/*
  Ad Studio. The Reply tool's frame (Inter, cool slate greys, a sidebar, white
  cards on a soft grey) with its own accent: a warm coral where Replies uses
  indigo, so the two read as one family but never get mistaken for each other.
*/
:root {
  --bg: #f8fafc;          /* slate-50 */
  --side: #f1f5f9;        /* slate-100 */
  --panel: #ffffff;
  --ink: #0f172a;         /* slate-900 */
  --ink-2: #334155;       /* slate-700 */
  --muted: #64748b;       /* slate-500 */
  --faint: #94a3b8;       /* slate-400 */
  --line: #e2e8f0;        /* slate-200 */
  --accent: #ea580c;      /* coral-orange */
  --accent-ink: #c2410c;
  --accent-soft: #fff4ec;
  --accent-ring: rgb(234 88 12 / 0.18);
  --good: #047857;  --good-soft: #ecfdf5;
  --warn: #b45309;  --warn-soft: #fffbeb;
  --bad: #be123c;   --bad-soft: #fff1f2;
  --blue: #1d4ed8;  --blue-soft: #eff6ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.05);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  accent-color: var(--accent);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 32px 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
p.lede { color: var(--muted); margin: 0 0 22px; max-width: 70ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Frame ------------------------------------------------------------------ */
.shell { min-height: 100vh; display: flex; }
.side { width: 240px; flex-shrink: 0; background: color-mix(in srgb, var(--side) 70%, transparent); border-right: 1px solid var(--line); padding: 20px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; box-shadow: var(--shadow); }
.brand span { line-height: 1.2; }
.brand b { display: block; font-size: 14px; font-weight: 600; }
.brand small { display: block; font-size: 12px; color: var(--muted); }
.menu { display: none; }
nav { margin-top: 22px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
nav a svg { width: 18px; height: 18px; color: var(--faint); }
nav a:hover { background: rgb(255 255 255 / 0.7); text-decoration: none; color: var(--ink); }
nav a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
nav a.on svg { color: var(--accent); }
.side-foot { border-top: 1px solid var(--line); padding: 14px 12px 0; }
.status { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.who { margin-top: 12px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.who button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); cursor: pointer; }
main { flex: 1; min-width: 0; max-width: 1280px; padding: 32px 36px 96px; }

/* Bits ------------------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--side); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 700; margin-right: 8px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: block; color: inherit; box-shadow: var(--shadow); transition: border-color 120ms, box-shadow 120ms; }
a.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 4px 14px rgb(15 23 42 / 0.06); text-decoration: none; }
.card .meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.card .cover { width: 100%; border-radius: 8px; display: block; margin-bottom: 10px; aspect-ratio: 1; object-fit: cover; background: var(--side); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 20px 0 22px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], textarea, select {
  font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; width: 100%; color: var(--ink);
  transition: border-color 120ms, box-shadow 120ms;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); outline: none; }
input[type=color] { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input[type=file]::file-selector-button { margin-right: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); box-shadow: var(--shadow); cursor: pointer; }
textarea { min-height: 96px; resize: vertical; }
input[type=number] { width: 76px; }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 5px; font-weight: 500; }
label:has(> input[type=checkbox]) { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); margin: 0; }
.btn { font: inherit; font-size: 14px; font-weight: 600; padding: 9px 18px; border-radius: 9px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { padding: 6px 11px; font-size: 13px; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: default; }
.err { color: var(--bad); font-size: 13px; }

.thumbs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.thumb { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--side); }
.thumb .cap { padding: 8px 10px; font-size: 12px; line-height: 1.45; }
.thumb.off img { opacity: .35; }

/* Run gallery ------------------------------------------------------------ */
.concept { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.concept-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.concept .num { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.concept .why { color: var(--muted); font-size: 14px; margin: 4px 0 16px; max-width: 80ch; }
.formats { display: grid; grid-template-columns: 1fr 0.5625fr; gap: 20px; align-items: start; max-width: 880px; }
.frame { position: relative; background: var(--side); border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.frame img.ad { display: block; width: 100%; }
.frame img.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
.show-zones .frame img.overlay { display: block; }
.frame .placeholder { aspect-ratio: var(--ar); display: grid; place-items: center; color: var(--muted); font-size: 13px; padding: 12px; text-align: center; }
.issues { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; }
.issues li { margin: 4px 0; padding-left: 18px; position: relative; color: var(--ink-2); }
.issues li.block::before { content: "✕"; position: absolute; left: 0; color: var(--bad); font-weight: 700; }
.issues li.warn::before { content: "!"; position: absolute; left: 3px; color: var(--warn); font-weight: 700; }
.ad-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ad-actions input { flex: 1; min-width: 160px; padding: 6px 10px; font-size: 13px; }

.copy-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fff; white-space: pre-wrap; font-size: 14px; box-shadow: var(--shadow); }
.copy-item .hook { font-weight: 600; }
.log { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; line-height: 1.7; max-height: 240px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--ink-2); }
.offer dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.offer dt { color: var(--muted); }
.offer dd { margin: 0; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 5px; vertical-align: middle; box-shadow: inset 0 0 0 1px rgb(15 23 42 / 0.1); margin-right: 4px; }
details summary { cursor: pointer; color: var(--accent-ink); font-weight: 500; }

/* Login ------------------------------------------------------------------ */
.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% -10%, #ffedd5 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #ffe4e6 0%, transparent 55%), var(--bg); padding: 16px; }
.login { width: 100%; max-width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 10px 30px rgb(15 23 42 / 0.08); display: flex; flex-direction: column; gap: 16px; }
.login .brand { padding: 0; margin-bottom: 6px; }
.login .btn { justify-content: center; width: 100%; }

/* Phone ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .shell { display: block; }
  .side { width: auto; height: auto; position: sticky; z-index: 10; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; background: rgb(255 255 255 / 0.92); backdrop-filter: blur(8px); }
  .menu { display: block; margin-left: auto; background: none; border: 0; padding: 6px; color: var(--ink-2); cursor: pointer; }
  nav, .side-foot { display: none; width: 100%; }
  .side.open nav, .side.open .side-foot { display: flex; }
  .side.open .side-foot { display: block; }
  nav { margin-top: 12px; }
  main { padding: 20px 16px 80px; }
  .formats { grid-template-columns: 1fr; }
  .offer dl { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }

.tracking { margin-bottom: 18px; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: linear-gradient(0deg, #fff, var(--accent-soft)); }
.tracking ol { margin: 6px 0 0; padding-left: 20px; }
.tracking li + li { margin-top: 8px; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; background: var(--side); padding: 1px 5px; border-radius: 5px; }
code.param { word-break: break-all; padding: 6px 8px; flex: 1; min-width: 0; }
