/* Solo teléfono. El diseño de escritorio conserva sus reglas originales. */
@media (max-width: 700px) {
  :root body.vias-mobile {
    --mobile-header-height: 82px;
    -webkit-tap-highlight-color: transparent;
  }

  :root body.vias-mobile .topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 88px;
    gap: 5px 8px;
    min-height: 0;
    padding: 8px 12px;
    overflow: visible;
  }

  :root body.vias-mobile .topbar::after,
  :root body.vias-mobile .topbar-title .eyebrow,
  :root body.vias-mobile .topbar-status > span,
  :root body.vias-mobile #topbarFreshness {
    display: none;
  }

  :root body.vias-mobile .menu-button { grid-column: 1; grid-row: 1; width: 40px; height: 40px; }
  :root body.vias-mobile .topbar-title { grid-column: 2; grid-row: 1; min-width: 0; }
  :root body.vias-mobile .topbar-title h1 { margin: 0; font-size: 18px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  :root body.vias-mobile .topbar-actions { display: flex; grid-column: 3; grid-row: 1; gap: 6px; width: auto; }
  :root body.vias-mobile .topbar-actions .icon-button { width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; font-size: 0; box-shadow: none; }
  :root body.vias-mobile #themeBtn::before { content: "◐"; font-size: 23px; line-height: 1; }
  :root body.vias-mobile #refreshBtn::before { content: "↻"; font-size: 27px; line-height: 1; }
  :root body.vias-mobile .topbar-status { grid-column: 2 / -1; grid-row: 2; display: block; min-width: 0; max-width: none; margin: 0; padding: 0 0 0 11px; border: 0; border-radius: 0; background: none; box-shadow: none; }
  :root body.vias-mobile .topbar-status::before { left: 0; top: 50%; width: 5px; height: 5px; transform: translateY(-50%); box-shadow: none; }
  :root body.vias-mobile .topbar-status strong { display: block; max-width: none; font-size: 11px; line-height: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

  :root body.vias-mobile main { padding: 10px 12px calc(94px + env(safe-area-inset-bottom)); }
  :root body.vias-mobile .surface { padding: 12px; }
  :root body.vias-mobile .panel.active .surface { animation: none; }
  :root body.vias-mobile .section-head { gap: 8px; margin-bottom: 10px; padding-bottom: 10px; }
  :root body.vias-mobile .section-head h2 { font-size: 17px; line-height: 1.3; }
  :root body.vias-mobile .section-head .eyebrow { display: none; }
  :root body.vias-mobile .input { min-height: 46px; font-size: 16px; }
  :root body.vias-mobile input[type="search"] { -webkit-appearance: none; appearance: none; }
  :root body.vias-mobile .icon-button { min-height: 42px; }
  :root body.vias-mobile .field-label { min-width: 0; font-size: 12px; }
  :root body.vias-mobile .summary-inline { font-size: 12px; line-height: 1.4; }
  :root body.vias-mobile .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

  .mobile-disclosure { min-width: 0; margin: 0 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  .mobile-disclosure > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 11px; cursor: pointer; list-style: none; font-size: 13px; color: var(--ink); }
  .mobile-disclosure > summary::-webkit-details-marker,
  .mobile-material-details > summary::-webkit-details-marker { display: none; }
  .mobile-disclosure > summary::after { content: "⌄"; flex: 0 0 auto; margin-left: auto; font-size: 18px; line-height: 1; color: var(--muted); }
  .mobile-disclosure[open] > summary::after { transform: rotate(180deg); }
  .mobile-disclosure-title { font-weight: 650; }
  .mobile-disclosure-current { margin-left: auto; color: var(--accent); font-size: 11px; line-height: 1.4; text-align: right; }
  .mobile-disclosure > summary > svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--accent); }
  .mobile-disclosure-content { min-width: 0; padding: 4px 11px 11px; }
  .mobile-disclosure > summary:focus-visible,
  .mobile-material-details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
  .mobile-apply-filters { display: block; width: 100%; margin-top: 12px; }

  :root body.vias-mobile .kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
  :root body.vias-mobile .kpi-grid .kpi-card { grid-column: auto; min-width: 0; min-height: 80px; padding: 10px; }
  :root body.vias-mobile .kpi-grid .kpi-card strong { font-size: 22px; }
  :root body.vias-mobile .kpi-grid #kpiTopProvider,
  :root body.vias-mobile .kpi-grid #kpiTopCode { font-size: 17px; }
  .mobile-daily-summary > summary { min-height: 40px; }
  .mobile-daily-summary .mobile-disclosure-current { color: var(--muted); font-size: 10px; }

  :root body.vias-mobile .inventory-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  :root body.vias-mobile .inventory-search-panel { position: sticky; top: calc(var(--mobile-header-height) + 6px); z-index: 10; grid-column: 1; padding: 11px; box-shadow: 0 4px 14px var(--shadow); }
  :root body.vias-mobile .inventory-search-panel:has(.mobile-inventory-filters[open]) { position: relative; top: auto; }
  :root body.vias-mobile #inventoryStatus { display: none; }
  :root body.vias-mobile .inventory-head { margin-bottom: 9px; }
  :root body.vias-mobile .search-field { min-height: 46px; margin: 0; }
  :root body.vias-mobile .search-field .input { padding-left: 10px; }
  .mobile-inventory-filters { margin: 10px 0 0; }
  :root body.vias-mobile .inventory-quick-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
  :root body.vias-mobile .inventory-filter { min-height: 44px; font-size: 13px; }
  :root body.vias-mobile .inventory-ft-controls { margin-top: 12px; padding-top: 12px; }
  :root body.vias-mobile .inventory-filter-hint { font-size: 12px; }
  :root body.vias-mobile .inventory-results-panel { grid-column: 1; }
  :root body.vias-mobile .inventory-results-panel .section-head { display: flex; align-items: center; }
  :root body.vias-mobile .inventory-results-panel .section-head h2 { font-size: 16px; }
  :root body.vias-mobile .inventory-results { gap: 9px; max-height: none; overflow: visible; padding: 0; }
  :root body.vias-mobile .inventory-card { grid-template-columns: minmax(0, 1fr) 94px; gap: 6px 10px; padding: 11px; }
  :root body.vias-mobile .inventory-card .inventory-material > strong { font-size: 16px; }
  :root body.vias-mobile .inventory-card .inventory-material .inventory-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14px; line-height: 1.4; }
  :root body.vias-mobile .inventory-card .inventory-material > .inventory-flow-stats,
  :root body.vias-mobile .inventory-card .inventory-material > .inventory-flow-recent,
  :root body.vias-mobile .inventory-card .inventory-material > .inventory-meta { display: none; }
  :root body.vias-mobile .inventory-card .stock { min-width: 0; min-height: 60px; padding: 8px; }
  :root body.vias-mobile .inventory-card .stock .stock-quantity { font-size: 28px; }
  :root body.vias-mobile .inventory-card .stock .stock-status { font-size: 11px; }
  .mobile-material-details { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .mobile-material-details > summary { min-height: 34px; padding-top: 8px; color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; list-style: none; }
  .mobile-material-details > summary::after { content: "+"; float: right; font-size: 16px; }
  .mobile-material-details[open] > summary::after { content: "−"; }
  .mobile-material-description { margin: 8px 0; color: var(--ink); font-size: 14px; line-height: 1.5; }
  .mobile-material-details .inventory-flow-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-material-details .inventory-meta { margin-top: 8px; color: var(--muted); font-size: 12px; }
  .mobile-material-movements { width: 100%; margin-top: 12px; }
  .mobile-rotation { margin: 0; }
  :root body.vias-mobile .mobile-rotation .inventory-movement-panel { padding: 0; border: 0; box-shadow: none; }
  .mobile-rotation .inventory-movement-panel .section-head { display: none; }

  :root body.vias-mobile .alternative-dashboard { gap: 10px; }
  :root body.vias-mobile .alternative-hero .section-head { margin-bottom: 10px; }
  :root body.vias-mobile .alternative-hero .section-head > div { flex: initial; }
  :root body.vias-mobile .mobile-primary-search { display: grid; gap: 7px; margin: 0 0 10px; font-size: 12px; }
  :root body.vias-mobile .alternative-filters { grid-template-columns: 1fr; gap: 12px; margin: 0; }
  .mobile-alternative-filters { margin-bottom: 8px; }
  .mobile-alternative-filters #alternativeClearBtn { margin-top: 10px; width: 100%; }
  .mobile-alternative-summary { margin-bottom: 8px; }
  :root body.vias-mobile .alternative-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
  :root body.vias-mobile .alternative-summary .shortage-kpi { min-height: 86px; padding: 10px; }
  :root body.vias-mobile .alternative-summary .shortage-kpi strong { font-size: 23px; }
  :root body.vias-mobile .alternative-summary .shortage-kpi > span { font-size: 10px; }
  :root body.vias-mobile .alternative-summary .shortage-kpi > em { font-size: 11px; }
  :root body.vias-mobile #alternativeFilterScope { display: none; }
  .mobile-help { margin: 0; border: 0; background: none; }
  .mobile-help > summary { min-height: 34px; padding: 6px 0; color: var(--muted); font-size: 12px; }
  .mobile-help .shortage-intro { margin: 8px 0; font-size: 13px; line-height: 1.5; }
  .mobile-help .alternative-method { margin: 8px 0; padding: 10px; }
  :root body.vias-mobile .alternative-report > .section-head { flex-wrap: wrap; }
  :root body.vias-mobile .alternative-classification > header { padding: 10px; }
  :root body.vias-mobile .alternative-card > header { padding: 12px; }
  :root body.vias-mobile .alternative-card h3 { font-size: 18px; }
  :root body.vias-mobile .alternative-card > header p { font-size: 13px; line-height: 1.45; }
  :root body.vias-mobile .alternative-member { grid-template-columns: minmax(0, 1fr) 60px 65px; gap: 8px; padding: 10px; }
  :root body.vias-mobile .alternative-member .alternative-member-description { font-size: 12px; line-height: 1.4; font-weight: 400; }
  :root body.vias-mobile .alternative-member > div:first-child strong { font-size: 15px; }
  :root body.vias-mobile .alternative-member > div:first-child span { white-space: normal; font-size: 11px; }
  :root body.vias-mobile .alternative-member > div:not(:first-child) strong { font-size: 15px; }
  :root body.vias-mobile .alternative-recommendation p { font-size: 13px; line-height: 1.5; }

  .mobile-advanced-filters { grid-column: 1 / -1; margin: 0; }
  .mobile-advanced-filters .mobile-disclosure-content { display: grid; gap: 12px; }
  .mobile-advanced-filters:not([open]) > .mobile-disclosure-content { display: none; }
  :root body.vias-mobile .advanced-filters { grid-template-columns: 1fr; gap: 10px; }

  .mobile-bottom-nav { position: fixed; z-index: 18; inset: auto 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -4px 18px var(--shadow); }
  .mobile-bottom-nav > button { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 52px; padding: 5px 2px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-size: 11px; line-height: 1.2; cursor: pointer; }
  .mobile-bottom-nav svg { width: 21px; height: 21px; }
  .mobile-bottom-nav > button[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent), transparent 91%); font-weight: 700; }
  .mobile-bottom-nav > button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .mobile-notice-dot { position: absolute; top: 6px; left: calc(50% + 7px); width: 7px; height: 7px; border-radius: 50%; background: var(--exit); }
  body.mobile-keyboard-open .mobile-bottom-nav { display: none; }
  :root body.vias-mobile .sidebar { z-index: 100; }
  :root body.vias-mobile .nav-overlay { z-index: 90; }
  :root body.vias-mobile #status { position: static; padding-bottom: calc(80px + env(safe-area-inset-bottom)); font-size: 11px; }
  :root body.vias-mobile .inventory-access-form .input { font-size: 16px; }
  :root body.vias-mobile .inventory-access-dialog { max-height: calc(100dvh - 24px); }
}
