/* PYPR — house style for executive rooms.
   Three zones: identity rail · working surface · live dossier.
   One accent: PYPR jade. Hairlines, not boxes. */

:root {
  --ground: #050706;
  --panel: #0a0e0c;
  --line: #1c2421;
  --line-strong: #2b3632;
  --bone: #e6ebe7;
  --mist: #93a09a;
  --faint: #5f6b66;
  --jade: #34c3a7;
  --jade-ink: #03140f;
  --jade-wash: rgba(52, 195, 167, 0.09);
  --serif: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --rail: 320px;
  --dossier: 300px;
  --halt-h: 76px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--bone);
  font: 400 16px/1.55 var(--sans); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--bone); text-decoration-color: var(--jade); text-underline-offset: 3px; }
a:hover { color: var(--jade); }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: 41px; line-height: 1.12; margin-bottom: 14px; }
h2 { font-size: 26px; line-height: 1.2; }
h3 { font-size: 17px; line-height: 1.3; color: var(--mist); }
p { margin: 0 0 1em; max-width: 66ch; }
.muted { color: var(--mist); }
.small { font-size: 13px; }

/* ---------- the house: three zones ---------- */
.house {
  display: grid; min-height: 100vh;
  grid-template-columns: var(--rail) minmax(0, 1fr) var(--dossier);
  grid-template-areas: "rail surface dossier";
}
.rail {
  grid-area: rail; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding-bottom: var(--halt-h);
}
.surface { grid-area: surface; min-width: 0; padding: 40px clamp(20px, 4vw, 56px) calc(var(--halt-h) + 40px); }
.surface-inner { max-width: 760px; }
.dossier {
  grid-area: dossier; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-left: 1px solid var(--line); padding: 28px 24px calc(var(--halt-h) + 24px);
}

/* ---------- identity rail ---------- */
.portrait {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden; flex: none;
  border-bottom: 1px solid var(--line); background: var(--ground);
}
.portrait .emblem { position: absolute; inset: -9%; width: 118%; height: 118%; }
.ident { padding: 28px 28px 0; }
.ident .name {
  font-family: var(--serif); font-size: 56px; line-height: 1; letter-spacing: 0.16em;
  margin: 0 0 14px; color: var(--bone);
}
.ident .role { color: var(--mist); font-size: 14px; margin: 0 0 24px; }
.credo { font-family: var(--serif); font-size: 21px; line-height: 1.45; color: var(--bone); margin: 0 0 24px; padding: 0 28px; max-width: calc(26ch + 56px); }
.contact { font-size: 14px; color: var(--mist); margin: 0 0 8px; padding: 0 28px; }
.rail-nav { padding: 20px 28px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; font-size: 14px; }
.linklike { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--mist); cursor: pointer; text-decoration: none; }
.linklike:hover { color: var(--bone); text-decoration: underline; text-decoration-color: var(--jade); }
.rail-nav a { color: var(--mist); text-decoration: none; }
.rail-nav a:hover, .rail-nav a[aria-current="page"] { color: var(--bone); text-decoration: underline; text-decoration-color: var(--jade); }

/* the emblem: hairline jade geometry, drawn once on load */
.emblem { display: block; }
.emblem .em-ring, .emblem .em-tick { fill: none; stroke: var(--line-strong); stroke-width: 0.6; }
.emblem .em-l, .emblem .em-f, .emblem .em-g, .emblem .em-s { fill: none; stroke: var(--jade); vector-effect: non-scaling-stroke; }
.emblem .em-l { stroke-width: 1; opacity: 0.9; }
.emblem .em-f { stroke-width: 1; opacity: 0.35; }
.emblem .em-g { stroke-width: 1; opacity: 0.55; }
.emblem .em-s { stroke-width: 1; opacity: 0.22; }
.emblem .em-core { fill: var(--jade); opacity: 0.92; }
.emblem .em-dot { fill: var(--ground); }
@media (prefers-reduced-motion: no-preference) {
  .portrait .em-l, .portrait .em-f { stroke-dasharray: 170; stroke-dashoffset: 170; animation: draw 1.8s ease-out forwards; }
  .portrait .em-f { animation-delay: 0.5s; }
  .portrait .em-g { stroke-dasharray: 1300; stroke-dashoffset: 1300; animation: draw 2.6s 0.9s ease-in-out forwards; }
  .portrait .em-core { opacity: 0; animation: arrive 1.2s 2.2s ease forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes arrive { to { opacity: 0.92; } }

/* ---------- working surface ---------- */
.tabs { display: flex; gap: 4px 26px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 32px; }
.tab {
  appearance: none; background: none; border: 0; color: var(--mist); font: 500 15px var(--sans);
  padding: 12px 0 13px; cursor: pointer; border-bottom: 1px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--bone); }
.tab[aria-selected="true"] { color: var(--bone); border-bottom-color: var(--jade); }
.tab .count { color: var(--jade); margin-left: 6px; }
.pane > h2 { margin-bottom: 8px; }
.pane > .lede { color: var(--mist); margin-bottom: 28px; }

.banner { border: 1px solid var(--line-strong); padding: 18px 20px; margin: 0 0 28px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.banner.halted { border-color: var(--bone); }
.banner p { margin: 0; }

.brief-text { white-space: pre-wrap; font-size: 17px; line-height: 1.65; max-width: 68ch; }
.empty { color: var(--mist); border-top: 1px solid var(--line); padding: 24px 0; }

/* proposals: hairline-separated entries, not cards */
.entries { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.entry { border-bottom: 1px solid var(--line); padding: 24px 0; }
.entry h3 { font-size: 21px; color: var(--bone); margin: 0 0 14px; }
.facts { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px 16px; margin: 0 0 16px; }
.facts dt { color: var(--mist); font-size: 14px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.cc { display: inline-block; border: 1px solid var(--line-strong); padding: 0 7px; margin-right: 8px; font-size: 13px; }
.cc-CC3, .cc-CC4 { border-color: var(--bone); }
details { margin: 0 0 16px; }
summary { cursor: pointer; color: var(--mist); font-size: 14px; }
pre {
  white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--panel); border: 1px solid var(--line); padding: 14px; margin: 10px 0 0; color: var(--bone);
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.status { font-size: 14px; color: var(--mist); }
.status.ok { color: var(--jade); }

/* buttons */
.btn {
  appearance: none; font: 500 15px/1.2 var(--sans); color: var(--bone); background: transparent;
  border: 1px solid var(--line-strong); padding: 12px 18px; border-radius: 2px; cursor: pointer;
  min-height: 44px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--bone); }
.btn:disabled { opacity: 0.45; cursor: progress; }
.btn-primary { background: var(--jade); border-color: var(--jade); color: var(--jade-ink); font-weight: 600; }
.btn-primary:hover { background: #48d3b7; border-color: #48d3b7; color: var(--jade-ink); }
.btn-quiet { border-color: transparent; color: var(--mist); padding-left: 0; padding-right: 0; }
.btn-quiet:hover { color: var(--bone); border-color: transparent; }
.btn-halt { background: var(--bone); color: var(--ground); border-color: var(--bone); font-weight: 700; letter-spacing: 0.02em; }
.btn-halt:hover { background: #fff; }
.btn-wide { width: 100%; min-height: 56px; font-size: 17px; }

/* forms */
label { display: block; font-size: 14px; color: var(--mist); margin: 0 0 6px; }
input[type="text"], input[type="number"], input[type="password"], textarea, select {
  width: 100%; background: var(--panel); color: var(--bone); border: 1px solid var(--line-strong);
  border-radius: 2px; padding: 11px 12px; font: 400 16px/1.4 var(--sans);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--jade); outline: none; }
.field { margin: 0 0 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 16px; margin: 0 0 18px; }
.checks label { display: flex; gap: 8px; align-items: center; color: var(--bone); font-size: 15px; margin: 0; }
.checks input { accent-color: var(--jade); width: 16px; height: 16px; }

/* chat */
.chatlog { border-top: 1px solid var(--line); margin: 0 0 20px; }
.msg { padding: 16px 0; border-bottom: 1px solid var(--line); }
.msg .who { font-size: 13px; color: var(--mist); margin-bottom: 4px; }
.msg.pypr .who { color: var(--jade); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--mist); }
th, td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }

/* ---------- live dossier ---------- */
.d-sec { border-bottom: 1px solid var(--line); padding: 0 0 18px; margin: 0 0 18px; }
.d-sec:last-child { border-bottom: 0; }
.d-sec h3 { font-family: var(--sans); font-size: 13px; font-weight: 500; margin: 0 0 8px; }
.state-word { font-family: var(--serif); font-size: 32px; line-height: 1.1; }
.state-ACTIVE { color: var(--jade); }
.state-HALTED { color: var(--bone); }
.state-GENESIS, .state-RETIRED, .state-UNKNOWN { color: var(--mist); }
.d-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.d-list li { padding: 6px 0; border-top: 1px solid var(--line); }
.d-list li:first-child { border-top: 0; }
.d-list .sub { color: var(--mist); font-size: 13px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-right: 8px; vertical-align: middle; }
.dot.on { background: var(--jade); }

/* ---------- halt bar: always visible ---------- */
.haltbar {
  position: fixed; left: 0; bottom: 0; z-index: 20; width: var(--rail); min-height: var(--halt-h);
  display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  background: var(--ground); border-top: 1px solid var(--line); border-right: 1px solid var(--line);
}
.haltbar .btn { flex: 1; }
.haltbar .note { font-size: 13px; color: var(--mist); }

/* notices */
.notice { position: fixed; right: 20px; bottom: calc(var(--halt-h) + 16px); z-index: 30; max-width: min(440px, calc(100vw - 40px));
  background: var(--panel); border: 1px solid var(--line-strong); padding: 14px 16px; font-size: 14px; }
.notice.error { border-color: var(--bone); }
.notice .code { color: var(--mist); font-size: 12px; margin-top: 4px; }

/* ---------- single-column pages (seat, login, enroll) ---------- */
.solo { max-width: 560px; margin: 0 auto; padding: 0 16px calc(var(--halt-h) + 32px); }
.solo-head { display: flex; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.solo-head .mark { width: 64px; height: 64px; flex: none; border: 1px solid var(--line); overflow: hidden; }
.solo-head .mark .emblem { width: 100%; height: 100%; }
.solo-head .name { font-family: var(--serif); font-size: 30px; letter-spacing: 0.14em; line-height: 1; }
.solo-head .role { color: var(--mist); font-size: 13px; margin-top: 4px; }
.seat-state { margin: 0 0 20px; }
.seat .entry h3 { font-size: 23px; }
.seat .facts { grid-template-columns: 96px minmax(0, 1fr); font-size: 16px; }
.seat .actions { flex-direction: column; align-items: stretch; }
.seat .haltbar, .solo-page .haltbar { width: 100%; border-right: 0; justify-content: center; }
.seat .haltbar .btn { max-width: 528px; }

/* public page */
.principles { list-style: none; margin: 0; padding: 0; }
.principles li { padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.principles li b { display: block; font-weight: 500; color: var(--bone); }
.principles li span { color: var(--mist); }
.public .surface h1 { max-width: 18ch; margin-bottom: 28px; }
.public .surface p { font-size: 17px; line-height: 1.7; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .house { grid-template-columns: 280px minmax(0, 1fr); grid-template-areas: "rail surface" "rail dossier"; }
  :root { --rail: 280px; }
  .dossier { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); padding: 28px clamp(20px, 4vw, 56px) calc(var(--halt-h) + 28px); }
  .surface { padding-bottom: 40px; }
}
@media (max-width: 760px) {
  .house { grid-template-columns: minmax(0, 1fr); grid-template-areas: "rail" "surface" "dossier"; }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 20px;
    display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 16px; align-items: center; padding-top: 16px; }
  .portrait { width: 96px; margin-left: 16px; border: 1px solid var(--line); }
  .ident { padding: 0 16px 0 0; }
  .ident .name { font-size: 34px; margin-bottom: 6px; }
  .ident .role { margin: 0; font-size: 13px; }
  .credo, .contact { grid-column: 1 / -1; padding: 0 16px; margin: 16px 0 0; font-size: 18px; max-width: none; }
  .contact { font-size: 14px; margin-top: 8px; }
  .rail-nav { grid-column: 1 / -1; padding: 12px 16px 0; }
  .surface { padding: 24px 16px 32px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { display: none; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.stack td { border: 0; padding: 3px 0; }
  .dossier { padding: 24px 16px calc(var(--halt-h) + 24px); }
  h1 { font-size: 33px; }
  .haltbar { width: 100%; border-right: 0; padding: 12px 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 92px minmax(0, 1fr); }
}
.spaced { margin-top: 48px; margin-bottom: 12px; }

/* ---------- approval card: everything, in full ---------- */
.everything { margin: 0 0 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.everything > summary { font-size: 14px; }
.everything .defaults { margin: 8px 0 0; }
.fields { margin: 12px 0 0; }
.fields dt { overflow-wrap: anywhere; }
.tag { display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid var(--line-strong); font-size: 11px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--mist); vertical-align: 1px; }
.mono { font: 14px/1.5 ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; }
pre.fieldval { margin: 0; max-height: 420px; overflow: auto; }
.htmlframe { display: block; width: 100%; height: 360px; margin: 10px 0 0; border: 1px solid var(--line-strong);
  background: #fff; color-scheme: light; resize: vertical; }
.warnings { list-style: none; margin: 0 0 16px; padding: 0; }
.warning { border: 1px solid var(--line-strong); border-left-width: 3px; padding: 10px 12px; margin: 0 0 8px; font-size: 14px; }
.warning.warn { border-left-color: var(--jade); }
.warning.danger { border-color: var(--bone); border-left-width: 4px; color: var(--bone); font-weight: 500; }
.warning.info { color: var(--mist); }

/* passkeys */
.d-list li.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.banner.warn { border-color: var(--bone); }
.banner pre { margin: 6px 0 10px; }
code { font: 13px ui-monospace, "SF Mono", Menlo, monospace; }

/* halt without a session (sign-in page) */
.halt-panel { margin: 40px 0 24px; padding: 20px 0 0; border-top: 1px solid var(--line); }
.halt-panel h2 { margin-bottom: 8px; }
.halt-panel .btn-halt { min-height: 64px; font-size: 18px; }
