/* Chancery: the office in the dark register. Ink ground, bone text, the arc
   wire, gold once per screen. Built on the platform's tokens (design.css);
   this file is the overlay, carried in reasoning from Conclave's, until a
   Chancery brand lives in the platform (CH-09). Nothing here restyles a
   control: buttons, focus, targets and reduced motion are the platform's. */
:root[data-theme="dark"] {
  --ink: #0b0e14;
  --ink-raised: #11151d;
  --bone: #ece6da;
  --bone-quiet: #aaa497;
  --arc: #8ea2ff;
  --arc-wire: rgba(142, 162, 255, 0.16);
  --gold: #d4a84b;

  --surface: var(--ink);
  --surface-sunken: var(--ink);
  --surface-raised: var(--ink-raised);
  --text: var(--bone);
  --text-muted: var(--bone-quiet);
  --border: var(--arc-wire);
  --border-strong: rgba(142, 162, 255, 0.55);
  --accent: var(--arc);
}

body.office {
  background: var(--ink);
  color: var(--bone);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--arc-wire);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--arc);
  text-decoration: none;
  min-height: var(--layout-touch-target);
}

.eyebrow {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-quiet);
  margin: 0;
}

.signout {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: 0;
}

.who { color: var(--bone-quiet); }

.stage {
  flex: 1;
  width: min(100%, var(--layout-container-sm));
  margin: 0 auto;
  padding: var(--space-7) var(--space-5) var(--space-8);
}

.hero { margin-bottom: var(--space-7); }

.display {
  font-size: var(--font-size-3xl);
  line-height: var(--font-leading-tight);
  letter-spacing: var(--font-tracking-tighter);
  text-wrap: balance;
  margin: 0 0 var(--space-4);
}

.lede {
  font-size: var(--font-size-md);
  color: var(--bone);
  text-wrap: pretty;
}

.muted { color: var(--bone-quiet); }

.panel {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--arc-wire);
}

.panel h1, .panel h2 { margin-top: 0; }

.stack { display: grid; gap: var(--space-3); max-width: 28rem; }

.error { color: var(--colour-critical-500); }
.notice { color: var(--gold); }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.inline { margin: 0; }
textarea { width: 100%; }

.date {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  color: var(--bone-quiet);
  margin: 0 0 var(--space-2);
}

/* The nine phases as nodes on a wire, the same figure Conclave draws. Lit is gold; the current one carries the
   arc; what is ahead is dim. Depth by dimming, not by shadow. */
.phases { margin-bottom: var(--space-6); }

.nodes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: var(--space-3);
  position: relative;
}

.node {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  color: var(--bone-quiet);
  opacity: 0.55;
}

.node--current { opacity: 1; color: var(--arc); }
.node--lit { opacity: 1; color: var(--bone); }

.node-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: transparent;
}

.node--current .node-dot { border-color: var(--arc); }
.node--lit .node-dot { background: var(--gold); border-color: var(--gold); }

.node-name {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

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

.foot {
  padding: var(--space-5);
  border-top: 1px solid var(--arc-wire);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.foot-links { display: flex; gap: var(--space-4); }
.foot-links a { color: var(--bone-quiet); min-height: var(--layout-touch-target); display: inline-flex; align-items: center; }

/* The button protocol (AW-108), stated once for the dark office. Every rule that
   changes a background states its colour; hover lifts and deepens; click
   presses. The platform's base hover (design.css) is completed here rather
   than edited there: the base rule sets a background alone, which is the
   AW-108 rule 1 shape, and the platform is read-only until Philip lifts it. */
.button {
  background: var(--arc);
  color: var(--ink);
  border-color: transparent;
  transition: transform var(--motion-duration-fast) var(--motion-easing-standard),
              background var(--motion-duration-fast) var(--motion-easing-standard),
              color var(--motion-duration-fast) var(--motion-easing-standard);
}
.button:hover {
  background: #5b73d9;
  color: #ffffff;
  transform: translateY(-1px);
}
.button:active {
  background: #4a60bd;
  color: #ffffff;
  transform: translateY(1px);
}
.button--plain {
  background: transparent;
  color: var(--bone);
  border-color: var(--border-strong);
}
.button--plain:hover {
  background: #1a2030;
  color: var(--bone);
  transform: translateY(-1px);
}
.button--plain:active {
  background: #141924;
  color: var(--bone);
  transform: translateY(1px);
}
.button--danger {
  background: #b23a3a;
  color: #ffffff;
}
.button--danger:hover {
  background: #8f2e2e;
  color: #ffffff;
  transform: translateY(-1px);
}
.button--danger:active {
  background: #742525;
  color: #ffffff;
  transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
  .button:hover, .button:active,
  .button--plain:hover, .button--plain:active,
  .button--danger:hover, .button--danger:active { transform: none; }
}


/* The office's own furniture: the nav, the day's actions, the register table,
   the checklist. Phone-sized first; the table scrolls sideways rather than
   collapsing, because a row is a row. */
.office-nav { display: flex; gap: var(--space-4); }
.office-nav a {
  color: var(--bone-quiet);
  text-decoration: none;
  min-height: var(--layout-touch-target);
  display: inline-flex;
  align-items: center;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.office-nav a[aria-current="page"] { color: var(--bone); border-bottom: 1px solid var(--gold); }

.actions li { display: grid; grid-template-columns: 1fr; gap: var(--space-1); padding: var(--space-3) 0; border-bottom: 1px solid var(--arc-wire); }
.action-client { color: var(--bone); font-weight: 600; text-decoration: none; }
.action-phase {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--arc);
}
.action-text { color: var(--bone); }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--arc-wire); }
.register { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.register th, .register td { text-align: left; padding: var(--space-3) var(--space-3); border-bottom: 1px solid var(--arc-wire); vertical-align: top; }
.register th {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone-quiet);
  font-weight: 400;
}
.register a { color: var(--bone); }
.row--broken td { color: var(--bone-quiet); }
.phase-pill { font-family: var(--font-family-mono); font-size: var(--font-size-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--arc); white-space: nowrap; }
.mono { font-family: var(--font-family-mono); font-size: var(--font-size-xs); }

.next { border-left: 2px solid var(--gold); padding-left: var(--space-4); }
.status-text { white-space: pre-wrap; }

.header-list { display: grid; gap: var(--space-2); margin: 0; }
.header-list div { display: grid; grid-template-columns: minmax(7rem, 1fr) 2fr; gap: var(--space-3); }
.header-list dt { color: var(--bone-quiet); font-family: var(--font-family-mono); font-size: var(--font-size-xs); letter-spacing: 0.08em; text-transform: uppercase; }
.header-list dd { margin: 0; overflow-wrap: anywhere; }

.gate { border-top: 1px solid var(--arc-wire); padding: var(--space-3) 0; }
.gate summary { cursor: pointer; min-height: var(--layout-touch-target); display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.gate--open summary { color: var(--arc); }
.gate-index { font-family: var(--font-family-mono); font-size: var(--font-size-xs); color: var(--bone-quiet); }

.checklist { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; gap: var(--space-2); }
.checklist li { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; }
.item--done .item-text { color: var(--bone-quiet); text-decoration: line-through; }
.tick {
  width: var(--layout-touch-target);
  height: var(--layout-touch-target);
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--gold);
  font-size: var(--font-size-md);
  cursor: pointer;
  transition: transform var(--motion-duration-fast) var(--motion-easing-standard),
              background var(--motion-duration-fast) var(--motion-easing-standard),
              border-color var(--motion-duration-fast) var(--motion-easing-standard);
}
.tick:hover { background: #1a2030; border-color: var(--arc); transform: translateY(-1px); }
.tick:active { background: #141924; border-color: var(--arc); transform: translateY(1px); }
.tick--done { border-color: var(--gold); }
.tick--still { cursor: default; }
.tick--still:hover, .tick--still:active { background: transparent; border-color: var(--border-strong); transform: none; }
@media (prefers-reduced-motion: reduce) { .tick:hover, .tick:active { transform: none; } }

.timeline li { display: grid; grid-template-columns: auto auto 1fr; gap: var(--space-3); align-items: baseline; }

@media (min-width: 40rem) {
  .actions li { grid-template-columns: minmax(10rem, 1fr) auto 2fr; align-items: baseline; }
}

.start-lines li { display: grid; grid-template-columns: 1fr; gap: var(--space-2); align-items: start; padding: var(--space-3) 0; border-bottom: 1px solid var(--arc-wire); }
.start-text { font-family: var(--font-family-mono); font-size: var(--font-size-sm); color: var(--bone); overflow-wrap: anywhere; }
select { width: 100%; }
@media (min-width: 40rem) { .start-lines li { grid-template-columns: 9rem 1fr auto; align-items: center; } }

.secret code { font-size: var(--font-size-lg); letter-spacing: 0.08em; color: var(--gold); overflow-wrap: anywhere; }
.keys li { display: grid; grid-template-columns: 1fr; gap: var(--space-2); padding: var(--space-3) 0; border-bottom: 1px solid var(--arc-wire); }
.key-name { color: var(--bone); font-weight: 600; }
.paper { background: var(--bone); color: var(--ink); padding: var(--space-5); border-radius: var(--radius-sm); margin-top: var(--space-3); }
.paper h2, .paper h3, .paper h4 { color: var(--ink); }
.paper code { color: var(--ink); }
@media (min-width: 40rem) { .keys li { grid-template-columns: 10rem 1fr auto auto; align-items: center; } }

/* The request as the client sent it, and what reading it suggests (CH-17). */
.answers { display: grid; grid-template-columns: minmax(12rem, 18rem) 1fr; gap: var(--space-2) var(--space-4); margin: var(--space-3) 0 0; }
.answers dt { color: var(--bone-dim, var(--bone)); font-weight: 600; }
.answers dd { margin: 0; overflow-wrap: anywhere; }
.screening { display: grid; gap: var(--space-2); margin: var(--space-3) 0 0; padding-left: var(--space-4); }
.screening li { display: grid; grid-template-columns: 7rem 1fr; gap: var(--space-2); align-items: baseline; }
.screening li > span:last-child { grid-column: 2; }
.verdict { text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--font-size-sm); }
.verdict--yes { color: var(--gold); }
.verdict--unknown { color: var(--bone); opacity: 0.75; }
.verdict--no { opacity: 0.6; }
.thread { display: grid; gap: var(--space-3); margin: var(--space-3) 0; padding: 0; list-style: none; }
.turn { border-left: 2px solid var(--arc-wire); padding-left: var(--space-3); }
.turn--arc { border-left-color: var(--gold); }
@media (max-width: 40rem) {
  .answers, .screening li { grid-template-columns: 1fr; }
  .screening li > span:last-child { grid-column: 1; }
}
.docs li { display: grid; gap: var(--space-2); padding: var(--space-3) 0; border-bottom: 1px solid var(--arc-wire); }
.doc-title { color: var(--bone); font-weight: 600; }
.state { text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--font-size-sm); }
.state--issued, .state--accepted { color: var(--gold); }
.state--draft, .state--superseded, .state--lapsed { opacity: 0.7; }
.row { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.flow-line { color: var(--gold); }
