/* ============================================================
   BizTrip v11 — app.css
   Single source of truth for all visual tokens and components.
   Every value comes from the Visual Specification.
   Order: 1. Variables → 2. Reset + Base → 3. Layout →
          4. Components (alphabetical) → 5. Utilities
   ============================================================ */

/* ── 1. Variables ─────────────────────────────────────────── */

:root {
  /* ── Primary (blue) ─────────────────────────── */
  --clr-primary:          #1A73E8;
  --clr-primary-dim:      #1558B0;
  --clr-primary-tint:     #E8F0FE;
  --clr-on-primary:       #FFFFFF;

  /* ── Surfaces ───────────────────────────────── */
  --clr-surface:          #FFFFFF;
  --clr-surface-low:      #F8F9FA;
  --clr-surface-mid:      #F1F3F4;
  --clr-surface-high:     #E8EAED;

  /* ── Text ───────────────────────────────────── */
  --clr-text:             #1F1F1F;
  --clr-text-2:           #5F6368;
  --clr-text-3:           #9AA0A6;
  --clr-text-inv:         #FFFFFF;

  /* ── Semantic ───────────────────────────────── */
  --clr-success:          #34A853;
  --clr-error:            #D93025;
  --clr-error-tint:       #FCE8E6;
  --clr-warning:          #F9AB00;
  --clr-warning-tint:     #FEF7E0;

  /* ── Travel type colours ────────────────────── */
  --clr-active-travel:    #1A73E8;
  --clr-passive-travel:   #5F6368;
  --clr-working:          #34A853;

  /* ── Typography ─────────────────────────────── */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-md:   15px;
  --text-lg:   17px;
  --text-xl:   32px;

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-bold:    600;

  --leading-tight:  1.2;
  --leading-normal: 1.4;
  --leading-loose:  1.6;

  /* ── Spacing ─────────────────────────────────── */
  --sp-tight: 3px;
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  24px;
  --sp-6:  32px;
  --sp-7:  48px;

  /* ── Border radius ───────────────────────────── */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  /* ── Elevation ───────────────────────────────── */
  --shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-2: 0 3px 8px rgba(0,0,0,0.14), 0 1px 3px rgba(0,0,0,0.10);
  --shadow-3: 0 8px 24px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.10);

  /* ── Layout dimensions ───────────────────────── */
  --topbar-h:      56px;
  --bottom-nav-h:  44px;
  --safe-top:      0px;
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
  --page-pad:      var(--sp-4);
  --max-width:     640px;
}

/* ── 2. Reset + Base ──────────────────────────────────────── */

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

html {
  height: 100%;
  /* Prevent font size adjustment on orientation change (iOS) */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  color: var(--clr-text);
  background: var(--clr-surface-low);
  line-height: var(--leading-normal);
  min-height: 100%;
  min-height: 100dvh;
  /* Do NOT set height: 100dvh — on iOS Safari this uses the small viewport
     and leaves a gap when the address bar hides. Fixed elements with
     bottom: 0 anchor to the visual viewport edge automatically. */
  overflow: hidden;
  -webkit-tap-highlight-color: rgba(0,0,0,0.04);
  overscroll-behavior: none;
}

/* ── Desktop: centre the app in a 480px phone column ──────────
   Uses calc(50vw - 240px) for left and explicit right.
   NO transforms — avoids stacking context issues with position:fixed.
   ──────────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  html, body {
    background: #dadce0;
  }

  /* Each fixed element gets explicit left + right, no right:0 fallback */
  #topbar {
    left:  calc(50vw - 240px) !important;
    right: calc(50vw - 240px) !important;
    width: 480px !important;
    border-left:  1px solid var(--clr-surface-high);
    border-right: 1px solid var(--clr-surface-high);
  }

  #main {
    left:  calc(50vw - 240px) !important;
    right: calc(50vw - 240px) !important;
    width: 480px !important;
  }

  #bottom-nav {
    left:  calc(50vw - 240px) !important;
    right: calc(50vw - 240px) !important;
    width: 480px !important;
    border-left:  1px solid var(--clr-surface-high);
    border-right: 1px solid var(--clr-surface-high);
  }

  #login-screen {
    left:  calc(50vw - 240px) !important;
    right: calc(50vw - 240px) !important;
    width: 480px !important;
  }

  .modal {
    left:  calc(50vw - 240px) !important;
    right: calc(50vw - 240px) !important;
    width: 480px !important;
  }

  #snackbar {
    left:    calc(50vw - 240px);
    right:   auto;
    width:   480px;
    transform: none;
  }

  /* White column behind the app, grey everywhere else */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: #dadce0;
    z-index: -2;
  }

  body::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    left:  calc(50vw - 240px);
    width: 480px;
    background: var(--clr-surface-low);
    z-index: -1;
    box-shadow: 0 0 40px rgba(0,0,0,0.15);
  }
}

a {
  color: var(--clr-primary);
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: rgba(0,0,0,0.04);
  touch-action: manipulation;
}

input, select, textarea {
  font-family: inherit;
}

/* Remove autofill background tint (Chrome / Safari) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--clr-surface) inset;
  -webkit-text-fill-color: var(--clr-text);
}

/* ── 3. Layout ────────────────────────────────────────────── */

/* Topbar ─────────────────────────────────────────────────── */

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Total height = content height + iOS status bar */
  height: var(--topbar-h);
  padding: 0 var(--sp-2) 0 var(--sp-4);
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-surface-high);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

#topbar-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--clr-text);
}

#topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* Topbar icon buttons */
#sync-btn,
#user-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--clr-text-2);
  flex-shrink: 0;
}

/* Offline badge */
#offline-icon {
  display: none;
  font-size: 9px;
  font-weight: 700;
  color: var(--clr-error);
  background: #FEE2E2;
  border-radius: 4px;
  padding: 2px 5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

body.is-offline #offline-icon {
  display: inline-block;
}

/* Sync button */
#sync-icon {
  font-size: 18px;
  line-height: 1;
  display: block;
  transition: transform 0.6s linear;
}

body.is-syncing #sync-icon {
  animation: spin 1s linear infinite;
}

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

#sync-btn:active,
#user-btn:active {
  background: var(--clr-surface-mid);
}

/* Main content area ──────────────────────────────────────── */

#main {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-nav-h) + 34px);
  overflow: hidden;
}



:root {
  
}

/* Push #main up on pages that show the quick bar */


/* Raise snackbar above quick bar on those pages */
body[data-page="times"] #snackbar,
body[data-page="expenses"] #snackbar {
  bottom: calc(var(--bottom-nav-h) + 34px);
}
/* ── END QUICK BAR LAYOUT BLOCK ────────────────────────────── */

/* Pages */
.page {
  display: none;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: var(--page-pad);
  padding-bottom: calc(var(--sp-6) + var(--safe-bottom));
  box-sizing: border-box;
}

.page--active {
  display: block;
}

/* Centered max-width wrapper for tablet */
.page > * {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

/* Bottom navigation ──────────────────────────────────────── */

#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-surface-high);
  display: flex;
  justify-content: space-around;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* .bnav-row is a transparent flex wrapper */
.bnav-row {
  display: contents;
}

.bnav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 0 6px;
  border: none;
  background: transparent;
  color: var(--clr-text-3);
  cursor: pointer;
  font-size: var(--text-xs);
  flex: 1;
  -webkit-tap-highlight-color: transparent;
}

.bnav-btn .biz-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.bnav-btn--active {
  color: var(--clr-primary);
}

/* Offline indicator ──────────────────────────────────────── */

#offline-icon {
  display: none;
  color: var(--clr-error);
  font-size: 20px;
}

body.is-offline #offline-icon {
  display: inline-flex;
}

body.is-offline #sync-btn {
  color: var(--clr-text-3);
  pointer-events: none;
}

body.is-offline #topbar::after {
  content: "Offline — changes will sync when connected";
  display: block;
  font-size: var(--text-xs);
  color: var(--clr-text-inv);
  background: var(--clr-warning);
  text-align: center;
  padding: var(--sp-1) var(--sp-4);
  position: absolute;
  bottom: -24px;
  left: 0;
  right: 0;
}

/* Loading bar ────────────────────────────────────────────── */

#loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--clr-primary);
  width: 0;
  z-index: 9999;
  transition: width 0.3s ease;
}

#loading-bar.is-loading {
  animation: loading-bar-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-bar-pulse {
  0%   { width: 20%; opacity: 1; }
  50%  { width: 75%; opacity: 0.8; }
  100% { width: 20%; opacity: 1; }
}

/* Login screen ───────────────────────────────────────────── */

#login-screen {
  position: fixed;
  inset: 0;
  background: var(--clr-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: var(--sp-5);
  text-align: center;
}

#login-screen.hidden {
  display: none;
}

/* ── 4. Components (alphabetical) ─────────────────────────── */

/* ── Autocomplete dropdown ────────────────────────────────── */

#autocomplete-dropdown {
  position: fixed;
  z-index: 400;
  min-width: 200px;
  max-width: calc(100vw - var(--sp-5));
  max-height: 240px;
  overflow-y: auto;
  background: var(--clr-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--clr-surface-high);
}

#autocomplete-dropdown[hidden] {
  display: none;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--clr-text);
  cursor: pointer;
  border-bottom: 1px solid var(--clr-surface-mid);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:active {
  background: var(--clr-primary-tint);
}

.suggestion-item__match {
  font-weight: var(--weight-medium);
  color: var(--clr-primary);
}

/* ── Buttons ──────────────────────────────────────────────── */

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  height: 48px;
  padding: 0 var(--sp-5);
  border-radius: var(--radius-full);
  background: var(--clr-primary);
  color: var(--clr-on-primary);
  min-width: 96px;
  box-shadow: var(--shadow-1);
}

.btn-primary:active {
  background: var(--clr-primary-dim);
}

.btn-secondary {
  height: 48px;
  padding: 0 var(--sp-5);
  border-radius: var(--radius-full);
  background: var(--clr-surface-mid);
  color: var(--clr-text);
  min-width: 96px;
}

.btn-secondary:active {
  background: var(--clr-surface-high);
}

.btn-danger {
  height: 48px;
  padding: 0 var(--sp-5);
  border-radius: var(--radius-full);
  background: var(--clr-error);
  color: var(--clr-on-primary);
  min-width: 96px;
  box-shadow: var(--shadow-1);
}

.btn-danger:active {
  background: #B3261E;
}

.btn-text {
  height: 40px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--clr-primary);
}

.btn-text:active {
  background: var(--clr-primary-tint);
}

/* Icon inside any button */
.btn-primary .material-symbols-outlined,
.btn-secondary .material-symbols-outlined,
.btn-danger .material-symbols-outlined,
.btn-text .material-symbols-outlined {
  font-size: 18px;
  margin-right: var(--sp-1);
  vertical-align: middle;
}

/* Disabled state */
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled,
.btn-text:disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* FAB ─────────────────────────────────────────────────────── */

.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 34px + var(--sp-4));
  right: var(--sp-4);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--clr-primary);
  color: var(--clr-on-primary);
  box-shadow: var(--shadow-2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fab .material-symbols-outlined {
  font-size: 24px;
}

.fab:active {
  background: var(--clr-primary-dim);
}

/* ── Card ─────────────────────────────────────────────────── */

.card {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

/* ── Dash KPI tiles (trip dashboard) ──────────────────────── */

.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
  margin: var(--sp-4) 0;
}

.dash-kpi-tile {
  background: var(--clr-surface-mid);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
}

.dash-kpi-val {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--clr-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-kpi-sub {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-kpi-lbl {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-text-2);
  margin-top: var(--sp-1);
}

/* ── Data table ───────────────────────────────────────────── */

.data-table-wrap {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;  /* prevents overflow — columns share available width */
}

.data-table thead th {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--clr-text-2);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1.5px solid var(--clr-surface-high);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  background: var(--clr-surface-low);
}

.data-table thead th:active {
  background: var(--clr-surface-high);
}

/* Sorted column header */
.data-table thead th.th--active {
  color: var(--clr-primary);
}

/* Second header row (group headers) */
.data-table thead tr:nth-child(2) th {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: none;
  letter-spacing: 0;
  color: var(--clr-text-2);
  padding-top: var(--sp-1);
  border-bottom: 1px solid var(--clr-surface-high);
}

.data-table tbody td {
  font-size: var(--text-sm);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--clr-surface-mid);
  vertical-align: top;
  color: var(--clr-text);
  overflow: hidden;
  word-break: break-word;
}

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

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:active {
  background: var(--clr-surface-mid);
}

.data-table__primary {
  font-weight: var(--weight-medium);
  color: var(--clr-text);
}

.data-table__secondary {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
  margin-top: 2px;
}

.data-table__amount {
  color: var(--clr-primary);
  font-weight: var(--weight-medium);
  text-align: right;
  white-space: nowrap;
}

.data-table__amount-home {
  color: var(--clr-text-2);
  font-size: var(--text-xs);
  text-align: right;
  white-space: nowrap;
}

/* Table controls row */
.table-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}

.table-controls__label {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
  font-weight: var(--weight-medium);
}

/* ── Empty state ──────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  color: var(--clr-text-2);
}

.empty-state__icon {
  font-size: 48px;
  color: var(--clr-text-3);
  margin-bottom: var(--sp-4);
}

.empty-state__title {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--clr-text);
  margin-bottom: var(--sp-2);
}

.empty-state__sub {
  font-size: var(--text-sm);
  color: var(--clr-text-2);
}

/* ── Input fields ─────────────────────────────────────────── */

.field {
  margin-bottom: var(--sp-4);
  position: relative;
}

.field__label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--clr-text-2);
  margin-bottom: var(--sp-1);
  letter-spacing: 0.03em;
}

/* Pre-filled from previous section — light grey to signal auto-filled */
.field__input[data-prefilled] {
  background: var(--clr-surface-mid) !important;
  border-color: var(--clr-surface-high);
}

.field__input {
  width: 100%;
  height: 48px;
  padding: 0 var(--sp-7) 0 var(--sp-3);
  border: 1.5px solid var(--clr-surface-high);
  border-radius: var(--radius-md);
  background: var(--clr-surface);
  font-size: var(--text-md);
  color: var(--clr-text);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.field__input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}

.field__input::placeholder {
  color: var(--clr-text-3);
}

/* Error state */
.field--error .field__input {
  border-color: var(--clr-error);
}

.field__error-msg {
  display: none;
  font-size: var(--text-xs);
  color: var(--clr-error);
  margin-top: var(--sp-1);
}

.field--error .field__error-msg {
  display: block;
}

/* Textarea */
.field__input--textarea {
  height: auto;
  min-height: 80px;
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-3);
  resize: vertical;
}

/* Clear button */
.field__clear-btn {
  position: absolute;
  right: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--clr-text-3);
  color: var(--clr-surface);
  font-size: 14px;
  line-height: 1;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
}

.field__clear-btn:hover {
  background: var(--clr-text-2);
}

/* Show clear btn when input has value — toggled via JS */
.field--has-value .field__clear-btn {
  display: flex;
}

/* Select dropdown */
.field__input--select {
  padding-right: var(--sp-7);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%235F6368' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

/* Side-by-side fields */
.field-row {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}

.field-row__main {
  flex: 3;
}

.field-row__side {
  flex: 2;
}

/* ── Icon grid (icon picker) ──────────────────────────────── */

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
}

.icon-grid__item {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--clr-surface-mid);
  color: var(--clr-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.icon-grid__item .biz-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.icon-grid__item:active,
.icon-grid__item--selected {
  background: var(--clr-primary-tint);
  color: var(--clr-primary);
}

/* ── List items ───────────────────────────────────────────── */

.list-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-surface-high);
  min-height: 56px;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0,0,0,0.04);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:active {
  background: var(--clr-surface-mid);
}

.list-item__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--clr-primary-tint);
  color: var(--clr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.list-item__content {
  flex: 1;
  min-width: 0;
}

.list-item__name {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--clr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item__sub {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
  margin-top: 2px;
}

.list-item__meta {
  font-size: var(--text-sm);
  color: var(--clr-text-2);
  flex-shrink: 0;
}

.list-item__arrows {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}

.list-item__arrow-btn {
  width: 32px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--clr-text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 20px;
}

.list-item__arrow-btn:active {
  background: var(--clr-surface-mid);
}

/* ── Modals ───────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.50);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 300;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal[data-open] {
  visibility: visible;
  opacity: 1;
}

.modal__surface {
  background: var(--clr-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: var(--max-width);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-3);
  transform: translateY(24px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal[data-open] .modal__surface {
  transform: translateY(0);
}

.modal__surface--fullscreen {
  border-radius: 0;
  max-height: 100dvh;
  height: 100dvh;
  /* Push content below iPhone status bar */
  padding-top: var(--safe-top);
}

.modal__header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--clr-surface-high);
  flex-shrink: 0;
}

.modal__header h2 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--clr-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4);
  -webkit-overflow-scrolling: touch;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + var(--safe-bottom));
  border-top: 1px solid var(--clr-surface-high);
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .modal__surface:not(.modal__surface--fullscreen) {
    border-radius: var(--radius-lg);
    align-self: center;
    margin: var(--sp-4);
    max-height: 85dvh;
  }
}

/* ── Page card (Times + Expenses) ─────────────────────────── */

.page-card {
  background: var(--clr-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-1);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  box-sizing: border-box;
  width: 100%;
}

.page-card__seg-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--sp-3);
}

.page-card__seg-ctrl {
  display: inline-flex;
  background: var(--clr-surface-mid);
  border-radius: var(--radius-full);
  padding: var(--sp-tight);
  gap: 2px;
}

.page-card__seg-btn {
  height: 32px;
  padding: 0 var(--sp-4);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--clr-text-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border: none;
  cursor: pointer;
  min-width: 64px;
  text-align: center;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.page-card__seg-btn--active {
  background: var(--clr-surface);
  color: var(--clr-primary);
  box-shadow: var(--shadow-1);
}

.page-card__value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.page-card__value-left {
  flex: 1;
}

.page-card__status {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-text-2);
  margin-bottom: 2px;
}

.page-card__value {
  font-size: 28px;
  font-weight: var(--weight-regular);
  color: var(--clr-primary);
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-tight);
}

.page-card__value--running {
  color: var(--clr-success);
}

.page-card__meta {
  text-align: right;
  padding-left: var(--sp-3);
}

.page-card__meta-top {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--clr-primary);
  line-height: var(--leading-tight);
}

.page-card__meta-bot {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
  line-height: var(--leading-normal);
}

.page-card__actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  margin-bottom: var(--sp-4);
}

.page-card__actions .btn-primary,
.page-card__actions .btn-secondary,
.page-card__actions .btn-danger {
  flex: 1;
  max-width: 180px;
}

.page-card__kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-2);
}

.page-card__kpi-tile {
  background: var(--clr-surface-mid);
  border-radius: var(--radius-md);
  padding: var(--sp-2);
  text-align: center;
  overflow: hidden;
  min-width: 0;
}

.page-card__kpi-val {
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--clr-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: var(--leading-tight);
}

.page-card__kpi-sub {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.page-card__kpi-lbl {
  font-size: 10px;
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--clr-text-2);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Segmented control (standalone, used in forms) ─────────── */

.seg-ctrl {
  display: inline-flex;
  background: var(--clr-surface-mid);
  border-radius: var(--radius-full);
  padding: var(--sp-tight);
  gap: 2px;
}

.seg-ctrl__btn {
  height: 32px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--clr-text-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.seg-ctrl__btn--active {
  background: var(--clr-surface);
  color: var(--clr-primary);
  box-shadow: var(--shadow-1);
}

/* ── Settings ─────────────────────────────────────────────── */

.settings-section {
  margin-bottom: var(--sp-5);
}

.settings-section__title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-text-2);
  padding: 0 var(--sp-4) var(--sp-2);
}

.settings-card {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  min-height: 56px;
  border-bottom: 1px solid var(--clr-surface-high);
  cursor: pointer;
}

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

.settings-row:active {
  background: var(--clr-surface-mid);
}

.settings-row__icon {
  width: 24px;
  text-align: center;
  color: var(--clr-text-2);
  flex-shrink: 0;
  font-size: 20px;
}

.settings-row__label {
  flex: 1;
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--clr-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-row__value {
  font-size: var(--text-sm);
  color: var(--clr-text-2);
  text-align: right;
}

.settings-row__chevron {
  color: var(--clr-text-3);
  font-size: 20px;
  flex-shrink: 0;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle__track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: var(--clr-surface-high);
  transition: background 0.2s;
}

.toggle input:checked + .toggle__track {
  background: var(--clr-primary);
}

.toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--clr-surface);
  box-shadow: var(--shadow-1);
  transition: transform 0.2s;
}

.toggle input:checked ~ .toggle__thumb {
  transform: translateX(20px);
}

/* ── Snackbar ─────────────────────────────────────────────── */

#snackbar {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 34px + var(--sp-3));
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: #323232;
  color: #FFFFFF;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  white-space: nowrap;
  max-width: calc(100vw - var(--sp-7));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

#snackbar.snackbar--visible {
  opacity: 1;
  pointer-events: auto;
}

.snackbar__undo {
  color: #8AB4F8;
  font-weight: var(--weight-medium);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: var(--text-sm);
  padding: 0;
  height: auto;
}

/* ── Trip banner (Times + Expenses pages) ─────────────────── */

.trip-banner {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  min-height: 56px;
  -webkit-tap-highlight-color: rgba(0,0,0,0.04);
}

.trip-banner:active {
  background: var(--clr-surface-low);
}

.trip-banner__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--clr-primary-tint);
  color: var(--clr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.trip-banner__info {
  flex: 1;
  min-width: 0;
}

.trip-banner__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--clr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-banner__sub {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-banner__chevron {
  color: var(--clr-text-3);
  flex-shrink: 0;
  font-size: 20px;
}

.trip-banner--no-trip .trip-banner__name {
  color: var(--clr-text-2);
}

/* ── Trip tiles (Trips page, tile view) ───────────────────── */

.trip-tile {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0,0,0,0.04);
}

.trip-tile:active {
  background: var(--clr-surface-low);
}

.trip-tile__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}

.trip-tile__name {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--clr-text);
}

.trip-tile__number {
  font-size: var(--text-sm);
  color: var(--clr-text-2);
  margin-left: var(--sp-2);
}

.trip-tile__actions {
  display: flex;
  gap: var(--sp-1);
}

.trip-tile__dest {
  font-size: var(--text-sm);
  color: var(--clr-text-2);
  margin-bottom: var(--sp-1);
}

.trip-tile__dates {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.trip-tile__dates-actual {
  font-size: var(--text-xs);
  color: var(--clr-text-3);
  margin-top: 2px;
}

.trip-tile__active-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--clr-primary);
  background: var(--clr-primary-tint);
  border-radius: var(--radius-full);
  padding: 2px var(--sp-2);
  margin-bottom: var(--sp-2);
}

/* Trip KPI chips (on tile) */
.trip-tile__kpi-row {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  flex-wrap: wrap;
}

.trip-tile__kpi-chip {
  background: var(--clr-surface-mid);
  border-radius: var(--radius-sm);
  padding: 2px var(--sp-2);
  font-size: var(--text-xs);
  color: var(--clr-text-2);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.trip-tile__kpi-chip-val {
  font-weight: var(--weight-medium);
  color: var(--clr-primary);
}

/* ── Search bar ───────────────────────────────────────────── */

.search-bar {
  position: relative;
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
}

.search-bar .biz-icon,
.search-bar [data-icon] {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--clr-text-3);
  pointer-events: none;
  z-index: 1;
  flex-shrink: 0;
}

.search-bar__input {
  width: 100%;
  height: 40px;
  padding: 0 var(--sp-5) 0 38px;
  border: 1.5px solid var(--clr-surface-high);
  border-radius: var(--radius-full);
  background: var(--clr-surface);
  font-size: var(--text-sm);
  color: var(--clr-text);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  font-family: inherit;
}

.search-bar__input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}

.search-bar__input::placeholder {
  color: var(--clr-text-3);
}

/* ── Filter chips ─────────────────────────────────────────── */

.filter-row {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 32px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-full);
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-surface-high);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--clr-text-2);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.filter-chip--active {
  background: var(--clr-primary-tint);
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}

/* ── View toggle buttons ──────────────────────────────────── */

.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--clr-surface-mid);
  border-radius: var(--radius-md);
  padding: 2px;
}

.view-toggle__btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--clr-text-2);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.view-toggle__btn--active {
  background: var(--clr-surface);
  color: var(--clr-primary);
  box-shadow: var(--shadow-1);
}

/* ── Trips page top row ───────────────────────────────────── */

.trips-controls {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  margin-bottom: var(--sp-2);
}

.trips-controls .search-bar {
  flex: 1;
  margin-bottom: 0;
}

/* ── Calendar view ────────────────────────────────────────── */

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  margin-bottom: var(--sp-2);
}

.cal-header__title {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--clr-text);
}

.cal-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--clr-text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.cal-nav-btn:active {
  background: var(--clr-surface-mid);
}

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

.cal-grid__dow {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--clr-text-2);
  text-align: center;
  padding: var(--sp-1) 0;
}

.cal-grid__day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--clr-text);
  gap: 2px;
  position: relative;
}

.cal-grid__day:active {
  background: var(--clr-surface-mid);
}

.cal-grid__day--other-month {
  color: var(--clr-text-3);
}

.cal-grid__day--today {
  font-weight: var(--weight-bold);
  color: var(--clr-primary);
}

.cal-grid__day__dots {
  display: flex;
  gap: 2px;
  justify-content: center;
}

.cal-grid__day--today {
  /* The day number gets the highlight, not the whole cell */
}

.cal-grid__day__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-size: var(--text-xs);
}

.cal-grid__day__num--today {
  background: var(--clr-primary);
  color: #fff;
  font-weight: var(--weight-semibold);
}

.cal-grid__day__dot {
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--clr-primary);
}

/* ── User avatar ──────────────────────────────────────────── */

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--clr-primary-tint);
  color: var(--clr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Quick entry bar ──────────────────────────────────────── */
/* Fixed bar above bottom-nav. See QUICK BAR LAYOUT BLOCK above.
   TO REMOVE: delete this block + the layout block near #main. */

body[data-page="times"] #quick-bar,
body[data-page="expenses"]


/* ── Tab bar (inside modals) ──────────────────────────────── */

.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--clr-surface-high);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-bar__btn {
  flex: 1;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--clr-text-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  padding: 0 var(--sp-3);
  font-family: inherit;
}

.tab-bar__btn--active {
  color: var(--clr-primary);
  border-bottom-color: var(--clr-primary);
}

.tab-panel {
  display: none;
  padding: var(--sp-4);
}

.tab-panel--active {
  display: block;
}

/* ── Confirm dialog ───────────────────────────────────────── */

.confirm-dialog__msg {
  font-size: var(--text-md);
  color: var(--clr-text);
  padding: var(--sp-4);
}

/* ── Badge / chip ─────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 20px;
  padding: 0 var(--sp-1);
  border-radius: var(--radius-full);
  background: var(--clr-primary);
  color: var(--clr-on-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}

/* ── Section header ───────────────────────────────────────── */

.section-header {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-text-2);
  padding: var(--sp-4) 0 var(--sp-2);
}

/* ── Divider ──────────────────────────────────────────────── */

.divider {
  height: 1px;
  background: var(--clr-surface-high);
  margin: var(--sp-3) 0;
}

/* ── Map container (Leaflet) ──────────────────────────────── */

.map-container {
  height: 300px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.map-offline-notice {
  font-size: var(--text-xs);
  color: var(--clr-text-2);
  text-align: center;
  padding: var(--sp-2) 0;
}

/* ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── */
/* ── 5. Animations ───────────────────────────────────────── */

@keyframes slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes row-highlight {
  0%   { background: var(--clr-primary-tint); }
  100% { background: transparent; }
}

.data-table tbody tr.new-row {
  animation: row-highlight 1200ms ease-out forwards;
}

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

.spin {
  animation: spin 1000ms linear infinite;
  display: inline-block;
}


/* ── SVG icon system (replaces Material Symbols) ─────────── */

.biz-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  fill: currentColor;
}

/* Size variants */
.biz-icon-sm  { width: 16px; height: 16px; }
.biz-icon-md  { width: 20px; height: 20px; }
.biz-icon-lg  { width: 24px; height: 24px; }
.biz-icon-xl  { width: 32px; height: 32px; }

/* Bottom nav icons — size set in .bnav-btn .biz-icon above */
.bnav-btn--active .biz-icon {
  /* active state handled by inherited color */
}

/* ── 6. Utilities ─────────────────────────────────────────── */

.hidden {
  display: none !important;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-muted {
  color: var(--clr-text-2);
}

.text-primary {
  color: var(--clr-primary);
}

.text-error {
  color: var(--clr-error);
}

.text-success {
  color: var(--clr-success);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Disabled state utility */
.disabled,
[disabled] {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* Scrollbar styling (desktop) */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--clr-surface-high);
  border-radius: var(--radius-full);
}

@keyframes bt-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* Ensure GPS-locate button and clear (×) button are mutually exclusive,
   regardless of inline-style timing during async GPS resolution */
.field--has-value [data-action^="te-gps-"],
.field--has-value [data-action^="sf-gps-"] {
  display: none !important;
}
