/* ============================================
   AI Ordering Assistant — PWA
   Light theme, landscape-first for tablets
   ============================================ */

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

:root {
  --blue: #1a73e8;
  --blue-dk: #1557b0;
  --blue-lt: #e8f0fe;
  --dark: #1e1e1e;
  --white: #ffffff;
  --light: #f5f6f8;
  --border: #e2e5ea;
  --text: #1a1a2e;
  --text2: #6b7280;
  --success: #16a34a;
  --success-lt: #dcfce7;
  --warn: #f59e0b;
  --danger: #ef4444;
  --gold: #c9a84c;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --tr: .18s ease;
}

html { font-size: 15px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--light);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100dvh;
  width: 100dvw;
}

/* ========== APP SHELL ========== */

.app {
  height: 100dvh;
  width: 100dvw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ========== SCREENS ========== */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  transform: translateX(20px);
  background: var(--light);
  z-index: 1;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  z-index: 2;
}

/* ========== TOP BAR ========== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  min-height: 52px;
  background: var(--dark);
  color: var(--white);
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.back-btn {
  background: none; border: none; color: var(--white);
  font-size: 22px; cursor: pointer; padding: 6px; line-height: 1;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}

.topbar h1 { font-size: 16px; font-weight: 700; }
.topbar .sub { font-size: 11px; color: rgba(255,255,255,.5); }

.badge {
  background: var(--blue); color: var(--white);
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 12px;
}

/* ========== SHARED BUTTONS ========== */

.btn {
  padding: 12px 16px; border: none; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: var(--tr); text-align: center; white-space: nowrap;
  touch-action: manipulation;
}

.btn-p { background: var(--blue); color: var(--white); }
.btn-p:hover { background: var(--blue-dk); }
.btn-s { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-s:hover { background: #eef0f3; }
.btn-full { width: 100%; }
.btn-lg { padding: 14px 20px; font-size: 15px; }

/* ========== SCROLLABLE BODY ========== */

.scroll-body {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.scroll-body::-webkit-scrollbar { width: 4px; }
.scroll-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 4px; }

/* ========== FOOTER BAR ========== */

.footer-bar {
  display: flex; gap: 8px; padding: 10px 16px;
  border-top: 1px solid var(--border); background: var(--white);
  flex-shrink: 0; align-items: center;
}

.footer-bar .btn { flex: 1; }

/* ========== SCREEN 1: FLOOR PLAN ========== */

.stats-row {
  display: flex; gap: 8px; padding: 12px 16px;
  background: var(--white); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.stat { flex: 1; text-align: center; padding: 8px; background: var(--light); border-radius: var(--r-sm); }
.stat .n { font-size: 22px; font-weight: 800; }
.stat .l { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text2); margin-top: 2px; }
.stat.hi { background: var(--blue-lt); }
.stat.hi .n { color: var(--blue); }

.section-lbl {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text2); padding: 10px 16px 6px;
}

.floor-grid {
  display: grid; gap: 10px; padding: 0 16px 16px;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.tbl-cell {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--r-md); padding: 14px 8px; text-align: center;
  cursor: pointer; transition: var(--tr); touch-action: manipulation;
}

.tbl-cell:hover { border-color: var(--blue); }
.tbl-cell.occ { border-color: var(--blue); background: #fafbff; }
.tbl-cell .num { font-size: 20px; font-weight: 800; }
.tbl-cell .seats { font-size: 10px; color: var(--text2); margin-top: 2px; }
.tbl-cell .st {
  display: inline-block; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  padding: 2px 7px; border-radius: 4px; margin-top: 6px;
}

.st-open { background: var(--success-lt); color: var(--success); }
.st-seat { background: var(--blue-lt); color: var(--blue); }
.st-ord { background: #fef3c7; color: #92400e; }
.st-srv { background: #ede9fe; color: #5b21b6; }

/* ========== SCREEN 2: TABLE SETUP ========== */

.setup-body { padding: 24px 16px; display: flex; flex-direction: column; align-items: center; }

.setup-hero { text-align: center; margin-bottom: 28px; }
.hero-icon { font-size: 48px; margin-bottom: 10px; }
.setup-hero h2 { font-size: 22px; font-weight: 800; }
.hero-desc { font-size: 13px; color: var(--text2); margin-top: 6px; max-width: 340px; line-height: 1.5; }

.setup-sec { margin-bottom: 20px; width: 100%; max-width: 340px; }

.sec-lbl {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text2); margin-bottom: 8px; text-align: center;
}

.guest-ctr {
  display: flex; align-items: center; justify-content: center;
  gap: 24px; padding: 16px; background: var(--white);
  border-radius: var(--r-md); box-shadow: var(--shadow);
}

.gc-btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--white);
  font-size: 22px; font-weight: 700; color: var(--blue);
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: var(--tr);
  touch-action: manipulation;
}

.gc-btn:hover { border-color: var(--blue); background: var(--blue-lt); }
.gc-val { font-size: 40px; font-weight: 800; min-width: 50px; text-align: center; }
.gc-lbl { font-size: 12px; color: var(--text2); text-align: center; margin-top: -4px; }

.powered-by {
  font-size: 11px; color: var(--text2); text-align: center;
  margin-top: 12px; letter-spacing: .3px;
}

/* ========== SCREEN 3: AI ORDERING ========== */

/* -- Hamburger Button -- */
.hamburger-btn {
  background: none; border: none; color: var(--white);
  font-size: 20px; cursor: pointer; padding: 8px;
  touch-action: manipulation; line-height: 1;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}

/* -- Layout -- */
.ordering-main {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.orders-col {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}

.orders-col::-webkit-scrollbar { width: 4px; }
.orders-col::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 4px; }

.orders-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panels-col {
  display: flex;
  flex-direction: column;
  width: 33%;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
  transition: width .3s ease;
}

.panels-col.collapsed {
  width: 40px;
  min-width: 40px;
  overflow: hidden;
}

.panels-col.collapsed .panel { display: none; }

.panels-col.expanded {
  width: 60%;
}

.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.panel + .panel {
  border-top: 1px solid var(--border);
}

/* -- Panel Toggle (collapse/expand strip) -- */
.panel-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  cursor: pointer;
  background: var(--light);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  touch-action: manipulation;
}

.toggle-icon {
  font-size: 14px;
  color: var(--text2);
  transition: transform .3s ease;
}

.panels-col.collapsed .toggle-icon {
  transform: rotate(180deg);
}

.panel-hdr {
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text2);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-expand-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 8px;
  transition: var(--tr);
  touch-action: manipulation;
}
.panel-expand-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-lt);
}
.panels-col.expanded .panel-expand-btn {
  background: var(--blue-lt);
  border-color: var(--blue);
  color: var(--blue);
}

.panel-log {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  -webkit-overflow-scrolling: touch;
}

.panel-log::-webkit-scrollbar { width: 3px; }
.panel-log::-webkit-scrollbar-thumb { background: rgba(0,0,0,.1); border-radius: 3px; }

.panel-empty {
  color: var(--text2);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  padding: 16px 8px;
}

/* -- Order Cards -- */
.order-card {
  background: var(--white);
  border-radius: var(--r-md);
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color .3s ease, box-shadow .3s ease;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.order-card.active {
  border-color: var(--success);
  box-shadow: 0 0 12px rgba(22,163,74,.15);
}

.order-card.flash {
  animation: cardFlash .6s ease;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--light);
}

.card-guest {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.card-subtotal {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
}

/* -- Guest Preferences -- */
.card-prefs {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 4px 10px;
  min-height: 0;
}
.card-prefs:empty { display: none; }

.pref-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: capitalize;
  animation: fadeIn .2s ease both;
}

.pref-allergy { background: #fee2e2; color: #991b1b; }
.pref-dietary { background: var(--success-lt); color: var(--success); }
.pref-other   { background: var(--blue-lt); color: var(--blue); }

/* -- Card Items -- */
.card-items {
  list-style: none;
  padding: 6px 10px;
  min-height: 48px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.card-item {
  display: flex;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
  animation: fadeSlideIn .3s ease both;
}

/* -- Qty Buttons -- */
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 16px; font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  touch-action: manipulation;
  transition: var(--tr);
  line-height: 1;
}
.qty-btn:hover { border-color: var(--blue); background: var(--blue-lt); }
.qty-minus { margin-right: 4px; }
.qty-plus  { margin-left: 4px; margin-right: 6px; }

.card-item-qty {
  color: var(--blue);
  font-weight: 800;
  min-width: 20px;
  text-align: center;
}

.card-item-name {
  flex: 1;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* clickable button variant */
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  touch-action: manipulation;
}
.item-tap:hover { color: var(--blue); text-decoration: underline; }

.card-item-price {
  font-weight: 700;
  margin-left: 8px;
  flex-shrink: 0;
}

/* -- Modifier chips -- */
.card-item-mods {
  font-size: 11px;
  color: var(--text2);
  padding: 0 0 2px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}

.mod-chip {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
}

.mod-official {
  background: var(--light);
  color: var(--text2);
}

.mod-custom {
  background: #fef3c7;
  color: #92400e;
  font-style: italic;
}

.mods-tappable { cursor: pointer; touch-action: manipulation; }
.mods-tappable:hover .mod-chip { opacity: .7; }
.mods-add-hint { color: var(--blue); font-style: normal; font-weight: 600; font-size: 11px; }

/* -- Add Note -- */
.card-item-note-row {
  padding: 0 0 4px 28px;
  list-style: none;
}

.add-note-btn {
  background: none; border: none;
  color: var(--blue);
  font-size: 11px; font-weight: 600;
  cursor: pointer; padding: 2px 0;
  touch-action: manipulation;
  opacity: 0.6;
}
.add-note-btn:hover { opacity: 1; }

.card-empty {
  color: var(--text2);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  padding: 12px 0;
}

/* -- Status Indicator -- */
.status-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.1);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text2);
  transition: background .3s;
}

.status-box.connected .status-dot {
  background: var(--success);
  box-shadow: 0 0 6px rgba(22,163,74,.5);
}

.status-box.listening .status-dot {
  background: var(--success);
  animation: pulse 1.2s infinite;
  box-shadow: 0 0 8px rgba(22,163,74,.6);
}

.status-box.error .status-dot {
  background: var(--danger);
}

.status-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
}

/* -- Review Order / Close Tab Button -- */
.btn-end {
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r-sm);
  background: transparent;
  color: rgba(255,255,255,.8);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--tr);
  touch-action: manipulation;
  min-height: 44px;
  display: flex; align-items: center;
}

.btn-end:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

/* -- Waiter Notes -- */
.note-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  margin-bottom: 4px;
  animation: fadeIn .2s ease both;
}

.note-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.note-text {
  font-size: 12px;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

.note-confirm {
  background: rgba(22,163,74,.06);
  border-left: 3px solid var(--success);
}
.note-confirm .note-icon { background: var(--success); color: var(--white); }

.note-alert {
  background: rgba(245,158,11,.08);
  border-left: 3px solid var(--warn);
}
.note-alert .note-icon { background: var(--warn); color: var(--white); }
.note-alert .note-text { color: #92400e; font-weight: 600; }

.note-tip {
  background: rgba(26,115,232,.06);
  border-left: 3px solid var(--blue);
}
.note-tip .note-icon { background: var(--blue); color: var(--white); }

/* -- Agent Actions Drawer -- */
.agent-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 340px;
  max-width: 90vw;
  background: var(--white);
  box-shadow: -4px 0 20px rgba(0,0,0,.15);
  display: flex; flex-direction: column;
  z-index: 100;
  transform: translateX(100%);
  transition: transform .3s ease;
}
.agent-drawer.open { transform: translateX(0); }

.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 99;
  touch-action: manipulation;
}
.drawer-backdrop.hidden { display: none; }

.drawer-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--dark); color: var(--white);
  flex-shrink: 0;
}
.drawer-title { font-size: 14px; font-weight: 700; }
.drawer-close {
  background: none; border: none; color: var(--white);
  font-size: 22px; cursor: pointer; padding: 6px;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}

/* -- Agent Action entries (inside drawer) -- */
.action-entry {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 6px;
  font-size: 11px;
  animation: fadeIn .2s ease both;
}

.action-time {
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  font-size: 10px;
  color: var(--text2);
  min-width: 48px;
  flex-shrink: 0;
}

.action-icon {
  width: 12px;
  text-align: center;
  flex-shrink: 0;
}

.action-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-entry.speculative { opacity: 0.6; }

.action-listening { color: var(--success); }
.action-stopped { color: var(--text2); }
.action-order { color: var(--text); }
.action-transcript { color: var(--text2); font-style: italic; }
.action-confirm { color: var(--success); }
.action-trace { color: var(--text2); font-style: italic; }
.action-tool { color: var(--warn); }

/* -- Suggestions -- */
.suggest-bar {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--blue-lt);
  flex-shrink: 0;
}

.suggest-bar.hidden { display: none; }

.suggest-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 6px;
}

.suggest-items {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.suggest-items::-webkit-scrollbar { display: none; }

.suggest-card {
  background: var(--white);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  box-shadow: var(--shadow);
  min-width: 160px;
  flex-shrink: 0;
  animation: fadeSlideIn .3s ease both;
}

.suggest-name { font-size: 13px; font-weight: 600; }
.suggest-reason { font-size: 11px; color: var(--text2); margin-top: 2px; }
.suggest-price { font-size: 13px; font-weight: 700; color: var(--blue); margin-top: 4px; }

/* -- Controls Bar -- */
.ctrl-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
  gap: 12px;
}

.speakers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.speaker-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all .2s ease;
  touch-action: manipulation;
  white-space: nowrap;
}

.speaker-btn:hover {
  border-color: var(--blue);
  background: var(--blue-lt);
}

.speaker-btn.active {
  border-color: var(--success);
  background: var(--success-lt);
  color: var(--success);
}

.speaker-btn.active .mic-icon {
  animation: pulse 1.2s infinite;
}

.mic-icon { font-size: 13px; }

.ctrl-total {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ========== SCREEN 4: REVIEW ORDER ========== */

.receipt {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.receipt-guest {
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.receipt-guest-hdr {
  padding: 10px 16px;
  background: var(--light);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}

.receipt-prefs {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px 16px;
}

.receipt-item {
  display: flex;
  align-items: baseline;
  padding: 8px 16px 2px;
  font-size: 14px;
}

.receipt-qty {
  color: var(--blue);
  font-weight: 800;
  min-width: 28px;
}

.receipt-name {
  flex: 1;
  font-weight: 500;
}

.receipt-price {
  font-weight: 700;
  margin-left: 12px;
}

.receipt-mods {
  font-size: 11px;
  color: var(--text2);
  font-style: italic;
  padding: 0 16px 6px 44px;
}

.receipt-empty {
  color: var(--text2);
  font-size: 12px;
  font-style: italic;
  padding: 12px 16px;
}

.receipt-subtotal {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  color: var(--blue);
}

.receipt-grand-total {
  font-size: 18px;
  font-weight: 800;
  text-align: right;
  padding: 16px 4px 8px;
  color: var(--text);
}

/* ========== BOTTOM SHEETS ========== */

.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 200;
  touch-action: manipulation;
}
.sheet-backdrop.hidden { display: none; }

.bottom-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--white);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
  z-index: 201;
  display: flex; flex-direction: column;
  max-height: 70vh;
  transform: translateY(100%);
  transition: transform .3s ease;
}
.bottom-sheet.visible { transform: translateY(0); }
.bottom-sheet.hidden { display: none; }

.sheet-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sheet-title { font-size: 15px; font-weight: 700; }
.sheet-close {
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); touch-action: manipulation;
}

.sheet-scroll {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sheet-list { padding: 8px 0; }

.sheet-item {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: none; border: none;
  border-bottom: 1px solid var(--border);
  text-align: left; cursor: pointer;
  touch-action: manipulation;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: background .15s;
}
.sheet-item:hover, .sheet-item:active { background: var(--blue-lt); }
.sheet-item-name { flex: 1; font-weight: 500; }
.sheet-item-price { font-weight: 700; color: var(--blue); margin-left: 12px; flex-shrink: 0; }

.sheet-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sheet-group-hdr {
  padding: 8px 16px 4px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text2);
  background: var(--light);
}

.mod-toggle { justify-content: space-between; }
.mod-toggle.active { background: var(--blue-lt); }
.mod-toggle.active .sheet-item-name { color: var(--blue); font-weight: 600; }
.mod-check { font-size: 14px; font-weight: 700; color: var(--blue); width: 20px; text-align: center; }

/* ========== LANDSCAPE ========== */

@media (orientation: landscape) {
  .floor-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }

  .setup-body { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 24px; }
  .setup-hero { flex-basis: 100%; }
  .setup-sec { max-width: 300px; }

  .panels-col { width: 50%; }
  .panels-col.expanded { width: 70%; }
}

/* ========== PORTRAIT ========== */

@media (orientation: portrait) {
  .speaker-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* ========== SMALL SCREENS ========== */

@media (max-height: 500px) {
  .topbar { height: 44px; min-height: 44px; }
  .topbar h1 { font-size: 14px; }
  .ctrl-bar { padding: 6px 12px; }
  .speaker-btn { padding: 5px 8px; font-size: 10px; }
}

/* ========== ANIMATIONS ========== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardFlash {
  0% { background: rgba(22,163,74,.1); }
  100% { background: var(--white); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
