/* ==========================================================================
   INDEX PRO — design system
   Concept: an observatory for your URLs. Layered midnight surfaces, hairline
   luminous borders, a periwinkle primary and one mint accent reserved for
   "found / healthy". Concentric rings are the recurring motif.
   All sizes are rem-based so the whole UI scales crisply on 4K screens.
   ========================================================================== */

:root {
  --font-display: 'Sora', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r-sm: .5rem; --r-md: .75rem; --r-lg: 1.125rem; --r-xl: 1.75rem;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --side-w: 17rem;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1121; --bg-2: #0e1528; --surface: #121a31; --surface-2: #172040; --elev: #1d2850;
  --text: #eef1fb; --text-2: #b6bfd9; --muted: #8590b0;
  --line: rgba(163, 178, 235, .13); --line-2: rgba(163, 178, 235, .26);
  --primary: #7c8dff; --primary-ink: #0a0f2c; --primary-soft: rgba(124, 141, 255, .15);
  --accent: #36e0c3; --accent-soft: rgba(54, 224, 195, .13);
  --ok: #3fdc9a; --warn: #ffb84d; --err: #ff6f7d; --info: #6cc4ff;
  --glow-1: rgba(124, 141, 255, .16); --glow-2: rgba(54, 224, 195, .08);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 48px -28px rgba(0, 0, 0, .7);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f4fb; --bg-2: #e8ecf8; --surface: #ffffff; --surface-2: #f5f7fd; --elev: #ffffff;
  --text: #0f1733; --text-2: #39446a; --muted: #66709a;
  --line: rgba(31, 46, 112, .11); --line-2: rgba(31, 46, 112, .22);
  --primary: #4256e8; --primary-ink: #ffffff; --primary-soft: rgba(66, 86, 232, .1);
  --accent: #078f7a; --accent-soft: rgba(7, 143, 122, .1);
  --ok: #0a8f5c; --warn: #b36b00; --err: #d1293d; --info: #1273b8;
  --glow-1: rgba(66, 86, 232, .1); --glow-2: rgba(7, 143, 122, .06);
  --shadow: 0 1px 2px rgba(20, 30, 80, .05), 0 18px 40px -26px rgba(20, 30, 80, .28);
}

/* ---- Scale up for large / 4K displays ---- */
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (min-width: 1920px) { html { font-size: 112.5%; } }
@media (min-width: 2560px) { html { font-size: 137.5%; } }
@media (min-width: 3200px) { html { font-size: 175%; } }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font-body); font-size: 1rem; line-height: 1.55;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 36rem at 88% -8%, var(--glow-1), transparent 62%),
    radial-gradient(48rem 30rem at -8% 108%, var(--glow-2), transparent 58%);
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -.015em; font-weight: 600; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-sm); }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--primary-ink); padding: .6rem 1rem; z-index: 999; border-radius: 0 0 var(--r-sm) 0; }
.skip:focus { left: 0; }
.i { width: 1.25rem; height: 1.25rem; flex: none; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: .88em; }
.d-block { display: block; }
.t-right { text-align: right; }
.mt { margin-top: 1.5rem; } .mt0 { margin-top: 0; }
.stack { display: grid; gap: 1.5rem; align-content: start; }
.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fine { font-size: .82rem; }
[hidden] { display: none !important; }

/* theme-aware icon/label swap */
[data-theme="dark"] .ico-light, [data-theme="dark"] .lbl-light,
[data-theme="light"] .ico-dark, [data-theme="light"] .lbl-dark { display: none; }

/* ---- Brand ---- */
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); font-family: var(--font-display); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 1.9rem; height: 1.9rem; color: var(--text); }
.brand-word { display: inline-flex; align-items: center; gap: .35rem; font-size: 1.05rem; letter-spacing: .01em; }
.brand-word b { font-weight: 700; }
.brand-word em { font-style: normal; font-size: .62rem; font-weight: 700; padding: .12rem .4rem; border: 1px solid var(--line-2); border-radius: .35rem; color: var(--accent); letter-spacing: .06em; }
.brand-sm .mark { width: 1.6rem; height: 1.6rem; }

/* ---- Buttons ---- */
.btn {
  --b: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 2.75rem; padding: .55rem 1.1rem; border-radius: var(--r-md);
  border: 1px solid var(--b); background: transparent; color: var(--text);
  font: 600 .93rem/1 var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .18s var(--ease), background .18s, border-color .18s, box-shadow .18s, color .18s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--primary); border-color: transparent; color: var(--primary-ink); box-shadow: 0 10px 24px -12px var(--primary); }
.btn-primary:hover { box-shadow: 0 14px 30px -12px var(--primary); filter: brightness(1.06); }
.btn-ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn-quiet { border-color: transparent; background: var(--surface-2); color: var(--text-2); }
.btn-quiet:hover { color: var(--text); }
.btn-ok { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn-ok:hover { background: var(--accent); color: #05231d; }
.btn-danger { background: var(--err); border-color: transparent; color: #fff; }
.btn-danger-ghost { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--err) 14%, transparent); border-color: var(--err); }
.btn-sm { min-height: 2.25rem; padding: .35rem .8rem; font-size: .84rem; border-radius: var(--r-sm); }
.btn-lg { min-height: 3.2rem; padding: .7rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; transition: color .18s, border-color .18s, background .18s; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }

/* ---- Forms ---- */
.form { display: grid; gap: 1.1rem; }
.form-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.form-3 .form-actions { grid-column: 1 / -1; }
.form-inline { grid-template-columns: 1fr auto; align-items: end; }
.field { display: grid; gap: .4rem; min-width: 0; }
.field.grow { min-width: 0; }
.field label { font-size: .86rem; font-weight: 600; color: var(--text-2); }
.input {
  width: 100%; min-height: 2.9rem; padding: .65rem .9rem; border-radius: var(--r-md);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: 500 1rem var(--font-body); transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder { color: var(--muted); }
.input:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--line-2)); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); background: var(--surface); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 1.2rem) 52%, calc(100% - .85rem) 52%; background-size: .4rem .4rem; background-repeat: no-repeat; padding-right: 2.4rem; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 3rem; }
.toggle-pass { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: var(--r-sm); cursor: pointer; }
.toggle-pass:hover, .toggle-pass.is-on { color: var(--primary); }
.hint { font-size: .8rem; color: var(--muted); }
.field-error { font-size: .82rem; color: var(--err); font-weight: 600; }
.check { display: flex; align-items: center; gap: .65rem; font-size: .92rem; color: var(--text-2); cursor: pointer; min-height: 2.5rem; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--primary); }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; }
.meter i { height: .28rem; border-radius: 1rem; background: var(--line-2); transition: background .25s; }
.meter[data-level="1"] i:nth-child(-n+1) { background: var(--err); }
.meter[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.meter[data-level="3"] i:nth-child(-n+3) { background: var(--info); }
.meter[data-level="4"] i { background: var(--ok); }

.alert { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface-2); font-size: .92rem; margin-bottom: 1rem; }
.alert .i { margin-top: .1rem; }
.alert-err, .alert-error { border-color: color-mix(in srgb, var(--err) 45%, transparent); background: color-mix(in srgb, var(--err) 10%, transparent); color: var(--text); }
.alert-err .i, .alert-error .i { color: var(--err); }
.alert-warn, .alert-warning { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.alert-ok, .alert-success { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .65rem .22rem .55rem; border-radius: 2rem; font-size: .76rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.badge i { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.b-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.b-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.b-err { color: var(--err); background: color-mix(in srgb, var(--err) 12%, transparent); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.b-info { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.b-primary { color: var(--primary); background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.b-muted { color: var(--muted); }

/* ---- Avatar ---- */
.avatar { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; flex: none; border-radius: 50%; font: 700 .82rem var(--font-display); color: var(--primary-ink); background: linear-gradient(135deg, var(--primary), var(--accent)); border: 0; }
.avatar-btn { cursor: pointer; transition: box-shadow .18s; }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--primary-soft); }
.avatar-lg { width: 3.75rem; height: 3.75rem; font-size: 1.1rem; }

/* ==========================================================================
   App shell (user + admin)
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: .5rem; padding: 1.4rem 1rem 1rem; background: var(--bg-2); border-right: 1px solid var(--line); overflow-y: auto; }
.sidebar .brand { padding: 0 .6rem .9rem; }
.side-tag { margin: 0 .6rem .4rem; font-size: .74rem; color: var(--accent); font-weight: 700; letter-spacing: .02em; }
.side-nav { display: grid; gap: .2rem; }
.nav-link { position: relative; display: flex; align-items: center; gap: .8rem; min-height: 2.9rem; padding: .55rem .8rem; border-radius: var(--r-md); color: var(--text-2); font-weight: 600; font-size: .95rem; transition: background .18s, color .18s; }
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link .i { transition: transform .25s var(--ease); }
.nav-link:hover .i { transform: translateX(2px); }
.nav-link.is-active { background: var(--primary-soft); color: var(--text); }
.nav-link.is-active::before { content: ''; position: absolute; left: -1rem; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-link.is-active .i { color: var(--accent); }
.side-foot { margin-top: auto; display: grid; gap: .7rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.me-text { display: grid; min-width: 0; line-height: 1.25; }
.me-text b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-col { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; padding: .8rem clamp(1rem, 3vw, 2.25rem); padding-top: calc(.8rem + var(--sat)); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar .brand-sm { display: none; }
.top-title { font-size: .85rem; color: var(--muted); font-weight: 600; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + .6rem); min-width: 15rem; padding: .4rem; border-radius: var(--r-lg); background: var(--elev); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop .18s var(--ease); z-index: 40; }
.menu-head { display: grid; padding: .7rem .8rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.menu-head small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.menu a, .menu button { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 2.6rem; padding: .5rem .8rem; border: 0; background: transparent; color: var(--text-2); font: 600 .92rem var(--font-body); border-radius: var(--r-sm); cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.content { flex: 1; width: 100%; max-width: 88rem; margin-inline: auto; padding: clamp(1.1rem, 3vw, 2.25rem); outline: none; animation: enter .5s var(--ease) both; }
.app-foot { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; justify-content: space-between; padding: 1.1rem clamp(1rem, 3vw, 2.25rem); color: var(--muted); font-size: .78rem; border-top: 1px solid var(--line); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.page-head h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); font-weight: 700; }
.page-head p { margin-top: .35rem; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.page-actions form { margin: 0; }
.back { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: 1rem; font-size: .88rem; font-weight: 600; color: var(--muted); }
.back .i { transform: rotate(180deg); width: 1rem; height: 1rem; }
.back:hover { color: var(--text); text-decoration: none; }
.profile-id { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.user-head .profile-id { margin-bottom: 0; }
.user-head h1 { font-size: clamp(1.3rem, 1rem + 1.2vw, 1.8rem); }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.35rem; }
.link-more { font-size: .85rem; font-weight: 600; }
.danger-zone { border-color: color-mix(in srgb, var(--err) 35%, var(--line)); }
.danger-zone .card-head h2 { color: var(--err); }
.danger-zone .card-body > p { margin-bottom: 1rem; }

/* ---- Stats ---- */
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); }
.stat-grid-sm { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.stat { --tone: var(--primary); position: relative; padding: 1.1rem 1.2rem 1.2rem; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: transform .25s var(--ease), border-color .25s; animation: enter .55s var(--ease) both; }
.stat:nth-child(2) { animation-delay: .04s; } .stat:nth-child(3) { animation-delay: .08s; } .stat:nth-child(4) { animation-delay: .12s; }
.stat:nth-child(5) { animation-delay: .16s; } .stat:nth-child(6) { animation-delay: .2s; } .stat:nth-child(7) { animation-delay: .24s; }
.stat:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--tone) 45%, var(--line)); }
.stat::after { content: ''; position: absolute; right: -1.6rem; bottom: -1.6rem; width: 5rem; height: 5rem; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent); box-shadow: 0 0 0 .7rem color-mix(in srgb, var(--tone) 6%, transparent); }
.t-primary { --tone: var(--primary); } .t-accent { --tone: var(--accent); } .t-ok { --tone: var(--ok); }
.t-warn { --tone: var(--warn); } .t-err { --tone: var(--err); } .t-info { --tone: var(--info); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.stat-label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.stat-ico { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .6rem; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); }
.stat-ico .i { width: 1.1rem; height: 1.1rem; }
.stat-value { margin-top: .7rem; font: 700 clamp(1.6rem, 1.2rem + 1vw, 2.1rem)/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---- Lists ---- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.35rem; border-bottom: 1px solid var(--line); transition: background .18s; }
.rows li:last-child { border-bottom: 0; }
.rows li:hover { background: var(--surface-2); }
.row-main { display: grid; min-width: 0; line-height: 1.35; }
.row-title { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-link { color: inherit; } .row-link:hover { text-decoration: none; }
.checklist { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .35rem; }
.checklist li { display: flex; align-items: center; gap: .8rem; min-height: 2.6rem; font-weight: 600; font-size: .94rem; }
.checklist .tick { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1.5px solid var(--line-2); color: #05231d; flex: none; transition: background .3s, border-color .3s; }
.checklist .tick .i { width: .9rem; height: .9rem; stroke-width: 2.6; }
.checklist .is-done .tick { background: var(--accent); border-color: var(--accent); }
.checklist .is-done > span:last-child { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.empty { display: grid; justify-items: center; gap: .35rem; padding: 2.4rem 1.5rem; text-align: center; }
.empty.slim { padding: 1.5rem; color: var(--muted); }
.empty p { font-weight: 600; }
.empty-ring { display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%; margin-bottom: .5rem; color: var(--text-2); border: 1px dashed var(--line-2); box-shadow: 0 0 0 .6rem var(--primary-soft); }
.empty-ring .mark { width: 1.8rem; height: 1.8rem; }
.kv { margin: 0; display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; font-weight: 600; font-size: .92rem; text-align: right; }
.kv-flat { padding: 0 .2rem; max-width: 28rem; }

/* ---- Toolbar / chips ---- */
.toolbar { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-bottom: 1.2rem; }
.search { position: relative; flex: 1 1 16rem; }
.search .i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 2.8rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .3rem 1rem; border-radius: 2rem; border: 1px solid var(--line-2); font-size: .86rem; font-weight: 600; color: var(--text-2); transition: all .18s; }
.chip:hover span { border-color: var(--primary); }
.chip input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--text); }
.chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---- Table (cards on phones) ---- */
.table-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: .92rem; }
.dtable th { text-align: left; padding: .85rem 1.2rem; font-size: .78rem; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.dtable td { padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dtable tbody tr { transition: background .18s; }
.dtable tbody tr:hover { background: var(--surface-2); }
.dtable tbody tr:last-child td { border-bottom: 0; }
.usercell { display: flex; align-items: center; gap: .8rem; color: inherit; min-width: 12rem; }
.usercell:hover { text-decoration: none; }
.usercell b { display: block; }
.actions { display: inline-flex; gap: .45rem; align-items: center; justify-content: flex-end; }
.actions form { margin: 0; }

.pager { display: flex; justify-content: center; gap: .35rem; margin-top: 1.4rem; }
.pg { display: grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding: 0 .6rem; border-radius: var(--r-sm); border: 1px solid var(--line-2); color: var(--text-2); font-weight: 700; font-size: .9rem; }
.pg:hover { text-decoration: none; border-color: var(--primary); color: var(--text); }
.pg.is-on { background: var(--primary); border-color: transparent; color: var(--primary-ink); }
.pg.is-off { opacity: .35; }

/* ---- Bar charts (pure CSS) ---- */
.bars { --tone: var(--primary); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .5rem; height: 10rem; align-items: stretch; }
.bar { display: grid; grid-template-rows: 1fr auto; gap: .45rem; min-width: 0; }
.bar .col { display: flex; align-items: flex-end; border-radius: .4rem; background: color-mix(in srgb, var(--tone) 6%, transparent); }
.bar i { display: block; width: 100%; height: var(--h); min-height: .22rem; border-radius: .4rem .4rem .15rem .15rem; background: var(--tone); transform-origin: bottom; animation: grow .8s var(--ease) both; animation-delay: calc(var(--i) * 45ms + .15s); transition: filter .18s; }
.bar:hover i { filter: brightness(1.25); }
.bar.is-zero i { opacity: .25; }
.bar span { font-size: .7rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

/* ---- Mobile sheet + bottom nav ---- */
.bottomnav, .sheet, .sheet-backdrop { display: none; }

/* ---- Dialog + toasts ---- */
.dlg { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--elev); color: var(--text); padding: 0; width: min(26rem, calc(100vw - 2rem)); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); }
.dlg::backdrop { background: rgba(5, 8, 20, .62); backdrop-filter: blur(3px); }
.dlg[open] { animation: pop .22s var(--ease); }
.dlg-body { padding: 1.6rem; display: grid; gap: .8rem; }
.dlg-body h2 { font-size: 1.15rem; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .6rem; }
.toasts { position: fixed; z-index: 100; top: calc(1rem + var(--sat)); right: 1rem; display: grid; gap: .6rem; width: min(24rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--r-md); background: var(--elev); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: .92rem; font-weight: 600; animation: toastIn .4s var(--ease) both; --c: var(--info); }
.toast::before { content: ''; flex: none; width: .55rem; height: .55rem; margin-top: .45rem; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 .3rem color-mix(in srgb, var(--c) 20%, transparent); }
.toast.t-success { --c: var(--ok); } .toast.t-error { --c: var(--err); } .toast.t-warning { --c: var(--warn); }
.toast.out { animation: toastOut .3s var(--ease) both; }

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.auth-side { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem; background: linear-gradient(160deg, var(--surface-2), var(--bg-2)); border-right: 1px solid var(--line); overflow: hidden; }
.auth-art { display: grid; place-items: center; flex: 1; }
.auth-rings { width: min(100%, 28rem); fill: none; stroke: var(--line-2); stroke-width: .35; }
.auth-rings .dot { fill: var(--accent); stroke: none; opacity: 0; animation: pinIn .6s var(--ease) both; }
.auth-rings .d1 { animation-delay: .5s; } .auth-rings .d2 { animation-delay: 1s; } .auth-rings .d3 { animation-delay: 1.5s; }
.auth-pitch { max-width: 24rem; color: var(--text-2); font-size: 1.05rem; line-height: 1.6; }
.auth-main { display: grid; place-items: center; padding: 2rem clamp(1.2rem, 4vw, 3rem); padding-top: calc(2rem + var(--sat)); padding-bottom: calc(2rem + var(--sab)); }
.auth-box { width: min(100%, 26rem); animation: enter .55s var(--ease) both; }
.auth-head { margin-bottom: 1.6rem; }
.auth-head h1 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 700; margin-bottom: .45rem; }
.auth-alt { margin-top: 1.4rem; text-align: center; color: var(--muted); font-size: .92rem; }
.auth-alt a { font-weight: 700; }

/* ==========================================================================
   Public landing
   ========================================================================== */
.pub-wrap { width: 100%; max-width: 76rem; margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.pubnav { position: sticky; top: 0; z-index: 50; padding-top: var(--sat); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid transparent; transition: border-color .25s; }
.pubnav.is-scrolled { border-bottom-color: var(--line); }
.pubnav .pub-wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.3rem; }
.pub-links { display: flex; align-items: center; gap: 1.6rem; }
.pub-links > a { color: var(--text-2); font-weight: 600; font-size: .92rem; position: relative; }
.pub-links > a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -.3rem; height: 1.5px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.pub-links > a:hover { color: var(--text); text-decoration: none; }
.pub-links > a:hover::after { transform: scaleX(1); }
.pub-cta { display: flex; align-items: center; gap: .6rem; }
.pub-cta-m, .pub-burger { display: none; }

.setup-banner { display: flex; flex-wrap: wrap; gap: .4rem 1rem; justify-content: center; padding: .6rem 1rem; background: color-mix(in srgb, var(--warn) 14%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); font-size: .88rem; font-weight: 600; }

.hero { position: relative; padding: clamp(2.5rem, 6vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem); overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 3.5rem 3.5rem; -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 20%, transparent 75%); opacity: .55; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { display: grid; gap: 1rem; font-weight: 800; }
.hero-name { font-size: clamp(3rem, 2rem + 5.5vw, 6.2rem); letter-spacing: -.045em; line-height: .95; background: linear-gradient(180deg, var(--text) 40%, color-mix(in srgb, var(--text) 55%, var(--primary))); -webkit-background-clip: text; background-clip: text; color: transparent; animation: enter .8s var(--ease) both; }
.hero-tag { font-size: clamp(1.2rem, 1rem + 1.2vw, 1.8rem); font-weight: 600; letter-spacing: -.02em; color: var(--text-2); animation: enter .8s .12s var(--ease) both; }
.hero-sub { margin-top: 1.4rem; max-width: 34rem; font-size: 1.12rem; color: var(--text-2); animation: enter .8s .2s var(--ease) both; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; animation: enter .8s .28s var(--ease) both; }
.hero-note { margin-top: 1.4rem; max-width: 32rem; font-size: .84rem; color: var(--muted); animation: enter .8s .36s var(--ease) both; }

/* Radar: sweeps once, lights each page as the line passes it, then rests. */
.radar-wrap { margin: 0; display: grid; gap: .8rem; justify-items: center; }
.radar-wrap figcaption { font-size: .76rem; color: var(--muted); }
.radar { position: relative; width: min(100%, 34rem); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--primary) 10%, transparent), transparent 68%); }
.radar-rings { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--line-2); stroke-width: .25; }
.radar-sweep { position: absolute; inset: 2%; border-radius: 50%; opacity: 0; background: conic-gradient(from 0deg, transparent 0deg 240deg, color-mix(in srgb, var(--accent) 34%, transparent) 360deg); animation: sweep var(--sweep, 4.2s) linear var(--sweep-delay, .5s) 1 both; }
.radar-sweep::after { content: ''; position: absolute; left: 50%; top: 0; width: 2px; height: 50%; margin-left: -1px; background: linear-gradient(var(--accent), transparent); }
.radar-core { position: absolute; left: 50%; top: 50%; width: 15%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 0 0 .6rem var(--primary-soft); color: var(--text); }
.radar-core .mark { width: 62%; height: 62%; }
.pin { --c: var(--ok); position: absolute; width: 0; height: 0; opacity: 0; animation: pinIn .55s var(--ease) both; }
.pin-ok { --c: var(--ok); } .pin-info { --c: var(--info); } .pin-warn { --c: var(--warn); }
.pin i { position: absolute; left: -.38rem; top: -.38rem; width: .76rem; height: .76rem; border-radius: 50%; background: var(--c); box-shadow: 0 0 .9rem var(--c); animation-delay: inherit; }
.pin i::after { content: ''; position: absolute; inset: -.5rem; border-radius: 50%; border: 1px solid var(--c); opacity: 0; animation: ping 1.1s ease-out both; animation-delay: inherit; }
.pin span { position: absolute; left: 1rem; top: 0; transform: translateY(-50%); display: grid; gap: .05rem; padding: .35rem .65rem; border-radius: var(--r-sm); background: var(--elev); border: 1px solid var(--line-2); white-space: nowrap; line-height: 1.2; box-shadow: var(--shadow); }
.pin.is-left span { left: auto; right: 1rem; text-align: right; }
.pin span b { font: 600 .74rem var(--font-mono); color: var(--text); }
.pin span small { font-size: .68rem; font-weight: 700; color: var(--c); }

.sec { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.sec-alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.sec-head { max-width: 40rem; margin-bottom: 2.4rem; }
.sec-head h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.7rem); font-weight: 700; letter-spacing: -.03em; margin-bottom: .7rem; }
.sec-head p { font-size: 1.05rem; }

.bento { display: grid; gap: 1.1rem; grid-template-columns: 1.25fr 1fr 1fr; grid-auto-rows: minmax(0, auto); }
.bt { padding: 1.6rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: transform .3s var(--ease), border-color .3s; }
.bt:hover { transform: translateY(-4px); border-color: var(--line-2); }
.bt-lg { grid-row: span 2; display: flex; flex-direction: column; justify-content: flex-end; min-height: 17rem; border-radius: var(--r-xl); background: radial-gradient(circle at 85% 12%, var(--primary-soft), transparent 55%), var(--surface); }
.bt-lg h3 { font-size: 1.5rem; margin-bottom: .6rem; }
.bt-ico { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: .8rem; margin-bottom: 1rem; color: var(--accent); background: var(--accent-soft); }
.bt-lg .bt-ico { margin-bottom: auto; }
.bt h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.bt p { color: var(--text-2); font-size: .94rem; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem; position: relative; counter-reset: s; }
.steps li { position: relative; }
.steps li:not(:last-child)::after { content: ''; position: absolute; top: 1.35rem; left: 3.4rem; right: -1rem; height: 1px; background: repeating-linear-gradient(90deg, var(--line-2) 0 .4rem, transparent .4rem .8rem); }
.step-n { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: 50%; margin-bottom: 1rem; font: 700 1rem var(--font-display); border: 1px solid var(--line-2); background: var(--surface); color: var(--accent); }
.steps h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.steps p { color: var(--text-2); font-size: .93rem; }

.mock { max-width: 52rem; margin-inline: auto; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface); box-shadow: 0 50px 80px -50px rgba(0, 0, 0, .7), var(--shadow); overflow: hidden; }
.mock-bar { display: flex; align-items: center; gap: .4rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.mock-bar i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line-2); }
.mock-bar span { margin-left: .8rem; font: 500 .74rem var(--font-mono); color: var(--muted); }
.mock-body { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); min-height: 18rem; }
.mock-side { display: grid; align-content: start; gap: .7rem; padding: 1rem; border-right: 1px solid var(--line); background: var(--bg-2); }
.mock-side b { height: 1.6rem; border-radius: .5rem; background: linear-gradient(135deg, var(--primary), var(--accent)); margin-bottom: .5rem; }
.mock-side i { height: 1.7rem; border-radius: .5rem; background: var(--surface-2); }
.mock-side i.on { background: var(--primary-soft); box-shadow: inset 2px 0 0 var(--accent); }
.mock-main { padding: 1.2rem; display: grid; gap: 1rem; }
.mock-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.mock-stats div { padding: .8rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface-2); }
.mock-stats small { display: block; font-size: .66rem; color: var(--muted); font-weight: 600; }
.mock-stats b { font: 700 1.3rem var(--font-display); }
.mock-chart { display: flex; align-items: flex-end; gap: .5rem; height: 6.5rem; padding: .8rem; border: 1px solid var(--line); border-radius: .7rem; }
.mock-chart i { flex: 1; height: var(--h); border-radius: .3rem .3rem 0 0; background: var(--primary); opacity: .85; }
.mock-chart i:nth-child(6) { background: var(--accent); opacity: 1; }
.mock-rows { display: grid; gap: .5rem; }
.mock-rows i { height: 1.8rem; border-radius: .5rem; background: var(--surface-2); }
.mock-rows i:nth-child(2) { width: 82%; } .mock-rows i:nth-child(3) { width: 64%; }

.faq-wrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 3rem; }
.faq { display: grid; gap: .7rem; }
.faq details { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); transition: border-color .2s; }
.faq details[open] { border-color: var(--line-2); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.05rem 1.25rem; font-weight: 600; cursor: pointer; list-style: none; min-height: 3.2rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { color: var(--accent); transition: transform .3s var(--ease); }
.faq details[open] summary .i { transform: rotate(45deg); }
.faq details p { padding: 0 1.25rem 1.2rem; color: var(--text-2); font-size: .95rem; }

.trust { list-style: none; margin: 0 0 3rem; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.trust li { display: flex; gap: 1rem; align-items: flex-start; padding: 1.2rem 1.3rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.trust .i { color: var(--accent); margin-top: .1rem; }
.cta-band { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; justify-content: space-between; padding: clamp(1.6rem, 4vw, 2.6rem); border-radius: var(--r-xl); border: 1px solid var(--line-2); background: radial-gradient(circle at 100% 0, var(--primary-soft), transparent 60%), var(--surface); }
.cta-band h2 { font-size: clamp(1.3rem, 1rem + 1.3vw, 2rem); max-width: 28rem; }
.pubfoot { padding: 2.6rem 0; border-top: 1px solid var(--line); }
.pubfoot .pub-wrap { display: grid; gap: 1rem; }
.pubfoot .muted { max-width: 44rem; }

/* ---- Error pages ---- */
.err-body { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.err-card { text-align: center; display: grid; justify-items: center; gap: .8rem; max-width: 26rem; animation: enter .6s var(--ease) both; }
.err-ring { display: grid; place-items: center; width: 5.5rem; height: 5.5rem; border-radius: 50%; border: 1px dashed var(--line-2); box-shadow: 0 0 0 .8rem var(--primary-soft); }
.err-ring .mark { width: 2.4rem; height: 2.4rem; }
.err-code { font: 700 .9rem var(--font-mono); color: var(--accent); margin-top: .6rem; }
.err-card h1 { font-size: 1.8rem; }
.err-card p { color: var(--text-2); }
.err-card .btn { margin-top: .8rem; }


/* ==========================================================================
   Phase 2–4 components
   ========================================================================== */
.mark-img { object-fit: contain; border-radius: .4rem; }
.notice { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1.1rem; margin-bottom: 1.4rem; border-radius: var(--r-md); border: 1px solid var(--line-2); background: linear-gradient(90deg, var(--accent-soft), transparent 70%); color: var(--text-2); font-size: .9rem; }
.notice .i { color: var(--accent); margin-top: .1rem; }
.notice b { color: var(--text); }

/* notifications */
.bell { position: relative; }
.bell-dot { position: absolute; top: .55rem; right: .6rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--err); box-shadow: 0 0 0 .2rem var(--surface); animation: ping-s 2.4s ease-out 2; }
@keyframes ping-s { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--err) 60%, transparent); } 100% { box-shadow: 0 0 0 .6rem transparent; } }
.menu-wide { min-width: min(22rem, calc(100vw - 2rem)); max-height: 70vh; overflow-y: auto; }
.menu-empty { padding: 1rem .8rem; color: var(--muted); font-size: .9rem; }
.note { display: grid; gap: .1rem; padding: .7rem .8rem; border-radius: var(--r-sm); }
.note + .note { border-top: 1px solid var(--line); }
.note b { font-size: .86rem; word-break: break-all; }
.note span { font-size: .82rem; color: var(--text-2); }
.note small { color: var(--muted); font-size: .72rem; }
@media (max-width: 1023px) { .menu-wide { position: fixed; left: 1rem; right: 1rem; top: calc(4.2rem + var(--sat)); } }

/* google account cards */
.g-badge { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .8rem; font: 800 1.1rem var(--font-display); color: #fff; background: conic-gradient(from 210deg, #4285f4, #34a853, #fbbc05, #ea4335, #4285f4); }
.acct-id { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.acct .card-head { flex-wrap: wrap; }
.prop { display: inline-flex; align-items: center; gap: .6rem; min-width: 0; }
.prop .i { color: var(--accent); }
.prop b { overflow-wrap: anywhere; }
.dtable tr.is-selected { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--accent); }

/* tabs */
.tabs { display: flex; gap: .3rem; padding: .45rem; margin: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tabs-flat { background: transparent; border: 1px solid var(--line); border-radius: var(--r-md); display: inline-flex; padding: .3rem; margin-bottom: 0; }
.tab { min-height: 2.5rem; padding: .4rem 1.1rem; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font: 600 .9rem var(--font-body); cursor: pointer; transition: background .2s, color .2s; display: inline-flex; align-items: center; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-on { background: var(--primary-soft); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.submit-grid { align-items: start; }
.pane { margin-top: 1.2rem; }
.pane[hidden] { display: none; }
.textarea { min-height: 9rem; resize: vertical; font-family: var(--font-mono); font-size: .88rem; line-height: 1.6; }
.select-sm { width: auto; min-width: 11rem; }
.toolbar-wrap { align-items: end; }
.date { display: grid; gap: .25rem; font-size: .76rem; font-weight: 700; color: var(--muted); }
.date .input { min-height: 2.9rem; }

/* dropzone */
.drop { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border: 1.5px dashed var(--line-2); border-radius: var(--r-md); cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop.is-over { transform: scale(1.01); }
.drop > .i { width: 1.6rem; height: 1.6rem; color: var(--accent); }
.drop-t { display: grid; line-height: 1.35; min-width: 0; }
.drop-t small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

/* button loading */
.btn.is-loading { position: relative; pointer-events: none; }
.btn.is-loading::after { content: ''; width: 1rem; height: 1rem; margin-left: .2rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.is-loading .i { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* progress + results */
.progress { height: 3px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: slide 1.1s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.results { max-height: 34rem; overflow-y: auto; }
.res { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.35rem; border-bottom: 1px solid var(--line); animation: enter .45s var(--ease) both; }
.res:last-child { border-bottom: 0; }
.res-main { display: grid; min-width: 0; }
.res-url { font: 600 .84rem var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-main small { font-size: .76rem; }

/* url table cells */
.cell-url { max-width: 20rem; }
.url-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 .85rem var(--font-mono); }
.cell-resp { max-width: 16rem; }
.cell-resp span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.dtable tr.is-gone { opacity: 0; transform: translateX(1rem); transition: all .35s var(--ease); }
.actions .btn .i { width: 1rem; height: 1rem; }

/* detail dialog */
.dlg-lg { width: min(46rem, calc(100vw - 1.5rem)); }
.dlg-lg .dlg-body { max-height: 88dvh; overflow-y: auto; }
.dd-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.dd-url { font: 600 1rem var(--font-mono); overflow-wrap: anywhere; margin: .2rem 0; }
.dd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: .6rem; }
.dd-h { margin-bottom: .6rem; }
.tag { display: inline-block; padding: .2rem .65rem; border-radius: 2rem; font: 700 .72rem var(--font-body); letter-spacing: .01em; }
.tag-app { background: var(--primary-soft); color: var(--primary); }
.tag-google { background: var(--accent-soft); color: var(--accent); }
.dd-cols .kv dd { text-align: right; overflow-wrap: anywhere; max-width: 60%; }
.dd-cols .kv dd.na { color: var(--muted); font-weight: 500; font-style: italic; }
@media (max-width: 720px) { .dd-cols { grid-template-columns: 1fr; } .dlg-lg { width: calc(100vw - 1rem); } }

/* switches, checks, previews */
.switch { display: flex; align-items: flex-start; gap: .9rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.sw { position: relative; flex: none; width: 2.8rem; height: 1.6rem; border-radius: 2rem; background: var(--line-2); transition: background .25s; margin-top: .1rem; }
.sw::after { content: ''; position: absolute; top: .2rem; left: .2rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.switch input:checked + .sw { background: var(--accent); }
.switch input:checked + .sw::after { transform: translateX(1.2rem); }
.switch input:focus-visible + .sw { outline: 2px solid var(--primary); outline-offset: 2px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.checks li { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; font-weight: 600; animation: enter .4s var(--ease) both; }
.checks .tick { display: grid; place-items: center; flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; }
.checks .tick .i { width: .9rem; height: .9rem; stroke-width: 2.6; }
.checks .ok .tick { background: var(--accent); color: #05231d; }
.checks .bad .tick { background: var(--err); color: #fff; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.preview { display: flex; align-items: center; gap: 1rem; padding: .6rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.preview img { max-height: 2.6rem; max-width: 9rem; object-fit: contain; }
.form-row { display: flex; gap: .7rem; margin-top: .4rem; }
.logview { margin: 0; padding: 1.2rem 1.35rem; max-height: 34rem; overflow: auto; font: 500 .78rem/1.6 var(--font-mono); color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
input[type="file"].input { padding: .5rem .7rem; }


/* ==========================================================================
   Plans, engines, usage ring, admin extras (v2)
   ========================================================================== */
.sec-title { margin: 2.4rem 0 .4rem; font-size: 1.35rem; }
.sec-sub { margin-bottom: 1.2rem; max-width: 46rem; }
.credit-strip { display: flex; align-items: center; gap: 1.2rem; padding: .85rem 1.2rem; margin-bottom: 1.4rem; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow); }
.credit-strip > div:not(.bar-mini) { display: grid; line-height: 1.15; }
.credit-strip b { font: 700 1.4rem var(--font-display); font-variant-numeric: tabular-nums; }
.credit-strip span { font-size: .74rem; color: var(--muted); font-weight: 600; }
.bar-mini { flex: 1; height: .45rem; border-radius: 1rem; background: var(--line); overflow: hidden; min-width: 3rem; }
.bar-mini i { display: block; height: 100%; border-radius: 1rem; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .8s var(--ease); }

/* usage ring */
.usage-body { display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: center; }
.ring { position: relative; width: 9.5rem; aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg, .ring-fg { fill: none; stroke-width: 9; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; animation: ringIn 1.2s var(--ease) both; }
@keyframes ringIn { from { stroke-dashoffset: 327; } }
.ring-t { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-t b { font: 700 2.2rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ring-t small { font-size: .74rem; color: var(--muted); font-weight: 600; }
@media (max-width: 520px) { .usage-body { grid-template-columns: 1fr; justify-items: center; } .usage-body .kv { width: 100%; } }

/* plan cards */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.1rem; }
.plan { position: relative; display: flex; flex-direction: column; gap: .7rem; padding: 1.5rem; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); transition: transform .3s var(--ease), border-color .3s; overflow: hidden; }
.plan::after { content: ''; position: absolute; right: -2.5rem; top: -2.5rem; width: 7rem; height: 7rem; border-radius: 50%; border: 1px solid var(--line-2); box-shadow: 0 0 0 .8rem var(--primary-soft); pointer-events: none; }
.plan:hover { transform: translateY(-4px); border-color: var(--line-2); }
.plan.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan h3 { font-size: 1.1rem; }
.price { display: flex; align-items: baseline; gap: .5rem; }
.price b { font: 700 2.1rem/1 var(--font-display); letter-spacing: -.03em; }
.price small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.plan-links { font-size: .98rem; } .plan-links b { color: var(--accent); font-family: var(--font-display); font-size: 1.15rem; }
.plan-feat { list-style: none; margin: .3rem 0 .6rem; padding: 0; display: grid; gap: .45rem; font-size: .9rem; color: var(--text-2); flex: 1; }
.plan-feat li { display: flex; gap: .55rem; align-items: center; }
.plan-feat .i { width: 1rem; height: 1rem; color: var(--accent); stroke-width: 2.6; }
.pay-box { margin: 0; padding: 1rem 1.35rem; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--accent-soft), transparent 75%); font-size: .92rem; }
.pay-box p { margin-top: .3rem; color: var(--text-2); overflow-wrap: anywhere; }
.ref-form { display: flex; gap: .5rem; margin-bottom: .5rem; }
.ref-form .input { min-height: 2.25rem; font-size: .85rem; min-width: 12rem; }

/* engines */
.engines { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.engines legend { font-size: .86rem; font-weight: 600; color: var(--text-2); padding: 0; margin-bottom: .5rem; }
.engines.compact { gap: .2rem; }
.engine { position: relative; cursor: pointer; display: block; }
.engine input { position: absolute; opacity: 0; }
.engine-card { display: grid; gap: .15rem; padding: .8rem 1rem .8rem 2.9rem; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface-2); transition: border-color .2s, background .2s; position: relative; }
.engine-card::before { content: ''; position: absolute; left: 1rem; top: 50%; width: 1.15rem; height: 1.15rem; margin-top: -.575rem; border-radius: .3rem; border: 1.5px solid var(--line-2); transition: all .2s var(--ease); }
.engine-card small { color: var(--muted); font-size: .8rem; }
.engine:hover .engine-card { border-color: var(--primary); }
.engine input:checked + .engine-card { border-color: var(--accent); background: var(--accent-soft); }
.engine input:checked + .engine-card::before { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2305231d' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/75% no-repeat; border-color: var(--accent); }
.engine input:focus-visible + .engine-card { outline: 2px solid var(--primary); outline-offset: 2px; }
.notice-warn { background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 14%, transparent), transparent 75%); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.notice-warn .i { color: var(--warn); }
.notice.flat { margin-bottom: 1.2rem; }
.copyline { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; flex-wrap: wrap; }
.copyline code, .mono-box { font: 600 .82rem var(--font-mono); padding: .35rem .6rem; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); overflow-wrap: anywhere; color: var(--text); }
.field > .notice { margin-bottom: 0; }
#action { max-width: 22rem; }
.engs { display: inline-flex; gap: .35rem; flex-wrap: wrap; }
.eng { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: .5rem; font: 700 .72rem var(--font-body); border: 1px solid var(--line-2); color: var(--text-2); }
.eng i { width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }
.eng-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.eng-info { color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.eng-err { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); background: color-mix(in srgb, var(--err) 10%, transparent); }
.eng-muted { color: var(--muted); }
.key-box { padding: 1rem 1.35rem; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--primary-soft), transparent 80%); display: grid; gap: .5rem; font-size: .9rem; }
.key-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.key-row .mono { overflow-wrap: anywhere; font-size: .78rem; }

/* admin extras */
.sa-box { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface-2); }
.sa-box .i { color: var(--accent); }
.sa-box b { overflow-wrap: anywhere; font-size: .9rem; }
.plain-ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .6rem; color: var(--text-2); font-size: .92rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }
.textarea-sm { min-height: 6rem; font-family: var(--font-body); font-size: .92rem; }
.decide { display: grid; gap: .5rem; min-width: 14rem; }
.decide .input { min-height: 2.25rem; font-size: .85rem; }
.test-card { animation: enter .4s var(--ease) both; }
.plans-admin .rows li { align-items: flex-start; flex-wrap: wrap; }
@media (max-width: 720px) { .decide { min-width: 0; } .ref-form { flex-direction: column; } .ref-form .input { min-width: 0; } }

/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sweep { 0% { transform: rotate(0); opacity: 0; } 6% { opacity: 1; } 94% { opacity: 1; } 100% { transform: rotate(360deg); opacity: 0; } }
@keyframes pinIn { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
@keyframes ping { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.2); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(1.5rem); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(1.5rem); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr; }
  .form-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li::after { display: none; }
  .faq-wrap { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* Tablet + phone: sidebar becomes a bottom tab bar + "More" sheet */
@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar .brand-sm { display: inline-flex; }
  .top-title { display: none; }
  .content { padding-bottom: calc(6.5rem + var(--sab)); }
  .app-foot { padding-bottom: calc(5.5rem + var(--sab)); flex-direction: column; }
  .grid-2 { grid-template-columns: 1fr; }

  .bottomnav { position: fixed; z-index: 60; left: .75rem; right: .75rem; bottom: calc(.75rem + var(--sab)); display: flex; justify-content: space-around; gap: .2rem; padding: .35rem; border-radius: 1.4rem; background: color-mix(in srgb, var(--elev) 88%, transparent); border: 1px solid var(--line-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .65); }
  .bn-item { flex: 1; min-width: 0; display: grid; justify-items: center; align-content: center; gap: .2rem; min-height: 3.5rem; padding: .3rem .2rem; border: 0; border-radius: 1.05rem; background: transparent; color: var(--muted); font: 600 .68rem var(--font-body); cursor: pointer; transition: background .2s, color .2s; -webkit-tap-highlight-color: transparent; }
  .bn-item:hover { text-decoration: none; color: var(--text); }
  .bn-item.is-active { background: var(--primary-soft); color: var(--text); }
  .bn-item.is-active .i { color: var(--accent); }
  .bn-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

  .sheet-backdrop { position: fixed; inset: 0; z-index: 70; display: block; background: rgba(5, 8, 20, .6); backdrop-filter: blur(2px); animation: fade .25s both; }
  .sheet { position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; display: grid; gap: 1rem; max-height: 86dvh; overflow-y: auto; padding: .7rem 1.1rem calc(1.2rem + var(--sab)); border-radius: 1.6rem 1.6rem 0 0; background: var(--elev); border: 1px solid var(--line-2); border-bottom: 0; animation: sheetUp .38s var(--ease) both; }
  .sheet[hidden] { display: none !important; }
  .sheet-grip { width: 2.6rem; height: .3rem; border-radius: 1rem; background: var(--line-2); margin: 0 auto .3rem; }
  .me-sheet { padding: .3rem .4rem; }
  .sheet-nav { display: grid; gap: .25rem; }
  .sheet-actions { display: grid; gap: .6rem; }
  .sheet-actions form { display: contents; }
  .toasts { top: auto; bottom: calc(6rem + var(--sab)); right: .75rem; left: .75rem; width: auto; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .radar-wrap { order: -1; }
  .radar { width: min(100%, 24rem); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-lg { grid-column: 1 / -1; grid-row: auto; min-height: 13rem; }
  .trust { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .pub-cta .btn, .pub-cta .icon-btn[data-theme-toggle] { display: none; }
  .pub-burger { display: inline-grid; }
  .pub-links { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: .6rem 1.1rem 1.1rem; background: var(--elev); border-bottom: 1px solid var(--line-2); box-shadow: var(--shadow); clip-path: inset(0 0 100% 0); opacity: 0; visibility: hidden; transition: clip-path .35s var(--ease), opacity .25s, visibility 0s .35s; }
  .pubnav.is-open .pub-links { clip-path: inset(0 0 0 0); opacity: 1; visibility: visible; transition: clip-path .35s var(--ease), opacity .25s; }
  .pub-links > a { padding: .9rem .3rem; min-height: 3rem; border-bottom: 1px solid var(--line); }
  .pub-links > a::after { display: none; }
  .pub-cta-m { display: grid; gap: .6rem; padding-top: 1rem; }
  .pubnav .pub-wrap { position: relative; }
  .pubnav { position: sticky; }
  .pub-links { position: absolute; }
}

@media (max-width: 720px) {
  .page-head { align-items: stretch; }
  .form-inline { grid-template-columns: 1fr; }
  .kv-flat { max-width: none; }

  /* tables become stacked cards */
  .dtable thead { display: none; }
  .dtable, .dtable tbody, .dtable tr, .dtable td { display: block; width: 100%; }
  .dtable tr { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
  .dtable tbody tr:last-child { border-bottom: 0; }
  .dtable td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .35rem 0; border: 0; text-align: right; }
  .dtable td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 700; text-align: left; flex: none; }
  .dtable td[data-label="User"] { display: block; text-align: left; padding-bottom: .6rem; }
  .dtable td[data-label="User"]::before, .dtable td[data-label="Actions"]::before { display: none; }
  .dtable td[data-label="Actions"] { padding-top: .8rem; }
  .actions { width: 100%; justify-content: stretch; }
  .actions > *, .actions form { flex: 1; }
  .actions .btn { width: 100%; }
  .toolbar .btn-primary { width: 100%; }
  .chips { width: 100%; }
}

@media (max-width: 600px) {
  .pin span { display: none; }
  .steps { grid-template-columns: 1fr; }
  .mock-stats { grid-template-columns: repeat(2, 1fr); }
  .mock-body { grid-template-columns: 3rem minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid-sm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: .95rem; }
  .bento { grid-template-columns: 1fr; }
  .card-head { padding: 1rem; } .card-body { padding: 1rem; } .rows li { padding: .8rem 1rem; }
  .hero-cta .btn { flex: 1 1 100%; }
  .cta-band .btn { width: 100%; }
  .toasts { left: .75rem; right: .75rem; }
}

@media (hover: none) {
  .btn:hover, .stat:hover, .bt:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .radar-sweep { display: none; }
}
