/*
 * Strongman surfaces (ADR-strongman SM8). Shared by the native app (BlazorWebView) and the responsive web. Uses the
 * product's own --mp-* design tokens (dark theme, barbell-gold accent) with fallbacks, and an sm- class prefix so it
 * never collides with the powerlifting board/app stylesheets. Text sizes are rem so OS font scaling reflows; touch
 * targets are >= 44px. Colour is never the only signal: Tree A/B, states and plates always carry text.
 */
.sm-app, .sm-screen, .sm-board, .sm-tile, .sm-standings, .sm-studio, .sm-overview {
  --sm-bg: var(--mp-bg, #0d1117);
  --sm-surface: var(--mp-surface, #161b22);
  --sm-surface-2: var(--mp-surface-2, #1f2630);
  --sm-border: var(--mp-border, #2d333b);
  --sm-text: var(--mp-text, #e6edf3);
  --sm-muted: var(--mp-muted, #9aa7b4);
  --sm-accent: var(--mp-accent, #f0a500);
  --sm-accent-soft: rgba(240, 165, 0, .14);
  --sm-good: var(--mp-good, #2ea043);
  --sm-bad: var(--mp-nolift, var(--mp-bad, #d92d20));
  --sm-warn: #d29922;
  --sm-tree-a: #58a6ff;
  --sm-tree-b: #d2a8ff;
  --sm-radius: 12px;
  --sm-touch: 44px;
  color: var(--sm-text);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- primitives */
.sm-eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; font-weight: 800; color: var(--sm-accent); margin-bottom: .3rem; }
.sm-muted { color: var(--sm-muted); }
.sm-small { font-size: .82rem; line-height: 1.45; }
.sm-num { text-align: right; font-variant-numeric: tabular-nums; }
.sm-text-good { color: var(--sm-good); }
.sm-text-bad { color: #ff8b85; }
.sm-text-warn { color: var(--sm-warn); }
.sm-text-accent { color: var(--sm-accent); }
.sm-row { display: flex; gap: .5rem; align-items: center; }
.sm-row--spread { justify-content: space-between; }
.sm-row--wrap { flex-wrap: wrap; }
.sm-card { background: var(--sm-surface); border: 1px solid var(--sm-border); border-radius: var(--sm-radius); padding: 1rem; display: grid; gap: .65rem; min-width: 0; }
.sm-card h2, .sm-card h3, .sm-card h4 { margin: 0; }
.sm-subcard { border: 1px solid var(--sm-border); border-radius: 10px; padding: .8rem; display: grid; gap: .55rem; background: var(--sm-surface-2); }
.sm-screen { display: grid; gap: .85rem; }
.sm-skeleton { padding: 1.5rem; color: var(--sm-muted); }
.sm-details summary { cursor: pointer; font-weight: 650; }
.sm-dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; margin: .5rem 0; }
.sm-dl dt { color: var(--sm-muted); }
.sm-dl dd { margin: 0; }
.sm-link { background: none; border: 0; color: var(--sm-accent); padding: .25rem 0; cursor: pointer; font: inherit; text-decoration: underline; justify-self: start; }

.sm-btn { min-height: var(--sm-touch); padding: .55rem 1rem; border-radius: 9px; border: 1px solid var(--sm-border); background: var(--sm-surface-2); color: var(--sm-text);
  font: inherit; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; text-decoration: none; }
.sm-btn:hover { border-color: var(--sm-accent); }
.sm-btn:focus-visible, .sm-chip:focus-visible, .sm-roles__btn:focus-visible, .sm-desk__input:focus-visible { outline: 3px solid var(--sm-accent); outline-offset: 2px; }
.sm-btn:disabled { opacity: .45; cursor: not-allowed; }
.sm-btn--primary { background: var(--sm-accent); border-color: var(--sm-accent); color: #161006; }
.sm-btn--wide { width: 100%; }
.sm-btn--small { min-height: 34px; padding: .3rem .65rem; font-size: .82rem; }
.sm-btn--good.is-selected { background: #1d4429; border-color: var(--sm-good); }
.sm-btn--bad.is-selected { background: #4b1c1a; border-color: var(--sm-bad); }
.sm-btn.is-selected { border-color: var(--sm-accent); box-shadow: inset 0 0 0 1px var(--sm-accent); }

.sm-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .5rem; border: 1px solid var(--sm-border); border-radius: 7px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.sm-badge--good { color: #7ee2a0; border-color: #2f6b45; background: #12301e; }
.sm-badge--warn { color: #f2cc60; border-color: #6b5420; background: #2d2410; }
.sm-badge--bad { color: #ffa198; border-color: #6e2a26; background: #33150f; }
.sm-badge--accent { color: var(--sm-accent); border-color: #6b5220; background: var(--sm-accent-soft); }
.sm-dot { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }

.sm-notice { padding: .7rem .9rem; border-radius: 9px; border: 1px solid #305359; background: #132a2d; font-size: .88rem; line-height: 1.45; }
.sm-notice--good { border-color: #2f6b45; background: #12301e; }
.sm-notice--bad { border-color: #6e2a26; background: #33150f; }
.sm-notice--warn { border-color: #6b5420; background: #2d2410; }

.sm-field { display: grid; gap: .3rem; font-size: .8rem; color: var(--sm-muted); min-width: 0; }
.sm-field input:not([type=checkbox]):not([type=radio]), .sm-field select, .sm-field textarea, .sm-inline-field select, .sm-desk__input,
.sm-subcard input:not([type=checkbox]):not([type=radio]), .sm-subcard select, .sm-title-input, .sm-reason {
  min-height: var(--sm-touch); padding: .55rem .7rem; border-radius: 8px; border: 1px solid var(--mp-control-border, #354253);
  background: var(--mp-control-bg, #171e28); color: var(--sm-text); font: inherit; font-size: 1rem; width: 100%; box-sizing: border-box; }
.sm-inline-field { display: inline-flex; gap: .4rem; align-items: center; font-size: .8rem; color: var(--sm-muted); }
.sm-subcard .sm-row > input, .sm-subcard .sm-row > select { width: auto; flex: 1 1 10rem; }
.sm-title-input { font-size: 1.25rem !important; font-weight: 800; max-width: 28rem; }
.sm-check { display: inline-flex; gap: .5rem; align-items: center; min-height: var(--sm-touch); color: var(--sm-text); font-size: .9rem; }
.sm-check input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--sm-accent); flex-shrink: 0; }
.sm-chip { min-height: var(--sm-touch); min-width: 3.4rem; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--sm-border); background: var(--sm-surface-2); color: var(--sm-text); font: inherit; font-weight: 700; cursor: pointer; }
.sm-chip.is-selected { background: var(--sm-accent); color: #161006; border-color: var(--sm-accent); }
.sm-choices { display: flex; gap: .4rem; flex-wrap: wrap; }

.sm-receipt { padding: .65rem .8rem; border-radius: 9px; border: 1px solid #2f6b45; background: #12301e; color: #b5ecc8; font-size: .82rem; line-height: 1.5; }
.sm-receipt--awaiting { border-color: #6b5420; background: #2d2410; color: #f2d79a; }
.sm-acting { position: sticky; top: 0; z-index: 3; padding: .7rem .9rem; border-radius: 9px; background: var(--sm-accent); color: #161006; font-weight: 750; }
.sm-rest { text-align: center; font-size: 2.4rem; font-weight: 850; letter-spacing: -.02em; color: var(--sm-accent); }
.sm-clock { font-variant-numeric: tabular-nums; font-weight: 800; }
.sm-clock--expired { color: var(--sm-bad); }
.sm-clock--done { color: var(--sm-good, #3fb950); font-size: .6em; }
.sm-facts { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .9rem; }
.sm-gear { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .35rem; }
.sm-gear li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .85rem; }

.sm-counter { display: grid; grid-template-columns: 1fr auto 3rem auto; gap: .5rem; align-items: center; padding: .4rem .5rem; border: 1px solid var(--sm-border); border-radius: 9px; background: var(--sm-surface-2); }
.sm-counter__label { font-size: .85rem; }
.sm-counter__value { font-size: 1.7rem; text-align: center; }
.sm-counter .sm-btn { min-width: var(--sm-touch); font-size: 1.4rem; padding: .2rem .8rem; }
.sm-counter--small .sm-counter__value { font-size: 1.2rem; }
.sm-decision { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.sm-stages { display: grid; gap: .4rem; }
.sm-stage { display: grid; grid-template-columns: 1fr 7rem; gap: .5rem; align-items: center; padding: .35rem .5rem; border-radius: 8px; border: 1px solid var(--sm-border); }
.sm-stage.is-done { border-color: #2f6b45; }
.sm-stage.is-next { border-color: var(--sm-accent); }
.sm-stage input { min-height: 40px; border-radius: 7px; border: 1px solid var(--sm-border); background: var(--mp-control-bg, #171e28); color: var(--sm-text); padding: .3rem .5rem; font: inherit; }
.sm-option-capture { display: grid; gap: .4rem; }
.sm-pending { display: grid; gap: .25rem; padding: .6rem; border-radius: 8px; border: 1px solid #6b5420; background: #2d2410; }
.sm-pending--conflict { border-color: #6e2a26; background: #33150f; }

.sm-modal { position: fixed; inset: 0; z-index: 50; background: rgba(4, 8, 12, .78); display: grid; place-items: center; padding: 1rem; }
.sm-modal__card { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--sm-surface); border: 1px solid var(--sm-border); border-radius: 16px; padding: 1.2rem; display: grid; gap: .7rem; }
.sm-review-row { display: grid; gap: .15rem; padding: .55rem .2rem; border-bottom: 1px solid var(--sm-border); }

/* ---------------------------------------------------------------- app shell */
.sm-app { display: grid; gap: .85rem; max-width: 760px; margin: 0 auto; padding: .75rem; }
.sm-app__head { display: flex; justify-content: space-between; gap: .75rem; align-items: center; padding: .6rem .2rem; border-bottom: 1px solid var(--sm-border); }
.sm-app__context { display: grid; gap: .1rem; min-width: 0; }
.sm-app__context .sm-small { overflow-wrap: anywhere; }
.sm-app__pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; }
.sm-app__foot { text-align: center; }
.sm-roles { display: flex; flex-wrap: wrap; gap: .3rem; padding: .3rem; border: 1px solid var(--sm-border); border-radius: 12px; background: var(--sm-surface); }
.sm-roles__btn { flex: 1 1 auto; min-height: var(--sm-touch); border: 0; border-radius: 9px; background: transparent; color: var(--sm-muted); font: inherit; font-weight: 700; white-space: nowrap; padding: 0 .8rem; cursor: pointer; }
.sm-roles__btn.is-active { background: var(--sm-accent-soft); color: var(--sm-accent); }
.sm-referee__athlete { font-size: 1.6rem; overflow-wrap: anywhere; }
.sm-dash-platform { display: grid; gap: .35rem; padding: .6rem 0; border-top: 1px solid var(--sm-border); }

/* ---------------------------------------------------------------- loading diagram */
.sm-load { display: grid; gap: .5rem; min-width: 0; }
.sm-load--blocked { padding: .7rem .8rem; border: 2px solid var(--sm-bad); border-radius: 10px; background: #33150f; color: #ffc4be; }
.sm-load--note { color: var(--sm-muted); font-size: .85rem; }
.sm-trees { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.sm-trees--one { grid-template-columns: 1fr; }
.sm-tree, .sm-pin { min-width: 0; padding: .55rem .7rem; border: 2px solid #475563; border-radius: 10px; background: var(--sm-surface-2); display: grid; gap: .35rem; }
.sm-tree--a { border-color: var(--sm-tree-a); }
.sm-tree--b { border-color: var(--sm-tree-b); }
.sm-tree__head { display: flex; justify-content: space-between; gap: .4rem; align-items: baseline; font-size: .85rem; }
.sm-tree__head strong { font-size: 1.15rem; }
.sm-tree__label { font-weight: 800; }
.sm-tree--a .sm-tree__label, .sm-tree--a .sm-tree__pair { color: #a8d2ff; }
.sm-tree--b .sm-tree__label, .sm-tree--b .sm-tree__pair { color: #e0c5ff; }
.sm-tree__pair { font-size: .76rem; font-weight: 700; }
.sm-tree__members { font-size: .72rem; color: var(--sm-muted); }
.sm-pins { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; position: relative; }
.sm-pins--twocentrepin { grid-template-columns: 1fr; max-width: 360px; }
.sm-pins__orientation { grid-column: 1 / -1; text-align: center; font-size: .7rem; font-weight: 800; letter-spacing: .1em; color: var(--sm-muted); }
.sm-plates { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; min-height: 2.3rem; }
.sm-plates__empty { color: var(--sm-muted); font-size: .8rem; }
.sm-plate { display: inline-flex; align-items: baseline; gap: .15rem; padding: .25rem .5rem; min-height: calc(2.3rem * var(--h, 100%) / 100%); border-radius: 6px;
  background: var(--plate); color: var(--ink); border: 2px solid rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
.sm-plate b { font-size: 1rem; }
.sm-plate small { font-size: .72rem; }
.sm-load__equation { display: grid; gap: .1rem; font-size: .78rem; color: var(--sm-muted); }
.sm-load__equation span { color: var(--sm-text); font-weight: 650; }
.sm-load__inventory { font-size: .74rem; color: var(--sm-muted); }
.sm-fixed { display: grid; gap: .2rem; padding: .6rem .8rem; border: 2px solid #475563; border-radius: 10px; background: var(--sm-surface-2); }
.sm-fixed__code { font-weight: 800; color: var(--sm-accent); }
.sm-fixed__kg { font-size: 1.6rem; }
.sm-load--dense .sm-tree, .sm-load--dense .sm-pin { padding: .35rem .5rem; }
.sm-load--dense .sm-plate { padding: .15rem .35rem; }
.sm-load--dense .sm-plate b { font-size: .85rem; }
.sm-options { display: flex; gap: .4rem; flex-wrap: wrap; }
.sm-option { padding: .25rem .55rem; border: 1px solid var(--sm-border); border-radius: 7px; font-size: .8rem; }

/* ---------------------------------------------------------------- platform tile & overview */
.sm-overview { display: grid; grid-template-rows: auto 1fr auto; height: 100%; min-height: 0; background: var(--sm-bg); }
.sm-overview__head { display: flex; gap: 1rem; align-items: center; padding: .7rem 1rem; border-bottom: 1px solid var(--sm-border); }
.sm-overview__grid { display: grid; gap: .75rem; padding: .75rem; min-height: 0; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.sm-overview__foot { padding: .5rem 1rem; border-top: 1px solid var(--sm-border); font-size: .8rem; color: var(--sm-muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.sm-tile { border: 1px solid #385362; border-top: 3px solid var(--sm-accent); border-radius: 12px; background: var(--sm-surface); padding: .6rem .8rem; display: flex; flex-direction: column; gap: .35rem; min-width: 0; min-height: 0; overflow: hidden; }
.sm-tile--blocked { border-color: var(--sm-bad); }
.sm-tile__head { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.sm-tile__name { font-size: 1.15rem; }
.sm-tile__clock { margin-left: auto; font-size: 1.25rem; }
.sm-tile__context { font-size: .75rem; color: var(--sm-accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-tile__current { display: flex; justify-content: space-between; gap: .6rem; align-items: center; }
.sm-tile__who { min-width: 0; }
.sm-tile__division { font-size: .72rem; color: var(--sm-muted); }
.sm-tile__athlete { margin: 0; font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-tile__target { flex-shrink: 0; font-size: 2rem; font-weight: 850; white-space: nowrap; letter-spacing: -.02em; }
.sm-tile__loading { flex: 1; min-height: 0; overflow: hidden; }
.sm-tile__foot { display: flex; gap: .5rem; align-items: center; font-size: .78rem; border-top: 1px solid var(--sm-border); padding-top: .35rem; }
.sm-tile__next { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-tile__next small { color: var(--sm-accent); font-weight: 800; margin-right: .3rem; }
/* One or two platforms per screen: the tiles are big, so their content is read from further away. */
.sm-overview--roomy .sm-tile > :not(.sm-tile__head):not(.sm-tile__foot) { zoom: 1.5; }
.sm-overview--dense .sm-tile__target { font-size: 1.5rem; }
.sm-overview--dense .sm-tile__athlete { font-size: 1.05rem; }
.sm-overview--dense .sm-tile__next { display: none; }

/* ---------------------------------------------------------------- individual board */
.sm-board { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; height: 100%; background: var(--sm-bg); }
.sm-board__head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .7rem 1rem; border-bottom: 1px solid var(--sm-border); flex-wrap: wrap; }
.sm-board__title { margin: 0; font-size: 1.5rem; }
.sm-board__title small { font-size: .85rem; color: var(--sm-muted); font-weight: 500; }
.sm-board__status { display: flex; gap: .4rem; flex-wrap: wrap; }
.sm-board__main { display: grid; grid-template-columns: minmax(0, 58fr) minmax(0, 42fr); min-height: 0; }
.sm-board__left { display: flex; flex-direction: column; gap: .7rem; padding: .9rem; border-right: 1px solid var(--sm-border); min-height: 0; }
.sm-current { padding: 1rem 1.2rem; border: 1px solid #395748; border-radius: 12px; background: #172a24; display: grid; gap: .4rem; }
.sm-current__row { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.sm-current__name { margin: 0; font-size: 2.1rem; letter-spacing: -.02em; overflow-wrap: anywhere; }
.sm-current__clock { font-size: 2rem; padding: .3rem .7rem; border: 1px solid var(--sm-border); border-radius: 9px; background: #0f1e25; }
.sm-current__target { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.sm-current__big { font-size: 3.4rem; font-weight: 900; letter-spacing: -.03em; }
.sm-current__option { display: grid; padding: .3rem .7rem; border: 1px solid var(--sm-border); border-radius: 9px; }
.sm-current__option b { font-size: 2rem; }
.sm-current__facts { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .9rem; color: var(--sm-muted); }
.sm-board__loading { flex: 1; min-height: 0; padding: .8rem 1rem; border: 1px solid var(--sm-border); border-radius: 12px; background: #101e27; display: grid; gap: .5rem; align-content: start; overflow: auto; }
.sm-board__loadhead { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.sm-setup-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .5rem; }
.sm-next { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.sm-next__card { padding: .6rem .8rem; border: 1px solid var(--sm-border); border-radius: 9px; background: var(--sm-surface); display: grid; gap: .15rem; min-width: 0; }
.sm-next__card strong { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-next__target { font-size: 1.4rem; font-weight: 800; }
.sm-queue { display: grid; grid-template-rows: auto auto 1fr; min-height: 0; }
.sm-queue__rows { min-height: 0; overflow: hidden; align-content: start; display: grid; }
.sm-queue__head { display: flex; justify-content: space-between; padding: .6rem 1rem; }
.sm-queue__cols, .sm-queue__row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) 6.5rem 9rem; gap: .5rem; align-items: center; padding: 0 1rem; }
.sm-queue__cols { font-size: .68rem; text-transform: uppercase; color: var(--sm-muted); background: var(--sm-surface); min-height: 1.9rem; }
.sm-queue__row { min-height: 2.4rem; border-bottom: 1px solid var(--sm-border); font-size: .92rem; }
.sm-queue__row.is-current { background: #233a2d; box-shadow: inset 3px 0 0 var(--sm-accent); }
.sm-queue__row.is-ineligible { color: #ffc1c5; }
.sm-queue__row.is-ineligible .sm-num { text-decoration: line-through; }
.sm-queue__name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-queue__name small { display: block; font-size: .7rem; color: var(--sm-muted); }
.sm-queue__state { font-size: .76rem; }
.sm-board__foot { display: flex; gap: .6rem; padding: .6rem 1rem; border-top: 1px solid var(--sm-border); background: var(--sm-surface); flex-wrap: wrap; }

/* ---------------------------------------------------------------- standings & tables */
.sm-standings { display: grid; gap: 1rem; }
.sm-standings__bar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.sm-standings__division { display: grid; gap: .5rem; min-width: 0; }
/* Results never wrap mid-value; on a phone the table scrolls inside its region (athlete column pinned). */
.sm-standings .sm-table { min-width: 36rem; }
.sm-standings .sm-cell-perf { white-space: nowrap; }
.sm-standings td small { max-width: 12rem; }
.sm-standings tbody td:nth-child(2), .sm-standings thead th:nth-child(2) { position: sticky; left: 0; background: var(--sm-surface); z-index: 1; }
.sm-table-wrap { overflow: auto; border: 1px solid var(--sm-border); border-radius: 10px; max-width: 100%; }
.sm-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.sm-table th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--sm-muted); background: var(--sm-surface-2); padding: .6rem .7rem; white-space: nowrap; }
.sm-table td, .sm-table tbody th { padding: .6rem .7rem; border-top: 1px solid var(--sm-border); vertical-align: top; text-align: left; font-weight: inherit; }
.sm-table td small, .sm-table th small { display: block; color: var(--sm-muted); font-size: .72rem; margin-top: .15rem; font-weight: 500; }
.sm-table tr.is-you td { background: #1d3327; }
.sm-cell-perf { font-weight: 700; }
.sm-cell-detail { font-style: italic; }

/* ---------------------------------------------------------------- tablet desk */
.sm-desk { max-width: 1400px; margin: 0 auto; }
.sm-desk__head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.sm-desk__head h2 { margin: 0; }
.sm-desk__filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .75rem; align-items: end; }
.sm-desk__wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--sm-border); border-radius: 12px; }
/* Fits a 1024 px landscape tablet without sideways scrolling; portrait scrolls with the athlete column pinned. */
.sm-desk__table { min-width: 940px; }
.sm-desk__table td small { display: block; overflow-wrap: anywhere; max-width: 16rem; }
.sm-desk__table thead th { position: sticky; top: 0; z-index: 2; }
.sm-desk__table tbody th, .sm-desk__table thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--sm-surface); min-width: 12rem; box-shadow: 4px 0 8px rgba(0, 0, 0, .25); }
.sm-desk__table thead th:first-child { z-index: 3; background: var(--sm-surface-2); }
.sm-desk__table tr.has-draft td, .sm-desk__table tr.has-draft th { background: #24210f; }
.sm-desk__input { font-size: 1.25rem; font-weight: 800; max-width: 10rem; }
.sm-desk__error { display: block; color: #ffc0a6; background: #392d24; border-left: 3px solid #da956f; padding: .4rem .55rem; border-radius: 4px; margin-bottom: .3rem; }
.sm-desk__foot { display: flex; justify-content: flex-end; gap: .75rem; align-items: center; flex-wrap: wrap; position: sticky; bottom: 0; z-index: 5; background: var(--sm-bg); padding: .7rem 0; }
.sm-desk__foot > span { margin-right: auto; color: var(--sm-muted); font-size: .85rem; }

/* ---------------------------------------------------------------- studio */
.sm-studio { display: grid; gap: 1rem; }
.sm-family-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
/* The add-event buttons sit in the narrow programme column: two per row, so labels never wrap letter by letter. */
.sm-family-cards--compact { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.sm-family-cards--compact .sm-btn { white-space: normal; line-height: 1.15; }
.sm-family-card { display: grid; gap: .35rem; text-align: left; padding: .9rem; min-height: 9rem; border: 1px solid var(--sm-border); border-radius: 12px; background: var(--sm-surface); color: var(--sm-text); font: inherit; cursor: pointer; align-content: start; }
.sm-family-card.is-active { border-color: var(--sm-accent); box-shadow: inset 0 0 0 1px var(--sm-accent); background: #2a2310; }
.sm-family-card strong { font-size: 1rem; }
.sm-family-card span { font-size: .82rem; color: var(--sm-muted); line-height: 1.4; }
.sm-family-card small { font-size: .7rem; color: var(--sm-accent); margin-top: auto; }
.sm-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.sm-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.sm-rule-preview { border-left: 3px solid var(--sm-accent); background: #2a2310; border-radius: 0 10px 10px 0; padding: .8rem 1rem; font-size: .9rem; line-height: 1.55; }
.sm-issue { font-size: .85rem; }
.sm-issue--blocking { color: #ffb4ab; }
.sm-studio-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1rem; align-items: start; }
.sm-event-list { display: grid; gap: .4rem; }
.sm-event-item { text-align: left; padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--sm-border); background: var(--sm-surface); color: var(--sm-text); font: inherit; cursor: pointer; display: grid; gap: .15rem; }
.sm-event-item.is-active { border-color: var(--sm-accent); }
.sm-event-item small { color: var(--sm-muted); font-size: .74rem; }

/* ---------------------------------------------------------------- web shell & display */
.sm-shell { min-height: 100vh; background: var(--mp-bg, #0d1117); color: var(--mp-text, #e6edf3); }
.sm-shell__bar { display: flex; gap: .75rem; align-items: center; padding: .7rem 1rem; border-bottom: 1px solid var(--mp-border, #2d333b); position: sticky; top: 0; z-index: 10; background: var(--mp-bg, #0d1117); }
.sm-shell__brand { font-weight: 850; color: inherit; text-decoration: none; letter-spacing: -.02em; }
.sm-shell__brand b { color: var(--mp-accent, #f0a500); }
.sm-shell__tag { font-size: .68rem; font-weight: 800; letter-spacing: .12em; padding: .15rem .45rem; border-radius: 6px; border: 1px solid #6b5220; color: var(--mp-accent, #f0a500); }
.sm-shell__back { margin-left: auto; color: var(--mp-muted, #9aa7b4); font-size: .85rem; }
.sm-shell__main { padding: 0 0 2rem; }
.sm-wide .sm-app { max-width: 1440px; }
.sm-display { width: 100vw; height: 100vh; display: grid; overflow: hidden; }
.sm-display > section { min-height: 0; }
/* Inside the native app the board lives under a top bar: fill the scroll area, and on a narrow phone stack tiles. */
.sm-native-board .sm-display { width: 100%; height: auto; min-height: calc(100dvh - 4rem); overflow: visible; }
@media (max-width: 700px) { .sm-native-board .sm-overview__grid { grid-template-columns: 1fr; grid-auto-rows: auto; } }
.sm-display__msg { display: grid; place-items: center; color: var(--mp-muted, #9aa7b4); font-size: 1.4rem; }
.sm-viewbar { display: flex; gap: .3rem; margin-left: auto; flex-wrap: wrap; }
.sm-viewbar__seg { padding: .3rem .7rem; border-radius: 8px; border: 1px solid var(--mp-border, #2d333b); color: var(--mp-text, #e6edf3); text-decoration: none; font-size: .78rem; font-weight: 700; }
.sm-viewbar__seg.is-active { border-color: var(--mp-accent, #f0a500); color: var(--mp-accent, #f0a500); }
.sm-overview__foot a { color: var(--mp-accent, #f0a500); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .sm-family-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm-studio-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sm-board__main { grid-template-columns: 1fr; }
  .sm-board__left { border-right: 0; }
  .sm-desk__filters { grid-template-columns: 1fr 1fr; }
  .sm-desk__filters > label:first-child { grid-column: 1 / -1; }
  .sm-grid2, .sm-grid3 { grid-template-columns: 1fr; }
  .sm-current__big { font-size: 2.6rem; }
  .sm-current__name { font-size: 1.6rem; }
  .sm-next { grid-template-columns: 1fr; }
  .sm-overview__grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .sm-trees { grid-template-columns: 1fr; }
  .sm-family-cards { grid-template-columns: 1fr; }
  .sm-desk__filters { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .sm-app *, .sm-board * { transition: none !important; animation: none !important; }
}

/* Unsupported progression formats: listed and visibly disabled (ADR-strongman delivered scope). */
.sm-unsupported { margin-top: .75rem; border-top: 1px solid var(--sm-border); padding-top: .6rem; font-size: .85rem; color: var(--sm-muted); }
.sm-unsupported summary { cursor: pointer; font-weight: 700; }
.sm-unsupported ul { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.sm-unsupported button[disabled] { opacity: .55; cursor: not-allowed; text-decoration: line-through; }
