/* The board tools (tools/board.js): change prices, change the look, the bars,
   more for a board, your other shops. Every rule starts .stb; colours only
   from the studio's variables. */

.stb { gap: 16px; }
.stb p { margin: 0; }
.stb .stb-small { font-size: 13px; }
.stb .stb-cost { color: var(--gold); font-weight: 800; }
.stb .stb-steps { margin: -2px 0 2px; }
.stb .stb-said-note { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; }

/* Banners: a line of words with, at most, one button beside them. */
.stb .stb-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); }
.stb .stb-banner.warn { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--surface-2)); }
.stb .stb-banner.danger { border-color: var(--red, #f0646a); background: color-mix(in srgb, var(--red, #f0646a) 8%, var(--surface-2)); }
.stb .stb-banner span { flex: 1 1 260px; }

/* The foot: the one big button, and its partners the same size. */
.stb .stb-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.stb .stb-foot > [data-count], .stb .stb-foot > [data-said] { flex: 1 1 220px; font-size: 14px; }
.stb .stb-foot.stb-two, .stb .stb-foot.stb-three { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stb .stb-foot.stb-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stb .stb-foot.stb-two .st-btn, .stb .stb-foot.stb-three .st-btn { width: 100%; min-height: 56px; padding: 8px 14px; line-height: 1.25; text-align: center; }
.stb .stb-sticky { position: sticky; bottom: -18px; z-index: 2; margin: 0 -18px -18px; padding: 14px 18px 18px; background: var(--surface); border-top: 1px solid var(--line); }

/* The price rows, as the film draws them. */
.stb .stb-rows { display: grid; gap: 6px; padding: 10px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.stb .stb-rows[hidden] { display: none; }
.stb .stb-arrive > * { animation: stb-in .35s ease both; }
.stb .stb-arrive > *:nth-child(2) { animation-delay: .03s; }
.stb .stb-arrive > *:nth-child(3) { animation-delay: .06s; }
.stb .stb-arrive > *:nth-child(4) { animation-delay: .09s; }
.stb .stb-arrive > *:nth-child(n+5) { animation-delay: .12s; }
@keyframes stb-in { from { opacity: 0; transform: translateY(6px); } }
.stb .stb-head { margin: 10px 4px 2px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stb .stb-head:first-child { margin-top: 2px; }
.stb .stb-note { padding: 2px 6px; color: var(--muted); font-size: 14px; }
.stb .stb-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; border: 2px solid transparent; background: var(--surface); transition: border-color .2s; }
.stb .stb-row.on { border-color: var(--blue, #4c8dff); }
.stb .stb-row.is-changed { border-color: color-mix(in srgb, var(--green) 55%, transparent); }
.stb .stb-name { flex: 1 1 auto; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.stb .stb-prices { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.stb .stb-price { display: inline-flex; align-items: center; gap: 4px; }
.stb .stb-price input { width: 86px; min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 17px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; transition: color .2s, border-color .2s, background .2s; }
.stb .stb-price input:focus { outline: none; border-color: var(--blue, #4c8dff); }
.stb .stb-price input.is-changed { color: var(--green); border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface-2)); }
.stb .stb-sign { color: var(--muted); font-weight: 800; }
.stb .stb-was { order: -1; margin-right: 4px; font-size: 13px; color: var(--muted); text-decoration: line-through; white-space: nowrap; }
.stb .stb-was:empty { display: none; }
.stb .stb-joiner { align-self: center; color: var(--muted); font-weight: 700; }
.stb .is-ghost { visibility: hidden; }
.stb .stb-sizes { background: transparent; padding-top: 2px; padding-bottom: 0; }
.stb .stb-size { display: inline-block; width: 86px; text-align: right; padding-right: 10px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.stb .stb-rule h3 { margin: 0; font-size: 17px; }
.stb .stb-rule .st-inline input { font-size: 16px; }
.stb .stb-rule .st-inline .st-btn { min-height: 48px; min-width: 160px; }
.stb .stb-text summary { padding: 6px 0; color: var(--muted); }
.stb .stb-text textarea { width: 100%; margin-top: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font: 15px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.stb .stb-text p { margin-top: 6px; }

/* Now / New, the worked prices. */
.stb .stb-table-wrap { max-height: 46dvh; overflow: auto; border-radius: 14px; border: 1px solid var(--line); }
.stb .stb-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.stb .stb-table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; padding: 10px 14px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stb .stb-table td { padding: 9px 14px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.stb .stb-table td b { color: var(--green); }

/* The ring while it draws. */
.stb .stb-wait { display: grid; justify-items: center; gap: 14px; padding: 18px 0 8px; text-align: center; }
.stb .stb-wait-title { font-size: 22px; letter-spacing: -.01em; }
.stb .stb-ring { width: 150px; height: 150px; }
.stb .stb-ring-track { stroke: var(--surface-2); }
.stb .stb-ring-arc { stroke: var(--green); transition: stroke-dashoffset .9s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--green) 45%, transparent)); }
.stb .stb-ring-pct { fill: var(--text); font-family: Figtree, system-ui, sans-serif; font-weight: 800; }
.stb .stb-ring.is-done .stb-ring-pct { fill: var(--green); }
.stb .stb-wait-said { min-height: 1.4em; font-size: 17px; font-weight: 700; }
.stb .stb-wait-said.is-done { color: var(--green); }
.stb .stb-wait .st-muted { max-width: 52ch; }

/* A board as the TV shows it, with its bars. */
.stb .stb-shot { container-type: inline-size; position: relative; display: flex; flex-direction: column; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; border: 3px solid #050505; box-shadow: 0 10px 28px rgba(0,0,0,.4); }
.stb .stb-shot.tall { aspect-ratio: 9 / 16; }
.stb .stb-pic { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; }
.stb .stb-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.stb .stb-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 0 8px; overflow: hidden; background: #111827; color: #fff; font-size: max(7px, 2.2cqw); line-height: 1; font-weight: 700; white-space: nowrap; }
.stb .stb-bar.top { height: var(--stb-top); }
.stb .stb-bar.bottom { height: var(--stb-bottom); }
.stb .stb-bar span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stb .stb-qr { flex: 0 0 auto; height: 80%; aspect-ratio: 1; border-radius: 2px; background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 25% 25%; }

.stb .stb-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stb .stb-compare.tall { grid-template-columns: repeat(2, minmax(0, 260px)); justify-content: center; }
.stb .stb-side { margin: 0; display: grid; gap: 8px; }
.stb .stb-side figcaption { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; }
.stb .stb-side.is-new figcaption { color: var(--green); }
.stb .stb-side figcaption a { font-weight: 700; font-size: 14px; }
.stb .stb-side.is-new .stb-shot { border-color: color-mix(in srgb, var(--green) 60%, #050505); animation: stb-wipe 1.1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes stb-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.stb .stb-mark { font-size: 13px; }
.stb .stb-bars-shot { width: min(460px, 100%); margin: 0 auto; }
.stb .stb-bars-shot .stb-shot.tall { width: min(220px, 60%); margin: 0 auto; }

/* More for a board: cards the same size, one under another. */
.stb .stb-list { display: grid; grid-auto-rows: 1fr; gap: 10px; }
.stb .stb-card { min-height: 76px; align-content: center; }
.stb .stb-card.is-danger b { color: var(--red, #f0646a); }
.stb .stb-card.is-danger:hover { border-color: var(--red, #f0646a); }
.stb .stb-reasons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.stb .stb-reason { min-height: 72px; align-content: center; }
.stb .stb-reason.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.stb .st-inline .st-btn { min-height: 48px; min-width: 110px; }
.stb .st-q textarea { resize: vertical; }

/* Your other shops. */
.stb .stb-shops { gap: 0; padding-top: 6px; padding-bottom: 6px; }
.stb .stb-shops .st-toggle + .st-toggle { border-top: 1px solid var(--line); }
.stb .stb-group .st-toggle { margin: 0; }
.stb .stb-results { display: grid; gap: 10px; }
.stb .stb-result { display: grid; gap: 2px; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.stb .stb-result span { color: var(--muted); font-size: 14px; }
.stb .stb-result.ok { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
.stb .stb-speeds .st-chip { min-width: 86px; }
.stb [data-bar-fields] { display: grid; gap: 6px; }
.stb [data-bar-fields][hidden] { display: none; }
.stb [data-bar-fields] .st-label { margin: 8px 0 0; }
.stb .st-group .st-toggle { min-height: 52px; }

/* A phone: the name over its boxes when there are several, one column of buttons. */
@media (max-width: 760px) {
  .stb .stb-row.has-many { flex-wrap: wrap; }
  .stb .stb-row.has-many .stb-name { flex-basis: 100%; }
  .stb .stb-row.has-many .stb-prices { justify-content: flex-start; }
  .stb .stb-sizes.has-many .stb-name { display: none; }
  .stb .stb-sizes.has-many .stb-prices { justify-content: flex-start; }
  .stb .stb-price input { width: 78px; }
  .stb .stb-size { width: 78px; }
  .stb .stb-foot.stb-three { grid-template-columns: 1fr; }
  .stb .stb-foot > .st-btn.big { flex: 1 1 100%; }
  .stb .stb-sticky { bottom: -18px; }
  .stb .stb-compare { grid-template-columns: 1fr; gap: 14px; }
  .stb .stb-compare.tall { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stb .stb-reasons { grid-template-columns: 1fr; }
  .stb .stb-rule .st-inline .st-btn { flex: 1 1 100%; }
  .stb .stb-speeds .st-chip { min-width: 0; flex: 1 1 0; }
}
