/* ── CONARTIST — POS DARK THEME ── */
  /* Disable double-tap-to-zoom across every interactive POS surface. The viewport
     meta tag's `user-scalable=no` is honoured by some browsers but not iOS Safari;
     `touch-action: manipulation` on the tappable elements reliably suppresses the
     300ms double-tap delay AND the zoom gesture, which previously caused the cart /
     tile / button grid to bounce in scale every time the cashier tapped quickly. */
  #screen-pos,
  #screen-pos button,
  #screen-pos .pos-product-tile,
  #screen-pos .pos-cart-item,
  #screen-pos .pos-col-chip,
  #screen-pos .pos-channel-btn,
  #screen-pos input,
  #screen-pos select {
    touch-action: manipulation;
  }

  /* ── POS STRUCTURAL LAYOUT ── */
  .pos-products-panel {
    display: flex;
    flex-direction: column;
    background: #1C1917;
    overflow: hidden;
  }

  .pos-cart-panel {
    display: flex;
    flex-direction: column;
    background: #252220;
    border-left: 1px solid #2C2927;
    overflow: hidden;
  }

  .pos-channel-bar {
    display: flex;
    gap: 8px;
    padding: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid #2C2927;
    background: #1C1917;
  }

  .pos-products-panel input.pos-search-input {
    margin: 10px 12px 0;
    width: calc(100% - 24px);
  }

  #pos-product-grid {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
  }


  .pos-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    height: calc(100dvh - 160px);
  }
  /* Stack only on real phone widths — between 640 and 900px (iPad split-view, narrow
     landscape, small laptops) keep products + cart side-by-side with a slimmer cart
     column so the cart isn't wasting half the screen as an empty box. */
  @media (max-width: 640px) {
    .pos-layout { grid-template-columns: 1fr; height: auto; }
  }
  @media (min-width: 641px) and (max-width: 900px) {
    .pos-layout {
      grid-template-columns: 1fr 240px;
      gap: 10px;
      height: calc(100dvh - 160px);
    }
  }

  /* POS Channel Bar */
  .pos-channel-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #3C3936;
    background: transparent;
    color: #A8A29E;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .pos-channel-btn:hover { border-color: var(--accent); color: var(--accent); }
  .pos-channel-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }

  /* POS Search */
  .pos-search-wrap { margin-bottom: 14px; }
  .pos-search-input {
    width: 100%;
    padding: 10px 16px;
    background: #2C2927;
    border: 1px solid #3C3936;
    border-radius: var(--radius-md);
    color: #F7F5F0;
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
  }
  .pos-search-input::placeholder { color: #6B6560; }
  .pos-search-input:focus { border-color: var(--accent); }

  /* POS Product Grid — flat tile grid. Chip rows above (series → collection → category)
     handle filtering; the grid itself just renders matching products. */
  .pos-products { overflow-y: auto; }
  #pos-product-grid {
    padding: 8px;
  }
  .pos-product-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 6px;
  }
  /* Collection filter chip row — horizontal-scroll strip just below the search bar.
     Sticky to the top of the products pane so the cashier can always reach a different
     collection mid-sale. Hides scrollbar but stays drag-scrollable on iPad. */
  .pos-collection-chips {
    display: flex;
    gap: 6px;
    padding: 6px 10px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid #2C2927;
    background: #1C1917;
    position: sticky;
    top: 0;
    z-index: 5;
  }
  .pos-collection-chips::-webkit-scrollbar { display: none; }
  .pos-collection-chips:empty { display: none; }

  .pos-col-chip {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 18px;
    border: 1px solid #3C3936;
    background: #2C2927;
    color: #A8A29E;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    min-height: 36px;
  }
  .pos-col-chip:hover { border-color: var(--accent); color: #F7F5F0; }
  .pos-col-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #F7F5F0;
  }
  .pos-col-chip-count {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    color: inherit;
    opacity: 0.85;
  }
  .pos-col-chip.active .pos-col-chip-count { background: rgba(255,255,255,0.18); }
  /* The same chip component is reused on the Stock page for the sales-channel filter.
     Stock uses the light theme — override the dark POS surface so chips read as a
     normal secondary control instead of jet-black on cream. */
  #screen-stock .pos-col-chip {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
  }
  #screen-stock .pos-col-chip:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
  }
  #screen-stock .pos-col-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }
  /* Category row sits ABOVE the collection row when both are visible. Subtle border so
     the two rows read as separate axes rather than one long chip strip. */
  .pos-category-row { border-bottom: 1px solid #2C2927; padding-bottom: 6px; }
  .pos-category-row + .pos-collection-chips { padding-top: 6px; }
  /* Category chips get a slightly heavier treatment to read as the primary axis. */
  .pos-cat-chip { font-weight: 600; }
  /* Compact tile — image + name + price + stock. Smaller minmax so the grid packs as many
     per row as fits. Cashier scans a 100-product catalogue at a con, density wins over
     hover-only info. */
  .pos-product-tile {
    background: #2C2927;
    border: 1px solid #3C3936;
    border-radius: var(--radius-md);
    padding: 10px 6px 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 44px;
  }
  .pos-product-tile:hover { border-color: var(--accent); background: #332E2A; }
  .pos-product-tile:active { transform: scale(0.96); }
  .pos-product-tile.out-of-stock { opacity: 0.35; cursor: not-allowed; }
  .pos-tile-img {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
  }
  .pos-tile-emoji {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    background: #3C3936;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
  }
  .pos-tile-name {
    font-size: 11px;
    color: #D4CEC6;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    /* Cap to two lines so a long name doesn't blow up the tile height. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .pos-tile-price {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    line-height: 1.1;
  }
  .pos-tile-stock {
    font-size: 10px;
    color: #6B6560;
    line-height: 1.1;
  }

  /* Variant group tile — same height as a regular tile; chevron hints picker */
  .pos-variant-count {
    font-size: 10px;
    color: #6B6560;
    margin-left: 4px;
    font-weight: 400;
  }

  /* Floating variant picker — appears anchored to a variant tile when tapped */
  .pos-variant-picker {
    position: fixed;
    z-index: 9999;
    background: #2C2927;
    border: 1px solid #3C3936;
    border-radius: 12px;
    padding: 6px;
    min-width: 180px;
    max-width: 260px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
    animation: fadeIn 0.12s ease;
  }
  .pos-variant-picker-head {
    font-size: 11px;
    font-weight: 600;
    color: #6B6560;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 10px 8px;
    border-bottom: 1px solid #3C3936;
    margin-bottom: 4px;
  }
  .pos-variant-pick {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #D4CEC6;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s;
    text-align: left;
  }
  .pos-variant-pick:hover { background: var(--accent); color: #fff; }
  .pos-variant-pick.out { opacity: 0.35; cursor: not-allowed; }
  .pos-variant-pick-label { font-weight: 500; }
  .pos-variant-pick-meta { font-size: 11px; color: #6B6560; }
  .pos-variant-pick:hover .pos-variant-pick-meta { color: rgba(255,255,255,0.8); }

  /* POS Cart */
  .pos-cart {
    background: #242120;
    border: 1px solid #3C3936;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .pos-cart-header {
    padding: 14px 16px;
    border-bottom: 1px solid #3C3936;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .pos-void-btn {
    padding: 5px 14px;
    border: 1px solid #4C4946;
    border-radius: 20px;
    background: transparent;
    color: #A8A29E;
    font-family: var(--font-body);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .pos-void-btn:hover { border-color: var(--danger); color: var(--danger); }
  .pos-cart-items { flex: 1; overflow-y: auto; padding: 10px; }
  .pos-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid #3C3936;
  }
  .pos-cart-item:last-child { border-bottom: none; }
  .pos-cart-item-name { flex: 1; font-size: 13px; color: #D4CEC6; font-weight: 500; }
  .pos-cart-item-price { font-size: 13px; color: #A8A29E; white-space: nowrap; }
  .pos-qty-btn {
    width: 26px; height: 26px;
    background: #3C3936;
    border: none;
    border-radius: var(--radius-sm);
    color: #D4CEC6;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.1s;
    flex-shrink: 0;
  }
  .pos-qty-btn:hover { background: var(--accent); color: #fff; }
  .pos-qty-num { font-size: 13px; color: #F7F5F0; min-width: 20px; text-align: center; font-weight: 500; }
  .pos-cart-footer {
    padding: 14px 16px;
    border-top: 1px solid #3C3936;
  }
  .pos-total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
  .pos-complete-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    min-height: 44px;
  }
  .pos-complete-btn:hover { background: var(--accent-dark); }
  .pos-complete-btn:active { transform: scale(0.98); }
  .pos-empty-cart {
    text-align: center;
    padding: 40px 16px;
    color: #4C4946;
    font-size: 13px;
  }

  /* ── CONVENTIONS ── */
  .con-window-filter {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
  }
  .con-win-btn {
    padding: 5px 14px;
    border-radius: 6px;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .con-win-btn.active {
    background: var(--accent);
    color: #fff;
  }
  .con-win-btn:not(.active):hover { color: var(--text-primary); background: var(--bg); }

  /* Timeline strip */
  .con-timeline-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 24px;
    scrollbar-width: none;
  }
  .con-timeline-strip::-webkit-scrollbar { display: none; }

  .con-timeline-card {
    flex-shrink: 0;
    width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
  }
  .con-timeline-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
  .con-timeline-card.status-confirmed { border-left: 3px solid #2D6A30; }
  .con-timeline-card.status-maybe { border-left: 3px solid #C49A2A; }
  .con-timeline-card.status-past { border-left: 3px solid var(--text-muted); opacity: 0.6; }

  .con-card-days-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  .con-card-days-badge.soon { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
  .con-card-days-badge.upcoming { background: var(--accent-light); color: var(--accent-dark); border: 1px solid #E8C8B5; }
  .con-card-days-badge.maybe { background: #FBF3DC; color: #9A7315; border: 1px solid #FAD87E; }
  .con-card-days-badge.past { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
  /* Neutral grey is now the default countdown pill (the user prefers calmer chrome —
     red/amber pulls focus away from the convention name). */
  .con-card-days-badge.neutral { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }

  .con-card-name {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
  }
  .con-card-date { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
  .con-card-location { font-size: 11px; color: var(--text-muted); }
  .con-card-booth {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-dark);
    background: var(--accent-light);
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
  }

  /* Full list */
  .con-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 24px 0 12px;
  }

  .con-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s;
    cursor: pointer;
  }
  .con-list-item:hover { box-shadow: var(--shadow-md); }
  .con-list-item.past-item { opacity: 0.5; }

  .con-list-date-block {
    flex-shrink: 0;
    width: 52px;
    text-align: center;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    padding: 6px 4px;
  }
  .con-list-date-block.past { background: var(--bg); }
  .con-date-month { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent-dark); }
  .con-date-block.past .con-date-month { color: var(--text-muted); }
  .con-date-day { font-family: var(--font-display); font-size: 22px; font-weight: 500; color: var(--text-primary); line-height: 1; }
  .con-date-year { font-size: 10px; color: var(--text-muted); }

  .con-list-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  /* New 5-row condensed card layout. Each `.con-card-row` is one logical line; rows
     stack tightly via the parent's `gap` so the full card stays short and scannable. */
  .con-card-row { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 1.35; }
  .con-card-row--name { font-size: 15px; font-weight: 500; color: var(--text-primary); margin-bottom: 1px; }
  .con-card-row--dates { color: var(--text-muted); }
  .con-card-row--loc { color: var(--text-secondary); }
  .con-card-row--status { font-size: 11px; }
  .con-card-row--note { font-size: 12px; color: var(--text-muted); font-style: italic; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .con-card-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; align-items: flex-end; }
  .con-card-actions .icon-btn { width: 30px; height: 30px; }

  /* Inline edit pane — same card chrome (border/padding/background), but stretches full
     width to host the form. Hover effect disabled because the whole card is interactive. */
  .con-list-item--editing {
    display: block;
    cursor: default;
    border-color: var(--accent);
    box-shadow: 0 4px 18px rgba(194,123,90,0.18);
  }
  .con-list-item--editing:hover { box-shadow: 0 4px 18px rgba(194,123,90,0.18); }

  /* Legacy classes kept for backwards-compat with any cached/old DOM during the migration. */
  .con-list-name { font-size: 15px; font-weight: 500; color: var(--text-primary); margin-bottom: 4px; }
  .con-list-meta {
    display: flex; flex-wrap: wrap; gap: 8px;
    font-size: 12px; color: var(--text-secondary); margin-bottom: 4px;
  }
  .con-list-meta span { display: flex; align-items: center; gap: 3px; }
  .con-list-notes { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-style: italic; }

  /* Convention P&L inline stats */
  .con-pl-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
  }
  .con-pl-stat { display: flex; flex-direction: column; gap: 2px; }
  .con-pl-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
  .con-pl-val { font-size: 14px; font-weight: 600; color: var(--text-primary); }

  .con-status-pill {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
  }
  .con-status-pill.confirmed { background: #EDF7EE; color: #2D6A30; border-color: #B8DFB9; }
  .con-status-pill.maybe { background: #FBF3DC; color: #9A7315; border-color: #FAD87E; }
  .con-status-pill.past { background: var(--bg); color: var(--text-muted); border-color: var(--border); }

  .con-list-actions { display: flex; gap: 6px; flex-shrink: 0; margin-top: 2px; }

  /* ── SALES DASHBOARD ── */
  .sales-charts-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }
  .sales-bottom-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
  }
  .sales-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
  }
  .sales-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .sales-chart-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
  }
  .sales-chart-body { min-height: 180px; }

  /* SVG bar chart */
  .sales-bar-wrap { display: flex; align-items: flex-end; gap: 4px; height: 160px; overflow-x: auto; padding-bottom: 20px; position: relative; }
  .sales-bar-col { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
  .sales-bar {
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    transition: opacity 0.15s;
    min-width: 24px;
  }
  .sales-bar:hover { opacity: 0.75; }
  .sales-bar-label { font-size: 9px; color: var(--text-muted); white-space: nowrap; transform: rotate(-35deg); transform-origin: top center; margin-top: 4px; }
  .sales-bar-val { font-size: 9px; color: var(--text-secondary); }

  /* Donut chart (CSS only) */
  .donut-wrap { position: relative; width: 120px; height: 120px; margin: 0 auto 12px; }
  .donut-svg { width: 120px; height: 120px; transform: rotate(-90deg); }
  .donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .donut-total { font-family: var(--font-display); font-size: 15px; font-weight: 500; color: var(--text-primary); }
  .donut-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
  .donut-legend { display: flex; flex-direction: column; gap: 5px; }
  .donut-legend-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-secondary); }
  .donut-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
  .donut-legend-pct { margin-left: auto; font-weight: 500; color: var(--text-primary); font-size: 12px; }

  /* Top products list */
  .top-product-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
  }
  .top-product-row:last-child { border-bottom: none; }
  .top-product-rank { font-size: 11px; font-weight: 700; color: var(--text-muted); width: 16px; text-align: center; flex-shrink: 0; }
  .top-product-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }
  .top-product-bar-wrap { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
  .top-product-bar { height: 100%; border-radius: 3px; background: var(--accent); }
  .top-product-rev { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
  .top-product-qty { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

  /* Recent sales list */
  .recent-sale-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
  }
  .recent-sale-row:last-child { border-bottom: none; }
  .recent-sale-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
  .recent-sale-body { flex: 1; min-width: 0; }
  .recent-sale-items { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .recent-sale-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
  .recent-sale-total { font-weight: 600; color: var(--text-primary); white-space: nowrap; }

  /* Manual sale modal items */
  .ms-item-row {
    display: grid;
    grid-template-columns: 1fr 60px 80px 36px;
    gap: 6px;
    margin-bottom: 6px;
    align-items: center;
  }

  /* ── DISCOUNT GROUPS ── */
  .dg-group-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
  }
  .dg-group-name { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
  .dg-tiers-row { display: flex; gap: 8px; flex-wrap: wrap; }
  .dg-tier-chip {
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent-dark);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 500;
  }
  .dg-tier-row {
    display: grid;
    grid-template-columns: 80px 1fr 36px;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
  }
  .dg-tier-label { font-size: 12px; color: var(--text-muted); text-align: right; padding-right: 4px; }

  .pos-discount-type-btn {
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid #4C4946;
    background: transparent;
    color: #A8A29E;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s;
  }
  .pos-discount-type-btn.active { background: #3C3936; color: #F7F5F0; border-color: #6B6560; }

  .pos-price-tap {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 4px;
    transition: background 0.12s;
    white-space: nowrap;
    text-align: right;
    line-height: 1.2;
  }
  .pos-price-tap:hover { background: #3C3936; }
  /* Bulk-discount strikethrough — original on top, new price below in accent. The hover
     tooltip on the price-tap shows the % off so the cashier can answer "why is it $20"
     without opening anything. */
  .pos-price-strike { font-size: 11px; color: #6B6560; text-decoration: line-through; line-height: 1.1; }
  .pos-price-discounted { font-size: 13px; color: #4ADE80; font-weight: 600; line-height: 1.1; }

  /* POS freebie badge in cart */
  .pos-freebie-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 20px;
    background: #3C3936;
    color: #C27B5A;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
  }
  .pos-discount-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 20px;
    background: #1A3320;
    color: #4ADE80;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
  }

  /* ── CONVENTION COST BREAKDOWN ── */
  .con-interstate-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg);
    transition: background 0.15s;
    user-select: none;
  }
  .con-interstate-toggle:hover { background: var(--accent-light); border-color: var(--accent); }
  .con-interstate-label { flex: 1; }

  .con-cost-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
  }
  .con-cost-row-main {
    display: grid;
    grid-template-columns: 180px 1fr 36px;
    align-items: center;
  }
  .con-cost-cat-select {
    padding: 9px 12px;
    border: none;
    border-right: 1px solid var(--border);
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-primary);
    background: transparent;
    outline: none;
    cursor: pointer;
    appearance: auto;
  }
  .con-cost-amount {
    padding: 9px 12px;
    border: none;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-primary);
    background: transparent;
    outline: none;
    width: 100%;
  }
  .con-cost-amount:focus { background: var(--accent-light); }
  .con-cost-delete {
    width: 36px;
    border: none;
    border-left: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
  }
  .con-cost-delete:hover { background: var(--danger-bg); color: var(--danger); }

  /* Hotel sub-row */
  .con-hotel-sub {
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--bg);
  }
  .con-hotel-sub label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 3px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }
  .con-hotel-sub input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
  }
  .con-hotel-sub input:focus { border-color: var(--accent); }
  .con-hotel-nightly-total {
    grid-column: span 2;
    font-size: 12px;
    color: var(--text-secondary);
    padding-top: 4px;
  }

  .con-add-cost-btn {
    width: 100%;
    padding: 9px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 4px;
    margin-bottom: 12px;
  }
  .con-add-cost-btn:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-light); }

  .con-cost-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
  }

  /* ── THEME COLOUR GROUPS ── */
  .theme-colour-group {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }
  .theme-colour-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
  }
  .theme-colour-group-header:hover { background: var(--accent-light); }
  .theme-group-swatch {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    flex-shrink: 0;
    position: relative;
  }
  .theme-group-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
  }
  .theme-group-desc {
    font-size: 11px;
    color: var(--text-muted);
  }
  .theme-group-chevron {
    font-size: 11px;
    color: var(--text-muted);
    transition: transform 0.2s;
  }
  .theme-group-chevron.open { transform: rotate(90deg); }

  .theme-colour-group-body {
    display: none;
    padding: 12px 14px;
    background: var(--bg-card);
    gap: 10px;
    flex-direction: column;
  }
  .theme-colour-group-body.open { display: flex; }

  .theme-colour-row {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .theme-colour-preview {
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    flex-shrink: 0;
    cursor: pointer;
    padding: 1px;
  }
  .theme-colour-label {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
  }
  .theme-colour-affected {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
  }
  .theme-hex-input {
    width: 96px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-card);
    outline: none;
    text-transform: uppercase;
    transition: border-color 0.15s;
  }
  .theme-hex-input:focus { border-color: var(--accent); }
  .theme-hex-input.invalid { border-color: var(--danger); background: var(--danger-bg); }

  /* Channel colour rows in theme */
  .theme-channel-colour-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
  }
  .theme-channel-colour-row:last-child { border-bottom: none; }
  .theme-channel-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .theme-channel-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }

  /* ── THEME EDITOR LAYOUT ── */
  .theme-editor-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    align-items: start;
  }
  @media (max-width: 900px) {
    .theme-editor-layout { grid-template-columns: 1fr; }
    .theme-preview-pane { order: -1; }
  }

  .theme-editor-controls { min-width: 0; }

  .theme-apply-bar {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }

  .theme-preview-pane {
    position: sticky;
    top: 80px;
  }

  /* Mini app preview frame */
  .tp-frame {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #D0D0D0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    line-height: 1.4;
    user-select: none;
  }
  .tp-sidebar {
    padding: 14px 12px 10px;
    border-right: 1px solid;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .tp-logo {
    font-family: 'Playfair Display', serif;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid;
  }
  .tp-nav-item {
    padding: 6px 8px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .tp-content { padding: 12px; flex: 1; }
  .tp-page-title {
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
  }
  .tp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
  .tp-stat {
    border-radius: 7px;
    padding: 7px 8px;
    border: 1px solid;
  }
  .tp-stat-label { font-size: 8px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 3px; }
  .tp-stat-val { font-size: 14px; font-weight: 500; font-family: 'Playfair Display', serif; }
  .tp-card {
    border-radius: 7px;
    padding: 8px;
    border: 1px solid;
  }
  .tp-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 0;
    border-bottom: 1px solid;
    font-size: 10px;
  }
  .tp-row:last-child { border-bottom: none; }
  .tp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .tp-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 20px;
    font-size: 8px;
    font-weight: 600;
  }
  .tp-btn {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 600;
    margin-top: 8px;
    cursor: default;
  }

  /* ── CUSTOM PRESET CHIPS ── */
  .custom-preset-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    background: var(--bg-card);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.12s;
    margin: 0 6px 6px 0;
  }
  .custom-preset-chip:hover { border-color: var(--accent); background: var(--accent-light); }
  .custom-preset-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
  }
  .custom-preset-delete {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: none;
    background: var(--border-strong);
    color: var(--text-secondary);
    font-size: 10px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
    transition: all 0.12s;
  }
  .custom-preset-delete:hover { background: var(--danger); color: #fff; }

  /* ── RECEIPT EDITOR ── */
  .receipt-editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 480px;
    max-height: 68dvh;
    overflow: hidden;
  }
  @media (max-width: 680px) {
    .receipt-editor-layout { grid-template-columns: 1fr; max-height: none; }
  }
  .receipt-editor-pane {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
  }
  .receipt-editor-toolbar {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
  }
  .placeholder-chips { display: flex; gap: 6px; flex-wrap: wrap; }
  .placeholder-chip {
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-strong);
    background: var(--bg-card);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--accent-dark);
    cursor: pointer;
    transition: all 0.12s;
    white-space: nowrap;
  }
  .placeholder-chip:hover { background: var(--accent-light); border-color: var(--accent); }
  .receipt-textarea {
    flex: 1;
    padding: 14px 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.65;
    border: none;
    outline: none;
    resize: none;
    background: #FDFCF9;
    color: var(--text-primary);
    overflow-y: auto;
  }
  .receipt-editor-hint {
    padding: 8px 14px;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
  }
  .receipt-editor-hint code {
    font-family: monospace;
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
  }
  .receipt-preview-pane {
    padding: 14px;
    background: var(--bg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
  .receipt-paper {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: 100%;
    max-width: 302px;
    margin: 0 auto;
  }
  .receipt-pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: 9.5px;
    line-height: 1.55;
    white-space: pre;
    overflow-x: hidden;
    color: #1C1917;
    margin: 0;
  }

  /* ── PRINT ── */
  @media print {
    body > *:not(#print-receipt) { display: none !important; }
    #print-receipt {
      display: block !important;
      font-family: 'Courier New', Courier, monospace;
      font-size: 10pt;
      line-height: 1.55;
      white-space: pre;
      width: 72mm;
      margin: 0;
      padding: 4mm;
      color: #000;
      background: #fff;
    }
  }
  #print-receipt { display: none; }
  @keyframes loading-bar {
    0% { transform: scaleX(0); }
    50% { transform: scaleX(1); }
    100% { transform: scaleX(0); transform-origin: right; }
  }
  .filter-toggle-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .filter-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
  .filter-toggle-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }

  /* ── VARIANT GROUP ROWS ── */
  .variant-group-header { cursor: pointer; }
  .variant-group-header:hover td { background: var(--bg) !important; }
  .variant-row td:first-child { padding-left: 28px; }

  /* ── UPDATES SCREEN (desktop only) ── */
  .screen-updates-only { display: none !important; }
  .nav-item-updates { display: none; }

  /* ── MOBILE BREAKPOINTS ── */
  /* iPad / tablet (641px – 1280px) — shrink POS tiles so the cashier sees more
     inventory per screen without scrolling at a busy con. */
  @media (min-width: 641px) and (max-width: 1280px) {
    .pos-product-tiles { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 5px; }
    .pos-product-tile { padding: 6px 4px 6px; min-height: 36px; }
    .pos-tile-img, .pos-tile-emoji { width: 44px; height: 44px; font-size: 22px; }
    .pos-tile-name { font-size: 10px; }
  }

  /* Reports — top + bottom chart rows collapse to a single column at ~800px so the
     2-charts-wide layout doesn't try to fit two/three side-by-side. Without this the
     "Top Products" + "Recent Transactions" + "By State" rows squashed each chart
     down to a strip that couldn't hold its data. */
  @media (min-width: 641px) and (max-width: 900px) {
    .sales-charts-row,
    .sales-bottom-row { flex-direction: column; }
    .sales-chart-card { min-width: 0 !important; }
    /* Sales drill chip strips wrap on their own; ensure padding is gentle on narrow widths. */
    #sales-online-chips,
    #sales-convention-chips { padding-left: 18px; padding-right: 18px; }
  }

  /* In the 641–900px range the cart column is slim (240px). Tighten the product tile
     grid so the narrow product area still fits multiple tiles per row. Also tighten
     cart-item spacing + shrink the void-btn padding so all 4 toolbar buttons (gift /
     % off / print / void) fit without "void" getting clipped. */
  @media (min-width: 641px) and (max-width: 900px) {
    .pos-product-tiles { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 4px; }
    /* Cart row: smaller gap, smaller qty buttons, name allowed to wrap to 2 lines so
       the row doesn't horizontal-overflow when a product name + gift/qty/price all
       have to share ~210px of usable width. */
    .pos-cart-item { gap: 4px; padding: 8px 6px; flex-wrap: nowrap; }
    .pos-cart-item-name {
      font-size: 12px;
      line-height: 1.25;
      min-width: 0;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
    .pos-cart-item-price { font-size: 12px; }
    .pos-qty-btn { width: 22px; height: 22px; font-size: 14px; }
    .pos-qty-num { font-size: 12px; min-width: 16px; }
    /* Cart-header toolbar: tighter padding + smaller font so 🎁 / % Off / 🖨 / Void
       all fit without the last button getting cut off. */
    .pos-cart-header { padding: 8px 10px; }
    .pos-cart-header > div { gap: 4px !important; }
    .pos-void-btn { padding: 4px 8px !important; font-size: 11px !important; }
  }

  /* POS top-bar collapse — when the user toggles it off, the channel bar / currency /
     "selling at" / float bar all hide so the products + cart get the reclaimed space.
     Driven by `data-pos-bar-collapsed="true"` on the POS screen container. */
  #screen-pos[data-pos-bar-collapsed="true"] .page-header,
  #screen-pos[data-pos-bar-collapsed="true"] #pos-con-selector,
  #screen-pos[data-pos-bar-collapsed="true"] #pos-float-bar { display: none !important; }

  /* Small breathing room below the float bar so the toggle handle has a strip of
     background behind it instead of butting straight against the search input or the
     cart header. The float bar itself gets a margin-bottom; .pos-layout slots into
     the gap. */
  #pos-float-bar { margin-bottom: 6px; }

  /* When the top bar is collapsed, give the freed vertical space to the products +
     cart panes. The default `.pos-layout` height was `calc(100dvh - 160px)` — the 160
     accounted for the page-header + float-bar + bottom-nav. With the top bar hidden
     we can reclaim ~110px of that. Stays defensive: dvh covers safe-area on iPad. */
  #screen-pos[data-pos-bar-collapsed="true"] .pos-layout {
    height: calc(100dvh - 50px);
  }
  /* The cart pane uses flex internally — its footer is fixed-size and the items list
     gets `flex:1`. So once .pos-layout's height grows, the cart items area automatically
     fills the new space without extra rules. Same for products pane via overflow-y:auto. */

  /* Horizontal pull-tab pinned to the BOTTOM edge of the POS top header — visually
     mirrors .pos-nav-toggle (which is pinned to the bottom-nav). When the bar is
     collapsed, this handle slides up to the very top of the POS container so the
     user can pull the header back down. Lines inside read as a drag handle. */
  .pos-bar-toggle {
    position: fixed;
    top: var(--pos-bar-toggle-top, 88px); /* sits just under the channel/float bar by default */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9990;
    width: 56px;
    height: 16px;
    background: #2C2927;
    border: none;
    border-radius: 0 0 6px 6px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: top 0.15s, background 0.15s;
  }
  .pos-bar-toggle:hover { background: #3C3936; }
  .pos-bar-toggle-lines { display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; line-height: 0; }
  .pos-bar-toggle-lines span { height: 2px; width: 18px; background: #A8A29E; border-radius: 1px; display: block; }
  /* When collapsed, the handle pins to y=0 (top edge of viewport) so the user can
     reach it without having to know where the header used to sit. */
  #screen-pos[data-pos-bar-collapsed="true"] .pos-bar-toggle { top: 0; border-radius: 0 0 6px 6px; }

  /* Phone (< 640px) */
  @media (max-width: 640px) {
    /* Stack page headers */
    .page-header-top { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-header-top .btn-primary { align-self: stretch; text-align: center; }

    /* Stock controls wrap to 2 columns */
    .stock-controls { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stock-controls input { grid-column: span 2; }

    /* Hide less-important table columns on phone */
    .col-sku, .col-barcode, .col-cost, .col-stock-detail { display: none; }
    .product-table th.col-sku,
    .product-table th.col-barcode,
    .product-table th.col-cost,
    .product-table th.col-stock-detail { display: none; }

    /* Product table font sizes */
    .product-table { font-size: 12px; }
    .product-name { font-size: 13px; }
    .action-btns { gap: 4px; }
    .icon-btn { width: 28px; height: 28px; font-size: 12px; }

    /* POS layout stacks vertically */
    .pos-layout { flex-direction: column; gap: 0; }
    .pos-products { border-right: none; border-bottom: 1px solid #2C2927; max-height: 50dvh; overflow-y: auto; }
    .pos-cart { max-height: 50dvh; overflow-y: auto; }
    .pos-product-tiles { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .pos-tile-name { font-size: 10px; }

    /* Modals full-screen on phone — pull the desktop side padding back so contents
       use the full screen width on tiny viewports. */
    .modal { max-width: 100% !important; width: 100% !important; margin: 0 !important;
      border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92dvh; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal-header,
    .modal-body,
    .modal-footer { padding-left: 16px !important; padding-right: 16px !important; }

    /* Sales charts stack */
    .sales-charts-row { flex-direction: column; }
    .sales-bottom-row { flex-direction: column; }

    /* Convention list */
    .con-list-item { flex-direction: column; gap: 10px; }
    .con-list-date-block { flex-direction: row; gap: 8px; align-items: center; }

    /* Stat cards 2-up */
    .stat-row { grid-template-columns: 1fr 1fr; }

    /* Bottom tab labels smaller */
    .tab-label { font-size: 9px; }
    .tab-icon { font-size: 20px; }
    #bottom-nav { height: 60px; }
  }


  /* Show updates screen on desktop, only when active. 901 (not 900) so this doesn't
     overlap the max-width:900 tablet rules at exactly 900px. */
  @media (min-width: 901px) {
    .screen-updates-only { display: none !important; }
    .screen-updates-only.active { display: block !important; }
    .nav-item-updates { display: flex; }
  }

  /* ── POS PAYMENT BUTTONS ── */
  .pos-pay-btn {
    padding: 12px 8px;
    border: 1px solid #3C3936;
    border-radius: 8px;
    background: #2C2927;
    color: #A8A29E;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s;
    text-align: center;
  }
  .pos-pay-btn:hover { border-color: #6B6560; color: #D4CEC6; }
  .pos-pay-btn.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
  }
  .pos-complete-btn.ready {
    background: #4ADE80;
    color: #1C1917;
  }
  .pos-complete-btn.ready:hover { background: #22C55E; }
  .float-tab {
    flex: 1; padding: 10px 16px; border: none; background: transparent;
    font-family: var(--font-body); font-size: 13px; font-weight: 500;
    color: #6B6560; cursor: pointer;
    border-bottom: 2px solid transparent; transition: all 0.15s;
  }
  .float-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
  .float-tab:hover:not(.active) { color: #D6D3D1; }
  .denom-table { width: 100%; border-collapse: collapse; }
  .denom-table tr { border-bottom: 1px solid #2C2927; }
  .denom-table tr:last-child { border-bottom: none; }
  .denom-table td { padding: 7px 6px; vertical-align: middle; }
  .denom-label { font-size: 13px; font-weight: 500; color: #D6D3D1; min-width: 90px; }
  .denom-type-badge { font-size: 9px; padding: 1px 5px; border-radius: 3px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.3px; }
  .denom-type-note { background: #2D3D2F; color: #4ADE80; }
  .denom-type-coin { background: #3D2E24; color: #C27B5A; }
  .denom-count-input {
    width: 64px; padding: 6px 8px; border: 1px solid #3C3936;
    border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 14px;
    text-align: center; color: #F7F5F0; background: #2C2927;
    outline: none; transition: border-color 0.15s;
  }
  .denom-count-input:focus { border-color: var(--accent); }
  .denom-subtotal { font-size: 12px; color: #78716C; text-align: right; min-width: 64px; font-variant-numeric: tabular-nums; }
  .variance-positive { background: #1A2E1C; border: 1px solid #2D4A2F; color: #4ADE80; }
  .variance-negative { background: #2E1A1A; border: 1px solid #4A2D2D; color: #F87171; }
  .variance-zero { background: #242120; border: 1px solid #3C3936; color: #A8A29E; }

  /* ── ARCHIVED ROW STYLE ── */
  .archived-row { opacity: 0.55; }
  .archived-row:hover { opacity: 0.8; }
  #vg-table-wrap table th, #vg-table-wrap table td {
    vertical-align: middle;
  }
  #vg-table-wrap table tbody tr:hover { background: var(--bg); }
  #vg-table-wrap table tbody tr:last-child td { border-bottom: none; }

  /* ── UPDATES & CHANGELOG ── */
  .updates-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
    width: fit-content;
  }
  .updates-tab {
    padding: 7px 18px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .updates-tab.active {
    background: var(--accent);
    color: #fff;
  }
  .updates-tab:not(.active):hover {
    background: var(--bg);
    color: var(--text-primary);
  }

  .updates-panel { display: flex; flex-direction: column; gap: 12px; }

  .update-entry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    box-shadow: var(--shadow-sm);
  }
  .update-entry.highlight {
    border-left: 3px solid var(--accent);
  }

  .update-version-block {
    flex-shrink: 0;
    text-align: center;
    min-width: 52px;
  }
  .update-version {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 500;
    color: var(--accent);
    line-height: 1;
  }
  .update-date {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: nowrap;
  }

  .update-body { flex: 1; min-width: 0; }
  .update-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
  }
  .update-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .update-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
  }
  .update-item-tag {
    flex-shrink: 0;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
  }
  .tag-new     { background: #EDF7EE; color: #2D6A30; border: 1px solid #B8DFB9; }
  .tag-fix     { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
  .tag-improve { background: var(--accent-light); color: var(--accent-dark); border: 1px solid #E8C8B5; }
  .tag-coming  { background: #F0EFFF; color: #4A47A3; border: 1px solid #C8C7F0; }
  .tag-idea    { background: #FBF3DC; color: #9A7315; border: 1px solid #FAD87E; }

  /* Planned status pill */
  .planned-status {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
  }
  .status-soon   { background: var(--accent-light); color: var(--accent-dark); border-color: #E8C8B5; }
  .status-medium { background: #F0EFFF; color: #4A47A3; border-color: #C8C7F0; }
  .status-idea   { background: #FBF3DC; color: #9A7315; border-color: #FAD87E; }
