/* asset-version: room.css v9 ee001b6e */
/* THINKER ROOM — Design System v1 (20/09)
 * Theo UX/UI Spec "THINKER — ROOM SYSTEM / Complete UX-UI Specification v1.0":
 * §8 color · §10 type scale · §11 spacing · §12 motion · §46 responsive · §48–56 components
 * Mood: quiet · literary · warm · private · intellectual · restrained · tactile · slow · precise
 * Không: SaaS · gamified · dashboard · glossy · glassmorphism · gradient-heavy
 */
/* ── ROOM TOKENS — KHAI BÁO DUY NHẤT (hợp nhất 27/09/2026) ────────────────────
 * Vì sao gộp: trước đây room.css có HAI khối :root; khối sau âm thầm đè khối trước
 * (paper · ink · line · white và cả --room-brass). Muốn biết màu thật phải đọc tới cuối
 * file — đó là nợ hệ thống, không phải phong cách. Nay chỉ còn MỘT nơi khai báo.
 *
 * NGỮ NGHĨA (đừng suy diễn ngược từ tên biến):
 *   --room-accent*  = accent của Thư phòng = NEUTRAL/INK (#6f685f). Thư phòng KHÔNG lấy
 *                     gold làm accent. Tên cũ `--room-brass` đã bị XOÁ vì nó khiến người
 *                     đọc code sau này tưởng accent của Room là màu đồng.
 *   Gold/brass      = chỉ là dấu thương hiệu Thinker+ ở phạm vi TOÀN CỤC (header/account),
 *                     không khai báo trong room.css — xem ROOM-SSOT §8.7.
 */
:root {
  --room-paper: #f5f3eb;
  --room-paper-deep: #e4dfc9;
  --room-white: #fffdf7;
  --room-ink: #403c37;
  --room-ink-soft: #6f685f;
  --room-ink-muted: #6f685f;
  --room-line: rgba(64, 60, 55, .14);
  --room-line-strong: rgba(64, 60, 55, .26);
  --room-neutral: #6f685f;
  --room-neutral-soft: rgba(111, 104, 95, .18);
  --room-accent: #6f685f;
  --room-accent-soft: rgba(111, 104, 95, .18);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font-ui: "Inter", "Noto Sans", system-ui, sans-serif;
  --font-lit: "Newsreader", "Noto Serif", Georgia, serif;
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--room-paper);
  color: var(--room-ink);
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: var(--room-accent-soft); }

/* ── Shell ── */
/* Vỏ desktop (27/09): shell 1280 tách khỏi số đo đọc 760.
   Mobile KHÔNG đổi: width:100% trên block = đúng hành vi cũ (≤1099/≤767 chỉ đè padding, không đè width). */
.room { width: min(100%, 1280px); margin: 0 auto; padding: 40px 48px 96px; }
.room-main { max-width: 760px; }
.room-main.wide { max-width: 1120px; }

/* ── Header (§5.2) — THINKER …… THƯ PHÒNG + tier (secondary) ── */
.room-hdr {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 20px; border-bottom: 1px solid var(--room-line);
  animation: room-enter .5s var(--ease) both;
}
.room-word {
  font-family: var(--font-ui); font-weight: 500; font-size: 11px;
  letter-spacing: .34em; text-transform: uppercase; color: var(--room-ink);
  text-decoration: none; transition: color .3s var(--ease);
}
.room-word:hover { color: var(--room-accent); }
.room-hdr-right { text-align: right; }
.room-hdr-title {
  font-family: var(--font-lit); font-style: italic; font-weight: 400;
  font-size: 15px; color: var(--room-ink); letter-spacing: .01em;
}
.room-tier {
  margin-top: 3px; font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--room-ink-muted); font-weight: 500;
}
.room-tier.is-plus { color: var(--room-accent); }

/* ── Nav (§6) — underline-only, không khung tab ── */
.room-nav {
  display: flex; align-items: center; gap: 40px;
  padding: 22px 0 0; margin-bottom: 8px;
  animation: room-enter .5s var(--ease) .08s both;
}
.room-nav a {
  position: relative; text-decoration: none;
  font-size: 10px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase;
  color: var(--room-ink-soft); padding: 6px 0 10px;
  transition: color .3s var(--ease);
}
.room-nav a:hover { color: var(--room-ink); }
.room-nav a.on { color: var(--room-ink); }
.room-nav a.on:after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--room-accent);
  animation: room-line .45s var(--ease) both;
}
.room-nav a.nav-gap { margin-left: auto; }
@keyframes room-line { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }
@keyframes room-enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ── Sections ── */
.room-sec { padding: 56px 0; border-bottom: 1px solid var(--room-line); }
.room-sec:last-of-type { border-bottom: none; }
.room-sec-enter { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.room-sec-enter.in { opacity: 1; transform: translateY(0); }
.room-eyebrow {
  font-size: 10px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase;
  color: var(--room-accent);
}
.room-sec-title {
  font-family: var(--font-lit); font-weight: 400; font-size: 25px; line-height: 1.2;
  margin-top: 10px; color: var(--room-ink);
}
.room-sec-sub { font-size: 12px; line-height: 1.7; color: var(--room-ink-soft); margin-top: 8px; max-width: 480px; }
.room-sec-head { margin-bottom: 32px; }

/* ── Hero (§13) ── */
.room-hero { padding: 64px 0 40px; }
.room-hero-title {
  font-family: var(--font-lit); font-style: italic; font-weight: 400;
  font-size: 46px; line-height: 1.05; letter-spacing: -.01em; color: var(--room-ink);
}
.room-hero-lede {
  font-family: var(--font-lit); font-style: italic; font-weight: 400;
  font-size: 15px; line-height: 1.9; color: var(--room-ink-soft);
  margin-top: 18px; max-width: 520px;
}
.room-hero-tier {
  margin-top: 26px; font-size: 10px; font-weight: 500; letter-spacing: .26em;
  text-transform: uppercase; color: var(--room-ink-muted);
}
.room-hero-tier.is-plus { color: var(--room-accent); }

/* ── Buttons (§48) — primary: ink bg cream text; secondary: transparent ink border; tertiary: text link ── */
.r-btn {
  display: inline-block; background: var(--room-ink); color: var(--room-paper);
  border: 1px solid var(--room-ink); border-radius: 0;
  font-family: var(--font-ui); font-size: 10px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  padding: 12px 22px; cursor: pointer; text-decoration: none;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.r-btn:hover { background: var(--room-accent); border-color: var(--room-accent); color: var(--room-white); }
.r-btn:disabled { opacity: .45; cursor: default; }
.r-btn.sec { background: transparent; color: var(--room-ink); }
.r-btn.sec:hover { background: var(--room-ink); color: var(--room-paper); border-color: var(--room-ink); }
.r-link {
  display: inline-block; font-size: 11px; letter-spacing: .14em; text-transform: none;
  color: var(--room-ink); text-decoration: none; border-bottom: 1px solid var(--room-accent-soft);
  padding-bottom: 2px; margin-top: 22px;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.r-link:hover { color: var(--room-accent); border-color: var(--room-accent); }
.r-link.brass { color: var(--room-accent); }

/* ── Cards (§50) — transparent, thin top rule, không shadow ── */
.r-card {
  background: transparent; border: none; border-top: 1px solid var(--room-line);
  padding: 26px 0 22px; transition: border-color .35s var(--ease);
}
.r-card:hover { border-top-color: var(--room-line-strong); }
.r-card + .r-card { }
.r-card-title { font-family: var(--font-lit); font-size: 18px; line-height: 1.45; color: var(--room-ink); }
.r-card-title a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .3s var(--ease), color .3s var(--ease); }
.r-card-title a:hover { color: var(--room-accent); border-bottom-color: var(--room-accent); }
.r-card-kind {
  font-size: 9px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase;
  color: var(--room-ink-muted); margin-bottom: 10px;
}
.r-card-meta { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--room-ink-muted); margin-top: 10px; }

/* ── Desk (§14) ── */
.desk-card {
  border-top: 1px solid var(--room-line-strong);
  background: var(--room-white);
  padding: 30px 32px 28px;
}
.desk-card:hover { background: var(--room-white); }
.desk-title { font-family: var(--font-lit); font-size: 21px; line-height: 1.4; }
.desk-title a { color: var(--room-ink); text-decoration: none; border-bottom: 1px solid var(--room-accent-soft); transition: color .3s var(--ease), border-color .3s var(--ease); }
.desk-title a:hover { color: var(--room-accent); border-bottom-color: var(--room-accent); }
.desk-continue { margin-top: 20px; }
.desk-continue a {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 500;
  color: var(--room-ink); text-decoration: none; transition: color .3s var(--ease);
}
.desk-continue a:hover { color: var(--room-accent); }

/* ── Split (Journey | Library — §68 desktop) ── */
.r-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }

/* ── Timeline (§16/§20) — marker 1px, không card grid ── */
.tl { margin-top: 4px; }
.tl-item { position: relative; padding: 16px 0 16px 26px; border-bottom: 1px solid var(--room-line); }
.tl-item:last-child { border-bottom: none; }
.tl-item:before {
  content: ""; position: absolute; left: 6px; top: 24px;
  width: 1px; height: 1px; /* marker cực nhẹ */
  box-shadow: 0 0 0 2px var(--room-paper), 0 0 0 3px var(--room-accent);
}
.tl-item:first-child:before { box-shadow: 0 0 0 2px var(--room-paper), 0 0 0 3px var(--room-accent); }
.tl-date { font-size: 9px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--room-ink-muted); }
.tl-kind { font-size: 9px; letter-spacing: .26em; text-transform: uppercase; color: var(--room-accent); margin-top: 4px; }
.tl-title { font-family: var(--font-lit); font-size: 18px; line-height: 1.45; margin-top: 8px; }
.tl-title a { color: var(--room-ink); text-decoration: none; transition: color .3s var(--ease); }
.tl-title a:hover { color: var(--room-accent); }
.tl-meta { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--room-ink-muted); margin-top: 6px; }
.tl-returned { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--room-accent); margin-top: 6px; }

/* ── Counts (context, không KPI — §17/§59) ── */
.r-counts { margin-top: 4px; }
.r-counts div { font-size: 13px; color: var(--room-ink-soft); padding: 9px 0; border-bottom: 1px solid var(--room-line); }
.r-counts div:last-child { border-bottom: none; }
.r-counts b { font-weight: 500; color: var(--room-ink); margin-right: 10px; font-variant-numeric: tabular-nums; }

/* ── Empty states (§15/§26) ── */
.r-empty {
  font-family: var(--font-lit); font-style: italic; font-size: 14px; line-height: 1.95;
  color: var(--room-ink-soft); padding: 18px 0 6px; max-width: 440px;
}

/* ── Tabs (underline, không boxed pills — §22) ── */
.r-tabs { display: flex; gap: 36px; border-bottom: 1px solid var(--room-line); margin-bottom: 30px; }
.r-tabs button {
  background: none; border: none; cursor: pointer; position: relative;
  font-family: var(--font-ui); font-size: 10px; font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase; color: var(--room-ink-muted);
  padding: 4px 0 14px; transition: color .3s var(--ease);
}
.r-tabs button:hover { color: var(--room-ink); }
.r-tabs button.on { color: var(--room-ink); }
.r-tabs button.on:after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--room-accent);
}

/* ── Library items (§23–25) ── */
.hl-card {
  border-top: 1px solid var(--room-line); padding: 26px 0 24px;
  background: transparent;
}
.hl-card:hover { border-top-color: var(--room-line-strong); }
.hl-quote { font-family: var(--font-lit); font-style: italic; font-size: 16px; line-height: 1.75; color: var(--room-ink); }
.hl-quote:before { content: "\201C"; color: var(--room-accent); }
.hl-quote:after { content: "\201D"; color: var(--room-accent); }
.hl-src { font-size: 11px; color: var(--room-ink-soft); margin-top: 14px; }
.hl-src a { color: var(--room-ink); text-decoration: none; border-bottom: 1px solid var(--room-accent-soft); transition: color .3s var(--ease), border-color .3s var(--ease); }
.hl-src a:hover { color: var(--room-accent); border-bottom-color: var(--room-accent); }
.hl-meta { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--room-ink-muted); margin-top: 6px; }
.note-card { border-top: 1px solid var(--room-line); padding: 22px 0; }
.note-label { font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--room-ink-muted); }
.note-text { font-size: 13px; line-height: 1.8; color: var(--room-ink-soft); margin-top: 8px; }
.note-from { font-size: 11px; color: var(--room-ink-muted); margin-top: 8px; }
.note-from a { color: var(--room-ink-soft); text-decoration: none; border-bottom: 1px solid var(--room-accent-soft); }
.note-from a:hover { color: var(--room-accent); }
.pinned-label {
  display: inline-block; font-size: 8px; font-weight: 500; letter-spacing: .26em;
  text-transform: uppercase; color: var(--room-accent);
  border: 1px solid var(--room-accent-soft); padding: 3px 8px 2px; margin-bottom: 10px;
}

/* ── Librarian (§27–30) — không bubble chat ── */
.lib-intro { font-family: var(--font-lit); font-style: italic; font-size: 14px; line-height: 1.95; color: var(--room-ink-soft); max-width: 460px; margin-top: 14px; }
.lib-mat { margin: 28px 0 4px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--room-ink-muted); }
.lib-mat select {
  margin-left: 12px; background: transparent; border: 1px solid var(--room-line-strong);
  font-family: var(--font-ui); font-size: 11px; color: var(--room-ink); padding: 6px 10px; cursor: pointer;
}
.lib-mat select:focus { outline: none; border-color: var(--room-accent); }
.lib-box { margin-top: 30px; }
.lib-q { font-size: 13px; line-height: 1.7; color: var(--room-ink-soft); }
.lib-a { font-size: 13.5px; line-height: 1.85; color: var(--room-ink); margin-top: 14px; white-space: pre-line; }
.lib-div { border: none; border-top: 1px solid var(--room-line); margin: 26px 0; }
.lib-src-ctx { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--room-line); }
.lib-src-ctx div:first-child { font-size: 9px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--room-ink-muted); }
.lib-src-ctx a { font-size: 12px; color: var(--room-ink); text-decoration: none; border-bottom: 1px solid var(--room-accent-soft); margin-top: 6px; display: inline-block; }
.lib-src-ctx a:hover { color: var(--room-accent); }
.lib-typing { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--room-ink-muted); margin-top: 16px; }
.lib-inputrow { display: flex; gap: 12px; margin-top: 30px; }
.lib-input {
  flex: 1; background: var(--room-white); border: 1px solid var(--room-line-strong); border-radius: 0;
  font-family: var(--font-ui); font-size: 13px; color: var(--room-ink); padding: 12px 14px; height: 44px;
}
.lib-input::placeholder { color: var(--room-ink-muted); }
.lib-input:focus { outline: 1px solid var(--room-accent); outline-offset: 3px; border-color: var(--room-accent); }
.lib-prompt {
  background: none; border: none; border-top: 1px solid var(--room-line);
  padding: 14px 0; cursor: pointer; text-align: left; width: 100%;
  font-family: var(--font-lit); font-style: italic; font-size: 13px; line-height: 1.7;
  color: var(--room-ink-soft); transition: color .3s var(--ease);
}
.lib-prompt:hover { color: var(--room-accent); }
.lib-quiet { font-size: 11px; letter-spacing: .08em; color: var(--room-ink-muted); margin-top: 18px; }
.lib-quiet.brass { color: var(--room-accent); }

/* ── Membership block (§19) ── */
.member-block { padding: 40px 0 0; }
.member-line { font-family: var(--font-lit); font-style: italic; font-size: 15px; line-height: 1.9; color: var(--room-ink-soft); margin-top: 12px; max-width: 480px; }
/* Value architecture (ROOM-SSOT §4.5): dòng giá trị quan hệ — đứng trên dòng tier-specific,
   không phải dòng quota. Không gold, không đậm hơn tier. */
.member-value { font-size: 15px; line-height: 1.85; color: var(--room-ink); margin-top: 14px; max-width: 520px; }
.member-tier { font-family: var(--font-lit); font-size: 17px; color: var(--room-ink); margin-top: 10px; }

/* ── Settings (§31–36) ── */
.set-sec { padding: 34px 0; border-bottom: 1px solid var(--room-line); }
.set-sec:last-child { border-bottom: none; }
.set-num { font-size: 9px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--room-ink-muted); }
.set-title { font-family: var(--font-lit); font-size: 19px; color: var(--room-ink); margin-top: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--room-line); }
.set-row:last-child { border-bottom: none; }
.set-row-label { font-size: 13px; color: var(--room-ink); }
.set-row-desc { font-size: 11px; line-height: 1.7; color: var(--room-ink-muted); margin-top: 4px; max-width: 420px; }
.r-toggle {
  position: relative; width: 40px; height: 22px; flex: none; cursor: pointer;
  background: var(--room-paper-deep); border: 1px solid var(--room-line-strong); border-radius: 0;
  transition: background .35s var(--ease), border-color .35s var(--ease);
}
.r-toggle:after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  background: var(--room-ink-muted); transition: transform .35s var(--ease), background .35s var(--ease);
}
.r-toggle.on { background: var(--room-accent-soft); border-color: var(--room-accent); }
.r-toggle.on:after { transform: translateX(18px); background: var(--room-accent); }
.r-input {
  background: var(--room-white); border: 1px solid var(--room-line-strong); border-radius: 0;
  font-family: var(--font-ui); font-size: 13px; color: var(--room-ink);
  padding: 11px 14px; width: 240px; max-width: 100%;
}
.r-input:focus { outline: 1px solid var(--room-accent); outline-offset: 3px; border-color: var(--room-accent); }
.r-input::placeholder { color: var(--room-ink-muted); }
.set-btn {
  background: transparent; border: 1px solid var(--room-line-strong); border-radius: 0;
  font-family: var(--font-ui); font-size: 9px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: var(--room-ink-soft); padding: 9px 16px; cursor: pointer;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.set-btn:hover { color: var(--room-ink); border-color: var(--room-ink); }
.set-btn.danger { color: var(--room-accent); border-color: var(--room-accent-soft); }
.set-btn.danger:hover { color: var(--room-accent); border-color: var(--room-accent); }

/* Leaving (§37) — deep, quiet, không theatrical */
.leave-block { margin-top: 10px; padding: 30px 0 0; }
.leave-copy { font-size: 12.5px; line-height: 1.95; color: var(--room-ink-soft); max-width: 440px; }
.leave-copy strong { color: var(--room-ink); font-weight: 500; }
.leave-note { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--room-ink-muted); margin-top: 10px; }
.leave-row { display: flex; gap: 12px; margin-top: 22px; }

/* ── Gate (§44) ── */
.gate {
  position: fixed; inset: 0; z-index: 4000; background: var(--room-paper);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.gate-in { max-width: 460px; text-align: left; animation: room-enter .6s var(--ease) both; }
.gate-title { font-family: var(--font-lit); font-style: italic; font-size: 40px; line-height: 1.1; color: var(--room-ink); }
.gate-lede { font-family: var(--font-lit); font-style: italic; font-size: 14px; line-height: 1.9; color: var(--room-ink-soft); margin: 18px 0 30px; }
.gate-alt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--room-ink-muted); margin-top: 18px; }

/* ── Footer (§45) ── */
.room-foot {
  margin-top: 88px; padding-top: 22px; border-top: 1px solid var(--room-line);
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
}
.room-foot a { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--room-ink-muted); text-decoration: none; transition: color .3s var(--ease); }
.room-foot a:hover { color: var(--room-accent); }
.room-foot .copy { margin-left: auto; font-size: 9px; letter-spacing: .14em; color: var(--room-ink-muted); opacity: .7; }

/* ── Toast (§53) — fade only, không lớn ── */
.r-toast {
  position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%);
  z-index: 5000; background: var(--room-ink); color: var(--room-paper);
  font-size: 11px; letter-spacing: .08em; padding: 11px 22px;
  opacity: 0; pointer-events: none; transition: opacity .45s var(--ease);
}
.r-toast.show { opacity: .92; }

/* ── Offline (§56) ── */
.r-offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 4500;
  background: var(--room-paper-deep); border-bottom: 1px solid var(--room-line);
  font-size: 11px; letter-spacing: .06em; color: var(--room-ink-soft);
  text-align: center; padding: 9px 16px;
}

/* ── Responsive (§46) ── */
@media (max-width: 1099px) {
  .room { padding: 32px 32px 80px; }
  .r-split { grid-template-columns: 1fr; gap: 8px; }
  .room-hero-title { font-size: 38px; }
}
@media (max-width: 767px) {
  .room { padding: 20px 20px 64px; }
  .room-hero { padding: 44px 0 28px; }
  .room-hero-title { font-size: 34px; }
  .room-sec-title { font-size: 21px; }
  .r-card-title, .tl-title { font-size: 16px; }
  .room-nav { gap: 22px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 6px; }
  .room-nav::-webkit-scrollbar { display: none; }
  .room-nav a { white-space: nowrap; }
  .room-nav a.nav-gap { margin-left: 0; }
  .desk-card { padding: 22px 18px; }
  .lib-inputrow { flex-direction: column; }
  .set-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .room-foot .copy { margin-left: 0; }
}

/* ─────────────────────────────────────────────────────────────────────────
 * ROOM CSS v2 (22/09/2026) — directive "Thinker Room + Customer Service + Thinker+"
 * (ChatGPT t_6ab1feff…), §XXXVIII (visual language) + §XXXIX/§XL/§XLI.
 *
 *  — Palette theo directive: cream #f5f3eb · ink #403c37 · secondary text #6f685f ·
 *    secondary bg #dad5c6/#e4dfc9. KHÔNG gold UI accent (brass cũ đổi về secondary neutral).
 *  — Square corners; no frosted glass; no emoji (inline SVG nếu cần).
 *  — Mobile-first behaviour: nav cuộn ngang, service không giấu sau hover.
 *  — CSS-first motion + prefers-reduced-motion đã xử lý ở khối gốc.
 * ───────────────────────────────────────────────────────────────────────── */
body { background: var(--room-paper); }
.room-sec-soft { border-bottom: none; }

/* state blocks — actionable, không đe doạ, không pressure */
.r-state { border: 1px solid var(--room-line-strong); padding: 22px 20px; margin-top: 18px; }
.r-state-t { font-family: var(--font-lit); font-size: 17px; line-height: 1.5; color: var(--room-ink); }
.r-state-b { font-size: 12px; line-height: 1.8; color: var(--room-ink-soft); margin-top: 8px; max-width: 520px; }
.r-state .r-link { display: inline-block; margin-top: 14px; }

/* continue card (Now) */
.r-continue { border-left: 2px solid var(--room-neutral); }
.r-continue .desk-continue a { border-bottom-color: var(--room-neutral-soft); }

/* caps list (entitlement hiển thị, không phải marketing bullets) */
.r-caps { list-style: none; padding: 0; margin: 14px 0 0; }
.r-caps li { font-size: 12px; line-height: 1.9; color: var(--room-ink-soft); padding: 7px 0 7px 18px; position: relative; border-bottom: 1px solid var(--room-line); }
.r-caps li:last-child { border-bottom: none; }
.r-caps li:before { content: ""; position: absolute; left: 0; top: 15px; width: 7px; height: 1px; background: var(--room-neutral); }
.r-caps-inline { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; }
.r-caps-inline span { font-size: 11px; letter-spacing: .04em; color: var(--room-ink-soft); }

/* room services list — luôn hiện, không phụ thuộc hover */
.r-svc { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.r-svc li { border-bottom: 1px solid var(--room-line); }
.r-svc a { display: block; padding: 15px 0; font-size: 12px; letter-spacing: .06em; color: var(--room-ink); text-decoration: none; transition: color .3s var(--ease); }
.r-svc a:hover, .r-svc a:focus-visible { color: var(--room-neutral); }
.r-svc a:focus-visible { outline: 1px solid var(--room-ink); outline-offset: 3px; }

/* data (privacy) box + link rows */
.r-databox { border: 1px solid var(--room-line); padding: 4px 18px 14px; margin-top: 14px; background: var(--room-paper-deep); }
.r-links { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 20px; }

/* screen-reader only */
.r-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* focus visible toàn Room (a11y §XLI) */
.room a:focus-visible, .room button:focus-visible, .room input:focus-visible,
.room select:focus-visible, .room textarea:focus-visible, .room [role="switch"]:focus-visible {
  outline: 1px solid var(--room-ink); outline-offset: 3px;
}
/* ── SWITCH (component dùng chung: #tgl-vault, #tgl-lib) ─────────────────────
   v4 (22/09): khối v3 đã ĐÈ `.r-toggle:after` bằng chữ "OFF/ON" ⇒ PHÁ knob v1
   (tgl-vault thành cái hộp có chữ nhỏ, không còn nút gạt). Thiết kế lại:
    — track 44×24 vuông (DNA góc vuông), knob 16×16 trượt;
    — brand = ink/cream, KHÔNG gold (directive §XXXVIII: no gold UI accent);
    — trạng thái KHÔNG chỉ bằng màu: nhãn chữ Bật/Tắt hiện ngay cạnh (.consent-state);
    — có state chờ đồng bộ (.is-busy) để phản hồi thao tác mạng thật. */
.r-toggle {
  position: relative; flex: none; width: 44px; height: 24px; cursor: pointer;
  background: var(--room-paper-deep); border: 1px solid var(--room-line-strong); border-radius: 0;
  transition: background .35s var(--ease), border-color .35s var(--ease);
}
.r-toggle:after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  background: var(--room-ink-soft); transition: transform .35s var(--ease), background .35s var(--ease);
}
.r-toggle:hover { border-color: var(--room-ink-soft); }
.r-toggle:focus-visible { outline: 1px solid var(--room-ink); outline-offset: 3px; }
.r-toggle.on { background: var(--room-ink); border-color: var(--room-ink); }
.r-toggle.on:after { transform: translateX(20px); background: var(--room-paper); }
.r-toggle.is-busy { opacity: .55; cursor: progress; }
@keyframes room-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.r-toggle.is-busy:after { animation: room-pulse 1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .r-toggle.is-busy:after { animation: none; } }

/* hàng consent: cấu trúc title + desc + (state + switch) */
.consent-row { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--room-line); }
.consent-row:last-of-type { border-bottom: none; }
.consent-main { max-width: 520px; }
.consent-title { font-size: 13px; color: var(--room-ink); }
.consent-desc { font-size: 11.5px; line-height: 1.75; color: var(--room-ink-soft); margin-top: 4px; }
.consent-side { display: flex; align-items: center; gap: 10px; flex: none; }
.consent-state { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--room-ink-soft); min-width: 36px; text-align: right; }
.consent-row.is-on .consent-state { color: var(--room-ink); }
.consent-fact { font-size: 11.5px; line-height: 1.8; color: var(--room-ink-soft); padding: 14px 0 4px; border-top: 1px solid var(--room-line); }
.sync-meta { font-size: 11px; color: var(--room-ink-soft); padding: 10px 0 0; }
.sync-meta.is-err { color: #8B463A; }

/* ── LENIS (smooth scroll) ───────────────────────────────────────────────────
   Rules chuẩn của Lenis chỉ áp khi <html> có class .lenis (do JS thêm).
   Vắng JS / prefers-reduced-motion ⇒ không class ⇒ scroll native, KHÔNG hỏng layout. */
html.lenis, html.lenis body { height: auto; }
html.lenis.lenis-smooth { scroll-behavior: auto !important; }
html.lenis.lenis-stopped { overflow: hidden; }

/* membership state: không chỉ dựa vào màu */
.member-tier { border-bottom: 1px solid var(--room-line-strong); display: inline-block; padding-bottom: 4px; }

textarea.r-input { line-height: 1.7; resize: vertical; }

@media (max-width: 767px) {
  .r-svc { grid-template-columns: 1fr; }
  .r-caps-inline { gap: 4px 16px; }
  input.r-input, select.r-input, textarea.r-input, #leave-email, #set-lang { font-size: 16px; }  /* iOS: cấm auto-zoom */
}

/* FIX 22/09: `hidden` attribute bị .gate{display:flex} đè → gate LUÔN hiện dù đã set hidden.
   Thuộc tính hidden phải thắng (gate chỉ dùng cho guest). */
.gate[hidden], #gate[hidden] { display: none !important; }
.room[hidden], #room[hidden] { display: none !important; }

/* ── MEMORY CONSOLE (MEM-04, 26/09/2026) ─────────────────────────────────────
   Cùng bậc chữ với các khối .set-* — ký ức là chuyện riêng tư, không phải điểm nhấn bán hàng.
   Brass chỉ dùng cho liên kết hành động (xuất dữ liệu), KHÔNG dùng để trang trí. */
.mem-console{margin-top:22px;padding:18px 18px 16px;border:1px solid var(--room-line);background:var(--room-paper)}
.mem-head .set-row-label{font-family:var(--font-ui);font-size:14px;color:var(--room-ink)}
.mem-head .set-row-desc{margin-top:6px;font-family:var(--font-lit);font-size:13px;line-height:1.55;color:var(--room-ink-muted);max-width:62ch}
.mem-status{margin-top:12px;font-family:var(--font-ui);font-size:13px;color:var(--room-ink-soft)}
.mem-list{list-style:none;margin:14px 0 0;padding:0}
.mem-item{display:flex;align-items:flex-start;gap:12px;padding:10px 0;border-top:1px solid var(--room-line)}
.mem-item-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.mem-k{font-family:var(--font-ui);font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--room-neutral)}
.mem-v{font-family:var(--font-lit);font-size:14px;color:var(--room-ink);overflow-wrap:anywhere}
.mem-src{font-family:var(--font-ui);font-size:11px;color:var(--room-ink-soft)}
.mem-del{flex:0 0 auto;background:none;border:1px solid var(--room-line);padding:6px 10px;font-family:var(--font-ui);font-size:12px;color:var(--room-ink-muted);cursor:pointer;transition:border-color .15s var(--ease),color .15s var(--ease)}
.mem-del:hover{border-color:var(--room-line-strong);color:var(--room-ink)}
.mem-del:disabled{opacity:.5;cursor:default}
.mem-actions{display:flex;flex-wrap:wrap;align-items:center;gap:14px;margin-top:14px}
/* `hidden` là thuộc tính HTML nhưng BẤT KỲ rule display nào cũng đè được nó ⇒ link/bút vẫn hiện.
   E2E 26/09: #mem-export bị coi là ẩn (el.hidden=true) nhưng vẫn render chữ "Xuất dữ liệu". */
.mem-console [hidden],.lib-fallback [hidden]{display:none!important}
.mem-console[data-state="reader"] .mem-actions,.mem-console[data-state="dormant"] .mem-actions{display:none}

/* ── 4 TẦNG DỰ PHÒNG (LIB-RESILIENCE-01) ─────────────────────────────────────
   Hai tầng dưới KHÔNG phụ thuộc AI: thư viện vẫn tra cứu được, kho riêng vẫn xuất được.
   Vì vậy khối này LUÔN hiện — không phải thông báo lỗi, mà là lối đi tiếp. */
.lib-fallback{margin-top:30px;padding-top:22px;border-top:1px solid var(--room-line);display:grid;gap:20px}
.fb-row .fb-t{font-family:var(--font-ui);font-size:13px;color:var(--room-ink)}
.fb-row .fb-b{margin:6px 0 8px;font-family:var(--font-lit);font-size:13.5px;line-height:1.6;color:var(--room-ink-muted);max-width:64ch}
@media (min-width:820px){.lib-fallback{grid-template-columns:1fr 1fr;gap:26px}}

/* ── LONG-TITLE GUARD (27/09/2026) — directive §25 ─────────────────────────────
   Tiếng Đức/Phần Lan/Hà Lan có từ rất dài; tiếng Nhật/Trung/Hàn không có khoảng trắng.
   Trước đây cả room.css chỉ có MỘT rule overflow-wrap ⇒ tiêu đề dài đẩy tràn ngang.
   Không sửa bằng cách thu nhỏ chữ (directive §25 cấm) — cho phép ngắt trong từ. */
.r-card-title, .tl-title, .desk-title, .room-hero-title, .room-sec-title,
.lib-q, .lib-a, .lib-cont-list a, .mem-v, .fb-t, .set-title, .gate-title {
  overflow-wrap: anywhere;
  word-break: break-word;   /* dự phòng cho engine cũ */
}
/* Chỉ bật gạch nối cho tiêu đề editorial (html lang do th-boot đặt ⇒ đúng ngôn ngữ). */
.r-card-title, .tl-title, .desk-title { hyphens: auto; -webkit-hyphens: auto; }

/* ── TẦNG CONTINUE của trang Thủ thư (§21/§22, 27/09/2026) ────────────────────
   Khác widget: đây là "điều bạn đang tìm hiểu" — nêu mạch đang đọc để hỏi tiếp.
   Nhịp chữ và đường kẻ giống các khối lib-* khác; không thêm card, không thêm màu. */
.lib-continue { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--room-line); }
.lib-cont-eyebrow { font-size: 9px; letter-spacing: .26em; text-transform: uppercase; color: var(--room-ink-muted); }
.lib-cont-list { list-style: none; margin: 12px 0 0; padding: 0; }
.lib-cont-list li { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--room-line); }
.lib-cont-list li:last-child { border-bottom: none; }
.lib-cont-list a { font-family: var(--font-lit); font-size: 15px; line-height: 1.45; color: var(--room-ink); text-decoration: none; transition: color .3s var(--ease); }
.lib-cont-list a:hover { color: var(--room-accent); }
.lib-cont-meta { flex: 0 0 auto; font-family: var(--font-ui); font-size: 11px; color: var(--room-ink-soft); }
.lib-cont-empty { margin: 10px 0 0; font-family: var(--font-lit); font-size: 13.5px; line-height: 1.6; color: var(--room-ink-muted); max-width: 64ch; }
@media (max-width: 430px) {
  /* Máy nhỏ (§24: 320/360/390/430): tiến độ xuống dòng dưới tiêu đề thay vì bóp tiêu đề. */
  .lib-cont-list li { flex-wrap: wrap; gap: 2px 10px; }
}
