:root {
  --bg: #e8ecf0;
  --panel: #dfe4e9;
  --paper: #ffffff;
  --ink: #0f1318;
  --muted: #5f6873;
  --line: #cfd6dd;
  --blue: #1f3b73;
  --blue-soft: #e4eaf6;
  --live: #d8322a;
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid rgba(31, 59, 115, 0.45); outline-offset: 2px; }

/* brand */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.brand.small { font-size: 15px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(216, 50, 42, 0.15); }
.dot.off { background: var(--muted); box-shadow: none; }

/* landing */
.landing { min-height: 100vh; padding: 28px clamp(20px, 5vw, 72px) 56px; display: flex; flex-direction: column; gap: 40px; max-width: 1100px; margin: 0 auto; }
.hero { display: flex; flex-direction: column; gap: 18px; padding-top: 24px; }
.hero h1 { font-size: clamp(30px, 4vw, 52px); line-height: 1.06; letter-spacing: -0.025em; font-weight: 700; margin: 0; max-width: 20ch; }
.hero .sub { font-size: 18px; line-height: 1.5; color: var(--muted); margin: 0; max-width: 56ch; }
.start { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.field { display: flex; align-items: stretch; background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 18px; max-width: 640px; transition: border-color 120ms; }
.field:focus-within { border-color: var(--blue); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 20px; padding: 12px 6px; color: var(--ink); }
.field input::placeholder { color: #a5adb6; }
.field button { border: 0; border-radius: 11px; background: var(--blue); color: #fff; font-weight: 600; font-size: 17px; padding: 0 24px; cursor: pointer; white-space: nowrap; }
.field button:hover { background: #17305f; }
.field button:disabled { opacity: 0.6; cursor: progress; }
.under { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; max-width: 640px; }
.platforms { display: flex; gap: 6px; }
.platforms label { cursor: pointer; }
.platforms input { position: absolute; opacity: 0; width: 0; height: 0; }
.platforms span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 14px; color: var(--muted); }
.platforms input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.platforms input:focus-visible + span { outline: 3px solid rgba(31, 59, 115, 0.45); outline-offset: 2px; }
.msg { min-height: 1.3em; margin: 0; font-size: 15px; color: var(--live); }
.kinds { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: 640px; }
.kinds .kLabel { font-size: 14px; color: var(--muted); margin-right: 6px; }
.kinds label { cursor: pointer; }
.kinds input { position: absolute; opacity: 0; width: 0; height: 0; }
.kinds span:not(.kLabel) { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 14px; color: var(--muted); }
.kinds input:checked + span { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.kinds input:focus-visible + span { outline: 3px solid rgba(31, 59, 115, 0.45); outline-offset: 2px; }
.more { max-width: 640px; }
.more summary { cursor: pointer; color: var(--blue); font-size: 15px; list-style: none; padding: 2px 0; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; display: inline-block; width: 18px; font-weight: 600; }
.more[open] summary::before { content: "–"; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.grid label:first-child { grid-column: 1 / -1; }
.grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.grid input { background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 16px; color: var(--ink); outline: 0; }
.grid input:focus { border-color: var(--blue); }
.fine { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
button.quiet { background: transparent; border: 1.5px solid var(--line); color: var(--ink); border-radius: 10px; padding: 8px 14px; font-size: 15px; cursor: pointer; }
button.quiet:hover { border-color: var(--muted); }

/* showcase: the real live view, running on canned comments */
.showcase { display: flex; flex-direction: column; }
.frame { background: var(--paper); border-radius: 22px; padding: 10px; box-shadow: 0 1px 0 rgba(15, 19, 24, 0.06), 0 30px 60px -30px rgba(15, 19, 24, 0.45); border: 1px solid var(--line); }
.frameBar { display: flex; align-items: center; gap: 10px; padding: 6px 10px 12px; font-size: 14px; color: var(--muted); }
.dot.small { width: 8px; height: 8px; box-shadow: 0 0 0 3px rgba(216, 50, 42, 0.15); }
.frame iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; background: var(--bg); }

/* the card, base */
.card { background: var(--paper); border-radius: 22px; padding: 28px 32px; box-shadow: 0 1px 0 rgba(15, 19, 24, 0.06), 0 18px 40px -24px rgba(15, 19, 24, 0.35); display: flex; flex-direction: column; gap: 10px; }
.card .kind { font-size: 14px; color: var(--muted); }
.card .who { font-size: 17px; color: var(--muted); }
.card .text { font-size: clamp(30px, 4vw, 56px); line-height: 1.04; letter-spacing: -0.02em; font-weight: 700; overflow-wrap: anywhere; text-wrap: balance; }
.card .do { display: flex; gap: 12px; align-items: baseline; font-size: clamp(20px, 2.3vw, 30px); line-height: 1.28; color: var(--blue); margin-top: 8px; font-weight: 600; letter-spacing: -0.01em; }
.card .do span { flex: none; font-size: 14px; font-weight: 500; color: var(--muted); }
.card .do em { font-style: normal; }
.card .why { font-size: 15px; line-height: 1.4; color: var(--muted); padding-left: 34px; }
.card.lull { background: var(--blue-soft); }
.card.lull .do { font-size: clamp(22px, 2.6vw, 34px); }

/* channel switcher in the live bar */
.chan { position: relative; }
.chanBtn { display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 8px; font-size: 15px; color: var(--ink); cursor: pointer; }
.chanBtn:hover { border-color: var(--muted); }
.chanBtn .pf { font-size: 12px; font-weight: 600; color: #fff; background: var(--ink); border-radius: 999px; padding: 2px 8px; }
.chanBtn .name { font-weight: 600; }
.chanBtn .chev { color: var(--muted); line-height: 0; }
.chanForm { position: absolute; top: calc(100% + 8px); left: 0; z-index: 5; width: min(440px, 88vw); background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: 0 18px 40px -20px rgba(15, 19, 24, 0.4); display: flex; flex-direction: column; gap: 10px; }
.chanForm .field.small { padding: 4px 4px 4px 12px; border-radius: 12px; }
.chanForm .field.small input { font-size: 16px; padding: 8px 4px; }
.chanForm .field.small button { font-size: 15px; padding: 0 16px; border-radius: 9px; }
.chanForm .msg { font-size: 14px; min-height: 0; }

/* live view */
.live { height: 100vh; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.bar { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 15px; }
.bar .status { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .quota { font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: minmax(280px, 2fr) 3fr; gap: 16px; flex: 1; min-height: 0; }
.stream { background: var(--panel); border-radius: 18px; padding: 10px; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: #b9c2cc transparent; }
.stream::-webkit-scrollbar { width: 8px; }
.stream::-webkit-scrollbar-thumb { background: #b9c2cc; border-radius: 8px; }
.stream ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.stream li { font-size: 16px; line-height: 1.35; padding: 8px 12px; border-radius: 10px; overflow-wrap: anywhere; border-left: 3px solid transparent; }
.stream li .u { color: var(--muted); margin-right: 8px; }
.stream li.picked { background: var(--blue-soft); border-left-color: var(--blue); }

/* card stream: newest on top, older ones settle below */
.cards { overflow-y: auto; min-height: 0; padding: 2px 4px 24px 2px; scrollbar-width: thin; scrollbar-color: #b9c2cc transparent; }
.cards ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cards .card { will-change: transform; transition: transform 320ms cubic-bezier(.2,.7,.2,1), opacity 320ms ease, padding 320ms ease; }
.cards .card.now { min-height: 42vh; justify-content: center; }
.cards .card.now.empty .who { font-size: 20px; }
.cards .card.past { padding: 16px 20px; gap: 4px; box-shadow: 0 1px 0 rgba(15, 19, 24, 0.05); opacity: 0.86; }
.cards .card.past .text { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.cards .card.past .do { font-size: 16px; margin-top: 2px; }
.cards .card.past .why { display: none; }
.cards .card.past .kind { display: none; }
.cards .card.enter { animation: push 360ms cubic-bezier(.2,.7,.2,1); }
@keyframes push { from { opacity: 0; transform: translateY(-28px) scale(0.985); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }

/* wrap */
.wrap { max-width: 560px; display: flex; flex-direction: column; gap: 18px; }
.wrap h1 { font-size: clamp(34px, 4.4vw, 58px); letter-spacing: -0.025em; line-height: 1.02; margin: 0; }
.wrap p { font-size: 18px; color: var(--muted); margin: 0; }
.wrap .field button { padding: 0 16px; }
.wrap button.quiet { align-self: flex-start; }

@media (max-width: 700px) {
  .bar { flex-wrap: wrap; row-gap: 8px; }
  .bar .status { flex-basis: 100%; order: 9; }
  .cols { grid-template-columns: 1fr; grid-template-rows: 58vh 1fr; }
  .cards { order: -1; }
  .cards .card.now { min-height: 0; padding: 22px; }
  .field { padding-left: 14px; }
  .field input { font-size: 18px; }
  .field button { padding: 0 14px; font-size: 15px; }
  .grid { grid-template-columns: 1fr; }
  .frame iframe { aspect-ratio: 9 / 14; }
  .field { flex-direction: column; padding: 6px; gap: 6px; }
  .field button { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .cards .card, .cards .card.enter { animation: none; transition: none; }
}
/* demo mode inside the landing frame */
.demo-mode .live { height: 100%; min-height: 0; padding: 12px; }
.demo-mode .bar .quota, .demo-mode .bar #end, .demo-mode .bar .chan .chev { display: none; }
.demo-mode .chanBtn { pointer-events: none; }
.demo-mode .bar .demoTag { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
html.demo-mode, .demo-mode body { height: 100%; }
