/* 未然調書 1.10.0: the window UI rebuilt (2026-11-28 #1-#5, docs/r12-design.md section 4).
   One grammar for every game window: almost the whole screen (js/ext/windows.js FULL); what you read on the left, the action column on the right
   (choices, confirm, close; the main button at the bottom right); one column under 900 px with the actions below. Two surfaces only: paper
   (#f3eee2 / ink #1b1714) and dark (#131012 / text #ece5d8), never a mid tone under mid-tone text (#1). */

.wm-layer.mzw-tickets .wm-body, .wm-layer.mzw-dialogue .wm-body, .wm-layer.mzw-report .wm-body, .wm-layer.mzw-doc .wm-body { padding: 0; overflow: hidden; }
.mzw-body.mzw-body > .win.r12 { height: 100%; display: flex; flex-direction: column; }
.mzw-body.mzw-body > .win.r12 > .panel, .mzw-body.mzw-body > .win.r12 > .dlg { flex: 1 1 auto; min-height: 0; height: 100%; display: flex; flex-direction: column; color: #ece5d8; }

.r12-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(270px, 27%, 400px); }
.r12-actions { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; background: #100c0d; border-left: 1px solid #3c2826; color: #ece5d8; }
.r12-act-top { display: flex; flex-direction: column; gap: 8px; }
.r12-act-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.r12-act-hint { margin: 0; font-size: 0.92em; line-height: 1.7; color: #d9d0c2; }
.r12 .btn { min-height: 46px; padding: 8px 14px; font-size: 1rem; line-height: 1.5; border-radius: 4px; color: #ece5d8; background: #1d1718; border: 1px solid #6d605a; text-align: left; }
.r12 .btn:hover:not(:disabled), .r12 .btn:focus-visible { background: #2c2224; color: #fff; }
.r12 .btn:disabled { opacity: 0.5; }
.r12 .btn.r12-primary { background: #8e1d1d; border-color: #d0504a; color: #fff; font-weight: 700; text-align: center; }
.r12 .btn.r12-primary:hover:not(:disabled) { color: #ece5d8; background: #a82424; }
@media (max-width: 899px) {
  .r12-grid { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .r12-actions { border-left: 0; border-top: 1px solid #3c2826; max-height: 46%; padding: 12px; }
  .r12-act-bottom { flex-direction: row; flex-wrap: wrap; }
  .r12-act-bottom .btn { flex: 1 1 40%; }
}

/* ---- the tickets (#11) ---- */
.tk-panel { color: #ece5d8; background: #131012; }
.tk-grid { grid-template-columns: clamp(230px, 24%, 330px) minmax(0, 1fr) clamp(250px, 23%, 330px); }
.tk-side { color: #ece5d8; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid #3c2826; background: #0e0b0c; }
.tk-count { padding: 12px 14px; border-bottom: 1px solid #3c2826; font-size: 0.95em; color: #ece5d8; }
.tk-count b { font-size: 1.3em; color: #fff; }
.tk-readyn { color: #ffd27a; }
.tk-list { flex: 1; overflow: auto; padding: 6px 8px 14px; }
.tk-act { margin: 12px 6px 4px; font-size: 0.82em; letter-spacing: 0.08em; color: #c9bcae; }
.tk-row { display: grid; grid-template-columns: 4.6em minmax(0, 1fr) auto; align-items: center; gap: 6px; width: 100%; min-height: 42px; margin: 2px 0; padding: 6px 8px; border: 1px solid transparent; border-radius: 4px; background: none; color: #ece5d8; text-align: left; cursor: pointer; font: inherit; font-size: 0.92em; }
.tk-row:hover, .tk-row:focus-visible { background: #221a1b; }
.tk-row.on { color: #ece5d8; background: #2a1d1e; border-color: #8e3a34; }
.tk-row.locked { color: #a99c90; cursor: default; grid-template-columns: 4.6em 1fr; }
.tk-row small { color: #c9bcae; margin-left: 4px; }
.tk-id { font-family: 'Zen Kaku Gothic New', sans-serif; font-weight: 700; color: #f0b9a8; font-size: 0.92em; }
.tk-id.big { font-size: 1.05em; }
.tk-st { font-size: 0.78em; padding: 2px 7px; border-radius: 10px; white-space: nowrap; border: 1px solid; }
.tk-st.st-todo, .tk-st.st-locked { color: #c9bcae; border-color: #5c514c; }
.tk-st.st-doing { color: #9fd0ff; border-color: #4f7ca6; }
.tk-st.st-ready { color: #1b1714; background: #ffd27a; border-color: #ffd27a; font-weight: 700; }
.tk-st.st-done { color: #fff; background: #8e1d1d; border-color: #c04040; }
.tk-row.st-done .tk-t { color: #d9d0c2; }
.tk-main { min-height: 0; overflow: auto; padding: 18px 22px 24px; color: #ece5d8; line-height: 1.75; }
.tk-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid #3c2826; padding-bottom: 8px; }
.tk-head h3 { margin: 0; font-size: 1.3em; color: #fff; }
.tk-ask { margin: 10px 0 4px; }
.tk-where { display: block; font-size: 0.9em; color: #d0c4b6; }
.tk-sec { margin: 16px 0 6px; font-size: 0.82em; letter-spacing: 0.12em; color: #f0b9a8; border-left: 3px solid #8e1d1d; padding-left: 8px; }
.tk-ev { list-style: none; margin: 0; padding: 0; }
.tk-ev li { display: grid; grid-template-columns: minmax(7em, 13em) 1fr; gap: 10px; padding: 7px 10px; border-bottom: 1px dashed #3c2826; }
.tk-src { display: inline-block; font-size: 0.84em; color: #f3d2c4; margin-right: 8px; }
.tk-empty, .tk-lock { color: #d9d0c2; }
.tk-cmp { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.tk-cmp > div:not(.tk-cmp-vs) { background: #f3eee2; color: #1b1714; padding: 10px 12px; border-radius: 3px; font-family: 'Zen Old Mincho', serif; }
.tk-cmp .tk-src { display: block; color: #7a2a22; margin: 0 0 4px; }
.tk-cmp-vs { align-self: center; font-size: 1.4em; color: #f0b9a8; }
.tk-need { margin-top: 10px; padding: 10px 12px; border: 1px dashed #8a7a6a; border-radius: 4px; color: #ece5d8; }
.tk-hint { color: #ffd27a; }
.tk-comment { color: #ece5d8; display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 12px; background: #1d1718; border-left: 3px solid #c04040; }
.tk-face { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; }
.tk-who { font-size: 0.85em; color: #f0b9a8; }
.tk-comment p { margin: 2px 0 0; font-size: 1.05em; }
.tk-note { margin-top: 12px; padding: 10px 12px; background: #f3eee2; color: #1b1714; border-radius: 3px; font-family: 'Zen Old Mincho', serif; }
.tk-note .tk-src { color: #7a2a22; }
.tk-story { color: #ece5d8; margin-top: 22px; border: 1px solid #3c2826; border-radius: 4px; padding: 8px 12px; background: #0e0b0c; }
.tk-story summary { cursor: pointer; color: #f0b9a8; }
.tk-story ol { margin: 8px 0 0 1.2em; padding: 0; }
.tk-story li { margin: 6px 0; }
.tk-sofar { color: #d9d0c2; }
@media (max-width: 899px) {
  .tk-grid { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto; }
  .tk-side { border-right: 0; border-bottom: 1px solid #3c2826; max-height: 30%; }
  .tk-main { padding: 12px; }
  .tk-ev li { grid-template-columns: 1fr; gap: 0; }
  .tk-cmp { grid-template-columns: 1fr; }
  .tk-cmp-vs { text-align: center; }
}

/* ---- the official forms (役所書類: a ruled table, blanks filled from choices, a red seal) ---- */
.gov-form { width: 100%; border-collapse: collapse; background: #f3eee2; color: #1b1714; font-family: 'Zen Old Mincho', serif; }
.gov-form th, .gov-form td { border: 1px solid #6a5e52; padding: 10px 12px; text-align: left; vertical-align: middle; }
.gov-form th { color: #1b1714; width: 9em; background: #e4dccb; font-weight: 700; }
.gov-form th small { display: block; font-weight: 400; font-size: 0.78em; color: #4a3f36; }
.gov-blank-cell { position: relative; }
.gov-blank { display: inline-flex; align-items: center; gap: 10px; min-width: 14em; min-height: 40px; padding: 4px 10px; border: 0; border-bottom: 2px solid #1b1714; background: #fffdf6; color: #1b1714; font: inherit; font-family: 'Zen Kurenaido', 'Zen Old Mincho', serif; font-size: 1.08em; cursor: pointer; text-align: left; }
.gov-blank:disabled { cursor: default; background: repeating-linear-gradient(135deg, #f3eee2 0 6px, #e8e1d1 6px 12px); color: #4a3f36; }
.gov-blank.has { color: #1b1714; background: #fffbe6; }
.gov-dd { margin-left: auto; font-size: 0.8em; color: #7a2a22; }
.gov-filled { font-family: 'Zen Kurenaido', 'Zen Old Mincho', serif; font-size: 1.1em; }
.gov-seal { display: inline-block; margin-left: 14px; padding: 2px 8px; border: 2px solid #b8221c; color: #b8221c; font-weight: 700; transform: rotate(-8deg); letter-spacing: 0.1em; }
.gov-opts { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0; }
.gov-opts.inline { margin: 0; }
.gov-opt { display: flex; gap: 10px; align-items: flex-start; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #6a5e52; border-radius: 3px; background: #fffdf6; color: #1b1714; font: inherit; text-align: left; cursor: pointer; line-height: 1.55; }
.gov-opt:hover, .gov-opt:focus-visible { background: #fff3cf; }
.gov-opt.on { color: #1b1714; background: #ffe9a8; border-color: #8e1d1d; box-shadow: inset 4px 0 0 #8e1d1d; }
.gov-opt[aria-disabled='true'] { background: #e8e1d1; color: #4a3f36; cursor: default; }
.gov-opt small { display: block; font-size: 0.85em; color: #4a3f36; }
.gov-opt small.gov-no { color: #8e1d1d; }
.gov-n { flex: 0 0 auto; width: 1.6em; height: 1.6em; line-height: 1.6em; text-align: center; border-radius: 50%; background: #1b1714; color: #f3eee2; font-size: 0.85em; }
.gov-fb { margin-top: 6px; font-size: 0.95em; }
.gov-fb.no { color: #ffb4a8; }
.gov-form .gov-fb.no { color: #8e1d1d; }
.gov-fb.ok { color: #b6f0b0; }

/* the first report: the whole sheet as paper */
.report { color: #ece5d8; background: #131012; }
.rep-main { min-height: 0; overflow: auto; padding: 22px; }
.gov-sheet { max-width: 980px; margin: 0 auto; padding: 22px 26px; background: #f3eee2; color: #1b1714; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6); }
.gov-title { text-align: center; font-family: 'Zen Old Mincho', serif; font-size: 1.6em; letter-spacing: 0.4em; font-weight: 700; }
.gov-meta { display: flex; justify-content: space-between; margin: 8px 0 12px; font-size: 0.9em; border-bottom: 2px solid #1b1714; padding-bottom: 6px; }
.gov-lead { margin: 0 0 12px; }
.gov-form.big th { width: 11em; }

/* ---- the talk: the scene (left) and the questions (right) (#2 #4) ---- */
.mzw-body.mzw-body .dlg.chat.vn { color: #ece5d8; width: 100%; height: 100%; max-height: none; display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 30%, 430px); background: #0c0a0a; padding: 0; border: 0; }
.vn-stage { position: relative; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.vn-bg { color: #ece5d8; position: absolute; inset: 0; background: #1a1414 center / cover no-repeat; filter: blur(2px) brightness(0.55) saturate(0.8); transform: scale(1.03); }
.vn-person { position: absolute; left: 3%; bottom: 0; height: 78%; aspect-ratio: 392 / 512; pointer-events: none; }
.vn-person img { width: 100%; height: 100%; object-fit: cover; -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 98%), linear-gradient(90deg, transparent 0, #000 14%, #000 84%, transparent 100%); -webkit-mask-composite: source-in; mask-image: linear-gradient(180deg, #000 62%, transparent 98%), linear-gradient(90deg, transparent 0, #000 14%, #000 84%, transparent 100%); mask-composite: intersect; filter: brightness(0.92); }
.dlg.chat.vn .chat-head { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; background: linear-gradient(180deg, rgba(8, 5, 5, 0.92), rgba(8, 5, 5, 0.6)); color: #ece5d8; backdrop-filter: none; }
.dlg.chat.vn .chat-who b { font-size: 1.2em; color: #fff; }
.vn-text { position: relative; z-index: 2; margin: auto 18px 18px clamp(18px, 30%, 360px); display: flex; flex-direction: column; min-height: 0; max-height: 62%; }
.dlg.chat.vn .chat-log { color: #ece5d8; overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: rgba(10, 7, 7, 0.9); border: 1px solid #5a3a34; border-radius: 6px; }
.dlg.chat.vn .msg { display: block; max-width: none; margin: 0; }
.dlg.chat.vn .msg .who { display: block; font-size: 0.85em; color: #f0b9a8; margin-bottom: 2px; }
.dlg.chat.vn .msg .bub { display: block; max-width: none; padding: 0; background: none; border: 0; color: #ece5d8; font-size: 1.12em; line-height: 1.85; box-shadow: none; }
.dlg.chat.vn .msg.them .bub { color: #fff; }
.dlg.chat.vn .msg.me .who { color: #9fd0ff; }
.dlg.chat.vn .msg.me .bub { color: #d8e8f6; }
.dlg.chat.vn .msg.inner .bub, .dlg.chat.vn .msg.sys .bub { color: #e8dcc8; font-style: italic; }
.dlg.chat.vn .msg.old { opacity: 0.62; }
.dlg.chat.vn .msg.old .bub { font-size: 0.95em; }
.dlg.chat.vn .msg.sep { text-align: center; color: #c9bcae; font-size: 0.82em; }
.dlg.chat.vn .msg.pic canvas { width: min(100%, 420px); height: auto; border-radius: 4px; }
.dlg.chat.vn .chat-more { align-self: center; margin-top: 4px; }
.vn-side { color: #ece5d8; background: #100c0d; }
.vn-q { font-size: 0.82em; letter-spacing: 0.12em; color: #f0b9a8; border-left: 3px solid #8e1d1d; padding-left: 8px; }
.dlg.chat.vn .chat-lead { padding: 8px 10px; background: #2a1d1e; border: 1px solid #8e3a34; border-radius: 4px; color: #ece5d8; font-size: 0.95em; }
.dlg.chat.vn .chat-lead .k { display: block; font-size: 0.8em; color: #ffd27a; }
.dlg.chat.vn .opts, .dlg.chat.vn .opts-meta { overflow: visible; display: flex; flex-direction: column; gap: 8px; max-height: none; padding: 0; background: none; }
.dlg.chat.vn .opt { display: flex; width: 100%; max-width: none; min-height: 48px; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 4px; background: #1d1718; border: 1px solid #6d605a; color: #ece5d8; font-size: 1rem; line-height: 1.5; text-align: left; backdrop-filter: none; }
.dlg.chat.vn .opt:hover:not(:disabled), .dlg.chat.vn .opt:focus-visible { color: #ece5d8; background: #2c2224; }
.dlg.chat.vn .opt.case { color: #ece5d8; background: #3a1214; border-color: #c04040; }
.dlg.chat.vn .opt.meta { border-style: dashed; background: #141011; color: #d9d0c2; }
.dlg.chat.vn .opt .num { flex: 0 0 auto; width: 1.7em; height: 1.7em; line-height: 1.7em; text-align: center; border-radius: 50%; background: #ece5d8; color: #1b1714; font-size: 0.85em; }
.dlg.chat.vn .evi-col, .dlg.chat.vn .evi { overflow: visible; }
.dlg.chat.vn .evi-col { position: static; width: auto; margin-top: 6px; border: 1px solid #3c2826; border-radius: 4px; padding: 8px 10px; background: #0e0b0c; color: #ece5d8; max-height: none; }
.dlg.chat.vn .evi-head { font-size: 0.82em; color: #f0b9a8; }
/* 1.10.1: the key hint sits on the 質問する line (at the column's foot it ran under the evidence note, then got cut at the window edge) */
.vn-q { display: flex; align-items: baseline; gap: 8px; }
.dlg.chat.vn .vn-q .skip.keys { margin-left: auto; letter-spacing: 0; font-size: 0.92em; color: #c9bcae; opacity: 1; text-align: right; }
/* 1.10.1: the column's children keep their own height (the evidence box shrank and its text ran over the key hint); the column scrolls instead */
.r12-actions > * { flex-shrink: 0; }
.dlg.chat.vn .meters .look { color: #ece5d8; font-size: 0.92em; }
@media (max-width: 899px) {
  .mzw-body.mzw-body .dlg.chat.vn { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .vn-person { height: 62%; left: 0; opacity: 0.85; }
  .vn-text { margin: auto 10px 10px 10px; max-height: 70%; }
  .vn-side { max-height: 48%; overflow: auto; border-left: 0; border-top: 1px solid #3c2826; }
  .dlg.chat.vn .evi-col, .dlg.chat.vn .skip.keys { display: none; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .mzw-body.mzw-body .dlg.chat.vn { grid-template-columns: minmax(0, 1fr) clamp(240px, 40%, 360px); grid-template-rows: none; }
  .vn-side { max-height: none; border-top: 0; border-left: 1px solid #3c2826; }
  .vn-person { height: 70%; }
  .vn-text { margin-left: 30%; max-height: 72%; }
}

/* a full window: the thought line waits (js/ext/windows.js show) */
body.mz-full #say { display: none !important; }

/* the papers: the sheet uses the big window */
.mzw-body.mzw-body .docwin .paper, .mzw-body.mzw-body .docwin .doc-wrap .paper { max-width: 1180px; }
.mzw-body.mzw-body .docwin .gain { color: #ece5d8; background: #100c0d; border: 1px solid #3c2826; }

/* #1 (8.png 段取り): the handover memo is paper: every line on it is ink (the current stage had the light screen text on the paper) */
.memo-paper .memo-ladder li, .memo-paper .memo-ladder li.now, .memo-paper .memo-ladder li.later, .memo-paper .memo-ladder li.done { color: #1b1714; opacity: 1; }
.memo-paper .memo-ladder li.now { color: #1b1714; background: #fff3cf; }
.memo-paper .memo-ladder li.later { color: #3b332c; background: #ebe5d6; }
.memo-paper .memo-ladder li.now .m-state { color: #8e1d1d; }
.memo-paper .memo-ladder .chip-u { color: #1b1714; background: #fffdf6; }
.memo-paper .memo-ladder .m-time, .memo-paper .memo-ladder .m-unl, .memo-paper .memo-ladder .m-intro { color: #2b241e; opacity: 1; }
.memo-paper .dim, .memo-paper .memo-keys { color: #3b332c; opacity: 1; }
.memo-paper .memo-keys { font-size: 0.92em; }

/* a phone held sideways (short and wide): the actions stay a column on the right (#4), the reading part keeps the height (r12 review: the
   one-column layout left the ticket body a few pixels tall on 844x390) */
@media (max-height: 500px) and (orientation: landscape) {
  .r12-grid { grid-template-columns: minmax(0, 1fr) clamp(190px, 30%, 280px); grid-template-rows: none; }
  .r12-actions { max-height: none; border-top: 0; border-left: 1px solid #3c2826; padding: 8px 10px; gap: 6px; }
  .r12-act-bottom { flex-direction: column; flex-wrap: nowrap; padding-top: 6px; gap: 6px; }
  .r12-act-bottom .btn { flex: 0 0 auto; }
  .r12 .btn { min-height: 40px; padding: 6px 10px; font-size: 0.9rem; }
  .r12-act-hint { font-size: 0.84em; line-height: 1.55; }
  .tk-grid { grid-template-columns: clamp(150px, 22%, 200px) minmax(0, 1fr) clamp(180px, 27%, 250px); grid-template-rows: none; }
  .tk-side { max-height: none; border-bottom: 0; border-right: 1px solid #3c2826; }
  .tk-count { padding: 6px 8px; font-size: 0.85em; }
  .tk-row { grid-template-columns: 1fr auto; min-height: 36px; padding: 4px 6px; font-size: 0.84em; }
  .tk-row .tk-id { grid-column: 1 / -1; font-size: 0.8em; }
  .tk-main { padding: 10px 12px; font-size: 0.92em; }
  .tk-ev li { grid-template-columns: 1fr; gap: 0; }
  .tk-face { width: 44px; height: 44px; }
}

/* the explanation card (r12 phone review: on a phone held sideways the card was taller than the screen and its わかった button was off the
   bottom): the card is a column whose text scrolls; the button always stays in sight. Sideways phones put it on the right (#4) */
#mz-ui .tip-wrap .tip { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); overflow: hidden; }
#mz-ui .tip-wrap .tip .tip-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#mz-ui .tip-wrap .tip .tip-ok { float: none; align-self: flex-end; flex: 0 0 auto; }
#mz-ui .tip-wrap .tip .tip-k { align-self: flex-start; }
@media (max-height: 500px) and (orientation: landscape) {
  #mz-ui .tip-wrap .tip { width: min(760px, 94vw); display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto minmax(0, 1fr); column-gap: 16px; padding: 10px 14px; line-height: 1.6; font-size: 0.92em; }
  #mz-ui .tip-wrap .tip .tip-k, #mz-ui .tip-wrap .tip h3, #mz-ui .tip-wrap .tip .tip-body { grid-column: 1; }
  #mz-ui .tip-wrap .tip .tip-k { justify-self: start; }
  #mz-ui .tip-wrap .tip h3 { margin: 2px 0 4px; }
  #mz-ui .tip-wrap .tip .tip-ok { grid-column: 2; grid-row: 1 / -1; align-self: end; margin: 0; }
}

/* a full window starts at the margin, not under the kit's top-anchored 9vh (r12 check: the windows were 87% of a 720 px screen) */
body.mz-full .wm-layer[data-mode="large"] { padding-top: max(var(--wm-m, 32px), env(safe-area-inset-top, 0px)); }

/* a phone held upright (r12 phone review): the list took the whole height and the ticket body got 0 px; the form's choice column was one
   character wide. Fixed shares: list a quarter, the ticket the rest, the actions below; the form stacks its label over its blank */
@media (max-width: 899px) and (orientation: portrait) {
  .tk-grid { grid-template-rows: minmax(0, 24%) minmax(0, 1fr) auto; }
  .tk-side { max-height: none; }
  .tk-count { padding: 6px 10px; }
  .r12-actions { max-height: none; }
}
@media (max-width: 600px) {
  .gov-form, .gov-form tbody, .gov-form tr, .gov-form th, .gov-form td { display: block; width: auto; }
  .gov-form th { border-bottom: 0; }
  .gov-form td { border-top: 0; }
  .vn-side { max-height: 55%; }
}

/* ---- 1.11.0 (2026-11-29 #1 「選択や次へで UI のサイズ・横幅がカクカク変わる」): fixed frames. The parts of a window keep their place and size
   whatever they hold: the talk's caption box has one height (its log scrolls), the lead box is always there, the questions take the free
   middle of the column (scrolling when there are many) and the leave / evidence boxes sit at fixed places below; the ticket's buttons sit in
   a strip of fixed height. tools/check-r12.mjs measures the boxes before and after choices, 次へ and ticket clicks. */
.vn-text { height: 38%; max-height: none; margin-top: auto; flex: 0 0 auto; }
.vn-text .chat-log { flex: 1 1 auto; height: 100%; }
.dlg.chat.vn .chat-lead { flex: 0 0 auto; height: 4.4em; overflow: auto; }
.dlg.chat.vn .chat-lead.none { border-style: dashed; background: #171213; color: #b9ad9c; }
.dlg.chat.vn .opts { flex: 1 1 0; min-height: 96px; overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.dlg.chat.vn .opts-meta { flex: 0 0 auto; min-height: calc(3 * 48px + 2 * 8px); justify-content: flex-start; }
.dlg.chat.vn .evi-col { flex: 0 0 auto; height: 132px; overflow-y: auto; }
.r12-actions.vn-side { overflow: hidden; }
.dlg.chat.vn .chat-head { flex: 0 0 auto; height: 58px; }
.dlg.chat.vn .chat-head .meters { flex: 1 1 auto; min-width: 0; text-align: right; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dlg.chat.vn .bub.wait-voice::after { content: '・・・'; color: #9a8f84; letter-spacing: 0.2em; animation: mz-wait 1.2s ease-in-out infinite; }
@keyframes mz-wait { 50% { opacity: 0.3; } }
.tk-actions .r12-act-bottom { flex: 0 0 auto; min-height: calc(2 * 46px + 8px + 10px); justify-content: flex-end; }
.tk-actions .r12-act-top { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.tk-head { min-height: 50px; flex-wrap: nowrap; }
.tk-head h3 { flex: 1 1 auto; min-width: 0; }
@media (max-width: 899px) {
  .vn-text { height: 46%; margin: auto 10px 10px 10px; }
  .dlg.chat.vn .opts-meta { min-height: 0; }
  .r12-actions.vn-side { overflow-y: auto; height: 48%; max-height: 48%; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .vn-text { height: 52%; margin-left: 30%; }
  .dlg.chat.vn .chat-head { height: 46px; padding: 6px 12px; }
  .dlg.chat.vn .chat-lead { height: 3.6em; }
  .dlg.chat.vn .opts { min-height: 80px; }
  .dlg.chat.vn .opts-meta { min-height: calc(3 * 40px + 2 * 6px); }
  .r12-actions.vn-side { height: auto; max-height: none; overflow-y: auto; }
  .tk-actions .r12-act-bottom { min-height: calc(2 * 40px + 6px + 6px); }
}
@media (max-width: 899px) and (orientation: portrait) {
  .tk-actions .r12-act-bottom { min-height: 0; }
  .tk-actions .r12-act-top { flex: 0 0 auto; }
}
/* the papers (#1): one size for the whole document. The paper fills the window (its width up to 1180 px); the text scrolls inside it and the
   page buttons stay at its foot, so turning a page never resizes the sheet or moves 次の頁 */
.mzw-body.mzw-body .docwin { height: 100%; display: flex; }
.mzw-body.mzw-body .docwin .doc-wrap { flex: 1 1 auto; height: 0; min-height: 0; max-height: none; align-items: stretch; }
.mzw-body.mzw-body .docwin .doc-wrap .paper { flex: 1 1 0; width: auto; max-width: 1180px; height: auto; max-height: none; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.mzw-body.mzw-body .docwin .paper .doc-title { flex: 0 0 auto; }
.mzw-body.mzw-body .docwin .paper .doc-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.mzw-body.mzw-body .docwin .paper .doc-nav, .mzw-body.mzw-body .docwin .paper .hint { flex: 0 0 auto; }
.mzw-body.mzw-body .docwin .gain { flex: 0 0 auto; align-self: flex-start; max-height: 100%; overflow-y: auto; }
@media (max-width: 900px) {
  .mzw-body.mzw-body .docwin .doc-wrap .paper { width: 100%; }
  .mzw-body.mzw-body .docwin .gain { align-self: stretch; width: auto; max-height: 26%; }
}
/* the talk on an upright phone: the scene and the questions keep fixed shares of the height */
@media (max-width: 899px) and (orientation: portrait) {
  .mzw-body.mzw-body .dlg.chat.vn { grid-template-rows: minmax(0, 1fr) 46%; }
  .r12-actions.vn-side { height: auto; max-height: none; }
}
.dlg.chat.vn .opts-meta { height: 178px; min-height: 0; overflow-y: auto; }
.tk-actions .r12-act-bottom { height: 122px; min-height: 0; }
@media (max-height: 500px) and (orientation: landscape) {
  .dlg.chat.vn .opts-meta { height: 140px; }
  .tk-actions .r12-act-bottom { height: 104px; }
}
@media (max-width: 899px) and (orientation: portrait) {
  .dlg.chat.vn .opts-meta { height: auto; }
  .tk-actions .r12-act-bottom { height: auto; }
}
/* (#1) the thought box under a paper keeps its place on every page (it came and went, and the paper grew and shrank with it) */
.mzw-body.mzw-body .docwin .monobox { flex: 0 0 auto; height: 5.4em; overflow-y: auto; }
.mzw-body.mzw-body .docwin .monobox.hidden { display: block; visibility: hidden; }
/* (#1) the evidence a tapped question shows floats over the foot of the column instead of pushing the buttons down */
.dlg.chat.vn .r12-actions { position: relative; }
.dlg.chat.vn .evi-inline { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 3; max-height: 55%; overflow-y: auto; margin: 0; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.7); }
@media (max-width: 899px) and (orientation: portrait) {
  .dlg.chat.vn .opts-meta { height: 96px; display: flex; flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: 6px; }
  .dlg.chat.vn .opts-meta .opt { flex: 1 1 45%; width: auto; min-height: 44px; }
  .tk-grid { grid-template-rows: minmax(0, 24%) minmax(0, 1fr) 156px; }
  .tk-actions { overflow: hidden; display: flex; flex-direction: column; }
  /* (#1) the action row stays where it is: what is above it scrolls in its own share instead of pushing it down */
  .tk-actions .r12-act-top { flex: 1 1 0; min-height: 0; overflow-y: auto; }
  .tk-actions .r12-act-bottom { flex: 0 0 auto; margin-top: 0; }
}
/* ---- 1.11.0 (#4): the ticket window holds the whole 調書: a switch to the case sheet the tickets write, and the 次にすること box with its
   reason at the top of the action column on every ticket */
.tk-views { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px 8px 0; }
.tk-view { min-height: 38px; padding: 4px 6px; border: 1px solid #5c514c; border-radius: 4px 4px 0 0; background: #171213; color: #d9d0c2; font: inherit; font-size: 0.86em; cursor: pointer; }
.tk-view.on { color: #1b1714; background: #f3eee2; border-color: #f3eee2; font-weight: 700; }
.tk-view:hover:not(.on), .tk-view:focus-visible { color: #fff; background: #2a1d1e; }
.tk-next { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid #8e3a34; border-radius: 4px; background: #241819; color: #ece5d8; }
.tk-next .k { font-size: 0.8em; letter-spacing: 0.12em; color: #ffd27a; }
.tk-next b { color: #fff; line-height: 1.55; }
.tk-next p { margin: 0; font-size: 0.9em; line-height: 1.6; color: #e3d9cb; }
.tk-next .tk-next-why span, .tk-why::first-letter { color: #f0b9a8; }
.tk-next .tk-next-why span { display: inline-block; margin-right: 6px; padding: 0 6px; border: 1px solid #8e3a34; border-radius: 3px; font-size: 0.85em; color: #f0b9a8; }
.tk-next .btn { margin-top: 4px; min-height: 40px; }
.tk-why { display: block; margin-top: 4px; font-size: 0.92em; color: #e3d9cb; }
.tk-casesheet { max-width: none; }
.gs-table .gs-act th { padding-top: 12px; text-align: left; font-family: 'Zen Old Mincho', serif; letter-spacing: 0.2em; background: #e7e0cf; color: #1b1714; }
.gs-table .gs-row th small { display: block; font-size: 0.8em; color: #4a3f36; }
.gs-blank { color: #5b5047; }
.gs-row.st-ready .gs-blank { color: #8e1d1d; font-weight: 700; }
@media (max-height: 500px) and (orientation: landscape) {
  .tk-views { padding: 4px 4px 0; }
  .tk-view { min-height: 32px; font-size: 0.78em; }
  .tk-next { padding: 6px 8px; font-size: 0.9em; }
}
/* (#4, 1.11.1 live check) the case sheet on an upright phone: each label above its line (two columns left the written line off the paper) */
@media (max-width: 899px) and (orientation: portrait) {
  .gs-table, .gs-table tbody, .gs-table tr, .gs-table th, .gs-table td { display: block; width: auto; max-width: none; }
  .gs-table .gs-row th { border-bottom: 0; padding-bottom: 2px; }
  .gs-table .gs-row td { padding-top: 4px; }
}
