/* =====================================================================
   THI TRẮC NGHIỆM — giao diện
   Máy tính: phong cách macOS (cửa sổ, thanh bên mờ, nút bấm, bảng kiểu Finder)
   Điện thoại (≤ 900 px): phong cách iOS (tiêu đề lớn, nhóm danh sách, thanh tab, bảng trượt)
   Đổi màu / cỡ chữ: chỉ sửa các biến trong :root
   ===================================================================== */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --green: #2F7A4D;      --green-hi: #3D9A62;   --green-ink: #1E5634;
  --green-soft: #E4F1E7; --green-line: #B9D9C3;
  --brown: #8B5A33;      --brown-hi: #A06C42;   --brown-ink: #6A4123;
  --brown-soft: #F3E9DD; --brown-line: #DEC7AE;
  --cream: #FBF8F3;      --sand: #F4EFE6;
  --red: #CF3B2F;        --red-soft: #FBE9E7;
  --amber: #B97A12;      --amber-soft: #FBF1DC;

  --ink: #1D1D1F;  --ink-2: #3A3A3C;  --muted: #7C7C80;  --faint: #AEAEB2;
  --line: rgba(70, 45, 20, .13);  --line-2: rgba(70, 45, 20, .07);
  --win: #FFFFFF;  --fill: #F6F3EE;  --hover: rgba(70, 45, 20, .05);
  --side: rgba(245, 239, 229, .86);
  --bar: rgba(255, 255, 255, .82);

  --r-win: 12px; --r-box: 10px; --r-ctl: 7px;
  --shadow-win: 0 0 0 .5px rgba(0,0,0,.18), 0 22px 70px rgba(60,40,15,.28), 0 4px 14px rgba(60,40,15,.10);
  --shadow-box: 0 0 0 .5px rgba(0,0,0,.05), 0 1px 2px rgba(60,40,15,.06);
  --shadow-pop: 0 0 0 .5px rgba(0,0,0,.14), 0 18px 50px rgba(40,25,10,.26);

  --fs: 13px; --fs-sm: 12px; --fs-xs: 11px; --fs-lg: 15px;
  --side-w: 252px;
  --band: 46px;    /* chiều cao thanh tên công ty trên cùng */
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: var(--fs)/1.45 var(--font); color: var(--ink); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 700px at 12% 0%, #FBF4E8 0%, rgba(251,244,232,0) 60%),
    radial-gradient(900px 700px at 100% 100%, #CFE0C8 0%, rgba(207,224,200,0) 60%),
    linear-gradient(140deg, #F3ECDF 0%, #E5ECDC 55%, #D2E2CB 100%);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: var(--fs-sm); } .xs { font-size: var(--fs-xs); }
.mono { font-family: var(--mono); font-size: .95em; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.sp { height: 14px; }

/* ---------------------------- Thanh tên công ty (trên cùng mọi trang) ---------------------------- */
.corp { position: fixed; top: 0; left: 0; right: 0; height: var(--band); z-index: 40; display: flex; align-items: center; gap: 10px; padding: 0 18px;
  background: rgba(250, 247, 240, .78); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--line); font-size: 16px; color: var(--ink); white-space: nowrap; overflow: hidden; }
.corp .logo { height: 30px; width: auto; flex: none; }
.corp b { font-weight: 700; color: #2F5F1E; letter-spacing: .01em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; }
.corp-home { display: none; flex: none; width: 32px; height: 32px; border-radius: 8px; place-items: center; color: var(--green); background: rgba(47,122,77,.1); }
.corp-home:hover { background: var(--green); color: #fff; }
.corp-home svg { width: 19px; height: 19px; }
body.mode-staff .corp-home { display: grid; }
.corp-app { margin-left: auto; color: var(--muted); font-size: 13px; }
.login .hero .corp-full { color: var(--green-ink); font-weight: 600; font-size: 13.5px; margin-top: 4px; }

/* ---------------------------- Cửa sổ macOS ---------------------------- */
.win {
  position: fixed; inset: calc(var(--band) + 14px) 14px 14px; display: grid; grid-template-columns: var(--side-w) 1fr;
  background: var(--win); border-radius: var(--r-win); box-shadow: var(--shadow-win); overflow: hidden; overflow: clip; /* clip: không cho trình duyệt tự cuộn khung cửa sổ */
}
.side {
  position: relative; background: var(--side); -webkit-backdrop-filter: saturate(160%) blur(28px); backdrop-filter: saturate(160%) blur(28px);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 46px 10px 12px; overflow-y: auto;
}
.traffic { position: absolute; top: 16px; left: 16px; display: flex; gap: 8px; }
.traffic i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.18); }
.traffic i:nth-child(1) { background: #FF5F57; } .traffic i:nth-child(2) { background: #FEBC2E; } .traffic i:nth-child(3) { background: #28C840; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; }
.brand .appicon { width: 38px; height: 38px; border-radius: 9px; flex: none; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.brand b { display: block; font-size: 14px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: var(--fs-xs); line-height: 1.25; }
.nav-sec { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); padding: 12px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; text-align: left;
  padding: 6px 10px; border-radius: 7px; cursor: default; color: var(--ink); font-size: var(--fs);
}
.nav-item svg { width: 17px; height: 17px; color: var(--green); flex: none; }
.nav-item:hover { background: var(--hover); }
.nav-item.on { background: var(--green); color: #fff; }
.nav-item.on svg { color: #fff; }
.nav-item.sub { padding-left: 30px; font-size: var(--fs); gap: 8px; }
.nav-item.sub svg { width: 14px; height: 14px; opacity: .85; }
.nav-item.sub.on svg { color: var(--green-ink); opacity: 1; }
.nav-item.sub.on { background: rgba(47,122,77,.16); color: var(--green-ink); font-weight: 600; }
.nav-item .chev { margin-left: auto; width: 12px; height: 12px; color: var(--muted); transition: transform .15s; }
.nav-item.on .chev { color: #fff; }
.nav-item.open .chev { transform: rotate(90deg); }
.side-foot { margin-top: auto; padding-top: 12px; }
.me-chip { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 9px; border: 0; background: none; width: 100%; text-align: left; }
.me-chip:hover { background: var(--hover); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 12px; color: #fff;
  background: linear-gradient(160deg, var(--brown-hi), var(--brown)); flex: none; }
.avatar.judge { background: linear-gradient(160deg, var(--green-hi), var(--green)); }
.me-chip b { display: block; font-size: var(--fs); line-height: 1.2; }
.me-chip small { color: var(--muted); font-size: var(--fs-xs); }
.ver { font-size: 10.5px; color: var(--faint); padding: 6px 10px 0; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; overflow: hidden; overflow: clip; }
.bar {
  flex: none; display: flex; align-items: center; gap: 12px; padding: 0 18px 0 22px; height: 54px;
  background: var(--bar); -webkit-backdrop-filter: saturate(170%) blur(20px); backdrop-filter: saturate(170%) blur(20px);
  border-bottom: 1px solid var(--line); position: relative; z-index: 3;
}
.bar .ttl { min-width: 0; }
.bar h1 { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .sub { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.bar .back { display: none; }
.bar .bl:empty { display: none; }
.content { flex: 1; overflow: auto; padding: 22px 26px 40px; outline: none; }
.content .page { max-width: 1280px; margin: 0 auto; }
.boot { display: grid; place-items: center; height: 60vh; }

/* ---------------------------- Điều khiển ---------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 12px;
  border-radius: var(--r-ctl); border: 0; background: #fff; color: var(--ink); font-size: var(--fs); font-weight: 500;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.16), 0 1px 1.5px rgba(0,0,0,.08); cursor: default; white-space: nowrap;
}
.btn:hover { background: #FBFAF8; }
.btn:active { background: #F0EDE8; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 14px; height: 14px; flex: none; }
.btn.primary { background: linear-gradient(180deg, var(--green-hi), var(--green)); color: #fff; box-shadow: 0 0 0 .5px rgba(20,60,35,.5), 0 1px 2px rgba(20,60,35,.25); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.brown { background: linear-gradient(180deg, var(--brown-hi), var(--brown)); color: #fff; box-shadow: 0 0 0 .5px rgba(80,45,15,.5), 0 1px 2px rgba(80,45,15,.25); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; }
.btn.plain { background: none; box-shadow: none; color: var(--green); padding: 0 6px; }
.btn.plain:hover { background: var(--hover); }
.btn.icon { width: 30px; padding: 0; }
.btn.lg { height: 36px; padding: 0 18px; font-size: 14px; border-radius: 9px; }
.btn.block { width: 100%; }

.inp, select.inp, textarea.inp {
  height: 28px; padding: 0 9px; border-radius: 6px; border: 0; background: #fff; width: 100%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.16), inset 0 1px 1px rgba(0,0,0,.04); outline: none; font-size: var(--fs);
}
textarea.inp { height: auto; min-height: 70px; padding: 7px 9px; resize: vertical; line-height: 1.45; }
select.inp { appearance: none; -webkit-appearance: none; padding-right: 26px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M2 5l3-3 3 3M2 9l3 3 3-3' fill='none' stroke='%232F7A4D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center; }
.inp:focus { box-shadow: inset 0 0 0 1px var(--green), 0 0 0 3.5px rgba(47,122,77,.25); }
.inp.lg { height: 36px; font-size: 14px; border-radius: 8px; padding: 0 12px; }
.inp.num { text-align: right; }
.inp.sm { width: 76px; }
.field { display: block; }
.field > span { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
.field > small { display: block; color: var(--muted); font-size: var(--fs-xs); margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }

.switch { position: relative; width: 38px; height: 22px; flex: none; display: inline-block; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: default; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 11px; background: #E3DED6; transition: background .18s; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.08); }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked + i { background: var(--green-hi); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(47,122,77,.3); }

.seg { display: inline-flex; background: #EDE8E0; border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; height: 24px; padding: 0 12px; border-radius: 6px; font-size: var(--fs); color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.06); }
.seg.block { display: flex; } .seg.block button { flex: 1; }

.chk { display: inline-flex; gap: 7px; align-items: center; cursor: default; }
.chk input { width: 15px; height: 15px; accent-color: var(--green); margin: 0; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 10px; font-size: var(--fs-xs); font-weight: 600;
  background: var(--fill); color: var(--ink-2); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green-ink); }
.badge.brown { background: var(--brown-soft); color: var(--brown-ink); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live .dot { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.pass { color: var(--green); font-weight: 600; } .fail { color: var(--red); font-weight: 600; }

/* ---------------------------- Hộp, nhóm cài đặt ---------------------------- */
.box { background: #fff; border-radius: var(--r-box); box-shadow: var(--shadow-box); border: 1px solid var(--line-2); }
.box.pad { padding: 16px 18px; }
.box > h3, .sec-title { font-size: 13px; font-weight: 600; }
.sec-title { margin: 22px 4px 8px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.sec-title:first-child { margin-top: 0; }
.sec-title .tools { margin-left: auto; display: flex; gap: 6px; }
.group { background: #fff; border-radius: var(--r-box); box-shadow: var(--shadow-box); border: 1px solid var(--line-2); overflow: hidden; }
.group + .note, .note { color: var(--muted); font-size: var(--fs-xs); margin: 6px 6px 0; }
.gr { display: flex; align-items: center; gap: 14px; padding: 9px 14px; min-height: 42px; }
.gr + .gr { border-top: 1px solid var(--line-2); }
.gr > .lb { flex: 1; min-width: 0; }
.gr > .lb b { font-weight: 500; display: block; }
.gr > .lb small { display: block; color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.gr > .ct { flex: 0 1 340px; display: flex; justify-content: flex-end; gap: 8px; align-items: center; min-width: 0; }
.gr > .ct .inp { max-width: 340px; }
.gr.link { cursor: default; } .gr.link:hover { background: var(--hover); }
.gr .val { color: var(--muted); }
.gr .chev { width: 8px; height: 13px; color: var(--faint); flex: none; }

.split { display: grid; grid-template-columns: minmax(360px, 38%) minmax(0, 1fr); gap: 18px; align-items: start; }
.split-list .li b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.list { background: #fff; border-radius: var(--r-box); box-shadow: var(--shadow-box); border: 1px solid var(--line-2); overflow: hidden; }
.li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 0; background: none; width: 100%; text-align: left; cursor: default; }
.li + .li { border-top: 1px solid var(--line-2); }
.li:hover { background: var(--hover); }
.li.on { background: var(--green); color: #fff; }
.li.on .muted, .li.on small { color: rgba(255,255,255,.82); }
.li.on .badge { background: rgba(255,255,255,.2); color: #fff; }
.li .ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--green-soft); color: var(--green); }
.li .ic.brown, .hic.brown { background: var(--brown-soft); color: var(--brown); }
.hic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--green-soft); color: var(--green); }
.hic svg { width: 22px; height: 22px; }
.btn.m-keep { display: none; }
.li .ic svg { width: 18px; height: 18px; }
.li.on .ic { background: rgba(255,255,255,.2); color: #fff; }
.li b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty > svg { width: 42px; height: 42px; color: var(--brown-line); display: block; margin: 0 auto 8px; }
.empty b { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }

/* Ô số liệu */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.tile { background: #fff; border-radius: var(--r-box); box-shadow: var(--shadow-box); border: 1px solid var(--line-2); padding: 12px 14px; }
.tile small { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
.tile b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile b em { font-style: normal; font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.tile.green b { color: var(--green); } .tile.brown b { color: var(--brown); } .tile.red b { color: var(--red); } .tile.amber b { color: var(--amber); }
.tile.click { cursor: default; } .tile.click:hover { box-shadow: 0 0 0 1px var(--green-line), var(--shadow-box); }

/* Biểu đồ phổ điểm */
.hist { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; align-items: end; height: 150px; padding: 8px 4px 0; }
.hist .c { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.hist .c i { width: 100%; max-width: 38px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--green-hi), var(--green)); min-height: 2px; }
.hist .c.f i { background: linear-gradient(180deg, #C69A72, var(--brown)); }
.hist .c em { font-style: normal; font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; margin-bottom: 3px; }
.hist-lab { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; font-size: 10.5px; color: var(--muted); text-align: center; padding: 4px 4px 0; }
.legend { display: flex; gap: 14px; font-size: var(--fs-xs); color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------------------------- Bảng kiểu Finder ---------------------------- */
.tblwrap { background: #fff; border-radius: var(--r-box); box-shadow: var(--shadow-box); border: 1px solid var(--line-2); overflow: auto; max-height: calc(100vh - 230px); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs); }
.tbl th { position: sticky; top: 0; z-index: 1; background: #FAF8F4; text-align: left; font-weight: 500; color: var(--muted); font-size: var(--fs-sm);
  padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tbody tr:nth-child(even) td { background: #FCFBF9; }
.tbl tbody tr.click { cursor: default; }
.tbl tbody tr.click:hover td { background: var(--green-soft); }
.tbl tbody tr.sel td { background: #EEF6F0; }
.tbl .r { text-align: right; } .tbl .c { text-align: center; }
.tbl .w { min-width: 260px; }
.tbl td.cb, .tbl th.cb { width: 34px; padding-right: 0; }
.tbl tr.dim td { color: var(--muted); }
.tbl tbody tr.warn-row td { background: #FFF8EC; }
.tbl tbody tr.warn-row.dim td { background: #FBF7F2; }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 4px; color: var(--muted); font-size: var(--fs-xs); }

.toolbar2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search { position: relative; flex: 0 1 260px; }
.search svg { position: absolute; left: 8px; top: 7px; width: 14px; height: 14px; color: var(--muted); }
.search .inp { padding-left: 27px; border-radius: 7px; background: #F1EDE6; box-shadow: none; }
.search .inp:focus { background: #fff; box-shadow: inset 0 0 0 1px var(--green), 0 0 0 3.5px rgba(47,122,77,.2); }

.notice { border-radius: 9px; padding: 10px 12px; background: var(--fill); color: var(--ink-2); font-size: var(--fs); line-height: 1.5; }
.notice.green { background: var(--green-soft); color: var(--green-ink); }
.notice.brown { background: var(--brown-soft); color: var(--brown-ink); }
.notice.red { background: var(--red-soft); color: #9C2A21; }
.notice.amber { background: var(--amber-soft); color: #7A520D; }
.notice b { font-weight: 600; }
.msg:empty { display: none; } .msg { margin-top: 10px; }

/* Chọn câu theo chủ đề */
.topic { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 14px; }
.topic + .topic { border-top: 1px solid var(--line-2); }
.topic .bar2 { height: 4px; background: var(--fill); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.topic .bar2 i { display: block; height: 100%; background: var(--green-hi); border-radius: 2px; }
.stepper { display: inline-flex; align-items: center; border-radius: 7px; box-shadow: 0 0 0 .5px rgba(0,0,0,.18), 0 1px 1px rgba(0,0,0,.06); overflow: hidden; background: #fff; }
.stepper button { border: 0; background: none; width: 26px; height: 26px; color: var(--green); font-size: 16px; line-height: 1; }
.stepper button:active { background: var(--fill); }
.stepper input { width: 48px; height: 26px; border: 0; text-align: center; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); outline: none; font-variant-numeric: tabular-nums; }
.total-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #FAF8F4; border-top: 1px solid var(--line); font-weight: 600; }

/* ---------------------------- Hộp thoại (sheet macOS) ---------------------------- */
#layer > .scrim { position: fixed; inset: 0; z-index: 50; background: rgba(40, 28, 15, .18); display: flex; justify-content: center; align-items: flex-start;
  padding: 60px 16px 16px; animation: fadeIn .15s ease; }
.sheet { background: #FDFCFA; border-radius: 12px; box-shadow: var(--shadow-pop); width: min(560px, 100%); max-height: calc(100vh - 90px);
  display: flex; flex-direction: column; animation: drop .2s cubic-bezier(.2,.9,.3,1.1); }
.sheet.wide { width: min(980px, 100%); } .sheet.mid { width: min(720px, 100%); } .sheet.narrow { width: min(400px, 100%); }
.sheet .sh-head { padding: 16px 20px 6px; display: flex; gap: 10px; align-items: flex-start; }
.sheet .sh-head h2 { font-size: 15px; font-weight: 700; }
.sheet .sh-head p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.sheet .sh-head .x { margin-left: auto; }
.sheet .sh-body { padding: 10px 20px 6px; overflow: auto; }
.sheet .sh-foot { padding: 12px 20px 16px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.sheet .sh-foot .left { margin-right: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.alert { text-align: center; }
.alert .sh-head { flex-direction: column; align-items: center; padding-top: 22px; }
.alert .sh-head .appicon { width: 54px; height: 54px; border-radius: 12px; margin-bottom: 8px; }
.alert .sh-body { padding-top: 0; color: var(--ink-2); }
.alert .sh-foot { justify-content: stretch; } .alert .sh-foot .btn { flex: 1; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }

#toasts { position: fixed; z-index: 80; top: calc(var(--band) + 12px); right: 22px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 260px; max-width: 460px; background: rgba(253,252,250,.96); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-radius: 12px; box-shadow: var(--shadow-pop); padding: 11px 14px 11px 12px; display: flex; gap: 10px; align-items: flex-start; animation: drop .2s ease; font-size: var(--fs); }
.toast .msgtxt { white-space: pre-line; }
.toast .appicon { width: 22px; height: 22px; border-radius: 5px; flex: none; margin-top: 1px; }
.toast b { display: block; }
.toast.err b { color: var(--red); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--green-soft); border-top-color: var(--green); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--muted); padding: 40px; }

/* ---------------------------- Màn hình đăng nhập ---------------------------- */
body.mode-login .win, body.mode-exam .win, body.mode-boot .win { grid-template-columns: 1fr; }
body.mode-login .side, body.mode-exam .side, body.mode-boot .side { display: none; }
body.mode-login .win { background: transparent; box-shadow: none; }
body.mode-login .bar, body.mode-boot .bar { display: none; }
body.mode-login .content { display: grid; place-items: center; padding: 24px 16px; }
.login { width: min(430px, 100%); background: rgba(253, 251, 247, .82); -webkit-backdrop-filter: saturate(170%) blur(30px); backdrop-filter: saturate(170%) blur(30px);
  border-radius: 16px; box-shadow: var(--shadow-win); padding: 30px 30px 24px; position: relative; }
.login .traffic { top: 14px; left: 14px; }
.login .hero { text-align: center; margin: 6px 0 20px; }
.login .hero img { width: 76px; height: 76px; border-radius: 17px; box-shadow: 0 6px 18px rgba(47,122,77,.28); }
.login .hero h1 { font-size: 22px; font-weight: 700; margin-top: 10px; }
.login .hero p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.login .stack > * + * { margin-top: 12px; }
.login .foot { text-align: center; color: var(--faint); font-size: var(--fs-xs); margin-top: 18px; }
.exam-card { border-radius: 10px; background: var(--green-soft); color: var(--green-ink); padding: 10px 12px; font-size: var(--fs-sm); line-height: 1.55; }
.exam-card b { font-size: var(--fs); }
.exam-info { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--green-line); white-space: pre-wrap; color: var(--ink-2); }
.privacy { font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; }
.pw-wrap { position: relative; } .pw-wrap .inp { padding-right: 38px; }
.pw-wrap .eye { position: absolute; right: 4px; top: 0; bottom: 0; margin: auto 0; height: 32px; width: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); }
.pw-wrap .eye svg { width: 17px; height: 17px; }

/* ---------------------------- Làm bài thi ---------------------------- */
body.mode-exam .win { inset: var(--band) 0 0; border-radius: 0; box-shadow: none; background: #FBF8F3; }
body.mode-exam .content { padding: 0; }
body.mode-exam .bar { display: none; }
.alert .sh-head .x { display: none; }
.xhead { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 22px; background: rgba(251,248,243,.9);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.xhead .appicon { width: 30px; height: 30px; border-radius: 7px; }
.xhead b { display: block; font-size: 14px; }
.xhead small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.timer { margin-left: auto; font: 700 20px/1 var(--mono); letter-spacing: .02em; padding: 8px 14px; border-radius: 10px; background: var(--green); color: #fff; font-variant-numeric: tabular-nums; }
.timer.warn { background: var(--brown); } .timer.crit { background: var(--red); animation: pulse 1s infinite; }
.xbody { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; max-width: 1180px; margin: 0 auto; padding: 22px; align-items: start; }
.qcard { background: #fff; border-radius: 12px; box-shadow: var(--shadow-box); border: 1px solid var(--line-2); padding: 16px 18px; scroll-margin-top: 80px; }
.qcard + .qcard { margin-top: 12px; }
.qcard.cur { box-shadow: 0 0 0 2px var(--green-line), var(--shadow-box); }
.qcard .qn { font-size: var(--fs-xs); color: var(--brown); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.qcard .qt { font-size: 15px; font-weight: 500; margin: 6px 0 12px; line-height: 1.55; white-space: pre-wrap; }
.opt { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line); cursor: default; font-size: 14px; line-height: 1.5; }
.opt + .opt { margin-top: 7px; }
.opt:hover { background: var(--cream); }
/* Ô chọn ẩn nằm ngay trong đáp án (không để trình duyệt cuộn sai chỗ khi bấm – lỗi trắng màn hình v1.0.2) */
.opt input { position: absolute; left: 14px; top: 14px; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.opt .k { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none;
  box-shadow: inset 0 0 0 1.5px var(--brown-line); color: var(--brown); margin-top: -1px; }
.opt.on { border-color: var(--green); background: var(--green-soft); }
.opt.on .k { background: var(--green); color: #fff; box-shadow: none; }
.opt input:focus-visible ~ .k { box-shadow: 0 0 0 3px rgba(47,122,77,.35); }
.xside { position: sticky; top: 78px; }
.xside .box { padding: 14px; }
.qnav { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 10px 0 12px; max-height: 46vh; overflow: auto; padding: 2px; }
.qnav button { height: 32px; border-radius: 7px; border: 0; background: var(--fill); font-weight: 600; font-size: 12px; color: var(--ink-2); }
.qnav button.done { background: var(--green); color: #fff; }
.qnav button.cur { box-shadow: 0 0 0 2px var(--brown); }
.progress { height: 6px; background: var(--fill); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green-hi); transition: width .3s; }
.savestate { font-size: var(--fs-xs); color: var(--muted); display: flex; gap: 6px; align-items: center; }
.savestate .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-hi); }
.savestate.pending .dot { background: var(--amber); } .savestate.err .dot { background: var(--red); }
.viol { color: var(--red); font-weight: 600; font-size: var(--fs-sm); }
.xbottom { display: none; }
.fs-block { position: fixed; inset: 0; z-index: 60; background: rgba(251,248,243,.97); display: grid; place-items: center; padding: 20px; text-align: center; }
.fs-block .box { padding: 26px; max-width: 440px; }
.fs-block h2 { color: var(--red); font-size: 18px; margin-bottom: 8px; }
.result { max-width: 520px; margin: 40px auto; text-align: center; padding: 30px 26px; }
.result .score { font-size: 64px; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.result .score small { font-size: 22px; color: var(--muted); font-weight: 600; }
.result .verdict { display: inline-block; padding: 6px 16px; border-radius: 20px; font-weight: 700; margin: 8px 0 14px; }
.result .verdict.ok { background: var(--green-soft); color: var(--green); } .result .verdict.no { background: var(--red-soft); color: var(--red); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; text-align: left; font-size: var(--fs); }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.rv-opt { display: flex; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 14px; }
.rv-opt.good { background: var(--green-soft); } .rv-opt.bad { background: var(--red-soft); } .rv-opt.key { box-shadow: inset 0 0 0 1.5px var(--green); }
.rv-opt .mk { margin-left: auto; font-weight: 700; font-size: 12px; white-space: nowrap; }
.rules { margin: 0; padding-left: 20px; line-height: 1.7; }

.pre { white-space: pre-wrap; }
.date-wrap { display: inline-flex; gap: 6px; align-items: center; position: relative; }
.date-wrap .inp { width: 130px; font-variant-numeric: tabular-nums; }
.date-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.tbl tbody tr.viol-row td { background: #FDF2EF; }
.cd-tabs { max-width: 560px; }
.qtext { white-space: pre-wrap; max-width: 520px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 26px; padding: 0 11px; border-radius: 13px; border: 0; background: var(--fill); font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; }
.chip.on { background: var(--green); color: #fff; }
.chip em { font-style: normal; opacity: .7; margin-left: 4px; }
.pwbox { font: 600 16px var(--mono); background: var(--fill); border-radius: 8px; padding: 10px 12px; letter-spacing: .04em; user-select: all; }

/* ---------------------------- Tab bar (chỉ điện thoại) ---------------------------- */
.tabbar { display: none; }
.m-only { display: none !important; }

/* =====================================================================
   ĐIỆN THOẠI — phong cách iOS
   ===================================================================== */
@media (max-width: 900px) {
  :root { --band: 38px; --fs: 15px; --fs-sm: 13px; --fs-xs: 12px; --r-box: 12px; }
  body { background: #F2F1EC; }
  .m-only { display: revert !important; }
  .d-only { display: none !important; }
  .win, body.mode-exam .win { position: static; inset: auto; display: block; border-radius: 0; box-shadow: none; background: transparent; min-height: 100%; }
  .side { display: none; }
  .main { min-height: 100vh; }
  /* Thanh tên công ty và tiêu đề: cố định, cùng chiều cao ở mọi trang */
  .corp { height: calc(env(safe-area-inset-top) + var(--band)); padding: env(safe-area-inset-top) 10px 0; justify-content: center; gap: 7px; font-size: 12.5px; background: rgba(242,241,236,.96); }
  .corp .logo { height: 24px; }
  .corp-home { width: 28px; height: 28px; } .corp-home svg { width: 17px; height: 17px; }
  .corp-app { display: none; }
  .bar { position: fixed; top: calc(env(safe-area-inset-top) + var(--band)); left: 0; right: 0; z-index: 20; height: 52px; padding: 0 8px; gap: 4px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr) minmax(0, 1fr); align-items: center;
    background: rgba(242,241,236,.94); border-bottom: .5px solid rgba(0,0,0,.14); }
  .bar .bl { display: flex !important; justify-self: start; min-width: 0; }
  .bar .ttl { text-align: center; min-width: 0; }
  .bar h1 { font-size: 16px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
  .bar .sub { font-size: 11px; line-height: 1.3; }
  .bar .tools { justify-self: end; margin-left: 0; gap: 2px; }
  .bar .back { display: inline-flex; padding: 0 4px; height: 32px; font-size: 15px; gap: 2px; }
  .bar .back svg { width: 20px; height: 20px; }
  .bar .back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .main { padding-top: calc(env(safe-area-inset-top) + var(--band) + 52px); }
  body.mode-login .main, body.mode-exam .main, body.mode-boot .main { padding-top: calc(env(safe-area-inset-top) + var(--band)); }
  .bar .tools .btn:not(.keep) { display: none; }
  .bar .tools .btn.keep { background: none; box-shadow: none; color: var(--green); font-weight: 600; font-size: 16px; padding: 0 4px; height: 32px; }
  .bar .tools .btn.keep svg { width: 20px; height: 20px; }
  .content { overflow: visible; padding: 12px 16px calc(96px + env(safe-area-inset-bottom)); }
  body.mode-login .content { min-height: 100vh; }
  .login { padding: 26px 20px 20px; background: rgba(255,255,255,.86); }
  .login .traffic { display: none; }

  .btn { height: 36px; border-radius: 10px; font-size: 15px; padding: 0 14px; }
  .btn.lg { height: 50px; border-radius: 13px; font-size: 17px; font-weight: 600; }
  .inp, select.inp { height: 40px; border-radius: 10px; font-size: 16px; padding: 0 12px; }
  select.inp { padding-right: 30px; }
  .inp.lg { height: 48px; border-radius: 12px; font-size: 17px; }
  .inp.sm { width: 84px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .seg { border-radius: 9px; } .seg button { height: 30px; font-size: 13px; padding: 0 10px; }
  .switch { width: 51px; height: 31px; } .switch i { border-radius: 16px; }
  .switch i::after { width: 27px; height: 27px; } .switch input:checked + i::after { transform: translateX(20px); }
  .stepper button { width: 36px; height: 34px; font-size: 20px; } .stepper input { height: 34px; width: 52px; font-size: 16px; }

  .split { display: block; }
  .split > .split-detail { display: none; }
  .split.detail > .split-list { display: none; }
  .split.detail > .split-detail { display: block; }

  .group, .list, .box, .tile, .tblwrap { border: 0; box-shadow: none; }
  .gr { padding: 11px 16px; min-height: 48px; flex-wrap: wrap; }
  .gr + .gr { border-top: 0; box-shadow: inset 16px 0 0 #fff, inset 0 .5px 0 rgba(0,0,0,.12); }
  .gr > .ct { flex: 1 1 100%; justify-content: flex-start; }
  .gr > .ct:has(.switch), .gr > .ct.inl { flex: 0 0 auto; }
  .gr > .ct .inp { max-width: none; }
  .li { padding: 11px 16px; }
  .li + .li { border-top: 0; box-shadow: inset 62px 0 0 #fff, inset 0 .5px 0 rgba(0,0,0,.12); }
  .bar .tools .btn.m-keep { display: inline-flex; }
  .li.on .badge { background: var(--fill); color: var(--ink-2); } .li.on .badge.green { background: var(--green-soft); color: var(--green-ink); }
  .li.on { background: #fff; color: inherit; } .li.on .muted, .li.on small { color: var(--muted); } .li.on .ic { background: var(--green-soft); color: var(--green); }
  .li::after { content: ""; width: 8px; height: 8px; border-right: 2px solid #C7C7CC; border-top: 2px solid #C7C7CC; transform: rotate(45deg); flex: none; margin-left: 4px; }
  .sec-title { margin: 22px 16px 7px; font-size: 13px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile b { font-size: 26px; }
  .toolbar2 .search { flex: 1 1 100%; }
  .search .inp { height: 36px; background: rgba(118,118,128,.12); border-radius: 10px; }
  .search svg { top: 11px; }
  .hist { height: 120px; gap: 3px; } .hist-lab { gap: 3px; font-size: 9.5px; }

  /* Bảng → danh sách iOS */
  .tblwrap { max-height: none; overflow: visible; background: transparent; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl thead { display: none; }
  .tbl tbody tr { background: #fff; padding: 11px 16px; position: relative; }
  .tbl tbody tr:first-child { border-radius: 12px 12px 0 0; } .tbl tbody tr:last-child { border-radius: 0 0 12px 12px; }
  .tbl tbody tr:only-child { border-radius: 12px; }
  .tbl tbody tr + tr { box-shadow: inset 16px 0 0 #fff, inset 0 .5px 0 rgba(0,0,0,.12); }
  .tbl tbody tr.click { padding-right: 34px; }
  .tbl tbody tr.click::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -5px;
    border-right: 2px solid #C7C7CC; border-top: 2px solid #C7C7CC; transform: rotate(45deg); }
  .tbl tbody tr:nth-child(even) td, .tbl tbody tr.click:hover td { background: none; }
  .tbl td { padding: 0; border: 0; text-align: left !important; }
  .tbl td.m-h { display: none; }
  .tbl td.m-p { font-weight: 600; font-size: 16px; }
  .tbl td.m-s { display: inline; color: var(--muted); font-size: 13px; }
  .tbl td.m-s + td.m-s::before { content: " · "; }
  .tbl td.m-r { position: absolute; right: 36px; top: 11px; text-align: right; }
  .tbl td.cb { position: absolute; left: -2px; top: 13px; } .tbl tr.has-cb { padding-left: 44px; }
  .tbl td.m-l { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
  .tbl td.m-l::before { content: attr(data-l) ": "; color: var(--muted); }
  .tbl tr.has-r td.m-p { padding-right: 70px; }

  /* Hộp thoại → bảng trượt từ dưới lên */
  #layer > .scrim { align-items: flex-end; padding: 0; background: rgba(0,0,0,.28); }
  .sheet, .sheet.wide, .sheet.mid, .sheet.narrow { width: 100%; border-radius: 14px 14px 0 0; max-height: 92vh; animation: up .28s cubic-bezier(.2,.9,.3,1); background: #F2F1EC; padding-bottom: env(safe-area-inset-bottom); }
  .sheet .sh-head { padding: 10px 16px 4px; position: relative; }
  .sheet .sh-head::before { content: ""; position: absolute; top: 5px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: rgba(0,0,0,.18); }
  .sheet .sh-head h2 { font-size: 17px; margin-top: 10px; }
  .sheet .sh-body { padding: 8px 16px; }
  .sheet .sh-foot { padding: 10px 16px 14px; }
  .sheet .sh-foot .btn, .sheet .sh-foot .left { flex: 1 1 100%; } .sheet .sh-foot .left .btn { flex: 1; }
  .alert { width: min(300px, calc(100% - 40px)) !important; border-radius: 14px !important; margin: auto; align-self: center; animation: drop .2s ease !important; background: rgba(250,250,248,.97) !important; }
  #layer > .scrim:has(.alert) { align-items: center; }
  #toasts { top: calc(env(safe-area-inset-top) + var(--band) + 8px); left: 12px; right: 12px; align-items: stretch; }
  .toast { max-width: none; border-radius: 16px; }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(250,249,246,.9);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid rgba(0,0,0,.15);
    padding: 6px 4px calc(env(safe-area-inset-bottom) + 4px); }
  body.mode-login .tabbar, body.mode-exam .tabbar, body.mode-boot .tabbar { display: none; }
  .tabbar button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 500; color: #8E8E93; padding: 2px 0; }
  .tabbar svg { width: 25px; height: 25px; }
  .tabbar button.on { color: var(--green); }

  /* Làm bài trên điện thoại */
  .xhead { top: calc(env(safe-area-inset-top) + var(--band)); padding: 8px 14px; }
  .date-wrap .inp { width: 150px; }
  .xhead .appicon { display: none; }
  .timer { font-size: 17px; padding: 7px 10px; }
  .xbody { display: block; padding: 12px 12px 110px; }
  .xside { display: none; }
  .qcard { padding: 14px; border-radius: 14px; }
  .qcard .qt { font-size: 16px; }
  .opt { padding: 12px; font-size: 16px; border-radius: 12px; }
  .xbottom { display: flex; gap: 10px; align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 10px 14px calc(env(safe-area-inset-bottom) + 10px);
    background: rgba(250,249,246,.94); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-top: .5px solid rgba(0,0,0,.15); }
  .xbottom .btn { height: 44px; border-radius: 12px; font-size: 16px; }
  .qnav { grid-template-columns: repeat(6, 1fr); max-height: 50vh; }
  .qnav button { height: 42px; font-size: 14px; }
  .result { margin: 10px auto; }
}
@media (max-width: 400px) { .corp { font-size: 11px; gap: 5px; } .corp .logo { height: 20px; } }
@media (max-width: 380px) { .tiles { grid-template-columns: 1fr 1fr; } .tile b { font-size: 22px; } }
@media (min-width: 1500px) { .win { inset: calc(var(--band) + 18px) 40px 22px; } body.mode-exam .win { inset: var(--band) 0 0; } }
@media print { body { background: #fff; } .side, .bar, .tabbar { display: none; } .win { position: static; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* v1.0.5: nhiều ngân hàng trong 1 loại đề; ô bắt buộc */
.req { color: var(--red, #c0392b); font-weight: 600; }
.part + .part { border-top: 1px dashed var(--line); }
.part .gr .ct { display: flex; gap: 8px; align-items: center; }
.part .gr .ct select { flex: 1; min-width: 0; }
.total-line.part-total { font-size: 13px; }
.total-line.type-total { border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .total-line.part-total, .total-line.type-total { flex-wrap: wrap; gap: 8px; }
  .total-line.part-total > span:first-child, .total-line.type-total > span:first-child { flex: 1 0 100%; }
}

/* v1.0.6 */
.terms-link { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; padding: 4px 10px 6px 52px; color: var(--green-ink); font: inherit; font-size: var(--fs-xs); text-align: left; cursor: pointer; }
.terms-link svg { width: 13px; height: 13px; flex: none; }
.terms-link:hover span, .terms-link.on span { text-decoration: underline; }
.sumwrap { background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-box); box-shadow: var(--shadow-box); overflow-x: auto; }
.sumtbl { width: 100%; border-collapse: collapse; font-size: var(--fs); min-width: 520px; }
.sumtbl th { background: #FAF8F4; color: var(--muted); font-weight: 500; font-size: var(--fs-sm); text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.sumtbl td { padding: 7px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.sumtbl td[rowspan] { border-right: 1px solid var(--line-2); }
.sumtbl tr.grp td { border-top: 1px solid var(--line); }
.sumtbl td.ty .num { color: var(--green-ink); font-weight: 600; }
.sumtbl tfoot td { background: #FAF8F4; font-weight: 600; }
.sumtbl .r { text-align: right; }
.terms-doc { background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-box); box-shadow: var(--shadow-box); padding: 22px 28px; line-height: 1.6; max-width: 920px; }
.terms-doc h1 { font-size: 20px; margin: 0 0 12px; } .terms-doc h2 { font-size: 16px; margin: 22px 0 8px; color: var(--green-ink); } .terms-doc h3 { font-size: 14.5px; margin: 16px 0 6px; }
.terms-doc p { margin: 6px 0; } .terms-doc ol, .terms-doc ul { margin: 6px 0; padding-left: 24px; } .terms-doc li { margin: 3px 0; }
.terms-doc table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: var(--fs); } .terms-doc th, .terms-doc td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.terms-doc th { background: #FAF8F4; font-weight: 600; }
.terms-agree { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 12px 16px; background: var(--green-soft); border: 1px solid rgba(47,122,77,.25); border-radius: var(--r-box); max-width: 920px; }
.dt-wrap .inp { width: 160px; }
@media (max-width: 760px) {
  .terms-doc { padding: 16px; border-radius: 12px; }
  .terms-doc table, .terms-doc tbody, .terms-doc tr, .terms-doc td, .terms-doc th { display: block; border: 0; padding: 2px 0; }
  .terms-doc thead { display: none; } .terms-doc tr { border-bottom: 1px solid var(--line-2); padding: 6px 0; } .terms-doc td:first-child { font-weight: 600; }
  .terms-agree { bottom: calc(var(--tabbar, 64px) + 8px); }
}
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--green-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.lg-filter { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; }
.lg-filter .lf { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); color: var(--muted); min-width: 0; }
.lg-filter .lf .inp, .lg-filter .lf select { width: 100%; }
.lg-filter .date-wrap { display: flex; gap: 6px; } .lg-filter .date-wrap .inp { flex: 1; min-width: 0; }

/* v1.0.6: Cấu hình kỳ thi / Cấu hình đề thi / Ngân hàng đề thi — rộng hết khung, ít lề hai bên */
.content.wide { padding-left: 14px; padding-right: 14px; }
.content.wide .page { max-width: none; }
.content.wide .split { grid-template-columns: minmax(340px, 28%) minmax(0, 1fr); gap: 14px; }
@media (max-width: 760px) { .content.wide { padding-left: 16px; padding-right: 16px; } }
