/* ---------- tokens ---------- */
:root {
  --bg: #f1f2f5;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --ink: #171a21;
  --ink-2: #3d4452;
  --muted: #6b7280;
  --line: #e2e5ea;
  --line-strong: #c9ced6;
  --accent: #c4133a;
  --accent-ink: #ffffff;
  --accent-soft: #fbe9ee;
  --ok: #1f8a4c;  --ok-soft: #e4f4ea;
  --warn: #a8690c; --warn-soft: #fbf1dc;
  --bad: #c62828; --bad-soft: #fde8e8;
  --info: #2563eb; --info-soft: #e5edff;
  --purple: #6d46c6; --purple-soft: #ede7fb;
  --shadow: 0 1px 2px rgba(23,26,33,.06), 0 8px 24px -16px rgba(23,26,33,.25);
  --r-s: 6px; --r-m: 12px; --r-l: 16px;
  --head: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Be Vietnam Pro", system-ui, sans-serif;
  /* chart series: validated for CVD separation and contrast on this surface */
  --c1: #d1193e; --c2: #2563eb; --c3: #0f8a6b; --c4: #b7791f;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121418;
  --surface: #1a1d23;
  --surface-2: #20242b;
  --ink: #e8eaee;
  --ink-2: #c3c8d1;
  --muted: #9aa1ad;
  --line: #2b3039;
  --line-strong: #3a404b;
  --accent: #ff5c7a;
  --accent-ink: #1a0b10;
  --accent-soft: rgba(255,92,122,.14);
  --ok: #4fc47f;  --ok-soft: rgba(79,196,127,.14);
  --warn: #e3a93a; --warn-soft: rgba(227,169,58,.14);
  --bad: #ff6b6b; --bad-soft: rgba(255,107,107,.14);
  --info: #6c9cff; --info-soft: rgba(108,156,255,.14);
  --purple: #a98cf0; --purple-soft: rgba(169,140,240,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -16px rgba(0,0,0,.6);
  --c1: #f0486a; --c2: #4f86e8; --c3: #1e9e7c; --c4: #c27f14;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); line-height: 1.5; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
small, .muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  font-family: var(--head); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none; padding: 4px 10px 22px; display: flex; align-items: center; gap: 10px;
}
/* logo: a dot broadcasting rings, one product sent out to every network */
.brand i {
  width: 10px; height: 10px; margin: 6px; border-radius: 50%; background: var(--accent); flex: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 0 8px color-mix(in srgb, var(--accent) 13%, transparent);
}
.side a.nav {
  color: var(--ink-2); text-decoration: none; padding: 9px 12px; border-radius: var(--r-s);
  display: flex; align-items: center; gap: 10px; font-weight: 500; transition: background .15s, color .15s;
}
.side a.nav:hover { background: var(--surface-2); color: var(--ink); }
.side a.nav.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side .spacer { flex: 1; }
.side .tools { display: flex; gap: 6px; align-items: center; padding: 10px 6px 4px; border-top: 1px solid var(--line); margin-top: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.seg a, .seg button { font: inherit; font-size: .8rem; font-weight: 600; padding: 5px 9px; text-decoration: none; color: var(--muted); background: var(--surface); border: 0; cursor: pointer; }
.seg a.on { background: var(--ink); color: var(--surface); }
.iconbtn { font: inherit; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 30px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--muted); cursor: pointer; }
.iconbtn:hover { color: var(--ink); border-color: var(--line-strong); }
:root[data-theme="dark"] .only-light, :root:not([data-theme="dark"]) .only-dark { display: none; }
.worker { font-size: .78rem; color: var(--muted); padding: 8px 10px 0; display: flex; gap: 8px; align-items: baseline; }
.worker b { color: var(--ink-2); font-weight: 500; }
.worker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; position: relative; top: -1px; }
.worker .dot.busy { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

main { padding: 28px 36px 64px; max-width: 1360px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head p { margin: 6px 0 0; color: var(--muted); max-width: 72ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- messages ---------- */
.flash { padding: 10px 14px; border-radius: var(--r-s); margin-bottom: 18px; border: 1px solid; display: flex; gap: 10px; align-items: center; }
.flash.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ink); }
.flash.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--ink); }
.warn-list { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 8px; }
.warn-list li {
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: var(--r-s);
  padding: 9px 14px; display: flex; justify-content: space-between; gap: 16px; align-items: center;
}

/* ---------- buttons & forms ---------- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; min-height: 36px; border-radius: var(--r-s); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(.93); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: .86rem; }
.btn[disabled] { opacity: .5; cursor: progress; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.panel > h2 { margin-bottom: 4px; }
.panel > .hint { margin: 0 0 16px; color: var(--muted); font-size: .92rem; max-width: 80ch; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; }
.field label, .lbl { font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.field .hint { color: var(--muted); font-size: .82rem; }
input[type=text], input[type=url], input[type=number], input[type=password], input[type=datetime-local], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); width: 100%; min-height: 38px;
  border: 1px solid var(--line-strong); border-radius: var(--r-s); padding: 7px 10px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly] { background: var(--surface-2); color: var(--ink-2); }
textarea { min-height: 104px; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label {
  display: inline-flex; gap: 7px; align-items: center; padding: 6px 11px; min-height: 36px; border: 1px solid var(--line-strong);
  border-radius: var(--r-s); cursor: pointer; font-weight: 500; font-size: .9rem; background: var(--surface);
}
.checks label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.checks input, .switch input { accent-color: var(--accent); width: 16px; height: 16px; }
.switch { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; min-height: 36px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.swatch { display: flex; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.swatch span { width: 18px; height: 22px; }
.formbar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); z-index: 2; }
.formbar .spacer { flex: 1; }
.inline-result { font-size: .9rem; margin-top: 8px; }
.inline-result.ok { color: var(--ok); } .inline-result.bad { color: var(--bad); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { border: 1px solid var(--line); border-radius: var(--r-m); overflow: auto; margin-bottom: 18px; box-shadow: var(--shadow); }
.tablewrap tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.scheduled, .badge.queued { background: var(--info-soft); color: var(--info); }
.badge.posted, .badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.failed { background: var(--bad-soft); color: var(--bad); }
.badge.exported { background: var(--purple-soft); color: var(--purple); }
.badge.running { background: var(--accent-soft); color: var(--accent); }
.badge.off, .badge.cancelled { background: var(--surface-2); color: var(--muted); }
.badge.planned { background: var(--surface-2); color: var(--ink-2); }
.ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 2 / 3; padding: 14px; text-align: center; background: var(--surface-2); color: var(--muted); font-size: .84rem; border-radius: var(--r-s); cursor: pointer; }
.pincard .ph { width: 100%; border-radius: 0; }
.strip .ph { width: 132px; border: 1px solid var(--line); }
.acc-row { border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px 16px; margin-top: 10px; background: var(--surface-2); }
.badge.ai { background: var(--purple-soft); color: var(--purple); }
.badge.ai::before { display: none; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px 18px 14px; box-shadow: var(--shadow); }
.kpi .label { font-size: .86rem; color: var(--muted); font-weight: 500; }
.kpi .value { font-family: var(--head); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.delta { font-weight: 600; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }

/* ---------- charts ---------- */
.row { display: grid; gap: 14px; margin-bottom: 18px; }
.row.split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card .cardhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card .cardhead p { margin: 2px 0 0; font-size: .86rem; color: var(--muted); }
.chart { position: relative; height: 260px; }
.chart.tall { height: 300px; }
.chart.short { height: 200px; }
.chart canvas { width: 100% !important; height: 100% !important; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend i.line { height: 3px; border-radius: 2px; width: 14px; }
.legend i.dash { height: 0; width: 14px; border-top: 3px dashed; background: none; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: .9rem; padding: 20px; }
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; }
.donut-wrap .chart { height: 150px; }
.statlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.statlist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .9rem; }
.statlist b { font-variant-numeric: tabular-nums; }

/* ---------- upcoming strip ---------- */
.strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.strip a { flex: 0 0 132px; scroll-snap-align: start; text-decoration: none; color: inherit; }
.strip img { width: 132px; aspect-ratio: 2/3; object-fit: cover; border-radius: var(--r-s); display: block; border: 1px solid var(--line); background: var(--surface-2); }
.strip .cap { font-size: .78rem; margin-top: 6px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.strip .when { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- pin grid ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters select, .filters input { width: auto; min-width: 150px; }
.pingrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.pincard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; display: flex; flex-direction: column; position: relative; box-shadow: var(--shadow); }
.pincard img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; cursor: pointer; background: var(--surface-2); }
.pincard .meta { padding: 8px 10px 10px; font-size: .83rem; display: grid; gap: 3px; }
.pincard .meta b { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pincard .pick { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; accent-color: var(--accent); }
.pincard .badges { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.pincard .err { color: var(--bad); font-size: .78rem; }
.bulkbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.pager { display: flex; gap: 6px; margin-top: 22px; flex-wrap: wrap; }
.pager a, .pager span { padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: var(--r-s); text-decoration: none; color: var(--ink); background: var(--surface); }
.pager span { background: var(--ink); color: var(--surface); border-color: var(--ink); }

dialog { border: 0; border-radius: var(--r-l); padding: 0; width: min(900px, 94vw); box-shadow: 0 24px 64px rgba(0,0,0,.4); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(10,12,16,.6); }
.dlg { display: flex; flex-direction: column; max-height: 90vh; }
.dlg .rowline { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.dlg-head, .dlg-foot { display: flex; align-items: center; gap: 12px; padding: 14px 20px; flex: none; }
.dlg-head { border-bottom: 1px solid var(--line); }
.dlg-foot { border-top: 1px solid var(--line); justify-content: space-between; flex-wrap: wrap; }
.dlg-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dlg-title h2 { margin: 0; font-size: 1.05rem; }
.dlg-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-body { display: grid; grid-template-columns: 260px 1fr; overflow: auto; min-height: 0; }
.dlg-side { background: var(--surface-2); padding: 16px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--line); }
.dlg-side img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; border-radius: 10px; }
.dlg-fields { padding: 18px 20px; display: grid; gap: 14px; align-content: start; }
.dlg-fields textarea { min-height: 96px; }
.dlg-link { margin: 0; overflow-wrap: anywhere; font-size: .86rem; }

/* ---------- preview ---------- */
.preview { display: grid; grid-template-columns: 260px 1fr; gap: 20px; margin-top: 14px; }
.preview img { width: 100%; border-radius: var(--r-s); border: 1px solid var(--line); }
.preview dl { margin: 0; display: grid; gap: 8px; }
.preview dt { font-weight: 600; font-size: .82rem; color: var(--muted); }
.preview dd { margin: 0; }
.guides { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.guides figure { margin: 0; width: 110px; }
.guides img { width: 110px; height: 110px; object-fit: cover; border-radius: var(--r-s); border: 1px solid var(--line); display: block; }
.guides button { margin-top: 4px; }

/* ---------- concepts ---------- */
.concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 26px; }
.concept { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.concept img, .concept .noimg { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; background: var(--surface-2); }
.concept .noimg { display: grid; place-items: center; color: var(--muted); font-size: .85rem; text-align: center; padding: 20px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 12px, var(--surface) 12px 24px); }
.concept .body { padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.concept .why { margin: 0; font-size: .88rem; color: var(--ink-2); }
.concept .prompt { margin: 0; font-size: .8rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.concept .rowline { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.concept-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.concept-pick label { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-s); cursor: pointer; background: var(--surface); position: relative; }
.concept-pick label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.concept-pick input { position: absolute; top: 10px; left: 10px; width: 18px; height: 18px; accent-color: var(--accent); z-index: 1; }
.concept-pick img, .concept-pick .noimg { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; background: var(--surface-2); display: block; }
.concept-pick .name { font-weight: 600; font-size: .86rem; }
.concept-pick .why { font-size: .76rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- jobs ---------- */
.jobs { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.joblist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; box-shadow: var(--shadow); }
.joblist a { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); align-items: center; }
.joblist a:hover { background: var(--surface-2); }
.joblist a.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.joblist a small { display: block; }
pre.log { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); padding: 16px; border-radius: var(--r-m); max-height: 70vh; overflow: auto; white-space: pre-wrap; font-size: .84rem; margin: 0; font-family: ui-monospace, Consolas, monospace; }
.empty-state { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-m); }
.empty-state .btn { margin-top: 12px; }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .row.split { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px 12px; align-items: center; }
  .side .spacer, .worker { display: none; }
  .brand { padding: 0 8px 0 0; }
  .side .tools { border: 0; margin: 0; padding: 0 0 0 6px; }
  main { padding: 18px 16px 48px; }
  .grid2, .grid3, .jobs, .preview, .dlg-body, .donut-wrap { grid-template-columns: 1fr; }
  .dlg-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .dlg-side img { max-width: 200px; margin: 0 auto; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- login / setup ---------- */
.side form.logout { margin: 0; }
body.authpage { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.authbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow);
  padding: 28px 28px 30px; width: 100%; max-width: 420px; }
.authbox .brand { padding: 0 0 18px; }
.authbox h1 { font-size: 1.5rem; }
.authbox > p.muted { margin: 6px 0 18px; }
.authbox .stack { display: grid; gap: 14px; }
.authbox .small { font-size: .86rem; text-align: center; }
input.code { font-size: 1.3rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.authbox .steps { margin: 0 0 12px; padding-left: 20px; color: var(--ink-2); }
.authbox .qr { display: grid; place-items: center; margin: 4px 0 10px; }
.authbox .qr svg { border-radius: var(--r-s); max-width: 100%; height: auto; }
.authbox details { margin-bottom: 14px; font-size: .9rem; }
code.secret { word-break: break-all; font-size: .95rem; }
ul.codes { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
ul.codes code { font-size: 1rem; display: block; text-align: center; padding: 6px; }

/* network icon + link to the published post on pin cards */
.net { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; flex: none; color: #fff; }
.net svg { width: 14px; height: 14px; }
.net.pinterest { background: #e60023; }
.net.facebook { background: #1877f2; }
.net.instagram { background: linear-gradient(45deg, #f9a825, #e1306c 50%, #833ab4); border-radius: 7px; }
.net.threads { background: #111; }
.pincard .netrow { display: flex; flex-wrap: wrap; gap: 5px; margin: 3px 0 1px; }
.pincard .netrow a { display: inline-flex; border-radius: 50%; }
.pincard .netrow a:hover .net { box-shadow: 0 0 0 2px var(--accent); }
.netrow .pending .net, .postrow:not(.posted) > .net { opacity: .3; filter: grayscale(1); }
.netrow .pending.failed .net, .postrow.failed > .net { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--bad); }
.postlist { display: flex; flex-direction: column; gap: 6px; }
.postlist b { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
#d-posts { display: flex; flex-direction: column; gap: 6px; }
.postrow { display: flex; align-items: center; gap: 9px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: .84rem; font-weight: 600; min-width: 0; cursor: pointer; }
.postrow:hover, .postrow.active { border-color: var(--accent); }
.postrow.active { box-shadow: 0 0 0 1px var(--accent); }
.postrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.postrow small { margin-left: auto; color: var(--muted); font-weight: 500; white-space: nowrap; }
.postrow a { text-decoration: none; padding: 0 4px; font-weight: 700; }
.dlg-fields .editing { display: flex; align-items: center; gap: 8px; font-weight: 600; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.dlg-fields .editing .badge { margin-left: auto; }

/* inbox: contact form messages */
.side a.nav .count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; }
.inbox { display: grid; gap: 14px; }
.inbox .msg { margin: 0; }
.inbox .msg.unread { border-left: 3px solid var(--accent); }
.inbox .msg header { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.inbox .msg h2 { font-size: 1.05rem; margin: 0 0 2px; display: flex; gap: 8px; align-items: center; }
.inbox .msg header a { color: var(--accent); text-decoration: none; }
.inbox .msg .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inbox .msg .actions form { margin: 0; }
.inbox .meta { display: flex; gap: 24px; flex-wrap: wrap; margin: 14px 0 0; }
.inbox .meta dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.inbox .meta dd { margin: 2px 0 0; word-break: break-all; }
.inbox .meta .nets { display: flex; gap: 4px; }
.inbox .body { margin: 14px 0 0; white-space: pre-wrap; color: var(--ink-2); line-height: 1.6; overflow-wrap: anywhere; }
