  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 18px;
    background: #f5f5f7;
    color: #1d1d1f;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    overscroll-behavior: none;
    max-width: 800px;
    margin: 0 auto;
  }

  /* ===== ADMIN WARNING BORDER (iPad+ only) ===== */
  @media (min-width: 601px) {
    body.admin-border::after {
      content: '';
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      border: 5px solid #ff3b30;
      pointer-events: none;
      z-index: 9999;
      animation: admin-blink 1s step-end infinite;
    }
    @keyframes admin-blink {
      0%, 49% { opacity: 1; }
      50%, 100% { opacity: 0; }
    }
  }

  /* ===== STORE SELECTOR ===== */
  .store-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    gap: 20px;
  }

  .store-logo {
    width: 240px;
    height: auto;
    margin-bottom: 16px;
  }

  .store-selector h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #1d1d1f;
  }

  #storeBtns {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .store-btn {
    width: 320px;
    padding: 14px 28px;
    font-size: 19px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 12px;
    background: #fff;
    color: #1d1d1f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
  }

  .store-btn-name {
    display: block;
    font-size: 19px;
    font-weight: 600;
  }

  .store-btn-status {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
  }

  .store-status-loading {
    color: #999;
    font-style: italic;
  }

  .store-status-done {
    color: #2e7d32;
    font-weight: 600;
  }

  .store-status-missing {
    color: #e65100;
    font-weight: 600;
  }

  .store-btn:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  }

  /* ===== STATUS CHECK INFO ===== */
  #statusCheckInfo {
    font-size: 13px;
    color: #999;
    text-align: center;
    margin-bottom: 6px;
  }

  #statusCheckInfo a {
    color: #007aff;
    text-decoration: none;
    margin-left: 6px;
    font-weight: 500;
  }

  /* ===== TOP BAR ===== */
  .top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #1d1d1f;
    color: #fff;
    gap: 12px;
  }

  .top-bar-back {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
  }

  .top-bar-store {
    font-size: 22px;
    font-weight: 700;
    flex: 1;
  }

  .top-bar-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    white-space: nowrap;
  }

  .top-bar-username {
    font-size: 14px;
    color: #ccc;
    font-weight: 500;
  }

  .top-bar-role {
    font-size: 11px;
    font-weight: 600;
    color: #999;
  }

  .top-bar-role.role-admin {
    color: #ff9500;
  }

  /* ===== TOGGLES GROUP ===== */
  .toggles-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  /* ===== ADMIN TOGGLE ===== */
  .admin-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    cursor: pointer;
  }

  .admin-toggle.visible {
    display: inline-flex;
  }

  .admin-toggle input { display: none; }

  .admin-toggle-track {
    width: 36px;
    height: 20px;
    background: #555;
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
  }

  .admin-toggle input:checked + .admin-toggle-track {
    background: #ff9500;
  }

  .admin-toggle-track::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
  }

  .admin-toggle input:checked + .admin-toggle-track::after {
    transform: translateX(16px);
  }

  .admin-toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    transition: color 0.2s;
  }

  .admin-toggle input:checked ~ .admin-toggle-label {
    color: #ff9500;
  }

  /* ===== DELETE TOGGLE ===== */
  .delete-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    cursor: pointer;
  }

  .delete-toggle.visible {
    display: inline-flex;
  }

  .delete-toggle input { display: none; }

  .delete-toggle-track {
    width: 36px;
    height: 20px;
    background: #555;
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
  }

  .delete-toggle input:checked + .delete-toggle-track {
    background: #ff3b30;
  }

  .delete-toggle-track::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
  }

  .delete-toggle input:checked + .delete-toggle-track::after {
    transform: translateX(16px);
  }

  .delete-toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    transition: color 0.2s;
  }

  .delete-toggle input:checked ~ .delete-toggle-label {
    color: #ff3b30;
  }

  .btn-clear-all {
    background: #ff3b30;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: none;
  }

  .btn-clear-all.visible {
    display: block;
  }

  /* ===== RECAP BAR ===== */
  .recap-bar {
    position: sticky;
    top: 54px;
    z-index: 99;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: 8px 12px;
    background: #f5f5f7;
    border-bottom: 1px solid #e0e0e0;
  }

  .recap-bar:empty { display: none; }

  .recap-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: #e8f5e9;
    color: #2e7d32;
    white-space: nowrap;
    cursor: pointer;
  }

  .recap-chip.has-missing {
    background: #fff3e0;
    color: #e65100;
  }

  .recap-chip .recap-count {
    font-weight: 700;
  }

  /* ===== LOADING ===== */
  .loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 16px;
  }

  .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #1d1d1f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  /* ===== SECTIONS ===== */
  .sections-container {
    padding: 8px 12px 120px 12px;
  }

  .section {
    margin-bottom: 12px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }

  .section-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    gap: 10px;
  }

  .section-header .section-name { flex: 1; }

  .section-header .section-count {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.85;
  }

  .section-header .section-chevron {
    font-size: 16px;
    transition: transform 0.2s;
  }

  .section.collapsed .section-chevron {
    transform: rotate(-90deg);
  }

  .section.collapsed .section-body { display: none; }

  .btn-clear-section {
    background: rgba(255,255,255,0.25);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: none;
  }

  .btn-clear-section.visible { display: block; }

  /* Section colors */
  .section-color-0 { background: #5856d6; }
  .section-color-1 { background: #ff6347; }
  .section-color-2 { background: #228b22; }
  .section-color-3 { background: #9370db; }
  .section-color-4 { background: #daa520; }
  .section-color-5 { background: #6f4e37; }
  .section-color-6 { background: #708090; }
  .section-color-7 { background: #c15189; }

  /* ===== PRODUCT TABLE ===== */
  .section-body { padding: 0; }

  .product-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  /* Column sizing via colgroup */
  .col-delete { width: 32px; }
  .col-name { /* auto: takes all remaining space */ }
  .col-data { width: 56px; }
  .col-sched { width: 36px; }

  .delete-cell {
    text-align: center;
    padding: 4px 2px;
  }

  .delete-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #ff3b30;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
  }

  .delete-btn:active {
    opacity: 0.7;
  }

  .product-table th {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    padding: 8px 3px 4px;
    text-align: center;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
  }

  .product-row {
    border-bottom: 1px solid #f0f0f0;
  }

  .product-row:last-child { border-bottom: none; }

  .section-totals-row td {
    font-size: 11px;
    font-weight: 700;
    color: #999;
    padding: 4px 2px;
    text-align: center;
    border-top: 1px solid #eee;
  }

  .section-totals-row .section-totals-label {
    text-align: right;
    padding-right: 8px;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
  }

  .product-row.active-picker {
    background: #e8f0fe;
  }

  .product-name {
    padding: 10px 8px 10px 12px;
    font-size: 19px;
    font-weight: 500;
    text-align: right;
    overflow: hidden;
    word-break: break-word;
    position: relative;
  }

  .daily-tag {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #007aff;
    background: #e3f2fd;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.2;
  }

  .product-inventory {
    text-align: center;
    padding: 8px 4px;
    width: 56px;
  }

  .inventory-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 44px;
    border-radius: 10px;
    background: #f0f0f0;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s;
  }

  .inventory-cell:active {
    background: #ddd;
  }

  .inventory-cell.empty {
    background: #fff3e0;
    border-color: #ffb74d;
  }

  .inventory-cell.has-value {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
  }

  .inventory-cell.has-value-daily {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #90caf9;
  }

  .inventory-cell.picking {
    border-color: #007aff;
    background: #e3f2fd;
  }

  .schedule-cell {
    text-align: center;
    font-size: 13px;
    color: #666;
    padding: 8px 2px;
    width: 36px;
  }

  .schedule-cell.tomorrow {
    font-weight: 700;
    color: #ff6b00;
    background: #fff8f0;
  }

  .schedule-cell.editable {
    cursor: pointer;
    border-radius: 6px;
  }

  .schedule-cell.editable:active {
    background: #e0e0e0;
  }

  .schedule-cell.schedule-picking {
    border: 2px solid #ff9500;
    background: #fff8e1;
    border-radius: 6px;
  }

  .to-receive-cell {
    text-align: center;
    padding: 8px 4px;
    width: 56px;
    border-right: 2px solid #eee;
  }

  .recv-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 44px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #888;
  }

  .recv-cell.has-value {
    color: #ff6b00;
    background: #fff3e0;
  }

  /* ===== VALUE PICKER (floating) ===== */
  .picker-overlay {
    display: none;
    position: absolute;
    left: 5%;
    right: 5%;
    z-index: 200;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 8px;
  }

  .picker-overlay.open {
    display: block;
  }

  .picker-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 199;
    background: rgba(0,0,0,0.15);
  }

  .picker-backdrop.open { display: block; }

  .picker-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .picker-grid::-webkit-scrollbar { display: none; }

  .picker-btn {
    flex-shrink: 0;
    min-width: 44px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: #f0f0f0;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.1s;
  }

  .picker-btn:active {
    background: #007aff;
    color: #fff;
  }

  .picker-btn.selected {
    background: #007aff;
    color: #fff;
  }

  .picker-btn.clear-btn {
    background: #ffecec;
    color: #ff3b30;
    font-size: 13px;
    font-weight: 700;
  }

  .picker-btn.clear-btn:active {
    background: #ff3b30;
    color: #fff;
  }

  .picker-direction-btn {
    display: none;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,0.92);
    box-shadow: 2px 0 8px rgba(0,0,0,0.10);
    font-size: 20px;
    font-weight: 700;
    color: #007aff;
    cursor: pointer;
    z-index: 2;
    line-height: 42px;
    text-align: center;
    padding: 0;
    transition: background 0.15s;
  }

  .picker-direction-btn:active {
    background: #e8e8e8;
  }

  .picker-direction-btn.visible {
    display: block;
  }

  /* ===== CONFIRM DIALOG ===== */
  .confirm-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 300;
    background: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
  }

  .confirm-overlay.open {
    display: flex;
  }

  .confirm-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 360px;
    width: 90%;
    text-align: center;
  }

  .confirm-box h3 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .confirm-box p {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
  }

  .confirm-actions {
    display: flex;
    gap: 12px;
  }

  .confirm-actions button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
  }

  .btn-confirm-cancel {
    background: #f0f0f0;
    color: #1d1d1f;
  }

  .btn-confirm-ok {
    background: #ff3b30;
    color: #fff;
  }

  /* ===== LOGIN SECTION ===== */
  .login-section {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .login-divider {
    font-size: 13px;
    color: #999;
    font-weight: 600;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 320px;
  }

  .login-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 17px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    color: #1d1d1f;
    outline: none;
    transition: border-color 0.2s;
  }

  .login-input:focus {
    border-color: #007aff;
  }

  .login-btn {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: #1d1d1f;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
  }

  .login-btn:disabled {
    opacity: 0.5;
  }

  .login-error {
    color: #ff3b30;
    font-size: 14px;
    text-align: center;
    min-height: 18px;
  }

  /* ===== USER SECTION (logged in) ===== */
  .user-section {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .user-section > div {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .user-display-name {
    font-size: 13px;
    color: #999;
    margin-top: 2px;
  }

  .footer-link {
    font-size: 15px;
    color: #007aff;
    text-decoration: none;
  }

  .footer-separator {
    color: #ccc;
    font-size: 16px;
  }

  /* ===== PASSWORD FORM (inside confirm-box) ===== */
  .password-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
  }

  /* ===== LANDSCAPE MOBILE ===== */
  @media (orientation: landscape) and (max-height: 500px) {
    .picker-btn {
      height: 36px;
      min-width: 38px;
      font-size: 15px;
    }
    .picker-grid {
      gap: 4px;
    }
  }

  /* ===== RESPONSIVE ===== */
  @media (max-width: 600px) {
    .col-data { width: 44px; }
    .col-sched { width: 26px; }
    .product-name {
      font-size: 14px;
      padding: 6px 4px 6px 6px;
    }
    .schedule-cell {
      font-size: 11px;
      padding: 6px 1px;
    }
    .product-table th {
      font-size: 9px;
      padding: 6px 1px 3px;
    }
    .inventory-cell, .recv-cell {
      width: 38px;
      height: 34px;
      font-size: 16px;
    }
    .product-inventory, .to-receive-cell {
      padding: 4px 2px;
    }
  }

  /* ===== New-app additions (kiosk access screen + read-only banner) ===== */
  .readonly-banner {
    /* Above the top-bar (z-index 100): during phases 2-3 this banner IS the
       main message — it must survive scrolling. */
    position: sticky; top: 0; z-index: 110;
    background: #fff3cd; color: #7a5c00; border-bottom: 1px solid #e6d28a;
    padding: 8px 14px; font-size: 13px; text-align: center;
  }
  .access-screen { max-width: 360px; margin: 60px auto; text-align: center; padding: 0 16px; }
  .access-screen h2 { margin-bottom: 18px; font-size: 20px; }
  .access-code-input {
    width: 100%; padding: 12px; font-size: 22px; letter-spacing: 8px; text-align: center;
    border: 1px solid #ccc; border-radius: 8px; margin-bottom: 12px;
  }
  .access-btn {
    width: 100%; padding: 12px; font-size: 16px; border: none; border-radius: 8px;
    background: #007aff; color: white; cursor: pointer; margin-bottom: 10px;
  }
  .access-btn.google { background: #fff; color: #333; border: 1px solid #ccc; }
  .access-error { color: #d33; font-size: 13px; min-height: 18px; }
  .access-divider { color: #999; font-size: 12px; margin: 14px 0; }
