/* Màu và bo góc lấy theo trang công khai của Hoàng Hà. --ngoc chỉ trang trí: chữ trắng trên đó không đủ tương phản. */
:root { --nen:#f4f4f4; --mat:#fff; --muc:#042520; --xam:#52625e; --vien:#d5dedb; --vien-dam:#74857f; --chinh:#02664c; --ngoc:#009981; --nhat:#eefff7; --ben:#c4dbd5; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
#man-che { display:none; }
body { margin:0; height:100dvh; display:grid; grid-template-rows:minmax(0,1fr); grid-template-columns:252px minmax(0,1fr); background:var(--nen); color:var(--muc); font:16px/1.5 Inter,"Segoe UI",Roboto,system-ui,sans-serif; }
h1,h2,h3,p,ul,ol { margin:0; padding:0; }
h1 { font-size:24px; line-height:1.25; }
h2 { font-size:18px; line-height:1.35; }
h3 { font-size:15px; font-weight:500; color:var(--xam); }
a { color:inherit; }
button,input { font:inherit; }
ul,ol { list-style:none; }
svg { display:block; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
:focus-visible { outline:3px solid var(--ngoc); outline-offset:2px; }
main:focus { outline:none; }

.ben { display:flex; flex-direction:column; overflow:auto; padding:24px 12px 16px; background:var(--muc); color:var(--ben); }
.ten { padding:0 12px 16px; color:#fff; text-decoration:none; }
.ten span { display:block; margin-top:4px; font-size:15px; color:var(--ben); }
.ten { display:flex; flex-wrap:wrap; align-items:center; gap:0 12px; }
.ten span { width:100%; }
.dau { width:52px; height:auto; flex:none; }
header .dau { display:none; }
.logo { width:124px; height:auto; stroke-width:9; }
nav { flex:1; }
nav p { padding:16px 12px 4px; font-size:15px; color:#93b5ad; }
nav a { display:flex; align-items:center; gap:12px; min-height:44px; padding:8px 12px; border-radius:8px; text-decoration:none; }
nav svg { width:20px; height:20px; flex:none; }
nav a:hover { background:#0b3a32; }
nav a[aria-current] { background:var(--chinh); color:#fff; font-weight:600; }
.ben :focus-visible { outline-color:#fff; outline-offset:-3px; }
.ban { padding:16px 12px 0; font-size:15px; }

.app { min-width:0; min-height:0; display:flex; flex-direction:column; }
header { display:flex; align-items:center; gap:12px; padding:16px 24px; background:var(--mat); border-bottom:1px solid var(--vien); }
header h1 { flex:1; min-width:0; }
.chip { padding:4px 12px; border-radius:20px; background:var(--nhat); border:1px solid var(--vien); color:var(--chinh); font-size:15px; }
#nut-menu { display:none; width:48px; padding:11px; }
main { flex:1; min-height:0; overflow:auto; padding:24px; }
.the { min-width:0; padding:20px; background:var(--mat); border:1px solid var(--vien); border-radius:10px; }
.phu { color:var(--xam); font-size:15px; }
.so { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:16px; }
.so.ba { grid-template-columns:repeat(3,minmax(0,1fr)); }
.so b { display:block; font-size:32px; line-height:1.4; }
small { font-size:15px; color:var(--xam); }
.di { text-decoration:none; }
.di:hover { border-color:var(--ngoc); background:var(--nhat); }
.luoi { display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:16px; }
.bieu-do { display:flex; flex-direction:column; }
.cot { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
.cot li { display:grid; gap:4px; border:0; text-align:center; }
.cot div { height:180px; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; border-bottom:1px solid var(--vien-dam); }
.cot i { width:min(40px,100%); border-radius:4px 4px 0 0; background:var(--chinh); }
.lua-chon { display:grid; gap:8px; }
.dap-an { display:flex; gap:12px; align-items:center; }
.dap-an input:last-child { flex:1; min-width:0; }
.dap-an input[type=radio] { flex:none; width:28px; height:28px; accent-color:var(--chinh); }
.cau-soan textarea { min-height:88px; }
.lua-chon button { text-align:left; font-weight:500; }
.gap-hola { display:grid; justify-items:center; gap:8px; text-align:center; }
.gap-hola .nut { width:100%; }
.nv { position:relative; width:100%; max-width:240px; aspect-ratio:1213/1297; margin-bottom:52px; }
.nv img,.nv canvas { position:absolute; inset:0; width:100%; height:100%; }
.nv.co-3d img { visibility:hidden; }
.nv::before { content:''; position:absolute; left:18%; right:22%; bottom:1%; height:9%; border-radius:50%; background:radial-gradient(closest-side,#02664c47,transparent); }
.nut-dong { position:absolute; left:50%; top:100%; transform:translateX(-50%); min-height:44px; margin-top:4px; padding:4px 12px; font-size:15px; white-space:nowrap; }

progress { appearance:none; width:100%; height:8px; margin:8px 0; border:0; border-radius:5px; overflow:hidden; background:var(--vien); }
progress::-webkit-progress-bar { background:var(--vien); }
progress::-webkit-progress-value { background:var(--chinh); }
progress::-moz-progress-bar { background:var(--chinh); }
li,li a { display:flex; justify-content:space-between; align-items:center; gap:16px; }
li a { flex:1; min-height:44px; text-decoration:none; }
li { border-top:1px solid var(--vien); }
ol { margin-top:16px; }
ol li { min-height:56px; }
li b { font-weight:500; }
li span { flex:none; font-size:15px; color:var(--xam); }
li a:hover,li .xong { color:var(--chinh); }
li .xong,li .dang { font-weight:700; }

button,.nut { min-height:48px; padding:10px 16px; border:1px solid var(--chinh); border-radius:8px; background:var(--mat); color:var(--chinh); text-align:center; font-weight:600; text-decoration:none; cursor:pointer; }
button:hover,.nut:hover { background:var(--nhat); }
.chinh,[aria-pressed=true] { background:var(--chinh); color:#fff; }
.chinh:hover,[aria-pressed=true]:hover { background:var(--muc); }
button:disabled,input:disabled { background:var(--nen); color:var(--xam); border-color:var(--vien); cursor:not-allowed; opacity:1; }
input[type=range] { width:100%; min-height:48px; accent-color:var(--chinh); }
input:not([type=radio],[type=checkbox],[type=range]) { min-width:0; width:100%; min-height:48px; padding:0 14px; border:1px solid var(--vien-dam); border-radius:8px; }
input::placeholder { color:var(--xam); opacity:1; }
label { display:grid; gap:4px; }

section.studio { height:100%; min-height:560px; display:grid; grid-template-columns:minmax(260px,38%) minmax(0,1fr); gap:16px; }
.san { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; text-align:center; background:linear-gradient(var(--nhat),#d5efe8); }
.san .nv { max-width:440px; flex:none; }
.mic { width:100%; min-height:64px; margin-top:16px; display:flex; align-items:center; justify-content:center; gap:12px; border-radius:32px; }
.mic { touch-action:none; user-select:none; -webkit-user-select:none; }
.mic.ghi { background:var(--chinh); color:#fff; }
.mic svg { width:24px; height:24px; }
.chat { display:flex; flex-direction:column; padding:0; overflow:hidden; }
.che-do { display:flex; flex-wrap:wrap; gap:8px; padding:16px; border-bottom:1px solid var(--vien); }
.tin { flex:1; min-height:0; overflow:auto; padding:16px; display:flex; flex-direction:column; gap:16px; }
.bong { max-width:88%; padding:12px 16px; border:1px solid var(--vien); border-radius:5px 10px 10px 10px; background:var(--nen); align-self:flex-start; }
.bong.toi { align-self:flex-end; border-radius:10px 5px 10px 10px; background:var(--chinh); color:#fff; }
.hoi-dap { display:flex; flex-direction:column; gap:16px; }
main { overflow-wrap:anywhere; }
td { min-width:88px; }
fieldset,.the > *,.ds > *,.bai,.luoi > *,.hep,.hep > *,.chon span { min-width:0; }
select { width:100%; min-width:0; }
dialog { width:min(420px,calc(100vw - 32px)); padding:16px; border:1px solid var(--vien-dam); border-radius:8px; background:var(--mat); color:var(--muc); }
#goi-y button,#goi-y .nut { max-width:100%; }
.bong .nut { display:inline-flex; align-items:center; max-width:100%; margin-top:4px; }
/* Danh sách tài liệu gợi ý: tiêu đề riêng, tách khỏi ô nhập và nút Gửi. */
.goi-y-tieu { flex-basis:100%; }
#goi-y:has(.goi-y-tieu) { padding-bottom:12px; border-bottom:1px dashed var(--vien); margin-bottom:16px; }
.nghe { margin-top:8px; } .nghe .loi:empty { display:none; }
.bong p + p { margin-top:8px; }
.nguon { margin:8px 0; padding-top:8px; border-top:1px solid var(--vien); font-size:15px; }
.hang { display:flex; gap:8px; }
.xuong { flex-wrap:wrap; margin-bottom:12px; }
.xuong > * { font-size:15px; font-weight:500; }
.nhap { padding:16px; border-top:1px solid var(--vien); }

.hep { max-width:560px; display:grid; gap:16px; }
fieldset { margin:0; padding:0; border:0; display:grid; gap:8px; }
legend { font-size:20px; font-weight:700; margin-bottom:12px; }
.chon { display:flex; align-items:center; gap:12px; min-height:56px; padding:8px 16px; border:1px solid var(--vien-dam); border-radius:8px; cursor:pointer; }
.chon:has(:checked) { border-color:var(--chinh); background:var(--nhat); }
.chon input { width:22px; height:22px; accent-color:var(--chinh); }
.chon b { margin-left:auto; flex:none; font-size:15px; color:var(--chinh); }
.chon:has(:disabled) { cursor:default; }
.chon.sai { border-color:#a3261b; background:#fdf1f0; }
.chon.sai b { color:#a3261b; }
.loi-giai { padding:12px 16px; border-left:4px solid var(--chinh); border-radius:8px; background:var(--nhat); }
.loi-giai.sai { border-color:#a3261b; background:#fdf1f0; }
.cuon { overflow:auto; padding:0; }
/* main cho ngắt chữ ở bất kỳ đâu; trong bảng chỉ ngắt ở khoảng trắng để ngày không gãy giữa số. */
.cuon th,.cuon td { overflow-wrap:normal; }
/* Bóng mờ ở cạnh còn nội dung để kéo ngang: hai lớp phủ trắng (local) che bóng khi đã cuộn tới mép. */
.cuon { background-image:linear-gradient(to right,var(--mat),transparent),linear-gradient(to left,var(--mat),transparent),radial-gradient(farthest-side at 0 50%,#0004,transparent),radial-gradient(farthest-side at 100% 50%,#0004,transparent); background-repeat:no-repeat; background-position:left,right,left,right; background-size:32px 100%,32px 100%,12px 100%,12px 100%; background-attachment:local,local,scroll,scroll; }
table { width:100%; border-collapse:collapse; text-align:left; }
th,td { padding:16px; }
th { background:var(--nen); border-bottom:1px solid var(--vien); font-size:15px; white-space:nowrap; }
.trong { padding:56px 16px; text-align:center; color:var(--xam); }

.cua { min-height:100%; display:grid; place-items:center; }
.cua .the { width:100%; max-width:420px; padding:28px; }
.chua-vao { grid-template-columns:minmax(0,1fr); }
.chua-vao :is(.ben,#nut-menu) { display:none; }
.chua-vao header .dau { display:block; width:34px; }
select { min-height:48px; padding:0 14px; border:1px solid var(--vien-dam); border-radius:8px; background:var(--mat); color:var(--muc); font:inherit; }
.loi:empty { display:none; }
.loi { color:#a3261b; font-weight:600; }
.luu-y { margin-bottom:16px; }
.canh-bao { border-color:#a3261b; border-left-width:4px; font-weight:600; }
.luoi.hai { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
.luoi .hep { max-width:none; }
.muc { margin:24px 0 8px; }
#mat-khau-tam b { display:block; padding:12px; font:700 22px/1.4 Consolas,monospace; overflow-wrap:anywhere; user-select:all; }
td .hang button { min-height:44px; padding:6px 12px; font-size:15px; white-space:nowrap; }
td { border-top:1px solid var(--vien); }
.toi-khung { display:grid; gap:8px; padding:16px 12px 0; }
.toi-khung a { min-height:44px; display:flex; align-items:center; }
.loc { display:grid; grid-template-columns:minmax(0,1fr) 240px; gap:16px; margin-bottom:16px; }
textarea { width:100%; min-height:160px; padding:12px 14px; border:1px solid var(--vien-dam); border-radius:8px; background:var(--mat); color:var(--muc); font:inherit; resize:vertical; }
.rong { max-width:760px; }
legend.nho { font-size:16px; font-weight:400; margin-bottom:4px; }
.bai { display:grid; gap:8px; margin-bottom:12px; }
.noi-dung { white-space:pre-wrap; overflow-wrap:anywhere; }
.tot { color:var(--chinh); font-weight:700; }
.ds article { display:grid; gap:12px; }
details.the > :is(button,form) { margin:0 0 16px; }
summary b { overflow-wrap:anywhere; }
.ds { display:grid; gap:12px; margin-top:12px; }
details.the { padding:0 20px; }
summary { display:flex; flex-wrap:wrap; align-items:center; gap:4px 16px; min-height:56px; padding:12px 0; cursor:pointer; }
summary b { flex:1; min-width:180px; }
summary::after { content:'+'; font-size:22px; color:var(--chinh); }
details[open] > summary::after { content:'−'; }
summary::-webkit-details-marker { display:none; }
details.the > p { margin-bottom:8px; }
details.the > .nguon { margin:12px 0 16px; }
@media (max-width:1080px) {
  .so { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:860px) {
  body { grid-template-columns:minmax(0,1fr); }
  .ben { position:fixed; inset:0 auto 0 0; z-index:2; width:min(284px,86vw); visibility:hidden; transform:translateX(-100%); transition:transform .2s,visibility .2s; }
  .mo-menu .ben { visibility:visible; transform:none; }
  .mo-menu #man-che { display:block; position:fixed; inset:0; z-index:1; background:#042520aa; }
  #nut-menu { display:block; flex:none; }
  .mo-menu #nut-menu { position:relative; z-index:3; }
  header .dau { display:block; width:34px; }
  header { padding:8px 16px; }
  header h1 { font-size:20px; }
  header .nut { display:none; }
  .chip { font-size:15px; max-width:108px; padding:4px 10px; line-height:1.25; border-radius:8px; }
  main { padding:16px; }
  .luoi,.luoi.hai,.so.ba,.loc,section.studio { grid-template-columns:minmax(0,1fr); }
  .gap-hola { order:-1; }
  section.studio { height:auto; }
  .san .nv { max-width:320px; }
}
@media (max-width:420px) { .the { padding:16px; } .chat,.cuon { padding:0; } .cuon th,.cuon td { padding:12px 8px; font-size:15px; } }
@media (prefers-reduced-motion:reduce) { html:not([data-dong=bat]) * { animation:none !important; transition:none !important; } }
/* In phiếu mật khẩu tạm: chỉ in phiếu, bỏ menu và phần còn lại của màn. */
@media print {
  body.in-phieu { display:block; height:auto; background:#fff; color:#000; }
  body.in-phieu .ben, body.in-phieu header, body.in-phieu #man-che, body.in-phieu main > section > :not(#phieu-nhap), body.in-phieu .khong-in { display:none !important; }
  body.in-phieu .app, body.in-phieu main { overflow:visible; padding:0; }
  body.in-phieu #phieu-nhap, body.in-phieu #phieu-nhap * { background:#fff !important; color:#000 !important; box-shadow:none !important; }
  body.in-phieu #phieu-nhap tr { break-inside:avoid; }
  body.in-phieu #phieu-nhap td b { font-family:ui-monospace, Consolas, monospace; }
  body.in-phieu #phieu-nhap td { padding:12px 8px; border-bottom:1px dashed #000; }
}
#ds-cua-hang select { width:auto; min-width:11em; }

a.nut { display:inline-block; line-height:1.4; }
