/* ============================================================================
   Trench of Death 2 — Modular Board Builder (Mobile Edition Styles)
   Mobile-First · Touch-First · Safe-Area Aware · 48px Minimum Hit Targets
   ============================================================================ */

:root {
  --bg-app: #0d1015;
  --bg-panel: #151a21;
  --bg-panel-elevated: #1d2430;
  --bg-card: #202733;
  --bg-card-hover: #293342;
  --border-subtle: #2b3545;
  --border-focus: #e09f3e;
  --text-primary: #f0f4f8;
  --text-secondary: #9fb0c2;
  --text-muted: #687787;
  --accent-gold: #e09f3e;
  --accent-gold-dim: rgba(224, 159, 62, 0.16);
  --accent-green: #2ea043;
  --accent-green-bright: #3fb950;
  --accent-red: #f85149;
  --accent-blue: #58a6ff;
  --accent-comp: #70c1b3;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  user-select: none;
  -webkit-user-select: none;
}

/* APP SHELL */
.mobile-app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

/* COMPACT HEADER */
.mobile-header {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 14px;
  flex-shrink: 0;
  z-index: 30;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3a2d1d, #1f2630);
  border: 1.5px solid var(--accent-gold);
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(224, 159, 62, 0.25);
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-weight: 800;
  font-size: 15.5px;
  color: var(--text-primary);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* UNIFIED EDITION SWITCHER LOCATED AT BRAND HEADER */
.edition-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #303c4f;
  border-radius: 16px;
  padding: 2px;
  gap: 2px;
}

.edition-toggle-btn {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.2;
  transition: all 0.15s ease;
}

.edition-toggle-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.edition-toggle-btn.active {
  background: rgba(63, 185, 80, 0.22);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.45);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.brand-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-pill-btn {
  background: #1c2430;
  border: 1.5px solid rgba(224, 159, 62, 0.45);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 14px;
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: all 0.15s ease;
}

.header-pill-btn:active {
  background: #252f3f;
  border-color: var(--accent-gold);
}

.preset-pill-arrow {
  color: var(--accent-gold);
  font-size: 13px;
}

/* BOARD WORKSPACE */
.mobile-board-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #090c10;
}

/* SUBBAR */
.board-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(21, 26, 33, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
  min-height: 48px;
}

.conn-pill {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-green-bright);
  display: flex;
  align-items: center;
  gap: 7px;
}

.conn-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green-bright);
  box-shadow: 0 0 6px rgba(63, 185, 80, 0.6);
  flex-shrink: 0;
}

.conn-pill.warn {
  color: #ff9800;
}

.conn-pill.warn .status-dot {
  background: #ff9800;
  box-shadow: 0 0 6px rgba(255, 152, 0, 0.6);
}

.subbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-seg {
  display: flex;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px;
}

.mode-seg .seg-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 4px;
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-seg .seg-btn.active {
  background: var(--accent-gold);
  color: #0f1216;
}

/* BOARD ZOOM CONTROLLER */
.board-zoom-control {
  display: flex;
  align-items: center;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.zoom-btn {
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  width: 34px;
  height: 32px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.zoom-btn:active {
  background: var(--accent-gold);
  color: #0f1216;
}

.zoom-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.zoom-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  padding: 0 8px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  min-width: 44px;
  border-radius: 4px;
}

.zoom-pill:hover {
  color: #fff;
}

.zoom-pill.zoomed {
  color: var(--accent-gold);
  background: rgba(224, 159, 62, 0.12);
}

/* MOBILE BOARD VIEWPORT */
.mobile-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 14px 12px 145px; /* bottom padding reserves thumb zone for floating action dock */
  position: relative;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.board-compass {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 7px;
  user-select: none;
}

.board-compass.south {
  margin-top: 7px;
  margin-bottom: 0;
}

.mobile-grid-wrap {
  background: #11151c;
  border: 1.5px solid #2d3848;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 100%;
}

.mobile-board-grid {
  display: grid;
  gap: 3px;
  justify-content: center;
}

/* GRID CELL */
.mob-cell {
  aspect-ratio: 1 / 1;
  background: #171d26;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}

.mob-cell:active {
  transform: scale(0.96);
}

.mob-cell.empty {
  color: rgba(255, 255, 255, 0.28);
  font-size: 26px;
  font-weight: 300;
}

.mob-cell.occupied {
  border-style: solid;
  border-color: #313f52;
  background: #1c232e;
}

.mob-cell.selected {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px var(--accent-gold);
  background: #232c3a;
  z-index: 5;
}

.mob-cell-coord {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  z-index: 4;
}

.mob-cell-rot {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.7);
  color: var(--accent-gold);
  padding: 1px 4px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 4;
}

.mob-pin-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 11px;
  z-index: 4;
}

/* SVG in cell */
.mob-cell svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* FLOATING DOCK (BRUSH & CELL ACTIONS) */
.floating-cell-toolbar,
.floating-brush-dock {
  position: absolute;
  bottom: 74px; /* above the 62px bottom nav bar */
  left: 10px;
  right: 10px;
  background: var(--bg-panel);
  border: 1.5px solid var(--accent-gold);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
  padding: 10px 12px;
  z-index: 25;
  animation: slideUpFloat 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.floating-brush-dock {
  border-color: var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brush-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.brush-thumb {
  width: 52px;
  height: 52px;
  background: #12161c;
  border-radius: 8px;
  border: 1.5px solid var(--accent-gold);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.brush-thumb svg {
  width: 100%;
  height: 100%;
}

.brush-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brush-lbl {
  font-size: 10.5px;
  color: var(--accent-gold);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.brush-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brush-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brush-act-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 13px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.brush-act-btn:active {
  transform: scale(0.97);
}

.brush-act-btn.primary {
  background: var(--accent-gold);
  color: #0f1216;
  border-color: var(--accent-gold);
  font-weight: 800;
}

.brush-act-btn.accent {
  background: rgba(224, 159, 62, 0.16);
  color: var(--accent-gold);
  border-color: rgba(224, 159, 62, 0.45);
}

/* FLOATING CELL ACTIONS */
.toolbar-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cell-tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(224, 159, 62, 0.18);
  padding: 3px 8px;
  border-radius: 5px;
}

.cell-name-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  margin: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-close-sm {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-actions {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 6px;
}

.tool-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 8px 6px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}

.tool-btn.tool-primary {
  background: var(--accent-gold);
  color: #0f1216;
  border-color: var(--accent-gold);
  font-weight: 800;
}

.tool-btn.tool-danger {
  color: var(--accent-red);
  border-color: rgba(248, 81, 73, 0.35);
}

.tool-icon {
  font-size: 16px;
}

.tool-lbl {
  font-size: 11px;
  font-weight: 700;
}

/* FIXED BOTTOM NAVIGATION BAR */
.mobile-bottom-nav {
  position: relative;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + var(--safe-bottom));
  min-height: 62px;
  z-index: 35;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.45);
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  min-height: 50px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.12s ease;
}

.nav-item.active {
  color: var(--accent-gold);
  background: rgba(224, 159, 62, 0.08);
}

.nav-item:active {
  background: rgba(255, 255, 255, 0.08);
}

.nav-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 3px;
}

.nav-lbl {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* BOTTOM SHEET DRAWER SYSTEM */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 86vh;
  background: var(--bg-panel);
  border-top: 1px solid #3c495e;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transform: translateY(105%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: var(--safe-bottom);
}

.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-drag-handle {
  width: 44px;
  height: 4px;
  background: #3e4b5e;
  border-radius: 2px;
  margin: 8px auto 4px;
  cursor: grab;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.sheet-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rot-picker {
  display: flex;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.sheet-rot-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  min-height: 28px;
}

.sheet-rot-btn.active {
  background: var(--accent-gold);
  color: #0f1216;
  font-weight: 800;
}

.sheet-close-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.sheet-body-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 28px;
}

/* TILE PALETTE SHEET */
.sheet-search-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-search {
  width: 100%;
  background: var(--bg-app);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}

.sheet-search:focus {
  border-color: var(--accent-gold);
}

.sheet-cat-bar {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.sheet-cat-bar::-webkit-scrollbar {
  display: none;
}

.sheet-cat-chip {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  min-height: 38px;
  border-radius: 18px;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sheet-cat-chip.active {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.sheet-palette-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mob-tile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  position: relative;
}

.mob-tile-card.selected {
  border-color: var(--accent-gold);
  background: #252d3a;
  box-shadow: 0 0 0 1.5px var(--accent-gold);
}

.mob-tile-card:active {
  transform: scale(0.98);
}

.mob-card-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #11151c;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.mob-card-thumb svg {
  width: 100%;
  height: 100%;
}

.mob-used-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent-gold);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
}

.mob-card-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.mob-card-ports {
  font-size: 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* GENERATOR SHEET */
.gen-section {
  margin-bottom: 20px;
}

.gen-section-title {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  margin-bottom: 10px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.preset-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 10px;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-card.active {
  border-color: var(--accent-gold);
  background: var(--accent-gold-dim);
}

.preset-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.preset-dim {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.gen-toggles {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 6px 12px;
  margin-bottom: 14px;
}

.mobile-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

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

.toggle-text {
  display: flex;
  flex-direction: column;
  padding-right: 12px;
}

.toggle-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.toggle-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.ios-switch {
  width: 44px;
  height: 26px;
  accent-color: var(--accent-gold);
  cursor: pointer;
}

.btn-create-large {
  width: 100%;
  background: var(--accent-gold);
  color: #0f1216;
  border: 1px solid var(--accent-gold);
  border-radius: 10px;
  padding: 15px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(224, 159, 62, 0.35);
  min-height: 52px;
}

.btn-create-large:active {
  transform: scale(0.98);
}

.kits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.kit-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
  padding: 12px 8px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kit-btn.comp {
  border-color: rgba(112, 193, 179, 0.45);
  color: #70c1b3;
}

.kit-btn:active {
  background: var(--bg-card-hover);
}

.dual-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.util-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 48px;
}

.util-btn.clear {
  color: #ff7b72;
  border-color: rgba(248, 81, 73, 0.4);
}

/* MANIFEST SHEET */
.manifest-stat-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-box {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
}

.stat-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-gold);
}

.stat-lbl {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.manifest-items-wrap {
  margin-bottom: 18px;
}

.manifest-group-hd {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
}

.manifest-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
}

.manifest-row-title {
  font-weight: 600;
  color: var(--text-primary);
}

.manifest-qty-tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(224, 159, 62, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.manifest-actions-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.manifest-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 800;
  padding: 13px;
  border-radius: 9px;
  cursor: pointer;
  min-height: 48px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.manifest-action-btn.primary {
  background: var(--accent-gold);
  color: #0f1216;
  border-color: var(--accent-gold);
}

/* MOBILE TOAST */
.mobile-toast {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1f2937;
  border: 1px solid var(--accent-gold);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  z-index: 100;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90%;
  text-align: center;
}

.mobile-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
