/* Phone view – the same world as the projector, in the CI's UI language: white divisions bled to the
   screen edges on a light grey ground, flush-left Extended headlines, black primary buttons, framed
   secondary ones, underlined inputs, 1px outline icons. 16px gutters, thumb-sized targets. */
:root { --ground: var(--g95); --fg: var(--black); --fg-2: var(--g30); --fg-3: var(--g40); --rule: var(--g85); }
html { background: var(--ground); }
body { background: var(--ground); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.5; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
::selection { background: var(--black); color: var(--white); }
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 60px; background: var(--white); border-bottom: 1px solid var(--rule); }
.top .brand-mark { font-size: 24px; color: var(--black); }
.top .t { flex: 1; min-width: 0; font-family: var(--wide); font-size: 13px; line-height: 1.35; }
.top .t b { display: block; font-weight: 700; }
.top .t span { color: var(--fg-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.langs { display: flex; flex: none; border: 1px solid var(--black); }
.langs button { font: inherit; font-family: var(--wide); font-size: 13px; border: 0; background: transparent; color: var(--black); padding: 6px 11px; min-height: 36px; min-width: 44px; cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--black); color: var(--white); }
.conn { width: 8px; height: 8px; background: var(--ok); flex: none; }
body.offline .conn { background: var(--err); }

main { padding: 8px 0 16px; display: grid; gap: 8px; max-width: 640px; margin: 0 auto; }
/* a panel is a white division, bled to the screen edges on phones */
.panel { background: var(--white); padding: 24px 16px; display: grid; gap: 14px; position: relative; }
.panel.cap { box-shadow: inset 0 3px 0 var(--black); }
.panel h2 { margin: 0; font-family: var(--display); font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -.005em; text-wrap: balance; }
.panel h3 { margin: 0; font-family: var(--display); font-size: 17px; font-weight: 700; line-height: 1.3; }
.panel p { margin: 0; color: var(--fg-2); }
.panel code { font-family: var(--mono); font-size: .9em; background: var(--g95); padding: 0 .3em; }
.now-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--wide); font-size: 13px; color: var(--fg-3); padding: 8px 16px 0; }
.now-head .blk { font-weight: 700; color: var(--fg-2); }
.now-head .live { display: inline-flex; align-items: center; gap: 8px; }
.now-head .live::before { content: ""; width: 8px; height: 8px; background: var(--red); }
.sub { margin: -8px 0 0; font-family: var(--wide); font-size: 14px; color: var(--fg-2) !important; }
.hint { font-size: 14px; color: var(--fg-3); }
.ok-msg { font-size: 14px; color: var(--ok); font-weight: 700; }
.err { font-size: 14px; color: var(--err); font-weight: 700; }

/* inputs: a label above an underline; multi-line fields sit in a fine frame */
label.f { display: grid; gap: 4px; font-family: var(--wide); font-size: 13px; color: var(--fg-3); }
input[type=text], input[type=email], input[type=url] { font: inherit; font-size: 16px; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--g50); border-radius: 0; background: transparent; color: var(--black); -webkit-appearance: none; appearance: none; caret-color: var(--black); }
input:focus { outline: none; border-bottom: 2px solid var(--black); padding-bottom: 9px; }
textarea { font: inherit; font-size: 16px; width: 100%; min-height: 112px; padding: 12px; border: 1px solid var(--g50); border-radius: 0; background: var(--white); color: var(--black); resize: vertical; line-height: 1.45; -webkit-appearance: none; appearance: none; }
textarea:focus { outline: none; border-color: var(--black); box-shadow: inset 0 0 0 1px var(--black); }
::placeholder { color: var(--g50); }
/* buttons: primary filled black, secondary framed, one primary per view */
.btn { font: inherit; font-family: var(--wide); font-size: 15px; border: 1px solid var(--black); border-radius: 0; padding: 12px 24px; cursor: pointer; background: var(--black); color: var(--white); min-height: 52px; min-width: 144px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--g80); border-color: var(--g80); color: var(--g40); }
.btn.ghost { background: transparent; color: var(--black); }
.btn.block { width: 100%; }
.linkbtn { font: inherit; font-family: var(--wide); font-size: 15px; border: 0; background: none; color: var(--black); padding: 12px 0; cursor: pointer; justify-self: start; }
.linkbtn::after { content: " →"; }

/* votes */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.scale button { font: inherit; font-family: var(--display); font-weight: 700; font-size: 20px; min-height: 56px; border: 1px solid var(--g70); background: var(--white); color: var(--black); cursor: pointer; }
.scale button[aria-pressed="true"] { background: var(--black); border-color: var(--black); color: var(--white); }
.scale-ends { display: flex; justify-content: space-between; gap: 12px; font-family: var(--wide); font-size: 13px; color: var(--fg-2); }
.choices { display: grid; gap: 4px; }
.choices button { font: inherit; text-align: left; padding: 14px 16px; min-height: 56px; border: 1px solid var(--g70); background: var(--white); color: var(--black); cursor: pointer; display: flex; align-items: center; gap: 14px; }
.choices button::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--g50); flex: none; }
.choices button[aria-pressed="true"] { border-color: var(--black); box-shadow: inset 0 0 0 1px var(--black); font-weight: 700; }
.choices button[aria-pressed="true"]::before { border-color: var(--black); background: var(--black); box-shadow: inset 0 0 0 4px var(--white); }
.qgroup { display: grid; gap: 8px; }
.qgroup + .qgroup { padding-top: 16px; border-top: 1px solid var(--rule); }

/* anonymous / named */
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--black); }
.seg button { font: inherit; font-family: var(--wide); font-size: 14px; border: 0; padding: 10px 8px; background: transparent; color: var(--black); cursor: pointer; min-height: 46px; }
.seg button[aria-pressed="true"] { background: var(--black); color: var(--white); }
.seg button:disabled { color: var(--g60); }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 16px 0; }
.panel .row, form.row { padding: 0; }
.row h3 { margin: 0; font-family: var(--display); font-size: 17px; }

/* posts: the wall's language, text under a fine rule */
.sortbar { display: flex; border: 1px solid var(--black); }
.sortbar button { font: inherit; font-family: var(--wide); font-size: 13px; border: 0; background: var(--white); padding: 7px 12px; min-height: 38px; cursor: pointer; color: var(--black); }
.sortbar button[aria-pressed="true"] { background: var(--black); color: var(--white); }
.posts { display: grid; gap: 0; background: var(--white); padding: 0 16px; }
.posts > .hint { padding: 20px 0; }
.post { padding: 16px 0 14px; display: grid; gap: 10px; border-top: 1px solid var(--rule); }
.post:first-child { border-top: 0; }
.post p { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.post .meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--wide); font-size: 12px; color: var(--fg-3); }
.post .who { font-weight: 700; color: var(--fg-2); }
.post .mine { color: var(--black); font-weight: 700; }
.post.answered { opacity: .55; }
.react { font: inherit; font-family: var(--wide); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 40px; border: 1px solid var(--black); background: var(--white); color: var(--black); cursor: pointer; white-space: nowrap; }
.react[aria-pressed="true"] { background: var(--black); color: var(--white); }
.badge-ok { color: var(--ok); font-weight: 700; }

/* commands */
.cmdlist { display: grid; gap: 14px; }
.cmditem { display: grid; gap: 6px; }
.cmditem .lab { font-family: var(--wide); font-size: 13px; font-weight: 700; color: var(--fg-2); }
.cmdbox { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; background: var(--black); overflow: hidden; }
.cmdbox code { display: block; background: none; color: var(--g95); padding: 12px; font-family: var(--mono); font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmdbox.prose { background: var(--g95); }
.cmdbox.prose code { color: var(--black); font-family: var(--font); font-size: 15px; }
.cmdbox.trap { box-shadow: inset 4px 0 0 var(--red); }
.cmdbox button { font: inherit; font-family: var(--wide); font-size: 13px; border: 0; border-left: 1px solid var(--g30); background: var(--black); color: var(--white); padding: 0 14px; cursor: pointer; min-width: 84px; }
.cmdbox.prose button { background: var(--g95); color: var(--black); border-left-color: var(--g80); }
.cmdbox button.done { color: var(--ok-d); }
.cmdbox.prose button.done { color: var(--ok); }

/* lists */
.steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.steps li { padding: 12px 0; border-top: 1px solid var(--rule); }
.steps li:first-child { border-top: 0; padding-top: 2px; }
.steps b { display: block; font-family: var(--display); }
.steps span { color: var(--fg-2); font-size: 15px; }
.sched { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.sched li { display: grid; grid-template-columns: 104px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 15px; position: relative; }
.sched li:first-child { border-top: 0; }
.sched li .tm { font-family: var(--wide); font-size: 13px; color: var(--fg-3); font-variant-numeric: tabular-nums; padding-top: 2px; }
.sched li.brk { color: var(--fg-3); }
.sched li.cur { font-weight: 700; }
.sched li.cur::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 4px; background: var(--red); }
.sched li.cur .tm { color: var(--black); }
.series { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.series li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: baseline; font-size: 15px; padding: 10px 0; border-top: 1px solid var(--rule); position: relative; }
.series li:first-child { border-top: 0; }
.series li .n { font-family: var(--display); font-weight: 700; }
.series li small { display: block; color: var(--fg-3); font-size: 13px; }
.series li.cur { font-weight: 700; }
.series li.cur::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 4px; background: var(--red); }
.countdown { font-family: var(--display); font-weight: 700; font-size: 56px; line-height: 1; font-variant-numeric: tabular-nums; }
.bigq { font-family: var(--display); font-size: 22px; line-height: 1.28; font-weight: 700; margin: 0; text-wrap: balance; }
.who-tag { justify-self: start; font-family: var(--wide); font-size: 13px; font-weight: 700; color: var(--black); }

/* join */
.join-wrap { min-height: calc(100vh - 40px); min-height: calc(100dvh - 40px); display: grid; align-content: center; gap: 8px; }
.join-wrap > .row { padding: 0 16px 16px; }
.join-hero { display: grid; gap: 12px; padding: 0 16px 16px; }
.join-hero .brand-mark { font-size: 32px; margin-bottom: 8px; }
.join-hero h1 { margin: 0; font-family: var(--display); font-size: 34px; line-height: 1.1; font-weight: 700; }
.join-hero p { margin: 0; color: var(--fg-2); font-size: 16px; }
.join-wrap .linkbtn { padding-left: 16px; }
.privacy { font-size: 13px !important; color: var(--fg-3) !important; line-height: 1.5; }
.nudge { display: flex; align-items: center; gap: 12px; background: var(--black); color: var(--white); padding: 14px 16px; font-size: 14px; }
.nudge button { margin-left: auto; flex: none; font: inherit; font-family: var(--wide); font-size: 14px; border: 0; background: var(--white); color: var(--black); padding: 9px 16px; min-height: 42px; cursor: pointer; }

/* tabs: 1px outline icons, the chosen one underlined */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(var(--tabs, 4), 1fr); background: var(--white); border-top: 1px solid var(--rule); padding: 0 4px env(safe-area-inset-bottom); }
.tabs button { font: inherit; font-family: var(--wide); font-size: 11px; border: 0; border-top: 2px solid transparent; background: none; color: var(--fg-3); padding: 8px 2px 6px; display: grid; justify-items: center; gap: 4px; cursor: pointer; min-height: 60px; }
.tabs button svg { width: 24px; height: 24px; }
.tabs button[aria-selected="true"] { color: var(--black); border-top-color: var(--black); }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.meet { display: flex; align-items: center; gap: 12px; background: var(--white); padding: 16px; }
.meet div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.meet b { font-family: var(--display); font-size: 16px; }
.meet span { font-size: 14px; color: var(--fg-2); }
.meet .btn { flex: none; min-height: 46px; min-width: 0; padding: 10px 18px; }
.series .look { display: inline-flex; align-items: center; margin-top: 6px; min-height: 38px; padding: 6px 14px; border: 1px solid var(--black); color: var(--black); font-family: var(--wide); font-size: 13px; text-decoration: none; }

/* on a wider screen the divisions keep a margin of grey around them */
@media (min-width: 672px) { main { padding-top: 16px; gap: 12px; } .now-head, .row { padding-left: 0; padding-right: 0; } }

/* ---------- code examples in your own programming language ---------- */
@media (min-width: 900px) { main.wide { max-width: 940px; } }
.ltabs { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; border-bottom: 1px solid var(--rule); }
.ltabs::-webkit-scrollbar { display: none; }
.ltabs button { flex: none; font: inherit; font-family: var(--wide); font-size: 14px; min-height: 44px; padding: 8px 0; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--fg-3); cursor: pointer; }
.ltabs button[aria-pressed="true"] { color: var(--black); border-bottom-color: var(--black); font-weight: 700; }
.codeblk { background: var(--black); overflow: hidden; min-width: 0; }
.codeblk .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 0 12px; border-bottom: 1px solid var(--g20); }
.codeblk .bar span { font-family: var(--mono); font-size: 12px; color: var(--g60); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codeblk .bar button { flex: none; font: inherit; font-family: var(--wide); font-size: 13px; border: 0; border-left: 1px solid var(--g20); background: var(--black); color: var(--white); padding: 0 14px; min-height: 40px; min-width: 84px; cursor: pointer; }
.codeblk .bar button.done { color: var(--ok-d); }
.codeblk pre { margin: 0; padding: 12px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.55; color: var(--g95); tab-size: 2; }
.codeblk.prose { background: var(--g95); }
.codeblk.prose .bar { border-bottom-color: var(--g85); }
.codeblk.prose .bar span { color: var(--fg-3); }
.codeblk.prose .bar button { background: var(--g95); color: var(--black); border-left-color: var(--g85); }
.codeblk.prose .bar button.done { color: var(--ok); }
.codeblk.prose pre { white-space: pre-wrap; font-family: var(--font); font-size: 15px; color: var(--black); }
.steps .cell { display: block; font-size: 15px; color: var(--fg-2); }
.steps .cell i { font-style: normal; color: var(--fg-3); font-size: 13px; }
.steps b.ok, .steps .cell b.ok { display: inline; color: var(--ok); }
.steps b.bad, .steps .cell b.bad { display: inline; color: var(--err); }
.steps b.mixed, .steps .cell b.mixed { display: inline; color: var(--fg-2); }
.codeblk .kw { color: var(--white); font-weight: 700; }
.codeblk .st { color: var(--ok-d); }
.codeblk .nu { color: var(--warn); }
.codeblk .pr { color: var(--g80); }
.codeblk .va { color: var(--err-d); }
.codeblk .ty { color: var(--g90); }
.codeblk .fn { color: var(--white); }
.codeblk .cm, .codeblk .cm * { color: var(--g50); font-weight: 400; }
.ltabs .plain { margin-right: 4px; }
.plainbox { display: grid; gap: 12px; }
.plainbox .copycmd { justify-self: start; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.flow li { position: relative; background: var(--g95); padding: 12px 14px 12px 40px; font-size: 16px; line-height: 1.45; color: var(--black); }
.flow li::before { content: ""; position: absolute; left: 16px; top: 19px; width: 10px; height: 10px; background: var(--black); }
.flow li + li::after { content: ""; position: absolute; left: 20px; top: -8px; width: 2px; height: 8px; background: var(--black); }
.flow li.branch::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--black); }
.flow code { font-family: var(--mono); font-size: .9em; background: var(--white); padding: 0 .3em; }

/* a board slide's points, and the room's answer after you voted */
.board-sum li { display: grid; gap: 2px; }
.board-sum li span { display: block; }
.board-sum li .li { position: relative; padding-left: 14px; }
.board-sum li .li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; background: var(--red); }
.board-sum li.gh b { font-size: 15px; color: var(--fg-2); }
.res { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--rule); }
.res-h { font-family: var(--wide); font-size: 13px; color: var(--fg-3) !important; }
.res-r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; font-size: 15px; }
.res-r b { font-family: var(--display); font-variant-numeric: tabular-nums; }
.res-r i { grid-column: 1 / -1; height: 8px; background: var(--g90); position: relative; overflow: hidden; }
.res-r i::after { content: ""; position: absolute; inset: 0; background: var(--black); transform-origin: left center; transform: scaleX(var(--p)); transition: transform .6s var(--ease); }
