/* Proluxsa · visual refresh, September 2026.
  Presentation only. Keep permission visibility, layout modes and print styles intact. */
/* Android tablet shell. Desktop and iPad keep the existing presentation. */
@media screen {
  body.android-device #appView .fullscreen-control:not(.hidden) {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: fixed; top: 10px; right: 10px; z-index: 80;
    width: 64px; min-height: 44px; padding: 2px 4px; gap: 0;
    background: #eef5f0; color: #28553c; border: 1px solid #dce7e0; border-radius: 9px;
  }
  body.android-device #appView .fullscreen-control span { font-size: 23px; line-height: 24px; }
  body.android-device #appView .fullscreen-control small { font-size: 10px; line-height: 13px; color: inherit; }
  body.android-device #appView .topbar { padding-right: 84px; }
  #appView .lot-keyboard-button { width: 100%; min-height: 44px; margin-top: 4px; padding: 7px; font-size: 12px; }
}
@media screen and (max-width: 1400px) {
  body.android-device { min-height: 100dvh; }
  body.android-device #appView { display: block; min-height: 100dvh; }
  body.android-device #loginView { min-height: 100dvh; }
  body.android-device #appView .content { width: 100%; min-width: 0; padding: 78px 14px 24px; }
  body.android-device.compact-mobile-form-view #appView .content { padding-top: 78px; }
  body.android-device.compact-mobile-form-view::before { display: none; }
  body.android-device #appView .topbar {
    display: flex; position: fixed; inset: 0 0 auto; z-index: 40;
    min-height: 64px; margin: 0; padding: 10px 84px 10px 66px;
  }
  body.android-device #appView .topbar .page-icon { display: none; }
  body.android-device #appView .topbar h2 { font-size: 20px; line-height: 1.2; }
  body.android-device #appView .topbar p { font-size: 12px; }
  body.android-device #appView .page-heading { min-width: 0; flex: 1 1 auto; }
  body.android-device #appView .mobile-menu-button {
    display: grid; position: fixed; top: 10px; left: 10px; z-index: 80;
    width: 44px; height: 44px; padding: 10px; place-items: center; gap: 4px;
    border: 1px solid #dce7e0; border-radius: 9px; background: #eef5f0;
  }
  body.android-device #appView .mobile-menu-button span { width: 22px; height: 2px; background: #28553c; }
  body.android-device.menu-open #mobileMenuButton span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  body.android-device.menu-open #mobileMenuButton span:nth-child(2) { opacity: 0; }
  body.android-device.menu-open #mobileMenuButton span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  body.android-device #mainSidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 70;
    width: min(300px, calc(100vw - 52px)); height: 100dvh; min-height: 0; max-height: 100dvh;
    display: flex; flex-direction: column; gap: 8px; padding: 8px 10px;
    overflow: hidden; transform: translateX(-105%); transition: transform .2s ease;
    box-shadow: 12px 0 32px #142e2430;
  }
  body.android-device.menu-open #mainSidebar { transform: translateX(0); }
  body.android-device #appView .sidebar-overlay {
    display: none; position: fixed; inset: 0; z-index: 60;
    background: #081a1166; backdrop-filter: none;
  }
  body.android-device.menu-open #appView .sidebar-overlay { display: block; }
  body.android-device #mainSidebar .brand {
    flex: 0 0 auto; min-height: 60px; grid-template-columns: 54px minmax(0, 1fr);
    gap: 7px; padding: 4px 2px 8px 48px;
  }
  body.android-device #mainSidebar .brand-logo { width: 54px; }
  body.android-device #mainSidebar .brand strong { font-size: 11px; }
  body.android-device #mainSidebar .brand small { font-size: 11px; }
  body.android-device #mainSidebar .sidebar-search { flex: 0 0 auto; min-height: 44px; margin: 0; }
  body.android-device #mainSidebar .nav {
    flex: 1 1 auto; min-height: 0; display: grid; align-content: start;
    grid-auto-rows: max-content; gap: 3px; overflow-y: auto; overscroll-behavior: contain;
  }
  body.android-device #mainSidebar .submenu { align-content: start; grid-auto-rows: max-content; gap: 2px; }
  body.android-device #mainSidebar :is(.nav-item, .submenu button) {
    min-height: 44px; padding: 9px 10px; font-size: 13px; line-height: 1.3;
  }
  body.android-device #mainSidebar .nav-icon { flex-shrink: 0; width: 18px; height: 18px; }
  body.android-device #mainSidebar .session {
    flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr;
    gap: 5px; margin: 0; padding: 7px; border-radius: 9px;
  }
  body.android-device #mainSidebar .session span { display: block; grid-column: 1 / -1; font-size: 12px; }
  body.android-device #mainSidebar .session button { min-height: 44px; padding: 7px; font-size: 12px; order: 0; }
}
@media screen {
  :root {
    --bg: #f5f7f8;
    --panel: #fff;
    --panel-soft: #f8faf9;
    --ink: #20342b;
    --muted: #64756d;
    --line: #e0e8e3;
    --green: #087b50;
    --green-dark: #086342;
    --green-soft: #edf7f1;
    --app-canvas: #f5f7f8;
    --app-surface: #fff;
    --app-surface-soft: #f8faf9;
    --app-border: #e0e8e3;
    --app-ink: #20342b;
    --app-muted: #64756d;
    --app-green: #087b50;
    --app-shadow: 0 3px 16px rgba(25, 48, 37, .045);
    --shadow: 0 16px 48px rgba(25, 48, 37, .1);
    --soft-shadow: var(--app-shadow);
  }

  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
  }

  #appView {
    --app-title-size: clamp(25px, 2vw, 30px);
    --app-section-title-size: 21px;
    --app-body-size: 15px;
    --app-label-size: 14px;
    --app-button-size: 14px;
    --app-control-height: 44px;
    --app-control-radius: 10px;
  }

  /* Navigation: quieter hierarchy with a distinct current location. */
  #mainSidebar {
    background: #fff;
    border-right-color: #e2e9e5;
    box-shadow: none;
    gap: 16px;
    padding: 20px 14px 14px;
  }
  #mainSidebar .brand {
    min-height: 82px;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 8px 7px 20px;
    border-bottom: 1px solid #e7eee9;
  }
  #mainSidebar .brand::after { display: none; }
  #mainSidebar .brand-logo { width: 96px; }
  #mainSidebar .brand strong { color: #213d2e; font-weight: 700; font-size: 13px; line-height: 1.45; }
  #mainSidebar .brand small { color: #6b7e72; font-size: 12px; font-weight: 500; margin-top: 5px; }
  #mainSidebar .sidebar-search {
    min-height: 44px;
    margin: 0 2px 3px;
    border-color: #e0e8e3;
    border-radius: 10px;
    background: #f6f8f7;
    box-shadow: none;
  }
  #mainSidebar .sidebar-search input { font-weight: 500; font-size: 13px; }
  #mainSidebar .sidebar-search input::placeholder { color: #65766c; }
  #mainSidebar .sidebar-search:focus-within { border-color: #087b50; box-shadow: 0 0 0 3px #087b501a; }
  #mainSidebar .nav { gap: 5px; }
  #mainSidebar :is(.nav-item, .submenu button) {
    min-height: 44px;
    padding: 10px 11px;
    border-radius: 9px;
    border-color: transparent;
    color: #506358;
    font-size: 14px;
    font-weight: 550;
    line-height: 1.4;
    box-shadow: none;
  }
  #mainSidebar .nav-parent { color: #284334; font-weight: 700; }
  #mainSidebar .submenu { border-left-color: #e0eae4; margin-left: 15px; padding-left: 10px; gap: 3px; }
  #mainSidebar .submenu button { font-size: 13px; }
  #mainSidebar :is(.nav-item, .submenu button):hover { background: #f0f6f2; color: #086342; transform: none; }
  #mainSidebar .nav-item.active { background: #eaf5ee; color: #086342; font-weight: 700; }
  #mainSidebar .submenu button.active,
  #mainSidebar .nav-item.active:not(.nav-parent) {
    color: #fff;
    background: #126445;
    border-color: #126445;
    box-shadow: 0 3px 8px #12644518;
    font-weight: 650;
  }
  #mainSidebar .nav-icon { width: 19px; height: 19px; stroke-width: 1.8; }
  #mainSidebar .session { background: #f7faf8; border-color: #e3ebe6; border-radius: 12px; padding: 12px; gap: 8px; }
  #mainSidebar .session span { font-size: 13px; line-height: 1.45; color: #365343; overflow-wrap: anywhere; }
  #mainSidebar .session button { min-height: 40px; font-size: 12px; font-weight: 600; border-radius: 8px; }
  #mainSidebar .session-secondary { background: #fff; border-color: #d9e5dd; color: #3c5c49; }

  /* A light header keeps the page title and status readable. */
  #appView .topbar {
    background: #fff;
    color: #20342b;
    border-bottom: 1px solid #e0e8e3;
    box-shadow: 0 2px 10px #1c382805;
  }
  #appView .topbar .page-icon { color: #087b50; background: #edf6f0; border: 1px solid #dcece2; border-radius: 12px; }
  #appView .topbar h2 { color: #203c2d; font-weight: 720; letter-spacing: -.025em; line-height: 1.2; }
  #appView .topbar #pageSubtitle { color: #66776e; font-size: 13px; line-height: 1.45; font-weight: 400; }
  #appView .sap-pill { border: 1px solid #dce7e0; background: #f3f8f5; color: #2c6245; font-weight: 600; }
  #appView .sap-pill.connected { background: #edf8f0; border-color: #d3eada; color: #1b6840; }
  #appView .sap-pill.checking { background: #f4f6f7; border-color: #e0e5e8; color: #52656e; }
  #appView .sap-pill.offline { background: #fff6e5; border-color: #f1ddb3; color: #825213; }
  #appView .sap-pill.error { background: #fff0f0; border-color: #f2d0d0; color: #a13737; }

  /* Shared surfaces retain all existing grids and scroll containers. */
  #appView :is(.panel, .viz-card, .inner-panel, .issue-panel, .transfer-builder) {
    border-color: #e0e8e3;
    border-radius: 14px;
    box-shadow: var(--app-shadow);
  }
  #appView .active-view :is(.panel-head h3, .panel > h3, .form-grid h3, .viz-card h3, .inner-panel h3) {
    color: #254132;
    font-weight: 700;
    letter-spacing: -.015em;
  }
  #appView :is(.panel-head h3, .panel > h3, .viz-card h3)::after { display: none; }
  #appView .panel-head { gap: 16px; margin-bottom: 18px; }
  #appView .active-view label { color: #3c5245; font-weight: 600; }
  #appView .active-view :is(.muted, .form-message, .quantity-help):not(.error) { color: #64756c; font-weight: 400; }

  #appView .active-view :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    background-color: #fff;
    border-color: #cfddd4;
    color: #223e2e;
    box-shadow: 0 1px 2px #18362304;
    font-weight: 500;
  }
  #appView .active-view :is(input, textarea)::placeholder { color: #738379; opacity: 1; font-weight: 400; }
  #appView .active-view :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
    border-color: #16845a;
    box-shadow: 0 0 0 3px #16845a16;
    outline: 2px solid transparent;
  }
  #appView .active-view :is(input[readonly], textarea[readonly], input:disabled, select:disabled, textarea:disabled) {
    background-color: #f2f5f3;
    border-color: #e0e7e2;
    color: #66776d;
    box-shadow: none;
  }
  #appView :is(input[type="checkbox"], input[type="radio"]) { accent-color: #087b50; }
  #appView .active-view :where(button[type="submit"], .primary-button, .small-button) {
    background: #087b50;
    border: 1px solid #087b50;
    color: #fff;
    font-weight: 650;
    box-shadow: 0 2px 4px #087b5014;
  }
  #appView .active-view :where(button[type="submit"], .primary-button, .small-button):hover:not(:disabled) {
    background: #086342;
    border-color: #086342;
    transform: none;
  }
  #appView .active-view :is(.secondary-button, .secondary, .row-action) {
    background: #fff;
    border: 1px solid #ccdcd2;
    color: #256344;
    font-weight: 600;
    box-shadow: none;
  }
  #appView .active-view :is(.secondary-button, .secondary, .row-action):hover:not(:disabled) { background: #edf7f0; border-color: #a9c9b6; transform: none; }
  #appView .active-view :is(.danger-button, .danger-action, .row-action.danger) { color: #a53535; background: #fff2f1; border-color: #efccca; box-shadow: none; }
  #appView .active-view :is(.danger-button, .danger-action, .row-action.danger):hover:not(:disabled) { background: #ffe7e5; color: #922d2d; border-color: #e3b3af; }
  #appView button:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }
  #appView :is(button, a, summary):focus-visible { outline: 3px solid #288c61; outline-offset: 3px; }

  #appView .active-view :is(.of-filters, .of-date-range, .waste-list-filters, .investigation-filters) {
    background: #f8faf9;
    border-color: #e1e9e4;
    border-radius: 12px;
  }
  #appView :is(.dashboard-tabs, .config-tabs, .auth-tabs, .transfer-mine-tabs) { background: #eef3f0; border-color: #dfe8e2; border-radius: 10px; box-shadow: none; }
  #appView .active-view :is(.dashboard-tab, .config-tabs button, .auth-tabs button, .transfer-mine-tabs button) { color: #516659; font-weight: 600; border-radius: 8px; }
  #appView .active-view :is(.dashboard-tab.active, .config-tabs button.active, .auth-tabs button.active, .transfer-mine-tabs button.active) {
    background: #126445;
    color: #fff;
    border-color: #126445;
    box-shadow: 0 2px 5px #123d2910;
  }

  /* Tables: keep meaningful states and selection above zebra striping. */
  #appView .table-wrap { border-color: #dfe7e2; border-radius: 11px; }
  #appView .active-view th { color: #547060; background: #f3f7f4; text-transform: none; font-weight: 650; letter-spacing: 0; box-shadow: inset 0 -1px 0 #dce6df; }
  #appView .active-view td:not(.error) { color: #344b3d; border-bottom-color: #e8eeea; font-variant-numeric: tabular-nums; }
  #appView .active-view tbody tr:nth-child(even):not([class]) { background: #fbfcfb; }
  #appView .active-view tbody tr:hover:not(.selected-row) { background-color: #f0f7f3; box-shadow: none; }
  #appView .active-view tbody tr.selected-row { background: #e6f4eb; box-shadow: inset 3px 0 0 #087b50; }
  #appView .active-view td :is(strong, b) { font-weight: 650; }
  #appView :is(.pagination, .pagination-bar, .table-pagination) { color: #66786d; background: #fafcfb; border-color: #e2ebe5; }
  #appView .metrics article { border-radius: 14px; border-color: #e0e8e3; box-shadow: var(--app-shadow); }
  #appView .metrics strong { font-weight: 720; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

  /* Alert controls remain separate actions on each visible alert. */
  #appView .supply-alert-mailbox { border: 1px solid #ebcdcb; background: #fff0ee; color: #aa3934; box-shadow: none; border-radius: 10px; font-weight: 650; }
  #appView .supply-alert-mailbox:hover,
  #appView .supply-alert-mailbox[aria-expanded="true"] { background: #ffe4df; color: #922d29; transform: none; }
  #appView .supply-alert-mailbox strong { background: #aa3934; color: #fff; }
  #appView .investigation-alert-mailbox { border-color: #eedbb7; background: #fff7e9; color: #8d5b17; }
  #appView .investigation-alert-mailbox:hover,
  #appView .investigation-alert-mailbox[aria-expanded="true"] { background: #fdefd5; color: #75470e; }
  #appView .investigation-alert-mailbox strong { background: #93611c; color: #fff; }
  #appView .supply-alert-panel { border: 1px solid #dde7e0; border-radius: 14px; box-shadow: 0 16px 48px #173b2826; background: #fff; }
  #appView .supply-alert-panel-head { background: #f7faf8; border-color: #e3ebe6; }
  #appView .supply-alert-panel-head strong { color: #254533; font-weight: 700; }
  #appView .supply-alert-panel-head span { color: #61766a; font-weight: 600; letter-spacing: .03em; }
  #appView .supply-alert-panel-head button { color: #50695a; background: #eaf1ec; }
  #appView .supply-alert-mailbox-item { background: #fff; border-color: #e7ede9; }
  #appView .supply-alert-mailbox-item p { color: #52685a; font-size: 13px; line-height: 1.55; }
  #appView .supply-alert-mailbox-item-head strong { color: #234d35; }
  #appView .supply-alert-mailbox-item-head span { background: #fff3e0; color: #895b1d; }
  #appView .supply-alert-panel footer { color: #65786a; background: #f7faf8; border-color: #e3ebe6; padding: 12px 16px; font-size: 12px; }
  #appView .alert-sound-controls { margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed #dce7df; }
  #appView .alert-sound-controls .row-action { min-height: 38px; padding: 8px 12px; border: 1px solid #bfd9c8; border-radius: 8px; background: #eef7f1; color: #216541; font-size: 12px; font-weight: 650; }
  #appView .alert-sound-controls .row-action[aria-pressed="true"] { background: #f4f5f5; color: #5a6b62; border-color: #dbe3de; }
  #appView .investigation-alert-details:hover { background: #f6faf7; }

  .app-modal-panel, .scanner-panel { border-radius: 16px; border-color: #dde7df; box-shadow: 0 24px 70px #142e2430; }
  .toast { border-radius: 12px; box-shadow: 0 10px 32px #142e2425; font-size: 14px; line-height: 1.5; }

  /* Login uses the same quiet palette and comfortable controls. */
  #loginView { background: #f5f7f8; }
  #loginView .login-visual { background: linear-gradient(145deg, #123e2c 0%, #185439 65%, #216548 100%); }
  #loginView .login-visual h2 { font-weight: 650; letter-spacing: -.035em; line-height: 1.1; }
  #loginView .login-panel { padding: 28px; border-color: #e0e8e3; border-radius: 18px; box-shadow: 0 16px 60px #183b2910; }
  #loginView .login-copy h1 { color: #254132; font-weight: 700; letter-spacing: -.025em; }
  #loginView .login-panel label { font-weight: 600; color: #425b4c; }
  #loginView .remember-help { display: block; margin: -12px 0 0 27px; color: #6a7c72; font-size: 12px; line-height: 1.4; }
  #loginView .login-panel :is(input[type="email"], input[type="password"]) { min-height: 48px; border-color: #cfddd4; border-radius: 10px; font-size: 16px; font-weight: 400; }
  #loginView .login-panel button[type="submit"] { min-height: 48px; background: #087b50; border-radius: 10px; font-weight: 650; box-shadow: 0 4px 12px #087b5020; }
  #loginView .login-panel button[type="submit"]:hover { background: #086342; transform: none; }
}

@media screen and (min-width: 1181px) {
  #appView { grid-template-columns: 270px minmax(0, 1fr); }
  #appView .content { padding: 0 28px 36px; }
  #appView .topbar { min-height: 92px; margin: 0 -28px 26px; padding: 18px 28px; }
  #appView .panel { padding: 24px; }
}

@media screen and (max-width: 1180px) {
  #appView .topbar { min-height: 66px; padding-top: 10px; padding-bottom: 10px; }
  #appView .content { padding-top: 82px; }
  #appView .mobile-menu-button { border-color: #dce7e0; background: #eef5f0; box-shadow: none; }
  #appView .mobile-menu-button span { background: #28553c; }
  #appView .topbar h2 { font-size: 21px; }
  #mainSidebar { padding-top: 18px; }
}

@media screen and (max-width: 640px) {
  #appView { --app-title-size: 24px; --app-section-title-size: 20px; --app-body-size: 15px; --app-control-height: 46px; }
  #appView .topbar { padding-right: 12px; }
  #appView .topbar h2 { font-size: 19px; }
  #appView .topbar-actions { gap: 6px; }
  #appView .supply-alert-mailbox { border-radius: 9px; }
  #appView .active-view .panel-head { gap: 12px; }
  #appView .panel { border-radius: 12px; }
  #appView .active-view :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { font-size: 16px; }
}

@media screen and (prefers-reduced-motion: reduce) {
  #appView button, #appView .sidebar, #loginView button { transition: none; }
}

@media screen {
  #appView .active-view .error:not(.informative) { color: #b42318; }
  #appView #of-sap .of-documents > section { min-width: 0; }
}
@media screen and (min-width: 701px) {
  #appView :is(#of-sap, #reporte-produccion) .of-date-range { grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: 16px; background: transparent; }
}
@media screen and (max-width: 900px) {
  body.compact-mobile-form-view #appView .content { padding-top: 66px; }
  body.compact-mobile-form-view::before { background: #fff; border-bottom: 1px solid #e0e8e3; box-shadow: 0 2px 10px #1c382805; }
}
@media screen {
  #appView .active-view label { text-transform: none; letter-spacing: 0; }
}
@media screen and (max-width: 640px) {
  #appView .topbar { gap: 8px; }
  #appView .topbar .page-heading { flex: 1 1 auto; min-width: 0; }
  #appView .topbar .page-heading > div { min-width: 0; }
  #appView .topbar #pageSubtitle { max-width: 100%; }
  body.compact-transfer-builder-view #appView .topbar h2 { font-size: 19px; }
}
@media screen and (max-width: 480px) {
  #appView .topbar #pageSubtitle { display: none; }
  #appView .topbar h2 { overflow-wrap: anywhere; }
}

/* Fixed receipt actions and bounded operational tables. */
@media screen {
  #appView .table-scroll {
    min-width: 0;
    max-width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #dfe7e2;
    border-radius: 11px;
    background: #fff;
  }
  #appView #entrada-pt-auto.active-view {
    --receipt-footer-space: calc(104px + env(safe-area-inset-bottom, 0px));
    padding-bottom: var(--receipt-footer-space);
    scroll-margin-bottom: var(--receipt-footer-space);
    animation: none;
    transform: none;
  }
  #appView #entrada-pt-auto .automatic-receipt-panel {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 24px;
  }
  #appView #entrada-pt-auto .automatic-receipt-table-wrap {
    max-height: min(52vh, 640px);
    overscroll-behavior-x: contain;
    scroll-padding-bottom: 16px;
  }
  #appView #entrada-pt-auto .automatic-receipt-table th {
    top: 0;
    z-index: 2;
  }
  #appView #entrada-pt-auto #automaticReceiptError {
    margin: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  #appView #entrada-pt-auto.active-view .automatic-receipt-actions {
    position: fixed;
    z-index: 25;
    inset: auto 0 0 270px;
    width: auto;
    max-width: none;
    min-height: 76px;
    margin: 0;
    padding: 14px 28px calc(14px + env(safe-area-inset-bottom, 0px));
    gap: 14px;
    align-items: center;
    justify-content: flex-end;
    flex-direction: row;
    flex-wrap: nowrap;
    border: 0;
    border-top: 1px solid #d6e3da;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(25, 48, 37, .08);
    backdrop-filter: none;
  }
  #appView #entrada-pt-auto.active-view .automatic-receipt-actions button {
    width: auto;
    min-width: 0;
    min-height: 46px;
    padding: 11px 18px;
    font-size: 15px;
    line-height: 1.35;
    white-space: normal;
  }
}
@media screen and (max-width: 1180px) {
  #appView #entrada-pt-auto.active-view .automatic-receipt-actions {
    left: 0;
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
  }
}
@media screen and (max-width: 700px) {
  #appView #entrada-pt-auto.active-view {
    --receipt-footer-space: calc(156px + env(safe-area-inset-bottom, 0px));
  }
  #appView #entrada-pt-auto.active-view .automatic-receipt-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  #appView #entrada-pt-auto.active-view .automatic-receipt-actions button {
    width: 100%;
  }
}
@media screen {
  #appView #entrada-pt-auto .automatic-receipt-fields { align-items: start; }
  #appView #entrada-pt-auto .automatic-receipt-label-options {
    grid-column: span 2;
    min-width: 0;
    padding: 12px 14px;
    gap: 10px;
    border-radius: 10px;
  }
  #appView #entrada-pt-auto .automatic-label-choice { gap: 16px; }
  #appView #entrada-pt-auto .automatic-label-choice label { min-width: 0; }
  #appView #entrada-pt-auto .automatic-label-count { flex: 0 0 auto; gap: 10px; }
  #appView #entrada-pt-auto .automatic-receipt-summary { border-radius: 10px; overflow: hidden; }
  #appView #entrada-pt-auto .automatic-receipt-summary > div { min-width: 0; overflow-wrap: anywhere; }
}
@media screen and (max-width: 980px) {
  #appView #entrada-pt-auto .automatic-receipt-label-options { grid-column: 1 / -1; }
}

/* Lot selection priority: oldest first, with text labels supplied by the UI. */
@media screen {
  #appView .lot-priority-oldest {
    --lot-priority-accent: #c52b3d;
    --lot-priority-ink: #8b1e2d;
    --lot-priority-bg: #fff1f3;
    --lot-priority-bg-hover: #ffe3e7;
    --lot-priority-border: #efb8c0;
  }

  #appView .lot-priority-middle {
    --lot-priority-accent: #bd7800;
    --lot-priority-ink: #755000;
    --lot-priority-bg: #fff7dc;
    --lot-priority-bg-hover: #ffedb0;
    --lot-priority-border: #e9cc80;
  }

  #appView .lot-priority-newest {
    --lot-priority-accent: #16834f;
    --lot-priority-ink: #0d6038;
    --lot-priority-bg: #edf8f1;
    --lot-priority-bg-hover: #daf0e2;
    --lot-priority-border: #acd7bc;
  }

  #appView .lot-priority-unknown {
    --lot-priority-accent: #718078;
    --lot-priority-ink: #4d5d55;
    --lot-priority-bg: #f3f6f4;
    --lot-priority-bg-hover: #e8eeea;
    --lot-priority-border: #cbd5cf;
  }

  #appView .lot-priority-combobox {
    position: relative;
    min-width: 0;
    width: 100%;
  }

  #appView .lot-priority-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 16px;
    min-width: 0;
    margin: 7px 0 9px;
    padding: 9px 11px;
    border: 1px solid #dfe7e2;
    border-radius: 9px;
    background: #f8faf9;
    color: #52665a;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
  }

  #appView .lot-priority-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  #appView .lot-priority-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border: 1px solid color-mix(in srgb, var(--lot-priority-accent, #718078) 72%, #000);
    border-radius: 50%;
    background: var(--lot-priority-accent, #718078);
    box-shadow: 0 0 0 2px var(--lot-priority-bg, #f3f6f4);
  }

  #appView .lot-priority-results {
    z-index: 45;
    max-height: min(360px, 48vh);
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    border-color: #ccd9d1;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 16px 38px rgba(27, 54, 40, .18);
  }

  #appView .lot-priority-results > .lot-priority-legend {
    position: sticky;
    z-index: 2;
    top: 0;
    margin: 0 0 6px;
    background: rgba(248, 250, 249, .98);
    box-shadow: 0 1px 0 #dfe7e2;
  }

  #appView .active-view .lot-priority-option {
    width: 100%;
    min-height: 52px;
    margin: 0 0 4px;
    padding: 10px 11px;
    border: 1px solid var(--lot-priority-border, #cbd5cf);
    border-left: 5px solid var(--lot-priority-accent, #718078);
    border-radius: 8px;
    background: var(--lot-priority-bg, #f3f6f4);
    color: var(--lot-priority-ink, #4d5d55);
    text-align: left;
    box-shadow: none;
  }

  #appView .active-view .lot-priority-option:last-child {
    margin-bottom: 0;
  }

  #appView .active-view .lot-priority-option :is(strong, b) {
    color: var(--lot-priority-ink, #4d5d55);
  }

  #appView .active-view .lot-priority-option :is(small, .muted) {
    color: color-mix(in srgb, var(--lot-priority-ink, #4d5d55) 82%, #fff);
  }

  #appView .active-view .lot-priority-option:hover:not(:disabled) {
    border-color: var(--lot-priority-accent, #718078);
    border-left-color: var(--lot-priority-accent, #718078);
    background: var(--lot-priority-bg-hover, #e8eeea);
    color: var(--lot-priority-ink, #4d5d55);
    transform: none;
  }

  #appView .active-view .lot-priority-option:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--lot-priority-accent, #718078) 42%, transparent);
    outline-offset: 2px;
    border-color: var(--lot-priority-accent, #718078);
  }

  #appView .lot-priority-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    max-width: 100%;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid var(--lot-priority-border, #cbd5cf);
    border-radius: 999px;
    background: var(--lot-priority-bg, #f3f6f4);
    color: var(--lot-priority-ink, #4d5d55);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }

  #appView .lot-priority-badge small {
    margin: 0;
    color: inherit;
    font-size: 10px;
    font-weight: 650;
  }

  #appView .lot-priority-result-meta {
    display: grid;
    flex: 0 0 auto;
    justify-items: end;
    gap: 5px;
  }

  #appView .lot-priority-selection-hint {
    display: flex;
    min-height: 28px;
    margin-top: 7px;
  }

  #appView .transfer-batch-row > .lot-priority-combobox,
  #appView .inventory-waste-batch-row > .lot-priority-combobox {
    min-width: 0;
  }

  #appView .lot-priority-selected {
    border-left: 5px solid var(--lot-priority-accent, #718078) !important;
    background-color: var(--lot-priority-bg, #f3f6f4) !important;
    color: var(--lot-priority-ink, #4d5d55) !important;
  }

  #appView .lot-priority-selected:focus {
    border-color: var(--lot-priority-accent, #718078) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lot-priority-accent, #718078) 22%, transparent) !important;
  }

  #appView option.lot-priority-oldest,
  #appView option.lot-priority-middle,
  #appView option.lot-priority-newest,
  #appView option.lot-priority-unknown {
    background-color: var(--lot-priority-bg, #f3f6f4);
    color: var(--lot-priority-ink, #4d5d55);
    font-weight: 650;
  }
}

@media screen and (max-width: 1180px) {
  #appView .lot-priority-results {
    max-height: min(400px, 52vh);
  }

  #appView .active-view .lot-priority-option {
    min-height: 56px;
    padding: 11px 12px;
  }

  #appView .lot-priority-selected {
    min-height: 48px;
  }
}

@media screen and (max-width: 720px) {
  #appView .lot-priority-legend {
    gap: 7px 12px;
    padding: 8px 9px;
    font-size: 11px;
  }

  #appView .lot-priority-results {
    right: 0;
    left: 0;
    max-height: 46vh;
  }

  #appView .active-view .lot-priority-option {
    align-items: flex-start;
    gap: 8px;
  }

  #appView .lot-priority-result-meta {
    justify-items: start;
  }

  #appView .lot-priority-badge {
    font-size: 10px;
  }
}
