/* Chi tieu - giao dien uu tien iPhone */
:root {
  color-scheme: light;
  --nen: #f2f2f7;
  --the: #ffffff;
  --the-2: #f7f7fa;
  --chu: #111114;
  --chu-phu: #5c5c66;
  --chu-mo: #8a8a94;
  --vien: #e3e3ea;
  --chinh: #2a78d6;
  --chinh-nhat: #e6f0fc;
  --chu-tren-chinh: #ffffff;
  --ra: #c92a2a;
  --vao: #237a36;
  --canh-bao-nen: #fff4db;
  --canh-bao-chu: #7a4b00;
  --cot: #2a78d6;
  --luoi: #e9e9ef;
  --bong: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 10px rgba(0, 0, 0, .04);
  --bo: 16px;
  --duoi: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --nen: #000000;
    --the: #1c1c1e;
    --the-2: #242427;
    --chu: #f2f2f7;
    --chu-phu: #b0b0ba;
    --chu-mo: #8e8e98;
    --vien: #2f2f33;
    --chinh: #3987e5;
    --chinh-nhat: #15263b;
    --ra: #ff8a8a;
    --vao: #6fdc85;
    --canh-bao-nen: #3a2c0c;
    --canh-bao-chu: #ffd27a;
    --cot: #3987e5;
    --luoi: #2c2c30;
    --bong: none;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0;
  background: var(--nen);
  color: var(--chu);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--chinh); text-decoration: none; }
[hidden] { display: none !important; }
.so { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ra { color: var(--ra); }
.vao { color: var(--vao); }

#trang {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 14px calc(108px + var(--duoi));
  min-height: 100vh;
}
.dang-tai { text-align: center; color: var(--chu-mo); padding: 80px 0; }

/* ---------- Dau trang ---------- */
.dau-trang { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 6px 2px 14px; }
.dau-trang h1 { font-size: 30px; line-height: 1.15; margin: 0; letter-spacing: -.02em; }
.dau-trang p { margin: 4px 0 0; color: var(--chu-phu); font-size: 16px; }
.nut-tron {
  flex: none; width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--the);
  box-shadow: var(--bong); font-size: 20px; display: grid; place-items: center; color: var(--chu);
}
.quay-lai { display: inline-flex; align-items: center; gap: 4px; font-size: 17px; padding: 8px 0; margin-bottom: 2px; }

/* ---------- The / khoi ---------- */
.khoi { background: var(--the); border-radius: var(--bo); padding: 16px; margin-bottom: 14px; box-shadow: var(--bong); }
.khoi > h2 { font-size: 19px; margin: 0 0 12px; letter-spacing: -.01em; }
.khoi > h2 small { font-weight: 400; color: var(--chu-mo); font-size: 15px; }
.phu { color: var(--chu-phu); font-size: 15px; }
.mo { color: var(--chu-mo); }

/* ---------- Nut ---------- */
.nut {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 52px; padding: 12px 16px; border-radius: 14px; border: 0;
  background: var(--chinh); color: var(--chu-tren-chinh); font-weight: 600; font-size: 18px;
}
.nut:disabled { opacity: .5; }
.nut-phu {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--vien);
  background: var(--the); color: var(--chu); font-weight: 600; font-size: 17px;
}
.nut-nho { min-height: 40px; padding: 8px 12px; border-radius: 12px; font-size: 16px; width: auto; }
.nut-do { color: var(--ra); }
.hang-nut { display: flex; gap: 10px; margin-top: 12px; }
.hang-nut > * { flex: 1; }

/* ---------- The giao dich cho xac nhan ---------- */
.the-gd {
  background: var(--the); border-radius: 20px; padding: 16px; margin-bottom: 14px; box-shadow: var(--bong);
  transition: transform .28s ease, opacity .28s ease, max-height .3s ease .2s, margin .3s ease .2s, padding .3s ease .2s;
  max-height: 1400px; overflow: hidden;
}
.the-gd.di { transform: translateX(110%); opacity: 0; max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
.the-gd .hang1 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.the-gd .so-tien { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.the-gd .gio { color: var(--chu-phu); font-size: 15px; white-space: nowrap; }
.the-gd .nd { margin: 6px 0 4px; font-size: 17px; word-break: break-word; }
.the-gd .nguon { margin: 0; color: var(--chu-mo); font-size: 14px; }
.the-gd .chua-chac {
  margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--canh-bao-nen); color: var(--canh-bao-chu); font-size: 15px;
}
.nut-goi-y {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 14px 0 10px; min-height: 56px; padding: 10px 14px;
  border: 2px solid var(--chinh); border-radius: 14px; background: var(--chinh-nhat); color: var(--chu); text-align: left;
}
.nut-goi-y .bt { font-size: 26px; }
.nut-goi-y .ten { flex: 1; font-weight: 600; font-size: 18px; line-height: 1.2; }
.nut-goi-y .ten small { display: block; font-weight: 400; font-size: 13px; color: var(--chu-phu); }
.nut-goi-y .dung { flex: none; background: var(--chinh); color: var(--chu-tren-chinh); font-weight: 700; border-radius: 10px; padding: 8px 12px; font-size: 16px; }
.nhan-chon { font-size: 14px; color: var(--chu-mo); margin: 10px 0 8px; }

.luoi-dm { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip-dm {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 62px; padding: 8px 4px; border-radius: 14px; border: 1px solid var(--vien); background: var(--the-2);
  font-size: 15px; line-height: 1.15; text-align: center;
}
.chip-dm .bt { font-size: 24px; line-height: 1; }
.chip-dm small { font-size: 11px; color: var(--chu-mo); }
.chip-dm.chon { border: 2px solid var(--chinh); background: var(--chinh-nhat); font-weight: 600; }
.chip-dm:active, .nut-goi-y:active, .nut:active, .nut-phu:active { transform: scale(.97); }

.hang-cuoi { display: flex; gap: 8px; margin-top: 12px; }
.hang-cuoi button { flex: 1; min-height: 44px; border-radius: 12px; border: 0; background: var(--the-2); color: var(--chu-phu); font-size: 16px; }
.o-ghi-chu { margin-top: 10px; }

/* ---------- Trong ---------- */
.trong { text-align: center; padding: 40px 18px; }
.trong .bt { font-size: 56px; }
.trong h2 { margin: 10px 0 6px; font-size: 22px; }
.trong p { color: var(--chu-phu); margin: 0 0 18px; }

/* ---------- Bao cao thang ---------- */
.chon-thang { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 14px; }
.chon-thang h1 { font-size: 26px; margin: 0; text-align: center; flex: 1; letter-spacing: -.02em; }
.o-tong { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tile { background: var(--the); border-radius: var(--bo); padding: 14px; box-shadow: var(--bong); }
.tile.lon { grid-column: 1 / -1; }
.tile .nhan { color: var(--chu-phu); font-size: 15px; }
.tile .gt { display: block; font-size: 24px; font-weight: 700; margin-top: 2px; letter-spacing: -.02em; }
.tile.lon .gt { font-size: 34px; }
.tile .so-sanh { display: block; color: var(--chu-phu); font-size: 14px; margin-top: 4px; }
.canh-bao {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; margin-bottom: 14px;
  background: var(--canh-bao-nen); color: var(--canh-bao-chu); font-weight: 600;
}
.canh-bao span:last-child { margin-left: auto; }

.hang-dm { display: flex; gap: 12px; align-items: center; padding: 10px 0; color: var(--chu); border-top: 1px solid var(--luoi); }
.hang-dm:first-of-type { border-top: 0; padding-top: 2px; }
.hang-dm .bt { font-size: 26px; width: 34px; text-align: center; flex: none; }
.hang-dm .giua { flex: 1; min-width: 0; }
.hang-dm .ten-dong { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.hang-dm .ten-dong b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hang-dm .ten-dong .so { font-weight: 600; }
.thanh { height: 8px; background: var(--luoi); border-radius: 4px; margin: 6px 0 4px; overflow: hidden; }
.thanh i { display: block; height: 100%; background: var(--cot); border-radius: 0 4px 4px 0; min-width: 2px; }
.hang-dm small { color: var(--chu-phu); font-size: 14px; }

/* Bieu do chi theo ngay */
.bd-ngay { position: relative; }
.bd-ngay .vung { position: relative; height: 150px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--vien); }
.bd-ngay .vach { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--luoi); pointer-events: none; }
.bd-ngay .vach span { position: absolute; right: 0; top: -18px; font-size: 12px; color: var(--chu-mo); background: var(--the); padding-left: 4px; }
.bd-ngay .cot-o { flex: 1; height: 100%; display: flex; align-items: flex-end; border: 0; padding: 0; background: none; min-width: 0; }
.bd-ngay .cot-o i { display: block; width: 100%; background: var(--cot); border-radius: 4px 4px 0 0; min-height: 0; }
.bd-ngay .cot-o.hom-nay i { outline: 2px solid var(--chu); outline-offset: 1px; }
.bd-ngay .cot-o.tuong-lai i { background: transparent; }
.bd-ngay .cot-o.dang-chon i { background: var(--chu); }
.bd-ngay .truc { display: flex; gap: 2px; margin-top: 4px; font-size: 12px; color: var(--chu-mo); }
.bd-ngay .truc span { flex: 1; text-align: center; min-width: 0; }
.bd-ngay .chu-giai { min-height: 24px; font-size: 15px; color: var(--chu-phu); margin-bottom: 6px; }
.bd-ngay .chu-giai b { color: var(--chu); }

/* ---------- Danh sach giao dich ---------- */
.tim { display: flex; gap: 8px; margin-bottom: 10px; }
.tim input { flex: 1; }
.loc { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; }
.loc::-webkit-scrollbar { display: none; }
.loc button, .loc a {
  flex: none; min-height: 38px; padding: 6px 14px; border-radius: 19px; border: 1px solid var(--vien);
  background: var(--the); color: var(--chu); font-size: 15px; display: inline-flex; align-items: center; gap: 6px;
}
.loc .chon { background: var(--chu); color: var(--nen); border-color: var(--chu); }
.tom-tat { display: flex; gap: 14px; flex-wrap: wrap; color: var(--chu-phu); font-size: 15px; margin: 2px 2px 10px; }
.tom-tat b { font-weight: 600; }
.nhom-ngay { margin-bottom: 14px; }
.ngay-dau { display: flex; justify-content: space-between; padding: 0 4px 6px; color: var(--chu-phu); font-size: 15px; }
.ngay-dau b { color: var(--chu); font-weight: 600; }
.ds { background: var(--the); border-radius: var(--bo); overflow: hidden; box-shadow: var(--bong); }
.hang-gd {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none;
  text-align: left; border-top: 1px solid var(--luoi); min-height: 64px; color: var(--chu);
}
.hang-gd:first-child { border-top: 0; }
.hang-gd .bt { font-size: 24px; width: 34px; text-align: center; flex: none; }
.hang-gd .giua { flex: 1; min-width: 0; }
.hang-gd .giua b { display: block; font-weight: 600; font-size: 17px; }
.hang-gd .giua small { display: block; color: var(--chu-phu); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hang-gd .so { font-weight: 600; font-size: 17px; }
.hang-gd .cho-tag { font-size: 12px; font-weight: 600; color: var(--canh-bao-chu); background: var(--canh-bao-nen); border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: 2px; }

/* ---------- Muc cai dat ---------- */
.muc {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; min-height: 58px; border: 0;
  background: var(--the); color: var(--chu); text-align: left; border-top: 1px solid var(--luoi); font-size: 17px;
}
.muc:first-child { border-top: 0; }
.muc .bt { font-size: 22px; width: 28px; text-align: center; }
.muc .giua { flex: 1; min-width: 0; }
.muc small { display: block; color: var(--chu-phu); font-size: 14px; }
.muc .mui { color: var(--chu-mo); font-size: 20px; }
.nhom-muc { border-radius: var(--bo); overflow: hidden; margin-bottom: 18px; box-shadow: var(--bong); }

/* ---------- O nhap ---------- */
label.nhan-o { display: block; font-size: 15px; color: var(--chu-phu); margin: 14px 0 6px; }
.o, input[type=text], input[type=password], input[type=search], input[type=datetime-local], textarea, select {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--vien);
  background: var(--the-2); font-size: 17px; outline: none;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.4; }
.o:focus, input:focus, textarea:focus, select:focus { border-color: var(--chinh); background: var(--the); }
.o-tien-wrap { position: relative; }
.o-tien { font-size: 34px !important; font-weight: 700; padding-right: 44px !important; min-height: 64px !important; letter-spacing: -.02em; }
.o-tien-wrap .dv { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--chu-mo); }
.goi-nhanh { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.goi-nhanh button { flex: none; min-height: 40px; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--vien); background: var(--the); font-size: 15px; }
.hai-nut { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--the-2); border-radius: 12px; padding: 3px; border: 1px solid var(--vien); }
.hai-nut button { min-height: 44px; border: 0; border-radius: 10px; background: none; font-size: 17px; font-weight: 600; color: var(--chu-phu); }
.hai-nut button.chon { background: var(--the); color: var(--chu); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.hai-nut button.chon[data-huong=ra] { color: var(--ra); }
.hai-nut button.chon[data-huong=vao] { color: var(--vao); }
.loi { color: var(--ra); font-size: 15px; margin: 10px 0 0; }

/* ---------- Bang tu duoi len ---------- */
#man-che { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 40; opacity: 0; transition: opacity .2s; }
#man-che.hien { opacity: 1; }
#bang {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  background: var(--nen); border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + var(--duoi));
  transform: translateY(100%); transition: transform .25s ease; max-width: 640px; margin: 0 auto;
  overscroll-behavior: contain;
}
#bang.hien { transform: none; }
.bang-dau { position: sticky; top: -8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0 8px; background: var(--nen); z-index: 1; }
.bang-dau h2 { margin: 0; font-size: 22px; }
.bang-dau::before { content: ""; position: absolute; top: 2px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--vien); }

/* ---------- Thanh duoi ---------- */
#thanh-duoi {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: stretch; justify-content: space-around;
  background: color-mix(in srgb, var(--the) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--vien); padding: 6px 4px calc(6px + var(--duoi));
}
#thanh-duoi a {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0;
  color: var(--chu-mo); font-size: 12px; font-weight: 500; min-height: 50px; justify-content: center;
}
#thanh-duoi a .bt { font-size: 24px; line-height: 1.1; filter: grayscale(1); opacity: .65; }
#thanh-duoi a.chon { color: var(--chinh); font-weight: 700; }
#thanh-duoi a.chon .bt { filter: none; opacity: 1; }
#huy-hieu {
  position: absolute; top: 0; left: 50%; margin-left: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--ra); color: #fff; font-size: 13px; line-height: 22px; text-align: center; font-weight: 700;
}
@media (prefers-color-scheme: dark) { #huy-hieu { background: #e03131; } }
.nut-them {
  flex: none; width: 58px; height: 58px; margin: -18px 6px 0; border-radius: 29px; border: 4px solid var(--nen);
  background: var(--chinh); color: #fff; font-size: 32px; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(42, 120, 214, .4);
}

/* ---------- Thong bao nho ---------- */
#thong-bao {
  position: fixed; left: 12px; right: 12px; bottom: calc(86px + var(--duoi)); z-index: 60; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #1f1f23; color: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3); font-size: 16px;
}
#thong-bao span { flex: 1; }
#thong-bao button { border: 0; background: none; color: #8ab8ff; font-weight: 700; font-size: 16px; padding: 6px 4px; }

/* ---------- Dang nhap ---------- */
.dang-nhap { max-width: 380px; margin: 0 auto; padding-top: 12vh; text-align: center; }
.dang-nhap img { width: 88px; height: 88px; border-radius: 22px; box-shadow: var(--bong); }
.dang-nhap h1 { font-size: 30px; margin: 14px 0 4px; }
.dang-nhap p { color: var(--chu-phu); margin: 0 0 22px; }
.dang-nhap form { text-align: left; }
.dang-nhap .nut { margin-top: 14px; }

/* ---------- Ket noi / huong dan ---------- */
.o-sao { display: flex; gap: 8px; align-items: stretch; }
.o-sao code {
  flex: 1; min-width: 0; padding: 12px; border-radius: 12px; background: var(--the-2); border: 1px solid var(--vien);
  font-size: 14px; word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.o-sao button { flex: none; }
details.huong-dan { background: var(--the); border-radius: var(--bo); margin-bottom: 12px; box-shadow: var(--bong); }
details.huong-dan summary { list-style: none; padding: 16px; font-weight: 600; font-size: 18px; display: flex; gap: 10px; align-items: center; }
details.huong-dan summary::-webkit-details-marker { display: none; }
details.huong-dan summary::after { content: "›"; margin-left: auto; font-size: 22px; color: var(--chu-mo); transition: transform .2s; }
details.huong-dan[open] summary::after { transform: rotate(90deg); }
details.huong-dan summary small { display: block; font-weight: 400; color: var(--chu-phu); font-size: 14px; }
details.huong-dan .noi { padding: 0 16px 16px; font-size: 16px; }
details.huong-dan ol { padding-left: 22px; margin: 0; }
details.huong-dan li { margin-bottom: 10px; }
.the-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--chinh-nhat); color: var(--chinh); vertical-align: 2px; }
.nhat-ky { font-size: 15px; }
.nhat-ky li { padding: 8px 0; border-top: 1px solid var(--luoi); list-style: none; }
.nhat-ky ul { margin: 0; padding: 0; }
.nhat-ky li:first-child { border-top: 0; }
.nhat-ky .tt { font-weight: 600; }
.tt-moi { color: var(--vao); }
.tt-loi { color: var(--ra); }
.ghi-chu-nho { font-size: 14px; color: var(--chu-phu); margin-top: 8px; }

@media (min-width: 700px) {
  #trang { padding-top: 24px; }
  .o-tong { grid-template-columns: 1fr 1fr 1fr; }
  .tile.lon { grid-column: auto; }
  .tile.lon .gt { font-size: 26px; }
  .luoi-dm { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
