/* AdHer — feminine editorial: warm cream, deep pink, serif display, script accents */
:root {
  --cream: #FBF3EE;
  --cream-2: #F6E8E2;
  --paper: #FFFCFA;
  --blush: #F9DDE5;
  --blush-2: #FCEDF1;
  --pink: #C8285F;
  --pink-deep: #9E1A49;
  --pink-soft: #E9789F;
  --ink: #3B2430;
  --ink-2: #6E5360;
  --muted: #9A8590;
  --line: #EFDCE2;
  --line-2: #E5C9D2;
  --good: #2F7D5B;
  --good-bg: #E3F2EA;
  --warn: #B4610F;
  --warn-bg: #FCEFDD;
  --bad: #B3263E;
  --bad-bg: #FBE3E7;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --script: "Caveat", "Segoe Script", "Bradley Hand", cursive;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 9px;
  --shadow: 0 1px 0 rgba(158, 26, 73, .04), 0 10px 30px -18px rgba(158, 26, 73, .28);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 4vw, 44px); }
h2 { font-size: 26px; }
h3 { font-size: 19px; }
h4 { font-size: 16px; }
p { margin: 0 0 .6em; }
a { color: var(--pink-deep); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--pink); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .logo { font-size: 48px; opacity: .6; }

/* Logo */
.logo { display: inline-flex; align-items: baseline; line-height: 1; text-decoration: none; color: var(--ink); }
.logo-ad { font-family: var(--serif); font-weight: 600; font-size: 1em; letter-spacing: -.03em; }
.logo-her { font-family: var(--script); font-weight: 700; color: var(--pink); font-size: 1.15em; margin-left: .02em; transform: rotate(-4deg); display: inline-block; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20; background: rgba(251, 243, 238, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.top-row { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 12px 24px 6px; }
.top-row .logo { font-size: 30px; }
.top-spacer { flex: 1; }
.save-state { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.save-state.saving::before { background: var(--pink-soft); }
.save-state.error { color: var(--bad); }
.save-state.error::before { background: var(--bad); }
.brand-switch { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 6px; }
.brand-switch select { border: 0; background: transparent; font-weight: 600; padding: 4px 4px; max-width: 180px; cursor: pointer; }
.brand-dot { width: 24px; height: 24px; border-radius: 50%; flex: none; border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--line-2); background-size: cover; background-position: center; }
.avatar { text-decoration: none; width: 34px; height: 34px; border-radius: 50%; background: var(--blush); color: var(--pink-deep); display: grid; place-items: center; font-family: var(--serif); font-weight: 600; border: 0; cursor: pointer; }

.tabs { max-width: 1280px; margin: 0 auto; display: flex; gap: 2px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14px; padding: 10px 12px 12px; border-bottom: 2.5px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--pink-deep); border-color: var(--pink); font-weight: 600; }
.tab .count { background: var(--pink); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; line-height: 17px; font-weight: 700; }

main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--ink-2); margin: 6px 0 0; max-width: 60ch; }
.script { font-family: var(--script); font-weight: 700; color: var(--pink); }

/* Surfaces */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.sub { color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.g-writer { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
@media (max-width: 1020px) { .g-side, .g-writer, .g-3 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .g-2 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hr { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--pink-soft); color: var(--pink-deep); }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.primary:hover { background: var(--pink-deep); border-color: var(--pink-deep); color: #fff; }
.btn.soft { background: var(--blush-2); border-color: transparent; color: var(--pink-deep); }
.btn.soft:hover { background: var(--blush); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); padding: 7px 10px; }
.btn.ghost:hover { color: var(--pink-deep); background: var(--blush-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.lg { padding: 13px 22px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--blush-2); color: var(--pink-deep); }
.icon-btn svg, .btn svg, .tab svg { width: 17px; height: 17px; flex: none; }

/* Forms */
.field { display: block; }
.field > span, .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field > span em { font-weight: 400; color: var(--muted); font-style: normal; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-2); background: #fff; border-radius: var(--r-sm);
  padding: 9px 12px; font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pink-soft); box-shadow: 0 0 0 3px rgba(200, 40, 95, .13); }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239E1A49'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.check { display: flex; gap: 9px; align-items: center; font-size: 14px; cursor: pointer; padding: 3px 0; }
.check input { width: 17px; height: 17px; accent-color: var(--pink); margin: 0; flex: none; }
.color-in { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; cursor: pointer; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--blush-2); color: var(--pink-deep); border-radius: 999px; padding: 4px 6px 4px 11px; font-size: 13px; font-weight: 500; }
.chip.flag { background: var(--warn-bg); color: var(--warn); }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; line-height: 1; }
.chip button:hover { background: rgba(158, 26, 73, .12); }
.chip-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line-2); background: #fff; border-radius: var(--r-sm); padding: 6px; }
.chip-input input { border: 0; outline: 0; flex: 1; min-width: 140px; padding: 4px 6px; background: transparent; }
.chip-input:focus-within { border-color: var(--pink-soft); box-shadow: 0 0 0 3px rgba(200, 40, 95, .13); }

/* Pills / status */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--cream-2); color: var(--ink-2); white-space: nowrap; }
.pill.active, .pill.approved, .pill.running { background: var(--good-bg); color: var(--good); }
.pill.draft, .pill.pending, .pill.planned { background: var(--blush-2); color: var(--pink-deep); }
.pill.paused, .pill.changes { background: var(--warn-bg); color: var(--warn); }
.pill.completed, .pill.archived, .pill.ended { background: #EEE8EA; color: var(--muted); }

/* Segmented */
.seg { display: inline-flex; background: var(--cream-2); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--pink-deep); font-weight: 600; box-shadow: 0 1px 3px rgba(158, 26, 73, .15); }

/* Overview */
.hello { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-bottom: 26px; }
.hello h1 { font-size: clamp(34px, 4.6vw, 54px); }
.hello .lede { color: var(--ink-2); font-size: 16.5px; margin-top: 10px; max-width: 52ch; }
.tagline-wrap { position: relative; padding: 18px 10px; text-align: center; }
.tagline-wrap::before { content: ""; position: absolute; inset: 18% 2% 14% 0; background: linear-gradient(100deg, rgba(249, 221, 229, 0) 0%, var(--blush) 12%, var(--blush) 78%, rgba(249, 221, 229, .2) 100%); border-radius: 40% 60% 55% 45% / 60% 40% 60% 40%; transform: rotate(-3deg); }
.tagline { position: relative; font-family: var(--script); font-weight: 700; color: var(--pink-deep); font-size: clamp(34px, 4.4vw, 54px); line-height: 1.02; transform: rotate(-4deg); display: inline-block; max-width: 13ch; }
.tagline-in { animation: write .9s ease-out both; }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (max-width: 820px) { .hello { grid-template-columns: 1fr; } .tagline-wrap { text-align: left; } }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 16px; }
.kpi .k-label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .k-label svg { width: 16px; height: 16px; color: var(--pink); }
.kpi .k-value { font-family: var(--serif); font-size: 28px; font-weight: 500; margin: 4px 0 2px; letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.delta { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.delta.good { color: var(--good); }
.delta.bad { color: var(--bad); }
.delta.flat { color: var(--muted); font-weight: 500; }
.delta small { color: var(--muted); font-weight: 400; }

.quick { display: grid; gap: 8px; }
.quick a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--r-md); text-decoration: none; color: var(--ink); background: var(--blush-2); font-weight: 600; font-size: 14.5px; }
.quick a:hover { background: var(--blush); color: var(--pink-deep); }
.quick a svg { width: 19px; height: 19px; color: var(--pink); }

.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
button.list-item { width: 100%; text-align: left; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer; font: inherit; }
button.list-item:hover .title { color: var(--pink-deep); }

/* Table-like rows */
.trows { display: grid; }
.trow { display: grid; grid-template-columns: minmax(0, 2fr) 110px minmax(0, 1.3fr) minmax(0, 1.4fr) 70px 110px; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); text-align: left; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; cursor: pointer; font: inherit; color: inherit; }
.trow.head { cursor: default; font-size: 12.5px; color: var(--muted); font-weight: 600; border-top: 0; padding-top: 4px; padding-bottom: 8px; }
.trow:not(.head):hover { background: var(--blush-2); }
.trow .name { font-weight: 600; font-family: var(--serif); font-size: 16.5px; }
.trows.card { padding: 10px 0; }
@media (max-width: 860px) {
  .trow { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .trow.head { display: none; }
  .trow > :nth-child(n+3) { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }
}

/* Empty state */
.empty { text-align: center; padding: 38px 20px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--ink-2); max-width: 46ch; margin: 0 auto 16px; }
.empty .script { font-size: 28px; display: block; margin-bottom: 4px; }

/* Creative tiles */
.creatives { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.ccard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.ccard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ccard .headline { font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.25; }
.ccard .copy { font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.ccard .actions { display: flex; gap: 4px; margin-top: auto; padding-top: 8px; align-items: center; }
.tile { position: relative; aspect-ratio: 4 / 5; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px; background-size: cover; background-position: center; }
.tile.sq { aspect-ratio: 1 / 1; }
.tile .t-head { font-family: var(--serif); font-weight: 600; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.08; letter-spacing: -.01em; position: relative; }
.tile .t-script { font-family: var(--script); font-weight: 700; font-size: 22px; position: relative; line-height: 1; margin-bottom: 6px; }
.tile .t-logo { position: absolute; top: 14px; left: 14px; height: 28px; max-width: 45%; object-fit: contain; }
.tile .t-brand { position: absolute; top: 14px; left: 16px; font-family: var(--serif); font-weight: 600; font-size: 14px; }
.tile .t-type { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.85); color: var(--ink); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 2px 8px; display: inline-flex; gap: 4px; align-items: center; }
.tile .t-type svg { width: 12px; height: 12px; }
.tile .t-list { list-style: none; padding: 0; margin: 10px 0 0; position: relative; font-size: 13.5px; display: grid; gap: 5px; }
.tile .t-list li::before { content: "✓  "; font-weight: 700; }
.tile .t-problem { position: relative; font-size: 14px; opacity: .85; margin-bottom: 10px; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.tile .t-cta { position: relative; margin-top: 12px; align-self: flex-start; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.tile.photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(30, 10, 20, .7) 100%); }
.tile.photo { color: #fff; }

/* Library tabs */
.lib-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.lib-tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 500; color: var(--ink-2); border-bottom: 2.5px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.lib-tabs button[aria-selected="true"] { color: var(--pink-deep); border-color: var(--pink); font-weight: 600; }
.lib-tabs .n { font-size: 12px; color: var(--muted); }

/* Writer output */
.option { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.option.picked { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(200, 40, 95, .1); }
.option-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.option textarea, .option input[type="text"] { border: 0; padding: 0; width: 100%; resize: vertical; background: transparent; line-height: 1.55; min-height: 0; }
.option textarea:focus, .option input[type="text"]:focus { outline: none; }
.option .meta { font-size: 12px; color: var(--muted); }
.option.busy { opacity: .55; pointer-events: none; }
.radio-pick { display: inline-flex; gap: 7px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.radio-pick input { accent-color: var(--pink); margin: 0; }
.headline-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; }
.headline-opt input[type="text"] { font-weight: 600; font-family: var(--serif); font-size: 15.5px; }

.callout { border-radius: var(--r-md); padding: 13px 15px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.callout svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.callout.warn { background: var(--warn-bg); color: #6E3B08; }
.callout.bad { background: var(--bad-bg); color: #6E1424; }
.callout.good { background: var(--good-bg); color: #1D4F39; }
.callout.info { background: var(--blush-2); color: var(--pink-deep); }
.callout strong { display: block; }
.flags { display: grid; gap: 8px; }
.flag-item { border-left: 3px solid var(--warn); background: var(--warn-bg); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 9px 12px; font-size: 13.5px; color: #6E3B08; }
.flag-item.bad { border-color: var(--bad); background: var(--bad-bg); color: #6E1424; }
.flag-item b { font-weight: 700; }
.flag-item .rw { margin-top: 6px; background: rgba(255,255,255,.7); border-radius: 6px; padding: 7px 9px; color: var(--ink); }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.spinner.dark { border-color: var(--line-2); border-top-color: var(--pink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Audiences */
.aud-type { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--blush-2); color: var(--pink); flex: none; }
.aud-type svg { width: 19px; height: 19px; }
.size { font-family: var(--serif); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Budget */
details.budget { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
details.budget + details.budget { margin-top: 12px; }
details.budget summary { list-style: none; cursor: pointer; padding: 16px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto 24px; gap: 18px; align-items: center; }
details.budget summary::-webkit-details-marker { display: none; }
details.budget summary .chev { transition: transform .2s; color: var(--muted); }
details.budget[open] summary .chev { transform: rotate(180deg); }
details.budget .inner { padding: 0 20px 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.place-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.place-group h4 { font-family: var(--sans); font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
@media (max-width: 640px) { details.budget summary { grid-template-columns: 1fr 24px; } details.budget summary .hide-sm { display: none; } }

/* Calendar */
.cal-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; }
@media (max-width: 960px) { .cal-wrap { grid-template-columns: 1fr; } }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--paper); }
.cal .dow { font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--cream-2); }
.day { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; background: var(--paper); text-align: left; font: inherit; color: inherit; border-top: 0; border-left: 0; min-width: 0; }
.day:hover { background: var(--blush-2); }
.day.out { background: #FBF6F3; color: var(--muted); }
.day.drop { background: var(--blush); outline: 2px dashed var(--pink); outline-offset: -4px; }
.day .dnum { font-size: 13px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.day.today .dnum { background: var(--pink); color: #fff; }
.cbar { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.cbar.cont { color: transparent; }
.sched { font-size: 12px; background: #fff; border: 1px solid var(--line-2); border-left: 3px solid var(--pink); border-radius: 5px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; }
.more { font-size: 11.5px; color: var(--pink-deep); font-weight: 600; }
.palette { display: grid; gap: 8px; max-height: 560px; overflow-y: auto; }
.pchip { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; cursor: grab; font-size: 13px; }
.pchip:active { cursor: grabbing; }
.pchip .sw { width: 30px; height: 36px; border-radius: 6px; flex: none; background-size: cover; background-position: center; }
.pchip .t { font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 640px) {
  .day { min-height: 64px; padding: 4px; }
  .cbar, .sched { font-size: 0; height: 5px; padding: 0; border-width: 0; border-radius: 3px; background: var(--pink-soft); }
  .cal .dow { padding: 6px 4px; text-align: center; }
}

/* Chart */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: var(--pink); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; transform: translate(-50%, -118%); white-space: nowrap; box-shadow: 0 8px 20px -8px rgba(158, 26, 73, .6); }
.chart .tip small { display: block; font-weight: 400; opacity: .85; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td.num, table.data th.num { text-align: right; }

/* A/B */
.ab { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .ab { grid-template-columns: 1fr; } }
.ver { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; background: #fff; position: relative; }
.ver.win { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(200, 40, 95, .1); }
.ver .crown { position: absolute; top: -11px; right: 12px; background: var(--pink); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.metric-row { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.metric-row b { font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: var(--cream-2); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--pink); border-radius: 99px; }
.winner { margin-top: 14px; font-weight: 600; color: var(--pink-deep); display: flex; gap: 8px; align-items: center; }

/* Approvals */
.queue-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.queue-item:first-child { border-top: 0; padding-top: 0; }
.queue-item .tile { aspect-ratio: 4 / 5; padding: 8px; border-radius: 10px; }
.queue-item .tile .t-head { font-size: 12px; }
.queue-item .tile .t-script, .queue-item .tile .t-list, .queue-item .tile .t-problem, .queue-item .tile .t-cta, .queue-item .tile .t-type, .queue-item .tile .t-brand, .queue-item .tile .t-logo { display: none; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--pink); margin-top: 2px; flex: none; }
.task .grow { flex: 1; min-width: 0; }
.task.done .ttl { text-decoration: line-through; color: var(--muted); }
.due { font-size: 12.5px; color: var(--muted); }
.due.today { color: var(--pink-deep); font-weight: 600; }
.due.late { color: var(--bad); font-weight: 600; }

/* Settings */
.brand-card { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.brand-card.on { border-color: var(--pink); }
.swatches { display: flex; gap: 4px; }
.swatches i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); }
.logo-prev { width: 64px; height: 64px; border-radius: 14px; border: 1px dashed var(--line-2); display: grid; place-items: center; background: #fff center / contain no-repeat; color: var(--muted); font-size: 12px; flex: none; }

/* Drawer */
.drawer-wrap { position: fixed; inset: 0; z-index: 50; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(59, 36, 48, .32); animation: fade .2s ease-out; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--cream); box-shadow: -20px 0 50px -20px rgba(59, 36, 48, .35); display: flex; flex-direction: column; animation: slide .25s ease-out; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(18px + env(safe-area-inset-top, 0px)) 22px 14px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 30px; }
.drawer-foot { padding: 14px 22px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; align-items: center; background: var(--paper); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 500; animation: fade .2s ease-out; box-shadow: 0 10px 30px -10px rgba(59, 36, 48, .5); pointer-events: auto; max-width: 90vw; }
.toast.err { background: var(--bad); }

/* Auth + onboarding */
.full { min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; background:
  radial-gradient(1200px 500px at 85% -10%, var(--blush) 0%, rgba(249,221,229,0) 60%),
  radial-gradient(900px 500px at -10% 110%, var(--blush-2) 0%, rgba(252,237,241,0) 60%), var(--cream); }
.auth { width: min(420px, 100%); }
.auth .logo { font-size: 52px; margin-bottom: 6px; }
.auth .script { font-size: 30px; display: block; margin-bottom: 22px; transform: rotate(-2deg); }
.onb { width: min(620px, 100%); }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps i { height: 4px; flex: 1; border-radius: 99px; background: var(--line-2); }
.steps i.on { background: var(--pink); }
.onb h2 { font-size: 32px; margin-bottom: 6px; }
.onb .lede { color: var(--ink-2); margin-bottom: 20px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt { margin-top: 18px; }
.mt-s { margin-top: 10px; }
.nowrap { white-space: nowrap; }
@media (max-width: 640px) { main { padding: 20px 14px 70px; } .top-row { padding: 10px 14px 4px; gap: 10px; } .top-row .logo { font-size: 26px; } .save-state span { display: none; } .card { padding: 18px; } .brand-switch select { max-width: 110px; } }

:where(svg[aria-hidden="true"]) { width: 18px; height: 18px; flex: none; }
.g-writer { align-items: start; }
.tile { container-type: inline-size; }
.tile .t-head { font-size: clamp(15px, 10.5cqi, 30px); }
.tile .t-list { font-size: clamp(11px, 5.6cqi, 14px); }
.tile .t-problem { font-size: clamp(11px, 6cqi, 15px); }
.cbar { background: color-mix(in srgb, var(--c) 16%, #fff); color: var(--c); border-left: 3px solid var(--c); }
.cbar.cont { height: 5px; padding: 0; border-left: 0; border-radius: 3px; background: color-mix(in srgb, var(--c) 30%, #fff); }
@media (max-width: 1020px) { .quick-card { order: -1; } }
