/* app.css — Layout & components for Sands Writing. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans); background: var(--sand); color: var(--ink);
  -webkit-font-smoothing: antialiased; overflow: hidden; transition: background .4s, color .4s;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0);
  background-size: 22px 22px;
}
#app-root { position: relative; z-index: 1; height: 100dvh; }
.muted { color: var(--ink-soft); }

.seal {
  width: 38px; height: 38px; flex: none; background: var(--accent); color: #fff; border-radius: 8px;
  display: grid; place-items: center; font-family: var(--serif); font-size: 22px; font-weight: 700;
  box-shadow: 0 3px 8px var(--shadow); transform: rotate(-3deg);
}

/* ---------- Auth ---------- */
.auth { height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; }
.auth-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 34px; box-shadow: 0 20px 50px var(--shadow); }
.brand-lg { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.brand-lg .seal { width: 52px; height: 52px; font-size: 30px; }
.brand-lg h1 { font-family: var(--display); font-size: 27px; font-weight: 600; letter-spacing: .5px; }
.brand-lg small { display: block; font-size: 10px; color: var(--ink-soft); margin-top: 4px; letter-spacing: 3px; }
.lead { font-size: 14px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 20px; }
.auth-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 20px; }
.auth-tabs button { border: 1px solid var(--line); background: var(--sand-2); color: var(--ink-soft); border-radius: 8px; padding: 8px 6px; cursor: pointer; font-family: var(--sans); font-size: 12px; }
.auth-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.auth-row { display: flex; gap: 10px; margin-top: 18px; }
.auth-row .btn { flex: 1; }
.keybox { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; word-break: break-all; background: var(--sand-2); border: 1px dashed var(--accent); color: var(--accent); padding: 14px; border-radius: 10px; line-height: 1.6; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); margin-top: 14px; }
.warn { font-size: 12px; color: var(--accent); margin-top: 16px; line-height: 1.6; }
.auth-foot { font-size: 11.5px; color: var(--ink-soft); letter-spacing: .5px; }
.recover-question { background: var(--sand-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; color: var(--ink); font-size: 13.5px; line-height: 1.6; margin: 16px 0; }

/* ---------- App shell ---------- */
.app { display: flex; height: 100dvh; overflow: hidden; }
.sidebar { width: 256px; flex: none; background: var(--sand-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .3s; z-index: 40; }
.brand { padding: 20px 18px 14px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line-soft); }
.brand h1 { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: .5px; line-height: 1; }
.brand small { display: block; font-size: 10px; color: var(--ink-soft); margin-top: 3px; letter-spacing: 3px; }
.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: none; cursor: pointer; background: transparent; color: var(--ink-soft); font-family: var(--sans); font-size: 14.5px; border-radius: 9px; text-align: left; transition: .18s; letter-spacing: .5px; }
.nav button .ic { font-family: var(--serif); font-size: 16px; width: 20px; text-align: center; font-weight: 600; }
.nav button:hover { background: var(--card); color: var(--ink); }
.nav button.active { background: var(--accent); color: #fff; box-shadow: 0 3px 9px var(--shadow); }
.nav button.active .ic { color: #fff; }
.side-foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-soft); }
.savestate { display: flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); transition: .3s; }
.dot.saving { background: var(--gold); animation: pulse 1s infinite; }
.dot.err { background: var(--accent); }
@keyframes pulse { 50% { opacity: .3; } }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--sand); }
.hamburger { display: none; background: none; border: none; color: var(--ink); font-size: 22px; cursor: pointer; padding: 4px 8px; }
.topbar .title { font-family: var(--display); font-size: 17px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-select { max-width: 210px; min-width: 140px; height: 38px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 0 9px; font-family: var(--sans); font-size: 13px; outline: none; }
.iconbtn { background: var(--card); border: 1px solid var(--line); color: var(--ink-soft); cursor: pointer; width: 38px; height: 38px; border-radius: 9px; font-size: 16px; display: grid; place-items: center; transition: .18s; }
.iconbtn:hover { color: var(--accent); border-color: var(--accent-soft); }
.iconbtn:disabled { opacity: .45; cursor: not-allowed; }
.view { flex: 1; overflow-y: auto; overflow-x: hidden; }
.view::-webkit-scrollbar { width: 10px; }
.view::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid var(--sand); }
.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }

/* ---------- Writing ---------- */
.write-wrap { display: flex; height: 100%; }
.chaplist { width: 248px; flex: none; border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 12px; background: var(--sand-2); }
.chaplist h3 { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--ink-soft); margin: 4px 8px 12px; font-weight: 600; }
.chap-item { padding: 11px 36px 11px 12px; border-radius: 9px; cursor: pointer; margin-bottom: 5px; border: 1px solid transparent; transition: .15s; position: relative; }
.chap-item:hover { background: var(--card); }
.chap-item.active { background: var(--card); border-color: var(--accent-soft); box-shadow: 0 2px 6px var(--shadow); }
.chap-item .ct { font-size: 14px; font-weight: 500; line-height: 1.3; }
.chap-item .cm { font-size: 11px; color: var(--ink-soft); margin-top: 5px; display: flex; justify-content: space-between; align-items: center; }
.chap-del { position: absolute; right: 8px; top: 8px; width: 24px; height: 24px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 17px; line-height: 1; }
.chap-del:hover { color: var(--accent); border-color: var(--accent-soft); background: var(--sand); }
.pill { font-size: 10px; padding: 2px 7px; border-radius: 20px; font-weight: 600; letter-spacing: .5px; }
.s-idea { background: var(--line-soft); color: var(--ink-soft); }
.s-draft { background: #e7d6b6; color: var(--gold); }
.s-revise { background: var(--accent-soft); color: var(--accent); }
.s-done { background: #d2e0c6; color: var(--good); }
.add-btn { width: 100%; padding: 10px; border: 1px dashed var(--line); background: transparent; color: var(--ink-soft); border-radius: 9px; cursor: pointer; font-family: var(--sans); font-size: 13px; transition: .18s; margin-top: 6px; }
.add-btn:hover { border-color: var(--accent); color: var(--accent); }

.editor-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.editor-head { padding: 22px 6vw 0; display: flex; flex-direction: column; gap: 12px; }
.chap-title-in { font-family: var(--display); font-size: 30px; font-weight: 600; border: none; background: transparent; color: var(--ink); width: 100%; outline: none; letter-spacing: .5px; }
.chap-title-in::placeholder { color: var(--line); }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meta-row select, .synopsis-in { font-family: var(--sans); font-size: 12.5px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); border-radius: 7px; padding: 6px 10px; outline: none; }
.meta-row select { cursor: pointer; }
.synopsis-in { flex: 1; min-width: 160px; font-style: italic; }
.synopsis-in.wide { width: 100%; min-width: 0; }
.ed-body-wrap { flex: 1; padding: 18px 6vw 8vh; overflow-y: auto; }
.ed-body { width: 100%; min-height: 60vh; border: none; background: transparent; outline: none; resize: none; font-family: var(--serif); font-size: 18.5px; line-height: 2; color: var(--ink); letter-spacing: .3px; }
.ed-body::placeholder { color: var(--line); }
.ed-foot { flex: none; padding: 9px 6vw; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); background: var(--sand); gap: 12px; }
.mention-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.mtag { font-size: 11px; background: var(--accent-soft); color: var(--accent); padding: 2px 9px; border-radius: 20px; cursor: pointer; }
.empty { display: grid; place-items: center; height: 100%; text-align: center; color: var(--ink-soft); padding: 40px; }
.empty .seal { margin: 0 auto 18px; width: 56px; height: 56px; font-size: 32px; }
.empty p { max-width: 320px; line-height: 1.7; font-size: 14px; }

.inspector { width: 300px; flex: none; border-left: 1px solid var(--line); background: var(--sand-2); overflow-y: auto; padding: 16px; }
.insp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.insp-head h3 { font-family: var(--display); font-size: 18px; font-weight: 600; }
.mini { padding: 7px 11px; font-size: 12px; }
.insp-section { border-top: 1px solid var(--line-soft); padding-top: 13px; margin-top: 13px; display: flex; flex-direction: column; gap: 8px; }
.insp-section label { font-size: 11px; color: var(--ink-soft); letter-spacing: 1px; text-transform: uppercase; }
.insp-section input, .insp-section select, .insp-section textarea { width: 100%; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 8px 10px; font-family: var(--sans); font-size: 13px; outline: none; }
.insp-section textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.checkline { display: flex; align-items: center; gap: 8px; text-transform: none !important; letter-spacing: 0 !important; }
.checkline input { width: auto; }
.insp-title-row { display: flex; align-items: center; justify-content: space-between; }
.small { font-size: 12px; line-height: 1.6; }
.entity-list, .snap-list, .clue-mini-list { display: flex; flex-direction: column; gap: 7px; }
.entity-list button, .snap-list button { text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 8px 10px; cursor: pointer; font-family: var(--sans); }
.entity-list small { display: block; color: var(--ink-soft); margin-top: 3px; }
.snap-list span { display: block; color: var(--ink-soft); font-size: 11px; margin-top: 3px; }
.clue-mini-list div { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 10px; }
.clue-mini-list span { display: block; color: var(--ink-soft); font-size: 11px; margin-top: 3px; }
.snapshot-preview { white-space: pre-wrap; max-height: 48vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-family: var(--serif); line-height: 1.9; }

/* ---------- Shared content pages ---------- */
.pad { padding: 28px clamp(18px, 5vw, 56px) 60px; max-width: 1100px; margin: 0 auto; }
.pad h2 { font-family: var(--display); font-size: 26px; font-weight: 600; margin-bottom: 4px; }
.pad .sub { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 26px; letter-spacing: .5px; }
.section-h { font-family: var(--display); font-size: 18px; margin: 8px 0 16px; font-weight: 600; }
.note { font-size: 12px; color: var(--ink-soft); margin-top: 18px; line-height: 1.7; }

.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 16px; cursor: pointer; transition: .2s; position: relative; overflow: hidden; }
.card:not(.add)::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); opacity: .7; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px var(--shadow); border-color: var(--accent-soft); }
.card.add { display: grid; place-items: center; border-style: dashed; }
.card .num { font-family: var(--display); font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.card .ch-name { font-size: 15.5px; font-weight: 600; margin-bottom: 9px; line-height: 1.4; }
.card .syn { font-size: 12.5px; color: var(--ink-soft); line-height: 1.65; font-style: italic; min-height: 42px; }
.card .cfoot { margin-top: 13px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--ink-soft); }
.card.dragging { opacity: .55; transform: scale(.98); }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; min-height: 18px; }
.card-tags span { font-size: 10.5px; color: var(--ink-soft); background: var(--sand-2); border: 1px solid var(--line-soft); padding: 2px 7px; border-radius: 6px; }
.view-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; }
.view-tabs button { border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-family: var(--sans); }
.view-tabs button.on { background: var(--ink); color: var(--sand); border-color: var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.outline-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.outline-table th, .outline-table td { border-bottom: 1px solid var(--line-soft); padding: 11px 12px; text-align: left; font-size: 12.5px; vertical-align: top; }
.outline-table th { color: var(--ink-soft); background: var(--sand-2); font-weight: 600; letter-spacing: .5px; }
.outline-table tr { cursor: pointer; }
.outline-table tr:hover td { background: var(--sand-2); }
.outline-table small { display: block; color: var(--ink-soft); margin-top: 4px; max-width: 260px; line-height: 1.5; }
.timeline { position: relative; display: flex; flex-direction: column; gap: 14px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; display: grid; grid-template-columns: 130px 1fr; gap: 14px; cursor: pointer; }
.tl-dot { position: absolute; left: -22px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--sand); }
.tl-time { color: var(--accent); font-size: 12px; font-weight: 600; padding-top: 5px; }
.tl-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.tl-card h4 { font-size: 15px; margin-bottom: 6px; }
.tl-card p { color: var(--ink-soft); font-size: 12.5px; line-height: 1.6; }
.clue-toolbar { margin-bottom: 16px; }
.clue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.clue-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 15px; cursor: pointer; transition: .18s; }
.clue-card:hover { border-color: var(--accent-soft); box-shadow: 0 6px 16px var(--shadow); }
.clue-card h4 { font-family: var(--display); font-size: 17px; margin: 9px 0 8px; }
.clue-card p { color: var(--ink-soft); font-size: 12.5px; line-height: 1.6; min-height: 38px; }
.clue-pair { display: flex; flex-direction: column; gap: 4px; margin-top: 11px; font-size: 11.5px; color: var(--ink-soft); }
.searchbar { display: grid; grid-template-columns: 1fr 150px 180px; gap: 9px; margin-bottom: 16px; }
.searchbar input, .searchbar select { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 10px 12px; font-family: var(--sans); outline: none; }
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-row { display: grid; grid-template-columns: minmax(180px, 1fr) 90px minmax(160px, 260px); gap: 12px; align-items: center; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 12px; cursor: pointer; font-size: 12.5px; }
.search-row:hover { border-color: var(--accent-soft); }
.search-row span { display: block; color: var(--ink-soft); margin-top: 4px; line-height: 1.5; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.filters button { padding: 7px 16px; border-radius: 30px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer; font-family: var(--sans); font-size: 13px; transition: .15s; }
.filters button.on { background: var(--ink); color: var(--sand); border-color: var(--ink); }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.cx-card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 15px 17px; cursor: pointer; transition: .18s; }
.cx-card:hover { border-color: var(--accent-soft); box-shadow: 0 6px 16px var(--shadow); }
.cx-type { display: inline-block; font-size: 10px; letter-spacing: 1px; padding: 2px 8px; border-radius: 5px; background: var(--sand-2); color: var(--ink-soft); margin-bottom: 9px; }
.cx-card h4 { font-family: var(--serif); font-size: 18px; font-weight: 600; margin-bottom: 7px; }
.cx-alias { font-size: 11.5px; color: var(--accent); margin: -2px 0 8px; }
.cx-card p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; max-height: 60px; overflow: hidden; }
.cx-back { margin-top: 11px; font-size: 11px; color: var(--accent); }

.progress-box { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 22px; margin-bottom: 24px; }
.progress-box .ph { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; font-size: 14px; }
.progress-box .ph b { font-family: var(--display); font-size: 18px; }
.bar { height: 14px; background: var(--sand-2); border-radius: 20px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 20px; transition: width .6s; }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 20px; }
.stat .n { font-family: var(--display); font-size: 34px; font-weight: 600; color: var(--accent); line-height: 1; }
.stat .l { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; letter-spacing: .5px; }
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 13px; }
.exp { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 18px; cursor: pointer; text-align: center; transition: .2s; }
.exp:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 18px var(--shadow); }
.exp .ei { font-size: 26px; margin-bottom: 9px; }
.exp .et { font-size: 14px; font-weight: 600; }
.exp .ed { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Forms / modal / toast ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; letter-spacing: 1px; color: var(--ink-soft); margin-bottom: 6px; text-transform: uppercase; }
.field input, .field textarea, .field select { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font-family: var(--sans); font-size: 14px; outline: none; }
.field textarea { font-family: var(--serif); line-height: 1.8; resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.overlay { position: fixed; inset: 0; background: rgba(20,15,8,.5); backdrop-filter: blur(3px); z-index: 100; display: none; align-items: center; justify-content: center; padding: 18px; }
.overlay.show { display: flex; }
.modal { background: var(--sand); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 60px var(--shadow); padding: 26px; }
.modal h3 { font-family: var(--display); font-size: 21px; margin-bottom: 20px; }
.modal-acts { display: flex; gap: 10px; margin-top: 22px; justify-content: flex-end; }
.btn { padding: 11px 22px; border-radius: 9px; border: none; cursor: pointer; font-family: var(--sans); font-size: 14px; font-weight: 500; transition: .18s; letter-spacing: .5px; }
.btn-p { background: var(--accent); color: #fff; } .btn-p:hover { filter: brightness(1.08); }
.btn-g { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); } .btn-g:hover { color: var(--ink); }
.btn-d { background: transparent; color: var(--accent); border: 1px solid var(--accent-soft); margin-right: auto; } .btn-d:hover { background: var(--accent); color: #fff; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--ink); color: var(--sand); padding: 13px 24px; border-radius: 30px; font-size: 13.5px; z-index: 200; transition: .35s; box-shadow: 0 8px 22px var(--shadow); opacity: 0; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ---------- Responsive (mobile / tablet) ---------- */
@media (max-width: 860px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); box-shadow: 6px 0 24px var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .scrim.show { display: block; }
  .hamburger { display: block; }
  .project-select { max-width: 36vw; min-width: 88px; }
  .write-wrap { flex-direction: column; }
  .chaplist { width: 100%; max-height: 30vh; border-right: none; border-bottom: 1px solid var(--line); }
  .inspector { width: 100%; max-height: 34vh; border-left: none; border-top: 1px solid var(--line); }
  .editor-head, .ed-body-wrap, .ed-foot { padding-left: 20px; padding-right: 20px; }
  .chap-title-in { font-size: 24px; }
  .ed-body { font-size: 17px; line-height: 1.95; }
  .searchbar { grid-template-columns: 1fr; }
  .search-row { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 1fr; }
}

/* ---------- Print (PDF export) ---------- */
#printArea { display: none; }
@media print {
  body::before { display: none; }
  #app-root { display: none !important; }
  #printArea { display: block; font-family: var(--serif); color: #111; background: #fff; }
  .pr-title { text-align: center; page-break-after: always; padding-top: 34vh; }
  .pr-title h1 { font-size: 34pt; font-weight: 600; margin-bottom: 18px; }
  .pr-title .au { font-size: 15pt; color: #444; }
  .pr-chap { page-break-before: always; }
  .pr-chap h2 { font-size: 20pt; text-align: center; margin: 0 0 26pt; font-weight: 600; }
  .pr-chap p { font-size: 12pt; line-height: 1.9; text-indent: 2em; margin: 0 0 4pt; text-align: justify; }
  @page { margin: 2.2cm 2.4cm; }
}
