/* =====================================================================================================
   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: #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: #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;
}

/* title: what is fun in this game */
.appeal {
  list-style: none;
  padding: 0;
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 640px;
  text-align: left;
}
.appeal li {
  background: rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  line-height: 1.5;
}
.appeal b {
  display: block;
  color: #2f5e46;
}
.appeal span {
  font-size: 0.85em;
  color: #4a5a52;
}
@media (max-width: 560px) {
  .appeal {
    grid-template-columns: minmax(0, 1fr);
  }
}

ul.caselist {
  list-style: none;
  padding: 0;
  margin: 4px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px;
}
ul.caselist li {
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}
ul.caselist li .dim {
  margin-left: auto;
  white-space: nowrap;
}

/* 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 #e2d8c0;
}
.hb-tab {
  font: inherit;
  border: none;
  background: #efe8d6;
  color: #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 #e2d8c0;
}
.hb-tab:hover {
  background: #f6f0e0;
}
.hb-tab.on {
  background: #fff;
  color: #2f5e46;
  font-weight: 700;
  border: 2px solid #e2d8c0;
  border-bottom-color: #fff;
}
.hb-tab .cnt {
  font-size: 0.75em;
  background: #e2d8c0;
  color: #5a5a4a;
  border-radius: 999px;
  padding: 0 7px;
}
.hb-tab.on .cnt {
  background: #2e8a56;
  color: #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: #2f5e46;
  letter-spacing: 0.06em;
  border-bottom: 2px solid #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: #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);
  }
}
