/* ==========================================================================
   Memoto — design_new2 · THÀNH PHẦN TRONG APP
   Mọi thứ dưới đây là app thật. Chrome của trang tài liệu nằm ở page.css.
   ========================================================================== */

/* ---------- Khung máy ---------- */
.phone {
  position: relative;
  width: 390px; height: 844px; flex: none;
  background: var(--bg);
  border-radius: var(--r-phone);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  overflow: hidden;
  font-family: var(--f-ui);
  color: var(--ink);
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Thanh trạng thái iOS */
.sbar {
  flex: none; height: 50px; padding: 14px 26px 0;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--f-ui); font-size: 14px; font-weight: 600;
  letter-spacing: -.01em;
}
.sbar .notch { width: 78px; height: 24px; border-radius: var(--pill); background: var(--ink); opacity: .9; }
.sbar .right { display: flex; align-items: center; gap: 5px; opacity: .85; }
/* Tên `.sig`, KHÔNG phải `.bars`: `.bars` đã là biểu đồ cột ở màn Lịch sử
   (height: 54px) và nó nằm sau trong file nên nó thắng — cột sóng của thanh
   trạng thái bị kéo cao 51px. Đụng độ cascade kiểu này không báo lỗi ở đâu cả. */
.sbar .sig { display: flex; align-items: flex-end; gap: 2px; height: 10px; }
.sbar .sig i { width: 3px; background: currentColor; border-radius: 1px; }
.sbar .sig i:nth-child(1) { height: 4px; }
.sbar .sig i:nth-child(2) { height: 6px; }
.sbar .sig i:nth-child(3) { height: 8px; }
.sbar .sig i:nth-child(4) { height: 10px; }
.sbar .batt { width: 22px; height: 11px; border: 1.3px solid currentColor; border-radius: 3px; padding: 1.3px; }
.sbar .batt i { display: block; height: 100%; width: 72%; background: currentColor; border-radius: 1px; }

/* Vùng cuộn */
.scr { flex: 1 1 auto; overflow: hidden; position: relative; padding: 4px 18px 0; }
.scr.flush { padding-left: 0; padding-right: 0; }
.scr.flush > * { padding-left: 18px; padding-right: 18px; }
.scr.flush > .full { padding-left: 0; padding-right: 0; }

/* ---------- Chữ ---------- */
.h1 { font-family: var(--f-dis); font-size: 32px; font-weight: 700; line-height: 1.02; letter-spacing: 0; margin: 0; }
.h2 { font-family: var(--f-dis); font-size: 24px; font-weight: 700; line-height: 1.1; margin: 0; }
.big {
  font-family: var(--f-dis); font-weight: 700;
  font-size: 62px; line-height: .86; letter-spacing: -.005em;
  font-variant-numeric: tabular-nums; margin: 0;
}
.big .u { font-size: .34em; font-weight: 600; margin-left: 5px; color: var(--ink-2); letter-spacing: .02em; }
.num { font-family: var(--f-dis); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.mono {
  font-family: var(--f-mono); font-size: 10px; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase; color: var(--ink-3);
}
.t { font-size: 15.5px; font-weight: 500; letter-spacing: -.005em; }
.s { font-size: 12.5px; font-weight: 400; color: var(--ink-2); line-height: 1.35; }
.dim { color: var(--ink-3); }

/* Biển số — chi tiết riêng của app xe, đặt cho ra chất biển số thật */
.plate {
  font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: .06em;
  padding: 3px 7px; border: 1px solid var(--line-2); border-radius: 5px;
  color: var(--ink-2); white-space: nowrap;
}

/* ---------- Thước vạch: dấu nhận diện của bản thiết kế này ----------
   Đầu mỗi module là một nhãn mono + một thước có vạch chia, mượn từ mặt
   đồng hồ đo. Nó thay cho tiêu đề in đậm và cho cả đường kẻ trơn. */
.mhead { display: flex; align-items: center; gap: 10px; margin: 16px 0 9px; }
.mhead .mono { flex: none; }
.mhead .ln {
  flex: 1 1 auto; height: 5px;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 7px);
  background-repeat: repeat-x; background-position: bottom; background-size: 7px 4px;
}
.mhead .act { flex: none; font-size: 12.5px; font-weight: 600; color: var(--br); }

/* ---------- THANH ĐO ----------
   Thay cho vòng cung. Lý do: quãng đường là tuyến tính, và chỉ thanh thẳng
   mới đặt được vạch "nhắc trước" (.warn) — thông tin mà vòng cung bỏ mất. */
.meter { position: relative; height: 6px; border-radius: var(--pill); background: var(--sf2); }
.meter > i {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: var(--pill); background: var(--none);
}
/* Vạch mốc nằm CHỒNG LÊN phần đã tô ở các trạng thái sắp/quá hạn, nên nó cần
   một vòng viền màu bề mặt để tách khỏi cả rãnh xám lẫn màu tô. Không dùng
   opacity thấp: ở trạng thái "còn nhiều" vạch mờ tới mức mất hẳn. */
.meter > .warn {
  left: auto; top: -4px; bottom: -4px; width: 2px; border-radius: 1px;
  background: var(--ink-2); box-shadow: 0 0 0 1px var(--sf); z-index: 1;
}
.meter.big { height: 11px; }
.meter.big > .warn { top: -5px; bottom: -5px; width: 2.5px; }
.tone-ok   .meter > i:not(.warn) { background: var(--ok-f); }
.tone-soon .meter > i:not(.warn) { background: var(--soon-f); }
.tone-late .meter > i:not(.warn) { background: var(--late-f); }
.tone-none .meter > i:not(.warn) { background: var(--none-f); }
/* Quá hạn: thanh đầy + gạch chéo, để nhìn là biết đã vượt mốc chứ không
   phải "vừa đủ đầy". */
.tone-late .meter > i:not(.warn) {
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.28) 0 3px, transparent 3px 7px);
}
.scale { display: flex; justify-content: space-between; margin-top: 6px; }

/* ---------- Huy hiệu trạng thái ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px 0 7px; border-radius: var(--pill);
  font-size: 11.5px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap;
}
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.tone-ok   > .pill, .pill.ok   { background: var(--ok-s);   color: var(--ok); }
.tone-soon > .pill, .pill.soon { background: var(--soon-s); color: var(--soon); }
.tone-late > .pill, .pill.late { background: var(--late-s); color: var(--late); }
.tone-none > .pill, .pill.none { background: var(--none-s); color: var(--none); }

/* ---------- Bề mặt ---------- */
.card {
  background: var(--sf); border: 1px solid var(--line);
  border-radius: var(--r-l); box-shadow: var(--sh-1);
}
.card.pad { padding: 16px; }
.group { background: var(--sf); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.group > * + * { border-top: 1px solid var(--line); }

/* ---------- Khối công-tơ-mét ở đầu Trang chủ ---------- */
.odo { padding: 18px 18px 16px; position: relative; overflow: hidden; }
/* Vân chéo rất mờ — chất "kim loại gia công", chỉ dùng đúng ở khối này. */
.odo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(74deg, currentColor 0 1px, transparent 1px 9px);
  opacity: .035;
}
.odo .top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.odo .avt {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: var(--br-s); color: var(--br-i);
}
/* Chân khối xếp DỌC, không phải ngang. Hai nút có nhãn chữ đã chiếm gần hết
   354px lòng máy; nhồi thêm dòng chú thích cùng hàng thì chú thích bị bóp còn
   một chữ mỗi dòng. */
.odo .foot { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.odo .acts { display: flex; gap: 9px; }
.odo .acts > .btn { flex: 1 1 0; min-width: 0; }

/* ---------- Dòng hạng mục ---------- */
.row {
  display: grid; grid-template-columns: 34px 1fr auto;
  align-items: center; gap: 12px; padding: 13px 15px;
  background: var(--sf);
}
.row .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--sf2); color: var(--ink-2); }
.row.tone-ok   .ic { background: var(--ok-s);   color: var(--ok); }
.row.tone-soon .ic { background: var(--soon-s); color: var(--soon); }
.row.tone-late .ic { background: var(--late-s); color: var(--late); }
.row .mid { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.row .mid .t { display: flex; align-items: center; gap: 7px; }
.row .end { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.row .end .v { font-family: var(--f-dis); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.row.tone-ok   .end .v { color: var(--ok); }
.row.tone-soon .end .v { color: var(--soon); }
.row.tone-late .end .v { color: var(--late); }
.row.tone-none .end .v { color: var(--none); font-size: 13px; font-weight: 600; }
.row .end .k { font-size: 10.5px; color: var(--ink-3); font-weight: 500; }
.row .chev { color: var(--ink-3); }

/* Dòng gọn: dùng cho nhóm "còn nhiều" — cùng dữ liệu, ít mực hơn */
.row.lite { padding: 11px 15px; grid-template-columns: 26px 1fr auto; gap: 11px; }
.row.lite .ic { width: 26px; height: 26px; border-radius: 8px; background: transparent; }
.row.lite .mid { gap: 0; }
.row.lite .end .v { font-size: 14.5px; font-weight: 600; color: var(--ink-2); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 20px; border-radius: var(--r-m);
  font-family: var(--f-ui); font-size: 15.5px; font-weight: 600; letter-spacing: -.01em;
  background: var(--br); color: var(--on-br); border: 0; white-space: nowrap;
}
.btn.block { width: 100%; }
.btn.sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: var(--r-s); }
.btn.xs { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn.tonal { background: var(--br-s); color: var(--br-i); }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line-2); }
.btn.plain { background: transparent; color: var(--br); }
.btn.ok    { background: var(--ok-s);   color: var(--ok); }
.btn.late  { background: var(--late-s); color: var(--late); }

/* Nút nổi: chữ + icon, không bao giờ chỉ có icon */
.fab {
  position: absolute; left: 18px; right: 18px; bottom: 92px; z-index: 3;
  height: 54px; border-radius: var(--r-m);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--br); color: var(--on-br);
  font-size: 16px; font-weight: 600; letter-spacing: -.01em;
  box-shadow: 0 8px 24px rgba(67, 64, 230, .34);
}

/* ---------- Nhập liệu ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > .lb { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; gap: 6px; align-items: baseline; }
.field > .lb .opt { font-weight: 400; color: var(--ink-3); font-size: 11.5px; }
.inp {
  height: 52px; padding: 0 14px; border-radius: var(--r-m);
  background: var(--sf); border: 1px solid var(--line-2); color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 16px; font-weight: 500;
}
.inp .ph { color: var(--ink-3); font-weight: 400; }
.inp.on { border-color: var(--br); box-shadow: 0 0 0 3px var(--br-s); }
.inp .suf { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.inp .val { font-family: var(--f-dis); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.help { font-size: 11.5px; color: var(--ink-3); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 13px; border-radius: var(--pill);
  border: 1px solid var(--line-2); background: var(--sf);
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.chip.on { background: var(--br); border-color: var(--br); color: var(--on-br); font-weight: 600; }

.seg { display: flex; gap: 3px; padding: 3px; background: var(--sf2); border-radius: var(--r-m); }
.seg > span {
  flex: 1; text-align: center; padding: 8px 6px; border-radius: 11px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
}
.seg > span.on { background: var(--sf); color: var(--ink); font-weight: 600; box-shadow: var(--sh-1); }

.sw { width: 46px; height: 28px; border-radius: var(--pill); background: var(--sf3); position: relative; flex: none; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.28); }
.sw.on { background: var(--br); }
.sw.on::after { left: 21px; }

/* ---------- Bàn số ---------- */
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.pad > b {
  height: 54px; border-radius: var(--r-m); background: var(--sf); border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--f-dis); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.pad > b.fn { background: var(--sf2); border-color: transparent; color: var(--ink-2); font-size: 18px; }

/* ---------- Bottom sheet ---------- */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  background: var(--sf); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  border-top: 1px solid var(--line);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .22);
  padding: 10px 18px 26px;
  display: flex; flex-direction: column; gap: 16px;
}
.sheet .grab { width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 4px; }
.scrim { position: absolute; inset: 0; z-index: 2; background: rgba(6, 8, 14, .55); }

/* ---------- Thanh tab ---------- */
.tabs {
  flex: none; height: 78px; padding: 9px 8px 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  /* Nền đặc, KHÔNG backdrop-filter. Mờ nền là hiệu ứng compositor đắt, và ở
     đây nó không đổi được gì về mặt thông tin vì thanh tab luôn đặc. Trên máy
     Android tầm trung nó là thứ giật đầu tiên. */
  background: var(--sf);
}
.tabs > span { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-3); font-size: 10.5px; font-weight: 500; }
.tabs > span.on { color: var(--br); font-weight: 600; }
/* Tab đang chọn có một vạch trên đầu — cùng ngôn ngữ "vạch chia" của thước. */
.tabs > span.on::before { content: ""; width: 22px; height: 2.5px; border-radius: 2px; background: var(--br); margin-bottom: 3px; margin-top: -6px; }
.tabs > span:not(.on)::before { content: ""; height: 2.5px; margin-bottom: 3px; margin-top: -6px; }

/* ---------- Thanh chọn xe ---------- */
.vrail { display: flex; gap: 8px; overflow: hidden; padding: 6px 0 2px; }
.vchip {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 38px; padding: 0 12px; border-radius: var(--pill);
  background: var(--sf); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
}
.vchip .d { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.vchip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
.vchip.add { color: var(--br); border-style: dashed; border-color: var(--line-2); }

/* ---------- Lịch sử ---------- */
.mgroup { display: flex; align-items: center; gap: 9px; margin: 20px 0 8px; }
.hrow { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 12px 15px; background: var(--sf); }
.hrow .dt { text-align: center; }
.hrow .dt b { display: block; font-family: var(--f-dis); font-size: 21px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hrow .dt i { font-style: normal; font-size: 10px; color: var(--ink-3); font-weight: 500; }
.hrow .end { text-align: right; }
.hrow .end .money { font-family: var(--f-dis); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- Dòng thời gian trong màn chi tiết hạng mục ---------- */
.tl { display: flex; flex-direction: column; }
.tl > li { display: grid; grid-template-columns: 16px 1fr auto; gap: 12px; padding: 11px 0; position: relative; list-style: none; }
.tl > li + li { border-top: 1px solid var(--line); }
.tl .n { display: grid; place-items: center; }
.tl .n i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--sf); }
.tl > li:first-child .n i { border-color: var(--br); background: var(--br); }

/* Cột nhỏ: mỗi lần thay cách nhau bao nhiêu km */
.bars { display: flex; align-items: flex-end; align-self: center; gap: 6px; height: 46px; }
.bars > i { flex: 1; background: var(--sf3); border-radius: 4px 4px 2px 2px; }
.bars > i.hi { background: var(--br); }

/* ---------- Tiện ích ---------- */
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.s16 { width: 16px; height: 16px; stroke-width: 1.9; }
.i.s24 { width: 24px; height: 24px; }
.i.s28 { width: 28px; height: 28px; stroke-width: 1.6; }
.stack { display: flex; flex-direction: column; }
.g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g14 { gap: 14px; } .g18 { gap: 18px; }
.rowx { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
