/* ==========================================================================
   css/c127.css - "one obvious next step" layer (C127, SIMPLE_SPEC.md): calm header, period dropdown, Today's training
   (session bar + Home), the 5-step onboarding + tour, the More sheet, the board "Tools" menu and one-tap Fix rows.
   Loads after skin.css and BEFORE brand/tokens.css. Colours only through tokens, so it works with or without the brand.
   ========================================================================== */

/* ---------------------------------------------------------------- header: logo · period ▾ · search · Free board · ? */
.app-pdrop { position: relative; display: inline-block; }
.app-period-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 8px 0 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: 0 2px 0 var(--edge);
  font: inherit; font-weight: var(--fw-strong, 800); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.app-period-btn:hover { background: var(--surface-2); }
.app-period-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
.app-period-btn .app-chev { width: 16px; height: 16px; color: var(--text-3); transition: transform calc(.18s * var(--motion, 1)) var(--ease, ease); }
.app-period-btn[aria-expanded="true"] .app-chev { transform: rotate(180deg); }
.app-period-menu {
  position: absolute; z-index: 70; top: calc(100% + 6px); left: 0; min-width: 196px; padding: 6px; display: grid; gap: 2px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-2);
  animation: app-in-up calc(.16s * var(--motion, 1)) var(--ease, ease) both;
}
.app-period-menu[hidden] { display: none; }
.app-period-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 8px 12px;
  border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-weight: 700; font-size: 15px; text-align: left; cursor: pointer;
}
.app-period-menu button:hover, .app-period-menu button:focus-visible { background: var(--surface-2); outline: none; }
.app-period-menu .app-ck { width: 18px; height: 18px; color: var(--accent-text, var(--accent)); visibility: hidden; flex: none; }
.app-period-menu button[aria-checked="true"] { font-weight: var(--fw-strong, 800); }
.app-period-menu button[aria-checked="true"] .app-ck { visibility: visible; }
.app-period-rail .app-pdrop { display: block; }
.app-period-rail .app-period-btn { width: 100%; justify-content: space-between; height: 42px; }
.app-period-rail .app-period-menu { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; min-width: 0; }
.app-topbar .app-period { flex: none; }
.app-topbar .app-period-top .app-period-n { display: none !important; }
@media (max-width: 360px) { .app-topbar .app-period-btn { padding: 0 6px 0 9px; font-size: 13px; } }

/* "Free board": a calm icon button, not a second green call to action */
.app-anbtn {
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 2px 0 var(--edge);
  font-weight: var(--fw-strong, 800);
}
.app-anbtn:hover { background: var(--surface-2); }
.app-anbtn:active { box-shadow: 0 1px 0 var(--edge); }
.app-anbtn svg { stroke-width: 2.1; }
.app-anbtn-top { width: 40px; min-width: 40px; height: 40px; padding: 0; }
.app-anbtn-top span, .app-findbtn-top span { display: none !important; }
.app-findbtn-top { width: 40px; min-width: 40px; height: 40px; padding: 0; box-shadow: 0 2px 0 var(--edge); }
.app-topbar .app-helpbtn { width: 40px; height: 40px; }
.app-anbtn-rail, .app-findbtn-rail { justify-content: flex-start; padding: 0 14px; height: 44px; font-size: 14.5px; }
.app-topbar { gap: 8px; }

/* the rating / plan / streak strip shows on Home only; a fresh user (no games yet) sees no period control and no strip */
.app[data-tab]:not([data-tab="home"]) .app-hud-slot { display: none !important; }
.app.is-nodata [data-period-ctl], .app.is-nodata .app-hud-slot { display: none !important; }

/* phone focus mode: a live board session also hides the header (the bottom tabs stay) */
@media (max-width: 899px) { html.drill-focus .app:is([data-tab="openings"], [data-tab="middlegame"], [data-tab="endgame"]) .app-topbar { display: none; } }

/* ---------------------------------------------------------------- Home: greeting · Today's training · 3 calm rows · More */
.hm-root { gap: 14px; }
@media (min-width: 700px) { .hm-root { gap: 18px; } }
.hm-hello { margin: 2px 2px -4px; font-size: var(--fs-md, 18px); font-weight: 700; color: var(--text-2); overflow-wrap: anywhere; }
.hm-hello b { color: var(--text); font-weight: var(--fw-heavy, 800); }
.hm-hello:empty, .hm-hello-slot:empty, .hm-banner:empty, .hm-rows:empty { display: none; }
.hm-ts h1 { font-size: clamp(28px, 7.4vw, 38px); margin: 6px 0 6px; }
.hm-ts .hm-ts-line { margin: 0 0 16px; font-weight: 700; font-size: 15px; }
.hm-ts .hm-ts-prog { margin: -4px 0 16px; height: 8px; }
.hm-len { display: block; margin: 12px auto 0; padding: 6px 10px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 700;
  color: rgba(244, 239, 228, .78); text-decoration: underline; text-underline-offset: 3px; min-height: 36px; }
.hm-len:hover { color: #fff; }
.hm-fold, .hm-more { border-radius: var(--radius, 16px); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); min-width: 0; }
.hm-fold[hidden], .hm-more[hidden] { display: none; }
.hm-fold > summary, .hm-more > summary {
  list-style: none; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; cursor: pointer; border-radius: inherit;
}
.hm-fold > summary::-webkit-details-marker, .hm-more > summary::-webkit-details-marker { display: none; }
.hm-fold > summary > svg, .hm-more > summary > svg { flex: none; width: 18px; height: 18px; margin-left: auto; color: var(--text-3); transition: transform calc(.18s * var(--motion, 1)) var(--ease, ease); }
.hm-fold[open] > summary > svg, .hm-more[open] > summary > svg { transform: rotate(90deg); }
.hm-fold > summary:hover, .hm-more > summary:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.hm-fold-ico { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--accent-text); background: var(--accent-soft); }
.hm-fold-ico svg { width: 20px; height: 20px; }
.hm-fold-t { display: flex; flex-direction: column; min-width: 0; }
.hm-fold-t b { font-size: 16px; font-weight: var(--fw-heavy, 800); }
.hm-fold-t small { font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.hm-fold .hm-plan { padding: 0 8px 8px; }
.hm-fold .hm-plan > .card { box-shadow: none; border: 0; background: transparent; padding: 4px 6px; }
.hm-fold .hm-plan .st-plan-head { display: none; }
.hm-more > summary span { font-weight: var(--fw-heavy, 800); font-size: 16px; }
.hm-more > summary small { font-size: 13.5px; font-weight: 700; color: var(--text-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-more-body { display: flex; flex-direction: column; gap: 16px; padding: 4px 12px 16px; min-width: 0; }
.hm-more-body > div:empty { display: none; }
.hm-rows { display: grid; gap: 10px; }
.hm-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; text-align: left; cursor: pointer;
  border-radius: var(--radius, 16px); border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); font: inherit;
}
.hm-row:hover { background: var(--surface-2); }
.hm-row > svg { flex: none; width: 18px; height: 18px; color: var(--text-3); margin-left: auto; }
.hm-row-ico { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.hm-row-ico svg { width: 18px; height: 18px; }
.hm-row-main { display: flex; flex-direction: column; min-width: 0; }
.hm-row-main b { font-size: 16px; font-weight: var(--fw-heavy, 800); }
.hm-row-main small { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.hm-goal > * { margin: 0; }

/* ---------------------------------------------------------------- Today's training: the slim session bar + end card */
.ts-bar {
  position: sticky; top: calc(var(--topbar-h, 0px) + 6px); z-index: 35; margin: 0 0 12px; padding: 8px 8px 0 14px;
  border-radius: 14px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); overflow: hidden;
}
.ts-bar[hidden] { display: none; }
html.drill-focus .ts-bar { top: 6px; }
.ts-row { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.ts-t { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 0; font-size: 14px; line-height: 1.3; }
.ts-t b { font-weight: var(--fw-heavy, 800); }
.ts-n { font-weight: 800; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.ts-what { color: var(--text-2); font-weight: 700; }
.ts-btn { flex: none; min-height: 36px; padding: 0 14px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 800; font-size: 14px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); }
.ts-next { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 2px 0 var(--accent-deep); }
.ts-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.ts-x:hover { background: var(--surface-2); color: var(--text); }
.ts-x svg { width: 18px; height: 18px; }
.ts-prog { height: 4px; margin: 6px -8px 0 -14px; background: var(--well, var(--surface-2)); }
.ts-prog > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width calc(.5s * var(--motion, 1)) var(--ease, ease); }
/* while the session runs, its bar replaces the area's subtab chips (one "where am I" line, not two) */
html.ts-on .sbt-nav, html.ts-on .sbt-chips { display: none !important; }
.ts-end { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 16, .62); animation: app-in-up calc(.2s * var(--motion, 1)) var(--ease, ease) both; }
.ts-end-card { width: min(420px, 100%); padding: 28px 22px 18px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-3); text-align: center; }
.ts-end-ico { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; font-weight: 900; color: var(--accent-ink); background: var(--accent); box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 40%, transparent); }
.ts-end-card h2 { margin: 0 0 8px; font-size: 26px; }
.ts-end-card p { margin: 0 0 8px; color: var(--text-2); font-weight: 600; line-height: 1.45; }
.ts-end-card .ts-end-sub { font-size: 13.5px; color: var(--text-3); margin-bottom: 18px; }
.ts-end-card .btn + .btn { margin-top: 8px; }

/* ---------------------------------------------------------------- first run: 5 steps (js/onboarding.js) */
.app-onb.ob { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 0 16px 28px; gap: 0;
  background-image:
    radial-gradient(640px 380px at 12% -6%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 66%),
    radial-gradient(680px 460px at 104% 104%, color-mix(in srgb, var(--purple) 18%, transparent), transparent 66%); }
.ob-top { position: relative; z-index: 2; width: min(480px, 100%); display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 0 6px; }
.ob-prog { flex: 1; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; visibility: hidden; }
.ob-prog i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width calc(.45s * var(--motion, 1)) var(--ease, ease); }
.ob.ob-has-prog .ob-prog { visibility: visible; }
.ob-count { flex: none; font-size: 12.5px; font-weight: 800; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ob-count:empty { display: none; }
.ob-skip { flex: none; margin: 0 0 0 auto; padding: 8px 10px; min-height: 40px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.ob-skip:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.ob-skip[hidden] { display: none; }
.ob .app-onb-card.ob-card { width: min(480px, 100%); margin: 4px 0 0; padding: 26px 22px 20px; text-align: left; }
@media (min-width: 700px) { .ob .app-onb-card.ob-card { padding: 34px 34px 26px; margin-top: 10px; } }
.ob-s[hidden] { display: none; }
.ob-s { animation: app-in-up calc(.32s * var(--motion, 1)) var(--ease, ease) both; }
.ob-s h1 { font-size: clamp(27px, 7.4vw, 34px); line-height: 1.08; letter-spacing: -.025em; margin: 0 0 10px; }
.ob-s h2 { font-size: clamp(23px, 6.2vw, 28px); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 8px; }
.ob-s h1:focus, .ob-s h2:focus { outline: none; }
.ob-lead { margin: 0 0 18px; color: var(--text-2); font-size: 15.5px; font-weight: 600; line-height: 1.45; }
.ob-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
.ob-brand .app-logo { width: 40px; height: 40px; border-radius: 12px; }
.ob-brand .brand-wordmark { font-size: 21px; }
.ob-how { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.ob-how li { display: flex; align-items: center; gap: 12px; }
.ob-how-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px;
  color: var(--accent-ink); background: var(--accent); box-shadow: 0 2px 0 var(--accent-deep); }
.ob-how li > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ob-how b { font-size: 15.5px; font-weight: 800; }
.ob-how small { font-size: 13px; font-weight: 600; color: var(--text-3); }
.ob-s .btn + .btn { margin-top: 8px; }
.ob-example { color: var(--text); }
.ob-note { margin: 12px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--text-3); }
/* C133: "Watch the 40-second trailer" (only when media/trailer.mp4 exists) + its overlay player */
.ob-trailer { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin: 6px 0 0; padding: 6px 10px;
  border: 0; background: none; color: var(--accent-text, var(--accent)); font: inherit; font-size: 14.5px; font-weight: 800; cursor: pointer; border-radius: 12px; }
.ob-trailer[hidden] { display: none; }
.ob-trailer svg { width: 16px; height: 16px; flex: none; }
.ob-trailer:hover span { text-decoration: underline; text-underline-offset: 3px; }
.ob-trailer:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ob-tv { position: fixed; inset: 0; z-index: 100020; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 16, .86);
  animation: app-fade calc(.2s * var(--motion, 1)) ease-out both; }
.ob-tv-box { position: relative; width: min(960px, 100%); }
.ob-tv-v { display: block; width: 100%; max-height: calc(100dvh - 96px); aspect-ratio: 16 / 9; background: #000; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.ob-tv-x { position: absolute; top: -48px; right: 0; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(244, 239, 228, .14); color: #F4EFE4; font-size: 26px; line-height: 1; cursor: pointer; }
.ob-tv-x:hover { background: rgba(244, 239, 228, .24); }
.ob-tv-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ob-tv-err { margin: 10px 0 0; text-align: center; color: #F4EFE4; font-weight: 700; }
.ob-tv-err[hidden] { display: none; }
/* the looping "Example recap" preview */
.ob-demo { margin: 0 0 20px; padding: 14px 14px 12px; border-radius: 16px; background: linear-gradient(160deg, #1D2645, #0B0F1C); color: #F4EFE4;
  box-shadow: inset 0 0 0 1px rgba(244, 239, 228, .07), var(--shadow-1); }
.ob-demo-h { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; }
.ob-demo-h span { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #F5B83D; }
.ob-demo-h b { font-size: 15px; font-weight: 800; }
.ob-demo-row { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 7px 0 9px; font-size: 13.5px; font-weight: 700; }
.ob-demo-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(244, 239, 228, .9); }
.ob-demo-row em { flex: none; white-space: nowrap; font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; color: #F4EFE4; }
.ob-demo-row i { position: absolute; left: 0; bottom: 2px; height: 4px; width: var(--w); border-radius: 99px; background: var(--c); transform-origin: left; animation: ob-grow calc(4.5s * var(--motion, 1)) var(--ease, ease) infinite; }
.ob-demo-row:nth-child(3) i { animation-delay: .15s; } .ob-demo-row:nth-child(4) i { animation-delay: .3s; }
@keyframes ob-grow { 0% { transform: scaleX(0); } 22%, 86% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: .3; } }
:root[data-motion="off"] .ob-demo-row i { animation: none; }
@media (prefers-reduced-motion: reduce) { .ob-demo-row i { animation: none; } }
/* step 2 */
.ob-back { display: inline-flex; align-items: center; gap: 4px; margin: -8px 0 10px -8px; padding: 6px 10px 6px 4px; min-height: 36px; border: 0; border-radius: 10px;
  background: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; color: var(--text-2); }
.ob-back:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.ob-back svg { width: 18px; height: 18px; }
.ob form { display: grid; gap: 10px; }
.ob-input { min-height: 52px; font-size: 17px; }
.ob .app-onb-err { min-height: 0; }
.ob .app-onb-err:empty { display: none; }
.ob-card-slot:empty { display: none; }
.ob-player { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); animation: app-in-up calc(.25s * var(--motion, 1)) var(--ease, ease) both; }
.ob-av { flex: none; width: 52px; height: 52px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; font-weight: 800; font-size: 22px; background: var(--surface-3); color: var(--text); }
.ob-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ob-player-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ob-player-main b { font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.ob-player-main small { font-size: 13px; font-weight: 600; color: var(--text-2); }
.ob-title { display: inline-block; padding: 0 5px; border-radius: 5px; font-size: 12px; font-weight: 800; color: #fff; background: #b33430; vertical-align: 2px; }
.ob-ratings { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ob-ratings span { font-size: 12.5px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.ob-ratings em { font-style: normal; font-weight: 700; color: var(--text-3); }
.ob-player-ok { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent); }
.ob-player-ok svg { width: 16px; height: 16px; stroke-width: 3; }
/* step 3 */
.ob-pick { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.ob-pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ob-pick-main b { font-size: 17px; font-weight: 800; }
.ob-pick-main span { font-size: 14.5px; font-weight: 700; color: var(--text-2); }
.ob-pick-main small { font-size: 13px; font-weight: 600; color: var(--text-3); margin-top: 2px; }
.ob-link { flex: none; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.ob-change { margin: 0 0 14px; }
.ob-change .imp-choice { margin: 0; }
.ob-change .is-locked { opacity: .45; }
.ob-goal { margin: 6px 0 20px; }
.ob-goal-h { margin: 0 0 8px; font-weight: 800; font-size: 15px; }
.ob-goal-h small { font-weight: 700; color: var(--text-3); font-size: 13px; margin-left: 4px; }
.ob-goal-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-goal-row .chip { min-height: 40px; padding: 6px 14px; cursor: pointer; font-weight: 800; }
.ob-goal-row .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
/* step 4 */
.ob-build-ico { position: relative; width: 64px; height: 64px; margin: 0 0 16px; }
.ob-build-ico .app-logo { width: 64px; height: 64px; border-radius: 18px; }
.ob-build-ico i { position: absolute; inset: -6px; border-radius: 22px; border: 3px solid transparent; border-top-color: var(--accent); border-right-color: color-mix(in srgb, var(--accent) 40%, transparent); animation: ob-spin calc(1.1s * var(--motion, 1)) linear infinite; }
@keyframes ob-spin { to { transform: rotate(360deg); } }
.ob-meter { margin: 0 0 16px; }
.ob-bar { height: 10px; }
.ob-bar > i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.ob-meter-t { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13.5px; }
.ob-meter-t b { font-weight: 800; font-variant-numeric: tabular-nums; }
.ob-meter-t span { color: var(--text-3); font-weight: 600; text-align: right; }
.ob-live { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; min-height: 40px; }
.ob-live li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14.5px; font-weight: 600; animation: app-in-up calc(.3s * var(--motion, 1)) var(--ease, ease) both; }
.ob-live li svg { flex: none; width: 18px; height: 18px; color: var(--accent-text); }
.ob-err { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--text); font-weight: 700; font-size: 14px; }
.ob-err[hidden] { display: none; }
/* step 5: the reveal */
.ob-reveal-top { margin: 0 0 10px; }
.ob-reveal-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-text); background: var(--accent-soft); }
.ob-reveal-badge svg { width: 15px; height: 15px; }
.ob-weak { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.ob-w { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border);
  border-left: 4px solid var(--tab-accent, var(--accent)); animation: app-in-up calc(.4s * var(--motion, 1)) var(--ease, ease) both; animation-delay: var(--d, 0ms); }
.ob-w-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--tab-accent); background: color-mix(in srgb, var(--tab-accent) 15%, transparent); }
.ob-w-ico svg { width: 18px; height: 18px; }
.ob-w-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ob-w-main b { font-size: 15.5px; font-weight: 800; overflow-wrap: anywhere; }
.ob-w-main small { font-size: 13.5px; font-weight: 600; color: var(--text-2); line-height: 1.4; }
.ob-w-main .ob-w-move { color: var(--text); padding: 6px 9px; margin-top: 4px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 700; }
.ob-w-main .crp-lock { align-self: flex-start; margin-top: 6px; }
.ob-w-pct { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.ob-w-pct b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--tab-accent); }
.ob-w-pct small { font-size: 11.5px; font-weight: 700; color: var(--text-3); margin-top: 3px; }
.ob-more { display: flex; justify-content: center; margin: 0 0 18px; }
.ob-more:empty { display: none; }
.ob-more-n { font-size: 14px; font-weight: 800; color: var(--text-2); }

/* ---------------------------------------------------------------- the 3-step tour (coach marks, non-blocking) */
.ob-tour { position: fixed; inset: 0; z-index: 9000; pointer-events: none; }
.ob-tour-ring { position: fixed; border-radius: 22px; box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(5, 8, 16, .55); transition: all calc(.3s * var(--motion, 1)) var(--ease, ease); }
.ob-tour-ring[hidden] { display: none; }
.ob-tour-card { position: fixed; pointer-events: auto; padding: 16px 16px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-3);
  animation: app-in-up calc(.25s * var(--motion, 1)) var(--ease, ease) both; }
.ob-tour-n { font-size: 12px; font-weight: 800; color: var(--accent-text); letter-spacing: .04em; margin-bottom: 4px; }
.ob-tour-card h3 { margin: 0 0 6px; font-size: 18px; line-height: 1.25; }
.ob-tour-card p { margin: 0 0 12px; font-size: 14.5px; font-weight: 600; color: var(--text-2); line-height: 1.45; }
.ob-tour-acts { display: flex; justify-content: flex-end; gap: 8px; }
.ob-tour-skip, .ob-tour-next { min-height: 40px; padding: 0 14px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 800; font-size: 14px; }
.ob-tour-skip { border: 0; background: none; color: var(--text-2); }
.ob-tour-next { border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 var(--accent-deep); }

/* ---------------------------------------------------------------- one Fix button per card: the rest are quiet one-tap links */
.st-fixrow { display: inline-flex; align-items: center; gap: 4px; min-height: 36px !important; height: auto !important; padding: 4px 6px; margin: 2px 0 0 -6px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 800; color: var(--accent-text, var(--accent)); text-align: left; white-space: normal; line-height: 1.25; max-width: 100%; }
.st-fixrow:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.st-fixrow:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; }
.st-fixrow::after { content: "\203A"; font-size: 17px; line-height: 1; margin-left: 2px; }
.app[data-tab="home"] .pl-plan { display: none; }   /* Home already shows Today's plan (folded) right under the hero */
.st-fixwrap:has(> .st-fixrow) { margin-top: 2px; }

/* ---------------------------------------------------------------- Profile: two calm folded groups */
.pf-group { border-radius: var(--radius, 16px); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); min-width: 0; }
.pf-group > .pf-group-sum { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; cursor: pointer; border-radius: inherit; }
.pf-group > .pf-group-sum::-webkit-details-marker { display: none; }
.pf-group > .pf-group-sum:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.pf-group-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pf-group-t b { font-size: 17px; font-weight: var(--fw-heavy, 800); }
.pf-group-t small { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.pf-group > .pf-group-sum > svg { flex: none; width: 18px; height: 18px; color: var(--text-3); transition: transform calc(.18s * var(--motion, 1)) var(--ease, ease); }
.pf-group[open] > .pf-group-sum > svg { transform: rotate(90deg); }
.pf-group > .pf-col { padding: 0 12px 14px; display: grid; gap: 14px; }
.pf-account-card:empty { display: none; }

/* ---------------------------------------------------------------- folded things are really folded: closed <details> content takes no
   space and cannot be hit (newer engines keep laid-out boxes for it), so folds are calm for eyes, keyboards and hit-testing alike */
details:not([open]) > :not(summary) { display: none !important; }

/* phones: an area's chip row sits flush under the header (no 14px strip of page between them) */
@media (max-width: 899px) {
  .app[data-tab="openings"] .app-main, .app[data-tab="middlegame"] .app-main, .app[data-tab="endgame"] .app-main { padding-top: 0; }
  html.ts-on .app[data-tab] .app-main, html.drill-focus .app[data-tab] .app-main { padding-top: 10px; }
}
