/* Sổ dung môi · giao diện điện thoại (≤ 760px)
 * Vẫn là cuốn sổ: bảng kẻ hairline, số căn phải tabular, tab gạch chân như tab sheet.
 * Không thẻ, không viên thuốc, không badge. Màu chỉ để báo trạng thái.
 */

/* ---------- dùng chung cả hai bản ---------- */
.stepper { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; }
.stepper .input { border-radius: 0; text-align: center; border-left: 0; border-right: 0; -moz-appearance: textfield; }
.stepper .input::-webkit-inner-spin-button, .stepper .input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.step {
  display: grid; place-items: center; border: var(--rule-strong); background: var(--color-paper-2); color: var(--color-ink-2);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.step:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.step:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.step:hover { background: var(--color-paper-3); }
.step:active { background: var(--color-rule); }
.step:focus-visible { outline-offset: -2px; position: relative; z-index: 1; }
.seg-wrap label { height: 32px; }
.pick { display: none; }
.m { display: none; }

/* ---------- điện thoại ---------- */
@media (max-width: 760px) {
  body { background: var(--color-paper); }
  .app, #scrim { display: none !important; }
  html.m-lock, html.m-lock body { overflow: hidden; }

  .m { display: block; min-height: 100dvh; padding-bottom: calc(var(--nav-h) + var(--safe-b)); font-variant-numeric: tabular-nums; }
  :where(.m) :where(button) { -webkit-tap-highlight-color: transparent; touch-action: manipulation; font: inherit; color: inherit; }
  .m-icon {
    width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-ink-2);
  }
  .m-icon .i { width: 20px; height: 20px; }
  .m-icon:active { background: var(--color-paper-3); }
  .m-icon:disabled { color: var(--color-rule-strong); }
  .m .gr { font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); letter-spacing: 0.02em; }
  .m .mono { font-size: 0.92em; }
  .t-danger, .is-danger, .is-danger .n, .is-danger b { color: var(--color-danger); }
  .t-warn, .is-warn, .is-warn .n, .is-warn b { color: var(--color-warn); }
  .t-in { color: var(--color-accent-ink); }

  /* ---- đầu trang ---- */
  .m-top {
    position: sticky; top: 0; z-index: 10;
    padding-top: var(--safe-t); background: var(--color-paper);
  }
  .m-top-row { display: flex; align-items: center; gap: var(--space-sm); height: 48px; padding: 0 var(--space-2xs) 0 var(--space-md); }
  .m-mark { font-family: var(--font-wordmark); font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
  .m-period { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-period .i { width: 12px; height: 12px; flex: none; }

  .m-search { display: flex; align-items: center; gap: var(--space-xs); padding: 0 var(--space-md) var(--space-xs); }
  .m-search input, .m-pick-search input {
    flex: 1; min-width: 0; height: 40px; padding: 0 var(--space-sm);
    border: var(--rule-strong); border-radius: var(--radius-sm); background: var(--color-paper); font-size: var(--text-md);
  }
  .m-search input:focus-visible, .m-pick-search input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -1px; border-color: transparent; }
  .m-search button { height: 40px; padding: 0 var(--space-xs); border: 0; background: none; color: var(--color-accent-ink); font-weight: 500; }

  /* tab tháng, giống tab sheet */
  .m-months { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-top: var(--rule-hair); border-bottom: var(--rule-strong); background: var(--color-paper-2); }
  .m-months[hidden] { display: none; }
  .m-months button {
    position: relative; height: 38px; border: 0; border-right: var(--rule-hair); background: transparent;
    font-size: var(--text-sm); font-weight: 500; color: var(--color-muted);
  }
  .m-months button:last-child { border-right: 0; }
  .m-months button i { position: absolute; top: 9px; right: calc(50% - 16px); width: 5px; height: 5px; border-radius: 50%; background: var(--color-accent); }
  .m-months button[aria-selected="true"] { background: var(--color-paper); color: var(--color-ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--color-accent); margin-bottom: -1px; }
  .m-months button:active { background: var(--color-paper-3); }
  .m-months button:focus-visible { outline-offset: -2px; }

  /* tab chữ gạch chân */
  .m-tabs { display: flex; gap: var(--space-lg); padding: 0 var(--space-md); border-bottom: var(--rule-hair); overflow-x: auto; scrollbar-width: none; }
  .m-tabs::-webkit-scrollbar { display: none; }
  .m-tabs button {
    flex: none; display: inline-flex; align-items: center; gap: 5px; height: 42px; padding: 0;
    border: 0; background: none; font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); white-space: nowrap;
  }
  .m-tabs button span { font-size: var(--text-xs); color: var(--color-neutral); font-weight: 500; }
  .m-tabs button.t-danger span { color: var(--color-danger); }
  .m-tabs button.t-warn span { color: var(--color-warn); }
  .m-tabs button.t-danger, .m-tabs button.t-warn { color: var(--color-muted); }
  .m-tabs button[aria-selected="true"] { color: var(--color-ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--color-ink); }
  .m-tabs button:focus-visible { outline-offset: -2px; }

  /* ---- bảng chính ---- */
  .ms, .ml, .ma, .mp { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .ms col.w-io { width: 23%; }
  .ms col.w-st { width: 17%; }
  .ms th, .ms td { padding: 0; border-bottom: var(--rule-hair); text-align: right; vertical-align: top; font-weight: 400; }
  .ms thead th {
    position: sticky; top: var(--m-top-h, 88px); z-index: 4;
    height: 30px; padding: 0 var(--space-sm); vertical-align: middle;
    background: var(--color-paper); border-bottom: var(--rule-strong);
    font-size: var(--text-xs); font-weight: 500; color: var(--color-muted);
  }
  .ms thead th:first-child, .ms tbody th { text-align: left; padding-left: var(--space-md); }
  .ms thead th:last-child, .ms td:last-child { padding-right: var(--space-md); }
  .ms td + td, .ms th + td { border-left: var(--rule-hair); }

  .ms tbody th button {
    display: grid; width: 100%; min-height: 56px; padding: 9px var(--space-xs) 8px 0; border: 0; background: none; text-align: left;
  }
  .ms .nm { font-size: var(--text-base); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
  .ms .sub { margin-top: 2px; font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ms tbody th button:active .nm { color: var(--color-accent-ink); text-decoration: underline; text-underline-offset: 3px; }

  .ms .n { display: block; font-size: var(--text-md); font-weight: 600; line-height: 1.25; }
  .ms small { display: block; margin-top: 2px; font-size: var(--text-xs); color: var(--color-muted); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ms .c-io button {
    display: block; width: 100%; min-height: 56px; padding: 9px var(--space-sm) 8px; border: 0; background: none; text-align: right;
  }
  .ms .c-io .n { text-decoration: underline dotted var(--color-rule-strong); text-decoration-thickness: 1px; text-underline-offset: 4px; }
  .ms .c-io .by { display: block; margin-top: 2px; font-size: var(--text-xs); line-height: 1.3; color: var(--color-muted); }
  .ms .c-io .pt { white-space: nowrap; }
  .ms .c-io button:active { background: var(--color-accent-wash); }
  .ms .c-io button:active .n { color: var(--color-accent-ink); }
  .ms .c-io button:focus-visible { outline-offset: -2px; }
  .ms .c-io.is-zero .n { padding: 9px var(--space-sm) 0; color: var(--color-rule-strong); font-weight: 400; text-decoration: none; }
  .ms .c-st { padding: 9px var(--space-md) 8px var(--space-xs); }

  .ms-grp th {
    height: 30px; padding: 10px var(--space-md) 4px !important; vertical-align: bottom !important;
    background: var(--color-paper-2); border-bottom: var(--rule-hair);
    font-size: var(--text-xs); font-weight: 600; color: var(--color-ink-2); text-align: left !important;
  }
  .ms-grp th span { margin-left: 6px; font-weight: 400; color: var(--color-muted); }

  .ms-total th, .ms-total td { background: var(--color-paper-2); border-bottom: var(--rule-strong); padding-top: 9px; padding-bottom: 8px; }
  .ms-total th { font-size: var(--text-sm); font-weight: 600; }
  .ms-total td { padding-left: var(--space-xs); padding-right: var(--space-sm); }
  .ms-total td:last-child { padding-right: var(--space-md); }

  .ms tr.m-flash > * { animation: m-flash var(--dur-flash) var(--ease-out); }
  @keyframes m-flash { 0%, 30% { background: var(--color-accent-wash); } 100% { background: transparent; } }

  .m-foot-note { padding: var(--space-md) var(--space-md) var(--space-lg); font-size: var(--text-xs); color: var(--color-muted); line-height: 1.5; max-width: 60ch; }
  .m-empty { padding: var(--space-2xl) var(--space-md); color: var(--color-ink-2); }
  .m-link { min-height: var(--tap); padding: 0; border: 0; background: none; color: var(--color-accent-ink) !important; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

  /* ---- nhật ký ---- */
  .ml col { width: auto; }
  .ml th, .ml td { border-bottom: var(--rule-hair); vertical-align: top; text-align: left; font-weight: 400; }
  .ml thead th { position: sticky; top: var(--m-top-h, 88px); z-index: 4; height: 30px; padding: 0 var(--space-sm); vertical-align: middle; background: var(--color-paper); border-bottom: var(--rule-strong); font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }
  .ml thead th:first-child { width: 56px; padding-left: var(--space-md); }
  .ml thead th:last-child { width: 64px; text-align: right; padding-right: var(--space-md); }
  .ml-day th, .ml-day td { padding: 10px var(--space-md) 4px; background: var(--color-paper-2); font-size: var(--text-xs); font-weight: 600; color: var(--color-ink-2); }
  .ml-day td { text-align: right; font-weight: 500; color: var(--color-muted); }
  .ml-no { padding: 11px 0 0 var(--space-md); font-size: var(--text-xs); color: var(--color-muted); }
  .ml td button { display: grid; width: 100%; min-height: 52px; padding: 9px var(--space-sm) 8px; border: 0; background: none; text-align: left; }
  .ml td button:active { background: var(--color-paper-2); }
  .ml .nm { font-weight: 600; }
  .ml .sub { margin-top: 2px; font-size: var(--text-sm); color: var(--color-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ml .sub2 { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ml-q { padding: 9px var(--space-md) 0 0; text-align: right !important; font-size: var(--text-md); font-weight: 600; }
  .ml tr.is-new td { background: var(--color-accent-wash); }

  /* ---- cảnh báo ---- */
  .m-caption { padding: var(--space-sm) var(--space-md) 0; font-size: var(--text-xs); color: var(--color-muted); }
  .m-h { display: flex; align-items: baseline; gap: 6px; padding: var(--space-lg) var(--space-md) var(--space-xs); font-size: var(--text-sm); font-weight: 600; border-bottom: var(--rule-strong); }
  .m-h span { font-weight: 400; font-size: var(--text-xs); color: var(--color-muted); }
  .ma th, .ma td { border-bottom: var(--rule-hair); vertical-align: middle; text-align: right; font-weight: 400; padding: 0 var(--space-sm); }
  .ma thead th { height: 28px; font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }
  .ma thead th:first-child, .ma tbody th { text-align: left; padding-left: var(--space-md); }
  .ma thead th:first-child { width: auto; }
  .ma thead th:nth-child(2), .ma thead th:nth-child(3) { width: 52px; }
  .ma thead th:last-child { width: 72px; padding-right: var(--space-md); }
  .ma td:last-child { padding-right: var(--space-md); }
  .ma tbody th button { display: grid; width: 100%; min-height: 52px; padding: 8px 0; border: 0; background: none; text-align: left; }
  .ma .nm { font-weight: 600; }
  .ma .sub { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ma .n { font-size: var(--text-md); font-weight: 600; display: block; }
  .ma small { display: block; font-size: var(--text-xs); }
  .m-cellbtn {
    width: 100%; height: 34px; border: var(--rule-strong) !important; border-radius: var(--radius-sm);
    background: var(--color-paper) !important; font-weight: 600; color: var(--color-accent-ink) !important;
  }
  .m-cellbtn:active { background: var(--color-accent-wash) !important; }

  /* ---- thanh dưới ---- */
  .m-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-template-columns: 1fr 1fr 1fr 1.25fr;
    height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: var(--color-paper); border-top: var(--rule-strong);
  }
  .m-nav button {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 5px;
    border: 0; background: none; font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); white-space: nowrap;
  }
  .m-nav button[aria-current="page"] { color: var(--color-ink); font-weight: 600; }
  .m-nav button[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 18%; right: 18%; height: 2px; background: var(--color-ink); }
  .m-nav button:focus-visible { outline-offset: -4px; }
  .m-count { font-size: var(--text-xs); font-weight: 600; color: var(--color-danger); }
  .m-nav .m-nav-new {
    margin: 8px var(--space-sm) 8px var(--space-2xs); border-radius: var(--radius-md);
    background: var(--color-accent); color: var(--color-on-accent); font-weight: 600;
  }
  .m-nav .m-nav-new .i { width: 16px; height: 16px; stroke-width: 2; }
  .m-nav .m-nav-new:active { background: var(--color-accent-ink); }

  /* ---- sheet đáy ---- */
  .m-scrim { position: fixed; inset: 0; z-index: 30; background: var(--color-scrim); animation: m-fade var(--dur-base) var(--ease-out); }
  @keyframes m-fade { from { opacity: 0; } to { opacity: 1; } }
  .m-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
    display: flex; flex-direction: column; max-height: 86dvh;
    background: var(--color-paper); border-radius: 10px 10px 0 0; border-top: var(--rule-strong);
    padding-bottom: var(--safe-b);
    transition: transform var(--dur-sheet) var(--ease-out);
    animation: m-up var(--dur-sheet) var(--ease-out);
  }
  @keyframes m-up { from { transform: translateY(100%); } to { transform: none; } }
  .m-grab { flex: none; height: 16px; display: grid; place-items: center; touch-action: none; }
  .m-grab::before { content: ""; width: 32px; height: 3px; border-radius: 2px; background: var(--color-rule-strong); }
  .m-sheet-head { flex: none; display: flex; align-items: flex-start; gap: var(--space-xs); padding: 0 var(--space-2xs) var(--space-sm) var(--space-md); border-bottom: var(--rule-hair); touch-action: none; }
  .m-sheet-head > div { flex: 1; min-width: 0; padding-top: 4px; }
  .m-sheet-head h2, .m-page-t h2 { font-size: var(--text-md); font-weight: 600; line-height: 1.3; }
  .m-sheet-head h2:focus, .m-page-t h2:focus { outline: none; }
  .m-sheet-head p, .m-page-t p { font-size: var(--text-xs); color: var(--color-muted); }
  .m-sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-md); }
  .m-sheet-foot { flex: none; display: flex; justify-content: center; padding: 0 var(--space-md); border-top: var(--rule-hair); }

  /* nội dung chi tiết dùng chung */
  .m .entry { padding: var(--space-sm) 0; }
  .m .e-top { flex-wrap: wrap; row-gap: 2px; }
  .m .e-team { background: none; padding: 0; color: var(--color-ink-2); }
  .m .e-team::before { content: "· "; color: var(--color-neutral); }
  .m .e-line { padding-left: 0; }
  .m .kv { grid-template-columns: 112px minmax(0, 1fr); }
  .m .hist td { padding: 8px 0; }
  .m .lots-t .fefo { color: var(--color-ink-2); }

  /* ---- trang sổ dung môi ---- */
  .m-page {
    position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column;
    background: var(--color-paper);
    animation: m-in var(--dur-sheet) var(--ease-out);
  }
  @keyframes m-in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
  .m-page-bar { flex: none; display: flex; align-items: center; gap: var(--space-2xs); padding: calc(var(--space-2xs) + var(--safe-t)) var(--space-md) var(--space-2xs) var(--space-2xs); border-bottom: var(--rule-hair); }
  .m-page-t { flex: 1; min-width: 0; }
  .m-page-t h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-page-t p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-page-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
  .m-mstep { display: grid; grid-template-columns: var(--tap) minmax(0, 1fr) var(--tap); align-items: center; padding: 0 var(--space-2xs); background: var(--color-paper-2); border-bottom: var(--rule-hair); }
  .m-mstep span { text-align: center; font-size: var(--text-sm); font-weight: 600; }
  .mf { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .mf th { padding: var(--space-sm) var(--space-md) 2px; font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); text-align: right; }
  .mf td { padding: 0 var(--space-md) var(--space-md); font-size: var(--text-lg); text-align: right; color: var(--color-ink-2); border-bottom: var(--rule-strong); }
  .mf th + th, .mf td + td { border-left: var(--rule-hair); }
  .mf td b { font-size: var(--text-xl); font-weight: 600; color: var(--color-ink); letter-spacing: -0.01em; }
  .mf td.is-danger b { color: var(--color-danger); }
  .mf td.is-warn b { color: var(--color-warn); }
  .m-status { padding: var(--space-sm) var(--space-md); font-size: var(--text-sm); font-weight: 500; border-bottom: var(--rule-hair); line-height: 1.5; }
  .m-tabs-page { position: sticky; top: 0; z-index: 2; background: var(--color-paper); margin-top: var(--space-xs); }
  .m-page-content { padding: var(--space-md) var(--space-md) var(--space-xl); }
  .m-page-foot {
    flex: none; display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md) calc(var(--space-xs) + var(--safe-b));
    border-top: var(--rule-strong);
  }
  .m-page-foot .btn { height: var(--tap); justify-content: center; font-size: var(--text-base); border-radius: var(--radius-md); }

  /* ---- form toàn màn hình ---- */
  .form-dialog { max-height: none; padding-bottom: 0; }
  .form-dialog .form { height: 100%; max-height: none; }
  .form-dialog[open] { animation: m-up var(--dur-sheet) var(--ease-out); }
  .f-head { padding: calc(var(--space-2xs) + var(--safe-t)) var(--space-2xs) var(--space-sm) var(--space-md); align-items: center; }
  .f-head h2 { font-size: var(--text-lg); }
  .f-head h2:focus { outline: none; }
  .f-head .icon-btn { width: var(--tap); height: var(--tap); }
  .f-body { flex: 1; padding: var(--space-md); gap: var(--space-lg); overscroll-behavior: contain; }
  .f-foot { display: grid; grid-template-columns: 1fr 2fr; padding: var(--space-xs) var(--space-md) calc(var(--space-xs) + var(--safe-b)); background: var(--color-paper); }
  .f-foot .btn { height: var(--tap); justify-content: center; font-size: var(--text-base); }
  .input, select.input { height: var(--tap); font-size: var(--text-md); min-width: 0; max-width: 100%; border-radius: var(--radius-sm); }
  .field > label, .fs > legend { font-size: var(--text-sm); }
  .hint, .err { font-size: var(--text-sm); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }
  .seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .seg label { height: 40px; justify-content: center; font-size: var(--text-sm); border-radius: 0; margin-left: -1px; }
  .seg label:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
  .seg label:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
  .seg label:has(input:checked) { position: relative; z-index: 1; }
  .seg-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg-wrap label { height: 40px; padding: 0 var(--space-sm); border-radius: 0 !important; margin: 0 0 -1px -1px; }
  .seg-wrap label:first-child { grid-column: 1 / -1; margin-left: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important; }
  .seg-wrap label:nth-child(even) { margin-left: 0; }
  .seg-wrap label:last-child { border-radius: 0 0 var(--radius-sm) 0 !important; }
  .seg-wrap label:nth-last-child(2) { border-radius: 0 0 0 var(--radius-sm) !important; }
  .stepper { grid-template-columns: var(--tap) minmax(0, 1fr) var(--tap); }
  .stepper .input { font-size: var(--text-lg); font-weight: 600; }
  .step:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
  .step:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
  .alloc-row { grid-template-columns: minmax(0, 1fr) 72px var(--tap); }
  .alloc-row .icon-btn { width: var(--tap); height: var(--tap); }
  .btn-text { min-height: var(--tap); }

  #f-sid, #f-stock { display: none; }
  .pick {
    display: grid; grid-template-columns: minmax(0, 1fr) 16px; grid-template-areas: "t c" "s c"; gap: 1px var(--space-xs); align-items: center;
    width: 100%; min-height: 56px; padding: var(--space-xs) var(--space-sm);
    border: var(--rule-strong); border-radius: var(--radius-sm); background: var(--color-paper); text-align: left;
  }
  .pick:active { background: var(--color-paper-2); }
  .pick-t { grid-area: t; display: flex; align-items: baseline; gap: 6px; font-size: var(--text-md); }
  .pick-t b { font-weight: 600; }
  .pick-t .grade { background: none; padding: 0; font-size: var(--text-xs); color: var(--color-muted); }
  .pick-s { grid-area: s; font-size: var(--text-sm); color: var(--color-muted); }
  .pick > .i { grid-area: c; color: var(--color-neutral); width: 16px; height: 16px; }

  /* ---- chọn dung môi ---- */
  .m-picker { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: var(--color-paper); animation: m-in var(--dur-base) var(--ease-out); }
  .m-pick-head { flex: none; display: flex; align-items: center; gap: var(--space-2xs); padding: calc(var(--space-2xs) + var(--safe-t)) var(--space-md) 0 var(--space-2xs); }
  .m-pick-head h2 { font-size: var(--text-lg); font-weight: 600; }
  .m-pick-head h2:focus { outline: none; }
  .m-pick-search { flex: none; display: flex; padding: var(--space-xs) var(--space-md) var(--space-sm); }
  .m-pick-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(var(--space-lg) + var(--safe-b)); }
  .mp th, .mp td { padding: 0; border-bottom: var(--rule-hair); text-align: left; font-weight: 400; }
  .mp thead th { position: sticky; top: 0; z-index: 2; height: 28px; padding: 0 var(--space-md); background: var(--color-paper); border-bottom: var(--rule-strong); font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }
  .mp thead th:last-child { width: 64px; text-align: right; }
  .mp td button { display: flex; align-items: center; gap: var(--space-sm); width: 100%; min-height: 52px; padding: 6px var(--space-md); border: 0; background: none; text-align: left; }
  .mp td button > span:first-child { flex: 1; min-width: 0; display: grid; }
  .mp td button:active { background: var(--color-paper-2); }
  .mp .nm { font-weight: 600; }
  .mp .sub { font-size: var(--text-xs); color: var(--color-muted); }
  .mp .n { font-size: var(--text-md); font-weight: 600; }
  .mp td button:disabled { color: var(--color-neutral); }
  .mp td button:disabled .nm, .mp td button:disabled .n { color: var(--color-neutral); font-weight: 400; }
  .mp tr.is-cur td { box-shadow: inset 2px 0 0 var(--color-accent); background: var(--color-accent-wash); }

  .toasts { bottom: calc(var(--nav-h) + var(--safe-b) + var(--space-xs)); width: calc(100% - 24px); }
  .toast { justify-content: space-between; border-radius: var(--radius-sm); }
}

@media (max-width: 360px) {
  .ms col.w-io { width: 24%; }
  .ms col.w-st { width: 16%; }
  .ms thead th, .ms .c-io button { padding-left: var(--space-xs); padding-right: var(--space-xs); }
  .ms thead th:first-child, .ms tbody th { padding-left: var(--space-sm); }
  .ms thead th:last-child, .ms .c-st { padding-right: var(--space-sm); }
  .ms .nm { font-size: var(--text-sm); }
  .m-nav button { font-size: var(--text-xs); }
  .m-period { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .m-sheet, .m-page, .m-picker, .m-scrim, .form-dialog[open] { animation-name: fade-only !important; }
  .ms tr.m-flash > * { animation: none; background: var(--color-accent-wash); }
}
