/* The BTC presenter's broadcast room, selected A (F60): a 320 x 208 room scaled to the card's width, the line under
   it, then Next line, Play and Pause. Scoped to the presenter; the chart's geometry stays in home.css. */

/* Before the reporter mounts, the empty slot holds the room's box, the line's three lines and the controls' row, so
   the card does not grow under the reader when it fills (it grew 236 px at 390 and the scroll anchor moved the price
   off the screen, where it never asked for a quote). Without scripts there is no presenter, so no slot. */
.js .slip.btc .btc-reporter:not([data-btc-studio]) { display: block; min-height: 0; }
.js .slip.btc .btc-reporter:not([data-btc-studio])::before { content: ""; display: block; aspect-ratio: 320 / 208; }
.js .slip.btc .btc-reporter:not([data-btc-studio])::after { content: ""; display: block; height: calc(12px + 72px + 12px + 44px); }
html:not(.js) .slip.btc .btc-reporter:empty { display: none; }

.slip.btc .btc-reporter[data-btc-studio] { display: block; min-height: 0; }
.slip.btc [data-btc-studio] .btc-studio {
  position: relative; width: 100%; height: auto; aspect-ratio: 320 / 208; overflow: hidden;
  border-radius: 7px; background: #081239; isolation: isolate;
}

/* the full-room still until the frames are in, then the backdrop and the host drawn on canvases */
.btc-studio-fallback, .btc-studio-backdrop, .btc-studio-host {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; image-rendering: pixelated;
}
.btc-studio-fallback, .btc-studio-backdrop { z-index: 0; }
.btc-studio-host { z-index: 2; }
.btc-studio-fallback[data-persona="professional"] { display: none; }
html[data-lang="li"] .btc-studio-fallback[data-persona="playful"] { display: none; }
html[data-lang="li"] .btc-studio-fallback[data-persona="professional"] { display: block; }
/* once ready, no still in any view (the persona attribute outranks the professional view's rule above) */
.btc-studio[data-ready="true"] .btc-studio-fallback[data-persona] { display: none; }
.btc-studio:not([data-ready="true"]) .btc-studio-backdrop,
.btc-studio:not([data-ready="true"]) .btc-studio-host { visibility: hidden; }

/* the two screens on the wall behind the host */
.btc-studio-wall { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.btc-studio-monitor {
  position: absolute; top: 23%; width: 25%; height: 31%; padding: 3.2% 1.8% 1%;
  border: 1px solid #69edff; border-radius: 3px; background: #061720; color: #69edff; box-shadow: 0 0 6px #40dcec42;
}
.btc-studio-monitor::after {
  content: ""; position: absolute; bottom: -5%; left: 38%; width: 24%; height: 5%; background: #233744; border: 1px solid #41616b;
}
.btc-studio-monitor-left { left: 2.5%; }
.btc-studio-monitor-right { right: 2.5%; color: #ed9dff; border-color: #ed9dff; box-shadow: 0 0 6px #bd51e442; }
.btc-studio-monitor-title { position: absolute; left: 6%; top: 7%; font: 700 clamp(5px, .55vw, 9px)/1 monospace; color: inherit; letter-spacing: 0; }
.btc-studio-signal { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; overflow: visible; }
.btc-studio-grid { stroke-width: .5; opacity: .22; }
.btc-studio-bars { display: flex; align-items: end; justify-content: space-around; height: 100%; gap: 5%; padding: 18% 6% 0; }
.btc-studio-bars i { width: 13%; height: 38%; background: currentColor; }
.btc-studio-bars i:nth-child(2) { height: 65%; }
.btc-studio-bars i:nth-child(3) { height: 49%; }
.btc-studio-bars i:nth-child(4) { height: 87%; }
.btc-studio-bars i:nth-child(5) { height: 70%; }
.btc-studio[data-mode="professional"] .btc-studio-monitor { color: #b9dee0; border-color: #b9dee0; box-shadow: 0 0 5px #7ca8ae33; background: #082026; }

/* ON AIR, its lamp glowing while the quote is live */
.btc-studio-on-air {
  position: absolute; top: 4%; left: 2.5%; z-index: 3; display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px;
  border: 1px solid #f58c854d; border-radius: 3px; background: #740e20; color: #fff; font: 700 10px/1 var(--display); letter-spacing: .04em;
}
.btc-studio-dot { width: 5px; height: 5px; border-radius: 50%; background: #d8bab9; }
.slip.btc[data-broadcast-state="live"] .btc-studio-dot { background: #ffbba2; box-shadow: 0 0 7px #ff805c; animation: btc-studio-signal 4s ease-in-out infinite; }
.btc-studio[data-active="false"] .btc-studio-dot, .btc-studio[data-paused="true"] .btc-studio-dot { animation: none; }
@keyframes btc-studio-signal { 50% { box-shadow: 0 0 11px #ff805ca8; } }

/* the line: three lines' room for every approved line, so a new one moves nothing below */
.slip.btc [data-btc-studio] .btc-reporter-line {
  margin: 12px 0 0; min-block-size: 4.5em; font: 500 16px/1.5 var(--display); text-transform: none; letter-spacing: normal;
}

/* Next line, Play, Pause or Resume: one row of three, in English in every view */
.btc-studio-controls { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.slip.btc .btc-studio-controls button {
  display: block; min-width: 0; min-height: 44px; margin: 0; padding: 10px 5px; appearance: none;
  border: 1px solid var(--btc-broadcast-rule); border-radius: 4px; background: transparent; color: var(--box-ink);
  font: 600 13px/1.2 var(--display); letter-spacing: 0; text-transform: none; cursor: pointer;
}
.slip.btc .btc-studio-controls button:focus-visible { outline: 2px solid var(--box-ink); outline-offset: 3px; }
.slip.btc .btc-studio-controls button[aria-pressed="true"] { background: #263847; color: #fff; }
.slip.btc .btc-studio-controls button:disabled { opacity: .5; cursor: default; }
.btc-studio-controls [aria-pressed="true"] .btc-studio-pause, .btc-studio-controls [aria-pressed="false"] .btc-studio-resume { display: none; }
/* the new line said once to a screen reader, never shown (it showed as a narrow column under the buttons) */
.slip.btc .btc-studio-controls .btc-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

@media (min-width: 1000px) {
  /* one presenter in every view (Mike on the preview, 8 Oct 2026: "size not the same, not feeling right"): the room,
     its line and the controls take a width set by the window, not by the card, so the playful and the professional
     card show the same room at the same scale; centred in the card */
  .slip.btc .btc-reporter { width: min(100%, clamp(320px, 26vw, 432px)); margin-inline: auto; }
  .js .slip.btc .btc-reporter:not([data-btc-studio])::after { height: calc(12px + 81px + 12px + 44px); }
  .slip.btc [data-btc-studio] .btc-reporter-line { font-size: 18px; }
  .btc-studio-on-air { font-size: 12px; padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .slip.btc .btc-studio-dot { animation: none !important; }
}

/* Option A (Mike picked it on the preview, 8 Oct 2026, after "size not the same, not feeling right"): on a desktop the
   broadcast card takes the whole row under its neighbours, the chart on the left and the presenter beside it at the
   window's width (above), the same in both views; the hot take (playful) or the two news items (professional) sit in
   their own row above. Phones and tablets stack as before. Nothing is left empty beside a taller box. */
@media (min-width: 1024px) {
  .posts-row > .btc { grid-column: 1 / -1; }
  .slip.btc[data-btc-broadcast] {
    display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 26vw, 432px); column-gap: 40px; align-items: start;
  }
  .slip.btc[data-btc-broadcast] > .btc-broadcast-head { grid-column: 1; grid-row: 1; }
  .slip.btc[data-btc-broadcast] > [data-btc] { grid-column: 1; grid-row: 2; }
  .slip.btc[data-btc-broadcast] > :not(.btc-broadcast-head, [data-btc], .btc-reporter) { grid-column: 1; }
  .slip.btc[data-btc-broadcast] > .btc-reporter { grid-column: 2; grid-row: 1 / span 2; width: 100%; margin: 0; }
  /* playful: the hot take across the row, its three takes side by side */
  html:not([data-lang="li"]) .posts-row > .pair > .takes { grid-column: 1 / -1; }
  /* a list still to be asked for (a page sent without its takes): each column holds the tallest take of the Editor's
     pool (worker/lines/takes.json) in the language on show, the
     middle column's 24 px sides, measured in Chrome: English 7 lines of the reading face at 1024 px, 6 from 1100, 5 from
     1280; 中文 6 at 1024, 5 from 1280, 4 from 1440. Fresh takes in one language move nothing (lesson 23); only a switch
     of language changes the height, as the visitor asked for it (Manager, 8 Oct 2026: no blank kept for the other
     language, F55) */
  html:not([data-lang="li"]) .posts-row .slip.takes .takes-list {
    --take-col-lines: 7;
    grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 0; max-width: none;
    min-height: calc(var(--take-col-lines) * 1.4em);
  }
  /* served with the page (home.css): the row fits its three */
  html:not([data-lang="li"]) .posts-row .slip.takes .takes-list[data-takes="served"] { min-height: 0; }
  html:not([data-lang="li"]) .posts-row .slip.takes .takes-list > li { padding-inline: 0 24px; }
  html:not([data-lang="li"]) .posts-row .slip.takes .takes-list > li + li {
    padding: 0 24px; border-top: 0; border-left: 2px dotted #8a877d;
  }
  html:not([data-lang="li"]) .posts-row .slip.takes .takes-list > li:last-child { padding-right: 0; }
  html:not([data-lang="li"]) .posts-row .slip.takes .takes-more { max-width: none; }
}
@media (min-width: 1024px) {
  html[data-lang="zh"] .posts-row .slip.takes .takes-list { --take-col-lines: 6; }
  /* a take is as tall as its own language here: the other language's words leave the cell instead of holding its
     height unseen (the .l2 cell keeps both so a switch moves nothing; here the switch may change the box) */
  html[data-lang="en"] .posts-row .slip.takes .takes-list > li > [data-l="zh"],
  html[data-lang="zh"] .posts-row .slip.takes .takes-list > li > [data-l="en"] { display: none; }
}
@media (min-width: 1100px) { html[data-lang="en"] .posts-row .slip.takes .takes-list { --take-col-lines: 6; } }
@media (min-width: 1280px) { html:not([data-lang="li"]) .posts-row .slip.takes .takes-list { --take-col-lines: 5; } }
@media (min-width: 1440px) { html[data-lang="zh"] .posts-row .slip.takes .takes-list { --take-col-lines: 4; } }
/* professional: the two news items side by side in their own row, the card under them */
@media (min-width: 900px) {
  html[data-home-view][data-lang="li"] .posts-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
  html[data-lang="li"] .posts-row > .pair:first-child > .ins { grid-column: 1; grid-row: 1; }
  html[data-lang="li"] .posts-row > .pair:last-child > .ins { grid-column: 2; grid-row: 1; }
  html[data-lang="li"] .posts-row > .btc { grid-column: 1 / -1; grid-row: 2; align-self: start; }
}

/* The professional view: the latest crypto news in the presenter's place (Mike, 8 Oct 2026: "on the professional site,
   just dun commentator for now, more a latest crypto news (from today)"). No presenter there at all (btc-reporter.js
   mounts none), and its reserved box goes too; the three items come from tools/site/crypto-news.json (build_zh.py). */
html[data-lang="li"] .slip.btc[data-btc-broadcast] .btc-reporter[data-btc-reporter] { display: none; }
.slip.btc .btc-news { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--btc-broadcast-rule); text-transform: none; letter-spacing: normal; }
.slip.btc .btc-news-title { margin: 0 0 12px; font: 600 13px/1.2 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--box-soft); }
.slip.btc .btc-news-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.slip.btc .btc-news-item + .btc-news-item { padding-top: 14px; border-top: 1px solid var(--btc-broadcast-rule); }
.slip.btc .btc-news-date { margin: 0 0 4px; font-size: 12px; color: var(--box-soft); }
.slip.btc .btc-news-head { margin: 0 0 6px; font: 600 16px/1.3 var(--display); letter-spacing: -.005em; }
.slip.btc .btc-news-text { margin: 0 0 6px; font: 400 14px/1.45 var(--display); }
.slip.btc .btc-news-source { margin: 0; font: 400 12px/1.4 var(--display); color: var(--box-soft); }
.slip.btc .btc-news-source a { color: inherit; }
@media (min-width: 1024px) {
  /* beside the chart where the presenter stands in the playful view; the items share the chart's height, so the card
     keeps option A's height and nothing is left under the list but the card's own padding */
  /* scoped to the professional view, or its display would outrank the playful view's [data-pro] hide (home.css) */
  html[data-lang="li"] .slip.btc[data-btc-broadcast] > .btc-news {
    grid-column: 2; grid-row: 1 / span 2; align-self: stretch; display: flex; flex-direction: column;
    margin: 0; padding: 0; border-top: 0;
  }
  .slip.btc[data-btc-broadcast] > .btc-news > .btc-news-list { flex: 1; align-content: space-between; }
  /* the news needs more width than the presenter: in the professional view the card is two even columns, and 2 to 3
     under 1200 px; with the date beside the source and 13 px text the three items fit the chart's height, so the card is
     option A's 492 px from 1024 to 1920 (measured 8 Oct 2026) */
  html[data-lang="li"] .slip.btc[data-btc-broadcast] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .slip.btc .btc-news-item {
    display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: baseline;
    grid-template-areas: "head head" "text text" "date source";
  }
  .slip.btc .btc-news-date { grid-area: date; margin: 0; line-height: 1.4; }
  .slip.btc .btc-news-head { grid-area: head; font-size: 15px; }
  .slip.btc .btc-news-text { grid-area: text; font-size: 13px; line-height: 1.38; }
  .slip.btc .btc-news-source { grid-area: source; }
}
@media (min-width: 1024px) and (max-width: 1199.98px) {
  html[data-lang="li"] .slip.btc[data-btc-broadcast] { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}

/* The commentator's dialogue box (Mike on the live studio, 8 Oct 2026: "not a desciption under it, it is his line (his
   dialogue box)"). Playful view only; the professional view keeps its existing news list. A box of the room's own
   navy with the left screen's cyan as a pixel border (square corners cut, as the studio's art is drawn), the room's
   pixel type, and a stepped tail pointing up at him. It holds the longest of his lines in the language on show at the
   box's width, so a new line moves nothing: in the pixel type at 16/24 px the longest English line needs 4 lines under
   a 262 px box, 3 under 374, 2 under 670 and 1 from there; the longest Chinese line 2 under 385 and 1 from there
   (measured in Chrome on the Editor's eight lines, 4 px spare). The other language and the professional line leave the
   box instead of holding its height unseen. The slot before the presenter mounts keeps the same height. */
.slip.btc .btc-reporter { container-type: inline-size; }
html[data-lang="en"] .slip.btc .btc-reporter-line, html[data-lang="en"] .slip.btc .btc-reporter::after { --dl-lines: 4; }
html[data-lang="zh"] .slip.btc .btc-reporter-line, html[data-lang="zh"] .slip.btc .btc-reporter::after { --dl-lines: 2; }
@container (min-width: 262px) { html[data-lang="en"] .slip.btc .btc-reporter-line, html[data-lang="en"] .slip.btc .btc-reporter::after { --dl-lines: 3; } }
@container (min-width: 374px) { html[data-lang="en"] .slip.btc .btc-reporter-line, html[data-lang="en"] .slip.btc .btc-reporter::after { --dl-lines: 2; } }
@container (min-width: 670px) { html[data-lang="en"] .slip.btc .btc-reporter-line, html[data-lang="en"] .slip.btc .btc-reporter::after { --dl-lines: 1; } }
@container (min-width: 385px) { html[data-lang="zh"] .slip.btc .btc-reporter-line, html[data-lang="zh"] .slip.btc .btc-reporter::after { --dl-lines: 1; } }

html:not([data-lang="li"]) .slip.btc [data-btc-studio] .btc-reporter-line {
  position: relative; box-sizing: border-box; margin: 15px 3px 0; padding: 10px 14px;
  min-block-size: calc(var(--dl-lines) * 24px + 20px);
  background: #081239; color: #eaf7ff; font: 400 16px/24px var(--pixel);
  box-shadow: 0 -3px 0 #69edff, 0 3px 0 #69edff, -3px 0 0 #69edff, 3px 0 0 #69edff;
}
html[data-lang="en"] .slip.btc .btc-reporter-line > [data-l]:not([data-l="en"]),
html[data-lang="zh"] .slip.btc .btc-reporter-line > [data-l]:not([data-l="zh"]) { display: none; }
/* the tail: cyan steps of 3 px up to him, the box's navy inside them over the border it opens */
html:not([data-lang="li"]) .slip.btc [data-btc-studio] .btc-reporter-line::before,
html:not([data-lang="li"]) .slip.btc [data-btc-studio] .btc-reporter-line::after {
  content: ""; position: absolute; left: calc(50% - 12px); top: -15px; width: 24px; height: 15px;
}
html:not([data-lang="li"]) .slip.btc [data-btc-studio] .btc-reporter-line::before {
  background: #69edff;
  clip-path: polygon(0 12px, 0 9px, 3px 9px, 3px 6px, 6px 6px, 6px 3px, 9px 3px, 9px 0, 15px 0, 15px 3px, 18px 3px, 18px 6px, 21px 6px, 21px 9px, 24px 9px, 24px 12px);
}
html:not([data-lang="li"]) .slip.btc [data-btc-studio] .btc-reporter-line::after {
  background: #081239;
  clip-path: polygon(3px 15px, 3px 9px, 6px 9px, 6px 6px, 9px 6px, 9px 3px, 15px 3px, 15px 6px, 18px 6px, 18px 9px, 21px 9px, 21px 15px);
}
html:not([data-lang="li"]) .slip.btc [data-btc-studio] .btc-studio-controls { margin-top: 15px; }
html.js:not([data-lang="li"]) .slip.btc .btc-reporter:not([data-btc-studio])::after {
  height: calc(15px + var(--dl-lines) * 24px + 20px + 15px + 44px);
}
