/* ARC — free email campaigns. Keeps the old ARC identity: warm paper, crimson-pink brand, monospace labels.
   Light and dark themes (switch in the menu). Ad frame: top banner + bottom square under the content + right Google slot. */
:root {
  --bg: #f6f3ee; --panel: #ffffff; --ink: #17151a; --ink-2: #5c5866; --ink-3: #8d8896; --line: #e6e0d8;
  --brand: #d8064f; --brand-2: #b0003f; --brand-soft: #fde4ec;
  --green: #138a5a; --green-soft: #def4ea; --amber: #a86400; --amber-soft: #fcefd8; --red: #c4302b; --red-soft: #fbe3e1; --blue: #2f5fd0; --blue-soft: #e5ecfc;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121015; --panel: #1b1920; --ink: #f1edf3; --ink-2: #b4adbd; --ink-3: #847d8e; --line: #2d2934;
  --brand: #ff3d7f; --brand-2: #ff6b9b; --brand-soft: #3a1426;
  --green: #4cc28f; --green-soft: #12301f; --amber: #f0b047; --amber-soft: #352610; --red: #ff6b62; --red-soft: #3a1714; --blue: #7aa2ff; --blue-soft: #18213a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 750; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .tiny { font-size: 12px; color: var(--ink-3); }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 26px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { text-decoration: none; display: block; margin-bottom: 26px; }
.brand .w { color: var(--brand); font-weight: 900; font-size: 30px; letter-spacing: -0.02em; line-height: 1; }
.brand .s { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--ink-2); margin-top: 6px; }
.menu { display: flex; flex-direction: column; gap: 4px; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 550; }
.menu a:hover { background: var(--bg); }
.menu a.on { background: var(--brand-soft); color: var(--brand); }
.menu .n { margin-left: auto; font-size: 12px; background: var(--brand); color: #fff; border-radius: 999px; padding: 0 7px; }
.side .foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.side .foot a { color: var(--ink-2); text-decoration: none; font-size: 14px; }
.theme-btn { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; }
.topbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
  .topbar .w { color: var(--brand); font-weight: 900; font-size: 22px; }
}
.frame { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding: 28px 32px 48px; align-items: start; max-width: 1400px; }
.frame.wide { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1180px) { .frame { grid-template-columns: minmax(0, 1fr); } .side-ad { display: none; } }
@media (max-width: 600px) { .frame { padding: 18px 14px 40px; } }
.main { min-width: 0; }

/* ---------- ads ---------- */
.ad-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; color: var(--ink-3); text-align: center; margin-bottom: 5px; text-transform: uppercase; }
.ad-under { font-size: 12px; text-align: center; margin-top: 5px; }
.ad-under a { color: var(--ink-3); text-decoration: none; }
.ad-top { max-width: 728px; margin: 0 auto 24px; } .ad-bottom { max-width: 300px; margin: 28px auto 0; } .ad-card { max-width: 420px; margin: 18px auto 6px; }
.ad img, .gate-ad img { display: block; width: 100%; height: auto; border-radius: 8px; }
.slot-empty { border: 1.5px dashed var(--line); border-radius: 8px; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; background: var(--panel); }
.ad-top .slot-empty { aspect-ratio: 728 / 90; } .ad-bottom .slot-empty { aspect-ratio: 300 / 250; } .ad-card .slot-empty { aspect-ratio: 728 / 90; }
.side-ad { position: sticky; top: 24px; }
.google-slot { width: 300px; height: 600px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--panel); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; color: var(--ink-3); font-size: 13px; }
.gate-bg { position: fixed; inset: 0; background: rgba(15, 10, 20, .6); z-index: 100; display: grid; place-items: center; padding: 16px; }
.gate { background: var(--panel); border-radius: 18px; padding: 18px 22px 16px; width: min(460px, 100%); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.gate .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; min-height: 36px; }
.gate-ad { max-width: 300px; margin: 0 auto; }
.gate .foot { text-align: center; font-size: 13px; color: var(--ink-2); margin-top: 12px; }

/* ---------- controls ---------- */
.btn { appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 650;
  font-size: 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-soft); }
.btn.danger.solid { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.small { padding: 5px 10px; font-size: 13px; } .btn.big { padding: 12px 22px; font-size: 16px; } .btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[readonly] { color: var(--ink-2); }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; } @media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.code-input { font-size: 26px !important; letter-spacing: .4em; text-align: center; font-family: var(--mono) !important; }

/* ---------- surfaces ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.panel + .panel { margin-top: 16px; }
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h .sub { color: var(--ink-2); margin-top: 6px; }
.narrow { max-width: 520px; margin: 0 auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card .bar { width: 28px; height: 4px; border-radius: 2px; background: var(--brand); margin-bottom: 12px; }
.card .bar.g { background: var(--green); } .card .bar.r { background: var(--red); } .card .bar.b { background: var(--blue); } .card .bar.a { background: var(--amber); }
.card .v { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.card .l { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-top: 4px; }
.card .s { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; background: var(--blue-soft); }
.notice.warn { background: var(--amber-soft); } .notice.bad { background: var(--red-soft); } .notice.good { background: var(--green-soft); }
.error-box { background: var(--red-soft); color: var(--red); border-radius: 12px; padding: 12px 14px; }
.empty { text-align: center; color: var(--ink-2); padding: 46px 12px; }
.loading { color: var(--ink-3); padding: 30px; text-align: center; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--bg); color: var(--ink-2); }
.pill.green { background: var(--green-soft); color: var(--green); } .pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); } .pill.blue { background: var(--blue-soft); color: var(--blue); } .pill.brand { background: var(--brand-soft); color: var(--brand); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0 14px; }
.tabs button { border: 0; background: transparent; padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 650; color: var(--ink-2); cursor: pointer; }
.tabs button.on { background: var(--brand); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--panel); }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--bg); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 8px; }

/* campaign */
.camp-list { display: flex; flex-direction: column; gap: 10px; }
.camp { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 16px; text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.camp:hover { border-color: var(--ink-3); }
.camp .thumb { width: 96px; height: 56px; border-radius: 8px; background: var(--bg) center / cover no-repeat; border: 1px solid var(--line); }
.camp .t { font-weight: 700; } .camp .s { font-size: 13px; color: var(--ink-2); }
.preview { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; place-items: center; min-height: 160px; }
.preview img { max-width: 100%; max-height: 360px; border-radius: 10px; }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 36px 20px; text-align: center; cursor: pointer; background: var(--bg); }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.boxes { display: flex; flex-direction: column; gap: 6px; }
.box-opt { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.box-opt input { accent-color: var(--brand); width: 17px; height: 17px; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.res { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel); }
.res .v { font-size: 22px; font-weight: 800; } .res .l { font-size: 12px; color: var(--ink-2); }
.progress { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: var(--brand); }
.mono { font-family: var(--mono); font-size: 12px; }

/* modal + toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 10, 20, .5); display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal { background: var(--panel); color: var(--ink); border-radius: 16px; padding: 22px; width: min(600px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.modal h2 { margin-bottom: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(520px, 92vw); }
.toast { background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.toast.bad { background: var(--red); color: #fff; }
.kv { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px 16px; font-size: 14px; } .kv .k { color: var(--ink-2); }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; gap: 2px; } }

/* public pages */
.pub-top { max-width: 1100px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.pub-top .w { color: var(--brand); font-weight: 900; font-size: 26px; text-decoration: none; }
.pub-top nav { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.hero { max-width: 1100px; margin: 0 auto; padding: 40px 20px 60px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(38px, 6vw, 60px); line-height: 1.02; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lede { font-size: 18px; color: var(--ink-2); margin: 18px 0 24px; max-width: 34em; }
.mock { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: 0 30px 60px rgba(30, 10, 20, .12); }
.mock .img { height: 170px; border-radius: 10px; background: linear-gradient(135deg, var(--brand) 0%, #ff8a3d 100%); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; }
.mock .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.mock .stats div { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; font-size: 12px; color: var(--ink-2); }
.mock .stats b { display: block; font-size: 18px; color: var(--ink); }
.foot-pub { text-align: center; color: var(--ink-3); font-size: 13px; padding: 26px 20px 40px; }
.foot-pub a { color: var(--ink-2); }
