:root {
    --bg: #fff9f3;
    --surface: #ffffff;
    --surface-2: #fff5ea;
    --border: #f6e7d8;
    --border-strong: #eeddca;
    --text: #1e2b45;
    --muted: #7c7386;
    --brand: #fe7902;
    --brand-hover: #e56a00;
    --brand-ink: #a34a00;
    --brand-soft: #fff3e6;
    --accent: #062a5c;
    --accent-hover: #041f45;
    --accent-soft: #e8eef7;
    --success: #16a34a;
    --success-soft: #dcfce7;
    --error: #e11d48;
    --error-soft: #ffe4e6;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 18px;
    --shadow: 0 1px 2px rgba(120, 70, 40, 0.06);
    --shadow-md: 0 18px 40px -24px rgba(120, 70, 40, 0.35);
    --ring: 0 0 0 3px rgba(254, 121, 2, 0.28);
    --container: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--brand-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid; place-items: center; width: 32px; height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, #ffa03a, #fe7902);
    color: #fff; font-weight: 800;
    box-shadow: 0 8px 18px -10px rgba(254, 121, 2, 0.9);
}
.brand-logo { display: block; height: 34px; width: auto; }
.nav { display: flex; align-items: center; gap: 1.1rem; }
.nav > a { color: var(--text); font-weight: 500; font-size: .92rem; position: relative; }
.nav > a:hover { color: var(--brand-hover); text-decoration: none; }
.nav > a.active { color: var(--brand-hover); }
.nav > a.active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -20px;
    height: 2px; background: var(--brand); border-radius: 2px;
}
.nav-user { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .9rem; }
.avatar {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: .78rem;
    border: 1px solid var(--border);
}
.inline-form { display: inline; margin: 0; }

/* Main */
.site-main { flex: 1; padding: 2.5rem 0; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 1.25rem 0; }
.site-footer .container { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; color: var(--muted); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .6rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: 600; font-size: .95rem; font-family: inherit; cursor: pointer; text-decoration: none;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease, box-shadow .16s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-sm { padding: .38rem .8rem; font-size: .85rem; border-radius: 8px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 10px 22px -14px rgba(254, 121, 2, 0.95); }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -14px rgba(6, 42, 92, 0.95); }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-hover); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--brand-hover); background: var(--brand-soft); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #be123c; color: #fff; }

/* Flash */
.flash-stack { margin-top: 1rem; display: grid; gap: .5rem; }
.flash { padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .9rem; border: 1px solid transparent; }
.flash-success { background: var(--success-soft); color: var(--success); border-color: #bbf7d0; }
.flash-error { background: var(--error-soft); color: #9f1239; border-color: #fecdd3; }
.flash-info { background: var(--brand-soft); color: var(--brand-ink); border-color: #ffd9cd; }

/* Cards & forms */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.6rem;
}
.card + .card { margin-top: 1.25rem; }
.card h2 { margin-top: 0; font-size: 1.15rem; letter-spacing: -.01em; }

label { display: block; font-weight: 600; font-size: .85rem; margin: .9rem 0 .35rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="datetime-local"], input[type="file"], select, textarea {
    width: 100%; padding: .62rem .8rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-size: .95rem; font-family: inherit; background: #fff; color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #c2b6ab; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.field-error { color: var(--error); font-size: .82rem; margin-top: .25rem; }
.form-actions { margin-top: 1.3rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

/* Auth */
.auth-wrap { display: flex; justify-content: center; padding: 3rem 1.25rem; }
.auth-card { width: 100%; max-width: 420px; position: relative; overflow: hidden; box-shadow: var(--shadow-md); }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, #fe7902, #ffb020, #062a5c); }
.auth-card h1 { margin: 0 0 .35rem; font-size: 1.6rem; letter-spacing: -.02em; }
.auth-foot { margin-top: 1.4rem; text-align: center; }

code {
    background: var(--brand-soft);
    color: var(--brand-ink);
    padding: .12rem .4rem;
    border-radius: 6px;
    font-size: .88em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Error page */
.error-page { text-align: center; padding: 4rem 1.25rem; }
.error-code { font-size: 3.4rem; font-weight: 800; letter-spacing: -.03em; margin: 0; background: linear-gradient(100deg, #fe7902, #ffb020); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h1 { margin: .25rem 0 .5rem; font-size: 1.6rem; }
.error-page .btn { margin-top: 1.25rem; }

/* Page head */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 .2rem; font-size: 1.7rem; font-weight: 800; letter-spacing: -.025em; }
.page-head p { margin: 0; }

/* Badges */
.badge-role { display: inline-flex; align-items: center; padding: .18rem .6rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: .8rem; font-weight: 600; }
.badge-role.is-premium { background: var(--warning-soft); color: var(--warning); }
.status-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active { background: var(--success-soft); color: var(--success); }
.status-suspended { background: var(--error-soft); color: #9f1239; }

/* Notice / empty */
.notice-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; border-left: 3px solid var(--brand); }
.empty-state { text-align: center; padding: 3.5rem 1.5rem; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); box-shadow: none; }
.empty-state h2 { margin-top: 0; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.5rem 1.35rem 1.7rem;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: .15rem;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card::before { content: ""; position: absolute; left: 0; top: 1.35rem; bottom: 1.35rem; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(#ffa03a, #fe7902); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-value { font-size: 1.95rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.stat-label { color: var(--muted); font-size: .85rem; font-weight: 500; }

/* Tables */
.table-card { padding: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { text-align: left; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th { background: var(--surface-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .right { text-align: right; }
.small { font-size: .8rem; }

/* Forms in tables */
.inline-row-form { margin: 0; }
.inline-row-form select { width: auto; padding: .38rem .55rem; font-size: .85rem; }
.search-form { display: flex; gap: .5rem; }
.search-form input { width: 220px; }
.row-actions { position: relative; display: inline-block; }
.row-actions summary { list-style: none; cursor: pointer; display: inline-block; }
.row-actions summary::-webkit-details-marker { display: none; }
.row-actions-menu { position: absolute; right: 0; top: calc(100% + .35rem); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: .75rem; z-index: 10; min-width: 220px; display: grid; gap: .5rem; }
.stacked-form { display: grid; gap: .4rem; }
.stacked-form input { padding: .42rem .6rem; font-size: .85rem; }

/* Admin lists */
.admin-links { display: flex; gap: .75rem; flex-wrap: wrap; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.check-list li { padding: .55rem .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .88rem; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 1rem; justify-content: center; margin-top: 1.5rem; }
.pagination a { padding: .4rem .8rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: .85rem; font-weight: 600; }
.pagination a:hover { border-color: var(--brand); color: var(--brand-hover); text-decoration: none; }

/* Links */
.copy-mini { border: 0; background: var(--brand-soft); color: var(--brand-ink); font-size: .72rem; font-weight: 700; padding: .12rem .45rem; border-radius: 5px; margin-left: .4rem; cursor: pointer; transition: background .15s ease; }
.copy-mini:hover { background: #ffe0d5; }
.row-actions-inline { display: inline-flex; gap: .25rem; justify-content: flex-end; align-items: center; }
.row-actions-inline form { display: inline-flex; margin: 0; }
.row-actions-inline .btn { line-height: 1.2; }
.advanced { margin-top: .9rem; border: 1px dashed var(--border-strong); background: var(--surface-2); border-radius: var(--radius); padding: .8rem 1rem; }
.advanced summary { cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--brand-ink); }

/* Analytics */
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-top: 1rem; overflow-x: auto; }
.chart-col { flex: 1 0 10px; min-width: 10px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.chart-bar { width: 100%; min-height: 0; background: linear-gradient(180deg, #ffa03a, #fe7902); border-radius: 4px 4px 0 0; transition: height .2s ease; }
.chart-col:hover .chart-bar { background: linear-gradient(180deg, #fe7902, #e56a00); }
.chart-label { position: absolute; bottom: -1.25rem; font-size: .65rem; color: var(--muted); white-space: nowrap; transform: rotate(-45deg); transform-origin: left top; }
.chart { margin-bottom: 1.75rem; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.chart-head h2 { margin: 0; }
.chart-summary { display: inline-flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.delta { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px; }
.delta-up { background: var(--success-soft); color: var(--success); }
.delta-down { background: var(--error-soft); color: #9f1239; }
.delta-flat { background: var(--surface-2); color: var(--muted); }
.sample-badge {
    font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    color: #b45309; background: var(--warning-soft); border-radius: 999px; padding: .2rem .6rem;
}
.breakdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.breakdown { display: grid; gap: .55rem; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: .6rem; font-size: .85rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--brand-soft); border-radius: 999px; height: 8px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, #ffa03a, #fe7902); border-radius: 999px; }
.bar-value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* QR */
.qr-card { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.qr-card img { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }

@media (max-width: 720px) {
    .stat-grid, .stat-grid-3, .breakdown-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Landing page
   ============================================================ */

.landing {
    --ink: #2f2a38;
    --coral: #fe7902;
    --coral-dark: #e56a00;
    --teal: #062a5c;
    --sun: #ffb020;
    --sky: #38bdf8;
    --cream: #fff9f3;
}

body.landing { background: var(--cream); overflow-x: hidden; }
body.landing .site-main { padding: 0; }
body.landing .site-footer { background: #ffffff; }

.hero-copy, .hero-demo, .demo-card, .demo-field, .demo-field input,
.feature-card, .premium-panel, .premium-copy, .premium-list,
.trust-inner, .cta-inner, .step, .story-card { min-width: 0; }

.eyebrow {
    display: inline-block;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--coral-dark);
    margin-bottom: .75rem;
}

/* Hero (light + playful) */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #fff3e8 0%, #fff9f3 82%);
    color: var(--ink);
    padding: 4.5rem 0 5rem;
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.blob-1 { width: 380px; height: 380px; background: #ffdcb0; top: -120px; right: 2%; animation: float 14s ease-in-out infinite; }
.blob-2 { width: 300px; height: 300px; background: #dbe7f7; bottom: -140px; right: 30%; opacity: .7; animation: float 18s ease-in-out infinite reverse; }
.blob-3 { width: 280px; height: 280px; background: #ffe9a8; top: 12%; left: -90px; opacity: .6; animation: float 16s ease-in-out infinite; }
.dot-grid {
    position: absolute; inset: 0;
    background-image: radial-gradient(#ffd9b3 1.6px, transparent 1.6px);
    background-size: 26px 26px;
    mask-image: radial-gradient(ellipse 65% 60% at 50% 35%, #000 20%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 35%, #000 20%, transparent 72%);
    opacity: .7;
}

.hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 3.5rem;
    align-items: center;
}
.hero-copy h1 {
    font-size: clamp(2.3rem, 5vw, 3.7rem);
    line-height: 1.05;
    letter-spacing: -.03em;
    margin: 1rem 0 1rem;
    font-weight: 800;
}
.grad {
    background: linear-gradient(100deg, #fe7902 0%, #ff9f45 55%, #ffb020 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-copy .lead {
    font-size: 1.12rem;
    line-height: 1.65;
    color: #5c5468;
    max-width: 34rem;
    margin: 0 0 1.9rem;
}
.hero-copy .lead strong { color: var(--ink); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .4rem .85rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: .82rem;
    font-weight: 600;
    color: #6b6375;
    box-shadow: var(--shadow);
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(6,42,92,.6); animation: pulse 2.4s infinite; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; }
.hero-points {
    display: flex; flex-wrap: wrap; gap: 1.25rem;
    list-style: none; margin: 1.9rem 0 0; padding: 0;
    font-size: .9rem; color: #6b6375;
}
.hero-points li { display: inline-flex; align-items: center; gap: .4rem; }
.hero-points svg { color: var(--teal); }

/* Demo card */
.hero-demo { position: relative; }
.demo-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 30px 60px -30px rgba(120, 70, 40, .35);
    overflow: hidden;
}
.demo-bar {
    display: flex; align-items: center; gap: .4rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.demo-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.demo-bar .dot:first-child { background: #ff8a7a; }
.demo-bar .dot:nth-child(2) { background: var(--sun); }
.demo-bar .dot:nth-child(3) { background: var(--teal); }
.demo-url { margin-left: auto; font-size: .8rem; color: var(--muted); font-weight: 600; }
.demo-tag {
    font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    color: #b45309; background: var(--warning-soft); border-radius: 999px; padding: .14rem .5rem;
}
.demo-body { padding: 1.5rem; }
.demo-label { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: .5rem; }
.demo-field { display: flex; gap: .5rem; }
.demo-field input {
    flex: 1; min-width: 0;
    background: #fff;
    border: 1px solid var(--border-strong);
    color: var(--ink);
    border-radius: 10px;
    padding: .7rem .85rem;
    font-size: .88rem;
    text-overflow: ellipsis;
}
.demo-field input:focus { outline: none; border-color: var(--coral); box-shadow: var(--ring); }
.demo-result { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px dashed var(--border-strong); }
.demo-result[hidden] { display: none; }
.demo-short { display: flex; align-items: center; gap: .5rem; }
.demo-short-url { font-weight: 800; font-size: 1.05rem; color: var(--teal); }
.demo-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.demo-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .3rem .7rem;
    font-size: .78rem;
    color: #6b6375;
}
.demo-chip strong { color: var(--ink); }

.hero-demo.is-revealed .demo-result { animation: rise .45s cubic-bezier(.2,.7,.3,1) both; }

.float-card {
    position: absolute;
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .6rem .9rem;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-size: .82rem;
    font-weight: 700;
    border: 1px solid var(--border);
    box-shadow: 0 18px 40px -20px rgba(120,70,40,.5);
    animation: float 7s ease-in-out infinite;
}
.float-a { top: -18px; left: -22px; color: var(--coral-dark); }
.float-a svg { color: var(--coral); }
.float-b { bottom: -20px; right: -18px; color: var(--teal); animation-delay: 1.4s; }
.float-b svg { color: var(--teal); }

/* Trust strip */
.trust-strip { background: #fff; border-bottom: 1px solid var(--border); }
.trust-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    padding: 1.1rem 1.25rem;
    font-size: .9rem; color: var(--muted);
}
.trust-points { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.trust-points li { position: relative; padding-left: 1.1rem; font-weight: 600; color: #5c5468; }
.trust-points li::before { content: ""; position: absolute; left: 0; top: .5em; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

/* Sections */
.section { padding: 5.5rem 1.25rem; }
.section-alt { background: #fff; }
.section-head { max-width: 40rem; margin: 0 auto 3rem; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); letter-spacing: -.02em; margin: 0 0 .75rem; }
.section-sub { color: var(--muted); font-size: 1.02rem; margin: 0; }

/* Story: problem vs solution */
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: stretch; }
.story-card { border-radius: 22px; padding: 2rem; }
.story-problem { background: #fff; border: 1px solid var(--border); }
.story-solution {
    position: relative;
    background: linear-gradient(150deg, #fff3e6 0%, #fff7e6 60%, #e8eef7 100%);
    border: 1px solid #ffdcc0;
}
.story-card h3 { margin: 0 0 .35rem; font-size: 1.2rem; }
.story-card > p { margin: 0 0 1.25rem; color: var(--muted); font-size: .95rem; }
.story-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.story-list li { display: flex; gap: .75rem; align-items: flex-start; font-size: .95rem; color: #4f4859; }
.story-list .mark {
    flex-shrink: 0; display: grid; place-items: center;
    width: 24px; height: 24px; border-radius: 50%; margin-top: .1rem;
}
.story-problem .mark { background: var(--error-soft); color: #be123c; }
.story-solution .mark { background: var(--accent-soft); color: var(--teal); }
.story-list strong { color: var(--ink); }

/* Feature cards */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature-grid + .feature-grid { margin-top: 1.25rem; }
.feature-grid-2 { grid-template-columns: 1fr 1.35fr; }
.feature-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: var(--shadow);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 24px 45px -28px rgba(120,70,40,.45); border-color: #ffd9cd; }
.feature-card h3 { font-size: 1.1rem; margin: .9rem 0 .5rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.feature-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.feature-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.icon-coral { background: var(--brand-soft); color: var(--coral-dark); }
.icon-teal { background: var(--accent-soft); color: var(--teal); }
.icon-sun { background: #fff6d9; color: #b45309; }
.icon-sky { background: #e6f6ff; color: #0284c7; }
.tag-premium {
    font-size: .65rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: #b45309; background: var(--warning-soft); border-radius: 999px; padding: .15rem .5rem;
}
.feature-card-wide { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.alias-demo { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.alias-row { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; padding: .5rem .75rem; border-radius: 9px; }
.alias-row.old { background: #f4efe9; color: #a89e94; text-decoration: line-through; }
.alias-row.new { background: var(--accent-soft); color: var(--accent-hover); font-weight: 700; }
.alias-arrow { color: #d8cbbd; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.step { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 2rem 1.5rem; }
.step-num {
    display: grid; place-items: center;
    width: 42px; height: 42px; border-radius: 14px;
    background: linear-gradient(135deg, #ffa03a, #fe7902);
    color: #fff; font-weight: 800; margin-bottom: 1rem;
    box-shadow: 0 10px 22px -10px rgba(254,121,2,.8);
}
.step h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); font-size: .93rem; }

/* Who it's for */
.usecases { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.usecase {
    display: inline-flex; align-items: center; gap: .5rem;
    background: #fff; border: 1px solid var(--border); border-radius: 999px;
    padding: .6rem 1.1rem; font-weight: 600; font-size: .92rem; color: #4f4859;
    box-shadow: var(--shadow);
}
.usecase svg { color: var(--coral); }

/* Premium panel (light) */
.premium-panel {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2.5rem;
    align-items: center;
    background: linear-gradient(135deg, #fff3e6 0%, #fff7e6 55%, #e8eef7 100%);
    border: 1px solid #ffdcc0;
    border-radius: 24px;
    padding: 3rem;
}
.premium-panel::after {
    content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
    background: #ffdcb0; filter: blur(70px); opacity: .5; top: -120px; right: -60px; pointer-events: none;
}
.premium-copy { position: relative; }
.eyebrow-light { color: var(--coral-dark); }
.premium-copy h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 .75rem; letter-spacing: -.02em; }
.premium-copy p { color: #5c5468; margin: 0 0 1.6rem; max-width: 30rem; }
.premium-list {
    position: relative;
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.25rem;
}
.premium-list li { display: flex; align-items: center; gap: .55rem; font-size: .93rem; color: #4f4859; font-weight: 500; }
.premium-list li::before {
    content: ""; width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314b8a6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 6'/%3E%3C/svg%3E") center/12px no-repeat;
    border: 1px solid #cfdcef;
}

/* CTA band */
.cta-band {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fe7902 0%, #ff9f45 55%, #ffc13d 100%);
    color: #fff;
    padding: 5.5rem 0;
    text-align: center;
}
.cta-inner h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); margin: 0 0 .6rem; letter-spacing: -.02em; }
.cta-inner p { color: rgba(255,255,255,.92); margin: 0 0 1.8rem; }
.cta-inner .hero-actions { justify-content: center; }
.cta-band .btn-primary { background: #fff; color: var(--coral-dark); box-shadow: 0 12px 26px -14px rgba(120,40,20,.6); }
.cta-band .btn-primary:hover { background: #fff5ef; }
.cta-band .btn-glass { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.5); }
.cta-band .btn-glass:hover { background: rgba(255,255,255,.24); color: #fff; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s cubic-bezier(.2,.7,.3,1), transform .55s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(6,42,92,.6); }
    70% { box-shadow: 0 0 0 8px rgba(6,42,92,0); }
    100% { box-shadow: 0 0 0 0 rgba(6,42,92,0); }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* Landing responsive */
@media (max-width: 960px) {
    .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
    .hero { padding: 3.5rem 0 4rem; }
    .hero-demo { max-width: 480px; }
    .feature-grid, .feature-grid-2, .story-grid { grid-template-columns: 1fr; }
    .feature-card-wide { flex-direction: column; align-items: flex-start; }
    .premium-panel { grid-template-columns: 1fr; padding: 2.25rem; }
    .steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .section { padding: 3.75rem 1.25rem; }
    .float-card { display: none; }
    .premium-list { grid-template-columns: 1fr; }
    .trust-points { gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .blob, .float-card, .pill-dot { animation: none !important; }
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .btn-primary:hover, .feature-card:hover { transform: none; }
    .hero-demo.is-revealed .demo-result { animation: none; }
}

body.landing a:focus-visible,
body.landing button:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; border-radius: 6px; }

/* ============================================================
   QR modal
   ============================================================ */
.qr-modal {
    border: 0;
    border-radius: 22px;
    padding: 1.75rem;
    width: calc(100% - 2rem);
    max-width: 440px;
    color: var(--text);
    box-shadow: 0 40px 80px -30px rgba(120, 70, 40, 0.5);
}
.qr-modal::backdrop { background: rgba(47, 42, 56, 0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.qr-modal[open] { animation: modalIn .24s cubic-bezier(.2,.7,.3,1) both; }
.qr-modal h2 { margin: 0 0 1rem; font-size: 1.15rem; letter-spacing: -.01em; }
.qr-modal-x { position: absolute; top: .5rem; right: .5rem; margin: 0; }
.qr-modal-x button {
    border: 0; background: transparent; color: var(--muted); cursor: pointer;
    font-size: 1.5rem; line-height: 1; padding: .25rem .55rem; border-radius: 9px;
    transition: background .15s ease, color .15s ease;
}
.qr-modal-x button:hover { background: var(--brand-soft); color: var(--text); }
.qr-modal-preview { display: grid; place-items: center; margin-bottom: 1rem; }
.qr-modal-preview img {
    width: 100%; max-width: 320px; height: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}
.qr-modal-url {
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .85rem;
    color: var(--muted);
    margin: 0 0 1.3rem;
    word-break: break-all;
}
.qr-modal-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

.qr-thumb { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 12px; line-height: 0; transition: transform .18s ease; }
.qr-thumb:hover { transform: scale(1.03); }
.qr-thumb img { display: block; border-radius: 12px; }

@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .qr-modal[open] { animation: none; }
    .qr-thumb:hover { transform: none; }
}

@media (max-width: 720px) {
    .features, .grid-2 { grid-template-columns: 1fr; }
    .site-footer .container { flex-direction: column; gap: .25rem; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .search-form input { width: 100%; }
}

/* ============================================================
   Mobile responsiveness
   ============================================================ */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    background: var(--surface);
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 760px) {
    .header-inner { position: relative; min-height: 60px; }
    .brand-logo { height: 28px; }
    .brand-name { font-size: .95rem; }

    .nav-toggle { display: inline-flex; }

    .nav {
        position: absolute;
        top: calc(100% + .5rem);
        left: 1.25rem;
        right: 1.25rem;
        z-index: 30;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: .15rem;
        padding: .5rem;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: var(--shadow-md);
    }
    .nav.open { display: flex; }
    .nav > a { padding: .75rem .85rem; border-radius: 10px; }
    .nav > a.active { background: var(--brand-soft); color: var(--brand-ink); }
    .nav > a.active::after { display: none; }
    .nav-user { padding: .6rem .85rem; border-top: 1px solid var(--border); margin-top: .25rem; }
    .nav .inline-form { display: block; }
    .nav .btn { width: 100%; }

    .site-main { padding: 1.5rem 0; }
    .page-head { gap: .75rem; }
    .page-head h1 { font-size: 1.4rem; }
    .page-head > * { width: 100%; }
    .search-form { width: 100%; }

    /* Tables become cards */
    .table-card {
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        overflow: visible;
    }
    .data-table thead { display: none; }
    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td { display: block; width: 100%; }
    .data-table tr {
        padding: .5rem .95rem;
        margin-bottom: .8rem;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: var(--shadow);
    }
    .data-table td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: .3rem;
        padding: .5rem 0;
        border: 0;
        text-align: left;
    }
    .data-table td + td { border-top: 1px solid var(--border); }
    .data-table td::before {
        content: attr(data-label);
        font-size: .72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--muted);
    }
    .data-table td[data-label=""]::before { display: none; }
    .data-table td[data-label=""] { padding-top: .35rem; }
    .data-table .row-actions-inline { justify-content: flex-start; flex-wrap: wrap; }

    /* Opt-out tables stay as horizontally scrollable tables */
    .table-card.keep-scroll {
        padding: 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: var(--shadow);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-card.keep-scroll .data-table { display: table; }
    .table-card.keep-scroll .data-table thead { display: table-header-group; }
    .table-card.keep-scroll .data-table tbody { display: table-row-group; }
    .table-card.keep-scroll .data-table tr {
        display: table-row;
        margin: 0; padding: 0;
        background: transparent; border: 0; box-shadow: none;
    }
    .table-card.keep-scroll .data-table th,
    .table-card.keep-scroll .data-table td {
        display: table-cell;
        width: auto;
        padding: .7rem .9rem;
        text-align: left;
        white-space: nowrap;
        background: transparent;
    }
    .table-card.keep-scroll .data-table td::before { display: none; }

    .qr-card { flex-direction: column; align-items: flex-start; }
    .qr-thumb { align-self: center; }
    .form-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 420px) {
    .stat-grid, .stat-grid-3, .breakdown-grid { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .container { padding: 0 1rem; }
    .nav { left: 1rem; right: 1rem; }
}

.admin-nav {
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: .4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.admin-nav a {
    padding: .5rem .95rem;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--muted);
    transition: background .15s ease, color .15s ease;
}
.admin-nav a:hover { background: var(--brand-soft); color: var(--brand-ink); text-decoration: none; }
.admin-nav a.active { background: var(--brand); color: #fff; box-shadow: 0 10px 20px -14px rgba(254, 121, 2, .95); }

/* ============================================================
   Manage-user modal
   ============================================================ */
.user-modal .um-section { border-top: 1px solid var(--border); padding-top: 1.1rem; margin-top: 1.1rem; }
.user-modal .um-section h3 { margin: 0 0 .6rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.user-modal .um-inline-form { display: flex; gap: .6rem; align-items: center; }
.user-modal .um-inline-form select { flex: 1; }
.user-modal #um-status-form { margin: 0; }

