/* Geppetto engine room. Brand: Signature Purple #5D2075, Blissful Pink #FF8DD0.
   Gonzaga is the brand headline face: drop gonzaga.woff2 into static/fonts and it is picked up. */
@font-face { font-family: "Gonzaga"; src: url("/static/fonts/gonzaga.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }

:root {
  --purple: #5D2075;
  --purple-ink: #2A1033;
  --purple-soft: #EFE4F3;
  --pink: #FF8DD0;
  --pink-soft: #FFE6F4;
  --page: #FAF6FC;
  --sheet: #FFFFFF;
  --line: #E6DCEB;
  --muted: #6E5D76;
  --pale: #F8E1BF;
  --choc: #4F2B1A;
  --straw: #EB3E53;
  --mint: #B3FFE1;
  --mango: #FF9A31;
  --blue: #4E86F7;
  --head: "Gonzaga", "Inter Tight", system-ui, sans-serif;
  --body: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--purple-ink); font: 15px/1.5 var(--body); }
a { color: var(--purple); }
img, video { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- frame ---------- */
.frame { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.rail { background: var(--purple); color: #fff; padding: 22px 0 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.rail .brand { padding: 0 22px 18px; }
.rail .brand img { width: 150px; }
.rail .brand small { display: block; margin-top: 6px; color: #E9D4F0; font-size: 13px; }
.rail nav a { display: flex; justify-content: space-between; align-items: center; padding: 9px 22px; color: #F3E8F7; text-decoration: none; font-weight: 500; position: relative; }
.rail nav a:hover { background: rgba(255,255,255,.07); }
.rail nav a.on { color: #fff; font-weight: 700; }
.rail nav a.on::before { content: ""; position: absolute; left: 0; top: 50%; width: 14px; height: 4px; background: var(--pink); transform: translateY(-50%) skewY(-18deg); }
.rail nav .count { background: var(--pink); color: var(--purple-ink); font-size: 12px; font-weight: 700; border-radius: 20px; padding: 0 8px; }
.rail .foot { margin-top: auto; padding: 14px 22px 0; font-size: 13px; color: #E9D4F0; }
.rail .foot form { display: inline; }
.rail .foot button { background: none; border: 0; color: #fff; text-decoration: underline; padding: 0; font: inherit; cursor: pointer; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--mint); }
.status-dot.down { background: var(--mango); }

main { padding: 30px 40px 80px; max-width: 980px; width: 100%; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
h1 { font: 800 34px/1.1 var(--head); letter-spacing: -0.01em; margin: 0; color: var(--purple); }
h1 + .slash, .slash { display: block; width: 120px; height: 5px; background: var(--pink); transform: skewY(-4deg); margin-top: 10px; border-radius: 2px; }
h2 { font: 700 20px/1.25 var(--head); margin: 32px 0 12px; color: var(--purple); }
h3 { font-size: 16px; margin: 0 0 6px; }
.lede { color: var(--muted); margin: 6px 0 0; max-width: 62ch; }

.flash { background: var(--pink-soft); border-left: 4px solid var(--pink); padding: 10px 14px; border-radius: 6px; margin-bottom: 18px; }
.banner { background: var(--choc); color: #fff; padding: 9px 40px; font-size: 14px; }
.banner.dry { background: var(--blue); }
.banner form { display: inline; }
.banner button { background: none; border: 1px solid #fff; color: #fff; border-radius: 6px; padding: 2px 10px; cursor: pointer; font: inherit; margin-left: 8px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a.on { color: var(--purple); border-color: var(--purple); font-weight: 700; }
.tabs a span { color: var(--muted); font-weight: 500; margin-left: 4px; }

/* ---------- buttons & forms ---------- */
button, .btn { font: 600 14px/1 var(--body); border-radius: 8px; padding: 10px 14px; border: 1px solid var(--line); background: var(--sheet); color: var(--purple-ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { border-color: var(--purple); }
.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.primary:hover { background: #4A185E; }
.quiet { background: transparent; border-color: transparent; color: var(--purple); padding-left: 6px; padding-right: 6px; }
.quiet:hover { text-decoration: underline; border-color: transparent; }
.danger { color: var(--straw); }
label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; font: 15px/1.45 var(--body); color: var(--purple-ink); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff; }
textarea { resize: vertical; }
textarea.post { font-size: 18px; min-height: 96px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.chars { font-size: 13px; color: var(--muted); text-align: right; }
.chars.over { color: var(--straw); font-weight: 700; }

/* ---------- draft sheet ---------- */
.draft { background: var(--sheet); border: 1px solid var(--line); border-left: 6px solid var(--pale); border-radius: var(--r); padding: 18px 20px 14px; margin-bottom: 16px; scroll-margin-top: 20px; }
.draft.h2 { border-left-color: var(--choc); }
.draft.h3 { border-left-color: var(--straw); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.heat { font-weight: 700; font-size: 12px; padding: 3px 9px; border-radius: 20px; background: var(--pale); color: var(--choc); }
.heat.h2 { background: var(--choc); color: #fff; }
.heat.h3 { background: var(--straw); color: #fff; }
.expiring { color: var(--straw); font-weight: 600; }
.post-text { font: 500 21px/1.42 var(--body); margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--purple-ink); }
.attach { display: flex; gap: 12px; align-items: center; margin: 0 0 12px; }
.attach img, .attach video { width: 132px; height: 132px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.reply-to { font-size: 14px; margin-bottom: 10px; }
.context { background: var(--page); border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 10px; }
.context p { margin: 0 0 6px; }
.context p:last-child { margin-bottom: 0; }
.context b { color: var(--purple); }
.sources { font-size: 13px; margin: 4px 0 0; padding-left: 18px; }
.alts { margin: 6px 0 10px; }
.alts summary, .more summary { cursor: pointer; color: var(--purple); font-weight: 600; font-size: 14px; }
.alt { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 15px; }
.alt:first-of-type { border-top: 0; }
.approvals { font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.approvals .ok { color: var(--purple); font-weight: 600; }
.approvals .ok::before { content: ""; display: inline-block; width: 12px; height: 3px; background: var(--pink); transform: skewY(-18deg); margin-right: 6px; vertical-align: middle; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.actions form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.actions .spacer { flex: 1; }
.panel { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.error { color: var(--straw); font-size: 14px; margin: 0 0 10px; }
.notes { margin-top: 10px; font-size: 14px; }
.note { padding: 6px 0; border-top: 1px dashed var(--line); }
.note .who { font-weight: 600; }
.note.internal .who::after { content: " (internal)"; color: var(--straw); font-weight: 500; }
.empty { background: var(--sheet); border: 1px dashed var(--line); border-radius: var(--r); padding: 28px; color: var(--muted); }

/* ---------- tables, lists ---------- */
.table-wrap { overflow-x: auto; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; color: var(--purple); background: var(--purple-soft); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.trend { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: start; }
.trend:last-child { border-bottom: 0; }
.trend .rank { font: 800 20px/1 var(--head); color: var(--purple); text-align: right; padding-top: 2px; }
.trend .name { font-weight: 700; font-size: 16px; }
.trend .sub { font-size: 13px; color: var(--muted); }
.trend .what { font-size: 14px; margin-top: 4px; }
.verdict { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: var(--purple-soft); color: var(--purple); white-space: nowrap; }
.verdict.off_menu { background: var(--straw); color: #fff; }
.verdict.drafted { background: var(--pink-soft); color: var(--purple-ink); }
.verdict.error { background: var(--mango); color: var(--purple-ink); }
.box { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); }
.box.pad { padding: 16px 18px; }

.grid-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tile .thumb { aspect-ratio: 1 / 1; background: var(--purple-soft); }
.tile .thumb img, .tile .thumb video { width: 100%; height: 100%; object-fit: cover; }
.tile .body { padding: 10px 12px 12px; font-size: 13px; }
.tile .body b { font-size: 14px; }

.day { margin-bottom: 22px; }
.day h3 { font: 700 17px/1.3 var(--head); color: var(--purple); margin-bottom: 8px; }
.slot { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: start; }
.slot:last-child { border-bottom: 0; }
.slot .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.state { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.state.posted { background: var(--mint); color: var(--purple-ink); }
.state.approved { background: var(--purple); color: #fff; }
.state.pending { background: var(--pale); color: var(--choc); }

.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 70px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
.bar .track { height: 12px; background: var(--purple-soft); border-radius: 6px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--purple); }
.bar.best .fill { background: var(--pink); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--purple); }
.login .sheet { background: #fff; border-radius: 14px; padding: 30px 28px; width: 100%; max-width: 380px; }
.login img { width: 170px; margin-bottom: 6px; }
.login p { color: var(--muted); margin: 0 0 14px; }
.login button { width: 100%; justify-content: center; margin-top: 18px; padding: 12px; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .rail { min-width: 0; }
  .rail { position: static; height: auto; padding: 12px 0 0; }
  .rail .brand { padding: 0 16px 8px; display: flex; align-items: center; justify-content: space-between; }
  .rail .brand img { width: 110px; }
  .rail .brand small { margin: 0; }
  .rail nav { display: flex; overflow-x: auto; }
  .rail nav a { padding: 10px 14px; white-space: nowrap; gap: 6px; }
  .rail nav a.on::before { left: 14px; right: 14px; top: auto; bottom: 4px; width: auto; height: 3px; transform: skewY(-3deg); }
  .rail .foot { display: none; }
  main { padding: 20px 16px 60px; }
  h1 { font-size: 27px; }
  .post-text { font-size: 19px; }
  .draft { padding: 14px 14px 12px; }
  .split { grid-template-columns: 1fr; }
  .banner { padding: 8px 16px; }
  .trend { grid-template-columns: 30px 1fr; }
  .trend .act { grid-column: 2; }
}

.tools { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 10px; }
.tools details[open] { flex-basis: 100%; }
.tools details[open] > summary { margin-bottom: 4px; }
.note-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.note-form input[type=text] { flex: 1; min-width: 180px; }
.note-form label { margin: 0; display: flex; gap: 4px; align-items: center; font-weight: 500; }
.meta > span { overflow-wrap: anywhere; }
@media (max-width: 860px) { .actions select { max-width: 100%; } .actions form { flex-wrap: wrap; } }
