:root {
  --bg: #f6f6f3; --panel: #fff; --ink: #1d1d16; --muted: #77776c; --line: #e6e5df;
  --brand: #d25611; --brand-soft: #fbeee6; --good: #18794e; --bad: #b42318; --bad-soft: #fde8e8; --info: #1a56db;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); }
a { color: inherit; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.3px; }
h2 { font-size: 15px; font-weight: 600; margin: 24px 0 10px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.shell { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.side a { text-decoration: none; padding: 7px 10px; border-radius: 6px; color: #44443c; }
.side a:hover { background: var(--bg); }
.side a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.brand { font-weight: 700; font-size: 16px; padding: 0 10px 18px; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); display: inline-block; }
.me { margin-top: auto; padding: 10px; color: var(--muted); font-size: 12px; }
main { padding: 28px 36px 60px; max-width: 1280px; min-width: 0; }
.banner { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; display: flex; gap: 12px; align-items: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.card b { display: block; font-size: 22px; font-weight: 600; }
.card small { color: var(--muted); display: block; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12px; background: #fbfbf9; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fbfbf9; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; margin: 1px 2px 1px 0; white-space: nowrap; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.chips button.chip { cursor: pointer; font: inherit; font-size: 12px; }
.st { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.st.draft { color: var(--muted); } .st.scheduled { color: var(--info); } .st.paused { color: var(--brand); }
.st.done, .st.sent { color: var(--good); } .st.cancelled, .st.failed, .st.skipped { color: var(--bad); } .st.queued { color: var(--muted); }
.flag-bad { color: var(--bad); font-weight: 600; }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid #cfcec6; border-radius: 6px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { width: 100%; min-height: 360px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 13px; }
label.inline { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1000px) { .grid2, .grid4 { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; } }
button { font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid #cfcec6; background: #fff; cursor: pointer; color: var(--ink); }
button:hover { background: var(--bg); }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(0.95); }
button.danger { color: var(--bad); border-color: #f0c4c0; }
button.small { padding: 3px 10px; font-size: 12px; }
button.link { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }
iframe.preview { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 10px; background: #f6f6f3; }
.note { background: #fbfbf9; border: 1px dashed var(--line); padding: 10px 12px; border-radius: 8px; color: #55554c; font-size: 13px; }
.pager { margin: 12px 0; }
#toast { position: fixed; bottom: 20px; right: 20px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; max-width: 420px; z-index: 10; }
#toast.err { background: var(--bad); }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 22px; width: min(520px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,0.25); }
.funnel { display: flex; gap: 0; margin: 12px 0; }
.funnel div { flex: 1; padding: 10px 12px; border: 1px solid var(--line); background: #fff; margin-left: -1px; }
.funnel div:first-child { border-radius: 10px 0 0 10px; margin-left: 0; } .funnel div:last-child { border-radius: 0 10px 10px 0; }
.funnel b { display: block; font-size: 18px; } .funnel small { color: var(--muted); }
body.login { display: grid; place-items: center; min-height: 100vh; }
body.login .card { width: min(360px, 92vw); padding: 30px; display: block; }
body.login h1 { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
body.login form { display: grid; gap: 14px; }
.error { color: var(--bad); }
