/* ═══════════════════════════════════════════════════════════════
   ĐẾ CHẾ TỰ DO — PLAYER + MODAL (brand canon v2, 06/10/2026 · dct v1 07/10/2026)
   Canon: comic/concept/visual/Nhận diện — Màu & Chữ.md · token dct: assets/css/dct.css
   Mục 1–4 (bar, now playing, action sheet, nav) dùng token --dct-* (khai báo dưới).
   Mục 5–6 vẫn dùng src/tokens.css. Đen tuyệt đối, chữ trắng xám, KHÔNG màu nhấn.
   Nhấn bằng độ đậm (800 vs 400) + trắng tinh vs trắng xám + khoảng trống.
   Cấm: gradient, glow, thẻ có viền, nút đặc màu, bo góc ảnh, màu nhấn.
   JS hooks giữ nguyên: #global-player, .gp-*, data-*. Backup: player.css.pre-brand-20261006, player.css.pre-dct-20261007
   ═══════════════════════════════════════════════════════════════ */

/* ── Z-index scale — ĐỊNH NGHĨA DUY NHẤT (ghi đè giá trị cũ trong tokens.css) ── */
:root {
  --z-nav-bar:              9998;
  --z-player-bar:           9999;
  --z-now-playing:          10000;
  --z-signup-banner:        10000;
  --z-action-sheet-overlay: 10001;
  --z-action-sheet:         10002;
  --z-popup-modal:          10050;
  --z-toast:                10100;
  --z-offcanvas:            10200;

  /* Kích thước player (dùng nội bộ file này) */
  --gp-bar-h:        88px;
  --gp-bar-h-mobile: 72px;
  --gp-nav-h:        54px;
}

/* ── Token dct (giống hệt .dct trong dct.css — scope .dct không bao player) ── */
#global-player,
.gp-popup,
#gp-restore-btn,
.gp-action-sheet-overlay,
.gp-action-sheet,
.gp-nav {
  --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;
}

/* ── Utility ── */
.gp-hidden { display: none !important; }
.gp-invisible { visibility: hidden !important; pointer-events: none !important; }

/* ═══════════════════════════════════════════════════════════════
   1. PLAYER BAR
   ═══════════════════════════════════════════════════════════════ */
#global-player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-player-bar);
  background: var(--dct-bg);
  border-top: 1px solid var(--dct-line);
  border-radius: 0;
  box-shadow: none;
  color: var(--dct-fg);
  font-family: var(--dct-font);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
#global-player.active { transform: translateY(0); }
#global-player.modal-hidden { transform: translateY(100%) !important; }
.gp-nav.modal-hidden { transform: translateY(100%) !important; }

body.gp-active { padding-bottom: calc(var(--gp-bar-h) + var(--s-4)); }
body.gp-popup-open { overflow: hidden; }

/* Vạch tiến độ 1px trên mép bar — chỉ hiện ở mobile (desktop có progress row) */
#global-player::before {
  content: '';
  position: absolute;
  top: -1px; left: 0;
  height: 1px;
  width: var(--gp-progress-pct, 0%);
  background: var(--dct-fg);
  pointer-events: none;
  display: none;
}

/* Nút thu gọn: desktop góc phải trên, trắng; mobile giữa mép trên (07/10/2026) */
.gp-minimize-btn {
  position: absolute;
  top: var(--s-1); right: var(--s-3);
  width: 44px; height: 20px;
  padding: 0;
  background: none; border: none; cursor: pointer;
  color: var(--dct-fg);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s;
  z-index: 2;
}
.gp-minimize-btn:hover { color: var(--dct-fg); }
.gp-minimize-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* Nút icon chung: trắng, không nền, không viền */
.gp-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--dct-muted);
  font-family: var(--dct-font);
  transition: color 0.15s, opacity 0.15s;
}
.gp-btn:hover { color: var(--dct-fg); }
.gp-btn svg { fill: currentColor; }

/* ── Bố cục 3 cột ── */
.gp-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s-6);
  height: var(--gp-bar-h);
  padding: 0 var(--s-6);
  box-sizing: border-box;
}
.gp-mobile-controls { display: none; }

/* ── TRÁI: ảnh + tên + yêu thích ── */
.gp-col-left {
  display: flex; align-items: center; gap: var(--s-3);
  min-width: 0;
}
.gp-artwork {
  width: 37px; height: 56px; /* 2:3 brand cover, shown whole (12/10/2026) */
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  background: var(--dct-card);
}
.gp-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.gp-title {
  font-family: var(--dct-font);
  font-size: 15px; font-weight: 800;
  letter-spacing: -0.01em; line-height: 1.3;
  color: var(--dct-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-artist {
  display: flex; align-items: center; gap: 6px;
  min-width: 0;
  font-family: var(--dct-font);
  font-size: 13px; font-weight: 400;
  color: var(--dct-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-artist .gp-current-time,
.gp-artist .gp-artist-dot { display: none; }
.gp-author { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-rating-slot:empty { display: none; }
.gp-rating-slot .book-rating { margin-top: 2px !important; }

.gp-like-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  color: var(--dct-muted);
}
.gp-like-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.gp-like-btn:hover,
.gp-like-btn.liked { color: var(--dct-fg); }
.gp-like-btn.liked svg { fill: currentColor; }

/* ── GIỮA: điều khiển + tiến độ ── */
.gp-col-center {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s-2);
  width: min(520px, 40vw);
}
.gp-controls { display: flex; align-items: center; gap: var(--s-5); }

.gp-prev-btn, .gp-next-btn { width: 28px; height: 28px; color: var(--dct-dim); }
.gp-prev-btn svg, .gp-next-btn svg { width: 20px; height: 20px; }

/* Play: vòng tròn trắng đặc 48px, icon đen — trội rõ hơn lùi/tiến 15s (32px) */
.gp-play-btn {
  width: 48px; height: 48px; flex-shrink: 0;
  background: var(--dct-fg); border-radius: 50%; box-shadow: none;
  color: var(--dct-bg);
}
.gp-play-btn:hover { color: var(--dct-bg); opacity: 0.85; }
.gp-play-btn svg { width: 22px; height: 22px; fill: currentColor; }

/* Khách (chưa đăng nhập): ẩn cuốn trước / cuốn sau. Member giữ nguyên */
#global-player:not([data-member]) .gp-prev-btn,
#global-player:not([data-member]) .gp-next-btn,
#global-player:not([data-member]) .gp-popup-prev,
#global-player:not([data-member]) .gp-popup-next { display: none; }

/* Lùi / tiến 15s (bar #gp-skip-back / #gp-skip-fwd + popup) */
.gp-skip-btn,
.gp-popup-skip-back,
.gp-popup-skip-fwd {
  position: relative;
  width: 32px; height: 32px;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--dct-muted);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s;
}
.gp-skip-btn:hover,
.gp-popup-skip-back:hover,
.gp-popup-skip-fwd:hover { color: var(--dct-fg); }
.gp-skip-btn svg,
.gp-popup-skip-back svg,
.gp-popup-skip-fwd svg { width: 100%; height: 100%; fill: none; stroke: currentColor; }
.gp-skip-btn span,
.gp-popup-skip-back span,
.gp-popup-skip-fwd span {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--dct-font);
  font-size: 9px; font-weight: 800; letter-spacing: 0;
  padding-top: 2px;
  pointer-events: none;
}

.gp-progress-row {
  display: flex; align-items: center; gap: var(--s-3);
  width: 100%;
}
.gp-time {
  flex-shrink: 0; min-width: 36px;
  font-family: var(--dct-font);
  font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--dct-muted);
}
.gp-time-total { text-align: right; }

/* Track 1px trắng mờ, fill trắng; vùng bấm mở rộng bằng ::before */
.gp-progress {
  flex: 1; position: relative;
  height: 1px;
  background: var(--dct-line);
  cursor: pointer;
  transition: height 0.15s;
}
.gp-progress::before {
  content: ''; position: absolute; left: 0; right: 0; top: -8px; bottom: -8px;
}
.gp-progress:hover { height: 3px; }
.gp-progress-fill {
  position: absolute; top: 0; left: 0;
  height: 100%;
  background: var(--dct-fg);
  transition: width 0.1s linear;
}

/* ── PHẢI: tốc độ · hàng chờ ── */
.gp-col-right {
  display: flex; align-items: center; justify-content: flex-end;
  gap: var(--s-4);
  min-width: 0;
}

.gp-bar-speed-wrap { position: relative; }
.gp-speed {
  height: 32px; padding: 0 var(--s-1);
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--dct-muted);
}

.gp-bar-speed-picker {
  position: absolute; bottom: calc(100% + var(--s-3)); right: 0;
  min-width: 88px;
  display: flex; flex-direction: column;
  padding: var(--s-2) 0;
  background: var(--dct-card);
  border: none; border-radius: 0; box-shadow: none;
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
  z-index: 5;
}
.gp-bar-speed-picker.open { opacity: 1; visibility: visible; transform: translateY(0); }
.gp-bar-speed-picker button {
  padding: 6px var(--s-4);
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: var(--dct-font); font-size: 13px; font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--dct-muted);
  transition: color 0.15s;
}
.gp-bar-speed-picker button:hover { color: var(--dct-fg); }
.gp-bar-speed-picker button.active { color: var(--dct-fg); font-weight: 800; }

.gp-queue-btn { position: relative; width: 32px; height: 32px; color: var(--dct-muted); }
.gp-queue-btn svg { width: 20px; height: 20px; }
.gp-queue-badge {
  position: absolute; top: -2px; right: -6px;
  display: none;
  font-family: var(--dct-font);
  font-size: 10px; font-weight: 800; line-height: 1;
  color: var(--dct-fg);
  background: none;
}
.gp-queue-badge:not(:empty) { display: block; }

/* ── Panel hàng chờ (desktop) ── */
.gp-queue-panel {
  position: absolute; bottom: 100%; right: var(--s-6);
  width: 340px; max-height: 420px;
  display: flex; flex-direction: column;
  background: var(--dct-card);
  border: none; border-top: 1px solid var(--dct-line);
  border-radius: 0; box-shadow: none;
  overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 10;
}
.gp-queue-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.gp-queue-header {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-4) var(--s-3);
  font-family: var(--dct-font);
  font-size: 12px; font-weight: 400;
  letter-spacing: 0.45em; text-transform: uppercase;
  color: var(--dct-muted);
}
.gp-queue-clear {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--dct-font);
  font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--dct-muted);
  text-decoration: underline; text-underline-offset: 3px;
  transition: color 0.15s;
}
.gp-queue-clear:hover { color: var(--dct-fg); }
.gp-queue-list { flex: 1; overflow-y: auto; padding: 0 var(--s-2) var(--s-2); }

/* ── Nút khôi phục (khi thu gọn) ── */
#gp-restore-btn.gp-restore-btn {
  position: fixed; bottom: 72px; right: 20px;
  width: 44px; height: 44px;
  display: none; align-items: center; justify-content: center;
  background: var(--dct-bg);
  color: var(--dct-fg);
  border: 1px solid var(--dct-line);
  border-radius: 0; box-shadow: none;
  cursor: pointer;
  z-index: var(--z-player-bar);
  transition: border-color 0.15s;
}
#gp-restore-btn.gp-restore-btn.visible { display: flex; }
#gp-restore-btn.gp-restore-btn:hover { border-color: var(--dct-fg); }
#gp-restore-btn.gp-restore-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* ── Bar mobile (≤640px) ── */
/* Tầng tablet 641–960px (07/10/2026): cột giữa thu lại, cột trái rộng hơn, ẩn tim để tên sách không cụt */
@media (min-width: 641px) and (max-width: 960px) {
  .gp-content { grid-template-columns: minmax(0, 1.7fr) auto minmax(0, 0.7fr); gap: var(--s-4); }
  .gp-col-center { width: min(340px, 36vw); }
  .gp-controls { gap: var(--s-4); }
  .gp-col-left .gp-like-btn { display: none; }
}

@media (max-width: 640px) {
  .gp-content {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--s-2);
    height: var(--gp-bar-h-mobile);
    padding: 0 var(--s-2) 0 var(--s-4);
  }
  /* bar (72) + gp-nav (54) + safe-area */
  body.gp-active { padding-bottom: calc(var(--gp-bar-h-mobile) + var(--gp-nav-h) + var(--s-4) + env(safe-area-inset-bottom, 0px)); }
  .gp-col-center, .gp-col-right { display: none; }
  #global-player::before { display: block; }
  .gp-minimize-btn { top: 0; height: 16px; right: auto; left: 50%; transform: translateX(-50%); color: var(--dct-dim); }

  .gp-artwork { width: 32px; height: 48px; }
  .gp-title { font-size: 14px; }
  .gp-artist { font-size: 12px; }
  .gp-artist .gp-current-time {
    display: inline; flex-shrink: 0;
    color: var(--dct-fg); font-weight: 600; font-variant-numeric: tabular-nums;
  }
  .gp-artist .gp-artist-dot {
    display: inline-block; flex-shrink: 0;
    width: 2px; height: 2px; background: var(--dct-muted);
  }
  .gp-like-btn { display: flex; width: 40px; height: 40px; }
  .gp-like-btn svg { width: 20px; height: 20px; }

  .gp-mobile-controls { display: flex; align-items: center; }
  .gp-mobile-play { width: 44px; height: 44px; }
  .gp-mobile-play svg { width: 20px; height: 20px; }
}

/* ═══════════════════════════════════════════════════════════════
   2. NOW PLAYING — toàn màn hình, 1 cột giữa nền #000
   ═══════════════════════════════════════════════════════════════ */
.gp-popup {
  position: fixed; inset: 0;
  z-index: var(--z-now-playing);
  display: flex; flex-direction: column;
  background: var(--dct-bg);
  color: var(--dct-fg);
  font-family: var(--dct-font);
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.gp-popup.open { transform: translateY(0); }
.gp-popup-bg { display: none !important; }   /* nền ảnh mờ đã bỏ */

.gp-popup-inner {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%; max-width: 480px; height: 100%;
  margin: 0 auto;
  padding: max(var(--s-5), env(safe-area-inset-top, 0px)) var(--s-5) calc(var(--s-7) + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Header: đóng · nhãn · chia sẻ */
.gp-popup-header {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s-6);
}
.gp-popup-close,
.gp-popup-share {
  width: 40px; height: 40px;
  background: none; border: none; border-radius: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--dct-muted);
  transition: color 0.15s;
}
.gp-popup-close:hover,
.gp-popup-share:hover { color: var(--dct-fg); }
.gp-popup-close svg { fill: currentColor; }
.gp-popup-share svg { stroke: currentColor; fill: none; }
.gp-popup-label {
  font-size: 12px; font-weight: 400;
  letter-spacing: 0.45em; text-transform: uppercase;
  color: var(--dct-muted);
}

/* Cover 2:3 (brand cover shown whole, 12/10/2026), same height as the old 320px square so the layout does not move. No radius, no shadow */
.gp-popup-artwork {
  display: block; flex-shrink: 0;
  width: 100%; max-width: 213px;
  aspect-ratio: 2 / 3; height: auto;
  margin: 0 auto;
  object-fit: cover;
  border-radius: 0; box-shadow: none;
  background: var(--dct-cover);
}

/* Khối info kiểu Spotify: trái = tên · tác giả · sao (căn trái) · phải = tim, căn giữa dọc */
.gp-popup-info {
  flex-shrink: 0;
  display: flex; align-items: center; gap: var(--s-3);
  margin-top: var(--s-6);
  text-align: left;
}
.gp-popup-info-text { flex: 1 1 auto; min-width: 0; text-align: left; }
.gp-popup-title {
  display: block;
  font-size: 24px; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.25;
  color: var(--dct-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-popup-title em,
.gp-popup-title i { font-style: normal; font-weight: 800; color: var(--dct-fg); }
/* Chạy chữ (player-ui.js thêm .is-marquee khi tên tràn + chạy Web Animations: nghỉ 2.5s, cuộn 35px/s, nối liền 2 bản) */
.gp-popup-title.is-marquee {
  text-overflow: clip;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 24px), transparent);
          mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 24px), transparent);
}
.gp-mq-track {
  display: inline-flex; white-space: nowrap;
  will-change: transform;
}
.gp-mq-track > span { flex-shrink: 0; padding-right: var(--mq-gap, 48px); }
.gp-popup-artist {
  margin-top: var(--s-1);
  font-size: 15px; font-weight: 400;
  color: var(--dct-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-popup-rating-slot { display: flex; justify-content: flex-start; margin-top: var(--s-2); }
.gp-popup-rating-slot:empty { display: none; }
.gp-popup-rating-slot .book-rating { justify-content: flex-start; margin-top: 0 !important; }

/* Tim (như nút ✓ của Spotify): viền xám → đặc trắng khi đã thích. Đơn sắc, không màu nhấn */
.gp-popup-like {
  flex-shrink: 0;
  width: 44px; height: 44px; margin-right: -9px;
  background: none; border: none; border-radius: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--dct-muted);
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s, transform 0.15s;
}
.gp-popup-like:hover { color: var(--dct-fg); }
.gp-popup-like:active { transform: scale(0.9); }
.gp-popup-like svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.gp-popup-like.liked { color: var(--dct-fg); }
.gp-popup-like.liked svg { fill: currentColor; }

/* Tiến độ: track 1px trắng */
.gp-popup-progress { flex-shrink: 0; margin-top: var(--s-6); }
.gp-popup-pbar {
  position: relative;
  height: 1px;
  background: var(--dct-line);
  cursor: pointer;
  transition: height 0.15s;
}
.gp-popup-pbar::before {
  content: ''; position: absolute; left: 0; right: 0; top: -12px; bottom: -12px;
}
.gp-popup-pbar:hover { height: 3px; }
.gp-popup-pfill {
  position: absolute; top: 0; left: 0;
  height: 100%;
  background: var(--dct-fg);
}
.gp-popup-pthumb {
  position: absolute; top: 50%; left: 0;
  width: 2px; height: 11px;
  background: var(--dct-fg);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.gp-popup-times {
  display: flex; justify-content: space-between;
  margin-top: var(--s-3);
  font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--dct-muted);
}
.gp-popup-times .gp-popup-tcur { color: var(--dct-fg); font-weight: 600; }

/* Điều khiển: trước · −15 · play · +15 · sau */
.gp-popup-controls {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  gap: var(--s-6);
  margin-top: var(--s-5);
}
.gp-popup-prev,
.gp-popup-next {
  width: 32px; height: 32px;
  background: none; border: none; border-radius: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--dct-dim);
  transition: color 0.15s;
}
.gp-popup-prev:hover,
.gp-popup-next:hover { color: var(--dct-fg); }
.gp-popup-prev svg,
.gp-popup-next svg { width: 22px; height: 22px; fill: currentColor; }
.gp-popup-skip-back,
.gp-popup-skip-fwd { width: 36px; height: 36px; }
.gp-popup-skip-back span,
.gp-popup-skip-fwd span { font-size: 10px; }

.gp-popup-play {
  width: 64px; height: 64px; flex-shrink: 0;
  border: none; padding: 0; cursor: pointer;
  box-shadow: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--dct-fg); border-radius: 50%;
  color: var(--dct-bg);
  transition: opacity 0.15s;
}
.gp-popup-play:hover { opacity: 0.85; }
.gp-popup-play svg { width: 28px; height: 28px; fill: currentColor; }

/* Tốc độ: chữ, không pill */
.gp-popup-speed-wrap { position: relative; flex-shrink: 0; margin-top: var(--s-5); }
.gp-popup-speed[hidden] { display: none !important; }
.gp-popup-speed-picker,
.gp-popup-speed-pills {
  position: static;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--s-1) var(--s-4);
  background: none; border: none; box-shadow: none;
  opacity: 1; visibility: visible;
}
.gp-popup-speed-picker button {
  background: none; border: none; border-radius: 0; cursor: pointer;
  padding: var(--s-1) 2px;
  font-family: var(--dct-font);
  font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums;
  color: var(--dct-dim);
  transition: color 0.15s;
}
.gp-popup-speed-picker button:hover { color: var(--dct-muted); }
.gp-popup-speed-picker button.active { color: var(--dct-fg); font-weight: 800; }

/* Tab: Hàng chờ · Yêu thích · Lịch sử — nhãn chữ hoa giãn 0.45em, không pill */
.gp-popup-tabs { flex-shrink: 0; margin-top: var(--s-7); }
.gp-popup-tab-header {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--s-2) var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--dct-line);
}
.gp-popup-tab {
  background: none; border: none; border-radius: 0; cursor: pointer;
  padding: var(--s-2) 0;
  display: flex; align-items: center; gap: 4px;
  font-family: var(--dct-font);
  font-size: 14px; font-weight: 400;
  letter-spacing: 0.45em; text-transform: uppercase;
  color: var(--dct-dim);
  transition: color 0.15s;
}
.gp-popup-tab:hover { color: var(--dct-muted); }
.gp-popup-tab.active { color: var(--dct-fg); font-weight: 800; }
.gp-popup-tab svg { display: none; }
.gp-popup-tab.gp-tab-disabled { opacity: 0.4; }
.gp-popup-qcount,
.gp-popup-liked-count { letter-spacing: 0.1em; }

.gp-popup-tab-content { padding-top: var(--s-4); }
.gp-popup-tab-pane { display: none; }
.gp-popup-tab-pane.active { display: block; }

.gp-popup-queue-actions { display: flex; justify-content: flex-end; padding-bottom: var(--s-2); }
.gp-popup-qclear {
  width: 32px; height: 32px;
  background: none; border: none; border-radius: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--dct-dim);
  transition: color 0.15s;
}
.gp-popup-qclear:hover { color: var(--dct-fg); }
.gp-popup-qlist,
.gp-popup-liked-list { display: flex; flex-direction: column; }
.gp-popup-history-list { max-height: none; }
.gp-popup-history-empty,
.gp-popup-liked-empty {
  padding: var(--s-6) 0;
  text-align: center;
  font-size: 14px; color: var(--dct-dim);
}
/* "Phát tất cả" = link hành động 600 15px gạch chân */
.gp-popup-liked-playall {
  display: block; margin: var(--s-4) auto 0;
  background: none; border: none; padding: var(--s-2); cursor: pointer;
  font-family: var(--dct-font);
  font-size: 15px; font-weight: 600;
  color: var(--dct-fg);
  text-decoration: underline; text-underline-offset: 4px;
}
.gp-popup-liked-playall:hover { color: var(--dct-muted); }

/* ── Dòng sách trong hàng chờ / yêu thích / lịch sử (bar + popup) ── */
.gp-queue-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--dct-line);
  background: transparent;
  cursor: pointer;
  transition: opacity 0.15s;
}
.gp-queue-panel .gp-queue-item { padding: var(--s-2); }
.gp-queue-item:hover { opacity: 0.85; }
.gp-qi-thumb {
  width: 44px; height: 44px; flex-shrink: 0;
  object-fit: cover;
  border-radius: 0;
  background: var(--dct-cover);
}
.gp-qi-info,
.gp-qi-meta { flex: 1; min-width: 0; }
.gp-qi-title {
  font-family: var(--dct-font);
  font-size: 14px; font-weight: 400; line-height: 1.35;
  color: var(--dct-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-queue-item.active .gp-qi-title { color: var(--dct-fg); font-weight: 800; }
.gp-qi-artist {
  font-size: 12px; color: var(--dct-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-qi-drag,
.gp-qi-more,
.gp-qi-remove {
  flex-shrink: 0;
  width: 32px; height: 32px; padding: 0;
  background: none; border: none; border-radius: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--dct-dim);
  transition: color 0.15s;
}
.gp-qi-drag:hover,
.gp-qi-more:hover,
.gp-qi-remove:hover { color: var(--dct-fg); }
.gp-qi-drag { cursor: grab; touch-action: none; }
.gp-qi-drag:active { cursor: grabbing; }
.gp-qi-drag svg,
.gp-qi-more svg,
.gp-qi-remove svg { width: 18px; height: 18px; fill: currentColor; }
.gp-queue-item.active .gp-qi-drag,
.gp-queue-item.active .gp-qi-more { visibility: hidden; }
.gp-queue-item.dragging { opacity: 0.4; }
.gp-qi-placeholder { border-top: 1px solid var(--dct-fg); border-bottom: 1px solid var(--dct-fg); }

/* ── Popup mobile: full-height ── */
@media (max-width: 640px) {
  .gp-popup { height: 100%; height: 100dvh; }
  .gp-popup-inner { max-width: none; padding-left: var(--s-4); padding-right: var(--s-4); }
  .gp-popup-header { margin-bottom: var(--s-5); }
  .gp-popup-artwork { max-width: min(213px, 52vw); }
  .gp-popup-title { font-size: 22px; }
  .gp-popup-info { gap: var(--s-2); }
  .gp-popup-controls { gap: var(--s-5); }
  .gp-popup-tab { font-size: 12px; letter-spacing: 0.3em; }
  .gp-popup-tab-header { gap: var(--s-2) var(--s-4); }
}

/* ═══════════════════════════════════════════════════════════════
   3. ACTION SHEET (menu ba chấm)
   ═══════════════════════════════════════════════════════════════ */
.gp-action-sheet-overlay {
  position: fixed; inset: 0;
  z-index: var(--z-action-sheet-overlay);
  background: rgba(0, 0, 0, 0.8);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.gp-action-sheet-overlay.open { opacity: 1; visibility: visible; }
.gp-action-sheet {
  position: fixed;
  z-index: var(--z-action-sheet);
  width: calc(100% - 32px); max-width: 360px;
  background: var(--dct-cover);
  border-radius: 0; box-shadow: none;
  overflow: hidden;
  font-family: var(--dct-font);
}
@media (min-width: 641px) {
  .gp-action-sheet {
    top: 50%; left: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s;
  }
  .gp-action-sheet-overlay.open .gp-action-sheet { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@media (max-width: 640px) {
  .gp-action-sheet {
    left: 0; right: 0; bottom: 0;
    width: 100%; max-width: none;
    border-top: 1px solid var(--dct-line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .gp-action-sheet-overlay.open .gp-action-sheet { transform: translateY(0); }
}
.gp-as-header {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4);
  border-bottom: 1px solid var(--dct-line);
}
.gp-as-thumb {
  width: 32px; height: 48px; /* 2:3 cover */ flex-shrink: 0;
  object-fit: cover; border-radius: 0;
  background: var(--dct-card);
}
.gp-as-info { flex: 1; min-width: 0; overflow: hidden; }
.gp-as-title {
  font-size: 15px; font-weight: 800; color: var(--dct-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-as-artist {
  margin-top: 2px;
  font-size: 13px; color: var(--dct-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gp-as-option {
  display: flex; align-items: center; gap: var(--s-3);
  width: 100%;
  padding: 14px var(--s-4);
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: var(--dct-font);
  font-size: 15px; font-weight: 400;
  color: var(--dct-muted);
  transition: color 0.15s;
}
.gp-as-option:hover { color: var(--dct-fg); }
.gp-as-option svg { width: 22px; height: 22px; flex-shrink: 0; }
.gp-as-option.destructive { color: var(--dct-muted); }

/* ═══════════════════════════════════════════════════════════════
   4. MOBILE NAV (thanh dưới, ≤640px)
   ═══════════════════════════════════════════════════════════════ */
.gp-nav { display: none; }
@media (max-width: 640px) {
  .gp-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: var(--z-nav-bar);
    display: flex; justify-content: space-around; align-items: center;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    background: var(--dct-bg);
    border-top: 1px solid var(--dct-line);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .gp-nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 10px 20px;
    background: none; border: none; cursor: pointer;
    color: var(--dct-dim);
    text-decoration: none;
    font-family: var(--dct-font);
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
  }
  .gp-nav-item:hover,
  .gp-nav-item.active { color: var(--dct-fg); }
  .gp-nav-item svg { flex-shrink: 0; }

  /* Bar nằm trên nav */
  #global-player.active { bottom: var(--gp-nav-h); }
  body.gp-popup-open .gp-nav { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   5. MODAL — upsell · Premium (web QR/pay-opt styles removed 20/10/2026)
   Nền #000, chữ trắng, CTA = link 600 15px gạch chân (không nút đặc)
   ═══════════════════════════════════════════════════════════════ */
.ap-upsell-overlay,
.pm-overlay {
  position: fixed; inset: 0;
  z-index: var(--z-popup-modal);
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  padding: var(--s-5);
  background: rgba(0, 0, 0, 0);
  overflow-y: auto;
  transition: background 0.3s ease;
}
.ap-upsell-overlay.fade-in,
.pm-overlay.open { display: flex; background: rgba(0, 0, 0, 0.92); }

.modal-card {
  position: relative;
  width: 100%; max-width: 480px; max-height: 88vh;
  overflow-y: auto;
  background: var(--bg);
  color: var(--ink);
  border: none; border-radius: 0; box-shadow: none;
  font-family: var(--font-sans);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
.ap-upsell-overlay.fade-in .modal-card,
.pm-overlay.open .modal-card { opacity: 1; transform: none; }
.modal-card.wide { max-width: 560px; }

.modal-close,
.pm-close {
  position: absolute; top: var(--s-3); right: var(--s-3);
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 0; cursor: pointer;
  color: var(--ink-55);
  z-index: 3;
  transition: color 0.15s;
}
.modal-close:hover,
.pm-close:hover { color: var(--dct-fg, #fff); }

.modal-hero { position: relative; padding: var(--s-7) var(--s-6) var(--s-5); text-align: center; }
.modal-kicker {
  margin-bottom: var(--s-4);
  font-size: 12px; font-weight: 400;
  letter-spacing: 0.45em; text-transform: uppercase;
  color: var(--ink-55);
}
.modal-title {
  margin: 0 0 var(--s-4);
  font-family: var(--font-sans);
  font-size: 32px; font-weight: 800;
  letter-spacing: -0.025em; line-height: 1.1;
  color: var(--ink);
}
.modal-title em { font-style: normal; font-weight: 800; color: var(--dct-fg, #fff); white-space: nowrap; } /* tên brand không bẻ đôi dòng */
.modal-lead {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px; font-weight: 400; line-height: 1.6;
  color: var(--ink-70);
}
.modal-lead strong,
.modal-lead b { font-weight: 700; color: var(--dct-fg, #fff); }
.modal-body { padding: 0 var(--s-6) var(--s-2); }
.modal-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: var(--s-3) var(--s-6);
  margin-top: var(--s-5);
  padding: var(--s-5) var(--s-6) var(--s-6);
  border-top: 1px solid var(--rule);
}
.modal-footer .sp { display: none; }

/* Nút trong modal → link hành động (ghi đè styles.css + style inline cũ) */
.ap-pw-unlock,
.modal-card .btn,
.modal-card .btn-primary,
.modal-card .btn-premium,
.modal-card .btn-ghost,
.modal-card .btn-outline,
.modal-card .btn-lg {
  display: inline-flex; align-items: center; gap: 6px;
  height: auto; width: auto;
  padding: var(--s-1) 0 !important;
  background: none !important;
  border: none !important; border-radius: 0 !important; box-shadow: none !important;
  font-family: var(--font-sans) !important;
  font-size: 15px !important; font-weight: 600 !important;
  letter-spacing: 0 !important; text-transform: none !important;
  color: var(--dct-fg, #fff) !important;
  text-decoration: underline; text-underline-offset: 4px;
  cursor: pointer;
  transition: color 0.15s;
}
.ap-pw-unlock:hover,
.modal-card .btn:hover { color: var(--ink-70) !important; background: none !important; }
.modal-card .btn-ghost,
.modal-card .btn-outline,
.ap-pw-secondary { color: var(--ink-55) !important; font-weight: 400 !important; }
.modal-card .btn svg { width: 13px; height: 13px; }
/* Nút "Đóng" ngoài card */
.ap-pw-dismiss {
  margin-top: var(--s-3);
  background: none !important; border: none; cursor: pointer;
  font-family: var(--font-sans) !important;
  font-size: 12px !important; letter-spacing: 0.45em !important; text-transform: uppercase;
  color: var(--ink-35) !important;
}
.ap-pw-dismiss:hover { color: var(--ink-70) !important; }

/* Đồng hồ lượt nghe */
.usage-block { margin-top: var(--s-5); padding: 0; background: none; border: none; border-radius: 0; }
.usage-block .u-label {
  display: flex; justify-content: space-between;
  margin-bottom: var(--s-2);
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-55);
}
.usage-block .u-label strong { color: var(--ink); font-weight: 800; }
.usage-block .bar { height: 1px; background: var(--ink-15); overflow: hidden; }
.usage-block .bar .fill { height: 100%; background: var(--dct-fg, #fff); }
.usage-block .bar .fill.full { background: var(--dct-fg, #fff); }

/* Trích dẫn chia sẻ */
.share-quote {
  margin: var(--s-5) 0 0; padding: 0 0 0 var(--s-4);
  border-left: 1px solid var(--rule);
  font-size: 16px; font-style: italic; font-weight: 400; line-height: 1.5;
  color: var(--ink-70);
}
.share-quote cite {
  display: block; margin-top: var(--s-2);
  font-style: normal; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-55);
}

/* Giá + quyền lợi */
.price-block { display: flex; align-items: baseline; justify-content: center; gap: var(--s-3); margin: var(--s-4) 0 var(--s-5); }
.price-big { font-size: 52px; font-weight: 800; letter-spacing: -0.025em; line-height: 1; color: var(--ink); }
.price-big em { font-style: normal; color: var(--dct-fg, #fff); }
.price-unit { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-55); }
.price-strike { margin-left: auto; font-size: 14px; color: var(--ink-35); text-decoration: line-through; }
.benefits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-4); text-align: left; }
.benefits li { display: grid; grid-template-columns: 20px 1fr; gap: var(--s-3); align-items: baseline; }
.benefits li svg { width: 16px; height: 16px; margin-top: 2px; color: var(--dct-fg, #fff); }
.benefits li .bt { font-size: 17px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.benefits li .bt em { font-style: normal; font-weight: 800; color: var(--dct-fg, #fff); }
.benefits li .bd { margin-top: 2px; font-size: 14px; color: var(--ink-55); }

/* Trạng thái chờ */
@keyframes gp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.pending {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 0; background: none; border: none; border-radius: 0;
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-70);
}
.pending .d { width: 6px; height: 6px; background: var(--dct-fg, #fff); animation: gp-pulse 1.2s ease-in-out infinite; }

/* Thành công */
.success-hero { padding: var(--s-7) var(--s-6) var(--s-5); text-align: center; }
.success-ring {
  width: 56px; height: 56px; margin: 0 auto var(--s-5);
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--dct-fg, #fff);
}
.success-title { margin: 0 0 var(--s-3); font-size: 36px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; color: var(--ink); }
.success-title em { font-style: normal; color: var(--dct-fg, #fff); }
.success-lead { margin: 0 0 var(--s-3); font-size: 16px; color: var(--ink-70); }
.success-meta {
  display: flex; justify-content: center; gap: var(--s-5);
  margin: var(--s-5) 0 var(--s-1);
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-55);
}
.success-meta .v { margin-top: 4px; font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }

/* Popup Premium */
.pm-loading { padding: var(--s-7) var(--s-6); text-align: center; font-size: 14px; color: var(--ink-55); }
.pm-btn-renew {
  display: inline-block;
  padding: var(--s-1) 0;
  background: none; border: none; border-radius: 0;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  letter-spacing: 0; text-transform: none;
  color: var(--dct-fg, #fff);
  text-decoration: underline; text-underline-offset: 4px;
  transition: color 0.15s;
}
.pm-btn-renew:hover { color: var(--ink-70); }
.pm-divider { height: 1px; margin: var(--s-5) 0; background: var(--rule); }

/* Biến thể nút cũ (ngoài modal) */
.btn-outline { color: var(--ink); border-color: var(--ink-35); }
.btn-outline:hover { border-color: var(--ink); background: none; }
.btn-full { width: 100%; }

/* Sao rating: rating-widget.js tô var(--star) / var(--star-empty) (token ở src/tokens.css) bằng style inline trên <path> */

/* Modal mobile: trượt từ dưới, full width */
@media (max-width: 640px) {
  .pm-overlay,
  .ap-upsell-overlay { padding: 0; align-items: stretch; justify-content: flex-end; }
  .modal-card { max-width: 100%; max-height: 92vh; border-top: 1px solid var(--rule); transform: translateY(30px); }
  .ap-upsell-overlay.fade-in .modal-card,
  .pm-overlay.open .modal-card { transform: none; }
  .modal-hero { padding: var(--s-6) var(--s-5) var(--s-4); }
  .modal-body { padding: 0 var(--s-5) var(--s-2); }
  .modal-footer { padding: var(--s-4) var(--s-5) calc(var(--s-5) + env(safe-area-inset-bottom, 0px)); }
  .modal-title { font-size: 26px; }
  .price-big { font-size: 42px; }
}

/* ═══════════════════════════════════════════════════════════════
   6. NGOÀI PLAYER (dùng chung, nạp toàn site) — đã đổi sang token v2
   ═══════════════════════════════════════════════════════════════ */

/* Ba chấm trên card sách (spotify-card / post-card) */
.spotify-card .sc-more-btn,
.post-card .sc-more-btn {
  position: absolute; bottom: 2px; right: 2px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  border: none; border-radius: 0;
  color: var(--ink);
  cursor: pointer;
  opacity: 0; transform: translateY(2px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 2;
}
.spotify-card .sc-more-btn svg,
.post-card .sc-more-btn svg { width: 18px; height: 18px; fill: currentColor; }
.spotify-card:hover .sc-more-btn,
.spotify-card .sc-more-btn:focus,
.post-card:hover .sc-more-btn,
.post-card .sc-more-btn:focus { opacity: 1; transform: translateY(0); }
@media (max-width: 640px) {
  .spotify-card .sc-more-btn,
  .post-card .sc-more-btn { opacity: 1; transform: translateY(0); }
}

/* Card sách trang tag */
.tag-posts .post-card { cursor: pointer; }
.tag-posts .card-title { text-align: center; }
.tag-posts .book-rating-slot { display: flex; justify-content: center; }
.tag-posts .post-card .flex-1 { display: flex; flex-direction: column; }
.tag-posts .post-card .flex-1 > div:first-child { order: 1; margin-bottom: 0; margin-top: auto; }
@media (max-width: 639px) {
  .tag-posts { grid-template-columns: 1fr !important; gap: 1.5rem !important; padding: 0 1rem !important; }
  .tag-posts > * { border-top: none !important; }
  .tag-posts .blog-layout { flex-direction: column; padding: 0; gap: 0.5rem; }
  .tag-posts .blog-layout > a:first-child { min-width: 100%; max-width: 100%; }
  .tag-posts .blog-layout > a:first-child img { min-width: 100%; max-width: 100%; aspect-ratio: 3 / 4; max-height: 340px; }
  .tag-posts .card-title { font-size: 1rem; line-height: 1.375rem; }
  .tag-posts .card-excerpt {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 0.75rem; line-height: 1.125rem;
  }
}

/* Ba chấm trên podcast hero */
.podcast-hero-more {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: 1px solid var(--rule); border-radius: 0;
  color: var(--ink-70);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.podcast-hero-more:hover { color: var(--ink); border-color: var(--ink); }
.podcast-hero-more svg { width: 20px; height: 20px; fill: currentColor; }

/* Signup banner (tạm ẩn từ 2026-04-21) */
.signup-banner { display: none !important; }
.signup-banner-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.signup-banner-title { margin: 0; font-size: 0.85rem; font-weight: 800; color: var(--ink); }
.signup-banner-desc { margin: 2px 0 0; font-size: 0.75rem; color: var(--ink-55); }
.signup-banner-btn {
  padding: 0; background: none; border: none; cursor: pointer; white-space: nowrap;
  font-size: 15px; font-weight: 600; color: var(--dct-fg, #fff);
  text-decoration: underline; text-underline-offset: 4px;
}
.signup-banner-close {
  position: absolute; top: 4px; right: 8px;
  padding: 2px 6px; background: none; border: none; cursor: pointer;
  font-size: 1.25rem; line-height: 1; color: var(--ink-55);
}
.signup-banner-close:hover { color: var(--ink); }
body.gp-popup-open .signup-banner,
body.gp-active .signup-banner { display: none; }
@media (max-width: 640px) {
  .signup-banner { padding: 10px 16px 65px; bottom: 0; }
  .signup-banner-inner { flex-direction: column; text-align: center; gap: 8px; }
  .blog-header-picture { display: block; max-width: 100%; margin: 0 auto; }
}

/* Công tắc push notification */
#push-toggle-row { justify-content: flex-start; align-items: center; gap: 0; }
#push-toggle-label { flex: 1; }
.push-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.push-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.push-slider {
  position: absolute; inset: 0;
  background: none;
  border: 1px solid var(--ink-35);
  cursor: pointer;
  transition: border-color 0.2s;
}
.push-slider::before {
  content: '';
  position: absolute; left: 3px; bottom: 3px;
  width: 16px; height: 16px;
  background: var(--ink-35);
  transition: transform 0.2s, background 0.2s;
}
.push-switch input:checked + .push-slider { border-color: var(--dct-fg, #fff); }
.push-switch input:checked + .push-slider::before { background: var(--dct-fg, #fff); transform: translateX(20px); }
.push-switch input:disabled + .push-slider { opacity: 0.4; cursor: not-allowed; }

/* ── Editorial homepage (partials/editorial-card.hbs) ── */
.ed-homepage { min-height: 100vh; padding-bottom: 160px; background: var(--bg); color: var(--ink); }
.ed-masthead { border-bottom: 1px solid var(--rule); }
.ed-issue-meta { padding: 10px 18px; text-align: right; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-55); }
.ed-hero { padding: 22px 18px 24px; border-bottom: 1px solid var(--rule); }
.ed-hero-kicker { margin-bottom: 12px; font-size: 12px; letter-spacing: 0.45em; text-transform: uppercase; color: var(--ink-55); }
.ed-headline { margin: 0 0 16px; font-size: clamp(36px, 11vw, 52px); font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; }
.ed-headline em { font-style: normal; color: var(--dct-fg, #fff); }
.ed-hero-sub { max-width: 340px; margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink-70); }
.ed-mono { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); }
.ed-stat-strip { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.ed-stat { padding: 0 12px; text-align: center; }
.ed-stat-num { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.ed-stat-label { margin-top: 2px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-55); }
.ed-section { padding: 22px 0 4px; border-bottom: 1px solid var(--rule); }
.ed-section-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 0 18px; }
.ed-section-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; letter-spacing: 0.45em; text-transform: uppercase; color: var(--ink-55); }
.ed-section-num { color: var(--ink); font-weight: 800; }
.ed-kicker-rule { display: none; }
.ed-section-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.ed-see-all {
  flex-shrink: 0; white-space: nowrap;
  font-size: 14px; font-weight: 600; color: var(--ink-70);
  text-decoration: underline; text-underline-offset: 4px;
  transition: color 0.15s;
}
.ed-see-all:hover { color: var(--dct-fg, #fff); }
.ed-carousel { display: flex; gap: 12px; overflow-x: auto; padding: 0 18px 20px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.ed-carousel::-webkit-scrollbar { display: none; }
.ed-card { flex: 0 0 auto; width: 124px; display: block; scroll-snap-align: start; color: var(--ink); text-decoration: none !important; }
.ed-card-cover-wrap { position: relative; aspect-ratio: 5 / 6; margin-bottom: 8px; overflow: hidden; border-radius: 0; background: var(--surface); }
.ed-card-cover-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ed-card-cover-empty { display: flex; align-items: center; justify-content: center; }
.ed-card-music-icon { width: 36px; height: 36px; color: var(--ink-35); }
.ed-card-play-btn {
  position: absolute; bottom: 0; right: 0;
  width: 32px; height: 32px; padding-left: 2px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--ink);
  border: none; border-radius: 0; box-shadow: none;
  cursor: pointer;
}
.ed-card-play-btn:hover { color: var(--dct-fg, #fff); }
.ed-badge-new {
  position: absolute; top: 0; left: 0; z-index: 1;
  padding: 3px 6px;
  background: var(--bg); color: var(--ink);
  font-size: 10px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase;
  border-radius: 0;
  pointer-events: none;
}
.ed-card-info { padding: 0 2px; }
.ed-card-title {
  margin: 0 0 2px;
  font-size: 13px; font-weight: 700; line-height: 1.3;
  color: var(--ink);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ed-card-author { margin: 0; font-size: 12px; color: var(--ink-55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-end-strip { padding: 18px; text-align: center; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-55); }
@media (min-width: 640px) {
  .ed-hero { padding: 32px 32px 36px; }
  .ed-hero-sub { max-width: 480px; }
  .ed-section-hd { padding: 0 32px; }
  .ed-carousel { padding: 0 32px 24px; gap: 16px; }
  .ed-issue-meta { padding: 10px 32px; }
  .ed-stat { padding: 0 24px; }
  .ed-card { width: 148px; }
}

/* ── Editorial post page (blog-header.hbs, post.hbs) ── */
.ep-header { padding: 22px 18px 28px; border-bottom: 1px solid var(--rule); background: var(--bg); }
.ep-kicker { margin-bottom: 12px; font-size: 12px; letter-spacing: 0.45em; text-transform: uppercase; color: var(--ink-55); }
.ep-title { margin: 0 0 14px; font-size: clamp(30px, 8.5vw, 52px); font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; color: var(--ink); }
.ep-title em { font-style: normal; }
.ep-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; font-size: 13px; color: var(--ink-55); }
.ep-meta-author { color: var(--ink); font-weight: 700; }
.ep-meta-dot { flex-shrink: 0; width: 3px; height: 3px; background: currentColor; }
.ep-cover-wrap { width: 78%; max-width: 400px; margin: 0 auto; overflow: hidden; border-radius: 0; box-shadow: none; }
.ep-cover-img { display: block; width: 100%; }
.ep-body { max-width: 680px; margin: 0 auto; padding: 28px 18px 24px; }
.ep-post-footer { max-width: 680px; margin: 0 auto; padding: 0 18px 32px; }
.ep-prose { color: var(--ink); }
.ep-prose h2,
.ep-prose h3 { font-family: var(--font-sans); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.ep-prose blockquote {
  padding: 0 0 0 18px;
  background: none;
  border-left: 1px solid var(--rule);
  font-family: var(--font-sans); font-style: italic; font-weight: 400;
  color: var(--ink);
}
.ep-prose a { color: var(--dct-fg, #fff); }
.ep-post-footer .pb-4:not(.not-prose) h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
@media (min-width: 640px) {
  .ep-header { padding: 28px 32px 36px; }
  .ep-cover-wrap { max-width: 420px; }
  .ep-body { max-width: 800px; padding: 36px 32px 32px; }
  .ep-post-footer { max-width: 800px; padding: 0 32px 48px; }
}

/* Avatar initial — chỉ hiện chữ đầu */
[data-initial] { display: inline-block; width: 1ch; overflow: hidden; white-space: nowrap; vertical-align: bottom; }

/* Bìa thiếu / hỏng → ô vuông đen, không icon ảnh vỡ, không alt text.
   content:url(gif trong suốt) thay ảnh (Chromium + Safari) → lộ nền --surface. */
.gp-artwork, .gp-popup-artwork, .gp-qi-thumb, .gp-as-thumb {
  color: transparent; font-size: 0; /* ẩn alt text nếu ảnh lỗi */
}
.gp-artwork:is([src=""], :not([src])),
.gp-popup-artwork:is([src=""], :not([src])),
.gp-qi-thumb:is([src=""], :not([src])),
.gp-as-thumb:is([src=""], :not([src])) {
  content: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
  background: var(--dct-cover);
}
