/* game-kit 8cacc23: css/kit.css — edit in game-kit and run tools/kit-sync.js */
/* game-kit: shared styles for first-person browser games (windows, HUD, buttons, touch controls,
   status chips, steppers, kanban, app-like software screens, tabs, stamps, share buttons; at the end
   progression pg-*, sim UI nt-/tb-/dl-/ch-*, journal jr-* / stream veil st-* / hiding hd-*, chat cx-*).
   From ひだまり薬局 (style.css + board.css). Theme with the custom properties in :root; pharmacy-only
   blocks (prescription slip, shelf picking, title) stay in that game. Class names keep the original
   ones (bcase = HUD board row, kcard = kanban card, hb-* = tabbed notebook, cd-* = detail card,
   app* = business software). */
:root {
  --fs: 1;
  /* legacy names -> design tokens (css/theme.css, docs/standard-3d.md); the fallbacks are the old values */
  --ink: var(--gf-text, #23302c);
  --paper: var(--gf-surface, #fffdf6);
  --panel: var(--gf-panel, rgba(252, 250, 244, 0.97));
  --line: var(--gf-border, #d8d2c2);
  --accent: var(--gf-accent, #3a7a5a);
  --accent2: var(--gf-accent-2, #e8a040);
  --warn: var(--gf-danger, #c0502a);
  --ok: var(--gf-ok, #2e7a4a);
  --dim: var(--gf-text-dim, #5c6662);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--gf-bg, #dfe8ea); color: var(--ink);
  font-family: var(--gf-font, 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic', sans-serif); font-size: calc(15px * var(--fs)); }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.dim { color: var(--dim); }
.small { font-size: 0.85em; }
button { font-family: inherit; }

/* ---- buttons ---- */
.btn { font: inherit; font-size: 0.95em; padding: 8px 14px; margin: 3px; border-radius: var(--gf-radius, 10px); border: 1px solid var(--gf-border-strong, #b8b0a0); background: var(--gf-surface, #fff); color: var(--ink); cursor: pointer; }
.btn:hover:not(:disabled) { background: var(--gf-surface-2, #f4efe2); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--gf-accent-ink, #fff); }
.btn.primary:hover:not(:disabled) { background: var(--gf-accent-hover, #2f6a4c); }
.btn.big { font-size: 1.15em; padding: 11px 34px; margin: 6px; }
.btn.small { font-size: 0.82em; padding: 4px 9px; }
.btn.ghost { background: transparent; border-style: dashed; color: var(--dim); }
.btn.consult { background: var(--gf-note-bg, #fff4dc); color: var(--gf-note-text, #2b2418); border-color: var(--gf-note-line, #a86f10); }
.btn.choice { display: block; width: 100%; text-align: left; margin: 5px 0; }
.btn.on { background: var(--accent); color: var(--gf-accent-ink, #fff); border-color: var(--accent); }
.btn .note { display: block; font-size: 0.8em; color: var(--dim); }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(40, 60, 50, 0.7); box-shadow: 0 0 0 1px #fff; }
#crosshair.on { width: 18px; height: 18px; margin: -9px 0 0 -9px; background: transparent; border: 3px solid var(--accent2); }
#prompt { position: absolute; left: 50%; top: calc(50% + 26px); transform: translateX(-50%); background: var(--gf-panel-soft, rgba(255, 253, 246, 0.94)); padding: 4px 12px; border-radius: 8px; font-weight: 700; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
#prompt:empty { display: none; }
#hud-left { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 8px; max-width: min(460px, 70vw); }
#objective { background: var(--gf-panel-soft, rgba(255, 253, 246, 0.9)); border-radius: 12px; padding: 8px 12px; line-height: 1.6; border: 1px solid var(--line); }
#objective .day { font-weight: 700; color: var(--gf-heading, #2f5e46); }
#objective .phase { background: #e8f2e8; padding: 0 8px; border-radius: 6px; margin-left: 4px; }
#objective .now { font-weight: 700; color: var(--gf-goal, #8a4e0c); }
#objective .more { color: var(--dim); font-size: 0.9em; }
#objective .hold { color: var(--gf-text-dim, #5c6662); font-size: 0.9em; }
#say { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); width: max-content; max-width: min(760px, 92vw); background: var(--gf-panel-soft, rgba(255, 253, 246, 0.96)); padding: 10px 18px; border-radius: 12px; line-height: 1.8; opacity: 0; transition: opacity 0.3s; border: 1px solid var(--line); text-align: center; }
#say.on { opacity: 1; }
#toasts { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; max-width: min(420px, 60vw); }
.toast { background: var(--gf-panel-soft, rgba(255, 253, 246, 0.96)); border-left: 4px solid var(--accent2); padding: 7px 12px; border-radius: 8px; transition: opacity 0.6s, transform 0.6s; line-height: 1.6; }
.toast.ok { border-left-color: var(--ok); }
.toast.out { opacity: 0; transform: translateX(20px); }
#keys { position: absolute; left: 12px; bottom: 10px; font-size: 0.8em; color: var(--ink); background: var(--gf-panel-soft, rgba(255, 255, 255, 0.7)); padding: 3px 8px; border-radius: 6px; }
#debug { position: absolute; right: 8px; bottom: 6px; font: 11px monospace; color: #333; white-space: pre; }
#fade { position: fixed; inset: 0; background: #fffaf0; opacity: 0; pointer-events: none; transition: opacity 0.6s; z-index: 15; }
#fade.on { opacity: 1; }

/* ---- windows ---- */
#ui { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.win-wrap { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; background: var(--gf-scrim, rgba(40, 50, 45, 0.28)); pointer-events: auto; padding: max(10px, min(9vh, 80px)) 10px 10px; }
.win { background: var(--panel); border-radius: var(--gf-radius-lg, 16px); width: min(620px, 96vw); max-height: 94vh; display: flex; flex-direction: column; box-shadow: var(--gf-shadow, 0 10px 40px rgba(0, 0, 0, 0.25)); border: 1px solid var(--line); }
.win.wide { width: min(1080px, 97vw); }
.win-head { padding: 12px 16px 8px; border-bottom: 1px solid var(--line); position: relative; }
.win-title { font-weight: 700; font-size: 1.12em; color: var(--gf-heading, #2f5e46); padding-right: 30px; }
.win-sub { color: var(--dim); font-size: 0.9em; }
.win-x { position: absolute; right: 10px; top: 8px; border: none; background: none; font-size: 22px; cursor: pointer; color: var(--dim); }
.win-body { padding: 12px 16px; overflow-y: auto; line-height: 1.7; }
.win-foot { padding: 8px 12px 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.caseid { font-size: 0.75em; color: var(--dim); font-weight: 400; }
.sec { font-weight: 700; color: var(--gf-heading, #2f5e46); margin: 10px 0 4px; border-bottom: 2px solid var(--gf-border, #e8e0cc); }
.intro { color: #4a5a52; }
.bubble { background: var(--gf-surface, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.q { font-weight: 700; margin: 10px 0 4px; }

/* schedule / handbook / report */
table.cases { width: 100%; border-collapse: collapse; font-size: 0.92em; }
table.cases td, table.cases th { border-bottom: 1px solid #e6e0d0; padding: 5px; text-align: left; vertical-align: top; }
table.cases tr.done td, table.cases tr.handover td { color: var(--dim); }
ul.flow { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
ul.flow li.done { color: var(--ok); }
dl.steps dt { font-weight: 700; margin-top: 6px; }
dl.steps dd { margin: 0 0 0 1em; }
table.shelf th { text-align: left; padding-right: 10px; vertical-align: top; }
.hintline { background: #fff4dc; padding: 6px 10px; border-radius: 8px; }
table.axes { border-collapse: collapse; margin: 6px 0; }
table.axes th { text-align: left; padding: 4px 14px 4px 0; font-weight: 500; }
table.axes td.stars { color: #e0a020; font-size: 1.25em; letter-spacing: 0.1em; padding-right: 12px; }
.caselist { line-height: 1.9; }
.settings label { display: block; margin: 8px 0; }
.settings input[type='range'] { width: 220px; vertical-align: middle; }

/* result (training complete) */
.win.result { width: min(560px, 96vw); }
.share-text { font-size: 0.85em; background: var(--gf-surface, #fff); border: 1px solid var(--line); padding: 8px 10px; border-radius: 8px; text-align: left; }
.share-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0 6px; }
.share-buttons button { font: inherit; padding: 9px 6px; border-radius: 10px; border: 1px solid var(--gf-border-strong, #b8b0a0); background: var(--gf-surface, #fff); color: var(--ink); cursor: pointer; }
.share-buttons .share-x { background: #000; color: #fff; border-color: #000; }
.share-buttons .share-fb { background: #1b4f9a; color: #fff; border-color: #1b4f9a; }
.share-buttons .share-line { background: #04783a; color: #fff; border-color: #04783a; }   /* AA with white text (#06a04a was 3.4:1; miru-fusha) */
.share-buttons .share-ig { background: linear-gradient(45deg, #94500e, #a02448, #5a2c9c); color: #fff; border: none; }
.share-note { min-height: 1.4em; color: #8a6a1a; font-size: 0.9em; }
.ask { font-weight: 700; color: var(--gf-heading, #2f5e46); }

/* high contrast */
body.contrast { --panel: #ffffff; --line: #333; --dim: #333; }
body.contrast .btn { border-color: #222; }
body.contrast #objective, body.contrast #say, body.contrast #prompt { background: #fff; border: 2px solid #111; }

/* ---- touch ---- */
#touch { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
#t-look { position: absolute; right: 0; top: 0; width: 55%; height: 100%; pointer-events: auto; touch-action: none; }
#t-stick { position: absolute; left: 22px; bottom: 26px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); border: 2px solid rgba(60, 80, 70, 0.4); pointer-events: auto; touch-action: none; }
#t-knob { position: absolute; left: 36px; top: 36px; width: 48px; height: 48px; border-radius: 50%; background: rgba(58, 122, 90, 0.6); }
#t-buttons { position: absolute; right: 14px; bottom: 22px; display: grid; grid-template-columns: repeat(3, auto); gap: 8px; pointer-events: auto; }
#t-buttons button, #t-menu { font: inherit; font-size: 13px; min-width: 58px; height: 46px; border-radius: 12px; border: 1px solid rgba(60, 80, 70, 0.5); background: rgba(255, 253, 246, 0.85); color: var(--ink); }
#t-buttons button.big { grid-row: span 2; height: 100px; font-size: 16px; background: rgba(232, 160, 64, 0.9); color: #fff; }
#t-buttons button.on { background: var(--accent); color: #fff; }
#t-menu { position: absolute; right: 12px; top: 12px; pointer-events: auto; min-width: 44px; }
body:has(#touch:not(.hidden)) #keys { display: none; }
body:has(#touch:not(.hidden)) #toasts { top: 64px; }

@media (max-width: 760px) {
  .task { grid-template-columns: 1fr; }
  .win { max-height: 96vh; }
  .win-body { padding: 10px 12px; }
  #objective { max-width: 62vw; font-size: 0.85em; padding: 6px 8px; }
  .rx-row { grid-template-columns: 4em 1fr; }
  .shelfui { max-height: 220px; }
}
@media (max-height: 520px) {
  .win { max-height: 98vh; }
  #objective { font-size: 0.8em; }
  #t-stick { width: 100px; height: 100px; bottom: 14px; }
  #t-knob { left: 26px; top: 26px; }
}


/* =====================================================================================================
   task screens: a small web dashboard (HUD board, kanban schedule, stepper, task window header,
   the 見破り stamp, the day report). Loaded after style.css.
   ===================================================================================================== */
:root {
  --c-todo: #8a96a0;
  --c-doing: #2f7fc0;
  --c-hold: #c07a1a;
  --c-done: #2e8a56;
  --c-handover: #7a5ab0;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(20, 40, 30, 0.08), 0 4px 14px rgba(20, 40, 30, 0.08);
}

#hud-left {
  width: min(340px, 62vw);
  max-width: none;
}
#objective {
  background: none;
  border: none;
  padding: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72em;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.7;
  color: #fff;
  background: var(--c-todo);
}
.chip.doing {
  background: var(--c-doing);
}
.chip.hold {
  background: var(--c-hold);
}
.chip.done {
  background: var(--c-done);
}
.chip.handover {
  background: var(--c-handover);
}

/* ---- stepper ---- */
.stepper {
  list-style: none;
  margin: 6px 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
}
.stepper li {
  flex: 1 1 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  font-size: 0.72em;
  color: var(--dim);
}
.stepper li::before {
  content: "";
  position: absolute;
  top: 10px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: #d6dcd6;
  z-index: 0;
}
.stepper li:first-child::before {
  display: none;
}
.stepper li.done::before,
.stepper li.cur::before,
.stepper li.hold::before {
  background: var(--c-done);
}
.stepper .dot {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: #fff;
  border: 2px solid #c8d0c8;
  color: var(--dim);
  font-size: 0.95em;
}
.stepper li.done .dot {
  background: var(--c-done);
  border-color: var(--c-done);
  color: #fff;
}
.stepper li.cur .dot {
  border-color: var(--c-doing);
  color: var(--c-doing);
  box-shadow: 0 0 0 4px rgba(47, 127, 192, 0.18);
  animation: pulse 1.6s ease-in-out infinite;
}
.stepper li.hold .dot {
  border-color: var(--c-hold);
  color: var(--c-hold);
}
.stepper li.cur .lab {
  color: var(--c-doing);
  font-weight: 700;
}
.stepper .lab {
  margin-top: 3px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.stepper.mini {
  margin: 0;
  gap: 3px;
  flex: 0 0 auto;
}
.stepper.mini li {
  flex: 0 0 auto;
}
.stepper.mini li::before {
  display: none;
}
.stepper.mini .dot {
  width: 9px;
  height: 9px;
  border-width: 1.5px;
  font-size: 0;
}
.stepper.mini li.cur .dot {
  box-shadow: 0 0 0 2px rgba(47, 127, 192, 0.25);
  background: var(--c-doing);
  animation: none;
}
.stepper.mini li.hold .dot {
  background: var(--c-hold);
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 7px rgba(47, 127, 192, 0.05);
  }
}

/* ---- HUD board ---- */
.board {
  background: rgba(255, 254, 250, 0.93);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 14px;
  border: 1px solid rgba(200, 196, 180, 0.8);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: 0.92em;
}
.bhead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 6px;
}
.ring {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}
.ring circle {
  fill: none;
  stroke-width: 4.5;
  transform: rotate(-90deg);
  transform-origin: 20px 20px;
}
.ring .bg {
  stroke: #e4e8e2;
}
.ring .fg {
  stroke: var(--c-done);
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s;
}
.ring text {
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
  fill: var(--ink);
}
.bday {
  font-weight: 700;
  color: var(--gf-heading, #2f5e46);
  display: flex;
  align-items: center;
  gap: 6px;
}
.bdate {
  font-size: 0.82em;
  color: var(--dim);
}
.phase {
  font-size: 0.75em;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f2e8;
  color: var(--gf-heading, #2f5e46);
  margin: 0;
}
.phase.pm {
  background: #fdf0d8;
  color: #8a5a10;
}
.phase.over {
  background: #e8e4f2;
  color: #5a4a8a;
}
.bnow {
  margin: 0 8px 6px;
  padding: 7px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff5df, #ffeccc);
  border: 1px solid #f0d49a;
}
.bnow .lbl {
  font-size: 0.68em;
  font-weight: 700;
  color: #a06a10;
  letter-spacing: 0.1em;
}
.bnow .what {
  font-weight: 700;
  color: #6a3e08;
  line-height: 1.45;
}
.bnow small {
  display: block;
  font-weight: 500;
  color: #8a6a3a;
  font-size: 0.82em;
}
.room {
  margin-left: 6px;
  font-size: 0.85em;
  color: var(--dim);
}
.bcases {
  list-style: none;
  margin: 0;
  padding: 0 6px 4px;
}
.bcase {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.3s;
}
.bcase .num {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #eef0ea;
  display: grid;
  place-items: center;
  font-size: 0.72em;
  font-weight: 700;
  color: var(--dim);
}
.bcase .tt {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9em;
}
.bcase.next {
  background: #eaf3fb;
}
.bcase.next .num {
  background: var(--c-doing);
  color: #fff;
}
.bcase.done .tt,
.bcase.handover .tt {
  color: var(--dim);
  text-decoration: line-through;
  text-decoration-color: rgba(0, 0, 0, 0.25);
}
.bcase.done .num {
  background: var(--c-done);
  color: #fff;
}
.bcase.locked {
  opacity: 0.5;
}
.bflow {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 6px 10px 8px;
  border-top: 1px solid #ece8dc;
  background: #faf8f2;
}
.bflow .rt {
  font-size: 0.68em;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid #d8d4c4;
  color: var(--dim);
}
.bflow .rt.done {
  background: #e6f2ea;
  border-color: #b8dcc4;
  color: var(--c-done);
}

/* the day-1 guide under the board */
#guide {
  background: rgba(46, 110, 80, 0.95);
  color: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  line-height: 1.6;
  border: none;
}
#guide .guide-head {
  font-size: 0.72em;
  letter-spacing: 0.1em;
  opacity: 0.85;
  color: #fff;
}
#guide b {
  color: #ffe9a8;
}

/* ---- Tab: the kanban ---- */
.board-win .win {
  width: min(1180px, 98vw);
}
.timeline {
  list-style: none;
  display: flex;
  margin: 2px 0 12px;
  padding: 0;
}
.timeline li {
  flex: 1 1 0;
  position: relative;
  text-align: center;
  font-size: 0.85em;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--dim);
}
.timeline li::before {
  content: "";
  position: absolute;
  top: 9px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: #d6dcd6;
}
.timeline li:first-child::before {
  display: none;
}
.timeline li.done::before {
  background: var(--c-done);
}
.timeline .dot {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #c8d0c8;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 0.75em;
  color: #fff;
  font-weight: 700;
}
.timeline li.done .dot {
  background: var(--c-done);
  border-color: var(--c-done);
}
.timeline li.done span {
  color: var(--c-done);
  font-weight: 700;
}
.timeline small {
  font-size: 0.78em;
}
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.kcol {
  background: #f1f0ea;
  border-radius: 12px;
  padding: 8px;
  min-height: 120px;
}
.kcol h3 {
  margin: 0 2px 8px;
  font-size: 0.95em;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.kcol h3 small {
  flex-basis: 100%;
  font-weight: 500;
  color: var(--dim);
  font-size: 0.75em;
}
.kcol .cnt {
  background: #fff;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.8em;
  color: var(--dim);
}
.kcol.doing h3 {
  color: var(--c-doing);
}
.kcol.hold h3 {
  color: var(--c-hold);
}
.kcol.done h3 {
  color: var(--c-done);
}
.kcol .empty {
  color: #b0b4ac;
  text-align: center;
  font-size: 0.85em;
  padding: 18px 0;
  border: 2px dashed #dedcd2;
  border-radius: 10px;
}
.kcard {
  background: var(--card);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--c-todo);
}
.kcard.doing {
  border-top-color: var(--c-doing);
}
.kcard.hold {
  border-top-color: var(--c-hold);
}
.kcard.done {
  border-top-color: var(--c-done);
  opacity: 0.85;
}
.kcard.handover {
  border-top-color: var(--c-handover);
  opacity: 0.85;
}
.kcard.locked {
  opacity: 0.55;
}
.kcard header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kcard .cid {
  font-size: 0.72em;
  color: var(--dim);
  font-family: ui-monospace, monospace;
}
.kcard .kbody {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.kcard h4 {
  margin: 0;
  font-size: 0.95em;
  line-height: 1.4;
}
.kcard p {
  margin: 2px 0 0;
  font-size: 0.8em;
  color: var(--dim);
  line-height: 1.45;
}
.kcard .who {
  color: #4a5a52;
}
.kcard .face,
.task-head .face {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d8d2c2;
}
.kcard footer {
  margin-top: 4px;
  font-size: 0.8em;
  padding-top: 5px;
  border-top: 1px dashed #e4e0d4;
  color: #3a4a44;
}
.people {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.person {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 999px;
  padding: 4px 14px 4px 4px;
  box-shadow: var(--shadow);
}
.person img,
.person .ph {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #e4e8e2;
}
.person small {
  display: block;
  color: var(--dim);
  font-size: 0.78em;
}
.sec small {
  font-weight: 500;
  color: var(--dim);
}

/* ---- the task window ---- */
.taskwin .win-sub .stepno {
  background: #eaf3fb;
  color: var(--c-doing);
  font-weight: 700;
  padding: 0 8px;
  border-radius: 999px;
  margin-left: 6px;
  font-size: 0.9em;
}
.task-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  margin: -12px -16px 12px;
  padding: 12px 16px 8px;
  background: linear-gradient(
    90deg,
    rgba(252, 250, 244, 0.97) 30%,
    rgba(252, 250, 244, 0.5)
  );
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}
.task-head .pname {
  font-weight: 700;
  line-height: 1.4;
}
.task-head .pname small {
  display: block;
  font-weight: 500;
  color: var(--dim);
  font-size: 0.82em;
}
.task-head .stepper {
  grid-column: 1 / -1;
  margin: 4px 0 0;
}
.task-head > .pname:first-child {
  grid-column: 1 / -1;
}
.task-goal {
  display: flex;
  gap: 8px;
  align-items: baseline;
  background: #eef6ee;
  border: 1px solid #cfe4d2;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.92em;
  margin-bottom: 8px;
  font-weight: 700;
  color: #24523a;
}
.task-goal .lbl {
  flex: 0 0 auto;
  font-size: 0.72em;
  background: #2e8a56;
  color: #fff;
  padding: 0 7px;
  border-radius: 6px;
  letter-spacing: 0.08em;
}
details.howto {
  background: #f4f8ff;
  border: 1px solid #c8d6ec;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.9em;
}
details.howto summary {
  cursor: pointer;
  padding: 6px 10px;
  font-weight: 700;
  color: #2a4a7a;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
details.howto summary::-webkit-details-marker {
  display: none;
}
details.howto summary span {
  font-weight: 500;
  font-size: 0.82em;
  color: #6a7a9a;
}
details.howto summary span::after {
  content: " ▾";
}
details.howto[open] summary span::after {
  content: " ▴";
}
details.howto ol {
  margin: 0 10px 4px 2em;
  padding: 0;
  line-height: 1.6;
}
details.howto .state {
  margin: 4px 10px;
  font-size: 0.85em;
  color: #3a4a6a;
}
details.howto .state s {
  color: #9aa4b4;
}
details.howto .state b {
  color: var(--c-doing);
}
details.howto .tip {
  margin: 0 10px 8px;
  font-size: 0.8em;
  color: var(--dim);
}
.fb {
  animation: fbin 0.25s ease-out;
}
@keyframes fbin {
  from {
    transform: translateY(4px);
    opacity: 0;
  }
}

/* ---- the 見破り stamp ---- */
.catch {
  position: fixed;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  z-index: 30;
  text-align: center;
  pointer-events: none;
  animation: catchin 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
  transition:
    opacity 0.6s,
    transform 0.6s;
}
.catch .stamp-big {
  display: inline-block;
  font-size: calc(40px * var(--fs));
  font-weight: 700;
  color: #c0502a;
  border: 5px solid #c0502a;
  border-radius: 14px;
  padding: 2px 26px;
  background: rgba(255, 252, 244, 0.92);
  transform: rotate(-6deg);
  letter-spacing: 0.1em;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}
.catch:not(.clean) .stamp-big {
  color: #c07a1a;
  border-color: #c07a1a;
  font-size: calc(30px * var(--fs));
}
.catch .what {
  margin-top: 12px;
  background: rgba(255, 253, 246, 0.95);
  border-radius: 10px;
  padding: 6px 14px;
  max-width: min(520px, 86vw);
  font-size: 0.9em;
  box-shadow: var(--shadow);
}
.catch.out {
  opacity: 0;
  transform: translate(-50%, -60%);
}
@keyframes catchin {
  from {
    transform: translate(-50%, -50%) scale(1.8);
    opacity: 0;
  }
}

/* ---- the day report ---- */
.axes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 6px;
}
.axis {
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
  border-top: 3px solid #e0a020;
}
.axis.s1 {
  border-top-color: #d08060;
}
.axis .lab {
  font-size: 0.82em;
  font-weight: 700;
}
.axis .stars {
  color: #e0a020;
  font-size: 1.3em;
  letter-spacing: 0.08em;
}
ul.catches {
  list-style: none;
  padding: 0;
  margin: 4px 0;
}
ul.catches li {
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  margin: 5px 0;
  box-shadow: var(--shadow);
  border-left: 4px solid #c07a1a;
}
ul.catches li.clean {
  border-left-color: #c0502a;
}
ul.catches small {
  display: block;
  color: var(--dim);
  font-size: 0.82em;
}
ul.catches .badge {
  font-size: 0.72em;
  font-weight: 700;
  color: #fff;
  background: #c07a1a;
  border-radius: 999px;
  padding: 0 8px;
  margin-right: 6px;
}
ul.catches li.clean .badge {
  background: #c0502a;
}

@media (max-width: 860px) {
  .kanban {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .axes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px), (max-height: 520px) {
  #hud-left {
    width: min(300px, 58vw);
  }
  .board {
    font-size: 0.82em;
  }
  .bcases,
  .bflow {
    display: none;
  }
  .ring {
    width: 34px;
    height: 34px;
  }
}
@media (max-width: 520px) {
  .kanban {
    grid-template-columns: minmax(0, 1fr);
  }
  .stepper .lab {
    display: none;
  }
  .timeline small {
    display: none;
  }
}
body.contrast .board {
  background: #fff;
  border: 2px solid #111;
}
body.contrast #objective {
  border: none;
}

/* conversations: a portrait beside the words */
.talkrow {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.talkrow .bubble {
  flex: 1 1 auto;
  position: relative;
  margin-top: 4px;
}
.talkface {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 3px solid #fff;
  box-shadow:
    0 0 0 1px #d8d2c2,
    var(--shadow);
}
@media (max-width: 520px) {
  .talkface {
    width: 52px;
    height: 52px;
  }
}

/* ---- J: the handbook (tabs) ---- */
.hb-win .win {
  width: min(1000px, 97vw);
  background: #fbf8ef;
}
.hb-win .win-head {
  background: linear-gradient(#f4ecd8, #efe5cc);
  border-radius: 16px 16px 0 0;
}
.hb-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: -4px 0 10px;
  border-bottom: 2px solid var(--gf-border, #e2d8c0);
}
.hb-tab {
  font: inherit;
  border: none;
  background: var(--gf-surface-2, #efe8d6);
  color: var(--gf-text-dim, #5a5a4a);
  padding: 7px 14px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -2px;
  border-bottom: 2px solid var(--gf-border, #e2d8c0);
}
.hb-tab:hover {
  background: var(--gf-accent-soft, #f6f0e0);
}
.hb-tab.on {
  background: var(--gf-surface, #fff);
  color: var(--gf-heading, #2f5e46);
  font-weight: 700;
  border: 2px solid var(--gf-border, #e2d8c0);
  border-bottom-color: var(--gf-surface, #fff);
}
.hb-tab .cnt {
  font-size: 0.78em;
  background: var(--gf-chip-bg, #e6ebdf);
  color: var(--gf-chip-text, #2b3a30);
  border-radius: 999px;
  padding: 0 7px;
}
.hb-tab.on .cnt {
  background: var(--gf-accent, #3a7a5a);
  color: var(--gf-accent-ink, #fff);
}
.hb-body {
  min-height: 300px;
}
.hb-foot {
  margin-top: 10px;
}
.hb-lead {
  color: #4a5a52;
  margin: 0 0 10px;
  font-size: 0.92em;
}
.hb-empty {
  text-align: center;
  color: var(--dim);
  padding: 50px 20px;
  border: 2px dashed #e2d8c0;
  border-radius: 14px;
  background: #fff;
}
.hb-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.9em;
  color: #3a4a44;
}
.hb-progress .bar {
  flex: 1;
  height: 10px;
  background: #e8e2d0;
  border-radius: 999px;
  overflow: hidden;
}
.hb-progress .bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #5aae7a, #2e8a56);
  border-radius: 999px;
  transition: width 0.5s;
}
.hb-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.hb-step {
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--c-done);
}
.hb-step.locked {
  border-left-color: #d8d2c2;
  background: #fdfcf8;
}
.hb-step.locked p,
.hb-step.locked h4 {
  color: #8a8a80;
}
.hb-step.next {
  border-left-color: var(--c-doing);
  box-shadow:
    0 0 0 2px rgba(47, 127, 192, 0.25),
    var(--shadow);
}
.hb-step header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hb-step .ic {
  font-size: 1.3em;
}
.hb-step h4 {
  margin: 0;
  flex: 1;
  font-size: 1em;
}
.hb-step p {
  margin: 6px 0 0;
  font-size: 0.88em;
  line-height: 1.6;
}
.hb-step details {
  margin-top: 6px;
  font-size: 0.85em;
}
.hb-step summary {
  cursor: pointer;
  color: #2a4a7a;
  font-weight: 700;
}
.hb-step ol {
  margin: 4px 0 0 1.4em;
  padding: 0;
}
.hb-racks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.hb-rack {
  background: linear-gradient(#f4f4f0, #e8e8e2);
  border: 2px solid #c8c8c0;
  border-radius: 10px;
  padding: 8px;
}
.hb-rack h4 {
  margin: 0 0 6px;
  text-align: center;
  background: #2a5a7a;
  color: #fff;
  border-radius: 6px;
  padding: 2px 0;
  font-size: 0.95em;
}
.hb-rack .shelves {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hb-rack .slot {
  background: #fff;
  border-bottom: 4px solid #b8b8b0;
  border-radius: 4px;
  padding: 6px 8px;
}
.hb-rack .slot.risky {
  outline: 2px solid #e0a020;
}
.hb-rack .boxes {
  display: flex;
  gap: 4px;
}
.hb-rack .bx {
  flex: 1;
  text-align: center;
  font-size: 0.75em;
  font-weight: 700;
  color: #1e4a8a;
  background: #fff;
  border: 1px solid #c8c4b8;
  border-top: 6px solid var(--c);
  border-radius: 3px;
  padding: 2px 0;
}
.hb-rack .bx.s2 {
  color: #a02020;
}
.hb-rack .nm {
  font-size: 0.8em;
  margin-top: 4px;
  line-height: 1.35;
}
.warn {
  color: #c07a1a;
}
.hb-callout {
  margin-top: 12px;
  background: #fff6e0;
  border: 1px solid #f0d49a;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.9em;
}
.hb-callout ul {
  margin: 4px 0 6px 1.2em;
  padding: 0;
}
.hb-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}
.hb-person {
  display: flex;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.hb-person img,
.hb-person .ph {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: #e4e8e2;
}
.hb-person h4 {
  margin: 0;
}
.hb-person p {
  margin: 2px 0;
  font-size: 0.82em;
}
.hb-person ul {
  margin: 4px 0 0 1.1em;
  padding: 0;
  font-size: 0.82em;
}
.hb-person .mem {
  background: #f4f8ff;
  border-radius: 6px;
  padding: 3px 6px;
  color: #2a4a6a;
}
.trust {
  color: #e07a8a;
  letter-spacing: 0.1em;
  font-size: 0.9em;
}
.trust small {
  color: var(--dim);
  margin-left: 6px;
  letter-spacing: 0;
}
.hb-notes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 6px;
}
.hb-notes .note {
  background: #fff59a;
  padding: 14px 12px;
  min-height: 90px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  transform: rotate(-1deg);
  font-size: 0.9em;
  line-height: 1.6;
}
.hb-notes .note.n1 {
  background: #c8f0d0;
  transform: rotate(0.8deg);
}
.hb-notes .note.n2 {
  background: #ffd8e0;
  transform: rotate(-0.4deg);
}
.hb-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}
.hb-stats div {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  box-shadow: var(--shadow);
}
.hb-stats b {
  display: block;
  font-size: 1.6em;
  color: #c0502a;
}
.hb-stats small {
  color: var(--dim);
}
@media (max-width: 760px) {
  .hb-racks {
    grid-template-columns: minmax(0, 1fr);
  }
  .hb-tab {
    padding: 6px 10px;
    font-size: 0.9em;
  }
}
.hb-rack .grid {
  display: grid;
  gap: 4px;
  background: #d8d8d0;
  padding: 4px;
  border-radius: 4px;
}
.hb-rack .cell {
  background: #fff;
  border-top: 6px solid var(--c);
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 0.75em;
  line-height: 1.3;
  border-bottom: 3px solid #b8b8b0;
  min-height: 40px;
}
.hb-rack .cell.empty {
  background: #ecece6;
  border-top-color: #ecece6;
}
.hb-rack .cell.risky {
  outline: 2px solid #e0a020;
}
.hb-rack .cell .v {
  font-weight: 700;
  display: block;
}
.hb-rack .cell .v.S1 {
  color: #1e4a8a;
}
.hb-rack .cell .v.S2 {
  color: #a02020;
}
.hb-rack .legend {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 0.75em;
  color: #4a5a52;
}
.hb-rack .legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: middle;
}

/* ---- the board rows and kanban cards open the case detail ---- */
#objective .bcase {
  pointer-events: auto;
  cursor: pointer;
}
#objective .bcase:hover {
  background: #f0f6ec;
}
.bkeys {
  margin-left: 8px;
  font-size: 0.85em;
  background: #eef0ea;
  border-radius: 4px;
  padding: 0 5px;
}
.kcard[data-case] {
  cursor: pointer;
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}
.kcard[data-case]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(20, 40, 30, 0.16);
}

/* ---- case detail ---- */
.case-win .win {
  width: min(920px, 97vw);
}
.cd-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: -12px -16px 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f2f8f0, #fbf6e8);
  border-bottom: 1px solid var(--line);
}
.cd-head img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow:
    0 0 0 1px #d8d2c2,
    var(--shadow);
}
.cd-ic {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 32px;
  background: #fff;
  box-shadow: var(--shadow);
}
.cd-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.85em;
}
.cd-meta .cid {
  font-family: ui-monospace, monospace;
  color: var(--dim);
}
.cd-title h3 {
  margin: 4px 0 2px;
  font-size: 1.25em;
  color: #24423a;
}
.cd-title p {
  margin: 0;
  color: #4a5a52;
}
.cd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
}
.cd-col h5 {
  margin: 12px 0 6px;
  font-size: 0.85em;
  color: var(--gf-heading, #2f5e46);
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--gf-border, #e8e0cc);
  padding-bottom: 2px;
}
.cd-col h5:first-child {
  margin-top: 0;
}
.cd-col h5 small {
  font-weight: 500;
  color: var(--dim);
  margin-left: 6px;
}
.cd-goal {
  margin: 0;
  background: #eef6ee;
  border: 1px solid #cfe4d2;
  border-radius: 10px;
  padding: 7px 10px;
  font-weight: 700;
  color: #24523a;
}
.cd-next {
  margin-top: 8px;
  background: linear-gradient(135deg, #fff5df, #ffeccc);
  border: 1px solid #f0d49a;
  border-radius: 10px;
  padding: 8px 12px;
  line-height: 1.6;
}
.cd-next .lbl {
  font-size: 0.72em;
  font-weight: 700;
  color: #a06a10;
  letter-spacing: 0.1em;
  display: block;
}
.cd-next b {
  color: #6a3e08;
  font-size: 1.05em;
}
.cd-next .dir {
  font-size: 0.88em;
  color: #6a5a3a;
  margin-top: 2px;
}
.cd-next.hold {
  background: #fff3e0;
  border-color: #e8b870;
}
.cd-next.done {
  background: #e6f4ea;
  border-color: #a8d8b8;
  color: #24523a;
}
.cd-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.cd-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  position: relative;
}
.cd-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 30px;
  bottom: -6px;
  width: 2px;
  background: #d6dcd6;
}
.cd-steps li.done:not(:last-child)::after {
  background: var(--c-done);
}
.cd-steps .dot {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8em;
  font-weight: 700;
  background: #fff;
  border: 2px solid #c8d0c8;
  color: var(--dim);
  z-index: 1;
}
.cd-steps li.done .dot {
  background: var(--c-done);
  border-color: var(--c-done);
  color: #fff;
}
.cd-steps li.cur .dot {
  border-color: var(--c-doing);
  color: var(--c-doing);
  box-shadow: 0 0 0 4px rgba(47, 127, 192, 0.18);
}
.cd-steps li.hold .dot {
  border-color: var(--c-hold);
  color: var(--c-hold);
}
.cd-steps li > div {
  flex: 1;
  min-width: 0;
}
.cd-steps b {
  display: block;
  font-size: 0.95em;
}
.cd-steps li.done b {
  color: var(--dim);
}
.cd-steps small {
  color: var(--dim);
  font-size: 0.8em;
}
.cd-steps small .room {
  margin-left: 4px;
}
.cd-card {
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
}
.cd-card small {
  display: block;
  color: var(--dim);
  font-size: 0.82em;
}
.cd-mem {
  margin-top: 6px;
  font-size: 0.85em;
  background: #f4f8ff;
  border-radius: 6px;
  padding: 4px 8px;
  color: #2a4a6a;
}
.cd-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.cd-stats div {
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  text-align: center;
  box-shadow: var(--shadow);
}
.cd-stats b {
  display: block;
  font-size: 1.2em;
  color: var(--gf-heading, #2f5e46);
}
.cd-stats small {
  color: var(--dim);
  font-size: 0.75em;
}
.cd-hint {
  margin-top: 8px;
  background: #fff4dc;
  border: 1px solid #e8c47a;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.88em;
}
.cd-found {
  margin-top: 6px;
  border-left: 4px solid #c07a1a;
  background: #fff;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.85em;
  box-shadow: var(--shadow);
}
.cd-found.clean {
  border-left-color: #c0502a;
}
@media (max-width: 700px) {
  .cd-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .cd-head img,
  .cd-ic {
    width: 52px;
    height: 52px;
  }
}
.bclock {
  margin-left: auto;
  font-size: 0.8em;
  font-weight: 700;
  color: #3a4a44;
  font-variant-numeric: tabular-nums;
}

/* ---- app chrome (task windows and terminal software) ---- */
.appbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--app, #2e7a6a);
  color: #fff;
  padding: 5px 12px;
  font-size: 0.85em;
  border-radius: 16px 16px 0 0;
}
.appbar .app-ic {
  font-size: 1.1em;
}
.appbar .app-menu {
  display: flex;
  gap: 12px;
  margin-left: 14px;
  opacity: 0.85;
}
.appbar .app-menu i {
  font-style: normal;
}
.appbar .app-user {
  margin-left: auto;
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.win > .appbar + .win-head {
  border-top: none;
}
.app-win .win {
  width: min(1040px, 97vw);
}
.appshell {
  margin: -12px -16px;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  background: #f6f7f8;
}
.appshell .appbar {
  border-radius: 0;
}
.app-tabs {
  display: flex;
  gap: 2px;
  background: #e8ecee;
  padding: 6px 10px 0;
  border-bottom: 1px solid #d0d6da;
}
.app-tab {
  font: inherit;
  font-size: 0.9em;
  border: 1px solid transparent;
  border-bottom: none;
  background: none;
  padding: 6px 14px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  color: #4a5a62;
}
.app-tab.on {
  background: #fff;
  border-color: #d0d6da;
  color: var(--app);
  font-weight: 700;
  margin-bottom: -1px;
}
.app-body {
  padding: 12px 14px;
  flex: 1;
}
.app-status {
  font-size: 0.75em;
  color: #5a6a72;
  background: #e8ecee;
  border-top: 1px solid #d0d6da;
  padding: 4px 12px;
}
.app-toast {
  background: #e6f4ea;
  border: 1px solid #a8d8b8;
  color: #24523a;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-weight: 700;
  animation: fbin 0.3s ease-out;
}
.app-toast b {
  font-size: 1.2em;
  margin-left: 6px;
}
.app-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.app-kpis div {
  background: #fff;
  border: 1px solid #dde3e6;
  border-radius: 10px;
  padding: 8px 10px;
}
.app-kpis b {
  display: block;
  font-size: 1.2em;
  color: #24423a;
  font-variant-numeric: tabular-nums;
}
.app-kpis b span {
  font-size: 0.7em;
  color: var(--dim);
  margin-left: 2px;
}
.app-kpis small {
  color: var(--dim);
  font-size: 0.78em;
}
.app-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #dde3e6;
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.9em;
}
.app-table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.82em;
  color: #5a6a72;
  background: #f0f3f5;
  padding: 6px 10px;
  border-bottom: 1px solid #dde3e6;
}
.app-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #eef1f3;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.app-table tr:last-child td {
  border-bottom: none;
}
.app-table tr.me td {
  background: #f2f9f4;
}
.app-table tr.today td {
  background: #eef6fc;
  font-weight: 700;
}
.app-table tr.future td {
  color: #a8b0b4;
}
.app-table .who {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-table .who img,
.app-table .who .ph {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #e4e8e2;
  display: grid;
  place-items: center;
}
.app-table .who small {
  display: block;
  color: var(--dim);
  font-size: 0.8em;
}
.app-table td.num {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  font-size: 1.1em;
  color: #2f7fc0;
}
.app-scroll {
  max-height: 52vh;
  overflow-y: auto;
  border-radius: 10px;
}
.app-log {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid #dde3e6;
  border-radius: 10px;
}
.app-log li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid #eef1f3;
  font-size: 0.9em;
}
.app-log .t {
  font-variant-numeric: tabular-nums;
  min-width: 9em;
}
.ehr-split {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px;
}
.ehr-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 56vh;
  overflow-y: auto;
}
.ehr-row {
  font: inherit;
  display: flex;
  gap: 8px;
  align-items: center;
  text-align: left;
  background: #fff;
  border: 1px solid #dde3e6;
  border-radius: 10px;
  padding: 6px 8px;
  cursor: pointer;
}
.ehr-row.on {
  border-color: var(--app);
  box-shadow: 0 0 0 2px rgba(42, 106, 138, 0.2);
}
.ehr-row img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.ehr-row small {
  display: block;
  color: var(--dim);
  font-size: 0.78em;
}
.ehr-main h5 {
  margin: 12px 0 6px;
  font-size: 0.85em;
  color: var(--app);
}
.ehr-head {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid #dde3e6;
  border-radius: 10px;
  padding: 10px;
}
.ehr-head img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}
.ehr-head h3 {
  margin: 0;
}
.ehr-head p {
  margin: 2px 0;
  font-size: 0.85em;
  color: var(--dim);
}
.ehr-head .pid {
  margin-left: auto;
  align-self: flex-start;
  font-family: ui-monospace, monospace;
  font-size: 0.8em;
  color: var(--dim);
}
.ehr-notes {
  background: #fff;
  border: 1px solid #dde3e6;
  border-radius: 10px;
  margin: 0;
  padding: 8px 8px 8px 28px;
  font-size: 0.9em;
}
@media (max-width: 760px) {
  .app-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ehr-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .ehr-list {
    flex-direction: row;
    overflow-x: auto;
  }
  .appbar .app-menu {
    display: none;
  }
}
ul.caselist .cl-t {
  flex: 1;
  min-width: 0;
}
ul.caselist .cl-t small {
  display: block;
  color: var(--dim);
  font-size: 0.75em;
}
.rep-kpis {
  margin-top: 8px;
}
/* pause menu: status + settings */
.menu-win .win {
  width: min(980px, 97vw);
}
.menu-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
}
.menu-status .ms-day b {
  font-size: 1.2em;
  color: #24423a;
  margin-right: 8px;
}
.menu-status .ms-day span {
  color: var(--dim);
}
.menu-status .hb-progress {
  margin: 6px 0 10px;
}
.ms-axes {
  display: grid;
  gap: 4px;
  margin: 8px 0;
}
.ms-axes div {
  display: grid;
  grid-template-columns: 9em 1fr 2.5em;
  align-items: center;
  gap: 8px;
  font-size: 0.85em;
}
.ms-axes i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f0c060, #e0a020);
}
.ms-axes b {
  text-align: right;
  color: #a07010;
}
.ms-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .menu-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
ul.caselist {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
@media (max-width: 520px) {
  ul.caselist {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- progression (js/progress-ui.js): goal chip on the HUD, briefing, level-up, goal screen, locked box ----
   From 飛騨市長 (goalbar / lvdlg / ladder / lockbox), ひだまり薬局 (the green goal band, op-ladder) and
   未然調書 (g-* goal card and screen). Uses the :root variables of kit.css. */
.pg-layer { position: fixed; z-index: 10; }
.pg-bar { display: block; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.1); overflow: hidden; flex: none; min-width: 40px; }
.pg-total .pg-bar { flex: 1; }
.pg-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.5s; }
.pg-bar.mini { height: 5px; max-width: 90px; }
.pg-k { display: inline-block; font-size: 0.75em; font-weight: 700; color: var(--gf-accent-ink, #fff); background: var(--accent); border-radius: 5px; padding: 0 6px; margin-right: 6px; vertical-align: 0.1em; }
.pg-lv { font-weight: 700; color: var(--accent); margin-right: 6px; white-space: nowrap; }
.pg-ck { display: inline-block; width: 1.3em; color: var(--dim); flex: none; }

/* HUD chip */
.pg-hud { pointer-events: auto; display: flex; flex-direction: column; gap: 3px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--gf-panel-soft, var(--gf-panel-soft, rgba(255, 253, 246, 0.92))); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--gf-radius-lg, 12px); padding: 7px 12px; max-width: min(420px, 70vw); line-height: 1.45; }
.pg-hud:hover { background: var(--paper); }
.pg-hud .pg-goal { font-size: 0.8em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-hud .pg-head { display: flex; align-items: baseline; gap: 4px; }
.pg-hud .pg-name { font-weight: 700; }
.pg-hud .pg-meter { margin-left: auto; font-size: 0.8em; color: var(--dim); white-space: nowrap; }
.pg-hud .pg-meter b { color: var(--accent); }
.pg-hud .pg-now { font-size: 0.9em; color: var(--gf-goal, #8a4e0c); font-weight: 700; }
.pg-hud.bump { animation: pg-bump 0.6s ease; }
@keyframes pg-bump { 0% { transform: scale(1); } 35% { transform: scale(1.04); box-shadow: 0 0 0 4px rgba(232, 160, 64, 0.45); } 100% { transform: scale(1); } }

/* shared window parts */
.pg .pg-say { margin-bottom: 6px; }
.pg-big { background: var(--gf-surface-2, #f2f7f2); border: 1px solid var(--line); border-radius: var(--gf-radius-lg, 12px); padding: 10px 14px; margin: 6px 0; }
.pg-big b { font-size: 1.1em; }
.pg-big small { display: block; color: var(--dim); }
.pg-sample { display: flex; justify-content: center; margin: 10px 0; }
.pg-sample:not(:empty) { padding: 8px; border: 1px dashed var(--line); border-radius: var(--gf-radius-lg, 12px); flex-direction: column; gap: 3px; background: var(--gf-panel-soft, var(--gf-panel-soft, rgba(255, 253, 246, 0.92))); }
.pg-sample .pg-goal { font-size: 0.8em; color: var(--dim); }
.pg-sample .pg-meter { font-size: 0.8em; color: var(--dim); margin-left: 8px; }
.pg-sample .pg-now { font-weight: 700; color: var(--gf-goal, #8a4e0c); }
.pg-sub { font-weight: 700; color: var(--dim); font-size: 0.85em; margin: 10px 0 4px; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pg-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: #e8f2e8; border: 1px solid #b8d8c0; font-size: 0.88em; }
.pg-chip.off { background: var(--gf-surface-2, #f1efe9); border-color: var(--line); color: var(--dim); }
.pg-chip i { font-style: normal; }
.pg-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.pg-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.pg-dots i.on { background: var(--accent); }
.pg-start b { color: var(--gf-goal, #8a4e0c); }
.pg-h { font-size: 1em; margin: 12px 0 4px; color: var(--accent); }

/* ladder (briefing) and level steps (level-up) */
.pg-ladder { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.pg-ladder li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; padding: 5px 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--dim); }
.pg-ladder li.done { color: var(--ink); background: var(--gf-surface-2, #f2f7f2); }
.pg-ladder li.now { color: var(--ink); border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.pg-ladder small { color: var(--dim); }
.pg-ladder em { margin-left: auto; font-style: normal; font-size: 0.8em; font-weight: 700; color: #1a1400; background: var(--accent2); border-radius: 6px; padding: 0 6px; }
.pg-steps { display: flex; gap: 4px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.pg-steps i { font-style: normal; width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; background: #eee9dc; color: var(--dim); font-size: 0.85em; font-weight: 700; }
.pg-steps i.done { background: #cfe3d4; color: var(--accent); }
.pg-steps i.on { background: var(--accent); color: var(--gf-accent-ink, #fff); transform: scale(1.15); }
.pg-new { list-style: none; padding: 0; margin: 4px 0; }
.pg-new li { padding: 5px 10px; margin: 4px 0; border-radius: 9px; background: var(--gf-highlight, #fff7e6); border: 1px solid #ecd39a; }
.pg-new small { display: block; color: var(--dim); }
.pg-levelup .win { animation: pg-pop 0.35s ease; }
@keyframes pg-pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* conditions and goals */
.pg-conds, .pg-goals { list-style: none; padding: 0; margin: 4px 0; }
.pg-conds li, .pg-goals li { display: flex; align-items: center; gap: 6px; padding: 3px 0; flex-wrap: wrap; }
.pg-conds li.ok, .pg-goals li.ok { color: var(--ok); }
.pg-conds li.ok .pg-ck, .pg-goals li.ok .pg-ck { color: var(--ok); font-weight: 700; }
.pg-conds small, .pg-n { color: var(--dim); font-size: 0.85em; margin-left: auto; }
.pg-gt { flex: 1; min-width: 10em; }
.pg-gt em { font-style: normal; font-size: 0.75em; color: var(--dim); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; margin-left: 6px; }
.pg-gt small { display: block; color: var(--dim); font-size: 0.82em; }
.pg-goals li.opt { color: var(--dim); }

/* goal screen */
.pg-top { position: sticky; top: -12px; background: var(--panel); padding-bottom: 6px; z-index: 1; }
.pg-total { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.pg-total b { color: var(--accent); }
.pg-stages { display: flex; flex-direction: column; gap: 8px; }
.pg-stage { border: 1px solid var(--line); border-radius: var(--gf-radius-lg, 12px); padding: 8px 12px; background: var(--gf-surface, #fff); color: var(--gf-text, #23302c); }
.pg-stage h4 { margin: 0 0 4px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; }
.pg-stage h4 small { color: var(--dim); font-weight: 400; }
.pg-state { margin-left: auto; font-size: 0.8em; padding: 1px 8px; border-radius: 999px; background: var(--gf-chip-bg, #e6ebdf); color: var(--gf-chip-text, #2b3a30); }
.pg-stage.now { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.pg-stage.now .pg-state { background: var(--accent); color: var(--gf-accent-ink, #fff); }
.pg-stage.done { background: var(--gf-hint-bg, #f6faf6); color: var(--gf-hint-text, #1f3a2c); }
.pg-stage.done .pg-state { background: var(--gf-hint-line, #3a7a5a); color: var(--gf-surface, #fff); }
.pg-stage.later { background: var(--gf-surface-2, #faf8f3); color: var(--gf-text-dim, #5c6662); }
.pg-intro { margin: 2px 0 6px; font-size: 0.92em; }
.pg-unl { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; }
.pg-hidden { margin: 2px 0; font-size: 0.9em; }

/* locked feature */
.pg-lock { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px dashed #c8bfa8; border-radius: var(--gf-radius-lg, 12px); background: #faf8f3; color: var(--dim); margin: 6px 0; }
.pg-lock b { color: var(--ink); }
.pg-lock small { display: block; font-size: 0.85em; }
.pg-lock .btn { margin-left: auto; flex: none; }
.pg-lk { font-size: 1.3em; }

/* toasts when there is no KitUI */
.pg-toasts { position: fixed; right: 12px; top: 12px; z-index: 12; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; max-width: min(420px, 70vw); }
.pg-toast { background: rgba(255, 253, 246, 0.97); border-left: 4px solid var(--ok); padding: 7px 12px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); transition: opacity 0.6s, transform 0.6s; }
.pg-toast.out { opacity: 0; transform: translateX(20px); }

@media (max-width: 600px) {
  .pg-hud { max-width: calc(100vw - 24px); padding: 6px 10px; }
  .pg-hud .pg-goal { display: none; }
  .pg-lock { flex-wrap: wrap; }
}

/* game-kit: management-sim UI (notify.js nt-*, timebar.js tb-*, delta.js dl-*, chart.js ch-*).
   From ひだ、人口倍増計画 (hida.css). Uses the kit.css custom properties (--accent, --warn, --ok, --panel, --ink, --line, --dim). */

/* ---- notify.js: log, dialogs ---- */
.nt-log { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.nt-log li { display: grid; grid-template-columns: 6.5em 1.4em 1fr; gap: 4px; padding: 5px 4px; border-bottom: 1px solid var(--line); line-height: 1.5; font-size: 0.92em; }
.nt-log li.unread { background: rgba(232, 160, 64, 0.08); }
.nt-log .nt-at { color: var(--dim); font-size: 0.88em; white-space: nowrap; }
.nt-log .nt-tx em { font-style: normal; font-size: 0.8em; background: #eee8da; border-radius: 6px; padding: 0 6px; margin-right: 4px; }
.nt-log li.nt-good .nt-tx { color: var(--ok); }
.nt-log li.nt-bad .nt-tx, .nt-log li.nt-important .nt-tx { color: var(--warn); font-weight: 700; }
.nt-empty { color: var(--dim); }
.nt-filters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.nt-filters button { font: inherit; font-size: 0.85em; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; cursor: pointer; color: var(--ink); }
.nt-filters button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.nt-badge:not(:empty) { display: inline-block; min-width: 1.5em; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 0.75em; text-align: center; font-style: normal; }
.nt-overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 10px; background: rgba(40, 50, 45, 0.32); }
.nt-dlg { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; width: min(520px, 96vw); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25); }
.nt-head { padding: 12px 16px 8px; border-bottom: 1px solid var(--line); }
.nt-head b { display: block; font-size: 1.1em; }
.nt-head small { color: var(--dim); }
.nt-body { padding: 12px 16px; overflow-y: auto; line-height: 1.7; }
.nt-foot { padding: 8px 12px 12px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 4px; }
.nt-important .nt-dlg, .nt-win.nt-important .win, .nt-bad .nt-dlg, .nt-win.nt-bad .win { border: 2px solid var(--warn); }
.nt-important .nt-head b, .nt-win.nt-important .win-title, .nt-win.nt-bad .win-title { color: var(--warn); }

/* ---- timebar.js ---- */
.tb-root { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.tb-play { font: inherit; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--accent); background: #fff; color: var(--accent); font-size: 1.1em; cursor: pointer; }
.tb-play.on { background: var(--accent); color: #fff; }
.tb-speed { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tb-speed button, .tb-skip { font: inherit; font-size: 0.85em; border: none; background: #fff; color: var(--ink); padding: 6px 10px; cursor: pointer; min-height: 36px; }
.tb-speed button + button { border-left: 1px solid var(--line); }
.tb-speed button.on { background: var(--accent); color: #fff; font-weight: 700; }
.tb-skip { border: 1px solid var(--line); border-radius: 10px; }
.tb-track { flex: 1 1 200px; min-width: 0; }
.tb-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 0.92em; }
.tb-date b { font-size: 1.08em; }
.tb-state { color: var(--dim); }
.tb-state a { color: var(--warn); font-weight: 700; cursor: pointer; text-decoration: underline; }
.tb-label small { color: var(--dim); margin-left: auto; }
.tb-cd { color: var(--warn); }
.tb-prog { height: 6px; margin-top: 4px; background: #eee8da; border-radius: 3px; overflow: hidden; }
.tb-prog i { display: block; height: 100%; background: var(--accent); transition: width 0.05s linear; }
.tb-prog i.held { background: var(--warn); opacity: 0.6; }

/* ---- delta.js ---- */
.dl-list { list-style: none; margin: 6px 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dl-list li { display: grid; grid-template-columns: 1fr auto 4.5em; gap: 8px; align-items: baseline; padding: 6px 10px; background: #fff; }
.dl-list li + li { border-top: 1px solid var(--line); }
.dl-list.compact li { padding: 3px 8px; font-size: 0.88em; }
.dl-lab small { display: block; color: var(--dim); font-size: 0.75em; }
.dl-val { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl-by { text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl-list li.dl-good { background: rgba(46, 122, 74, 0.07); }
.dl-list li.dl-good .dl-by { color: var(--ok); }
.dl-list li.dl-bad { background: rgba(192, 80, 42, 0.09); }
.dl-list li.dl-bad .dl-by, .dl-list li.dl-bad .dl-val b { color: var(--warn); }
.dl-list li.dl-flat .dl-by { color: var(--dim); }
.dl-chip { display: inline-block; font-size: 0.8em; border-radius: 6px; padding: 1px 6px; margin: 1px 3px 1px 0; }
.dl-chip.dl-good { background: rgba(46, 122, 74, 0.12); color: var(--ok); }
.dl-chip.dl-bad { background: rgba(192, 80, 42, 0.12); color: var(--warn); }
.dl-chip.dl-flat { background: #eee8da; color: var(--dim); }
.dl-verdict { font-weight: 700; margin: 4px 0; }
.dl-verdict.dl-good { color: var(--ok); }
.dl-verdict.dl-bad { color: var(--warn); }
.dl-legend, .dl-empty { color: var(--dim); font-size: 0.82em; }
.dl-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; }
.dl-dlg.dl-bad .win, .dl-dlg.dl-bad .nt-dlg { border: 2px solid var(--warn); }
.dl-dlg.dl-bad .win-title, .dl-dlg.dl-bad .nt-head b { color: var(--warn); }

/* ---- chart.js ---- */
.ch-svg { width: 100%; height: auto; display: block; font-size: 11px; }
.ch-grid { stroke: var(--line); stroke-width: 1; opacity: 0.7; }
.ch-base { stroke: var(--dim); stroke-width: 1; opacity: 0.6; }
.ch-axis { fill: var(--dim); }
.ch-ref { stroke-width: 1.8; stroke-dasharray: 6 4; }
.ch-reflab { font-weight: 700; }
.ch-line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.ch-line.dashed { stroke-dasharray: 5 4; }
.ch-area { opacity: 0.12; stroke: none; }
.ch-last { stroke: #fff; stroke-width: 1.5; }
.ch-mk { cursor: pointer; }
.ch-mkdot { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.ch-mk.good .ch-mkdot { fill: var(--ok); }
.ch-mk.bad .ch-mkdot { fill: var(--warn); }
.ch-mkbang { fill: var(--warn); font-weight: 700; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.82em; color: var(--dim); margin-top: 4px; }
.ch-legend i { display: inline-block; width: 16px; height: 0; border-top: 3px solid var(--c); vertical-align: middle; margin-right: 4px; }
.ch-legend i.dashed { border-top-style: dashed; }
.ch-spark { vertical-align: middle; }

/* game-kit: side stories — journal / collection (jr-*, js/journal-ui.js), the streaming veil (st-*,
   js/stream.js) and the hiding-spot peek overlay (hd-*, js/hide.js). Uses the kit.css custom properties;
   the tabs are kit.css .hb-tabs. */

/* ---- journal ---- */
.jr { display: flex; flex-direction: column; gap: 8px; }
.jr-win .win-body { min-height: 50vh; }
.jr .hb-tab { position: relative; }
.jr-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-left: 4px; vertical-align: top; }
.jr-sum { display: flex; align-items: center; gap: 10px; }
.jr-bar { flex: 1; height: 8px; border-radius: 4px; background: #ece6d6; overflow: hidden; }
.jr-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.4s; }
.jr-num { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; margin-left: auto; }
.jr-num small { font-weight: 400; color: var(--dim); margin-left: 4px; }
.jr-dim { color: var(--dim); font-size: 0.88em; }
.jr-empty { color: var(--dim); text-align: center; padding: 16px 0; }
.jr-new { display: inline-block; font-size: 0.75em; font-weight: 700; letter-spacing: 0.04em; color: var(--gf-badge-text, #fff); background: var(--gf-badge-bg, #b3261e); border-radius: 6px; padding: 0 5px; margin-right: 6px; vertical-align: middle; animation: jr-pop 0.5s ease-out; }
@keyframes jr-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.jr-chip { display: inline-block; font-size: 0.82em; padding: 1px 8px; margin: 2px 3px 2px 0; border-radius: 10px; background: #f1ecdf; border: 1px solid var(--line); }
.jr-chip.on { background: var(--accent2); border-color: var(--accent2); color: #fff; }

.jr-entry { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); margin: 6px 0; padding: 0 12px; }
.jr-entry > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 9px 0; cursor: pointer; list-style: none; }
.jr-entry > summary::-webkit-details-marker { display: none; }
.jr-entry.done { background: #f3f7f1; }
.jr-entry > p { margin: 4px 0 8px; }
.jr-prog { flex: 0 0 72px; height: 6px; border-radius: 3px; background: #ece6d6; overflow: hidden; margin-left: auto; }
.jr-prog i { display: block; height: 100%; background: var(--accent); }
.jr-entry.done .jr-prog i { background: var(--ok); }
.jr-entry .jr-num { margin-left: 0; }
.jr-steps { list-style: none; margin: 4px 0 8px; padding: 0; }
.jr-steps li { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; line-height: 1.6; }
.jr-steps li.cur { background: #fff7e6; border-radius: 8px; padding: 5px 6px; }
.jr-box { flex: 0 0 18px; height: 18px; margin-top: 3px; border: 2px solid var(--line); border-radius: 5px; display: grid; place-items: center; font-size: 12px; color: #fff; }
.jr-steps li.done .jr-box { background: var(--ok); border-color: var(--ok); }
.jr-steps li.cur .jr-box { border-color: var(--accent2); }
.jr-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-bottom: 10px; }
.jr-rw { padding-bottom: 10px; }

/* locked: silhouettes */
.jr-locked { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin-top: 10px; }
.jr-sil { border: 1px dashed #c8c0ae; border-radius: 10px; padding: 8px; text-align: center; color: #a8a090; background: repeating-linear-gradient(135deg, #f6f2e8 0 6px, #efe9dc 6px 12px); min-height: 52px; display: flex; flex-direction: column; justify-content: center; }
.jr-sil b { letter-spacing: 0.2em; }
.jr-sil span { font-size: 0.78em; }
.jr-sil.more { font-weight: 700; }

/* threads (気になること) */
.jr-q { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.jr-q > div:last-child { flex: 1; min-width: 0; }
.jr-pic { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 10px; background: #2a3238 center / cover no-repeat; }
.jr-nopic { display: grid; place-items: center; color: #8a949a; font-size: 26px; font-weight: 700; background: linear-gradient(135deg, #3a444c, #1e2428); }
.jr-notes { margin: 4px 0; padding-left: 18px; }
.jr-notes li { line-height: 1.6; }
.jr-qmark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent2); color: #fff; font-weight: 700; margin-right: 6px; }
.jr-q-done { border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; padding: 0 10px; background: var(--paper); }
.jr-q-done > summary { padding: 8px 0; cursor: pointer; }
.jr-q-done .jr-q { border-bottom: none; }

/* collection */
.jr-kind .sec { display: flex; align-items: baseline; }
.jr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.jr-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 10px; border: 1px solid var(--line); background: #f4f0e6; font: inherit; font-size: 0.8em; color: var(--dim); text-align: center; }
.jr-cell.got { background: #fff; color: var(--ink); cursor: pointer; }
.jr-cell.got:hover { border-color: var(--accent); }
.jr-cell .jr-pic { width: 56px; height: 56px; flex-basis: 56px; }
.jr-cell:not(.got) .jr-pic { background: #d8d2c4; color: #f4f0e6; }
.jr-cell span:not(.jr-new) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.jr-cell .jr-new { position: absolute; top: -4px; right: -4px; margin: 0; }
.jr-detail:not(:empty) { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.jr-detail p { margin: 4px 0 0; }

/* ---- streaming veil ---- */
.st-veil { position: fixed; inset: 0; z-index: 14; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 18vh; background: rgba(10, 12, 14, 0.62); color: #ece8dc; letter-spacing: 0.06em; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.st-veil.on { opacity: 1; pointer-events: auto; }
.st-veil-t::after { content: ""; display: inline-block; width: 1em; height: 1em; margin-left: 10px; vertical-align: -0.15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: st-spin 0.9s linear infinite; }
@keyframes st-spin { to { transform: rotate(360deg); } }
.st-stats { position: fixed; right: 8px; bottom: 8px; z-index: 6; font: 11px/1.45 ui-monospace, monospace; color: #e8f0e8; background: rgba(0, 0, 0, 0.55); padding: 6px 9px; border-radius: 8px; white-space: pre; pointer-events: none; }

/* ---- hiding spot: looking out through the slats ---- */
.hd-peek { position: fixed; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background:
    radial-gradient(ellipse 34% 22% at 50% 48%, transparent 60%, rgba(0, 0, 0, 0.92) 100%),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.96) 0 22px, transparent 22px 34px); }
.hd-peek.on { opacity: 1; }
body.hd-hiding #crosshair { display: none; }

@media (max-width: 480px) {
  .jr-prog { flex-basis: 48px; }
  .jr-pic { flex-basis: 48px; width: 48px; height: 48px; }
  .jr-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}

/*@section chat*/
/* game-kit: messenger screen for chat fiction (js/chat-ui.js). All classes are cx-*. Skins on the root:
   .skin-line (green, chat-app like) and .skin-plain (neutral); override the --cx-* properties to theme.
   From 未確認室 / 返事をする人 / 既読の向こう (css/app.css). */
.cx-app {
  --cx-bg: #c9d6e2; --cx-head: #26323c; --cx-head-ink: #fff; --cx-in: #fff; --cx-in-ink: #1d2328;
  --cx-out: #7fd36a; --cx-out-ink: #102010; --cx-meta: #4d5a66; --cx-sys: rgba(40, 52, 64, 0.45); --cx-sys-ink: #fff;
  --cx-bar: #fff; --cx-accent: var(--accent, #3a7a5a); --cx-accent-ink: var(--gf-accent-ink, #fff); --cx-chip: #e9f6e4; --cx-radius: 18px; --cx-c: #888;
  position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden;
  background: var(--cx-bg); color: var(--cx-in-ink);
  font-family: 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', var(--font, sans-serif); font-size: calc(15px * var(--fs, 1));
}
.cx-app.skin-line { --cx-bg: #b9cbdc; --cx-head: #2b3a4a; --cx-out: #85e070; --cx-chip: #e3f7dc; --cx-accent: #2fae4a; --cx-accent-ink: #05220e; }
.cx-app.skin-plain { --cx-bg: #f2f1ed; --cx-head: #fffdf6; --cx-head-ink: var(--ink, #23302c); --cx-in: #fff; --cx-out: #dfe9f6;
  --cx-out-ink: #1d2a38; --cx-sys: rgba(0, 0, 0, 0.08); --cx-sys-ink: #4a5450; --cx-accent: var(--accent, #3a7a5a); --cx-chip: #eef3ef; }
.cx-app.skin-plain .cx-bubble, .cx-app.skin-plain .cx-choice { border: 1px solid var(--line, #d8d2c2); }
.cx-app * { box-sizing: border-box; }
.cx-app button { font: inherit; cursor: pointer; }

/* header and tabs */
.cx-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--cx-head); color: var(--cx-head-ink); flex: none; }
.cx-htext { flex: 1; min-width: 0; }
.cx-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-sub { font-size: 0.75em; opacity: 0.75; }
.cx-hbtn { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 999px; padding: 3px 12px; font-size: 0.8em; opacity: 0.85; }
.cx-tabs { display: flex; gap: 4px; padding: 6px 12px; overflow-x: auto; background: rgba(255, 255, 255, 0.55); flex: none; scrollbar-width: none; }
.cx-tabs[hidden] { display: none; }
.cx-tab { position: relative; border: 0; background: transparent; padding: 5px 12px; border-radius: 999px; white-space: nowrap; color: var(--cx-meta); }
.cx-tab.on { background: var(--cx-head); color: var(--cx-head-ink); }
.cx-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 0.72em; line-height: 18px; text-align: center; }
.cx-tab-typing::after { content: "…"; margin-left: 4px; animation: cx-blink 1s infinite; }

/* log */
.cx-logs { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 16px; overscroll-behavior: contain; }
.cx-log[hidden] { display: none; }
.cx-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 3px; animation: cx-in 0.22s ease-out; }
.cx-row.cx-first { margin-top: 12px; }
.cx-out { justify-content: flex-end; }
.cx-col { display: flex; flex-direction: column; min-width: 0; max-width: min(78%, 520px); }
.cx-out .cx-col { align-items: flex-end; }
.cx-av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: var(--cx-c); color: #fff; font-weight: 700; font-size: 0.9em; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7); }
.cx-av img { width: 100%; height: 100%; object-fit: cover; }
.cx-av-gap { visibility: hidden; height: 1px; }
.cx-name { font-size: 0.75em; font-weight: 700; color: var(--cx-c); margin: 0 0 3px 4px; filter: brightness(0.8); }
.cx-line { display: flex; align-items: flex-end; gap: 5px; }
.cx-out .cx-line { flex-direction: row-reverse; }
.cx-bubble { padding: 8px 12px; border-radius: var(--cx-radius); background: var(--cx-in); color: var(--cx-in-ink); line-height: 1.55;
  overflow-wrap: anywhere; border-left: 3px solid var(--cx-c); }
.cx-first.cx-in .cx-bubble { border-top-left-radius: 4px; }
.cx-out .cx-bubble { background: var(--cx-out); color: var(--cx-out-ink); border-left: 0; }
.cx-first.cx-out .cx-bubble { border-top-right-radius: 4px; }
.cx-meta { display: flex; flex-direction: column; font-size: 0.66em; color: var(--cx-meta); white-space: nowrap; line-height: 1.3; }
.cx-out .cx-meta { align-items: flex-end; }
.cx-read:empty { display: none; }
.cx-read { color: var(--cx-meta); font-weight: 700; }

/* typing */
.cx-dots { display: flex; gap: 4px; padding: 12px 14px; }
.cx-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--cx-meta); opacity: 0.4; animation: cx-dot 1.1s infinite; }
.cx-dots i:nth-child(2) { animation-delay: 0.18s; }
.cx-dots i:nth-child(3) { animation-delay: 0.36s; }

/* centre lines */
.cx-sys, .cx-date, .cx-act-note, .cx-after { display: flex; flex-direction: column; align-items: center; margin: 12px 0; text-align: center; }
.cx-sys span, .cx-date span { display: inline-block; max-width: 92%; padding: 3px 12px; border-radius: 999px; background: var(--cx-sys); color: var(--cx-sys-ink); font-size: 0.78em; line-height: 1.5; }
.cx-date span { font-weight: 700; }
.cx-act-note span { font-size: 0.78em; color: var(--cx-meta); border: 1px dashed var(--cx-meta); border-radius: 999px; padding: 2px 10px; }
.cx-after { margin: 26px 0 14px; }
.cx-after-when { font-weight: 700; letter-spacing: 0.2em; color: var(--cx-head); }
.cx-after-date { font-size: 0.75em; color: var(--cx-meta); }
.cx-summary, .cx-end { margin: 14px auto; max-width: 520px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.92); color: #1d2328; line-height: 1.7; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); }
.cx-summary p, .cx-end p { margin: 6px 0 0; }
.cx-summary-k, .cx-end-k { font-size: 0.75em; font-weight: 700; color: var(--cx-meta); letter-spacing: 0.1em; }
.cx-end { border-top: 4px solid var(--cx-accent); text-align: center; }
.cx-end-bad { border-top-color: #8a2a36; }
.cx-end-name { font-size: 1.25em; font-weight: 700; margin-top: 2px; }
.cx-new { margin-left: 6px; padding: 0 6px; border-radius: 4px; background: #e5484d; color: #fff; }
.cx-end-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.cx-btn { border: 1px solid #b8b0a0; background: #fff; color: #1d2328; border-radius: 10px; padding: 7px 14px; }
.cx-btn.primary { background: var(--cx-accent); border-color: var(--cx-accent); color: var(--cx-accent-ink, #fff); }

/* media */
.cx-media { margin: 0; border-radius: 14px; overflow: hidden; background: var(--cx-in); max-width: 260px; }
.cx-media img, .cx-media video { display: block; width: 100%; max-height: 320px; object-fit: cover; background: #111; }
.cx-cap { padding: 6px 10px; font-size: 0.78em; color: var(--cx-meta); line-height: 1.5; }
.cx-ph .cx-ph-k { display: grid; place-items: center; aspect-ratio: 4 / 3; width: 220px; max-width: 100%;
  background: repeating-linear-gradient(135deg, #3a4148 0 10px, #333a40 10px 20px); color: #cfd6dc; font-size: 0.85em; letter-spacing: 0.1em; }
.cx-voice-wrap { display: flex; flex-direction: column; gap: 4px; }
.cx-out .cx-voice-wrap { align-items: flex-end; }
.cx-voice { display: flex; align-items: center; gap: 8px; min-width: 190px; }
.cx-play { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--cx-c); color: #fff; font-size: 0.8em; flex: none; }
.cx-out .cx-play { background: #2b6a2a; }
.cx-wave { display: flex; align-items: center; gap: 2px; height: 22px; flex: 1; }
.cx-wave i { flex: 1; background: currentColor; opacity: 0.35; border-radius: 1px; height: 40%; }
.cx-wave i:nth-child(3n) { height: 85%; } .cx-wave i:nth-child(4n+1) { height: 60%; } .cx-wave i:nth-child(5n+2) { height: 25%; }
.cx-playing .cx-wave i { animation: cx-wave 0.7s infinite alternate; }
.cx-playing .cx-wave i:nth-child(2n) { animation-delay: 0.2s; }
.cx-dur { font-size: 0.75em; opacity: 0.7; }
.cx-trans { font-size: 0.78em; color: var(--cx-meta); background: rgba(255, 255, 255, 0.6); border-radius: 10px; padding: 4px 10px; max-width: 260px; }
.cx-stamp { font-size: 2.6em; line-height: 1.1; padding: 2px 4px; }
.cx-file-k { display: inline-block; margin-right: 8px; padding: 1px 6px; border-radius: 4px; background: var(--cx-meta); color: #fff; font-size: 0.7em; font-weight: 700; }

/* choices and input bar */
.cx-choices { display: flex; flex-direction: column; gap: 6px; padding: 0 16px; max-height: 45%; overflow-y: auto; flex: none; }
.cx-choosing .cx-choices { padding: 10px 16px; background: rgba(255, 255, 255, 0.75); border-top: 1px solid rgba(0, 0, 0, 0.08); }
.cx-prompt { font-size: 0.75em; color: var(--cx-meta); font-weight: 700; }
.cx-choice { text-align: left; border: 1px solid var(--cx-accent); background: #fff; color: #1d2328; border-radius: 14px; padding: 10px 14px; line-height: 1.5; animation: cx-in 0.25s ease-out backwards; }
.cx-choice:hover, .cx-chip:hover { background: var(--cx-chip); }
.cx-act { border-style: dashed; }
.cx-bar { display: flex; align-items: center; gap: 8px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--cx-bar); border-top: 1px solid rgba(0, 0, 0, 0.08); flex: none; }
.cx-input { flex: 1; color: #9aa3aa; padding: 8px 14px; border-radius: 999px; background: #f0f2f4; font-size: 0.9em; }
.cx-chip { flex: 1; text-align: left; border: 1px solid var(--cx-accent); background: var(--cx-chip); color: #1d2328; border-radius: 999px; padding: 8px 14px; animation: cx-pulse 1.6s ease-in-out infinite; }
.cx-send { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--cx-accent); color: var(--cx-accent-ink, #fff); font-weight: 700; }
.cx-send:disabled { opacity: 0.35; cursor: default; }

/* banner, sheet */
.cx-banner { position: absolute; left: 16px; right: 16px; top: 8px; z-index: 3; padding: 10px 14px; border-radius: 14px; background: rgba(30, 36, 42, 0.92); color: #fff;
  font-size: 0.85em; transform: translateY(-140%); transition: transform 0.3s; pointer-events: none; }
.cx-banner.on { transform: none; }
.cx-sheet { position: absolute; inset: 0; z-index: 15; background: rgba(0, 0, 0, 0.45); display: flex; align-items: flex-end; justify-content: center; }
.cx-sheet[hidden] { display: none; }
.cx-sheet-in { width: 100%; max-width: 560px; max-height: 85%; overflow-y: auto; background: #fff; color: #1d2328; border-radius: 18px 18px 0 0; padding: 14px 16px 20px; }
.cx-sheet-head { display: flex; justify-content: space-between; align-items: center; }
.cx-x { border: 0; background: transparent; font-size: 1.5em; line-height: 1; }
.cx-sheet-sub { margin-top: 14px; font-weight: 700; font-size: 0.85em; color: var(--cx-meta); }
.cx-gal { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cx-gal li { padding: 10px 12px; border-radius: 12px; background: #f4f5f2; line-height: 1.55; }
.cx-gal li p { margin: 4px 0 0; font-size: 0.85em; }
.cx-gal-k { display: block; font-size: 0.72em; color: var(--cx-meta); font-weight: 700; }
.cx-gal-off { color: #7b8287; }
.cx-gal .cx-btn { margin-top: 6px; }

/* effects */
/* @fx: only the app misbehaving (stale talk, duplicated row, error row, broken image, 文字化け) — never a shaking,
   tinted or vignetted screen */
.cx-dim .cx-logs { filter: grayscale(1); opacity: 0.7; }
.cx-banner.cx-banner-err { background: #fff4e5; color: #7a4a10; border: 1px solid #f0c890; }
.cx-dup { opacity: 0.92; }
.cx-err span { background: #fdecec; color: #9a2f2f; }
.cx-retry { margin-top: 4px; border: 0; background: transparent; color: var(--cx-meta); font-size: 0.72em; text-decoration: underline; }
.cx-broken .cx-ph-k { font-size: 0.8em; color: #6b7178; }
.cx-garbled { font-family: monospace; letter-spacing: 0.02em; }
@keyframes cx-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes cx-dot { 0%, 60%, 100% { opacity: 0.3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes cx-blink { 50% { opacity: 0.2; } }
@keyframes cx-wave { to { transform: scaleY(1.8); opacity: 0.8; } }
@keyframes cx-pulse { 50% { box-shadow: 0 0 0 4px rgba(47, 174, 74, 0.18); } }
@media (prefers-reduced-motion: reduce) { .cx-app *, .cx-app { animation: none !important; transition: none !important; } }
@media (max-width: 400px) { .cx-col { max-width: 82%; } .cx-av { width: 32px; height: 32px; } }

/*@end*/
/* ---- task mini games (js/task-minigames.js, rule S16; docs/task-minigames.md). Theme: --tm-green / --tm-amber / --tm-dim on #mg ---- */
#mg { --tm-green: var(--gf-mg-accent, #46c27a); --tm-amber: var(--gf-mg-warn, #ffcc4a); --tm-dim: var(--gf-mg-dim, #6a8a76); }
#mg .desk-only { display: inline; }
body.touch #mg .desk-only { display: none; }
@media (pointer: coarse) { #mg .desk-only { display: none; } }
#mg { position: fixed; inset: 0; z-index: calc(var(--gf-z-window, 60) + 5); display: flex; align-items: flex-start; justify-content: center; background: var(--gf-overlay-strong, rgba(0, 0, 0, 0.72)); padding: max(56px, env(safe-area-inset-top)) 12px 110px; overflow: auto; }
#mg .mg-box { width: min(560px, 100%); background: var(--gf-mg-bg, #0a1410); border: 1px solid var(--gf-mg-line, #2a5a3a); border-radius: 10px; padding: 12px 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
/* a PC screen: the minigame box uses the screen like the windows do (phones keep 560 / full width) */
@media (min-width: 900px) and (min-height: 700px) { #mg .mg-box { width: min(max(560px, 48vw), 900px); font-size: 17px; } }
#mg .mg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--tm-green); }
#mg .mg-x, #mg .mg-ok, #mg .mg-step { min-height: max(48px, var(--gf-hit, 44px)); padding: 0 16px; border-radius: 8px; border: 1px solid var(--gf-mg-line, #2a5a3a); background: var(--gf-mg-btn, #12261a); color: var(--gf-mg-ink, #d8ffe4); cursor: pointer; font-size: 15px; }
#mg .mg-ok { margin-top: 10px; width: 100%; border-color: var(--tm-amber); background: var(--gf-mg-btn, #12261a); color: var(--tm-amber); font-weight: 700; }
#mg .mg-help { margin: 8px 0; padding: 6px 10px; border-left: 3px solid var(--gf-note-line, var(--tm-amber)); background: var(--gf-note-bg, #2a2410); color: var(--gf-note-text, #fff3c8); font-size: 15px; line-height: 1.6; }
#mg .mg-stage { position: relative; padding: 10px; border-radius: 8px; background: var(--gf-mg-bg-2, #0b1810); border: 1px solid var(--gf-mg-line, #1d3a28); user-select: none; touch-action: none; }
#mg .mg-stage.flash { animation: mgflash 0.35s; }
#mg.calm .mg-stage.flash { animation: none; }
@keyframes mgflash { 30% { box-shadow: inset 0 0 0 3px #e0483a; } }
#mg .mg-msg { min-height: 1.6em; margin-top: 8px; font-size: 14px; color: var(--gf-mg-ink, #c8f8d8); }
#mg .mg-msg.bad { color: var(--gf-mg-bad, #ff9a8a); }
#mg .mg-foot { font-size: 12px; color: var(--tm-dim); }
#mg.won .mg-stage { border-color: var(--tm-green); }
#mg .al-win { position: relative; height: 96px; border-radius: 6px; overflow: hidden; background: repeating-linear-gradient(#e8e2d0 0 14px, #d8d2c0 14px 15px); }
#mg .al-mark { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #e0483a; }
#mg .al-mark span { position: absolute; top: 2px; left: 6px; font-size: 12px; padding: 0 5px; border-radius: 4px; background: #fffdf6; color: #7a1a10; white-space: nowrap; }
#mg .al-item { position: absolute; top: 26px; height: 50px; width: 70px; margin-left: -35px; background: repeating-linear-gradient(90deg, #111 0 3px, #f4f0e6 3px 6px, #111 6px 8px, #f4f0e6 8px 13px); border: 2px solid #111; display: grid; place-items: end center; }
#mg .al-item span { background: #f4f0e6; color: #111; font-size: 10px; padding: 0 3px; }
#mg .al-range { width: 100%; height: 48px; margin-top: 10px; accent-color: var(--tm-amber); }
#mg .dl-face { position: relative; width: 180px; height: 180px; margin: 0 auto; border-radius: 50%; background: radial-gradient(#2a3238 0 60%, #1a2024 61%); border: 3px solid #4a7a5a; touch-action: none; cursor: grab; }
#mg .dl-tick, #mg .dl-knob { position: absolute; inset: 0; }
#mg .dl-tick i { position: absolute; left: calc(50% - 3px); top: 4px; width: 6px; height: 22px; background: #e0483a; border-radius: 3px; }
#mg .dl-needle { position: absolute; left: calc(50% - 5px); top: 26px; width: 10px; height: 64px; border-radius: 5px; background: linear-gradient(90deg, #d8b420, #a08010); }
#mg .dl-lbl { position: absolute; left: 50%; transform: translateX(-50%); bottom: 36px; z-index: 2; padding: 1px 10px; border-radius: 10px; text-align: center; font-size: 14px; background: #0a1410; color: #d8ffe4; }
#mg .dl-keys { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
#mg .sq-order { display: flex; justify-content: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
#mg .sq-n { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--gf-mg-line, #2a5a3a); color: var(--gf-mg-ink, #d8ffe4); font-size: 14px; }
#mg .sq-n.ok { background: rgba(70, 194, 122, 0.25); border-color: var(--tm-green); }
#mg .sq-chip { color: var(--c); font-size: 22px; }
#mg .sq-pad { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
#mg .sq-btn { min-height: 64px; border-radius: 10px; border: 2px solid var(--c); background: var(--gf-mg-btn, #12261a); color: var(--c); font-size: 28px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
#mg .sq-btn small { font-size: 14px; color: var(--gf-mg-ink, #d8ffe4); }
#mg .wp-glass { position: relative; height: 168px; border-radius: 6px; overflow: hidden; background: #aee0ff; border: 3px solid #4a5a60; }
#mg .wp-scan { position: absolute; inset: 0; display: grid; place-items: center; font: 700 26px monospace; letter-spacing: 3px; color: #111; background: linear-gradient(#e8f4ff, #bfe4ff); }
#mg .wp-dirt { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
#mg .wp-bar { height: 10px; margin-top: 8px; border-radius: 5px; background: #1d3a28; overflow: hidden; }
#mg .wp-bar i { display: block; height: 100%; width: 0; background: var(--tm-green); }
#mg .cb-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
#mg .mg-stage:has(.cb-col) { display: flex; justify-content: space-between; gap: 60px; }
#mg .cb-col { display: flex; flex-direction: column; gap: 10px; flex: 1; position: relative; z-index: 2; }
#mg .cb-plug, #mg .cb-sock { min-height: max(48px, var(--gf-hit, 44px)); border-radius: 8px; border: 2px solid var(--c); background: var(--gf-mg-btn, #12261a); color: var(--gf-mg-ink, #d8ffe4); cursor: pointer; font-size: 15px; display: flex; align-items: center; gap: 6px; padding: 0 10px; touch-action: none; }
#mg .cb-plug span, #mg .cb-sock span { color: var(--c); font-size: 18px; }
#mg .cb-plug.sel, #mg .ln-slip.sel { outline: 3px solid var(--tm-amber); }
#mg .cb-plug.done, #mg .cb-sock.done, #mg .ln-slip.done { opacity: 0.55; }
#mg .ln-items, #mg .ln-trays { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
#mg .ln-trays { margin-top: 14px; }
#mg .ln-slip { min-height: 52px; min-width: 88px; border-radius: 4px; border: 1px solid #999; background: #f4f0e6; color: #222; font-size: 16px; cursor: grab; touch-action: none; z-index: 3; }
#mg .ln-tray { min-height: 70px; min-width: 96px; flex: 1; border-radius: 8px; border: 2px dashed var(--gf-mg-line, #4a7a5a); background: var(--gf-mg-btn, #12261a); color: var(--gf-mg-ink, #d8ffe4); font-size: 15px; cursor: pointer; }
#mg .ln-tray b { font-size: 22px; color: var(--gf-mg-warn, var(--tm-amber)); }
@media (max-height: 460px) { #mg { padding: 8px 12px; } #mg .mg-box { padding: 8px 12px; } #mg .mg-help { margin: 4px 0; font-size: 13px; padding: 3px 8px; } #mg .mg-foot { display: none; } #mg .mg-stage { padding: 6px; } #mg .mg-msg { min-height: 1.3em; margin-top: 4px; } #mg .cb-col { gap: 4px; } #mg .cb-plug, #mg .cb-sock { min-height: 44px; } #mg .mg-ok { margin-top: 6px; } #mg .sq-btn { min-height: 52px; } #mg .sq-order { margin-bottom: 6px; } #mg .dl-face { width: 120px; height: 120px; } #mg .dl-needle { height: 40px; top: 18px; } #mg .dl-lbl { bottom: 20px; } #mg .wp-glass { height: 110px; } }

/* ---- createJournal (js/journal-ui.js): tabs + entries = thumbnail + one-line impression, ★ pins, by room (jn-*; docs/journal-ui.md) ---- */
/* the journal reads like a notebook (rule U29 + the self record): body text 16px+ / line-height 1.7, newest first, grouped by room with headings, a room filter,
   tap = the entry opens in place.  Colours are PAIRS (quote = the row, voice = the protagonist's own line; css/theme.css), never one half of a pair. */
.jn { font-size: calc(16px * var(--fs, 1)); line-height: 1.7; }
.jn-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.jn-rooms { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.jn-rooms .jn-chip { flex: none; }
.jn-chip { min-height: var(--gf-hit, 44px); padding: 0 14px; border-radius: 22px; border: 1px solid var(--gf-border-strong, var(--line)); background: var(--gf-surface, var(--paper)); color: var(--gf-text, var(--ink)); cursor: pointer; font: inherit; font-size: 0.95em; display: inline-flex; align-items: center; gap: 6px; }
.jn-chip.on { background: var(--gf-accent, var(--accent)); color: var(--gf-accent-ink, #fff); border-color: var(--gf-accent, var(--accent)); }
.jn-hint { margin: 2px 0 8px; color: var(--gf-text-dim, var(--dim)); font-size: 0.92em; line-height: 1.6; }
.jn-body { display: flex; flex-direction: column; gap: 6px; overflow: auto; max-height: 60vh; padding-right: 2px; }
.jn-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.jn-group h4 { position: sticky; top: 0; z-index: 1; margin: 10px 0 2px; padding: 4px 2px; font-size: 1.1em; color: var(--gf-heading, var(--accent)); background: var(--gf-surface, var(--paper)); border-bottom: 1px solid var(--gf-border, var(--line)); display: flex; align-items: baseline; gap: 8px; }
.jn-group h4 small { font-size: 0.8em; font-weight: 400; color: var(--gf-text-dim, var(--dim)); }
.jn-row { display: flex; gap: 6px; align-items: flex-start; margin: 0; }
.jn-card { flex: 1; min-width: 0; border: 1px solid var(--gf-quote-line, var(--line)); border-radius: var(--gf-radius, 10px); background: var(--gf-quote-bg, var(--paper)); color: var(--gf-quote-text, var(--ink)); overflow: hidden; }
.jn-row.open .jn-card { border-color: var(--gf-voice-line, var(--accent)); }
.jn-main { width: 100%; min-height: 56px; display: flex; gap: 12px; align-items: center; text-align: left; background: transparent; border: 0; padding: 10px 12px; cursor: pointer; color: inherit; font: inherit; }
.jn-th { flex: none; width: 72px; height: 54px; border-radius: 6px; background: var(--gf-surface-2, #ccc) center / cover no-repeat; }
.jn-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.jn-tx b { font-size: 1.05em; font-weight: 700; overflow-wrap: anywhere; }
.jn-tx em { font-style: normal; font-size: 0.88em; font-weight: 700; color: var(--gf-quote-label, var(--dim)); }
.jn-line { color: var(--gf-voice-text, var(--ink)); font-size: 1em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.jn-row.open .jn-line { display: block; -webkit-line-clamp: unset; }
.jn-chev { flex: none; color: var(--gf-quote-label, var(--dim)); transition: transform 0.15s; }
.jn-row.open .jn-chev { transform: rotate(180deg); }
.jn-more { padding: 4px 14px 12px 14px; border-top: 1px solid var(--gf-quote-line, var(--line)); background: var(--gf-voice-bg, var(--paper)); color: var(--gf-voice-text, var(--ink)); }
.jn-more[hidden] { display: none; }
.jn-more p { margin: 8px 0; }
.jn-go { min-height: var(--gf-hit, 44px); margin: 4px 0 0; }
.jn-nopic .jn-card { border-left-width: 5px; }
.jn-star { flex: none; width: 48px; min-height: var(--gf-hit, 44px); height: 56px; border-radius: var(--gf-radius, 8px); border: 1px solid var(--gf-border-strong, var(--line)); background: var(--gf-surface, var(--paper)); cursor: pointer; color: var(--gf-text-dim, #5c6662); display: grid; place-items: center; }
.jn-star.on { color: var(--gf-note-text, #2b2418); background: var(--gf-note-bg, #fff4d6); border-color: var(--gf-note-line, #a86f10); }
.jn-star.on svg { fill: currentColor; }
.jn-hud { min-height: var(--gf-hit, 44px); min-width: 44px; padding: 0 12px; border-radius: var(--gf-radius, 10px); border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; position: relative; }
.jn-col { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
@media (min-width: 900px) { .jn.jn-side { flex-direction: row; align-items: stretch; } .jn.jn-side .hb-tabs { flex-direction: column; flex: none; width: 11em; } .jn.jn-side .jn-col { padding-left: 8px; } }

/* ---- task screen (js/progress-ui.js taskScreen(); docs/progress-ui.md): pg-task-* / pg-cur / pg-abils ---- */
.pg-task-now h4, .pg-task-next h4, .pg-abil h4 { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; }
.pg-cur { padding: 10px 12px; border-radius: var(--gf-radius, 10px); border: 2px solid var(--accent2); background: var(--gf-highlight, #fff7e6); display: flex; flex-direction: column; gap: 3px; }
.pg-cur b { font-size: 1.1em; }
.pg-cur p { margin: 2px 0; line-height: 1.6; }
.pg-curbar { display: flex; align-items: center; gap: 8px; }
.pg-curbar .pg-bar { flex: 1; }
.pg-mean { display: block; color: var(--dim); }
.pg-goals li.lock { color: var(--dim); }
.pg-task-next { padding: 6px 10px; border-radius: var(--gf-radius, 10px); border: 1px dashed var(--line); }
.pg-abils { list-style: none; margin: 4px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.pg-abils li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); }
.pg-abils li.off { background: var(--gf-surface-2, #f1efe9); color: var(--gf-text-dim, #5c6662); }
.pg-abils small { display: block; color: var(--gf-text-dim, #5c6662); }
.pg-ai { flex: none; width: 1.6em; text-align: center; }

/* ---- inventory + object card (js/inventory-ui.js; docs/inventory-ui.md): iv-* ---- */
.iv-win .win { width: min(1000px, 97vw); height: min(88vh, 680px); max-height: 94vh; } /* fixed size: tabs / selection never move it (U12) */
.iv-win .win-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.iv { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.iv-main { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; min-height: 0; flex: 1; }
.iv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); grid-auto-rows: min-content; gap: 6px; overflow: auto; align-content: start; padding: 2px; }
.iv-detail { display: flex; flex-direction: column; gap: 8px; overflow: auto; min-height: 0; border: 1px solid var(--line); border-radius: var(--gf-radius, 10px); background: var(--paper); padding: 10px; }
.iv-cell { position: relative; min-height: 88px; padding: 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 8px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; font: inherit; font-size: 0.82em; }
.iv-cell.sel { border-color: var(--accent); background: var(--gf-accent-soft, #eaf4ee); box-shadow: 0 0 0 2px rgba(58, 122, 90, 0.25); }
.iv-cell.pick { border-color: var(--accent2); background: var(--gf-highlight, #fff4dc); }
.iv-th { flex: none; width: 100%; height: 52px; border-radius: 4px; background: var(--gf-surface-2, #ccc) center / cover no-repeat; }
.iv-th.s { width: 32px; height: 24px; }
.iv-nopic { display: grid; place-items: center; background: var(--gf-surface-2, #ece6d6); color: var(--dim); font-weight: 700; }
.iv-nm { max-width: 100%; overflow: hidden; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }   /* a long item name wraps to two lines instead of being cut (tekkyo) */
@media (max-height: 520px) { .iv-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); } }
.iv-n { position: absolute; right: 4px; bottom: 22px; font-size: 0.8em; background: var(--gf-surface, #fff); border-radius: 6px; padding: 0 3px; }
.iv-new { position: absolute; top: 2px; right: 2px; font-size: 0.72em; font-weight: 700; padding: 0 5px; border-radius: 8px; background: var(--gf-badge-bg, #b3261e); color: var(--gf-badge-text, #fff); }
.iv-view { display: flex; flex-direction: column; gap: var(--gf-space-3, 10px); }
.iv-photocard { display: flex; flex-direction: column; gap: 8px; }
.iv-photo { display: block; width: 100%; aspect-ratio: 16 / 10; max-height: 38vh; border-radius: 8px; background: var(--gf-surface-2, #ccc) center / cover no-repeat; border: 1px solid var(--gf-border, var(--line)); }
.iv-photo.iv-nopic { font-size: 2em; }
.iv-info { display: flex; flex-direction: column; gap: 3px; }
.iv-name { font-size: 1.1em; }
.iv-tag, .iv-meta { font-style: normal; font-size: 0.78em; color: var(--gf-text-dim, var(--dim)); }
.iv-text, .iv-why, .iv-feel { margin: 2px 0; line-height: 1.6; }
.iv-text { white-space: pre-line; }
.iv-why { padding: 8px 12px; border-left: 4px solid var(--gf-note-line, #a86f10); border-radius: 0 var(--gf-radius, 8px) var(--gf-radius, 8px) 0; background: var(--gf-note-bg, #fff7e6); color: var(--gf-note-text, #2b2418); font-size: 1em; line-height: 1.7; }
.iv-why span { display: block; font-size: 0.85em; font-weight: 700; color: var(--gf-note-label, #6a4710); }
/* U19: the protagonist's feeling is its own bordered block (the inner-voice card), never text inside the photo card */
.iv-voice { padding: 8px 12px 8px 14px; border: 1px solid var(--gf-voice-line, #3a7a5a); border-left: 4px solid var(--gf-voice-line, #3a7a5a); border-radius: var(--gf-radius, 10px); background: var(--gf-voice-bg, #eef5f1); color: var(--gf-voice-text, #23302c); }
.iv-voice-l { display: block; font-size: 0.85em; letter-spacing: 0.06em; color: var(--gf-voice-label, #3d5a4c); }
.iv-feel { font-style: italic; margin: 2px 0 0; }
@container (min-width: 620px) { .iv-view.iv-side { flex-direction: row; align-items: flex-start; } .iv-view.iv-side > * { flex: 1 1 0; min-width: 0; } }
.iv-card, .iv-detail, .jn-view { container-type: inline-size; }
.iv-acts { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: auto; }
.iv-acts .btn, .iv-chip { min-height: var(--gf-hit, 44px); }
.iv-rel { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; width: 100%; }
.iv-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 22px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; font: inherit; font-size: 0.85em; }
.iv-empty { color: var(--dim); padding: 12px; margin: 0; }
.iv-pickmsg { margin: 0 0 6px; padding: 6px 10px; border-radius: 8px; background: var(--gf-note-bg, #fff4dc); color: var(--gf-note-text, #2b2418); border: 1px solid var(--gf-note-line, #a86f10); }
.iv-tabs .hb-tab { min-height: var(--gf-hit, 44px); }
body.touch .hb-tab { min-height: var(--gf-hit, 44px); } /* (U13) the notebook's tabs too (KitUI.tabs) */
.iv-card { width: 100%; max-width: 560px; margin: 0 auto; }
@media (max-width: 760px) { .iv-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 0.8fr) minmax(0, 1.2fr); } .iv-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); } .iv-th { height: 36px; } .iv-cell { min-height: 64px; } .iv-photo { max-height: 22vh; } .iv-win.win-wrap { align-items: flex-start; } }
@media (max-height: 520px) { .iv-photo { max-height: 34vh; aspect-ratio: 2 / 1; } .iv-th { height: 36px; } .iv-cell { min-height: 64px; } .iv-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); } }

/*@section rn*/
/* ---- release notes (js/release-notes.js; docs/release-notes.md; rule Q10): rn-* ---- */
.rn-wrap { --rn-bg: var(--gf-surface, #fffdf6); --rn-fg: var(--gf-text, #2b2620); --rn-muted: var(--gf-text-dim, #7a7266); --rn-line: var(--gf-border, #e3dccb); --rn-accent: var(--gf-accent, #a8451f); --rn-new: var(--gf-badge-bg, #b3261e); --rn-radius: var(--gf-radius-lg, 12px);
  position: fixed; inset: 0; z-index: 9000; display: flex; align-items: flex-start; justify-content: center; background: var(--gf-overlay, rgba(0, 0, 0, .55)); padding: max(12px, min(9vh, 80px)) 12px 12px; box-sizing: border-box; }
.rn-win { width: min(560px, 100%); height: min(520px, 100%); display: flex; flex-direction: column; background: var(--rn-bg); color: var(--rn-fg); border: 1px solid var(--rn-line); border-radius: var(--rn-radius); box-shadow: 0 10px 40px rgba(0, 0, 0, .4); overflow: hidden; font: 15px/1.6 system-ui, sans-serif; }
@media (min-width: 1100px) and (min-height: 700px) { .rn-win { width: min(720px, 100%); height: min(640px, 100%); } }
.rn-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--rn-line); flex: none; }
.rn-h { margin: 0; font-size: 1.15em; }
.rn-cur { color: var(--rn-muted); font-size: .85em; flex: 1; }
.rn-x { margin-left: auto; min-width: var(--gf-hit, 44px); min-height: var(--gf-hit, 44px); border: 0; background: none; color: inherit; font-size: 28px; line-height: 1; cursor: pointer; border-radius: 8px; }
.rn-x:hover, .rn-x:focus-visible { background: rgba(0, 0, 0, .08); }
.rn-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px 16px; overscroll-behavior: contain; }
.rn-entry { border-bottom: 1px solid var(--rn-line); }
.rn-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: var(--gf-hit, 44px); cursor: pointer; padding: 6px 0; }
.rn-ver { font-weight: 700; color: var(--gf-heading, var(--rn-accent)); } /* both AA on the window: a game without theme.css gets the darker default */
.rn-date { color: var(--rn-muted); font-size: .85em; }
.rn-ttl { font-weight: 600; }
.rn-new { background: var(--rn-new, var(--gf-badge-bg, #b3261e)); color: var(--gf-badge-text, #fff); font-size: .7em; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.rn-items { list-style: none; margin: 0 0 10px; padding: 0; }
.rn-item { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.rn-chip { flex: none; min-width: 3.6em; text-align: center; font-size: .75em; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: #ddd; color: #333; }
.rn-t-new { background: #d9efd9; color: #1c5a1c; } .rn-t-fix { background: #f6dcd6; color: #8a2a18; }
.rn-t-change { background: #dbe6f6; color: #1d3f78; } .rn-t-balance { background: #f3e9c8; color: #6b5410; }
.rn-empty { color: var(--rn-muted); padding: 16px 0; }
.rn-link { min-height: var(--gf-hit, 44px); min-width: var(--gf-hit, 44px); background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; opacity: .85; }
.rn-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #d33; margin-left: 4px; vertical-align: middle; }
.rn-dot[hidden] { display: none; }
@media (max-width: 760px), (max-height: 520px) { .rn-wrap { align-items: flex-start; padding: 6px; } }

/*@end*/
/* ---- map-svg (js/map-svg.js, rule U18): classes ms-* ; colours from --gf-* with fallbacks ---- */
.ms-wrap { --ms-h: 44px; min-width: 0; max-width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: var(--gf-space-2, 8px); width: 100%; height: 100%; min-height: 160px; color: var(--gf-text, #23302c); font-family: inherit; }
.ms-tabs { display: flex; gap: var(--gf-space-1, 4px); flex-wrap: wrap; }
.ms-tabs[hidden] { display: none; }
.ms-tab, .ms-btn { min-width: var(--gf-hit, 44px); min-height: var(--gf-hit, 44px); padding: 0 var(--gf-space-3, 12px); border: 1px solid var(--gf-border, #d8d2c2); border-radius: var(--gf-radius, 10px); background: var(--gf-surface, #fffdf6); color: var(--gf-text, #23302c); font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.ms-tab.ms-on { background: var(--gf-accent, #3a7a5a); color: var(--gf-accent-ink, #fff); border-color: var(--gf-accent, #3a7a5a); }
.ms-tab.ms-here::after { content: " ●"; font-size: 0.7em; }
.ms-view { min-width: 0; max-width: 100%; position: relative; flex: 1 1 auto; min-height: 140px; overflow: hidden; border: 1px solid var(--gf-border, #d8d2c2); border-radius: var(--gf-radius, 10px); background: var(--gf-surface-2, #f4efe2); touch-action: none; cursor: grab; }
.ms-view:active { cursor: grabbing; }
.ms-svg { display: block; width: 100%; height: 100%; max-width: 100%; min-width: 0; user-select: none; -webkit-user-select: none; }
.ms-ctl { position: absolute; right: var(--gf-space-2, 8px); bottom: var(--gf-space-2, 8px); display: flex; flex-direction: column; gap: var(--gf-space-1, 4px); }
.ms-info { display: none; align-items: center; gap: var(--gf-space-2, 8px); padding: var(--gf-space-2, 8px) var(--gf-space-3, 12px); border: 1px solid var(--gf-border, #d8d2c2); border-radius: var(--gf-radius, 10px); background: var(--gf-surface, #fffdf6); }
.ms-info.ms-on { display: flex; }
.ms-photo { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
.ms-r { cursor: pointer; }
/* legend */
.ms-key { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.85em; color: var(--gf-text, #222); }
.ms-key li { display: inline-flex; align-items: center; gap: 5px; }
.ms-k { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.ms-k-me { background: var(--gf-accent, #3a7a5a); border-radius: 50%; } .ms-k-door { background: var(--gf-map-door, #8a5a00); height: 5px; border-radius: 0; } .ms-k-lock { background: var(--gf-danger, #c0502a); } .ms-k-pin { background: var(--gf-accent-2, #e8a040); border-radius: 50%; }
.ms-bg { fill: transparent; }
.ms-grid { stroke: var(--gf-map-grid, #eee); } .ms-grid5 { stroke: var(--gf-map-grid-2, #ccc); }
.ms-room { stroke: var(--gf-text, #333); stroke-width: 1.5; }
.ms-room--room { fill: var(--gf-map-room, #dbe8f4); } .ms-room--corridor { fill: var(--gf-map-corridor, #e8e2c8); } .ms-room--outdoor { fill: var(--gf-map-outdoor, #d6efd0); } .ms-room--stairs { fill: var(--gf-map-stairs, #f2d9b8); }
.ms-room--unvisited { opacity: 0.55; stroke-dasharray: 4 3; }
.ms-room--go { stroke: var(--gf-accent, #3a7a5a); stroke-width: 3; opacity: 1; stroke-dasharray: none; }
.ms-room--here { stroke: var(--gf-accent, #3a7a5a); stroke-width: 3.5; }
.ms-room--sel { stroke: var(--gf-danger, #c0502a); stroke-width: 3.5; }
/* map text (standard 1.4): >= 12px on screen (--ms-fs is set by map-svg.js), solid text colour + a halo in the surface colour, the UI font; colour is for markers only */
.ms-label,.ms-stairs-t,.ms-station-t,.ms-start,.ms-pin-t,.ms-legend,.ms-ruler{font-family:var(--gf-font,system-ui,"Noto Sans JP","Hiragino Sans","Yu Gothic",sans-serif);font-weight:600;paint-order:stroke;stroke:var(--gf-surface,#fff);stroke-width:3px;stroke-linejoin:round}
.ms-label{fill:var(--gf-text,#222);font-size:calc(var(--ms-fs,12)*1px);text-anchor:middle;pointer-events:none}
.ms-label--small{font-size:calc(var(--ms-fs,12)*.92px)}.ms-label--dim{fill:var(--gf-text,#222)}.ms-label--floor{text-anchor:start;font-size:calc(var(--ms-fs,12)*1.1px);font-weight:700}
.ms-stairs-t{fill:var(--gf-text,#222);font-size:calc(var(--ms-fs,12)*.85px);text-anchor:middle;pointer-events:none}
.ms-station-t{fill:var(--gf-text,#222);font-size:calc(var(--ms-fs,12)*.8px)}
.ms-start{fill:var(--gf-text,#222);font-size:calc(var(--ms-fs,12)*.8px)}
.ms-pin-t{fill:var(--gf-text,#222);font-size:calc(var(--ms-fs,12)*.85px);pointer-events:none}
.ms-legend{fill:var(--gf-text,#222);font-size:calc(var(--ms-fs,12)*.85px)}
.ms-ruler{fill:var(--gf-text-dim,#555);font-size:calc(var(--ms-fs,12)*.7px)}
.ms-door { stroke: var(--gf-map-door, #8a5a00); stroke-width: 4; stroke-linecap: butt; }
.ms-door--exit { stroke: var(--gf-ok, #2a8a4a); } .ms-door--direct { stroke: #d22; } .ms-door--locked { stroke: var(--gf-danger, #c0502a); }
.ms-lock { fill: var(--gf-danger, #c0502a); stroke: #fff; stroke-width: 1; }
.ms-stairs { fill: none; stroke: var(--gf-map-door, #8a5a00); stroke-width: 1.2; }
.ms-station { fill: #c33; }
.ms-pin { fill: var(--gf-accent, #e8a040); stroke: #fff; stroke-width: 1.5; } .ms-pin--item { fill: var(--gf-ok, #2e7a4a); }
.ms-player { fill: var(--gf-accent, #3a7a5a); stroke: #fff; stroke-width: 1.5; }
.ms-player-ring { fill: none; stroke: var(--gf-accent, #3a7a5a); stroke-width: 1.5; opacity: 0.5; transform-box: fill-box; transform-origin: center; animation: ms-pulse 1.8s ease-out infinite; }
.ms-calm .ms-player-ring { animation: none; }
@keyframes ms-pulse { from { transform: scale(0.8); opacity: 0.7; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ms-player-ring { animation: none; } }

/*@section shell*/
/* ---- standard UI shell: window manager wm-*, tab menu tm-*, pause menu pm-* (js/win-manager.js, tab-menu.js, pause-menu.js; docs/win-manager.md ...).
   Theme tokens --gf-* with fallbacks (css/theme.css sets them; without it the kit defaults apply). The layer sits above the inner-voice
   band in z-order (--gf-z-window) but its area ends where the band starts (--wm-band, set by the manager): they never overlap (U14). ---- */
.wm-layer { position: fixed; inset: 0; z-index: var(--gf-z-window, 60); display: flex; align-items: flex-start; justify-content: center; box-sizing: border-box;
  padding: max(var(--wm-m, 16px), env(safe-area-inset-top, 0px)) max(var(--wm-m, 16px), env(safe-area-inset-right, 0px)) calc(var(--wm-band, 0px) + max(var(--wm-m, 16px), env(safe-area-inset-bottom, 0px))) max(var(--wm-m, 16px), env(safe-area-inset-left, 0px));
  background: var(--gf-overlay, rgba(10, 14, 12, 0.5)); color: var(--gf-text, var(--ink, #23302c)); font-size: calc(15px * var(--fs, 1) * var(--wm-zoom, 1)); }
/* always top-anchored (one window after another keeps its top edge): on big screens a little lower than the margin */
.wm-layer[data-mode="large"] { padding-top: max(var(--wm-m, 32px), min(9vh, 80px), env(safe-area-inset-top, 0px)); }
/* a text-only window (win-manager: no picture / table / field / tabs) is as tall as its text, never a big empty box (but not a strip either) */
.wm-layer.wm-fit .wm-win { height: auto; max-height: min(var(--wm-h, 600px), 100%); min-height: min(200px, var(--wm-h, 600px)); }
.wm-layer.wm-fit .wm-body { flex: 0 1 auto; }
.wm-win { box-sizing: border-box; display: flex; flex-direction: column; min-height: 0; width: var(--wm-w, 760px); height: var(--wm-h, 600px); /* sized by win-manager.js (band-aware), not by --gf-win-w/h */ max-width: 100%; max-height: 100%;
  background: var(--gf-surface, var(--panel, #fffdf6)); border: 1px solid var(--gf-border, var(--line, #d8d2c2)); border-radius: var(--gf-radius-lg, 16px); box-shadow: var(--gf-shadow, 0 10px 40px rgba(0, 0, 0, 0.35)); overflow: hidden; outline: none; }
.wm-head { flex: none; display: flex; align-items: center; gap: var(--gf-space-2, 8px); min-height: 56px; padding: 6px var(--gf-space-3, 12px) 6px var(--gf-win-pad, 16px); border-bottom: 1px solid var(--gf-border, var(--line, #d8d2c2)); }
.wm-title { flex: 1; min-width: 0; margin: 0; font-size: 1.12em; font-weight: 700; color: var(--gf-accent, #2f5e46); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-btn { flex: none; width: var(--gf-hit, 44px); height: var(--gf-hit, 44px); min-width: 44px; min-height: 44px; border: 1px solid transparent; border-radius: var(--gf-radius, 12px); background: transparent; color: var(--gf-text-dim, var(--dim, #6a7470)); font: inherit; font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.wm-btn:hover { background: var(--gf-surface-2, rgba(0, 0, 0, 0.06)); color: var(--gf-text, inherit); }
.wm-btn:focus-visible, .tm-tab:focus-visible, .pm-item:focus-visible, .pm-back:focus-visible, .tm-hud:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: 2px; }
.wm-infobox { flex: none; padding: var(--gf-space-3, 10px) var(--gf-win-pad, 16px); background: var(--gf-surface-2, #f4efe2); border-bottom: 1px solid var(--gf-border, var(--line, #d8d2c2)); line-height: 1.7; font-size: 0.92em; }
.wm-infobox[hidden], .wm-btn[hidden], .tm-badge[hidden], .tm-dot[hidden] { display: none; }   /* (a locked window hides its x: .wm-btn is display:grid, which beat the hidden attribute) */
.wm-body { flex: 1; min-height: 0; overflow: auto; padding: var(--gf-win-pad, 16px); display: flex; flex-direction: column; line-height: 1.7; overscroll-behavior: contain; }
.wm-body.wm-flush { padding: 0; overflow: hidden; }
.wm-body img[data-wm-cap][style*="max-width"] { margin-left: auto; margin-right: auto; }   /* a capped picture (win-manager capImages) sits in the middle */
@media (prefers-reduced-motion: no-preference) { .wm-layer { animation: wm-in 0.14s ease-out; } @keyframes wm-in { from { opacity: 0; } } }

/* tab menu */
.tm { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tm-tabs { flex: none; display: flex; gap: var(--gf-space-1, 4px); padding: var(--gf-space-2, 8px) var(--gf-win-pad, 16px) 0; border-bottom: 2px solid var(--gf-border, var(--line, #e2d8c0)); overflow-x: auto; scrollbar-width: none; }
.tm-tab { position: relative; flex: none; min-height: var(--gf-hit, 44px); display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--gf-text-dim, var(--dim, #5a5a4a)); font: inherit; cursor: pointer; margin-bottom: -2px; }
.tm-tab:hover { background: var(--gf-surface-2, #f6f0e0); }
.tm-tab.on { background: var(--gf-surface, #fff); color: var(--gf-accent, #2f5e46); font-weight: 700; border-color: var(--gf-border, #e2d8c0); border-bottom: 2px solid var(--gf-surface, #fff); }
.tm-badge { min-width: 1.4em; padding: 0 5px; border-radius: 10px; background: var(--gf-badge-bg, #b3261e); color: var(--gf-badge-text, #fff); font-style: normal; font-size: 0.72em; font-weight: 700; line-height: 1.5; text-align: center; }
.tm-badge.dot { min-width: 0; width: 9px; height: 9px; padding: 0; border-radius: 50%; }
.tm-content { flex: 1; min-height: 0; overflow: auto; padding: var(--gf-win-pad, 16px); display: flex; flex-direction: column; overscroll-behavior: contain; }
.tm-content > .iv, .tm-content > .jr { flex: 1; min-height: 0; }
.tm-content .jn-body { max-height: none; flex: 1; min-height: 0; }
.tm-content .jn-detail { overflow: auto; }
.tm-empty { color: var(--gf-text-dim, var(--dim)); padding: var(--gf-space-4, 16px); margin: 0; }
.tm-hud { position: relative; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: var(--gf-radius, 10px); border: 1px solid var(--gf-border, var(--line)); background: var(--gf-surface, var(--panel)); color: var(--gf-text, var(--ink)); font: inherit; cursor: pointer; pointer-events: auto; }
.tm-dot { position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--gf-danger, #c0502a); }
@media (max-width: 640px) { .tm-tab { padding: 0 10px; } .tm-tab:not(.on) .tm-lb { display: none; } .tm-tabs { padding-left: var(--gf-space-2, 8px); padding-right: var(--gf-space-2, 8px); } .tm-content, .wm-body { padding: var(--gf-space-3, 12px); } }
@media (max-height: 520px) { .tm-tab { padding: 0 10px; } .tm-tab:not(.on) .tm-lb { display: none; } .tm-tabs { padding-left: var(--gf-space-2, 8px); padding-right: var(--gf-space-2, 8px); } }   /* a landscape phone: inactive tabs are icons too, so 言葉の記録 is not cut off at the right (tekkyo, urakawa) */

/* pause menu */
.pm { display: flex; flex-direction: column; gap: var(--gf-space-3, 12px); width: 100%; max-width: 520px; margin: 0 auto; padding: var(--gf-space-2, 8px) 0; }
.pm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--gf-space-3, 12px); }
.pm-item, .pm-back { position: relative; box-sizing: border-box; width: 100%; min-height: 52px; display: flex; align-items: center; gap: var(--gf-space-3, 12px); padding: 0 var(--gf-space-4, 18px); border: 1px solid var(--gf-border, var(--line, #d8d2c2)); border-radius: var(--gf-radius, 12px); background: var(--gf-surface-2, #fff); color: var(--gf-text, inherit); font: inherit; font-size: 1.02em; text-align: left; cursor: pointer; }
.pm-item:hover, .pm-back:hover { background: var(--gf-surface, #f4efe2); border-color: var(--gf-accent, #3a7a5a); }
.pm-item.primary { background: var(--gf-accent, #3a7a5a); border-color: var(--gf-accent, #3a7a5a); color: var(--gf-accent-ink, #fff); font-weight: 700; }
.pm-ic { flex: none; width: 1.6em; text-align: center; }
.pm-dot { margin-left: auto; width: 10px; height: 10px; border-radius: 50%; background: var(--gf-danger, #c0502a); }
.pm-back { width: auto; align-self: flex-start; min-height: 44px; padding: 0 var(--gf-space-4, 16px); }
.pm-set { display: flex; flex-direction: column; gap: var(--gf-space-3, 12px); }
.pm-row { display: flex; align-items: center; gap: var(--gf-space-3, 14px); min-height: 56px; padding: var(--gf-space-2, 8px) var(--gf-space-4, 16px); border: 1px solid var(--gf-border, var(--line)); border-radius: var(--gf-radius, 12px); background: var(--gf-surface-2, #fff); cursor: pointer; }
.pm-row input[type="checkbox"] { flex: none; width: 24px; height: 24px; accent-color: var(--gf-accent, #3a7a5a); }
.pm-row small { display: block; color: var(--gf-text-dim, var(--dim)); }
.pm-sel select { flex: none; min-height: 44px; min-width: 7em; padding: 0 10px; border-radius: var(--gf-radius, 10px); border: 1px solid var(--gf-border-strong, #8c8472); background: var(--gf-surface, #fff); color: var(--gf-text, inherit); font: inherit; }
.pm-vol { flex-wrap: wrap; cursor: default; } .pm-vol > span { flex: 1 1 8em; } .pm-vol input[type="range"] { flex: 2 1 10em; min-height: 44px; accent-color: var(--gf-accent, #3a7a5a); }
.pm-note { margin: 0; line-height: 1.8; } .pm-yn { display: flex; flex-direction: column; gap: var(--gf-space-3, 12px); }
html[data-gf-no-flash="1"] .wm-layer { animation: none; }

/*@end*/
/* ---- step-guide (js/step-guide.js, rules U22/U23): classes sg-* ; colours from --gf-* with fallbacks ---- */
.sg-wrap { display: flex; flex-direction: column; gap: var(--gf-space-2, 8px); color: var(--gf-text, #23302c); font-family: inherit; }
.sg-hidden { display: none; }
.sg-card { padding: var(--gf-space-3, 12px) var(--gf-space-4, 16px); border: 2px solid var(--gf-accent, #3a7a5a); border-radius: var(--gf-radius, 10px); background: var(--gf-surface, #fffdf6); box-shadow: var(--gf-shadow, 0 4px 14px rgba(0, 0, 0, 0.15)); }
.sg-card.sg-lv-subtle { border-width: 1px; }
.sg-card.sg-lv-off { border-width: 1px; border-style: dashed; padding: var(--gf-space-2, 8px) var(--gf-space-3, 12px); }
.sg-step { font-size: 0.8em; font-weight: 800; letter-spacing: 0.08em; color: var(--gf-accent, #3a7a5a); }
.sg-title { font-weight: 800; font-size: 1.05em; margin: 2px 0; }
.sg-body { line-height: var(--gf-lh, 1.65); }
.sg-hint { margin-top: var(--gf-space-2, 8px); padding: var(--gf-space-1, 4px) var(--gf-space-2, 8px); border-left: 3px solid var(--gf-accent-2, #e8a040); background: var(--gf-highlight, #fff7e6); font-style: italic; }
.sg-actions { display: flex; gap: var(--gf-space-2, 8px); justify-content: flex-end; margin-top: var(--gf-space-2, 8px); }
.sg-btn { min-height: var(--gf-hit, 44px); min-width: var(--gf-hit, 44px); padding: 0 var(--gf-space-4, 16px); border-radius: var(--gf-radius, 10px); border: 1px solid var(--gf-border, #d8d2c2); background: var(--gf-surface, #fffdf6); color: var(--gf-text, #23302c); font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.sg-btn.sg-next { background: var(--gf-accent, #3a7a5a); border-color: var(--gf-accent, #3a7a5a); color: var(--gf-accent-ink, #fff); }
.sg-skip { color: var(--gf-text-dim, #6a7470); }
.sg-done { padding: var(--gf-space-1, 4px) var(--gf-space-3, 12px); font-size: 0.85em; color: var(--gf-text-dim, #6a7470); background: var(--gf-surface-2, #f2efe4); border-radius: var(--gf-radius, 10px); }
.sg-check { color: var(--gf-ok, #2e7a4a); font-weight: 800; }
/* emphasis overlay on a DOM element (fixed, follows the element, never takes clicks) */
.sg-emph { position: fixed; left: 0; top: 0; z-index: 9000; pointer-events: none; box-sizing: border-box; border-radius: var(--gf-radius, 10px); }
.sg-emph--ring { border: 3px solid var(--gf-accent-2, #e8a040); animation: sg-pulse 1.4s ease-in-out infinite; }
.sg-emph--glow { box-shadow: 0 0 0 4px var(--gf-accent-2, #e8a040), 0 0 24px 8px var(--gf-accent-2, #e8a040); opacity: 0.8; animation: sg-glow 1.6s ease-in-out infinite; }
.sg-emph--arrow { border: 2px dashed var(--gf-accent-2, #e8a040); }
.sg-emph--arrow::before { content: "▼"; position: absolute; left: 50%; top: -34px; transform: translateX(-50%); font-size: 28px; line-height: 1; color: var(--gf-accent-2, #e8a040); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); animation: sg-bob 0.9s ease-in-out infinite; }
.sg-emph.sg-lv-subtle { opacity: 0.55; animation: none; }
.sg-emph.sg-calm, .sg-emph.sg-calm::before { animation: none; }
@keyframes sg-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes sg-glow { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.9; } }
@keyframes sg-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .sg-emph, .sg-emph::before { animation: none; } }
.tm-content .iv-photo { max-height: 26vh; aspect-ratio: 2 / 1; }
@media (max-height: 520px) and (min-width: 600px) { .pm { max-width: none; } .pm-list { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gf-space-2, 8px) var(--gf-space-3, 12px); } .pm-item { min-height: 48px; } }
/*@section chat*/
/* ---- chat standard 1.2 (#35): home / title / call / backlog / drafts / album. Colours come from --cx-* (skins set them from --gfc-*) ---- */
.cx-app .cx-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cx-app .cx-stage > .cx-logs { flex: 1; }
.cx-back { background: transparent; border: 0; color: inherit; font-size: 1.6em; line-height: 1; padding: 0 6px 2px 0; display: inline-flex; align-items: center; gap: 2px; }
.cx-back[hidden], .cx-hav[hidden] { display: none; }
.cx-hav { background: transparent; border: 0; padding: 0; }
.cx-app .cx-hav .cx-av { width: 34px; height: 34px; }
.cx-htext { cursor: default; }
.cx-hav:not([disabled]) ~ .cx-htext { cursor: pointer; }
.cx-datechip-wrap { flex: none; z-index: 2; padding: 4px 0 3px; text-align: center; pointer-events: none; background: var(--cx-bg); }
.cx-datechip-wrap[hidden] { display: none; }
.cx-datechip { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--cx-sys); color: var(--cx-sys-ink); font-size: 0.75em; font-weight: 700; }
.cx-newpill { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 2; border: 0; border-radius: 999px; padding: 6px 14px; background: var(--cx-accent); color: var(--cx-accent-ink, #fff); font-size: 0.8em; font-weight: 700; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); }
.cx-newpill[hidden] { display: none; }
.cx-notif { position: absolute; left: 12px; right: 12px; top: 8px; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 0; text-align: left; border-radius: 14px; background: var(--cx-panel, rgba(30, 36, 42, 0.95)); color: var(--cx-panel-ink, #fff); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); animation: cx-in 0.2s ease-out; }
.cx-notif[hidden] { display: none; }
.cx-app .cx-notif .cx-nf-av .cx-av { width: 34px; height: 34px; }
.cx-nf-main { display: flex; flex-direction: column; min-width: 0; }
.cx-nf-main span { color: var(--cx-meta); font-size: 0.86em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-row.cx-old { animation: none; }
.cx-row.cx-old .cx-bubble { opacity: 0.92; }
.cx-av.cx-k-unknown { background: transparent; box-shadow: 0 0 0 1.5px var(--cx-meta); border: 1.5px dashed var(--cx-meta); }
.cx-unread { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--cx-meta); font-size: 0.75em; }
.cx-unread::before, .cx-unread::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: 0.4; }
.cx-draft .cx-bubble { background: transparent; color: var(--cx-accent); border: 1.5px dashed var(--cx-accent); }
.cx-input.cx-selftype { color: var(--cx-in-ink); }
.cx-skipbtn { border: 1px solid var(--cx-meta); background: transparent; color: var(--cx-meta); border-radius: 999px; padding: 6px 12px; font-size: 0.8em; }
.cx-skipbtn[hidden] { display: none; }
.cx-note { display: block; margin-top: 4px; font-size: 0.78em; opacity: 0.75; }
.cx-choices-warn .cx-choice { border-color: #d0866a; }
.cx-choices-important .cx-choice { border-width: 2px; }
.cx-goto { flex: none; }
.cx-app[data-ch-static="1"] .cx-bar { opacity: 0.7; }
.cx-stamp-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cx-st-word { font-size: 0.8em; font-weight: 700; color: var(--cx-meta); }
.cx-callrec { display: inline-flex; align-items: center; gap: 8px; }
.cx-callrec span:last-child { color: var(--cx-meta); font-size: 0.85em; }
.cx-callrec.cx-missed b { color: #e48a7e; }
.cx-viewable { cursor: zoom-in; }
.cx-callscreen { position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; background: rgba(8, 10, 12, 0.96); color: #eef1f4; }
.cx-cs-in { width: 100%; max-width: 420px; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.cx-cs-app { margin: 0; font-size: 0.8em; letter-spacing: 0.1em; opacity: 0.7; }
.cx-app .cx-callscreen .cx-cs-av .cx-av { width: 112px; height: 112px; font-size: 2.4em; }
.cx-cs-name { font-size: 1.4em; }
.cx-cs-state { margin: 0; opacity: 0.8; }
.cx-cs-cap { min-height: 5.5em; max-width: 100%; font-size: 0.92em; line-height: 1.8; color: #cfd6dd; }
.cx-cs-cap p { margin: 0; animation: cx-in 0.3s ease-out; }
.cx-cs-btns { display: flex; gap: 40px; margin-top: 14px; }
.cx-callscreen { overflow-y: auto; }
.cx-cs-in { margin: auto; }
.cx-cs-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: transparent; color: inherit; font-size: 0.85em; }
.cx-cs-btn span { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6em; background: #c0392b; }
.cx-cs-btn.yes span { background: #2e9b57; }
.cx-viewer { position: absolute; inset: 0; z-index: 16; background: rgba(0, 0, 0, 0.86); display: flex; align-items: center; justify-content: center; padding: 12px; }
.cx-viewer[hidden] { display: none; }
.cx-viewer-box { position: relative; max-width: 100%; max-height: 100%; overflow: auto; background: var(--cx-panel, #fff); color: var(--cx-panel-ink, #1d2328); border-radius: 12px; padding: 12px; }
.cx-viewer-body .cx-media, .cx-viewer-body .cx-widget { max-width: 100%; }
.cx-viewer-body img { max-height: 70vh; width: 100%; object-fit: contain; }
.cx-viewer-x { position: absolute; right: 6px; top: 4px; z-index: 1; border: 0; background: rgba(0, 0, 0, 0.5); color: #fff; width: 32px; height: 32px; border-radius: 50%; font-size: 1.2em; line-height: 1; }
.cx-pf-head { display: flex; align-items: center; gap: 12px; }
.cx-app .cx-sheet .cx-pf-head .cx-av { width: 64px; height: 64px; font-size: 1.4em; }
.cx-pf-head small { display: block; color: var(--cx-meta); }
.cx-pf-status { margin: 4px 0 0; font-size: 0.85em; }
.cx-pf-dl { margin: 14px 0 0; display: grid; grid-template-columns: 6.5em 1fr; gap: 8px 10px; font-size: 0.9em; line-height: 1.6; }
.cx-pf-dl dt { color: var(--cx-meta); font-weight: 700; }
.cx-pf-dl dd { margin: 0; }
.cx-pf-you { margin: 12px 0 0; font-size: 0.82em; color: var(--cx-meta); line-height: 1.7; }
.cx-rtabs { display: flex; gap: 6px; margin: 10px 0 4px; }
.cx-rtab { border: 1px solid var(--cx-line, rgba(0, 0, 0, 0.2)); background: transparent; color: inherit; border-radius: 999px; padding: 5px 14px; font-size: 0.85em; }
.cx-rtab.on { background: var(--cx-accent); border-color: var(--cx-accent); color: var(--cx-accent-ink, #fff); }
.cx-album { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 8px; }
.cx-ph-tile { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 0; background: transparent; color: inherit; padding: 0; }
.cx-ph-thumb { display: block; border-radius: 8px; overflow: hidden; background: rgba(127, 127, 127, 0.2); max-height: 140px; pointer-events: none; }
.cx-ph-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cx-ph-cap { font-size: 0.75em; color: var(--cx-meta); line-height: 1.4; }
.cx-empty { color: var(--cx-meta); font-size: 0.85em; }
.cx-gal-group { margin-top: 10px; font-size: 0.8em; font-weight: 700; color: var(--cx-meta); }
.cx-end-theme { font-weight: 700; }
.cx-end-progress { margin-top: 8px; font-size: 0.85em; }
.cx-end-dots { display: flex; gap: 4px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.cx-end-dots span { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--cx-meta); display: grid; place-items: center; font-size: 0.7em; opacity: 0.5; }
.cx-end-dots span.on { background: var(--cx-accent); border-color: var(--cx-accent); color: var(--cx-accent-ink, #fff); opacity: 1; }
/* theme tokens that used to be fixed colours (sheets, input, choices, text screens): --gfc-panel etc. -> --cx-* (fallbacks = the old values) */
.cx-sheet-in, .cx-summary, .cx-end { background: var(--cx-panel, #fff); color: var(--cx-panel-ink, #1d2328); }
.cx-gal li { background: var(--cx-panel-alt, #f4f5f2); }
.cx-input { background: var(--cx-input, #f0f2f4); color: var(--cx-input-ink, #9aa3aa); }
.cx-choice { background: var(--cx-choice, #fff); color: var(--cx-choice-ink, #1d2328); }
.cx-choosing .cx-choices { background: var(--cx-panel-alt, rgba(255, 255, 255, 0.75)); }
.cx-btn { background: var(--cx-choice, #fff); color: var(--cx-choice-ink, #1d2328); border-color: var(--cx-line, #b8b0a0); }
.cx-btn.primary { background: var(--cx-accent); border-color: var(--cx-accent); color: var(--cx-accent-ink, #fff); }
.cx-trans { background: var(--cx-panel-alt, rgba(255, 255, 255, 0.6)); }
.cx-text { background: var(--cx-text-screen, #0d0f12); color: var(--cx-text-screen-ink, #e9e6df); }
/* talk list (js/chat-home.js) */
.cx-app > .cx-home { position: absolute; inset: 0; z-index: 5; display: none; flex-direction: column; background: var(--cx-bg); color: var(--cx-bg-ink, var(--cx-in-ink)); }
.cx-badge[hidden] { display: none; }
.cx-app[data-screen="home"] > .cx-home { display: flex; }
.cx-h-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; background: var(--cx-head); color: var(--cx-head-ink); }
.cx-h-app { font-size: 1.3em; letter-spacing: 0.06em; }
.cx-h-menu { background: none; border: 0; color: inherit; font-size: 1.35em; padding: 4px 8px; }
.cx-h-tabs { display: flex; gap: 18px; padding: 8px 16px 0; background: var(--cx-head); color: var(--cx-head-ink); opacity: 0.95; font-size: 0.9em; }
.cx-h-tabs .on { font-weight: 700; border-bottom: 2px solid currentColor; padding-bottom: 6px; }
.cx-h-tabs button { background: none; border: 0; color: inherit; opacity: 0.65; padding: 0 0 6px; }
.cx-h-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.cx-h-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; background: transparent; color: inherit; border: 0; border-bottom: 1px solid rgba(127, 127, 127, 0.18); text-align: left; }
.cx-h-row:hover { background: rgba(127, 127, 127, 0.1); }
.cx-h-row.fresh { background: rgba(127, 127, 127, 0.16); }
.cx-h-row.old { opacity: 0.6; }
.cx-app .cx-h-row .cx-h-av .cx-av { width: 48px; height: 48px; }
.cx-h-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cx-h-main i { font-style: normal; font-size: 0.78em; opacity: 0.6; margin-left: 4px; font-weight: 400; }
.cx-h-main span { color: var(--cx-meta); font-size: 0.86em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-h-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--cx-meta); font-size: 0.78em; }
.cx-wait { background: var(--cx-accent); }
.cx-h-hint { margin: auto 0 0; padding: 16px; text-align: center; color: var(--cx-meta); font-size: 0.85em; }
/* title screen (js/chat-title.js) */
.cxt { position: absolute; inset: 0; z-index: 9; overflow-y: auto; background: var(--cx-text-screen, #0c0e11); color: var(--cx-text-screen-ink, #e6e3dc); font-family: var(--gfc-font, inherit); }
.cxt[hidden] { display: none; }
.cxt-art { position: absolute; inset: 0 0 auto 0; height: 62%; background-size: cover; background-position: center; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.cxt-box { position: relative; padding: 30vh 16px 28px; display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
@media (min-width: 560px) { .cxt-box { padding-top: 24vh; } }
.cxt-kicker { margin: 0; opacity: 0.7; font-size: 0.82em; letter-spacing: 0.2em; }
.cxt-logo { margin: 0; font-family: var(--gfc-title-font, inherit); font-weight: 900; font-size: 2.9em; letter-spacing: 0.08em; line-height: 1.1; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.8); }
.cxt-logo span { display: block; font-size: 0.42em; font-weight: 600; letter-spacing: 0.18em; margin-top: 10px; opacity: 0.8; }
.cxt-lead { margin: 2px 0 6px; font-family: var(--gfc-title-font, inherit); font-size: 1.12em; line-height: 1.9; opacity: 0.9; }
.cxt-text { margin: 0; font-size: 0.9em; line-height: 1.9; opacity: 0.8; }
.cxt-actions { display: flex; flex-direction: column; gap: 10px; }
.cxt-btn { font: inherit; font-weight: 700; font-size: 1.05em; padding: 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.08); color: inherit; width: 100%; cursor: pointer; }
.cxt-btn.primary { background: var(--cx-accent); border-color: var(--cx-accent); color: var(--cx-accent-ink, #fff); }
.cxt-btn:hover { filter: brightness(1.12); }
.cxt-cont[hidden] { display: none; }
.cxt-info { margin: 4px 0 0; opacity: 0.6; font-size: 0.82em; text-align: center; }
.cxt-row { display: flex; gap: 10px; }
.cxt-link { flex: 1; position: relative; font: inherit; padding: 10px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.16); background: transparent; color: inherit; cursor: pointer; }
.cxt-link:disabled { opacity: 0.35; cursor: default; }
.cxt-dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; }
.cxt-dot[hidden] { display: none; }
.cxt-points { margin: 6px 0 0; padding-left: 1.2em; opacity: 0.75; font-size: 0.86em; line-height: 1.8; }
.cxt-notice { margin: 4px 0 0; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; opacity: 0.65; font-size: 0.76em; line-height: 1.7; }
.cxt-loading { opacity: 0.6; font-size: 0.85em; min-height: 1.4em; }
.cxt-art { transition: opacity 0.5s ease; }
.cxt-art.gf-art-wait { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .cxt-art { transition: none; } }
.cx-p-hide { display: none; }
.cx-p-in { animation: cx-in 0.5s ease-out; }
.cx-text-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 8px; }
.cx-text-skip { background: none; border: 0; color: inherit; opacity: 0.6; text-decoration: underline; font-size: 0.85em; }
.cx-text-skip[hidden] { display: none; }
.cx-read.cx-flick { animation: cx-blink 0.5s 4; }
.cx-app { color: var(--cx-bg-ink, var(--cx-in-ink)); }
.cx-bubble { color: var(--cx-in-ink); }
.cx-out .cx-bubble { color: var(--cx-out-ink); }
.cx-v-cap { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; font-size: 0.86em; text-align: center; color: var(--cx-meta); }
.cx-v-cap:empty { display: none; }
/* ---- chat fixes (kit-chatfix): share buttons on the ending card, short landscape screens ---- */
.cx-end .share-text { font-size: 0.82em; line-height: 1.7; text-align: left; margin-top: 12px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--cx-line, rgba(128, 128, 128, 0.35)); background: color-mix(in srgb, currentColor 6%, transparent); color: inherit; }
.cx-end .share-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0 6px; }
.cx-end .share-buttons button, .cx-end .share-buttons .share-x, .cx-end .share-buttons .share-fb, .cx-end .share-buttons .share-line, .cx-end .share-buttons .share-ig {
  font: inherit; font-size: 0.92em; min-height: 44px; padding: 8px 10px; border-radius: 10px; cursor: pointer; border: 1px solid var(--cx-line, #b8b0a0); background: var(--cx-choice, #fff); color: var(--cx-choice-ink, #1d2328); }
.cx-end .share-buttons button:hover { filter: brightness(1.08); }
.cx-end .share-buttons button:focus-visible { outline: 2px solid var(--cx-accent); outline-offset: 2px; }
.cx-end .share-buttons [data-share="x"], .cx-end .share-buttons [data-share="save"] { background: var(--cx-accent); border-color: var(--cx-accent); color: var(--cx-accent-ink, #fff); }
.cx-end .share-note { min-height: 1.4em; color: var(--cx-meta); font-size: 0.85em; }
@media (max-height: 480px) {
  .cx-cs-in { padding: 8px 20px; gap: 4px; }
  .cx-cs-app { display: none; }
  .cx-app .cx-callscreen .cx-cs-av .cx-av { width: 52px; height: 52px; font-size: 1.4em; }
  .cx-cs-name { font-size: 1.15em; }
  .cx-cs-cap { min-height: 2.4em; line-height: 1.6; }
  .cx-cs-btns { margin-top: 4px; }
  .cx-cs-btn span { width: 48px; height: 48px; }
  .cxt-box { padding-top: 10vh; gap: 8px; padding-bottom: 12px; }
  .cxt-logo { font-size: 2em; }
  .cxt-lead { font-size: 1em; line-height: 1.6; margin: 0; }
  .cxt-text { line-height: 1.6; }
  .cxt-btn { padding: 10px; }
}
/* the title's buttons stay in view while the page scrolls */
.cxt-actions { position: sticky; bottom: 0; padding: 10px 0 4px; background: linear-gradient(transparent, var(--cx-text-screen, #0c0e11) 28%); }
/*@end*/

/* ---- the 3D conversation window and choice (js/talk-ui.js, standard 1.7) ---- */
.gf-talk { display: flex; flex-direction: column; gap: var(--gf-space-3, 12px); min-height: 100%; color: var(--gf-text, #e8e6df); }
.gf-talk-img { width: 100%; max-height: 30vh; object-fit: cover; border: 1px solid var(--gf-border, rgba(255,255,255,.2)); border-radius: var(--gf-radius, 4px); }
.gf-talk-row { display: flex; gap: var(--gf-space-3, 12px); align-items: flex-start; }
.gf-talk-face { flex: none; width: clamp(84px, 22%, 150px); aspect-ratio: 2 / 3; object-fit: cover; object-position: top; border: 1px solid var(--gf-border, rgba(255,255,255,.2)); border-radius: var(--gf-radius, 4px); }
.gf-talk-words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--gf-space-2, 8px); }
.gf-talk-img + .gf-talk-row .gf-talk-face { width: clamp(64px, 14%, 96px); }
.gf-talk-img:has(+ .gf-talk-row) { max-height: 22vh; }   /* a scene picture with a face under it: both fit without scrolling */
.gf-talk-who { margin: 0; color: var(--gf-accent, #d9b46a); font-size: var(--gf-text-sm, 13px); letter-spacing: 0.12em; }
.gf-talk-who span { color: var(--gf-text-dim, #b8b4a8); margin-left: 0.4em; letter-spacing: 0; }
.gf-talk--me .gf-talk-who { color: var(--gf-text-dim, #b8b4a8); }
.gf-talk-text { margin: 0; color: var(--gf-text, #e8e6df); font-size: 18px; line-height: 1.9; cursor: pointer; }
.gf-talk-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--gf-space-3, 12px); }
.gf-talk-n { color: var(--gf-text-dim, #b8b4a8); font-size: var(--gf-text-sm, 13px); }
.gf-talk-next, .gf-talk-choice { min-height: var(--gf-hit, 44px); min-width: 120px; }
.gf-talk-choices { display: flex; flex-wrap: wrap; gap: var(--gf-space-3, 12px); justify-content: flex-end; margin-top: var(--gf-space-4, 16px); }

/* ---- pre-paint of the standard windows (js/ui-warm.js): really laid out and painted, but invisible and inert. opacity .001 (not 0: Chrome skips painting at 0) ---- */
body.gf-warming .wm-layer, body.gf-warming .rn-wrap, body.gf-warming #mg, body.gf-warming .gf-overlay { opacity: 0.001 !important; pointer-events: none !important; animation: none !important; transition: none !important; }


/*@section minigame-library*/
/* ---- the mini game library (js/mg-frame.js, js/mg-pour.js, js/mg-turn-dials.js; docs/minigame-library.md): top-anchored like every window ---- */
.mgx { position: fixed; left: 50%; top: max(var(--gf-space-5, 24px), min(9vh, 80px), env(safe-area-inset-top, 0px)); transform: translateX(-50%); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - min(9vh, 80px) - 24px); overflow: auto; z-index: calc(var(--gf-z-window, 60) + 5);
  box-sizing: border-box; background: var(--gf-surface, var(--panel, #fffdf6)); border: 1px solid var(--gf-border-strong, var(--line, #b8b0a0)); border-radius: var(--gf-radius-lg, 12px); padding: var(--gf-space-5, 20px); color: var(--gf-text, var(--ink, #23302c)); box-shadow: var(--gf-shadow, 0 10px 40px rgba(0, 0, 0, 0.35)); }
.mgx-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mgx-head b { font-size: 18px; color: var(--gf-heading, var(--gf-accent, #2f5e46)); }
.mgx-help { color: var(--gf-text-dim, var(--dim, #5c6662)); line-height: 1.7; }
.mgx-msg { min-height: 1.7em; color: var(--gf-accent-hover, var(--gf-accent, #2f5e46)); }
.mgx-close, .mgx-row .btn { min-height: var(--gf-hit, 44px); }
.mgx-row { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.mgx-pour { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.mgx-pour-dish { position: relative; width: 140px; height: 180px; border: 1px solid var(--gf-border, #d8d2c2); border-radius: 4px; background: var(--gf-surface-2, #ece6d6); display: flex; align-items: flex-end; overflow: hidden; }
.mgx-pour-heap { width: 100%; height: 0; background: linear-gradient(#f4f0e4, #d8d2c0); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.mgx-pour--water .mgx-pour-heap { background: linear-gradient(#7fb0d0, #3a6a8a); clip-path: none; }
.mgx-pour--sand .mgx-pour-heap { background: linear-gradient(#d8c08a, #a88a50); }
.mgx-pour-band { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--gf-accent, #3a7a5a); border-bottom: 2px dashed var(--gf-accent, #3a7a5a); }
.mgx-pour-btn { min-height: 56px; min-width: 220px; touch-action: none; user-select: none; }
.mgx-dials { display: flex; justify-content: center; gap: 14px; margin: 8px 0 16px; flex-wrap: wrap; }
.mgx-dial { width: 96px; min-height: 120px; border: 1px solid var(--gf-border-strong, #b8b0a0); border-radius: 8px; background: var(--gf-surface-2, #ece6d6); color: var(--gf-text, inherit); font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.mgx-dial-arrow { width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-bottom: 30px solid var(--gf-accent, #3a7a5a); transition: transform 0.2s; }
.mgx-dial-dir { font-size: 22px; }
.mgx-dial small { color: var(--gf-text-dim, #5c6662); }
@media (prefers-reduced-motion: reduce) { .mgx-dial-arrow { transition: none; } }
.mgx-mark { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mgx-mark-lock { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 18px; border: 1px solid var(--gf-border-strong, #b8b0a0); border-radius: 8px; background: var(--gf-surface-2, #ece6d6); color: var(--gf-text, #1f2422); }
.mgx-mark-lock small, .mgx-mark-pick small { color: var(--gf-text-dim, #5c6662); }
.mgx-mark-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.mgx-mark-pick { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 72px; min-height: max(72px, var(--gf-hit, 44px)); }
.mgx-mark-pick.ok { border-color: var(--gf-ok, #2f7a4a); color: var(--gf-ok, #2f7a4a); }
.mgx-mark-pick.no { animation: mgx-shake 0.3s; }
@keyframes mgx-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.mgx-timing { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.mgx-timing-track { position: relative; width: min(360px, 100%); height: 56px; border: 1px solid var(--gf-border-strong, #b8b0a0); border-radius: 6px; background: var(--gf-surface-2, #ece6d6); overflow: hidden; }
.mgx-timing-target { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--gf-accent, #3a7a5a) 25%, transparent); border-left: 2px dashed var(--gf-accent, #3a7a5a); border-right: 2px dashed var(--gf-accent, #3a7a5a); }
.mgx-timing-mark { position: absolute; top: 6px; bottom: 6px; width: 22px; margin-left: -11px; border-radius: 3px; background: #f4ecd8; border: 2px solid #8a2a20; }  /* pair-ok: a paper seal on any theme */
.mgx-timing--needle .mgx-timing-mark { width: 4px; margin-left: -2px; background: #2a2a2a; border: 0; }  /* pair-ok */
.mgx-timing--hammer .mgx-timing-mark { width: 30px; margin-left: -15px; background: #6a5a48; border-color: #3a3028; }  /* pair-ok */
.mgx-timing-btn, .mgx-code-btn { min-height: 56px; min-width: 220px; touch-action: none; user-select: none; }
.mgx-code-btn { display: block; margin: 12px auto 0; }
/* standard 1.8.2: tune-radio, trace-path, slide-tiles, search-dark, rotate-pipes, sort-items */
.mgx-radio { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mgx-radio-band { display: flex; align-items: center; gap: 8px; width: min(380px, 100%); font: 0.8em var(--gf-font-mono, monospace); color: var(--gf-text-dim); }
.mgx-radio-scale { position: relative; flex: 1; height: 34px; border: 1px solid var(--gf-border-strong, #b8b0a0); border-radius: 4px; background: repeating-linear-gradient(90deg, transparent 0 9px, var(--gf-border, #d8d2c2) 9px 10px), var(--gf-surface-2, #ece6d6); }
.mgx-radio-needle { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: #b0281c; }  /* pair-ok: a red needle on any theme */
.mgx-radio-bars { display: flex; align-items: flex-end; gap: 3px; width: min(380px, 100%); height: 54px; }
.mgx-radio-bars b { flex: 1; height: 10%; background: color-mix(in srgb, var(--gf-accent, #3a7a5a) 70%, transparent); border-radius: 2px 2px 0 0; }
.mgx-radio-hold { width: min(380px, 100%); height: 8px; border-radius: 4px; background: var(--gf-surface-2, #ece6d6); overflow: hidden; }
.mgx-radio-hold i { display: block; height: 100%; width: 0; background: var(--gf-accent, #3a7a5a); }
.mgx-radio-heard { margin: 0; min-height: 1.7em; width: min(380px, 100%); text-align: center; color: var(--gf-text); font-size: 0.95em; line-height: 1.7; }
@media (max-height: 500px) { .mgx-radio { gap: 6px; } .mgx-radio-knob { width: 84px; height: 84px; } .mgx-radio-bars { height: 36px; } }
.mgx-radio-signal { display: flex; align-items: center; gap: 8px; width: min(380px, 100%); font-size: 0.8em; color: var(--gf-text-dim); }
.mgx-radio-signal div { flex: 1; height: 12px; border-radius: 6px; background: var(--gf-surface-2, #ece6d6); overflow: hidden; border: 1px solid var(--gf-border, #d8d2c2); }
.mgx-radio-signal i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8a7a5a, var(--gf-accent, #3a7a5a)); transition: width 0.1s linear; }  /* pair-ok */
.mgx-radio.warm .mgx-radio-needle { box-shadow: 0 0 5px #ff5a40; }  /* pair-ok */
.mgx-radio-knob { --a: 0deg; position: relative; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #6a6e70, #1a1c1e); border: 3px solid #2a2e30; box-shadow: 0 4px 10px rgba(0,0,0,0.5); cursor: grab; touch-action: none; transform: rotate(var(--a)); }  /* pair-ok */
.mgx-radio-knob i { position: absolute; left: 50%; top: 8px; width: 6px; height: 30px; margin-left: -3px; background: #e8e0c8; border-radius: 3px; }  /* pair-ok */
.mgx-radio-knob:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: 4px; }
.mgx-trace { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mgx-trace svg { width: min(420px, 100%); height: auto; aspect-ratio: 400 / 260; border: 1px solid var(--gf-border-strong, #b8b0a0); border-radius: 6px; background: #f2ead6; touch-action: none; }  /* pair-ok: paper */
.mgx-trace polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mgx-trace-guide { stroke: rgba(160, 130, 80, 0.18); }  /* pair-ok */
.mgx-trace-line { stroke: #9a8a6a; stroke-width: 2px; stroke-dasharray: 6 6; }  /* pair-ok */
.mgx-trace-ink { stroke: #1e1a16; stroke-width: 7px; }  /* pair-ok: ink */
.mgx-trace--cut .mgx-trace-ink { stroke: #8a2a20; stroke-width: 3px; }  /* pair-ok */
.mgx-trace--thread .mgx-trace-ink { stroke: #b0281c; stroke-width: 3px; }  /* pair-ok */
.mgx-trace-pen { fill: #b0281c; stroke: #f2ead6; stroke-width: 3px; }  /* pair-ok */
.mgx-trace-end { fill: none; stroke: #3a7a5a; stroke-width: 3px; stroke-dasharray: 4 3; }  /* pair-ok */
.mgx-trace-key { min-height: 52px; min-width: 220px; touch-action: none; user-select: none; }
.mgx-slide { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: flex-start; }
.mgx-slide-board { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 3px; width: min(300px, 100%); aspect-ratio: 1; padding: 3px; background: var(--gf-border-strong, #b8b0a0); border-radius: 6px; }
.mgx-slide-piece { min-width: 44px; min-height: 44px; border: 0; border-radius: 3px; background: var(--gf-surface-2, #ece6d6) no-repeat; color: var(--gf-text); font: 700 1.3em var(--gf-font); cursor: pointer; transition: transform 0.1s; }
.mgx-slide-piece:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: -3px; }
.mgx-slide-gap { border-radius: 3px; background: rgba(0,0,0,0.35); }  /* pair-ok */
.mgx-slide-ref { width: 96px; height: 96px; object-fit: cover; border: 1px solid var(--gf-border-strong, #b8b0a0); border-radius: 4px; opacity: 0.85; }
.mgx-dark { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mgx-dark-stage { position: relative; width: min(440px, 100%); aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; cursor: crosshair; touch-action: none; background: #2a2622; }  /* pair-ok */
.mgx-dark-stage:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: 3px; }
.mgx-dark-pic { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, #4a4036 0 38px, #3e352c 38px 41px) center / cover; }  /* pair-ok: boards */
.mgx-dark-mark { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: radial-gradient(circle, #e8dcc0 0 30%, rgba(150,30,16,0.85) 32% 56%, transparent 58%); }  /* pair-ok */
.mgx-dark-mark.found { box-shadow: 0 0 0 3px var(--gf-accent, #3a7a5a); }
.mgx-dark-shade { position: absolute; inset: 0; pointer-events: none; }
.mgx-dark-count { margin: 0; min-height: 1.4em; color: var(--gf-text-dim); font-size: 0.9em; }
.mgx-pipes { display: flex; justify-content: center; }
.mgx-pipes-grid { display: grid; grid-template-columns: repeat(var(--w, 4), 1fr); gap: 3px; width: min(360px, 100%); padding: 3px; background: var(--gf-border-strong, #b8b0a0); border-radius: 6px; }
.mgx-pipe { aspect-ratio: 1; min-width: 44px; padding: 0; border: 0; border-radius: 3px; background: var(--gf-surface-2, #ece6d6); cursor: pointer; }
.mgx-pipe svg { display: block; width: 100%; height: 100%; }
.mgx-pipe polyline { fill: none; stroke: #6a6258; stroke-width: 18px; stroke-linecap: round; }  /* pair-ok */
.mgx-pipe circle { fill: #6a6258; }  /* pair-ok */
.mgx-pipe.on polyline { stroke: #2a6a9a; }  /* pair-ok: water */
.mgx-pipe.on circle { fill: #2a6a9a; }  /* pair-ok */
.mgx-pipe.in { box-shadow: inset 4px 0 0 #2a6a9a; }  /* pair-ok */
.mgx-pipe.out { box-shadow: inset 0 -4px 0 var(--gf-accent, #3a7a5a); }
.mgx-pipe.in.out { box-shadow: inset 4px 0 0 #2a6a9a, inset 0 -4px 0 var(--gf-accent, #3a7a5a); }  /* pair-ok */
.mgx-pipe:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: -3px; }
.mgx-sort { display: flex; flex-direction: column; gap: 14px; }
.mgx-sort-tray { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 52px; }
.mgx-sort-item { min-height: 48px; padding: 8px 14px; border: 1px solid var(--gf-border-strong, #b8b0a0); border-radius: 6px; background: var(--gf-surface-2, #ece6d6); color: var(--gf-text); font: inherit; cursor: grab; touch-action: none; user-select: none; }
.mgx-sort-item.picked { outline: 3px solid var(--gf-accent, #3a7a5a); }
.mgx-sort-ghost { position: fixed; z-index: 10000; pointer-events: none; transform: translate(-50%, -50%); opacity: 0.9; box-shadow: 0 6px 16px rgba(0,0,0,0.4); }  /* pair-ok */
.mgx-sort-empty { color: var(--gf-text-dim); align-self: center; }
.mgx-sort-bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.mgx-sort-bin { display: flex; flex-direction: column; gap: 4px; align-items: center; min-height: 92px; padding: 10px 8px; border: 2px dashed var(--gf-border-strong, #b8b0a0); border-radius: 8px; background: transparent; color: var(--gf-text); font: inherit; cursor: pointer; }
.mgx-sort-in { font-size: 0.8em; color: var(--gf-text-dim); }
/* standard 1.8.3: the frame's motion (open, message, miss, clear stamp, pips) and the skins (cfg.skin); ctx.calm / reduce motion: .mgx--calm */
.mgx { animation: mgx-open 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
@keyframes mgx-open { from { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(0.97); } to { opacity: 1; transform: translateX(-50%); } }
.mgx-head b { flex: 1; }
.mgx-pips { display: inline-flex; gap: 5px; }
.mgx-pips i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--gf-border-strong, #b8b0a0); transition: background 0.25s, transform 0.25s; }
.mgx-pips i.on { background: var(--gf-accent, #3a7a5a); border-color: var(--gf-accent, #3a7a5a); transform: scale(1.15); }
.mgx-msg.in { animation: mgx-msg 0.32s ease-out both; }
@keyframes mgx-msg { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.mgx-body { position: relative; }
.mgx-body.mgx-shake { animation: mgx-shake 0.36s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
@keyframes mgx-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
.mgx--win { box-shadow: 0 0 0 3px var(--gf-accent, #3a7a5a), var(--gf-shadow, 0 10px 40px rgba(0, 0, 0, 0.35)); transition: box-shadow 0.3s; }
.mgx-stamp { position: absolute; left: 50%; top: 50%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 16px; transform: translate(-50%, -50%) rotate(-8deg); border: 3px solid #a8281c; border-radius: 10px; background: rgba(255, 250, 238, 0.92); color: #a8281c; font: 700 1.25em var(--gf-font); letter-spacing: 0.2em; pointer-events: none; z-index: 5; animation: mgx-stamp 0.42s cubic-bezier(0.2, 1.4, 0.4, 1) both; }  /* pair-ok: a red seal on paper on every skin */
.mgx-stamp svg { width: 46px; height: 46px; fill: none; stroke: #a8281c; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }  /* pair-ok */
.mgx-stamp svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: mgx-check 0.35s 0.18s ease-out forwards; }
@keyframes mgx-stamp { from { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(2.2); } 60% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(0.92); } to { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); } }
@keyframes mgx-check { to { stroke-dashoffset: 0; } }
.mgx .btn { transition: transform 0.08s, box-shadow 0.15s; }
.mgx .btn:active { transform: translateY(1px) scale(0.98); }
.mgx--calm, .mgx--calm *, .mgx--calm *::before, .mgx--calm *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
.mgx--calm .mgx-stamp svg path { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .mgx, .mgx *, .mgx *::before, .mgx *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } .mgx-stamp svg path { stroke-dashoffset: 0; } }
/* skins: each sets the panel's own tokens, so the buttons and every game inside follow (text pairs checked for AA) */
.mgx--skin-metal { --gf-mg-btn: #3a4146; --gf-mg-line: #7a868c; --gf-mg-ink: #e8ecee; --gf-surface: #2b3034; --gf-surface-2: #3a4146; --gf-text: #e8ecee; --gf-text-dim: #b8c0c4; --gf-heading: #f2f5f6; --gf-accent: #7fd6aa; --gf-accent-hover: #9be4bd; --gf-border: #5a6468; --gf-border-strong: #7a868c;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.12)), repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 5px), #2b3034; border-width: 2px; }  /* pair-ok: brushed steel */
.mgx--skin-metal::before { content: ""; position: absolute; inset: 8px; border-radius: 8px; pointer-events: none; background: radial-gradient(circle at 0 0, #8a9296 2.5px, transparent 3.5px) 0 0 / 100% 100% no-repeat, radial-gradient(circle at 100% 0, #8a9296 2.5px, transparent 3.5px), radial-gradient(circle at 0 100%, #8a9296 2.5px, transparent 3.5px), radial-gradient(circle at 100% 100%, #8a9296 2.5px, transparent 3.5px); }  /* pair-ok: rivets */
.mgx--skin-wood { --gf-mg-btn: #664630; --gf-mg-line: #a07c56; --gf-mg-ink: #f8ecd8; --gf-surface: #4e3522; --gf-surface-2: #664630; --gf-text: #f8ecd8; --gf-text-dim: #e6d2b4; --gf-heading: #ffe8b8; --gf-accent: #f2c462; --gf-accent-hover: #ffd47a; --gf-border: #7a5a3a; --gf-border-strong: #a07c56;
  background: repeating-linear-gradient(176deg, rgba(0,0,0,0.08) 0 3px, transparent 3px 11px, rgba(255,220,170,0.04) 11px 13px, transparent 13px 23px), linear-gradient(90deg, #4a3220, #56392a 40%, #4a3220); border-width: 3px; }  /* pair-ok: boards */
.mgx--skin-crt { --gf-surface: #04120a; --gf-surface-2: #0b2416; --gf-text: #b8ffcc; --gf-text-dim: #86dca2; --gf-heading: #d2ffe0; --gf-accent: #5cff9a; --gf-accent-hover: #8cffb8; --gf-border: #1c5a34; --gf-border-strong: #2e8a52;
  background: radial-gradient(ellipse at center, #08200f 0%, #04120a 75%, #020804 100%); font-family: var(--gf-font-mono, ui-monospace, monospace); text-shadow: 0 0 6px rgba(92, 255, 154, 0.35); }  /* pair-ok: a green screen */
.mgx--skin-crt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,0.22) 0 1px, transparent 1px 3px); animation: mgx-flicker 4s steps(1) infinite; }  /* pair-ok */
@keyframes mgx-flicker { 0%, 97% { opacity: 1; } 98% { opacity: 0.7; } }
.mgx--skin-night { --gf-mg-btn: #1e2232; --gf-mg-line: #4c5474; --gf-mg-ink: #e6e8f2; --gf-surface: #12141e; --gf-surface-2: #1e2232; --gf-text: #e6e8f2; --gf-text-dim: #b0b4c8; --gf-heading: #c8d4ff; --gf-accent: #9cb6ff; --gf-accent-hover: #b8caff; --gf-border: #343a52; --gf-border-strong: #4c5474;
  background: radial-gradient(circle at 80% -10%, rgba(156, 182, 255, 0.14), transparent 45%), #12141e; }  /* pair-ok: moonlight */
.mgx--skin-washi { --gf-mg-btn: #ece2cc; --gf-mg-line: #b0a07e; --gf-mg-ink: #2a2420; --gf-surface: #f7f1e3; --gf-surface-2: #ece2cc; --gf-text: #2a2420; --gf-text-dim: #574c44; --gf-heading: #8a2418; --gf-accent: #9a2c1e; --gf-accent-hover: #b03826; --gf-border: #d2c4a6; --gf-border-strong: #b0a07e;
  background: radial-gradient(circle at 20% 30%, rgba(160, 130, 80, 0.07) 0 1px, transparent 2px) 0 0 / 7px 9px, radial-gradient(circle at 70% 60%, rgba(160, 130, 80, 0.06) 0 1px, transparent 2px) 0 0 / 11px 13px, #f7f1e3; border-radius: 4px; }  /* pair-ok: paper fibres */
.mgx--skin-metal .btn, .mgx--skin-wood .btn, .mgx--skin-crt .btn, .mgx--skin-night .btn { background: var(--gf-surface-2); color: var(--gf-text); border-color: var(--gf-border-strong); }
.mgx--skin-metal .btn.primary, .mgx--skin-wood .btn.primary, .mgx--skin-crt .btn.primary, .mgx--skin-night .btn.primary, .mgx--skin-washi .btn.primary { background: var(--gf-accent); color: #10140f; border-color: var(--gf-accent); }  /* pair-ok: dark ink on the light accents */
.mgx--skin-washi .btn.primary { color: #fff8ec; }  /* pair-ok: light ink on the vermilion */
.mgx--skin-washi .btn { background: var(--gf-surface); color: var(--gf-text); border-color: var(--gf-border-strong); }
/* the games' own motion */
.mgx-radio.near .mgx-radio-knob { box-shadow: 0 0 0 3px var(--gf-accent, #3a7a5a), 0 0 18px var(--gf-accent, #3a7a5a); }
.mgx-radio.near .mgx-radio-needle { box-shadow: 0 0 8px #ff5a40; }  /* pair-ok */
.mgx-radio-bars b { transition: height 0.08s linear; }
.mgx-trace-pen { animation: mgx-pulse 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes mgx-pulse { 50% { transform: scale(1.25); } }
.mgx-slide-piece.moved { animation: mgx-slide 0.14s ease-out both; }
@keyframes mgx-slide { from { transform: translate(var(--fx, 0), var(--fy, 0)); } to { transform: none; } }
.mgx-slide-board.solved .mgx-slide-piece { box-shadow: 0 0 0 2px var(--gf-accent, #3a7a5a); transition: box-shadow 0.4s; }
.mgx-dark-mark.found { animation: mgx-found 0.6s ease-out both; }
@keyframes mgx-found { 0% { transform: scale(0.4); } 60% { transform: scale(1.5); } 100% { transform: scale(1); } }
.mgx-pipe.spin svg { animation: mgx-spin 0.16s ease-out both; }
@keyframes mgx-spin { from { transform: rotate(-90deg); } to { transform: none; } }
.mgx-pipe.on polyline { transition: stroke 0.25s; filter: drop-shadow(0 0 3px rgba(42, 106, 154, 0.6)); }  /* pair-ok */
.mgx-sort-item { transition: transform 0.12s, box-shadow 0.12s; }
.mgx-sort-item:hover, .mgx-sort-item.picked { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.25); }  /* pair-ok */
.mgx-sort-bin { transition: background 0.2s, border-color 0.2s, transform 0.12s; }
.mgx-sort-bin.got { animation: mgx-got 0.45s ease-out; }
@keyframes mgx-got { 30% { transform: scale(1.05); background: color-mix(in srgb, var(--gf-accent, #3a7a5a) 22%, transparent); } }
.mgx-sort-bin.hot { border-color: var(--gf-accent, #3a7a5a); background: color-mix(in srgb, var(--gf-accent, #3a7a5a) 12%, transparent); }
/* standard 1.8.3: memory-pairs, lock-pick, photo-focus, rhythm-taps, connect-dots */
.mgx-pairs { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 8px; width: min(380px, 100%); margin: 0 auto; perspective: 700px; }
.mgx-card { aspect-ratio: 3 / 4; min-height: 64px; padding: 0; border: 0; background: none; cursor: pointer; }
.mgx-card-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.38s cubic-bezier(0.3, 1.3, 0.5, 1); }
.mgx-card.up .mgx-card-in { transform: rotateY(180deg); }
.mgx-card-back, .mgx-card-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 6px; backface-visibility: hidden; border: 2px solid var(--gf-border-strong, #b8b0a0); }
.mgx-card-back { background: repeating-linear-gradient(45deg, #6a2a20 0 6px, #7a3428 6px 12px); box-shadow: inset 0 0 0 4px #e8d8b8; }  /* pair-ok: a red card back */
.mgx-card-face { transform: rotateY(180deg); background: #faf4e6; color: #2a2018; font: 700 1.9em var(--gf-font); }  /* pair-ok: paper */
.mgx-card-face img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.mgx-card.kept .mgx-card-face { border-color: var(--gf-accent, #3a7a5a); box-shadow: 0 0 0 2px var(--gf-accent, #3a7a5a); animation: mgx-kept 0.5s ease-out; }
@keyframes mgx-kept { 40% { transform: rotateY(180deg) scale(1.1); } }
.mgx-card:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: 2px; border-radius: 6px; }
.mgx-lock { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mgx-lock-body { position: relative; display: flex; gap: 14px; justify-content: center; padding: 14px 20px 10px; width: min(320px, 100%); height: 170px; box-sizing: border-box; border-radius: 10px 10px 40px 40px; background: linear-gradient(#b8923a, #8a6a24); box-shadow: inset 0 -6px 0 rgba(0,0,0,0.25); }  /* pair-ok: brass */
.mgx-lock-shear { position: absolute; left: 10px; right: 10px; top: 54px; border-top: 2px dashed rgba(40, 24, 8, 0.6); }  /* pair-ok */
.mgx-pin { --h: 0; position: relative; flex: 1; max-width: 46px; background: rgba(40, 24, 8, 0.45); border-radius: 6px; overflow: hidden; }  /* pair-ok */
.mgx-pin i { position: absolute; left: 6px; right: 6px; bottom: calc(var(--h) * 100px); height: 60px; border-radius: 4px 4px 10px 10px; background: linear-gradient(90deg, #d0d4d6, #f4f6f6, #b0b4b6); transition: background 0.15s; }  /* pair-ok: steel */
.mgx-pin.cur { box-shadow: 0 0 0 2px #fff4c8; }  /* pair-ok */
.mgx-pin.feel i { background: linear-gradient(90deg, #e8e0b0, #fffbe0, #c8c098); box-shadow: 0 0 10px #fff2a0; }  /* pair-ok */
.mgx-pin.set i { background: linear-gradient(90deg, #8ac8a0, #c8f0d4, #6aa880); transition: bottom 0.2s; }  /* pair-ok */
.mgx-lock-wrench { width: 120px; height: 10px; border-radius: 5px; background: #4a4e50; transform-origin: left center; transition: transform 0.12s; }  /* pair-ok */
.mgx-lock-wrench.feel { transform: rotate(4deg); }
.mgx-lock-btn { min-height: 56px; min-width: 220px; touch-action: none; user-select: none; }
.mgx-photo { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mgx-photo-view { position: relative; width: min(400px, 100%); aspect-ratio: 16 / 10; overflow: hidden; border-radius: 6px; background: #0c0e10; border: 6px solid #1e2022; }  /* pair-ok: a camera body */
.mgx-photo-pic { position: absolute; inset: 0; transition: transform 0.15s ease-out; }
.mgx-photo-pic svg, .mgx-photo-pic img { width: 100%; height: 100%; display: block; object-fit: cover; }
.mgx-photo-frame { position: absolute; inset: 18% 24%; border: 2px solid rgba(255, 255, 255, 0.7); pointer-events: none; }  /* pair-ok */
.mgx-photo-frame::before, .mgx-photo-frame::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; margin: -1px 0 0 -7px; background: rgba(255,255,255,0.7); }  /* pair-ok */
.mgx-photo-frame::after { transform: rotate(90deg); }
@media (max-height: 500px) { .mgx-photo { display: grid; grid-template-columns: auto auto; grid-template-rows: 1fr auto; gap: 10px 12px; align-items: center; justify-content: center; } .mgx-photo-view { grid-row: 1 / 3; width: min(360px, 27vw, calc((100dvh - 225px) * 1.6)); border-width: 4px; } .mgx-photo-ring { width: 100%; min-width: 170px; height: 40px; align-self: end; } .mgx-photo-ctl { align-self: start; flex-wrap: nowrap; gap: 6px; } .mgx-photo-ctl .btn { padding-left: 10px; padding-right: 10px; white-space: nowrap; flex: none; } }   /* a landscape phone: the picture beside the ring and the shutter, so all of it shows without scrolling */
.mgx-photo-meter { position: absolute; right: 8px; bottom: 6px; font: 12px var(--gf-font-mono, monospace); color: #f0f0e8; text-shadow: 0 1px 2px #000; }  /* pair-ok */
.mgx-photo-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }  /* pair-ok */
.mgx-photo-flash.go { animation: mgx-flash 0.5s ease-out; }
@keyframes mgx-flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.mgx-photo-ring { --r: 0px; width: min(400px, 100%); height: 46px; border-radius: 8px; cursor: ew-resize; touch-action: none; background: repeating-linear-gradient(90deg, #2a2c2e 0 6px, #4a4e52 6px 9px) var(--r) 0 / 300px 100%, #2a2c2e; box-shadow: inset 0 6px 8px rgba(0,0,0,0.5), inset 0 -6px 8px rgba(0,0,0,0.5); position: relative; }  /* pair-ok: a knurled ring */
.mgx-photo-ring i { position: absolute; left: 50%; top: -4px; width: 0; height: 0; margin-left: -6px; border: 6px solid transparent; border-top-color: #e8b040; }  /* pair-ok */
.mgx-photo-ring:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: 3px; }
.mgx-photo-ctl { justify-content: center; }
.mgx-photo-ctl [data-z] { min-width: 56px; font-size: 1.3em; }
.mgx-rhythm { display: flex; justify-content: center; }
.mgx-rhythm-stage { position: relative; width: 240px; height: 240px; display: flex; align-items: center; justify-content: center; }
.mgx-rhythm-ring { --s: 2; position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 4px solid var(--gf-accent, #3a7a5a); transform: scale(var(--s)); pointer-events: none; }
.mgx-rhythm-pad { width: 120px; height: 120px; border-radius: 50%; border: 6px solid #5a3a20; background: radial-gradient(circle at 40% 35%, #f4e6c8, #d8c098); color: #3a2410; font: 700 1.3em var(--gf-font); cursor: pointer; touch-action: none; user-select: none; }  /* pair-ok: a drum skin */
.mgx-rhythm--bell .mgx-rhythm-pad { border-color: #8a6a24; background: radial-gradient(circle at 40% 35%, #fff2b8, #c8a040); }  /* pair-ok */
.mgx-rhythm--mokugyo .mgx-rhythm-pad { border-color: #4a2a14; background: radial-gradient(circle at 40% 35%, #c88a50, #7a4a24); color: #fff0dc; }  /* pair-ok */
.mgx-rhythm-pad.beat { animation: mgx-beat 0.22s ease-out; }
.mgx-rhythm-pad.hit { animation: mgx-hit 0.3s ease-out; box-shadow: 0 0 0 6px var(--gf-accent, #3a7a5a); }
.mgx-rhythm-pad.off { animation: mgx-beat 0.2s ease-out; box-shadow: 0 0 0 4px #b0281c; }  /* pair-ok */
@keyframes mgx-beat { 40% { transform: scale(0.95); } }
@keyframes mgx-hit { 30% { transform: scale(1.12); } }
.mgx-rhythm-pad:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: 6px; }
.mgx-dots { display: flex; justify-content: center; }
.mgx-dots-box { position: relative; width: min(340px, 100%); aspect-ratio: 300 / 260; border-radius: 8px; background: radial-gradient(circle at 50% 40%, #232a3a, #10131c); }  /* pair-ok: night sky */
.mgx-dots-box svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mgx-dots-lines line { stroke: #e8d8a0; stroke-width: 3px; stroke-linecap: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: mgx-draw 0.35s ease-out forwards; }  /* pair-ok */
.mgx-dots-lines.lit line { stroke: #ffe890; filter: drop-shadow(0 0 4px #ffd860); transition: stroke 0.4s; }  /* pair-ok */
@keyframes mgx-draw { to { stroke-dashoffset: 0; } }
.mgx-dot { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 2px solid #e8d8a0; background: rgba(16, 19, 28, 0.85); color: #f4ecd0; font: 700 0.95em var(--gf-font); cursor: pointer; }  /* pair-ok */
.mgx-dot.done { background: #e8d8a0; color: #1a1c24; }  /* pair-ok */
.mgx-dot.hint { animation: mgx-pulse 0.9s ease-in-out infinite; box-shadow: 0 0 0 4px rgba(255, 216, 96, 0.6); }  /* pair-ok */
.mgx-dot.pop { animation: mgx-hit 0.3s ease-out; }
.mgx-dot:focus-visible { outline: 3px solid #ffd860; outline-offset: 2px; }  /* pair-ok */
/* standard 1.8.4: sixteen more (balance-scale … hold-breath) */
.mgx-scale { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mgx-scale-rig { position: relative; width: min(340px, 100%); height: 150px; }
.mgx-scale-post { position: absolute; left: 50%; top: 22px; bottom: 0; width: 8px; margin-left: -4px; background: linear-gradient(90deg, #6a4a20, #b8923a, #6a4a20); border-radius: 3px; }  /* pair-ok: brass */
.mgx-scale-post::after { content: ""; position: absolute; left: -26px; right: -26px; bottom: 0; height: 10px; border-radius: 4px; background: #6a4a20; }  /* pair-ok */
.mgx-scale-beam { --t: 0deg; position: absolute; left: 4%; right: 4%; top: 18px; height: 6px; background: #b8923a; border-radius: 3px; transform: rotate(var(--t)); transition: transform 0.55s cubic-bezier(0.3, 1.5, 0.5, 1); z-index: 1; }  /* pair-ok */
.mgx-pan { position: absolute; top: 4px; width: 84px; height: 70px; margin-left: -42px; transform: rotate(calc(-1 * var(--t))); transform-origin: 50% 0; transition: transform 0.55s cubic-bezier(0.3, 1.5, 0.5, 1); display: flex; align-items: flex-end; justify-content: center; }
.mgx-pan.l { left: 14%; } .mgx-pan.r { left: 86%; }
.mgx-pan::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; bottom: 14px; background: linear-gradient(to top left, transparent calc(50% - 1px), #8a6a2a calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) left / 50% 100% no-repeat, linear-gradient(to top right, transparent calc(50% - 1px), #8a6a2a calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) right / 50% 100% no-repeat; }  /* pair-ok: the strings */
.mgx-pan::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; border-radius: 0 0 46px 46px / 0 0 14px 14px; background: linear-gradient(#d8b860, #9a7a30); }  /* pair-ok: the pan */
.mgx-pan b { position: relative; z-index: 1; margin-bottom: 12px; padding: 4px 8px; background: #f0e2c0; color: #3a2a14; border-radius: 4px; font-size: 0.85em; }  /* pair-ok: a paper parcel */
.mgx-pan-in { position: relative; z-index: 1; display: flex; flex-wrap: wrap-reverse; gap: 2px; justify-content: center; margin-bottom: 12px; max-width: 80px; }
.mgx-pan-in i { min-width: 22px; height: 18px; border-radius: 3px 3px 1px 1px; background: #5a5e60; color: #f0f2f2; font: 700 11px/18px var(--gf-font); font-style: normal; text-align: center; animation: mgx-drop 0.25s ease-out; }  /* pair-ok: iron weights */
@keyframes mgx-drop { from { transform: translateY(-14px); opacity: 0; } }
.mgx-scale-tray { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mgx-weight { min-width: 56px; min-height: 52px; border: 2px solid var(--gf-border-strong, #b8b0a0); border-radius: 8px 8px 4px 4px; background: var(--gf-surface-2, #ece6d6); color: var(--gf-text); font: 700 1.1em var(--gf-font); cursor: pointer; transition: transform 0.15s, opacity 0.15s; }
.mgx-weight small { font-size: 0.65em; font-weight: 400; margin-left: 2px; }
.mgx-weight.on { opacity: 0.45; transform: translateY(3px); border-style: dashed; }
.mgx-bells { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 6px 0; }
.mgx-bell { width: 64px; min-height: 92px; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid var(--gf-border-strong, #b8b0a0); border-radius: 10px; background: var(--gf-surface-2, #ece6d6); color: var(--gf-text); font: 700 1em var(--gf-font); cursor: pointer; transform-origin: 50% 0; }
.mgx-bell svg { width: 40px; height: 44px; fill: #c8a040; stroke: #6a5018; stroke-width: 1.5; }  /* pair-ok: brass */
.mgx-bell.ring { animation: mgx-ring 0.5s ease-out; box-shadow: 0 0 0 3px var(--gf-accent, #3a7a5a), 0 0 16px var(--gf-accent, #3a7a5a); }
@keyframes mgx-ring { 15% { transform: rotate(12deg); } 35% { transform: rotate(-10deg); } 55% { transform: rotate(6deg); } 75% { transform: rotate(-3deg); } }
.mgx-bells[data-state="watch"] .mgx-bell { cursor: default; opacity: 0.85; }
.mgx-switch { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 10px; width: min(300px, 100%); margin: 0 auto; padding: 12px; border-radius: 10px; background: #2a2c2e; }  /* pair-ok: a panel */
.mgx-sw { aspect-ratio: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px solid #4a4e52; border-radius: 8px; background: #3a3e42; cursor: pointer; }  /* pair-ok */
.mgx-sw-lamp { width: 26px; height: 26px; border-radius: 50%; background: #4a4438; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.3); transition: background 0.2s, box-shadow 0.2s; }  /* pair-ok */
.mgx-sw.lit .mgx-sw-lamp { background: #ffd870; box-shadow: 0 0 14px #ffc840, inset 0 -3px 0 rgba(160,100,0,0.3); }  /* pair-ok */
.mgx-switch--lantern .mgx-sw-lamp { border-radius: 6px 6px 10px 10px; height: 30px; }
.mgx-switch--lantern .mgx-sw.lit .mgx-sw-lamp { background: #ff9a50; box-shadow: 0 0 16px #ff7a30; }  /* pair-ok */
.mgx-sw-tog { width: 12px; height: 20px; border-radius: 3px; background: #c8ccd0; transform: translateY(4px); transition: transform 0.12s; }  /* pair-ok */
.mgx-sw.lit .mgx-sw-tog { transform: translateY(-4px); }
.mgx-sw.flip { animation: mgx-beat 0.18s ease-out; }
.mgx-sw:focus-visible { outline: 3px solid #ffd870; outline-offset: 2px; }  /* pair-ok */
.mgx-rp { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 3px; width: min(300px, 100%); aspect-ratio: 1; margin: 0 auto; padding: 3px; background: var(--gf-border-strong, #b8b0a0); border-radius: 6px; }
.mgx-rp-piece { min-width: 44px; padding: 0; border: 0; overflow: hidden; border-radius: 2px; cursor: pointer; background: #111; }  /* pair-ok */
.mgx-rp-piece span { display: block; width: 100%; height: 100%; transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1); }
.mgx-rp-piece:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: -3px; }
.mgx-rp.whole { gap: 0; transition: gap 0.4s; }
.mgx-shadows { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.mgx-shadows-win { position: relative; width: min(400px, 100%); aspect-ratio: 16 / 9; overflow: hidden; border: 6px solid #5a4028; border-radius: 4px; background: linear-gradient(#e8dcc0, #d8c8a4); }  /* pair-ok: a lit paper screen */
.mgx-shadows-bars { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 3px), #5a4028 calc(25% - 3px) 25%), repeating-linear-gradient(0deg, transparent 0 calc(33.3% - 3px), #5a4028 calc(33.3% - 3px) 33.3%); }  /* pair-ok: the lattice */
.mgx-shadows-lane { position: absolute; inset: 0; }
.mgx-shadow { position: absolute; width: 16%; height: 64%; left: 0; background: radial-gradient(ellipse 30% 16% at 50% 14%, rgba(20,16,12,0.85) 98%, transparent), radial-gradient(ellipse 46% 50% at 50% 70%, rgba(20,16,12,0.8) 98%, transparent); filter: blur(2px); animation: mgx-pass var(--dur, 1.6s) linear both; }  /* pair-ok */
.mgx-shadows--crows .mgx-shadow { height: 18%; width: 10%; background: radial-gradient(ellipse 50% 40% at 50% 50%, rgba(20,16,12,0.85) 98%, transparent); }  /* pair-ok */
@keyframes mgx-pass { from { transform: translateX(calc(var(--dir, 1) * -120%)); left: calc(50% - var(--dir, 1) * 58%); } to { transform: translateX(calc(var(--dir, 1) * 20%)); left: calc(50% + var(--dir, 1) * 58%); } }
.mgx-shadows-ans .btn { min-width: 52px; font-size: 1.1em; }
.mgx-shadows-ans, .mgx-shadows .mgx-row { justify-content: center; }
.mgx-spot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mgx-spot-pic { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 4px; border: 2px solid var(--gf-border-strong, #b8b0a0); }
.mgx-spot-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mgx-spot-right { cursor: crosshair; touch-action: none; }
.mgx-spot-right:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: 2px; }
.mgx-spot-cur { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border: 2px dashed #fff; border-radius: 50%; pointer-events: none; mix-blend-mode: difference; }  /* pair-ok */
.mgx-spot-ring { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 3px solid #e84030; border-radius: 50%; pointer-events: none; animation: mgx-found 0.5s ease-out both; }  /* pair-ok */
@media (max-width: 480px) { .mgx-spot { grid-template-columns: 1fr; } }
.mgx-maze { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mgx-maze svg { width: min(300px, 100%); height: auto; border-radius: 6px; background: #14161c; touch-action: none; }  /* pair-ok */
.mgx-maze svg:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: 3px; }
.mgx-maze-walls { fill: none; stroke: #8a8070; stroke-width: 4; stroke-linecap: round; }  /* pair-ok */
.mgx-maze-exit { fill: rgba(120, 220, 160, 0.35); stroke: #78dca0; stroke-width: 2; }  /* pair-ok */
.mgx-maze-trail line { stroke: rgba(255, 210, 120, 0.35); stroke-width: 6; stroke-linecap: round; }  /* pair-ok */
.mgx-maze-light { fill: #ffd27a; filter: drop-shadow(0 0 8px #ffb840); transition: cx 0.12s, cy 0.12s; }  /* pair-ok */
.mgx-maze--bead .mgx-maze-light { fill: #c8d8e8; filter: none; }  /* pair-ok */
.mgx-maze-pad { display: grid; grid-template-columns: repeat(4, 52px); gap: 6px; }
.mgx-cipher { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mgx-cipher-disc { width: min(260px, 100%); height: auto; touch-action: none; cursor: grab; }
.mgx-cipher-disc:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: 3px; border-radius: 50%; }
.mgx-cipher-disc .o { fill: #e8dcc0; stroke: #6a5030; stroke-width: 3; }  /* pair-ok: paper discs */
.mgx-cipher-disc .i { fill: #c8a878; stroke: #6a5030; stroke-width: 2; }  /* pair-ok */
.mgx-cipher-disc text { font: 700 11px var(--gf-font); text-anchor: middle; dominant-baseline: middle; fill: #2a1e10; }  /* pair-ok */
.mgx-cipher-disc .mark { fill: #a8281c; }  /* pair-ok */
.mgx-cipher-inner { transform-origin: 130px 130px; transition: transform 0.18s ease-out; }
.mgx-cipher-coded, .mgx-cipher-read { margin: 0; font-size: 1.05em; letter-spacing: 0.15em; }
.mgx-cipher-read b { color: var(--gf-accent, #3a7a5a); }
.mgx-cipher-ctl { justify-content: center; }
.mgx-steady { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.mgx-steady-box { position: relative; width: min(420px, 100%); aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: radial-gradient(circle at 50% 60%, #2a2418, #0c0a08); cursor: none; touch-action: none; }  /* pair-ok: dark room */
.mgx-steady-box:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: 3px; }
.mgx-steady-ring { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 3px dashed rgba(255, 200, 120, 0.6); transition: border-color 0.2s, box-shadow 0.2s; }  /* pair-ok */
.mgx-steady-ring.in { border-style: solid; border-color: #ffd27a; box-shadow: 0 0 22px rgba(255, 190, 90, 0.6), inset 0 0 18px rgba(255, 190, 90, 0.35); }  /* pair-ok */
.mgx-steady-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #ffe2a0; box-shadow: 0 0 10px #ffb840; pointer-events: none; }  /* pair-ok: a flame */
.mgx-steady--lens .mgx-steady-dot { border-radius: 50%; transform: none; background: none; border: 2px solid #e8f0ff; box-shadow: none; }  /* pair-ok */
.mgx-pump { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mgx-pump-dial { width: min(300px, 100%); height: auto; }
.mgx-pump-dial path { fill: none; stroke-width: 14; }
.mgx-pump-dial .track { stroke: var(--gf-surface-2, #ece6d6); stroke-width: 16; }
.mgx-pump-dial .band { stroke: #4aa870; }  /* pair-ok */
.mgx-pump-dial .danger { stroke: #c83a28; }  /* pair-ok */
.mgx-pump-dial .needle { stroke: #2a2420; stroke-width: 4; stroke-linecap: round; transform-origin: 100px 100px; transition: transform 0.08s linear; }  /* pair-ok */
.mgx-pump-dial .hub { fill: #2a2420; }  /* pair-ok */
.mgx-pump-dial.good .band { filter: drop-shadow(0 0 4px #4aa870); }  /* pair-ok */
.mgx-pump-btn { min-height: 64px; min-width: 200px; font-size: 1.15em; touch-action: none; user-select: none; }
.mgx-pump-btn.push { animation: mgx-beat 0.16s ease-out; }
.mgx-order-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.mgx-order-list li { display: flex; gap: 6px; align-items: stretch; }
.mgx-order-list li.moved { animation: mgx-msg 0.25s ease-out; }
.mgx-order-step { flex: 1; min-height: 46px; display: flex; gap: 10px; align-items: center; text-align: left; padding: 6px 12px; border: 1px solid var(--gf-border-strong, #b8b0a0); border-radius: 6px; background: var(--gf-surface-2, #ece6d6); color: var(--gf-text); font: inherit; cursor: pointer; }
.mgx-order-step b { min-width: 1.4em; color: var(--gf-accent, #3a7a5a); }
.mgx-order-list li.picked .mgx-order-step { outline: 3px solid var(--gf-accent, #3a7a5a); }
.mgx-order-mv { display: flex; gap: 4px; }
.mgx-order-mv .btn { min-width: 44px; padding: 0 8px; }
.mgx-order .mgx-row { justify-content: center; margin-top: 10px; }
.mgx-compass { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mgx-compass-clue { margin: 0; padding: 8px 12px; border-left: 3px solid var(--gf-accent, #3a7a5a); background: var(--gf-surface-2, #ece6d6); color: var(--gf-text); border-radius: 0 6px 6px 0; align-self: stretch; }
.mgx-compass-dial { width: min(240px, 100%); height: auto; touch-action: none; cursor: grab; }
.mgx-compass-dial:focus-visible { outline: 3px solid var(--gf-accent, #3a7a5a); outline-offset: 3px; border-radius: 50%; }
.mgx-compass-dial .rim { fill: #f0e4c8; stroke: #6a5030; stroke-width: 4; }  /* pair-ok: a paper dial */
.mgx-compass-dial .ticks line { stroke: #6a5030; stroke-width: 1.4; }  /* pair-ok */
.mgx-compass-dial text { font: 700 12px var(--gf-font); text-anchor: middle; fill: #2a1e10; }  /* pair-ok */
.mgx-compass-dial text.n { fill: #a8281c; }  /* pair-ok */
.mgx-compass-needle { transform-origin: 100px 100px; transition: transform 0.15s ease-out; }
.mgx-compass-needle .tip { fill: #a8281c; } .mgx-compass-needle .tail { fill: #3a4048; } .mgx-compass-dial .hub { fill: #2a1e10; }  /* pair-ok */
.mgx-mirror { display: flex; justify-content: center; }
.mgx-mirror-box { position: relative; width: min(300px, 86%); aspect-ratio: 1; margin: 20px; border-radius: 4px; background: #101418; }  /* pair-ok: a dark room */
.mgx-mirror-box svg { position: absolute; inset: -6.6%; width: 113.3%; height: 113.3%; overflow: visible; pointer-events: none; }
.mgx-mirror-box .grid line { stroke: #2a323a; stroke-width: 1; }  /* pair-ok */
.mgx-beam { fill: none; stroke: #fff2b0; stroke-width: 4; stroke-linejoin: round; filter: drop-shadow(0 0 5px #ffd860); }  /* pair-ok: the light */
.mgx-mirror-goal { fill: #3a2a20; stroke: #e8a040; stroke-width: 3; transition: fill 0.3s; }  /* pair-ok */
.mgx-mirror-goal.hit { fill: #ffd860; filter: drop-shadow(0 0 10px #ffd860); }  /* pair-ok */
.mgx-mirror-src { fill: #fff2b0; }  /* pair-ok */
.mgx-mirror-m { position: absolute; width: 48px; height: 48px; margin: -24px 0 0 -24px; padding: 0; border: 2px solid #4a5868; border-radius: 6px; background: rgba(40, 52, 64, 0.85); cursor: pointer; z-index: 1; }  /* pair-ok */
.mgx-mirror-m i { position: absolute; left: 50%; top: 50%; width: 44px; height: 5px; margin: -2.5px 0 0 -22px; background: linear-gradient(90deg, #a8c8e8, #f0f8ff, #a8c8e8); border-radius: 2px; transform: rotate(-45deg); transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1); }  /* pair-ok: a mirror */
.mgx-mirror-m.back i { transform: rotate(45deg); }
.mgx-mirror-m:focus-visible { outline: 3px solid #ffd860; outline-offset: 2px; }  /* pair-ok */
.mgx-kana { display: flex; flex-direction: column; gap: 10px; }
.mgx-kana-boxes { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.mgx-kana-boxes span { width: 40px; height: 46px; display: flex; align-items: center; justify-content: center; border-bottom: 3px solid var(--gf-border-strong, #b8b0a0); font: 700 1.4em var(--gf-font); color: var(--gf-text); }
.mgx-kana-boxes span.on { animation: mgx-msg 0.2s ease-out; }
.mgx-kana-boxes.done span { border-color: var(--gf-accent, #3a7a5a); color: var(--gf-accent, #3a7a5a); }
.mgx-kana-tiles { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.mgx-kana-tile { width: 48px; height: 52px; border: 1px solid #b8a070; border-radius: 4px; background: linear-gradient(#f8f0dc, #e8dcc0); color: #2a1e10; font: 700 1.3em var(--gf-font); cursor: pointer; box-shadow: 0 2px 0 #b8a070; transition: transform 0.1s, opacity 0.15s; }  /* pair-ok: wooden tiles */
.mgx-kana-tile:disabled { opacity: 0.3; transform: translateY(2px); box-shadow: none; cursor: default; }
.mgx-kana .mgx-row { justify-content: center; }
.mgx-jugs { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.mgx-jugs-row { display: flex; gap: 30px; align-items: flex-end; }
.mgx-jug { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mgx-jug-glass { position: relative; width: 70px; height: calc(var(--cap, 3) * 26px); border: 3px solid #8aa0b0; border-top: 0; border-radius: 0 0 12px 12px; background: rgba(200, 220, 235, 0.15); overflow: hidden; }  /* pair-ok: glass */
.mgx-jug-water { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(#7ab8e0, #3a7aa8); transition: height 0.45s cubic-bezier(0.3, 1.2, 0.5, 1); }  /* pair-ok */
.mgx-jug-water::before { content: ""; position: absolute; left: 0; right: 0; top: -3px; height: 6px; background: rgba(255,255,255,0.4); border-radius: 50%; }  /* pair-ok */
.mgx-jug-v { font-size: 1.2em; } .mgx-jug small { color: var(--gf-text-dim); font-size: 0.8em; }
.mgx-jug.want .mgx-jug-glass { border-color: var(--gf-accent, #3a7a5a); box-shadow: 0 0 12px var(--gf-accent, #3a7a5a); }
.mgx-jugs-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: min(340px, 100%); }
.mgx-breath { --near: 0; position: relative; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.mgx-breath-sense, .mgx-breath-lung { position: relative; width: min(380px, 100%); height: 22px; border-radius: 11px; background: var(--gf-surface-2, #ece6d6); overflow: hidden; }
.mgx-breath-sense i, .mgx-breath-lung i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.mgx-breath-sense i { background: linear-gradient(90deg, #8a6a50, #c8504a); transition: background 0.2s; }  /* pair-ok */
.mgx-breath-sense i.close { background: linear-gradient(90deg, #a83a2a, #e82a1a); box-shadow: 0 0 10px #e82a1a; }  /* pair-ok */
.mgx-breath-lung i { background: linear-gradient(90deg, #4a88b8, #8ac8e8); }  /* pair-ok */
.mgx-breath-sense span, .mgx-breath-lung span { position: relative; z-index: 1; padding-left: 10px; font-size: 0.8em; line-height: 22px; color: #1a1410; mix-blend-mode: normal; }  /* pair-ok: on the light part of the bar */
.mgx-breath-eye { width: min(380px, 100%); aspect-ratio: 16 / 7; border-radius: 6px; background: linear-gradient(90deg, #0a0806 0 44%, transparent 44% 56%, #0a0806 56%), radial-gradient(ellipse at 50% 60%, rgba(200, 150, 120, calc(0.08 + var(--near) * 0.5)), #0c0a08 70%); position: relative; overflow: hidden; }  /* pair-ok: a gap between two doors */
.mgx-breath-eye::after { content: ""; position: absolute; left: 50%; top: 22%; width: 7%; height: 70%; margin-left: -3.5%; border-radius: 40% 40% 10% 10%; background: #050404; opacity: calc(var(--near) * 1.2); transform: translateX(calc((1 - var(--near)) * 60%)); }  /* pair-ok: it, passing the gap */
.mgx-breath.holding .mgx-breath-eye { filter: brightness(0.8); }
.mgx-breath-btn { min-height: 60px; min-width: 240px; touch-action: none; user-select: none; }
.mgx-breath.holding .mgx-breath-btn { transform: scale(0.97); box-shadow: inset 0 3px 8px rgba(0,0,0,0.35); }  /* pair-ok */
@media (prefers-reduced-motion: reduce) { .mgx-mark-pick.no { animation: none; } }

/* ---- mini game widgets (js/mg-widgets.js: from 撤去通知 / 浦川): the panel colours are the --gf-mg tokens ---- */
.mg-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 8px 0; }
.mg-drum { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 92px; }
.mg-drum small, .mg-knob small, .mg-key small, .mg-lever small, .mg-crank small, .mg-vs small { color: var(--gf-text-dim); font-size: 0.78em; text-align: center; }
.mg-flap { position: relative; width: 112px; height: 86px; background: #0a0b0c; color: #f0e8c8; border: 2px solid #3a3e40; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: ns-resize; touch-action: none; }
.mg-flap b { font: 700 1.25em var(--gf-font); color: #f0e8c8; z-index: 1; }
.mg-flap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: #000; }
.mg-flap .prev, .mg-flap .next { font-size: 0.72em; color: #a89f8a; }
.mg-flap.flip b { animation: flip 0.18s ease-out; }
@keyframes flip { 0% { transform: scaleY(0.2); } 100% { transform: scaleY(1); } }
/* the widgets' own small buttons (a game's panel styles them further; these keep them touchable everywhere) */
:where(.mg-row, .mg-wires, .mg-hooks) button { border: 1px solid var(--gf-mg-line, #2a5a3a); background: var(--gf-mg-btn, #12261a); color: var(--gf-mg-ink, #d8ffe4); border-radius: 6px; padding: 8px 10px; font: inherit; cursor: pointer; min-height: var(--gf-hit, 44px); }
:where(.mg-row) .mg-up, :where(.mg-row) .mg-dn { padding: 2px 18px; font-size: 0.8em; min-width: 50px; }
.mg-knob { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mg-k { position: relative; width: 150px; height: 150px; }
.mg-k .ticks .tick { position: absolute; transform: translate(-50%, -50%); font: 11px var(--gf-font-mono); color: var(--gf-text-dim); }
.mg-k .ticks .tick.on { color: var(--gf-goal); font-weight: 700; }
.mg-k .cap { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #5a5e60, #1a1c1e); border: 3px solid #2a2e30; box-shadow: 0 4px 10px #000; cursor: grab; touch-action: none; color: inherit; }  /* pair-ok */
.mg-k .cap i { position: absolute; left: 50%; top: 6px; width: 6px; height: 26px; margin-left: -3px; background: #e8e0c8; border-radius: 3px; color: inherit; }
.mg-kbtn { display: flex; gap: 6px; align-items: center; }
.mg-kbtn b { min-width: 3.4em; text-align: center; color: var(--gf-goal); }
.mg-key, .mg-lever, .mg-crank { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 120px; }
.mg-lock { width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, #2a2c2e 30%, #4a4e50 31%, #3a3e40 60%, #1a1c1e); display: flex; align-items: center; justify-content: center; color: inherit; }  /* pair-ok */
.mg-bow { width: 64px; height: 64px; border-radius: 10px; background: #8a7a50 center / cover; border: 3px solid #c8b878; cursor: grab; touch-action: none; transition: transform 0.08s; color: inherit; }  /* pair-ok */
.mg-key.done .mg-bow { border-color: var(--gf-ok); }
.mg-slot { position: relative; width: 46px; height: 130px; background: #0a0b0c; border: 2px solid #3a3e40; border-radius: 8px; color: inherit; }  /* pair-ok */
.mg-handle { position: absolute; left: -10px; right: -10px; height: 30px; background: linear-gradient(#d84a3a, #8a2a20); border-radius: 6px; cursor: grab; touch-action: none; box-shadow: 0 3px 6px #000; color: inherit; }  /* pair-ok */
.mg-lever.on .mg-handle { background: linear-gradient(#5ad07a, #2a7a3a); color: inherit; }  /* pair-ok */
.mg-lever.off { opacity: 0.55; }
.mg-state { font: 700 0.85em var(--gf-font-mono); color: var(--gf-goal); }
.mg-wheel { position: relative; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, #3a3e40 18%, #1a1c1e 19%, #2a2e30 70%, #111 71%); cursor: grab; touch-action: none; color: inherit; }  /* pair-ok */
.mg-arm { position: absolute; left: 50%; top: 50%; width: 10px; height: 62px; margin-left: -5px; transform-origin: 50% 0; background: #9a9ea2; border-radius: 5px; color: inherit; }  /* pair-ok */
.mg-arm i { position: absolute; left: -9px; bottom: -10px; width: 28px; height: 28px; border-radius: 50%; background: #6a4a2a; color: inherit; }  /* pair-ok */
.mg-prog { width: 130px; height: 6px; background: var(--gf-surface-2); border-radius: 3px; overflow: hidden; color: inherit; }  /* pair-ok */
.mg-prog i { display: block; height: 100%; width: 0; background: var(--gf-accent); color: inherit; }
.mg-crank.done .mg-prog i { background: var(--gf-ok); color: inherit; }
.mg-cards { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.mg-slots { display: flex; gap: 8px; }
.mg-slotbox { flex: 1; min-height: 96px; border: 2px dashed var(--gf-mg-line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 6px; color: var(--gf-text); }
.mg-slotbox small { color: var(--gf-text-dim); font-size: 0.78em; }
.mg-slotbox.hover { border-color: var(--gf-accent); background: var(--gf-accent-soft); color: inherit; }
.mg-tray { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; padding: 6px; background: var(--gf-code-bg); border-radius: 8px; color: var(--gf-code-text); }
.mg-card { background: #ece4cf; color: #1f1d1a; border-radius: 4px; padding: 8px 10px; font: 0.92em / 1.5 var(--gf-font-serif); cursor: grab; touch-action: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); user-select: none; position: relative; z-index: 1; max-width: 100%; }
.mg-card small { display: block; color: #5a4a30; font: 0.8em var(--gf-font); }
.mg-card.picked { outline: 3px solid var(--gf-accent); }
.mg-card.dragging { z-index: 10; opacity: 0.9; box-shadow: 0 10px 24px #000; }
.mg-card.ghost { position: fixed; }
.mg-card em { display: block; font: 700 0.75em var(--gf-font); font-style: normal; color: #6a3a10; }
.mg-hold { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mg-hb { position: relative; min-width: 120px; min-height: 48px; padding: 8px 12px; border-radius: 8px; touch-action: none; overflow: hidden; }
.mg-hbar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--gf-surface-2); color: inherit; }  /* pair-ok */
.mg-hbar i { display: block; height: 100%; width: 0; background: var(--gf-accent); color: inherit; }
.mg-hold.done .mg-hbar i { width: 100%; background: var(--gf-ok); color: inherit; }
.mg-vs { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mg-vtrack { position: relative; width: 22px; background: #0a0b0c; border: 2px solid #3a3e40; border-radius: 10px; touch-action: none; color: inherit; }  /* pair-ok */
.mg-vh { position: absolute; left: -26px; width: 70px; height: 30px; margin-bottom: -15px; background: linear-gradient(#5a7a9a, #2a4a6a); color: #fff; border-radius: 6px; cursor: ns-resize; touch-action: none; display: flex; align-items: center; justify-content: center; }
.mg-vh b { font: 700 0.8em var(--gf-font-mono); color: #fff; }
.mg-dial .cap i { height: 40px; top: 0; background: #e08a3a; color: inherit; }
/* a rocker switch */
.mg-rocker { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 104px; }
.mg-rocker small { color: var(--gf-mg-dim); font-size: 12px; }
.mg-rk { color: var(--gf-mg-ink); position: relative; display: flex; width: 120px; height: 44px; border-radius: 8px; background: var(--gf-mg-btn); border: 1px solid var(--gf-mg-line); overflow: hidden; touch-action: none; cursor: pointer; }
.mg-rk span { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; z-index: 1; }
.mg-rk i { color: var(--gf-mg-ink); position: absolute; top: 3px; bottom: 3px; width: calc(50% - 4px); left: 3px; border-radius: 6px; background: var(--gf-mg-line); transition: left 0.15s, background 0.15s; opacity: 0; }
.mg-rocker.a .mg-rk i { color: var(--gf-mg-ink); left: 3px; opacity: 1; background: #2a6a48; }
.mg-rocker.b .mg-rk i { color: var(--gf-mg-ink); left: calc(50% + 1px); opacity: 1; background: #8a5a18; }
/* wires */
.mg-wires { position: relative; display: grid; grid-template-columns: 1fr 1.1fr 1fr; margin: 8px 0; min-height: 210px; }
.mg-wsvg { width: 100%; height: 100%; pointer-events: none; position: absolute; inset: 0; z-index: 2; }
.mg-wl, .mg-wr { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; z-index: 1; }
.mg-wl { grid-column: 1; }
.mg-wr { grid-column: 3; }
.mg-wn { color: var(--gf-mg-ink); position: relative; background: var(--gf-mg-btn); border: 1px solid var(--gf-mg-line); border-radius: 8px; padding: 8px 10px; min-height: 44px; display: flex; flex-direction: column; justify-content: center; touch-action: none; cursor: pointer; }
.mg-wn small { color: var(--gf-mg-dim); font-size: 12px; }
.mg-wn.picked { border-color: var(--gf-mg-warn); }
.mg-wn.on { border-color: var(--gf-ok); }
.mg-wl .plug { color: var(--gf-mg-ink); position: absolute; right: -9px; top: 50%; margin-top: -9px; width: 18px; height: 18px; border-radius: 50%; background: #aaa; border: 2px solid #222; }
.mg-wr .plug { position: absolute; left: -9px; top: 50%; margin-top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #222; }
.mg-wr .mg-wn { padding-left: 16px; }
/* the mirror rod */
.mg-mirror { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 6px 0; }
.mg-mirror small { color: var(--gf-mg-dim); font-size: 12px; }
.mg-mrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
.mg-md { color: var(--gf-mg-ink); position: relative; width: 170px; height: 150px; touch-action: none; cursor: grab; background: var(--gf-mg-bg-2); border: 1px solid var(--gf-mg-line); border-radius: 8px; overflow: hidden; }
.mg-scale { color: var(--gf-mg-ink); position: absolute; left: 12%; bottom: 12%; width: 240px; height: 240px; margin: 0 0 -120px -120px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 270deg, rgba(160, 200, 220, 0.16) 270deg 360deg); }
.mg-scale::after { content: ""; position: absolute; left: 50%; top: 50%; width: 120px; height: 2px; background: #c03028; transform-origin: 0 50%; transform: rotate(-35deg); }
.mg-rod { color: var(--gf-mg-ink); position: absolute; left: 12%; bottom: 12%; width: 120px; height: 6px; margin-bottom: -3px; transform-origin: 0 50%; background: linear-gradient(90deg, #8a9aa4, #e4eef4); border-radius: 3px; }
.mg-rod i { color: var(--gf-mg-ink); position: absolute; right: -14px; top: -11px; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle, #f0f6fa, #8a9aa4); border: 2px solid #333; }
.mg-view { color: var(--gf-mg-ink); width: 240px; height: 150px; background: #000; border-radius: 50%; }
/* the valve wheel */
.mg-valve { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 150px; }
.mg-valve small { color: var(--gf-mg-dim); font-size: 12px; text-align: center; }
.mg-vw { position: relative; width: 132px; height: 132px; border-radius: 50%; border: 10px solid var(--vc); box-sizing: border-box; touch-action: none; cursor: grab; }
.mg-vw i { color: var(--gf-mg-ink); position: absolute; left: 50%; top: 50%; width: 112px; height: 8px; margin: -4px 0 0 -56px; background: var(--vc); border-radius: 4px; }
.mg-vw i:nth-child(2) { transform: rotate(60deg); }
.mg-vw i:nth-child(3) { transform: rotate(120deg); }
.mg-valve.done .mg-vw { opacity: 0.55; cursor: default; }
.mg-valve.done .mg-prog i { color: var(--gf-mg-ink); background: var(--gf-ok); }
/* the hooks of P08 */
.mg-hooks { margin: 6px auto; width: min(420px, 100%); }
.mg-hsvg { color: var(--gf-mg-ink); width: 100%; height: auto; background: var(--gf-mg-bg-2); border: 1px solid var(--gf-mg-line); border-radius: 8px; touch-action: none; display: block; }
.mg-hsvg .hatch { fill: #e8eef2; }
.mg-hsvg .rope { fill: none; stroke: #e0b828; stroke-width: 1.6; stroke-linejoin: round; }
.mg-hsvg .hook circle:first-child { fill: #1a2830; stroke: #8aa0ac; stroke-width: 0.8; }
.mg-hsvg .hook.on circle:first-child { stroke: #e0b828; stroke-width: 1.4; }
.mg-hsvg .bead { fill: #e0b828; }
.mg-hsvg .no { fill: #e0b828; font-size: 5px; font-weight: 700; }

/* 言葉の記録 (the say log tab): newest first, a speaker tag in the accent colour */
.gf-saylog-help { margin: 0 0 8px; color: var(--gf-text-dim); font-size: 0.85em; }
.gf-saylog ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gf-saylog li { padding: 8px 10px; border-radius: 6px; background: var(--gf-surface-2, rgba(255,255,255,0.04)); line-height: 1.7; }
.gf-saylog li:first-child { outline: 1px solid var(--gf-accent, #3a7a5a); }
.gf-saylog .who, .gf-saylog li > span > b:first-child { color: var(--gf-accent, #3a7a5a); margin-right: 0.5em; font-weight: 600; }   /* a game that tags the speaker with <b> (hikage) reads the same */
body.touch #say.on { pointer-events: auto; }   /* a tap on the thought band opens 言葉の記録 */
