/* Design the show (docs/09-set-constructor.md, M5): the big monitor beside OBS, or a phone. */
:root {
  --bg: #0f0e1a; --panel: #17162a; --card: #1e1c36; --line: #2e2b52; --text: #ecebff;
  --muted: #9a97c4; --accent: #38e1ff; --accent2: #7a5cff; --ok: #4cff8f; --warn: #ffb23f; --bad: #ff6b78; --gold: #f6c945;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 18px/1.4 "Segoe UI", system-ui, sans-serif; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }

.login { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, #241f4a, var(--bg) 70%); z-index: 30; padding: 16px; }
.login-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login-card p { margin: 0; }
.login-card label { display: flex; flex-direction: column; gap: 6px; }
.login-card input { background: #13122a; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.brand { font-weight: 800; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #0f0e1a; font-weight: 900; }
.primary { border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 800; background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #0f0e1a; }
.primary:disabled { opacity: .4; cursor: default; }
.ghost { background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; color: var(--muted); }
.err { color: var(--bad); min-height: 1em; }

.design { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.top { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.back { color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }
.title { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.title b { font-size: 20px; }
.title .muted { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { background: none; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 42px; font-size: 18px; }

.cols { flex: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; min-height: 0; }
.talkcol { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px; border-right: 1px solid var(--line); min-height: 0; }
.plancol { padding: 18px 20px 24px; overflow: auto; }

/* The conversation, newest at the bottom. */
.feed { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 12px; min-height: 200px; max-height: calc(100dvh - 330px); padding-right: 4px; }
.msg { max-width: 92%; border-radius: 16px; padding: 10px 14px; }
.msg.you { align-self: flex-end; background: #2a2650; border-bottom-right-radius: 4px; }
.msg.him { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .who { display: block; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.msg.him .who { color: var(--accent); }
.msg.bad { border-color: rgba(255, 107, 120, .6); }
.msg.bad .said { color: var(--bad); }
.msg.working .said::after { content: "…"; animation: dots 1.2s steps(4) infinite; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }
.changes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.changes span { font-size: 13px; padding: 2px 8px; border-radius: 999px; background: rgba(56, 225, 255, .1); color: var(--accent); border: 1px solid rgba(56, 225, 255, .25); }
.changes span.ship { background: rgba(76, 255, 143, .12); color: var(--ok); border-color: rgba(76, 255, 143, .35); }
.ask { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ask b { width: 100%; font-weight: 600; }
.ask button { border: 1px solid var(--accent); background: rgba(56, 225, 255, .08); border-radius: 999px; padding: 8px 16px; color: var(--accent); font-weight: 600; }

.typed { display: flex; gap: 8px; }
.typed input { flex: 1; min-width: 0; background: #13122a; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.typed button { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 0 16px; }
.talk { position: relative; border: 0; border-radius: 16px; padding: 18px; font-size: 22px; font-weight: 800; background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #0f0e1a; touch-action: none; user-select: none; -webkit-user-select: none; overflow: hidden; }
.talk.rec { background: #ff3b4e; color: #fff; }
.talk:disabled { opacity: .5; cursor: default; }
.talk .meter { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(0, 0, 0, .2); }
.talk .meter i { display: block; height: 100%; width: 0; background: #fff; }
.note { margin: 0; font-size: 14px; color: var(--muted); min-height: 1.2em; }
.note.bad { color: var(--bad); }

/* The plan, as it is now. */
.planhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.planhead h2 { margin: 0; font-size: 26px; }
.state { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; background: var(--card); color: var(--muted); border: 1px solid var(--line); }
.state.approved { color: var(--ok); border-color: rgba(76, 255, 143, .4); }
.state.live { color: #fff; background: #d81f3a; border-color: #d81f3a; }
.plan h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 6px; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plan li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 16px; }
.plan li .when { color: var(--muted); font-size: 14px; }
.plan li .brief { display: block; color: var(--muted); font-size: 14px; font-style: italic; }
.plan .facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.plan .facts span { font-size: 14px; padding: 3px 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); }
.tier { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 1px 7px; border-radius: 6px; margin-left: 6px; }
.tier.big { background: rgba(122, 92, 255, .25); color: #c9bcff; }
.tier.headline { background: rgba(246, 201, 69, .2); color: var(--gold); }
.n { display: inline-block; min-width: 2.2em; font-weight: 800; color: var(--accent); }
.actions { margin-top: 18px; display: flex; gap: 10px; }
.night { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.night iframe { width: min(100%, calc(72vh * 9 / 16)); aspect-ratio: 9 / 16; border: 1px solid var(--line); border-radius: 12px; background: #000; }

/* Stages being made: the candidates, the one kept, and why the rest weren't. */
.stagejobs { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.job { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.job .head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.job .head .muted { font-size: 14px; }
.job.failed { border-color: rgba(255, 107, 120, .6); }
.job .err { font-size: 14px; }
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 8px; }
.cand { position: relative; margin: 0; }
.cand img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; border: 2px solid transparent; display: block; opacity: .55; }
.cand.kept img { border-color: var(--ok); opacity: 1; }
.cand figcaption { font-size: 11px; color: var(--muted); line-height: 1.25; margin-top: 3px; }
.dress { margin-top: 18px; }
.dress h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px; }
.dress p { margin: 0 0 8px; font-size: 15px; }
.dress .cands { margin-bottom: 10px; }
.plan li .photo { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--accent); cursor: pointer; border: 1px dashed rgba(56, 225, 255, .4); border-radius: 8px; padding: 3px 9px; }
.plan li .photo.has { border-style: solid; color: var(--ok); border-color: rgba(76, 255, 143, .4); }
.cost { margin-top: 18px; }
.cost p { margin: 0 0 8px; font-size: 16px; }
.cost .facts { display: flex; flex-wrap: wrap; gap: 8px; }
.cost .facts span { font-size: 14px; padding: 3px 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); }
.cost .csv { display: inline-block; margin-top: 10px; text-decoration: none; font-size: 14px; }

/* A phone: one column, the talk button always at hand. */
@media (max-width: 820px) {
  body { font-size: 17px; }
  .top { padding: 10px 14px; }
  .cols { grid-template-columns: 1fr; }
  .talkcol { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px 16px; }
  .plancol { padding: 14px 16px 24px; }
  .feed { max-height: none; min-height: 120px; }
  .talk { position: sticky; bottom: 10px; z-index: 4; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
  .night iframe { width: 100%; }
}
