[hidden] { display: none !important; }
:root {
  --ink: #1c2733;
  --ink-2: #4a5868;
  --paper: #f3f5f8;
  --panel: #ffffff;
  --rule: #dce2ea;
  --accent: #2f55d4;
  --accent-ink: #ffffff;
  --ok: #1f7a4d;
  --warn: #9a5a06;
  --err: #b42318;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.55 var(--font); color: var(--ink); background: var(--paper); }
a { color: var(--accent); }
h1 { font-size: 26px; line-height: 1.2; font-weight: 600; margin: 0 0 18px; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 14px; }
h2.sub { margin-top: 32px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.muted { color: var(--ink-2); font-size: 13px; }
.lede { color: var(--ink-2); max-width: 70ch; margin: -8px 0 22px; }
.hint { color: var(--ink-2); font-size: 13px; margin: 6px 0 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #c9d3de; padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { color: #fff; font-weight: 600; font-size: 17px; text-decoration: none; padding: 0 10px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #c9d3de; text-decoration: none; padding: 8px 10px; border-radius: 6px; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 #7d9bff; }
.who { margin-top: auto; font-size: 13px; padding: 0 10px; }
.who a { color: #9fb5ff; }
.main { padding: 32px clamp(16px, 4vw, 48px) 64px; max-width: 1200px; width: 100%; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.head-row h1 { margin: 0; }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .who { margin: 0 0 0 auto; }
}

/* panels & forms */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 20px 22px; margin-bottom: 18px; }
label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 14px; }
label small { display: block; font-weight: 400; color: var(--ink-2); margin-top: 4px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px; font: inherit; font-weight: 400;
  color: var(--ink); background: #fff; border: 1px solid #c5ceda; border-radius: 6px;
}
textarea.mono, input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(47,85,212,.15); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: 600; margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 20px; align-items: end; }
.radios { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.swatches { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.swatches label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input[type=color] { width: 42px; height: 32px; padding: 2px; border: 1px solid #c5ceda; border-radius: 6px; background: #fff; }
details { margin: 6px 0 14px; }
summary { cursor: pointer; color: var(--accent); font-weight: 500; margin-bottom: 10px; }
.site-picker { border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; max-height: 280px; overflow: auto; margin-bottom: 16px; columns: 2 260px; }
.site-picker label.check { margin-bottom: 8px; break-inside: avoid; }
.picker-tools { column-span: all; margin-bottom: 8px; }
.savebar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 0 6px; }

/* buttons */
.btn { display: inline-block; font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 6px; padding: 9px 16px; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linkish.danger { color: var(--err); }

/* tables */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: 13px; font-weight: 500; color: var(--ink-2); background: #f8f9fb; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.dim td { opacity: .55; }
.row-actions { white-space: nowrap; }
.row-actions > * { margin-right: 12px; }
.row-actions form { display: inline; }
.code-cell { display: flex; gap: 8px; align-items: center; min-width: 360px; }
.code-cell .snippet { margin: 0; font-size: 12px; }

/* status pills */
.pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 999px; margin-top: 4px; }
.pill-active { background: #e3f4ea; color: var(--ok); }
.pill-paused { background: #eceff3; color: var(--ink-2); }
.pill-scheduled { background: #e6ecfd; color: var(--accent); }
.pill-ended { background: #fbeee0; color: var(--warn); }

/* figures: the one bold element */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); margin: 8px 0 24px; }
.figures > div { padding: 16px 16px 16px 0; color: var(--ink-2); font-size: 14px; }
.figures .fig { display: block; font-size: 40px; line-height: 1.05; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin-bottom: 4px; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 80px; margin: 0 0 24px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); }
.spark span { flex: 1; background: var(--accent); opacity: .75; border-radius: 2px 2px 0 0; min-width: 3px; }
.spark span:hover { opacity: 1; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.filters label { margin: 0; }
.filters .btn { margin-bottom: 1px; }

/* notices */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; border-left: 4px solid; background: #fff; }
.flash-ok { border-color: var(--ok); }
.flash-warn { border-color: var(--warn); }
.flash-err { border-color: var(--err); color: var(--err); }
.empty { padding: 28px; text-align: center; background: var(--panel); border: 1px dashed #c5ceda; border-radius: 10px; color: var(--ink-2); }
.steps ol { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 6px; }
.steps li.done { color: var(--ink-2); text-decoration: line-through; }
ul.plain { list-style: none; padding: 0; margin: 0 0 18px; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; }
form.inline { display: inline; }

/* login / install */
body.solo { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.solo-card { background: var(--panel); border: 1px solid var(--rule); border-top: 4px solid var(--ink); border-radius: 10px; padding: 28px; width: 100%; max-width: 380px; }
.solo-card.wide { max-width: 560px; }
.solo-card .btn { width: 100%; padding: 11px; }
.bulk { margin-top: 10px; }

/* v2: roles, fields, visual editor */
.role { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; margin-left: 4px; }
.panel.narrow { max-width: 460px; }
.actions { display: flex; gap: 8px; margin-top: 6px; }
.field { margin-bottom: 14px; }
.field-label { display: block; font-weight: 500; font-size: 14px; margin: 0 0 6px; }
.field-label small { display: block; font-weight: 400; color: var(--ink-2); }

.img-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.img-row input { flex: 1 1 260px; margin: 0 !important; }
.thumb { width: 52px; height: 52px; border: 1px solid var(--rule); border-radius: 6px; display: grid; place-items: center; background: #f8f9fb; overflow: hidden; flex: none; }
.thumb:empty::after { content: ""; width: 18px; height: 14px; border: 1.5px solid #b7c0cc; border-radius: 2px; }
.thumb img { max-width: 100%; max-height: 100%; }

.ve { border: 1px solid #c5ceda; border-radius: 6px; background: #fff; overflow: hidden; }
.ve:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,85,212,.15); }
.ve-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--rule); background: #f8f9fb; }
.ve-btn { width: 32px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 4px; color: var(--ink); cursor: pointer; padding: 0; }
.ve-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ve-btn svg circle { fill: currentColor; stroke: none; }
.ve-btn svg rect + circle { fill: none; stroke: currentColor; }
.ve-btn:hover { background: #e7ebf1; }
.ve-btn.on, .ve-btn[aria-pressed=true] { background: #dfe6fb; color: var(--accent); }
.ve-btn:disabled { opacity: .4; }
.ve-sep { width: 1px; height: 18px; background: var(--rule); margin: 0 4px; }
.ve.source .ve-btn:not([aria-pressed=true]) { opacity: .35; pointer-events: none; }
.ve-area { min-height: 130px; max-height: 360px; overflow: auto; padding: 12px 14px; font-size: 15px; line-height: 1.6; outline: none; }
.ve { position: relative; }
.ve.empty:not(.source) .ve-area::before { content: attr(data-placeholder); position: absolute; color: #98a2b3; pointer-events: none; }
.ve-area p { margin: 0 0 6px; }
.ve-area img { max-width: 100%; height: auto; }
.ve-area a { color: var(--accent); }
.ve textarea.ve-src { border: 0 !important; border-radius: 0; margin: 0 !important; min-height: 160px; box-shadow: none !important; }
.ve-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
