@import url("../fonts/fonts.css");

/* ============================================================
   WATERMARK — period theme
   ============================================================ */

:root {
    --paper: #d8c8a4;
    --paper-warm: #efe6cc;
    --paper-bright: #fbf4dc;
    --ink: #1a1410;
    --ink-soft: #3a2c1c;
    --wall: #2c2218;
    --wall-dark: #1d1a14;
    --rubber: #a8443a;
    --gold: #c9a35a;
    --red-stamp: #8a1a14;
    --green: #4a6a4a;
    --bad: #b94a3a;
    --good: #6a8a4a;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--wall-dark);
    font-family: 'EB Garamond', Georgia, serif;
    color: var(--paper);
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

#app { height: 100%; }

button {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.7rem 1.2rem;
    border: 1px solid var(--gold);
    background: transparent;
    color: var(--paper);
    cursor: pointer;
    transition: background 0.15s;
}
button:hover:not(:disabled) { background: rgba(201, 163, 90, 0.15); }
button:disabled { opacity: 0.35; cursor: not-allowed; }
button.primary {
    background: var(--gold);
    color: var(--wall-dark);
    border-color: var(--gold);
    font-weight: 600;
}
button.primary:hover:not(:disabled) { background: #d8b870; }
button.ghost { border-color: rgba(216, 200, 164, 0.4); }

h1, h2, h3 {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0 0 0.6rem 0;
}

/* ----------- Game shell ----------- */
.game {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.6rem 1.2rem;
    background: #110f0a;
    border-bottom: 1px solid #3a2c1c;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
}
.status-bar .brand {
    font-family: 'Special Elite', monospace;
    font-size: 1.2rem;
    color: var(--gold);
    letter-spacing: 0.1em;
}
.status-bar .sub { color: rgba(216, 200, 164, 0.5); font-size: 0.8rem; }
.status-bar .stat { display: flex; flex-direction: column; gap: 2px; min-width: 80px; }
.status-bar .label { font-size: 0.65rem; opacity: 0.55; text-transform: uppercase; letter-spacing: 0.15em; }
.status-bar .value { font-size: 1rem; color: var(--paper-bright); }
.status-bar .heat { position: relative; min-width: 140px; }
.status-bar .heat .bar {
    position: absolute; bottom: -6px; left: 0; right: 0; height: 3px;
    background: rgba(216, 200, 164, 0.12);
}
.status-bar .heat .bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--good), var(--gold) 50%, var(--bad));
    transition: width 0.4s;
}

.stage { position: relative; flex: 1; overflow: hidden; }

/* ----------- Scenes: shared ----------- */
.scene {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 50px);
    overflow: hidden;
}
.scene > .room-svg,
.scene > svg.room-svg {
    position: absolute; inset: 0; width: 100%; height: 100%;
}
.room-svg {
    position: absolute; inset: 0; width: 100%; height: 100%;
    z-index: 0;
}
.scene .overlay {
    position: relative; z-index: 2;
    padding: 2rem;
    display: flex; flex-direction: column;
    gap: 1.5rem;
    min-height: calc(100vh - 50px);
}

/* ----------- Morning / newspaper ----------- */
.morning .overlay { align-items: center; justify-content: center; }
.newspaper {
    width: min(720px, 95%);
    background: var(--paper);
    color: var(--ink);
    padding: 2rem 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 2px 0 rgba(0,0,0,0.2);
    transform: rotate(-0.5deg);
}
.newspaper .header { border-bottom: 3px double var(--ink); padding-bottom: 0.6rem; margin-bottom: 1rem; text-align: center; }
.newspaper .masthead { font-family: 'Special Elite', monospace; font-size: 2.4rem; letter-spacing: 0.05em; }
.newspaper .dateline { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; opacity: 0.7; margin-top: 0.3rem; }
.newspaper .columns { column-count: 2; column-gap: 1.5rem; }
.newspaper .lede { font-size: 1.05rem; line-height: 1.5; margin: 0 0 0.8rem; font-weight: 600; }
.newspaper .filler { font-size: 0.9rem; opacity: 0.7; line-height: 1.5; }

.morning .actions {
    width: min(720px, 95%);
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 2rem;
}
.morning .flavor { flex: 1; font-style: italic; color: rgba(216, 200, 164, 0.85); line-height: 1.5; }
.morning .flavor p { margin: 0; }

/* ----------- Desk / client intake ----------- */
.desk .overlay { align-items: stretch; justify-content: center; }
.client-card {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    background: rgba(20, 16, 12, 0.85);
    border: 1px solid #3a2c1c;
    padding: 1.5rem;
    width: min(900px, 100%);
    margin: 0 auto;
}
.portrait-frame {
    display: flex; flex-direction: column;
    background: #0e0c0a;
    border: 1px solid #3a2c1c;
    padding: 0.5rem;
}
.portrait-svg { width: 100%; height: auto; aspect-ratio: 5 / 6; display: block; }
.name-tag { padding: 0.6rem 0.2rem 0; font-family: 'IBM Plex Mono', monospace; }
.name-tag .name { font-size: 1rem; color: var(--paper-bright); }
.name-tag .occ { font-size: 0.78rem; opacity: 0.6; margin-top: 2px; }

.dossier { display: flex; flex-direction: column; gap: 1rem; }
.document-header {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: var(--gold);
    border-bottom: 1px dashed rgba(201,163,90,0.4);
    padding-bottom: 0.5rem;
}
.dossier blockquote {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    font-style: italic;
    color: var(--paper-bright);
    padding-left: 1rem;
    border-left: 2px solid var(--gold);
}
.offer { display: flex; flex-direction: column; gap: 4px; font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; }
.offer .hint { opacity: 0.55; font-size: 0.75rem; }
.dossier .actions { display: flex; gap: 0.8rem; margin-top: auto; }

.queue {
    display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
    margin: 0 auto; width: min(900px, 100%);
    font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem;
}
.queue-label { opacity: 0.55; margin-right: 0.5rem; text-transform: uppercase; letter-spacing: 0.1em; }
.queue-pill { padding: 0.3rem 0.6rem; border: 1px solid rgba(216,200,164,0.25); }
.queue-pill.done { opacity: 0.4; text-decoration: line-through; }
.queue-pill .status { opacity: 0.5; margin-left: 0.4rem; }

.empty-desk { text-align: center; margin: auto; }

/* ----------- Workshop ticket ----------- */
.workshop .overlay { align-items: center; }
.ticket-panel {
    width: min(720px, 95%);
    background: rgba(216, 200, 164, 0.96);
    color: var(--ink);
    padding: 1.5rem 1.8rem;
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.ticket-panel h2 { font-size: 1.4rem; }
.ticket-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem; opacity: 0.7; margin-bottom: 1rem;
    border-bottom: 1px dashed var(--ink-soft); padding-bottom: 0.5rem;
}
.task-list { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.task-row {
    display: grid; grid-template-columns: 80px 1fr 70px;
    align-items: center;
    background: transparent;
    border: 1px solid var(--ink-soft);
    color: var(--ink);
    padding: 0.7rem 0.9rem;
    text-transform: none; letter-spacing: 0;
    font-family: 'EB Garamond', serif;
    font-size: 1rem;
    text-align: left;
}
.task-row:hover:not(:disabled) { background: rgba(58, 44, 28, 0.1); }
.task-row .task-type { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: var(--ink-soft); letter-spacing: 0.15em; }
.task-row .task-score { font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; text-align: right; }
.task-row.done .task-score { color: var(--good); font-weight: 700; }
.task-row.done { opacity: 0.75; }

.ticket-actions { display: flex; justify-content: space-between; gap: 0.8rem; }
.ticket-actions .ghost { color: var(--ink); border-color: var(--ink-soft); }

/* ----------- Craft (carving + signature) ----------- */
.craft {
    width: min(960px, 100%);
    margin: 0 auto;
    background: rgba(20, 16, 12, 0.92);
    border: 1px solid #3a2c1c;
    padding: 1.5rem;
}
.craft-header h3 { color: var(--paper-bright); margin-bottom: 0.3rem; }
.craft-header .hint { opacity: 0.65; margin: 0 0 1rem; font-style: italic; }
.craft-stage {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
    margin-bottom: 1rem;
}
.panel-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--gold);
    margin-bottom: 0.4rem;
}
.ref-svg, .carve-svg, .paper-svg {
    width: 400px; height: 400px;
    max-width: 100%;
    display: block;
    background: #0a0806;
    border: 1px solid #3a2c1c;
    cursor: crosshair;
    touch-action: none;
}
.craft-footer { display: flex; align-items: center; gap: 1rem; }
.craft-footer .meter { flex: 1; display: flex; align-items: center; gap: 0.8rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; }
.craft-footer .meter .bar { flex: 1; height: 8px; background: rgba(216,200,164,0.1); position: relative; }
.craft-footer .meter .fill { height: 100%; background: linear-gradient(90deg, var(--bad), var(--gold) 50%, var(--good)); transition: width 0.2s; }
.craft-footer .pct { min-width: 50px; text-align: right; color: var(--paper-bright); }

/* ----------- QC bench ----------- */
.qc .overlay { align-items: center; }
.qc-panel {
    width: min(820px, 95%);
    background: rgba(216, 200, 164, 0.96);
    color: var(--ink);
    padding: 1.5rem 1.8rem;
    box-shadow: 0 16px 40px rgba(0,0,0,0.6);
}
.qc-sub { font-style: italic; margin-bottom: 1rem; opacity: 0.7; }
.qc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.2rem; }
.qc-card { background: rgba(58,44,28,0.06); border: 1px solid var(--ink-soft); padding: 1rem; }
.qc-label { font-weight: 700; margin-bottom: 0.6rem; }
.qc-meter { display: flex; align-items: center; gap: 0.6rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; margin-bottom: 0.6rem; }
.qc-meter .bar { flex: 1; height: 8px; background: rgba(58,44,28,0.15); }
.qc-meter .fill { height: 100%; background: linear-gradient(90deg, var(--bad), var(--gold), var(--good)); }
.qc-verdict { font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.6rem; }
.qc-verdict.good { color: var(--good); }
.qc-verdict.ok { color: var(--ink-soft); }
.qc-verdict.risk { color: #b87a20; }
.qc-verdict.bad { color: var(--bad); }
.qc-card .ghost { color: var(--ink); border-color: var(--ink-soft); }

.qc-summary { padding: 0.8rem 0; border-top: 1px dashed var(--ink-soft); border-bottom: 1px dashed var(--ink-soft); margin-bottom: 1rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.9rem; }
.qc-summary .risk { font-family: 'EB Garamond', serif; font-style: italic; margin-top: 0.5rem; font-size: 1.05rem; }
.qc-actions { display: flex; justify-content: space-between; gap: 0.8rem; }
.qc-actions .ghost { color: var(--ink); border-color: var(--ink-soft); }

/* ----------- End-of-day & Game over ----------- */
.eod .overlay, .game-over .overlay { align-items: center; justify-content: center; }
.game-over { background: #050403; min-height: 100vh; }
.ledger-card, .end-card {
    width: min(560px, 95%);
    background: rgba(20,16,12,0.95);
    border: 1px solid #3a2c1c;
    padding: 1.8rem;
}
.end-card { width: min(680px, 95%); }
.ledger-card h2, .end-card h1 { color: var(--gold); }
.end-card h1 { font-size: 2.2rem; letter-spacing: 0.05em; }
.end-message { font-style: italic; line-height: 1.6; color: var(--paper-bright); margin: 1rem 0 1.5rem; }
.ledger-rows { display: flex; flex-direction: column; gap: 0.4rem; margin: 1rem 0; font-family: 'IBM Plex Mono', monospace; font-size: 0.9rem; }
.ledger-rows .row { display: flex; justify-content: space-between; padding: 0.3rem 0; border-bottom: 1px dashed rgba(216,200,164,0.1); }
.end-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.9rem; margin: 1rem 0; }
.ledger-list { list-style: none; padding: 0; margin: 0 0 1.5rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; }
.ledger-list li { padding: 0.4rem 0; border-bottom: 1px dashed rgba(216,200,164,0.1); display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: baseline; }
.ledger-list .who { color: var(--paper-bright); min-width: 160px; }
.ledger-list .what { opacity: 0.6; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.1em; }
.ledger-list .paid { color: var(--good); }
.ledger-list .outcome { color: var(--gold); margin-left: auto; }
.muted { opacity: 0.5; }

/* ----------- Ticket requirements ----------- */
.ticket-requirements {
    background: rgba(58, 44, 28, 0.08);
    border-left: 3px solid var(--ink-soft);
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
}
.ticket-requirements .req-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--ink-soft);
    margin-bottom: 0.4rem;
}
.ticket-requirements ul { margin: 0; padding: 0; list-style: none; }
.ticket-requirements li { font-size: 1rem; padding: 2px 0; }

.task-chosen { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; opacity: 0.6; }

/* ----------- The Forger's Manual (book) ----------- */
.manual-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
    z-index: 50;
    padding: 1rem;
}
.manual-book {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(1100px, 100%);
    height: min(720px, 95vh);
    background: #c9b482;
    box-shadow: 0 30px 80px rgba(0,0,0,0.9), inset 0 0 60px rgba(58, 30, 10, 0.3);
    position: relative;
    border: 3px solid #2a1a0a;
}
.book-spine {
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 16px; transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(0,0,0,0.4), rgba(0,0,0,0.05), rgba(0,0,0,0.4));
    z-index: 1;
}
.book-page {
    padding: 1.8rem 2rem;
    color: var(--ink);
    overflow-y: auto;
    background:
        radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(80, 50, 20, 0.2) 100%),
        repeating-linear-gradient(0deg, transparent 0, transparent 22px, rgba(58, 40, 20, 0.05) 22px, rgba(58, 40, 20, 0.05) 23px),
        #efe2bd;
    position: relative;
}
.book-page.left  { border-right: 1px solid rgba(58, 30, 10, 0.2); }
.book-page.right { border-left:  1px solid rgba(58, 30, 10, 0.2); }
.page-header { border-bottom: 2px solid var(--ink); padding-bottom: 0.4rem; margin-bottom: 1rem; }
.page-title { font-family: 'Special Elite', monospace; font-size: 1.2rem; letter-spacing: 0.08em; }
.page-sub { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; opacity: 0.7; margin-top: 2px; }

.task-context {
    background: rgba(138, 26, 20, 0.08);
    border-left: 3px solid var(--red-stamp);
    padding: 0.7rem 0.9rem;
    margin-bottom: 1rem;
}
.task-context .ctx-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem; letter-spacing: 0.2em;
    color: var(--red-stamp);
}
.task-context .ctx-need { font-size: 1.05rem; font-weight: 700; margin-top: 3px; }
.task-context .ctx-hint { font-size: 0.85rem; font-style: italic; margin-top: 4px; opacity: 0.75; }

.tabs { display: flex; gap: 4px; margin-bottom: 0.6rem; }
.tabs .tab {
    background: rgba(58, 30, 10, 0.08);
    border: 1px solid rgba(58, 30, 10, 0.3);
    color: var(--ink);
    padding: 0.45rem 0.8rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.15em;
}
.tabs .tab.active {
    background: var(--ink);
    color: var(--paper-bright);
    border-color: var(--ink);
}

.entry-list { display: flex; flex-direction: column; gap: 2px; }
.entry-row {
    display: flex; flex-direction: column;
    align-items: flex-start;
    text-align: left; gap: 1px;
    padding: 0.5rem 0.7rem;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: 1px dashed rgba(58, 30, 10, 0.18);
    color: var(--ink);
    font-family: 'EB Garamond', serif;
    text-transform: none; letter-spacing: 0;
}
.entry-row:hover { background: rgba(58, 30, 10, 0.06); }
.entry-row.selected {
    background: rgba(201, 163, 90, 0.25);
    border-color: var(--ink-soft);
}
.entry-title { font-size: 1rem; font-weight: 600; }
.entry-auth { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; opacity: 0.6; }

.empty-page {
    height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--ink-soft); opacity: 0.5; font-style: italic;
}
.empty-page .empty-art { font-size: 4rem; margin-bottom: 1rem; }

.entry-detail { display: flex; flex-direction: column; height: 100%; }
.entry-detail-title { font-family: 'EB Garamond', serif; font-size: 1.5rem; font-weight: 700; }
.entry-detail-auth { font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; opacity: 0.65; margin-bottom: 0.8rem; }
.entry-figure {
    background: rgba(58, 30, 10, 0.05);
    border: 1px solid rgba(58, 30, 10, 0.2);
    padding: 0.8rem;
    margin-bottom: 0.8rem;
}
.entry-svg {
    width: 220px; height: 220px;
    display: block; margin: 0 auto;
    background: var(--paper-warm);
    border: 1px solid rgba(58, 30, 10, 0.3);
}
.entry-caption {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    text-align: center;
    opacity: 0.7;
    margin-top: 0.5rem;
    letter-spacing: 0.08em;
}
.entry-notes {
    background: rgba(58, 30, 10, 0.05);
    border-left: 3px solid var(--ink-soft);
    padding: 0.6rem 0.9rem;
    flex: 1;
    margin-bottom: 0.8rem;
}
.entry-notes .notes-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem; letter-spacing: 0.2em;
    color: var(--ink-soft); margin-bottom: 0.4rem;
}
.entry-notes p { margin: 0; font-size: 0.95rem; line-height: 1.45; }
.entry-actions { display: flex; justify-content: space-between; gap: 0.8rem; margin-top: auto; }
.entry-actions .ghost { color: var(--ink); border-color: var(--ink-soft); }

/* ----------- Craft "from memory" panel ----------- */
.reference-side {
    display: flex; align-items: center;
}
.ref-blurb {
    background: rgba(58, 30, 10, 0.25);
    border-left: 3px solid var(--gold);
    padding: 1rem 1.2rem;
    width: 100%;
    max-width: 320px;
}
.ref-blurb-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--gold);
}
.ref-blurb-name {
    font-family: 'EB Garamond', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--paper-bright);
    margin: 0.3rem 0 0.6rem;
}
.ref-blurb p { font-size: 0.9rem; line-height: 1.5; opacity: 0.75; font-style: italic; margin: 0 0 0.8rem; }

/* ----------- Reopen-manual button on craft surface ----------- */
.reopen-manual {
    margin-top: 0.6rem;
    font-size: 0.7rem;
    padding: 0.4rem 0.7rem;
    width: 100%;
}

/* ----------- QC wrong-reference styling ----------- */
.qc-card.wrong-ref {
    border-color: var(--bad);
    background: rgba(185, 74, 58, 0.08);
}
.qc-req { font-style: italic; font-size: 0.9rem; opacity: 0.75; margin-bottom: 0.4rem; }
.qc-req em { color: var(--red-stamp); font-style: normal; }
.qc-chosen { font-size: 0.9rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.qc-chosen .match { color: var(--good); font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; }
.qc-chosen .mismatch { color: var(--bad); font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; }
.qc-summary .risk-bad {
    color: var(--bad);
    font-weight: 700;
    margin-top: 0.5rem;
    font-family: 'EB Garamond', serif;
    font-size: 1.05rem;
}

/* ============================================================
   COMPOSITION DESK — the v0.3 vision
   ============================================================ */

.composition-desk {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 50px);
    display: grid;
    grid-template-columns: 96px 1fr;
    background:
        repeating-linear-gradient(0deg,
            transparent 0, transparent 32px,
            rgba(20, 14, 8, 0.18) 32px, rgba(20, 14, 8, 0.18) 33px),
        repeating-linear-gradient(90deg,
            rgba(58, 30, 10, 0.10) 0, rgba(58, 30, 10, 0.10) 220px,
            rgba(36, 22, 10, 0.10) 220px, rgba(36, 22, 10, 0.10) 440px),
        linear-gradient(180deg, #3a2616 0%, #281a0e 100%);
}

.desk-surface {
    position: relative;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    grid-template-rows: 1fr auto;
    gap: 1.5rem;
}
.empty-desk-msg { color: var(--paper); opacity: 0.6; align-self: center; justify-self: center; }

.desk-slot {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.4);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    padding: 0.6rem;
}
.template-slot {
    grid-column: 2;
    grid-row: 1;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    display: flex;
    justify-content: center;
}
.manual-slot {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    cursor: pointer;
    transform: rotate(-1.5deg);
    max-width: 220px;
}
.folder-slot {
    grid-column: 3;
    grid-row: 1;
    background: #d4c084;
    color: var(--ink);
    transform: rotate(1.5deg);
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    padding: 1rem;
}
.jobs-slot {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex; gap: 0.6rem; align-items: center;
    background: rgba(0,0,0,0.35);
    padding: 0.7rem 1rem;
}
.jobs-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--gold);
    margin-right: 0.5rem;
}
.job-chip {
    background: rgba(216,200,164,0.08);
    border: 1px solid rgba(216,200,164,0.25);
    color: var(--paper);
    padding: 0.4rem 0.7rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    text-transform: none; letter-spacing: 0;
}
.job-chip.active { background: var(--gold); color: var(--wall-dark); border-color: var(--gold); }
.job-chip.done { opacity: 0.45; text-decoration: line-through; }
.qc-button {
    margin-left: auto;
    background: var(--gold); color: var(--wall-dark);
    border-color: var(--gold); font-weight: 600;
}

/* --- Closed manual book on desk --- */
.closed-book {
    background: linear-gradient(135deg, #6a4828, #4a3018);
    color: var(--paper);
    padding: 1.5rem 1rem;
    height: 200px;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    border: 2px solid #2a1a0e;
    box-shadow: inset -8px 0 10px rgba(0,0,0,0.4), 4px 4px 12px rgba(0,0,0,0.5);
    text-align: center;
}
.book-title {
    font-family: 'Special Elite', monospace;
    color: var(--gold);
    letter-spacing: 0.15em;
    font-size: 0.85rem;
}
.book-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    opacity: 0.5;
    margin-top: 0.5rem;
    letter-spacing: 0.15em;
}

/* --- Tools tray --- */
.tools-tray {
    display: flex; flex-direction: column;
    align-items: center; gap: 0.4rem;
    padding: 1rem 0.4rem;
    background: linear-gradient(180deg, #1a120a, #0e0a06);
    border-right: 1px solid #000;
    box-shadow: inset -4px 0 8px rgba(0,0,0,0.5);
}
.tools-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--gold);
    margin-bottom: 0.6rem;
}
.tool {
    width: 72px; height: 72px;
    background: rgba(216,200,164,0.05);
    border: 1px solid rgba(216,200,164,0.18);
    color: var(--paper);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 0; gap: 4px;
    text-transform: none; letter-spacing: 0;
    cursor: pointer;
}
.tool:hover { background: rgba(216,200,164,0.12); }
.tool.active {
    background: var(--gold); color: var(--wall-dark);
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(201, 163, 90, 0.4);
}
.tool-icon { font-size: 1.8rem; line-height: 1; }
.tool-name { font-size: 0.65rem; font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.05em; }
.tools-hint {
    margin-top: 0.6rem;
    font-size: 0.65rem;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--gold);
    opacity: 0.85;
    text-align: center;
    line-height: 1.4;
}

/* --- Document on the desk --- */
.document {
    width: 100%;
    max-width: 520px;
    aspect-ratio: 600 / 850;
    box-shadow: 0 16px 40px rgba(0,0,0,0.7), 0 2px 0 rgba(0,0,0,0.4);
    transform: rotate(-0.5deg);
}
.document.tool-knife .zone[stroke-dasharray] { cursor: crosshair; }
.document.tool-pen .zone[stroke-dasharray] { cursor: crosshair; }
.document.tool-typewriter .zone[stroke-dasharray] { cursor: text; }
.document.tool-photo .zone[stroke-dasharray] { cursor: copy; }
.doc-svg { width: 100%; height: 100%; display: block; }
.zone { transition: stroke 0.15s, fill 0.15s; }
.zone.hot { fill: rgba(201, 163, 90, 0.15); }
.zone:hover { fill: rgba(201, 163, 90, 0.1); }

/* --- Client folder --- */
.client-folder {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--ink);
}
.folder-tab {
    background: var(--ink-soft); color: var(--paper-warm);
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    display: inline-block;
    margin-bottom: 0.6rem;
}
.folder-photo {
    width: 110px;
    background: #efe2bd;
    border: 1px solid var(--ink-soft);
    padding: 4px;
    margin-bottom: 0.8rem;
    cursor: pointer;
    position: relative;
}
.folder-photo .portrait-svg { display: block; }
.folder-photo:hover { box-shadow: 0 0 0 2px var(--gold); }
.folder-photo.removed { opacity: 0.4; cursor: default; }
.folder-photo .empty-slot {
    height: 132px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; color: var(--ink-soft);
    border: 1px dashed var(--ink-soft);
}
.folder-photo .photo-stamp {
    position: absolute; bottom: 4px; left: 4px; right: 4px;
    font-size: 0.55rem; text-align: center;
    background: rgba(0,0,0,0.5); color: var(--paper);
    letter-spacing: 0.1em; padding: 1px;
}
.folder-fields {
    display: grid;
    grid-template-columns: 90px 1fr;
    column-gap: 0.6rem; row-gap: 0.25rem;
    font-size: 0.78rem;
    margin: 0;
}
.folder-fields dt {
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    color: var(--ink-soft);
    padding-top: 2px;
}
.folder-fields dd { margin: 0; }
.folder-fields .age { opacity: 0.55; }

/* --- Typewriter --- */
.craft-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 60;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 2rem;
}
.cancel-craft {
    margin-top: 1rem;
    color: var(--paper); border-color: rgba(216,200,164,0.35);
}
.typewriter {
    width: min(820px, 95vw);
    background: #1a140e;
    border: 1px solid #3a2c1c;
    padding: 1.5rem 1.8rem;
    color: var(--paper-bright);
}
.tw-header h3 { color: var(--paper-bright); margin: 0 0 0.3rem; }
.tw-hint { opacity: 0.65; font-style: italic; margin: 0 0 1rem; font-size: 0.95rem; }
.tw-form { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.tw-row {
    display: grid;
    grid-template-columns: 140px 1fr 140px;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0.8rem;
    background: rgba(216,200,164,0.05);
    border-left: 3px solid transparent;
}
.tw-row.active { border-left-color: var(--gold); background: rgba(216,200,164,0.1); }
.tw-row.typed { border-left-color: var(--good); }
.tw-row label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--gold);
}
.tw-row input {
    background: var(--paper-bright);
    color: var(--ink);
    border: 1px solid var(--ink-soft);
    font-family: 'Special Elite', monospace;
    font-size: 1.1rem;
    padding: 0.4rem 0.6rem;
    letter-spacing: 0.1em;
    width: 100%;
    text-transform: uppercase;
}
.tw-row input:focus { outline: 2px solid var(--gold); }
.tw-required-font {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    opacity: 0.6;
    text-align: right;
}
.tw-preview {
    background: var(--paper-warm); color: var(--ink);
    padding: 1rem;
    margin-bottom: 1rem;
}
.tw-preview-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
    color: var(--ink-soft);
}
.tw-preview-paper {
    background: var(--paper-bright);
    padding: 0.6rem 0.8rem;
    font-size: 1.05rem;
}
.tw-preview-row {
    display: grid; grid-template-columns: 140px 1fr;
    padding: 0.2rem 0;
    border-bottom: 1px dashed rgba(58,40,20,0.18);
}
.tw-preview-row .lbl {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem; letter-spacing: 0.15em;
    color: var(--ink-soft); padding-top: 4px;
}
.tw-actions { display: flex; justify-content: flex-end; }

/* --- Photo cropper --- */
.photo-cropper {
    width: min(720px, 95vw);
    background: #1a140e;
    border: 1px solid #3a2c1c;
    padding: 1.5rem 1.8rem;
    color: var(--paper-bright);
}
.pc-header h3 { color: var(--paper-bright); margin: 0 0 0.3rem; }
.pc-hint { font-style: italic; opacity: 0.65; margin: 0 0 1rem; }
.pc-crop-stage, .pc-affix-stage { display: flex; justify-content: center; padding: 1rem; }
.raw-photo {
    position: relative;
    width: 200px; height: 240px;
    background: #0e0c0a;
    border: 1px solid var(--ink-soft);
    touch-action: none;
}
.raw-photo > svg { width: 100%; height: 100%; display: block; }
.crop-box {
    position: absolute;
    width: 110px; height: 140px;
    border: 2px dashed var(--gold);
    background: rgba(201, 163, 90, 0.1);
    cursor: move;
}
.crop-box .dim {
    position: absolute;
    bottom: -22px; left: 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--gold);
    letter-spacing: 0.1em;
}
.affix-zone {
    position: relative;
    width: 240px; height: 280px;
    background: #efe2bd;
    border: 1px solid var(--ink-soft);
    touch-action: none;
    overflow: hidden;
}
.zone-outline {
    position: absolute; inset: 50px 60px;
    border: 2px dashed var(--ink-soft);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 4px;
}
.zone-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--ink-soft);
}
.affixed-photo {
    position: absolute;
    top: 50%; left: 50%;
    width: 120px; height: 150px;
    cursor: grab;
}
.affixed-photo:active { cursor: grabbing; }
.affixed-inner {
    width: 100%; height: 100%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.pc-readouts {
    margin-top: 0.8rem;
    display: flex; gap: 1.5rem; justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
}
.pc-readouts .ok { color: var(--good); }
.pc-readouts .warn { color: var(--bad); }
.pc-actions { display: flex; justify-content: space-between; gap: 0.8rem; }

/* --- QC report --- */
.qc-report-panel {
    width: min(900px, 95%);
    background: var(--paper-warm);
    color: var(--ink);
    padding: 1.5rem 1.8rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    margin: 0 auto;
}
.qc-report-panel h2 {
    font-family: 'Special Elite', monospace;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 0.4rem;
}
.qc-report-sub { font-style: italic; opacity: 0.7; margin-bottom: 1rem; }
.qc-report { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.qc-section { background: rgba(58, 30, 10, 0.05); padding: 0.6rem 0.9rem; border-left: 3px solid var(--ink-soft); }
.qc-section h4 {
    margin: 0 0 0.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem; letter-spacing: 0.2em;
    color: var(--ink-soft);
}
.qc-line {
    display: grid; grid-template-columns: 24px 140px 1fr auto;
    align-items: center; gap: 0.6rem;
    padding: 0.3rem 0;
    border-bottom: 1px dashed rgba(58, 30, 10, 0.12);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem;
}
.qc-line:last-child { border-bottom: none; }
.qc-line .dot { font-weight: 700; font-size: 1.1rem; }
.qc-line.ok .dot { color: var(--good); }
.qc-line.bad .dot { color: var(--bad); }
.qc-line .verdict { color: var(--ink-soft); }
.qc-line.bad .verdict { color: var(--bad); }
.qc-summary-block {
    padding: 0.9rem 1rem;
    margin: 1rem 0;
    border-left: 4px solid;
}
.qc-summary-block.ok { background: rgba(106, 138, 74, 0.1); border-color: var(--good); }
.qc-summary-block.bad { background: rgba(185, 74, 58, 0.1); border-color: var(--bad); }
.qc-summary-block strong { font-family: 'Special Elite', monospace; letter-spacing: 0.05em; font-size: 1.1rem; }
.qc-summary-block p { margin: 0.4rem 0 0; font-style: italic; }
.qc-actions { display: flex; justify-content: space-between; }
.qc-actions .ghost { color: var(--ink); border-color: var(--ink-soft); }

.loading-progress { display: none; }
.loading-progress-text { display: none; }

#blazor-error-ui {
    background: var(--paper);
    color: var(--ink);
    font-family: 'IBM Plex Mono', monospace;
    bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    left: 0; padding: 0.6rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem;
}

/* ============================================================
   Title screen & settings
   ============================================================ */

.title-scene {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at 35% 30%, #3a2c1c 0%, var(--wall-dark) 70%);
}

.title-card { text-align: center; max-width: 540px; padding: 2rem; }

.title-brand {
    font-family: 'EB Garamond', serif;
    font-size: 3.4rem; letter-spacing: 0.35em; margin: 0;
    color: var(--gold);
    text-shadow: 0 2px 18px rgba(201,163,90,0.25);
}

.title-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem; letter-spacing: 0.25em; color: #8a7a5c; margin: 0.4rem 0 0;
}

.title-tag {
    font-family: 'Special Elite', monospace;
    color: var(--paper); opacity: 0.8; margin: 1.4rem 0 2rem;
}

.title-menu { display: flex; flex-direction: column; gap: 0.7rem; align-items: stretch; }
.title-menu .slot-label { opacity: 0.65; font-size: 0.8em; margin-left: 0.6em; }
.title-menu .slot-list { display: flex; flex-direction: column; gap: 0.4rem; }
.title-menu button.slot, .title-menu button.secondary {
    background: transparent; border: 1px solid #5a4a34; color: var(--paper);
    padding: 0.55rem 1rem; cursor: pointer; font-family: 'IBM Plex Mono', monospace;
}
.title-menu button.slot:hover, .title-menu button.secondary:hover { border-color: var(--gold); color: var(--gold); }

.title-foot {
    margin-top: 2.4rem; font-size: 0.75rem; color: #6a5c44;
    font-family: 'IBM Plex Mono', monospace;
}

.settings-overlay {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(20,14,8,0.72);
    display: flex; align-items: center; justify-content: center;
}

.settings-panel {
    background: var(--paper-warm); color: var(--ink);
    border: 1px solid var(--ink-soft);
    box-shadow: 0 18px 60px rgba(0,0,0,0.55);
    width: min(440px, 92vw); max-height: 86vh; overflow: auto;
    padding: 1.4rem 1.6rem;
}
.settings-panel h2 { margin-top: 0; font-family: 'EB Garamond', serif; letter-spacing: 0.1em; }
.settings-panel h3 {
    font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--ink-soft); border-bottom: 1px dashed var(--ink-soft);
    padding-bottom: 0.3rem; margin: 1.3rem 0 0.6rem;
}
.setting-row { display: flex; align-items: center; gap: 0.8rem; margin: 0.45rem 0; }
.setting-row label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.setting-row input[type="range"] { flex: 1; accent-color: var(--gold); }
.settings-actions { display: flex; gap: 0.7rem; margin-top: 1.4rem; }
.settings-panel button.secondary, .settings-panel button.danger {
    background: transparent; border: 1px solid var(--ink-soft); color: var(--ink);
    padding: 0.45rem 0.9rem; cursor: pointer; font-family: 'IBM Plex Mono', monospace;
}
.settings-panel button.danger { border-color: var(--bad); color: var(--bad); }

/* Craft surfaces must own the pointer: no scroll/zoom/text-selection during strokes. */
.carve-svg, .paper-svg, .crop-box, .raw-photo, .affix-zone, .affixed-photo {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
/* Responsive craft canvases (the rect-mapped pointer math makes any size correct). */
.carve-svg, .paper-svg { width: 100%; max-width: 420px; height: auto; display: block; }

/* ============================================================
   Pixel sprites
   ============================================================ */
.pixel-sprite { image-rendering: pixelated; display: block; }
.pixel-strip {
    background-repeat: no-repeat;
    animation-name: wm-strip;
    animation-fill-mode: forwards;
}
@keyframes wm-strip {
    from { background-position-x: 0; }
    to   { background-position-x: var(--strip-end); }
}

/* Pixel-art room plates fill the scene like the SVG did (cover + crisp). */
.room-plate {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    z-index: 0;
}

.portrait-sprite {
    width: 100%; height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    display: block;
}

/* ============================================================
   Ink mixing & wax seal crafts
   ============================================================ */
.station-slot { display: flex; gap: 0.6rem; }
.station-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: #2c2218; border: 1px solid #5a4a34; color: var(--paper);
    padding: 0.45rem 0.9rem; cursor: pointer; font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem;
}
.station-chip.done { border-color: var(--good); color: var(--good); }
.station-swatch { width: 16px; height: 16px; border: 1px solid #000; display: inline-block; }

.ink-stage { display: flex; gap: 2rem; align-items: flex-start; padding: 1rem 0; }
.ink-swatches { display: flex; gap: 1.2rem; }
.swatch-block { text-align: center; }
.swatch-label { font-family: 'IBM Plex Mono', monospace; font-size: 0.65rem; letter-spacing: 0.15em; color: var(--ink-soft); margin-bottom: 0.4rem; }
.swatch { width: 110px; height: 110px; border: 2px solid var(--ink-soft); box-shadow: inset 0 0 30px rgba(248,217,124,0.25); }
.swatch-name { font-size: 0.75rem; margin-top: 0.4rem; color: var(--ink-soft); font-style: italic; }
.ink-sliders { flex: 1; display: flex; flex-direction: column; gap: 0.9rem; min-width: 240px; }
.ink-row { display: flex; align-items: center; gap: 0.8rem; }
.ink-row label { width: 130px; font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; }
.ink-row input[type="range"] { flex: 1; accent-color: var(--rubber); }

.wax-stage { display: flex; flex-direction: column; gap: 1.2rem; align-items: center; padding: 1.4rem 0; }
.wax-meter { width: 100%; max-width: 420px; }
.wax-track { position: relative; height: 26px; background: #2c2218; border: 1px solid var(--ink-soft); }
.wax-zone { position: absolute; top: 0; bottom: 0; background: rgba(106,138,74,0.35); border-left: 1px dashed var(--good); border-right: 1px dashed var(--good); }
.wax-fill { position: absolute; top: 3px; bottom: 3px; left: 3px; background: #a8443a; transition: width 0.05s linear; }
.wax-readout { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--ink-soft); margin-top: 0.4rem; min-height: 1.1em; }
.wax-hold { touch-action: none; user-select: none; -webkit-user-select: none; }

/* QC fresh-eyes fatigue: verdicts and pass/fail dots fade out, raw values remain. */
.qc-fatigued .qc-line .verdict, .qc-fatigued .qc-line .dot { visibility: hidden; }
.qc-summary-block.fatigued { border: 1px dashed var(--ink-soft); padding: 0.8rem 1rem; opacity: 0.85; }

/* Typewriter machine switch */
.tw-machines { display: flex; gap: 0.6rem; margin: 0.6rem 0; }
.tw-machine {
    background: #2c2218; border: 1px solid #5a4a34; color: var(--paper);
    padding: 0.4rem 1rem; cursor: pointer; font-size: 0.85rem;
}
.tw-machine.active { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 12px rgba(201,163,90,0.25); }

/* Vrana visit panel (Days 4 and 11) */
.vrana-visit {
    display: flex; gap: 1.2rem; align-items: flex-start;
    background: rgba(20,14,8,0.85); border: 1px solid #5a4a34;
    padding: 1.2rem 1.4rem; margin: 1rem 0; color: var(--paper);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.vrana-portrait { width: 96px; flex: none; border: 1px solid #5a4a34; }
.vrana-text h3 { margin: 0 0 0.6rem; font-family: 'EB Garamond', serif; letter-spacing: 0.08em; color: var(--gold); }
.vrana-text p { margin: 0.4rem 0; font-size: 0.9rem; line-height: 1.45; }
.vrana-quote { font-style: italic; color: #d8c8a4; border-left: 2px solid var(--rubber); padding-left: 0.8rem; }
.vrana-dossier { color: #8a7a5c; font-size: 0.82rem; }

/* Manual template pages */
.template-page .tpl-section { margin: 0.55rem 0; }
.template-page .tpl-line { margin: 0.15rem 0; font-size: 0.82rem; }
.tpl-swatch { display: inline-block; width: 13px; height: 13px; border: 1px solid var(--ink-soft); vertical-align: -2px; margin-right: 4px; }

/* Evening events */
.family-event, .evening-spends { border-top: 1px dashed var(--ink-soft); margin-top: 0.9rem; padding-top: 0.7rem; }
.family-event h3, .evening-spends h3 { margin: 0 0 0.4rem; font-size: 0.75rem; letter-spacing: 0.2em; font-family: 'IBM Plex Mono', monospace; color: var(--ink-soft); text-transform: uppercase; }
.event-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0 0.8rem; }
.event-actions .ghost:disabled { opacity: 0.45; cursor: default; }

.rain-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }

/* Typewriter bench: form + dossier side by side so values are copied, not memorized. */
.tw-layout { display: flex; gap: 1.4rem; align-items: flex-start; }
.tw-layout .tw-form { flex: 1; min-width: 0; }
.tw-dossier {
    flex: none; width: 220px;
    background: var(--paper-bright); border: 1px solid var(--ink-soft);
    padding: 0.8rem 0.9rem; transform: rotate(0.6deg);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.tw-dossier-label { font-family: 'IBM Plex Mono', monospace; font-size: 0.62rem; letter-spacing: 0.22em; color: var(--ink-soft); margin-bottom: 0.4rem; }
.tw-dossier-name { font-family: 'EB Garamond', serif; font-weight: 600; margin-bottom: 0.5rem; }
.tw-dossier-age { color: var(--ink-soft); font-weight: 400; font-size: 0.85em; }
.tw-dossier-row { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.78rem; margin: 0.22rem 0; border-bottom: 1px dotted rgba(58,44,28,0.35); padding-bottom: 0.18rem; }
.tw-dossier-row span { color: var(--ink-soft); }
.tw-dossier-row strong { font-family: 'Special Elite', monospace; text-align: right; }

/* Draggable photo: the portrait inside must never swallow the pointer or start a native
   image drag — the wrapper owns the interaction. */
.affixed-photo, .raw-photo { cursor: grab; }
.affixed-photo:active { cursor: grabbing; }
.affixed-photo *, .crop-box *, .raw-photo .portrait-sprite, .raw-photo .portrait-svg {
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}
