/* Shared styles for the three freezer-rearrange screens. Tile/shelf/bench visual
   language ported from the approved prototypes; harmonised with the app theme
   (styles.css) for the accent so it doesn't clash with the Home link or TEST banner.
   Per-screen layout (tabs, columns, board mode) lives with each screen. */

:root {
  --fg-accent: var(--accent-text, #1f6fb2);
  --fg-empty: #e6ecf0;
  --fg-reserved: #8a6bb8;
  --fg-freezer: #8fa0ad;
  --fg-shelf: #a9b7c2;
  --fg-shelf-sg: #7fc4ad;
  --fg-line: var(--border, #d3dbe1);
  --fg-bench-line: #d9c49a;
}

.fg-app { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; }
.fg-head h1 { font-size: 19px; margin: 0; font-weight: 650; }
.fg-sub { font-size: 12.5px; color: var(--text-secondary, #6b7a86); margin-top: 2px; }

/* --- freezer area + shelves --- */
.fg-freezer { background: var(--fg-freezer); border-radius: 12px; padding: 8px 8px 6px; }
.fg-shelf { display: grid; grid-template-columns: 22px 1fr; gap: 4px; background: var(--fg-shelf); border-radius: 8px; padding: 4px; margin-bottom: 6px; }
.fg-shelf.sg { background: var(--fg-shelf-sg); }
.fg-slabel { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10.5px; color: #fff; font-weight: 600; line-height: 1.1; text-align: center; }
.fg-slabel small { font-weight: 400; font-size: 9px; opacity: .9; }
.fg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }

/* --- one tile --- */
.fg-cell {
  position: relative; height: 46px; border-radius: 6px; overflow: hidden; background: var(--fg-empty);
  border: 1.5px solid rgba(0, 0, 0, .08); padding: 3px 5px 6px; min-width: 0;
  display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; transition: transform .12s;
}
.fg-cell.back { height: 40px; }          /* back row a touch shorter than the front */
.fg-cell.empty { background: repeating-linear-gradient(135deg, #e9eef2 0 6px, #e1e8ed 6px 12px); cursor: pointer; }
.fg-top { display: flex; justify-content: space-between; gap: 4px; font-size: 9.5px; line-height: 1; position: relative; z-index: 1; }
.fg-pos { font-weight: 700; opacity: .8; white-space: nowrap; overflow: hidden; }
.fg-pct { opacity: .85; white-space: nowrap; }
.fg-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; position: relative; z-index: 1; }
.fg-hint { font-size: 9.5px; color: #7d8b96; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fg-hint.res { color: var(--fg-reserved); font-weight: 600; }
.fg-lvl { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, .28); }
.fg-lvl i { display: block; height: 100%; background: rgba(255, 255, 255, .85); }

.fg-cell.sel { border-color: var(--fg-accent); box-shadow: 0 0 0 2px var(--fg-accent); transform: translateY(-2px); }
.picking .fg-cell:not(.sel):not(.fg-off) { border-style: dashed; border-color: color-mix(in srgb, var(--fg-accent) 45%, transparent); }
.fg-cell.flash { animation: fg-flash .7s; }
@keyframes fg-flash { 0% { box-shadow: 0 0 0 3px #f2b705; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* faded, not tappable (board: Working off, or Staging shelf while cabinet on) */
.fg-off, .fg-shelf.fg-off { opacity: .38; filter: grayscale(.85); pointer-events: none; }

.fg-basenote { font-size: 10px; color: var(--text-muted, #8a9089); text-align: center; padding: 2px 0 4px; }

/* --- dock: status + bench, pinned above the freezer in stacking order --- */
.fg-dock { position: sticky; bottom: 0; z-index: 20; background: var(--surface-2, #fff); border-top: 1px solid var(--fg-line); padding: 8px 0 calc(10px + env(safe-area-inset-bottom)); margin-top: 10px; box-shadow: 0 -4px 12px rgba(0, 0, 0, .06); }
.fg-status { padding: 0 14px 7px; font-size: 13px; min-height: 22px; display: flex; align-items: center; gap: 8px; }
.fg-status b { font-weight: 650; }
.fg-status .fg-idle { color: var(--text-secondary, #6b7a86); }
.fg-status .fg-err { color: var(--danger-text, #8a241d); }
.fg-status button { margin-left: auto; border: 1px solid var(--fg-line); background: var(--surface-2, #fff); border-radius: 7px; padding: 4px 10px; font: inherit; font-size: 12.5px; color: var(--fg-accent); cursor: pointer; }
.fg-benchhead { padding: 0 14px 5px; font-size: 12px; color: var(--text-secondary, #6b7a86); }
.fg-benchhead strong { color: var(--text-primary, #1d2a33); font-size: 13px; }
.fg-bench { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; padding: 2px 14px; max-height: 116px; overflow-y: auto; }
.fg-chip { height: 48px; border-radius: 7px; position: relative; overflow: hidden; border: 1.5px solid rgba(0, 0, 0, .1); padding: 3px 6px 6px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; }
.fg-chip.sel { border-color: var(--fg-accent); box-shadow: 0 0 0 2px var(--fg-accent); }
.fg-chip.drop { background: var(--surface-2, #fff); border: 1.5px dashed var(--fg-bench-line); color: #8b7340; font-size: 12px; align-items: center; justify-content: center; text-align: center; font-weight: 600; }
.fg-chip.drop.live { border-color: var(--fg-accent); color: var(--fg-accent); }
.fg-legend { font-size: 11px; color: var(--text-secondary, #6b7a86); padding: 6px 14px 0; }
