/* =========================================================================
   Omnidara design system - calm, competent, trust-forward SaaS.
   Palette: warm paper bg, ink navy text, confident teal-green accent.
   Status colours are consistent everywhere: green=live, amber=pending, red=error.
   ========================================================================= */

:root {
    --paper: #f7f5f0;
    --paper-2: #efece4;
    --surface: #ffffff;
    --ink: #14211d;
    --ink-soft: #41514b;
    --muted: #768079;
    --line: #e3ded3;
    --line-strong: #d2ccbe;

    --brand: #0e7c66;        /* teal-green = reliability / live */
    --brand-dark: #0a5a4a;
    --brand-tint: #e3f3ee;

    --amber: #b8740c;
    --amber-tint: #fbeed5;
    --red: #c0392b;
    --red-tint: #fbe6e3;
    --blue: #2b6cb0;
    --blue-tint: #e4eefb;

    --radius: 14px;
    --radius-sm: 9px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(20, 33, 29, .06), 0 1px 3px rgba(20, 33, 29, .05);
    --shadow: 0 6px 24px rgba(20, 33, 29, .08);
    --shadow-lg: 0 18px 50px rgba(20, 33, 29, .14);

    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Hanken Grotesk", system-ui, sans-serif;
    --maxw: 1180px;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.55;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--brand); color: #fff; }

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

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; color: var(--ink); margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; color: var(--ink-soft); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .76rem; }
.strong { font-weight: 700; color: var(--ink); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85em; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .between { justify-content: space-between; } .center-y { align-items: center; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; } .wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: var(--font-body); font-weight: 600; font-size: .95rem;
    padding: .62rem 1.2rem; border-radius: var(--radius-pill);
    border: 1px solid transparent; cursor: pointer; background: var(--paper-2); color: var(--ink);
    transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
    text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); border-color: var(--brand); }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: .38rem .8rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.card-lg { padding: 2rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.card-head h3 { margin: 0; }

/* ---------- Badges / status ---------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .73rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: .22rem .6rem; border-radius: var(--radius-pill); border: 1px solid transparent; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-live { background: var(--brand-tint); color: var(--brand-dark); }
.badge-pending { background: var(--amber-tint); color: var(--amber); }
.badge-error { background: var(--red-tint); color: var(--red); }
.badge-muted { background: var(--paper-2); color: var(--muted); }
.badge-info { background: var(--blue-tint); color: var(--blue); }
.badge-plain { text-transform: none; font-weight: 600; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius-sm); padding: .85rem 1.1rem; margin-bottom: 1.2rem; font-size: .92rem; border: 1px solid; }
.alert-success { background: var(--brand-tint); border-color: #b9e0d4; color: var(--brand-dark); }
.alert-error { background: var(--red-tint); border-color: #f0c4be; color: var(--red); }
.alert-info { background: var(--blue-tint); border-color: #c5d9f2; color: var(--blue); }
.alert-warn { background: var(--amber-tint); border-color: #ecd3a7; color: var(--amber); }
/* Inline validation: the offending input itself is marked, not just a distant banner. */
.field-invalid label { color: var(--red); }
.field-invalid input, .field-invalid textarea, .field-invalid select { border-color: var(--red); }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.1rem; }
.field label, .form-label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], textarea, select {
    width: 100%; font-family: var(--font-body); font-size: .95rem; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    padding: .62rem .8rem; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
textarea { resize: vertical; min-height: 120px; }
.field-error { color: var(--red); font-size: .82rem; margin-top: .3rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.help { font-size: .82rem; color: var(--muted); margin-top: .3rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--paper); }

/* ---------- Public nav ---------- */
.site-nav { position: sticky; top: 0; z-index: 40; background: rgba(247,245,240,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-nav .inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; color: var(--ink); display: inline-flex; align-items: center; gap: .5rem; }
.brand:hover { text-decoration: none; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { color: var(--ink-soft); font-weight: 600; font-size: .94rem; }
.nav-links a:hover { color: var(--brand-dark); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { padding: 5rem 0 3rem; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-dark); background: var(--brand-tint); padding: .35rem .85rem; border-radius: var(--radius-pill); }
.hero h1 { margin: 1.2rem 0; max-width: 16ch; }
.hero p.lead { font-size: 1.2rem; max-width: 52ch; color: var(--ink-soft); }
.hero-cta { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

.section { padding: 4rem 0; }
.section-tight { padding: 2.5rem 0; }
.eyebrow-line { font-weight: 700; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-dark); margin-bottom: .6rem; }

/* feature + marketplace grids */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.feature-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.feature-card .ic { width: 42px; height: 42px; border-radius: 11px; background: var(--brand-tint); color: var(--brand-dark); display: grid; place-items: center; font-size: 1.2rem; margin-bottom: 1rem; }
.mp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1rem; }
.mp-chip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem .6rem; text-align: center; font-weight: 600; font-size: .85rem; }
.mp-chip small { display: block; color: var(--muted); font-weight: 500; }

/* pricing */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; align-items: stretch; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 1.7rem; display: flex; flex-direction: column; }
.plan-card.featured { border-color: var(--brand); box-shadow: var(--shadow); position: relative; }
.plan-card.featured::after { content: "Most popular"; position: absolute; top: -12px; right: 18px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; padding: .25rem .7rem; border-radius: var(--radius-pill); }
.plan-price { font-family: var(--font-display); font-size: 2.6rem; font-weight: 600; margin: .4rem 0; }
.plan-price small { font-size: .95rem; color: var(--muted); font-family: var(--font-body); }
.plan-features { list-style: none; padding: 0; margin: 1.2rem 0; }
.plan-features li { padding: .4rem 0 .4rem 1.6rem; position: relative; color: var(--ink-soft); font-size: .92rem; }
.plan-features li::before { content: "\2713"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.toggle-wrap { display: inline-flex; gap: .25rem; background: var(--paper-2); padding: .25rem; border-radius: var(--radius-pill); }
.toggle-wrap button { border: none; background: transparent; padding: .4rem 1rem; border-radius: var(--radius-pill); font-weight: 600; cursor: pointer; color: var(--ink-soft); }
.toggle-wrap button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* faq */
.faq details { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.faq summary { font-weight: 700; cursor: pointer; color: var(--ink); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 3rem 0; margin-top: 4rem; color: var(--muted); font-size: .9rem; }
.site-footer a { color: var(--ink-soft); }

/* =========================================================================
   App shell (authenticated)
   ========================================================================= */
.app-shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #cdd6d2; padding: 1.5rem 1rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { color: #fff; font-size: 1.25rem; padding: 0 .6rem 1.4rem; }
.sidebar .brand .dot { box-shadow: 0 0 0 4px rgba(14,124,102,.3); }
.side-nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .62rem .75rem; border-radius: var(--radius-sm); color: #b6c2bc; font-weight: 600; font-size: .92rem; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side-nav a.active { background: var(--brand); color: #fff; }
.side-nav a svg { width: 18px; height: 18px; flex: none; }
.side-foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1rem; margin-top: 1rem; font-size: .85rem; }
.side-foot .who { color: #fff; font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; border-bottom: 1px solid var(--line); background: rgba(247,245,240,.8); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.topbar .page-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.content { padding: 2rem; max-width: 1280px; width: 100%; }
.menu-btn { display: none; }

/* stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.stat-card .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.stat-card .value { font-family: var(--font-display); font-size: 2rem; font-weight: 600; margin-top: .35rem; }
.stat-card .value.green { color: var(--brand-dark); }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.4rem; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }

/* health dots */
.health-row { display: flex; align-items: center; justify-content: space-between; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.health-row:last-child { border-bottom: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--brand); } .dot.amber { background: var(--amber); } .dot.red { background: var(--red); } .dot.grey { background: var(--muted); }

/* activity feed */
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; display: flex; justify-content: space-between; gap: 1rem; }
.feed li:last-child { border-bottom: none; }
.feed .when { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* placement badges row */
.placements { display: flex; flex-wrap: wrap; gap: .4rem; }

/* image grid */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .8rem; }
.img-cell { position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--paper-2); aspect-ratio: 1; }
.img-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-cell .img-actions { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: .3rem; background: linear-gradient(to top, rgba(0,0,0,.6), transparent); }
.img-cell .img-actions button { background: rgba(255,255,255,.9); border: none; border-radius: 6px; font-size: .68rem; padding: .15rem .4rem; cursor: pointer; font-weight: 600; }
.img-cell.primary { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-tint); }
.img-cell .star { position: absolute; top: .3rem; left: .3rem; background: var(--brand); color: #fff; font-size: .62rem; font-weight: 700; padding: .1rem .35rem; border-radius: 5px; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 1.4rem; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s; }
.dropzone:hover { border-color: var(--brand); color: var(--brand-dark); }

/* sticky bulk-action bar */
.bulk-bar { position: sticky; bottom: 12px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--ink); color: #fff; border-radius: var(--radius); padding: .7rem 1.1rem; margin-top: .9rem; box-shadow: var(--shadow-lg); }
.bulk-bar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.bulk-bar .btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* activity timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-entry { position: relative; padding: 0 0 1.1rem 1.6rem; }
.tl-entry::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: -2px; width: 2px; background: var(--line); }
.tl-entry:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }
.tl-sold .tl-dot { border-color: var(--blue); }
.tl-auto .tl-dot { border-color: var(--brand-dark); background: var(--brand-tint); }
.tl-failed .tl-dot { border-color: var(--red); }
.tl-failed .tl-body > .small { color: var(--red); }
.tl-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .15rem; }

/* universal listing form */
.req-hint { font-size: .72rem; font-weight: 700; color: var(--amber); text-transform: none; margin-left: .3rem; }
.dest-row { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.dest-row:last-of-type { border-bottom: none; }
.dest-overrides { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .55rem; padding-left: 1.6rem; }
.dest-overrides label { font-weight: 600; color: var(--muted); margin-bottom: .2rem; }
.dest-errors { list-style: none; padding: .45rem 0 0 1.6rem; margin: 0; }
.dest-errors li { color: var(--red); font-size: .8rem; padding: .1rem 0; }
.dest-errors li::before { content: "\26A0\FE0E  "; }
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .45rem; }
/* server-side category typeahead (replaces the embedded datalists) */
.typeahead-results { position: relative; z-index: 30; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); margin-top: .2rem; max-height: 16rem; overflow-y: auto; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.typeahead-results[hidden] { display: none; }
.typeahead-option { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--ink-soft); font-size: .82rem; padding: .45rem .7rem; cursor: pointer; }
.typeahead-option:hover, .typeahead-option:focus { background: var(--brand-tint); color: var(--brand-dark); }
/* dynamic per-category aspect fields (rendered by app.js under each category picker) */
.aspect-fields { margin-top: .5rem; padding-left: .7rem; border-left: 2px solid var(--line); }
.aspect-fields:empty { display: none; }
.aspect-fields .field { margin-bottom: .55rem; }
.chip { border: 1px solid var(--line-strong); background: var(--paper-2); color: var(--ink-soft); font-size: .76rem; font-weight: 600; padding: .18rem .6rem; border-radius: var(--radius-pill); cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-tint); }
.dims-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }

/* marketplace connect cards */
.connect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.connect-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.connect-card.connected { border-color: #b9e0d4; }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.toolbar .grow { min-width: 200px; }

/* pagination */
.pager { display: flex; gap: .5rem; justify-content: center; margin-top: 1.4rem; align-items: center; }

/* progress */
.progress { height: 8px; background: var(--paper-2); border-radius: var(--radius-pill); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: var(--radius-pill); }
.progress.warn > span { background: var(--amber); }
/* Over the plan limit - normal after a downgrade, since nothing is removed for a billing
   reason. The bar is already clamped to 100%, so without a distinct treatment "5 of 2" looks
   identical to "2 of 2"; the stripes say "full AND past the limit" rather than just "full". */
.progress.over > span {
    width: 100% !important;
    background: repeating-linear-gradient(45deg,
        var(--amber), var(--amber) 6px, var(--paper-2) 6px, var(--paper-2) 12px);
}

/* auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-aside { background: var(--ink); color: #d7ded9; padding: 3.5rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside h2 { color: #fff; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 410px; }

/* ---------- Onboarding checklist ---------- */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; align-items: flex-start; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.check-list li:last-child { border-bottom: none; }
.check-list .check-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: transparent; margin-top: .1rem; }
.check-list li.done .check-mark { background: var(--brand); border-color: var(--brand); color: #fff; }
.check-list li.done .strong { color: var(--muted); text-decoration: line-through; }
.check-list li.current .check-mark { border-color: var(--brand); }
.check-list li p { margin: .2rem 0 0; }

/* ---------- Legal documents ---------- */
.legal-doc h2 { font-size: 1.25rem; margin-top: 2.2rem; }
.legal-doc h3 { font-size: 1rem; margin-top: 1.4rem; }
.legal-doc p, .legal-doc li { color: var(--ink-soft); }
.legal-doc ul { padding-left: 1.2rem; }
.legal-doc li { margin: .35rem 0; }

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; width: 256px; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .menu-btn { display: inline-flex; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-grid, .plan-grid { grid-template-columns: 1fr; }
    .mp-grid { grid-template-columns: repeat(3, 1fr); }
    .grid-2, .grid-2-even, .form-grid { grid-template-columns: 1fr; }
    .dest-overrides { grid-template-columns: 1fr; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .nav-links .hide-sm { display: none; }
}
@media (max-width: 560px) {
    .stat-grid { grid-template-columns: 1fr; }
    .mp-grid { grid-template-columns: repeat(2, 1fr); }
    .content { padding: 1.2rem; }
}

/* In-app confirmation dialog (replaces window.confirm for destructive actions). */
.confirm-dialog {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    padding: 1.3rem 1.4rem 1.1rem;
    max-width: 26rem;
    box-shadow: var(--shadow-lg, 0 18px 40px rgba(20, 33, 29, .18));
}
.confirm-dialog::backdrop { background: rgba(20, 33, 29, .45); }
.confirm-dialog-message { margin: 0 0 1.1rem; line-height: 1.5; }
.confirm-dialog-actions { display: flex; gap: .6rem; justify-content: flex-end; }
