@font-face { font-family: Archivo; src: url(/fonts/Archivo-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
:root { --paper: #fbf5ed; --paper-2: #f2e9db; --ink: #1f2a22; --ink-2: #3a463d; --muted: #5c645b; --line: #d9ccb6; --accent: #a3401c; --green: #34503a; --white: #fff; --warn: #fff7d6; --radius: 8px; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 Archivo, system-ui, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
h1, h2, h3 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* top bar */
.top { display: flex; align-items: center; gap: 16px; padding: 0 20px; min-height: 58px; background: var(--ink); color: var(--paper); position: sticky; top: 0; z-index: 20; }
.brand { font: 22px "Instrument Serif", Georgia, serif; white-space: nowrap; }
.brand small { font: 12px Archivo, sans-serif; opacity: .7; margin-left: 8px; letter-spacing: .06em; text-transform: uppercase; }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.tabs a { color: var(--paper); text-decoration: none; padding: 0 14px; min-height: 58px; display: flex; align-items: center; opacity: .75; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { opacity: 1; } .tabs a[aria-current="page"] { opacity: 1; border-bottom-color: #e0885f; }
.tabs .badge { margin-left: 6px; background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; min-width: 20px; text-align: center; }
.who { font-size: 13px; opacity: .85; white-space: nowrap; display: flex; gap: 10px; align-items: center; }
.who button { background: transparent; border: 1px solid rgba(255,255,255,.4); color: var(--paper); border-radius: 6px; min-height: 34px; padding: 0 12px; cursor: pointer; }
.ribbon { background: var(--warn); color: #5a4a00; padding: 8px 20px; font-size: 13.5px; border-bottom: 1px solid #ecdc9a; }
.ribbon b { margin-right: 6px; }

main { padding: 20px; max-width: 1500px; margin: 0 auto; }
.pagehead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pagehead h1 { font-size: 34px; } .pagehead p { margin: 0; color: var(--muted); }

/* board */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; scroll-snap-type: x proximity; }
.col { flex: 0 0 240px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); scroll-snap-align: start; }
.col h2 { font: 600 12.5px Archivo, sans-serif; letter-spacing: .08em; text-transform: uppercase; padding: 11px 12px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.col.s-NEEDS_HUMAN h2 { background: #f6d9c8; } .col.s-ENROLLED h2 { background: #d6e5d3; }
.col .cards { display: grid; gap: 8px; padding: 8px; max-height: 68vh; overflow-y: auto; }
.card { text-align: left; width: 100%; background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; cursor: pointer; display: block; }
.card:hover { border-color: var(--ink); }
.card b { display: block; } .card span { display: block; font-size: 13px; color: var(--muted); }
.card .pill { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 10px; background: var(--paper-2); color: var(--ink-2); margin: 4px 4px 0 0; }
.card .pill.task { background: #f6d9c8; color: #6b2a0f; }
.empty { color: var(--muted); padding: 8px 4px; font-size: 13.5px; }

/* lists */
.list { display: grid; gap: 8px; max-width: 880px; }
.row { display: flex; gap: 12px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.row.done { opacity: .55; text-decoration: line-through; }
.row .grow { flex: 1; min-width: 0; } .row small { color: var(--muted); display: block; }
.btn { min-height: 40px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--ink); background: var(--white); cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--paper-2); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; } .btn.primary:hover { background: #29402e; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.accent:hover { background: #8a3417; }
.btn.danger { border-color: #9c1c1c; color: #9c1c1c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.daygroup h2 { font-size: 24px; margin: 18px 0 8px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--paper-2); }
.tag.noshow { background: #f6d9c8; } .tag.done { background: #d6e5d3; }

/* inbox + drawer */
.inbox { display: grid; grid-template-columns: 330px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .inbox { grid-template-columns: 1fr; } }
.threads { display: grid; gap: 6px; max-height: 75vh; overflow-y: auto; }
.thread { text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; cursor: pointer; }
.thread[aria-current="true"] { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.thread b { display: flex; justify-content: space-between; gap: 8px; } .thread span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; margin-top: 6px; }
.detail { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.detail h2 { font-size: 30px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13.5px; margin: 4px 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; align-items: center; }
.chat { background: #ece5dd; border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.bub { max-width: 80%; padding: 6px 10px; border-radius: 8px; background: #fff; box-shadow: 0 1px .5px rgba(0,0,0,.13); white-space: pre-wrap; overflow-wrap: anywhere; }
.bub.in { align-self: flex-start; } .bub.out { align-self: flex-end; background: #d9fdd3; }
.bub small { display: block; font-size: 11px; color: #667781; margin-top: 2px; }
.reply { display: flex; gap: 8px; margin-top: 10px; } .reply textarea { flex: 1; min-height: 44px; padding: 8px 10px; border: 1px solid var(--ink); border-radius: 6px; resize: vertical; background: #fff; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.facts section { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; } .facts h3 { font: 600 12px Archivo; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.facts ul { margin: 0; padding: 0; list-style: none; font-size: 14px; } .facts li { padding: 2px 0; }
.msg { padding: 8px 12px; border-radius: 6px; margin: 8px 0; } .msg.err { background: #f8dcdc; color: #6d1212; } .msg.ok { background: #d6e5d3; }
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(760px, 100vw); border: 0; padding: 0; background: var(--paper); box-shadow: -10px 0 40px rgba(0,0,0,.3); }
dialog.drawer::backdrop { background: rgba(0,0,0,.4); }
.drawer-in { padding: 18px; } .drawer .close { float: right; }

/* report */
.report { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; max-width: 640px; }

/* login */
.login { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.login h1 { font-size: 42px; margin-bottom: 4px; } .login p { color: var(--muted); }
.login form { display: grid; gap: 10px; margin: 18px 0; } .login label { font-weight: 600; font-size: 14px; }
.login input { min-height: 46px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 6px; background: #fff; }
.login hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.stagesel { min-height: 40px; border: 1px solid var(--ink); border-radius: 6px; padding: 0 8px; background: #fff; }
