/* game-kit 6ee9a0c: 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, #6a7470);
}
* { 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-highlight, #fff4dc); border-color: #e8c47a; }
.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: #a05a10; }
#objective .more { color: var(--dim); font-size: 0.9em; }
#objective .hold { color: #7a5a9a; font-size: 0.9em; }
#say { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); 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: center; justify-content: center; background: var(--gf-scrim, rgba(40, 50, 45, 0.28)); pointer-events: auto; padding: 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: #06a04a; color: #fff; border-color: #06a04a; }
.share-buttons .share-ig { background: linear-gradient(45deg, #f2a43a, #d9406a, #7a46c8); 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.75em;
  background: var(--gf-border, #e2d8c0);
  color: var(--gf-text-dim, #5a5a4a);
  border-radius: 999px;
  padding: 0 7px;
}
.hb-tab.on .cnt {
  background: var(--gf-ok, #2e8a56);
  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: #a05a10; 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: #a05a10; }
.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: #a05a10; }
.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: #fff; 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: #fff; }
.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.75em; padding: 1px 8px; border-radius: 999px; background: #eee9dc; color: var(--dim); }
.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: #f6faf6; }
.pg-stage.done .pg-state { background: #cfe3d4; color: var(--ok); }
.pg-stage.later { background: #faf8f3; color: var(--dim); }
.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.7em; font-weight: 700; letter-spacing: 0.04em; color: #fff; background: var(--warn); 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-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-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: #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: #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); }
#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: #2a2410; color: var(--tm-amber); font-weight: 700; }
#mg .mg-help { margin: 8px 0; padding: 5px 10px; border-left: 3px solid var(--tm-amber); background: rgba(255, 204, 74, 0.1); color: #fff3c8; font-size: 14px; 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: #ff9a8a; }
#mg .mg-foot { font-size: 11px; 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: 11px; color: #a02a1e; 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: 0; right: 0; bottom: 40px; text-align: center; font-size: 13px; color: #9ad0aa; }
#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 #2a5a3a; color: #9ad0aa; font-size: 13px; }
#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: #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: 13px; color: #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: #12261a; color: #d8ffe4; cursor: pointer; font-size: 14px; 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 #4a7a5a; background: #12261a; color: #9ad0aa; font-size: 14px; cursor: pointer; }
#mg .ln-tray b { font-size: 22px; color: 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) ---- */
.jn-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.jn-chip { min-height: var(--gf-hit, 44px); padding: 0 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; font: inherit; }
.jn-chip.on { background: var(--accent); color: var(--gf-accent-ink, #fff); border-color: var(--accent); }
.jn-body { display: flex; flex-direction: column; gap: 4px; overflow: auto; max-height: 60vh; }
.jn-group h4 { margin: 10px 0 4px; color: var(--accent); }
.jn-row { display: flex; gap: 6px; align-items: stretch; margin: 3px 0; }
.jn-main { flex: 1; min-width: 0; min-height: 56px; display: flex; gap: 10px; align-items: center; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; cursor: pointer; color: var(--ink); font: inherit; }
.jn-th { flex: none; width: 64px; height: 44px; border-radius: 4px; background: var(--gf-surface-2, #ccc) center / cover no-repeat; }
.jn-th.jn-nopic { display: grid; place-items: center; background: var(--gf-surface-2, #ece6d6); color: var(--dim); font-weight: 700; }
.jn-tx { display: flex; flex-direction: column; min-width: 0; }
.jn-tx em { font-style: normal; font-size: 0.7em; color: var(--dim); }
.jn-tx small { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jn-star { flex: none; width: 48px; min-height: var(--gf-hit, 44px); border-radius: 8px; border: 1px solid var(--line); background: var(--paper); font-size: 1.3em; cursor: pointer; color: #9a8f70; }
.jn-star.on { color: #d49a12; background: var(--gf-highlight, #fff4d6); }
.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; }
@media (min-width: 900px) { .jn.jn-side { flex-direction: row; } .jn.jn-side .hb-tabs { flex-direction: column; } }

/* ---- 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 { opacity: 0.6; background: var(--gf-surface-2, #f1efe9); }
.pg-abils small { display: block; color: var(--dim); }
.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; text-overflow: ellipsis; white-space: nowrap; }
.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.65em; font-weight: 700; padding: 0 5px; border-radius: 8px; background: var(--warn); color: #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: 4px 8px; border-left: 3px solid var(--gf-accent, var(--accent2)); background: var(--gf-highlight, #fff7e6); font-size: 0.92em; }
.iv-why span { display: block; font-size: 0.78em; color: var(--gf-text-dim, var(--dim)); }
/* 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-border, #cfe1d6); border-left: 4px solid var(--gf-accent, #3a7a5a); border-radius: var(--gf-radius, 10px); background: var(--gf-surface-2, #eef5f1); color: var(--gf-text, var(--gf-heading, #2f5e46)); }
.iv-voice-l { display: block; font-size: 0.72em; letter-spacing: 0.12em; opacity: 0.7; }
.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-highlight, #fff4dc); border: 1px solid #e8c47a; }
.iv-tabs .hb-tab { min-height: var(--gf-hit, 44px); }
.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, #c0562b); --rn-new: var(--gf-danger, #d33); --rn-radius: var(--gf-radius-lg, 12px);
  position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; background: var(--gf-overlay, rgba(0, 0, 0, .55)); padding: 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(--rn-accent); }
.rn-date { color: var(--rn-muted); font-size: .85em; }
.rn-ttl { font-weight: 600; }
.rn-new { background: var(--rn-new); color: #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; 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 { 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%; 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; }
.ms-bg { fill: transparent; }
.ms-grid { stroke: var(--gf-map-grid, #eee); } .ms-grid5 { stroke: var(--gf-map-grid-2, #ccc); } .ms-ruler { fill: #888; font-size: 8px; }
.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; }
.ms-label { fill: var(--gf-text, #222); font-size: 10px; text-anchor: middle; pointer-events: none; }
.ms-label--small { font-size: 8px; } .ms-label--dim { fill: var(--gf-text-dim, #6a7470); } .ms-label--floor { text-anchor: start; font-size: 12px; font-weight: bold; }
.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-stairs-t { fill: var(--gf-map-door, #8a5a00); font-size: 8px; text-anchor: middle; pointer-events: none; }
.ms-station { fill: #c33; } .ms-station-t { fill: var(--gf-text, #222); font-size: 8px; } .ms-start { fill: #06c; font-size: 9px; }
.ms-pin { fill: var(--gf-accent, #e8a040); stroke: #fff; stroke-width: 1.5; } .ms-pin--item { fill: var(--gf-ok, #2e7a4a); }
.ms-pin-t { fill: var(--gf-text, #222); font-size: 9px; paint-order: stroke; stroke: #fff; stroke-width: 2.5px; stroke-linejoin: round; pointer-events: none; }
.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-legend { fill: var(--gf-text-dim, #555); font-size: 9px; }
.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)); }
.wm-layer[data-mode="large"] { align-items: center; }
.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], .tm-badge[hidden], .tm-dot[hidden] { display: none; }
.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; }
@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-danger, #c0502a); color: #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); } }

/* 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-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; 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 { position: sticky; top: 6px; z-index: 2; height: 0; text-align: center; pointer-events: none; }
.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: #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-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: #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: #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: #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: #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; }
.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; }
/*@end*/
