@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("plex-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url("plex-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url("plex-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url("plex-700.woff2") format("woff2"); }
:root {
    --ink: #17130f;
    --ink-2: #4a423d;
    --muted: #6f665f;
    --line: #e7e0da;
    --paper: #f8f5f2;
    --card: #ffffff;
    --accent: #0e6b5d;
    --accent-bright: #5fd0b6;
    --accent-soft: #e9f4f1;
    --red: #b3261e;
    --red-soft: #fdeceb;
    --radius: 18px;
    --font: "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(248, 245, 242, 0.9); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { display: inline-flex; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.topnav { display: flex; gap: 18px; }
.topnav a { font-size: 13px; color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--ink); }

/* Hero */
.hero { padding-top: 44px; padding-bottom: 26px; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; color: var(--accent); }
.hero h1 { margin-top: 12px; font-size: clamp(30px, 6vw, 52px); font-weight: 700; }
.lede { margin-top: 14px; max-width: 58ch; font-size: 16px; line-height: 1.75; color: var(--ink-2); }

/* Platform tabs */
.platforms { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 26px; }
.platform {
    display: grid;
    gap: 2px;
    text-align: start;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}
.platform:hover { border-color: #d3c9c1; }
.platform-name { font-size: 14px; font-weight: 600; }
.platform-note { font-size: 11.5px; color: var(--muted); }
.platform.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.platform.is-active .platform-note { color: var(--accent-bright); }

/* Workspace */
.workspace { display: grid; grid-template-columns: 1fr; gap: 18px; padding-bottom: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 2px rgba(23, 19, 15, 0.04); }
.card-head { margin-bottom: 14px; }
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-head p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }

/* Drop zone */
.drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    border: 1px dashed #d8cec6;
    border-radius: 14px;
    background: var(--paper);
    text-align: center;
    transition: border-color 120ms ease, background-color 120ms ease;
}
.drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop.has-file { border-style: solid; border-color: var(--line); }
.drop-icon { width: 30px; height: 30px; color: var(--muted); }
.drop-title { font-size: 14px; font-weight: 600; }
.drop-hint { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.drop-file { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 100%; font-size: 13px; color: var(--muted); }
.drop-file b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); direction: ltr; unicode-bidi: isolate; }
.drop-size { font-size: 12px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 120ms ease, background-color 120ms ease, border-color 120ms ease;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2a231e; }
.btn-secondary { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-link { border: 0; background: none; padding: 4px; font-size: 13px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-link:hover { color: var(--ink); }

/* Fields */
.field { margin-top: 18px; }
.field label, .field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.field input {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
}
.field textarea { width: 100%; padding: 12px 14px; font: inherit; font-size: 15px; color: var(--text); background: var(--surface, #fff); border: 1px solid var(--line, #ddd6cc); border-radius: 12px; resize: vertical; min-height: 96px; }
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segmented button {
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    font-size: 13px;
    color: var(--ink-2);
    cursor: pointer;
}
.segmented button.is-on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.form-actions { display: grid; gap: 8px; margin-top: 20px; }
.fineprint { margin-top: 14px; font-size: 11.5px; color: var(--muted); }
.error { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 13px; }

/* Progress */
.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.progress-label { font-size: 14px; font-weight: 600; }
.progress-pct { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.track { height: 6px; margin-top: 10px; border-radius: 999px; background: #eee7e1; overflow: hidden; }
.track span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 300ms ease; }
.progress-note { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* Empty result */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; margin: auto 0; padding: 6px 0; }
.empty-body { max-width: 40ch; }
.empty h2 { font-size: 16px; font-weight: 700; }
.empty p { margin-top: 6px; font-size: 13.5px; line-height: 1.75; color: var(--muted); }
.empty-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 11px; text-align: start; }
.empty-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--ink-2); }
.ring.is-ghost { width: 92px; height: 92px; opacity: 0.55; }
.ring.is-ghost .ring-num { font-size: 28px; color: var(--muted); }
.result-card { display: flex; flex-direction: column; }
.dot { flex: none; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--accent-bright); }

/* Result */
.result-head { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 108px; height: 108px; flex: none; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring circle { fill: none; stroke-width: 7; }
.ring .ring-track { stroke: #eee7e1; }
.ring .ring-fill { stroke: var(--ink); stroke-linecap: round; transition: stroke-dasharray 700ms ease; }
.ring.is-ready .ring-fill, .ring.is-tweak .ring-fill { stroke: var(--accent); }
.ring.is-hold .ring-fill { stroke: var(--red); }
.ring-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.result-text { min-width: 0; }
.platform-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.verdict { margin-top: 8px; font-size: 20px; font-weight: 700; }
.is-ready .verdict, .is-tweak .verdict { color: var(--accent); }
.is-hold .verdict { color: var(--red); }
.verdict-line { margin-top: 4px; font-size: 13px; color: var(--ink-2); }

.section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.section h3 { font-size: 14px; font-weight: 700; }
.section-note { margin-top: 3px; font-size: 12px; color: var(--muted); }

.meters { display: grid; gap: 16px; margin-top: 14px; }
.meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.meter-label { font-size: 13.5px; font-weight: 600; }
.meter-value { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meter-value.is-good { color: var(--accent); }
.meter-value.is-low { color: var(--red); }
.meter .track { margin-top: 7px; height: 5px; }
.meter .track span.is-mid { background: #b9a99f; }
.meter .track span.is-low { background: var(--red); }
.meter-note { margin-top: 7px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }

.fixes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 16px; }
.fixes li { display: grid; grid-template-columns: 22px 1fr; gap: 11px; }
.fix-num { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fix-body h4 { margin: 0; font-size: 13.5px; font-weight: 700; }
.fix-note { margin-top: 3px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.fix-action { margin-top: 5px; font-size: 13.5px; line-height: 1.7; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin: 14px 0 0; }
.facts dt { font-size: 11.5px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; word-break: break-word; }

.range { margin-top: 20px; padding: 0 2px; }
.range-track { position: relative; height: 10px; border-radius: 999px; background: #ece4de; }
.range-band { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: rgba(14, 107, 93, 0.18); box-shadow: inset 0 0 0 1px rgba(14, 107, 93, 0.45); }
.range-mark { position: absolute; top: -8px; bottom: -8px; width: 3px; margin-inline-start: -1.5px; border-radius: 3px; background: var(--ink); }
.range-mark i { position: absolute; top: -5px; inset-inline-start: 50%; width: 9px; height: 9px; margin-inline-start: -4.5px; border-radius: 50%; background: var(--ink); }
.range-ticks { display: flex; justify-content: space-between; margin-top: 12px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.range-legend { margin-top: 8px; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.range-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }

.disclaimer { margin-top: 18px; font-size: 11.5px; line-height: 1.7; color: var(--muted); }

/* How it works */
.how { padding-top: 40px; padding-bottom: 24px; }
.how h2 { font-size: 22px; font-weight: 700; }
.how-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 18px; }
.how-grid article { padding-top: 14px; border-top: 1px solid var(--line); }
.how-grid h3 { font-size: 14px; font-weight: 700; }
.how-grid p { margin-top: 5px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.how-note { margin-top: 22px; padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 13px; line-height: 1.7; color: var(--ink-2); }

/* Footer */
.site-footer { margin-top: 20px; padding: 26px 0 44px; border-top: 1px solid var(--line); }
.site-footer p { font-size: 12px; color: var(--muted); }
.footer-inner { display: flex; flex-direction: column; gap: 18px; }
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-brand .brand-name { font-family: var(--font); font-weight: 700; font-size: 15px; color: var(--ink); letter-spacing: -0.01em; }
.footer-brand p { max-width: 34ch; line-height: 1.7; }
.footer-by { border-inline-start: 2px solid var(--accent); padding-inline-start: 12px; }
.footer-role { font-size: 11px !important; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.footer-name { font-family: var(--font); font-weight: 600; font-size: 14px !important; color: var(--ink) !important; }

@media (max-width: 430px) {
    .hero { padding-top: 28px; padding-bottom: 18px; }
    .hero h1 { font-size: 27px; line-height: 1.35; }
    .lede { font-size: 14.5px; line-height: 1.8; }
    .platforms { gap: 6px; margin-top: 20px; }
    .platform { padding: 10px 12px; }
    .card { padding: 16px; border-radius: 16px; }
    .how { padding-top: 32px; padding-bottom: 20px; }
}

@media (min-width: 720px) {
    .footer-inner { flex-direction: row; align-items: flex-end; justify-content: space-between; }
    .platforms { grid-template-columns: repeat(3, 1fr); }
    .drop { flex-direction: row; text-align: start; padding: 18px 20px; gap: 14px; }
    .drop-text { flex: 1 1 auto; }
    .drop .btn { flex: none; }
    .how-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .workspace { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 22px; align-items: stretch; }
    .form-card { position: sticky; top: 78px; }
    .card { padding: 24px; }
    .how-grid { grid-template-columns: repeat(3, 1fr); }
    .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- theme ---------- */
html { color-scheme: light; }
[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f5f1ec;
    --ink-2: #cdc4bb;
    --muted: #9c9188;
    --line: #2e2823;
    --paper: #12100e;
    --card: #1b1714;
    --accent: #43c2a7;
    --accent-bright: #6ad9bf;
    --accent-soft: #16332c;
    --red: #f0796d;
    --red-soft: #3a1f1c;
}
[data-theme="dark"] body { background: var(--paper); }
[data-theme="dark"] .topbar { background: rgba(18, 16, 14, 0.86); }
[data-theme="dark"] .card { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
[data-theme="dark"] .drop { border-color: #3a332d; }
[data-theme="dark"] .platform:hover { border-color: #443c35; }
[data-theme="dark"] .platform.is-active { background: var(--accent); border-color: var(--accent); color: #0c1a17; }
[data-theme="dark"] .platform.is-active .platform-note { color: #0c2c26; }
[data-theme="dark"] .btn-primary { background: var(--accent); color: #0b1a17; }
[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: #52cfb3; }
[data-theme="dark"] .segmented .is-on { background: var(--accent); border-color: var(--accent); color: #0b1a17; }
[data-theme="dark"] .track { background: #2a241f; }
[data-theme="dark"] .range-track { background: #2a241f; }
[data-theme="dark"] .ring .ring-track { stroke: #2e2823; }
[data-theme="dark"] .ring .ring-fill { stroke: var(--ink); }
[data-theme="dark"] .ring.is-ready .ring-fill, [data-theme="dark"] .ring.is-tweak .ring-fill { stroke: var(--accent); }
[data-theme="dark"] .meter .track span.is-mid { background: #6b5c52; }
[data-theme="dark"] .brand-mark svg rect, [data-theme="dark"] .auth .brand-mark svg rect { fill: var(--accent); }
[data-theme="dark"] .brand-mark svg path, [data-theme="dark"] .auth .brand-mark svg path { fill: #0b1a17; }
[data-theme="dark"] .btn-google { background: var(--card); color: var(--ink); border-color: var(--line); }

/* ---------- theme toggle ---------- */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--card); color: var(--ink-2); cursor: pointer;
}
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth[hidden] { display: none; }
.auth-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; max-width: 1080px; margin: 0 auto; width: 100%; }
.auth-grid { display: grid; grid-template-columns: 1fr; gap: 26px; align-items: center; padding-top: 12px; padding-bottom: 40px; flex: 1; }
.auth-copy h1 { margin-top: 10px; font-size: 30px; line-height: 1.3; font-weight: 700; }
.auth-copy .lede { margin-top: 12px; font-size: 15px; }
.auth-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; }
.auth-points b { display: block; font-size: 13.5px; }
.auth-points span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: 0 1px 2px rgba(23,19,15,0.05); }
.auth-card h2 { font-size: 19px; font-weight: 700; }
.auth-sub { margin-top: 6px; font-size: 13px; color: var(--muted); }
.btn-google { margin-top: 18px; gap: 10px; background: var(--card); border-color: var(--line); color: var(--ink); height: 46px; }
.btn-google:hover { border-color: #cfc4bb; }
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; color: var(--muted); font-size: 11.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-card .field { margin-top: 14px; }
.code-input { letter-spacing: 0.4em; font-size: 17px; text-align: center; font-variant-numeric: tabular-nums; }
.auth-card .btn-primary { margin-top: 14px; }
.auth-card .btn-link { display: block; margin: 12px auto 0; }
.auth-note { margin-top: 12px; padding: 9px 11px; border-radius: 9px; background: var(--red-soft); color: var(--red); font-size: 12.5px; }
.auth-fine { margin-top: 14px; font-size: 11px; line-height: 1.7; color: var(--muted); text-align: center; }

/* ---------- topbar actions ---------- */
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-chip { display: none; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.user-chip.is-on { display: inline-flex; }
.user-email { font-size: 12px; color: var(--ink-2); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-out { border: 0; background: none; font-size: 11.5px; color: var(--muted); cursor: pointer; padding: 2px 4px; }
.user-out:hover { color: var(--ink); }

@media (max-width: 560px) {
    .user-email { max-width: 84px; font-size: 11px; }
    .user-chip { gap: 4px; padding: 3px 3px 3px 8px; }
    .topbar-actions { gap: 8px; }
}
@media (max-width: 430px) {
    .auth-copy h1 { font-size: 26px; }
    .auth-grid { gap: 20px; padding-top: 4px; }
    .auth-points { gap: 12px; }
    .topnav { display: none; }
}
@media (min-width: 860px) {
    .auth-grid { grid-template-columns: 1.1fr 420px; gap: 56px; padding-top: 24px; }
    .auth-copy h1 { font-size: 40px; }
    .auth-copy .lede { font-size: 16px; }
    .auth-card { padding: 26px; }
}

/* ---------- admin ---------- */
.admin { padding: 26px 20px 60px; }
.admin-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.admin-head h1 { margin-top: 8px; font-size: 26px; font-weight: 700; }
.admin-note { font-size: 12.5px; color: var(--muted); background: var(--accent-soft); border-radius: 9px; padding: 8px 11px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 11.5px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.admin-card { margin-bottom: 16px; }
.table-wrap { overflow-x: auto; margin-top: 4px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th { text-align: start; font-weight: 600; font-size: 11.5px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: 0; }
.table-empty { color: var(--muted); text-align: center; padding: 18px 0 !important; }
@media (min-width: 720px) {
    .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .admin-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}

/* ---------- legal ---------- */
.legal { max-width: 720px; padding-top: 40px; padding-bottom: 50px; }
.legal h1 { font-size: 30px; font-weight: 700; }
.legal-lede { margin-top: 12px; font-size: 15px; line-height: 1.8; color: var(--ink-2); }
.legal h2 { margin-top: 28px; font-size: 16px; font-weight: 700; }
.legal ul { margin: 10px 0 0; padding-inline-start: 20px; }
.legal li { font-size: 14px; line-height: 1.9; color: var(--ink-2); }
.legal p { margin-top: 8px; font-size: 14px; line-height: 1.9; color: var(--ink-2); }

.auth-links { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 10px; }
.auth-links .btn-link { margin: 0; }

/* extras: expected views, history, compare */
.baseline-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 10px; }
.baseline-row label { font-size: 13px; color: var(--ink-2); }
.baseline-row input { width: 140px; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; }
.views-range { margin: 6px 0 0; font-size: 15px; color: var(--ink); }
.views-range.is-empty { color: var(--muted); font-size: 13.5px; }
.views-note { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.history-card { margin-top: 22px; }
.history-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.history-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; text-align: start; }
.history-item.is-picked { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.history-score { font-weight: 700; font-size: 18px; min-width: 34px; }
.history-meta { display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); }
.history-meta b { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.history-note, .history-empty { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.compare { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.compare > div { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.compare span { font-size: 12px; color: var(--muted); }
.compare b { font-size: 22px; }
.compare small { font-size: 11.5px; color: var(--muted); }
.compare-diff b { color: var(--accent); }

/* Upload card: keep the change-video button inside the card, any width, any direction */
.drop { max-width: 100%; box-sizing: border-box; overflow: hidden; }
.drop-text { min-width: 0; max-width: 100%; }
.drop.has-file { flex-direction: column; align-items: center; text-align: center; padding: 18px 16px; gap: 12px; }
.drop.has-file .drop-text { flex: none; width: 100%; }
.drop.has-file .btn { align-self: center; }

/* ---------- quality pass ---------- */
.history-wrap { max-width: 1080px; margin: 22px auto 0; padding: 0 20px; }
.history-wrap .history-card { margin-top: 0; }

/* result: tinted summary block and softer sections */
.result-head { padding: 16px 18px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.result-head.is-ready, .result-head.is-tweak { background: var(--accent-soft); border-color: #cfe7e0; }
.result-head.is-hold { background: var(--red-soft); border-color: #f4cfcc; }
.ring-num { font-size: 36px; }
.verdict { font-size: 21px; }
.meter .track { height: 6px; border-radius: 99px; overflow: hidden; }
.meter .track span { border-radius: 99px; transition: width 700ms ease; }
.fixes li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.fix-body h4 { font-size: 14px; }
.facts > div:last-child { grid-column: 1 / -1; }
.facts > div:last-child dd { font-size: 12.5px; font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: normal; }
.facts > div:last-child dd span { display: block; overflow: hidden; text-overflow: ellipsis; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#result .result-head, #result .section, #result .disclaimer { animation: rise 360ms ease both; }
#result .section:nth-of-type(1) { animation-delay: 60ms; }
#result .section:nth-of-type(2) { animation-delay: 120ms; }
#result .section:nth-of-type(3) { animation-delay: 180ms; }
@media (prefers-reduced-motion: reduce) { #result .result-head, #result .section, #result .disclaimer { animation: none; } }

/* error and empty states */
.error { display: flex; gap: 8px; align-items: flex-start; line-height: 1.7; border: 1px solid #f4cfcc; }
.error::before { content: "!"; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
.empty .ring.is-ghost { opacity: 0.8; }

/* buttons and focus */
.btn { transition: transform 120ms ease, background-color 120ms ease, opacity 120ms ease; }
.btn:not(:disabled):active { transform: scale(0.985); }
.btn:focus-visible, .platform:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* dark mode for the new pieces */
[data-theme="dark"] .result-head { background: #1d1a17; border-color: #2e2924; }
[data-theme="dark"] .result-head.is-ready, [data-theme="dark"] .result-head.is-tweak { background: #12241f; border-color: #1f3d35; }
[data-theme="dark"] .result-head.is-hold { background: #2a1614; border-color: #4a2623; }
[data-theme="dark"] .fixes li { background: #1d1a17; border-color: #2e2924; }
[data-theme="dark"] .error { border-color: #4a2623; }

/* mobile */
@media (max-width: 560px) {
    .topnav a:not(#admin-link) { display: none; }
    .user-email { display: none; }
    .user-chip { padding: 4px 10px; }
    .history-wrap { padding: 0 16px; }
    .result-head { padding: 14px; gap: 14px; }
    .ring { width: 92px; height: 92px; }
    .ring-num { font-size: 30px; }
    .verdict { font-size: 19px; }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.error[hidden] { display: none; }
.ring.is-fix .ring-fill { stroke: #c27b14; }
.is-fix .verdict { color: #9a5f0c; }
.result-head.is-fix { background: #fdf4e3; border-color: #f1dcb0; }
[data-theme="dark"] .result-head.is-fix { background: #2a2111; border-color: #4a3a1a; }
[data-theme="dark"] .is-fix .verdict { color: #e6a84a; }
[data-theme="dark"] .ring.is-fix .ring-fill { stroke: #e6a84a; }
@media (max-width: 560px) {
    .platforms { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .platform { padding: 10px 8px; text-align: center; }
    .platform-note { display: none; }
    .platform-name { font-size: 12.5px; }
}

/* safe zones */
.safezone { display: flex; align-items: center; gap: 22px; margin-top: 14px; }
.phone { position: relative; flex: none; width: 150px; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #2a2622; }
.phone canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.zone { position: absolute; background: rgba(179, 38, 30, 0.38); border: 1px dashed rgba(255, 255, 255, 0.7); }
.zone-top { top: 0; left: 0; right: 0; }
.zone-bottom { bottom: 0; left: 0; right: 0; }
.zone-side { right: 0; }
.zone-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13px; color: var(--ink-2); }
.zone-legend li { display: flex; align-items: center; gap: 9px; }
.zone-chip { flex: none; width: 14px; height: 14px; border-radius: 4px; background: rgba(179, 38, 30, 0.38); border: 1px dashed var(--red); }
@media (max-width: 560px) { .safezone { gap: 16px; } .phone { width: 120px; } }

#long-fields[hidden] { display: none; }
.platforms { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .platforms { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .platforms { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } .platform { padding: 10px 4px; } .platform-name { font-size: 12px; } }
.timeline { display: flex; align-items: flex-end; gap: 2px; height: 84px; padding: 8px; border: 1px solid var(--line, #e6e0d8); border-radius: 12px; background: var(--surface-2, #faf7f3); }
.tl-bar { flex: 1 1 0; min-width: 2px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.tl-bar.is-still { background: #c9bfb2; opacity: .8; }
.chapter-spots { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chapter-spots li { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line, #e6e0d8); font-variant-numeric: tabular-nums; font-size: 14px; }

html.has-session #auth { display: none !important; }

.audit { margin-top: 28px; }
.audit-row { display: flex; gap: 10px; margin-top: 14px; }
.audit-row input { flex: 1 1 auto; min-width: 0; padding: 12px 14px; font: inherit; font-size: 15px; color: var(--text); background: var(--surface, #fff); border: 1px solid var(--line, #ddd6cc); border-radius: 12px; }
.audit-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#audit-result:not(:empty) { margin-top: 18px; }
@media (max-width: 560px) { .audit-row { flex-direction: column; } }

.hook-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; }
.hook-cell { margin: 0; flex: 0 0 auto; text-align: center; }
.hook-frame { display: block; border-radius: 10px; background: #2a2622; border: 1px solid var(--line, #e6e0d8); max-width: 100%; }
.hook-cell figcaption { display: flex; flex-direction: column; gap: 4px; align-items: center; margin-top: 6px; font-size: 12px; }
.hook-badge { padding: 2px 8px; border-radius: 999px; background: #efe9e1; color: #5b5147; font-size: 11px; }
.hook-badge.is-move { background: #dff1ec; color: #0e6b5d; }
.hook-badge.is-still { background: #f9e7d3; color: #9a5a12; }
[data-theme="dark"] .hook-badge { background: #2b2620; color: #cfc5b8; }
[data-theme="dark"] .hook-badge.is-move { background: #12332d; color: #5fd0bb; }
[data-theme="dark"] .hook-badge.is-still { background: #3a2a14; color: #e6a84a; }


/* ---------- evidence layer ---------- */
.est-tag { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.proof-root:empty { display: none; }
.proof-block { margin: 28px 0 8px; }
.px-head { margin-bottom: 16px; }
.px-eyebrow { display: inline-block; font: 700 11px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.16em; color: var(--accent); padding: 5px 8px; border: 1px solid var(--accent); border-radius: 4px; margin-bottom: 10px; }
.px-head h2 { font-size: clamp(20px, 3.4vw, 27px); letter-spacing: -0.02em; margin-bottom: 6px; }
.px-head p { color: var(--ink-2); max-width: 62ch; }
.scope { background: #0e1512; color: #cfe9e1; border-radius: 14px; padding: 16px; box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 18px 40px -22px rgba(0,0,0,0.5); border: 1px solid #1d2a25; }
.scope-top { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; margin-bottom: 14px; }
.scope-video.is-v .scope-player { width: 150px; aspect-ratio: 9 / 16; }
.scope-video.is-h .scope-player { width: 260px; aspect-ratio: 16 / 9; }
.scope-player { display: block; background: #000; border-radius: 8px; object-fit: contain; max-width: 100%; }
.readout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ro { background: #131d19; border: 1px solid #1f2e28; border-radius: 8px; padding: 9px 10px; min-width: 0; }
.ro-k { display: block; font: 600 9.5px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.12em; color: #7fa397; margin-bottom: 6px; }
.ro b { font: 600 22px/1.1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #e8fbf5; font-variant-numeric: tabular-nums; }
.ro small { font-size: 11px; color: #7fa397; font-weight: 500; }
.ro-s { display: block; margin-top: 5px; font-size: 11px; color: #7fa397; min-height: 15px; }
.ro-s.is-on { color: #5fd0b6; }
.ro-s.is-off { color: #ff8b80; }
.ro-s.is-cut { color: #f0b34a; }
.scope-key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 14px; font-size: 12px; color: #9dbfb3; }
.scope-key li { display: flex; align-items: center; gap: 8px; }
.scope-key i { width: 14px; height: 8px; border-radius: 2px; flex: none; }
.k-wave { background: #5fd0b6; }
.k-gate { background: none; border-top: 2px dashed #f0b34a; height: 0 !important; }
.k-sil { background: rgba(255,107,94,0.45); }
.k-cut { background: #f0b34a; width: 3px !important; }
.k-hook { background: rgba(95,208,182,0.25); border-inline-end: 2px solid #5fd0b6; }
.scope-tl { position: relative; cursor: crosshair; border-radius: 8px; background: #0a110e; border: 1px solid #1a2822; overflow: hidden; touch-action: pan-y; }
.scope-tl canvas { display: block; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.6); pointer-events: none; left: 0; }
.tl-tip { position: absolute; top: 4px; transform: translateX(-50%); background: #e8fbf5; color: #0e1512; font: 600 11px ui-monospace, Menlo, Consolas, monospace; padding: 2px 6px; border-radius: 4px; pointer-events: none; }
.lane-label { position: absolute; left: 8px; font: 600 9px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.14em; color: #6f8f84; pointer-events: none; }
.lane-label.l1 { top: 6px; }
.lane-label.l2 { top: 126px; }
.tl-axis { display: flex; justify-content: space-between; font: 500 11px ui-monospace, Menlo, Consolas, monospace; color: #6f8f84; padding: 6px 2px 0; }
.scope-note { margin-top: 8px; font-size: 12px; color: #9dbfb3; }
.px-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.px-chip { display: inline-flex; align-items: baseline; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; }
.px-chip em { font-style: normal; color: var(--muted); }
.px-chip b { font: 600 13px ui-monospace, Menlo, Consolas, monospace; }
.px-sub { margin: 22px 0 12px; }
.px-sub h3 { font-size: 17px; }
.px-sub p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.px-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.px-card { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-inline-start: 4px solid var(--muted); border-radius: 12px; padding: 12px; }
.px-card.tone-good { border-inline-start-color: #1f9d6b; }
.px-card.tone-warn { border-inline-start-color: #d89a1d; }
.px-card.tone-bad { border-inline-start-color: var(--red); }
.px-card.tone-info { border-inline-start-color: #3a6fd8; }
.px-thumb { flex: none; border-radius: 6px; background: repeating-linear-gradient(45deg, #1b1612, #1b1612 6px, #241e19 6px, #241e19 12px); opacity: 0.55; transition: opacity .3s; }
.px-thumb.is-drawn { opacity: 1; }
.px-thumb.none { display: none; }
.px-thumb.v { width: 72px; height: 128px; }
.px-thumb.h { width: 128px; height: 72px; }
.px-body { min-width: 0; }
.px-tags { display: flex; gap: 6px; margin-bottom: 6px; }
.px-kind, .px-tone { font: 700 9.5px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.1em; padding: 4px 6px; border-radius: 4px; }
.px-kind { background: var(--ink); color: var(--paper); }
.px-tone { background: var(--accent-soft); color: var(--accent); }
.tone-warn .px-tone { background: #fbf1da; color: #8a5d00; }
.tone-bad .px-tone { background: var(--red-soft); color: var(--red); }
.tone-info .px-tone { background: #e6eefc; color: #2a55a8; }
.px-body h4 { margin: 0 0 4px; font-size: 15px; }
.px-body p { font-size: 13px; color: var(--ink-2); }
.px-go { margin-top: 8px; font: inherit; font-size: 12.5px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; color: var(--ink); }
.px-go b { font: 600 12px ui-monospace, Menlo, Consolas, monospace; color: var(--accent); }
.px-go:hover { border-color: var(--accent); }
.px-empty { color: var(--muted); font-size: 14px; }
.hk-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.hk { margin: 0; flex: none; }
.hk figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; font-size: 11.5px; max-width: 160px; }
.hk figcaption b { font: 600 12px ui-monospace, Menlo, Consolas, monospace; }
.hk-tag { font-size: 11px; padding: 2px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.hk-tag.is-still { background: #eeeae6; color: var(--muted); }
.hk-tag:empty { display: none; }
.hk-d { font: 500 11px ui-monospace, Menlo, Consolas, monospace; color: var(--muted); }
.au-list { display: grid; gap: 8px; }
.au-part { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.au-part > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; padding: 12px 14px; list-style: none; font-weight: 600; }
.au-part > summary::-webkit-details-marker { display: none; }
.au-part > summary::after { content: "+"; font: 400 18px/1 ui-monospace, monospace; color: var(--muted); margin-inline-start: 6px; }
.au-part[open] > summary::after { content: "–"; }
.au-calc { margin-inline-start: auto; font: 500 12.5px ui-monospace, Menlo, Consolas, monospace; color: var(--muted); }
.au-calc b { color: var(--accent); font-size: 14px; }
.au-wrap { overflow-x: auto; padding: 0 14px 12px; }
.au-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.au-table th { text-align: start; font: 600 10.5px ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.08em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.au-table td { padding: 9px 8px; border-bottom: 1px solid #f0ebe6; vertical-align: top; }
.au-table tr:last-child td { border-bottom: 0; }
.c-k b { display: block; font-weight: 600; }
.c-v { font-variant-numeric: tabular-nums; }
.c-r { color: var(--ink-2); }
.c-p { white-space: nowrap; font: 500 13px ui-monospace, Menlo, Consolas, monospace; text-align: end; }
.c-p b { color: var(--accent); font-size: 15px; }
.src { display: inline-block; margin-top: 4px; font: 700 9px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.1em; padding: 3px 5px; border-radius: 3px; background: var(--accent-soft); color: var(--accent); }
.src.is-input { background: #eeeae6; color: var(--muted); }
.au-foot { padding: 0 14px 12px; font-size: 12px; color: var(--muted); }
.px-limits { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.px-limits h3 { font-size: 15px; margin-bottom: 6px; }
.px-limits ul { margin: 0; padding-inline-start: 18px; color: var(--ink-2); font-size: 13.5px; display: grid; gap: 4px; }
@media (max-width: 640px) {
  .scope-top { grid-template-columns: 1fr; }
  .scope-video.is-v .scope-player { width: 120px; }
  .scope-video.is-h .scope-player { width: 100%; }
  .readout { grid-template-columns: 1fr 1fr 1fr; }
  .ro b { font-size: 18px; }
  .px-cards { grid-template-columns: 1fr; }
}
[data-theme="dark"] .px-card, [data-theme="dark"] .au-part, [data-theme="dark"] .px-chip { background: var(--card); }
.ro b, .tl-tip, .au-calc, .c-p { direction: ltr; unicode-bidi: isolate; }
.ro small { margin-inline-start: 2px; }
.hk-v { width: 90px; }
.hk-h { width: 160px; }
.hk figcaption { max-width: none; }

@media (max-width: 640px) {
  .au-table { min-width: 0; }
  .au-table thead { display: none; }
  .au-table, .au-table tbody, .au-table tr, .au-table td { display: block; width: 100%; }
  .au-table tr { padding: 10px 0; border-bottom: 1px solid #f0ebe6; }
  .au-table tr:last-child { border-bottom: 0; }
  .au-table td { border: 0; padding: 3px 0; }
  .c-p { text-align: start; }
  .c-v::before { content: attr(data-l); }
}
[hidden] { display: none !important; }
.workspace { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .workspace { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); } }
.workspace > *, .proof-root, .proof-block, .scope, .au-list { min-width: 0; max-width: 100%; }

.specimen-wrap { width: 100%; max-width: 360px; }
.specimen { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 14px 30px -18px rgba(0,0,0,0.5); }
.specimen-tag { display: inline-block; margin-top: 8px; font: 600 10.5px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.06em; color: var(--muted); border: 1px dashed var(--line); border-radius: 999px; padding: 5px 9px; }

.guide-table { width: 100%; border-collapse: collapse; margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.guide-table th, .guide-table td { text-align: start; padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.guide-table th { width: 32%; font-weight: 700; color: var(--ink); }
.guide-table tr:last-child th, .guide-table tr:last-child td { border-bottom: 0; }
.guide-note { color: var(--muted); font-size: 13px; }
.guide-cta { display: inline-block; margin-top: 14px; text-decoration: none; }
.footer-guides { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; align-items: center; }
.footer-guides a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line); }
.footer-guides a:hover { color: var(--accent); border-color: var(--accent); }
.guide-cta { padding: 13px 22px; line-height: 1.2; }

/* v17 polish: timeline ruler motif, tied to what the tool measures */
.hero { position: relative; }
.hero::after {
    content: ""; display: block; height: 14px; margin-top: 26px; opacity: .55;
    background:
      repeating-linear-gradient(90deg, var(--ink-2) 0 1px, transparent 1px 12px) bottom/100% 7px no-repeat,
      repeating-linear-gradient(90deg, var(--ink-2) 0 1px, transparent 1px 60px) bottom/100% 14px no-repeat;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 55%, transparent 100%);
            mask-image: linear-gradient(90deg, #000 0, #000 55%, transparent 100%);
}
[dir="rtl"] .hero::after { -webkit-mask-image: linear-gradient(270deg, #000 0, #000 55%, transparent 100%); mask-image: linear-gradient(270deg, #000 0, #000 55%, transparent 100%); }
.hero h1 { font-size: clamp(32px, 6.4vw, 58px); letter-spacing: -0.02em; }
.platform { transition: transform .15s ease, border-color .15s ease; }
.platform:hover { transform: translateY(-2px); border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .platform { transition: none; } .platform:hover { transform: none; } }

/* v18: result reveal, dark summary panel, evidence-backed fix list */
.l-en { display: none; }
[data-lang="en"] .l-ar { display: none; }
[data-lang="en"] .l-en { display: inline; }
.result-head { position: relative; overflow: hidden; padding: 22px 22px 30px; background: #14110e !important; border: 1px solid #2a241f !important; color: #f4efe9; gap: 22px; }
.result-head::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 10px; opacity: .35;
  background: repeating-linear-gradient(90deg, #f4efe9 0 1px, transparent 1px 10px) bottom/100% 6px no-repeat, repeating-linear-gradient(90deg, #f4efe9 0 1px, transparent 1px 50px) bottom/100% 10px no-repeat; }
.result-head .ring { width: 128px; height: 128px; }
.result-head .ring-num { font-size: 46px; color: #fff; }
.result-head .ring circle { stroke-width: 6; }
.result-head .ring .ring-track { stroke: rgba(255,255,255,.14); }
.result-head .ring .ring-fill { stroke: var(--accent-bright); }
.result-head.is-fix .ring .ring-fill { stroke: #f0b85a; }
.result-head.is-hold .ring .ring-fill { stroke: #ef7b72; }
.result-head .verdict { font-size: 24px; color: #fff; }
.result-head.is-hold .verdict { color: #ffb4ad; }
.result-head.is-fix .verdict { color: #f6cf8e; }
.result-head.is-ready .verdict, .result-head.is-tweak .verdict { color: var(--accent-bright); }
.result-head .verdict-line { color: #cfc6bd; }
.result-head .platform-chip { background: rgba(255,255,255,.1); color: #f4efe9; border-color: rgba(255,255,255,.18); }
.result-head .est-tag { color: #9d9389; }
.potential { margin-top: 10px; padding: 8px 11px; border-radius: 10px; background: rgba(95,208,182,.12); color: #bff0e3; font-size: 12.5px; line-height: 1.65; }
.is-revealing .verdict, .is-revealing .verdict-line, .is-revealing .potential, .is-revealing .platform-chip { animation: scRise .6s ease both; }
.is-revealing .verdict { animation-delay: .5s; } .is-revealing .verdict-line { animation-delay: .65s; } .is-revealing .potential { animation-delay: .8s; }
.fixes li { animation: scRise .55s ease both; }
@keyframes scRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fix-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fix-gain { flex: none; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fix-ev { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.fix-ev li { display: grid !important; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; align-items: baseline; padding: 6px 9px !important; border-radius: 8px !important; border: 0 !important; background: var(--accent-soft) !important; font-size: 12px; animation: none !important; }
.fix-ev .ev-k { color: var(--ink-2); } .fix-ev .ev-v { font-weight: 700; } .fix-ev .ev-p { font-variant-numeric: tabular-nums; color: var(--muted); direction: ltr; }
@media (max-width: 560px) { .result-head { flex-direction: column; align-items: flex-start; } .result-head .ring { width: 112px; height: 112px; } }
@media (prefers-reduced-motion: reduce) { .fixes li, .is-revealing * { animation: none !important; } }
.fix-ev .ev-v { unicode-bidi: plaintext; text-align: start; }

/* v19: loading state */
.scan-panel { padding: 4px 0; }
.scan-stage { position: relative; height: 120px; margin-bottom: 18px; border-radius: 12px; background: #14110e; overflow: hidden; }
.scan-ruler { position: absolute; inset-inline: 0; bottom: 0; height: 14px; opacity: .4;
  background: repeating-linear-gradient(90deg, #f4efe9 0 1px, transparent 1px 10px) bottom/100% 7px no-repeat, repeating-linear-gradient(90deg, #f4efe9 0 1px, transparent 1px 50px) bottom/100% 14px no-repeat; }
.scan-line { position: absolute; top: 0; bottom: 0; width: 2px; inset-inline-start: 0; background: var(--accent-bright); box-shadow: 0 0 18px 4px rgba(95,208,182,.55); animation: scScan 2.2s ease-in-out infinite alternate; }
@keyframes scScan { from { inset-inline-start: 4%; } to { inset-inline-start: 96%; } }
.progress-time { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .scan-line { animation: none; inset-inline-start: 50%; } }

/* v20: identity pass: type, hero, cards, mobile */
:root { --font: "IBM Plex Sans Arabic", "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif; }
body { font-feature-settings: "tnum" 1; }
.hero { padding-top: 56px; }
.kicker { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); letter-spacing: .08em; }
.kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #d8473b; box-shadow: 0 0 0 3px rgba(216,71,59,.18); animation: scRec 1.6s ease-in-out infinite; }
@keyframes scRec { 50% { opacity: .35; } }
.hero h1 { margin-top: 18px; font-size: clamp(34px, 7vw, 68px); line-height: 1.12; font-weight: 700; letter-spacing: -0.03em; }
.hero h1 .hl { color: var(--accent); background: linear-gradient(transparent 86%, rgba(95,208,182,.5) 86% 94%, transparent 94%); }
[data-theme="dark"] .hero h1 .hl { color: var(--accent-bright); }
.lede { font-size: 17px; line-height: 1.8; }
.platform { border-radius: 14px; }
.platform.is-active { box-shadow: 0 10px 24px -14px rgba(23,19,15,.6); }
.card { border-color: #ddd4cc; box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 18px 34px -24px rgba(23,19,15,.28); }
[data-theme="dark"] .card { box-shadow: none; }
.form-card .card-head h2::before { content: "01"; display: inline-block; margin-inline-end: 9px; padding: 1px 7px; border-radius: 6px; background: var(--ink); color: var(--accent-bright); font-size: 11px; font-weight: 600; letter-spacing: .06em; vertical-align: 2px; }
.btn-primary { border-radius: 12px; box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 10px 20px -12px rgba(23,19,15,.7); }
.btn-primary:disabled { box-shadow: none; }
input[type="text"], textarea { border-radius: 12px; }
@media (max-width: 640px) {
  .hero { padding-top: 34px; }
  .platforms { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -20px; padding: 2px 20px 10px; scrollbar-width: none; }
  .platforms::-webkit-scrollbar { display: none; }
  .platform { flex: 0 0 150px; scroll-snap-align: start; }
  .form-card .form-actions { position: sticky; bottom: 0; z-index: 5; margin-inline: -4px; padding: 16px 4px 10px; background: linear-gradient(rgba(255,255,255,0), var(--card) 34%); }
}
@media (prefers-reduced-motion: reduce) { .kicker::before { animation: none; } }

/* ---------- plan chip ---------- */
.plan-chip {
    display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--card);
    color: var(--ink); font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.plan-chip:hover { border-color: var(--accent); color: var(--accent); }
.plan-chip.is-empty { background: var(--ink); border-color: var(--ink); color: #fff; }
.plan-chip .l-en { display: none; }
[data-lang="en"] .plan-chip .l-ar { display: none; }
[data-lang="en"] .plan-chip .l-en { display: inline; }
[data-theme="dark"] .plan-chip.is-empty { background: var(--accent); border-color: var(--accent); color: #0b1a17; }

/* ---------- paywall / plan offer ---------- */
.paywall { display: grid; gap: 14px; }
.paywall h2 { font-size: 22px; }
.paywall-lede { font-size: 14.5px; line-height: 1.75; color: var(--ink-2); }
.paywall-list { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.paywall-list li::marker { color: var(--accent); }
.pay-box { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.pay-rows { display: grid; gap: 8px; }
.pay-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-method { min-width: 84px; font-size: 12.5px; color: var(--muted); }
.pay-row b { font-size: 15px; letter-spacing: 0.02em; }
.pay-copy { margin-inline-start: auto; }
.pay-note, .pay-steps { font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.pay-off { font-size: 13.5px; color: var(--muted); }
.pay-form { display: grid; gap: 12px; }
.pay-form .segmented { grid-template-columns: repeat(2, 1fr); }
.pay-pending { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--accent); border-radius: 14px; background: var(--accent-soft); font-size: 13.5px; line-height: 1.7; }
.pay-pending-title { font-weight: 700; }
.pay-pending .btn-link { justify-self: start; }

/* ---------- subscribe page ---------- */
.plan-page { display: grid; gap: 18px; max-width: 720px; padding-top: 36px; padding-bottom: 48px; }
.plan-intro h1 { margin-top: 10px; font-size: clamp(26px, 5vw, 36px); }
.plan-card { padding: 22px; }
.plan-now { display: grid; gap: 4px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.plan-now-line { font-size: 14px; font-weight: 600; }
.plan-now-line.is-pending { color: var(--accent); }
.plan-foot { font-size: 12.5px; line-height: 1.75; color: var(--muted); }

/* ---------- admin additions ---------- */
.stat.is-alert .stat-value { color: var(--accent); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.row-actions { display: flex; gap: 8px; }
.admin-table td.row-actions { display: table-cell; white-space: nowrap; }
.admin-table td.row-actions .btn + .btn, .admin-table td.row-actions .entry-state + .btn { margin-inline-start: 6px; }
.admin-table td { vertical-align: middle; }
.cell-date { direction: ltr; unicode-bidi: isolate; text-align: end; white-space: nowrap; }
@media (max-width: 640px) {
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 8px; }
}
.mismatch { font-size: 11px; color: var(--red); }
.settings-form { display: grid; gap: 14px; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.set-grid .field-wide { grid-column: 1 / -1; }
.settings-hint { font-size: 12.5px; color: var(--muted); }

@media (max-width: 640px) {
    .set-grid { grid-template-columns: 1fr; }
    .plan-chip { height: 30px; padding: 0 9px; font-size: 11.5px; }
    .paywall h2 { font-size: 20px; }
}

/* v22: tap feedback everywhere + one confirmation pill for copy actions */
button:not(:disabled), .platform, [data-copy], [data-method], .seg button {
    transition: transform 120ms ease, opacity 120ms ease, background-color 120ms ease, border-color 120ms ease;
}
button:not(:disabled):active, .platform:active, [data-copy]:active, [data-method]:active { transform: scale(0.97); }
.sc-toast {
    position: fixed;
    inset-inline: 0;
    bottom: 22px;
    z-index: 90;
    width: fit-content;
    max-width: calc(100% - 32px);
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: #14110e;
    color: #f4efe9;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 14px 34px -14px rgba(23, 19, 15, 0.75);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}
.sc-toast.is-on { opacity: 1; transform: none; }
.sc-toast::before { content: "✓"; color: #5fd0b6; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
    button:not(:disabled):active, .platform:active, [data-copy]:active, [data-method]:active { transform: none; }
    .sc-toast { transition: none; transform: none; }
}

/* v23: suggested title */
.suggest-text { margin: 10px 0 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 600; line-height: 1.7; unicode-bidi: plaintext; }
.suggest-meta { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }

/* public landing: price, sample, how-it-works */
.price-line { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink-2); font-size: 13.5px; line-height: 1.7; }
.price-line b { color: var(--accent); }
.auth-nav { margin: 0 auto 0 18px; }
.pub-sample, .auth .how { padding-top: 28px; padding-bottom: 28px; }
.sample-card { position: relative; margin-top: 14px; max-width: 640px; }
.sample-tag { position: absolute; top: 14px; inset-inline-end: 16px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--paper); border: 1px dashed var(--muted); color: var(--muted); }
.sample-top { display: flex; align-items: center; gap: 16px; }
.sample-score { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 88px; height: 88px; border-radius: 50%; border: 6px solid var(--accent-bright); }
.sample-score b { font-size: 30px; line-height: 1; }
.sample-score span { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sample-verdict { margin-top: 6px; font-size: 17px; font-weight: 700; }
.sample-table { margin-top: 14px; }
.sample-table td:last-child { color: var(--muted); }
.sample-fix { margin-top: 12px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.how-sub { margin-top: 24px; font-size: 14px; font-weight: 700; }
.how-table-wrap { margin-top: 10px; overflow-x: auto; }
.how-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.how-table th, .how-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; }
.how-table thead th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.how-table tbody th { font-weight: 600; white-space: nowrap; }
.how-table tr.total th, .how-table tr.total td { font-weight: 700; border-bottom: 0; }
.how-list { margin: 10px 0 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
@media (max-width: 640px) { .how-table th, .how-table td { padding: 7px 6px; font-size: 12px; } .sample-top { padding-top: 22px; } }

.audio-warn{margin:14px 0;padding:12px 14px;border:1px solid #d9a441;border-inline-start:4px solid #d9a441;border-radius:10px;background:rgba(217,164,65,.12);font-size:.95rem;line-height:1.7}

.guest-try{margin-top:14px}
.guest-try .auth-sub{margin-top:8px}
.guest-cta{margin:0 0 14px;padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:var(--accent-soft);display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.guest-cta p{margin:0;font-size:14px;line-height:1.7}
.is-guest .user-chip,.is-guest #plan-chip{display:none}

/* title suggestions */
.suggest-box { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.suggest-box .btn { padding: 8px 16px; font-size: 14px; }
.suggest-box .field-hint { margin-top: 0; }
#suggest-out { flex-basis: 100%; display: grid; gap: 8px; }
#suggest-out[hidden] { display: none; }
.suggest-chip { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.suggest-chip:hover, .suggest-chip.is-picked { border-color: var(--accent); background: var(--accent-soft); }
.suggest-chip-score { flex: none; font-size: 12px; font-weight: 700; color: var(--accent); }
[data-theme="dark"] .suggest-chip { color: inherit; }
#listen-out { flex-basis: 100%; display: grid; gap: 8px; }
#listen-out[hidden] { display: none; }
#listen-btn[hidden] { display: none; }
.listen-heard { margin: 0; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 12px; background: var(--paper); color: var(--ink-2); line-height: 1.8; }

/* ---------- mobile overflow fix ---------- */
html, body { max-width: 100%; overflow-x: clip; }
.topbar-inner { gap: 8px; }
.topbar-actions { min-width: 0; }
.brand { flex: none; }
@media (max-width: 560px) {
  .topbar-actions { gap: 6px; flex: 0 1 auto; min-width: 0; }
  .plan-chip { min-width: 0; max-width: 118px; padding: 0 9px; font-size: 12px; overflow: hidden; }
  .plan-chip span { display: block; overflow: hidden; text-overflow: ellipsis; }
  .user-chip.is-on { flex: none; }
  #admin-link { font-size: 12px; white-space: nowrap; }
}

/* sticky CTA only after a video is chosen, so it never covers the pick button */
@media (max-width: 640px) {
  .form-card .form-actions { position: static; background: none; margin-inline: 0; padding: 16px 0 0; }
  .form-card:has(.drop.has-file) .form-actions { position: sticky; bottom: 0; margin-inline: -4px; padding: 16px 4px 10px; background: linear-gradient(rgba(255,255,255,0), var(--card) 34%); }
  [data-theme="dark"] .form-card:has(.drop.has-file) .form-actions { background: linear-gradient(rgba(0,0,0,0), var(--card) 34%); }
}

/* ---------- install button ---------- */
.install-box { margin: 16px 0 0; display: grid; gap: 8px; justify-items: start; }
.install-box[hidden], .install-tip[hidden], .install-tip [hidden] { display: none; }
.install-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.install-btn svg { width: 18px; height: 18px; flex: none; }
.install-tip { margin: 0; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 12px; background: var(--paper); color: var(--ink-2); font-size: 13.5px; line-height: 1.8; max-width: 46ch; }
.install-box .l-en, .install-tip .l-en { display: none; }
[data-lang="en"] .install-box .l-ar, [data-lang="en"] .install-tip .l-ar { display: none; }
[data-lang="en"] .install-box .l-en, [data-lang="en"] .install-tip .l-en { display: inline; }
.nav-badge{display:inline-block;min-width:18px;padding:1px 6px;margin-inline-start:6px;border-radius:999px;background:#d33;color:#fff;font-size:12px;line-height:18px;text-align:center;font-weight:600}

.plan-chip.is-owner { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
[data-theme="dark"] .plan-chip.is-owner { background: var(--accent); border-color: var(--accent); color: #0b1a17; }
.owner-bar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; background: var(--accent); color: #0b1a17; font-size: 14px; font-weight: 700; text-decoration: none; }
.owner-bar[hidden] { display: none; }
.owner-bar .l-en { display: none; }
[data-lang="en"] .owner-bar .l-ar { display: none; }
[data-lang="en"] .owner-bar .l-en { display: inline; }

.plan-chip.is-owner { flex: none; max-width: none; overflow: visible; }
.plan-chip.is-owner span { overflow: visible; text-overflow: clip; }
.update-bar { position: fixed; inset-inline: 12px; bottom: 12px; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.update-bar button { border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 700; background: var(--accent); color: #0b1a17; cursor: pointer; }

/* ---- motion polish: transform and opacity only, off for reduced motion ---- */
html { scroll-behavior: smooth; }
.topbar, .auth-top { transition: box-shadow 200ms ease; }
.topbar.is-scrolled, .auth-top.is-scrolled { box-shadow: 0 6px 24px -14px rgba(0, 0, 0, .45); }
@media (prefers-reduced-motion: no-preference) {
    .auth-copy > .kicker, .auth-copy > h1, .auth-copy > .lede, .auth-copy > .price-line { animation: scRise .6s cubic-bezier(.2,.7,.2,1) both; }
    .auth-copy > h1 { animation-delay: .06s; }
    .auth-copy > .lede { animation-delay: .14s; }
    .auth-copy > .price-line { animation-delay: .22s; }
    .auth-points li { animation: scRise .55s cubic-bezier(.2,.7,.2,1) both; }
    .auth-points li:nth-child(1) { animation-delay: .30s; }
    .auth-points li:nth-child(2) { animation-delay: .38s; }
    .auth-points li:nth-child(3) { animation-delay: .46s; }
    .auth-points li:nth-child(4) { animation-delay: .54s; }
    .auth-card { animation: scRise .7s .12s cubic-bezier(.2,.7,.2,1) both; }
    .hero > * { animation: scRise .6s cubic-bezier(.2,.7,.2,1) both; }
    .has-motion .rv { opacity: 0; transform: translateY(16px); transition: opacity .55s ease var(--rv-d, 0ms), transform .55s cubic-bezier(.2,.7,.2,1) var(--rv-d, 0ms); }
    .has-motion .rv.is-in { opacity: 1; transform: none; }
    .has-motion .sample-card.is-in .how-table tr { animation: scRise .5s both; }
    .has-motion .sample-card.is-in .how-table tr:nth-child(1) { animation-delay: .15s; }
    .has-motion .sample-card.is-in .how-table tr:nth-child(2) { animation-delay: .22s; }
    .has-motion .sample-card.is-in .how-table tr:nth-child(3) { animation-delay: .29s; }
    .has-motion .sample-card.is-in .how-table tr:nth-child(4) { animation-delay: .36s; }
    .has-motion .sample-card.is-in .how-table tr:nth-child(5) { animation-delay: .43s; }
    .has-motion .sample-card.is-in .how-table tr:nth-child(6) { animation-delay: .50s; }
    .btn-primary:active, .btn:active { transform: scale(.98); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- share sheet ---- */
.share-layer { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: flex-end; justify-content: center; }
.share-back { position: absolute; inset: 0; background: rgba(10, 8, 6, .55); }
.share-panel { position: relative; width: 100%; max-width: 440px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -18px 50px -20px rgba(0, 0, 0, .55); }
.share-title { margin: 0 0 14px; font-size: 17px; font-weight: 700; }
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.share-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 13.5px; text-decoration: none; cursor: pointer; }
.share-item:active { transform: scale(.97); }
.share-mark { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 17px; font-family: system-ui, sans-serif; }
.share-close { margin-top: 12px; width: 100%; padding: 11px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.share-foot { display: block; margin: 10px auto 0; padding: 6px 12px; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (min-width: 640px) { .share-layer { align-items: center; } .share-panel { border-radius: 20px; } }
@media (prefers-reduced-motion: no-preference) { .share-panel { animation: scRise .28s ease both; } .share-back { animation: scFade .2s ease both; } @keyframes scFade { from { opacity: 0; } to { opacity: 1; } } }

/* ---- GSAP / Lenis layer ---- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
html.fx-wait .auth-copy > h1, html.fx-wait .hero > h1 { animation: none; opacity: 0; }
html.fx-on .auth-copy > h1, html.fx-on .hero > h1 { animation: none; opacity: 1; }
.fx-w { display: inline-block; }
.fx-aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fx-aurora i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; }
.fx-aurora i:nth-child(1) { top: -30vmax; inset-inline-start: -20vmax; background: radial-gradient(circle, rgba(95, 208, 182, .22), rgba(95, 208, 182, 0) 65%); }
.fx-aurora i:nth-child(2) { bottom: -35vmax; inset-inline-end: -25vmax; background: radial-gradient(circle, rgba(240, 179, 74, .12), rgba(240, 179, 74, 0) 65%); }
[data-theme="dark"] .fx-aurora i:nth-child(1) { background: radial-gradient(circle, rgba(67, 194, 167, .20), rgba(67, 194, 167, 0) 65%); }
.fx-progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 100001; background: var(--accent-bright); transform-origin: 100% 50%; pointer-events: none; }
html[dir="ltr"] .fx-progress { transform-origin: 0 50%; }
@media (prefers-reduced-motion: no-preference) {
    html.fx-on .btn-primary:not(:disabled) { position: relative; overflow: hidden; isolation: isolate; }
    html.fx-on .btn-primary:not(:disabled)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, .26) 50%, transparent 62%); transform: translateX(-130%); animation: fxShine 4.8s ease-in-out 1.6s infinite; pointer-events: none; }
    @keyframes fxShine { 0%, 62% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
}
/* fx v2: clearly visible aurora (stronger wash, wider drift is in fx.js) */
.fx-aurora i:nth-child(1) { background: radial-gradient(circle, rgba(95, 208, 182, .40), rgba(95, 208, 182, 0) 62%); }
.fx-aurora i:nth-child(2) { background: radial-gradient(circle, rgba(240, 179, 74, .30), rgba(240, 179, 74, 0) 62%); }
[data-theme="dark"] .fx-aurora i:nth-child(1) { background: radial-gradient(circle, rgba(67, 194, 167, .36), rgba(67, 194, 167, 0) 62%); }
[data-theme="dark"] .fx-aurora i:nth-child(2) { background: radial-gradient(circle, rgba(240, 179, 74, .22), rgba(240, 179, 74, 0) 62%); }


/* Plan card (paywall) */
.plan-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 18px 16px; display: grid; gap: 10px; }
.plan-toggle { display: flex; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin: 0 auto; }
.plan-toggle button { border: 0; background: transparent; border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.plan-toggle button.is-on { background: var(--ink); color: #fff; }
.plan-save { font-size: 12px; font-weight: 700; color: var(--accent); }
.plan-toggle button.is-on .plan-save { color: var(--accent-bright); }
.plan-price-row { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-top: 4px; }
.plan-price { font-size: 44px; font-weight: 800; line-height: 1; }
.plan-price-unit { font-size: 14px; font-weight: 600; color: var(--muted); }
.plan-billed { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.plan-check-head { margin: 6px 0 0; font-size: 14px; font-weight: 700; }
.plan-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.plan-check li { position: relative; padding-inline-start: 26px; }
.plan-check li::before { content: '✓'; position: absolute; inset-inline-start: 2px; color: var(--accent); font-weight: 800; }
[data-theme="dark"] .plan-toggle button.is-on { background: var(--accent); color: #0b1a17; }
[data-theme="dark"] .plan-toggle button.is-on .plan-save { color: #0b1a17; }




/* Duplicate reference warning on pending payment requests */
.dup-row td { padding: 0 0 6px; border: 0; }
.dup-banner { display: block; width: 100%; box-sizing: border-box; background: #d92d20; color: #fff; font-weight: 700; font-size: 13.5px; line-height: 1.7; padding: 10px 14px; border-radius: 10px; text-align: start; }


/* Support thread + inbox */
.support-card textarea, .sup-form textarea { width: 100%; min-height: 76px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; background: var(--bg); color: var(--ink); box-sizing: border-box; }
.sup-form { display: flex; flex-direction: column; gap: 10px; }
.sup-msgs { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 14px; max-height: 340px; overflow-y: auto; }
.sup-msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.sup-msg.user { align-self: flex-start; background: var(--accent); color: #fff; border-start-start-radius: 4px; }
.sup-msg.user .sup-t { color: rgba(255,255,255,.8); }
.sup-msg.admin { align-self: flex-end; background: var(--card); border: 1px solid var(--line); border-start-end-radius: 4px; }
.sup-t { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }
.sup-empty { color: var(--muted); font-size: 13.5px; }
.sup-thread-item { display: block; width: 100%; text-align: start; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; font: inherit; color: var(--ink); }
.sup-thread-item:last-child { border-bottom: 0; }
.sup-thread-item .sup-email { font-weight: 600; font-size: 14px; }
.sup-thread-item .sup-preview { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-unread { display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #d92d20; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; margin-inline-start: 8px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; }
.icon-btn .nav-badge { position: absolute; top: -6px; inset-inline-end: -6px; margin-inline-start: 0; }
.sup-back { background: none; border: 0; color: var(--accent); font: inherit; font-size: 13.5px; cursor: pointer; padding: 0 0 8px; }
.sup-push { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.sup-push-note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }


/* Owner notifications enable card on the admin panel */
.push-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 18px; }
.push-card h2 { font-size: 16px; margin: 0 0 4px; }
.push-card .push-copy p { margin: 0; font-size: 13.5px; opacity: .75; }
.push-card .btn { flex-shrink: 0; }


/* Header menu (three-lines) */
.topbar-actions { position: relative; }
.nav-menu { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 80; display: none; flex-direction: column; align-items: stretch; gap: 8px; min-width: 230px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(23, 19, 15, .35); }
.nav-menu.is-open { display: flex; }
.nav-menu .topnav { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
.nav-menu .topnav a { padding: 8px 10px; border-radius: 9px; }
.nav-menu > a, .nav-menu > button { width: 100%; justify-content: flex-start; }
.nav-menu .user-chip { width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
.nav-menu .user-chip .user-out { width: 100%; }
.nav-menu [data-lang-toggle] { width: 100%; }

/* Platform tabs: scrollable row with a fade hint on narrow screens */
@media (max-width: 560px) {
  .platforms { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 6px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(to left, transparent 0, #000 30px); mask-image: linear-gradient(to left, transparent 0, #000 30px); }
  .platforms::-webkit-scrollbar { display: none; }
  .platforms .platform { flex: 0 0 auto; scroll-snap-align: start; }
}


/* Menu rows: icon + label, equal width, tidy RTL/LTR */
.nav-menu { gap: 6px; min-width: 250px; }
.nav-menu .nav-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-size: .95rem; text-align: start; text-decoration: none; cursor: pointer; }
.nav-menu .nav-row:hover { border-color: var(--accent); }
.nav-menu .nav-ic { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-menu .nav-row-label { flex: 1 1 auto; }
.nav-menu .lang-current { color: var(--muted); font-size: .85rem; }
.nav-menu .nav-caret { width: 14px; height: 14px; color: var(--muted); }
.nav-menu .lang-list { display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 1px dashed var(--line); border-radius: 10px; }
.nav-menu .lang-list button { padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.nav-menu .lang-list button.is-active { background: var(--accent); color: #fff; }
.nav-menu .topnav { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.nav-menu .user-chip { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; }
.nav-menu .user-chip .user-email { text-align: center; color: var(--muted); font-size: .85rem; }
.nav-menu .user-chip .user-out { width: 100%; }
.nav-menu .nav-badge { position: static; margin-inline-start: auto; }

/* Menu topnav links stay visible inside the dropdown on phones */
@media (max-width: 560px) { #nav-menu .topnav a.nav-row { display: flex !important; } }

/* owner push panel inside hamburger menu */
#push-panel{padding:2px 12px 10px}
#push-panel .sup-push-note{margin:0 0 8px;font-size:12.5px;opacity:.8;line-height:1.6}
#push-panel .btn{width:100%}

/* share pill in the signed-out header: match lang-toggle, stay small */
.auth-top .share-btn { display: inline-flex; align-items: center; gap: 6px; width: auto; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.auth-top .share-btn:hover { color: var(--ink); }
.auth-top .share-btn .nav-ic { width: 15px; height: 15px; flex: 0 0 auto; }

/* sample interactive details */
.sample-table tbody tr[data-d]{cursor:pointer;outline:none}
.sample-table tbody tr[data-d]:hover,.sample-table tbody tr[data-d]:focus-visible{background:rgba(23,19,15,.04)}
.sample-table tbody tr[data-d][aria-expanded="true"]{background:rgba(95,208,182,.14)}
.sample-table tbody tr[data-d] th::after{content:"";display:inline-block;border:solid currentColor;border-width:0 1.5px 1.5px 0;padding:2.5px;margin-inline-start:6px;transform:rotate(45deg);vertical-align:middle;opacity:.5;transition:transform .2s}
.sample-table tbody tr[data-d][aria-expanded="true"] th::after{transform:rotate(225deg)}
.sample-detail{margin-top:10px;padding:12px 14px;border:1px dashed rgba(23,19,15,.25);border-radius:10px;font-size:14px;line-height:1.9}
/* footer contact form */
.footer-contact{max-width:560px;margin:0 auto 26px;text-align:center;padding:0 20px}
.footer-contact h2{font-size:20px;margin:0 0 6px}
.fc-note{color:var(--muted);font-size:13.5px;margin:0 0 14px}
.fc-form{display:flex;flex-direction:column;gap:8px;text-align:start}
.fc-label{font-size:12.5px;color:var(--muted)}
.fc-form input[type=email],.fc-form textarea{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px;font:inherit;color:var(--ink);width:100%;box-sizing:border-box;resize:vertical}
.fc-hp{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;opacity:0}
/* never let any element push the page wider than the screen (a wide page starts scrolled into empty space on mobile RTL) */
html{overflow-x:clip}
.fc-ts{display:flex;justify-content:center;min-height:65px;margin-top:4px}
.fc-send{margin-top:4px}
.fc-status{margin:4px 0 0;font-size:13px;min-height:18px}
.fc-status.ok{color:#2e8b6a}
.fc-status.err{color:#c0392b}
/* admin visitor messages */
.cm-item{border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-bottom:8px;text-align:start}
.cm-unread{border-color:var(--accent-bright)}
.cm-meta{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:var(--muted)}
.cm-body{margin:6px 0;white-space:pre-wrap;font-size:14px}
.cm-read{font-size:12px;border:1px solid var(--line);background:var(--surface-2);border-radius:8px;padding:4px 10px;cursor:pointer}
/* logged-out public nav stays reachable on phones */
@media (max-width: 860px) {
  .auth-top { flex-wrap: wrap; }
  .topnav.auth-nav { display: flex !important; order: 3; flex: 1 1 100%; justify-content: center; gap: 16px; margin: 8px 0 0; }
  .topnav.auth-nav a { display: inline !important; font-size: 13px; padding: 4px 2px; }
}

/* visitor support card in the footer: same look as the in-app support card */
.footer-contact{text-align:start}
.support-card input[type=email]{width:100%;border:1px solid var(--line);border-radius:12px;padding:10px 12px;font:inherit;background:var(--bg);color:var(--ink);box-sizing:border-box;text-align:start}
/* one support box per view: signed-in users already have the in-app support card */
html.is-authed .footer-contact{display:none}

/* quick preview for logged-out visitors */
.pub-quick-card { padding: 26px 20px; text-align: center; }
.pub-quick-card h2 { font-size: 21px; margin: 4px 0 6px; }
.pub-quick-card .lede { color: var(--ink-2); font-size: 14.5px; line-height: 1.8; margin: 0 0 16px; }
.pq-progress { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }
.pq-error { margin: 14px 0 0; font-size: 14px; color: #e0685a; }
.pq-result { margin-top: 18px; text-align: start; }
.pq-head { font-size: 13px; color: var(--muted); text-align: center; margin: 0 0 4px; }
.pq-note { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.pq-lock { margin-top: 18px; border: 1px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.pq-lock-title { font-weight: 700; font-size: 14px; margin: 0 0 8px; }
.pq-lock ul { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.pq-again { margin-top: 12px; width: 100%; }
