:root {
  --blue: #0040b8;
  --blue-deep: #07399d;
  --blue-dark: #08264f;
  --blue-soft: #eaf2ff;
  --blue-pale: #f3f7ff;
  --ink: #12253d;
  --muted: #53677f;
  --line: #d8e5fa;
  --white: #fff;
  --danger: #b42318;
  --success: #087443;
  --shadow: 0 18px 44px rgba(21, 55, 111, .12);
  --radius: 24px;
  font-family: "Avenir Next", Avenir, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef5ff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: #eef5ff; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #f9c846; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.boot { min-height: 100vh; display: grid; place-items: center; background: var(--blue); color: #fff; padding: 24px; }
.boot-content { display: grid; justify-items: center; gap: 18px; max-width: 360px; text-align: center; }
.boot-content p { margin: 0; line-height: 1.55; }
.boot-retry { min-height: 48px; padding: 0 22px; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; background: #fff; color: var(--blue); font: inherit; font-weight: 800; cursor: pointer; }
.brand-mark { display: block; width: 76px; height: auto; }
.boot .brand-mark { width: 112px; }
.brand-link { display: inline-flex; align-items: center; text-decoration: none; }
.topbar, .admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.language-toggle, .topbar-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  color: var(--white);
  background: rgba(255,255,255,.1);
  font-weight: 750;
}

.hero-shell {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(145deg, #0040b8 0%, #0a4cc7 55%, #06379f 100%);
  border-radius: 0 0 42px 42px;
}
.topbar { position: relative; z-index: 5; width: min(100% - 36px, 1080px); margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) 0 16px; }
.hero-content { position: relative; z-index: 3; width: min(100% - 36px, 1080px); margin: 38px auto 0; padding-bottom: 110px; }
.eyebrow { margin: 0 0 14px; color: #cfe0ff; font-size: .77rem; line-height: 1.2; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.hero-content h1 { max-width: 680px; margin: 0; font-size: clamp(2.2rem, 9vw, 4.6rem); line-height: .98; letter-spacing: -.055em; }
.hero-description { max-width: 610px; margin: 20px 0 0; color: #e7efff; font-size: clamp(1rem, 4vw, 1.35rem); line-height: 1.5; }
.hero-orbit { position: absolute; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; }
.orbit-one { width: 370px; height: 370px; right: -145px; top: 78px; }
.orbit-two { width: 250px; height: 250px; right: -85px; top: 138px; }
.hero-symbol { position: absolute; right: 16px; bottom: 22px; width: 145px; height: 118px; opacity: .92; }
.delivery-bag { position: absolute; right: 2px; bottom: 0; width: 92px; height: 78px; border: 4px solid rgba(255,255,255,.72); border-radius: 18px; background: rgba(255,255,255,.09); }
.delivery-bag::before { content: ""; position: absolute; width: 42px; height: 18px; left: 21px; top: -18px; border: 4px solid rgba(255,255,255,.72); border-bottom: 0; border-radius: 12px 12px 0 0; }
.cup { position: absolute; bottom: 0; width: 42px; height: 62px; border: 3px solid #fff; border-radius: 6px 6px 14px 14px; background: rgba(255,255,255,.16); transform: rotate(-5deg); }
.cup::before { content: ""; position: absolute; left: 5px; right: 5px; top: -9px; border-top: 3px solid #fff; }
.cup-left { left: 5px; }
.cup-right { left: 42px; height: 68px; transform: rotate(6deg); }

.public-main { width: min(100% - 24px, 1080px); margin: -52px auto 0; padding: 0 0 calc(50px + env(safe-area-inset-bottom)); position: relative; z-index: 4; }
.service-grid { display: grid; gap: 16px; }
.service-card { position: relative; overflow: hidden; min-height: 228px; padding: 25px 24px 22px; border-radius: var(--radius); box-shadow: var(--shadow); }
.service-card::after { content: ""; position: absolute; width: 190px; height: 190px; right: -88px; top: -100px; border-radius: 50%; background: rgba(70,126,222,.08); }
.app-card { background: var(--white); border: 1px solid var(--line); }
.express-card { color: var(--white); background: linear-gradient(145deg, #083ba6, #0040b8); }
.express-card::after { background: rgba(255,255,255,.08); }
.service-name { margin: 0 0 14px; color: var(--blue); font-size: .82rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.express-card .service-name { color: #bfd4ff; }
.service-price { margin: 0; font-size: clamp(1.75rem, 8vw, 3.4rem); line-height: 1; font-weight: 900; letter-spacing: -.045em; }
.app-card .service-price { color: var(--blue); }
.service-summary { position: relative; z-index: 1; margin: 15px 0 76px; color: #41536b; font-size: 1.04rem; line-height: 1.48; font-weight: 600; }
.express-card .service-summary { color: #e4edff; }
.delivery-line { position: absolute; left: 18px; right: 18px; bottom: 18px; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 16px; background: #edf4ff; font-size: .88rem; line-height: 1.35; font-weight: 750; }
.express-card .delivery-line { background: rgba(255,255,255,.12); }
.clock-icon { position: relative; flex: 0 0 28px; width: 28px; height: 28px; border: 3px solid currentColor; border-radius: 50%; }
.clock-icon::before { content: ""; position: absolute; left: 11px; top: 4px; width: 3px; height: 9px; border-radius: 2px; background: currentColor; }
.clock-icon::after { content: ""; position: absolute; left: 11px; top: 11px; width: 7px; height: 3px; border-radius: 2px; background: currentColor; }
.fee-note { margin: 18px 8px 28px; color: var(--muted); font-size: .8rem; line-height: 1.55; }

.form-card, .result-card, .contact-strip, .login-card, .filters-card, .list-card {
  border: 1px solid rgba(216,229,250,.9);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}
.form-card { padding: 25px 20px; }
fieldset { display: grid; gap: 17px; margin: 0; padding: 0; border: 0; }
.field { min-width: 0; }
.field label, .card-label { display: block; margin: 0 0 8px; color: var(--ink); font-size: .88rem; font-weight: 750; }
input, select, textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid #c7d7ef;
  border-radius: 13px;
  color: var(--ink);
  background: #fbfdff;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,64,184,.1); outline: none; }
[aria-invalid="true"] { border-color: var(--danger); }
.field-error { min-height: 18px; margin: 5px 2px 0; color: var(--danger); font-size: .77rem; line-height: 1.35; }
.consent-field { margin-top: 3px; padding: 16px; border-radius: 16px; background: var(--blue-pale); }
.check-label { display: grid !important; grid-template-columns: 22px 1fr; align-items: start; gap: 11px; margin: 0 !important; font-weight: 600 !important; line-height: 1.45; }
.check-label input { width: 22px; min-height: 22px; margin: 0; accent-color: var(--blue); }
.data-notice { margin: 10px 0 0 33px; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.primary-button, .secondary-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 800;
  text-decoration: none;
}
.primary-button { width: 100%; margin-top: 18px; border: 1px solid var(--blue); color: var(--white); background: var(--blue); box-shadow: 0 12px 24px rgba(0,64,184,.18); }
.primary-button:hover { background: var(--blue-deep); }
.secondary-button { border: 1px solid #b8cbea; color: var(--blue); background: var(--white); }
.secondary-button:hover { background: var(--blue-pale); }
.compact-button { width: auto; min-height: 44px; margin-top: 0; padding: 0 15px; }
.inline-alert { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; color: #8a321f; background: #fff1ed; font-size: .84rem; line-height: 1.45; }
.inline-alert[data-message-type="success"] { color: #075e37; background: #e9f8f0; }
.result-card { padding: 35px 24px; text-align: center; }
.result-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; color: var(--white); background: var(--blue); font-size: 1.55rem; font-weight: 900; }
.result-card h2 { margin: 0; font-size: 1.55rem; }
.result-card > p { max-width: 650px; margin: 13px auto 0; color: var(--muted); line-height: 1.55; }
.result-detail { padding: 13px 14px; border-radius: 12px; background: var(--blue-pale); }
.result-actions { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 22px auto 0; }
.result-actions .primary-button { margin-top: 0; }
.contact-strip { margin-top: 18px; padding: 20px; }
.contact-strip > p { margin: 0; color: var(--muted); line-height: 1.55; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 15px; }
.contact-button { min-height: 46px; }
.text-link { color: var(--blue); font-weight: 750; overflow-wrap: anywhere; }

/* Admin */
.admin-page { background: #f4f7fb; }
.admin-topbar { min-height: 68px; padding: calc(12px + env(safe-area-inset-top)) max(18px, calc((100vw - 1320px)/2)) 12px; color: var(--white); background: var(--blue); }
.admin-topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.current-user { display: none; color: #dce9ff; font-size: .86rem; font-weight: 700; }
.admin-main { width: min(100% - 24px, 1320px); margin: 24px auto 50px; }
.login-card { max-width: 440px; margin: 8vh auto 0; padding: 28px 22px; }
.login-card h1 { margin: 0 0 22px; font-size: 1.65rem; }
.login-card form { display: grid; gap: 15px; }
.admin-heading { display: flex; flex-direction: column; gap: 18px; margin-bottom: 20px; }
.admin-heading h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.65rem); letter-spacing: -.035em; }
.blue-eyebrow { color: var(--blue); }
.admin-heading-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.filters-card { display: grid; gap: 12px; padding: 16px; }
.filters-card .field label:not(.sr-only) { font-size: .75rem; }
.filter-actions { display: flex; gap: 10px; align-items: end; }
.list-card { margin-top: 16px; overflow: hidden; }
.list-status { min-height: 20px; margin: 0; padding: 14px 16px 0; color: var(--muted); font-size: .84rem; }
.table-scroll-hint { margin: 0; padding: 7px 16px 9px; color: var(--blue); font-size: .78rem; font-weight: 750; }
.table-wrap { overflow-x: auto; overscroll-behavior-inline: contain; padding-bottom: 6px; scrollbar-color: #7699d7 #e7eef9; scrollbar-width: auto; }
.table-wrap::-webkit-scrollbar { height: 10px; }
.table-wrap::-webkit-scrollbar-track { background: #e7eef9; border-radius: 999px; }
.table-wrap::-webkit-scrollbar-thumb { background: #7699d7; border: 2px solid #e7eef9; border-radius: 999px; }
.intent-table { width: 100%; min-width: 1060px; border-collapse: collapse; }
.intent-table th { padding: 12px 14px; color: var(--muted); background: #f8fbff; border-bottom: 1px solid var(--line); font-size: .72rem; text-align: left; text-transform: uppercase; letter-spacing: .045em; }
.intent-table td { padding: 14px; border-bottom: 1px solid #e8eef8; font-size: .84rem; vertical-align: top; }
.intent-table tbody tr:hover { background: #f8fbff; }
.row-link { padding: 0; border: 0; color: var(--blue); background: none; font-weight: 800; text-align: left; }
.status-cell { font-weight: 750; }
.status-partnered { color: var(--success); }
.status-not_interested { color: var(--muted); }
.pager { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; color: var(--muted); font-size: .82rem; }

.detail-open { overflow: hidden; }
.detail-panel { position: fixed; inset: 0; z-index: 30; }
.detail-backdrop { position: absolute; inset: 0; background: rgba(5,21,48,.56); }
.detail-sheet { position: absolute; inset: 0; overflow-y: auto; padding: calc(18px + env(safe-area-inset-top)) 18px calc(36px + env(safe-area-inset-bottom)); background: #f6f9fe; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.detail-header h2 { margin: 4px 0 0; font-size: 1.6rem; }
.detail-kicker { margin: 0; color: var(--muted); font-size: .78rem; }
.icon-button { width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--white); font-size: 1.6rem; }
.detail-loading { padding: 28px 0; color: var(--muted); }
.detail-data { display: grid; grid-template-columns: 1fr; gap: 1px; overflow: hidden; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--line); }
.detail-data > div { min-width: 0; padding: 14px; background: var(--white); }
.detail-data dt { color: var(--muted); font-size: .73rem; font-weight: 750; }
.detail-data dd { margin: 6px 0 0; line-height: 1.45; overflow-wrap: anywhere; }
.detail-data a { color: var(--blue); }
.follow-up-card, .notification-card, .notes-card { margin-top: 16px; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.follow-up-card { display: grid; gap: 14px; }
.notification-card { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.notification-card p { margin: 0; }
.notification-status { color: var(--blue); font-weight: 850; }
.notification-note { margin-top: 6px !important; color: var(--muted); font-size: .77rem; line-height: 1.45; }
.notes-card h3 { margin: 0 0 15px; }
.note-history { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.note-history li { padding: 13px; border-radius: 13px; background: var(--blue-pale); }
.note-history p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-meta { margin-top: 8px !important; color: var(--muted); font-size: .72rem; }
.empty-note { color: var(--muted); }
.immutable-note { margin: 12px 0 0; color: var(--muted); font-size: .74rem; line-height: 1.45; }

@media (min-width: 680px) {
  .hero-shell { min-height: 440px; }
  .hero-content { margin-top: 60px; padding-bottom: 120px; }
  .hero-symbol { right: 8%; width: 190px; transform: scale(1.18); }
  .public-main { margin-top: -64px; }
  .service-grid { grid-template-columns: 1fr 1fr; }
  .service-card { min-height: 290px; padding: 30px; }
  .service-summary { font-size: 1.12rem; }
  .form-card { padding: 34px; }
  fieldset { grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .full-field { grid-column: 1 / -1; }
  .result-actions { flex-direction: row; }
  .result-actions > * { flex: 1; }
  .current-user { display: inline; }
  .admin-heading { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .filters-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
  .filter-actions { grid-column: 1 / -1; }
  .detail-sheet { left: auto; width: min(720px, 92vw); padding: 26px 30px 44px; box-shadow: -20px 0 60px rgba(4,22,50,.22); }
  .detail-data { grid-template-columns: 1fr 1fr; }
  .detail-wide { grid-column: 1 / -1; }
  .follow-up-card { grid-template-columns: 1fr 1fr; }
  .notification-card { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (min-width: 980px) {
  .hero-symbol { right: 13%; bottom: 35px; transform: scale(1.4); }
  .filters-card { grid-template-columns: 2fr repeat(3, minmax(150px, 1fr)); }
  .filter-search { grid-column: auto; }
  .filter-actions { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
