/* OTR Express Referrals — single stylesheet.
   Light theme matching the OTR Express Group brand: deep navy + bright
   blue on a clean white background. Mobile-first; uses min-width media
   queries to scale up. */

:root {
  --navy:        #0e1a3a;
  --navy-dark:   #060d1f;
  --navy-soft:   #1e2a4a;
  --blue:        #2563eb;
  --blue-dark:   #1d4ed8;
  --blue-light:  #3b82f6;
  --blue-faint:  #dbeafe;

  --bg:          #ffffff;
  --bg-soft:     #f8fafc;
  --bg-mid:      #f1f5f9;
  --bg-dark:     #0e1a3a;

  --line:        #e2e8f0;
  --line-strong: #cbd5e1;

  --text:        #0f172a;
  --text-mid:    #334155;
  --text-faint:  #64748b;
  --text-dim:    #94a3b8;
  --text-on-dark: #e2e8f0;

  --rose:        #e11d48;
  --rose-bg:     #fee2e2;
  --rose-text:   #9f1239;
  --emerald:     #059669;
  --emerald-bg:  #d1fae5;
  --amber:       #d97706;
  --amber-bg:    #fef3c7;

  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 1px 3px rgba(15,23,42,0.05), 0 6px 24px -8px rgba(15,23,42,0.08);
  --shadow-lg:   0 10px 40px -12px rgba(15,23,42,0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  font-size: 16px;
}

img, svg { max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  color: var(--navy);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 0.8em; }

code {
  background: var(--bg-mid);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  color: var(--blue-dark);
}

.site { display: flex; flex-direction: column; min-height: 100vh; }
.main { flex: 1; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 700px) { .wrap { padding: 0 1.75rem; } }

.section { padding: 3rem 0; }
@media (min-width: 700px) { .section { padding: 4rem 0; } }
.section-band { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.center { text-align: center; }
.narrow { max-width: 640px; }
.narrow-col { max-width: 460px; margin: 0 auto; }

/* ========== Navigation ========== */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  gap: 1rem;
}
@media (min-width: 700px) { .nav-inner { padding: 1rem 1.75rem; } }

.brand { display: inline-flex; align-items: center; line-height: 1; }
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.brand-otr {
  color: var(--navy);
  font-size: 1.4rem;
  line-height: 1;
}
.brand-group {
  color: var(--blue);
  font-size: 0.95rem;
  line-height: 1;
}
@media (min-width: 700px) {
  .brand-otr { font-size: 1.7rem; }
  .brand-group { font-size: 1.05rem; }
}

.nav-links { display: none; align-items: center; gap: 0.25rem; }
@media (min-width: 760px) { .nav-links { display: flex; } }
.nav-links a {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
}
.nav-links a:hover { color: var(--blue); }
.nav-links a.active { color: var(--blue); }

.nav-cta {
  display: inline-flex;
  padding: 0.55rem 1rem !important;
  background: var(--blue);
  color: #fff !important;
  border-radius: 6px;
  font-weight: 700;
}
.nav-cta:hover { background: var(--blue-dark); color: #fff !important; }

/* Mobile nav menu (collapses to hamburger via CSS-only details/summary) */
.nav-mobile { display: block; position: relative; }
@media (min-width: 760px) { .nav-mobile { display: none; } }
.nav-mobile summary {
  list-style: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: inline-flex;
}
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile summary svg { width: 22px; height: 22px; color: var(--navy); }
.nav-mobile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.nav-mobile-menu a {
  padding: 0.65rem 0.85rem;
  color: var(--navy);
  font-weight: 600;
  border-radius: 6px;
}
.nav-mobile-menu a:hover { background: var(--bg-soft); color: var(--blue); }

/* ========== Footer ========== */
.footer {
  background: var(--navy);
  color: var(--text-on-dark);
  margin-top: 4rem;
}
.footer .brand-otr { color: #fff; }
.footer .brand-group { color: #93c5fd; }
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2.5rem 0;
}
.footer a { color: #93c5fd; }
.footer a:hover { color: #fff; }
.footer .hint { color: #94a3b8; font-size: 0.85rem; }
.footer-cols { display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 700px) {
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .footer-cols { flex-direction: row; gap: 3rem; }
}
.footer-col h4 {
  color: #fff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}
.footer-col a { display: block; padding: 0.2rem 0; font-size: 0.9rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.25rem 0;
  font-size: 0.82rem;
  color: #94a3b8;
}

/* ========== Hero ========== */
.hero {
  position: relative;
  padding: 3.5rem 0;
  background:
    radial-gradient(ellipse at top right, rgba(37,99,235,0.08), transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(14,26,58,0.05), transparent 60%),
    var(--bg);
  overflow: hidden;
}
@media (min-width: 760px) { .hero { padding: 5rem 0; } }
.hero-sm { padding: 2rem 0 1rem; }
.hero-grid { display: grid; gap: 2.5rem; }
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; align-items: center; } }
.hero-title { font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; }
.accent { color: var(--blue); }
.accent-navy { color: var(--navy); }

.eyebrow {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  background: var(--blue-faint);
  color: var(--blue-dark);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 1rem;
}
.lead { color: var(--text-mid); font-size: 1.05rem; max-width: 640px; }
@media (min-width: 700px) { .lead { font-size: 1.12rem; } }
.lead.narrow { max-width: 640px; }
.hint { color: var(--text-faint); font-size: 0.88rem; margin: 0.2rem 0; }
.hint.right { text-align: right; }

/* ========== Buttons ========== */
.btn-primary,
.btn-ghost,
.btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  font-family: inherit;
  text-align: center;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 14px -2px rgba(37,99,235,0.45);
}
.btn-primary:hover { background: var(--blue-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost.sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-text {
  background: transparent;
  color: var(--text-faint);
  border-color: var(--line);
  padding: 0.45rem 0.9rem;
  font-size: 0.78rem;
}
.btn-text:hover { border-color: var(--rose); color: var(--rose); }
.btn-danger {
  background: var(--rose);
  color: #fff;
  padding: 0.85rem 1.4rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
}
.full { width: 100%; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.cta-row.center { justify-content: center; }

/* ========== Cards ========== */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
@media (min-width: 700px) { .card { padding: 2rem; } }
.card.no-pad { padding: 0; overflow-x: auto; }
.card-brand {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #fff;
  border-color: transparent;
}
.card-brand h2, .card-brand h3 { color: #fff; }
.card-brand .eyebrow { background: rgba(59,130,246,0.25); color: #bfdbfe; }
.card-brand .hint { color: rgba(255,255,255,0.7); }
.card-brand p { color: rgba(255,255,255,0.9); }
.card-ok { border-color: var(--emerald); background: var(--emerald-bg); }
.card-ok h2, .card-ok h3 { color: #065f46; }

/* ========== Steps (How it works) ========== */
.steps { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: 1rem; }
.steps li { display: flex; gap: 1rem; }
.step-num {
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
}
.card-brand .step-num { background: #fff; color: var(--navy); }
.steps strong { display: block; color: inherit; font-weight: 700; margin-bottom: 0.15rem; }
.steps p { margin: 0; font-size: 0.92rem; }
.card-brand .steps p { color: rgba(255,255,255,0.85); }

/* ========== Stage cards grid ========== */
.grid-3 { display: grid; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 700px)  { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px)  { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { display: grid; gap: 1.5rem; }
@media (min-width: 880px)  { .grid-2 { grid-template-columns: 1fr 1fr; gap: 2rem; } }
.stage-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}
.stage-title { color: var(--navy); font-size: 0.9rem; font-weight: 700; margin: 0 0 0.3rem; }
.stage-desc  { color: var(--text-faint); font-size: 0.88rem; margin: 0; }

/* ========== Rules list ========== */
.rules { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: 0.6rem; }
.rules li {
  color: var(--text-mid);
  font-size: 0.95rem;
  padding-left: 1.7rem;
  position: relative;
}
.rules li::before {
  content: "✓";
  color: var(--blue);
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 800;
}

/* ========== Section heads ========== */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 780px) {
  .section-head {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
  }
}
.section-head.single { flex-direction: column; align-items: flex-start; }

/* ========== Forms ========== */
.form-stack { display: flex; flex-direction: column; gap: 1.25rem; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }
@media (min-width: 620px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field-wide { grid-column: 1 / -1; }
.field-label {
  font-size: 0.78rem;
  color: var(--navy);
  font-weight: 600;
}
.field-input,
.field-textarea,
select.field-input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
}
.field-input:focus, .field-textarea:focus, select.field-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.18);
}
.field-textarea { min-height: 120px; resize: vertical; }
.field-input::placeholder { color: var(--text-dim); }

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.form-actions.between { justify-content: space-between; }
.form-actions.right { justify-content: flex-end; }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
  line-height: 1.45;
}
.checkbox input { width: 1.05rem; height: 1.05rem; margin-top: 0.15rem; accent-color: var(--blue); flex: 0 0 auto; }

.lookup-form {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  align-items: end;
}
@media (min-width: 780px) {
  .lookup-form { grid-template-columns: 1fr 1fr auto; }
}

.consent-block {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.consent-block .checkbox + .checkbox { padding-top: 0.5rem; border-top: 1px dashed var(--line); }

/* ========== Alerts ========== */
.alert {
  padding: 0.9rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
}
.alert ul { margin: 0; padding-left: 1.2rem; }
.alert-error  { border-color: var(--rose); background: var(--rose-bg); color: var(--rose-text); }
.alert-ok     { border-color: var(--emerald); background: var(--emerald-bg); color: #065f46; }
.alert-reject { border-color: var(--rose); background: var(--rose-bg); color: var(--rose-text); margin: 1rem 0 0; }
.alert-title  { font-weight: 700; margin-bottom: 0.2rem; }

/* ========== Status chips ========== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid;
}
.chip .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.status-sky      { color: #0369a1; background: #e0f2fe; border-color: #bae6fd; }
.status-indigo   { color: #4338ca; background: #e0e7ff; border-color: #c7d2fe; }
.status-violet   { color: #6d28d9; background: #ede9fe; border-color: #ddd6fe; }
.status-amber    { color: #b45309; background: var(--amber-bg); border-color: #fde68a; }
.status-cyan     { color: #0e7490; background: #cffafe; border-color: #a5f3fc; }
.status-emerald  { color: #047857; background: var(--emerald-bg); border-color: #a7f3d0; }
.status-emerald-strong { color: #065f46; background: #a7f3d0; border-color: #6ee7b7; }
.status-brand    { color: #fff; background: var(--blue); border-color: var(--blue-dark); }
.status-rose     { color: var(--rose-text); background: var(--rose-bg); border-color: #fecaca; }
.status-slate    { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }

/* ========== Ref cards / sections ========== */
.ref-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (min-width: 780px) {
  .ref-head { flex-direction: row; justify-content: space-between; align-items: flex-start; }
}
.ref-head-right { display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-start; }
@media (min-width: 780px) { .ref-head-right { align-items: flex-end; } }
.stack > * + * { margin-top: 1.25rem; }

/* ========== Two col ========== */
.two-col {
  display: grid;
  gap: 2rem;
  margin-top: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 820px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ========== Stats row ========== */
.stats-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
  padding: 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 1rem;
}
@media (min-width: 620px) { .stats-row { grid-template-columns: repeat(3, 1fr); } }
.stats-row > div { display: flex; flex-direction: column; }
.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

/* ========== Timeline ========== */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.5rem;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.3rem;
  bottom: 0.3rem;
  width: 1px;
  background: var(--line-strong);
}
.timeline li {
  position: relative;
  padding-bottom: 1.1rem;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -1.6rem;
  top: 0.3rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  box-shadow: 0 0 0 3px var(--bg);
  background: var(--line-strong);
}
.dot-done    { background: var(--emerald); }
.dot-brand   { background: var(--blue); }
.dot-pending { background: var(--line-strong); }
.dot-reject  { background: var(--rose); }
.timeline div { display: flex; flex-direction: column; }
.timeline-meta { color: var(--text-faint); font-size: 0.78rem; margin-top: 0.1rem; }
.text-strong { color: var(--navy); font-weight: 700; font-size: 0.9rem; }
.text-faint  { color: var(--text-dim); font-weight: 600; font-size: 0.9rem; }
.text-reject { color: var(--rose); font-weight: 700; font-size: 0.9rem; }

/* ========== Comments ========== */
.comments { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.comments li {
  padding: 0.9rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.comments li p { margin: 0.25rem 0 0; color: var(--text); white-space: pre-wrap; }
.comment-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-faint);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.comment-meta .ok    { color: var(--emerald); font-weight: 600; }
.comment-meta .muted { color: var(--text-dim); }

/* ========== Admin bar ========== */
.admin-bar {
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--blue);
}
.admin-bar a { color: #fff; }
.admin-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
@media (min-width: 700px) { .admin-bar-inner { padding: 0.85rem 1.75rem; } }
.admin-bar-left  { display: flex; align-items: center; gap: 0.85rem; }
.admin-bar-right { display: flex; align-items: center; gap: 0.75rem; }
.admin-chip {
  padding: 0.25rem 0.85rem;
  background: var(--blue);
  color: #fff;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.admin-nav { display: flex; gap: 0.25rem; }
.admin-nav a {
  color: rgba(255,255,255,0.8);
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 4px;
}
.admin-nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.admin-email { color: rgba(255,255,255,0.7); font-size: 0.82rem; }
@media (max-width: 680px) { .admin-email { display: none; } }
.admin .btn-text {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.25);
}
.admin .btn-text:hover { color: #fff; border-color: #fff; background: rgba(255,255,255,0.08); }

/* ========== Admin stat cards ========== */
.stat-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
  margin: 1.25rem 0 1.75rem;
}
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(5, 1fr); } }
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow);
}
.stat-card p {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.stat-card strong { display: block; font-size: 1.7rem; color: var(--navy); margin-top: 0.25rem; }
.stat-card.accent {
  border-color: var(--blue);
  background: var(--blue-faint);
}
.stat-card.accent strong { color: var(--blue-dark); }

/* ========== Tables ========== */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table thead th {
  text-align: left;
  padding: 0.85rem 1rem;
  background: var(--bg-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
}
.table tbody td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table tbody tr:hover { background: var(--bg-soft); }
.table tbody td p { margin: 0; }
.table .strong { color: var(--navy); font-weight: 700; }
.table .right  { text-align: right; }
.table .empty  { text-align: center; color: var(--text-dim); padding: 2.5rem 1rem; }

.filter-form {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr;
  width: 100%;
}
@media (min-width: 700px) {
  .filter-form { grid-template-columns: 1fr auto auto; max-width: 600px; }
}

/* ========== Detail layout ========== */
.detail-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .detail-grid { grid-template-columns: 320px 1fr; align-items: start; gap: 1.75rem; }
}
.kv { margin: 0.5rem 0 0; display: flex; flex-direction: column; gap: 0.55rem; padding: 0; list-style: none; }
.kv > div, .kv > li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}
.kv dt, .kv span:first-child {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 0.85rem;
}
.kv dd, .kv strong {
  color: var(--navy);
  text-align: right;
  margin: 0;
  word-break: break-word;
  font-weight: 600;
}
.hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
.mt { margin-top: 1rem; }

.back-link {
  display: inline-block;
  color: var(--text-faint);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.back-link:hover { color: var(--blue); }

/* ========== Terms page ========== */
.legal { max-width: 820px; margin: 0 auto; }
.legal h2 { margin-top: 2rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
.legal h3 { margin-top: 1.5rem; }
.legal p, .legal li { color: var(--text-mid); }
.legal ul, .legal ol { padding-left: 1.4rem; }
.legal li { margin-bottom: 0.4rem; }
.toc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; }
.toc ol { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.toc a { color: var(--navy); }
.toc a:hover { color: var(--blue); }

/* ========== Thanks page ========== */
.thanks {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 1.25rem 5rem;
}
.thanks .eyebrow { margin: 0 auto 1rem; }
.thanks h1 { margin: 0 auto 1rem; }
.thanks .lead {
  margin: 0 auto 1.5rem;
  max-width: 560px;
}
.thanks .cta-row {
  margin-top: 0;
  justify-content: center;
}
.thanks .cta-row a { min-width: 200px; }
@media (max-width: 520px) {
  .thanks { padding: 3rem 1rem 4rem; }
  .thanks .cta-row {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }
  .thanks .cta-row a { width: 100%; min-width: 0; }
}

/* ========== Mobile polish ========== */
@media (max-width: 600px) {
  .ref-head h2 { font-size: 1.25rem; }
  .timeline-meta { word-break: break-word; }
  .stat-grid { gap: 0.5rem; }
  .stat-card { padding: 0.75rem 0.85rem; }
  .stat-card strong { font-size: 1.4rem; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    background: #fff;
  }
  .table tbody td {
    padding: 0.6rem 1rem;
    border-bottom: 1px dashed var(--line);
  }
  .table tbody td:last-child { border-bottom: 0; }
  .table .right { text-align: left; }
  .table .empty { padding: 1.5rem 1rem; }
  .form-actions.between { flex-direction: column; align-items: stretch; }
  .form-actions.between .btn-primary { width: 100%; }
  .cta-row .btn-primary, .cta-row .btn-ghost { flex: 1 1 auto; }
}

/* ========== Driver share-consent card (admin) ========== */
.consent-card {
  border-left: 4px solid var(--blue);
  background: var(--blue-faint);
}
.consent-card .hint { color: var(--text-mid); }
.consent-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.25rem;
}
@media (min-width: 700px) {
  .consent-head { flex-direction: row; justify-content: space-between; align-items: flex-start; }
}
.consent-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-mid);
  font-weight: 600;
}
.radio-pill input { accent-color: var(--blue); }
.radio-pill:hover { border-color: var(--blue); color: var(--blue); }
.radio-pill.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue-dark);
}
.radio-pill.active span { color: #fff; }

.consent-pending { color: var(--amber); background: var(--amber-bg); border-color: #fde68a; }
.consent-yes     { color: #047857; background: var(--emerald-bg); border-color: #a7f3d0; }
.consent-no      { color: var(--rose-text); background: var(--rose-bg); border-color: #fecaca; }

/* ========== Inline delete buttons in comment meta ========== */
.comment-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.inline-form { display: inline; margin: 0; padding: 0; }
.btn-link-danger {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--rose);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
}
.btn-link-danger:hover { color: var(--rose-text); }

/* ========== Disclosure block ========== */
.disclosure {
  border: 1px solid var(--blue-faint);
  background: var(--blue-faint);
  color: var(--navy);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin: 0.75rem 0 1rem;
}
.disclosure-title {
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--navy);
  font-size: 0.92rem;
}
.disclosure p { margin: 0; font-size: 0.88rem; line-height: 1.55; color: var(--text-mid); }

.timeline-section { margin-top: 1.5rem; }
.timeline-section .eyebrow { margin-bottom: 1rem; }

/* ========== Misc ========== */
.right-align { text-align: right; }
.muted { color: var(--text-faint); }
.no-margin { margin: 0; }
