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

:root {
  --bg: #080C18;
  --bg2: #0D1224;
  --bg3: #111827;
  --bg4: #162033;
  --border: #1E2D45;
  --border2: #2A3B57;
  --blue: #3B82F6;
  --blue-dim: #1D4ED8;
  --blue-soft: #93C5FD;
  --purple: #8B5CF6;
  --cyan: #06B6D4;
  --green: #34D399;
  --amber: #FBBF24;
  --red: #F87171;
  --text: #F1F5F9;
  --muted: #64748B;
  --subtle: #94A3B8;
  --radius: 14px;
  --sidebar: 256px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .03);
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-soft); text-decoration: none; }
a:hover { color: var(--text); }
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; }
.center { text-align: center; }
.fine { font-size: .78rem; color: var(--muted); }
.grad { background: linear-gradient(135deg, var(--blue), var(--purple)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
:focus-visible { outline: 2px solid var(--blue); 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: linear-gradient(135deg, var(--blue), var(--purple));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #fff; letter-spacing: 0;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font-size: .875rem; font-weight: 600; 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: linear-gradient(135deg, var(--blue), var(--blue-dim)); color: #fff; box-shadow: 0 0 20px rgba(59, 130, 246, .25); }
.btn-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 0 30px rgba(59, 130, 246, .45); }
.btn-outline { background: rgba(255, 255, 255, .02); border-color: var(--border); color: var(--subtle); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue-soft); background: rgba(59, 130, 246, .06); }
.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: 12px; }
.btn-sm { padding: 7px 12px; font-size: .8rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled, .btn.is-busy { opacity: .75; cursor: default; transform: none; }
.btn-current { background: rgba(52, 211, 153, .08); border: 1px solid rgba(52, 211, 153, .25); color: var(--green); cursor: default; }
.icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--border); background: rgba(255, 255, 255, .02);
  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 rgba(147, 197, 253, .25); border-top-color: var(--blue-soft); animation: spin .8s linear infinite; display: inline-block; flex-shrink: 0; }
.spinner-sm { width: 14px; height: 14px; }
@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: rgba(255, 255, 255, .03); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px; font-size: .9rem; color: var(--text);
  transition: border-color .2s, box-shadow .2s, background .2s; outline: none;
}
input::placeholder { color: #4B5B73; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); background: rgba(59, 130, 246, .04); }
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: 10px; background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .25); color: #FECACA; font-size: .85rem; }
.form-error .ic { color: var(--red); margin-top: 1px; }
.form-error a { color: #fff; font-weight: 600; text-decoration: underline; }

input[type=range] { width: 100%; accent-color: var(--blue); height: 24px; }
.range-val { margin-left: auto; color: var(--blue-soft); font-weight: 600; }

/* checkbox */
.cb { appearance: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border2); background: rgba(255, 255, 255, .02); 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 #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .12s; }
.cb:checked { background: var(--blue); border-color: var(--blue); }
.cb:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.cb:indeterminate { background: var(--blue); border-color: var(--blue); }
.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: rgba(255, 255, 255, .015); 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: linear-gradient(135deg, var(--blue), var(--purple)); }
.switch-input:checked + .switch-track .switch-knob { transform: translateX(16px); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch:has(.switch-input:checked) { border-color: rgba(59, 130, 246, .35); background: rgba(59, 130, 246, .05); }
.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: rgba(255, 255, 255, .03); 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(--bg4); color: var(--text); box-shadow: inset 0 0 0 1px var(--border2), 0 0 16px rgba(59, 130, 246, .15); }

/* 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: rgba(255, 255, 255, .03); cursor: text; transition: border-color .2s, box-shadow .2s; }
.chips-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
.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: rgba(59, 130, 246, .12); border: 1px solid rgba(59, 130, 246, .28); color: var(--blue-soft); 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: rgba(59, 130, 246, .2); }
.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(--blue); color: var(--blue-soft); }
.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; height: 700px; background: radial-gradient(ellipse at center top, rgba(59, 130, 246, .16) 0%, transparent 60%), radial-gradient(ellipse at 70% 40%, rgba(139, 92, 246, .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: rgba(13, 18, 36, .85); border: 1px solid var(--border); border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow); backdrop-filter: blur(10px); position: relative; }
.auth-card::before { content: ''; position: absolute; top: 0; left: 24px; right: 24px; height: 1px; background: linear-gradient(90deg, transparent, var(--blue), transparent); }
.auth-title { font-size: 1.6rem; font-weight: 800; 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: 600; }
.field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.auth-forgot { font-size: .8rem; color: var(--blue-soft); text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; color: var(--text); }
.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: 800; letter-spacing: -.035em; line-height: 1.15; margin: 18px 0 22px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; background: rgba(59, 130, 246, .1); border: 1px solid rgba(59, 130, 246, .2); border-radius: 999px; font-size: .78rem; font-weight: 500; color: var(--blue-soft); }
.badge-dot { width: 6px; height: 6px; background: var(--blue); 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: rgba(59, 130, 246, .12); color: var(--blue-soft); font-size: .72rem; font-weight: 800; 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: rgba(13, 18, 36, .6); }
.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: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; font-size: .72rem; font-weight: 800; 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(--green); }

/* ---------- 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: rgba(255, 255, 255, .03); }
.nav-link.active { color: var(--text); background: linear-gradient(90deg, rgba(59, 130, 246, .16), rgba(59, 130, 246, .03)); }
.nav-link.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--blue), var(--purple)); }
.nav-link.active .ic { color: var(--blue-soft); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; font-size: .7rem; font-weight: 700; 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: linear-gradient(180deg, rgba(59, 130, 246, .06), rgba(13, 18, 36, 0)); 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: 600; }
.plan-chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; background: rgba(148, 163, 184, .1); color: var(--subtle); border: 1px solid var(--border); }
.plan-chip.plan-starter { background: rgba(59, 130, 246, .12); color: var(--blue-soft); border-color: rgba(59, 130, 246, .3); }
.plan-chip.plan-pro { background: rgba(139, 92, 246, .14); color: #C4B5FD; border-color: rgba(139, 92, 246, .35); }
.mini-meter-row { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-bottom: 5px; }
.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, 12, 24, .82); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(30, 45, 69, .6); }
.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: 600; border: 1px solid var(--border); background: rgba(255, 255, 255, .02); color: var(--subtle); }
.pill .ic { width: 14px; height: 14px; color: var(--blue-soft); }
.pill:hover { color: var(--text); border-color: var(--border2); }
.pill-queue { color: #C4B5FD; background: rgba(139, 92, 246, .1); border-color: rgba(139, 92, 246, .3); }
.pill-warn { color: var(--amber); border-color: rgba(251, 191, 36, .3); }
.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: #fff; background: linear-gradient(135deg, #1E3A5F, #2D1B4E); border: 1px solid var(--border2); flex-shrink: 0; }
.avatar:hover { color: #fff; border-color: var(--blue); }
.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: 800; letter-spacing: -.035em; 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: 600; }
.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
   business name (nowrap row title) made the dashboard wider than the screen (zoomed-out
   page on phones, sideways scroll on desktop). min-width:0 lets the ellipsis work instead. */
.grid-2 > * { min-width: 0; }

/* 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: rgba(59, 130, 246, .1); border: 1px solid rgba(59, 130, 246, .18); color: var(--blue-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: 800; letter-spacing: -.04em; line-height: 1.1; }
.stat-num span { font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stat-foot { font-size: .76rem; color: var(--muted); }
.stat-plan { background: linear-gradient(160deg, rgba(139, 92, 246, .10), var(--bg2) 60%); }
.stat-plan .stat-ic { background: rgba(139, 92, 246, .12); border-color: rgba(139, 92, 246, .25); color: #C4B5FD; }
.stat-plan .btn { align-self: flex-start; margin-top: auto; }

/* bars */
.bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .06); overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--purple)); transition: width .5s ease; }
.bar-lg { height: 8px; }
.bar-full > span { background: linear-gradient(90deg, #F59E0B, var(--red)); }
.bar-unl > span { background: linear-gradient(90deg, rgba(59, 130, 246, .5), rgba(139, 92, 246, .5)); }
.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: 18px; margin-bottom: 20px; position: relative; overflow: hidden; color: var(--text); border: 1px solid rgba(59, 130, 246, .3); background: radial-gradient(ellipse at 85% 50%, rgba(59, 130, 246, .20), transparent 55%), radial-gradient(ellipse at 10% 0%, rgba(139, 92, 246, .12), transparent 50%), var(--bg2); transition: border-color .2s, transform .2s; }
.hero-cta:hover { color: var(--text); border-color: rgba(59, 130, 246, .6); }
.hero-cta:hover .btn-primary { box-shadow: 0 0 34px rgba(59, 130, 246, .5); }
.hero-cta h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 800; 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(--blue); }
.hero-cta-art { position: relative; height: 170px; }

.radar { position: absolute; top: 50%; left: 50%; border-radius: 50%; border: 1px solid rgba(59, 130, 246, .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(--blue-soft); box-shadow: 0 8px 20px rgba(0, 0, 0, .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: #C4B5FD; }
.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: rgba(255, 255, 255, .03); color: var(--text); }
.row-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: rgba(59, 130, 246, .1); color: var(--blue-soft); border: 1px solid rgba(59, 130, 246, .18); }
.row-ic .ic { width: 16px; height: 16px; }
.row-ic-page { background: linear-gradient(135deg, rgba(59, 130, 246, .25), rgba(139, 92, 246, .25)); color: #fff; font-weight: 800; font-size: .9rem; border-color: rgba(139, 92, 246, .3); }
.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(16, 185, 129, .1); color: var(--green); border: 1px solid rgba(16, 185, 129, .2); }
.status-bad { background: rgba(248, 113, 113, .1); color: var(--red); border: 1px solid rgba(248, 113, 113, .2); }

/* 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: linear-gradient(135deg, rgba(59, 130, 246, .14), rgba(139, 92, 246, .14)); border: 1px solid rgba(59, 130, 246, .22); color: var(--blue-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, .06); border: 1px solid rgba(248, 113, 113, .22); color: #FECACA; 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(52, 211, 153, .28); background: linear-gradient(90deg, rgba(16, 185, 129, .1), rgba(16, 185, 129, .02)); margin-bottom: 18px; font-size: .9rem; color: var(--subtle); }
.success-banner strong { color: var(--text); }

/* skeletons */
.skel { border-radius: 12px; background: linear-gradient(90deg, rgba(255, 255, 255, .03) 0%, rgba(255, 255, 255, .07) 50%, rgba(255, 255, 255, .03) 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-size: .75rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--blue), var(--purple)); }
.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(--blue); }
.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(--blue); 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); }
.map .leaflet-control-attribution { background: rgba(8, 12, 24, .78); color: var(--subtle); font-size: 10px; }
.map .leaflet-control-attribution a { color: var(--blue-soft); }
.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: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(59, 130, 246, .28), 0 4px 12px rgba(0, 0, 0, .5); }
.map-pin:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 50%; }
.map-note { font-size: .78rem; color: var(--subtle); min-height: 1.2em; overflow-wrap: anywhere; }
.map-note.dim { color: var(--muted); }
.map-note.warn { color: var(--amber); }
.map-note.pin { color: var(--blue-soft); font-weight: 600; }
/* 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: linear-gradient(180deg, rgba(59, 130, 246, .07), var(--bg2) 45%); }
.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(--blue-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; }
.summary-quota { font-size: .76rem; color: var(--muted); margin-top: 2px; }

/* 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: 800; 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: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; box-shadow: 0 0 40px rgba(59, 130, 246, .5); }
.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(--blue); border-top-color: transparent; animation: spin .8s linear infinite; }
.pstep.done { color: var(--subtle); }
.pstep.done .pstep-dot { border-color: var(--green); background: var(--green); }
.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, .25); }
.big-ic-ok { background: rgba(52, 211, 153, .1); color: var(--green); border: 1px solid rgba(52, 211, 153, .25); 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: rgba(255, 255, 255, .015); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid rgba(30, 45, 69, .6); 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: rgba(255, 255, 255, .025); }
.biz.sel { background: rgba(59, 130, 246, .07); }
.biz.sel .td-cb { box-shadow: inset 3px 0 0 var(--blue); }
.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: rgba(139, 92, 246, .1); color: #C4B5FD; border: 1px solid rgba(139, 92, 246, .3); }
.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: rgba(139, 92, 246, .12); color: #C4B5FD; border: 1px solid rgba(139, 92, 246, .28); }
.tag-muted { background: rgba(148, 163, 184, .06); color: var(--muted); border: 1px solid var(--border); }
.tag-ok { background: rgba(16, 185, 129, .1); color: var(--green); border: 1px solid rgba(16, 185, 129, .22); }

.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(17, 24, 39, .92); backdrop-filter: blur(14px); border: 1px solid rgba(59, 130, 246, .4); box-shadow: 0 20px 50px rgba(0, 0, 0, .55), 0 0 40px rgba(59, 130, 246, .15); 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; }
.st-running { border-color: rgba(139, 92, 246, .45); background: linear-gradient(90deg, rgba(139, 92, 246, .08), var(--bg2) 60%); box-shadow: 0 0 30px rgba(139, 92, 246, .08); }
.st-running .job-ic { background: rgba(139, 92, 246, .12); border-color: rgba(139, 92, 246, .3); }
.st-running .job-status { color: #C4B5FD; }
.st-done .job-ic { background: rgba(16, 185, 129, .1); color: var(--green); border-color: rgba(16, 185, 129, .25); }
.st-done .job-status { color: var(--green); }
.st-failed { border-color: rgba(248, 113, 113, .3); }
.st-failed .job-ic { background: rgba(248, 113, 113, .08); color: var(--red); border-color: rgba(248, 113, 113, .25); }
.st-failed .job-status { color: #FCA5A5; }
.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(--blue-soft); }
.share-input { flex: 1; min-width: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem !important; color: var(--blue-soft) !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: #FF5F57; }
.dots i:nth-child(2) { background: #FFBD2E; }
.dots i:nth-child(3) { background: #28CA41; }
.pv-url { flex: 1; min-width: 0; background: rgba(255, 255, 255, .04); 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 #1A2335; }
.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: rgba(59, 130, 246, .45); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0, 0, 0, .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, 12, 24, .55); color: #fff; font-weight: 600; 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: rgba(255, 255, 255, .015); }
.usage .fine { grid-column: 1 / -1; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plan { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 28px; position: relative; display: flex; flex-direction: column; transition: border-color .2s; }
.plan:hover { border-color: rgba(59, 130, 246, .3); }
.plan-popular { border-color: var(--blue); background: linear-gradient(180deg, rgba(59, 130, 246, .07) 0%, var(--bg2) 45%); }
.plan-current { border-color: rgba(52, 211, 153, .4); }
.plan-flag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--blue), var(--blue-dim)); color: #fff; font-size: .7rem; font-weight: 700; padding: 4px 14px; border-radius: 999px; letter-spacing: .05em; white-space: nowrap; }
.plan-name { font-size: .82rem; font-weight: 600; color: var(--subtle); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.plan-price { font-size: 2.6rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; margin-bottom: 8px; display: flex; align-items: baseline; gap: 4px; }
.plan-cur { font-size: 1rem; font-weight: 700; color: var(--subtle); letter-spacing: 0; }
.plan-per { font-size: .9rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan-desc { font-size: .8rem; color: var(--muted); 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(--subtle); align-items: flex-start; }
.plan-features .ic { color: var(--blue); 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 rgba(139, 92, 246, .35); background: radial-gradient(ellipse at 0% 50%, rgba(139, 92, 246, .16), transparent 60%), 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: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; 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(17, 24, 39, .96); border: 1px solid var(--border2); box-shadow: 0 16px 40px rgba(0, 0, 0, .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; }
.modal { margin: auto; border: 0; background: transparent; color: var(--text); max-width: min(460px, calc(100vw - 32px)); width: 100%; }
.modal::backdrop { background: rgba(3, 6, 14, .7); 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: 800; 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: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; box-shadow: 0 0 30px rgba(139, 92, 246, .4); }
.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: rgba(255, 255, 255, .03); border: 1px solid var(--border); border-radius: 10px; 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(--blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
.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: 600; color: var(--blue-soft); }
.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(--blue-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: rgba(59, 130, 246, .35); background: radial-gradient(ellipse at 0% 50%, rgba(59, 130, 246, .12), transparent 60%), 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(--blue-soft); }
.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: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, .14), transparent 60%), var(--bg2); }

/* ---------- 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(3, 6, 14, .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-split .auth-body { grid-template-columns: 1fr; max-width: 440px; }
  .auth-aside { order: -1; }
  .auth-aside .aside-steps, .auth-aside .check-list { display: none; }
  .aside-title { font-size: 1.4rem; margin: 12px 0 0; }
}
@media (max-width: 720px) {
  .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(--blue); }
  .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(16, 185, 129, .08); border-color: rgba(16, 185, 129, .25); }
.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: rgba(255, 255, 255, .02); }
.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: rgba(139, 92, 246, .12); color: #C4B5FD; }
.gen-row.st-running .gen-status { color: #C4B5FD; }
.gen-row.st-done .gen-ic { background: rgba(16, 185, 129, .1); 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: #FCA5A5; }
.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: rgba(255, 255, 255, .03); }
.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: linear-gradient(180deg, var(--purple), var(--blue)); transition: height .4s ease; }
.abar-zero .abar-fill { background: rgba(148, 163, 184, .18); }
.abar:hover .abar-fill { filter: brightness(1.25); }
.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; }
.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: rgba(255, 255, 255, .015); white-space: nowrap; }
.atable td { padding: 12px; border-bottom: 1px solid rgba(30, 45, 69, .6); 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, .25); }
.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%; }
}
