/* All visual overrides are phone-only. Desktop styles remain in each HTML file. */
.mobile-field { display: contents; }
.mobile-field > span { display: none; }
@media screen and (min-width:720px) { .row > .mobile-field > input { flex: 1 1 150px; } }
@media screen and (max-width: 719px) {
  html { scroll-padding-top: 100px; }
  body { overflow-x: clip; }
  main { padding-inline: 14px !important; padding-bottom: calc(100px + var(--bot)) !important; }
  header { padding-inline: 14px !important; }
  header .ib, header button { min-width: 44px; min-height: 44px; }
  button, a { touch-action: manipulation; }
  button.b, a.b, .btn, .qb, .pkbtn { min-height: 48px; }
  .b.s, .btn-sm, .x, .ib { min-height: 44px; min-width: 44px; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; min-height: 48px; scroll-margin-block: 90px 28px; }
  textarea { resize: vertical; line-height: 1.7; }
  input[type=checkbox], input[type=radio] { width: 21px; height: 21px; accent-color: var(--p); vertical-align: middle; }
  .card { padding: 16px; border-radius: 20px; margin-bottom: 14px; }
  .row { gap: 10px; }
  .row > input, .row > select, .row > textarea, .mobile-field { flex: 1 1 100%; min-width: 0; }
  .mobile-field { display: flex; flex-direction: column; gap: 6px; }
  .mobile-field > span { display: block; font-weight: 700; font-size: 13px; color: var(--mut); }
  .mobile-field input { width: 100%; }
  .items .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; padding: 12px; border: 1px solid var(--bd); border-radius: 16px; }
  .items .row select { grid-column: 1 / -1; width: 100%; }
  .items .row input { width: 100%; min-width: 0; }
  .items .row .dv { grid-column: 1 / 3; text-align: start; font-size: 14px; }
  .items .row > button { grid-column: 3; grid-row: 2 / 4; padding: 8px; align-self: center; }
  .mobile-submit { position: sticky; bottom: 84px; z-index: 8; width: 100%; box-shadow: 0 8px 24px #0f172a24; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .chips .chip, .nchips button, .sch { flex-shrink: 0; min-height: 44px; }
  .oc2 { border-radius: 20px; overflow: hidden; }
  .oc2 .nm { min-width: 0; overflow-wrap: anywhere; }
  .oc2 .bar { gap: 12px; flex-wrap: wrap; }
  .oc2 .bar .ac, .oc2 .bar .ic { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  .oc2 .bar .ac > button { flex: 1; min-height: 48px; }
  .oc2 .bar .ic > a, .oc2 .bar .ic > button { flex: 1; width: auto; min-height: 48px; }
  .qa { gap: 10px; }
  .qa > a { flex: 1; min-height: 48px; }
  .more { gap: 10px; }
  .more > button { min-height: 82px; border: 1px solid var(--bd); border-radius: 16px; }
  #bnav, nav { padding-inline: 10px; }
  #bnav button, nav button { min-height: 58px; }
  #modal, .dlg { top: var(--visual-top, 0px); bottom: auto; height: var(--visual-height, 100dvh); align-items: flex-end; padding: 0; }
  .sheet, .dlg > div { border-radius: 24px 24px 0 0; margin: 0; width: 100%; max-width: 100% !important; max-height: calc(var(--visual-height, 100dvh) - 18px); overscroll-behavior: contain; overflow-y: auto; padding: 12px 18px calc(20px + var(--bot)); }
  .dlg > div { max-height: calc(var(--visual-height, 100dvh) - 24px); }
  .sh-h { position: sticky; top: -12px; z-index: 5; background: white; padding-block: 12px; margin-top: -12px; }
  .sheet .btns, .dlg .btns { position: sticky; bottom: -1px; background: white; padding-top: 10px; }
  .tw { max-width: 100%; overscroll-behavior-x: contain; }
  table.mobile-cards, table.mobile-cards tbody { display: block; width: 100%; }
  table.mobile-cards tr:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.mobile-cards tr:not(:first-child) { display: block; border: 1px solid var(--bd); border-radius: 16px; padding: 10px 12px; margin-bottom: 12px; background: white; }
  table.mobile-cards td { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--bd); overflow-wrap: anywhere; min-width: 0; }
  table.mobile-cards td:last-child { border-bottom: 0; }
  table.mobile-cards td::before { content: attr(data-label); color: var(--mut); font-size: 13px; font-weight: 600; flex-shrink: 0; }
  table.mobile-cards td[data-label=""] { justify-content: flex-end; flex-wrap: wrap; }
  table.mobile-cards td[data-label=""]::before { display: none; }
  .dit { grid-template-columns: minmax(0, 1fr) 34px 62px 68px; font-size: 13px; gap: 4px; }
  .capsum { flex-wrap: wrap; gap: 12px; }
  .stats, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat, .kp { min-width: 0; padding: 14px; overflow-wrap: anywhere; }
  .sgrid { grid-template-columns: minmax(0, 1fr); }
  .stk-hero, .bal { border-radius: 22px; }
  body.mobile-keyboard-open #bnav, body.mobile-keyboard-open nav { visibility: hidden; pointer-events: none; }
  body.mobile-keyboard-open main { padding-bottom: 24px !important; }
  body.mobile-keyboard-open .mobile-submit { bottom: 8px; }
  body.mobile-keyboard-open #toast { bottom: 12px; }
}
