:root {
  color-scheme: light;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
}
img {
  max-width: 100%;
}
:root {
  --ground: #eaf1f0;
  --surface: #ffffff;
  --surface-2: #f4f8f7;
  --line: #d3e0de;
  --ink: #0f2a2e;
  --muted: #56706f;
  --faint: #8ba3a2;
  --accent: #0b7a78;
  --accent-soft: #d5edeb;
  --done: #1f9460;
  --done-soft: #ddf3e7;
  --work: #d98a1c;
  --work-soft: #fbebd2;
  --wait: #6b7fd7;
  --wait-soft: #e3e7fa;
  --risk: #c8404f;
  --risk-soft: #f8dde0;
  --side: #0e2427;
  --side-ink: #cfe6e2;
  --side-muted: #7fa3a0;
  --side-hover: #17363a;
  --side-active: #1f4a4d;
  --monitor: #07181b;
  --monitor-line: #123237;
  --trace: #46e0c2;
  --monitor-ink: #bfe3dd;
  --shadow: 0 1px 2px rgba(15, 42, 46, 0.06), 0 8px 24px -12px rgba(15, 42, 46, 0.18);
  --display: "Bricolage Grotesque", "Noto Sans TC", system-ui, sans-serif;
  --body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0a1618;
    --surface: #10221f;
    --surface-2: #0d1d1c;
    --line: #1e3835;
    --ink: #e3f0ee;
    --muted: #93aeab;
    --faint: #5f7c79;
    --accent: #3cc7be;
    --accent-soft: #113a38;
    --done: #4ccb8c;
    --done-soft: #103325;
    --work: #f0aa45;
    --work-soft: #3a2a10;
    --wait: #95a5f2;
    --wait-soft: #1d2446;
    --risk: #f07a86;
    --risk-soft: #3c171c;
    --side: #07120f;
    --side-hover: #10221f;
    --side-active: #163532;
    --monitor: #050f11;
    --monitor-line: #0f2a2d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0a1618;
  --surface: #10221f;
  --surface-2: #0d1d1c;
  --line: #1e3835;
  --ink: #e3f0ee;
  --muted: #93aeab;
  --faint: #5f7c79;
  --accent: #3cc7be;
  --accent-soft: #113a38;
  --done: #4ccb8c;
  --done-soft: #103325;
  --work: #f0aa45;
  --work-soft: #3a2a10;
  --wait: #95a5f2;
  --wait-soft: #1d2446;
  --risk: #f07a86;
  --risk-soft: #3c171c;
  --side: #07120f;
  --side-hover: #10221f;
  --side-active: #163532;
  --monitor: #050f11;
  --monitor-line: #0f2a2d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
}
* {
  box-sizing: border-box;
}
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  padding: 0 16px;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}
button {
  font: inherit;
  color: inherit;
}
.num {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: var(--mono);
  font-size: 0.82em;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* shell */
.app {
  max-width: 1320px;
  margin: 0 auto;
  padding-block: 12px 40px;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.side {
  position: sticky;
  top: calc(12px + env(safe-area-inset-top, 0px));
  background: var(--side);
  color: var(--side-ink);
  border-radius: 20px;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 80px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  color: #fff;
}
.brand svg {
  width: 26px;
  height: 26px;
  color: var(--trace);
}
.brand small {
  display: block;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 500;
  color: var(--side-muted);
  letter-spacing: 0.06em;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav .g {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--side-muted);
  padding: 10px 10px 4px;
}
.nav a,
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--side-ink);
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.nav a svg,
.nav button svg {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.85;
}
.nav a:hover,
.nav button:hover {
  background: var(--side-hover);
}
.nav a[aria-current="page"] {
  background: var(--side-active);
  color: #fff;
  font-weight: 700;
}
.nav a[aria-current="page"] svg {
  color: var(--trace);
  opacity: 1;
}
.nav .badge {
  margin-left: auto;
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--work);
  color: #1b1305;
  border-radius: 999px;
  padding: 0 7px;
  min-width: 20px;
  text-align: center;
}
.nav .badge.soft {
  background: var(--side-hover);
  color: var(--side-ink);
}
.side .new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 10px;
  background: var(--trace);
  color: #05201c;
  font-weight: 900;
  cursor: pointer;
}
.side .new svg {
  width: 16px;
  height: 16px;
}
.me {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--side-hover);
}
.me .av {
  width: 34px;
  height: 34px;
}
.me b {
  display: block;
  font-size: 13.5px;
  color: #fff;
}
.me span {
  font-size: 11.5px;
  color: var(--side-muted);
}
.me button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--side-muted);
  cursor: pointer;
  font-size: 12px;
}
.mtop {
  display: none;
}

main {
  display: grid;
  gap: 22px;
  min-width: 0;
}
.pagehead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.pagehead .crumb {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.pagehead h1 {
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.stamp {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--done);
  animation: ping 2.2s infinite;
}
@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--done) 60%, transparent);
  }
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* overview */
.hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.gauge {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.gauge svg {
  width: 86px;
  height: 86px;
  flex: none;
}
.gauge .ring-bg {
  stroke: var(--surface-2);
}
.gauge .pct {
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
  fill: var(--ink);
}
.gauge h3 {
  font-size: 14.5px;
  font-weight: 700;
}
.gauge .big {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 4px;
}
.gauge .big small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.gauge p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.countdown {
  background: linear-gradient(
    135deg,
    var(--accent),
    color-mix(in srgb, var(--accent) 55%, #0f2a2e)
  );
  color: #f2fffd;
  border-radius: 18px;
  padding: 16px 18px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
/* four gauges fill the row; the countdown is a strip under them, its dates side by side */
.hero .countdown {
  grid-column: 1 / -1;
  grid-auto-flow: column;
  justify-content: start;
  column-gap: 36px;
}
.hero .countdown hr {
  display: none;
}
.countdown::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 26px solid rgba(255, 255, 255, 0.08);
}
.countdown .row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.countdown .d {
  font-family: var(--display);
  font-weight: 800;
  font-size: 42px;
  line-height: 1;
}
.countdown .d.sm {
  font-size: 28px;
}
.countdown .row span {
  font-size: 13px;
  opacity: 0.92;
}
.countdown hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 0;
}
.sec-h {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}
.sec-h h2 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.03em;
}
.sec-h p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.track-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}
.track {
  position: relative;
  min-width: 720px;
  height: 136px;
}
.track .axis {
  position: absolute;
  left: 0;
  right: 0;
  top: 62px;
  height: 8px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.track .past {
  position: absolute;
  left: 0;
  top: 62px;
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
}
.track .band {
  position: absolute;
  height: 22px;
  border-radius: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
}
.track .band.work {
  top: 84px;
  background: var(--work-soft);
  color: var(--work);
}
.track .band.wait {
  top: 110px;
  background: var(--wait-soft);
  color: var(--wait);
}
.track .mark {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 104px;
}
.track .mark .t {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
}
.track .mark .dt {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.track .mark .pin {
  margin-top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--faint);
}
.track .mark.done .pin {
  border-color: var(--accent);
  background: var(--accent);
}
.track .mark.next .pin {
  border-color: var(--work);
}
.track .today {
  position: absolute;
  top: 44px;
  bottom: 0;
  width: 2px;
  background: var(--risk);
  transform: translateX(-1px);
}
.track .today b {
  position: absolute;
  top: 84px;
  left: 6px;
  font-size: 11px;
  color: #fff;
  background: var(--risk);
  padding: 1px 7px;
  border-radius: 5px;
  white-space: nowrap;
}
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.col h3 {
  font-size: 15px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}
.col h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c);
}
.col h3 .n {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 9px;
  color: var(--muted);
}
.item {
  border-left: 3px solid var(--c);
  background: var(--surface-2);
  border-radius: 4px 10px 10px 4px;
  padding: 9px 12px;
}
.item .t {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
}
.item .m {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}

/* phases */
.phases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.phase {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
.phase:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.phase .head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.phase .when {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.phase h3 {
  font-size: 17px;
  font-weight: 900;
  margin-top: 2px;
}
.phase .meter {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.phase .meter .num {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}
.phase .meter span {
  font-size: 12.5px;
  color: var(--muted);
}
.phase p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}
.bar {
  height: 10px;
  border-radius: 10px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.bar i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  animation: sheen 3.6s ease-in-out infinite;
}
@keyframes sheen {
  60%,
  100% {
    transform: translateX(100%);
  }
}
.ms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ms span {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.ms span.d {
  background: var(--done-soft);
  border-color: transparent;
  color: var(--done);
}
.ms span.w {
  background: var(--work-soft);
  border-color: transparent;
  color: var(--work);
}
.ms span.p {
  text-decoration: line-through;
  opacity: 0.7;
}
.more {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}
.drawer {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  display: grid;
  gap: 8px;
}
.drawer .li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.drawer .li .mono {
  color: var(--muted);
}
.drawer .li .frac {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.drawer .li .note {
  grid-column: 2 / 4;
  font-size: 12px;
  color: var(--muted);
  margin-top: -6px;
}
.pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill.done {
  background: var(--done-soft);
  color: var(--done);
}
.pill.work {
  background: var(--work-soft);
  color: var(--work);
}
.pill.wait {
  background: var(--wait-soft);
  color: var(--wait);
}
.pill.pause {
  background: var(--surface-2);
  color: var(--muted);
}
.pill.risk {
  background: var(--risk-soft);
  color: var(--risk);
}
.pill.ask {
  background: var(--accent-soft);
  color: var(--accent);
}
.pill.decide {
  background: color-mix(in srgb, #8a5cc2 16%, transparent);
  color: #8a5cc2;
}
.pill.fixed {
  background: var(--done-soft);
  color: var(--done);
  box-shadow: inset 0 0 0 1px var(--done);
}

/* heartbeat */
.vitals {
  display: grid;
  /* minmax(0, …): the chart has a minimum width and scrolls in its own box; without
     this the grid column grows to that width and the whole page scrolls sideways on phones */
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.monitor {
  background: var(--monitor);
  border-radius: 18px;
  padding: 18px 20px;
  color: var(--monitor-ink);
  border: 1px solid var(--monitor-line);
}
.monitor .mh {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.monitor .mh h2 {
  font-size: 16px;
  font-weight: 900;
  color: #e8fff9;
  letter-spacing: 0.04em;
}
.monitor .mh .bpm {
  font-family: var(--display);
  color: var(--trace);
  font-size: 13px;
}
.monitor .mh .bpm b {
  font-size: 36px;
  font-weight: 800;
  margin-right: 4px;
}
.monitor .ecg-wrap {
  overflow-x: auto;
}
.monitor svg {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
}
.monitor .grid line {
  stroke: var(--monitor-line);
  stroke-width: 1;
}
.monitor .tr {
  fill: none;
  stroke: var(--trace);
  stroke-width: 2;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(70, 224, 194, 0.55));
}
.monitor .ax {
  fill: #6f9a94;
  font-family: var(--mono);
  font-size: 10px;
}
.monitor .peak {
  fill: var(--trace);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
}
.monitor .scan {
  fill: var(--trace);
  filter: drop-shadow(0 0 6px var(--trace));
}
.monitor .caption {
  font-size: 12px;
  color: #7fa8a1;
  margin-top: 6px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.stat .num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}
.stat .num small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 2px;
}
.stat .l {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* issues */
.issues {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tab {
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.tab[aria-pressed="true"] {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.btn {
  font-weight: 700;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 12px;
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
}
.btn:hover {
  filter: brightness(1.07);
}
.btn.ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.danger {
  background: var(--surface);
  color: var(--risk);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.sm {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 10px;
}
.ilist {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.issue {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}
.issue[aria-current="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.issue .ico {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.issue .t {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.45;
}
.issue .m {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 13.5px;
}
.thread {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.thread h3 {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.4;
}
.thread .sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}
.thread .sub select {
  font: inherit;
  font-size: 12.5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 6px;
  background: var(--surface);
  color: var(--ink);
}
.msgs {
  display: grid;
  gap: 12px;
}
.msg {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
}
.av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  flex: none;
}
.bubble {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.bubble .bh {
  background: var(--surface-2);
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.bubble .bh b {
  color: var(--ink);
}
.bubble .bh .role {
  font-size: 11px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.bubble .bh .role.dev {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  font-weight: 700;
}
.bubble .bb {
  padding: 10px 12px;
  font-size: 14px;
  white-space: pre-wrap;
}
.event {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  padding-left: 6px;
}
.event .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}
.event .dot svg {
  width: 12px;
  height: 12px;
}
.reply {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}
textarea,
input[type="text"],
select.f {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  width: 100%;
}
.reply textarea {
  flex: 1 1 260px;
  min-height: 44px;
  width: auto;
  resize: vertical;
}
.hint {
  font-size: 12px;
  color: var(--muted);
}

/* report form */
.form {
  display: grid;
  gap: 18px;
  max-width: 720px;
}
.field {
  display: grid;
  gap: 6px;
}
.field label,
.field .lab {
  font-weight: 700;
  font-size: 14px;
}
fieldset.field,
fieldset.loc-group {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
fieldset.field > legend {
  padding: 0;
  margin-bottom: 6px;
}
.req,
.opt {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  font-weight: 700;
  vertical-align: 1px;
}
.req {
  color: var(--risk);
}
.opt {
  color: var(--muted);
  font-weight: 500;
}
.req-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.req-note .req {
  margin: 0 2px;
}
.lab-hint {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.field .sub-lab {
  margin-top: 4px;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
}
.field-err {
  color: var(--risk);
  font-size: 13px;
  font-weight: 700;
}
.field[aria-invalid="true"] input[type="text"]:not(.note-in),
.field[aria-invalid="true"] textarea {
  border-color: var(--risk);
}
.field[aria-invalid="true"] .choices label,
.field[aria-invalid="true"] .loc-group {
  border-color: var(--risk);
}

/* "where": groups of checkboxes */
.locs {
  display: grid;
  gap: 10px;
}
.loc-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
}
fieldset.loc-group {
  border: 1px solid var(--line);
  padding: 10px 12px;
}
.loc-group > legend,
.loc-group > summary {
  font-weight: 700;
  font-size: 13.5px;
  padding: 0 4px;
}
.loc-group > summary {
  cursor: pointer;
}
.loc-group small {
  margin-left: 8px;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
}
.loc-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
}
.loc-opts label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
}
.loc-opts input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choices label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--surface);
  font-weight: 500;
}
.choices label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.choices input {
  accent-color: var(--accent);
}
.choices small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.drop {
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.form .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* members */
.tbl-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 620px;
}
th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
td .who {
  display: flex;
  align-items: center;
  gap: 10px;
}
td .who small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
td .acts {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.note {
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 14px;
}

/* auth screens */
.auth {
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
  padding-block: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px 28px;
  display: grid;
  gap: 18px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.auth-card .pulse {
  height: 54px;
  margin: -4px -28px 0;
}
.auth-card .pulse path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linejoin: round;
}
.auth-card h1 {
  font-size: 26px;
  font-weight: 900;
}
.auth-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.gbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
}
.gbtn:hover {
  background: var(--surface-2);
}
.gbtn svg {
  width: 20px;
  height: 20px;
}
.steps {
  display: grid;
  gap: 10px;
  text-align: left;
}
.step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 13.5px;
}
.step i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--muted);
}
.step.ok i {
  background: var(--done);
  color: #fff;
}
.step.now i {
  background: var(--work);
  color: #fff;
}
.step small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
  z-index: 10;
}
.foot {
  font-size: 12.5px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.foot b {
  color: var(--ink);
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .phases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .side {
    position: static;
    min-height: 0;
    padding: 12px;
  }
  .mtop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .mtop .brand {
    padding: 0;
  }
  .mtop button {
    border: 0;
    background: var(--side-hover);
    color: var(--side-ink);
    border-radius: 10px;
    padding: 6px 12px;
    cursor: pointer;
  }
  .side > .brand {
    display: none;
  }
  .side .collapsible[hidden] {
    display: none !important;
  }
  .board,
  .issues {
    grid-template-columns: 1fr;
  }
  /* one column: an empty "pick a report" box under the list is only clutter */
  .thread.idle {
    display: none;
  }
}
@media (max-width: 560px) {
  .hero,
  .phases {
    grid-template-columns: 1fr;
  }
  .hero .countdown {
    grid-auto-flow: row;
  }
  /* member tables: one card per person, buttons reachable without swiping sideways */
  table {
    min-width: 0;
  }
  thead {
    display: none;
  }
  tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  td {
    padding: 0;
    border: 0;
  }
  td:first-child {
    flex: 1 0 100%;
    min-width: 0;
  }
  td:last-child {
    margin-left: auto;
  }
  td .who > div {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .monitor .scan {
    display: none;
  }
}

/* live-app additions */
.banner {
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13.5px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.banner.warn {
  background: var(--work-soft);
  color: var(--ink);
}
.banner.err {
  background: var(--risk-soft);
  color: var(--ink);
}
.banner b {
  color: var(--risk);
}
.loading {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gallery figure {
  margin: 0;
  width: 120px;
}
.gallery figcaption {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.doc-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.doc-list a {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.doc-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}
.fref {
  font-weight: 700;
}
.where {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}
.where-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--ink);
}
.issue-note {
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.gallery a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  width: 120px;
  height: 90px;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.more-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
  text-align: left;
}
.body-text {
  white-space: pre-wrap;
  font-size: 14px;
}
.av img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.status-chip {
  font-size: 11.5px;
  padding: 1px 8px;
  border-radius: 999px;
}
a.btn,
a.new,
a.issue,
a.gbtn,
.nav a {
  text-decoration: none;
}
a.issue {
  color: inherit;
}
a.gbtn {
  color: var(--ink);
}
a.more {
  text-decoration: none;
}

/* a wide child (the timeline) must scroll inside its panel, not widen the page */
main {
  grid-template-columns: minmax(0, 1fr);
}
/* the countdown numbers are spans inside .row, which also styles spans */
.countdown .row .d {
  font-family: var(--display);
  font-weight: 800;
  font-size: 42px;
  line-height: 1;
  opacity: 1;
}
.countdown .row .d.sm {
  font-size: 28px;
}

/* sidebar account row: long emails must not push the sign-out button out */
.me > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}
.me b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me button {
  white-space: nowrap;
  flex: none;
}

/* timeline: labels of marks that sit close together take turns above and below */
.track {
  height: 156px;
}
.track .axis,
.track .past {
  top: 80px;
}
.track .band.work {
  top: 102px;
}
.track .band.wait {
  top: 128px;
}
.track .today {
  top: 60px;
}
.track .today b {
  top: 44px;
}
.track .mark {
  height: 96px;
}
.track .mark .lbl {
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.track .mark.alt .lbl {
  top: 0;
}
.track .mark .pin {
  position: absolute;
  top: 77px;
  left: calc(50% - 7px);
  margin: 0;
}
.track {
  height: 176px;
}
.track .today b {
  top: 92px;
}
.item .t,
.issue .t,
.bubble .bb,
.body-text {
  overflow-wrap: anywhere;
}

/* images picked for a report, before sending */
.picked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.thumb {
  position: relative;
  margin: 0;
  width: 172px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.thumb img {
  display: block;
  width: 100%;
  height: 84px;
  object-fit: cover;
}
.thumb figcaption {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thumb .unpick {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(15, 42, 46, 0.75);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.thumb .unpick:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

/* report form: drop zone, patient-data warning, consent, similar reports */
.drop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.warn-pd {
  font-size: 12.5px;
  color: var(--ink);
  background: var(--work-soft);
  border-radius: 10px;
  padding: 8px 12px;
}
.consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
}
.consent input {
  margin-top: 3px;
  accent-color: var(--accent);
}
.thumb .fno {
  position: absolute;
  left: 4px;
  top: 4px;
  border-radius: 8px;
  background: rgba(15, 42, 46, 0.8);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
}
.thumb .doc-icon {
  height: 84px;
  display: grid;
  place-content: center;
  gap: 2px;
  text-align: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.thumb .doc-icon span {
  font-size: 11px;
  color: var(--muted);
}
.thumb .label-in {
  display: block;
  width: calc(100% - 12px);
  margin: 0 6px;
  padding: 5px 8px;
  font-size: 12.5px;
  border-radius: 8px;
}
.thumb-actions {
  display: flex;
  gap: 6px;
  padding: 6px;
}
.thumb-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  padding: 3px 8px;
  cursor: pointer;
}
.similar {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  background: var(--surface-2);
  font-size: 13.5px;
}
.similar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.similar-row a {
  color: var(--ink);
  font-weight: 500;
}
.thread-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.thread-tools .env {
  font-size: 12px;
}
.reply-form {
  display: grid;
  gap: 10px;
}
.reply-form textarea {
  width: 100%;
  min-height: 64px;
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  resize: vertical;
}
.reply-actions {
  display: flex;
  justify-content: flex-end;
}
.bubble .gallery {
  padding: 0 12px 10px;
}

/* black-out tool */
.masker {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(5, 15, 17, 0.72);
  display: grid;
  place-items: center;
  padding: 16px;
}
.masker-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
  width: min(960px, 100%);
  max-height: 100%;
  overflow: auto;
}
.masker-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}
.masker-stage {
  overflow: auto;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 2px;
}
.masker-stage canvas {
  touch-action: none;
  cursor: crosshair;
  max-width: 100%;
}
.masker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
details.picker > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  list-style: none;
}
details.picker > summary::-webkit-details-marker {
  display: none;
}
details.picker > summary::before {
  content: "＋ ";
}
details.picker[open] > summary {
  margin-bottom: 6px;
}
details.picker:not([open]) > :not(summary) {
  display: none;
}

/* ================= real-use verification ================= */
.verify .vrow {
  display: grid;
  grid-template-columns: minmax(150px, 210px) 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.verify .vrow:first-of-type {
  border-top: 0;
}
.verify .vrow.alert .vh h3 {
  color: var(--risk);
}
.verify .vh h3 {
  margin: 0 0 4px;
  font-size: 14px;
}
.verify .vh .big {
  font-size: 26px;
  font-weight: 700;
}
.verify .vh .big small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.verify .vd p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.verify .vtags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.vtag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.vtag b:empty {
  display: none;
}
@media (max-width: 560px) {
  .verify .vrow {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* roles and permissions */
.role-list {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.role-card {
  display: grid;
  gap: 10px;
}
.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.role-head input {
  max-width: 16rem;
  font-weight: 700;
}
.perms {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 28px;
}
.perm-group {
  display: grid;
  align-content: start;
  gap: 6px;
  font-size: 13.5px;
}
.perm-group b {
  font-size: 12px;
  color: var(--muted);
}
.perm-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.perm-group input {
  accent-color: var(--accent);
}
.role-card .actions {
  display: flex;
  gap: 8px;
}
select.role-select {
  width: auto;
  padding: 6px 10px;
}

/* robots and API keys */
.av.bot {
  display: grid;
  place-items: center;
}
.av.bot svg {
  width: 72%;
  height: 72%;
}
.bubble .bh .role.bot {
  background: var(--accent-soft);
  color: var(--accent);
}
.token-form {
  max-width: none;
  margin-bottom: 16px;
}
.new-token {
  margin-bottom: 16px;
  border: 2px solid var(--accent);
}
.new-token h2 {
  margin: 0 0 6px;
}
.token-box {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.token-box input {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}
.perm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.token-box .btn,
[data-revoke] {
  white-space: nowrap;
  flex: none;
}

/* LINE */
.bind-code {
  display: grid;
  gap: 8px;
}
.bind-code .code {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
}
.line-log {
  display: grid;
}
.lmsg {
  display: grid;
  grid-template-columns: 6.5em 7em minmax(0, 1fr);
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.lmsg .t {
  color: var(--muted);
  font-size: 12.5px;
  padding-top: 2px;
}
.lmsg .c {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: grid;
  gap: 4px;
  justify-items: start;
}
.line-img img {
  max-width: min(320px, 100%);
  max-height: 260px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
}
@media (max-width: 560px) {
  .lmsg {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .lmsg .c {
    grid-column: 1 / -1;
  }
}

/* ---- 待核准 (drafts) ---- */
.draft {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid var(--line);
}
.draft-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.draft-files {
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.draft .note {
  white-space: pre-wrap;
}
.bh .edited {
  font-size: 12px;
  color: var(--muted);
}
.draft-orig {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13.5px;
}
.draft-orig .bb {
  white-space: pre-wrap;
  margin-top: 8px;
  color: var(--muted);
}
