/* Đế Chế Tự Do — trang chủ v1 + /tuyen-ngon/ (06/10/2026)
   Nguồn: design/mockup-dechetudo.html. Dark only, không accent.
   Mọi class prefix dct- để không đụng CSS theme tanaflows. Chỉ nạp ở index.hbs và page-tuyen-ngon.hbs. */

body.dct-bare {
  background: #000 !important;
  padding-bottom: 0;
}
body.dct-bare.gp-active { padding-bottom: 96px; }

.dct {
  --dct-bg: #000;
  --dct-fg: #fff;
  --dct-muted: #9a9a9a;
  --dct-dim: #666;
  --dct-line: #2a2a2a;
  --dct-frame: #333;
  --dct-cover: #1a1a1a;
  --dct-card: #111;
  --dct-font: "Be Vietnam Pro", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
  background: var(--dct-bg);
  color: var(--dct-fg);
  font-family: var(--dct-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
.dct *, .dct *::before, .dct *::after { box-sizing: border-box; }
.dct-screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
}
.dct-screen.dct-tight { gap: 32px; }
.dct [hidden] { display: none !important; }

/* header */
.dct-hdr { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.dct-logo {
  font-weight: 600; font-size: 13px; letter-spacing: 0.22em;
  color: var(--dct-fg); text-transform: uppercase; white-space: nowrap; text-decoration: none;
}
/* header khách lạ: chỉ logo, căn giữa, to hơn chút (v3 07/10/2026). Member/tuyên ngôn không đổi. */
.dct-hdr.dct-hdr-center { justify-content: center; }
.dct-hdr.dct-hdr-center .dct-logo { font-size: 15px; }
.dct-hdr .dct-link { color: var(--dct-muted); font-size: 13px; text-decoration: none; background: none; border: 0; cursor: pointer; font-family: inherit; padding: 6px 0; }
.dct-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--dct-fg); color: var(--dct-bg);
  font-weight: 600; font-size: 13px; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer; font-family: inherit;
}

/* type */
.dct h1, .dct .dct-h1 { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; margin: 0; text-wrap: balance; color: var(--dct-fg); }
.dct h2, .dct .dct-h2 { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; margin: 0; text-wrap: balance; color: var(--dct-fg); }
.dct h3, .dct .dct-h3 { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dct-muted); margin: 0; }
.dct p { margin: 0; }
.dct-sub { color: var(--dct-muted); font-size: 16px; line-height: 1.5; }
.dct-fine { color: var(--dct-dim); font-size: 12px; line-height: 1.45; }

/* form */
.dct-form { display: flex; flex-direction: column; gap: 10px; }
.dct-input {
  width: 100%; height: 52px;
  background: var(--dct-bg); color: var(--dct-fg);
  border: 1px solid var(--dct-frame); border-radius: 6px;
  padding: 0 16px; font: inherit; font-size: 16px; /* 16px: chặn iOS zoom */
  -webkit-appearance: none; appearance: none;
}
.dct-input::placeholder { color: var(--dct-dim); }
.dct-input:focus { outline: 1px solid var(--dct-fg); outline-offset: 0; border-color: var(--dct-fg); }
.dct-btn {
  width: 100%; height: 52px;
  background: var(--dct-fg); color: var(--dct-bg);
  border: 0; border-radius: 6px;
  font: inherit; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-decoration: none;
}
.dct-btn:focus-visible, .dct-btn-sm:focus-visible { outline: 2px solid var(--dct-fg); outline-offset: 2px; }
.dct-btn[disabled] { opacity: .6; cursor: default; }
.dct-btn-sm {
  height: 36px; padding: 0 14px;
  background: var(--dct-fg); color: var(--dct-bg);
  border: 0; border-radius: 6px;
  font: inherit; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; cursor: pointer; text-decoration: none; flex: none;
}
.dct-btn-ghost { background: transparent; color: var(--dct-fg); border: 1px solid var(--dct-frame); }
.dct-error { color: #ff8a8a; font-size: 13px; min-height: 0; }
.dct-error:empty { display: none; }

/* loading state do Ghost gắn class lên form */
.dct-form .dct-spin { display: none; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: dct-spin .7s linear infinite; }
.dct-form.loading .dct-spin { display: inline-block; }
.dct-form.loading .dct-btn-label { opacity: .7; }
.dct-form.loading .dct-btn { pointer-events: none; }
@keyframes dct-spin { to { transform: rotate(360deg); } }

/* sections */
.dct-fold { min-height: calc(100svh - 92px); display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.dct-sec { display: flex; flex-direction: column; gap: 16px; }

.dct-shelf { display: flex; gap: 10px; overflow-x: auto; margin-inline: -20px; padding-inline: 20px; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.dct-shelf::-webkit-scrollbar { display: none; }
.dct-cover {
  flex: none; width: 90px; height: 130px;
  background: var(--dct-cover); border-radius: 3px;
  padding: 10px 8px; display: flex; align-items: flex-end;
  font-size: 11px; line-height: 1.3; font-weight: 600; color: var(--dct-muted);
  position: relative; overflow: hidden;
}
.dct-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
a.dct-cover, .dct-card a.dct-t { text-decoration: none; color: inherit; }
a.dct-cover { color: var(--dct-muted); }
/* Stranger shelf covers are display-only (not links) */
.dct-shelf > div.dct-cover { cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.dct-shelf > div.dct-cover img { pointer-events: none; -webkit-user-drag: none; }
#dct-tuan { margin-top: 8px; }
#dct-tuan[hidden] { display: none; }
.dct-cover.dct-sm { width: 56px; height: 80px; padding: 6px; font-size: 9px; }
/* Bìa trong thẻ "Nghe ngay" = đúng cỡ bìa trên kệ (90x130, như .dct-cover gốc); .dct-sm giữ nguyên cho chỗ khác */
#dct-tuan .dct-cover { width: 90px; height: 130px; padding: 10px 8px; font-size: 11px; border-radius: 3px; }
#dct-tuan .dct-card { align-items: center; }
@media (max-width: 480px) {
  #dct-tuan .dct-card { flex-wrap: wrap; }
  #dct-tuan .dct-card .dct-body { flex: 1 1 0; min-width: 0; }
  #dct-tuan .dct-card .dct-btn-sm { flex: 1 1 100%; }
}
.dct-cover .dct-lock {
  position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; padding: 4px;
  background: rgba(0,0,0,.65); border-radius: 50%; z-index: 1;
}

/* "Đế Chế Tự Do là gì?" — 3 thẻ bấm mới hiện, <details> native (khách lạ, v3 07/10/2026).
   Brand: không viền thẻ, chỉ kẻ mảnh trên/dưới; nhấn bằng độ đậm; mũi tên xoay khi mở. */
.dct h4 { font-size: 17px; line-height: 1.3; font-weight: 600; margin: 0; color: var(--dct-fg); }
.dct-acc { border-bottom: 1px solid var(--dct-line); }
.dct-qa { border-top: 1px solid var(--dct-line); }
.dct-qa summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0; min-height: 44px;
  font-size: 17px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; color: var(--dct-fg);
  -webkit-tap-highlight-color: transparent;
}
.dct-qa summary::-webkit-details-marker { display: none; }
.dct-qa summary::marker { content: ""; }
.dct-qa summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px;
  border-right: 1.5px solid var(--dct-muted); border-bottom: 1.5px solid var(--dct-muted);
  transform: translateY(-3px) rotate(45deg); transition: transform .2s ease, border-color .2s ease;
}
.dct-qa[open] summary::after { transform: translateY(2px) rotate(-135deg); border-color: var(--dct-fg); }
.dct-qa summary:focus-visible { outline: 2px solid var(--dct-fg); outline-offset: 2px; }
.dct-qa p { color: var(--dct-muted); font-size: 15px; line-height: 1.6; padding: 0 28px 20px 0; }
@media (prefers-reduced-motion: reduce) { .dct-qa summary::after { transition: none; } }

.dct-about p { color: var(--dct-muted); font-size: 15px; }
.dct-about .dct-name { color: var(--dct-fg); font-weight: 600; font-size: 17px; margin-bottom: 6px; }

.dct-footer { color: var(--dct-dim); font-size: 12px; text-align: center; border-top: 1px solid var(--dct-line); padding-top: 20px; }
.dct-footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.dcs-none [data-dcs-open-wrap] { display: none; }

/* ② kiểm tra hộp thư */
.dct-center { min-height: calc(100svh - 160px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 18px; }
.dct-center .dct-form { width: 100%; }
.dct-center .dct-textlink, .dct-textlink {
  color: var(--dct-fg); font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
  background: none; border: 0; cursor: pointer; font-family: inherit; padding: 4px;
}
.dct-center strong { color: var(--dct-fg); word-break: break-all; }

/* ③ member */
.dct-gift { display: flex; flex-direction: column; gap: 10px; }
.dct-card {
  background: var(--dct-card); border: 1px solid var(--dct-line); border-radius: 10px;
  padding: 14px; display: flex; align-items: center; gap: 12px;
  color: var(--dct-fg); text-decoration: none;
}
.dct-card .dct-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dct-card .dct-t { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dct-card .dct-d { color: var(--dct-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dct-badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  border: 1px solid var(--dct-frame); color: var(--dct-muted);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.dct-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dct-upsell {
  border: 1px solid var(--dct-fg); border-radius: 10px;
  padding: 22px 18px; display: flex; flex-direction: column; gap: 10px;
}
.dct-upsell h2 { font-size: 22px; }
.dct-price { font-size: 20px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
/* Kệ = dòng sách dùng chung (partials/dct-book-row.hbs + dct-list.css, 12/10/2026 — bỏ lưới bìa vì bản quyền).
   Chỉ còn: pool xáo theo ngày hiện 9 dòng đầu (fallback không JS) + nhãn "Sách Tuần Này" ở Miễn Phí. */
.dct-lib-grid .dct-row:nth-child(n+10) { display: none; }
.dct-lib-grid.is-shuffled .dct-row:nth-child(n+10) { display: grid; }
.dct-row .dct-tag { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-55); }
.dct-more { color: var(--dct-muted); font-size: 14px; text-align: center; text-decoration: underline; text-underline-offset: 3px; }

/* /tuyen-ngon/ */
.dct-q { display: flex; flex-direction: column; gap: 10px; border: 0; padding: 0; margin: 0; }
.dct-q legend { font-weight: 600; font-size: 15px; margin-bottom: 4px; padding: 0; }
.dct-q .dct-hint { color: var(--dct-dim); font-size: 12px; font-weight: 400; }
.dct-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dct-chip {
  border: 1px solid var(--dct-frame); background: transparent; color: var(--dct-fg);
  border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 14px; cursor: pointer; line-height: 1.2;
}
.dct-chip[aria-pressed="true"] { background: var(--dct-fg); color: var(--dct-bg); border-color: var(--dct-fg); }
.dct-doc {
  border: 1px solid var(--dct-fg); border-radius: 10px; padding: 24px 20px;
  display: flex; flex-direction: column; gap: 14px; font-size: 16px; line-height: 1.6;
}
.dct-doc .dct-doc-title { font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; text-align: center; }
.dct-doc b { font-weight: 700; }
.dct-doc .dct-sign { text-align: right; margin-top: 6px; }

@media (max-width: 500px) {
  .dct h1, .dct .dct-h1 { font-size: 30px; }
}

/* /tuyen-ngon/ v2 kiểu Typeform (07/10/2026): 1 câu / 1 màn. Chỉ bật khi script chạy (#dct-tn.js);
   không JS → .dct-tn:not(.js) hiện cả form như v1. */
.dct-tn:not(.js) fieldset, .dct-tn:not(.js) .dct-tn-step { display: flex; }
.dct-tn:not(.js) .dct-tn-intro, .dct-tn:not(.js) .dct-tn-nav, .dct-tn:not(.js) .dct-tn-next { display: none; }
.dct-tn.js .dct-tn-nojs { display: none; }
.dct-tn.js .dct-tn-step { display: none; }
.dct-tn.js .dct-tn-step.is-active { display: flex; animation: dct-tn-in .28s ease-out both; }
.dct-tn.is-wait .dct-tn-step, .dct-tn.is-wait .dct-tn-nav { visibility: hidden; }
@keyframes dct-tn-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.dct-tn.js #dct-tn-form-wrap { min-height: calc(100svh - 170px); }
.dct-tn.js .dct-tn-intro { flex-direction: column; gap: 20px; justify-content: center; min-height: calc(100svh - 200px); }
.dct-tn-intro h1 { font-size: 34px; outline: none; }
.dct-tn-intro .dct-sub { font-size: 17px; }
.dct-tn-start { height: 60px; font-size: 18px; margin-top: 8px; }

.dct-tn-nav { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 12px; }
.dct-tn-nav[hidden] { display: none; }
.dct-tn-back {
  background: none; border: 0; color: var(--dct-muted); font: inherit; font-size: 14px;
  padding: 8px 0; cursor: pointer; justify-self: start; min-height: 40px;
}
.dct-tn-back:hover, .dct-tn-back:focus-visible { color: var(--dct-fg); }
.dct-tn-count { justify-self: end; color: var(--dct-muted); font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.dct-tn-bar { grid-column: 1 / -1; height: 3px; background: var(--dct-line); border-radius: 3px; overflow: hidden; }
.dct-tn-bar span { display: block; height: 100%; width: 0; background: var(--dct-fg); transition: width .3s ease; }

.dct-tn.js .dct-q { gap: 12px; }
.dct-tn.js .dct-q legend { font-size: 26px; line-height: 1.22; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 14px; text-wrap: balance; outline: none; }
.dct-tn.js .dct-q .dct-hint { display: block; font-size: 14px; margin-top: 6px; letter-spacing: 0; }
.dct-tn.js .dct-chips { flex-direction: column; flex-wrap: nowrap; gap: 10px; }
.dct-tn.js .dct-chip {
  width: 100%; text-align: left; border-radius: 12px; padding: 16px 18px; min-height: 56px;
  font-size: 17px; line-height: 1.3; transition: background-color .15s, color .15s, border-color .15s;
}
.dct-tn.js .dct-chip:hover { border-color: var(--dct-muted); }
.dct-tn.js .dct-chip[aria-pressed="true"] { border-color: var(--dct-fg); }
.dct-tn.js .dct-chip:focus-visible { outline: 2px solid var(--dct-fg); outline-offset: 2px; }
.dct-tn-next { margin-top: 10px; }
.dct-tn-next[disabled] { opacity: .35; }
.dct-tn.js .dct-q[data-max="1"] .dct-tn-next[disabled] { display: none; } /* chọn 1: bấm là sang; nút chỉ hiện khi quay lại */
.dct-tn.js .dct-tn-sign { gap: 12px; }
.dct-tn.js .dct-tn-sign-label { font-size: 26px !important; font-weight: 700 !important; letter-spacing: -0.015em; margin-bottom: 4px; }
.dct-tn.js .dct-tn-sign .dct-btn[type=submit] { height: 60px; font-size: 18px; margin-top: 6px; }
/* màn nhập mã 6 số (OTC ký tuyên ngôn, 07/10/2026) */
.dct-tn-otc, .dct-tn-link { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.dct-tn-otc[hidden], .dct-tn-link[hidden] { display: none; }
.dct-tn-otc .dct-form { max-width: 320px; }
.dct-tn-otc .dct-fine:empty { display: none; }
.dct-otc-input { height: 64px; text-align: center; font-size: 30px; letter-spacing: .4em; padding: 0 0 0 .4em; font-variant-numeric: tabular-nums; }
.dct-otc-input::placeholder { letter-spacing: .4em; }
.dct-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 500px) {
  .dct-tn-intro h1 { font-size: 30px; }
  .dct-tn.js .dct-q legend, .dct-tn.js .dct-tn-sign-label { font-size: 23px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .dct-tn.js .dct-tn-step.is-active { animation: none; }
  .dct-tn-bar span, .dct-tn.js .dct-chip { transition: none; }
}

/* Ghost Portal iframe (thông báo "đăng ký thành công"…): trang dark + iframe không khai color-scheme
   → Chrome vẽ nền iframe trắng đục. Khai color-scheme khớp tài liệu trong iframe để nền trong suốt. */
body.dct-bare #ghost-portal-root iframe { color-scheme: light; }

/* dechetudo score stars in the "Nghe ngay, miễn phí" card (rating-widget.js); empty slot hidden */
#dct-tuan .book-rating-slot { display: block; min-width: 0; }
#dct-tuan .book-rating-slot:empty { display: none; }
#dct-tuan .book-rating { margin-top: 2px !important; justify-content: flex-start; gap: 4px !important; flex-wrap: nowrap; }
#dct-tuan .book-rating > div { gap: 1px !important; }
#dct-tuan .book-rating svg { width: 12px !important; height: 12px !important; }
#dct-tuan .book-rating span { font-size: 12px !important; color: var(--dct-dim) !important; }

/* Link chữ "Trang chủ" trên header căn giữa (/tuyen-ngon/, 08/10/2026 v2): ghim phải, logo vẫn giữa */
.dct-hdr.dct-hdr-center { position: relative; }
.dct-hdr .dct-hdr-home { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-weight: 600; white-space: nowrap; }
.dct-hdr .dct-hdr-home:hover { color: var(--dct-fg); text-decoration: underline; text-underline-offset: 4px; }
