/* IFS OPS Web · lớp giao diện v3 — PHẦN ĐIỆN THOẠI (tách từ ui.css 10/10/2026, thread "Nâng cấp giao diện Web").
   Chỉ nạp khi màn hình ≤ 600 px (thẻ <link media=…> trong index.html) → sửa file này KHÔNG ảnh hưởng cỡ màn hình còn lại.
   Nạp SAU ui.css. Kiểm tra trước khi đưa lên: node scripts/ui-check.mjs */

@media (max-width: 600px) {
  .auth, .who-pick { margin-left: auto !important; margin-right: auto !important; width: calc(100% - 24px); max-width: 440px; }
}
@media (max-width: 600px) {
  .top { padding-top: env(safe-area-inset-top); height: calc(var(--header-h) + env(safe-area-inset-top)); }
  .top::after { background: linear-gradient(90deg, var(--yellow) 0, var(--yellow) 40px, transparent 40px); }
  main { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  #tabbar { -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); background: color-mix(in srgb, var(--surface) 88%, transparent); }
  #tabbar button { transition: color var(--t-fast) var(--ease), background var(--t) var(--ease), transform var(--t-fast) var(--ease); }
  #tabbar button:active { transform: scale(.94); }
  #tabbar button.on svg { animation: ui-bounce .36s var(--ease-out); }
  .panel, .card, .rc, .kc { border-radius: var(--r-md); }
  .btn { border-radius: 10px; }
  .modal { align-items: end; padding: 0; }
  .modal .mbox { border-radius: var(--r-xl) var(--r-xl) 0 0; max-width: none; padding-bottom: calc(22px + env(safe-area-inset-bottom)); animation-name: ui-sheet; max-height: calc(100vh / var(--ifs-zoom, 1) - 40px); }
  .sheet { border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .menu { left: 12px; right: 12px; min-width: 0; }
  /* bảng rộng: vuốt ngang mượt, có bóng ở mép báo còn nội dung */
  .tbl-wrap, .hrscroll { background:
      linear-gradient(90deg, var(--surface) 30%, transparent) left / 24px 100% no-repeat local,
      linear-gradient(270deg, var(--surface) 30%, transparent) right / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.10), transparent) left / 10px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.10), transparent) right / 10px 100% no-repeat scroll; }
}
@media (max-width: 600px) { #uiTop { bottom: calc(84px + env(safe-area-inset-bottom)); width: 42px; height: 42px; } }
@media (max-width: 600px) {
  .tbl-wrap:has(> table.ui-cardable) { overflow: visible; margin: 0; padding: 0; background: none; }
  table.ui-cardable, table.ui-cardable tbody, table.ui-cardable tr, table.ui-cardable td { display: block; width: 100%; }
  table.ui-cardable thead { display: none; }
  table.ui-cardable tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; margin-bottom: 8px; background: var(--surface); box-shadow: var(--sh-1); }
  table.ui-cardable tr.mine { background: var(--accent-soft); }
  table.ui-cardable tr.total { background: var(--soft); border-color: var(--line-strong); }
  table.ui-cardable td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0 !important; border: 0 !important;
    white-space: normal; text-align: right; background: none !important; font-size: 14.5px; position: static !important; }
  table.ui-cardable td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 500; text-align: left; flex: none; max-width: 55%; }
  table.ui-cardable td:first-child { grid-column: 1 / -1; display: block; text-align: left; font-size: 16px; font-weight: 700; padding: 2px 0 6px !important; margin-bottom: 4px; border-bottom: 1px solid var(--line) !important; }
  table.ui-cardable td:first-child::before { display: none; }
  table.ui-cardable td:empty, table.ui-cardable td[data-label=""]:not(:first-child)::before { display: none; }
}
@media (max-width: 600px) {
  main#app > .loading:only-child::after {
    background:
      linear-gradient(var(--sk) 0 0) 0 0 / calc(50% - 5px) 84px no-repeat,
      linear-gradient(var(--sk) 0 0) 100% 0 / calc(50% - 5px) 84px no-repeat,
      linear-gradient(var(--sk) 0 0) 0 94px / calc(50% - 5px) 84px no-repeat,
      linear-gradient(var(--sk) 0 0) 100% 94px / calc(50% - 5px) 84px no-repeat,
      linear-gradient(var(--sk) 0 0) 0 196px / 100% 130px no-repeat,
      linear-gradient(var(--sk) 0 0) 0 344px / 100% 126px no-repeat;
  }
}
@media (max-width: 600px) { .rc .dl { font-size: 12.5px; padding: 1px 7px; } .tkpi span { font-size: 12.5px; } }
@media (max-width: 600px) {
  .hvhero { padding: 14px; }
  .hvhero .hvhead2 { gap: 6px 12px; margin-bottom: 12px; align-items: flex-start; flex-wrap: wrap; }
  .hvhero .hvhead2 > .hxtags { order: 3; flex-basis: 100%; }
  .hvhero .hvhead2 > div:not(.hxtags) { flex: 1; min-width: 0; }
  .hvhero .hvav.big { width: 48px; height: 48px; font-size: 17px; }
  .hvhero .hvhead2 h1 { font-size: 20px; gap: 6px; }
  .hvhero .hvhead2 .muted { font-size: 13.5px; line-height: 1.45; }
  .hvhero .hvtiles { gap: 8px; margin-bottom: 4px; }
  .hvhero .hvtiles > div { padding: 8px 10px 8px 12px; }
  .hvhero .hvtiles span { font-size: 12px; } .hvhero .hvtiles b { font-size: 16px; } .hvhero .hvtiles small { font-size: 12px; line-height: 1.35; display: block; }
  .hvhero .hvbtns {
    position: fixed; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 26; display: flex; flex-wrap: nowrap; gap: 8px;
    overflow-x: auto; padding: 10px 12px; background: color-mix(in srgb, var(--surface) 94%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px -10px rgba(21,21,21,.2); scrollbar-width: none; }
  .hvhero .hvbtns::-webkit-scrollbar { display: none; }
  .hvhero .hvbtns .btn { flex: none !important; min-height: 46px; padding: 8px 14px; white-space: nowrap; }
  .hvhero .hvbtns .btn.primary { order: -2; }
  .hvhero .hvbtns #hvCk { order: -1; }
  body:has(.hvhero .hvbtns) { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
  body:has(.hvhero .hvbtns) #uiTop { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .hvhero ~ .subtabs { position: sticky; top: var(--header-h); z-index: 6; background: var(--workspace); margin-left: -12px; margin-right: -12px; padding: 0 12px; }
}
@media (max-width: 600px) { #uiFind { height: 36px; width: 36px; padding: 0; justify-content: center; margin-left: auto; } }
@media (max-width: 600px) { .uipal-bg { padding: 8px; align-items: flex-start; } .uipal-foot { display: none; } .uipal-list { max-height: 60vh; } }
@media (max-width: 600px) { .erow::before { left: -12px; } .erow .eico { width: 30px; height: 30px; } }
@media (max-width: 600px) {
  #uiBack:not([hidden]) { display: grid; place-items: center; width: 36px; height: 36px; margin-left: -6px; border: 0; border-radius: 10px; background: none; color: #fff; cursor: pointer; flex: none; }
  #uiBack:active { background: #262624; }
  body.ui-hasback .brand { display: none; }
  body.ui-hasback .ptitle { border-left: 0; padding-left: 0; }
  body.ui-hasback main#app :is(#hvBack, #stBack, button.linkbtn[id$="Back"]) { display: none; }
}
@media (max-width: 600px) { .uiprint span { display: none; } }
@media (max-width: 600px) {
  .uimore-m { position: fixed; left: 0; right: 0; top: auto; bottom: 0; min-width: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.25); }
  .uimore.open .uimore-m { animation-name: ui-sheet; }
  .uimore-m .btn { min-height: 50px; font-size: 16px; }
}
