/* Closify web app — same brand tokens as the landing page (webapp/index.html) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* T-105: docs/DA.md palette (60 navy / 30 white + cream / 10 coral). Coral = primary CTA button only. */
  --navy: #081B30;
  --navy-2: #0F2744;
  --cream: #F8F7F4;
  --cta: #FF5A4E;
  --cta-hover: #E8473B;
  --cta-ink: #081B30;          /* navy text on coral = 5.6:1 */
  --bg: #081B30;               /* page */
  --bg2: #0F2744;              /* cards, sidebar (DA elevated navy) */
  --bg3: #15314F;              /* inner surfaces */
  --bg4: #1B3B5E;              /* hover / selected */
  --border: #23446B;
  --border2: #335A85;
  --field-bg: rgba(255, 255, 255, .04);
  --field-line: #3A5D85;
  --line-strong: rgba(184, 199, 217, .45);
  --accent: #FFFFFF;           /* selected / active / focus on navy (was blue / purple) */
  --accent-ink: #081B30;       /* text on --accent */
  --accent-soft: #DCE5EF;      /* icons and highlights on navy */
  --focus: #FFFFFF;
  --focus-ring: rgba(255, 255, 255, .22);
  --tint-1: rgba(255, 255, 255, .03);
  --tint-2: rgba(255, 255, 255, .06);
  --tint-3: rgba(255, 255, 255, .1);
  --tint-4: rgba(255, 255, 255, .16);
  --tint-line: rgba(184, 199, 217, .28);
  --ok: #16A34A;               /* micro-only fills */
  --green: #5BD38A;            /* success text / icons on navy (AA) */
  --amber: #FBBF24;
  --red: #FCA5A5;              /* error text / icons, kept pink-red so it never reads as the coral CTA */
  --err-text: #FECACA;
  --text: #FFFFFF;
  --subtle: #B8C7D9;
  --muted: #93A7BE;            /* >= 4.6:1 on every navy step */
  --placeholder: #8DA1B8;
  --radius: 16px;
  --sidebar: 256px;
  --shadow: 0 20px 50px rgba(2, 10, 20, .45), 0 0 0 1px rgba(255, 255, 255, .03);
  --font-head: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

/* T-105: light action cards (white, like the landing hero card). The same components re-skin
   themselves through these local tokens; nothing inside needs its own light rules. */
.auth-card, .try-card, .plan, .modal-upgrade .modal-card {
  --bg2: #FFFFFF;
  --bg3: #F8F7F4;
  --bg4: #EFEDE7;
  --border: #E3E1DB;
  --border2: #C9D3DE;
  --field-bg: #F8F7F4;
  --field-line: #B4C0CE;
  --line-strong: #C9D3DE;
  --accent: #081B30;
  --accent-ink: #FFFFFF;
  --accent-soft: #081B30;
  --focus: #081B30;
  --focus-ring: rgba(8, 27, 48, .16);
  --tint-1: rgba(8, 27, 48, .025);
  --tint-2: rgba(8, 27, 48, .05);
  --tint-3: rgba(8, 27, 48, .07);
  --tint-4: rgba(8, 27, 48, .1);
  --tint-line: rgba(8, 27, 48, .16);
  --green: #15803D;
  --amber: #B45309;
  --red: #B42318;
  --err-text: #7A271A;
  --text: #081B30;
  --subtle: #4A5D73;
  --muted: #5E6F84;
  --placeholder: #5E6F84;     /* 4.8:1 on the cream field */
  --shadow: 0 24px 60px rgba(2, 10, 20, .45);
  color: var(--text);
  color-scheme: light;
}

html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent-soft); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--subtle); }
.mono { font-variant-numeric: tabular-nums; }
/* T-105: headings and big numbers in Space Grotesk (docs/DA.md section 5) */
h1, h2, h3, .page-title, .auth-title, .aside-title, .try-title, .modal-title, .section-title, .stat-num, .plan-price, .logo { font-family: var(--font-head); letter-spacing: -.03em; }
.center { text-align: center; }
.fine { font-size: .78rem; color: var(--muted); }
.grad { color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- icons ---------- */
.ic { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-star { fill: var(--amber); stroke: var(--amber); width: 15px; height: 15px; }
.ic-star-off { fill: none; stroke: var(--muted); }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .logo-icon { width: 48px; height: 48px; font-size: 17px; border-radius: 12px; animation: pulse 1.4s infinite; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; }
.logo:hover { color: var(--text); }
.logo-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--navy); letter-spacing: 0;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font-size: .875rem; font-weight: 700; line-height: 1.2; cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s, color .2s;
  white-space: nowrap; text-decoration: none; user-select: none;
}
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--cta); color: var(--cta-ink); box-shadow: 0 6px 18px rgba(2, 10, 20, .22); }
.btn-primary:hover { color: var(--cta-ink); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(2, 10, 20, .28); }
.btn-primary:active { background: var(--cta-hover); transform: none; }
/* T-105 coral discipline: coral is the ONE primary action of a view. Repeated row buttons, page-head
   shortcuts and secondary panels that also use .btn-primary get the solid white (navy on light) style. */
.btn-primary.btn-sm, .page-actions .btn-primary, .grid-account .btn-primary, .soon .btn-primary {
  background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn-primary.btn-sm:hover, .page-actions .btn-primary:hover, .grid-account .btn-primary:hover, .soon .btn-primary:hover {
  color: var(--accent-ink); background: var(--accent-soft); box-shadow: none; }
/* :has() stays in its own rules: a browser without :has() drops the whole selector list it sits in. */
.try-main:has(.try-result .btn-primary) .try-form .btn-primary {
  background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.try-main:has(.try-result .btn-primary) .try-form .btn-primary:hover {
  color: var(--accent-ink); background: var(--accent-soft); box-shadow: none; }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--text); background: var(--tint-2); }
.btn-ghost { background: transparent; color: var(--subtle); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-lg { padding: 13px 24px; font-size: .95rem; border-radius: 14px; }
.btn-sm { padding: 7px 12px; font-size: .8rem; border-radius: 10px; }
.btn-block { width: 100%; white-space: normal; text-align: center; }   /* T-105: long labels wrap instead of spilling out */
.btn:disabled, .btn.is-busy { opacity: .75; cursor: default; transform: none; }
.btn-current { background: rgba(22, 163, 74, .1); border: 1px solid rgba(22, 163, 74, .4); color: #166534; cursor: default; }   /* only on the light plan cards: 4.5:1+ */
.icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--border); background: var(--tint-1);
  color: var(--subtle); cursor: pointer; transition: all .2s; flex-shrink: 0;
}
.icon-btn:hover { color: var(--text); border-color: var(--border2); background: var(--bg4); }
.icon-btn .ic { width: 16px; height: 16px; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--tint-4); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; flex-shrink: 0; }
.spinner-sm { width: 14px; height: 14px; }
.btn-primary .spinner { border-color: rgba(8, 27, 48, .25); border-top-color: var(--cta-ink); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: .8rem; font-weight: 600; color: var(--subtle); display: flex; align-items: center; gap: 6px; }
.field-hint { font-size: .75rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select {
  width: 100%; background: var(--field-bg); border: 1px solid var(--field-line);
  border-radius: 12px; padding: 11px 14px; font-size: .9rem; color: var(--text);
  transition: border-color .2s, box-shadow .2s, background .2s; outline: none;
}
input::placeholder { color: var(--placeholder); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--subtle) 50%), linear-gradient(135deg, var(--subtle) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
select option { background: var(--bg2); }
.input-lg { padding: 13px 14px; font-size: 1rem; }
.input-sm { padding: 8px 12px; font-size: .85rem; }
.input-ic { position: relative; display: flex; align-items: center; }
.input-ic > .ic { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.input-ic > input { padding-left: 40px; }
.input-ic-sm > .ic { width: 15px; height: 15px; left: 11px; }
.input-ic-sm > input { padding-left: 34px; min-width: 220px; }
.form-error { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .4); color: var(--err-text); font-size: .85rem; }
.form-error .ic { color: var(--red); margin-top: 1px; }
.form-error a { color: var(--err-text); font-weight: 700; text-decoration: underline; }

input[type=range] { width: 100%; accent-color: var(--accent-soft); height: 24px; }
.range-val { margin-left: auto; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* checkbox */
.cb { appearance: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--field-line); background: var(--field-bg); cursor: pointer; display: inline-grid; place-content: center; transition: all .15s; flex-shrink: 0; }
.cb::after { content: ''; width: 9px; height: 5px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .12s; }
.cb:checked { background: var(--accent); border-color: var(--accent); }
.cb:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.cb:indeterminate { background: var(--accent); border-color: var(--accent); }
.cb:indeterminate::after { border-left: 0; width: 9px; height: 0; transform: none; }

/* switch */
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--tint-1); transition: border-color .2s, background .2s; }
.switch:hover { border-color: var(--border2); }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 38px; height: 22px; border-radius: 999px; background: var(--border2); position: relative; flex-shrink: 0; transition: background .2s; margin-top: 1px; }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.switch-input:checked + .switch-track { background: var(--accent); }
.switch-input:checked + .switch-track .switch-knob { background: var(--accent-ink); }
.switch-input:checked + .switch-track .switch-knob { transform: translateX(16px); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch:has(.switch-input:checked) { border-color: var(--tint-line); background: var(--tint-2); }
.switch-txt { display: flex; flex-direction: column; gap: 2px; }
.switch-label { font-weight: 600; font-size: .9rem; }
.switch-desc { font-size: .78rem; color: var(--muted); }

/* segmented */
.seg { align-self: flex-start; max-width: 100%; display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--tint-1); border: 1px solid var(--border); border-radius: 11px; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--subtle); font-weight: 600; font-size: .82rem; padding: 7px 13px; border-radius: 8px; cursor: pointer; transition: all .15s; }
.seg-btn .ic { width: 15px; height: 15px; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

/* chips */
.chips-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 48px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--tint-1); cursor: text; transition: border-color .2s, box-shadow .2s; }
.chips-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.chips-field { flex: 1; min-width: 140px; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 6px 6px !important; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 11px; border-radius: 8px; background: var(--tint-3); border: 1px solid var(--tint-line); color: var(--text); font-size: .82rem; font-weight: 500; }
.chip-x { border: 0; background: transparent; color: inherit; cursor: pointer; width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; opacity: .7; }
.chip-x:hover { opacity: 1; background: var(--tint-3); }
.chip-x .ic { width: 13px; height: 13px; }
.chip-ghost { background: transparent; border-color: var(--border); color: var(--subtle); padding: 5px 11px 5px 8px; cursor: pointer; transition: all .15s; }
.chip-ghost:hover { border-color: var(--accent); color: var(--text); }
.chip-ghost .ic { width: 13px; height: 13px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.suggest-lbl { font-size: .75rem; color: var(--muted); margin-right: 2px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 40px 16px 24px; position: relative; overflow: hidden; }
.auth-glow { position: absolute; top: -200px; left: 50%; transform: translateX(-50%); width: 1100px; max-width: 100vw; height: 700px; background: radial-gradient(ellipse at center top, rgba(184, 199, 217, .10) 0%, transparent 60%); pointer-events: none; }
.auth-logo { position: relative; margin-bottom: 36px; font-size: 1.2rem; }
.auth-body { position: relative; width: 100%; max-width: 440px; display: grid; gap: 28px; align-items: center; }
.auth-split .auth-body { max-width: 960px; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 56px; }
.auth-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow); position: relative; }
.auth-card::before { content: none; }
.auth-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; margin-bottom: 6px; }
.auth-sub { color: var(--subtle); font-size: .9rem; margin-bottom: 26px; }
.auth-switch { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 22px; }
.auth-switch a { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.auth-forgot { font-size: .8rem; color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.auth-forgot:hover { color: var(--subtle); }
.auth-foot { position: relative; margin-top: auto; padding-top: 40px; font-size: .75rem; color: var(--muted); }
.auth-foot a { color: var(--muted); text-decoration: underline; }
.auth-aside { padding: 8px 0; }
.aside-title { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: 18px 0 22px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; background: var(--tint-2); border: 1px solid var(--tint-line); border-radius: 999px; font-size: .78rem; font-weight: 500; color: var(--subtle); }
.badge-dot { width: 6px; height: 6px; background: var(--ok); border-radius: 50%; animation: pulse 2s infinite; }
.check-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }
.check-list li { position: relative; padding-left: 30px; color: var(--subtle); font-size: .92rem; }
.check-list li::before { content: '\2713'; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 6px; background: var(--tint-3); color: var(--text); font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.check-list strong { color: var(--text); font-weight: 600; }
.aside-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.step-mini { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg2); }
.step-mini div { display: flex; flex-direction: column; font-size: .75rem; color: var(--muted); line-height: 1.35; }
.step-mini strong { color: var(--text); font-size: .85rem; margin-bottom: 2px; }
.step-mini-n { width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; background: var(--accent); color: var(--accent-ink); font-family: var(--font-head); font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.pw-wrap { display: flex; flex-direction: column; gap: 6px; }
.pw-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pw-meter span { height: 3px; border-radius: 2px; background: var(--border); transition: background .2s; }
.pw-meter.s1 span:nth-child(1) { background: var(--red); }
.pw-meter.s2 span:nth-child(-n+2) { background: var(--amber); }
.pw-meter.s3 span { background: var(--ok); }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 14px; gap: 26px; z-index: 30;
}
.sidebar .logo { padding: 2px 8px; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-toggle { flex-shrink: 0; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--subtle); font-weight: 500; font-size: .9rem; transition: all .15s; position: relative; }
.nav-link:hover { color: var(--text); background: var(--tint-1); }
.nav-link.active { color: var(--text); background: var(--tint-3); }
.nav-link.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-link.active .ic { color: var(--text); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; display: grid; place-items: center; animation: pulse 1.6s infinite; }
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.side-plan { padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg3); display: flex; flex-direction: column; gap: 10px; }
.side-plan-row { display: flex; align-items: center; justify-content: space-between; }
.side-plan-up { font-size: .78rem; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.plan-chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; background: var(--tint-2); color: var(--subtle); border: 1px solid var(--border); }
.plan-chip.plan-starter { background: var(--tint-3); color: var(--text); border-color: var(--tint-line); }
.plan-chip.plan-pro { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.mini-meter-row { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.side-user-txt { min-width: 0; flex: 1; }
.side-user-name { font-size: .83rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-mail { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 32px; background: rgba(8, 27, 48, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.top-title { font-size: .95rem; font-weight: 600; color: var(--subtle); letter-spacing: -.01em; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid var(--border); background: var(--tint-1); color: var(--subtle); font-variant-numeric: tabular-nums; }
.pill .ic { width: 14px; height: 14px; color: var(--accent-soft); }
.pill:hover { color: var(--text); border-color: var(--border2); }
.pill-queue { color: var(--text); background: var(--tint-3); border-color: var(--tint-line); }
.pill-warn { color: var(--amber); border-color: rgba(251, 191, 36, .4); }
.pill-warn .ic { color: var(--amber); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .78rem; font-weight: 700; color: var(--text); background: var(--bg4); border: 1px solid var(--border2); flex-shrink: 0; }
.avatar:hover { color: var(--text); border-color: var(--accent); }
.avatar-sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.main { padding: 32px 32px 64px; max-width: 1240px; width: 100%; margin: 0 auto; outline: none; }
.main.has-actionbar { padding-bottom: 120px; }
.backdrop { display: none; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head-txt { min-width: 0; }
.page-title { font-size: clamp(1.45rem, 2.4vw, 1.9rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.page-sub { color: var(--subtle); margin-top: 6px; font-size: .92rem; max-width: 640px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); margin-bottom: 14px; font-weight: 500; }
.back .ic { width: 15px; height: 15px; }
.back:hover { color: var(--text); }
.section-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -.02em; margin: 36px 0 16px; }

/* ---------- cards ---------- */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { font-size: .98rem; font-weight: 700; letter-spacing: -.01em; }
.link-sm { font-size: .8rem; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
/* T-74 fix round 3: a grid item's minimum width is its content's, so one long unbreakable
   name would widen the whole grid (T-105: this comment was never closed, so the rule below was dead) */
.grid-2 > * { min-width: 0; }
/* T-78 (F-6): prevent long email in account Profile card from overflowing */
.profile > div { min-width: 0; }
.profile .muted { overflow-wrap: anywhere; }


/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; min-height: 150px; }
.stat-top { display: flex; align-items: center; gap: 10px; }
.stat-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--tint-2); border: 1px solid var(--border2); color: var(--accent-soft); }
.stat-ic .ic { width: 16px; height: 16px; }
.stat-label { font-size: .82rem; color: var(--subtle); font-weight: 500; }
.stat-num { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-num span { font-family: var(--font-body); font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stat-foot { font-size: .76rem; color: var(--muted); }
.stat-plan { background: var(--bg2); border-color: var(--border2); }
.stat-plan .stat-ic { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stat-plan .btn { align-self: flex-start; margin-top: auto; }

/* bars */
.bar { height: 6px; border-radius: 999px; background: var(--tint-3); overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: var(--accent-soft); transition: width .5s ease; }
.bar-lg { height: 8px; }
.bar-full > span { background: var(--amber); }
.bar-unl > span { background: var(--tint-line); }
.bar-anim > span { position: relative; overflow: hidden; }
.bar-anim > span::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); animation: sheen 1.4s infinite; }
@keyframes sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* hero CTA */
.hero-cta { display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: center; padding: 30px 32px; border-radius: 20px; margin-bottom: 20px; position: relative; overflow: hidden; color: var(--text); border: 1px solid var(--border2); background: radial-gradient(ellipse at 85% 50%, rgba(184, 199, 217, .10), transparent 55%), var(--bg2); transition: border-color .2s, transform .2s; }
.hero-cta:hover { color: var(--text); border-color: var(--line-strong); }
.hero-cta:hover .btn-primary { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(2, 10, 20, .28); }
.hero-cta h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.2; margin: 6px 0 8px; }
.hero-cta p { color: var(--subtle); font-size: .92rem; max-width: 540px; margin-bottom: 20px; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--subtle); }
.hero-cta-art { position: relative; height: 170px; }

.radar { position: absolute; top: 50%; left: 50%; border-radius: 50%; border: 1px solid rgba(184, 199, 217, .35); transform: translate(-50%, -50%); animation: radar 3.2s ease-out infinite; }
.radar.r1 { width: 60px; height: 60px; }
.radar.r2 { width: 120px; height: 120px; animation-delay: .8s; }
.radar.r3 { width: 180px; height: 180px; animation-delay: 1.6s; }
@keyframes radar { 0% { opacity: .9; transform: translate(-50%, -50%) scale(.6); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); } }
.art-pin { position: absolute; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg3); border: 1px solid var(--border2); color: var(--accent-soft); box-shadow: 0 8px 20px rgba(2, 10, 20, .4); animation: bob 3s ease-in-out infinite; }
.art-pin .ic { width: 16px; height: 16px; }
.art-pin.p1 { top: 14%; left: 22%; }
.art-pin.p2 { top: 58%; left: 12%; animation-delay: .6s; color: var(--subtle); }
.art-pin.p3 { top: 22%; right: 14%; animation-delay: 1.2s; color: var(--green); }
.art-pin.p4 { bottom: 8%; right: 30%; animation-delay: 1.8s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* lists */
.list { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 10px; color: var(--text); min-height: 56px; }
.row-link:hover { background: var(--tint-1); color: var(--text); }
.row-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--tint-2); color: var(--accent-soft); border: 1px solid var(--border2); }
.row-ic .ic { width: 16px; height: 16px; }
.row-ic-page { background: var(--accent); color: var(--accent-ink); font-family: var(--font-head); font-weight: 700; font-size: .9rem; border-color: var(--accent); }
.row-main { min-width: 0; flex: 1; }
.row-title { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-chev { color: var(--muted); width: 16px; height: 16px; }
.row-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.status { font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; flex-shrink: 0; }
.status-ok { background: rgba(22, 163, 74, .12); color: var(--green); border: 1px solid rgba(22, 163, 74, .35); }
.status-bad { background: rgba(248, 113, 113, .1); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }

/* empty / error */
.empty { text-align: center; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--tint-2); border: 1px solid var(--border2); color: var(--accent-soft); margin-bottom: 6px; }
.empty-ic .ic { width: 22px; height: 22px; }
.empty h3 { font-size: 1rem; font-weight: 700; }
.empty p { color: var(--muted); font-size: .86rem; max-width: 380px; }
.empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.error-box { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .35); color: var(--err-text); font-size: .86rem; grid-column: 1 / -1; }
.error-box .ic { color: var(--red); }
.error-box-txt { flex: 1; }
.info-banner { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg2); color: var(--subtle); margin-bottom: 18px; font-size: .88rem; }
.success-banner { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 14px; border: 1px solid rgba(22, 163, 74, .4); background: rgba(22, 163, 74, .1); margin-bottom: 18px; font-size: .9rem; color: var(--subtle); }
.success-banner strong { color: var(--text); }

/* skeletons */
.skel { border-radius: 12px; background: linear-gradient(90deg, var(--tint-1) 0%, var(--tint-3) 50%, var(--tint-1) 100%); background-size: 200% 100%; animation: skel 1.3s ease-in-out infinite; }
.skel-stat { height: 150px; }
.skel-row { height: 52px; margin: 4px 0; }
.skel-page { height: 290px; border-radius: var(--radius); }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- search form ---------- */
.search-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.card-form { padding: 8px 26px; }
.form-section { padding: 22px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 16px; }
.form-section:last-child { border-bottom: 0; }
.form-section-head { display: flex; align-items: center; gap: 10px; }
.form-section-head h3 { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.num { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-family: var(--font-head); font-size: .75rem; font-weight: 700; color: var(--accent-ink); background: var(--accent); }
.card-form .form-error { margin-top: 18px; }
.more { border: 1px solid var(--border); border-radius: 12px; }
.more summary { cursor: pointer; list-style: none; padding: 12px 14px; font-size: .86rem; font-weight: 600; color: var(--subtle); display: flex; align-items: center; justify-content: space-between; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: '+'; font-size: 1.1rem; color: var(--muted); }
.more[open] summary::after { content: '\2212'; color: var(--text); }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 4px 14px 16px; }
.span-2 { grid-column: span 2; }

/* map + radius slider (T-43) */
.map-box { display: flex; flex-direction: column; gap: 8px; }
.map { height: 300px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; background: var(--bg3); z-index: 0; }
.map-box.map-off .map { display: none; }
.map:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* OSM tiles are light: darken them to fit the app (images only; pin, circle and controls keep their colours) */
.map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); }
/* T-105: Leaflet sets its own Helvetica stack on the map; use the app font */
.map.leaflet-container { font-family: var(--font-body); }
/* T-105: let the navy map background show through a little, so the dark tiles read as navy, not grey */
.map .leaflet-tile-pane { opacity: .82; }
.map .leaflet-control-attribution { background: rgba(8, 27, 48, .82); color: var(--subtle); font-size: 10px; }
.map .leaflet-control-attribution a { color: var(--text); }
.map .leaflet-bar a { background: var(--bg2); color: var(--text); border-bottom-color: var(--border); }
.map .leaflet-bar a:hover { background: var(--bg4); }
.map .leaflet-bar { border: 1px solid var(--border); box-shadow: none; }
.map-pin { display: grid; place-items: center; cursor: grab; }
.map-pin-dot { width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; border: 4px solid var(--navy); box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 9px rgba(255, 255, 255, .22), 0 4px 12px rgba(2, 10, 20, .5); }
.map-pin:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 50%; }
.map-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.map-note { font-size: .78rem; color: var(--subtle); min-height: 1.2em; overflow-wrap: anywhere; flex: 1 1 200px; }
.map-note.dim { color: var(--muted); }
.map-note.warn { color: var(--amber); }
.map-note.pin { color: var(--text); font-weight: 700; }
.map-past-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--subtle); cursor: pointer; user-select: none; }
.map-past-toggle:hover { color: var(--text); }
.map-past-toggle .cb { width: 15px; height: 15px; border-radius: 4px; }
.map-past-toggle .cb::after { width: 7px; height: 4px; }
.map-box.map-off .map-past-toggle { display: none; }
.map-bar-actions { display: inline-flex; align-items: center; gap: 12px; }
.map-bar-fs-btn { font-size: .78rem; padding: 3px 8px; height: 26px; }
.map-box.map-off .map-fs-btn, .map-box.map-off .map-bar-fs-btn { display: none; }
.leaflet-tooltip.map-past-tooltip { background: var(--bg2); color: var(--text); border: 1px solid var(--border2); box-shadow: 0 4px 12px rgba(0, 0, 0, .4); font-size: .75rem; border-radius: 6px; padding: 4px 8px; font-family: inherit; }
.leaflet-tooltip-top.map-past-tooltip::before { border-top-color: var(--border2); }
.leaflet-tooltip-bottom.map-past-tooltip::before { border-bottom-color: var(--border2); }

/* Fullscreen map */
.map { position: relative; }
.map-fs-btn { position: absolute; top: 10px; right: 10px; z-index: 1000; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: .75rem; font-weight: 600; color: var(--text); background: rgba(15, 39, 68, .85); border: 1px solid var(--border); border-radius: 8px; backdrop-filter: blur(8px); cursor: pointer; transition: all .15s ease; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.map-fs-btn:hover { background: var(--bg2); border-color: var(--border2); color: var(--text); }
.map-fs-btn .ic { width: 14px; height: 14px; }
.map-box.is-fullscreen { position: fixed; inset: 0; z-index: 99999; background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.map-box.is-fullscreen .map { flex: 1; height: 100%; border-radius: 12px; }
.map-box.is-fullscreen .map-bar { background: var(--bg2); padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border); }
body.map-fs-open { overflow: hidden; }

/* Location dropdown (places autocomplete / suggestions) */
.input-with-drop { position: relative; }
.input-with-drop input { padding-right: 40px; }
.input-drop-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; display: flex; align-items: center; justify-content: center; border-radius: 6px; transition: color .15s, transform .15s; }
.input-drop-toggle:hover { color: var(--text); }
.input-drop-toggle.is-open { transform: translateY(-50%) rotate(180deg); color: var(--text); }
.places-dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 280px; overflow-y: auto; background: var(--bg2); border: 1px solid var(--border2); border-radius: 12px; box-shadow: 0 10px 25px rgba(0, 0, 0, .5); z-index: 100; display: flex; flex-direction: column; padding: 6px; }
.places-dropdown[hidden] { display: none; }
.places-option { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; background: none; border: none; color: var(--text); font-size: .88rem; text-align: left; cursor: pointer; width: 100%; transition: background .12s, color .12s; font-family: inherit; }
.places-option:hover, .places-option.is-active { background: var(--tint-3); color: var(--text); }
.places-option .ic { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.places-option:hover .ic, .places-option.is-active .ic { color: var(--text); }
.places-option-name { flex: 1; font-weight: 500; }
.places-option-tag { font-size: .7rem; padding: 2px 6px; border-radius: 4px; background: var(--tint-2); color: var(--subtle); }
.places-empty { padding: 14px 12px; font-size: .82rem; color: var(--muted); text-align: center; }
/* the typed place is only a name once the pin was moved by hand (fix round 1) */
.input-lg.is-pinned { color: var(--muted); font-style: italic; }
.plan-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--amber); margin: 6px 0 14px; }
.plan-note .ic { width: 14px; height: 14px; }
.plan-note a { font-weight: 700; }
.range-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: -4px; }
.summary { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 16px; background: var(--bg2); }
.summary-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.summary-body { display: flex; flex-direction: column; gap: 10px; }
.sum-row { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; font-weight: 500; overflow-wrap: anywhere; }
.sum-row .ic { color: var(--accent-soft); width: 16px; height: 16px; margin-top: 2px; }
.sum-row.dim { color: var(--muted); }
.sum-row.dim .ic { color: var(--muted); }
.summary-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.summary-est { font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; }
.summary-quota { font-size: .76rem; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* scrape progress */
.progress-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 28px; max-width: 680px; margin: 0 auto; }
.progress-card h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -.03em; }
.progress-card > .bar { width: 100%; max-width: 440px; margin: 14px 0 6px; }
.scan { position: relative; width: 200px; height: 170px; margin-bottom: 6px; }
.scan-core { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: #FFFFFF; color: var(--navy); box-shadow: 0 10px 30px rgba(2, 10, 20, .45); }
.scan-core .ic { width: 24px; height: 24px; }
.psteps { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 10px; margin: 12px 0 6px; width: 100%; max-width: 440px; }
.pstep { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--muted); transition: color .3s; }
.pstep-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border2); flex-shrink: 0; position: relative; transition: all .3s; }
.pstep.active { color: var(--text); font-weight: 600; }
.pstep.active .pstep-dot { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.pstep.done { color: var(--subtle); }
.pstep.done .pstep-dot { border-color: var(--ok); background: var(--ok); }
.pstep.done .pstep-dot::after { content: ''; position: absolute; left: 5px; top: 3px; width: 5px; height: 8px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.progress-foot { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; margin-top: 8px; }
.progress-foot .ic { width: 14px; height: 14px; }
.big-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.big-ic .ic { width: 22px; height: 22px; }
.big-ic-bad { background: rgba(248, 113, 113, .1); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.big-ic-ok { background: rgba(22, 163, 74, .12); color: var(--green); border: 1px solid rgba(22, 163, 74, .35); width: 40px; height: 40px; }

/* ---------- results ---------- */
.results-meta { display: flex; align-items: center; gap: 12px; margin: -8px 0 16px; flex-wrap: wrap; font-size: .85rem; }
.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.selall { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .85rem; color: var(--subtle); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 11px 12px; border-bottom: 1px solid var(--border); background: var(--tint-1); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.td-cb { width: 44px; padding-left: 18px !important; }
.biz { cursor: pointer; transition: background .12s; }
.biz:hover { background: var(--tint-1); }
.biz.sel { background: var(--tint-2); }
.biz.sel .td-cb { box-shadow: inset 3px 0 0 var(--accent); }
.biz-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.biz-cat { font-size: .76rem; color: var(--muted); text-transform: capitalize; }
.td-name { min-width: 200px; }
.rating { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; white-space: nowrap; }
.num-cell { font-variant-numeric: tabular-nums; color: var(--subtle); }
.ico-txt { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--subtle); }
.ico-txt .ic { width: 14px; height: 14px; color: var(--muted); }
.addr { display: block; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--subtle); }
.td-act { width: 50px; text-align: right; padding-right: 16px !important; white-space: nowrap; }
/* T-54: previews already made for a business of this search */
.row-acts { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
.page-acts { display: inline-flex; align-items: center; gap: 4px; }
.page-acts:empty, .page-slot:empty { display: none; }
.tag-gen { background: var(--tint-3); color: var(--text); border: 1px solid var(--tint-line); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.tag .ic { width: 12px; height: 12px; }
.tag-opp { background: var(--tint-2); color: var(--text); border: 1px solid var(--tint-line); }
.tag-muted { background: rgba(148, 163, 184, .06); color: var(--muted); border: 1px solid var(--border); }
.tag-ok { background: rgba(22, 163, 74, .12); color: var(--green); border: 1px solid rgba(22, 163, 74, .35); }
.tag-warning { background: rgba(245, 158, 11, .14); color: var(--amber); border: 1px solid rgba(245, 158, 11, .4); text-decoration: none; }
.tag-warning:hover { text-decoration: underline; }
.tag-info { background: var(--tint-3); color: var(--text); border: 1px solid var(--tint-line); text-decoration: none; }
.tag-info:hover { text-decoration: underline; }

.actionbar { position: fixed; bottom: 20px; left: calc(var(--sidebar) + 32px); right: 32px; max-width: 1176px; margin: 0 auto; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px 14px 22px; border-radius: 16px; background: rgba(15, 39, 68, .96); backdrop-filter: blur(14px); border: 1px solid var(--border2); box-shadow: 0 20px 50px rgba(2, 10, 20, .55); animation: rise .25s ease-out; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.actionbar-info { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); }
.actionbar-info strong { color: var(--text); font-size: .95rem; }
.actionbar-info.warn span { color: var(--amber); }
.actionbar-btns { display: flex; gap: 8px; align-items: center; }

/* ---------- queue ---------- */
.overall { margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.overall-row { display: flex; justify-content: space-between; align-items: baseline; }
.jobs { display: flex; flex-direction: column; gap: 10px; }
.job { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--bg2); border: 1px solid var(--border); transition: border-color .3s, background .3s; }
.job-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: rgba(148, 163, 184, .08); color: var(--muted); border: 1px solid var(--border); }
.job-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.job-title { font-weight: 700; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.job-cat { font-size: .75rem; color: var(--muted); font-weight: 500; text-transform: capitalize; }
.job-status { font-size: .82rem; color: var(--muted); }
.job-main .bar { max-width: 420px; }
.job-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.job-time { font-size: .75rem; color: var(--muted); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.st-running { border-color: var(--border2); background: var(--bg2); }
.st-running .job-ic { background: var(--tint-3); border-color: var(--tint-line); color: var(--text); }
.st-running .job-status { color: var(--text); }
.st-done .job-ic { background: rgba(22, 163, 74, .12); color: var(--green); border-color: rgba(22, 163, 74, .35); }
.st-done .job-status { color: var(--green); }
.st-failed { border-color: rgba(248, 113, 113, .35); }
.st-failed .job-ic { background: rgba(248, 113, 113, .08); color: var(--red); border-color: rgba(248, 113, 113, .3); }
.st-failed .job-status { color: var(--red); }
.st-skipped { opacity: .7; }
.st-queued .job-title { color: var(--subtle); }

/* ---------- preview ---------- */
.share-bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 18px; flex-wrap: wrap; }
.share-lbl { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--subtle); }
.share-lbl .ic { width: 16px; height: 16px; color: var(--accent-soft); }
.share-input { flex: 1; min-width: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem !important; color: var(--text) !important; padding: 9px 12px !important; }
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-stage { display: flex; justify-content: center; transition: all .3s; }
.pv-device { width: 100%; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--bg3); box-shadow: var(--shadow); transition: width .35s ease, border-radius .35s; }
.pv-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--bg3); border-bottom: 1px solid var(--border); }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border2); }
.dots i:nth-child(2) { background: var(--border2); }
.dots i:nth-child(3) { background: var(--border2); }
.pv-url { flex: 1; min-width: 0; background: var(--tint-2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font-size: .72rem; color: var(--muted); font-family: ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-screen { position: relative; height: calc(100vh - 290px); min-height: 520px; background: #fff; }
.pv-iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.pv-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--bg2); color: var(--subtle); font-size: .9rem; transition: opacity .3s; z-index: 1; }
.pv-loading.gone { opacity: 0; pointer-events: none; }
.pv-stage.is-mobile .pv-device { width: 400px; border-radius: 36px; border: 10px solid var(--bg3); }
.pv-stage.is-mobile .pv-bar { justify-content: center; padding: 8px 14px; }
.pv-stage.is-mobile .dots { display: none; }
.pv-stage.is-mobile .pv-screen { height: 760px; max-height: calc(100vh - 250px); min-height: 560px; }

/* ---------- pages library ---------- */
.pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.span-all { grid-column: 1 / -1; }
.page-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s, transform .2s, box-shadow .2s; }
.page-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(2, 10, 20, .4); }
.thumb { position: relative; display: block; height: 180px; overflow: hidden; background: #fff; border-bottom: 1px solid var(--border); }
.thumb-frame { width: 1280px; height: 900px; border: 0; transform: scale(.25); transform-origin: 0 0; pointer-events: none; background: #fff; }
.pages-grid .thumb-frame { width: 400%; height: 400%; }
.thumb-hover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; background: rgba(8, 27, 48, .6); color: #FFFFFF; font-weight: 700; font-size: .85rem; opacity: 0; transition: opacity .2s; }
.thumb:hover .thumb-hover, .thumb:focus-visible .thumb-hover { opacity: 1; }
.page-card-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.page-card-title { font-size: .98rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-card-meta { font-size: .75rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.dot-sep::before { content: '·'; margin-right: 10px; }
.page-card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }
.page-card-actions .btn { flex: 1; }

/* ---------- account / plans ---------- */
.grid-account { margin-bottom: 8px; }
.profile { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.profile-name { font-weight: 700; font-size: 1.05rem; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 12px; font-size: .88rem; border-top: 1px solid var(--border); padding-top: 16px; }
.kv dt { color: var(--muted); }
.kv dd { text-transform: capitalize; }
.usage { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.usage .stat { min-height: 0; background: var(--tint-1); }
.usage .fine { grid-column: 1 / -1; }
/* T-93: Billing interval toggle in app */
.plans-toggle-wrap { display: flex; justify-content: center; margin-bottom: 24px; }
.plans-toggle {
  display: inline-flex; align-items: center; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 4px;
}
.plans-toggle-btn {
  background: transparent; border: 0; color: var(--subtle); font-size: 0.85rem; font-weight: 600;
  padding: 6px 16px; border-radius: 999px; cursor: pointer; transition: all 0.2s ease;
  display: inline-flex; align-items: center; gap: 8px; font-family: inherit;
}
.plans-toggle-btn:hover { color: var(--text); }
.plans-toggle-btn.is-active {
  background: var(--accent); color: var(--accent-ink); box-shadow: none;
}
.plans-save-pill {
  font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: rgba(22, 163, 74, .14); color: var(--green); border: 1px solid rgba(22, 163, 74, .4);
}
.plans-toggle-btn.is-active .plans-save-pill {
  background: var(--cream); color: var(--navy); border-color: var(--cream);
}
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plan { background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; padding: 28px; position: relative; display: flex; flex-direction: column; transition: border-color .2s; }
.plan:hover { border-color: var(--border2); }
.plan-popular { border: 2px solid var(--navy); box-shadow: 0 16px 40px rgba(2, 10, 20, .35), 0 0 0 2px rgba(255, 255, 255, .9); }
.plan-current { border-color: rgba(22, 163, 74, .55); }
.plan-flag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #FFFFFF; border: 1px solid rgba(255, 255, 255, .9); font-size: .7rem; font-weight: 700; padding: 4px 14px; border-radius: 999px; letter-spacing: .05em; white-space: nowrap; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.plan-name { font-size: .82rem; font-weight: 600; color: var(--subtle); text-transform: uppercase; letter-spacing: .08em; }
.plan-badge { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.plan-price-wrap { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.plan-old { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: var(--subtle); text-decoration: line-through; text-decoration-thickness: 2px; font-variant-numeric: tabular-nums; }
.plan-duration { font-size: .75rem; color: var(--subtle); font-weight: 500; }
.plan-price { font-size: 2.6rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.plan-cur { font-size: 1rem; font-weight: 700; color: var(--subtle); letter-spacing: 0; }
.plan-per { font-family: var(--font-body); font-size: .9rem; font-weight: 400; color: var(--subtle); letter-spacing: 0; }
.plan-countdown {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; margin-bottom: 20px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  font-size: .86rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums;
  text-align: center;
}
.plan-desc { font-size: .8rem; color: var(--subtle); padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.plan-features li { display: flex; gap: 10px; font-size: .86rem; color: var(--text); align-items: flex-start; }
.plan-features .ic { color: var(--text); width: 16px; height: 16px; margin-top: 2px; }
.plan .btn-block { margin-top: auto; }
.soon { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px; margin-bottom: 20px; border: 1px solid var(--border2); background: var(--bg2); animation: rise .3s ease-out; flex-wrap: wrap; }
.soon-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex-shrink: 0; }
.soon-txt { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; font-size: .88rem; color: var(--subtle); }
.soon-txt strong { color: var(--text); font-size: 1rem; }

/* ---------- toasts & modal ---------- */
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 1000; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: rgba(15, 39, 68, .98); border: 1px solid var(--border2); box-shadow: 0 16px 40px rgba(2, 10, 20, .5); font-size: .86rem; transform: translateY(12px); opacity: 0; transition: all .25s; }
.toast.in { transform: none; opacity: 1; }
.toast-ic { color: var(--green); }
.toast-error .toast-ic { color: var(--red); }
.toast-warn .toast-ic { color: var(--amber); }
.toast-msg { flex: 1; }
.toast-action { font-weight: 700; white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }
.modal { margin: auto; border: 0; background: transparent; color: var(--text); max-width: min(460px, calc(100vw - 32px)); width: 100%; }
.modal::backdrop { background: rgba(2, 10, 20, .72); backdrop-filter: blur(4px); }
.modal-card { position: relative; background: var(--bg2); border: 1px solid var(--border2); border-radius: 20px; padding: 30px 28px 24px; box-shadow: var(--shadow); animation: rise .2s ease-out; }
.modal-x { position: absolute; top: 14px; right: 14px; }
.modal-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 10px; padding-right: 30px; }
.modal-body { display: flex; flex-direction: column; gap: 10px; font-size: .9rem; }
.modal-hero { margin-bottom: 16px; }
.modal-hero-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
/* T-46 email modal + T-47 regenerate / versions */
.modal-wide { max-width: min(640px, calc(100vw - 32px)); }
.modal { max-height: calc(100dvh - 24px); overflow-y: auto; }   /* long modals scroll on small screens (T-46) */
.textarea { width: 100%; background: var(--field-bg); border: 1px solid var(--field-line); border-radius: 12px; padding: 11px 14px; font-size: .88rem; color: var(--text); line-height: 1.5; resize: vertical; outline: none; transition: border-color .2s, box-shadow .2s; }
.textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.email-body { min-height: 220px; font-size: .84rem; }
.email-warn { font-size: .8rem; color: var(--amber); }
.email-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.btn.is-disabled { opacity: .45; cursor: not-allowed; }
.char-count { margin-left: auto; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.regen-cost { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; color: var(--text); }
.regen-cost .ic { width: 16px; height: 16px; }
.regen-box { margin-bottom: 18px; }
.version-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 16px; font-size: .85rem; }
.version-bar .ic { width: 16px; height: 16px; color: var(--accent-soft); }
.version-txt { font-weight: 600; }
.tag-disabled { color: var(--red); font-weight: 600; }
.thumb-disabled { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; background: repeating-linear-gradient(45deg, var(--bg2), var(--bg2) 10px, var(--bg3) 10px, var(--bg3) 20px); color: var(--muted); font-weight: 600; font-size: .85rem; }
.pv-disabled { padding: 20px; }
/* T-74: locked (free, view-only) preview + paywall */
.lock-bar { display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin-bottom: 18px; flex-wrap: wrap; border-color: var(--line-strong); background: var(--bg2); }
.lock-bar-txt { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; font-size: .88rem; color: var(--subtle); }
.lock-bar-txt strong { color: var(--text); font-size: 1rem; }
.lock-bar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.paywall-list { list-style: none; padding: 0; margin: 14px 0 4px; display: flex; flex-direction: column; gap: 8px; font-size: .88rem; color: var(--subtle); }
.paywall-list li { display: flex; gap: 8px; align-items: flex-start; }
.paywall-list .ic { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--text); }
.verify-card { max-width: 460px; margin: 40px auto; text-align: center; }
.version-select { width: auto; max-width: 100%; min-width: 0; flex: 1 1 260px; }
.modal-upgrade .modal-card { background: var(--bg2); border-color: var(--border); }

/* T-92: template picker & custom regenerate styles */
.tpl-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 6px; }
.tpl-picker-card { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg3); cursor: pointer; transition: all .15s ease; display: flex; flex-direction: column; gap: 4px; user-select: none; }
.tpl-picker-card:hover { border-color: var(--line-strong); background: var(--tint-2); }
.tpl-picker-card.is-active { border-color: var(--accent); background: var(--tint-3); box-shadow: 0 0 0 2px var(--accent); }
.tpl-picker-card .tpl-name { font-size: .92rem; font-weight: 700; color: var(--text); }
.tpl-picker-card .tpl-brief { font-size: .8rem; line-height: 1.35; margin: 0; }
button.tpl-picker-card { font: inherit; color: inherit; text-align: left; width: 100%; }
.tpl-picker-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* T-92 fix round: palette / font picker (colours set through CSSOM custom properties, CSP-safe) */
.design-custom { margin-top: 12px; display: grid; gap: 6px; }
.design-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }
.design-picker select { width: 100%; }
.swatch-row { display: inline-flex; gap: 4px; vertical-align: middle; margin-left: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .25); background: var(--sw, transparent); display: inline-block; }
.sec-toggle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px 12px; padding: 10px 12px; border-radius: 10px; background: var(--tint-1); border: 1px solid var(--border); }
.sec-toggle-item { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; cursor: pointer; user-select: none; }
.sec-toggle-item input[type="checkbox"] { cursor: pointer; accent-color: var(--accent-soft); }
.sec-toggle-add { color: var(--text); font-weight: 700; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip-action { font-size: .78rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg3); color: var(--muted); cursor: pointer; transition: all .15s ease; user-select: none; }
.chip-action:hover { border-color: var(--accent); color: var(--text); background: var(--tint-2); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .search-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .hero-cta { grid-template-columns: 1fr; }
  .hero-cta-art { display: none; }
}
/* collapsible sidebar (T-42): desktop only — under 960px the sidebar is the drawer */
@media (min-width: 961px) {
  .sidebar { transition: width .2s ease, padding .2s ease; }
  .sidebar .nav-link { white-space: nowrap; }
  .side-collapsed { --sidebar: 76px; }
  .side-collapsed .sidebar { padding: 20px 12px; }
  .side-collapsed .side-head { flex-direction: column; gap: 14px; }
  .side-collapsed .sidebar .logo { padding: 2px 0; }
  /* labels leave the screen but stay readable by screen readers */
  .side-collapsed .logo-txt, .side-collapsed .nav-label, .side-collapsed .side-user-txt {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .side-collapsed .nav-link { justify-content: center; gap: 0; padding: 10px 0; }
  .side-collapsed .nav-link.active::before { left: -12px; }
  .side-collapsed .nav-badge { position: absolute; top: 3px; right: 3px; margin: 0; min-width: 17px; height: 17px; padding: 0 4px; font-size: .62rem; }
  .side-collapsed .side-plan { display: none; }
  .side-collapsed .side-user { flex-direction: column; gap: 8px; padding: 6px 0; }
}
@media (max-width: 960px) {
  .side-toggle { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: 20px 0 50px rgba(0, 0, 0, .5); }
  .nav-open .sidebar { transform: none; }
  .nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(2, 10, 20, .6); z-index: 25; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .main { padding: 22px 16px 56px; }
  .actionbar { left: 16px; right: 16px; bottom: 12px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-plan { grid-column: span 2; min-height: 0; }
  .grid-2, .plans { grid-template-columns: 1fr; }
  .auth { padding: 24px 16px 24px; }
  .auth-logo { margin-bottom: 20px; }
  .auth-body { gap: 20px; }
  .auth-split .auth-body { grid-template-columns: 1fr; max-width: 440px; }
  .auth-aside .aside-steps { display: none; }
  .auth-aside .check-list { display: flex; }
  .aside-title { font-size: 1.4rem; margin: 12px 0 14px; }
}
@media (max-width: 720px) {
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, .textarea { font-size: 16px; }
  .pill-quota { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stat-plan { grid-column: auto; }
  .more-grid, .usage { grid-template-columns: 1fr; }
  .map { height: 240px; }
  .span-2 { grid-column: auto; }
  .page-head { align-items: flex-start; }
  .input-ic-sm > input { min-width: 0; }
  .auth-card { padding: 28px 20px; }
  .kv { grid-template-columns: 110px 1fr; }
  /* results table -> cards */
  .table thead { display: none; }
  .table, .table tbody { display: block; }
  .table tr.biz { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 10px; padding: 14px 14px; border-bottom: 1px solid var(--border); }
  .table tr.biz:last-child { border-bottom: 0; }
  .table td { padding: 0; border: 0; }
  .table td[data-label] { grid-column: 2 / 4; display: flex; gap: 8px; align-items: center; font-size: .82rem; }
  .table td[data-label]:not(.td-name)::before { content: attr(data-label); color: var(--muted); font-size: .72rem; min-width: 64px; }
  .table td.td-cb { grid-column: 1; grid-row: 1 / span 7; padding: 2px 0 0 !important; width: auto; }
  .table td.td-name[data-label] { grid-column: 2; grid-row: 1; min-width: 0; display: block; margin-bottom: 4px; }
  .table td.td-act { grid-column: 3; grid-row: 1; width: auto; padding: 0 !important; }
  .addr { max-width: 100%; white-space: normal; }
  .biz.sel .td-cb { box-shadow: none; }
  .biz.sel { box-shadow: inset 3px 0 0 var(--accent); }
  .actionbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; }
  .actionbar-btns .btn-primary { flex: 1; }
  .job { flex-wrap: wrap; }
  .job-actions { width: 100%; justify-content: flex-end; }
  .pv-stage.is-mobile .pv-device { width: 100%; max-width: 400px; }
  .pv-screen { height: 70vh; min-height: 420px; }
  .share-input { min-width: 0; width: 100%; }
  .share-btns .btn { flex: 1; }
  .top-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- T-54: generation indicator (topbar) ---- */
.gen-ind { position: relative; }
.gen-ind[hidden] { display: none; }
.pill-queue { cursor: pointer; font: inherit; font-size: .78rem; font-weight: 600; }
.pill-done { color: var(--green); background: rgba(22, 163, 74, .1); border-color: rgba(22, 163, 74, .35); }
.pill-done .ic { color: var(--green); }
.gen-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow: auto; padding: 14px; border-radius: var(--radius); background: var(--bg2); border: 1px solid var(--border2); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.gen-pop[hidden] { display: none; }
.gen-pop-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; font-size: .85rem; }
.gen-pop-head .muted { font-size: .75rem; }
.gen-list { display: flex; flex-direction: column; gap: 6px; }
.gen-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--tint-1); }
.gen-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: rgba(148, 163, 184, .08); color: var(--muted); }
.gen-ic .ic { width: 14px; height: 14px; }
.gen-main { flex: 1; min-width: 0; }
.gen-name { font-weight: 600; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-status { font-size: .72rem; color: var(--muted); }
.gen-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.gen-row.st-running .gen-ic { background: var(--tint-3); color: var(--text); }
.gen-row.st-running .gen-status { color: var(--text); }
.gen-row.st-done .gen-ic { background: rgba(22, 163, 74, .12); color: var(--green); }
.gen-row.st-done .gen-status { color: var(--green); }
.gen-row.st-failed .gen-ic { background: rgba(248, 113, 113, .08); color: var(--red); }
.gen-row.st-failed .gen-status { color: var(--red); }
.gen-pop-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }

/* ---- T-54: History ---- */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: inherit; text-decoration: none; transition: border-color .2s, background .2s; }
a.history-card:hover { border-color: var(--border2); background: var(--tint-1); }
.history-card.is-failed { opacity: .75; }
.history-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.history-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-static { padding: 3px 10px; font-size: .75rem; text-transform: capitalize; }
.history-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--muted); }
.hfact { display: inline-flex; align-items: center; gap: 5px; }
.hfact .ic { width: 13px; height: 13px; }
.hfact-ok { color: var(--green); }
.plan-note-ok { color: var(--green); }
@media (max-width: 720px) {
  .history-card { padding: 14px; gap: 10px; }
  .row-acts .page-acts .btn { padding: 4px 8px; }
  .gen-pop { position: fixed; top: 64px; left: 16px; right: 16px; width: auto; }
}

/* ---- T-72: Admin (read-only) ---- */
.nav-link[hidden] { display: none; }
.admin-stats .stat-kpi { min-height: 0; }
.stat-kpi .stat-foot { overflow-wrap: anywhere; }
.achart { margin-bottom: 20px; }
.achart-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .82rem; margin-bottom: 12px; }
.abars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-bottom: 1px; border-bottom: 1px solid var(--border); }
.abar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.abar-fill { display: block; width: 100%; height: var(--h, 0%); min-height: 2px; border-radius: 3px 3px 0 0; background: var(--accent-soft); transition: height .4s ease; }
.abar-zero .abar-fill { background: var(--tint-3); }
.abar:hover .abar-fill { background: #FFFFFF; }
.achart-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 6px; }
.admin-users-title { font-size: .98rem; font-weight: 700; }
.admin-pages { margin-top: 24px; }
.atable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.atable { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .85rem; }
.atable th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 11px 12px; border-bottom: 1px solid var(--border); background: var(--tint-1); white-space: nowrap; }
.atable td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.atable tr:last-child td { border-bottom: 0; }
.atable th:first-child, .atable td:first-child { padding-left: 16px; }
.atd-user { max-width: 300px; }
.atd-email { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atd-name, .atd-small { font-size: .76rem; text-transform: capitalize; }
.atd-name { text-transform: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atd-nowrap { white-space: nowrap; color: var(--subtle); }
.atd-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-bad { background: rgba(248, 113, 113, .1); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.atable-msg { padding: 16px; }
.apager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); font-size: .82rem; }
.apager-btns { display: flex; gap: 8px; }
@media (max-width: 720px) {
  .abars { gap: 2px; height: 110px; }
  .admin-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .admin-stats .stat-kpi { padding: 14px; }
  .admin-users .table-tools .input-ic { flex: 1 1 100%; }
}

/* ---- T-97 (D-28): Zero-Friction Guest Trial (#/try) ---- */
.try-page { min-height: 100vh; display: flex; flex-direction: column; padding: 20px 16px 48px; max-width: 820px; margin: 0 auto; width: 100%; }
.try-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.try-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.try-main { display: flex; flex-direction: column; gap: 18px; }
.try-card { padding: 28px; }
.try-title { font-size: clamp(1.4rem, 3.5vw, 1.9rem); font-weight: 700; letter-spacing: -.03em; margin: 6px 0 8px; }
.try-sub { color: var(--subtle); font-size: .94rem; line-height: 1.55; margin-bottom: 18px; }
.try-form { display: flex; flex-direction: column; gap: 16px; }
.try-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* T-105: preset chips look like the landing chips (cream on the white card) */
.try-chips .btn-outline { background: var(--bg3); border-color: var(--border); }
.try-chips .btn-outline:hover { border-color: var(--accent); background: var(--bg2); }
.try-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .82rem; }
.try-progress { display: flex; align-items: center; gap: 14px; }
.try-progress-txt { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.try-biz-card { padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg3); margin: 10px 0 16px; }
.try-biz-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.try-biz-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; font-size: .86rem; }
.try-badge-ok { color: #166534; border-color: rgba(22, 163, 74, .4); background: rgba(22, 163, 74, .1); }
.try-gen-status { margin-top: 14px; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--text); font-size: .78rem; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.btn-link:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .try-card { padding: 18px; }
  .try-grid { grid-template-columns: 1fr; gap: 12px; }
  .try-head .badge { display: none; }
}
