/* ==========================================================================
   ThirtyPosts design system
   One stylesheet for the whole product: marketing site, auth, app, admin.
   ========================================================================== */

:root {
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef2ff;
  --brand-softer: #f6f7ff;
  --accent: #0ea5e9;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;

  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;

  --radius: 12px;
  --radius-lg: 18px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, .07), 0 2px 4px -2px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, .08), 0 8px 10px -6px rgba(15, 23, 42, .04);
  --shadow-brand: 0 10px 30px -10px rgba(79, 70, 229, .45);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --max: 1140px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #818cf8;
    --brand-strong: #6366f1;
    --brand-soft: #1e1b4b;
    --brand-softer: #171633;
    --accent: #38bdf8;
    --success: #34d399;
    --success-soft: #052e26;
    --warn: #fbbf24;
    --warn-soft: #2b2007;
    --danger: #f87171;
    --danger-soft: #300f0f;

    --ink: #e6edf7;
    --ink-2: #c3cdda;
    --muted: #94a3b8;
    --faint: #64748b;
    --line: #24304a;
    --line-soft: #1a2338;
    --bg: #0b1020;
    --surface: #111827;
    --surface-2: #172033;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow: 0 4px 10px rgba(0, 0, 0, .45);
    --shadow-lg: 0 24px 40px -12px rgba(0, 0, 0, .6);
    --shadow-brand: 0 10px 30px -12px rgba(99, 102, 241, .55);
  }
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); letter-spacing: -.03em; }
h3 { font-size: 1.2rem; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand); color: #fff; }

/* ── Layout ────────────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 22px; }
.section { padding-block: clamp(56px, 9vw, 104px); }
.center { text-align: center; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.hide { display: none !important; }
.spacer { flex: 1; }

/* ── Typography helpers ────────────────────────────────── */
.lead { font-size: clamp(1.02rem, 2vw, 1.2rem); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.eyebrow {
  font-size: .74rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand);
}
.mono { font-family: var(--mono); font-size: .85em; }
.gradient-text {
  background: linear-gradient(100deg, var(--brand) 10%, var(--accent) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  --btn-bg: var(--brand); --btn-fg: #fff; --btn-border: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  font-weight: 600; font-size: .94rem; cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, opacity .18s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { box-shadow: var(--shadow-brand); }
.btn-primary:hover { --btn-bg: var(--brand-strong); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-border: var(--line); }
.btn-ghost:hover { --btn-bg: var(--surface-2); }
.btn-soft { --btn-bg: var(--brand-soft); --btn-fg: var(--brand); }
.btn-danger { --btn-bg: transparent; --btn-fg: var(--danger); --btn-border: var(--line); }
.btn-danger:hover { --btn-bg: var(--danger-soft); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: 10px; }
.btn-sm { padding: 7px 13px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

/* ── Header ────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.14rem; color: var(--ink); letter-spacing: -.03em; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: grid; place-items: center; color: #fff; font-weight: 800;
  font-size: .82rem; letter-spacing: -.04em;
  box-shadow: var(--shadow-brand);
}
.nav { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 7px; color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
@media (max-width: 720px) { .nav .nav-hide { display: none; } }

/* ── Hero ──────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding-block: clamp(56px, 9vw, 108px) clamp(40px, 6vw, 76px); }
.hero::before {
  content: ''; position: absolute; inset: -30% -10% auto; height: 620px; z-index: -1;
  background:
    radial-gradient(52% 46% at 22% 24%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 70%),
    radial-gradient(46% 42% at 80% 12%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  filter: blur(6px);
}
.hero h1 { max-width: 20ch; }
.hero .lead { max-width: 56ch; margin-top: 18px; }
.hero-cta { margin-top: 30px; }
.trust { margin-top: 22px; display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.trust span { display: inline-flex; gap: 7px; align-items: center; }
.tick { color: var(--success); font-weight: 800; }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm);
}
.card-flat { box-shadow: none; }
.card-soft { background: var(--surface); }
.feature { transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.feature-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 1.15rem; margin-bottom: 13px;
}
.feature h3 { margin-bottom: 6px; }

/* ── Steps ─────────────────────────────────────────────── */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 56px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 38px; height: 38px;
  border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; box-shadow: var(--shadow-brand);
}

/* ── Sample pack preview ───────────────────────────────── */
.preview {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--bg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.preview-bar {
  display: flex; align-items: center; gap: 7px; padding: 11px 15px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.preview-body { padding: 18px; display: grid; gap: 12px; max-height: 430px; overflow: auto; }
.preview-post { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.preview-post .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }

/* ── Pricing ───────────────────────────────────────────── */
.price-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); align-items: stretch; }
.price-card { display: flex; flex-direction: column; position: relative; }
.price-card.popular { border-color: var(--brand); box-shadow: var(--shadow-brand); }
.price-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; font-size: .68rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; padding: 4px 12px; border-radius: 99px;
}
.price-amount { font-size: 2.5rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.price-period { color: var(--muted); font-size: .9rem; font-weight: 500; }
.price-features { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 9px; font-size: .9rem; }
.price-features li { display: flex; gap: 9px; align-items: flex-start; color: var(--ink-2); }
.price-features li::before { content: '✓'; color: var(--success); font-weight: 800; flex: none; }
.price-card .btn { margin-top: 18px; }
.price-card .spacer { flex: 1; }

/* ── FAQ ───────────────────────────────────────────────── */
details.faq { border-bottom: 1px solid var(--line); padding: 16px 2px; }
details.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; color: var(--brand); font-size: 1.35rem; line-height: 1; font-weight: 400; }
details.faq[open] summary::after { content: '−'; }
details.faq p { margin-top: 10px; color: var(--muted); }

/* ── Footer ────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: 44px 30px; margin-top: 40px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1.6fr repeat(auto-fit, minmax(130px, 1fr)); }
.footer-grid h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 11px; }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: 7px; font-size: .9rem; }
.footer-grid a { color: var(--ink-2); }
.footer-bottom { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }

/* ── Forms ─────────────────────────────────────────────── */
.field { display: block; margin-bottom: 15px; }
.field > label, .label { display: block; font-weight: 600; font-size: .87rem; margin-bottom: 6px; color: var(--ink); }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--ink);
  transition: border-color .16s, box-shadow .16s; font-size: .95rem;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 51%, calc(100% - 12px) 51%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 99px;
  font-size: .87rem; font-weight: 500; background: var(--bg);
  transition: all .15s; user-select: none;
}
.chip:hover { border-color: var(--brand); }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; }
.switch input { position: absolute; opacity: 0; }
.switch .track {
  width: 40px; height: 23px; border-radius: 99px; background: var(--line);
  position: relative; transition: background .18s; flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: var(--shadow-sm);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(17px); }

/* ── Badges & alerts ───────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px; font-size: .73rem; font-weight: 700;
  background: var(--surface-2); color: var(--ink-2); letter-spacing: .01em;
  border: 1px solid var(--line);
}
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.alert { padding: 12px 15px; border-radius: var(--radius-sm); font-size: .9rem; border: 1px solid transparent; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-info { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }

/* ── App shell ─────────────────────────────────────────── */
.app-shell { display: grid; grid-template-columns: 244px 1fr; min-height: calc(100vh - 64px); }
.sidebar { border-right: 1px solid var(--line); background: var(--surface); padding: 20px 14px; }
.side-nav { display: grid; gap: 3px; }
.side-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: var(--radius-sm); border: none; background: none;
  color: var(--ink-2); font-weight: 500; cursor: pointer; font-size: .93rem;
  transition: background .14s, color .14s;
}
.side-nav button:hover { background: var(--surface-2); color: var(--ink); }
.side-nav button.active { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.side-nav .side-icon { width: 18px; text-align: center; flex: none; }
.side-title { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin: 18px 12px 7px; }
.app-main { padding: 26px 26px 70px; min-width: 0; }
@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); padding: 12px; }
  .side-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; gap: 6px; }
  .side-title { display: none; }
  .app-main { padding: 18px 16px 60px; }
}

.usage-meter { margin-top: 18px; padding: 13px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 8px 0 6px; }
.meter > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 99px; transition: width .5s ease; }

/* ── Page head ─────────────────────────────────────────── */
.page-head { margin-bottom: 22px; }
.page-head h2 { margin-bottom: 4px; }

/* ── Stats ─────────────────────────────────────────────── */
.stat { padding: 16px 18px; }
.stat .n { font-size: 1.85rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.stat .k { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }

/* ── Tables ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--surface); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface); }

/* ── Post cards (results view) ─────────────────────────── */
.post {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); overflow: hidden; transition: border-color .16s, box-shadow .16s;
}
.post:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); box-shadow: var(--shadow); }
.post-head {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 11px 15px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.day-chip {
  background: var(--brand); color: #fff; font-weight: 800; font-size: .72rem;
  padding: 3px 9px; border-radius: 6px; letter-spacing: .04em; flex: none;
}
.post-body { padding: 15px; }
.post-hook { font-weight: 700; margin-bottom: 8px; font-size: 1rem; }
.caption { white-space: pre-wrap; line-height: 1.62; color: var(--ink-2); }
.tags { margin-top: 11px; color: var(--brand); font-size: .84rem; word-break: break-word; line-height: 1.75; }
.post-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 11px 15px; border-top: 1px solid var(--line-soft); background: var(--surface); }
.visual-note { margin-top: 10px; padding: 9px 11px; background: var(--surface); border-radius: var(--radius-sm); font-size: .84rem; color: var(--muted); border-left: 3px solid var(--accent); }

/* ── Tabs ──────────────────────────────────────────────── */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 20px; }
.tabs button {
  padding: 10px 15px; border: none; background: none; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .14s, border-color .14s;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ── Empty state ───────────────────────────────────────── */
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .icon { font-size: 2.6rem; margin-bottom: 12px; opacity: .55; }

/* ── Loading ───────────────────────────────────────────── */
.spinner {
  width: 17px; height: 17px; border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-wrap { max-width: 460px; margin: 46px auto; text-align: center; }
.progress-bar { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 18px; }
.progress-bar > div {
  height: 100%; border-radius: 99px; width: 30%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  animation: slide 1.5s ease-in-out infinite;
}
@keyframes slide { 0% { margin-left: -32%; } 100% { margin-left: 102%; } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Modal ─────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 200; padding: 20px; animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(560px, 100%); max-height: 88vh; overflow: auto; animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; position: sticky; top: 0; background: var(--bg); }
.modal-body { padding: 22px; }
.modal-foot { padding: 15px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface); }
.x-btn { border: none; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.x-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ── Toast ─────────────────────────────────────────────── */
.toast-host { position: fixed; bottom: 22px; right: 22px; z-index: 300; display: grid; gap: 9px; max-width: min(370px, calc(100vw - 40px)); }
.toast {
  padding: 12px 16px; border-radius: var(--radius-sm); background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow-lg); font-size: .89rem; animation: toast-in .22s ease;
  display: flex; gap: 9px; align-items: flex-start;
}
.toast.ok { background: var(--success); color: #fff; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes toast-in { from { transform: translateX(16px); opacity: 0; } }

/* ── Auth pages ────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-strong) 55%, #1e1b4b 100%);
  color: #fff; padding: 46px; display: flex; flex-direction: column; justify-content: center;
}
.auth-side .logo, .auth-side .logo:hover { color: #fff; }
.auth-side .logo-mark { background: rgba(255, 255, 255, .17); box-shadow: none; backdrop-filter: blur(6px); }
.auth-side blockquote { margin-top: 34px; font-size: 1.12rem; line-height: 1.6; opacity: .95; border-left: 3px solid rgba(255,255,255,.4); padding-left: 16px; }
.auth-form-side { display: grid; place-items: center; padding: 40px 22px; }
.auth-box { width: min(400px, 100%); }
@media (max-width: 860px) { .auth-page { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ── Misc ──────────────────────────────────────────────── */
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.copy-target { position: relative; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 10px; } }

.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 4px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: .8rem; font-weight: 500; }

@media print {
  .site-header, .sidebar, .tabs, .post-foot, .btn, .toast-host { display: none !important; }
  .app-shell { display: block; }
  .post { break-inside: avoid; }
}
