:root {
  color-scheme: light;
  --ink: #252e29;
  --muted: #555e56;
  --pine: #254b3d;
  --pine-dark: #20372f;
  --ground: #f3eee4;
  --paper: #fffcf5;
  --line: #ded6c7;
  --red: #8a3328;
  --serif: Georgia, 'Times New Roman', serif;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--ground);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button { min-height: 44px; cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }
a { color: var(--pine); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid #a75121; outline-offset: 3px; }
.topbar { background: #fffaf1; border-bottom: 1px solid var(--line); }
.top-inner, .hero-inner, .workspace { width: min(1140px, calc(100% - 64px)); margin-inline: auto; }
.top-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.identity { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font: 700 19px/1.2 var(--serif); }
.seal { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #a78f61; border-radius: 50%; background: #f1e4ca; color: #463924; }
.toolbar { display: flex; gap: 5px; }
.quiet { padding: 0 10px; border: 0; background: transparent; color: var(--pine); border-radius: 5px; font-size: 14px; }
.quiet:hover { background: #e8eee7; }
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--pine-dark); color: #fff8e9; }
.room { position: absolute; inset: 0 0 0 29%; z-index: -1; background: linear-gradient(90deg, var(--pine-dark), transparent 62%), url('/assets/study.webp') center 47% / cover no-repeat; }
.hero-inner { padding-block: 47px 50px; min-height: 220px; display: flex; align-items: center; gap: 23px; }
.portrait { width: 100px; height: 100px; margin: 0; flex: none; overflow: hidden; border: 1px solid #c09d66; border-radius: 50%; background: #e2bf87; }
.portrait img { width: 100%; height: 100%; display: block; object-fit: cover; }
.overline { margin: 0 0 8px; color: #566a5b; font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.hero .overline { color: #f5d49b; }
h1, h2, h3 { font-family: var(--serif); }
h1 { margin: 0; font-size: clamp(42px, 6vw, 65px); line-height: 1; font-weight: 500; }
.welcome { margin: 13px 0 0; max-width: 32rem; color: #f8e5c8; line-height: 1.45; }
.workspace { padding-block: 28px 52px; }
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 320px); gap: 24px; align-items: start; }
.main-column { display: grid; gap: 20px; min-width: 0; }
.side-column { position: sticky; top: 16px; }
.sheet { border: 1px solid var(--line); background: var(--paper); border-radius: 13px; padding: 26px; box-shadow: 0 3px 12px #3d2d1610; min-width: 0; }
.narrow { max-width: 530px; margin: 4px auto 0; padding: 32px; }
.narrow p { color: var(--muted); }
.sheet h2 { font-size: clamp(26px, 4.3vw, 39px); line-height: 1.11; letter-spacing: -.025em; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sheet-heading { margin-bottom: 20px; }
.decision-sheet h2 { font-size: 29px; }
.handoff { padding: 14px 15px; border-left: 3px solid #a97543; background: #f3eddf; line-height: 1.55; margin: 16px 0 0; overflow-wrap: anywhere; }
.handoff strong, .handoff span { display: block; white-space: pre-wrap; }
.handoff span:empty { display: none; }
.document { overflow-wrap: anywhere; line-height: 1.58; font-size: 15px; }
.document > :first-child { margin-top: 0; }
.document > :last-child { margin-bottom: 0; }
.document h3 { font-size: 24px; margin: 24px 0 10px; }
.document p { margin: 0 0 14px; }
.document ul, .document ol { padding-inline-start: 22px; }
.document li + li { margin-top: 10px; }
.document a { font-weight: 650; }
.work-list { padding: 0 !important; margin: 17px 0 21px; list-style: none; }
.work-list > li { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 12px; background: #f9f4ea; border: 1px solid #e9dfce; border-radius: 9px; padding: 15px; }
.work-list > li + li { margin-top: 10px; }
.work-number { align-self: start; display: grid; place-items: center; min-height: 32px; border: 1px solid #d8c7aa; border-radius: 6px; color: #634c2f; font: 700 16px var(--serif); }
.work-list h3 { font-size: 19px; font-family: inherit; margin: 0; line-height: 1.42; }
.work-list h3 a { display: inline-block; font-size: 14px; font-weight: 650; }
.work-list p { margin: 8px 0 0; color: #4c554e; }
.fine { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
#waiting-note { font-size: 14px; line-height: 1.5; }
form label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 7px; }
input, textarea { width: 100%; background: #fffefa; border: 1px solid #aba394; border-radius: 6px; padding: 11px; min-width: 0; color: var(--ink); }
textarea { min-height: 100px; resize: vertical; }
.pair-controls { display: flex; gap: 9px; }
.primary, .secondary { border-radius: 6px; padding: 10px 14px; font-size: 14px; font-weight: 700; }
.primary { border: 1px solid var(--pine); color: #fffaf1; background: var(--pine); }
.primary:hover { background: #193b2e; }
.secondary { border: 1px solid #8f9d8e; color: var(--pine); background: transparent; }
.secondary:hover { background: #edf0e8; }
.decision-actions { display: grid; gap: 9px; margin-top: 12px; }
.record { padding: 13px; margin-top: 15px; border: 1px solid #b6c6b2; border-radius: 6px; background: #edf2e7; overflow-wrap: anywhere; }
.record p { margin: 5px 0 0; white-space: pre-wrap; }
.form-error { margin: 10px 0 0; color: var(--red) !important; font-size: 14px; line-height: 1.45; }
.form-error:empty, .status:empty { display: none; }
.status { color: var(--muted); font-size: 13px; margin: 14px 0 0; line-height: 1.45; }
@media (max-width: 800px) {
  .top-inner, .hero-inner, .workspace { width: calc(100% - 32px); }
  .plan-layout { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .side-column { position: static; }
  .main-column { gap: 16px; }
  .hero-inner { min-height: 182px; padding-block: 29px; }
  .sheet { padding: 22px; }
}
@media (max-width: 460px) {
  .top-inner { min-height: 60px; gap: 4px; }
  .identity { gap: 7px; font-size: 16px; }
  .seal { width: 28px; height: 28px; }
  .toolbar { gap: 0; }
  .quiet { padding-inline: 6px; font-size: 13px; }
  .hero-inner { gap: 13px; min-height: 158px; }
  .room { inset-inline-start: 22%; opacity: .45; }
  .portrait { width: 68px; height: 68px; }
  h1 { font-size: 40px; }
  .welcome { margin-top: 8px; font-size: 14px; }
  .workspace { padding-top: 16px; }
  .sheet { padding: 17px; }
  .work-list > li { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 11px; }
  .work-list h3 { font-size: 17px; }
}
.handoffs-sheet { margin-bottom: 20px; }
.handoffs-list { display: grid; gap: 8px; }
.handoffs-sheet .sheet-heading, .handoffs-empty { margin-bottom: 12px; }
.handoff-batch { border: 1px solid #e3dacb; border-radius: 7px; background: #f9f4ea; }
.handoff-batch summary {
  display: list-item;
  min-height: 44px;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.handoff-batch ul { margin: 0; padding: 0 14px 12px 36px; }
.handoff-batch li { margin-bottom: 7px; overflow-wrap: anywhere; }
.source-link { font-size: 14px; margin-inline-start: 6px; display: inline-block; }
.batch-review { color: #713321; margin-inline-start: 6px; }
.status { margin: 0 0 12px; }
.history { margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.history label { display: block; color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.history select { min-height: 44px; max-width: 100%; color: var(--ink); border: 1px solid #aba394; border-radius: 6px; padding: 5px 28px 5px 10px; background: #fffefa; font: inherit; }
.decision-jump { display: none; }
@media (max-width: 800px) {
  .decision-jump { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 700; }
  #decision-title { scroll-margin-top: 16px; }
}
