/* Wait, How? — upload desk. Flat: paper, ink, one accent. No gradients, glow or shadows. */
@font-face { font-family: "Zodiak"; src: url(/fonts/Zodiak-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zodiak"; src: url(/fonts/Zodiak-400i.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Zodiak"; src: url(/fonts/Zodiak-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Zodiak"; src: url(/fonts/Zodiak-900.woff2) format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Osifont"; src: url(/fonts/osifont.ttf) format("truetype"); font-display: swap; }

:root {
  --paper: #F4F1EA;
  --ink: #111111;
  --ink-2: #55524C;
  --rule: #111111;
  --faint: #D9D4C7;
  --brand: #FF4F1F;
  --accent: #FF4F1F;
  --pad: 20px;
  --label: "Osifont", ui-monospace, monospace;
  --serif: "Zodiak", ui-serif, Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.5 var(--serif);
  min-height: 100vh; display: flex; flex-direction: column;
}
main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--pad) 48px; flex: 1; }
a { color: inherit; }
[hidden] { display: none !important; }

/* labels: technical-drawing lettering */
.label, .btn, .nav a, .nav button, .sheet-tag, .callout-n, .slot-word, .slot-aspect, .slot-file,
.block-h, .count, .step, .state-label, .state-meta, .channel-name, .channel-meta, .caption summary,
.foot, .hint, .arch-date, .arch-state, .slot-msg, .drop-empty, .drop-busy, .muted, .error {
  font-family: var(--label); text-transform: uppercase; letter-spacing: .12em; font-weight: 400;
}

/* top bar */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1120px; width: 100%; margin: 0 auto; padding: 14px var(--pad);
  border-bottom: 1px solid var(--rule);
}
.brand { text-decoration: none; display: inline-flex; align-items: center; }
.logo-text { font: 900 24px/1 var(--serif); letter-spacing: -.01em; }
.logo-svg { height: 28px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav form { margin: 0; }
.nav a, .nav button {
  font-size: 12px; line-height: 1; text-decoration: none; color: var(--ink); background: none; border: 0; display: block; font-family: var(--label); margin: 0;
  padding: 8px 6px; cursor: pointer; white-space: nowrap;
}
.nav a:hover, .nav button:hover { text-decoration: underline; text-underline-offset: 4px; }

/* title block */
.sheet { padding: 28px 0 24px; border-bottom: 1px solid var(--rule); }
.sheet-tag {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2);
  padding-bottom: 10px; margin-bottom: 18px; border-bottom: 1px dashed var(--ink);
}
.title {
  font: 900 clamp(38px, 10.5vw, 84px)/.98 var(--serif); letter-spacing: -.02em;
  margin: 0 0 14px; text-wrap: balance; overflow-wrap: anywhere;
}
.lede { font-size: clamp(18px, 4.6vw, 23px); line-height: 1.4; margin: 0; max-width: 34em; color: var(--ink); }

/* sections */
.block { padding: 26px 0 8px; border-bottom: 1px solid var(--rule); }
.block:last-child { border-bottom: 0; }
.block-h { display: flex; align-items: center; gap: 12px; font-size: 14px; margin: 0 0 18px; }
.block-n {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--ink);
  font-size: 13px; letter-spacing: 0;
}
.count { margin-left: auto; font-size: 13px; }
.hint { font-size: 12px; line-height: 1.6; color: var(--ink-2); margin: -6px 0 20px; max-width: 60em; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; font-size: 13px; line-height: 1;
  color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 0;
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:focus-visible, input:focus-visible, summary:focus-visible, .nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--paper); color: var(--ink); }
.btn-small { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.btn[disabled], .btn.is-busy { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.done { background: var(--accent); border-color: var(--accent); color: var(--ink); }

/* callouts */
.callout-n {
  flex: none; display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px;
  border: 1px solid var(--ink); border-radius: 999px; font-size: 13px; letter-spacing: .04em;
}
.leader { flex: 1; min-width: 16px; border-top: 1px dashed var(--ink); height: 0; align-self: center; }

/* status */
.steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--ink); }
.step { padding: 10px 8px 9px; font-size: 11px; display: flex; flex-direction: column; gap: 4px; color: var(--ink-2); border-left: 1px solid var(--ink); position: relative; }
.step:first-child { border-left: 0; }
.step-n { font-size: 10px; }
.step.past { color: var(--ink); }
.step.past .step-n::after { content: " ✓"; }
.step.now { background: var(--ink); color: var(--paper); }
.step.now::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--accent); }
.step.now.bad::after { background: var(--brand); }
.state { padding: 0 0 14px; }
.state-label { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 0 0 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.state.bad .dot { background: var(--paper); border: 2px solid var(--brand); }
.state-text { margin: 0; max-width: 40em; }
.state-meta { font-size: 11px; color: var(--ink-2); margin: 8px 0 0; }
.rerender {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px dashed var(--ink); padding: 14px; margin: 0 0 18px;
}
.rerender p { margin: 0; flex: 1 1 220px; }

/* slots */
.slots { display: grid; grid-template-columns: 1fr; gap: 0; }
.slot { padding: 0 0 28px; margin: 0 0 28px; border-bottom: 1px dashed var(--ink); min-width: 0; }
.slot-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.slot-word { font-size: 14px; }
.slot-aspect { font-size: 12px; color: var(--ink-2); border: 1px solid var(--ink-2); padding: 3px 6px 2px; }
.slot-purpose { margin: 0 0 12px; color: var(--ink-2); font-style: italic; }
.prompt { border: 1px solid var(--ink); padding: 14px; margin: 0 0 14px; background: var(--paper); }
.prompt-text { margin: 0 0 12px; font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; max-height: 15.5em; overflow: auto; }
.drop {
  position: relative; width: 100%; max-height: 70vh; border: 1px dashed var(--ink);
  display: grid; place-items: center; overflow: hidden; margin: 0 auto 12px;
  background-image: linear-gradient(var(--faint) 1px, transparent 1px), linear-gradient(90deg, var(--faint) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px;
}
.drop:not(.filled) { max-height: 440px; }
.drop.filled { border-style: solid; background: var(--ink); }
.preview { width: 100%; height: 100%; object-fit: contain; display: block; }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-2); background: var(--paper); padding: 8px 10px; }
.drop-busy { position: absolute; inset: auto 0 0 0; background: var(--ink); color: var(--paper); text-align: center; font-size: 12px; padding: 10px; }
.cross { width: 26px; height: 26px; position: relative; display: block; }
.cross::before, .cross::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px solid var(--ink); }
.cross::after { transform: rotate(90deg); }
.slot-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; width: 100%; }
.file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.slot-file { font-size: 11px; color: var(--ink-2); text-transform: none; letter-spacing: .06em; }
.slot-msg { font-size: 12px; min-height: 1.4em; margin: 8px 0 0; }
.slot-msg.err { color: var(--ink); }
.slot-msg.err::before { content: "⚠ "; color: var(--brand); }
.slot-msg.warn::before { content: "△ "; color: var(--brand); }
.slot-msg.ok::before { content: "● "; color: var(--accent); }

/* channels */
.channel { padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px dashed var(--ink); }
.channel:last-child { border-bottom: 0; margin-bottom: 0; }
.channel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: nowrap; }
.channel-name { font-size: 15px; }
.channel-meta { font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.channel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.caption { margin-top: 12px; }
.caption summary { font-size: 12px; cursor: pointer; padding: 6px 0; list-style: none; }
.caption summary::before { content: "+ "; }
.caption[open] summary::before { content: "− "; }
.caption pre {
  font: 400 15px/1.55 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere;
  border-left: 1px solid var(--ink); padding: 4px 0 4px 14px; margin: 8px 0 0;
}
.muted { font-size: 11px; color: var(--ink-2); align-self: center; }

/* empty states */
.empty { display: flex; gap: 16px; align-items: flex-start; border: 1px dashed var(--ink); padding: 18px; margin-bottom: 18px; }
.empty .cross { flex: none; margin-top: 2px; }
.empty p { margin: 0; }
.empty strong { font-weight: 700; }

/* archive */
.archive { list-style: none; margin: 0; padding: 0; }
.arch { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; padding: 16px 0; border-bottom: 1px dashed var(--ink); text-decoration: none; }
.arch:hover .arch-title { text-decoration: underline; text-underline-offset: 4px; }
.arch-date { font-size: 12px; grid-row: 1; }
.arch-title { font: 700 20px/1.2 var(--serif); grid-column: 1 / -1; }
.arch-state { font-size: 11px; color: var(--ink-2); grid-row: 1; justify-self: end; }
.arch-state.state-done::before { content: "● "; color: var(--accent); }

/* login */
.login { max-width: 460px; margin: 0 auto; padding: 40px 0; }
.login .title { font-size: clamp(48px, 15vw, 76px); }
.login .lede { margin-bottom: 30px; }
.login-form { display: grid; gap: 12px; border-top: 1px solid var(--ink); padding-top: 22px; }
.label { display: flex; align-items: center; gap: 10px; font-size: 13px; }
input[type=password] {
  width: 100%; min-height: 52px; padding: 12px 14px; font: 400 18px var(--serif);
  color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 0; appearance: none;
}
.error { margin: 0; font-size: 12px; }
.error::before { content: "⚠ "; color: var(--brand); }

/* footer */
.foot {
  display: flex; justify-content: space-between; max-width: 1120px; width: 100%; margin: 0 auto;
  padding: 12px var(--pad) 18px; border-top: 1px solid var(--rule); font-size: 10px; color: var(--ink-2);
}

.toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 10;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border: 1px solid var(--ink);
  font: 400 12px/1 var(--label); text-transform: uppercase; letter-spacing: .12em;
}

@media (min-width: 760px) {
  :root { --pad: 32px; }
  .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; row-gap: 36px; padding-bottom: 28px; }
  .slot { border-bottom: 0; margin: 0; padding: 0; }
  .channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .channel { border-bottom: 0; }
  .step { font-size: 12px; padding: 12px 14px 11px; }
  .arch { grid-template-columns: 120px 1fr auto; align-items: baseline; }
  .arch-title { grid-column: 2; grid-row: 1; }
  .arch-state { grid-column: 3; }
}
@media (min-width: 1100px) {
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color .12s, color .12s; }
}

/* profiles */
.profile-imgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0 0 16px; }
.profile-img { margin: 0; border: 1px solid var(--ink); background: var(--paper); display: grid; min-width: 0; }
.profile-img img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--ink); background: repeating-conic-gradient(var(--paper) 0 25%, #E8E3D8 0 50%) 0 0 / 16px 16px; }
.profile-img figcaption { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; font-size: 13px; line-height: 1.35; }
.profile-fields .prompt-text { white-space: pre-wrap; max-height: none; }
.field-label { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 8px; font-family: var(--label); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; }
.field-label .over { color: var(--brand); }
.profile-img img[src*="avatar_"] { width: min(200px, 70%); margin: 16px auto; border: 1px solid var(--ink); border-radius: 50%; }
@media (max-width: 440px) {
  .top { flex-wrap: wrap; row-gap: 6px; }
  .nav { width: 100%; justify-content: space-between; margin: 0 -6px; width: calc(100% + 12px); }
}
.sheet .hint { margin-top: 16px; }
.profile-img img[src*="light-text"] { background: #161718; }
