/* Better Than Boxes — Customer App — Dark Design System */
/* Matches betterthanboxes.co brand: Oswald, dark theme, no-radius aesthetic */

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

:root {
  --bg:        #0a0a0a;
  --surface:   #111;
  --surface2:  #141414;
  --border:    #222;
  --border2:   #2a2a2a;
  --text:      #ffffff;
  --muted:     #999;
  --subtle:    #666;
  --font-headline: 'Oswald', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --green:  #3a9b62;
  --red:    #e53e3e;
  --orange: #dd6b20;
  --yellow: #d97706;

  /* Extended semantic tokens */
  --green-dim:    #1a3a28;   /* success background */
  --green-border: #1f5c38;   /* success border */
  --blue:         #3b82f6;   /* info / link */
  --blue-dim:     #1a2a4a;   /* info background */

  /* Chat widget */
  --chat-bubble-agent:  #141414;
  --chat-bubble-user:   #1a3a28;
  --chat-bubble-border: #222;

  /* Timeline */
  --timeline-line:        #222;
  --timeline-dot-done:    #3a9b62;
  --timeline-dot-pending: #333;

  /* Motion */
  --transition: 150ms ease;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Header ── */
header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.nav-logo-img { width: 32px; height: 32px; display: block; flex-shrink: 0; }
.nav-wordmark {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: .12em;
  color: var(--text);
  text-transform: uppercase;
}

nav { display: flex; gap: 4px; align-items: center; }
nav button {
  background: none; border: none; color: var(--muted);
  font-size: 0.78rem; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; padding: 6px 12px; font-family: var(--font-body);
  transition: color .15s;
}
nav button:hover { color: var(--text); }

main {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 80px; /* 80px bottom for bottom nav */
  width: 100%;
}

/* ── Pages ── */
.page { display: none; }
.page.active { display: block; }
#page-dashboard { padding-bottom: 106px; }

/* ── Auth page ── */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2.5rem;
  width: 100%; max-width: 440px;
}

.auth-logo { text-align: center; margin-bottom: 24px; }

.auth-headline {
  font-family: var(--font-headline);
  font-weight: 900; font-size: 1.6rem;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--text); margin-bottom: 8px;
}

.auth-sub { color: var(--subtle); font-size: .85rem; margin-bottom: 1.5rem; }

/* ── Move cards ── */
.move-list {
  display: grid;
  gap: 16px;
}

.move-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text);
  margin-bottom: 24px;
  overflow: hidden;
}

.move-card-summary {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 20px 24px;
}

.move-summary-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 18px;
  min-width: 0;
  padding: 0;
  text-align: left;
  width: 100%;
}
.move-summary-toggle:hover,
.move-summary-toggle:focus-visible {
  color: var(--text);
  outline: none;
}

.move-summary-text {
  display: block;
  min-width: 0;
}

.move-card-label {
  color: var(--subtle);
  display: block;
  font-size: .62rem;
  letter-spacing: .2em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.move-expand-icon {
  color: var(--muted);
  display: inline-flex;
  justify-content: center;
  transition: transform var(--transition), color var(--transition);
}
.move-card.is-expanded .move-expand-icon {
  color: var(--text);
  transform: rotate(180deg);
}

.move-view-totes {
  align-items: center;
  background: var(--text);
  border: 1px solid var(--text);
  color: #050505;
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-headline);
  font-size: .78rem;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  letter-spacing: .14em;
  min-height: 44px;
  padding: 11px 16px;
  text-transform: uppercase;
  white-space: nowrap;
}
.move-view-totes:hover,
.move-view-totes:focus-visible {
  background: #d9d9d9;
  border-color: #d9d9d9;
  outline: none;
}

.move-details {
  border-top: 1px solid var(--border);
  padding: 18px 24px 20px;
}
.move-details[hidden] {
  display: none;
}

.move-map {
  aspect-ratio: 2.65 / 1;
  background:
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.035) 1px, transparent 1px),
    radial-gradient(circle at 24% 38%, rgba(255,255,255,.16), transparent 14%),
    radial-gradient(circle at 77% 62%, rgba(255,255,255,.12), transparent 16%),
    linear-gradient(145deg, #151515, #080808);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
  border: 1px solid var(--border2);
  margin-bottom: 14px;
  min-height: 118px;
  overflow: hidden;
  position: relative;
}
.move-map iframe {
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}
.move-map::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
  top: 50%;
  transform: rotate(-8deg);
}
.move-map-route {
  border-top: 2px dashed rgba(255,255,255,.52);
  height: 0;
  left: 21%;
  position: absolute;
  right: 21%;
  top: 52%;
  transform: rotate(-10deg);
  transform-origin: center;
}
.move-map:has(iframe)::before {
  display: none;
}
.move-map-pin {
  align-items: center;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,.38);
  color: var(--text);
  display: flex;
  height: 34px;
  justify-content: center;
  position: absolute;
  width: 34px;
}
.move-map-pin-from { left: 17%; top: 37%; }
.move-map-pin-to { right: 17%; top: 51%; }

.move-route {
  color: var(--text);
  display: block;
  font-family: var(--font-headline);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.25;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.move-meta,
.move-meta-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .85rem;
  margin-top: 0;
}
.move-meta-icon { font-size: .95rem; flex-shrink: 0; }

.move-status {
  display: inline-block;
  padding: 2px 10px;
  font-size: .65rem; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--border2); color: var(--muted);
}
.move-status.active { border-color: var(--text); color: var(--text); }
.move-status.delivered { border-color: var(--green); color: var(--green); }

.move-addresses {
  border-top: 1px solid var(--border);
  display: grid;
}
.move-address-link {
  align-items: center;
  color: var(--muted);
  display: grid;
  gap: 12px;
  grid-template-columns: 64px minmax(0, 1fr) 18px;
  padding: 13px 24px;
  text-decoration: none;
}
.move-address-link + .move-address-link {
  border-top: 1px solid var(--border);
}
.move-address-link span {
  color: var(--subtle);
  font-size: .62rem;
  letter-spacing: .16em;
  line-height: 1;
  text-transform: uppercase;
}
.move-address-link strong {
  color: var(--text);
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}
.move-address-link:hover,
.move-address-link:focus-visible {
  background: #131313;
  outline: none;
}
.move-directions {
  align-items: center;
  border: 1px solid var(--border2);
  color: var(--text);
  display: inline-flex;
  font-family: var(--font-headline);
  font-size: .76rem;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  letter-spacing: .14em;
  min-height: 46px;
  padding: 13px 20px;
  text-decoration: none;
  text-transform: uppercase;
  width: 100%;
}
.move-directions:hover,
.move-directions:focus-visible {
  background: #171717;
  outline: none;
}

@media (max-width: 560px) {
  .move-card-summary {
    grid-template-columns: 1fr;
  }

  .move-view-totes {
    width: 100%;
  }
}

.back-inline {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--subtle);
  cursor: pointer;
  display: inline-flex;
  font-size: .76rem;
  gap: 8px;
  letter-spacing: .16em;
  margin: -4px 0 14px;
  padding: 6px 0;
  text-transform: uppercase;
}
.back-inline:hover,
.back-inline:focus-visible {
  color: var(--text);
  outline: none;
}

/* ── Tote tiles ── */
.tote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 12px;
}

.tote-search-wrap {
  background: rgba(10, 10, 10, .78);
  border: 1px solid rgba(255, 255, 255, .16);
  bottom: calc(60px + env(safe-area-inset-bottom) + 12px);
  box-shadow:
    0 0 22px rgba(255, 255, 255, .14),
    0 14px 34px rgba(0, 0, 0, .62);
  left: max(14px, calc((100vw - 720px) / 2 + 20px));
  margin-bottom: 0;
  padding: 8px;
  position: fixed;
  right: max(14px, calc((100vw - 720px) / 2 + 20px));
  z-index: 190;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.tote-search-wrap input {
  background: var(--surface);
  text-align: center;
}
.tote-search-wrap p {
  display: none;
}

.tote-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: block;
  font-family: var(--font-body);
  padding: 0;
  text-align: left;
  transition: border-color .15s, transform .15s;
  width: 100%;
}
.tote-tile:hover,
.tote-tile:focus-visible {
  border-color: #444;
  outline: none;
}
.tote-tile:active { transform: translateY(1px); }

.tote-tile-media {
  aspect-ratio: 1;
  background: linear-gradient(145deg, #151515, #070707);
  overflow: hidden;
  position: relative;
  width: 100%;
}
.tote-tile-media img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.tote-tile-placeholder {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 2rem;
  height: 100%;
  justify-content: center;
  opacity: .86;
  width: 100%;
}
.tote-tile-shade {
  background:
    linear-gradient(180deg, rgba(0,0,0,.68) 0%, rgba(0,0,0,.08) 38%, rgba(0,0,0,.82) 100%),
    linear-gradient(135deg, rgba(0,0,0,.42), rgba(70,70,70,.12));
  inset: 0;
  position: absolute;
}
.tote-tile-id {
  font-family: var(--font-headline);
  font-size: .98rem;
  font-weight: 700;
  left: 12px;
  letter-spacing: .08em;
  line-height: 1.1;
  max-width: calc(100% - 24px);
  overflow-wrap: anywhere;
  position: absolute;
  text-transform: uppercase;
  top: 11px;
  z-index: 1;
}
.tote-tile-desc {
  bottom: 12px;
  color: rgba(255,255,255,.84);
  display: -webkit-box;
  font-size: .78rem;
  left: 12px;
  line-height: 1.35;
  max-width: calc(100% - 24px);
  overflow: hidden;
  position: absolute;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  z-index: 1;
}

/* ── Tote detail ── */
.detail-close-btn {
  align-items: center;
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 1.2rem;
  height: 38px;
  justify-content: center;
  margin-left: auto;
  transition: border-color .15s, color .15s;
  width: 38px;
}
.detail-close-btn:hover,
.detail-close-btn:focus-visible {
  border-color: var(--border2);
  color: var(--text);
  outline: none;
}
.tote-detail-head {
  display: flex; align-items: center; gap: 16px; margin-bottom: 22px;
}
.tote-detail-icon {
  background: var(--surface2); border: 1px solid var(--border);
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; flex-shrink: 0;
}
.tote-detail-info h1 {
  font-family: var(--font-headline);
  font-weight: 700; font-size: 1.4rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text);
}
.tote-detail-info p { color: var(--muted); font-size: .88rem; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 3px 9px;
  font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--border2); color: var(--muted);
}
.badge-available { border-color: var(--text); color: var(--text); }
.badge-rented { border-color: var(--muted); color: var(--muted); }
.badge-maintenance { border-color: var(--subtle); color: var(--subtle); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

label {
  display: block; font-size: .65rem; font-weight: 400;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--subtle); margin-bottom: 6px;
}

input, select, textarea {
  width: 100%; padding: 14px 16px;
  border: 1px solid var(--border2);
  background: var(--surface); color: var(--text);
  font-size: .93rem; outline: none;
  font-family: var(--font-body);
  transition: border-color .15s;
  -webkit-appearance: none; appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--subtle); }
select option { background: var(--surface); color: var(--text); }
textarea { resize: vertical; min-height: 70px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: 2px solid transparent;
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; font-family: var(--font-body); font-weight: 400;
  transition: background .2s, color .2s, border-color .2s;
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: default; }

.btn-primary {
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.btn-primary:hover:not(:disabled) {
  background: transparent; color: var(--text);
}
.btn-ghost {
  background: transparent; border-color: var(--border2); color: var(--muted);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--text); color: var(--text); }
.btn-danger {
  background: transparent; border-color: #8b2020; color: #f87171;
}
.btn-danger:hover:not(:disabled) { background: #8b2020; color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: .72rem; }
.btn-xs { padding: 4px 8px; font-size: .62rem; }
.btn-full { width: 100%; justify-content: center; }

.file-btn {
  position: relative;
  overflow: hidden;
}
.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  padding: 20px; margin-bottom: 16px;
}

/* ── Section head ── */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h2 {
  font-family: var(--font-headline);
  font-weight: 700; font-size: 1rem;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text);
}
.optional-label {
  color: var(--subtle);
  font-family: var(--font-body);
  font-size: .65rem;
  font-weight: 400;
  letter-spacing: .08em;
}
.subsection-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

.inline-status {
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--muted);
  font-size: .82rem;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.packing-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.packing-gallery.packing-gallery-empty {
  display: flex;
  justify-content: center;
}
.packing-gallery.packing-gallery-empty .packing-upload-tile {
  width: min(260px, 100%);
}
.packing-gallery.packing-gallery-single {
  display: flex;
  justify-content: center;
}
.packing-upload-tile {
  min-height: 180px;
  border: 1px dashed var(--border2);
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  padding: 24px 16px;
  margin: 0;
  transition: border-color .15s, color .15s, background .15s;
}
.packing-upload-tile:hover {
  border-color: var(--text);
  color: var(--text);
  background: var(--surface);
}
.packing-upload-tile i {
  font-size: 1.35rem;
  color: inherit;
}
.packing-upload-tile span {
  font-size: .88rem;
  color: inherit;
  text-transform: none;
  letter-spacing: 0;
}
.packing-upload-tile small {
  font-size: .65rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--subtle);
}
.packing-upload-tile input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.packing-photo {
  border: 1px solid var(--border);
  background: var(--surface2);
  min-width: 0;
  position: relative;
}
.packing-photo-wrap {
  width: min(320px, 100%);
}
.packing-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #050505;
  border-bottom: 1px solid var(--border);
}
.packing-photo-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.packing-photo-actions .btn {
  width: 100%;
}
.packing-photo-delete {
  align-items: center;
  background: rgba(10, 10, 10, .78);
  border: 1px solid #8b2020;
  color: #f87171;
  cursor: pointer;
  display: inline-flex;
  font-size: .9rem;
  height: 36px;
  justify-content: center;
  position: absolute;
  right: 10px;
  top: 10px;
  transition: background .15s, color .15s, border-color .15s;
  width: 36px;
}
.packing-photo-delete:hover,
.packing-photo-delete:focus-visible {
  background: #8b2020;
  border-color: #8b2020;
  color: var(--text);
  outline: none;
}
.packing-photo-replace {
  position: relative;
  overflow: hidden;
}
.packing-photo-replace input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.snapshot-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.snapshot-actions .btn {
  min-height: 44px;
}
@media (max-width: 520px) {
  .snapshot-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .snapshot-actions .btn {
    width: 100%;
  }
}
/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  padding: 28px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal h2 {
  font-family: var(--font-headline); font-weight: 700; font-size: 1rem;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text);
  margin-bottom: 20px;
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px;
}

/* ── Alerts ── */
.alert {
  padding: 12px 16px; font-size: .88rem; margin-bottom: 16px;
  border: 1px solid var(--border); color: var(--muted); background: var(--surface2);
}
.alert-error { border-color: #8b2020; background: #1a0808; color: #f87171; }
.alert-success { border-color: #0a3a20; background: #041a0c; color: #4aaa70; }

/* ── Empty state ── */
.empty { text-align: center; padding: 40px 24px; color: var(--subtle); }
.empty .icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; }
.empty p { font-size: .9rem; color: var(--subtle); line-height: 1.7; }

/* ── Back button ── */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--subtle); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; cursor: pointer; margin-bottom: 18px;
  background: none; border: none; padding: 0;
  transition: color .15s; font-family: var(--font-body);
}
.back-btn:hover { color: var(--text); }

/* ── Loading ── */
.loading-row { text-align: center; padding: 40px; }
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 1px solid var(--border2); border-top-color: var(--text);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 72px; right: 24px;
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text); padding: 12px 20px;
  font-size: .82rem; letter-spacing: .06em;
  z-index: 9999; transform: translateY(80px); opacity: 0;
  transition: all .25s; max-width: 300px;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { border-color: #0a3a20; color: #4aaa70; }
#toast.error   { border-color: #8b2020; color: #f87171; }

/* ── Bottom navigation (mobile-first) ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 60px; background: var(--bg); border-top: 1px solid var(--border);
  display: flex; z-index: 200;
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  color: var(--subtle); transition: color .15s; padding: 8px;
}
.bnav-item.active { color: var(--text); }
.bnav-icon { font-size: 1.2rem; line-height: 1; }
.bnav-label { font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; }

#btb-chat-panel {
  bottom: 60px !important;
  right: 0 !important;
  width: min(420px, 100vw) !important;
  height: min(560px, calc(100dvh - 60px)) !important;
  border-bottom: none !important;
}

/* ── Timeline ── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0;
}

.timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 24px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 20px;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border: 2px solid var(--timeline-dot-pending);
  background: var(--bg);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.timeline-dot.done {
  background: var(--timeline-dot-done);
  border-color: var(--timeline-dot-done);
}

.timeline-line {
  flex: 1;
  width: 1px;
  background: var(--timeline-line);
  margin-top: 2px;
}
.timeline-item:last-child .timeline-line { display: none; }

.timeline-content { flex: 1; min-width: 0; padding-top: 0; }

.timeline-label {
  font-size: .82rem;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 3px;
}
.timeline-item:not(.done) .timeline-label { color: var(--muted); }

.timeline-meta {
  font-size: .72rem;
  color: var(--subtle);
  letter-spacing: .04em;
}

/* ── Chat widget ── */
.chat-window {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 400px;
  height: 520px;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  font-size: .88rem;
  line-height: 1.55;
  border: 1px solid var(--chat-bubble-border);
  word-break: break-word;
}

.chat-bubble.agent {
  background: var(--chat-bubble-agent);
  color: var(--text);
  align-self: flex-start;
  border-color: var(--border);
}

.chat-bubble.user {
  background: var(--chat-bubble-user);
  color: var(--text);
  align-self: flex-end;
  border-color: var(--green-border);
}

/* Animated 3-dot typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--chat-bubble-agent);
  border: 1px solid var(--border);
  align-self: flex-start;
  width: fit-content;
}
.chat-typing span {
  display: block;
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: typing-bounce .6s ease infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); opacity: .4; }
  50%       { transform: translateY(-4px); opacity: 1; }
}

.chat-input-row {
  display: flex;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input-row input {
  flex: 1;
  border: none;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 14px;
  font-size: .88rem;
  color: var(--text);
  outline: none;
}
.chat-input-row input::placeholder { color: var(--subtle); }
.chat-input-row button {
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 12px 18px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.chat-input-row button:hover {
  background: transparent;
  color: var(--text);
  outline: 2px solid var(--text);
  outline-offset: -2px;
}

/* Floating action button + panel */
.chat-widget-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;          /* FAB exception — circular affordance */
  background: var(--text);
  color: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 500;
  transition: transform var(--transition), background var(--transition);
  box-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.chat-widget-fab:hover { transform: scale(1.06); }

.chat-widget-panel {
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: 499;
  display: none;
  flex-direction: column;
  width: 360px;
  max-height: 520px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.6);
}
.chat-widget-panel.open { display: flex; }

.chat-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.chat-widget-header-title {
  font-family: var(--font-headline);
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.chat-widget-close {
  background: none;
  border: none;
  color: var(--subtle);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 4px;
  transition: color var(--transition);
}
.chat-widget-close:hover { color: var(--text); }

/* ── Opt-in checkbox (TCPA) ── */
.opt-in-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
}
.opt-in-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--green);
  flex-shrink: 0;
}
.opt-in-row label {
  font-size: .75rem;
  color: var(--subtle);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  line-height: 1.55;
  cursor: pointer;
  margin-bottom: 0;
}
.opt-in-row a { color: var(--muted); text-decoration: underline; }

/* ── Status pill (softer badge variant) ── */
/* Same sharp-edge aesthetic as .badge; used for status flows with more color variety */
.pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid var(--border2);
  color: var(--muted);
  border-radius: 0;  /* Explicit: no radius despite name */
}
.pill-green  { border-color: var(--green-border); color: var(--green); background: var(--green-dim); }
.pill-orange { border-color: #5a2e00; color: var(--orange); background: #1a0e00; }
.pill-blue   { border-color: #1a3a6e; color: var(--blue); background: var(--blue-dim); }

/* ── Calendar buttons (confirmation page) ── */
.cal-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
  margin-bottom: 8px;
}
.cal-btn:hover { border-color: var(--text); color: var(--text); }

.cal-btn-icon { font-size: 1.1rem; flex-shrink: 0; }

.cal-btn-apple  { /* no additional style — inherits .cal-btn */ }
.cal-btn-google { /* no additional style — inherits .cal-btn */ }

/* ── Responsive ── */
@media (max-width: 640px) {
  header { padding: 0 14px; }
  main { padding: 18px 14px 80px; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .modal { padding: 20px; }
}

@media (min-width: 769px) {
  /* Hide bottom nav on desktop — use header nav instead */
  .bottom-nav { display: none; }
  main { padding-bottom: 28px; }
  #page-dashboard { padding-bottom: 0; }
  .tote-search-wrap {
    background: transparent;
    border: none;
    bottom: auto;
    box-shadow: none;
    left: auto;
    margin-bottom: 14px;
    padding: 0;
    position: static;
    right: auto;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  #toast { bottom: 24px; }
}
