/* Jeelda — responsive app styles. No inline styles anywhere (strict CSP). */
:root {
  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #f0f1f7; --border: #e1e3ec;
  --text: #1c1d26; --muted: #646778; --brand: #5b4bdb; --brand-2: #4637c4; --brand-soft: #ecebfd;
  --ok: #18865a; --ok-soft: #e3f5ec; --warn: #a96500; --warn-soft: #fdf1dc; --bad: #c4314b; --bad-soft: #fbe6ea;
  --info: #1f6fb2; --info-soft: #e3effa;
  --radius: 12px; --shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 4px 16px rgba(20, 20, 40, .05);
  --nav-w: 232px; --top-h: 56px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #121319; --surface: #1b1c25; --surface-2: #23242f; --border: #2f3140;
    --text: #e9e9f1; --muted: #9a9cb0; --brand: #8b7ff5; --brand-2: #a69cf8; --brand-soft: #2a2747;
    --ok: #4cc690; --ok-soft: #173327; --warn: #f0b04a; --warn-soft: #3a2c12; --bad: #f2788c; --bad-soft: #3d1c24;
    --info: #6fb2ea; --info-soft: #162c40;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121319; --surface: #1b1c25; --surface-2: #23242f; --border: #2f3140;
  --text: #e9e9f1; --muted: #9a9cb0; --brand: #8b7ff5; --brand-2: #a69cf8; --brand-soft: #2a2747;
  --ok: #4cc690; --ok-soft: #173327; --warn: #f0b04a; --warn-soft: #3a2c12; --bad: #f2788c; --bad-soft: #3d1c24;
  --info: #6fb2ea; --info-soft: #162c40;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: .25rem 0 .75rem; }
code, .mono { font-family: var(--mono); font-size: .88em; }
pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .75rem; overflow: auto; max-height: 360px; font-size: .82rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; grid-template-rows: var(--top-h) 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: .75rem; padding: 0 1rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.brand img { width: 28px; height: 28px; }
.topbar .spacer { flex: 1; }
.company-picker { min-width: 0; max-width: 280px; }
.nav { background: var(--surface); border-right: 1px solid var(--border); padding: .75rem .5rem; overflow-y: auto; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); }
.nav a { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: 8px; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav .section { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .9rem .75rem .3rem; }
.nav .section.company-section { color: var(--brand); font-size: .82rem; font-weight: 700; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; padding-top: 1rem; }
.nav .section.stage-section { color: var(--brand); font-weight: 700; padding-top: 1rem; }
.nav svg { width: 18px; height: 18px; flex: none; }
.main { padding: 1.25rem; min-width: 0; }
.menu-btn { display: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; flex: 1; min-width: 200px; }
.page-head .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-left: auto; }
.post-editor-head { align-items: flex-start; gap: 1rem; }
.post-editor-heading { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; flex: none; }
.post-editor-heading h1 { flex: none; min-width: 0; }
.post-editor-controls { display: flex; flex: 1 1 520px; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .75rem; min-width: 0; }
.post-neighbor-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .4rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.post-neighbor-nav-label { padding: 0 .25rem; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.post-edit-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; left: 0; top: var(--top-h); bottom: 0; width: min(80vw, 280px); z-index: 30; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); height: auto; }
  .nav.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main { padding: 1rem .75rem; }
  .brand span { display: none; }
  .company-picker { max-width: 50vw; }
}

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; min-width: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.card-head h2, .card-head h3 { margin: 0; flex: 1; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); }
.kpi .label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 1.5rem; font-weight: 700; }
.offline-kpi { --metric: var(--brand); --metric-soft: var(--brand-soft); display: flex; align-items: center; gap: .75rem; min-height: 88px; background: linear-gradient(135deg, var(--metric-soft), var(--surface) 82%); border-color: var(--metric-soft); border-top: 3px solid var(--metric); }
.offline-kpi--done { --metric: var(--ok); --metric-soft: var(--ok-soft); }
.offline-kpi--scans { --metric: var(--info); --metric-soft: var(--info-soft); }
.offline-kpi--spent { --metric: var(--warn); --metric-soft: var(--warn-soft); }
.offline-kpi-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--metric-soft); color: var(--metric); }
.offline-kpi-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.offline-kpi-info { min-width: 0; }
.offline-kpi .label { margin-bottom: .12rem; }
.offline-kpi .value { font-size: 1.35rem; line-height: 1.2; overflow-wrap: anywhere; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.empty h3 { color: var(--text); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: .5rem .85rem; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 38px; }
.btn-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); border-color: var(--bad-soft); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: .25rem .6rem; min-height: 30px; font-size: .85rem; }
.btn[disabled], .btn.busy { opacity: .6; pointer-events: none; }
.btn.busy::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { padding: .4rem; min-height: 36px; min-width: 36px; }
.theme-switch { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .4rem; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: .82rem; cursor: pointer; }
.theme-switch:hover { background: var(--surface-2); }
.theme-switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.theme-switch-track { display: inline-flex; align-items: center; width: 38px; height: 22px; padding: 3px; border-radius: 999px; background: var(--border); transition: background .18s ease; }
.theme-switch-thumb { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s ease; }
.theme-switch[aria-checked="true"] .theme-switch-track { background: var(--brand); }
.theme-switch[aria-checked="true"] .theme-switch-thumb { transform: translateX(16px); }

label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .25rem; }
.field { margin-bottom: .85rem; min-width: 0; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: .2rem; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=password], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: .5rem .65rem; font: inherit; min-height: 38px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: 18px; height: 18px; }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; margin-top: .5rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.toolbar .field { margin: 0; min-width: 140px; flex: 1 1 140px; }
.toolbar .field.grow { flex: 3 1 220px; }

/* ---------- tables & lists ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ai-usage-tenant td { background: var(--surface-2); }
.ai-usage-company { padding-left: 2rem; }
.usage-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.usage-charts > .card { min-width: 0; }
.usage-chart-wrap { min-width: 0; overflow-x: auto; }
.usage-line-chart { display: block; width: 100%; min-width: 480px; height: auto; }
.usage-bar-chart { display: block; width: 100%; min-width: 600px; height: auto; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis, .chart-date, .chart-category, .chart-value { fill: var(--muted); font: 11px system-ui, sans-serif; }
.chart-line { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.chart-bar { fill: var(--brand); opacity: .86; }
.chart-value { fill: var(--text); }
.chart-legend { display: flex; align-items: center; gap: .45rem; padding: 0 .75rem .5rem; color: var(--muted); font-size: .8rem; }
.legend-total { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.chart-empty { min-height: 220px; display: grid; place-items: center; }
.tenant-usage-detail { margin: 1rem 0; }
.tenant-usage-detail .usage-charts { margin-bottom: 0; }
.tenant-usage-detail h3 { margin: .5rem .75rem; font-size: 1rem; }
.ai-pricing-table input { min-width: 125px; }
.admin-tenant-link { color: inherit; text-decoration: none; }
.admin-tenant-link:hover { color: var(--brand); text-decoration: underline; }
.admin-breadcrumb { display: flex; align-items: center; gap: .5rem; margin: 0 0 .75rem; color: var(--muted); font-size: .85rem; }
.admin-breadcrumb a, .admin-inline-links a { color: var(--brand); }
.admin-tenant-panels { align-items: start; }
.admin-account-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; margin: .75rem 0 1rem; }
.admin-account-details div { min-width: 0; }
.admin-account-details dt { color: var(--muted); font-size: .78rem; }
.admin-account-details dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.admin-inline-links, .admin-related-links { display: flex; flex-wrap: wrap; gap: .55rem; }
.admin-tenant-kpis { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
@media (max-width: 520px) { .admin-account-details { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .usage-charts { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.company-open-link { color: inherit; text-decoration: none; }
.company-open-link:hover, .company-open-link:focus-visible { text-decoration: underline; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .55rem 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.social-guide { border-top: 3px solid var(--brand); }
.emotion-card { border-top: 3px solid var(--brand); }
.emotion-current { align-self: stretch; }
.emotion-current p:last-child { margin-bottom: 0; }
.emotion-custom-toggle { width: fit-content; margin: .75rem 0 .25rem; }
.emotion-help { margin: 0 0 .85rem; }
.emotion-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: .75rem 0; }
.emotion-group { min-width: 0; padding: .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.emotion-group h3 { margin-bottom: .7rem; }
.emotion-slider { display: grid; grid-template-columns: minmax(0, 1fr) 2.5rem; align-items: center; gap: .15rem .5rem; margin: .65rem 0; font-weight: 500; }
.emotion-slider output { justify-self: end; min-width: 2.25rem; padding: .05rem .35rem; border-radius: 6px; background: var(--surface); color: var(--brand); text-align: center; font-variant-numeric: tabular-nums; }
.emotion-range { grid-column: 1 / -1; width: 100%; margin: .1rem 0; accent-color: var(--brand); cursor: pointer; }
.emotion-range:disabled { cursor: not-allowed; opacity: .55; }
.emotion-range:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 1050px) { .emotion-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .emotion-groups { grid-template-columns: 1fr; } }
.social-steps { list-style: none; counter-reset: social-step; display: grid; gap: .6rem; margin: .75rem 0 1rem; padding: 0; }
.social-steps li { counter-increment: social-step; display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: start; gap: .7rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.social-steps li::before { content: counter(social-step); display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: .85rem; font-weight: 700; }
.social-steps li strong, .social-steps li span { display: block; }
.social-steps li span { margin-top: .1rem; color: var(--muted); font-size: .86rem; }
.kv { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: .35rem .75rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- chips & badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .1rem .55rem; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag { font-size: .8rem; padding: .05rem .5rem; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.pf { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .85rem; }
.pf::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.pf.instagram::before { background: #d6249f; } .pf.facebook::before { background: #1877f2; } .pf.linkedin::before { background: #0a66c2; }
.pf.tiktok::before { background: #25f4ee; box-shadow: 2px 0 0 #fe2c55; } .pf.x::before { background: #888; } .pf.pinterest::before { background: #e60023; }
.pf.youtube::before { background: #ff0000; } .pf.threads::before { background: #666; }
.trend-up { color: var(--ok); } .trend-down { color: var(--bad); } .trend-flat { color: var(--muted); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 1rem; scrollbar-width: thin; }
.tabs button { display: inline-flex; align-items: center; gap: .4rem; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: .6rem .9rem; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- posts ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.post-view-tabs { display: flex; gap: .5rem; border-bottom: 1px solid var(--border); margin: 1rem 0 .75rem; }
.post-view-tabs button { display: inline-flex; align-items: center; gap: .4rem; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: .65rem .9rem; font: inherit; cursor: pointer; }
.post-view-tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
.calendar-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto auto auto; gap: .55rem; align-items: center; margin-bottom: .65rem; }
.calendar-search input, .calendar-filter select { width: 100%; min-height: 2.5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); padding: .45rem .65rem; font: inherit; }
.calendar-search input:focus-visible, .calendar-filter select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.week-navigation { display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.week-navigation strong { min-width: 145px; text-align: center; font-size: .9rem; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 .75rem; }
.calendar-empty { display: flex; align-items: flex-start; flex-direction: column; gap: .15rem; padding: .75rem 1rem; margin: 0 0 .65rem; border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: 10px; background: var(--surface); color: var(--muted); }
.calendar-empty strong { color: var(--text); font-size: .9rem; }
.calendar-empty span { font-size: .82rem; }
.calendar-scroll { max-height: min(74vh, 860px); overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); scrollbar-width: thin; }
.calendar-grid { display: grid; grid-template-columns: 64px repeat(7, minmax(132px, 1fr)); grid-template-rows: 58px repeat(24, minmax(48px, auto)); min-width: 1088px; }
.calendar-corner, .calendar-day-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--border); }
.calendar-corner { left: 0; z-index: 4; border-right: 1px solid var(--border); }
.calendar-day-head { display: flex; align-items: center; justify-content: space-between; gap: .35rem; padding: .4rem .55rem; border-right: 1px solid var(--border); }
.calendar-day-name { display: grid; gap: .05rem; }
.calendar-day-head .calendar-day-name span { color: var(--muted); text-transform: uppercase; font-size: .68rem; font-weight: 650; letter-spacing: .035em; }
.calendar-day-head .calendar-day-name strong { font-size: 1.1rem; line-height: 1.1; }
.calendar-day-head.weekend { background: var(--surface-2); }
.calendar-day-head.today { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
.calendar-day-count { display: grid; place-items: center; min-width: 1.45rem; height: 1.45rem; padding: 0 .3rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .68rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.calendar-day-head.today .calendar-day-count { background: var(--surface); color: var(--brand); }
.calendar-time { position: sticky; left: 0; z-index: 1; padding: .2rem .35rem 0 0; text-align: right; color: var(--muted); font-size: .7rem; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.calendar-slot { min-width: 0; padding: .2rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.calendar-slot.weekend { background: color-mix(in srgb, var(--surface-2) 42%, var(--surface)); }
.calendar-slot.today { background: color-mix(in srgb, var(--brand-soft) 42%, var(--surface)); }
.calendar-entry { display: grid; gap: .08rem; min-width: 0; margin-bottom: .22rem; }
.calendar-event { display: grid; width: 100%; min-width: 0; gap: .2rem; margin: 0; padding: .38rem .45rem; text-align: left; color: var(--text); font: inherit; font-size: .72rem; line-height: 1.25; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--muted); border-radius: 8px; cursor: pointer; }
.calendar-event { transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.calendar-event:hover, .calendar-event:focus-visible { border-color: var(--brand); outline: none; box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 18%, transparent); transform: translateY(-1px); }
.calendar-event.has-image { grid-template-columns: 34px minmax(0, 1fr); align-items: start; }
.calendar-image { width: 34px; height: 40px; grid-column: 1; grid-row: 1; object-fit: cover; border-radius: 5px; }
.event-body { display: grid; min-width: 0; gap: .2rem; }
.calendar-image-credit { min-width: 0; overflow: hidden; padding: 0 .2rem; color: var(--muted); font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.calendar-image-credit a, .post-image-preview a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.calendar-image-credit a:hover, .post-image-preview a:hover { color: var(--brand); }
.calendar-event.status-approved { border-left-color: var(--brand); }
.calendar-event.status-published { border-left-color: var(--ok); }
.calendar-event.status-publishing { border-left-color: var(--info); }
.calendar-event.status-publishfailed { border-left-color: var(--bad); }
.event-top { display: flex; justify-content: space-between; align-items: center; gap: .2rem; }
.event-top .pf { min-width: 0; font-size: .68rem; }
.event-top time { white-space: nowrap; color: var(--muted); }
.calendar-event strong, .event-copy { overflow: hidden; text-overflow: ellipsis; }
.calendar-event strong { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.event-copy { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; white-space: pre-line; color: var(--muted); }
.event-state { color: var(--muted); font-size: .66rem; }
.post-list { display: grid; gap: .75rem; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow); cursor: pointer; display: grid; gap: .4rem; }
.post-card:hover { border-color: var(--brand); }
.post-card .meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .85rem; color: var(--muted); }
.post-card .text { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.post-image-preview { display: flex; align-items: center; gap: .7rem; min-width: 0; color: var(--muted); font-size: .76rem; }
.post-image-preview img { width: 86px; height: 66px; flex: 0 0 auto; object-fit: cover; border-radius: 7px; }
.post-image-preview span { min-width: 0; overflow-wrap: anywhere; }
.post-image-full { display: block; width: 100%; max-height: 400px; object-fit: cover; border: 1px solid var(--border); border-radius: 9px; }
.post-image-card > p:last-child { margin-bottom: 0; }
.post-media-choice-set { min-width: 0; margin: 0; padding: 0; border: 0; }
.post-media-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .55rem; }
.post-media-choice { position: relative; display: grid; align-content: start; gap: .3rem; min-width: 0; margin: 0; padding: .4rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease; }
.post-media-choice:hover { border-color: var(--brand); transform: translateY(-1px); }
.post-media-choice.selected { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent); }
.post-media-choice:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.post-media-choice input[type=radio] { position: absolute; top: .55rem; left: .55rem; z-index: 1; width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.post-media-choice img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.post-media-choice-label { display: -webkit-box; overflow: hidden; color: var(--text); font-size: .77rem; line-height: 1.3; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post-media-choice-meta { overflow: hidden; color: var(--muted); font-size: .68rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.post-media-none { min-height: 132px; align-content: center; justify-items: center; background: var(--surface-2); }
.post-media-none-icon { display: grid; place-items: center; width: 100%; min-height: 72px; color: var(--muted); }
.post-media-none-icon svg { width: 30px; height: 30px; }
.post-image-preview-stage { display: grid; gap: .4rem; }
.post-image-preview-stage p { margin-bottom: 0; }
.post-image-empty { display: grid; min-height: 180px; place-content: center; justify-items: center; gap: .5rem; border: 1px dashed var(--border); border-radius: 9px; background: var(--surface-2); color: var(--muted); text-align: center; }
.post-image-empty p { margin: 0; }
.day-group h3 { margin: 1rem 0 .5rem; font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.scene { border-left: 3px solid var(--brand); padding: .25rem .75rem; margin: .5rem 0; background: var(--surface-2); border-radius: 0 8px 8px 0; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--border); stroke-width: 1; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.second { stroke: var(--ok); }
.chart .area { fill: var(--brand-soft); opacity: .7; }
.chart .dot { fill: var(--brand); }
.chart .bar { fill: var(--brand); }
.chart .bar.low { fill: var(--muted); }
.chart text { fill: var(--muted); font-size: 14px; font-family: var(--font); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--brand); margin-right: .35rem; }
.legend .sw.second { background: var(--ok); }

/* ---------- dialog, toasts ---------- */
.dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; width: min(560px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(10, 10, 25, .45); }
.dialog .d-head { padding: 1rem 1rem .5rem; } .dialog .d-body { padding: 0 1rem; overflow: auto; max-height: 65vh; }
.dialog .d-foot { padding: .75rem 1rem 1rem; display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 100; max-width: min(420px, calc(100vw - 2rem)); }
.toast { background: var(--text); color: var(--bg); padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; animation: pop .15s ease-out; }
.toast.bad { background: var(--bad); color: #fff; } .toast.ok { background: var(--ok); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.secret { display: flex; gap: .5rem; align-items: center; background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 8px; padding: .6rem .75rem; }
.secret code { flex: 1; overflow-wrap: anywhere; }
.callout { border-radius: 10px; padding: .75rem 1rem; background: var(--info-soft); color: var(--text); border: 1px solid transparent; margin-bottom: 1rem; }
.callout.warn { background: var(--warn-soft); } .callout.bad { background: var(--bad-soft); }

/* ---------- authentication ---------- */
.login { position: relative; isolation: isolate; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: clamp(1rem, 4vw, 3rem); background-color: var(--bg); background-image: radial-gradient(ellipse at 14% 16%, color-mix(in srgb, var(--brand) 17%, transparent), transparent 37%), radial-gradient(ellipse at 88% 82%, rgba(91, 190, 173, .15), transparent 34%), linear-gradient(135deg, color-mix(in srgb, var(--brand-soft) 34%, var(--bg)), var(--bg) 55%, color-mix(in srgb, #d8e9ee 38%, var(--bg))); }
.login::before { position: absolute; z-index: -1; inset: 0; content: ""; background-image: radial-gradient(color-mix(in srgb, var(--brand) 19%, transparent) .8px, transparent .8px); background-size: 28px 28px; opacity: .28; mask-image: linear-gradient(135deg, #000 0%, transparent 70%); pointer-events: none; }
.login::after { position: absolute; z-index: -1; top: -24vmin; right: -12vmin; width: clamp(320px, 54vw, 720px); aspect-ratio: 1; content: ""; border: 1px solid color-mix(in srgb, var(--brand) 16%, transparent); border-radius: 50%; box-shadow: 0 0 0 30px color-mix(in srgb, var(--brand) 4%, transparent), 0 0 0 75px color-mix(in srgb, var(--brand) 3%, transparent), 0 0 0 135px color-mix(in srgb, var(--brand) 2%, transparent); pointer-events: none; }
.auth-home-link { position: absolute; z-index: 2; top: clamp(1rem, 3vw, 2rem); left: clamp(1rem, 4vw, 3rem); display: inline-flex; align-items: center; gap: .5rem; padding: .58rem .85rem; border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--surface) 76%, transparent); color: var(--text); font-size: .8rem; font-weight: 650; box-shadow: 0 4px 16px rgba(30, 30, 60, .06); backdrop-filter: blur(12px); }
.auth-home-link:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.auth-home-link span { font-size: 1rem; line-height: 1; }
.auth-layout { position: relative; z-index: 1; width: min(1020px, 100%); min-height: min(640px, calc(100vh - 3rem)); display: grid; grid-template-columns: .94fr 1.06fr; overflow: hidden; border: 1px solid var(--border); border-radius: 26px; background: var(--surface); box-shadow: 0 28px 90px rgba(28, 27, 63, .14); }
.auth-aside { position: relative; isolation: isolate; display: flex; flex-direction: column; padding: clamp(1.7rem, 3.3vw, 3rem); overflow: hidden; color: #f8f7ff; background: radial-gradient(ellipse at 5% 100%, rgba(114, 97, 236, .38), transparent 46%), radial-gradient(ellipse at 100% 4%, rgba(106, 197, 193, .16), transparent 38%), linear-gradient(145deg, #17172d 0%, #222044 54%, #29244f 100%); }
.auth-aside::before, .auth-aside::after { position: absolute; z-index: -1; content: ""; border: 1px solid rgba(255, 255, 255, .08); border-radius: 50%; pointer-events: none; }
.auth-aside::before { width: 380px; height: 380px; right: -205px; top: 16%; box-shadow: 0 0 0 32px rgba(255,255,255,.018), 0 0 0 68px rgba(255,255,255,.014); }
.auth-aside::after { width: 260px; height: 260px; left: -205px; bottom: -155px; box-shadow: 0 0 0 22px rgba(255,255,255,.025); }
.auth-brand, .auth-mobile-brand { display: inline-flex; align-items: center; gap: .65rem; color: inherit; font-size: 1.05rem; font-weight: 750; letter-spacing: -.025em; text-decoration: none; }
.auth-brand:hover, .auth-mobile-brand:hover { text-decoration: none; }
.auth-brand img, .auth-mobile-brand img { width: 38px; height: 38px; }
.auth-brand b, .auth-mobile-brand b { color: #bdb5ff; font-weight: 750; }
.auth-aside-copy { margin: auto 0 1.7rem; padding-top: 3rem; }
.auth-kicker, .auth-overline { display: flex; align-items: center; gap: .45rem; color: #bcb8e5; font-size: .68rem; font-weight: 750; letter-spacing: .13em; }
.auth-kicker i, .auth-live i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #88e1bf; box-shadow: 0 0 0 4px rgba(136,225,191,.12); }
.auth-aside-copy h2 { max-width: 390px; margin: .8rem 0 .65rem; color: #fff; font-size: clamp(2rem, 3.2vw, 2.75rem); font-weight: 650; letter-spacing: -.055em; line-height: 1.06; }
.auth-aside-copy p { max-width: 370px; margin: 0; color: #c4c2dc; font-size: .97rem; line-height: 1.7; }
.auth-flow { position: relative; padding: 1rem 1.05rem .35rem; border: 1px solid rgba(255,255,255,.13); border-radius: 17px; background: rgba(255,255,255,.065); box-shadow: 0 16px 45px rgba(9, 8, 29, .16); backdrop-filter: blur(10px); }
.auth-flow-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: .72rem; border-bottom: 1px solid rgba(255,255,255,.1); color: #aaa8cb; font-size: .62rem; font-weight: 750; letter-spacing: .12em; }
.auth-live { display: inline-flex; align-items: center; gap: .4rem; color: #c3f0db; font-size: .58rem; }
.auth-live i { width: 6px; height: 6px; box-shadow: none; }
.auth-flow-step { position: relative; display: flex; align-items: center; gap: .75rem; min-height: 58px; }
.auth-flow-step + .auth-flow-step::before { position: absolute; content: ""; left: 17px; top: -5px; height: 11px; border-left: 1px dashed rgba(255,255,255,.24); }
.auth-flow-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px; background: #fbdfb9; color: #724716; font-size: 1.05rem; }
.auth-flow-icon-lilac { background: #dcd5ff; color: #5143a4; }
.auth-flow-icon-mint { background: #c6f0df; color: #26775c; }
.auth-flow-step > span:nth-child(2) { display: grid; flex: 1; gap: .05rem; }
.auth-flow-step b { color: #f7f6ff; font-size: .82rem; font-weight: 650; }
.auth-flow-step small { color: #aaa8c4; font-size: .7rem; }
.auth-flow-check, .auth-flow-arrow { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(136,225,191,.12); color: #88e1bf; font-size: .73rem; }
.auth-flow-arrow { background: transparent; color: #bdb5ff; font-size: 1rem; }
.auth-flow-foot { display: flex; align-items: center; gap: .5rem; padding: .7rem 0 .55rem; border-top: 1px solid rgba(255,255,255,.1); color: #c3c0dc; font-size: .68rem; }
.auth-avatar { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid #343154; border-radius: 50%; background: #f0b991; color: #463328; font-size: .58rem; font-weight: 800; }
.auth-spark { margin-left: auto; color: #e8c67e; font-size: .9rem; }
.auth-aside-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; margin-top: auto; padding-top: 1.35rem; color: #9491b6; font-size: .57rem; font-weight: 700; letter-spacing: .08em; }
.auth-aside-foot span:last-child { color: #c4c2dc; font-size: .65rem; font-weight: 500; letter-spacing: 0; }
.login .auth-card { position: relative; align-self: stretch; width: auto; display: flex; flex-direction: column; justify-content: center; margin: 0; padding: clamp(1.5rem, 4vw, 3.3rem); border: 0; border-radius: 0; background: var(--surface); box-shadow: none; }
.auth-card-top { position: absolute; align-self: flex-end; top: clamp(1.15rem, 2.6vw, 2rem); right: clamp(1.2rem, 2.8vw, 2.5rem); }
.auth-mobile-brand { display: none; }
.auth-heading { margin: 1rem 0 1.15rem; }
.auth-heading-mark { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: .65rem; border: 1px solid var(--brand-soft); border-radius: 10px; background: linear-gradient(145deg, var(--brand-soft), var(--surface)); color: var(--brand); font-size: .9rem; }
.auth-overline { margin: 0 0 .35rem; color: var(--brand); font-size: .63rem; }
.auth-heading h1 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -.045em; }
.auth-heading > p:last-child { margin: .45rem 0 0; color: var(--muted); font-size: .91rem; }
.login .theme-switch { border: 1px solid var(--border); background: var(--surface); }
.login .theme-switch-track { width: 34px; height: 20px; }
.login .theme-switch-thumb { width: 14px; height: 14px; }
.login .theme-switch[aria-checked="true"] .theme-switch-thumb { transform: translateX(14px); }
.login .field { margin-bottom: .8rem; }
.login .field > input { display: block; width: 100%; min-height: 45px; padding: .6rem .8rem; border-radius: 10px; }
.login label { margin-bottom: .38rem; font-size: .82rem; }
.login input::placeholder { color: var(--muted); opacity: .7; }
.auth-card .seg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; margin: 0 0 1rem; background: var(--bg); }
.auth-card .seg button { min-height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: .81rem; font-weight: 650; cursor: pointer; transition: color .15s ease, background .15s ease, box-shadow .15s ease; }
.auth-card .seg button.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 5px rgba(23, 22, 50, .1); }
.auth-card form > .btn.primary { width: 100%; min-height: 48px; margin-top: .25rem; border-radius: 10px; font-weight: 700; box-shadow: 0 5px 14px rgba(80, 65, 191, .2); }
.auth-card form > .btn.ghost { width: 100%; min-height: 40px; margin-top: .4rem; color: var(--muted); }
.auth-card form > .btn.ghost:hover { color: var(--brand); background: var(--brand-soft); }
.auth-card form > .hint { margin: .95rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.auth-card #login-form > p + p { margin-top: .48rem; }
.auth-card .link-btn { color: var(--brand); font-size: inherit; font-weight: 650; text-decoration: none; }
.auth-card .link-btn:hover { text-decoration: underline; }
.auth-card .auth-forgot-trigger { display: flex; width: fit-content; margin: .35rem 0 0 auto; font-size: .77rem; }
.auth-card .callout { font-size: .84rem; }
.auth-card .callout.bad { border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.auth-card form .muted.small { margin: -.2rem 0 .8rem; color: var(--muted); font-size: .83rem; line-height: 1.55; }
.auth-card .field .hint { margin-top: .3rem; font-size: .75rem; }
.auth-card form #forgot-result { margin-top: .25rem; font-size: .82rem; }
.auth-card form .callout + .btn.primary { margin-top: 0; }
.auth-card form #login-btn + .hint { margin-top: .9rem; }
.auth-card form .secret { margin: .9rem 0; }
.login .field > input:focus { outline: 3px solid color-mix(in srgb, var(--brand) 22%, transparent); outline-offset: 1px; border-color: var(--brand); }
.link-btn { display: inline-flex; align-items: center; gap: .25rem; border: 0; padding: 0; background: none; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; }
.mfa-qr { display: block; width: 180px; height: 180px; margin: .5rem 0 1rem; padding: 8px; border-radius: 8px; background: #fff; }

@media (max-width: 900px), (max-height: 700px) {
  .login { padding: 4.2rem 1rem 1rem; }
  .auth-home-link { top: .75rem; left: 1rem; }
  .auth-layout { width: min(520px, 100%); min-height: 0; grid-template-columns: 1fr; border-radius: 22px; }
  .auth-aside { display: none; }
  .login .auth-card { min-height: 0; padding: 4.4rem clamp(1.35rem, 7vw, 2.5rem) 1.4rem; }
  .auth-card-top { top: 1rem; left: 1.25rem; right: 1.25rem; display: flex; align-items: center; justify-content: space-between; }
  .auth-mobile-brand { display: inline-flex; font-size: .88rem; }
  .auth-mobile-brand img { width: 31px; height: 31px; }
  .auth-heading { margin: .35rem 0 .9rem; }
  .auth-heading-mark { width: 27px; height: 27px; margin-bottom: .45rem; font-size: .82rem; }
  .auth-card .seg { margin-bottom: .8rem; }
  .auth-card form > .btn.primary { min-height: 44px; }
  .auth-card form > .btn.ghost { min-height: 36px; margin-top: .2rem; }
  .auth-card form > .hint { margin-top: .7rem; }
}
@media (max-width: 420px) {
  .login { padding: 4rem .45rem .45rem; }
  .auth-home-link { top: .65rem; left: .8rem; }
  .auth-layout { border-radius: 17px; }
  .login .auth-card { padding: 4.2rem 1.1rem 1rem; }
  .auth-card-top { right: .9rem; left: .9rem; }
  .auth-mobile-brand { gap: .4rem; font-size: .82rem; }
  .auth-mobile-brand img { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) { .auth-card .seg button { transition: none; } }

@media (max-width: 820px) {
  .calendar-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .calendar-search { grid-column: 1 / -1; grid-row: 1; }
  #this-week { grid-column: 1; grid-row: 2; justify-self: stretch; }
  .week-navigation { grid-column: 2; grid-row: 2; justify-content: flex-end; }
  .status-filter { grid-column: 1; grid-row: 3; min-width: 0; }
  .platform-filter { grid-column: 2; grid-row: 3; min-width: 0; }
}
@media (max-width: 600px) { .topbar .theme-switch-label { display: none; } }

@media (max-width: 600px) {
  .kv { grid-template-columns: 1fr; } .kv dt { margin-top: .4rem; }
  .page-head .actions { width: 100%; } .page-head .actions .btn { flex: 1; }
  .post-editor-head { align-items: stretch; }
  .post-editor-controls { flex-basis: 100%; justify-content: flex-start; }
  .post-neighbor-nav { width: 100%; justify-content: space-between; }
  .post-edit-actions { width: 100%; } .post-edit-actions .btn { flex: 1 1 auto; }
  .hide-sm { display: none; }
  th, td { padding: .5rem; }
  .calendar-toolbar { grid-template-columns: 1fr auto; }
  .calendar-search { grid-column: 1 / -1; }
  .week-navigation { grid-column: 2; grid-row: 2; justify-content: flex-end; }
  .week-navigation strong { min-width: 88px; }
  .week-navigation .btn.icon-btn { width: 34px; height: 36px; }
  .week-navigation { gap: .15rem; }
  #this-week { grid-column: 1; grid-row: 2; justify-self: stretch; }
  .status-filter { grid-column: 1; grid-row: 3; min-width: 0; }
  .platform-filter { grid-column: 2; grid-row: 3; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.unstyled { border: 0; padding: 0; margin: 0; min-width: 0; }
details summary { cursor: pointer; margin: .5rem 0; }
select[multiple] { min-height: 110px; }


.page-head .actions select { width: auto; }

.input-row { display: flex; gap: .5rem; align-items: stretch; }
.input-row input { flex: 1; min-width: 0; }
@media (max-width: 600px) { .input-row { flex-direction: column; } }


.qr-row { display: flex; gap: .75rem; align-items: center; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.qr { background: #fff; border-radius: 6px; padding: 4px; flex: none; }
h4 { margin: .6rem 0 .2rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.export-menu { position: relative; }
.export-menu summary { list-style: none; margin: 0; }
.export-menu summary::-webkit-details-marker { display: none; }
.export-menu-options { position: absolute; top: calc(100% + .35rem); right: 0; z-index: 5; display: grid; gap: .25rem; min-width: 130px; padding: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.export-menu-options .btn { justify-content: flex-start; border-color: transparent; }
.seo-card-summary { display: flex; align-items: center; gap: .6rem; list-style: none; margin: 0; }
.seo-card-summary::-webkit-details-marker { display: none; }
.seo-card-summary h2 { flex: 1; min-width: 0; margin: 0; }
.seo-card-toggle::before { content: '⌄'; display: inline-block; color: var(--muted); font-size: 1.2rem; transition: transform .15s ease; }
.seo-card[open] .seo-card-toggle::before { transform: rotate(180deg); }
.seo-card > .card-head { margin-top: .75rem; }
.media-dropzone { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.35rem; min-height:120px; padding:1rem; margin:.75rem 0 1rem; border:2px dashed var(--border); border-radius:var(--radius); background:var(--surface); color:var(--muted); cursor:pointer; text-align:center; }
.media-dropzone strong { color:var(--text); }
.media-dropzone.dragging { border-color:var(--brand); background:var(--brand-soft); }
.media-toolbar { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; margin:1rem 0; }
.media-toolbar label:first-child { flex:1 1 240px; }
.media-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr)); gap:1rem; }
.media-card { overflow:hidden; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
.media-thumb { display:flex; width:100%; height:210px; align-items:center; justify-content:center; background:var(--surface-2); color:var(--muted); }
.media-thumb img { width:100%; height:100%; object-fit:contain; }
.media-placeholder { font-size:.85rem; }
.media-card-body { padding:.8rem; }
.media-card-body .card-head { align-items:flex-start; }
.media-card-body .card-head strong { overflow-wrap:anywhere; }
.media-tags { display:flex; gap:.35rem; flex-wrap:wrap; margin:.5rem 0; }
.media-rights { display:flex; align-items:center; gap:.45rem; margin:.75rem 0; font-size:.85rem; }
.media-rights input { width:auto; }
.media-actions { display:flex; flex-wrap:wrap; gap:.35rem; }
.media-queue-list { display:grid; gap:.4rem; }
.media-queue-item { display:grid; grid-template-columns:minmax(120px,1fr) auto; gap:.2rem .6rem; align-items:center; font-size:.85rem; }
.progress { grid-column:1/-1; height:5px; overflow:hidden; background:var(--surface-2); border-radius:5px; }
.progress i { display:block; height:100%; background:var(--brand); transition:width .15s ease; }
.media-page-head { align-items:center; gap:1rem; margin-bottom:1.25rem; }
.media-page-heading { flex:1 1 320px; min-width:0; }
.media-page-heading h1 { min-width:0; line-height:1.15; }
.media-page-heading p { margin:.35rem 0 0; }
.media-page-actions { display:flex; flex:0 0 auto; justify-content:flex-end; margin-left:auto; }
.media-upload-button { min-width:156px; min-height:42px; box-shadow:0 5px 14px color-mix(in srgb, var(--brand) 22%, transparent); }
.media-dropzone { min-height:148px; gap:.45rem; margin:0 0 1rem; border-style:dashed; background:linear-gradient(135deg,var(--surface),var(--surface-2)); transition:border-color .16s ease,background .16s ease,transform .16s ease; }
.media-dropzone:hover,.media-dropzone:focus-visible { border-color:var(--brand); outline:none; }
.media-dropzone.dragging { transform:translateY(-1px); }
.media-dropzone-icon { display:grid; width:38px; height:38px; place-items:center; margin-bottom:.15rem; border-radius:12px; background:var(--brand-soft); color:var(--brand); }
.media-dropzone-icon .btn-icon { width:21px; height:21px; }
.media-toolbar { padding:.7rem; border:1px solid var(--border); border-radius:12px; background:var(--surface); box-shadow:var(--shadow); }
.media-toolbar label { margin:0; }
.media-toolbar label:not(:first-child) { flex:0 1 200px; }
.media-toolbar .btn { flex:0 0 auto; }
.media-actions { gap:.45rem; padding-top:.25rem; }
.media-actions .btn { gap:.35rem; }
.media-actions .btn-icon { width:14px; height:14px; }
.media-actions .btn.danger { background:transparent; }
.media-actions .btn.danger:hover { background:var(--bad-soft); }
@media (max-width:600px) {
  .media-page-head { align-items:flex-start; }
  .media-page-actions { width:100%; }
  .media-upload-button { margin-left:auto; }
  .media-toolbar label:not(:first-child) { flex:1 1 140px; }
  .media-toolbar .btn { flex:1 1 100%; }
}
.seo-change { margin: .5rem 0 1rem; }
.seo-history { margin-bottom: 1rem; }

