/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0f18;
  --surface:   #161927;
  --surface-2: #1f2336;
  --surface-3: #272c42;
  --accent:    #6c63ff;
  --accent-h:  #5b53e8;
  --accent-l:  rgba(108, 99, 255, 0.12);
  --success:   #22c55e;
  --success-l: rgba(34, 197, 94, 0.12);
  --danger:    #ef4444;
  --danger-l:  rgba(239, 68, 68, 0.12);
  --warning:   #f59e0b;
  --warning-l: rgba(245, 158, 11, 0.12);
  --text:      #e2e8f0;
  --muted:     #64748b;
  --border:    #2a3050;
  --radius:    10px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.page-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container--wide {
  max-width: 1200px;
}

/* ─── Nav ────────────────────────────────────────────────────────────────── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--surface-2);
}

.nav-links a.active {
  color: var(--accent);
}

.nav-logout {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.nav-logout:hover {
  color: var(--danger);
  background: var(--danger-l);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0.4rem;
}

/* ─── Main content ────────────────────────────────────────────────────────── */
main {
  flex: 1;
  padding: 2rem 1rem;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-h); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }

.btn-danger {
  background: var(--danger-l);
  color: var(--danger);
  border: 1px solid transparent;
}
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }

.btn-success {
  background: var(--success-l);
  color: var(--success);
  border: 1px solid transparent;
}
.btn-success:hover:not(:disabled) { background: var(--success); color: #fff; }

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

.btn-block { width: 100%; }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

input::placeholder, textarea::placeholder { color: var(--muted); }

/* ─── Login Page ─────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-text {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.login-logo-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─── Upload Page ────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-l);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.upload-zone h3 {
  margin-bottom: 0.4rem;
  color: var(--text);
}

.upload-zone p {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Mobile camera/library buttons — hidden by default (desktop).
   JS shows them only when width < 768 AND pointer: coarse (touch). */
.mobile-upload-btns {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 0 0.25rem;
}

.mobile-upload-btn {
  font-size: 1rem;
  padding: 0.85rem 1rem;
}

.mobile-upload-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

.photo-preview {
  margin-top: 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
  position: relative;
}

.photo-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.photo-preview-label {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--success);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
}

/* ─── Confirm Screen Photo Strip ─────────────────────────────────────────── */
.confirm-photos-strip {
  display: flex;
  flex-direction: row;
  gap: 0.625rem;
  overflow-x: auto;
  padding-bottom: 0.375rem;
  -webkit-overflow-scrolling: touch;
}

.confirm-photos-strip::-webkit-scrollbar {
  height: 4px;
}

.confirm-photos-strip::-webkit-scrollbar-track {
  background: var(--surface-2);
  border-radius: 2px;
}

.confirm-photos-strip::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.confirm-photo-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: block;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.confirm-photo-thumb:hover {
  transform: scale(1.04);
  border-color: var(--accent);
}

/* ─── Photo Lightbox ─────────────────────────────────────────────────────── */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.photo-lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.photo-lightbox img {
  max-width: min(92vw, 900px);
  max-height: 88vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.7);
}

.photo-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
}

.photo-lightbox-close:hover {
  background: var(--surface-3);
}

/* ─── Multi-photo Thumbnails (Upload Page) ───────────────────────────────── */
.photo-thumbs {
  margin-top: 1.25rem;
}

.photo-thumbs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.photo-thumbs-count {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.photo-thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
}

.thumb-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}

.thumb-remove:hover {
  background: var(--danger);
}

.thumb-num {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
}

/* ─── Photo Gallery (Results Page) ──────────────────────────────────────── */
.photo-gallery {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  border-radius: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.photo-gallery img {
  flex: 0 0 auto;
  width: auto;
  height: 160px;
  border-radius: 8px;
  object-fit: cover;
}

/* ─── Photo Count Badge (History Page) ──────────────────────────────────── */
.photo-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.1rem 0.5rem;
  margin-top: 0.3rem;
  font-weight: 500;
}

/* ─── Loading Overlay ────────────────────────────────────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 15, 24, 0.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
}

.loading-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ─── Results Page ────────────────────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
  align-items: start;
}


.summary-box {
  background: var(--accent-l);
  border: 1px solid rgba(108, 99, 255, 0.25);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1.25rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* Items table */
.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.items-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.items-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.items-table tr:last-child td { border-bottom: none; }

.items-table tr:hover td { background: var(--surface-2); }

.badge-estimated {
  background: var(--warning-l);
  color: var(--warning);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 0.4rem;
  white-space: nowrap;
}

.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.fw-600 { font-weight: 600; }

.totals-section {
  border-top: 2px solid var(--border);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  font-size: 0.95rem;
}

.total-row.subtotal {
  color: var(--muted);
  font-size: 0.875rem;
}

.total-range {
  background: var(--success-l);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.total-range-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--success);
}

.total-range-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--success);
}

.meta-row {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.meta-row span { display: flex; align-items: center; gap: 0.3rem; }

/* ─── History Page ───────────────────────────────────────────────────────── */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.history-item:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  color: var(--text);
}

.history-thumb {
  width: 72px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.history-thumb-placeholder {
  width: 72px;
  height: 56px;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--muted);
}

.history-thumbs-row {
  display: flex;
  gap: 0.25rem;
  overflow: hidden;
  max-width: 240px;
}

.history-info h3 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.history-info p {
  font-size: 0.8rem;
  color: var(--muted);
}

.history-total {
  text-align: right;
}

.history-total-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--success);
}

.history-total-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h2 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* ─── Pricing Page ───────────────────────────────────────────────────────── */
.pricing-table {
  width: 100%;
  border-collapse: collapse;
}

.pricing-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.pricing-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.9rem;
}

.pricing-table tr:last-child td { border-bottom: none; }

.pricing-table tr:hover td { background: var(--surface-2); }

.pricing-table .actions { display: flex; gap: 0.4rem; justify-content: flex-end; }

.edit-input {
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.3rem 0.5rem;
  width: 100%;
  outline: none;
}

.edit-price-input {
  width: 80px;
}

.add-form {
  display: grid;
  grid-template-columns: 1fr 100px auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-error {
  background: var(--danger-l);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
  background: var(--success-l);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* ─── Page Header ────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.5rem;
}

/* ─── Utility ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .results-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.1rem;
  }

  .nav-links.open { display: flex; }
  .nav-links a, .nav-logout { width: 100%; text-align: left; }
  .nav-toggle { display: block; }
  nav { position: relative; }

  .add-form {
    grid-template-columns: 1fr;
  }

  .history-item {
    grid-template-columns: 56px 1fr;
  }

  .history-total { display: none; }

  h1 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .login-card { padding: 1.75rem 1.25rem; }
  .card { padding: 1rem; }
  main { padding: 1rem 0.75rem; }
}

/* ─── Review Tab Bar ─────────────────────────────────────────────────────── */
.review-tab-bar {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.review-tab-bar::-webkit-scrollbar {
  display: none;
}

.review-tab-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.2;
}

.review-tab-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.review-tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ─── Confirmation Screen ────────────────────────────────────────────────── */
.confirm-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
  white-space: nowrap;
}

.confirm-qty-input,
.confirm-price-input {
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
  padding: 0.3rem 0.4rem;
  outline: none;
  -webkit-appearance: none;
}

.confirm-qty-input {
  width: 58px;
  text-align: center;
}

.confirm-price-input {
  width: 76px;
  text-align: right;
}

.confirm-qty-input:focus,
.confirm-price-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.item-notes {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.add-item-panel {
  margin-top: 1rem;
  padding: 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.add-item-qty-price {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.editing-row td {
  background: rgba(108, 99, 255, 0.05);
}

.confirm-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
  .add-item-qty-price { grid-template-columns: 1fr; }
  .confirm-qty-input { width: 52px; }
  .confirm-price-input { width: 68px; }
}

/* ─── Per-photo Sections (Confirm & Results) ─────────────────────────────── */
.photo-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.photo-section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.photo-section-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.photo-section-thumb:hover {
  border-color: var(--accent);
}

.photo-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.photo-section-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

.photo-section-subtotal .subtotal-value {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.photo-section-divider {
  border: none;
  border-top: 2px solid var(--border);
  margin: 1.5rem 0;
}

/* ─── Review Screen – Hero Photo ─────────────────────────────────────────── */
.review-photo-hero {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: opacity 0.15s;
}

.review-photo-hero:hover {
  opacity: 0.92;
}

/* ─── Review Screen – AI Description ────────────────────────────────────── */
.review-photo-summary {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  white-space: pre-wrap;
}

/* ─── Review Screen – Section Footer (add button + subtotal) ─────────────── */
.photo-section-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  gap: 0.5rem;
}

.photo-section-subtotal-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.photo-subtotal-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.photo-section-subtotal-inline .subtotal-value {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

/* ─── Fixed Confirm Footer ───────────────────────────────────────────────── */
.confirm-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 200;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

.confirm-footer-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--success);
  margin-bottom: 0.1rem;
}

.confirm-footer-range-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

.confirm-footer-range {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--success);
  line-height: 1.2;
}

.confirm-footer-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Extra bottom padding so footer doesn't overlap last content */
body.has-confirm-footer main {
  padding-bottom: 6rem;
}

@media (max-width: 560px) {
  .confirm-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
  }

  .confirm-footer-totals {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
  }

  .confirm-footer-range {
    font-size: 1.3rem;
  }

  .confirm-footer-btn {
    width: 100%;
  }

  body.has-confirm-footer main {
    padding-bottom: 8.5rem;
  }
}

/* ─── Mobile Item Cards (toggled by button, never by breakpoint) ─────────── */
.mobile-item-list { display: none; }

/* Mobile view active — toggled via JS, not media query */
.confirm-screen--mobile-view .confirm-table-wrap { display: none; }

.confirm-screen--mobile-view .mobile-item-list {
  display: block;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.mobile-item-card {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.mobile-item-content {
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  position: relative;
  z-index: 1;
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-height: 2.75rem;
  justify-content: center;
}

.mobile-item-card.swiped .mobile-item-content {
  transform: translateX(-112px);
}

.mobile-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-item-details {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.2;
}

.mobile-item-details strong {
  color: var(--text);
  font-weight: 600;
}

.mobile-item-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 112px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.375rem;
}

.mobile-item-actions .btn {
  flex: 1;
  padding: 0.4rem 0.2rem;
  font-size: 0.78rem;
  text-align: center;
  justify-content: center;
  min-width: 0;
}

.mobile-items-empty {
  padding: 1.25rem 0.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Swipe hint tip */
.swipe-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  max-height: 3rem;
  opacity: 1;
  transition: opacity 0.25s ease, max-height 0.25s ease, padding 0.25s ease;
}

.swipe-hint--gone {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.swipe-hint-text {
  flex: 1;
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.75;
}

.swipe-hint-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.1rem;
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0.5;
  flex-shrink: 0;
}

.swipe-hint-close:hover {
  opacity: 1;
}

/* Inline edit card on mobile */
.mobile-item-card--editing {
  background: rgba(108, 99, 255, 0.05);
}

.mobile-item-edit {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-item-edit-name {
  font-size: 0.84rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-item-edit-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.mobile-edit-sep {
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
}

.mobile-edit-total {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  text-align: right;
  white-space: nowrap;
}

.mobile-item-edit-row .confirm-qty-input {
  width: 50px;
  flex-shrink: 0;
}

.mobile-item-edit-row .confirm-price-input {
  width: 66px;
  flex-shrink: 0;
}

.mobile-item-edit-row .btn {
  padding: 0.3rem 0.45rem;
  flex-shrink: 0;
}
