:root {
  --desk: #1d1915;
  --desk-2: #2a241e;
  --paper: #f4ecd8;
  --paper-edge: #d9ccab;
  --ink: #2a2520;
  --ink-soft: #6b6155;
  --stamp: #a3262a;
  --brass: #c9a14a;
  --ok: #3f7a4a;
  --ui-text: #eee4cf;
  --ui-muted: #a89b86;
  --font-ui: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-paper: "Times New Roman", Georgia, serif;
  --font-mono: Consolas, "Courier New", monospace;
  --font-hand: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  --shadow-paper: 0 1px 0 var(--paper-edge), 0 18px 40px rgba(0, 0, 0, .45);
  --dur: 180ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at 30% 0%, #3a3027 0%, var(--desk) 60%) fixed, var(--desk);
  color: var(--ui-text);
  font: 15px/1.55 var(--font-ui);
}
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .doc-item:focus-visible {
  outline: 2px solid var(--brass); outline-offset: 2px;
}
[hidden] { display: none !important; }

/* Thanh trên */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: rgba(20, 17, 14, .92); border-bottom: 1px solid #3b3229;
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
.brand-text { display: flex; flex-direction: column; }
.brand-series { letter-spacing: .32em; font-size: 11px; color: var(--brass); font-weight: 700; }
.brand-case { font-family: var(--font-paper); font-size: 19px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions button, .btn {
  background: transparent; color: var(--ui-text); border: 1px solid #5a4c3d; border-radius: 3px;
  padding: 8px 14px; transition: background var(--dur), border-color var(--dur), transform var(--dur);
}
.actions button:hover, .btn:hover { background: #3a3027; border-color: var(--brass); }
.actions button:active, .btn:active { transform: translateY(1px); }
.primary, .btn.primary { background: var(--stamp) !important; border-color: var(--stamp) !important; color: #fff; font-weight: 600; }
.primary:hover { filter: brightness(1.1); }
.primary:disabled { opacity: .45; cursor: not-allowed; }

/* Màn mở đầu */
.intro { max-width: 720px; margin: 48px auto; padding: 0 20px; }
.folder {
  position: relative; background: #c9a86a; color: var(--ink); padding: 44px 48px 36px; border-radius: 4px 4px 3px 3px;
  box-shadow: var(--shadow-paper); font-family: var(--font-paper); font-size: 17px;
}
.folder::before {
  content: ""; position: absolute; top: -18px; left: 28px; width: 180px; height: 22px;
  background: #c9a86a; border-radius: 6px 6px 0 0;
}
.folder h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: .02em; }
.folder .stamp { position: absolute; top: 26px; right: 30px; }
.folder blockquote { margin: 12px 0; padding: 8px 16px; border-left: 3px solid var(--stamp); background: rgba(255,255,255,.25); font-style: italic; }
.folder .date { color: #5a4630; font-style: italic; margin: 0 0 12px; }
.goals { font-size: 18px; }
.folder .muted { color: #5a4630; }
.intro .btn.primary { margin-top: 24px; padding: 12px 28px; font-size: 16px; }
.stamp {
  display: inline-block; color: var(--stamp); border: 3px solid var(--stamp); padding: 4px 12px; border-radius: 4px;
  font: 700 14px/1 var(--font-mono); letter-spacing: .18em; transform: rotate(-6deg); opacity: .85;
}

/* Bàn làm việc */
.desk { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 64px); }
.doclist { border-right: 1px solid #3b3229; padding: 16px 12px 40px; overflow-y: auto; max-height: calc(100vh - 64px); position: sticky; top: 64px; }
.doclist h2 { font-size: 11px; letter-spacing: .24em; color: var(--ui-muted); margin: 18px 8px 6px; font-weight: 700; }
.doclist .progress { margin: 0 8px 8px; font-size: 13px; color: var(--ui-muted); }
.doc-item {
  display: grid; grid-template-columns: 28px 1fr 18px; align-items: center; gap: 6px; width: 100%;
  background: transparent; color: var(--ui-text); border: 0; border-left: 3px solid transparent;
  text-align: left; padding: 7px 8px; border-radius: 2px; transition: background var(--dur);
}
.doc-item:hover { background: var(--desk-2); }
.doc-item.active { background: #3a3027; border-left-color: var(--brass); }
.doc-item .num { font: 12px var(--font-mono); color: var(--ui-muted); }
.doc-item.unread .ttl { font-weight: 700; }
.doc-item.unread .num::after { content: "•"; color: var(--stamp); margin-left: 2px; }
.doc-item.locked { opacity: .45; cursor: not-allowed; }
.doc-item .pin { color: var(--brass); font-size: 13px; }

.viewer { padding: 32px clamp(16px, 4vw, 56px) 80px; }
.viewer-tools { display: flex; justify-content: space-between; align-items: center; max-width: 820px; margin: 0 auto 14px; gap: 8px; flex-wrap: wrap; }
.viewer-tools .label { color: var(--ui-muted); font-size: 13px; letter-spacing: .08em; }

.paper {
  max-width: 820px; margin: 0 auto; background: var(--paper); color: var(--ink);
  padding: 44px clamp(20px, 5vw, 60px); box-shadow: var(--shadow-paper); font-family: var(--font-paper); font-size: 16.5px;
  background-image: linear-gradient(rgba(120, 90, 40, .04) 1px, transparent 1px); background-size: 100% 28px;
  animation: slideIn 260ms cubic-bezier(.16, 1, .3, 1);
}
.paper.kind-photo { background: #e9e4da; }
.paper.kind-log { font-family: var(--font-mono); font-size: 14.5px; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px) rotate(-.3deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .paper { animation: none; } }

.qh { text-align: center; margin-bottom: 18px; }
.org { font-weight: 700; text-align: center; letter-spacing: .04em; margin-bottom: 8px; }
.org small { font-weight: 400; letter-spacing: 0; color: var(--ink-soft); }
.doc-title { text-align: center; font-size: 20px; letter-spacing: .06em; margin: 14px 0 4px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); font-size: .92em; }
.sign { width: 260px; margin: 28px 0 0 auto; text-align: center; }
.hand { font-family: var(--font-hand); color: #1f3a8a; font-size: 22px; }
.hand.small { font-size: 15px; transform: rotate(-2deg); display: inline-block; }
.hand.big { font-size: 26px; display: inline-block; transform: rotate(-3deg); margin: 4px 8px; }
table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.kv td { padding: 4px 8px; border-bottom: 1px dotted #b9ab8b; vertical-align: top; }
.kv td:first-child { width: 34%; color: var(--ink-soft); }
.log th, .log td { border: 1px solid #b9ab8b; padding: 6px 8px; text-align: left; vertical-align: top; }
.log th { background: #e6dbbf; }
.log td:first-child { white-space: nowrap; font-family: var(--font-mono); }
.qa p { margin: 6px 0; }
.qa p:nth-child(odd) { margin-top: 14px; }
.notes li, .sms li { margin: 4px 0; }
.receipt { border: 2px dashed #9b8b6b; padding: 16px; background: #fbf6e8; }

svg.plan, svg.photo, img.photo { width: 100%; height: auto; display: block; margin: 8px 0; }
svg.photo, img.photo { border: 10px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.25); transform: rotate(-.6deg); }
svg .room rect { fill: #fbf6e8; stroke: #333; }
svg .room.hl rect { fill: #f3d9c9; stroke: var(--stamp); stroke-width: 2; }
svg.plan text, svg.photo text { font: 16px var(--font-ui); text-anchor: middle; fill: #222; }
svg.plan text.sm { font-size: 12px; fill: #555; }
svg.plan text.lbl { font-size: 13px; letter-spacing: .12em; fill: #555; }
svg.photo text.mb { font: 10px var(--font-mono); fill: #f2f2f2; }
svg.photo text.cap { font-size: 14px; fill: #f4ecd8; }
svg.photo text.cap.dark { fill: #333; }
svg.photo text.hw { font: 22px var(--font-hand); text-anchor: start; }
.caption { font-style: italic; }

.phone { max-width: 380px; margin: 10px auto; background: #e8eef5; border-radius: 22px; padding: 12px; border: 8px solid #222; font-family: var(--font-ui); font-size: 14px; }
.phone-head { display: flex; flex-direction: column; padding: 4px 8px 10px; border-bottom: 1px solid #c8d2dd; }
.phone-head small { color: #6b7785; }
.phone-day { text-align: center; font-size: 12px; color: #6b7785; margin: 8px 0; }
.chat { display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 80%; padding: 7px 10px; border-radius: 12px; display: flex; flex-direction: column; }
.msg time { font-size: 11px; color: #6b7785; align-self: flex-end; }
.msg.in { background: #fff; align-self: flex-start; border-bottom-left-radius: 3px; }
.msg.out { background: #cfe3ff; align-self: flex-end; border-bottom-right-radius: 3px; }

.followup { max-width: 820px; margin: 18px auto 0; }
.followup .paper { padding-top: 26px; border-top: 4px solid var(--stamp); }
.followup-locked { color: var(--ui-muted); font-size: 14px; text-align: center; }
.key { background: #fff3c4; padding: 8px 12px; border-left: 4px solid var(--brass); }

/* Ngăn kéo: sổ tay, gợi ý */
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(420px, 100vw); z-index: 40;
  background: #241f1a; border-left: 1px solid #4a3e32; box-shadow: -20px 0 40px rgba(0,0,0,.4);
  display: flex; flex-direction: column;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #3b3229; }
.drawer-head h2 { margin: 0; font-size: 16px; letter-spacing: .1em; }
.drawer-head button { background: none; border: 0; color: var(--ui-text); font-size: 18px; }
.drawer-body { padding: 18px; overflow-y: auto; flex: 1; }
.drawer textarea {
  width: 100%; min-height: 55vh; resize: vertical; background: var(--paper); color: var(--ink);
  font: 18px/28px var(--font-hand); border: 0; padding: 10px 14px;
  background-image: linear-gradient(transparent 27px, #c8b993 28px); background-size: 100% 28px;
}
.hint { background: var(--paper); color: var(--ink); padding: 12px 14px; margin-bottom: 10px; font-family: var(--font-paper); }
.hint b { color: var(--stamp); }

/* Kết luận */
.conclude { max-width: 820px; margin: 32px auto 80px; padding: 0 16px; }
.conclude .paper h3 { margin-top: 0; }
.q-block { padding: 18px 0; border-bottom: 1px dashed #b9ab8b; }
.q-block:last-of-type { border-bottom: 0; }
.q-block label { display: block; font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.q-block select, .q-block input[type=text] {
  width: 100%; padding: 9px 10px; font: 16px var(--font-paper); background: #fffaf0; border: 1px solid #b9ab8b; color: var(--ink);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips span { width: 100%; font-size: 13px; color: var(--ink-soft); }
.chip { border: 1px solid #b9ab8b; background: #fffaf0; color: var(--ink); padding: 4px 9px; border-radius: 14px; font: 13px var(--font-ui); }
.chip[aria-pressed=true] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.result-score { text-align: center; }
.result-score .big { font: 700 64px/1 var(--font-paper); color: var(--stamp); margin: 20px 0 6px; }
.paper .btn:not(.primary) { color: var(--ink); border-color: #9b8b6b; }
.paper .btn:not(.primary):hover { background: #e6dbbf; border-color: var(--ink); }
.res-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dotted #b9ab8b; }
.res-row .ok { color: var(--ok); font-weight: 700; }
.res-row .bad { color: var(--stamp); font-weight: 700; }
.tag { font: 700 11px var(--font-mono); background: var(--stamp); color: #fff; padding: 2px 6px; letter-spacing: .1em; }
.warn { background: #f7e1d0; padding: 10px 12px; border-left: 4px solid var(--stamp); }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: #111; color: #fff; padding: 10px 16px; border-radius: 4px; border: 1px solid var(--brass);
}

/* Nút phụ */
.btn.big { padding: 12px 22px; font-size: 16px; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost, .actions button.ghost { border-color: transparent; }
.btn:disabled { opacity: .5; cursor: wait; }
.link { background: none; border: 0; padding: 0; color: var(--brass); text-decoration: underline; font-size: inherit; }
code { font-family: var(--font-mono); background: rgba(0,0,0,.08); padding: 1px 5px; }

/* Màn hình chờ */
body[data-screen="title"] .topbar { background: linear-gradient(180deg, rgba(20,17,14,.7) 0%, rgba(20,17,14,0) 100%); border-bottom: 0; position: absolute; width: 100%; backdrop-filter: none; -webkit-backdrop-filter: none; }
.title-screen { position: relative; min-height: 100vh; display: grid; align-items: end; overflow: hidden; }
.title-art { position: absolute; inset: 0; }
.title-art svg, .title-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.title-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,17,14,.1) 0%, rgba(20,17,14,.55) 45%, var(--desk) 92%); }
.title-body { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; padding: 0 clamp(20px, 6vw, 80px) 56px; align-items: end; }
.kicker { font: 700 11px var(--font-ui); letter-spacing: .3em; color: var(--brass); margin: 0 0 8px; }
.logo { font: 700 clamp(44px, 7vw, 92px)/.95 var(--font-paper); margin: 0; color: var(--paper); text-shadow: 0 4px 30px rgba(0,0,0,.6); }
.logo { letter-spacing: .12em; }
.logo-sub { font: 400 clamp(22px, 3vw, 34px)/1.2 var(--font-paper); margin: 6px 0 0; color: var(--paper); text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.logo-sub span { color: #f2c66b; font-style: italic; }
.tagline { font: italic 20px var(--font-paper); color: var(--ui-text); margin: 14px 0 26px; }
.menu { display: flex; flex-wrap: wrap; gap: 10px; }
.chapters { list-style: none; margin: 0; padding: 18px; background: rgba(20,17,14,.78); border: 1px solid #4a3e32; backdrop-filter: blur(4px); }
.chapters li { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; padding: 9px 4px; border-bottom: 1px dashed #3b3229; align-items: center; }
.chapters li:last-child { border-bottom: 0; }
.chapters .no { font: 700 15px var(--font-mono); color: var(--brass); }
.chapters .t { font-family: var(--font-paper); font-size: 16px; }
.chapters .st { font-size: 12px; color: var(--ui-muted); }
.chapters li.locked .t { color: var(--ui-muted); }
.chapters li.open .st { color: #9fd49f; }

/* Dẫn truyện */
.prologue { max-width: 1040px; margin: 0 auto; padding: 40px 20px 60px; min-height: calc(100vh - 64px); display: flex; flex-direction: column; justify-content: center; }
.slide { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; align-items: center; animation: slideIn 420ms cubic-bezier(.16, 1, .3, 1); }
.slide-visual svg.scene, .slide-visual img.scene { width: 100%; height: auto; box-shadow: var(--shadow-paper); }
.slide-text { font: 21px/1.6 var(--font-paper); }
.slide-text p { margin: 0 0 14px; }
.slide-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 36px; gap: 12px; }
.slide-nav > div:last-child { display: flex; gap: 8px; }
.dots { display: flex; gap: 8px; }
.dots span { width: 9px; height: 9px; border-radius: 50%; background: #4a3e32; transition: background var(--dur), transform var(--dur); }
.dots span.on { background: var(--brass); transform: scale(1.3); }
.mini-paper { background: var(--paper); color: var(--ink); padding: 28px 32px; font-family: var(--font-paper); box-shadow: var(--shadow-paper); transform: rotate(-2deg); max-width: 380px; margin: 0 auto; }
.mini-paper p { margin: 6px 0; }
.duo { display: flex; gap: 18px; justify-content: center; }
.duo .portrait { width: min(200px, 42%); height: auto; border: 8px solid #fff; box-shadow: var(--shadow-paper); }
.duo .art:nth-child(2) .portrait { transform: rotate(3deg) translateY(14px); }
.duo .art:first-child .portrait { transform: rotate(-2deg); }
.case-stack { position: relative; height: 260px; max-width: 360px; margin: 0 auto; }
.case-stack span { position: absolute; left: 0; right: 0; height: 170px; background: #c9a86a; border-radius: 4px; box-shadow: 0 10px 24px rgba(0,0,0,.45); color: var(--ink); font: 700 34px var(--font-mono); padding: 14px 20px; }
.case-stack span:nth-child(1) { top: 0; transform: rotate(-4deg); }
.case-stack span:nth-child(2) { top: 18px; transform: rotate(2deg); background: #bf9c5e; }
.case-stack span:nth-child(3) { top: 36px; transform: rotate(-1deg); background: #b59152; }
.case-stack span:nth-child(4) { top: 54px; transform: rotate(3deg); background: #ab8748; }
.case-stack span:nth-child(5) { top: 72px; transform: rotate(-2deg); background: #a37e40; }

/* Sảnh nhóm */
.lobby { max-width: 820px; margin: 40px auto 80px; padding: 0 16px; }
.lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.lobby-box { border: 1px dashed #b9ab8b; padding: 16px 18px; background: #fbf6e8; }
.lobby-box h3 { margin: 0 0 6px; }
.field { display: block; font-weight: 700; margin: 12px 0; }
.field input { display: block; width: 100%; margin-top: 6px; padding: 9px 10px; font: 17px var(--font-paper); background: #fffaf0; border: 1px solid #b9ab8b; color: var(--ink); }
#lobbyCode { text-transform: uppercase; letter-spacing: .3em; font-family: var(--font-mono); }
.lobby-error { color: var(--stamp); font-weight: 700; min-height: 1.4em; }
.howto p { margin: 0 0 12px; }

/* Ảnh thẻ, nhân vật, camera */
.mugshot { float: right; width: 108px; margin: 0 0 10px 18px; transform: rotate(2deg); }
.mugshot svg, .mugshot img { width: 100%; height: auto; display: block; border: 5px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.mugshot figcaption { font: 11px var(--font-ui); color: var(--ink-soft); text-align: center; }
.char-grid { display: grid; gap: 12px; }
.char-card { display: grid; grid-template-columns: 84px 1fr; gap: 12px; background: var(--paper); color: var(--ink); padding: 10px; }
.char-card svg, .char-card img { width: 84px; height: auto; border: 4px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.char-card h3 { margin: 0; font-family: var(--font-paper); }
.char-card p { margin: 4px 0; font-size: 14px; }
.char-card .meta { color: var(--ink-soft); font-size: 13px; }
.char-card.unknown { opacity: .7; }
.cctv { margin: 12px 0; }
.cctv-screen { position: relative; background: #222; border: 3px solid #111; overflow: hidden; }
.cctv-screen .cctv-img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.cctv-screen img.cctv-img { filter: grayscale(1) contrast(1.1) brightness(.92); }
.cctv-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.2) 0 2px, transparent 2px 4px), rgba(79,107,82,.18); }
.cctv-cam, .cctv-stamp, .cctv-rec { position: absolute; z-index: 1; font: 13px Consolas, monospace; color: #e8f3e0; text-shadow: 0 0 3px #000; }
.cctv-cam { top: 8px; left: 10px; }
.cctv-rec { top: 8px; right: 10px; color: #ff6a6a; }
.cctv-stamp { bottom: 8px; left: 10px; }
.cctv figcaption { font: italic 13px var(--font-paper); color: var(--ink-soft); margin-top: 4px; }
.stills { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* Bàn chơi nhóm */
.desk.team { grid-template-columns: 260px minmax(0, 1fr) 340px; }
.tool-row { display: flex; gap: 8px; flex-wrap: wrap; }
.team-panel { border-left: 1px solid #3b3229; background: #201b17; display: flex; flex-direction: column; position: sticky; top: 64px; height: calc(100vh - 64px); padding: 14px 14px 10px; }
#teamDyn { overflow-y: auto; max-height: 48%; flex-shrink: 0; }
.team-panel h4 { font-size: 11px; letter-spacing: .2em; color: var(--ui-muted); margin: 14px 0 6px; }
.team-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.room-code { font: 700 20px var(--font-mono); letter-spacing: .18em; color: #f2c66b; }
.net { display: block; font-size: 11px; color: var(--ui-muted); }
.net.online { color: #9fd49f; }
.net.reconnecting, .net.closed, .net.error { color: #f0a080; }
.players { list-style: none; margin: 0; padding: 0; }
.players li { padding: 4px 0; font-size: 14px; }
.players li.off { opacity: .5; }
.players small { display: block; margin-left: 16px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.badge { font-size: 10px; background: #3a3027; color: var(--brass); padding: 1px 5px; border-radius: 3px; }
.badge.me { color: #9fd49f; }
.pin-row { display: flex; flex-wrap: wrap; gap: 6px; }
.team-panel .chip { background: #3a3027; color: var(--ui-text); border-color: #5a4c3d; }
.votes { overflow-x: auto; }
.votes table { font-size: 12px; margin: 0; }
.votes th, .votes td { border: 1px solid #3b3229; padding: 4px 6px; text-align: left; }
.conclude .votes th, .conclude .votes td { border-color: #b9ab8b; }
.chat-log { list-style: none; margin: 0; padding: 0 2px; overflow-y: auto; flex: 1; min-height: 120px; font-size: 14px; }
.chat-log li { padding: 6px 0; border-bottom: 1px solid #2c2620; word-wrap: break-word; }
.chat-log li.sys { color: var(--ui-muted); font-style: italic; font-size: 13px; }
.chat-log time { font-size: 11px; color: var(--ui-muted); }
.doc-ref { display: block; margin-top: 4px; background: var(--paper); color: var(--ink); border: 0; border-left: 3px solid var(--brass); padding: 5px 8px; text-align: left; font-size: 13px; width: 100%; }
.doc-ref:hover { background: #fff; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; }
.chat-form input { flex: 1; min-width: 0; padding: 8px; background: #fffaf0; border: 1px solid #5a4c3d; font: 14px var(--font-ui); }
.team-foot { text-align: right; margin-top: 6px; }
.small { font-size: 13px; }

@media (max-width: 1180px) {
  .desk.team { grid-template-columns: 1fr; }
  .desk.team .doclist { position: static; max-height: 240px; border-right: 0; border-bottom: 1px solid #3b3229; }
  .team-panel { position: static; height: auto; max-height: 80vh; border-left: 0; border-top: 1px solid #3b3229; }
}

@media (max-width: 860px) {
  .title-body, .slide, .lobby-grid, .stills { grid-template-columns: 1fr; }
  .slide-text { font-size: 18px; }
  .mugshot { width: 84px; }
  .desk { grid-template-columns: 1fr; }
  .doclist { position: static; max-height: none; border-right: 0; border-bottom: 1px solid #3b3229; }
  .topbar { padding: 10px 14px; }
  .folder { padding: 36px 22px 28px; }
}

/* Ảnh thật (assets/img) và lớp chứa hình */
.art { display: contents; }
img.portrait { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 25%; }
img.scene { display: block; object-fit: cover; }
img.photo { aspect-ratio: 560 / 300; object-fit: cover; }
.ev-photo { position: relative; }
.ev-tag { display: none; position: absolute; background: #f4efe1; padding: 6px 12px 8px; box-shadow: 0 3px 8px rgba(0,0,0,.35); border-left: 4px solid var(--stamp); }
.ev-tag small { display: block; font: 10px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.ev-tag b { font-size: 22px; font-weight: 400; color: #1f2f6a; white-space: nowrap; }
.ev-tag-1 { left: 5%; bottom: 8%; transform: rotate(-3deg); }
.ev-tag-2 { right: 5%; bottom: 14%; transform: rotate(4deg); }
.ev-tag-2 b { color: #1e1e1e; }
.ev-photo:has([data-hydrated]) .ev-tag { display: block; }
.evid { float: right; width: 190px; margin: 0 0 12px 20px; }
.evid svg, .evid img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 6px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.evid figcaption { font: 12px var(--font-ui); color: var(--ink-soft); text-align: center; margin-top: 6px; }
@media (max-width: 640px) { .evid { float: none; width: 70%; margin: 0 auto 14px; } }

/* Sách cổ */
.toc { margin: 6px 0 14px; padding-left: 22px; }
.toc li { margin: 4px 0; }
.tale { background: #efe3c4; border-left: 4px solid #8a5a2a; padding: 12px 16px; margin: 10px 0 16px; font-style: italic; }
.tale p { margin: 0 0 10px; }
.tale p:last-child { margin: 0; }
.margins { list-style: none; padding: 0; }
.margins li { margin: 8px 0; }
.ink-old { color: #6a3d7a; font-size: 13px; }
.ink-new { color: #1f2f6a; font-size: 13px; }
.margins .hand { display: block; font-size: 1.2em; }
.margins .hand.purple { color: #6a3d7a; }
.memo { background: #fff8d6; border: 1px dashed #b49a4a; padding: 10px 14px; margin-top: 14px; }
.memo ul { margin: 6px 0; }
.chapters .src { display: block; font: italic 12px var(--font-paper); color: var(--ui-muted); margin-top: 2px; }
.slide-photo svg, .slide-photo img { width: 100%; height: auto; display: block; box-shadow: var(--shadow-paper); }

/* Bản kết luận nhiều phần */
.q-section { margin: 22px 0 6px; padding-top: 6px; border-top: 3px double #8a7a5a; }
.q-section-title { font: 700 13px var(--font-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--stamp); margin: 10px 0 2px; }
.q-section-title small { letter-spacing: 0; text-transform: none; color: var(--ink-soft); font-weight: 400; margin-left: 6px; }
.q-section-intro { font-style: italic; color: var(--ink-soft); margin: 0 0 4px; }
.q-no { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 700 13px var(--font-ui); vertical-align: 2px; }
.q-help { font-size: 14px; color: var(--ink-soft); margin: -2px 0 10px; }
.match { display: grid; gap: 6px; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 260px); gap: 10px; align-items: center; padding: 4px 8px; background: rgba(255,255,255,.35); border-left: 3px solid #c9b88f; }
.match-row select { width: 100%; }
.match-res { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; }
.res-row .match-res li { font-weight: 400; }
.res-row > span:last-child { white-space: nowrap; }
.match-res li.ok { color: var(--ok); }
.match-res li.bad { color: var(--stamp); }
.vote-card { border: 1px solid #3b3229; margin: 6px 0; padding: 4px 8px; font-size: 12px; }
.conclude .vote-card { border-color: #b9ab8b; }
.vote-card summary { cursor: pointer; }
.vote-card ul { list-style: none; margin: 6px 0 0; padding: 0; }
.vote-card li { padding: 3px 0; border-top: 1px dotted #3b3229; }
.vote-card li span { display: block; opacity: .7; font-size: 11px; }
.vote-card li.agree { color: #7fbf7f; }
.conclude .vote-card li.agree { color: var(--ok); }
@media (max-width: 860px) { .match-row { grid-template-columns: 1fr; } }

/* ---------- Bảng điều tra (bảng bần, sợi chỉ đỏ) ---------- */
.board-screen { display: grid; grid-template-columns: 270px minmax(0, 1fr); height: calc(100vh - 64px); }
.board-tray { user-select: none; overflow-y: auto; padding: 16px 14px; background: #201b17; border-right: 1px solid #3b3229; display: flex; flex-direction: column; gap: 8px; }
.board-tray h3 { margin: 0; font: 700 13px var(--font-ui); letter-spacing: .2em; color: var(--brass); }
.board-tray h4 { margin: 10px 0 0; font-size: 11px; letter-spacing: .2em; color: var(--ui-muted); }
.board-tray .small { font-size: 13px; color: var(--ui-muted); margin: 0; }
.board-tools { display: flex; gap: 6px; }
.board-tools .btn[aria-pressed="true"] { background: var(--stamp); border-color: var(--stamp); color: #fff; }
.tray-list { display: flex; flex-direction: column; gap: 4px; }
.tray-list .chip { text-align: left; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray-list .chip:disabled { opacity: .35; cursor: default; }
.board-scroll { overflow: auto; position: relative; background: #5a3d24; }
.board-canvas { position: relative;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,220,160,.18) 0 1px, transparent 2px) 0 0 / 23px 19px,
    radial-gradient(circle at 70% 60%, rgba(60,30,10,.35) 0 1.2px, transparent 2px) 0 0 / 17px 29px,
    radial-gradient(circle at 40% 80%, rgba(255,230,180,.12) 0 1px, transparent 2px) 0 0 / 31px 13px,
    radial-gradient(ellipse at center, #c08a52 0%, #a8733f 60%, #8a5a2e 100%);
  box-shadow: inset 0 0 0 14px #5b3b20, inset 0 0 0 16px #3b2614, inset 0 0 80px rgba(0,0,0,.45); }
.board-canvas.linking { cursor: crosshair; }
.board-empty { position: absolute; left: 60px; top: 60px; margin: 0; padding: 14px 18px; background: rgba(255,250,235,.85); color: var(--ink); font: italic 16px var(--font-paper); box-shadow: var(--shadow-paper); transform: rotate(-1deg); }
.board-strings { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.bstring { fill: none; stroke: #b3121b; stroke-width: 2.6; stroke-linecap: round; }
.bstring-shadow { fill: none; stroke: rgba(0,0,0,.35); stroke-width: 3; transform: translate(2px, 4px); }
.bstring-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.bstring-hit:hover + *, .bstring-hit:hover { stroke: rgba(255,255,255,.25); }
.bpin { fill: #c4161c; stroke: #6d0a0e; stroke-width: 1.5; }
.bpin-shadow { fill: rgba(0,0,0,.4); }
.bpin-shine { fill: rgba(255,255,255,.75); }
.bcard { position: absolute; width: 160px; padding: 18px 8px 8px; background: #fbf7ec; color: var(--ink); box-shadow: 0 6px 14px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.3);
  transform: rotate(var(--tilt, 0deg)); cursor: grab; touch-action: none; user-select: none; transition: box-shadow .15s, transform .15s; }
.bcard:focus-visible { outline: 3px solid #f2c66b; outline-offset: 3px; }
.bcard.dragging { cursor: grabbing; transform: rotate(0deg) scale(1.04); box-shadow: 0 16px 30px rgba(0,0,0,.55); z-index: 5; transition: none; }
.bcard.selected { box-shadow: 0 0 0 4px #f2c66b, 0 10px 20px rgba(0,0,0,.5); }
.linking .bcard { cursor: crosshair; }
.bthumb { height: 120px; overflow: hidden; background: #2a2622; display: grid; place-items: center; }
.bthumb > *, .bthumb .art > * { max-width: 100%; }
.bthumb svg, .bthumb img { width: 100%; height: 120px; object-fit: cover; display: block; border: 0 !important; box-shadow: none !important; transform: none !important; margin: 0 !important; }
.bcard.person { width: 140px; }
.bcard.person .bthumb { height: 160px; }
.bcard.person .bthumb svg, .bcard.person .bthumb img { height: 160px; object-position: 50% 20%; }
.bthumb .cctv-screen { width: 100%; border: 0; }
.bthumb .cctv-screen span { display: none; }
.blabel { font: 12px/1.3 var(--font-ui); padding-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.blabel b { color: var(--stamp); }
.bcard.person .blabel { text-align: center; display: block; }
.bcard.person .blabel b { display: block; color: var(--ink); font-family: var(--font-paper); font-size: 14px; }
.bcard.person .blabel small { color: var(--ink-soft); }
.bcard.note { width: 170px; min-height: 150px; padding: 22px 10px 10px; background: #f7e27a; box-shadow: 0 6px 12px rgba(0,0,0,.35); }
.bcard.note textarea { width: 100%; min-height: 110px; border: 0; background: transparent; resize: none; font: 19px/1.25 var(--font-hand); color: #1f2f6a; cursor: text; }
.bcard.note textarea:focus { outline: 1px dashed #b49a4a; }
.bactions { position: absolute; top: 2px; right: 2px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.bcard:hover .bactions, .bcard:focus-within .bactions { opacity: 1; }
.bactions button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(30,25,20,.8); color: #fff; font-size: 12px; cursor: pointer; }
.bactions button:hover { background: var(--stamp); }
.bthumb .mini-paper, .bthumb .mini-phone { width: 86px; height: 110px; background: #f4ecd8; padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.bthumb .mini-paper b { height: 6px; width: 70%; margin: 0 auto 4px; background: #555; }
.bthumb .mini-paper i { height: 3px; background: #b9ab8b; }
.bthumb .mini-paper.kind-log i:nth-child(odd) { background: #8a7a5a; }
.bthumb .mini-phone { width: 64px; border-radius: 10px; background: #e9eef5; border: 4px solid #222; }
.bthumb .mini-phone i { height: 12px; width: 70%; border-radius: 6px; background: #fff; }
.bthumb .mini-phone i.out { align-self: flex-end; background: #cfe3ff; }
#btnBoard[aria-pressed="true"] { background: var(--stamp); border-color: var(--stamp); color: #fff; }
@media (max-width: 860px) {
  .board-screen { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .board-tray { max-height: 34vh; border-right: 0; border-bottom: 1px solid #3b3229; }
}

/* ---------- Icon trong nút ---------- */
.actions button, .btn, .chip, .doc-ref, .bactions button, #drawerClose { display: inline-flex; align-items: center; justify-content: center; gap: .42em; }
.actions button .ic { opacity: .85; }
.tray-list .chip { display: block; }
.bactions button .ic { width: 13px; height: 13px; }
.doc-item .pin .ic { color: var(--stamp); width: 13px; height: 13px; }
.result .ok .ic, li.ok > .ic { color: #3f7a3a; }
li.bad > .ic { color: var(--stamp); }
.title-screen .st .ic { width: .95em; height: .95em; }
.paper .key .ic { color: #8a6a2a; }

/* ---------- Bảng chung của nhóm ---------- */
.board-team { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.board-host { min-width: 0; }
.bcard.held { outline: 3px solid var(--holder); outline-offset: 3px; }
.bholder { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); white-space: nowrap; background: var(--holder); color: #fff;
  font: 600 11px/1 var(--font-ui); padding: 5px 8px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.4); pointer-events: none; z-index: 3; }
.bholder::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #fff; margin-right: 6px; vertical-align: 1px; animation: blink 1s infinite; }
.bsign { display: block; text-align: right; font: italic 12px var(--font-hand, cursive); color: #6b5a3a; margin-top: 2px; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- Mic thảo luận ---------- */
.voice-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; padding: 8px 10px; border: 1px dashed #5a4c3d; border-radius: 6px; }
.voice-bar.on { border-style: solid; border-color: #7a5a3a; background: rgba(160, 60, 40, .12); }
.voice-bar small { font-size: 12px; }
.mic-badge { display: inline-flex; align-items: center; color: #bfae8f; margin-left: 4px; }
.mic-badge.talking { color: #7fd08a; }
.players li.talking .dot { box-shadow: 0 0 0 3px rgba(127, 208, 138, .55), 0 0 10px rgba(127, 208, 138, .8); }
.players .busy { color: #f0c987; display: inline-flex; align-items: center; gap: 4px; }
.players .busy .ic { width: 12px; height: 12px; }

@media (max-width: 1100px) {
  .board-team { grid-template-columns: 1fr; }
}

/* ==== ICONS:START (sinh tự động bởi icons-gen, đừng sửa tay) ==== */
.ic{display:inline-block;width:1.1em;height:1.1em;flex:none;vertical-align:-0.18em;background-color:currentColor;-webkit-mask:var(--i) center/contain no-repeat;mask:var(--i) center/contain no-repeat}
.ic-menu{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h10'/%3E%3C/svg%3E")}
.ic-board{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3.5' width='18' height='13.5' rx='1.2'/%3E%3Cpath d='M7.5 8.5l4.5 4 4.5-3.5' stroke-dasharray='0'/%3E%3Ccircle cx='7.5' cy='8.5' r='1.3' fill='black'/%3E%3Ccircle cx='12' cy='12.5' r='1.3' fill='black'/%3E%3Ccircle cx='16.5' cy='9' r='1.3' fill='black'/%3E%3Cpath d='M8 17l-1.5 4M16 17l1.5 4'/%3E%3C/svg%3E")}
.ic-desk{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7.5V19h18V9.5H11.5L9.5 7H3.8'/%3E%3Cpath d='M3 7.5V5h6l1.5 2'/%3E%3C/svg%3E")}
.ic-close{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E")}
.ic-star{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.8l2.5 5.2 5.7.7-4.2 3.9 1.1 5.6L12 16.4l-5.1 2.8L8 13.6 3.8 9.7l5.7-.7z'/%3E%3C/svg%3E")}
.ic-star-fill{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.8l2.5 5.2 5.7.7-4.2 3.9 1.1 5.6L12 16.4l-5.1 2.8L8 13.6 3.8 9.7l5.7-.7z'/%3E%3C/svg%3E")}
.ic-chat{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4.5h14a1.5 1.5 0 0 1 1.5 1.5v8.5A1.5 1.5 0 0 1 19 16h-8l-4.5 3.5V16H5a1.5 1.5 0 0 1-1.5-1.5V6A1.5 1.5 0 0 1 5 4.5z'/%3E%3Cpath d='M8 9h8M8 12h5'/%3E%3C/svg%3E")}
.ic-pin{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3.5h6l-.8 5.5 3.3 3.3v1.2H6.5v-1.2L9.8 9z'/%3E%3Cpath d='M12 13.5V21'/%3E%3C/svg%3E")}
.ic-check{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")}
.ic-cross{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 6.5l11 11M17.5 6.5l-11 11'/%3E%3C/svg%3E")}
.ic-pen{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20l1.2-4.3L15.8 5.1a2 2 0 0 1 2.9 0l.2.2a2 2 0 0 1 0 2.9L8.3 18.8z'/%3E%3Cpath d='M14 7l3 3'/%3E%3C/svg%3E")}
.ic-mic{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M9 21h6'/%3E%3C/svg%3E")}
.ic-mic-off{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 9.5V6a3 3 0 0 0-5.8-1M9 9v2a3 3 0 0 0 4.6 2.5M18.5 11a6.5 6.5 0 0 1-1 3.4M5.5 11a6.5 6.5 0 0 0 10.2 5.3M12 17.5V21M9 21h6M4 4l16 16'/%3E%3C/svg%3E")}
.ic-clip{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.5 7.5l-7 7a2 2 0 0 0 2.8 2.8l7.5-7.5a4 4 0 0 0-5.7-5.7L5.6 11.6a6 6 0 0 0 8.5 8.5l5.4-5.4'/%3E%3C/svg%3E")}
.ic-open{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M9 7h8v8'/%3E%3C/svg%3E")}
.ic-move{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v18M3 12h18M12 3l-2.5 2.5M12 3l2.5 2.5M12 21l-2.5-2.5M12 21l2.5-2.5M3 12l2.5-2.5M3 12l2.5 2.5M21 12l-2.5-2.5M21 12l-2.5 2.5'/%3E%3C/svg%3E")}
.ic-thread{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='7' r='2.2'/%3E%3Ccircle cx='18' cy='16' r='2.2'/%3E%3Cpath d='M7.8 8.4C9 15 12 17.5 15.8 16.3'/%3E%3C/svg%3E")}
.ic-note{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h14v10.5L13.5 20H5z'/%3E%3Cpath d='M13.5 20v-5.5H19M8 8.5h8M8 11.5h5'/%3E%3C/svg%3E")}
.ic-lock{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='10' rx='1.6'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 8 0v3M12 14.5v2.5'/%3E%3C/svg%3E")}
.ic-key{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4.2'/%3E%3Cpath d='M11 12l8.5-8.5M16.5 6.5l2.5 2.5M14 9l2 2'/%3E%3C/svg%3E")}
.ic-hint{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 17.5h6M10 21h4M12 3a6 6 0 0 0-3.6 10.8c.7.6 1.1 1.4 1.1 2.2v1.5h5V16c0-.8.4-1.6 1.1-2.2A6 6 0 0 0 12 3z'/%3E%3C/svg%3E")}
.ic-gavel{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.5 4.5l6 6M11 7l6 6M12.2 5.8l-3.5 3.5 6 6 3.5-3.5M9.5 12.5L3.5 18.5l2 2 6-6M4 21h9'/%3E%3C/svg%3E")}
.ic-link{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E")}
.ic-leave{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h4.5A1.5 1.5 0 0 1 20 5.5v13a1.5 1.5 0 0 1-1.5 1.5H14M10 8l-4 4 4 4M6 12h10'/%3E%3C/svg%3E")}
.ic-eye{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12z'/%3E%3Ccircle cx='12' cy='12' r='2.8'/%3E%3C/svg%3E")}
/* ==== ICONS:END ==== */

/* Ủng hộ tác giả: mã QR chuyển khoản */
.support-link {
  color: var(--brass); border: 1px solid var(--brass); background: rgba(201, 161, 74, .14);
  font-weight: 700; display: inline-flex; align-items: center; gap: 8px;
  animation: support-glow 2.6s ease-in-out infinite;
}
.support-link:hover, .support-link:focus-visible { background: var(--brass); color: var(--desk); }
@keyframes support-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 161, 74, 0); }
  50% { box-shadow: 0 0 14px 2px rgba(201, 161, 74, .45); }
}
@media (prefers-reduced-motion: reduce) { .support-link { animation: none; } }
.ic-coffee{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h12v5.5a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5z'/%3E%3Cpath d='M16 10.5h1.5a2.5 2.5 0 0 1 0 5H16M8 3.5c-.6.8-.6 1.7 0 2.5M12 3.5c-.6.8-.6 1.7 0 2.5'/%3E%3C/svg%3E")}
.support { text-align: center; }
.support p { margin: 0 0 12px; }
.support-qr { display: block; width: min(260px, 80%); height: auto; margin: 4px auto 12px; border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); background: #fff; }
.support.compact { margin: 28px 0 8px; padding: 18px; border: 1px dashed #b9ab8b; background: rgba(255, 250, 240, .6); }
.support.compact .support-qr { width: min(190px, 60%); }

/* Phóng to ảnh tài liệu */
.viewer img.art-photo { cursor: zoom-in; }
.zoom { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(10, 8, 6, .88); cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
/* Ảnh dãy hộp thư: giữ trọn khung, không cắt hai bên vì số ô ở mép là manh mối */
[data-art="hop-thu"] img.photo { aspect-ratio: auto; object-fit: contain; }
