/* books.phucnt.org — tủ sách: trang chính, trang sách, cổng tủ riêng.
   Màu chỉ khai báo ở đây; trình đọc (reader.css) dùng lại các biến này. */

:root {
  --paper: #f4eee1;
  --paper-2: #ebe3d1;
  --paper-3: #dfd5bf;
  --ink: #231e17;
  --ink-2: #5a5145;
  --ink-3: #877c6b;
  --rule: #d6cab2;
  --accent: #1f4a3d;
  --on-accent: #f6f1e4;
  --seal: #c0392b;
  --gold: #e3c47c;
  --shadow: 28 20 8;

  --serif: 'Literata', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --display: 'Fraunces', 'Literata', Georgia, serif;
  --ui: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --size: 19px;
  --lh: 1.7;
  color-scheme: light;
}

:root[data-theme='sepia'] {
  --paper: #efe0c2; --paper-2: #e6d4b1; --paper-3: #d9c59d;
  --ink: #3a2c1b; --ink-2: #67553c; --ink-3: #8d7a5c; --rule: #cdb98f;
  --accent: #2c4a36; --on-accent: #f3e7cd; --seal: #b23a26;
}
:root[data-theme='gray'] {
  --paper: #e9e9e6; --paper-2: #dddcd8; --paper-3: #cecdc8;
  --ink: #202020; --ink-2: #505050; --ink-3: #777774; --rule: #c4c3be;
  --accent: #1f4a3d; --on-accent: #f1f1ee; --seal: #b5382b;
}
:root[data-theme='night'] {
  --paper: #15130f; --paper-2: #1d1a15; --paper-3: #2a261e;
  --ink: #e2d9c7; --ink-2: #b1a794; --ink-3: #7f7767; --rule: #353026;
  --accent: #93cbb3; --on-accent: #10201a; --seal: #d9573f; --gold: #d8bb78;
  --shadow: 0 0 0;
  color-scheme: dark;
}
:root[data-theme='eink'] {
  --paper: #fff; --paper-2: #fff; --paper-3: #e9e9e9;
  --ink: #000; --ink-2: #111; --ink-3: #333; --rule: #000;
  --accent: #000; --on-accent: #fff; --seal: #000; --gold: #fff;
  --shadow: 0 0 0;
}
/* không có JS: theo hệ thống */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #15130f; --paper-2: #1d1a15; --paper-3: #2a261e;
    --ink: #e2d9c7; --ink-2: #b1a794; --ink-3: #7f7767; --rule: #353026;
    --accent: #93cbb3; --on-accent: #10201a; --seal: #d9573f; --gold: #d8bb78;
    --shadow: 0 0 0;
    color-scheme: dark;
  }
}
:root[data-theme='eink'] *, :root[data-theme='eink'] *::before, :root[data-theme='eink'] *::after {
  transition: none !important; animation: none !important; box-shadow: none !important;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: clamp(18px, 4.4vw, 44px); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; font: 500 14px/1 var(--ui); text-decoration: none; }
.skip:focus { top: 12px; }

/* ───────── đầu trang ───────── */

.top { border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; }
.brand-name { font: 600 20px/1 var(--display); font-variation-settings: 'opsz' 40; letter-spacing: -.01em; white-space: nowrap; }
.brand-host { font: 400 12px/1 var(--ui); color: var(--ink-3); letter-spacing: .02em; padding-left: 11px; border-left: 1px solid var(--rule); white-space: nowrap; }
.topnav { display: flex; align-items: center; gap: clamp(8px, 1.8vw, 20px); font: 500 13.5px/1 var(--ui); }
.topnav a { text-decoration: none; color: var(--ink-2); padding: 8px 2px; white-space: nowrap; }
.topnav .nav-btn { white-space: nowrap; }
.topnav a:hover { color: var(--ink); }
.lock-form { margin: 0; display: inline-flex; }
.nav-btn { background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 7px 12px; font: 500 12.5px/1 var(--ui); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.nav-btn:hover { color: var(--ink); border-color: var(--ink-3); }

/* con dấu */
.seal {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 5px;
  background: var(--seal); color: #fff7ea;
  font: italic 600 12.5px/1 var(--display); letter-spacing: -.01em;
  transform: rotate(-5deg);
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .28), 0 1px 2px rgb(var(--shadow) / .25);
}
.seal--big { width: 76px; height: 76px; font-size: 22px; border-radius: 9px; box-shadow: inset 0 0 0 2.5px rgb(255 255 255 / .28), 0 6px 18px rgb(var(--shadow) / .18); }
:root[data-theme='eink'] .seal { color: #fff; }

/* ───────── nút ───────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font: 500 14.5px/1.2 var(--ui); text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--ghost { background: transparent; border-color: var(--rule); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-3); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.btn[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); }

.kicker { font: 600 12px/1.3 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.kicker::before { content: ''; display: inline-block; width: 22px; height: 2px; background: var(--seal); vertical-align: middle; margin-right: 10px; transform: translateY(-1px); }

/* ───────── bìa sách ───────── */

.cover {
  position: relative; display: block; width: 100%; aspect-ratio: 2 / 3;
  border-radius: 3px 6px 6px 3px; overflow: hidden;
  background: var(--paper-3);
  box-shadow: 0 1px 1px rgb(var(--shadow) / .18), 0 10px 22px -8px rgb(var(--shadow) / .38), 0 22px 36px -22px rgb(var(--shadow) / .32);
  container-type: inline-size;
}
.cover--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover::after { /* gáy sách */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgb(0 0 0 / .30) 0, rgb(0 0 0 / .05) 2.2%, rgb(255 255 255 / .16) 4%, rgb(255 255 255 / 0) 7%, rgb(0 0 0 / 0) 92%, rgb(0 0 0 / .10) 100%);
}
.cover--cloth {
  color: var(--gold);
  background:
    repeating-linear-gradient(0deg, rgb(255 255 255 / .035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgb(0 0 0 / .05) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 30% 10%, rgb(255 255 255 / .16), transparent 60%),
    var(--cloth, #3b3330);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 13% 11% 10% 13%;
  font-size: 12px;
}
.cover--cloth::before { /* khung nhũ vàng */
  content: ''; position: absolute; inset: 5.5% 5.5% 5.5% 8%;
  border: 1px solid color-mix(in srgb, var(--gold) 70%, transparent);
  border-radius: 2px; pointer-events: none;
  box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px color-mix(in srgb, var(--gold) 28%, transparent);
}
.cover-initial {
  position: absolute; right: -4%; bottom: -13%;
  font: italic 500 100px/1 var(--display); font-size: 92cqw; font-variation-settings: 'opsz' 144;
  color: #fff; opacity: .075; pointer-events: none; user-select: none;
}
.cover-author { position: relative; font: 600 7px/1.3 var(--ui); font-size: 4.6cqw; letter-spacing: .16em; text-transform: uppercase; opacity: .86; }
.cover-title {
  position: relative; margin-top: auto; margin-bottom: auto;
  font: 500 18px/1.08 var(--display); font-size: 12.5cqw; font-variation-settings: 'opsz' 144; letter-spacing: -.012em;
  text-wrap: balance; overflow-wrap: anywhere;
}
.cover--cloth.t-l .cover-title { font-size: 17.5cqw; }
.cover--cloth.t-s .cover-title { font-size: 10.4cqw; line-height: 1.12; }
.cover-orn { position: relative; width: 26%; height: 9px; margin-bottom: 7%; opacity: .8;
  background: linear-gradient(currentColor, currentColor) left center / 38% 1px no-repeat, linear-gradient(currentColor, currentColor) right center / 38% 1px no-repeat; }
.cover-orn::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.cover-foot { position: relative; font: 500 7px/1 var(--ui); font-size: 4.4cqw; letter-spacing: .2em; opacity: .7; }
:root[data-theme='eink'] .cover--cloth { background: #fff; color: #000; box-shadow: none; outline: 1.5px solid #000; outline-offset: -1.5px; }
:root[data-theme='eink'] .cover--cloth::before { border-color: #000; }
:root[data-theme='eink'] .cover-initial { display: none; }
:root[data-theme='eink'] .cover::after { display: none; }

/* ───────── trang chính ───────── */

.hero { padding-top: clamp(40px, 8vw, 96px); padding-bottom: clamp(30px, 5vw, 56px); }
.hero-title {
  margin-top: 20px;
  font: 400 clamp(44px, 9.2vw, 108px)/.98 var(--display); font-variation-settings: 'opsz' 144; letter-spacing: -.035em;
}
.hero-title em { font-style: italic; font-weight: 300; color: var(--accent); }
.hero-lede { margin-top: clamp(20px, 3vw, 30px); max-width: 37em; font-size: clamp(17px, 1.9vw, 20px); line-height: 1.62; color: var(--ink-2); text-wrap: pretty; }
.hero--small { padding-top: clamp(30px, 5vw, 60px); padding-bottom: 10px; }
.hero--small .hero-title { font-size: clamp(36px, 6vw, 64px); }

.resume { padding-bottom: clamp(26px, 4vw, 44px); }
.resume-title { font: 600 12px/1.3 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.resume-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 12px; }
.resume-card {
  display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 16px;
  padding: 14px 18px 14px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper-2);
  text-decoration: none; transition: border-color .15s ease, transform .15s ease;
}
.resume-card:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.resume-info { display: grid; gap: 3px; min-width: 0; }
.resume-kicker { font: 600 10.5px/1.2 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--seal); }
.resume-name { font: 500 19px/1.2 var(--display); font-variation-settings: 'opsz' 40; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-part { font: 400 12.5px/1.35 var(--ui); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-bar, .card-progress, .book-progress .bar { display: block; height: 3px; border-radius: 3px; background: var(--paper-3); overflow: hidden; }
.resume-bar { margin-top: 6px; }
.resume-bar i, .card-progress i, .book-progress .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.resume-pct { font: 500 22px/1 var(--display); font-variation-settings: 'opsz' 40; color: var(--accent); font-feature-settings: 'tnum'; }

.shelf { padding-top: clamp(28px, 4vw, 44px); padding-bottom: clamp(30px, 5vw, 60px); border-top: 1px solid var(--rule); }
.page-private .shelf { border-top: 0; }
.shelf-head { display: grid; gap: 10px; margin-bottom: clamp(24px, 3.4vw, 40px); max-width: 44em; }
.shelf-head h2 { font: 400 clamp(28px, 4.2vw, 44px)/1.08 var(--display); font-variation-settings: 'opsz' 100; letter-spacing: -.02em; }
.shelf-head h2 em { font-weight: 300; color: var(--accent); }
.shelf-head p { color: var(--ink-2); font-size: 16px; text-wrap: pretty; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: clamp(26px, 3.6vw, 44px) clamp(18px, 2.8vw, 34px); }
.cards--large { grid-template-columns: repeat(auto-fill, minmax(200px, 250px)); }
.card-link { display: grid; gap: 3px; text-decoration: none; }
.card-link .cover { margin-bottom: 13px; transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s ease; transform-origin: 50% 100%; }
.card-link:hover .cover, .card-link:focus-visible .cover { transform: translateY(-6px) rotate(-.6deg); }
.card-title { font: 500 18px/1.2 var(--display); font-variation-settings: 'opsz' 30; letter-spacing: -.008em; text-wrap: balance; }
.card-author { font-size: 14px; font-style: italic; color: var(--ink-2); }
.card-meta { margin-top: 2px; font: 400 12px/1.35 var(--ui); color: var(--ink-3); }
.card-progress { margin-top: 8px; }
@media (max-width: 400px) { .cards { grid-template-columns: 1fr 1fr; } }

.shelf--private { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 24px; }
.shelf--private .shelf-head { margin-bottom: 0; }
.shelf--private.is-open { display: block; }
.shelf--private.is-open .shelf-head { margin-bottom: clamp(24px, 3.4vw, 40px); }
.shelf--private .cards { grid-template-columns: repeat(auto-fill, minmax(158px, 190px)); }
@media (max-width: 620px) { .shelf--private { grid-template-columns: 1fr; row-gap: 18px; } }

.features { padding-top: clamp(30px, 5vw, 56px); padding-bottom: clamp(44px, 7vw, 88px); border-top: 1px solid var(--rule); }
.features h2 { font: italic 300 clamp(26px, 3.8vw, 40px)/1.1 var(--display); font-variation-settings: 'opsz' 100; letter-spacing: -.02em; margin-bottom: clamp(20px, 3vw, 34px); }
.feature-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 26px clamp(24px, 4vw, 48px); counter-reset: f; }
.feature-list li { display: grid; gap: 6px; align-content: start; padding-top: 14px; border-top: 2px solid var(--ink); counter-increment: f; }
.feature-list li::before { content: counter(f, upper-roman); font: italic 400 14px/1 var(--display); color: var(--seal); }
.feature-list b { font: 500 19px/1.25 var(--display); font-variation-settings: 'opsz' 30; }
.feature-list span { font-size: 15px; line-height: 1.55; color: var(--ink-2); }

/* ───────── chân trang ───────── */

.foot { border-top: 1px solid var(--rule); padding: 30px 0 calc(34px + env(safe-area-inset-bottom)); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; }
.colophon { max-width: 46em; font-size: 13.5px; font-style: italic; color: var(--ink-3); line-height: 1.55; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; font: 500 13px/1.4 var(--ui); }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }

/* ───────── trang sách ───────── */

.book { padding-top: 22px; padding-bottom: clamp(44px, 7vw, 88px); max-width: 980px; }
.crumb { font: 500 13.5px/1.4 var(--ui); color: var(--ink-3); }
.shelf > .crumb { margin-top: 34px; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.book-head { display: grid; grid-template-columns: minmax(170px, 250px) 1fr; gap: clamp(28px, 5vw, 60px); align-items: start; margin-top: clamp(22px, 4vw, 44px); }
.book-info { display: grid; gap: 0; min-width: 0; }
.book-title { margin-top: 16px; font: 400 clamp(38px, 6.4vw, 70px)/1 var(--display); font-variation-settings: 'opsz' 144; letter-spacing: -.03em; text-wrap: balance; }
.book-original { margin-top: 10px; font: italic 300 clamp(18px, 2.4vw, 23px)/1.25 var(--display); color: var(--ink-3); }
.book-original[lang='ja'] { font: 400 17px/1.4 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif; letter-spacing: .06em; }
.book-author { margin-top: 12px; font: 500 14px/1.4 var(--ui); color: var(--ink-2); }
.book-blurb { margin-top: 20px; max-width: 34em; font-size: 18px; line-height: 1.62; text-wrap: pretty; }
.book-facts { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 4px 0; font: 400 13px/1.4 var(--ui); color: var(--ink-3); }
.book-facts span + span::before { content: '·'; margin: 0 9px; }
.book-progress { margin-top: 18px; display: grid; gap: 7px; max-width: 26em; }
.book-progress .pct { font: 400 12.5px/1.3 var(--ui); color: var(--ink-2); }
.book-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.offline-note { margin-top: 12px; font: 400 13px/1.4 var(--ui); color: var(--ink-2); }
@media (max-width: 640px) {
  .book-head { grid-template-columns: 1fr; }
  .book-cover { width: min(52vw, 200px); }
  .book-actions .btn { flex: 1 1 auto; }
}

.book-meta, .accolades, .book-toc, .app-card { margin-top: clamp(36px, 6vw, 64px); }
.book-meta dl { display: grid; grid-template-columns: max-content 1fr; gap: 9px 22px; padding: 22px 0; border-block: 1px solid var(--rule); font-size: 15.5px; }
.book-meta dt { font: 600 11.5px/1.9 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.book-meta dd { color: var(--ink); }
@media (max-width: 520px) { .book-meta dl { grid-template-columns: 1fr; gap: 0; } .book-meta dd { margin-bottom: 12px; } }

.accolades .awards { display: grid; gap: 10px; font-size: 16px; }
.accolades .awards li { position: relative; padding-left: 1.4em; }
.accolades .mark { position: absolute; left: 0; top: .32em; color: var(--seal); font-size: .8em; line-height: 1.4; }
.accolades .quote { margin-top: 26px; padding-left: 22px; border-left: 2px solid var(--seal); font: italic 300 clamp(19px, 2.6vw, 24px)/1.45 var(--display); font-variation-settings: 'opsz' 40; text-wrap: pretty; }
.accolades .quote p + p { margin-top: .6em; }
.accolades cite { display: block; margin-top: 12px; font: 500 13px/1.4 var(--ui); font-style: normal; color: var(--ink-3); }

.book-toc h2 { font: 600 12px/1.3 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.toc-row { display: grid; grid-template-columns: 7.2em 1fr auto; align-items: baseline; gap: 4px 18px; padding: 17px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; transition: background-color .15s ease, padding .15s ease; }
.toc-row:hover { background: var(--paper-2); padding-inline: 12px; }
.toc-kicker { font: 500 12px/1.4 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.toc-title { font: 400 clamp(19px, 2.4vw, 23px)/1.25 var(--display); font-variation-settings: 'opsz' 40; letter-spacing: -.01em; }
.toc-meta { display: flex; gap: 12px; font: 400 12.5px/1.4 var(--ui); color: var(--ink-3); white-space: nowrap; }
.toc-state { color: var(--accent); font-weight: 500; }
.toc-row.is-done .toc-title { color: var(--ink-2); }
@media (max-width: 560px) {
  .toc-row { grid-template-columns: 1fr auto; }
  .toc-kicker { grid-column: 1 / -1; }
  .toc-meta { flex-direction: column; gap: 0; text-align: right; }
}

.app-card { padding: clamp(22px, 4vw, 34px); border-radius: 14px; background: var(--paper-2); border: 1px solid var(--rule); display: grid; gap: 12px; }
.app-card-kicker { font: 600 12px/1.3 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--seal); }
.app-card-text { max-width: 40em; font-size: 17px; text-wrap: pretty; }
.app-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.rights { margin-top: 30px; max-width: 46em; font-size: 13.5px; font-style: italic; color: var(--ink-3); line-height: 1.55; }

/* ───────── cổng tủ riêng, 404, offline ───────── */

.gate { max-width: 560px; padding-top: clamp(48px, 10vw, 110px); padding-bottom: clamp(60px, 10vw, 120px); display: grid; gap: 18px; justify-items: start; }
.gate h1 { margin-top: 10px; font: 400 clamp(40px, 7vw, 62px)/1 var(--display); font-variation-settings: 'opsz' 144; letter-spacing: -.03em; }
.gate-lede { font-size: 18px; color: var(--ink-2); text-wrap: pretty; }
.gate-form { width: 100%; display: grid; gap: 8px; margin-top: 10px; }
.gate-form label { font: 600 12px/1.3 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.gate-row { display: flex; gap: 10px; }
.gate-row input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 16px; border: 1px solid var(--ink-3); border-radius: 999px; background: var(--paper); font: 500 17px/1.2 var(--ui); letter-spacing: .06em; }
.gate-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.gate-error { font: 500 14px/1.4 var(--ui); color: var(--seal); }
.gate-hint { font-size: 14.5px; font-style: italic; color: var(--ink-3); line-height: 1.55; }
.gate .crumb { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 560px) {
  .brand-host { display: none; }
  .topnav { gap: 8px; }
  .topnav a { display: none; }   /* Ứng dụng / Tài liệu vẫn có ở chân trang */
}
@media print {
  .top, .foot, .book-actions, .app-card { display: none; }
}
