/* Luyện Phiên Dịch — bộ giao diện dùng chung.
   Ý tưởng bố cục: sổ tốc ký của phiên dịch viên, có đường lề dọc; mốc giờ nằm ngoài lề, lời nói nằm trong trang. */
:root {
  --luc-900: #0B2B26; --luc-800: #0F3D35; --luc-700: #145044; --luc-600: #1B6657;
  --luc-300: #7FCBB3; --luc-100: #DCEDE6; --luc-50: #EEF5F1;
  --vang-500: #E8A317; --vang-300: #F5CF72; --vang-100: #FBEFCF; --mat-ong-700: #7A4F00;

  --nen: #F6F7F2; --mat: #FFFFFF; --mat-2: #EEF2EC; --chu: #14211E; --chu-phu: #51615B;
  --vien: #D7DFD9; --le: #E3B9A6;
  --chinh: #145044; --tren-chinh: #FFFFFF; --nhat-chinh: #DCEDE6; --chu-nhan: #7A4F00;
  --tin-hieu: #E8A317; --tren-tin-hieu: #0B2B26; --nhat-vang: #FBEFCF;
  --dung: #17693F; --nhat-dung: #DFF1E6; --sai: #A8281F; --nhat-sai: #F9E3E0;
  --ben: #0F3D35; --ben-chu: #EAF1EC; --ben-phu: #A9C4BA; --ben-vien: rgba(255,255,255,.12); --ben-chon: rgba(255,255,255,.10);

  --phong-chu: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --phong-doc: "Literata", Georgia, "Times New Roman", serif;
  --bo-the: 8px; --bo-nut: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --nen: #0C1714; --mat: #13221E; --mat-2: #1A2C27; --chu: #EAF1EC; --chu-phu: #9DB0A8;
    --vien: #2A3F39; --le: #6B4A3C;
    --chinh: #7FCBB3; --tren-chinh: #0C1714; --nhat-chinh: #1C3A33; --chu-nhan: #F0B93A;
    --tin-hieu: #F0B93A; --tren-tin-hieu: #0C1714; --nhat-vang: #3A2E12;
    --dung: #5FD39A; --nhat-dung: #15352A; --sai: #F58A80; --nhat-sai: #3D1F1C;
    --ben: #0A1411; --ben-chu: #EAF1EC; --ben-phu: #9DB0A8; --ben-vien: rgba(255,255,255,.09); --ben-chon: rgba(255,255,255,.08);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --nen: #0C1714; --mat: #13221E; --mat-2: #1A2C27; --chu: #EAF1EC; --chu-phu: #9DB0A8;
  --vien: #2A3F39; --le: #6B4A3C;
  --chinh: #7FCBB3; --tren-chinh: #0C1714; --nhat-chinh: #1C3A33; --chu-nhan: #F0B93A;
  --tin-hieu: #F0B93A; --tren-tin-hieu: #0C1714; --nhat-vang: #3A2E12;
  --dung: #5FD39A; --nhat-dung: #15352A; --sai: #F58A80; --nhat-sai: #3D1F1C;
  --ben: #0A1411; --ben-chu: #EAF1EC; --ben-phu: #9DB0A8; --ben-vien: rgba(255,255,255,.09); --ben-chon: rgba(255,255,255,.08);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--nen); color: var(--chu); font: 400 16px/1.6 var(--phong-chu); }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.2; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.35; }
a { color: var(--chinh); text-underline-offset: 3px; }
ul, ol { padding-left: 1.2em; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--tin-hieu); outline-offset: 2px; border-radius: 3px; }
.so { font-variant-numeric: tabular-nums; }
.phu { color: var(--chu-phu); }
.nho { font-size: .875rem; }
.nhan-dau { font-size: .875rem; font-weight: 600; color: var(--chu-nhan); }
.dem { max-width: 65ch; }
.bieu-tuong { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tieu-doc { font-family: var(--phong-doc); }

/* Khung trang */
.khung { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.thanh-ben { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--ben); color: var(--ben-chu); display: flex; flex-direction: column; gap: 24px; padding: 24px 16px; }
.thanh-ben .logo img { display: block; width: 100%; max-width: 190px; height: auto; }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--bo-nut); color: var(--ben-phu); text-decoration: none; font-size: .9375rem; font-weight: 500; transition: background .15s, color .15s; }
.menu a:hover { background: var(--ben-chon); color: var(--ben-chu); }
.menu a[aria-current="page"] { background: var(--ben-chon); color: #fff; }
.menu a[aria-current="page"] .bieu-tuong { color: var(--vang-500); }
.chan-ben { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: .8125rem; color: var(--ben-phu); }
.chan-ben button { background: none; border: 1px solid var(--ben-vien); border-radius: var(--bo-nut); padding: 7px 10px; color: var(--ben-chu); cursor: pointer; text-align: left; }
.noi-dung { min-width: 0; padding-block: 40px 72px; padding-left: max(16px, min(5vw, 56px)); padding-right: max(16px, min(5vw, 56px)); }
.trang { max-width: 1040px; margin-inline: auto; display: flex; flex-direction: column; gap: 32px; }
.dau-trang { display: flex; flex-direction: column; gap: 8px; }
.dau-trang p { max-width: 62ch; color: var(--chu-phu); }

/* Nút */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--bo-nut); border: 1px solid transparent; font-weight: 500; font-size: .9375rem; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .1s; }
.nut:active { transform: translateY(1px); }
.nut:disabled { opacity: .45; cursor: not-allowed; }
.nut-chinh { background: var(--chinh); color: var(--tren-chinh); }
.nut-chinh:hover { background: var(--luc-600); }
:root[data-theme="dark"] .nut-chinh:hover { background: #95D6C1; }
.nut-tin-hieu { background: var(--tin-hieu); color: var(--tren-tin-hieu); }
.nut-tin-hieu:hover { background: var(--vang-300); }
.nut-phu { background: var(--mat); color: var(--chu); border-color: var(--vien); }
.nut-phu:hover { border-color: var(--chinh); }
.nut-phu[aria-pressed="true"] { background: var(--nhat-chinh); border-color: var(--chinh); }
.nut-vuong { width: 40px; padding: 0; }
.hang { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.giua-rong { justify-content: space-between; }

/* Thẻ và nhãn */
.the { background: var(--mat); border: 1px solid var(--vien); border-radius: var(--bo-the); padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.luoi { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 4px; background: var(--mat-2); color: var(--chu-phu); font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.chip-chinh { background: var(--nhat-chinh); color: var(--chinh); }
.chip-vang { background: var(--nhat-vang); color: var(--chu-nhan); }
.chip-dung { background: var(--nhat-dung); color: var(--dung); }
.chip-sai { background: var(--nhat-sai); color: var(--sai); }
.tien-do { height: 6px; border-radius: 3px; background: var(--mat-2); overflow: hidden; }
.tien-do span { display: block; height: 100%; background: var(--chinh); }

/* Thông báo */
.bao { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--bo-the); background: var(--mat-2); font-size: .9375rem; }
.bao .bieu-tuong { margin-top: .22em; }
.bao-vang { background: var(--nhat-vang); }
.bao-vang .bieu-tuong { color: var(--chu-nhan); }
.bao-sai { background: var(--nhat-sai); }
.bao-sai .bieu-tuong { color: var(--sai); }
.bao-dung { background: var(--nhat-dung); }
.bao-dung .bieu-tuong { color: var(--dung); }

/* Sổ tốc ký: mốc giờ ngoài lề, lời nói trong trang */
.so-ky { background: var(--mat); border: 1px solid var(--vien); border-radius: var(--bo-the); overflow: hidden; }
.dong { display: grid; grid-template-columns: 68px minmax(0, 1fr); border-bottom: 1px solid var(--vien); }
.dong:last-child { border-bottom: 0; }
.dong .gio { padding: 11px 10px 11px 0; text-align: right; font-size: .8125rem; color: var(--chu-phu); font-variant-numeric: tabular-nums; border-right: 1px solid var(--le); background: none; border-top: 0; border-bottom: 0; border-left: 0; cursor: pointer; }
.dong .loi { padding: 10px 14px; font-family: var(--phong-doc); font-size: 1.0625rem; line-height: 1.6; min-width: 0; }
.dong.dang-doc { background: var(--nhat-vang); }
.dong .an { color: transparent; background: var(--mat-2); border-radius: 3px; user-select: none; }
.dong .nghi::after { content: " ?"; color: var(--chu-nhan); font-family: var(--phong-chu); font-weight: 600; }

/* Bảng */
.bang-cuon { overflow-x: auto; border: 1px solid var(--vien); border-radius: var(--bo-the); background: var(--mat); }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--vien); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: .8125rem; font-weight: 600; color: var(--chu-phu); }

@media (max-width: 820px) {
  .khung { display: block; }
  .thanh-ben { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; height: auto; padding: 10px max(16px, env(safe-area-inset-left, 0px)) 8px max(16px, env(safe-area-inset-right, 0px)); gap: 8px; }
  .thanh-ben .logo img { max-width: 150px; }
  .menu { flex-direction: row; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; }
  .menu a { white-space: nowrap; padding: 7px 9px; font-size: .875rem; }
  .chan-ben { display: none; }
  .noi-dung { padding-block: 24px 56px; }
  .dong { grid-template-columns: 54px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
