/* DS Tracker — light design system */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f3f3f0;
  --border: #e7e6e1;
  --border-strong: #d7d6d0;
  --text: #121315;
  --muted: #6c6d71;
  --faint: #9a9a9e;
  --ink: #121315;
  --accent: #2f5bea;
  --accent-2: #1a2d78;
  --accent-soft: rgba(47, 91, 234, 0.08);
  --good: #12805c;
  --bad: #c2410c;
  --map-empty: #ebebe7;
  --shadow: 0 1px 0 rgba(18, 19, 21, 0.03), 0 1px 2px rgba(18, 19, 21, 0.04);
  --shadow-lg: 0 1px 2px rgba(18, 19, 21, 0.04), 0 12px 40px -12px rgba(18, 19, 21, 0.14);
  --radius: 12px;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--text); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; font-weight: 600; }
code, pre { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
::selection { background: rgba(47, 91, 234, 0.16); }

/* Buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 9px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow); transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(0.5px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.08); }
.btn.primary:hover { background: #2a2b2f; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 11px 20px; font-size: 15px; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg { width: 15px; height: 15px; }
input, select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 9px 12px; width: 100%; box-shadow: var(--shadow);
}
select { appearance: none; padding-right: 32px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c6d71' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; cursor: pointer; font-weight: 500; }
input:focus, select:focus { outline: 3px solid rgba(47, 91, 234, 0.14); border-color: var(--accent); }
input::placeholder { color: var(--faint); }
label { display: block; font-weight: 500; font-size: 13px; margin: 14px 0 6px; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15.5px; letter-spacing: -0.02em; color: var(--text); }
.brand svg { width: 26px; height: 26px; flex: none; }

/* App shell */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.86); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1320px; margin: 0 auto; padding: 0 24px; height: 58px; display: flex; align-items: center; gap: 16px; }
.topbar nav { display: flex; gap: 2px; margin-left: 18px; height: 100%; }
.topbar nav a { display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-weight: 500; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.topbar nav a:hover { color: var(--text); }
.topbar nav a.active { color: var(--text); border-bottom-color: var(--ink); }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.plan-badge { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); }
@media (max-width: 860px) { .topbar-inner { height: auto; padding: 10px 16px; flex-wrap: wrap; } .topbar nav { order: 3; width: 100%; margin: 0; overflow-x: auto; } .topbar nav a { padding: 8px 10px; } #user-email { display: none; } }

main { max-width: 1320px; margin: 0 auto; padding: 24px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar select { width: auto; }
.toolbar .spacer { flex: 1; }
.live { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; padding: 7px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; }
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(18,128,92,.5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(18,128,92,.45); } 70% { box-shadow: 0 0 0 7px rgba(18,128,92,0); } 100% { box-shadow: 0 0 0 0 rgba(18,128,92,0); } }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border-strong); padding: 4px 6px 4px 11px; border-radius: 999px; font-weight: 500; font-size: 12.5px; box-shadow: var(--shadow); }
.chip button { border: 0; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; width: 18px; height: 18px; border-radius: 50%; }
.chip button:hover { color: var(--text); }

/* Cards */
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(6, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-map { grid-template-columns: 1.7fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .g-kpi { grid-template-columns: repeat(3, 1fr); } .g-map, .g-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g-kpi { grid-template-columns: repeat(2, 1fr); } .g-2 { grid-template-columns: 1fr; } main { padding: 16px; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card + .card, .grid + .grid, .grid + .card, .card + .grid { margin-top: 16px; }
.grid > .card, .plans > .card, .features > .card { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 14px; font-weight: 600; }
.card-head .sub { color: var(--faint); font-size: 12.5px; }
.card-head .tabs { margin-left: auto; flex-shrink: 0; }

.g-kpi .kpi { border: 0; border-radius: 0; box-shadow: none; border-right: 1px solid var(--border); padding: 18px 20px; cursor: default; position: relative; }
.g-kpi .kpi:last-child { border-right: 0; }
.g-kpi .kpi[data-metric] { cursor: pointer; }
.g-kpi .kpi[data-metric]:hover { background: #fcfcfb; }
.g-kpi .kpi.active::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 0; height: 2px; background: var(--ink); }
@media (max-width: 1100px) { .g-kpi .kpi { border-bottom: 1px solid var(--border); } }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.delta { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat { color: var(--faint); }

.tabs { display: inline-flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 500; padding: 4px 9px; border-radius: 7px; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }

.chart-box { position: relative; height: 290px; }
.chart-box.sm { height: 200px; }

/* Bar lists */
.barlist { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; }
.barlist .hdr, .barlist .row { display: grid; grid-template-columns: var(--cols, minmax(0,1fr) 68px 68px); gap: 8px; align-items: center; }
.barlist .hdr { color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 0 10px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.barlist .hdr span:not(:first-child), .barlist .row .n { text-align: right; font-variant-numeric: tabular-nums; }
.barlist .row { position: relative; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.barlist .row:hover .bar { background: rgba(47, 91, 234, 0.14); }
.barlist .row .bar { position: absolute; inset: 2px auto 2px 0; background: var(--accent-soft); border-radius: 6px; z-index: 0; transition: background .15s; }
.barlist .row > *:not(.bar) { position: relative; z-index: 1; }
.barlist .row .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist .row .n { font-weight: 500; }
.barlist .row .n.dim { color: var(--muted); font-weight: 400; }
.barlist .empty { color: var(--muted); padding: 28px 10px; text-align: center; font-size: 13px; }

/* Map */
.map-wrap { position: relative; }
.map-wrap svg { width: 100%; height: auto; display: block; }
.map-wrap .country { stroke: #fff; stroke-width: 0.6; cursor: pointer; transition: opacity .15s; }
.map-wrap .country:hover { opacity: .78; }
.map-wrap .city { fill: var(--accent-2); fill-opacity: .7; stroke: #fff; stroke-width: 1; pointer-events: none; }
.map-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); margin-top: 10px; }
.map-legend .scale { height: 6px; width: 140px; border-radius: 3px; }
.tooltip { position: fixed; pointer-events: none; z-index: 50; background: var(--ink); color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; box-shadow: var(--shadow-lg); }

/* Heatmap */
.heat { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 3px; font-size: 10.5px; color: var(--faint); }
.heat .cell { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.heat .lbl { display: flex; align-items: center; }
.heat .hl { text-align: center; }

/* Realtime feed */
.feed { display: flex; flex-direction: column; max-height: 300px; overflow: auto; }
.feed .item { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 7px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.feed .item:last-child { border-bottom: 0; }
.feed .item .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .item .when { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.minutes { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin: 4px 0 12px; padding-bottom: 1px; border-bottom: 1px solid var(--border); }
.minutes div { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }

/* Settings pages */
.page-title { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 20px; }
.page-title h1 { font-size: 24px; letter-spacing: -0.025em; }
.narrow { max-width: 780px; }
.site-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.site-row:last-child { border-bottom: 0; }
.site-row .info { flex: 1; min-width: 200px; }
.site-row .info b { display: block; font-weight: 600; }
.site-row .info .muted { font-size: 12.5px; }
.steps { counter-reset: s; padding: 0; list-style: none; margin: 8px 0 0; }
.steps li { counter-increment: s; position: relative; padding: 2px 0 18px 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border-strong); font-weight: 600; font-size: 12.5px; }
.snippet { position: relative; background: #0f1012; color: #e7e7ea; border-radius: 10px; padding: 16px; overflow: auto; white-space: pre; margin: 10px 0; line-height: 1.6; }
.snippet .btn { position: absolute; top: 10px; right: 10px; background: #26272b; border-color: #3a3b40; color: #fff; box-shadow: none; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); }
.status-pill.ok { color: var(--good); background: rgba(18, 128, 92, 0.06); border-color: rgba(18, 128, 92, 0.2); }
.status-pill.wait { background: var(--surface-2); color: var(--muted); }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; gap: 12px; padding: 24px; }
.plan.current, .plan.featured { border-color: var(--ink); box-shadow: var(--shadow-lg); }
.plan h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.plan .tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: #fff; letter-spacing: 0; }
.plan .price { font-size: 38px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.plan .blurb { color: var(--muted); font-size: 13px; margin-top: -4px; }
.plan ul { list-style: none; padding: 14px 0 0; margin: 0; border-top: 1px solid var(--border); display: grid; gap: 8px; color: var(--text); }
.plan li { display: flex; gap: 9px; align-items: flex-start; }
.plan li::before { content: ""; flex: none; width: 15px; height: 15px; margin-top: 3px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121315' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center/contain; }
.plan .btn { margin-top: auto; }
.meter { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 10px 0 6px; }
.meter div { height: 100%; background: var(--ink); border-radius: 3px; }

.notice { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 14px; margin: 16px 0; font-size: 13.5px; }
.error { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; }
.empty-state { text-align: center; padding: 64px 20px; }
.empty-state h2 { margin-bottom: 8px; font-size: 22px; }
.empty-state p { max-width: 440px; margin: 0 auto 20px; }

/* ---------------- Auth ---------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-form { display: flex; flex-direction: column; padding: 32px 40px; }
.auth-form form { width: 100%; max-width: 380px; margin: auto; padding: 40px 0; }
.auth h1 { font-family: var(--serif); font-weight: 400; font-size: 40px; letter-spacing: -0.01em; line-height: 1.1; margin: 0 0 8px; }
.auth .btn.primary { width: 100%; margin-top: 20px; padding: 11px; }
.auth .switch { text-align: center; margin-top: 18px; color: var(--muted); font-size: 13.5px; }
.auth .switch a { color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.auth-side { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side .quote { font-family: var(--serif); font-size: 34px; line-height: 1.15; max-width: 440px; letter-spacing: -0.005em; }
.auth-side .quote em { color: #9fb4ff; font-style: italic; }
.auth-side .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; border-top: 1px solid rgba(255,255,255,.14); padding-top: 22px; font-size: 13px; color: rgba(255,255,255,.62); }
.auth-side .facts b { display: block; color: #fff; font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.auth-side .globe { position: absolute; right: -120px; top: 50%; transform: translateY(-50%); width: 460px; opacity: .22; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } .auth-form { padding: 24px 16px; } }

/* ---------------- Marketing ---------------- */
.site-nav { position: sticky; top: 0; z-index: 30; background: rgba(247, 247, 245, 0.82); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-nav.scrolled { border-bottom-color: var(--border); }
.site-nav .inner { max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 28px; }
.site-nav .links { display: flex; gap: 24px; font-size: 14px; color: var(--muted); font-weight: 500; }
.site-nav .links a { color: var(--muted); }
.site-nav .links a:hover { color: var(--text); }
.site-nav .cta { margin-left: auto; display: flex; gap: 8px; }
@media (max-width: 720px) { .site-nav .links { display: none; } .site-nav .inner { padding: 0 16px; } }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 720px) { .wrap { padding: 0 16px; } }

.hero { padding: 88px 0 56px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 5px 12px 5px 6px; box-shadow: var(--shadow); }
.eyebrow b { background: var(--ink); color: #fff; font-weight: 600; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 7vw, 84px); line-height: 1.02; letter-spacing: -0.02em; margin: 26px auto 0; max-width: 900px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p.lede { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 600px; margin: 22px auto 32px; line-height: 1.55; }
.hero .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero .assure { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-top: 22px; color: var(--muted); font-size: 13px; }
.hero .assure span { display: inline-flex; align-items: center; gap: 7px; }
.hero .assure svg { width: 15px; height: 15px; color: var(--good); }

/* product preview */
.preview { margin: 8px auto 0; max-width: 1080px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 1px 2px rgba(18,19,21,.04), 0 40px 80px -30px rgba(18,19,21,.22); overflow: hidden; text-align: left; }
.preview .bar { height: 40px; display: flex; align-items: center; gap: 7px; padding: 0 16px; border-bottom: 1px solid var(--border); background: #fbfbfa; }
.preview .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.preview .bar span { margin-left: 12px; font-size: 12px; color: var(--faint); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 2px 10px; }
.preview .body { padding: 20px; display: grid; gap: 14px; }
.preview .kpis { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 10px; }
.preview .kpis div { padding: 14px 16px; border-right: 1px solid var(--border); }
.preview .kpis div:last-child { border-right: 0; }
.preview .kpis small { color: var(--muted); font-size: 11.5px; display: block; }
.preview .kpis b { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.preview .kpis em { font-style: normal; font-size: 11.5px; color: var(--good); margin-left: 6px; }
.preview .row2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; }
.preview .pane { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.preview .pane h4 { margin: 0 0 10px; font-size: 12.5px; font-weight: 600; }
.preview .pane svg { width: 100%; display: block; }
.preview .geo { display: grid; gap: 4px; font-size: 12.5px; }
.preview .geo div { position: relative; display: flex; justify-content: space-between; padding: 5px 8px; border-radius: 6px; }
.preview .geo div::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--accent-soft); border-radius: 6px; }
.preview .geo span { position: relative; }
@media (max-width: 760px) { .preview .kpis { grid-template-columns: repeat(2, 1fr); } .preview .kpis div:nth-child(2) { border-right: 0; } .preview .kpis div:nth-child(-n+2) { border-bottom: 1px solid var(--border); } .preview .row2 { grid-template-columns: 1fr; } }

.section { padding: 96px 0 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.section h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.5vw, 52px); line-height: 1.05; letter-spacing: -0.015em; }
.section-head p { color: var(--muted); font-size: 16.5px; margin: 14px 0 0; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.feature { padding: 28px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.feature .ic { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border-strong); display: grid; place-items: center; margin-bottom: 18px; background: var(--surface); box-shadow: var(--shadow); }
.feature .ic svg { width: 18px; height: 18px; }
.feature h3 { font-size: 15.5px; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 14px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how .step { padding: 24px; }
.how .num { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--faint); margin-bottom: 14px; }
.how h3 { font-size: 15.5px; margin-bottom: 6px; }
.how p { color: var(--muted); margin: 0; }
@media (max-width: 860px) { .how { grid-template-columns: 1fr; } }

.faq { max-width: 760px; margin: 0 auto; border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); padding: 18px 2px; }
.faq summary { cursor: pointer; font-weight: 500; font-size: 15.5px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--faint); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 10px 0 0; }

.closing { margin: 96px 0 0; background: var(--ink); color: #fff; border-radius: 20px; padding: 64px 32px; text-align: center; }
.closing h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.5vw, 52px); line-height: 1.05; }
.closing p { color: rgba(255,255,255,.65); margin: 14px 0 28px; font-size: 16px; }
.closing .btn.primary { background: #fff; color: var(--ink); border-color: #fff; }
.closing .btn.primary:hover { background: #ececec; }

.site-footer { margin-top: 64px; border-top: 1px solid var(--border); }
.site-footer .inner { max-width: 1160px; margin: 0 auto; padding: 28px 24px 40px; display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.site-footer .inner .sp { flex: 1; }

/* DS logo mark */
.brand img.mark { height: 26px; width: auto; display: block; }
.brand img.mark.sm { height: 20px; }
.brand { font-weight: 700; letter-spacing: -0.025em; }

/* Billing */
.banner { background: #fff8e6; border-bottom: 1px solid #f1dfb0; color: #6b4e06; text-align: center; padding: 9px 16px; font-size: 13.5px; }
.banner.bad { background: #fdf0ec; border-color: #f3cfc3; color: #8a2c0b; }
.banner a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; margin-left: 6px; }
.notice.ok { border-left-color: var(--good); }
.notice.bad { border-left-color: var(--bad); }
.notice.wait { border-left-color: var(--faint); }
.notice a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.plan-now { font-size: 20px; letter-spacing: -0.02em; margin-bottom: 4px; }
.cycle-toggle { display: inline-flex; gap: 2px; padding: 3px; margin: 22px 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.cycle-toggle button { border: 0; background: transparent; font: inherit; font-weight: 500; color: var(--muted); padding: 7px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.cycle-toggle button.active { background: var(--ink); color: #fff; }
.cycle-toggle .save { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: rgba(18,128,92,.1); color: var(--good); }
.cycle-toggle button.active .save { background: rgba(255,255,255,.16); color: #fff; }
.plan .tag.light { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 0 10px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }
#history { overflow-x: auto; margin-top: 16px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(18,19,21,.42); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
.modal { position: relative; width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px; padding: 28px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.35); animation: rise .18s ease; }
.modal h2 { font-size: 18px; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--surface-2); color: var(--muted); font-size: 18px; cursor: pointer; }
.co-price { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; margin-top: 10px; }
.co-price .muted { font-size: 14px; font-weight: 400; letter-spacing: 0; }
.co-secure { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 12px; margin-top: 14px; }
.co-secure svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* Legal & contact pages */
.legal { max-width: 760px; padding-top: 56px; padding-bottom: 40px; }
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 6vw, 56px); line-height: 1.05; letter-spacing: -0.015em; }
.legal .updated { color: var(--faint); font-size: 13px; margin: 10px 0 28px; }
.legal .updated:empty { display: none; }
.legal .lede { font-size: 18px; color: var(--muted); margin: 14px 0 28px; }
.legal h2 { font-size: 18px; margin: 34px 0 10px; letter-spacing: -0.015em; }
.legal p, .legal li { font-size: 15px; line-height: 1.7; color: #2b2c30; }
.legal ul { padding-left: 20px; margin: 8px 0; }
.legal li { margin: 4px 0; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(47,91,234,.35); }
.contact-grid > .card { margin-top: 0; }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 8px 0 16px; }
.contact-grid .card h3 { font-size: 14px; margin-bottom: 8px; }
.contact-grid .card p { margin: 0 0 6px; font-size: 14.5px; }
.contact-grid .card p.muted { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--text); }
.legal-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; text-align: center; }
.legal-note a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
