/* Championship 2026 — shared interface, 2026-09-29 redesign 「數位生態箱」.
 *
 * Tokens live in ui/tokens.css (loaded first). This sheet holds the base,
 * the portrait frame, the shared HUD (status bar and tool dock), the shared
 * components (buttons, dialogs, sheets, page scaffold) and the five record
 * pages: roster, schedule, help, tamer and championship run. Each game area
 * keeps its own sheet: intRh2Styles.css (Raising Home), vs2Styles.css (Gate,
 * Hunt, Shop, Database, Cage), vs5Styles.css (Battle), opening.css (title),
 * and ui/highlight.css holds the one important-highlight template.
 * The earlier reskin layers (nativeUiSkin, daylightSkin, raisingHomeHud,
 * huntMobile, facilityBattleMobile, trainingLabels, shopOriginalVideo) were
 * folded in and are no longer linked; nothing here should need !important.
 */

/* ======================================================================= *
 * 1. Base
 * ======================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  color: var(--c-text-1);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  overscroll-behavior: none;
  overscroll-behavior-y: contain;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

html { background: var(--c-void); }
body {
  overflow: hidden;
  /* The night lab: a lamp over the middle of the screen, falling off to ink. */
  background:
    var(--bg-pattern),
    radial-gradient(90% 60% at 50% 48%, var(--c-stage-glow) 0%, transparent 70%),
    linear-gradient(180deg, var(--c-backdrop-top) 0%, var(--c-ground) 45%, var(--c-backdrop-bottom) 100%);
}

/* The installed application's unsafe canvas persists after leaving TITLE.
   Paint the shared game backdrop behind the Home indicator, rather than the
   html c-void fallback. Foreground controls keep their existing safe padding. */
html:has(body[data-web-app]):not(:has(#cm-title:not([hidden]))) {
  min-height:100lvh;
  background-color:var(--c-backdrop-bottom);
  background-image:var(--bg-pattern),
    radial-gradient(90% 60% at 50% 48%,var(--c-stage-glow) 0%,transparent 70%),
    linear-gradient(180deg,var(--c-backdrop-top) 0%,var(--c-ground) 45%,var(--c-backdrop-bottom) 100%);
}
body[data-web-app]:not([data-portrait-frame]) { min-height:var(--cm-app-viewport-height,100dvh); }
html.da-open:has(body[data-web-app]):not(:has(#cm-title:not([hidden]))) { background:#070b14; }

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { max-width: 100%; }

:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}
::selection { background: var(--c-selection); color: var(--c-text-1); }
* { scrollbar-width: thin; scrollbar-color: var(--c-line-3) transparent; }

#cm-root[hidden] { display: none; }
/* Visibility is owned by the views; a grid or flex rule must never bring a
   hidden panel back. */
#cm-root [hidden],
.cm-status-bar [hidden],
.cm-toolbar[hidden],
.cm-toolbar [hidden] { display: none; }
/* The arcade theme's quick dock (ui/arcade.css); other themes keep the eight-slot rail only. */
.cm-toolbar__quick { display: none; }

.cm-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The shared Pixi canvas keeps crisp pixels wherever it is mounted. */
.cm-field-canvas, #cm-root canvas, .da-root canvas { display: block; image-rendering: pixelated; touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* ======================================================================= *
 * 2. Portrait frame (Owner 2026-09-13): a sideways screen shows the portrait
 *    game centred and scaled, one containing block for every fixed layer.
 * ======================================================================= */
body[data-portrait-frame] {
  position: fixed;
  left: var(--cm-frame-center-x);
  top: var(--cm-frame-center-y);
  width: 390px;
  height: var(--cm-viewport-height);
  transform: translate(-50%, -50%) scale(var(--cm-frame-scale));
  transform-origin: center;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 0 0 1px var(--c-line-1), var(--shadow-frame);
}
html:has(body[data-portrait-frame]) {
  background:
    radial-gradient(60% 80% at 50% 50%, var(--c-ground-raised) 0%, var(--c-void) 70%),
    var(--c-void);
}
body[data-portrait-frame] .cm-status-bar,
body[data-portrait-frame] .cm-toolbar { left: 0; right: 0; width: auto; transform: none; }

/* Screens sit between the shared bars; each bar reports its own height. */
:root {
  --cm-screen-top: 0px;
  --cm-screen-bottom: 0px;
  --cm-screen-height: calc(var(--cm-viewport-height, var(--cm-app-viewport-height, 100dvh)) - var(--cm-screen-top) - var(--cm-screen-bottom));
}
body[data-status-bar="on"] {
  --cm-screen-top: var(--cm-status-bar-height, var(--hud-height));
  --cm-screen-height: calc(var(--cm-viewport-height, var(--cm-app-viewport-height, 100dvh)) - var(--cm-screen-top) - var(--cm-screen-bottom));
}
body[data-status-bar="on"] #cm-root { top: var(--cm-screen-top); }
body[data-toolbar="on"] {
  --cm-screen-bottom: var(--cm-toolbar-height, var(--dock-height));
  --cm-screen-height: calc(var(--cm-viewport-height, var(--cm-app-viewport-height, 100dvh)) - var(--cm-screen-top) - var(--cm-screen-bottom));
}
body[data-toolbar="on"] #cm-root { bottom: var(--cm-screen-bottom); }
/* Native-size installed screens must use the same measured height as their
   inner scaffold. Do not stretch the logical, scaled sideways game frame. */
body[data-web-app]:not([data-portrait-frame]) #cm-root {
  bottom:auto; height:var(--cm-screen-height);
}
body[data-web-app]:not([data-portrait-frame]) #cm-root[data-active-screen="RAISING_HOME"] {
  height:var(--cm-app-viewport-height);
}
body[data-web-app] .da-root { bottom:auto; height:var(--cm-app-viewport-height); }

/* ======================================================================= *
 * 3. Top HUD — the original's info_bar fields plus bits and the save state
 * ======================================================================= */
.cm-status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-hud);
  display: flex;
  /* A larger reading size or a longer language may need a second row: the
     readouts wrap instead of running off the edge, and every screen below
     follows the bar's measured height (--cm-status-bar-height). */
  flex-wrap: wrap;
  align-items: center;
  gap: 6px var(--sp-2);
  min-height: calc(var(--hud-height) + var(--safe-top));
  padding: calc(var(--safe-top) + 6px) max(var(--sp-3), var(--safe-right)) 6px max(var(--sp-3), var(--safe-left));
  background: var(--c-surface-bar);
  border-bottom: 1px solid var(--c-line-1);
  -webkit-backdrop-filter: var(--backdrop-glass);
  backdrop-filter: var(--backdrop-glass);
  color: var(--c-text-1);
  font-size: var(--fs-body-sm);
  line-height: 1;
  font-weight: var(--fw-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Over the habitat the bar is part of the scene: no plate, a soft fade. */
.cm-status-bar[data-screen="RAISING_HOME"] {
  background: linear-gradient(180deg, color-mix(in srgb, var(--c-ground) 86%, transparent) 0%, color-mix(in srgb, var(--c-ground) 50%, transparent) 70%, transparent 100%);
  border-bottom-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.cm-status-bar__season {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px 0 8px;
  border-radius: var(--r-tag);
  background: var(--c-surface-2);
  color: var(--c-text-1);
  font-size: var(--fs-label);
}
.cm-status-bar__season::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--season, var(--c-text-3));
}
.cm-status-bar__season[data-season="spring"] { --season: var(--c-season-spring); }
.cm-status-bar__season[data-season="summer"] { --season: var(--c-season-summer); }
.cm-status-bar__season[data-season="autumn"] { --season: var(--c-season-autumn); }
.cm-status-bar__season[data-season="winter"] { --season: var(--c-season-winter); }

.cm-status-bar__day { display: inline-flex; align-items: baseline; gap: 0.2em; color: var(--c-text-2); }
.cm-status-bar__day-number { color: var(--c-text-1); font-size: var(--fs-body); }
.cm-status-bar__time { color: var(--c-text-1); font-size: var(--fs-body); letter-spacing: 0.02em; }

/* Every screen now titles itself, so the bar's mode name is for assistive
   technology only. */
.cm-status-bar__mode {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.cm-status-bar__extras { display: inline-flex; align-items: center; gap: var(--sp-2); margin-left: auto; min-width: 0; }
/* Bits and today's matches belong to Home; the Shop and Battle carry their own. */
.cm-status-bar:not([data-screen="RAISING_HOME"]) :is(.cm-status-bar__bits, .cm-status-bar__matches) { display: none; }

.cm-status-bar__bits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-gold-strong);
  font-size: var(--fs-body);
}
.cm-status-bar__bits::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--c-coin-light) 0 22%, var(--c-gold) 45%, var(--c-coin-shade) 100%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-text-on-gold) 35%, transparent);
}

.cm-status-bar__matches {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--c-accent-line);
  border-radius: var(--r-tag);
  background: var(--c-accent-soft);
  color: var(--c-accent-strong);
  font-size: var(--fs-label);
  font-weight: var(--fw-strong);
}
.cm-status-bar__matches::before { content: ""; width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); }
/* A 44px touch area around a compact chip. */
.cm-status-bar__matches::after { content: ""; position: absolute; inset: -8px -4px; }

/* Save state: a compact mark with a 44px hit area. The mark says the state;
   words appear only with news -- queued, just written, or failed. Tapping it
   explains what "saved" means in this build (this device only). */
.cm-status-bar__save {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: var(--r-tag);
  background: transparent;
  color: var(--c-text-3);
  font: var(--fw-strong) var(--fs-label)/1 var(--font-ui);
  white-space: nowrap;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.cm-status-bar__save::after { content: ""; position: absolute; inset: -8px -4px; }
.cm-status-bar__save::before {
  content: "";
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  background: currentColor;
  -webkit-mask: var(--icon-check) center / contain no-repeat;
  mask: var(--icon-check) center / contain no-repeat;
}
.cm-status-bar__save-text { display: none; }
.cm-status-bar__save:is([data-state="SAVING"], [data-state="SAVE_FAILED"], [data-flash="true"]) .cm-status-bar__save-text { display: inline; }
/* Queued: an autosave will write as soon as the screen allows. */
.cm-status-bar__save[data-state="SAVING"] { color: var(--c-accent-strong); }
.cm-status-bar__save[data-state="SAVING"]::before {
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  background: transparent;
  -webkit-mask: none;
  mask: none;
  animation: cm-save-spin 0.9s linear infinite;
}
@keyframes cm-save-spin { to { transform: rotate(360deg); } }
/* Just written: the words stay for a moment in the accent. */
.cm-status-bar__save[data-flash="true"] { border-color: var(--c-accent-line); background: var(--c-accent-soft); color: var(--c-accent-strong); }
.cm-status-bar__save[data-state="SAVE_FAILED"] { border-color: var(--c-danger-line); background: var(--c-danger-soft); color: var(--c-danger); }
.cm-status-bar__save[data-state="SAVE_FAILED"]::before { -webkit-mask-image: var(--icon-alert); mask-image: var(--icon-alert); }
@media (hover: hover) { .cm-status-bar__save:hover { background: var(--c-surface-2); color: var(--c-text-1); } }
.cm-status-bar__save:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
/* Save news for assistive technology only. */
.cm-status-bar__announce { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.cm-status-bar__end-day {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-tag);
  background: var(--c-surface-2);
  color: var(--c-text-1);
  font-size: var(--fs-label);
}
.cm-status-bar__end-day:disabled { opacity: 0.4; }

/* ======================================================================= *
 * 4. Tool dock — the original's ui/toolbar.nxr: six tools and two menus
 * ======================================================================= */
.cm-toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-hud);
}

.cm-toolbar__rail {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  padding: 6px max(6px, var(--safe-left)) calc(6px + var(--safe-bottom)) max(6px, var(--safe-right));
  background: var(--c-surface-bar);
  border-top: 1px solid var(--c-line-1);
  -webkit-backdrop-filter: var(--backdrop-glass);
  backdrop-filter: var(--backdrop-glass);
}

.cm-toolbar__cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 60px;
  padding: 4px 2px;
  border: 1px solid transparent;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--c-text-2);
  font-size: var(--fs-caption);
  font-weight: var(--fw-strong);
  line-height: 1.15;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.cm-toolbar__cell::before {
  content: "";
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  background: center / contain no-repeat;
  image-rendering: pixelated;
  transition: transform var(--dur-fast) var(--ease-out);
}
.cm-toolbar__cell[data-icon="hand"]::before { background-image: url("../../../assets/production/toolbar/licensed-runtime-v1/hand-rest.png"); }
.cm-toolbar__cell[data-icon="feed"]::before { background-image: url("../../../assets/production/toolbar/licensed-runtime-v1/feed-rest.png"); }
.cm-toolbar__cell[data-icon="protein"]::before { background-image: url("../../../assets/production/toolbar/licensed-runtime-v1/protein-rest.png"); }
.cm-toolbar__cell[data-icon="clean"]::before { background-image: url("../../../assets/production/toolbar/licensed-runtime-v1/clean-rest.png"); }
.cm-toolbar__cell[data-icon="woundMedicine"]::before { background-image: url("../../../assets/production/toolbar/licensed-runtime-v1/woundMedicine-rest.png"); }
.cm-toolbar__cell[data-icon="medicine"]::before { background-image: url("../../../assets/production/toolbar/licensed-runtime-v1/medicine-rest.png"); }
.cm-toolbar__cell[data-icon="manage"]::before { background-image: url("../../../assets/production/toolbar/licensed-runtime-v1/manage-rest.png"); }
.cm-toolbar__cell[data-icon="system"]::before { background-image: url("../../../assets/production/toolbar/licensed-runtime-v1/system-rest.png"); }

.cm-toolbar__cell-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  text-align: center;
  line-height: 1.25;
  word-break: normal;
  overflow-wrap: break-word;
}
/* Icon captions: the icon carries the meaning and the full name is the
   button's label, so the caption keeps its size at larger reading sizes
   and English letters sit a little tighter. */
.cm-toolbar__cell-label { font-size: min(var(--fs-caption), 11px); }
:root:lang(en) .cm-toolbar__cell { padding-inline: 0; }
:root:lang(en) .cm-toolbar__cell-label { font-size: 10px; line-height: 1.2; letter-spacing: -0.02em; }
:root:lang(vi) .cm-toolbar__cell,
:root:lang(th) .cm-toolbar__cell { padding-inline: 1px; }
:root:lang(vi) .cm-toolbar__cell-label { font-size: 10px; line-height: 1.25; }
:root:lang(th) .cm-toolbar__cell-label { font-size: 10.5px; line-height: 1.25; letter-spacing: -0.01em; }

/* The two menus sit apart from the six tools. */
.cm-toolbar__cell[data-menu-id="MANAGEMENT"] { margin-left: 4px; }
.cm-toolbar__cell[data-menu-id="MANAGEMENT"]::after {
  content: "";
  position: absolute;
  left: -4px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--c-line-2);
}

@media (hover: hover) {
  .cm-toolbar__cell:hover:not(:disabled) { background: var(--c-surface-2); color: var(--c-text-1); }
}
.cm-toolbar__cell:active:not(:disabled)::before { transform: scale(0.92); }

/* The chosen tool and the open menu: the one living colour. */
.cm-toolbar__cell[aria-pressed="true"],
.cm-toolbar__cell[aria-expanded="true"] {
  border-color: var(--c-accent-line);
  background: var(--c-accent-soft);
  color: var(--c-accent-strong);
  box-shadow: 0 0 16px color-mix(in srgb, var(--c-accent) 18%, transparent);
}
.cm-toolbar__cell[aria-pressed="true"]::before { transform: translateY(-1px) scale(1.06); }

.cm-toolbar__cell:disabled { opacity: 0.38; }

/* Stock rides the icon's top-right corner. */
.cm-toolbar__stock {
  position: absolute;
  top: 3px;
  left: calc(50% + 8px);
  min-width: 20px;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--r-tag);
  background: var(--c-surface-3);
  color: var(--c-text-1);
  font-size: 10px;
  line-height: 17px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.cm-toolbar__cell[data-owned="0"] .cm-toolbar__stock { background: var(--c-danger-soft); color: var(--c-danger); }

/* ---- Active tool: what it does, and how to put it down ------------------ */
.cm-toolbar__tool-hint {
  position: absolute;
  left: 50%;
  bottom: calc(100% + var(--sp-2));
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 4px 4px 4px 14px;
  transform: translateX(-50%);
  border: 1px solid var(--c-accent-line);
  border-radius: var(--r-card);
  background: var(--c-surface-hud);
  box-shadow: var(--shadow-float);
  font-size: var(--fs-body-sm);
  animation: cm-rise var(--dur-base) var(--ease-out);
}
.cm-toolbar__tool-name { color: var(--c-accent-strong); font-weight: var(--fw-heavy); white-space: nowrap; }
.cm-toolbar__tool-text { min-width: 0; overflow: hidden; color: var(--c-text-2); text-overflow: ellipsis; white-space: nowrap; }
.cm-toolbar__tool-done {
  flex: 0 0 auto;
  min-height: var(--target);
  padding: 0 var(--sp-4);
  border: 0;
  border-radius: var(--r-control);
  background: var(--c-surface-3);
  color: var(--c-text-1);
  font-weight: var(--fw-strong);
}
.cm-toolbar__menu:not([hidden]) ~ .cm-toolbar__tool-hint { display: none; }

/* ---- Menus: a sheet above the dock, entries in groups ------------------- */
.cm-toolbar__menu {
  position: absolute;
  left: max(var(--sp-3), var(--safe-left));
  right: max(var(--sp-3), var(--safe-right));
  bottom: calc(100% + var(--sp-2));
  max-width: 440px;
  margin: 0 auto;
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-sheet);
  background: var(--c-surface-1);
  box-shadow: var(--shadow-lift);
  animation: cm-rise var(--dur-base) var(--ease-out);
}
@keyframes cm-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cm-fade { from { opacity: 0; } to { opacity: 1; } }

.cm-toolbar__group { display: grid; gap: var(--sp-2); }
.cm-toolbar__group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 2px;
  color: var(--c-text-3);
  font-size: var(--fs-label);
  font-weight: var(--fw-strong);
  letter-spacing: 0.04em;
}
.cm-toolbar__group-title::before { content: ""; width: 9px; height: 9px; background: var(--motif-stair) no-repeat; }
.cm-toolbar__group-entries { display: grid; gap: 6px; }
.cm-toolbar__group[data-prominent="true"] .cm-toolbar__group-entries { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cm-toolbar__group[data-separate="true"] { padding-top: var(--sp-3); border-top: 1px solid var(--c-line-1); }

.cm-toolbar__entry {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid var(--c-line-1);
  border-radius: var(--r-control);
  background: var(--c-surface-2);
  color: var(--c-text-1);
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.cm-toolbar__entry-label { font-size: var(--fs-body); font-weight: var(--fw-strong); line-height: 1.25; }
.cm-toolbar__entry-hint { color: var(--c-text-3); font-size: var(--fs-label); line-height: var(--lh-label); }
@media (hover: hover) {
  .cm-toolbar__entry:hover:not(:disabled) { border-color: var(--c-accent-line); background: var(--c-surface-3); }
}
.cm-toolbar__entry:active:not(:disabled) { background: var(--c-surface-3); }
.cm-toolbar__entry:disabled { opacity: 0.45; }
.cm-toolbar__entry[data-state="NOT_IMPLEMENTED"] .cm-toolbar__entry-hint::after { content: var(--label-not-open); }
/* The three destinations of the loop read as tiles. */
.cm-toolbar__group[data-prominent="true"] .cm-toolbar__entry {
  min-height: 78px;
  justify-items: center;
  text-align: center;
  border-color: var(--c-accent-line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c-accent) 12%, transparent), color-mix(in srgb, var(--c-accent) 4%, transparent));
}
.cm-toolbar__group[data-prominent="true"] .cm-toolbar__entry-label { font-size: var(--fs-title-2); }
.cm-toolbar__group[data-separate="true"] .cm-toolbar__entry { background: transparent; }

/* A 360px phone: the bar keeps every readout by dropping words, never the
   numbers; the dock's eight cells keep 44px each by losing their gaps. */
@media (max-width: 379px) {
  .cm-status-bar { gap: 6px; padding-inline: max(10px, var(--safe-left)) max(10px, var(--safe-right)); }
  .cm-status-bar__extras { gap: 6px; }
  .cm-status-bar__matches { padding: 0 8px; }
  .cm-status-bar__matches-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cm-status-bar__bits { gap: 4px; font-size: var(--fs-body-sm); }
  .cm-status-bar__bits::before { width: 12px; height: 12px; }
  .cm-toolbar__rail { gap: 0; padding-inline: max(4px, var(--safe-left)) max(4px, var(--safe-right)); }
  .cm-toolbar__cell[data-menu-id="MANAGEMENT"] { margin-left: 0; }
  .cm-toolbar__cell[data-menu-id="MANAGEMENT"]::after { left: 0; }
}

/* A wide screen has room for the icon beside its name. */
@media (min-width: 600px) {
  body:not([data-portrait-frame]) .cm-toolbar__rail { max-width: 760px; margin: 0 auto; border-inline: 1px solid var(--c-line-1); border-radius: var(--r-card) var(--r-card) 0 0; }
  body:not([data-portrait-frame]) .cm-toolbar__cell { flex-direction: row; gap: 6px; font-size: var(--fs-label); }
  body:not([data-portrait-frame]) .cm-toolbar__cell::before { width: 30px; height: 30px; }
  body:not([data-portrait-frame]) .cm-toolbar__stock { left: auto; right: 4px; top: 2px; }
  body:not([data-portrait-frame]) .cm-toolbar__menu { max-width: 520px; }
}

/* ======================================================================= *
 * 5. Components
 * ======================================================================= */

/* ---- Buttons --------------------------------------------------------------
 * Primary: the one action a screen is for. Secondary: everything else that
 * is pressed. Back: leave, always on the left. Danger: only in confirmations. */
.cm-button,
.cm-screen-back,
.cm-screen-primary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control);
  padding: 0 var(--sp-5);
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-control);
  background: var(--c-surface-2);
  color: var(--c-text-1);
  font-size: var(--fs-body);
  font-weight: var(--fw-strong);
  line-height: 1.2;
  text-align: center;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.cm-button--primary,
.cm-screen-primary {
  border-color: transparent;
  background: var(--btn-primary-bg);
  box-shadow: var(--btn-primary-edge);
  color: var(--c-text-on-accent);
}
@media (hover: hover) {
  .cm-button:hover:not(:disabled), .cm-screen-back:hover:not(:disabled) { border-color: var(--c-line-3); background: var(--c-surface-3); }
  .cm-button--primary:hover:not(:disabled), .cm-screen-primary:hover:not(:disabled) { filter: var(--btn-primary-hover); }
}
:is(.cm-button, .cm-screen-back, .cm-screen-primary):active:not(:disabled) { transform: translateY(1px); }
:is(.cm-button, .cm-screen-back, .cm-screen-primary):disabled {
  border-color: var(--c-line-1);
  background: var(--c-surface-1);
  box-shadow: none;
  color: var(--c-text-disabled);
}
/* The drawn chevron marks the one way back: the first button of a page footer.
   The same class also styles quiet buttons (關閉, 取消, a registration toggle)
   that are not a way back, so they get no chevron. */
.cm-screen-footer > .cm-screen-back:first-child::before { content: ""; flex: 0 0 auto; width: 8px; height: 14px; margin-right: 2px; background: currentColor; -webkit-mask: var(--icon-chevron-left) center / contain no-repeat; mask: var(--icon-chevron-left) center / contain no-repeat; }

/* ---- Confirmation dialog (uiDialog.js) ---------------------------------- */
dialog.cm-dialog {
  width: min(380px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--c-text-1);
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog.cm-dialog::backdrop { background: var(--c-scrim); }
dialog.cm-dialog[open] { animation: cm-pop var(--dur-base) var(--ease-spring); }
@keyframes cm-pop { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
.cm-dialog__panel {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-sheet);
  background: var(--c-surface-1);
  box-shadow: var(--shadow-lift);
}
.cm-dialog__title { margin: 0; font-size: var(--fs-title-2); line-height: var(--lh-title-2); font-weight: var(--fw-heavy); }
.cm-dialog__message { margin: 0; color: var(--c-text-2); font-size: var(--fs-body); line-height: var(--lh-body); white-space: pre-line; }
.cm-dialog__actions { display: grid; gap: var(--sp-2); margin-top: var(--sp-2); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cm-dialog__actions[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.cm-dialog__actions[data-count="3"] { grid-template-columns: minmax(0, 1fr); }
.cm-dialog__action {
  min-height: var(--control);
  padding: 0 var(--sp-3);
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-control);
  background: var(--c-surface-2);
  color: var(--c-text-1);
  font-weight: var(--fw-strong);
}
.cm-dialog__action--primary { border-color: transparent; background: var(--btn-primary-bg); box-shadow: var(--btn-primary-edge); color: var(--c-text-on-accent); }
.cm-dialog__action--danger { border-color: var(--c-danger-line); background: var(--c-danger-soft); color: var(--c-danger-text); }
@media (hover: hover) {
  .cm-dialog__action:hover { background: var(--c-surface-3); }
  .cm-dialog__action--primary:hover { background: var(--btn-primary-bg); filter: var(--btn-primary-hover); }
  .cm-dialog__action--danger:hover { background: color-mix(in srgb, var(--c-danger) 24%, transparent); }
}

/* ---- Sheet (item details on a list page) --------------------------------- */
.cm-sheet { position: fixed; inset: 0; z-index: var(--z-sheet); display: grid; align-items: end; }
.cm-sheet__scrim { position: absolute; inset: 0; border: 0; padding: 0; background: var(--c-scrim); animation: cm-fade var(--dur-base) var(--ease-out); }
.cm-sheet__panel {
  position: relative;
  display: grid;
  gap: var(--sp-3);
  width: min(100%, 560px);
  max-height: min(78vh, calc(var(--cm-screen-height, 100vh) + var(--cm-screen-bottom) - 24px));
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-5) calc(var(--sp-5) + var(--safe-bottom));
  overflow-y: auto;
  border: 1px solid var(--c-line-2);
  border-bottom: 0;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--c-surface-1);
  box-shadow: var(--shadow-lift);
  /* A sheet answers a tap: the standard 200 ms, not the page-entry 320 ms. */
  animation: cm-rise var(--dur-base) var(--ease-out);
}
.cm-sheet__panel::before {
  content: "";
  justify-self: center;
  width: 40px;
  height: 4px;
  margin: -8px 0 4px;
  border-radius: 2px;
  background: var(--c-line-3);
}
.cm-sheet__actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--sp-2); margin-top: var(--sp-2); }
.cm-sheet__close { min-height: var(--control); }
@media (min-width: 700px) {
  body:not([data-portrait-frame]) .cm-sheet { align-items: center; }
  body:not([data-portrait-frame]) .cm-sheet__panel { border-bottom: 1px solid var(--c-line-2); border-radius: var(--r-sheet); padding-bottom: var(--sp-5); }
  body:not([data-portrait-frame]) .cm-sheet__panel::before { display: none; }
}

/* ======================================================================= *
 * 6. Record pages: one scaffold for roster, schedule, help, tamer and the
 *    championship run. Header (kicker + title + lede), body, footer with
 *    Back on the left and the page's one action on the right.
 * ======================================================================= */
:is(.cm-digimon-root, .cm-schedule-root, .cm-help-root, .cm-tamer-root, .cm-championship-root) {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: 96px;
}
:is(.cm-digimon-shell, .cm-schedule-shell, .cm-help-shell, .cm-tamer-shell, .cm-championship-shell) {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  width: min(100%, 560px);
  min-height: 100%;
  margin: 0 auto;
  padding: var(--sp-5) max(var(--sp-4), var(--safe-left)) 0;
}

:is(.cm-digimon-kicker, .cm-schedule-kicker, .cm-help-kicker, .cm-tamer-kicker, .cm-championship-kicker) {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--c-accent);
  font-size: var(--fs-label);
  font-weight: var(--fw-strong);
  letter-spacing: 0.08em;
}
:is(.cm-digimon-kicker, .cm-schedule-kicker, .cm-help-kicker, .cm-tamer-kicker, .cm-championship-kicker)::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--motif-stair) no-repeat;
}
:is(.cm-digimon-title, .cm-schedule-title, .cm-help-title, .cm-tamer-title, .cm-championship-title) {
  margin: -8px 0 0;
  font-size: var(--fs-title-1);
  line-height: var(--lh-title-1);
  font-weight: var(--fw-heavy);
}
/* The signature link line (2026-10-15): a short teal cable under each page
   title that ends in a lit node -- the 「網線」 of the product's name. Only
   page titles carry it, so it stays recognisable. The retro theme keeps its
   own skin untouched. */
:root:not([data-theme="classic"]) :is(.cm-vs2-title, .cm-digimon-title, .cm-schedule-title, .cm-help-title, .cm-tamer-title, .cm-championship-title) {
  padding-bottom: 9px;
  background:
    radial-gradient(circle, var(--c-accent-hi) 0 2.5px, color-mix(in srgb, var(--c-accent-hi) 35%, transparent) 3px, transparent 5px) 50px 100% / 12px 12px no-repeat,
    linear-gradient(90deg, var(--c-accent) 0%, var(--c-accent-hi) 100%) 0 calc(100% - 5px) / 54px 2px no-repeat;
}
.cm-screen-lede { margin: -6px 0 0; color: var(--c-text-2); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }

/* The footer stays reachable at the bottom of the page. */
.cm-screen-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  margin: auto calc(-1 * max(var(--sp-4), var(--safe-left))) 0;
  padding: var(--sp-3) max(var(--sp-4), var(--safe-left)) calc(var(--sp-3) + var(--safe-bottom));
  border-top: 1px solid var(--c-line-1);
  background: var(--c-surface-bar);
  -webkit-backdrop-filter: var(--backdrop-glass);
  backdrop-filter: var(--backdrop-glass);
}
.cm-screen-footer > .cm-screen-back { flex: 0 1 auto; }
.cm-screen-footer > .cm-screen-primary { flex: 1 1 auto; max-width: 260px; margin-left: auto; }

/* Shared surfaces for a block of readouts. */
:is(.cm-tamer-fields, .cm-digimon-detail, .cm-schedule-season, .cm-championship-board, .cm-championship-run) {
  border: 1px solid var(--c-line-1);
  border-radius: var(--r-card);
  background: var(--c-surface-1);
}

/* ---- Roster ------------------------------------------------------------- */
.cm-digimon-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.cm-digimon-item { min-width: 0; }
.cm-digimon-item__button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px 8px 14px;
  border: 1px solid var(--c-line-1);
  border-radius: var(--r-control);
  background: var(--c-surface-1);
  color: var(--c-text-1);
  text-align: left;
}
.cm-digimon-item__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-strong); }
.cm-digimon-item__button[aria-pressed="true"] {
  border-color: var(--c-accent-line);
  background: var(--c-accent-soft);
  box-shadow: var(--glow-accent);
}
.cm-digimon-item__button[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 9px;
  height: 9px;
  background: var(--motif-stair) no-repeat;
}

.cm-digimon-detail {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0;
  margin: 0;
  padding: var(--sp-2) var(--sp-4);
}
.cm-digimon-detail__label,
.cm-digimon-detail__value {
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--c-line-1);
}
.cm-digimon-detail__label { color: var(--c-text-3); font-size: var(--fs-body-sm); }
.cm-digimon-detail__value { padding-left: var(--sp-4); color: var(--c-text-1); font-weight: var(--fw-strong); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cm-digimon-detail > :nth-last-child(2):is(dt, dd),
.cm-digimon-detail > :last-child:is(dt, dd) { border-bottom: 0; }
.cm-digimon-empty { grid-column: 1 / -1; margin: 0; padding: var(--sp-4) 0; color: var(--c-text-2); }
.cm-digimon-untraced { grid-column: 1 / -1; margin: var(--sp-2) 0; color: var(--c-text-3); font-size: var(--fs-label); }

.cm-digimon-resistance { grid-column: 1 / -1; display: grid; gap: 6px; padding: 12px 0 8px; }
.cm-digimon-resistance__title { color: var(--c-text-3); font-size: var(--fs-body-sm); }
.cm-digimon-resistance__bar { display: flex; height: 10px; overflow: hidden; border-radius: 5px; background: var(--c-surface-3); gap: 2px; }
.cm-digimon-resistance__segment { min-width: 2px; }
.cm-digimon-resistance__segment--heat { background: var(--c-element-heat); }
.cm-digimon-resistance__segment--cold { background: var(--c-element-cold); }
.cm-digimon-resistance__segment--thunder { background: var(--c-element-thunder); }
.cm-digimon-resistance__segment--light { background: var(--c-element-light); }
.cm-digimon-resistance__segment--dark { background: var(--c-element-dark); }

.cm-digimon-controls { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.cm-digimon-control {
  min-height: var(--target);
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-control);
  background: var(--c-surface-2);
  color: var(--c-text-1);
  font-weight: var(--fw-strong);
}
.cm-digimon-control:disabled { border-color: var(--c-line-1); background: transparent; color: var(--c-text-disabled); }
.cm-digimon-controls-note { margin: -4px 0 0; color: var(--c-text-3); font-size: var(--fs-label); }

.cm-digimon-rename {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border: 1px solid var(--c-accent-line);
  border-radius: var(--r-card);
  background: var(--c-surface-1);
  scroll-margin-bottom: 96px;
}
.cm-digimon-rename__label { color: var(--c-text-2); font-size: var(--fs-body-sm); }
.cm-digimon-rename__input {
  min-height: var(--control);
  padding: 0 var(--sp-3);
  border: 1px solid var(--c-line-3);
  border-radius: var(--r-control);
  background: var(--c-ground);
  color: var(--c-text-1);
  font-size: calc(16px * var(--text-scale));
}
.cm-digimon-rename__input:focus { border-color: var(--c-accent); outline: none; box-shadow: 0 0 0 3px var(--c-accent-soft); }
.cm-digimon-rename__actions { display: flex; justify-content: flex-end; gap: var(--sp-2); }
.cm-digimon-rename__actions button {
  min-height: var(--target);
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-control);
  background: var(--c-surface-2);
  color: var(--c-text-1);
  font-weight: var(--fw-strong);
}
.cm-digimon-rename__actions button[type="submit"] { border-color: transparent; background: var(--c-accent); color: var(--c-text-on-accent); }
.cm-digimon-rename__message { margin: 0; color: var(--c-warning); font-size: var(--fs-body-sm); }
.cm-digimon-rename__message:empty { display: none; }

/* ---- Schedule ------------------------------------------------------------ */
.cm-schedule-board { display: grid; gap: var(--sp-3); }
.cm-schedule-season { padding: var(--sp-3); }
.cm-schedule-season__name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-title-2);
  font-weight: var(--fw-heavy);
}
.cm-schedule-days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cm-schedule-day {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 6px;
  border-radius: var(--r-control);
  background: var(--c-ground-raised);
}
.cm-schedule-day[data-today="true"] { box-shadow: inset 0 0 0 1px var(--c-accent-line); background: color-mix(in srgb, var(--c-accent) 7%, transparent); }
.cm-schedule-day__number { margin: 0; color: var(--c-text-3); font-size: var(--fs-label); font-weight: var(--fw-strong); font-variant-numeric: tabular-nums; }
.cm-schedule-day[data-today="true"] .cm-schedule-day__number { color: var(--c-accent); }
.cm-schedule-day[data-today="true"] .cm-schedule-day__number::after { content: var(--label-today); }
.cm-schedule-day__none { margin: 0; color: var(--c-text-disabled); font-size: var(--fs-label); }
.cm-schedule-fixture {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: var(--target);
  padding: 6px 8px;
  border: 1px solid var(--c-line-1);
  border-radius: var(--r-tag);
  background: var(--c-surface-2);
  color: var(--c-text-1);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-strong);
  text-align: left;
}
.cm-schedule-fixture__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Status is carried by a mark as well as a colour. */
.cm-schedule-fixture[data-won="true"]::before { content: "✓"; color: var(--c-success); font-size: 12px; }
.cm-schedule-fixture[data-locked="true"] { color: var(--c-text-disabled); background: transparent; }
.cm-schedule-fixture[data-locked="true"]::before { content: "🔒"; font-size: 10px; filter: grayscale(1); opacity: 0.7; }
.cm-schedule-fixture[data-eligible-today="true"] { border-color: var(--c-accent-line); }
.cm-schedule-fixture[data-eligible-today="true"]::after { content: var(--label-eligible); margin-left: auto; padding: 1px 5px; border-radius: 4px; background: var(--c-accent-soft); color: var(--c-accent-strong); font-size: 10px; }
.cm-schedule-fixture[aria-pressed="true"] { border-color: var(--c-accent); background: var(--c-accent-soft); box-shadow: var(--glow-accent); }
.cm-schedule-empty { margin: 0; color: var(--c-text-2); }
.cm-schedule-footer { margin: 0; color: var(--c-text-3); font-size: var(--fs-label); line-height: var(--lh-label); text-align: center; }
.cm-schedule-detail { gap: var(--sp-3); }
.cm-schedule-detail__when { margin: 0; color: var(--c-accent); font-size: var(--fs-label); font-weight: var(--fw-strong); letter-spacing: 0.04em; }
.cm-schedule-detail__name { margin: 0; font-size: var(--fs-title-1); line-height: var(--lh-title-1); font-weight: var(--fw-heavy); }
.cm-schedule-detail__blurb { margin: 0; color: var(--c-text-2); }
.cm-schedule-facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px var(--sp-4);
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-control);
  background: var(--c-ground-raised);
}
.cm-schedule-facts dt { color: var(--c-text-3); font-size: var(--fs-body-sm); }
.cm-schedule-facts dd { margin: 0; text-align: right; font-weight: var(--fw-strong); font-variant-numeric: tabular-nums; }
.cm-schedule-short,
.cm-schedule-facts dd[data-short="true"] { color: var(--c-warning); }
.cm-schedule-register { width: 100%; }

/* ---- Help ---------------------------------------------------------------- */
.cm-help-list { display: grid; gap: 6px; }
.cm-help-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: var(--sp-3) 0 0;
  color: var(--c-text-3);
  font-size: var(--fs-label);
  font-weight: var(--fw-strong);
  letter-spacing: 0.06em;
}
.cm-help-heading + .cm-help-heading { margin-top: 0; }
.cm-help-heading::before { content: ""; width: 9px; height: 9px; background: var(--motif-stair) no-repeat; opacity: 0.8; }
.cm-help-topic {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-line-1);
  border-radius: var(--r-control);
  background: var(--c-surface-1);
  color: var(--c-text-1);
  font-weight: var(--fw-strong);
  text-align: left;
}
.cm-help-topic::after { content: ""; flex: 0 0 auto; width: 8px; height: 14px; margin-left: auto; background: var(--c-text-3); -webkit-mask: var(--icon-chevron-right) center / contain no-repeat; mask: var(--icon-chevron-right) center / contain no-repeat; }
.cm-help-topic[aria-pressed="true"] { border-color: var(--c-accent-line); background: var(--c-accent-soft); }
.cm-help-empty, .cm-help-note { margin: 0; color: var(--c-text-3); font-size: var(--fs-body-sm); }
.cm-help-detail__title { margin: 0; font-size: var(--fs-title-2); line-height: var(--lh-title-2); font-weight: var(--fw-heavy); }
.cm-help-detail__body { margin: 0; color: var(--c-text-1); line-height: 1.7; white-space: pre-line; }
.cm-help-detail__provenance { margin: 0; color: var(--c-text-3); font-size: var(--fs-label); }

/* ---- Tamer --------------------------------------------------------------- */
.cm-tamer-fields {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0;
  margin: 0;
  padding: var(--sp-2) var(--sp-4);
}
.cm-tamer-field__label,
.cm-tamer-field__value { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--c-line-1); }
.cm-tamer-field__label { color: var(--c-text-3); font-size: var(--fs-body-sm); }
.cm-tamer-field__value { padding-left: var(--sp-4); text-align: right; font-weight: var(--fw-strong); font-variant-numeric: tabular-nums; }
.cm-tamer-field__value[data-state="UNSOURCED"] { color: var(--c-text-disabled); }
.cm-tamer-field__value[data-field-id="money"] { color: var(--c-gold-strong); }
.cm-tamer-field__value[data-field-id="rank"] { color: var(--c-accent-strong); }
.cm-tamer-fields > :nth-last-child(-n + 2) { border-bottom: 0; }
.cm-tamer-note { margin: 0; color: var(--c-text-3); font-size: var(--fs-label); }

/* ---- Championship run ---------------------------------------------------- */
.cm-championship-board { display: grid; gap: var(--sp-2); padding: var(--sp-2); }
.cm-championship-entry {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 72px;
  padding: var(--sp-3);
  border: 1px solid var(--c-line-1);
  border-radius: var(--r-control);
  background: var(--c-surface-2);
  color: var(--c-text-1);
  text-align: left;
}
.cm-championship-entry[data-unlocked="false"] { background: transparent; color: var(--c-text-disabled); }
.cm-championship-cup {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--r-control);
  background: var(--c-gold-soft);
  font-size: 22px;
}
.cm-championship-entry[data-unlocked="false"] .cm-championship-cup { filter: grayscale(1); opacity: 0.5; }
.cm-championship-entry__copy { display: grid; gap: 2px; min-width: 0; }
.cm-championship-entry__name { font-size: var(--fs-title-2); font-weight: var(--fw-heavy); }
.cm-championship-entry__rounds { color: var(--c-text-2); font-size: var(--fs-body-sm); }
.cm-championship-entry__reason { color: var(--c-warning); font-size: var(--fs-body-sm); }
.cm-championship-prize { display: inline-flex; align-items: baseline; gap: 4px; margin: 2px 0 0; color: var(--c-gold-strong); font-weight: var(--fw-heavy); font-variant-numeric: tabular-nums; }
.cm-championship-prize__bit { color: var(--c-text-2); font-size: var(--fs-label); font-weight: var(--fw-strong); }
.cm-championship-notice { margin: 0; padding: var(--sp-3); border-radius: var(--r-control); background: var(--c-warning-soft); color: var(--c-warning); }
.cm-championship-run { display: grid; gap: var(--sp-3); padding: var(--sp-4); }
.cm-championship-run__title { margin: 0; font-size: var(--fs-title-2); font-weight: var(--fw-heavy); }
.cm-championship-rounds { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cm-championship-round {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-control);
  background: var(--c-ground-raised);
}
.cm-championship-opponent { color: var(--c-text-2); }
.cm-championship-actions { display: flex; gap: var(--sp-2); }
.cm-championship-action {
  min-height: var(--control);
  padding: 0 var(--sp-5);
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-control);
  background: var(--c-surface-2);
  color: var(--c-text-1);
  font-weight: var(--fw-strong);
}
.cm-championship-action--primary { border-color: transparent; background: var(--btn-primary-bg); box-shadow: var(--btn-primary-edge); color: var(--c-text-on-accent); }

/* ---- Wider screens: the extra width becomes columns, not bigger cards ---- */
@media (min-width: 700px) {
  body:not([data-portrait-frame]) :is(.cm-digimon-shell, .cm-help-shell, .cm-tamer-shell, .cm-championship-shell) { width: min(100%, 820px); padding-inline: var(--sp-8); }
  body:not([data-portrait-frame]) .cm-schedule-shell { width: min(100%, 1000px); padding-inline: var(--sp-8); }
  body:not([data-portrait-frame]) .cm-screen-footer { margin-inline: calc(-1 * var(--sp-8)); padding-inline: var(--sp-8); }
  /* Roster: the list and the record side by side. */
  body:not([data-portrait-frame]) .cm-digimon-shell {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    grid-template-areas: "kicker kicker" "title title" "list detail" "controls detail" "rename detail" "note detail" "footer footer";
    /* The note row takes the spare height, so the footer still sits at the
       bottom of the screen as it does on a phone. */
    grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
    column-gap: var(--sp-5);
  }
  body:not([data-portrait-frame]) .cm-digimon-shell > .cm-digimon-controls-note { align-self: start; }
  body:not([data-portrait-frame]) .cm-digimon-shell > .cm-screen-footer { align-self: end; }
  body:not([data-portrait-frame]) .cm-digimon-shell > .cm-digimon-kicker { grid-area: kicker; }
  body:not([data-portrait-frame]) .cm-digimon-shell > .cm-digimon-title { grid-area: title; }
  body:not([data-portrait-frame]) .cm-digimon-shell > .cm-digimon-list { grid-area: list; grid-template-columns: minmax(0, 1fr); align-content: start; }
  body:not([data-portrait-frame]) .cm-digimon-shell > .cm-digimon-detail { grid-area: detail; align-self: start; }
  body:not([data-portrait-frame]) .cm-digimon-shell > .cm-digimon-controls { grid-area: controls; }
  body:not([data-portrait-frame]) .cm-digimon-shell > .cm-digimon-rename { grid-area: rename; }
  body:not([data-portrait-frame]) .cm-digimon-shell > .cm-digimon-controls-note { grid-area: note; }
  body:not([data-portrait-frame]) .cm-digimon-shell > .cm-screen-footer { grid-area: footer; }
  body:not([data-portrait-frame]) .cm-schedule-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Two seasons side by side keep two days per row, so a fixture name fits. */
  body:not([data-portrait-frame]) .cm-schedule-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body:not([data-portrait-frame]) .cm-tamer-fields { grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); }
  body:not([data-portrait-frame]) .cm-tamer-fields > :nth-last-child(-n + 4) { border-bottom: 0; }
  body:not([data-portrait-frame]) .cm-help-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body:not([data-portrait-frame]) .cm-help-heading { grid-column: 1 / -1; }
  body:not([data-portrait-frame]) .cm-championship-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ======================================================================= *
 * 7. Motion preferences
 * ======================================================================= */
/* Reduced motion: the player's choice (data-motion on <html>, resolved from
   the setting and, when it is "system", from the OS); the media query only
   covers a page that has no data-motion yet. */
:root[data-motion="reduced"] .cm-status-bar__save[data-state="SAVING"]::before { animation: none; border-top-color: currentColor; opacity: 0.7; }
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after { scroll-behavior: auto; }
:root[data-motion="reduced"] .cm-toolbar__menu, :root[data-motion="reduced"] .cm-sheet__panel, :root[data-motion="reduced"] dialog.cm-dialog[open] { animation-name: cm-fade; }
:root[data-motion="reduced"] :is(.cm-button, .cm-screen-back, .cm-screen-primary):active:not(:disabled) { transform: none; }
:root[data-motion="reduced"] .cm-toolbar__cell::before { transition: none; }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion]) .cm-status-bar__save[data-state="SAVING"]::before { animation: none; border-top-color: currentColor; opacity: 0.7; }
  :root:not([data-motion]) *, :root:not([data-motion]) *::before, :root:not([data-motion]) *::after { scroll-behavior: auto; }
  :root:not([data-motion]) .cm-toolbar__menu, :root:not([data-motion]) .cm-sheet__panel, :root:not([data-motion]) dialog.cm-dialog[open] { animation-name: cm-fade; }
  :root:not([data-motion]) :is(.cm-button, .cm-screen-back, .cm-screen-primary):active:not(:disabled) { transform: none; }
  :root:not([data-motion]) .cm-toolbar__cell::before { transition: none; }
}

/* DOM owns transient resident loading/error feedback, never a substitute animal. */
.int-rh2-resident-assets { position:absolute; inset:12px 12px auto; z-index:12; display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; padding:10px 12px; border:1px solid var(--c-line-2); border-radius:var(--r-control); background:var(--c-surface-1); color:var(--c-text-1); pointer-events:none; }
.int-rh2-resident-assets[hidden] { display:none; }
.int-rh2-resident-assets p { flex:1 1 180px; margin:0; font-size:13px; line-height:1.4; }
.int-rh2-resident-assets button { min-height:44px; padding:8px 12px; border:1px solid var(--c-line-2); border-radius:var(--r-control); background:var(--c-accent); color:var(--c-text-on-accent); font:inherit; pointer-events:auto; }

/* ---- Currency HUD candidate r1: append-only; Bits economy is unchanged. ---- */
.cm-status-bar__currencies {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--c-line-1);
  border-radius: var(--r-control);
  background: var(--c-surface-bar);
}
.cm-status-bar:not([data-screen="RAISING_HOME"]) .cm-status-bar__currencies { display: none; }
.cm-status-bar__currencies .cm-status-bar__bits { min-width: 0; max-width: 100%; }
.cm-status-bar__currencies .cm-status-bar__bits::before { content: none; }
.cm-status-bar__currency-icon { display: block; flex: 0 0 24px; width: 24px; height: 24px; object-fit: contain; }
.cm-status-bar__bits-value { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.cm-status-bar__diamond {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  padding: 4px;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--c-text-2);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.cm-status-bar__diamond-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.cm-status-bar__diamond:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
@media (hover: hover) { .cm-status-bar__diamond:hover { background: var(--c-surface-2); color: var(--c-text-1); } }
.cm-status-bar__extras { flex-wrap: wrap; max-width: 100%; }
@media (max-width: 420px) {
  .cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__extras { flex-basis: 100%; margin-inline-start: 0; }
  .cm-status-bar__currencies { flex: 0 1 auto; gap: 4px; padding-inline: 4px; }
}

/* Wallet width must not depend on balance digits or transient save notices.
   Keep the existing calendar / wallet flex arrangement and <=420px row policy. */
.cm-status-bar__save-slot { display: contents; }
/* Raising Save stays a real 44px control in wide phone layouts too. */
.cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__save { min-width: 44px; min-height: 44px; }
.cm-status-bar__compact-value { display: none; }
.cm-status-bar__currencies .cm-status-bar__bits {
  min-height: 44px; padding: 0; border: 0; border-radius: var(--r-control);
  background: transparent; font-family: inherit; font-weight: inherit;
  cursor: pointer; touch-action: manipulation;
}
.cm-status-bar__bits:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
@media (max-width: 600px) {
  .cm-status-bar[data-screen="RAISING_HOME"] { gap: 6px; padding-inline: max(10px, var(--safe-left)) max(10px, var(--safe-right)); }
  .cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__extras { gap: 6px; }
  .cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__currencies { flex: 0 0 calc(180px * var(--text-scale)); width: calc(180px * var(--text-scale)); flex-wrap: nowrap; gap: 4px; padding: 0; border: 0; }
  .cm-status-bar[data-screen="RAISING_HOME"] :is(.cm-status-bar__bits, .cm-status-bar__diamond) { flex: 0 0 calc(88px * var(--text-scale)); width: calc(88px * var(--text-scale)); justify-content: flex-start; gap: 4px; padding: 0; }
  .cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__currency-icon { flex-basis: 20px; width: 20px; height: 20px; }
  .cm-status-bar[data-screen="RAISING_HOME"] :is(.cm-status-bar__bits-value, .cm-status-bar__diamond-text, .cm-status-bar__save-text) { display: none; }
  .cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__compact-value { display: inline; white-space: nowrap; font-size: calc(14px * var(--text-scale)); line-height: 1.25; }
  .cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__diamond[data-test-wallet="false"] .cm-status-bar__compact-value::before { content: "—"; }
  .cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__save-slot { display: inline-flex; flex: 0 0 44px; width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  .cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__save { min-width: 44px; height: 44px; justify-content: center; padding: 0; }
  .cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__save::after { inset: 0; }
  /* A small floating notice never participates in wallet flex sizing. */
  .cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__matches { position: absolute; left: max(10px, var(--safe-left)); right: auto; top: calc(100% + 6px); bottom: auto; max-width: calc(100% - 20px - var(--safe-left) - var(--safe-right)); min-width: 44px; min-height: 44px; height: 44px; font-size: calc(14px * var(--text-scale)); white-space: normal; }
  .cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__matches::after { inset: 0; }
  .cm-status-bar[data-screen="RAISING_HOME"] .cm-status-bar__matches-word { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
}

/* ---- 2026-10-12 UI polish: honest loading, the ranch expansion preview ---- */

/* A dialog action that is not available yet reads as unavailable, not broken. */
.cm-dialog__action:disabled { opacity: 0.5; cursor: not-allowed; filter: saturate(0.4); }
.cm-dialog__action:not(:disabled):active { transform: translateY(1px); }

/* Loading progress: steps finish with their loads, bytes are network bytes,
   and the sheen only says a step is still running. Nothing moves on a timer. */
.cm-load-progress { display: grid; gap: var(--sp-2); width: 100%; }
.cm-load-progress[hidden] { display: none; }
.cm-load-progress__bar { position: relative; height: 6px; overflow: hidden; border-radius: 999px; background: var(--c-surface-3); }
.cm-load-progress__fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--c-accent-deep), var(--c-accent)); transition: width var(--dur-slow) var(--ease-out); }
.cm-load-progress__bar[data-running="true"]::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent); animation: cm-load-sheen 1.5s var(--ease-in-out) infinite; }
.cm-load-progress__bar[data-failed="true"] .cm-load-progress__fill { background: var(--c-danger); }
@keyframes cm-load-sheen { from { transform: translateX(-110%); } to { transform: translateX(280%); } }
.cm-load-progress__steps { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-1) var(--sp-3); margin: 0; padding: 0; list-style: none;
  color: var(--c-text-3); font-size: var(--fs-label); line-height: var(--lh-label); }
.cm-load-progress__step { display: inline-flex; align-items: center; gap: 6px; }
.cm-load-progress__step::before { content: ""; flex: none; box-sizing: border-box; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 50%; }
.cm-load-progress__step[data-state="active"] { color: var(--c-text-1); font-weight: var(--fw-strong); }
.cm-load-progress__step[data-state="active"]::before { border-color: var(--c-accent); border-right-color: transparent; animation: cm-save-spin 0.9s linear infinite; }
.cm-load-progress__step[data-state="done"] { color: var(--c-text-2); }
.cm-load-progress__step[data-state="done"]::before { border-color: var(--c-success); background: var(--c-success); box-shadow: inset 0 0 0 1.5px var(--c-surface-1); }
.cm-load-progress__step[data-state="error"] { color: var(--c-danger-text); }
.cm-load-progress__step[data-state="error"]::before { border-color: var(--c-danger); background: var(--c-danger-soft); }
.cm-load-progress .cm-load-progress__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-1) var(--sp-3); flex: none; margin: 0;
  color: var(--c-text-3); font-size: var(--fs-caption); line-height: var(--lh-caption); font-variant-numeric: tabular-nums; }
.cm-load-progress .cm-load-progress__slow { flex: none; margin: 0; color: var(--c-warning); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.cm-load-progress [hidden] { display: none; }
:root[data-motion="reduced"] .cm-load-progress__bar::after,
:root[data-motion="reduced"] .cm-load-progress__step::before { animation: none; }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion]) .cm-load-progress__bar::after,
  :root:not([data-motion]) .cm-load-progress__step::before { animation: none; }
}

/* The ranch's loading card: centred over the field while it loads or fails,
   faded in after a beat so a quick load never flashes it. Once the scene is
   up, a resident-art notice keeps the old strip along the top. */
.int-rh2-resident-assets:is([data-phase="loading"], [data-phase="error"]) {
  inset: 50% 16px auto; max-width: 420px; margin: 0 auto; transform: translateY(-50%);
  padding: var(--sp-4); gap: var(--sp-3); border-radius: var(--r-card); box-shadow: var(--shadow-float);
}
.int-rh2-resident-assets[data-phase="loading"] { animation: cm-fade var(--dur-base) var(--ease-out) 240ms both; }
/* A short frame or long words never push the card off the field: it scrolls
   inside it, and the first-day hint steps aside while the card is up. */
.int-rh2-resident-assets:is([data-phase="loading"], [data-phase="error"]) { max-height: calc(100% - 24px); overflow-y: auto; overscroll-behavior: contain; pointer-events: auto; }
.int-rh2-root:has(.int-rh2-resident-assets:is([data-phase="loading"], [data-phase="error"]):not([hidden])) .int-rh2-hint { display: none; }
.int-rh2-resident-assets:is([data-phase="loading"], [data-phase="error"]) > p { flex-basis: 100%; text-align: center; font-weight: var(--fw-strong); }

/* One clear next step on the loading card: retry is the primary action;
   cancel, return and reload are quieter, with the same pressed and focus
   feedback as every other button. */
.int-rh2-resident-assets button { border-color: var(--c-line-2); background: var(--c-surface-2); color: var(--c-text-1); font-weight: var(--fw-strong); }
.int-rh2-resident-assets button[data-load-action="retry"] { border-color: transparent; background: var(--c-accent); color: var(--c-text-on-accent); }
.int-rh2-resident-assets button:not(:disabled):active { transform: translateY(1px); }
.int-rh2-resident-assets button:disabled { opacity: 0.55; cursor: default; }
.int-rh2-resident-assets button:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
@media (hover: hover) {
  .int-rh2-resident-assets button:not(:disabled):hover { background: var(--c-surface-3); }
  .int-rh2-resident-assets button[data-load-action="retry"]:not(:disabled):hover { background: var(--c-accent-strong); }
}

/* The locked expansion rows' call to action, floated over the rows. Blue to
   match the original Lid art it sits on, in every theme. */
.int-rh2-expansion-cta {
  position: absolute; left: var(--cta-x, 50%); top: var(--cta-y, 50%); z-index: 6;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 6px 12px 6px 6px;
  border: 1px solid rgba(134, 230, 255, 0.6); border-radius: 999px;
  background: linear-gradient(180deg, rgba(14, 44, 66, 0.92), rgba(6, 22, 34, 0.92)); color: #eaf7ff;
  font: inherit; font-size: var(--fs-body-sm); font-weight: var(--fw-heavy); line-height: 1.2; white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42), 0 0 0 3px rgba(134, 230, 255, 0.14);
  transform: translate(-50%, -50%); cursor: pointer; touch-action: manipulation;
  animation: cm-fade var(--dur-base) var(--ease-out) both;
}
.int-rh2-expansion-cta[hidden] { display: none; }
/* Out of the way while the player is doing something: a partner's card is
   open or a care tool is in hand (the hint steps aside the same way). */
.int-rh2-root[data-selection="selected"] .int-rh2-expansion-cta, body[data-tool] .int-rh2-expansion-cta { display: none; }
.int-rh2-expansion-cta__lock { position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #2f6c95, #123a56); box-shadow: inset 0 0 0 1px rgba(134, 230, 255, 0.55); }
.int-rh2-expansion-cta__lock::after { content: ""; position: absolute; inset: 7px; background: #eaf7ff;
  -webkit-mask: var(--cm-padlock) center / contain no-repeat; mask: var(--cm-padlock) center / contain no-repeat; }
.int-rh2-expansion-cta__badge { padding: 2px 8px; border-radius: 999px; background: rgba(134, 230, 255, 0.16); color: #9eeaff;
  font-size: var(--fs-caption); font-weight: var(--fw-strong); }
.int-rh2-expansion-cta:active { transform: translate(-50%, -50%) scale(0.97); }
.int-rh2-expansion-cta:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; }
@media (hover: hover) { .int-rh2-expansion-cta:hover { border-color: #9eeaff; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42), 0 0 0 4px rgba(134, 230, 255, 0.22); } }
:root { --cm-padlock: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 7V5a3.5 3.5 0 0 1 7 0v2h.5A1.5 1.5 0 0 1 13.5 8.5v5A1.5 1.5 0 0 1 12 15H4a1.5 1.5 0 0 1-1.5-1.5v-5A1.5 1.5 0 0 1 4 7h.5Zm2 0h3V5a1.5 1.5 0 0 0-3 0v2Zm1.5 2.5a1 1 0 0 0-.6 1.8V12.5h1.2v-1.2A1 1 0 0 0 8 9.5Z'/%3E%3C/svg%3E"); }

/* The ranch expansion sheet: a map of the honeycomb, three points, status. */
dialog.cm-dialog[data-variant="expansion"] { width: min(420px, calc(100vw - 32px)); }
dialog.cm-dialog[data-variant="expansion"] .cm-dialog__panel { max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; }
.cm-expansion-sheet { display: grid; gap: var(--sp-3); }
.cm-expansion-sheet__map { display: grid; justify-items: center; gap: var(--sp-2); margin: 0; padding: var(--sp-3);
  border: 1px solid var(--c-line-1); border-radius: var(--r-card); background: var(--c-ground-raised); }
.cm-expansion-sheet__svg { display: block; width: min(100%, 240px); height: auto; }
.cm-expansion-sheet__hex { fill: color-mix(in srgb, var(--c-accent) 30%, var(--c-surface-2)); stroke: var(--c-accent-line); stroke-width: 0.8; }
.cm-expansion-sheet__hex--locked { fill: #4b7ea3; stroke: #a9d6f0; }
.cm-expansion-sheet__lock-shackle { fill: none; stroke: #eaf7ff; stroke-width: 1.4; }
.cm-expansion-sheet__lock-body { fill: #eaf7ff; }
.cm-expansion-sheet__key { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-1) var(--sp-4); color: var(--c-text-2);
  font-size: var(--fs-label); line-height: var(--lh-label); }
.cm-expansion-sheet__key-item { display: inline-flex; align-items: center; gap: 6px; }
.cm-expansion-sheet__key-item::before { content: ""; width: 12px; height: 14px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.cm-expansion-sheet__key-item--current::before { background: color-mix(in srgb, var(--c-accent) 55%, var(--c-surface-2)); }
.cm-expansion-sheet__key-item--locked::before { background: #4b7ea3; }
.cm-expansion-sheet__points { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.cm-expansion-sheet__points li { position: relative; padding-left: 20px; color: var(--c-text-1); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.cm-expansion-sheet__points li::before { content: ""; position: absolute; left: 3px; top: calc(var(--lh-body-sm) / 2 - 4px); width: 8px; height: 8px;
  border-radius: 2px; background: var(--c-accent); transform: rotate(45deg); }
.cm-expansion-sheet__status { padding: var(--sp-3); border: 1px solid color-mix(in srgb, var(--c-warning) 40%, transparent); border-radius: var(--r-control); background: var(--c-warning-soft); }
.cm-expansion-sheet__status strong { display: block; color: var(--c-warning); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.cm-expansion-sheet__status p { margin: var(--sp-1) 0 0; color: var(--c-text-2); font-size: var(--fs-label); line-height: var(--lh-label); }

/* The title-match chip is small to look at; its hit area is not (44 px tall). */
.cm-status-bar__matches { position: relative; }
.cm-status-bar__matches::after { content: ""; position: absolute; inset: -8px -4px; }


/* Module rollover needs a new document, not another request for the old URL. */
.int-rh2-resident-assets[data-module-load-failed="true"] button[data-load-action="reload"] { border-color: transparent; background: var(--c-accent); color: var(--c-text-on-accent); }
.int-rh2-resident-assets[data-load-owner="screen"] { position: fixed; }
