:root {
  --night: #091019;
  --night-2: #101a25;
  --night-3: #16212d;
  --ink: #dbe4ea;
  --muted: #8fa1b1;
  --line: rgba(219, 228, 234, 0.12);
  --line-strong: rgba(219, 228, 234, 0.24);
  --gold: #cfb17a;
  --gold-soft: rgba(207, 177, 122, 0.14);
  --green: #1e4f43;
  --green-soft: rgba(30, 79, 67, 0.18);
  --red-soft: rgba(157, 66, 66, 0.18);
  --card: rgba(12, 20, 31, 0.7);
  --max: 1240px;
  --radius: 28px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(207, 177, 122, 0.12), transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(30, 79, 67, 0.18), transparent 24%),
    linear-gradient(180deg, #0a1018 0%, #0f1722 45%, #0b121a 100%);
  color: var(--ink);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 95%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.shell {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(8, 14, 22, 0.72);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 82px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.brand-lockup img {
  width: clamp(220px, 24vw, 320px);
  height: auto;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a.current {
  color: var(--gold);
}

.nav .nav-cta {
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(207, 177, 122, 0.35);
  background: var(--gold-soft);
  color: #f6ebd8;
}

.page-hero,
.hero-card,
.section-card,
.flowband,
.metric-card,
.paper-card,
.portal-card,
.closeout,
.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 25, 37, 0.9), rgba(10, 16, 24, 0.78));
  box-shadow: var(--shadow);
}

.page-hero {
  margin-top: 34px;
  padding: 32px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(207, 177, 122, 0.24);
  background: rgba(207, 177, 122, 0.08);
  color: #f3e4c8;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before,
.eyebrow .dot {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(207, 177, 122, 0.8);
}

.globe-wrap {
  margin-top: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(12, 20, 31, 0.85), rgba(8, 14, 22, 0.95));
  box-shadow: var(--shadow);
  overflow: hidden;
}

#globe {
  width: 100%;
  height: 520px;
  background: #0a1018;
}

#globe .cesium-widget,
#globe .cesium-widget canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.cesium-widget-credits,
.cesium-viewer-bottom {
  display: none !important;
}

.globe-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 520px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

.globe-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.globe-caption .globe-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(207, 177, 122, 0.8);
  margin-right: 10px;
  vertical-align: middle;
}

.globe-hint {
  color: rgba(143, 161, 177, 0.7);
}

@media (max-width: 720px) {
  #globe { height: 380px; }
  .globe-caption { flex-direction: column; gap: 6px; align-items: flex-start; }
}

.case-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 25, 37, 0.9), rgba(10, 16, 24, 0.78));
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.case-card:hover {
  border-color: rgba(207, 177, 122, 0.35);
  transform: translateY(-2px);
}

.case-card .case-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(207, 177, 122, 0.3);
  background: rgba(207, 177, 122, 0.08);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}

.case-card h3 {
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
}

.case-card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  font-size: 14px;
}

.case-services {
  list-style: none;
  padding: 0;
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-services li {
  font-size: 12px;
  color: rgba(243, 228, 200, 0.82);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  letter-spacing: 0.02em;
}

.eyebrow .dot {
  display: inline-block;
  flex: 0 0 auto;
}

h1,
h2,
h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  letter-spacing: -0.04em;
  margin: 0;
}

h1 {
  margin-top: 20px;
  font-size: clamp(52px, 8vw, 94px);
  line-height: 0.92;
}

h2 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 0.98;
}

h3 {
  font-size: 28px;
  line-height: 1.02;
}

.lede {
  margin-top: 22px;
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(19px, 2.2vw, 27px);
  line-height: 1.55;
}

.lede strong,
.lede span {
  color: var(--gold);
}

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button {
  min-height: 54px;
  padding: 0 22px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 220ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  border: 1px solid rgba(207, 177, 122, 0.4);
  background: linear-gradient(180deg, rgba(207, 177, 122, 0.22), rgba(207, 177, 122, 0.12));
  color: #f6ebd8;
}

.button-secondary {
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.03);
  color: var(--ink);
}

.section {
  padding: 28px 0 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.section-kicker {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-head p {
  max-width: 480px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
  margin: 0;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero-metrics {
  margin-top: 28px;
}

.metric-card {
  padding: 20px 18px;
}

.metric-card strong {
  display: block;
  font-size: clamp(24px, 3vw, 34px);
}

.metric-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-card,
.hero-card,
.portal-card,
.paper-card,
.form-card {
  padding: 24px;
}

.section-card p,
.hero-card p,
.portal-card p,
.paper-card p,
.form-card p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 12px;
}

.list li {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  line-height: 1.6;
}

.list li strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  color: var(--ink);
}

.service-price {
  color: var(--gold);
}

.flowband {
  padding: 24px;
}

.flowband p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 12px;
}

.steps li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  line-height: 1.6;
}

.steps b {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 13px;
}

.mapbox {
  position: relative;
  min-height: 420px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 25% 30%, rgba(207, 177, 122, 0.18), transparent 18%),
    radial-gradient(circle at 70% 70%, rgba(30, 79, 67, 0.28), transparent 22%),
    linear-gradient(180deg, #0a1118, #111b26);
}

.mapbox::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(219, 228, 234, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(219, 228, 234, 0.08) 1px, transparent 1px);
  background-size: 72px 72px;
}

.parcel,
.route,
.node {
  position: absolute;
}

.parcel {
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
}

.p1 { inset: 18% auto auto 12%; width: 170px; height: 110px; transform: rotate(-8deg); }
.p2 { inset: 44% auto auto 36%; width: 210px; height: 140px; transform: rotate(7deg); }
.p3 { inset: 24% 14% auto auto; width: 160px; height: 160px; transform: rotate(12deg); }

.route {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform-origin: left center;
  box-shadow: 0 0 18px rgba(207, 177, 122, 0.4);
}

.r1 { left: 18%; top: 30%; width: 42%; transform: rotate(12deg); }
.r2 { left: 30%; top: 58%; width: 40%; transform: rotate(-24deg); }
.r3 { left: 60%; top: 34%; width: 20%; transform: rotate(82deg); }

.node {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 22px rgba(207, 177, 122, 0.8);
}

.n1 { left: 24%; top: 26%; }
.n2 { left: 58%; top: 38%; }
.n3 { left: 47%; top: 57%; }
.n4 { left: 76%; top: 29%; }

.map-overlay {
  position: absolute;
  inset: auto 18px 18px 18px;
  display: grid;
  gap: 10px;
}

.overlay-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(8, 14, 22, 0.84);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  font-size: 14px;
}

.overlay-card span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  display: block;
}

.overlay-card strong {
  font-size: 16px;
}

.statline {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.statline .item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
}

.statline .item strong {
  display: block;
  margin-bottom: 4px;
}

.paper-card em {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f3e4c8;
  background: rgba(207, 177, 122, 0.08);
  border: 1px solid rgba(207, 177, 122, 0.18);
}

.paper-card strong {
  display: block;
  margin-top: 16px;
  font-size: 22px;
  line-height: 1.18;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

/* The HTML `hidden` attribute would normally hide an element, but
   .field above sets display:grid which overrides it. Re-assert hidden.
   !important so nothing further down in the cascade can beat this. */
[hidden] {
  display: none !important;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

/* Elements placed directly inside a .form-grid span the full width. */
.form-grid > .checkline,
.form-grid > .actions,
.form-grid > .form-status {
  grid-column: 1 / -1;
}

.checkline {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  line-height: 1.6;
}

.closeout {
  margin: 28px 0 60px;
  padding: 30px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: end;
}

.footer {
  padding: 0 0 42px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 1080px) {
  .grid-4,
  .grid-3,
  .grid-2,
  .closeout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(calc(100% - 28px), var(--max));
  }

  .topbar-inner {
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup img {
    width: min(320px, 72vw);
  }

  .nav {
    gap: 12px 16px;
    justify-content: flex-start;
  }

  .page-hero,
  .hero-card,
  .section-card,
  .flowband,
  .metric-card,
  .paper-card,
  .portal-card,
  .closeout,
  .form-card {
    padding: 22px;
    border-radius: 24px;
  }
}

/* --- Supabase wiring: form status, auth chrome, tracker cards --- */

.muted {
  color: var(--muted);
}

.form-status {
  margin-top: 10px;
  min-height: 1.4em;
  font-size: 14px;
  color: var(--muted);
}
.form-status[data-tone="error"] { color: #ff7a7a; }
.form-status[data-tone="success"] { color: #7ae0a8; }
.form-status[data-tone="pending"] { color: var(--muted); font-style: italic; }

#session-state[data-mode="signedin"] {
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tracker-card { display: flex; flex-direction: column; gap: 12px; }
.tracker-card h3 { margin: 0; }
.tracker-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tracker-meta .ref {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.tracker-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  margin: 0;
  font-size: 14px;
}
.tracker-grid dt { color: var(--muted); }
.tracker-grid dd { margin: 0; }

.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: capitalize;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}
.chip-new { color: #e8eef4; border-color: rgba(125, 170, 255, 0.4); background: rgba(125, 170, 255, 0.08); }
.chip-in_progress, .chip-in-progress { color: #f2d58a; border-color: rgba(242, 213, 138, 0.4); background: rgba(242, 213, 138, 0.08); }
.chip-delivered { color: #7ae0a8; border-color: rgba(122, 224, 168, 0.4); background: rgba(122, 224, 168, 0.08); }
.chip-mandate_inquiry { color: #d6c8ff; border-color: rgba(214, 200, 255, 0.4); background: rgba(214, 200, 255, 0.08); }
.chip-cancelled { color: #ff9a9a; border-color: rgba(255, 154, 154, 0.4); background: rgba(255, 154, 154, 0.08); }

/* --- Services-page "The Split Matters" editorial layout --- */

.split-statement {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.split-headline {
  margin: 0;
  text-align: center;
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
}
.split-headline::before,
.split-headline::after {
  content: "—";
  display: inline-block;
  margin: 0 14px;
  color: var(--line-strong);
  letter-spacing: 0;
}

.split-line {
  margin: 0;
  max-width: 54ch;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
}
.split-line strong { color: var(--gold); }

.split-line-left  { align-self: flex-start; text-align: left;  }
.split-line-right { align-self: flex-end;   text-align: right; }

@media (max-width: 720px) {
  .split-statement { gap: 24px; }
  .split-line { font-size: 16px; max-width: none; }
  .split-headline::before,
  .split-headline::after { margin: 0 8px; }
}

/* --- Clickable service cards --- */

.service-card-clickable {
  cursor: pointer;
  position: relative;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.service-card-clickable:hover,
.service-card-clickable:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
  outline: none;
}
.card-cta {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.card-cta::after {
  content: "→";
  transition: transform 0.14s ease;
}
.service-card-clickable:hover .card-cta::after,
.service-card-clickable:focus-visible .card-cta::after {
  transform: translateX(3px);
}

/* --- Modal (SKU details and similar) --- */

body.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative;
  background: linear-gradient(180deg, var(--night-2) 0%, var(--night-3) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 28px;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.modal-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}

.modal-close {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.14s ease, color 0.14s ease;
}
.modal-close:hover,
.modal-close:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
  outline: none;
}

.modal-hero { margin-bottom: 4px; }
.modal-hero h2 {
  margin: 0 0 4px;
  font-size: 26px;
  line-height: 1.2;
}
.modal-hero p { margin: 0; }

/* Description is the lead element in the modal. */
.modal-detail {
  margin: 20px 0 0;
  color: var(--ink);
  line-height: 1.6;
  font-size: 18px;
}

/* Quieter meta strip below the description: price | delivery | format. */
.modal-meta {
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}
.modal-meta-row {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--line);
}
.modal-meta-row:last-child { border-right: none; }
.modal-meta-row dt {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.modal-meta-row dd {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}
.modal-meta-row:first-child dd { color: var(--gold); font-weight: 600; }

@media (max-width: 560px) {
  .modal-meta {
    grid-template-columns: 1fr;
  }
  .modal-meta-row {
    border-right: none;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }
  .modal-meta-row:last-child { border-bottom: none; }
}

.modal-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .modal { padding: 12px; }
  .modal-panel { padding: 20px; border-radius: 20px; }
}

/* ============================================================
   Sand theme — applied per-page via <body class="theme-sand">
   ============================================================ */
body.theme-sand {
  background: #e8dcbd;
  color: #111;
}
body.theme-sand::before { display: none; }

body.theme-sand .topbar {
  background: rgba(232, 220, 189, 0.82);
  border-bottom: 1px solid rgba(17, 17, 17, 0.14);
}
body.theme-sand .brand img { filter: invert(1); }

body.theme-sand .nav a,
body.theme-sand .nav a.current { color: #111; }
body.theme-sand .nav a:hover { color: #000; }
body.theme-sand .nav-cta {
  color: #111;
  border: 1px solid rgba(17, 17, 17, 0.28);
  background: rgba(255, 255, 255, 0.35);
}
body.theme-sand .nav-cta:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(17, 17, 17, 0.45);
}

body.theme-sand h1,
body.theme-sand h2,
body.theme-sand h3,
body.theme-sand h4,
body.theme-sand h5,
body.theme-sand p,
body.theme-sand li,
body.theme-sand strong,
body.theme-sand .eyebrow,
body.theme-sand .section-kicker,
body.theme-sand .muted,
body.theme-sand .footer { color: #111; }

body.theme-sand .eyebrow { border-color: rgba(17, 17, 17, 0.2); }

body.theme-sand .section-card,
body.theme-sand .closeout {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(17, 17, 17, 0.14);
  box-shadow: 0 18px 48px rgba(120, 95, 55, 0.12);
  color: #111;
}
body.theme-sand .section-card:hover {
  border-color: rgba(17, 17, 17, 0.28);
}

body.theme-sand .split-statement { color: #111; }
body.theme-sand .split-headline { color: #111; }
body.theme-sand .split-line strong { color: #111; }

body.theme-sand .button-primary {
  background: #111;
  color: #e8dcbd;
  border-color: #111;
}
body.theme-sand .button-primary:hover { background: #000; }
body.theme-sand .button-secondary {
  color: #111;
  border-color: rgba(17, 17, 17, 0.35);
  background: transparent;
}
body.theme-sand .button-secondary:hover {
  background: rgba(17, 17, 17, 0.06);
  border-color: rgba(17, 17, 17, 0.55);
}

body.theme-sand .card-cta { color: #111; }

/* ============================================================
   Client portal — post-login per-client cards
   ============================================================ */
.client-cards {
  margin-top: 8px;
}

.portal-card.file-card,
.portal-card.mapping-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 320px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-head h3 {
  margin: 0;
}

.card-head .chip {
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(207, 177, 122, 0.35);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.file-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.file-row:hover {
  border-color: rgba(207, 177, 122, 0.35);
  background: rgba(207, 177, 122, 0.05);
}

.file-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.file-title {
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.file-desc {
  font-size: 14px;
  line-height: 1.4;
}

.file-meta {
  font-size: 12px;
  letter-spacing: 0.02em;
}

.file-open {
  padding: 6px 14px;
  font-size: 13px;
  flex-shrink: 0;
}

.file-empty {
  padding: 20px 0;
  font-size: 14px;
  list-style: none;
}

.mapping-card .mapping-action {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.mapping-card .mapping-action .button {
  align-self: stretch;
  text-align: center;
}

/* ---- Topbar when signed in: hide marketing nav, show sign-out ---- */
body.is-signed-in #main-nav { display: none !important; }

/* ---- Compact hero when signed in: h1 shrinks to h2 scale, lede is hidden ---- */
body.is-signed-in #hero-heading {
  font-size: clamp(34px, 4vw, 54px);
}
body.is-signed-in .page-hero {
  padding: 24px 32px;
}

.topbar-session {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-session .button {
  padding: 6px 14px;
  font-size: 13px;
}

/* ---- Rollup line under the card head ---- */
.card-rollup {
  font-size: 13px;
  letter-spacing: 0.02em;
  margin-top: -6px;
}

/* ---- Card body holds group heads, file lists, and tile grids ---- */
.card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.group-head {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 600;
  padding-top: 2px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.group-head .group-meta {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 400;
}

.group-empty {
  font-size: 14px;
  padding: 16px 0;
}

/* ---- Folder tile grid ---- */
.folder-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.folder-tile {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.folder-tile:hover {
  border-color: rgba(207, 177, 122, 0.35);
  background: rgba(207, 177, 122, 0.05);
}

.folder-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
  word-break: break-word;
}

.folder-count {
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* ---- Inline city chip on highlight rows ---- */
.chip-city {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border: 1px solid rgba(207, 177, 122, 0.35);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 500;
  vertical-align: middle;
}

@media (max-width: 720px) {
  .portal-card.file-card,
  .portal-card.mapping-card {
    min-height: 0;
  }
  .file-row {
    flex-direction: column;
    align-items: stretch;
  }
  .file-open {
    align-self: flex-start;
  }
  .folder-tiles {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

/* Solo sign-in card — no longer side-by-side with a fluff card */
.form-card-solo {
  max-width: 520px;
  margin: 0 auto;
}

/* Subtle text-style button for "Forgot password?" */
.button-link {
  min-height: 0;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  cursor: pointer;
}

.button-link:hover {
  color: var(--ink);
  transform: none;
  text-decoration: underline;
}

/* Inputs card — client-uploaded files */
.inputs-card {
  margin-top: 24px;
}
.inputs-card .inputs-hint {
  margin: 4px 0 16px;
  font-size: 15px;
}
.upload-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.upload-controls .form-status {
  font-size: 14px;
}
.upload-controls .form-status[data-tone="pending"] { color: var(--muted); }
.upload-controls .form-status[data-tone="success"] { color: #15803d; }
.upload-controls .form-status[data-tone="error"]   { color: #b91c1c; }

/* File row actions: Open + Remove live side by side */
.file-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.file-delete {
  color: #b91c1c;
}
.file-delete:hover {
  color: #7f1d1d;
}
.file-delete:disabled {
  opacity: 0.5;
  cursor: wait;
}
