/* NearSight design system — corporate trust: deep navy & charcoal, sky accent. Dark is the default;
   [data-theme="light"] swaps tokens. Every price token is nowrap + tabular. */
:root {
  --navy-900: #070f1f; --navy-800: #0b1a33; --navy-700: #12274d; --navy-600: #1b3566;
  --charcoal-900: #111418; --charcoal-800: #171b21; --charcoal-700: #22272f; --charcoal-600: #2e343d;
  --sky-400: #38bdf8; --sky-500: #0ea5e9; --blue-600: #2563eb; --blue-500: #3b82f6;
  --green-500: #22c55e; --amber-500: #f59e0b; --red-500: #ef4444;

  --bg: var(--navy-900);
  --bg-elev: var(--navy-800);
  --bg-card: #0f2142;
  --bg-card-2: var(--charcoal-800);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e6edf7;
  --text-muted: #a3b3ca;
  --text-faint: #8496b1;
  --accent: var(--sky-400);
  --accent-strong: var(--blue-600);
  --accent-text: #061225;
  --nav-bg: rgba(7, 15, 31, 0.86);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 16px; --radius-sm: 10px;
  --maxw: 1180px;
  --font: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f6fb; --bg-elev: #ffffff; --bg-card: #ffffff; --bg-card-2: #eef2f8;
  --border: rgba(15, 33, 66, 0.12); --text: #0b1a33; --text-muted: #3f5474; --text-faint: #56677f;
  --accent: var(--blue-600); --accent-strong: var(--blue-600); --accent-text: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.88); --shadow: 0 14px 40px rgba(11, 26, 51, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; min-height: 100vh; overflow-x: hidden; }
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::placeholder { color: var(--text-faint); opacity: 1; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Type scale */
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.12; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; }
h1.h1-sm { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 60ch; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: .9rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .6rem; }

/* Layout */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
section { padding: clamp(48px, 7vw, 96px) 0; }
.section-head { margin-bottom: clamp(24px, 3vw, 40px); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); background: var(--nav-bg); border-bottom: 1px solid var(--border); }
.nav .container { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand img { height: 36px; width: auto; }
.brand .brand-tag { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sky-400); margin-left: 6px; padding: 3px 8px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a, .nav-links button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; color: var(--text-muted); font-weight: 600; background: none; border: 0; cursor: pointer; }
.nav-links a:hover, .nav-links button:hover { color: var(--text); background: var(--bg-card-2); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--bg-card-2); }
.nav-toggle { display: none; margin-left: auto; min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: 10px; background: none; cursor: pointer; align-items: center; justify-content: center; }
.burger { display: inline-flex; flex-direction: column; gap: 4px; width: 20px; }
.burger i { display: block; height: 2px; background: var(--text); border-radius: 2px; }
.theme-btn { min-width: 44px; justify-content: center; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; align-items: stretch; padding: 12px; background: var(--bg-elev); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a, .nav-links button { min-height: 48px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; cursor: pointer; transition: transform .12s ease, background .15s ease, box-shadow .15s ease; text-decoration: none; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--sky-500), var(--blue-600)); color: #fff; box-shadow: 0 10px 30px rgba(37, 99, 235, .35); }
.btn-primary:hover { box-shadow: 0 14px 34px rgba(37, 99, 235, .45); }
.btn-secondary { background: var(--bg-card-2); color: var(--text); border-color: var(--border); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost.hero-ghost { color: #e6edf7; border-color: rgba(255,255,255,.3); }
.btn-danger { background: rgba(239, 68, 68, .12); color: #fca5a5; border-color: rgba(239, 68, 68, .35); }
[data-theme="light"] .btn-danger { color: #b91c1c; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .92rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(18px, 2.5vw, 28px); box-shadow: var(--shadow); }
.card-soft { background: var(--bg-card-2); box-shadow: none; }
.card h3 { margin-bottom: .35rem; }
.card-grid > .card { display: flex; flex-direction: column; height: 100%; }

/* Hero (CSS layer — no photographic layer: the licensed imagery does not depict this business) */
.hero { position: relative; overflow: hidden; padding: clamp(64px, 10vw, 128px) 0 clamp(48px, 7vw, 96px); background:
  radial-gradient(1200px 500px at 85% -10%, rgba(56, 189, 248, .22), transparent 60%),
  radial-gradient(800px 400px at -10% 110%, rgba(37, 99, 235, .25), transparent 60%),
  linear-gradient(180deg, var(--navy-800), var(--navy-900)); color: #e6edf7; }
[data-theme="light"] .hero { background:
  radial-gradient(1200px 500px at 85% -10%, rgba(56, 189, 248, .25), transparent 60%),
  radial-gradient(800px 400px at -10% 110%, rgba(37, 99, 235, .18), transparent 60%),
  linear-gradient(180deg, #0b1a33, #12274d); }
.hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%); pointer-events: none; }
.hero .container { position: relative; z-index: 1; display: grid; gap: 40px; grid-template-columns: 1.15fr .85fr; align-items: center; }
@media (max-width: 900px) { .hero .container { grid-template-columns: 1fr; } }
.hero h1 { color: #fff; }
.hero .lead { color: #bfcde2; }
.hero .eyebrow { color: var(--sky-400); }
.hero-panel { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 20px; padding: 24px; backdrop-filter: blur(8px); color: #e6edf7; }
.hero-panel-title { color: #fff; }
.hero-panel label, .hero-panel .help, .hero-panel .faint { color: #bfcde2; }
.hero-panel .input { background: rgba(7,15,31,.7); color: #fff; border-color: rgba(255,255,255,.18); }
.hero-panel .chip { background: rgba(255,255,255,.08); color: #e6edf7; border-color: rgba(255,255,255,.2); }
.hero-panel .chip.on { background: var(--sky-400); color: #061225; border-color: var(--sky-400); }
.hero-panel .btn-ghost { color: #e6edf7; border-color: rgba(255,255,255,.3); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.hero-stats .stat { border-left: 2px solid var(--sky-400); padding-left: 12px; }
.hero-stats .stat b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; }
.hero-stats .stat span { color: #bfcde2; font-size: .85rem; }

/* Forms */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--text-muted); }
.label-spacer { display: block; height: calc(1.43rem + 6px); }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--accent); }
.field { margin-bottom: 14px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; color: var(--text); }
.check input { width: 22px; height: 22px; accent-color: var(--accent-strong); }
.help { font-size: .85rem; color: var(--text-faint); margin-top: 6px; }
.notice { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card-2); font-size: .95rem; }
.notice-warn { border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .1); }
.notice-error { border-color: rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .1); }
.notice-ok { border-color: rgba(34, 197, 94, .45); background: rgba(34, 197, 94, .1); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card-2); color: var(--text); font-weight: 600; font-size: .9rem; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* Price + product cards */
.price { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -0.02em; }
.price-lg { font-size: 1.9rem; line-height: 1; }
.price-unit { font-size: .85rem; font-weight: 600; color: var(--text-muted); margin-left: 2px; white-space: nowrap; }
.product { display: flex; flex-direction: column; gap: 14px; height: 100%; position: relative; }
.product .product-head { display: grid; grid-template-columns: 1fr; gap: 6px; padding-right: 0; }
.product.recommended .product-head { padding-right: 120px; }
.product .product-title { font-size: 1.15rem; font-weight: 750; letter-spacing: -0.01em; }
.product .product-price { display: flex; align-items: baseline; gap: 2px; }
.product .speeds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.product .speed { background: var(--bg-card-2); border-radius: 10px; padding: 10px 12px; }
.product .speed b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.product .speed span { font-size: .75rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; }
.product .product-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.product.recommended { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(56,189,248,.25), var(--shadow); }
.ribbon { position: absolute; top: 14px; right: 14px; background: var(--accent); color: var(--accent-text); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }

/* Badges / status */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--border); background: var(--bg-card-2); color: var(--text-muted); white-space: nowrap; }
.badge-ok { color: #86efac; border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.12); }
.badge-warn { color: #fcd34d; border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.12); }
.badge-bad { color: #fca5a5; border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.12); }
.badge-info { color: var(--accent); border-color: rgba(56,189,248,.4); background: rgba(56,189,248,.12); }
[data-theme="light"] .badge-ok { color: #15803d; } [data-theme="light"] .badge-warn { color: #92400e; } [data-theme="light"] .badge-bad { color: #b91c1c; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-faint); display: inline-block; }
.dot.on { background: var(--green-500); box-shadow: 0 0 0 4px rgba(34,197,94,.2); }
.dot.off { background: var(--red-500); }

/* Steps */
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); counter-reset: step; }
.step { position: relative; padding: 22px 22px 22px 64px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 20px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--sky-500), var(--blue-600)); color: #fff; font-weight: 800; }

/* Tables (admin) */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: .93rem; }
th { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
tbody tr:hover { background: var(--bg-card-2); }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.clickable { cursor: pointer; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 40px 0 28px; color: var(--text-muted); font-size: .92rem; background: var(--bg-elev); }
footer .cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
footer .trust { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
footer .trust span { border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: .8rem; }
footer .legal { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: .82rem; color: var(--text-faint); }

/* Admin shell */
.admin { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; background: var(--charcoal-900); color: #e6edf7; }
[data-theme="light"] .admin { background: #eef1f6; color: #0b1a33; }
.admin-side { background: var(--navy-800); border-right: 1px solid rgba(255,255,255,.08); padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; }
.admin-side .brand { padding: 6px 8px 16px; color: #fff; }
.admin-side a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: #bfcde2; font-weight: 600; }
.admin-side a:hover, .admin-side a.active { background: rgba(56,189,248,.14); color: #fff; text-decoration: none; }
.admin-side .side-foot { margin-top: auto; font-size: .82rem; color: #bfcde2; padding: 10px 8px; border-top: 1px solid rgba(255,255,255,.08); }
.admin-side .side-foot .faint { color: #a3b3ca; }
.admin-side .btn-ghost { color: #e6edf7; border-color: rgba(255,255,255,.25); }
.admin-main { padding: clamp(16px, 3vw, 32px); min-width: 0; }
.admin-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-top h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.admin-top .spacer { flex: 1; }
.admin .card { background: var(--charcoal-800); border-color: rgba(255,255,255,.08); }
[data-theme="light"] .admin .card { background: #fff; border-color: rgba(11,26,51,.1); }
.admin .table-wrap { background: var(--charcoal-800); border-color: rgba(255,255,255,.08); }
[data-theme="light"] .admin .table-wrap { background: #fff; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi b { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi span { color: var(--text-muted); font-size: .85rem; }
.admin-menu-btn { display: none; }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .admin-side { position: fixed; inset: 0 auto 0 0; width: min(280px, 85vw); transform: translateX(-100%); transition: transform .2s ease; z-index: 60; }
  .admin-side.open { transform: none; box-shadow: var(--shadow); }
  .admin-menu-btn { display: inline-flex; }
}

/* Utilities */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--bg-card-2); border-radius: 0 10px 10px 0; font-size: .9rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; word-break: break-all; }
.hidden { display: none !important; }
.skeleton { height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-card-2), var(--bg-card), var(--bg-card-2)); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.fade-in { animation: fi .35s ease both; }
@keyframes fi { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy-800); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 100; max-width: calc(100vw - 32px); border: 1px solid rgba(255,255,255,.12); }
.pac-container { z-index: 200 !important; font-family: var(--font); border-radius: 12px; }
pre { max-width: 100%; overflow-x: auto; }
