:root {
  --bg: #0F1419; --card: #161D26; --card-2: #1C2530; --line: #2A3542;
  --ink: #F5F5F0; --muted: #9AA5B1; --accent: #F08C1A; --amber: #D97706;
  --ok: #3FB27F; --warn: #E0A030; --bad: #E5534B;
  --radius: 14px; --gap: 16px;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100vh; font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button { font: inherit; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: rgba(15, 20, 25, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.3px; }
.brand em { font-style: normal; color: var(--accent); }
.mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--bg); font-weight: 800; }
.top-actions { display: flex; align-items: center; gap: 8px; }
main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 80px; }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; letter-spacing: -1px; margin: 4px 0 4px; }
h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 12px; }
.eyebrow { text-transform: uppercase; font-size: 12px; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grid { display: grid; gap: var(--gap); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.tight { padding: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--ink); font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #3a4757; }
.btn:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #111; }
.btn.danger { background: transparent; border-color: var(--bad); color: #ffb3ae; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--card-2); border: 1px solid var(--line); white-space: nowrap; }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.ok::before { background: var(--ok); } .pill.warn::before { background: var(--warn); } .pill.bad::before { background: var(--bad); } .pill.info::before { background: var(--accent); }
.list { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.item:hover { border-color: var(--accent); }
.item .title { font-weight: 700; }
.item .meta { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.kpi { font-size: 1.6rem; font-weight: 800; letter-spacing: -.5px; }
.bar { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 14px 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border-radius: 999px; padding: 8px 14px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.tabs button[aria-selected='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.preview-wrap { background: #e9eaec; border-radius: var(--radius); padding: 14px; }
.preview-head { background: #fff; color: #111; border-radius: 10px 10px 0 0; padding: 12px 14px; border-bottom: 1px solid #e5e5e5; }
.preview-head .s { font-weight: 700; } .preview-head .p { color: #666; font-size: 14px; }
iframe.mail { display: block; width: 100%; min-height: 320px; border: 0; background: #fff; border-radius: 0 0 10px 10px; }
.preview-wrap.mobile { max-width: 390px; margin: 0 auto; }
label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
input[type=text], textarea { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: #0c1116; color: var(--ink); font: inherit; }
textarea { min-height: 420px; line-height: 1.55; resize: vertical; }
.counter { font-size: 13px; color: var(--muted); }
.counter.bad { color: var(--bad); }
.check { display: flex; gap: 8px; font-size: 14px; padding: 4px 0; }
.quote { border-left: 3px solid var(--accent); padding: 6px 12px; margin: 0; color: var(--ink); }
.score { font-size: 2.2rem; font-weight: 800; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
.approve-box { border: 1px solid var(--accent); background: rgba(240, 140, 26, .07); }
.notice { padding: 12px 14px; border-radius: 10px; background: rgba(229, 83, 75, .1); border: 1px solid rgba(229, 83, 75, .4); }
#toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 700; max-width: calc(100% - 32px); z-index: 10; }
.auth { max-width: 440px; margin: 8vh auto 0; text-align: center; }
.auth .card { text-align: left; }
@media (max-width: 600px) { main { padding-top: 14px; } .card { padding: 14px; } textarea { min-height: 360px; } }
[hidden] { display: none !important; }
