/* HappyDTech Poster (cloud) — design tokens shared with the local poster.
   60-30-10: canvas 60% / card surfaces 30% / brand blue + orange accent 10%. */
:root {
  --canvas: #F3F7FB;
  --canvas-glow: radial-gradient(1200px 500px at 85% -10%, rgba(8, 120, 232, .10), transparent 60%),
                 radial-gradient(900px 420px at -10% 0%, rgba(243, 154, 56, .10), transparent 55%);
  --surface: #FFFFFF;
  --surface-2: #F1F6FB;
  --surface-3: #E5F1FC;
  --ink: #132B4A;
  --ink-2: #44627F;
  --ink-3: #5E7389;
  --line: #D6E4F1;
  --line-strong: #C9DDF0;
  --brand: #0868CC;
  --brand-2: #2E8BF0;
  --brand-grad: linear-gradient(135deg, #0868CC 0%, #1A73D9 100%); /* end kept ≥4.5:1 with white text */
  --brand-glow: 0 6px 18px rgba(8, 104, 204, .28);
  --accent: #F39A38;
  --accent-ink: #8A4B08;
  --accent-bg: #FDF0E1;
  --ok: #197653;   --ok-bg: #E6F5EF;   --ok-line: #A9DCC4;
  --wait: #0868CC; --wait-bg: #E4F1FD; --wait-line: #A9CFF5;
  --bad: #A23B2A;  --bad-bg: #FDE2DD;  --bad-line: #F2B3A8;
  --plat-linkedin: #0A66C2;
  --plat-tiktok: #111111;
  --plat-instagram: #D62976;
  --plat-facebook: #1877F2;
  --plat-fastwork: #F39A38;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(19, 43, 74, .04), 0 10px 30px rgba(19, 43, 74, .07);
  --shadow-lift: 0 2px 6px rgba(19, 43, 74, .06), 0 18px 40px rgba(19, 43, 74, .12);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Thonburi", "Tahoma", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --fs-body: clamp(14px, 0.35vw + 13px, 16px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0D0F15;
    --canvas-glow: radial-gradient(1100px 480px at 85% -10%, rgba(46, 139, 240, .16), transparent 60%),
                   radial-gradient(800px 380px at -10% 0%, rgba(243, 154, 56, .08), transparent 55%);
    --surface: #161922;
    --surface-2: #1C2030;
    --surface-3: #1E2A40;
    --ink: #F3F4F6;
    --ink-2: #B4C0D3;
    --ink-3: #96A2B6;
    --line: #262C3E;
    --line-strong: #2F3850;
    --brand: #4C9DFF;
    --brand-2: #79B6FF;
    --brand-grad: linear-gradient(135deg, #1A62C4 0%, #2270CF 100%);
    --brand-glow: 0 0 0 1px rgba(90, 165, 255, .35), 0 8px 24px rgba(76, 157, 255, .30);
    --accent: #F6AE5C;
    --accent-ink: #F6C68D;
    --accent-bg: #33240F;
    --ok: #7FD8AE;   --ok-bg: #12301F;   --ok-line: #2C6B4C;
    --wait: #8CC4FF; --wait-bg: #14263F; --wait-line: #2E5A8E;
    --bad: #FFADA0;  --bad-bg: #3A1C18;  --bad-line: #7A3A30;
    --plat-tiktok: #E8E8E8;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-lift: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: var(--fs-body); line-height: 1.5; color: var(--ink);
  background: var(--canvas-glow), var(--canvas); background-attachment: fixed;
}
h1, h2, h3, p { margin: 0; }
h2 { font-size: 18px; letter-spacing: -.01em; }
h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
a { color: var(--brand); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hint { color: var(--ink-3); font-size: 13px; }
.hint.small { font-size: 12px; }
.hint.warn { color: var(--accent-ink); background: var(--accent-bg); padding: 8px 10px; border-radius: var(--radius-sm); margin-top: 8px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 8px 14px; background: var(--brand); color: #fff; border-radius: var(--radius-sm); }
.skip:focus { left: 16px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.stack { display: grid; gap: 14px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px clamp(16px, 3vw, 36px);
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand-card { display: flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.brand-mark { width: 40px; height: 40px; flex: none; border-radius: 11px; box-shadow: var(--brand-glow); }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.brand-name span { color: var(--brand); }
.brand-sub { color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32ch; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.tabs [role="tab"] {
  font: inherit; font-size: 14px; font-weight: 700; color: var(--ink-2); background: transparent; border: 0; border-radius: 10px;
  padding: 8px 14px; cursor: pointer; display: inline-flex; white-space: nowrap; align-items: center; gap: 6px; transition: background .25s var(--ease), color .25s var(--ease);
}
.tabs [role="tab"]:hover { color: var(--brand); }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  font: inherit; font-weight: 700; font-size: 14px; line-height: 1; padding: 11px 18px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background .3s var(--ease), box-shadow .3s var(--ease), transform .15s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: var(--brand-glow); padding: 14px 22px; font-size: 15px; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.primary:disabled { background: var(--surface-3); color: var(--ink-3); box-shadow: none; cursor: not-allowed; }
.btn.primary[aria-busy="true"] { cursor: progress; }
.btn.text { border-color: transparent; background: transparent; color: var(--ink-2); padding: 8px; font-weight: 600; }
.btn.text:hover { color: var(--brand); }
.btn.text.inline { padding: 4px 6px; font-size: 13px; color: var(--brand); }
.btn.text.inline svg { width: 15px; height: 15px; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.danger { background: var(--bad); border-color: transparent; color: #fff; }
.btn.danger:hover { filter: brightness(1.05); }
.danger-text.btn.text.inline { color: var(--bad); }
@media (prefers-color-scheme: dark) { .btn.danger { color: #2A0F0B; } }

/* ---------- layout ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: 22px clamp(16px, 3vw, 36px) 120px; }
.panel-view { display: grid; gap: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.section-head .hint { max-width: 70ch; margin-top: 2px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px;
  display: grid; gap: 12px; align-content: start;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.step {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-3); color: var(--brand); font-size: 13px; font-weight: 800;
}

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  position: relative; overflow: hidden; padding: 14px 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--line-strong); }
.stat.accent-blue::before { background: var(--brand-grad); }
.stat.accent-green::before { background: var(--ok); }
.stat.accent-red::before { background: var(--bad); }
.stat.accent-orange::before { background: var(--accent); }
.stat-label { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.badge {
  min-width: 22px; height: 20px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 99px;
  font-size: 12px; font-weight: 800; background: var(--accent); color: #2B1700; font-variant-numeric: tabular-nums;
}

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
input[type="email"], input[type="password"], input[type="datetime-local"], textarea, select {
  font: inherit; font-weight: 400; font-size: 15px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 10px 12px; width: 100%; transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
textarea { resize: vertical; line-height: 1.5; }
.form-error { color: var(--bad); font-size: 13px; min-height: 1em; }
.form-error:empty { display: none; }
details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
summary { cursor: pointer; font-weight: 700; color: var(--ink-2); font-size: 13px; }
details[open] summary { margin-bottom: 10px; }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 8px; }
.counter { font-variant-numeric: tabular-nums; }
.counter.over { color: var(--bad); font-weight: 700; }

.seg-field { border: 0; padding: 0; margin: 0; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span, .seg [role="tab"] {
  display: inline-block; padding: 8px 16px; border-radius: 9px; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink-2);
  background: transparent; border: 0; cursor: pointer;
}
.seg input:checked + span, .seg [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.schedule-row { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 12px; }
.time-hint { display: grid; gap: 6px; }
.hint-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.hint-list .in-window { color: var(--ok); }

/* ---------- media ---------- */
.dropzone {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 26px 16px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); transition: border-color .3s var(--ease), background .3s var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--surface-3); }
.dropzone:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-grad); box-shadow: var(--brand-glow);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M4 20h16'/%3E%3C/svg%3E") center / 24px no-repeat, linear-gradient(#000 0 0); mask-composite: exclude; }
.dz-text { font-size: 14px; color: var(--ink-2); }
.media-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.media-list:empty { display: none; }
.media-item {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line);
}
.media-item.has-error { border-color: var(--bad-line); background: var(--bad-bg); }
.thumb { width: 64px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line); }
.thumb-empty { display: block; }
.media-meta { display: grid; gap: 4px; min-width: 0; }
.media-meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
progress { width: 100%; height: 8px; accent-color: var(--brand); }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-3);
  cursor: pointer; transition: all .3s var(--ease);
}
.icon-btn:hover { background: var(--bad-bg); color: var(--bad); }

/* ---------- target pills ---------- */
.target-groups { display: grid; gap: 14px; }
.target-group { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.target-group:first-child { border-top: 0; padding-top: 0; }
.tg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.p-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; background: var(--plat, var(--ink-3)); }
.plat-linkedin { --plat: var(--plat-linkedin); }
.plat-tiktok { --plat: var(--plat-tiktok); }
.plat-instagram { --plat: var(--plat-instagram); }
.plat-facebook { --plat: var(--plat-facebook); }
.plat-fastwork { --plat: var(--plat-fastwork); }
.p-dot.plat-linkedin, .p-dot.plat-tiktok, .p-dot.plat-instagram, .p-dot.plat-facebook, .p-dot.plat-fastwork { background: var(--plat); }
.pills { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.pill {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font: inherit; text-align: left;
  cursor: pointer; transition: all .3s var(--ease);
}
.pill .p-dot { background: var(--plat); box-shadow: 0 0 0 3px color-mix(in srgb, var(--plat) 22%, transparent); }
.pill .p-text { display: grid; line-height: 1.25; min-width: 0; }
.pill .p-name { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill .p-state { font-size: 12px; color: var(--ink-3); }
.pill .p-icon { margin-left: auto; display: grid; opacity: 0; transform: scale(.6); transition: all .3s var(--ease); }
.pill:hover { border-color: var(--brand); background: var(--surface-3); }
.pill[aria-pressed="true"] { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: var(--brand-glow); }
.pill[aria-pressed="true"] .p-state { color: rgba(255, 255, 255, .9); }
.pill[aria-pressed="true"] .p-dot { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .3); }
.pill[aria-pressed="true"] .p-icon { opacity: 1; transform: none; }

.chip {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.chip.state-live, .chip.status-posted { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.chip.state-pending_review, .chip.status-manual { background: var(--accent-bg); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.chip.state-manual { background: var(--accent-bg); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.chip.status-scheduled, .chip.status-running { background: var(--wait-bg); color: var(--wait); border-color: var(--wait-line); }
.chip.status-failed { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }

/* ---------- CTA ---------- */
.compose { display: grid; gap: 18px; }
.cta-bar {
  position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px 12px 18px; border-radius: var(--radius-lg); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); box-shadow: var(--shadow-lift);
}
.sel-line { flex: 1; color: var(--ink-2); font-weight: 600; font-size: 14px; min-width: 180px; }
.cta-bar .form-error { flex-basis: 100%; order: 3; }

/* ---------- posts ---------- */
.post-list { display: grid; gap: 14px; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 10px; }
.post-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.post-when { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; }
.post-when svg { width: 15px; height: 15px; color: var(--ink-3); }
.caption-preview { color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; white-space: pre-line; }
.target-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.target-row {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
}
.t-text { min-width: 0; font-size: 14px; }
.t-error { display: block; color: var(--bad); font-size: 12px; margin-top: 2px; }
.t-actions { display: inline-flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.empty-state { text-align: center; padding: 40px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--ink-3); display: grid; gap: 12px; justify-items: center; }
.skeleton { height: 120px; border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; border: 1px solid var(--line); }

/* ---------- accounts ---------- */
.banner { padding: 12px 16px; border-radius: var(--radius); font-weight: 600; font-size: 14px; }
.banner.is-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line); }
.banner.is-error { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-line); }
.switch-row { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.switch { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; user-select: none; position: relative; }
.switch input { position: absolute; opacity: 0; width: 38px; height: 22px; margin: 0; cursor: pointer; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .3s var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .3s var(--ease); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid var(--accent); outline-offset: 2px; }
.account-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.account-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.account-row.is-expired { border-color: var(--bad-line); }
.acc-name { display: grid; min-width: 0; font-size: 14px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- guide ---------- */
.guide { display: grid; gap: 14px; }
.source-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--ink-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
tbody th { font-weight: 800; white-space: nowrap; }
.tip { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }

/* ---------- toast & dialog ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 14px;
  padding: 12px 14px 12px 18px; border-radius: 14px; background: #132B4A; color: #fff; box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
  font-size: 14px; max-width: calc(100vw - 32px);
}
.toast-action { font: inherit; font-weight: 800; color: #9CCBFF; background: transparent; border: 0; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.toast-action:hover { background: rgba(255, 255, 255, .1); }
dialog {
  width: min(480px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: rgba(8, 16, 30, .5); backdrop-filter: blur(3px); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- auth page ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lift); padding: 28px; display: grid; gap: 18px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark { width: 48px; height: 48px; border-radius: 13px; }
.auth-brand .brand-name { font-size: 20px; }
.auth-lede { color: var(--ink-2); font-size: 14px; }
.auth-card .seg { justify-self: start; }
.auth-foot { border-top: 1px solid var(--line); padding-top: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .topbar { gap: 10px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .tabs [role="tab"] { flex: 1; justify-content: center; padding: 8px 8px; font-size: 13px; }
  .schedule-row { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .brand-sub { display: none; }
  .target-row { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .t-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .stat-value { font-size: 22px; }
  .cta-bar { bottom: 8px; }
  .cta-bar .btn.primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: shimmer 1.4s linear infinite; }
  .toast:not([hidden]) { animation: toast-in .35s var(--ease) both; }
  .post-card, .card { animation: rise .4s var(--ease) both; }
}
@keyframes shimmer { to { background-position: -200% 0; } }
/* Motion only moves things: content stays visible even if animations are paused. */
@keyframes rise { from { transform: translateY(6px); } to { transform: none; } }
@keyframes toast-in { from { transform: translate(-50%, 12px); } to { transform: translate(-50%, 0); } }
