:root {
  --nen: #0d0d0d;
  --the: #171717;
  --the-2: #202020;
  --vien: #2e2e2e;
  --vang: #f5e900;
  --chu: #f2f2f2;
  --chu-mo: #9a9a9a;
  --do: #ff4d4d;
  --xanh: #35d07f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--nen); color: var(--chu); }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px; line-height: 1.45;
  padding: 0 0 env(safe-area-inset-bottom);
}
#goc { max-width: 620px; margin: 0 auto; padding: 16px 14px 64px; }

h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
.mo { color: var(--chu-mo); }
.nho { font-size: 13px; }

/* ---- dau trang ---- */
.dau { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.dau h1 { font-size: 20px; font-weight: 900; text-transform: uppercase; color: var(--vang); }
.dau .ngay-nay { font-size: 13px; color: var(--chu-mo); }

/* ---- bang bao hom nay ---- */
.bang-hom-nay {
  background: var(--vang); color: #0d0d0d; border-radius: 16px;
  padding: 14px 16px; margin-bottom: 14px;
}
.bang-hom-nay.nghi { background: var(--the); color: var(--chu); border: 1px solid var(--vien); }
.bang-hom-nay .nhan { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.bang-hom-nay .to { font-size: 26px; font-weight: 900; text-transform: uppercase; line-height: 1.1; margin-top: 2px; }
.bang-hom-nay .phu { font-size: 14px; font-weight: 600; margin-top: 2px; }

/* ---- dai thu trong tuan ---- */
.tuan { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.o-thu {
  background: var(--the); border: 1px solid var(--vien); border-radius: 12px;
  padding: 8px 2px; text-align: center; cursor: pointer; color: var(--chu);
  font: inherit; line-height: 1.2;
}
.o-thu .t { font-size: 12px; font-weight: 700; color: var(--chu-mo); }
.o-thu .d { font-size: 15px; font-weight: 900; margin-top: 3px; }
.o-thu.nghi .d { color: #5a5a5a; font-weight: 700; }
.o-thu.chon { border-color: var(--vang); background: #262300; }
.o-thu.chon .d { color: var(--vang); }
.o-thu.nay { box-shadow: inset 0 0 0 1px var(--vang); }

/* ---- thanh dieu huong ngay ---- */
.dieu-huong { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.dieu-huong input[type=date] {
  flex: 1; background: var(--the); color: var(--chu); border: 1px solid var(--vien);
  border-radius: 10px; padding: 9px 10px; font: inherit;
}
.nut {
  background: var(--the-2); color: var(--chu); border: 1px solid var(--vien);
  border-radius: 10px; padding: 9px 12px; font: inherit; font-weight: 700; cursor: pointer;
}
.nut.chinh { background: var(--vang); color: #0d0d0d; border-color: var(--vang); }
.nut:active { transform: scale(.97); }

/* ---- the bai tap ---- */
.bai {
  background: var(--the); border: 1px solid var(--vien); border-radius: 16px;
  padding: 12px 14px; margin-bottom: 10px;
}
.bai-dau { display: flex; align-items: flex-start; gap: 12px; }
.bai-chu { flex: 1; min-width: 0; }
img.hinh {
  width: 78px; height: 78px; object-fit: contain; flex-shrink: 0;
  background: #0a0a0a; border: 1px solid var(--vien); border-radius: 12px; padding: 3px; cursor: zoom-in;
}
.hop-ls img.hinh { width: 110px; height: 110px; display: block; margin: 0 auto 8px; }
.lop-phu.hinh-to { align-items: center; padding: 20px; }
.hop-hinh { background: var(--the); border: 1px solid var(--vien); border-radius: 18px; padding: 16px; text-align: center; max-width: 420px; }
.hop-hinh img { width: 100%; max-width: 340px; height: auto; }
.bai-ten { font-size: 17px; font-weight: 800; }
.bai-so { color: var(--vang); font-weight: 800; font-size: 14px; margin-top: 1px; }
.bai-truoc { font-size: 12px; color: var(--chu-mo); margin-top: 6px; }
.bai-truoc b { color: #cfcfcf; font-weight: 700; }
.nut-ls { background: none; border: none; color: var(--chu-mo); font: inherit; font-size: 12px;
  text-decoration: underline; cursor: pointer; padding: 2px 0; white-space: nowrap; }

.hang-set { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.hang-set .stt { width: 26px; font-size: 12px; font-weight: 800; color: var(--chu-mo); }
.o-nhap { position: relative; flex: 1; }
.o-nhap input {
  width: 100%; background: var(--the-2); border: 1px solid var(--vien); border-radius: 10px;
  color: var(--chu); font: inherit; font-weight: 700; padding: 10px 34px 10px 10px; text-align: right;
}
.o-nhap input:focus { outline: none; border-color: var(--vang); }
.o-nhap .dv { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--chu-mo); pointer-events: none; }
.hang-set.xong .stt { color: var(--xanh); }
.hang-set.loi input { border-color: var(--do); }

.chep { margin-top: 8px; }

/* ---- ngay nghi ---- */
.hop-nghi { background: var(--the); border: 1px dashed var(--vien); border-radius: 16px; padding: 16px; text-align: center; }
.chon-buoi { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }

/* ---- lop phu lich su ---- */
.lop-phu { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: flex; align-items: flex-end;
  justify-content: center; z-index: 30; }
.hop-ls { background: var(--nen); border: 1px solid var(--vien); border-radius: 18px 18px 0 0;
  width: 100%; max-width: 620px; max-height: 86vh; overflow-y: auto; padding: 16px 14px 28px; }
.hop-ls h3 { font-size: 18px; font-weight: 900; }
.lan { border-top: 1px solid var(--vien); padding: 10px 0; display: flex; gap: 10px; justify-content: space-between; }
.lan .ng { font-weight: 800; font-size: 14px; white-space: nowrap; }
.lan .st { text-align: right; font-size: 14px; color: #d8d8d8; }
.dinh { display: flex; gap: 14px; margin: 10px 0 4px; }
.dinh div { background: var(--the); border: 1px solid var(--vien); border-radius: 12px; padding: 8px 12px; flex: 1; }
.dinh b { display: block; font-size: 19px; font-weight: 900; color: var(--vang); }

/* ---- tab duoi ---- */
.tab { display: flex; gap: 8px; margin: 4px 0 16px; }
.tab button { flex: 1; }
.tab button.chon { background: var(--vang); color: #0d0d0d; border-color: var(--vang); }

.trong { text-align: center; color: var(--chu-mo); padding: 26px 10px; }
.bao { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; background: var(--the-2);
  border: 1px solid var(--vien); color: var(--chu); padding: 9px 14px; border-radius: 999px; font-size: 13px;
  z-index: 40; opacity: 0; transition: opacity .2s; pointer-events: none; }
.bao.hien { opacity: 1; }
.bao.loi { border-color: var(--do); color: #ffb3b3; }
