:root {
  --coral: #db6a41;
  --ink: #211d1d;
  --cream: #fff8f4;
  --yellow: #fcea8b;
  --line: #211d1d26;
  --muted: #78685e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #e7d9cd;
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}
button,
input,
a {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  min-height: 44px;
  border-radius: 9px;
  padding: 9px 13px;
}
button:hover {
  background: var(--yellow);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}
button[aria-pressed="true"],
button.active {
  background: var(--ink);
  color: var(--cream);
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 660px;
  overflow: hidden;
  background: radial-gradient(ellipse at 44% 35%, #fffdf9 0%, #fff8f4 44%, #edddcf 100%);
}
#stage {
  position: absolute;
  inset: 0 318px 0 0;
  touch-action: none;
}
#stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}
#labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.island-label {
  pointer-events: auto;
  font-size: 11px;
  padding: 3px 8px;
  min-height: 28px;
  border: 1px solid #211d1d35;
  border-radius: 5px;
  background: #fff8f4ed;
  box-shadow: 0 2px 0 #211d1d14;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.island-label strong {
  color: var(--coral);
  font:
    700 10px ui-monospace,
    monospace;
  margin-right: 5px;
}
.island-label.selected {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--coral);
}
.island-label.dim {
  opacity: 0.28;
}
.island-label.selected strong {
  color: var(--yellow);
}
.port-label {
  font-size: 9px;
  background: #fff8f4dd;
  border: 1px dashed #78685e;
  padding: 3px 6px;
  border-radius: 4px;
}
.brand {
  position: absolute;
  top: 28px;
  left: 32px;
  pointer-events: none;
  z-index: 2;
}
.eyebrow {
  font:
    700 10px ui-monospace,
    monospace;
  letter-spacing: 2px;
}
.brand .future {
  pointer-events: auto;
  text-decoration: none;
  font:
    900 clamp(24px, 3vw, 42px) / 0.95 Arial,
    sans-serif;
  letter-spacing: -2px;
  color: var(--coral);
}
.brand .future span {
  display: block;
}
.brand h1 {
  font-size: 19px;
  letter-spacing: 4px;
  margin-top: 12px;
}
.brand .candidate {
  font-size: 12px;
  margin-top: 8px;
}
.brand .candidate b {
  margin-right: 10px;
}
.hero-note {
  position: absolute;
  left: 32px;
  top: 190px;
  max-width: 180px;
  pointer-events: none;
}
.hero-note .number {
  font:
    italic 60px/0.95 Georgia,
    serif;
  color: var(--coral);
}
.hero-note h2 {
  font-size: 17px;
  line-height: 1.5;
  margin: 8px 0;
}
.hero-note p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.map-meta {
  position: absolute;
  left: 32px;
  bottom: 236px;
  font:
    10px/1.8 ui-monospace,
    monospace;
  color: var(--muted);
  pointer-events: none;
}
.toolbar {
  position: absolute;
  right: 338px;
  top: 28px;
  display: flex;
  gap: 7px;
  z-index: 5;
}
.toolbar button {
  background: #fff8f4e8;
  font-size: 12px;
}
.sidebar {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 42px;
  width: 318px;
  background: #fff8f4e8;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 7;
  backdrop-filter: blur(16px);
}
.side-head {
  padding: 29px 22px 16px;
}
.side-head .eyebrow {
  color: var(--coral);
  margin-bottom: 10px;
}
.side-head h2 {
  font-size: 24px;
  font-weight: 900;
}
.side-head p {
  font-size: 11px;
  color: var(--muted);
  margin: 9px 0 16px;
  line-height: 1.6;
}
.search {
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
  padding: 10px 12px;
  font-size: 13px;
}
.side-tabs {
  display: flex;
  gap: 5px;
  margin: 12px 0 0;
}
.side-tabs button {
  flex: 1;
  font-size: 12px;
  padding: 6px;
}
.tree {
  overflow: auto;
  padding: 0 15px 20px;
  scrollbar-width: thin;
}
.tree details {
  border-bottom: 1px solid var(--line);
}
.tree summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  padding: 8px;
}
.tree summary::-webkit-details-marker {
  display: none;
}
.tree .index {
  font:
    italic 22px Georgia,
    serif;
  color: var(--coral);
  width: 25px;
  flex: none;
}
.tree .item-name {
  font-size: 13px;
  font-weight: 700;
  flex: 1;
}
.tree .count {
  font:
    10px ui-monospace,
    monospace;
  color: var(--muted);
}
.tree details[open] summary {
  background: #fcea8b55;
  border-radius: 7px;
}
.tree .children {
  padding: 0 8px 10px 40px;
  display: grid;
  gap: 3px;
}
.tree .children button {
  font-size: 12px;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 7px 9px;
}
.tree .children button:hover {
  background: #fcea8b88;
}
.tree .island-open {
  font-weight: 700;
  color: var(--coral);
}
.flow-item {
  width: 100%;
  margin-bottom: 7px;
  text-align: left;
  font-size: 12px;
  line-height: 1.6;
}
.flow-item b {
  color: var(--coral);
  margin-right: 7px;
}
.card {
  position: absolute;
  left: 30px;
  top: 176px;
  bottom: 248px;
  width: 340px;
  background: #fff8f4f7;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 60px #53311b18;
  overflow: auto;
  z-index: 6;
  padding: 24px;
  backdrop-filter: blur(20px);
  scrollbar-width: thin;
}
.card[hidden] {
  display: none;
}
.card .close {
  position: absolute;
  right: 10px;
  top: 9px;
  width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 22px;
}
.card .eyebrow {
  color: var(--coral);
  margin-bottom: 15px;
  padding-right: 20px;
}
.card h2 {
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.card p,
.card li {
  font-size: 13px;
  line-height: 1.8;
}
.card ul {
  padding-left: 18px;
}
.chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.chip {
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
  padding: 4px 7px;
}
.card h3 {
  font-size: 10px;
  letter-spacing: 1px;
  margin: 22px 0 8px;
  color: var(--muted);
}
.card .phase {
  padding: 12px;
  border-left: 3px solid var(--coral);
  background: #f2e5dc;
  font-size: 12px;
  line-height: 1.8;
}
.card .sources a {
  display: flex;
  min-height: 44px;
  align-items: center;
  font-size: 12px;
  line-height: 1.6;
}
.card .small {
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
}
.card .quote {
  border-left: 2px solid var(--coral);
  padding: 8px 12px;
  margin: 12px 0;
}
.card-footer {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 12px;
}
.controls {
  position: absolute;
  left: 30px;
  right: 348px;
  bottom: 65px;
  z-index: 5;
  max-width: 930px;
  background: #fff8f4ee;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 19px;
  box-shadow: 0 8px 24px #5436200a;
  backdrop-filter: blur(12px);
}
.control-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
  margin-bottom: 10px;
}
.control-tabs button {
  min-height: 44px;
  border: 0;
  background: transparent;
  font-size: 12px;
  padding: 8px 13px;
}
.control-tabs button.active {
  background: var(--ink);
}
.control-tabs .guide {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}
.panel {
  display: none;
}
.panel.active {
  display: block;
}
.day-row {
  display: flex;
  gap: 13px;
  align-items: center;
}
.day-row output {
  font:
    22px ui-monospace,
    monospace;
  min-width: 70px;
}
.day-row input {
  width: 100%;
  accent-color: var(--coral);
  height: 44px;
}
.play {
  min-width: 44px;
  padding: 8px;
}
.ticks {
  display: flex;
  justify-content: space-between;
  margin-left: 125px;
  font:
    9px ui-monospace,
    monospace;
  color: var(--muted);
}
.control-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.7;
  min-height: 17px;
}
.term-buttons,
.heart-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.term-buttons button {
  flex: 1;
  white-space: nowrap;
  font-size: 11px;
  padding: 8px;
}
.heart-buttons button {
  width: 47px;
  font:
    700 18px Arial,
    sans-serif;
}
.heart-buttons .reset {
  width: auto;
  font-size: 12px;
}
.footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 12;
  background: var(--ink);
  color: var(--cream);
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  font-size: 9px;
  gap: 15px;
}
.footer span:last-child {
  color: var(--yellow);
}
.legend {
  position: absolute;
  right: 342px;
  bottom: 245px;
  font-size: 10px;
  line-height: 1.9;
  color: var(--muted);
  background: #fff8f4c9;
  border-radius: 8px;
  padding: 10px;
  pointer-events: none;
}
.legend b {
  color: var(--ink);
  font-weight: 500;
}
.legend i {
  display: inline-block;
  width: 20px;
  border-top: 2px solid var(--coral);
  vertical-align: middle;
  margin-right: 6px;
}
.legend i.dash {
  border-top-style: dashed;
}
.legend i.dot {
  border-top-style: dotted;
}
.mascot {
  position: absolute;
  right: 345px;
  bottom: 280px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
  pointer-events: none;
}
.mascot .face {
  background: #708f68;
  border: 2px solid #43533d;
  outline: 3px dotted #708f68;
  width: 30px;
  height: 28px;
  border-radius: 45% 50% 42% 44%;
  color: white;
  text-align: center;
  font: bold 15px/25px monospace;
  transform: rotate(-8deg);
}
.intro {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: #211d1d38;
  backdrop-filter: blur(5px);
}
.intro[hidden] {
  display: none;
}
.intro-box {
  width: min(440px, calc(100% - 36px));
  background: var(--cream);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 30px 100px #211d1d33;
}
.intro-box .eyebrow {
  color: var(--coral);
}
.intro-box h2 {
  font-size: 28px;
  line-height: 1.45;
  margin: 18px 0;
}
.intro-box p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.intro-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 25px;
  gap: 10px;
}
.intro-actions .next {
  background: var(--ink);
  color: var(--cream);
}
.tour-caption {
  display: none;
  position: absolute;
  bottom: 12%;
  left: 8%;
  right: 8%;
  text-align: center;
  pointer-events: none;
  z-index: 15;
}
.tour-caption .caption {
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 900;
  line-height: 1.5;
  letter-spacing: 2px;
}
.tour-caption .quote-text {
  font-size: clamp(17px, 2.3vw, 28px);
  line-height: 1.7;
  background: #fff8f4f2;
  padding: 20px;
  border-radius: 12px;
}
.tour-caption .quote-source {
  font-size: 11px;
  background: var(--yellow);
  display: inline-block;
  padding: 7px 12px;
  margin-top: 10px;
}
.tour-caption .tour-stage {
  font-size: 11px;
  margin-top: 10px;
}
.tour-controls {
  display: none;
  position: absolute;
  top: 28px;
  right: 22px;
  z-index: 20;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}
.tour-controls button {
  font-size: 12px;
}
.tour .sidebar,
.tour .toolbar,
.tour .hero-note,
.tour .map-meta,
.tour .controls,
.tour .legend,
.tour .mascot,
.tour .card {
  display: none;
}
.tour #stage {
  right: 0;
}
.tour .tour-caption {
  display: block;
}
.tour .tour-controls {
  display: flex;
}
.tour #stage canvas {
  cursor: none;
}
.tour .island-label {
  pointer-events: none;
}
.tour.capture .tour-controls {
  opacity: 0;
}
.tour.capture .tour-controls:focus-within,
.tour.capture .tour-controls:hover {
  opacity: 1;
}
.tour .brand {
  top: 38px;
}
.tour .brand h1 {
  font-size: 17px;
}
.tour .footer {
  font-size: 10px;
}
.loading {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: var(--cream);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 30px;
}
.loading h2 {
  font-size: 28px;
  color: var(--coral);
}
.loading p {
  font-size: 13px;
  line-height: 1.8;
  margin: 15px 0;
}
.loading[hidden] {
  display: none;
}
.mobile-toggle,
.mobile-close {
  display: none;
}
.sidebar-hidden .sidebar {
  display: none;
}
.sidebar-hidden #stage {
  right: 0;
}
.sidebar-hidden .toolbar {
  right: 24px;
}
.sidebar-hidden .controls {
  right: 30px;
}
.sidebar-hidden .legend,
.sidebar-hidden .mascot {
  right: 30px;
}
body.ratio {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  background: var(--ink);
}
body.ratio #app {
  width: min(100vw, 56.25dvh);
  height: min(100dvh, 177.777vw);
  min-height: 0;
}
body.ratio .brand {
  left: 6%;
  top: 4%;
}
body.ratio .brand .future {
  font-size: 30px;
}
body.ratio .brand h1 {
  font-size: 14px;
}
body.ratio .brand .candidate {
  font-size: 10px;
}
body.ratio .footer {
  font-size: 8px;
  padding: 8px 12px;
  flex-wrap: wrap;
  gap: 3px;
}
body.ratio .tour-controls {
  top: 2%;
  right: 3%;
  transform: scale(0.85);
  transform-origin: right top;
}
body.ratio .tour-caption {
  bottom: 15%;
  left: 6%;
  right: 6%;
}
body.ratio .tour-caption .caption {
  font-size: 24px;
}
body.ratio .tour-caption .quote-text {
  font-size: 17px;
  padding: 14px;
}
body.ratio .tour-caption .quote-source {
  font-size: 9px;
}
body.ratio .island-label {
  font-size: 9px;
  padding: 2px 5px;
  min-height: 22px;
}
body.ratio .island-label strong {
  font-size: 8px;
}
@media (max-width: 800px) {
  #app {
    min-height: 580px;
  }
  #stage {
    right: 0;
  }
  .brand {
    top: 21px;
    left: 19px;
  }
  .brand .future {
    font-size: 27px;
    letter-spacing: -1.5px;
  }
  .brand .future span {
    display: inline;
    margin-right: 4px;
  }
  .brand h1 {
    font-size: 15px;
    letter-spacing: 2px;
    margin-top: 8px;
  }
  .brand .candidate {
    font-size: 10px;
  }
  .hero-note {
    top: 117px;
    left: 20px;
    max-width: 150px;
  }
  .hero-note .number {
    font-size: 34px;
    float: left;
    margin-right: 8px;
  }
  .hero-note h2 {
    font-size: 11px;
    margin: 0;
    padding-top: 2px;
  }
  .hero-note p {
    font-size: 9px;
    clear: both;
    padding-top: 6px;
  }
  .toolbar {
    right: 15px;
    top: 20px;
    flex-direction: column;
    gap: 5px;
  }
  .toolbar button {
    font-size: 11px;
    min-width: 44px;
    padding: 7px;
  }
  .toolbar .wide {
    display: none;
  }
  .sidebar {
    width: 100%;
    top: 18%;
    bottom: 42px;
    border-radius: 18px 18px 0 0;
    transform: translateY(110%);
    transition: transform 0.25s;
    box-shadow: 0 -10px 50px #211d1d22;
  }
  .sidebar.mobile-open {
    transform: translateY(0);
  }
  .side-head {
    padding: 20px;
  }
  .side-head p {
    margin: 5px 0 10px;
  }
  .side-head h2 {
    font-size: 20px;
  }
  .mobile-close {
    display: block;
    position: absolute;
    right: 18px;
    top: 15px;
  }
  .mobile-toggle {
    display: block;
  }
  .controls {
    left: 12px;
    right: 12px;
    bottom: 63px;
    padding: 10px 12px;
  }
  .control-tabs {
    gap: 2px;
    margin-bottom: 6px;
    padding-bottom: 5px;
  }
  .control-tabs button {
    font-size: 11px;
    padding: 7px 10px;
  }
  .control-tabs .guide {
    display: none;
  }
  .day-row {
    gap: 6px;
  }
  .day-row output {
    font-size: 19px;
    min-width: 57px;
  }
  .ticks {
    margin-left: 107px;
  }
  .control-note {
    font-size: 9px;
  }
  .map-meta {
    left: 17px;
    bottom: 250px;
    font-size: 8px;
  }
  .map-meta .extra {
    display: none;
  }
  .legend {
    right: 14px;
    bottom: 247px;
    font-size: 8px;
    padding: 5px;
    line-height: 1.6;
  }
  .mascot {
    display: none;
  }
  .footer {
    padding: 7px 12px;
    font-size: 8px;
    gap: 3px;
    flex-wrap: wrap;
    min-height: 44px;
  }
  .island-label {
    font-size: 9px;
    min-height: 25px;
    padding: 3px 5px;
  }
  .island-label strong {
    font-size: 8px;
    margin-right: 3px;
  }
  .card {
    left: 12px;
    right: 12px;
    width: auto;
    top: auto;
    bottom: 61px;
    max-height: 56%;
    padding: 22px;
    z-index: 10;
  }
  .card h2 {
    font-size: 22px;
  }
  .term-buttons {
    gap: 4px;
  }
  .term-buttons button {
    font-size: 10px;
    padding: 6px;
  }
  .tour .brand .future {
    font-size: 26px;
  }
  .tour .brand h1 {
    font-size: 13px;
  }
  .tour-controls {
    top: 100px;
    right: 15px;
  }
  .tour-caption {
    bottom: 13%;
  }
  .tour-caption .caption {
    font-size: 25px;
  }
  .tour-caption .quote-text {
    font-size: 17px;
  }
  .sidebar-hidden .controls {
    right: 12px;
  }
  .sidebar-hidden .toolbar {
    right: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
#stage {
  bottom: 220px;
  isolation: isolate;
}
.tour #stage {
  bottom: 0;
}
.island-label {
  min-height: 44px !important;
  min-width: 44px;
}
@media (max-width: 800px) {
  #stage {
    bottom: 220px;
  }
}
.scene-note {
  padding: 12px;
  background: #f2e5dc;
  border-radius: 8px;
}
.scene-note small {
  color: var(--muted);
}
/* ---- second visual pass ---- */
.ghost-label{display:flex;flex-direction:column;align-items:center;gap:1px;font:700 11px/1.2 "Noto Sans TC",sans-serif;color:#a5442a;background:#fff8f4f0;border:1px dashed #db6a41;border-radius:8px;padding:3px 7px;white-space:nowrap;pointer-events:none}
.ghost-label small{font-weight:500;font-size:9px;color:#78685e}
.site-sign{display:flex;flex-direction:column;gap:1px;background:#fffdf9;border:2px solid #211d1d;border-top:6px solid #db6a41;border-radius:6px;padding:4px 8px;font:500 10px/1.3 "Noto Sans TC",sans-serif;box-shadow:0 4px 10px #211d1d22;pointer-events:none;white-space:nowrap}
.site-sign b{font-size:12px}

/* ===== W8: cards, HUD, dock, log (second visual pass) ===== */
.card{background:#fffdfaeb;border:1px solid #ffffff;border-radius:22px;box-shadow:0 1px 0 #ffffff inset,0 2px 6px #4a2a1414,0 22px 60px #4a2a1424;padding:20px 20px 18px;backdrop-filter:blur(22px) saturate(1.2);width:360px}
.card .close{right:8px;top:8px;border-radius:12px}
.card-head{display:flex;gap:12px;align-items:center;margin:0 0 12px;padding-right:34px}
.card-head h2{margin:2px 0 0!important;font-size:21px!important;line-height:1.3!important;font-weight:800}
.card-head .eyebrow{margin:0!important;font-size:9.5px;letter-spacing:1.6px}
.icon-tile{flex:0 0 52px;height:52px;border-radius:15px;display:grid;place-items:center;background:linear-gradient(150deg,#fff3e9,#f7dcc8);color:var(--coral);box-shadow:0 1px 0 #fff inset,0 3px 8px #db6a4124}
.icon-tile .ico{width:28px;height:28px}
.icon-tile.flow{background:linear-gradient(150deg,#e6f1f1,#cfe2e2);color:#2f6170;font:800 15px ui-monospace,monospace}
.icon-tile.role{background:linear-gradient(150deg,#eef4e7,#d9e7cd);color:#4e7a55;font:800 20px "Noto Sans TC",sans-serif}
.ico{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.ico.sm{width:15px;height:15px;flex:0 0 15px}
.card .lede{font-size:13.5px!important;line-height:1.7!important;color:#3d3431;margin:0 0 10px}
.pills{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 4px}
.pill{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:4px 10px;font-size:11px;font-weight:600;background:#f4ece4;color:#4b403b;border:1px solid #ecdccf}
.pill.heart i{width:7px;height:7px;border-radius:50%;background:var(--c)}
.pill.heart{color:color-mix(in srgb,var(--c) 70%,#000);background:color-mix(in srgb,var(--c) 10%,#fff);border-color:color-mix(in srgb,var(--c) 28%,#fff)}
.pill.soft{background:#fff;color:#78685e}
.pill.status{background:#211d1d;color:#fff8f4;border-color:#211d1d}
.pill.flow{background:#e6f1f1;color:#2f6170;border-color:#cfe2e2;font-family:ui-monospace,monospace}
.card h3{font-size:10px!important;letter-spacing:1.6px!important;color:#9a8679!important;margin:18px 0 8px!important;font-weight:700;text-transform:uppercase}
.stat-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:8px;margin:12px 0 2px}
.stat{background:#fff;border-radius:14px;padding:10px 11px 9px 12px;border:1px solid #f0e4da;box-shadow:inset 3px 0 0 var(--accent),0 2px 6px #4a2a140d;display:flex;flex-direction:column;gap:3px;min-width:0}
.stat b{font-size:20px;font-weight:800;color:#211d1d;font-variant-numeric:tabular-nums;line-height:1.15;word-break:keep-all}
.stat .lbl{font-size:10.5px;line-height:1.45;color:#78685e;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.rows{display:flex;flex-direction:column;gap:6px}
.row{display:grid;grid-template-columns:10px 1fr auto 12px;align-items:center;gap:9px;text-align:left;background:#fff;border:1px solid #f0e4da;border-radius:12px;padding:9px 11px;min-height:44px;font-size:13px}
.row:hover{background:#fff6ec;border-color:#f2c9b3}
.row .dot{width:8px;height:8px;border-radius:50%;background:var(--coral)}
.row .ph{font-size:10px;color:#9a8679;white-space:nowrap}
.row i{color:#c4b3a6;font-style:normal;font-size:16px}
.flow-chips{display:flex;flex-wrap:wrap;gap:6px}
.flow-chip{display:inline-flex;align-items:center;gap:7px;border-radius:999px;padding:6px 12px 6px 6px;min-height:36px;background:#fff;border:1px solid #e3d5ca;font-size:12px}
.flow-chip b{background:#e6f1f1;color:#2f6170;border-radius:999px;padding:2px 7px;font:700 11px ui-monospace,monospace}
.flow-chip i{font-style:normal;color:#b19f92}
.flow-chip:hover{background:#fff6ec;border-color:#db6a41}
.card ul.facts{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:6px}
.card ul.facts li{position:relative;padding:8px 10px 8px 26px;background:#fbf6f1;border-radius:10px;font-size:12.5px;line-height:1.65}
.card ul.facts li::before{content:"";position:absolute;left:11px;top:15px;width:6px;height:6px;border-radius:2px;background:var(--coral)}
.timeline{display:grid;grid-template-columns:repeat(5,1fr);gap:3px;margin-bottom:6px}
.timeline span{font-size:9.5px;text-align:center;padding:16px 2px 4px;position:relative;color:#9a8679;line-height:1.25}
.timeline span::before{content:"";position:absolute;left:0;right:0;top:4px;height:7px;border-radius:4px;background:#efe4da}
.timeline span.on{color:#a5442a;font-weight:700}
.timeline span.on::before{background:repeating-linear-gradient(135deg,#db6a41 0 6px,#e98a66 6px 12px)}
.timeline.unknown span::before{background:repeating-linear-gradient(135deg,#e6ddd5 0 5px,#f4eee8 5px 10px)}
.card .phase{border-radius:10px;border-left:3px solid var(--coral);background:#fbf3ec}
.scene-note{display:flex;gap:9px;align-items:flex-start;margin-top:14px;padding:10px 12px;background:#f3f6f0;border-radius:12px;font-size:11.5px;line-height:1.6;color:#4f5a4a}
.scene-note small{display:block;color:#7d8778;font-size:10px}
.route{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;margin:12px 0;background:#fbf6f1;border-radius:14px;padding:10px}
.route>div{display:flex;flex-direction:column;gap:5px}
.route>i{font-style:normal;color:#db6a41;font-size:18px}
.route .stop{display:flex;align-items:center;gap:6px;background:#fff;border-radius:9px;padding:5px 8px;font-size:11.5px;border:1px solid #f0e4da;color:#3d3431}
.route .stop .ico{color:var(--coral)}
.meter{height:9px;border-radius:6px;background:#efe4da;overflow:hidden}
.meter i{display:block;height:100%;background:linear-gradient(90deg,#3e7c8c,#7fb3bd);border-radius:6px}
.card .sources a{background:#fff;border:1px solid #f0e4da;border-radius:10px;padding:6px 10px;margin-bottom:6px;text-decoration:none}
.card .sources a:hover{border-color:#db6a41}
.card-footer{font-size:10px;color:#9a8679}

.hud{position:absolute;left:232px;right:calc(318px + 286px);top:24px;z-index:4;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none}
.status{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;pointer-events:auto}
.st{display:inline-flex;align-items:center;gap:6px;background:#fffdfae6;border:1px solid #fff;border-radius:999px;padding:5px 11px;font-size:11px;color:#6a5d56;box-shadow:0 2px 8px #4a2a1414;backdrop-filter:blur(10px)}
.st i{width:7px;height:7px;border-radius:50%;background:var(--c)}
.st b{font-size:13px;color:#211d1d;font-variant-numeric:tabular-nums}
.st.time b{font-family:ui-monospace,monospace}
.toggles{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;pointer-events:auto}
.toggles .seg{display:flex;background:#fffdfae6;border:1px solid #fff;border-radius:999px;padding:3px;box-shadow:0 2px 8px #4a2a1414}
.toggles .seg button{min-height:36px;width:38px;padding:0;border:0;border-radius:999px;background:transparent;display:grid;place-items:center;color:#8a7a70}
.toggles .seg button[aria-pressed=true]{background:#fff1d6;color:#c06a1b;box-shadow:0 1px 3px #4a2a1420}
.toggles svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.toggles .tg{display:inline-flex;align-items:center;gap:6px;min-height:42px;padding:6px 12px;border-radius:999px;background:#fffdfae6;border:1px solid #fff;font-size:12px;color:#5d514b;box-shadow:0 2px 8px #4a2a1414}
.toggles .tg[aria-pressed=true]{background:#211d1d;color:#fff8f4;border-color:#211d1d}
.toggles .tg:hover{background:#fff1d6}
.toggles .tg[aria-pressed=true]:hover{background:#3a3332}
.dock{position:absolute;right:calc(318px + 14px);top:96px;z-index:4;display:flex;flex-direction:column;gap:5px;background:#fffdfad9;border:1px solid #fff;border-radius:20px;padding:6px;box-shadow:0 6px 20px #4a2a141f;backdrop-filter:blur(12px)}
.dock-btn{position:relative;width:38px;height:36px;min-height:36px;padding:0;border:0;border-radius:12px;background:transparent;color:#a5442a;display:grid;place-items:center}
.dock-btn .ico{width:20px;height:20px}
.dock-btn:hover,.dock-btn:focus-visible{background:#fff1e6}
.dock-btn .tip{position:absolute;right:46px;top:50%;transform:translateY(-50%);white-space:nowrap;background:#211d1d;color:#fff8f4;font-size:11px;padding:4px 8px;border-radius:7px;opacity:0;pointer-events:none;transition:opacity .15s}
.dock-btn:hover .tip,.dock-btn:focus-visible .tip{opacity:1}
.mascot{right:calc(318px + 70px)!important}
.log{position:absolute;right:calc(318px + 66px);top:96px;bottom:250px;width:330px;z-index:5;background:#fffdfaf0;border:1px solid #fff;border-radius:20px;box-shadow:0 20px 50px #4a2a1426;backdrop-filter:blur(18px);display:none;flex-direction:column;padding:14px 14px 10px}
.log.open{display:flex}
.log-head{display:flex;justify-content:space-between;align-items:flex-start}
.log-head .eyebrow{color:var(--coral);font-size:9px}
.log-head h3{font-size:15px;margin-top:2px}
.log-head button{border:0;background:transparent;font-size:20px;width:44px;padding:0}
.log-filters{display:flex;gap:8px;align-items:center;margin:8px 0}
.log-filters .live{display:inline-flex;align-items:center;gap:5px;font:700 10px ui-monospace,monospace;color:#3d7a52}
.log-filters .live i{width:7px;height:7px;border-radius:50%;background:#5ebd7a;box-shadow:0 0 0 3px #5ebd7a33}
.log-filters select{flex:1;min-height:36px;border-radius:10px;border:1px solid #e3d5ca;background:#fff;font-size:12px;padding:0 8px}
#log-list{list-style:none;margin:0;padding:0;overflow:auto;flex:1;display:flex;flex-direction:column;gap:4px}
#log-list li{display:grid;grid-template-columns:44px 1fr;gap:8px;align-items:start;font-size:11.5px;line-height:1.5;padding:6px 4px;border-bottom:1px dashed #efe4da}
.lp{display:inline-block;text-align:center;border-radius:999px;padding:2px 0;font-size:10px;font-weight:700}
.lp.depart{background:#e6f1f1;color:#2f6170}.lp.arrive{background:#fff1d6;color:#7f520a}.lp.handoff{background:#f6e3ec;color:#9a3a63}
.lt b{font-family:ui-monospace,monospace;color:#db6a41}
.log-note{font-size:9.5px;color:#9a8679;line-height:1.5;margin-top:6px}
.name-tag{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;background:#fffdfaf2;border:1px solid #fff;border-radius:999px;padding:2px 8px 2px 3px;font-size:10px;min-height:22px;box-shadow:0 2px 6px #4a2a1424;color:#3d3431;pointer-events:auto}
.name-tag i{font-style:normal;width:16px;height:16px;border-radius:50%;background:#eef4e7;display:grid;place-items:center;font-size:9px;color:#4e7a55}
.name-tag b{font:700 9px ui-monospace,monospace;color:#2f6170;background:#e6f1f1;border-radius:999px;padding:1px 5px}
.name-tag.ambient{opacity:.85}
.island-label{border-radius:999px!important;background:#fffdfaf2!important;border:1px solid #fff!important;box-shadow:0 3px 10px #4a2a1424!important;padding:4px 11px!important;font-weight:600}
.island-label.selected{background:#211d1d!important;color:#fff8f4!important}
.debug .hud,.debug .dock,.debug .log,.debug .card,.debug .controls,.debug .sidebar,.debug .toolbar,.debug .brand,.debug .hero-note,.debug .map-meta,.debug .mascot,.debug .footer,.debug #labels,.debug .intro{display:none!important}
.debug #stage{inset:0!important}
.debug #app{background:transparent!important}
.tour .hud,.tour .dock,.tour .log{display:none}
@media (max-width:1680px){.toggles .tg span{display:none}.toggles .tg{padding:0;width:42px;justify-content:center}}
.toggles .tg{position:relative}
.toggles .tg::after,.toggles .seg button::after{content:attr(title);position:absolute;top:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#211d1d;color:#fff8f4;font-size:11px;padding:3px 8px;border-radius:6px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s}
.toggles .tg:hover::after,.toggles .tg:focus-visible::after,.toggles .seg button:hover::after{opacity:1}
.toggles .seg button{position:relative}
@media (max-width:800px){
.hud{left:12px;right:64px;top:auto;bottom:228px;align-items:flex-start}
.status .st:not(.time){display:none}
.toggles{justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;max-width:100%}
.toggles .tg span{display:none}
.dock{right:auto;left:0;top:auto;bottom:180px;flex-direction:row;overflow-x:auto;max-width:100vw;border-radius:0;width:100%;display:none}
.log{left:10px;right:10px;width:auto;top:90px;bottom:240px}
.card{width:auto;border-radius:22px 22px 0 0}
.mascot{display:none}
}

/* night legibility for text that sits on the 3D canvas */

body.night .brand,body.night .hero-note,body.night .map-meta{background:#fffaf5e6;border-radius:16px;padding:10px 12px;box-shadow:0 6px 20px #0003;margin-left:-12px}
body.night .hero-note{top:200px}

@media (max-width:800px){
.island-label{min-height:30px!important;min-width:30px;font-size:10px!important;padding:2px 8px!important}
.hero-note,.map-meta{display:none}

.hud{bottom:224px}
}

#labels.compact .island-label{font-size:10.5px;padding:2px 9px!important;min-height:26px!important;box-shadow:0 2px 6px #4a2a141f!important}
#labels.compact .island-label strong{font-size:9px}

.icon-tile.thumb{flex:0 0 72px;height:72px;border-radius:18px;padding:0;overflow:visible;position:relative;background:#f4ece4}
.icon-tile.thumb img{width:72px;height:72px;border-radius:18px;object-fit:cover;display:block;box-shadow:0 0 0 2px #fff,0 4px 12px #4a2a1426}
.icon-tile .badge-ico{position:absolute;right:-6px;bottom:-6px;width:26px;height:26px;border-radius:9px;background:#fff;display:grid;place-items:center;color:var(--coral);box-shadow:0 2px 6px #4a2a1426}

/* ---- iteration 12: legibility & declutter ---- */
.control-tabs .status{margin-left:auto;display:flex;gap:5px;flex-wrap:nowrap;justify-content:flex-end;pointer-events:auto}
.control-tabs .st{box-shadow:none;border:1px solid #efe2d6;background:#fff;padding:4px 9px;font-size:10.5px}
.control-tabs .st b{font-size:12px}
.hud{top:22px;right:calc(318px + 280px)}
.brand{background:#fffaf5d9;border-radius:18px;padding:12px 14px 10px;margin-left:-14px;margin-top:-10px;box-shadow:0 6px 20px #4a2a141a;backdrop-filter:blur(10px)}
.hero-note{background:#fffaf5d9;border-radius:16px;padding:10px 12px;margin-left:-12px;box-shadow:0 6px 20px #4a2a141a;backdrop-filter:blur(10px)}
.map-meta{background:#fffaf5c7;border-radius:12px;padding:6px 10px;margin-left:-10px}
body.card-open .hero-note,body.card-open .map-meta{display:none}
.dock{display:none}
.sidebar-hidden .dock{display:flex}
.tour-caption .caption{background:#fffaf5ee;border-radius:16px;padding:10px 18px;display:inline-block;box-shadow:0 8px 24px #4a2a1426}
.tour-caption .tour-stage{background:#fffaf5ee;display:inline-block;border-radius:999px;padding:4px 12px}
.log-filters select{min-width:0;max-width:100%}
.log-filters{min-width:0}
.row .ph{white-space:normal;text-align:right;max-width:120px;line-height:1.3}
.flow-chip span{white-space:normal}
.site-board{display:none}
@media (max-width:1300px){.control-tabs .st:not(.time){display:none}}
@media (max-width:800px){
.control-tabs .status{display:none}
.toggles{max-width:calc(100vw - 80px);overflow-x:auto;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,#000 85%,transparent)}
body.card-open .brand{display:none}
.brand{padding:8px 10px;margin:0}
}
.doing{display:flex;align-items:center;gap:8px;background:#eef4e7;border-radius:10px;padding:7px 10px;font-size:12px!important;color:#3d5a41;margin-top:10px}
.doing i{width:8px;height:8px;border-radius:50%;background:#5ebd7a;box-shadow:0 0 0 3px #5ebd7a33}

/* iteration 13: full-height canvas behind translucent panels */
#stage{bottom:0!important}
.controls{background:#fffaf5e8!important;backdrop-filter:blur(14px)}
@media (max-width:800px){
#stage{bottom:0!important}
.hud{top:auto;bottom:226px;left:10px;right:10px}
}
.route-tag{font:700 11px "Noto Sans TC",sans-serif;background:#fffaf5f2;border:1px solid #fff;border-left:4px solid #3e7c8c;border-radius:8px;padding:3px 8px;box-shadow:0 3px 8px #4a2a1424;pointer-events:none;white-space:nowrap}

.log-tabs{display:flex;gap:4px;background:#f4ece4;border-radius:12px;padding:3px;margin:8px 0 4px}
.log-tabs button{flex:1;min-height:34px;border:0;border-radius:9px;background:transparent;font-size:12px;color:#78685e;padding:0}
.log-tabs button[aria-selected=true]{background:#fff;color:#211d1d;box-shadow:0 1px 3px #4a2a1420;font-weight:700}
#log-body{display:flex;flex-direction:column;min-height:0;flex:1}
#log-body[hidden],.overview-panel[hidden]{display:none}
.overview-panel{overflow:auto;flex:1;padding-right:2px}
.overview-panel h4{font-size:10px;letter-spacing:1.6px;color:#9a8679;margin:14px 0 6px}
.stat-row.four{grid-template-columns:repeat(2,1fr)}
.heart-bars{display:flex;flex-direction:column;gap:6px}
.heart-bars>div{display:grid;grid-template-columns:52px 1fr 20px;align-items:center;gap:8px}
.heart-bars .bar{display:block;height:8px;background:#efe4da;border-radius:5px;overflow:hidden}
.heart-bars .bar b{display:block;height:100%;border-radius:5px}
.heart-bars em{font-style:normal;font-size:12px;font-weight:700;text-align:right}
.mini-list{display:grid;grid-template-columns:1fr 1fr;gap:5px}
.mini-list button{display:grid;grid-template-columns:16px 1fr auto;gap:6px;align-items:center;min-height:34px;padding:4px 8px;border-radius:9px;font-size:11.5px;text-align:left;background:#fff;border:1px solid #f0e4da}
.mini-list button .ico{color:var(--coral)}
.mini-list em{font-style:normal;font-weight:700;color:#78685e}
#log-list li .lt time{font:600 10px ui-monospace,monospace;color:#76645a;margin-right:6px}
#log-list li .lt .ico{color:var(--coral);vertical-align:-3px;margin-right:4px}
body.interacted .mascot{display:none}
.mascot{background:#fffaf5e6;border-radius:999px;padding:4px 10px 4px 4px;box-shadow:0 3px 10px #4a2a141f}
.pill.soft{white-space:normal}
.row .ph{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-width:130px;font-size:9.5px}
.pills .pill.soft{max-width:100%;line-height:1.4}
.name-tag .carry{font-size:9.5px;color:#a5442a;border-left:1px solid #efe2d6;padding-left:5px}
body.card-open .mascot,body.flows-on .mascot{display:none}
.tour-controls #tour-time{background:#fffaf5ee;border-radius:999px;padding:4px 10px}
@media (max-width:800px){.toggles{flex-wrap:wrap;max-width:none;overflow:visible;-webkit-mask-image:none}.toggles .tg,.toggles .seg button{min-height:38px}.toggles .tg{width:38px}}
.card::after{content:"";position:sticky;display:block;bottom:-18px;height:28px;margin:0 -20px -18px;background:linear-gradient(#fffdfa00,#fffdfa);pointer-events:none}

/* iteration 17: card open → time panel collapses to its tab row */
@media (min-width:801px){
body.card-open .controls .panel,body.card-open .controls .control-note{display:none!important}
body.card-open .controls{padding:8px 14px}
body.card-open .card{bottom:150px}
}
.route-tag{font-size:13px;padding:5px 11px;border-left-width:5px}
.route-tag::before{content:"⚑ ";color:#3e7c8c}
.shared-phase{font-size:11.5px!important;background:#fbf3ec;border-left:3px solid var(--coral);border-radius:8px;padding:7px 10px;margin:0 0 8px;line-height:1.55!important}
.shared-phase b{display:block;font-size:10px;color:#9a8679;letter-spacing:1px}

/* iteration 19 */
.name-tag{font-size:11px;min-height:24px}
.name-tag b{font-size:10px}
.name-tag .carry{font-size:10.5px}
@media (min-width:801px){.log{right:12px;top:12px;bottom:auto;max-height:calc(100% - 300px);width:300px;z-index:12}}
.toggles .seg2 .tg{box-shadow:none;border:0;background:transparent;min-height:36px;width:40px;padding:0;justify-content:center}
.toggles .seg2 .tg[aria-pressed=true]{background:#211d1d;color:#fff8f4}
body.zoomed .map-meta,body.zoomed .hero-note,body.zoomed .mascot{display:none}
body.log-open #sidebar .tree,body.log-open #sidebar .side-tabs,body.log-open #sidebar .search{visibility:hidden}
@media (min-width:801px){.log{max-height:calc(100% - 60px)!important}}
@media (max-width:800px){.card{max-height:48vh!important}}
.island-label.dim{opacity:.78!important;filter:saturate(.6)}

/* iteration 24: renewal planned-use labels with icons; tag route chip */
.ghost-label{flex-direction:row;gap:5px;color:var(--g,#a5442a);border:1.5px solid var(--g,#db6a41);border-style:solid;background:#fffdf9f5;box-shadow:0 2px 6px #4a2a1420}
.ghost-label i{display:grid;place-items:center;width:16px;height:16px;border-radius:50%;background:var(--g,#db6a41);color:#fff}
.ghost-label svg{width:11px;height:11px}
.name-tag b{font:600 9.5px "Noto Sans TC",sans-serif;color:#2f6170;background:#e6f1f1;border-radius:999px;padding:1px 6px}
.lt .nw{white-space:nowrap}
.icon-tile.role.portrait{flex-basis:64px;height:64px;position:relative;overflow:visible;padding:0;border:2px solid #fff;box-shadow:0 0 0 2px #db6a41,0 4px 10px #4a2a1430}
.icon-tile.role.portrait img{width:100%;height:100%;object-fit:cover;border-radius:13px;display:block}
.icon-tile.role.portrait .glyph{position:absolute;right:-6px;bottom:-6px;width:22px;height:22px;border-radius:50%;background:#211d1d;color:#fff8f4;font:700 11px "Noto Sans TC",sans-serif;display:grid;place-items:center;border:2px solid #fff}

/* iteration 26: activity bubbles, current theme row, legend, title fit */
.name-tag.bubble{position:relative;border-radius:12px;padding:3px 9px 3px 3px;background:#fffdfa;border:1.5px solid #f0d9c8;margin-bottom:7px}
.name-tag.bubble::after{content:"";position:absolute;left:50%;bottom:-7px;margin-left:-6px;border:6px solid transparent;border-top-color:#fffdfa;border-bottom:0;filter:drop-shadow(0 1.5px 0 #f0d9c8)}
.name-tag.bubble .doing{font-size:11px;color:#5d4f49}
.name-tag.bubble .doing b{font:700 11px "Noto Sans TC",sans-serif;color:#a5442a;background:none;padding:0}
#tree details.current>summary{background:#fff1e8;box-shadow:inset 3px 0 0 #db6a41;border-radius:10px}
#tree details.current>summary .item-name{color:#a5442a;font-weight:700}
.legend{background:#fffaf6f5!important;box-shadow:0 2px 8px #4a2a141a}
.card h2{font-size:clamp(19px,2.1vw,24px);word-break:keep-all;overflow-wrap:anywhere}
.island-label.selected{z-index:3}
/* iteration 27: mobile keeps one toolbar row (time is on the slider below) */
@media (max-width:800px){.toggles .seg:not(.seg2){display:none}.toggles{flex-wrap:nowrap}}

/* v3 content: plain sentence, vision quote */
.card .plain{font-size:14.5px;line-height:1.65;color:#2e2724;background:#fff6ef;border-radius:12px;padding:10px 12px;margin:10px 0 12px}
.card blockquote.vision{margin:6px 0 10px;padding:2px 0 2px 10px;border-left:3px solid #db6a41;color:#6b5a52;font-size:12.5px;line-height:1.6}

/* A4: layer toolbar — icon over a single-line label, width follows content */
@media (min-width:801px){
.toggles{max-width:none;overflow:visible;-webkit-mask-image:none}
.toggles .seg2 .tg{width:auto;min-width:46px;min-height:46px;padding:4px 9px;flex-direction:column;justify-content:center;gap:2px}
.toggles .seg2 .tg span{display:block!important;white-space:nowrap;font-size:11px;line-height:1.2;letter-spacing:.02em}
.toggles .seg button{min-height:46px;width:42px}
}

/* A6: card frame clips; inner content scrolls with an inset, thin, brand-tinted scrollbar */
.card{overflow:hidden!important;padding:0!important;display:flex;flex-direction:column}
.card[hidden]{display:none!important}
.card::after{display:none!important}
#card-content{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding:20px 12px 40px 20px;margin:8px 6px 8px 0;scrollbar-width:thin;scrollbar-color:#e8c9b6 transparent;overscroll-behavior:contain}
#card-content::-webkit-scrollbar{width:6px}
#card-content::-webkit-scrollbar-track{background:transparent;margin:10px 0}
#card-content::-webkit-scrollbar-thumb{background:#e8c9b6;border-radius:6px}
#card-content::-webkit-scrollbar-thumb:hover{background:#db6a41}
.card .close{z-index:2}
/* A5: tiles never overflow */
.stat-row{grid-template-columns:repeat(auto-fit,minmax(0,1fr))!important}
.stat{min-width:0;overflow:hidden}
.stat b{font-size:clamp(14px,1.25vw,19px)!important;overflow-wrap:anywhere;word-break:normal!important;min-width:0;max-width:100%}
.stat .lbl{overflow-wrap:anywhere}

/* A7: item pins on the map + numbered sidebar items */
.item-pin{display:inline-flex;align-items:center;gap:5px;padding:3px 9px 3px 3px;border-radius:999px;background:#fffdfa;border:1.5px solid #db6a41;box-shadow:0 3px 10px #4a2a1430;font:600 11.5px/1.2 "Noto Sans TC",sans-serif;color:#2e2724;white-space:nowrap;pointer-events:auto;cursor:pointer;transform:translateY(-50%);transition:transform .15s}
.item-pin b{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#db6a41;color:#fff;font-size:12px;font-weight:800}
.item-pin.hot,.item-pin:hover{transform:translateY(-50%) scale(1.14);background:#211d1d;color:#fff8f4;border-color:#211d1d;z-index:5}
.item-pin.sel{background:#db6a41;color:#fff;border-color:#fff}
.item-pin.sel b{background:#fff;color:#db6a41}
#tree .children button .pin-no{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:50%;background:#fff1e8;color:#db6a41;font-size:11px;margin-right:8px;font-weight:800}
#tree .children button.hot{background:#fff1e8;color:#a5442a}
#tree .children button.hot .pin-no{background:#db6a41;color:#fff}
.item-pin.mini{padding:2px}
.item-pin.mini span{display:none}
.item-pin.mini:hover span{display:inline}
.stat.long b{font-size:clamp(12.5px,1.05vw,15px)!important;letter-spacing:-.02em}
.item-pin.compact.mini:hover,.item-pin.compact.hot{padding:3px 9px 3px 3px}
.item-pin.compact.mini:hover span{display:inline}
/* scroll cue at the bottom of the card */
.card::before{content:"";position:absolute;left:1px;right:14px;bottom:1px;height:34px;border-radius:0 0 20px 20px;background:linear-gradient(#fffdfa00,#fffdfaf2);pointer-events:none;z-index:1}
.item-pin{z-index:4}
.item-pin.slid{border-style:dashed}
.control-note{color:#5f514a!important}

/* brand card: same left edge as the detail card, never overlapping it */
@media (min-width:801px){
  .brand{left:30px!important;top:18px!important;margin:0!important}
  .card{left:30px!important;top:calc(var(--brand-bottom,190px) + 12px)!important}
  body.card-open .brand{display:block!important}
}
.island-label.numonly{font-size:0!important;padding:4px 7px!important}.island-label.numonly strong{font-size:11px}.island-label.numonly:hover{font-size:12px!important}

/* ===== release fixes (2026-10-11) ===== */
/* page footer removed: reclaim the strip */
.footer{display:none!important}
.sidebar{bottom:0!important}
@media (min-width:801px){
  .controls{bottom:23px!important}
  body.card-open .card{bottom:108px!important}
  .card{bottom:120px}
}
/* CSS2D labels must never transition transform (the renderer sets it every frame) */
.item-pin,.island-label,.name-tag,.route-tag,.ghost-label{transition:none!important}
.item-pin.hot,.item-pin:hover{transform:none}
.mob-only{display:none!important}
@media (hover:none){
  .item-pin.mini:hover span,.item-pin.compact.mini:hover span{display:none}
  .toggles .tg::after,.toggles .seg button::after{display:none}
}

/* ---------- mobile layout ---------- */
@media (max-width:800px){
  .mob-only{display:block!important}
  .sheet-handle.mob-only{display:flex!important}
  #stage{bottom:0!important;right:0!important}
  .map-meta,.dock,.hero-note{display:none!important}
  .toolbar{z-index:15}
  .toolbar button[aria-pressed=true]{background:#211d1d;color:#fff8f4}
  /* time panel: on demand, docked to the bottom edge */
  .controls{display:none!important}
  body.m-time .controls{display:block!important;left:0!important;right:0!important;bottom:0!important;border-radius:18px 18px 0 0!important;padding:12px 14px calc(12px + env(safe-area-inset-bottom,0px))!important;z-index:14}
  /* layers bar: not shown on phones */
  .hud{display:none!important}
  /* detail card: bottom sheet flush with the screen edge, thin side margins */
  .card{left:8px!important;right:8px!important;bottom:0!important;top:auto!important;width:auto!important;max-height:60%!important;border-radius:20px 20px 0 0!important;padding-bottom:env(safe-area-inset-bottom,0px)!important;z-index:16!important}
  body.card-open .card{bottom:0!important}
  #card-content{padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))}
  /* index sheet: half height by default, full on handle tap / swipe up */
  .sidebar{top:auto!important;height:52%!important;bottom:0!important;transition:transform .25s,height .25s!important;z-index:17;padding-top:18px}
  .sidebar.full{height:calc(100% - 16px)!important}
  .sheet-handle{position:absolute;top:0;left:50%;transform:translateX(-50%);width:96px;height:22px;border:0;background:transparent;display:flex!important;align-items:center;justify-content:center;padding:0;cursor:pointer;z-index:2}
  .sheet-handle i{display:block;width:44px;height:5px;border-radius:5px;background:#211d1d40}
  .sidebar .side-head{padding-top:10px}
  /* half sheet: drop the intro copy so the list itself gets the room; full sheet shows everything */
  .sidebar:not(.full) .side-head .eyebrow,.sidebar:not(.full) .side-head h2,.sidebar:not(.full) .side-head p{display:none}
  .sidebar:not(.full) .side-head{padding-top:14px!important;padding-right:60px!important}
  .sidebar:not(.full) .side-head .search{margin-top:0}
  .sidebar:not(.full) .mobile-close{top:16px}
}

/* search field: always dark text (dark-mode browsers default inputs to white text) */
.search,.search:focus{color:#211d1d!important;-webkit-text-fill-color:#211d1d;caret-color:#db6a41;color-scheme:light}
.search::placeholder{color:#9a8b82;-webkit-text-fill-color:#9a8b82}
@media (max-width:800px){.search{font-size:16px!important}}

/* map badges are not toolbar buttons: no 44px touch minimum (it stretched the number badges into tall pills) */
.item-pin{min-height:0!important;min-width:0!important}
.item-pin.mini,.item-pin.compact.mini{width:26px;height:26px;justify-content:center;padding:2px!important}
/* night only recolours the brand card; its size and position stay the same at every time of day */
body.night .brand{padding:12px 14px 10px;margin-left:-14px;margin-top:-10px}
@media (min-width:801px){body.night .brand{margin:0!important}}
@media (max-width:800px){body.night .brand{padding:8px 10px!important;margin:0!important}}
/* partner-city tags: quiet place-name captions, only while exploring city diplomacy */
.route-tag{font:500 10px/1.3 "Noto Sans TC",sans-serif!important;color:#4f6266;background:#fffaf5b3!important;border:0!important;border-radius:999px!important;padding:2px 8px!important;box-shadow:none!important;letter-spacing:.04em}
.route-tag::before{content:"↗ "!important;color:#7a9a9f!important}
/* mid widths (tablet / small laptop): the layer bar no longer fits between brand and toolbar — dock it under the brand */
@media (min-width:801px) and (max-width:1279px){
  .hud{left:30px!important;right:auto!important;top:calc(var(--brand-bottom,180px) + 10px)!important;align-items:flex-start!important}
  .hud .toggles{justify-content:flex-start!important;flex-wrap:wrap!important;max-width:calc(100vw - 318px - 60px)!important}
  body.card-open .hud{display:none!important}
  .hero-note{display:none!important}
}
/* easter egg: Puma's tag — small, warm, a little playful; grows a speech line while he stops on his soapbox */
.name-tag.puma-tag{background:#211d1d;color:#fff8f4;border:1.5px solid #db6a41;padding:2px 9px 2px 4px;gap:5px;box-shadow:0 3px 10px #4a2a1440;cursor:pointer;opacity:1!important}
.name-tag.puma-tag i{background:#db6a41;color:#fff;width:16px;height:16px;font-size:10px}
.name-tag.puma-tag .pn{font:800 11px/1 "Noto Sans TC",sans-serif;color:#fcea8b;background:none;padding:0;letter-spacing:.04em}
.name-tag.puma-tag .stop{font-size:10.5px;color:#fff8f4}
.name-tag.puma-tag .stop:empty{display:none}
.name-tag.puma-tag.talking{border-color:#fcea8b}
.icon-tile.puma-tile{background:linear-gradient(150deg,#211d1d,#3a3332);color:#fcea8b;font-size:24px}
/* phone detail card: fixed one-third height by default, full screen on demand */
#card-size{display:none}
@media (max-width:800px){
  .card{height:34%!important;max-height:none!important;min-height:220px;transition:height .25s ease!important}
  .card.full{height:calc(100% - 10px)!important}
  .card #card-handle{position:absolute;top:0;left:50%;transform:translateX(-50%);z-index:3}
  #card-size{display:inline-flex!important;position:absolute;top:10px;right:54px;z-index:3;min-height:32px;height:32px;padding:0 11px;border-radius:999px;border:1px solid #ecdccf;background:#fff;font-size:12px;font-weight:600;color:#5d514b;align-items:center}
  #card-size[aria-pressed=true]{background:#211d1d;color:#fff8f4;border-color:#211d1d}
  #card-content{padding-top:30px!important}
  .card .card-head{padding-right:40px}
}
@media (prefers-reduced-motion:reduce){.card{transition:none!important}}
/* toolbar overview arrow: one drawn icon on every device (the ↗ character turns into an emoji on phones) */
.tb-ico{width:13px;height:13px;vertical-align:-2px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* sheet handles: no button hover/tap fill — only the grab bar shows */
.sheet-handle,.sheet-handle:hover,.sheet-handle:active,.sheet-handle:focus{background:transparent!important;box-shadow:none!important;border:0!important;-webkit-tap-highlight-color:transparent}
.sheet-handle:focus:not(:focus-visible){outline:none}
/* removed: map caption and mascot hint */
.map-meta,.mascot{display:none!important}
/* removed: the "14 一格政見" hero note */
.hero-note{display:none!important}
/* 2026-10-14: resident speech tags — one clean pill: role badge centred on the left, "正在搬 + item" on one line */
.name-tag.bubble{align-items:center;gap:6px;padding:3px 10px 3px 3px;border-radius:999px;min-height:26px;border:1.5px solid #f0d9c8;box-shadow:0 3px 10px #4a2a1426}
.name-tag.bubble>i{flex:0 0 20px;width:20px;height:20px;font-size:10px;line-height:1;align-self:center}
.name-tag.bubble .doing{display:inline-flex!important;align-items:baseline;gap:4px;margin:0!important;padding:0!important;background:none!important;border-radius:0;font-size:11px!important;line-height:1.2;color:#5d4f49}
.name-tag.bubble .doing::before,.name-tag.bubble .doing i{display:none}
.name-tag.bubble .doing b{font:700 11.5px/1.2 "Noto Sans TC",sans-serif;color:#a5442a}
/* island icon column: never shown (also not when the index is closed) */
.dock,.sidebar-hidden .dock{display:none!important}
/* index list: no divider lines between themes */
.tree details,.tree .flow-item{border-bottom:0!important}
/* 2026-10-15: bottom time panel (台北人的一天／任期時間軸／HEART) removed — the clock runs by itself;
   light presets and 暫停 live in the layer bar (desktop) or behind the 時間 button (phone) */
.controls,body.m-time .controls{display:none!important}
@media (min-width:801px){
  .card,body.card-open .card{bottom:24px!important}
}
@media (max-width:800px){
  body.m-time .hud{display:flex!important;position:absolute;left:0!important;right:0!important;bottom:0!important;top:auto!important;width:auto!important;z-index:14;padding:10px 12px calc(12px + env(safe-area-inset-bottom,0px))!important;background:#fff8f4f2;border-radius:18px 18px 0 0;box-shadow:0 -8px 30px #211d1d1f;justify-content:center;align-items:center!important}
  body.m-time .hud .toggles{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;justify-content:center;gap:8px!important;max-width:none!important;width:auto!important}
  body.m-time .hud .toggles .seg{width:auto!important}
  body.m-time .hud .toggles .seg button{width:46px!important;min-height:40px!important;height:40px!important;flex:0 0 46px!important}
  body.m-time .hud .seg2 .tg:not([data-toggle=freeze]){display:none!important}
  body.m-time .hud .status{display:none!important}
}
@media (max-width:800px){body.m-time .hud .toggles .seg{display:flex!important}}

/* ===== brand block v2 (2026-10-15): HEART 政策島 ===== */
.brand .candidate{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:10px;padding-top:9px;border-top:1.5px solid #db6a4140;font-size:12px;line-height:1}
.brand .candidate .proj{display:inline-flex;align-items:baseline;gap:5px;font-weight:800;font-size:15px;letter-spacing:.06em;color:var(--ink,#211D1D)}
.brand .candidate .proj em{font-style:normal;font:900 15px/1 Arial,sans-serif;letter-spacing:.04em;color:var(--coral,#DB6A41)}
.brand .candidate b{margin:0;font-weight:600;font-size:11.5px;letter-spacing:.12em;color:#6b5a52;white-space:nowrap}
@media (max-width:800px){
  .brand .candidate{margin-top:7px;padding-top:6px;gap:10px}
  .brand .candidate .proj,.brand .candidate .proj em{font-size:12px}
  .brand .candidate b{font-size:10px;letter-spacing:.08em}
}

/* ===== brand block v3 (2026-10-15): landscape — FUTURE SOON. left, title stack right ===== */
.brand{display:flex!important;align-items:center;gap:16px}
body.card-open .brand{display:none!important}
@media (min-width:801px){body.card-open .brand{display:flex!important}}
.brand .future{font:900 40px/.9 Arial,sans-serif!important;letter-spacing:-1.8px!important;white-space:nowrap}
.brand .future span{display:block!important;margin:0!important}
.brand .brand-r{display:flex;flex-direction:column;gap:9px;padding-top:2px}
.brand h1{margin:0!important;font-size:20px!important;font-weight:800;letter-spacing:.2em!important;line-height:1;white-space:nowrap}
.brand .candidate{margin:0!important;padding:0!important;border:0!important;display:block}
.brand .candidate .proj{display:inline-flex;align-items:baseline;gap:6px;font-size:14px;font-weight:700;letter-spacing:.14em;line-height:1;white-space:nowrap}
.brand .candidate .proj em{font-size:14px;letter-spacing:.06em}
@media (max-width:800px){
  .brand{gap:11px}
  .brand .future{font-size:25px!important;letter-spacing:-1.1px!important}
  .brand .brand-r{gap:6px;padding-top:1px}
  .brand h1{font-size:14px!important;letter-spacing:.16em!important}
  .brand .candidate .proj,.brand .candidate .proj em{font-size:11px}
  .brand .candidate .proj{letter-spacing:.1em}
}
@media (min-width:1280px){.hud{left:calc(var(--brand-left,30px) + var(--brand-w,320px) + 18px)!important}}
.brand .brand-r{align-items:flex-start}
.brand .candidate{text-align:left}

/* 2026-10-23: the top bar ends 16px before the right-hand button group, whatever its width (「我的角色」 widened it) */
@media (min-width:1280px){.hud{right:calc(100vw - var(--toolbar-left, calc(100vw - 598px)) + 16px)!important}}

/* 2026-10-24: 「協作關係・依據」圖例移除 */
#legend{display:none!important}

/* 2026-10-25: Puma 的思考雲與「市政建言」按鈕（CSS2D，錨點在頭頂上方；內容往上長） */
.puma-extra{width:0;height:0;overflow:visible;pointer-events:none}
.puma-extra .px-col{position:absolute;left:0;bottom:20px;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:30px;width:max-content} /* 錨點與 Puma 名牌相同：往上推 20px，落在名牌上方 */
.puma-extra .px-col:has(.puma-advice[hidden]) .puma-cloud{margin-bottom:26px} /* 只有雲時，留出小圓點的位置 */
.puma-cloud{position:relative;max-width:210px;padding:9px 14px;border-radius:22px;background:#fffdf9;color:#211d1d;border:1.5px solid #211d1d1f;box-shadow:0 6px 18px #4a2a1430;font:600 12.5px/1.5 "Noto Sans TC",sans-serif;text-align:center;white-space:normal;animation:pumaCloudIn .45s ease-out}
.puma-cloud[hidden],.puma-advice[hidden]{display:none!important}
.puma-cloud .q{display:block}
.puma-cloud .src{display:block;margin-top:3px;font:500 10px/1.3 "Noto Sans TC",sans-serif;color:#8a7a70;letter-spacing:.02em}
.puma-cloud .src:empty{display:none}
.puma-cloud i{position:absolute;border-radius:50%;background:#fffdf9;border:1.5px solid #211d1d1f;box-shadow:0 3px 8px #4a2a1420}
.puma-cloud .d1{width:12px;height:12px;left:calc(50% - 4px);bottom:-14px}
.puma-cloud .d2{width:7px;height:7px;left:calc(50% + 4px);bottom:-24px}
.puma-advice{pointer-events:auto;display:inline-flex;align-items:center;gap:4px;padding:6px 12px;border-radius:999px;background:#db6a41;color:#fff!important;border:2px solid #fff;box-shadow:0 4px 14px #4a2a1440;font:800 12.5px/1.2 "Noto Sans TC",sans-serif;text-decoration:none;letter-spacing:.04em;white-space:nowrap;cursor:pointer}
.puma-advice:hover{background:#c85a33}
.puma-advice:focus-visible{outline:3px solid #fcea8b;outline-offset:2px}
@keyframes pumaCloudIn{from{opacity:0;transform:translateY(6px) scale(.92)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.puma-cloud{animation:none}}
/* 島主名牌與角色卡 */
.name-tag.puma-tag.lord-tag{border-color:#e9e1cc}
.name-tag.puma-tag.lord-tag i{background:#f5d33a;color:#211d1d}
.icon-tile.puma-tile.lord-tile{background:linear-gradient(150deg,#f5d33a,#e9e1cc);color:#211d1d}
.lord-link{display:inline-block;padding:8px 14px;border-radius:999px;background:#211d1d;color:#fff8f4!important;font-weight:800;text-decoration:none}
.lord-link:hover{background:#3a3332}
