/* 帰署 — RETURN TO DESK: a calm office palette (off-white paper, navy ink, the tag colours of design 5.4) */
:root {
  --fs: 1;
  --ink: #1e2a3a;
  --paper: #f6f4ee;
  --line: #c9c6bc;
  --navy: #22406a;
  --dim: #6a7078;
  --g: #2f8a52; /* observed / record: green */
  --y: #c99a12; /* statement: yellow */
  --k: #8a8e94; /* unknown: grey */
  --r: #c0392b; /* hypothesis / contradiction: red */
  --b: #2a64a8;
  font-size: calc(16px * var(--fs));
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0a0c0e;
  font-family: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hidden {
  display: none !important;
}
.dim {
  color: var(--dim);
}
.small {
  font-size: 0.85em;
}
.ok {
  color: var(--g);
  font-weight: 700;
}
.warn {
  color: var(--r);
  font-weight: 700;
}
.warn.big {
  border: 2px solid var(--r);
  background: #fdf0ee;
  padding: 8px 12px;
  border-radius: 6px;
}
#fade {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s;
}
#fade.on {
  opacity: 1;
  transition: none;
}

/* ---- HUD ---- */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  color: #fff;
}
#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.12s;
}
#crosshair.on {
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  background: transparent;
  border: 2px solid #ffd65a;
}
#prompt {
  position: absolute;
  left: 50%;
  top: calc(50% + 22px);
  transform: translateX(-50%);
  background: rgba(10, 20, 30, 0.72);
  padding: 4px 12px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.95rem;
}
#prompt:empty,
#say:empty,
#objective:empty {
  display: none;
}
#objective {
  position: absolute;
  left: 12px;
  top: 12px;
  max-width: min(420px, 70vw);
  background: rgba(10, 20, 30, 0.66);
  border-left: 3px solid #ffd65a;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.obj-head {
  font-size: 0.78rem;
  color: #c8d0d8;
}
.obj-now.urgent {
  color: #ff9a8a;
  font-weight: 700;
}
.obj-count {
  font-size: 0.78rem;
  color: #c8d0d8;
}
#room {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  background: rgba(10, 20, 30, 0.6);
  padding: 3px 14px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.5s;
  font-size: 0.9rem;
}
#room.on {
  opacity: 1;
}
#say {
  position: absolute;
  left: 50%;
  bottom: 13%;
  transform: translateX(-50%);
  max-width: min(680px, 90vw);
  background: rgba(10, 20, 30, 0.78);
  padding: 10px 18px;
  border-radius: 6px;
  line-height: 1.7;
  opacity: 0;
  transition: opacity 0.4s;
}
#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, 80vw);
}
.toast {
  background: rgba(20, 40, 64, 0.88);
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 0.88rem;
  line-height: 1.5;
  transition: opacity 0.8s;
}
.toast.out {
  opacity: 0;
}
#debug {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font: 12px monospace;
  white-space: pre;
}

/* ---- touch ---- */
#touch {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#t-look {
  position: absolute;
  right: 0;
  top: 0;
  width: 62%;
  height: 100%;
  pointer-events: auto;
}
#t-stick {
  position: absolute;
  left: 22px;
  bottom: 22px;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  pointer-events: auto;
}
#t-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}
#t-buttons {
  position: absolute;
  right: 18px;
  bottom: 22px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  pointer-events: auto;
}
#t-buttons button,
#t-menu {
  color: #fff;
  background: rgba(10, 20, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font: 700 13px 'Zen Kaku Gothic New', sans-serif;
}
#t-buttons button.big {
  width: 82px;
  height: 82px;
  font-size: 16px;
  background: rgba(40, 70, 110, 0.7);
}
#t-buttons button.on {
  background: rgba(255, 214, 90, 0.5);
}
#t-menu {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 46px;
  height: 46px;
  pointer-events: auto;
  font-size: 20px;
}
@media (max-width: 760px) {
  #room {
    top: auto;
    bottom: 160px;
  }
  #say {
    bottom: 160px;
    font-size: 0.88rem;
  }
  #toasts {
    top: 70px;
  }
}

/* ---- title ---- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #24303c 0%, #0c1014 75%);
  overflow-y: auto;
  padding: 20px;
}
.title-box {
  max-width: 560px;
  width: 100%;
  color: #e8ecf0;
  text-align: center;
}
.kicker {
  letter-spacing: 0.3em;
  color: #9fb0c0;
  font-size: 0.85rem;
  margin: 0;
}
.title-box h1 {
  font-family: 'Zen Old Mincho', serif;
  font-size: 3.6rem;
  margin: 8px 0 18px;
  letter-spacing: 0.2em;
}
.title-box h1 span {
  display: block;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.4em;
  color: #ffd65a;
  margin-top: 4px;
}
.lead {
  line-height: 1.9;
  color: #c8d2dc;
}
.title-box button,
#shift-sel {
  font: 700 1.05rem 'Zen Kaku Gothic New', sans-serif;
  padding: 12px 26px;
  margin: 8px 6px;
  border-radius: 6px;
  border: 1px solid #8aa0b8;
  background: #1c2a3a;
  color: #fff;
  cursor: pointer;
}
.title-box button.primary,
#start:not(:disabled) {
  background: #2a5a9a;
  border-color: #5a8ac8;
}
.title-box button:disabled {
  opacity: 0.5;
}
#shift-sel {
  padding: 10px;
  font-weight: 400;
  max-width: 100%;
}
.hint {
  color: #9aa8b4;
  font-size: 0.85rem;
  line-height: 1.7;
}

/* ---- windows ---- */
.win-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  padding: 12px;
}
.win {
  background: var(--paper);
  width: min(720px, 100%);
  max-height: 100%;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.win.wide {
  width: min(1180px, 100%);
}
.win-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 10px 18px;
  background: var(--navy);
  color: #fff;
  border-radius: 8px 8px 0 0;
}
.win-title {
  font-weight: 700;
}
.win-x {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  font-size: 1.3rem;
  width: 40px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
}
.win-body {
  padding: 14px 18px 18px;
  overflow-y: auto;
  line-height: 1.6;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.win-body h4 {
  margin: 14px 0 6px;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
}
.btn {
  font: 700 0.95rem 'Zen Kaku Gothic New', sans-serif;
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid #8a96a4;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  margin: 4px 4px 4px 0;
}
.btn.primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn.small {
  padding: 5px 10px;
  font-size: 0.82rem;
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.list {
  padding-left: 0;
  list-style: none;
}
.list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.cid {
  font-family: ui-monospace, Consolas, monospace;
  color: var(--navy);
  font-weight: 700;
}
.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 1px 7px;
  border-radius: 10px;
  color: #fff;
  background: var(--k);
  margin-left: 4px;
  white-space: nowrap;
}
.badge.g {
  background: var(--g);
}
.badge.y {
  background: var(--y);
}
.badge.r {
  background: var(--r);
}
.badge.b {
  background: var(--b);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.tab {
  font: 0.88rem 'Zen Kaku Gothic New', sans-serif;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.tab.on {
  border-color: var(--navy);
  box-shadow: inset 0 -3px 0 var(--navy);
}
table.kv,
table.grid {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
table.kv th,
table.kv td,
table.grid th,
table.grid td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
table.kv th,
table.grid th {
  background: #e8e6de;
  white-space: nowrap;
}

/* memo */
.memo-page {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.memo-canvas {
  width: min(460px, 100%);
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transform: rotate(-0.6deg);
}
.memo-side {
  flex: 1;
  min-width: 220px;
}
.memo-mini {
  font-family: 'Zen Kurenaido', cursive;
  background: #f0f2f6;
  border-left: 3px solid #7a9ad0;
  padding: 6px 10px;
  font-size: 1rem;
  line-height: 1.5;
}

/* tags (design 5.4: green = confirmed source, yellow = statement, grey = unknown, red = guess) */
.chip {
  display: inline-block;
  font-size: 0.78rem;
  padding: 1px 7px;
  border-radius: 4px;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.chip.none {
  background: #bbb;
}
.t-obs.chip,
.tagbtn.t-obs.on {
  background: var(--g);
}
.t-rec.chip,
.tagbtn.t-rec.on {
  background: #2a7a8a;
}
.t-stmt.chip,
.tagbtn.t-stmt.on {
  background: var(--y);
}
.t-hyp.chip,
.tagbtn.t-hyp.on {
  background: var(--r);
}
.t-unk.chip,
.tagbtn.t-unk.on {
  background: var(--k);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 6px solid #ccc;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
}
.card.focus {
  outline: 2px solid #ffd65a;
}
.card.t-obs {
  border-left-color: var(--g);
  background: #f0f8f2;
}
.card.t-rec {
  border-left-color: #2a7a8a;
  background: #eef6f8;
}
.card.t-stmt {
  border-left-color: var(--y);
  background: #fdf8e6;
}
.card.t-hyp {
  border-left-color: var(--r);
  background: #fcefed;
}
.card.t-unk {
  border-left-color: var(--k);
  background: #f2f2f2;
}
.card-text {
  font-size: 1.02rem;
  margin-bottom: 8px;
}
.tagbtns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tagbtn {
  font: 0.82rem 'Zen Kaku Gothic New', sans-serif;
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 5px;
  cursor: pointer;
  min-height: 34px;
}
.tagbtn.on {
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}
.tagbtn .k {
  font-family: monospace;
  opacity: 0.6;
  margin-right: 3px;
}
.sort-head {
  margin-bottom: 4px;
}

/* PC */
.pc-head {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.pc-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 2.2fr;
  gap: 16px;
}
.pc-src {
  font-size: 0.9rem;
  background: #eceae2;
  border-radius: 6px;
  padding: 8px 10px;
  align-self: start;
}
.srcs {
  padding-left: 0;
  list-style: none;
  margin: 8px 0;
}
.srcs li {
  margin: 5px 0;
}
.timeline,
.needs {
  padding-left: 18px;
  margin: 4px 0;
}
.needs li.done {
  color: var(--g);
}
.fld {
  margin-bottom: 12px;
}
.fld-l {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.opts {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.opts.row {
  flex-direction: row;
  flex-wrap: wrap;
}
.opt {
  font: 0.95rem 'Zen Kaku Gothic New', sans-serif;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink);
  min-height: 40px;
}
.opt.small {
  font-size: 0.86rem;
  padding: 6px 10px;
}
.opt.on {
  border-color: var(--navy);
  background: #e6eef8;
  box-shadow: inset 4px 0 0 var(--navy);
  font-weight: 700;
}
.opt.locked {
  color: #9a9a9a;
  background: #f2f2f0;
}
.opt.em {
  border-color: var(--r);
  color: var(--r);
  font-weight: 700;
}
.lock {
  display: block;
  font-size: 0.75rem;
  color: var(--b);
  font-weight: 700;
}
.atts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.att {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}
.att-ctl {
  flex: 1;
}
.thumb {
  margin: 0;
  width: 200px;
  flex: none;
  cursor: zoom-in;
}
.thumb-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  background: #3a3a38;
}
.thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
  background: #555;
  transition: transform 0.2s;
}
.thumb figcaption {
  font-size: 0.78rem;
  line-height: 1.35;
}
.check {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  margin: 8px 0;
  font-size: 0.9rem;
}
.e-err {
  color: var(--r);
}
.e-warn {
  color: #9a6a00;
}
.e-ok {
  color: var(--g);
}
.pc-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.returned {
  background: #fcefed;
  border: 1px solid var(--r);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 0.92rem;
}
.lesson {
  background: #eef4ea;
  border-left: 3px solid var(--g);
  padding: 6px 10px;
  font-size: 0.92rem;
}
.rec {
  background: #eef2f6;
  border-left: 3px solid var(--b);
  padding: 6px 10px;
  margin: 4px 0;
  font-family: ui-monospace, Consolas, 'Zen Kaku Gothic New', monospace;
  font-size: 0.88rem;
}
.past {
  background: #f4f0e2;
  border: 1px dashed #b8a878;
  padding: 6px 10px;
  margin: 6px 0;
  font-size: 0.88rem;
}
.dev-row {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.dev-row.na {
  opacity: 0.65;
}
.scan-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}
.scan-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.scan-item .thumb {
  width: 220px;
}

/* submit / review */
.res {
  position: relative;
  border-radius: 6px;
  padding: 10px 12px 10px 100px;
  margin-bottom: 10px;
  min-height: 90px;
}
.ok-box {
  background: #eef6ef;
  border: 1px solid #a8d0b0;
}
.back-box {
  background: #fcefed;
  border: 1px solid #e0a8a0;
}
.stamp {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 70px;
  height: 70px;
  border: 3px solid #c0392b;
  color: #c0392b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 1.1rem 'Zen Old Mincho', serif;
  transform: rotate(-12deg);
}
.stamp:not(.red) {
  border-color: #b03030;
  color: #b03030;
}
.back-box .res {
  padding-left: 12px;
}

/* boss */
.talk {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
  min-height: 80px;
}
.line {
  margin: 6px 0;
}
.line.p {
  color: var(--dim);
  text-align: right;
}

/* D01 */
.d01s {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}
.d01 {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.d01.off {
  opacity: 0.5;
  text-decoration: line-through;
}
.d01 .box {
  width: 24px;
  height: 24px;
  border: 2px solid var(--navy);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: none;
}

/* steps / cases */
.steps {
  padding-left: 0;
  list-style: none;
}
.steps li {
  padding: 3px 0;
}
.steps li.done {
  color: var(--g);
}
.steps li.now {
  font-weight: 700;
  color: var(--navy);
}
b.r {
  color: var(--r);
}

/* summary */
.sum-acts {
  background: #eef4ea;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.92rem;
}
.sum-score {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.rank {
  font: 700 3.4rem 'Zen Old Mincho', serif;
  width: 90px;
  height: 90px;
  border: 4px solid currentColor;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
}
.rank.r-S {
  color: #b8860b;
}
.rank.r-C {
  color: var(--dim);
}
.total {
  font-size: 2.2rem;
  font-weight: 700;
}
.total small {
  font-size: 1rem;
  color: var(--dim);
}
.bars {
  flex: 1;
  min-width: 260px;
}
.bar {
  display: grid;
  grid-template-columns: 8em 1fr 4em;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  margin: 3px 0;
}
.bar-t {
  height: 10px;
  background: #ddd;
  border-radius: 5px;
  overflow: hidden;
}
.bar-t div {
  height: 100%;
  background: var(--navy);
}
.sum-case {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}
.ans {
  font-size: 0.9rem;
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
}
.ans > div {
  margin: 5px 0;
}
.menu-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.set {
  display: grid;
  grid-template-columns: 10em 1fr;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}
.set.chk {
  display: flex;
}

/* photo viewer */
.viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  cursor: zoom-out;
  overflow: hidden;
}
.viewer-in {
  max-width: 94vw;
  text-align: center;
  color: #e8ecf0;
}
.viewer img {
  max-width: 94vw;
  max-height: 76vh;
  border-radius: 4px;
  transition: scale 0.1s;
}
.viewer-meta {
  margin-top: 8px;
  font-size: 0.9rem;
}
.viewer .dim {
  color: #9aa8b4;
}

/* phones */
@media (max-width: 760px) {
  .pc-grid {
    grid-template-columns: 1fr;
  }
  .win-wrap {
    padding: 0;
  }
  .win {
    border-radius: 0;
    height: 100%;
  }
  .win-head {
    border-radius: 0;
  }
  .thumb {
    width: 130px;
  }
  .att {
    flex-direction: column;
  }
  .att .thumb {
    width: 100%;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .title-box h1 {
    font-size: 2.6rem;
  }
  #objective {
    max-width: 58vw;
    font-size: 0.8rem;
  }
  .res {
    padding-left: 12px;
    padding-top: 80px;
  }
  .bar {
    grid-template-columns: 7em 1fr 3.5em;
  }
}
@media (max-height: 500px) {
  .win-wrap {
    padding: 0;
  }
  .win {
    height: 100%;
    border-radius: 0;
  }
}

/* tutorial */
.tipbox {
  background: #fff8dc;
  border: 1px solid #e0c870;
  border-left: 5px solid #c99a12;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}
.tip-t {
  font-weight: 700;
  color: #7a5a00;
  margin-bottom: 2px;
}
.brief {
  font-size: 1rem;
  line-height: 1.8;
}
.tip-key {
  background: #e6eef8;
  border-left: 4px solid var(--navy);
  padding: 8px 12px;
}
.tip-table th {
  width: 5.5em;
  text-align: center !important;
  background: #f2f0ea !important;
}
.tip-steps li {
  margin: 4px 0;
}
.practice {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 0.92rem;
}
.practice .p-ok {
  color: var(--g);
  margin: 4px 0;
}
.practice .p-ng {
  color: var(--r);
  margin: 4px 0;
}

.boss-say {
  background: #fff;
  border-left: 4px solid var(--navy);
  padding: 8px 12px;
  margin: 6px 0 12px;
}

/* work board (HUD) */
.board {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.b-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  white-space: nowrap;
}
.b-row.b-done {
  opacity: 0.55;
}
.b-id {
  font-family: ui-monospace, Consolas, monospace;
  color: #ffd65a;
}
.b-title {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11em;
}
.b-pips {
  display: flex;
  gap: 2px;
}
.pip {
  font-style: normal;
  font-size: 0.66rem;
  width: 1.45em;
  height: 1.45em;
  line-height: 1.45em;
  text-align: center;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.45);
}
.pip.ok {
  background: #2f8a52;
  color: #fff;
}
.pip.doing {
  background: #c99a12;
  color: #fff;
}
.pip.back,
.pip.urgent {
  background: #c0392b;
  color: #fff;
}
.carry {
  color: #9fd0ff;
}
/* PC progress and the sticky action bar */
.pc-btns.sticky {
  position: sticky;
  bottom: -18px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 10px 0 12px;
  margin: 10px 0 -18px;
  align-items: center;
  z-index: 2;
}
.pc-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-right: auto;
  font-size: 0.82rem;
}
.pc-progress span {
  padding: 3px 8px;
  border-radius: 12px;
  background: #e6e4dc;
  color: var(--dim);
}
.pc-progress span.ok {
  background: #e2f2e6;
  color: var(--g);
  font-weight: 700;
}
/* acceptance */
.stamp.anim {
  animation: stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes stamp {
  from {
    transform: rotate(-12deg) scale(2.4);
    opacity: 0;
  }
  to {
    transform: rotate(-12deg) scale(1);
    opacity: 1;
  }
}
.traps {
  margin: 8px 0;
}
.traps-h {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--navy);
}
.trap {
  display: inline-block;
  font-size: 0.8rem;
  margin: 3px 4px 0 0;
  padding: 2px 8px;
  border-radius: 12px;
}
.trap.ok {
  background: #e2f2e6;
  color: var(--g);
}
.trap.ng {
  background: #fdf0ee;
  color: var(--r);
}
@media (max-width: 760px) {
  .b-title {
    display: none;
  }
}

/* ---- HUD card (always on screen) ---- */
#objective {
  background: none;
  border: none;
  padding: 0;
  max-width: none;
}
.hc {
  width: 290px;
  background: linear-gradient(180deg, rgba(18, 30, 46, 0.86), rgba(12, 20, 32, 0.82));
  border: 1px solid rgba(160, 190, 220, 0.22);
  border-radius: 10px;
  padding: 10px 12px 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  font-size: 0.86rem;
}
.hc-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.hc-shift {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #c8d6e4;
  font-size: 0.78rem;
}
.hc-count b {
  font-size: 1.15rem;
  color: #fff;
}
.hc-count {
  color: #9fb0c0;
  font-size: 0.8rem;
}
.hc-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  margin: 6px 0 8px;
  overflow: hidden;
}
.hc-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #3aa86a, #8ad0a0);
  transition: width 0.6s;
}
.hc-bar.big {
  height: 8px;
  background: #e2e0d8;
  border-radius: 4px;
  margin: 6px 0;
}
.hc-now {
  background: rgba(255, 214, 90, 0.1);
  border-left: 3px solid #ffd65a;
  border-radius: 4px;
  padding: 6px 8px;
}
.hc-now.urgent {
  background: rgba(220, 70, 60, 0.18);
  border-left-color: #ff7a6a;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    background: rgba(220, 70, 60, 0.32);
  }
}
.hc-label {
  font-size: 0.68rem;
  color: #ffd65a;
  letter-spacing: 0.1em;
}
.hc-now.urgent .hc-label {
  color: #ff9a8a;
}
.hc-text {
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}
.hc-where {
  font-size: 0.76rem;
  color: #ffd65a;
  margin-top: 2px;
}
.hc-carry {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #9fd0ff;
}
.hc .board {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 6px;
}
.hc-foot {
  text-align: right;
  font-size: 0.68rem;
  color: #7a8a9a;
  margin-top: 4px;
}

/* ---- the work board window (kanban) ---- */
.win-cases .win-body {
  background: #eceae3;
}
.kb-top {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  align-items: start;
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 14px;
}
.kb-num b {
  font-size: 2.2rem;
  color: var(--navy);
  line-height: 1;
}
.kb-num span {
  color: var(--dim);
  margin-left: 6px;
}
.kb-meta {
  font-size: 0.8rem;
  color: var(--dim);
}
.tl {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
}
.tl li {
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  color: var(--dim);
  padding-right: 14px;
  position: relative;
}
.tl li:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 3px;
  top: 50%;
  width: 8px;
  height: 1px;
  background: #c8c6be;
}
.tl-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #c8c6be;
  margin-right: 5px;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.tl-done .tl-dot {
  background: var(--g);
  border-color: var(--g);
  color: #fff;
}
.tl-done {
  color: var(--g) !important;
}
.tl-now .tl-dot {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(34, 64, 106, 0.18);
}
.tl-now {
  color: var(--navy) !important;
  font-weight: 700;
}
.tl-urgent .tl-dot {
  border-color: var(--r);
}
.tl-urgent {
  color: var(--r) !important;
}
.kb {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.kcol {
  background: #e2e0d8;
  border-radius: 10px;
  padding: 8px;
  min-height: 120px;
}
.kcol h4 {
  border: none !important;
  margin: 2px 4px 8px !important;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #4a5260 !important;
}
.kcol h4 b {
  background: #fff;
  border-radius: 10px;
  padding: 0 8px;
  font-size: 0.75rem;
}
.kcol-back h4 {
  color: var(--r) !important;
}
.kcol-done h4 {
  color: var(--g) !important;
}
.kc {
  background: #fff;
  border-radius: 8px;
  padding: 9px 10px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  border-top: 4px solid #8a96a4;
  font-size: 0.82rem;
}
.kc-urgent {
  box-shadow: 0 0 0 2px var(--r), 0 1px 2px rgba(0, 0, 0, 0.12);
}
.kc header {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}
.kc-id {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  color: var(--navy);
}
.kc-cat {
  font-size: 0.7rem;
  color: var(--dim);
}
.kc-flag {
  font-size: 0.68rem;
  background: var(--r);
  color: #fff;
  border-radius: 8px;
  padding: 0 6px;
}
.kc-flag.ok {
  background: var(--g);
}
.kc-flag.back {
  background: #b07a20;
}
.kc h5 {
  margin: 4px 0 2px;
  font-size: 0.95rem;
}
.kc-sum {
  margin: 0 0 6px;
  color: #5a6068;
  font-size: 0.76rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kc-stages {
  display: flex;
  gap: 3px;
  margin-bottom: 6px;
}
.st {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e2e0d8;
  position: relative;
}
.st i,
.st em {
  display: none;
}
.st-ok {
  background: var(--g);
}
.st-doing {
  background: var(--y);
}
.st-back,
.st-urgent {
  background: var(--r);
}
.kc-next {
  background: #f4f2ec;
  border-radius: 6px;
  padding: 5px 7px;
  line-height: 1.45;
}
.kc-next.done {
  background: #e2f2e6;
  color: var(--g);
  font-weight: 700;
  text-align: center;
}
.kc-where {
  display: block;
  color: #8a6a00;
  font-size: 0.74rem;
}
.kc-needs {
  margin-top: 4px;
}
.chip-need {
  display: inline-block;
  font-size: 0.68rem;
  background: #e6eef8;
  color: var(--b);
  border-radius: 8px;
  padding: 1px 6px;
  margin: 2px 3px 0 0;
}
.kc-empty {
  text-align: center;
  color: #a8a69e;
  padding: 18px 0;
}
.kb-empty {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
}
/* category colours on the card's top edge */
.kc.c1 { border-top-color: #2a64a8; }
.kc.c2 { border-top-color: #2a8a8a; }
.kc.c3 { border-top-color: #d07a2a; }
.kc.c4 { border-top-color: #8a6a4a; }
.kc.c5 { border-top-color: #6a4aa8; }
.kc.c6 { border-top-color: #c0392b; }
.kc.c7 { border-top-color: #b03a7a; }
.kc.c8 { border-top-color: #a8202a; }
.kc.c9 { border-top-color: #2f8a52; }
.kc.c10 { border-top-color: #4a5a6a; }
@media (max-width: 900px) {
  .kb {
    grid-template-columns: 1fr 1fr;
  }
  .kb-top {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .hc {
    width: 210px;
    font-size: 0.78rem;
  }
  .kb {
    grid-template-columns: 1fr;
  }
  .kc-empty {
    padding: 4px 0;
  }
  .kcol {
    min-height: 0;
  }
}

/* ==== rich UI pass ==================================================================== */
/* windows take the screen: the touch controls under them are hidden (they caught taps) */
body.win-open #touch {
  display: none;
}
.win-x {
  width: 46px;
  height: 40px;
  font-size: 1.5rem;
  line-height: 1;
  touch-action: manipulation;
}
.win-x:active {
  background: rgba(255, 255, 255, 0.2);
}
.win-head {
  position: sticky;
  top: 0;
  z-index: 3;
}
.viewer-x {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1.6rem;
}

/* ---- the printed form ---- */
.paper {
  background: #fdfcf8;
  background-image: linear-gradient(transparent 0, transparent);
  border: 1px solid #d8d4c6;
  box-shadow: 0 2px 0 #ecebe4, 0 4px 0 #e2e0d6, 0 10px 24px rgba(40, 30, 10, 0.18);
  border-radius: 3px;
  padding: 18px 20px 14px;
  font-family: 'Zen Old Mincho', 'Yu Mincho', serif;
  color: #1c2430;
  position: relative;
}
.pp-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  border-bottom: 3px double #3a4656;
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.pp-org {
  font-size: 0.78rem;
  color: #5a6470;
  font-family: 'Zen Kaku Gothic New', sans-serif;
}
.pp-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
}
.pp-no {
  text-align: right;
  font-size: 0.74rem;
  font-family: ui-monospace, Consolas, monospace;
  color: #5a6470;
}
.pp-meta {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-bottom: 10px;
  font-family: 'Zen Kaku Gothic New', sans-serif;
}
.pp-meta th,
.pp-meta td {
  border: 1px solid #b8b4a6;
  padding: 4px 8px;
  text-align: left;
}
.pp-meta th {
  background: #f0eee6;
  width: 4.5em;
  font-weight: 400;
  color: #4a5260;
}
.pp-rows {
  border-top: 1px solid #b8b4a6;
}
.pp-row {
  display: grid;
  grid-template-columns: 7.5em 1fr auto;
  border: 1px solid #b8b4a6;
  border-top: none;
  min-height: 48px;
  align-items: stretch;
}
.paper.edit .pp-row {
  cursor: pointer;
  transition: background 0.15s;
}
.paper.edit .pp-row:hover {
  background: #fbf6e2;
}
.pp-l {
  background: #f0eee6;
  border-right: 1px solid #b8b4a6;
  padding: 8px;
  font-size: 0.85rem;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  color: #3a4252;
  display: flex;
  align-items: center;
}
.pp-v {
  padding: 8px 12px;
  font-size: 1rem;
  line-height: 1.55;
  display: flex;
  align-items: center;
}
.pp-row.empty .pp-v {
  color: #a8a498;
}
.pp-ph {
  color: #a8a498;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 0.85rem;
}
.pp-caret {
  padding: 0 10px;
  display: flex;
  align-items: center;
  color: #8a96a4;
  font-size: 0.7rem;
}
.pp-row.active {
  background: #fff8dc;
  box-shadow: inset 4px 0 0 #c99a12;
}
.pp-row.mk-error {
  box-shadow: inset 4px 0 0 var(--r);
  background: #fdf0ee;
}
.pp-row.mk-warn {
  box-shadow: inset 4px 0 0 #c99a12;
}
.pp-row.noted {
  background: #fff3f0;
}
.pp-opts {
  border: 1px solid #b8b4a6;
  border-top: none;
  background: #f6f4ec;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: drop 0.18s ease-out;
}
@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.pp-opt {
  font: 0.95rem 'Zen Kaku Gothic New', sans-serif;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #cfcbbd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink);
  line-height: 1.5;
  touch-action: manipulation;
}
.pp-opt:hover {
  border-color: var(--navy);
}
.pp-opt.on {
  border-color: var(--navy);
  background: #e6eef8;
  box-shadow: inset 4px 0 0 var(--navy);
}
.pp-opt.locked {
  color: #9a9a9a;
  background: #efeee8;
}
.sticky {
  position: relative;
  margin: -2px 6px 6px 7.5em;
  background: #fff27a;
  color: #4a3a00;
  padding: 6px 10px 6px 12px;
  font: 0.85rem 'Zen Kurenaido', 'Zen Kaku Gothic New', sans-serif;
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.18);
  transform: rotate(-0.8deg);
  border-left: 3px solid #e0c000;
}
.sticky b {
  color: var(--r);
  margin-right: 6px;
  font-family: 'Zen Kaku Gothic New', sans-serif;
}
.pp-sec {
  margin: 12px 0 4px;
  font-size: 0.8rem;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  color: #4a5260;
  border-bottom: 1px solid #b8b4a6;
}
.pp-att {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 30px;
}
.pp-att-i {
  display: flex;
  gap: 8px;
  align-items: center;
  font: 0.78rem 'Zen Kaku Gothic New', sans-serif;
  background: #f4f2ea;
  border: 1px solid #ddd8c8;
  padding: 4px;
  border-radius: 3px;
  max-width: 330px;
}
.pp-att-i img {
  width: 72px;
  height: 46px;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.pp-src {
  color: #2a6a8a;
}
.pp-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 12px;
  gap: 10px;
}
.pp-note {
  font-size: 0.7rem;
  color: #8a8a80;
  font-family: 'Zen Kaku Gothic New', sans-serif;
}
.pp-stamps {
  display: flex;
}
.pp-st {
  width: 66px;
  border: 1px solid #8a8a80;
  text-align: center;
  font: 0.7rem 'Zen Kaku Gothic New', sans-serif;
}
.pp-st + .pp-st {
  border-left: none;
}
.pp-st > span {
  display: block;
  border-bottom: 1px solid #8a8a80;
  background: #f0eee6;
}
.pp-st-in {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hanko {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  font: 700 0.85rem 'Zen Old Mincho', serif;
  transform: rotate(-10deg);
  opacity: 0.88;
}
.hanko.red {
  color: #c4302a;
}
.hanko.blue {
  color: #2a4a8a;
  width: 40px;
  height: 40px;
  font-size: 0.7rem;
}
.hanko.anim {
  animation: stamp 0.45s 0.15s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

/* ---- the PC around the form ---- */
.pc-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 1.05rem;
}
.pc-step {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 8px;
  font-weight: 700;
  color: var(--navy);
}
.pc-step:first-child {
  margin-top: 0;
}
.pc-step .n {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.tpls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.tpl {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  touch-action: manipulation;
}
.tpl-id {
  font: 0.72rem ui-monospace, Consolas, monospace;
  color: var(--dim);
}
.tpl-n {
  font: 700 0.95rem 'Zen Old Mincho', serif;
  text-align: center;
}
.tpl.on {
  border-color: var(--navy);
  background: #e6eef8;
  box-shadow: 0 0 0 2px var(--navy);
}
.pc-src {
  align-self: start;
  position: sticky;
  top: 0;
}
.pc-src summary {
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  margin-bottom: 6px;
}
.pc-sub {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4a5260;
  margin: 8px 0 2px;
  letter-spacing: 0.08em;
}
.timeline {
  list-style: none;
  padding: 0 0 0 10px;
  border-left: 2px solid #c8c6be;
}
.timeline li {
  position: relative;
  margin: 4px 0;
  font-size: 0.82rem;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy);
}
.timeline i {
  font-style: normal;
  font-size: 0.7rem;
  background: #e2e6ee;
  color: var(--navy);
  border-radius: 3px;
  padding: 0 4px;
  margin-right: 4px;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--navy);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  border: none;
  background: #fff;
  padding: 8px 14px;
  font: 0.9rem 'Zen Kaku Gothic New', sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
.seg button + button {
  border-left: 1px solid var(--navy);
}
.seg button.on {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}
.att-q {
  font-size: 0.82rem;
  font-weight: 700;
  margin: 8px 0 4px;
}
.returned {
  border-left: 5px solid var(--r);
}

/* ---- review results ---- */
.review {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rv {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 12px;
  border-radius: 10px;
}
.rv.ok {
  background: #eef6ef;
}
.rv.back {
  background: #fbefec;
}
.rv-doc .paper {
  font-size: 0.9em;
}
.rv-h {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.big-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 4px solid #c4302a;
  color: #c4302a;
  font: 700 1.2rem 'Zen Old Mincho', serif;
  transform: rotate(-12deg);
  flex: none;
}
.big-stamp.red {
  border-color: #b8221c;
  color: #b8221c;
  border-radius: 8px;
  width: 92px;
  height: 52px;
  font-size: 1.1rem;
}
.big-stamp.anim {
  animation: stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.boss-line {
  background: #fff;
  border-left: 4px solid var(--navy);
  padding: 8px 10px;
  border-radius: 4px;
}
.all-done {
  text-align: center;
  font-size: 1.05rem;
  padding: 10px;
  background: #e2f2e6;
  border-radius: 8px;
}

/* ---- chief: bubbles ---- */
.talk {
  background: #eef0f2;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
}
.bub {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 88%;
}
.bub p {
  margin: 0;
  padding: 8px 12px;
  border-radius: 14px;
  line-height: 1.55;
}
.bub.b p {
  background: #fff;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.bub.p {
  align-self: flex-end;
}
.bub.p p {
  background: var(--navy);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2a3a52;
  color: #fff;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* ---- D01 ledger ---- */
.ledger {
  background: #fdfcf8;
  border: 1px solid #d8d4c6;
  box-shadow: 0 6px 16px rgba(40, 30, 10, 0.12);
  padding: 12px 14px;
  font-family: 'Zen Old Mincho', serif;
}
.ledger-h {
  display: flex;
  justify-content: space-between;
  border-bottom: 3px double #3a4656;
  padding-bottom: 4px;
}
.ledger .d01 {
  border: none;
  border-bottom: 1px solid #d8d4c6;
  border-radius: 0;
  background: transparent;
}
.d01-t {
  flex: 1;
}
.d01-s {
  font: 0.72rem 'Zen Kaku Gothic New', sans-serif;
  color: var(--dim);
}
.d01.off .d01-s {
  color: var(--r);
}

/* ---- end-of-shift report ---- */
.report {
  background: #fdfcf8;
  border: 1px solid #d8d4c6;
  box-shadow: 0 10px 24px rgba(40, 30, 10, 0.15);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.rp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px double #3a4656;
  padding-bottom: 8px;
}
.rp-title {
  font: 700 1.6rem 'Zen Old Mincho', serif;
  letter-spacing: 0.2em;
}
.rp-rank {
  width: 96px;
  height: 96px;
  border: 4px solid currentColor;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  transform: rotate(-8deg);
  animation: stamp 0.5s 0.2s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.rp-rank span {
  font: 700 2.4rem 'Zen Old Mincho', serif;
  line-height: 1;
}
.rp-rank small {
  font-size: 0.72rem;
}
.rp-rank.r-S {
  color: #b8860b;
}
.rp-rank.r-C {
  color: var(--dim);
}
.rp-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  margin: 10px 0;
}
.radar {
  width: 100%;
  max-width: 260px;
}
.radar .rg {
  fill: none;
  stroke: #c8c6be;
  stroke-width: 1;
}
.radar .rs {
  fill: rgba(34, 64, 106, 0.25);
  stroke: var(--navy);
  stroke-width: 2;
}
.radar text {
  font-size: 9px;
  fill: #3a4252;
}
.radar text.rv {
  font-weight: 700;
  fill: var(--navy);
}
.rp-act {
  font-size: 0.86rem;
  padding: 4px 0 4px 14px;
  border-bottom: 1px dashed #d8d4c6;
  position: relative;
}
.rp-act::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--g);
}
.rp-comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
}
.rp-comment p {
  margin: 0;
  background: #fff8dc;
  padding: 10px 12px;
  border-radius: 4px;
  font-family: 'Zen Kurenaido', serif;
  font-size: 1.05rem;
  flex: 1;
}
.sum-case {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.sc-h {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sc-score {
  margin-left: auto;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
}
.sc-score small {
  font-size: 0.7rem;
}

/* ---- the bag's contents ---- */
.envs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.env {
  background: #d8c49a;
  background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.25), transparent 40%);
  border-radius: 4px;
  padding: 10px 12px;
  box-shadow: 0 2px 5px rgba(60, 40, 0, 0.25);
  position: relative;
  color: #2a2010;
}
.env::before {
  content: '';
  position: absolute;
  top: 0;
  left: 40%;
  width: 20%;
  height: 6px;
  background: #b8a070;
  border-radius: 0 0 4px 4px;
}
.env-tag {
  display: flex;
  gap: 6px;
  align-items: center;
  background: #fdfcf8;
  padding: 2px 8px;
  border-radius: 3px;
  width: fit-content;
}
.env-cat {
  font-size: 0.72rem;
  color: var(--dim);
}
.env-t {
  display: block;
  margin: 6px 0 2px;
  font: 700 1rem 'Zen Old Mincho', serif;
}
.env p {
  margin: 0 0 6px;
  font-size: 0.82rem;
}
.env-ph {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.env-ph img {
  width: 58px;
  height: 40px;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transform: rotate(-2deg);
}
.env-ph img:nth-child(2) {
  transform: rotate(3deg);
}

/* ---- devices ---- */
.term {
  background: #0e1a14;
  color: #8ef0b0;
  font: 0.86rem ui-monospace, Consolas, 'Zen Kaku Gothic New', monospace;
  padding: 10px 12px;
  border-radius: 6px;
  margin-top: 6px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}
.term-h {
  color: #c8ffd8;
  border-bottom: 1px solid #2a4a38;
  margin-bottom: 4px;
}
.term .dim {
  color: #5a9a72;
}
.mapbox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 6px;
  align-items: start;
}
.map-img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.map-note {
  background: #fff;
  border-left: 4px solid #2f8a52;
  padding: 8px 10px;
  font-size: 0.88rem;
}
.map-note b {
  display: block;
  color: #2f8a52;
}
.lbl {
  width: min(340px, 100%);
  background: #fff;
  border: 1px solid #c8c6be;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  font-size: 0.86rem;
}
.lbl-h {
  font-weight: 700;
  border-bottom: 2px solid #1c2430;
}
.lbl-no {
  font: 700 1.1rem ui-monospace, Consolas, monospace;
  margin: 4px 0;
}
.lbl-bar {
  height: 28px;
  margin-top: 6px;
  background: repeating-linear-gradient(90deg, #1c2430 0 2px, transparent 2px 4px, #1c2430 4px 5px, transparent 5px 8px, #1c2430 8px 11px, transparent 11px 13px);
}
.dev-archive .past {
  background: #f2e8cc;
  border: 1px solid #c8b888;
  box-shadow: 0 2px 4px rgba(80, 60, 0, 0.15);
  font-family: 'Zen Old Mincho', serif;
}

/* ---- return panel ---- */
.panel {
  background: #10202a;
  color: #9fe0c0;
  border-radius: 10px;
  padding: 14px 16px;
  font-family: ui-monospace, Consolas, monospace;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.6);
}
.pn-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #1e3a44;
}
.pn-row span {
  color: #5a9a8a;
}
.pn-big {
  font-size: 1.8rem;
  color: #c8ffe8;
}
.pn-new {
  margin-top: 10px;
  background: #fff8dc;
  border-left: 4px solid #c99a12;
  padding: 8px 10px;
}
.pn-new b {
  display: block;
}

@media (max-width: 760px) {
  .rv {
    grid-template-columns: 1fr;
  }
  .rp-grid {
    grid-template-columns: 1fr;
  }
  .rp-chart {
    display: flex;
    justify-content: center;
  }
  .paper {
    padding: 12px 10px;
  }
  .pp-row {
    grid-template-columns: 5.5em 1fr auto;
  }
  .pp-title {
    font-size: 1.2rem;
    letter-spacing: 0.15em;
  }
  .pp-head {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .pp-no {
    text-align: center;
  }
  .sticky {
    margin-left: 6px;
  }
  .tpls {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  .tpl {
    padding: 6px 4px;
  }
  .tpl-n {
    font-size: 0.78rem;
  }
  .pc-btns.sticky .btn {
    padding: 8px 12px;
  }
  .pc-src {
    background: #eceae2;
    padding: 8px 10px;
    border-radius: 6px;
  }
  .mapbox {
    grid-template-columns: 1fr;
  }
  .pc-src {
    position: static;
  }
}

.report .bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 18px;
}
.bar em {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--dim);
  white-space: nowrap;
}
@media (max-width: 760px) {
  .report .bars {
    grid-template-columns: 1fr;
  }
}
