@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700&display=swap');

:root {
  --bg: #f3f3f6;
  --surface: #ffffff;
  --surface-head: #fafafa;
  --surface-subtle: #f1f1f4;
  --surface-hover: #e7e7ec;

  --border: #d8d8e0;
  --border-light: #e7e7ed;
  --border-input: #c6c6d0;
  --border-strong: #111111;

  --ink: #111111;
  --ink-secondary: #43434a;
  --ink-muted: #767680;
  --on-ink: #ffffff;

  --ok-text: #166534;
  --ok-bg: #eef8f1;
  --ok-border: #bddfc7;

  --warn-text: #92400e;
  --warn-bg: #fef7e6;
  --warn-border: #eed59e;

  --danger-text: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #f0bebe;
  --danger-solid: #dc2626;

  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 236px;
  --nav-h: 64px;
}

/* Matte Editorial Dark Theme (Zero Neon / Zero AI Glow) */
html[data-theme="dark"] {
  --bg: #0c0d10;
  --surface: #15171c;
  --surface-head: #1b1e24;
  --surface-subtle: #20242c;
  --surface-hover: #2a2f3a;

  --border: #2c313c;
  --border-light: #232730;
  --border-input: #383e4c;
  --border-strong: #f2f3f5;

  --ink: #f2f3f5;
  --ink-secondary: #b4b9c5;
  --ink-muted: #7d8494;
  --on-ink: #111111;

  --ok-text: #6ee7b7;
  --ok-bg: rgba(22, 101, 52, 0.22);
  --ok-border: rgba(110, 231, 183, 0.3);

  --warn-text: #fcd34d;
  --warn-bg: rgba(146, 64, 14, 0.24);
  --warn-border: rgba(252, 211, 77, 0.3);

  --danger-text: #fca5a5;
  --danger-bg: rgba(185, 28, 28, 0.22);
  --danger-border: rgba(252, 165, 165, 0.35);
  --danger-solid: #ef4444;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  direction: rtl;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* ============================================================================
   RESPONSIVE APP FRAME
   ============================================================================ */
.app-frame { min-height: 100dvh; display: flex; flex-direction: column; }
.desktop-sidebar { display: none; }

.app-main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 12px) + 16px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1.5px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 16px;
  height: 16px;
  stroke: var(--ink);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); line-height: 1.15; }
.brand-sub { font-size: 12px; color: var(--ink-muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.main-content {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 14px 28px;
}

.tab-panel { display: none; animation: fadeIn 0.14s ease-out; }
.tab-panel.active { display: block; }

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

@media (min-width: 880px) {
  .app-frame { flex-direction: row; }

  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-left: 1px solid var(--border);
    z-index: 40;
    padding: 18px 14px;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 14px;
  }

  .sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

  .sidebar-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: right;
    transition: background 0.14s, color 0.14s;
  }

  .sidebar-nav-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
  }

  .sidebar-nav-btn:hover { background: var(--surface-subtle); color: var(--ink); }
  .sidebar-nav-btn.active { background: var(--ink); color: var(--on-ink); font-weight: 600; }

  .sidebar-footer {
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.5;
  }

  .app-main-col { margin-right: var(--sidebar-w); padding-bottom: 28px; }
  .topbar-brand { display: none; }
  .topbar { padding: 11px 24px; }
  .main-content { padding: 20px 24px 36px; }
  .bottom-nav { display: none; }

  .split-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
    align-items: start;
  }

  .looks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
  }

  .closet-grid { grid-template-columns: repeat(4, 1fr) !important; }
  .fav-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* ============================================================================
   PROMINENT RED ERROR ALERT BANNER (503 / 429 / Network / Timeout)
   ============================================================================ */
.error-banner {
  background: var(--danger-bg);
  border: 1.5px solid var(--danger-solid);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: fadeIn 0.16s ease-out;
}

.error-banner-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.error-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--danger-text);
}

.error-banner-msg {
  font-size: 13px;
  color: var(--danger-text);
  line-height: 1.4;
}

.error-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-error-retry {
  background: var(--danger-solid);
  color: #ffffff;
  border: none;
  border-radius: 7px;
  padding: 7px 13px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================================================
   UNIFIED DAILY STATUS STRIP & SUB-TABS
   ============================================================================ */
.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}

.status-cell {
  flex: 1;
  min-width: 170px;
  padding: 10px 14px;
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.status-cell:last-child { border-left: none; }
.status-kicker { font-size: 11px; font-weight: 600; color: var(--ink-muted); }
.status-value { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.status-cell.is-warn { background: var(--warn-bg); }
.status-cell.is-warn .status-value { color: var(--warn-text); }
.status-cell.is-ok { background: var(--ok-bg); }
.status-cell.is-ok .status-value { color: var(--ok-text); }

.subtabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.subtabs::-webkit-scrollbar { display: none; }

.subtab-btn {
  flex: 1;
  min-width: max-content;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.14s;
  white-space: nowrap;
}

.subtab-btn:hover { color: var(--ink); background: var(--surface-subtle); }
.subtab-btn.active { background: var(--ink); color: var(--on-ink); font-weight: 600; }

.subpanel { display: none; }
.subpanel.active { display: block; }

/* ============================================================================
   FRAMED CARDS, BADGES & SEPARATED COLOR/FIT TAGS
   ============================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}

.card-featured { border-color: var(--ink); }

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

.card-body { padding: 15px 16px; }
.card-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin: 0; color: var(--ink); }
.card-kicker { font-size: 11px; font-weight: 600; color: var(--ink-muted); margin-bottom: 2px; }
.card-sub { font-size: 13px; color: var(--ink-secondary); line-height: 1.5; margin: 0 0 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  white-space: nowrap;
}

.badge-dark { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.badge-ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.badge-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.badge-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-subtle);
  border: 1px solid var(--border-light);
  color: var(--ink-secondary);
  line-height: 1.45;
  white-space: nowrap;
}

.tag-color {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
  font-weight: 500;
}

.tag-fit {
  background: var(--surface-subtle);
  border-color: var(--border);
  color: var(--ink);
  font-weight: 600;
}

.swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(128, 128, 128, 0.45);
  display: inline-block;
  flex-shrink: 0;
}

/* ============================================================================
   FORMS & CHIPS
   ============================================================================ */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-secondary); margin-bottom: 5px; }

.input, .select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23767680' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  background-size: 15px;
  cursor: pointer;
}

.input:focus, .select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(128, 128, 128, 0.14);
}

.input::placeholder { color: var(--ink-muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.collapse-toggle {
  width: 100%;
  text-align: right;
  background: var(--surface-head);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 12px;
  margin-bottom: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.collapse-toggle:hover { border-color: var(--border); color: var(--ink); }

.collapse-body {
  padding: 12px;
  background: var(--surface-head);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.chip {
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--ink-secondary);
  border-radius: 8px;
  padding: 7px 13px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s;
}

.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }

/* ============================================================================
   STRICT 4-TIER BUTTON HIERARCHY
   ============================================================================ */
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 9px;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.08s, background 0.14s, border-color 0.14s, opacity 0.14s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-flex { flex: 1; min-width: 112px; }

.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
  min-height: 48px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-primary.is-done { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-input);
  min-height: 40px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-subtle); border-color: var(--ink); }

.btn-quiet {
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  border-color: var(--border-light);
  min-height: 33px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 7px;
}
.btn-quiet:hover:not(:disabled) { background: var(--surface-hover); color: var(--ink); border-color: var(--border); }

.btn-danger {
  background: var(--surface);
  color: var(--danger-text);
  border-color: var(--danger-border);
  min-height: 31px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 7px;
}
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); border-color: var(--danger-text); }

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }

.danger-zone {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-start;
}

/* ============================================================================
   LOOKBOOK OUTFIT CARDS (Separated Name + Color Tag + View & Swap Buttons)
   ============================================================================ */
.spec-table {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
}

.spec-group-title {
  background: var(--surface-head);
  border-bottom: 1px solid var(--border-light);
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
}

.spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13.5px;
  line-height: 1.4;
}

.spec-row:last-child { border-bottom: none; }
.spec-key { color: var(--ink-muted); min-width: 70px; font-size: 12px; font-weight: 500; flex-shrink: 0; }
.spec-val-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.spec-val { color: var(--ink); font-weight: 600; font-size: 13.5px; }

.spec-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.mini-action-btn {
  border: 1px solid var(--border);
  background: var(--surface-head);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
}

.mini-action-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface);
}

.mini-action-view {
  border-color: var(--border-input);
  color: var(--ink);
  background: var(--surface);
}

.outfit-note {
  padding: 9px 12px;
  background: var(--surface-head);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.collage-img {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  border: 1px solid var(--border);
  display: block;
}

/* ============================================================================
   CLOSET GALLERY CARDS & MANUAL STUDIO SLOTS
   ============================================================================ */
.closet-filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
}

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

.item-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 0.14s, box-shadow 0.14s;
  position: relative;
}

.item-tile:hover { border-color: var(--ink); }
.item-tile.selected { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }

.select-dot {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: rgba(17, 17, 17, 0.45);
  z-index: 3;
}
.item-tile.selected .select-dot { background: var(--ink); box-shadow: inset 0 0 0 4px var(--on-ink); }

.item-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface-head);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 11.5px;
  overflow: hidden;
  position: relative;
}

.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-thumb svg { width: 28px; height: 28px; stroke: var(--ink-muted); fill: none; stroke-width: 1.5; }

.quick-photo-btn {
  position: absolute;
  bottom: 7px;
  right: 7px;
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--ink);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 2;
}
.quick-photo-btn:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

.item-tile-body { padding: 10px 11px 11px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.item-tile-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.item-tile-footer {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-muted);
}

.batch-bar {
  position: sticky;
  bottom: calc(var(--nav-h) + 10px);
  z-index: 25;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: 11px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.batch-bar .btn-white {
  background: var(--on-ink);
  color: var(--ink);
  border: none;
  border-radius: 7px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Manual Studio Visual Canvas */
.studio-canvas {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 600px) {
  .studio-canvas { grid-template-columns: repeat(3, 1fr); }
}

.studio-slot {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.14s;
}

.studio-slot:hover { border-color: var(--ink); }
.studio-slot.is-empty { border-style: dashed; background: var(--surface-head); }

.studio-slot-visual {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-light);
  overflow: hidden;
}

.studio-slot-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.studio-slot-visual svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke-width: 1.6;
}

.studio-slot-info {
  padding: 8px 10px;
  text-align: right;
}

.studio-slot-lbl { font-size: 10.5px; color: var(--ink-muted); font-weight: 600; }
.studio-slot-name { font-size: 12.5px; color: var(--ink); font-weight: 600; margin-top: 2px; line-height: 1.3; }

/* Packing Checklist Rows */
.pack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border-light);
}

.pack-row:last-child { border-bottom: none; }
.pack-row.is-packed .pack-name { text-decoration: line-through; color: var(--ink-muted); }

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

.pack-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

/* Analytics & Lists */
.color-bar-track {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.progress-label { min-width: 82px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.progress-track { flex: 1; height: 8px; background: var(--surface-subtle); border-radius: 99px; overflow: hidden; border: 1px solid var(--border-light); }
.progress-fill { height: 100%; background: var(--ink); border-radius: 99px; }
.progress-num { min-width: 48px; text-align: left; font-size: 12px; color: var(--ink-muted); font-weight: 600; }

/* Camera Mode Selector & Dropzone */
.mode-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mode-pill { background: var(--surface); border: 1px solid var(--border-input); color: var(--ink-secondary); border-radius: 8px; padding: 8px 12px; font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.mode-pill.active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }

.mode-hint {
  font-size: 13px;
  color: var(--ink-secondary);
  background: var(--surface-head);
  border: 1px solid var(--border-light);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  line-height: 1.45;
}

.photo-dropzone {
  width: 100%;
  border-radius: 10px;
  border: 1.5px dashed var(--border-input);
  background: var(--surface-head);
  padding: 16px 12px;
  text-align: center;
  margin-bottom: 10px;
}

.photo-dropzone img { max-width: 100%; max-height: 280px; border-radius: 8px; border: 1px solid var(--border); object-fit: contain; }

.multi-preview-strip { display: flex; gap: 8px; overflow-x: auto; justify-content: center; flex-wrap: wrap; }
.multi-preview-strip img { width: 84px; height: 84px; object-fit: cover; border-radius: 7px; border: 1px solid var(--border); }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}

.list-row-main { flex: 1; min-width: 0; }
.list-row-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.list-row-sub { font-size: 12px; color: var(--ink-secondary); margin-top: 2px; line-height: 1.45; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
@media (min-width: 600px) { .stats-grid-4 { grid-template-columns: repeat(4, 1fr); } }

.stat-box { background: var(--surface-head); border: 1px solid var(--border-light); border-radius: 9px; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.stat-lbl { font-size: 12px; color: var(--ink-muted); }

/* Bottom Navigation (Mobile) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-inner { max-width: 560px; margin: 0 auto; height: var(--nav-h); display: grid; grid-template-columns: repeat(5, 1fr); }

.nav-btn {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 2px;
}

.nav-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn span { font-size: 11px; font-weight: 500; }
.nav-btn.active { color: var(--ink); }
.nav-btn.active svg { stroke-width: 2.2; }
.nav-btn.active span { font-weight: 700; }

/* Modal Sheet */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 10, 14, 0.52);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 720px) {
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal-sheet { border-radius: 16px !important; max-width: 540px; border: 1px solid var(--border); }
}

.modal-backdrop.open { display: flex; }

.modal-sheet {
  width: 100%;
  max-width: 540px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
}

.modal-top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-head);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body-pad { padding: 16px 18px calc(22px + env(safe-area-inset-bottom, 8px)); }
.modal-title { font-size: 15.5px; font-weight: 700; margin: 0; color: var(--ink); }

/* ============================================================================
   REAL-TIME THINKING & PROGRESS LOADING CARD (Replaces Boring Spinner)
   ============================================================================ */
.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 16, 20, 0.45);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.loader-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.loader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.loader-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.loader-pct {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.loader-bar-track {
  width: 100%;
  height: 7px;
  background: var(--surface-subtle);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  margin-bottom: 14px;
}

.loader-bar-fill {
  height: 100%;
  width: 8%;
  background: var(--ink);
  border-radius: 99px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.loader-scan-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-head);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  margin-bottom: 14px;
  min-height: 62px;
}

.loader-scan-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.loader-scan-thumb img { width: 100%; height: 100%; object-fit: cover; }

.loader-scan-meta { flex: 1; min-width: 0; }
.loader-scan-kicker { font-size: 11px; color: var(--ink-muted); font-weight: 600; }
.loader-scan-item { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.loader-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.loader-step {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--ink-muted);
  transition: color 0.2s;
}

.loader-step.is-active { color: var(--ink); font-weight: 600; }
.loader-step.is-done { color: var(--ok-text); }

.step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border-input);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 9px;
}

.loader-step.is-active .step-dot {
  border-color: var(--ink);
  background: var(--ink);
  animation: pulseDot 1.1s infinite ease-in-out;
}

.loader-step.is-done .step-dot {
  border-color: var(--ok-text);
  background: var(--ok-bg);
  color: var(--ok-text);
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.7); opacity: 0.5; }
}

/* Toast & PIN Gate */
.toast {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 90;
  background: var(--ink);
  color: var(--on-ink);
  padding: 10px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

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

.pin-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pin-gate.open { display: flex; }

.pin-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
}

.bullet-list { margin: 6px 0 0; padding-right: 18px; color: var(--ink); font-size: 13.5px; line-height: 1.55; }
.bullet-list li { margin-bottom: 4px; }

.empty-state {
  text-align: center;
  padding: 34px 16px;
  color: var(--ink-muted);
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.divider { height: 1px; background: var(--border-light); margin: 14px 0; }
.hidden { display: none !important; }
