/* Study Quest — css/tome.css (V7.2.1 "The writer + Tomeforging", builder v721-tome)
 * Tomeforging on screen (js/ui-tome.js) and the writing session's bits in the writer's bottom bar (js/ui-writing.js).
 * The study look ("Lamplit + Vellum", docs/V8-PLAN.md §1.1): the Tomeforging window is a flat Vellum page (#f4ecdb, ink
 * #211a12 = 14.6:1; no texture behind text) inside the game's dialog frame. Spines are the only textured things (no text on
 * a texture: the title sits on a flat label).
 */
.modal.tome-dlg { width: min(700px, calc(100vw - 32px)); max-width: min(700px, calc(100vw - 32px)); }
.modal.tome-dlg .modal-body { padding: 10px; background: #14120f; }
.tome-page { --tm-page: #f4ecdb; --tm-ink: #211a12; --tm-ink-2: #4e4031; --tm-meta: #625240; --tm-rule: #d2c19f; --tm-hot: #9a3a12;
  --tm-read: "Iowan Old Style", Charter, Palatino, Georgia, serif; --tm-ui: "Avenir Next", Avenir, "Helvetica Neue", system-ui, sans-serif;
  background: var(--tm-page); color: var(--tm-ink); padding: 18px 22px 16px; border-radius: 2px; font: 400 16px/1.5 var(--tm-read);
  box-shadow: inset 0 0 0 1px #c9b48c; }
.tome-page p { margin: 0 0 10px; }
.tome-head { display: flex; align-items: center; gap: 14px; margin: 0 0 10px; }
.tome-emblem-wrap { width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #6b5a44;
  background: #ebe0c8; box-shadow: inset 0 0 0 2px #c9b48c; }
.tome-emblem-wrap.tome-rank--apprentice { color: #7d6a4c; box-shadow: inset 0 0 0 2px #b9a27a; }
.tome-emblem-wrap.tome-rank--journeyman { color: #5c3a20; box-shadow: inset 0 0 0 2px #7a5229; }
.tome-emblem-wrap.tome-rank--expert { color: #4a5560; box-shadow: inset 0 0 0 2px #8d98a3, inset 0 0 0 4px #ebe0c8, inset 0 0 0 5px #8d98a3; }
.tome-emblem-wrap.tome-rank--artisan { color: #7a5a10; box-shadow: inset 0 0 0 2px #b8901f, inset 0 0 0 4px #ebe0c8, inset 0 0 0 5px #b8901f; }
.tome-emblem { width: 36px; height: 36px; }
.tome-rankname { font: 700 21px/1.15 var(--tm-read); letter-spacing: .01em; }
.tome-skill { font: 500 15px/1.35 var(--tm-ui); color: var(--tm-ink-2); font-variant-numeric: tabular-nums; }
.tome-skill b { color: var(--tm-ink); font-size: 18px; }
.tome-bar { position: relative; height: 10px; border-radius: 5px; background: #e2d5b8; box-shadow: inset 0 0 0 1px #c9b48c; margin: 4px 0 6px; overflow: hidden; }
.tome-bar__fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v, 0) * 100%); background: linear-gradient(90deg, #b06a12, #d0601c); border-radius: 5px; }
.tome-bar__tick { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(33, 26, 18, .45); }
.tome-ranks { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 500 13px/1.4 var(--tm-ui); color: var(--tm-meta); margin: 0 0 10px; }
.tome-rk b { font-weight: 600; color: var(--tm-ink-2); }
.tome-rk.is-on b { color: var(--tm-hot); }
.tome-rk.is-done { color: #3e5d4f; }
.tome-next { font: 500 15px/1.45 var(--tm-ui); color: var(--tm-ink-2); }
.tome-next b { color: var(--tm-ink); }
.tome-word { color: var(--tm-hot, #9a3a12); border-bottom: 1px dotted currentColor; cursor: help; font-weight: 600; }
.tome-master { padding: 10px 12px; margin: 4px 0 12px; border-top: 1px solid var(--tm-rule); border-bottom: 1px solid var(--tm-rule); }
.tome-who { margin: 0 0 8px; }
.tome-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tome-why { font: 500 13px/1.4 var(--tm-ui); color: var(--tm-meta); flex: 1 1 220px; }
.tome-h { font: 700 13px/1 var(--tm-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--tm-meta); margin: 14px 0 8px; }
.tome-small { font: 500 13px/1.45 var(--tm-ui); color: var(--tm-meta); }
.tome-rules { font: 400 14.5px/1.5 var(--tm-read); color: var(--tm-ink-2); }
.tome-titles { list-style: none; margin: 0 0 8px; padding: 0; }
.tome-titles li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dotted var(--tm-rule);
  color: #6e604c; }   /* V7.2.1 fixer: 5.2:1 on the page (was 3.5:1) */
.tome-titles li.is-earned { color: var(--tm-ink); }
.tome-tright { font: 500 13px/1.3 var(--tm-ui); color: var(--tm-meta); }
.tome-page .btn { font-size: 13px; }

/* the shelf: spines (the textured leather and bast are only on the spine; the title sits on a flat label) */
.tome-shelf { display: flex; align-items: flex-end; gap: 4px; min-height: 196px; padding: 10px 12px 0; margin: 0 0 8px; overflow-x: auto;
  background: linear-gradient(#4a3624, #3a2a1c); border-bottom: 10px solid #2a1d12; border-radius: 2px; box-shadow: inset 0 6px 14px rgba(0,0,0,.45); }
.tome-spine { position: relative; flex: none; width: 38px; height: var(--h, 140px); border-radius: 3px 3px 1px 1px; display: flex; align-items: center; justify-content: center;
  box-shadow: inset -3px 0 0 rgba(0,0,0,.25), inset 3px 0 0 rgba(255,255,255,.08), 0 2px 3px rgba(0,0,0,.5); cursor: help; }
.tome-spine__title { position: relative; z-index: 1; writing-mode: vertical-rl; transform: rotate(180deg); max-height: calc(100% - 26px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 600 12px/1 var(--tm-ui, system-ui); padding: 6px 3px; border-radius: 2px; }
.tome-spine--unbound { background: #e9dfc8; box-shadow: inset 0 0 0 1px #b9a27a, 0 2px 3px rgba(0,0,0,.4); border-radius: 1px; }
.tome-spine--unbound::after { content: ''; position: absolute; left: -2px; right: -2px; top: 46%; height: 3px; background: #8c6b44; }
.tome-spine--unbound .tome-spine__title { color: #3b2f22; background: #f4ecdb; }
.tome-spine--lyko { background: repeating-linear-gradient(45deg, #a88a5a 0 4px, #94784c 4px 8px), #a88a5a; }
.tome-spine--lyko .tome-spine__title { color: #2a2016; background: #e6d6b2; }
.tome-spine--kozha { background: linear-gradient(90deg, #4a2614, #6a3a1e 40%, #4a2614); }
.tome-spine--kozha::before, .tome-spine--kozha::after { content: ''; position: absolute; left: 0; right: 0; height: 2px; background: #2d170b; }
.tome-spine--kozha::before { top: 12px; } .tome-spine--kozha::after { bottom: 12px; }
.tome-spine--kozha .tome-spine__title { color: #f3e6cf; background: #3a1d0e; }
.tome-spine--serebro { background: linear-gradient(90deg, #26313b, #3b4a57 40%, #26313b); }
.tome-spine--serebro::before, .tome-spine--serebro::after { content: ''; position: absolute; left: -1px; right: -1px; height: 7px; background: linear-gradient(#e2e6ea, #9aa4ad); }
.tome-spine--serebro::before { top: 6px; } .tome-spine--serebro::after { bottom: 6px; }
.tome-spine--serebro .tome-spine__title { color: #eef2f5; background: #1d262e; }
.tome-spine--zlato { background: linear-gradient(90deg, #5a1410, #7c2218 40%, #5a1410); }
.tome-spine--zlato::before, .tome-spine--zlato::after { content: ''; position: absolute; left: 3px; right: 3px; height: 9px; border: 2px solid #d9b14a; border-radius: 2px; }
.tome-spine--zlato::before { top: 6px; } .tome-spine--zlato::after { bottom: 6px; }
.tome-spine--zlato .tome-spine__title { color: #f6e3a6; background: #4a0f0b; }
.tome-shelf--book { margin: 6px 0 10px; }

/* the inn window's line about Vedislav */
.inn-tome { margin: 6px 0 0; font-size: 15px; line-height: 1.45; }
.inn-tome .tome-word { color: #f1c76b; }
.inn-tome__btn { margin-left: 10px; }

/* the writer's bottom bar: the session line, the Tomeforging chip, "Finish work" */
.wr-bottom .wr-session.is-note { color: #ffb37a; }
.wr-bottom .wr-session.is-quiet { color: #b9ad97; font-style: italic; }
.wr-bottom button.wr-tf { color: var(--wr-gold, #e3b562); border-color: #5a4426; padding: 4px 9px; }
.wr-bottom button.wr-finish { padding: 4px 9px; }
.modal.wr-ask .wr-ask-small { font-size: 13px; opacity: .85; }
/* V7.24.1 "The tutor": Ask the Veshta about this, and its feedback beside the page (comments only; nothing goes into the text) */
.wr-bottom button.wr-tutorbtn { padding: 4px 9px; color: #cfe3c4; border-color: #3f5236; }
.wr-tutor { position: absolute; right: 14px; top: 64px; bottom: 52px; width: min(340px, 34vw); z-index: 30; overflow: auto;
  background: var(--wr-bar, #121110); border: 1px solid var(--wr-btn-line, #3b3832); border-radius: 6px; padding: 12px 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.45); font: 400 14px/1.45 var(--st-ui); color: var(--wr-ui-text, #d8d0c1); }
.wr-tutor[hidden] { display: none; }
/* the page steps aside while the feedback is open, so the panel never covers your text (as the scroll's cards panel does) */
.wr-root.wr-tutoron .wr-desk { margin-right: calc(min(340px, 34vw) + 24px); }
.wr-tutor h4 { margin: 0 0 8px; font: 700 12px/1.2 var(--st-title, Cinzel, serif); letter-spacing: .12em; text-transform: uppercase; color: var(--wr-gold, #e3b562); }
.wr-tutor__saw, .wr-tutor__meta { margin: 0 0 8px; font-size: 12px; color: var(--wr-ui-meta, #a39c8f); }
.wr-tutor__q { width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 6px 8px; background: var(--wr-btn, #1a1917); color: inherit; border: 1px solid var(--wr-btn-line, #3b3832); border-radius: 3px; font: inherit; }
.wr-tutor__btns { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.wr-tutor__out { white-space: pre-wrap; }
@media (max-width: 760px), (max-height: 520px) {
  .wr-bottom button.wr-tf, .wr-bottom button.wr-finish, .wr-bottom button.wr-tutorbtn { display: none; }
  .wr-tutor { left: 10px; right: 10px; width: auto; }
  .wr-root.wr-tutoron .wr-desk { margin-right: 0; }
  .tome-page { padding: 12px 12px 10px; font-size: 15px; }
  .tome-shelf { min-height: 150px; }
}

/* ---------------------------------------------------------------------------------------------- V7.3 lane L (v73-scrolls): the tome's side
 * js/ui-scrolls.js: "Tome ▾" in the writer's top bar (Make it a scroll, Notes · Cards, Due date and target, Finish work); in the
 * Cards view a card paragraph and its answer lines share the scroll's soft background (no layout change: the pages stay as they
 * are) and a panel lists this tome's cards. */
.wr-root.wr-cards .wr-text .wr-cb { background: rgba(198, 160, 92, 0.17); box-shadow: -6px 0 0 rgba(198, 160, 92, 0.17), 6px 0 0 rgba(198, 160, 92, 0.17); }
.wr-root.wr-cards .wr-text .wr-cb.wr-cb-a { border-radius: 5px 5px 0 0; }
.wr-root.wr-cards .wr-text .wr-cb.wr-cb-z { border-radius: 0 0 5px 5px; }
.wr-root.wr-cards .wr-text .wr-cb.wr-cb-a.wr-cb-z { border-radius: 5px; }
.wr-root.wr-cards .wr-text .wr-cb.wr-cb-off { background: rgba(120, 112, 100, 0.12); box-shadow: -6px 0 0 rgba(120, 112, 100, 0.12), 6px 0 0 rgba(120, 112, 100, 0.12); }
.wr-top .sc-tomebtn { font-weight: 600; }
.wr-top .sc-tomebtn.is-on { border-color: var(--st-bronze); color: #f1eadc; }
.sc-menu { position: fixed; z-index: 60; width: 320px; background: #f4ecdb; color: #211a12; border: 1px solid #c9b48c; border-radius: 4px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); padding: 4px; font: 400 14px/1.35 "Avenir Next", Avenir, "Helvetica Neue", system-ui, sans-serif; }
.wr-root .sc-menu .sc-mi { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: #211a12; padding: 7px 10px; border-radius: 3px; height: auto; }
.wr-root .sc-menu .sc-mi:hover, .wr-root .sc-menu .sc-mi:focus { background: rgba(198, 160, 92, 0.22); color: #211a12; }
.sc-mi .l { display: block; font-weight: 600; }
.sc-mi .w { display: block; font-size: 12px; color: #625240; }
.sc-panel { position: absolute; right: 12px; top: 104px; bottom: 56px; width: 270px; overflow: auto; z-index: 8; background: #f4ecdb; color: #211a12;
  border: 1px solid #c9b48c; border-radius: 4px; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35); padding: 12px 14px; font: 400 13.5px/1.4 "Iowan Old Style", Charter, Georgia, serif; }
.sc-panel .sc-h { margin: 0 0 4px; font: 700 12px/1.2 "Avenir Next", Avenir, system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: #8a6a32; }
.sc-panel .sc-sub { margin: 0 0 8px; color: #4e4031; font-size: 12.5px; }
.wr-root .sc-panel .sc-go { margin: 0 0 8px; background: #2f5a9a; border-color: #2f5a9a; color: #f4ecdb; height: 26px; padding: 0 10px; }
.sc-list { list-style: none; margin: 0; padding: 0; }
.sc-card { background: rgba(198, 160, 92, 0.15); border-radius: 5px; padding: 6px 8px; margin: 0 0 6px; }
.sc-card .sc-q { display: block; font-weight: 600; }
.sc-card .sc-a { display: block; color: #4e4031; }
/* the page makes room for the panel (the layout re-fits to the narrower desk: nothing covers the text) */
.wr-root.wr-cards .wr-desk { margin-right: 290px; }
@media (max-width: 760px), (max-height: 420px) { .sc-panel { display: none; } .wr-root.wr-cards .wr-desk { margin-right: 0; } }
