:root {
  color-scheme: light;
  --canvas: #f6f0e7;
  --sidebar: #e7ddd1;
  --paper: #fbfaf7;
  --ink: #29231d;
  --muted: #746e66;
  --line: #d9d0c4;
  --line-strong: #c9bfb1;
  --accent: #b75a45;
  --accent-soft: #ead4cc;
  --focus: #2f6f72;
  --surface: #faf4eb;
  --surface-border: #e6dbcf;
  --surface-soft: #f1e5da;
  --shadow-soft: 0 5px 16px rgba(71, 52, 35, 0.025);
  --radius-sm: 8px;
  --radius-md: 16px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* V2.3.2.6 final Trip Detail typography and icon system */
.trip-detail .back-link::before {
  content: none;
}

.trip-detail .back-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
}

.back-link-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.back-link::before {
  content: none;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font: inherit;
  text-decoration: none;
}

/* V2.3.2.7 reference-matched frosted controls and icon weight */
.trip-detail .trip-summary {
  background: rgba(250, 244, 235, 0.72);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 5px 16px rgba(71, 52, 35, 0.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.trip-detail .trip-summary div {
  grid-template-columns: 40px minmax(0, 1fr);
}

.trip-detail .trip-summary-icon {
  width: 40px;
  height: 40px;
  background: rgba(247, 225, 211, 0.68);
}

.trip-detail .trip-summary-icon-svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
}

.trip-detail .trip-settings-action {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(250, 244, 235, 0.58);
  box-shadow: 0 4px 12px rgba(71, 52, 35, 0.025);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.trip-detail .trip-settings-action:hover,
.trip-detail .trip-settings-action:focus-visible {
  background: rgba(250, 244, 235, 0.7);
}

@media (min-width: 1100px) {
  .trip-detail h2 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
  }

  .trip-detail .trip-country {
    font-size: 17px;
    font-weight: 600;
  }

  .trip-detail .trip-dates {
    font-size: 14px;
    font-weight: 500;
  }

  .trip-detail .trip-currency-summary {
    font-size: 13px;
    font-weight: 500;
  }

  .trip-calendar-icon,
  .trip-settings-icon {
    width: 16px;
    height: 16px;
    stroke-width: 1.8;
  }

  .trip-summary-label {
    font-size: 12px;
    font-weight: 500;
  }

  .trip-summary-copy strong {
    font-size: 20px;
    font-weight: 650;
  }

  .trip-summary-icon {
    width: 33px;
    height: 33px;
    background: rgba(247, 225, 211, 0.72);
  }

  .trip-summary-icon-svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.8;
  }

  .trip-detail .expenses-section h3 {
    font-size: 23px;
    font-weight: 700;
  }

  .trip-detail .expense-section-meta {
    font-size: 13px;
  }

  .trip-detail .trip-table th {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
  }

  .trip-detail .trip-table td {
    font-size: 14px;
  }

  .trip-detail .trip-actions .text-button {
    font-size: 13px;
  }
}

/* V2.7.4 mobile Trip Detail composition */
@media (max-width: 767px) {
  .trip-detail {
    min-width: 0;
  }

  .trip-detail .back-link {
    margin-bottom: 16px;
  }

  .trip-detail .trip-hero {
    display: flex;
    min-height: 0;
    flex-direction: column;
    border-radius: 18px;
  }

  .trip-detail .trip-hero > .trip-detail-cover {
    width: 100%;
    height: 190px;
    min-height: 190px;
    flex: 0 0 190px;
    border-radius: 18px 18px 0 0;
  }

  .trip-detail .trip-detail-atmosphere {
    min-width: 0;
  }

  .trip-detail .trip-detail-hero-content {
    min-height: 0;
    gap: 18px;
    padding: 20px 16px 16px;
  }

  .trip-detail .trip-detail-title-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .trip-detail h2 {
    min-width: 0;
    font-size: clamp(34px, 11vw, 46px);
    line-height: 1;
    overflow-wrap: anywhere;
  }

  .trip-detail .trip-settings-action {
    margin-left: auto;
    padding: 8px 10px;
    font-size: 12px;
  }

  .trip-detail .trip-country {
    margin-top: 6px;
    font-size: 17px;
  }

  .trip-detail .trip-dates {
    gap: 7px;
    margin-top: 9px;
    font-size: 14px;
  }

  .trip-detail .trip-currency-summary {
    margin-top: 9px;
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .trip-detail .trip-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    border-radius: 14px;
  }

  .trip-detail .trip-summary div,
  .trip-detail .trip-summary div + div {
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 10px 7px;
    border-left: 0;
  }

  .trip-detail .trip-summary div + div::before {
    display: none;
  }

  .trip-detail .trip-summary-icon {
    width: 26px;
    height: 26px;
  }

  .trip-detail .trip-summary-icon-svg {
    width: 14px;
    height: 14px;
  }

  .trip-detail .trip-summary-copy {
    min-width: 0;
    gap: 2px;
  }

  .trip-detail .trip-summary-label {
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .trip-detail .trip-summary-copy strong {
    min-width: 0;
    font-size: 15px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .trip-detail .expenses-section {
    margin-top: 24px;
  }

  .trip-detail .expenses-section .section-heading {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
  }

  .trip-detail .expenses-section h3 {
    font-size: 23px;
    line-height: 1.05;
  }

  .trip-detail .expense-section-meta {
    font-size: 13px;
  }

  .trip-detail .expenses-section .section-heading > .button {
    flex: 0 0 auto;
    height: 42px;
    min-height: 42px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .trip-detail .trip-table-wrap {
    overflow: visible;
  }

  .trip-detail .expense-table {
    display: block;
    border-top: 0;
  }

  .trip-detail .expense-table thead {
    display: none;
  }

  .trip-detail .expense-table tbody {
    display: grid;
  }

  .trip-detail .expense-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "date amount"
      "category actions"
      "note note";
    gap: 7px 10px;
    min-width: 0;
    padding: 14px 0;
    border-bottom: 1px solid rgba(116, 110, 102, 0.1);
  }

  .trip-detail .expense-table tbody tr:first-child {
    border-top: 1px solid rgba(116, 110, 102, 0.1);
  }

  .trip-detail .expense-table td,
  .trip-detail .expense-table td:last-child {
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .trip-detail .expense-table td:nth-child(1) {
    grid-area: date;
    color: var(--muted);
  }

  .trip-detail .expense-table td:nth-child(2) {
    grid-area: category;
  }

  .trip-detail .expense-table td:nth-child(3) {
    grid-area: amount;
    text-align: right;
  }

  .trip-detail .expense-table td:nth-child(4) {
    grid-area: note;
    max-width: none;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }

  .trip-detail .expense-table td:nth-child(5) {
    grid-area: actions;
    position: relative;
    width: auto;
    text-align: right;
  }

  .trip-detail .expense-table .expense-amount,
  .trip-detail .expense-table .category-label {
    white-space: nowrap;
  }

  .trip-detail .expense-row-menu .trip-row-menu-items {
    max-width: calc(100vw - 24px);
  }

  .trip-detail .expense-form-backdrop,
  .trip-detail .trip-settings-backdrop {
    padding: 12px;
  }

  .trip-detail .expense-form-modal,
  .trip-detail .trip-settings-panel {
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }

  .trip-detail .expense-form-modal-heading {
    padding: 18px 18px 0;
  }

  .trip-detail .expense-form-modal .expense-form {
    padding: 16px 18px 20px;
  }

  .trip-detail .expense-form-modal .expense-form-fields {
    grid-template-columns: 1fr;
  }

  .trip-detail .expense-form-modal .expense-form-fields > .form-field:last-child {
    grid-column: auto;
  }

  .trip-detail .expense-form-modal .form-actions {
    margin-top: 18px;
  }

  .trip-detail .trip-settings-panel {
    width: min(100%, 420px);
    padding: 18px;
  }
}

/* V2.13 Obsidian Glass cascade layer */
html,
body {
  color-scheme: dark;
  background-color: #101310;
  color: var(--ink);
}

body {
  background-image: linear-gradient(180deg, rgba(10, 14, 13, 0.3), rgba(10, 14, 13, 0.7)), url("./assets/terra-wallpaper.webp");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

.app-shell,
.main-content,
.content-column,
.view-content {
  background: transparent;
}

.sidebar {
  border-right-color: var(--surface-border);
  background: rgba(16, 19, 16, 0.76);
  color: var(--ink);
  backdrop-filter: blur(24px) saturate(115%);
  -webkit-backdrop-filter: blur(24px) saturate(115%);
}

.brand,.sidebar-account {
  color: var(--ink);
}

.brand-image { height: 44px; filter: brightness(1.08) saturate(0.9); }

.nav-item {
  border-left-color: transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.nav-item.is-active { border-left-color: var(--accent); background: var(--accent-soft); color: var(--ink); }

.main-content { padding: 34px 36px 56px; }
.content-column { width: min(100%, 1240px); margin: 0 auto; }
.page-header h1 { color: var(--ink); font-family: Instrument Serif, Georgia, serif; font-weight: 400; }
.page-subtitle { color: var(--muted); }

.button {
  border-color: var(--line-strong);
  border-radius: 10px;
  background: rgba(32, 37, 35, 0.8);
  color: var(--ink);
}

.button:hover { border-color: rgb(var(--accent-rgb) / 0.46); background: rgba(40, 45, 42, 0.9); }
.button-primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { border-color: color-mix(in srgb, var(--accent) 78%, white); background: color-mix(in srgb, var(--accent) 78%, white); color: var(--accent-ink); }
.text-button, .section-link { color: var(--accent); }
.text-button-danger { color: #e77d82; }

.overview-surface,.settings-section,.global-expenses-table-wrap,.global-expenses-empty,.page-empty-illustration,.trip-hero,.trip-detail-header,.auth-card,.trip-form-modal,.expense-form-modal,.cover-crop-modal {
  border-color: var(--surface-border);
  background: rgba(22, 26, 25, 0.76);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(115%);
  -webkit-backdrop-filter: blur(20px) saturate(115%);
}

.overview-summary strong,.section-heading h2,.overview-empty-copy h3,.trip-row-identity strong,.trip-row-financials strong,.global-expense-date strong,.global-expense-trip .trip-link strong,.trip-detail h2,.trip-detail .trip-country,.trip-summary dd,.settings-action strong,.auth-heading h1,.trip-form-modal-heading h2,.expense-form-modal-heading h2 {
  color: var(--ink);
}

.trip-row-dates,.trip-row-financials small,.global-expense-date span,.global-expense-trip .trip-link span,.expense-note,.expense-eur-equivalent,.settings-section p,.expense-section-meta,.trip-detail .trip-dates,.trip-detail .trip-currency-summary,.auth-heading p,.auth-switch,.auth-options {
  color: var(--muted);
}

.trip-row { border-bottom-color: var(--line); background: transparent; box-shadow: none; }
.trip-year-heading { border-bottom-color: var(--line); }
.category-donut::after { background: #202522; }
.category-breakdown div { border-bottom-color: var(--line); }

.trip-search,
.trip-sort,
.trip-view-toggle,
.global-expense-search,
.global-expense-filter,
.date-picker-control,
input,
select,
textarea {
  border-color: var(--line-strong);
  background: rgba(32, 37, 35, 0.66);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder { color: #858c85; }
.trip-view-toggle button.is-active { background: var(--accent-soft); color: var(--accent); }
.trip-search-icon, .trip-sort-icon, .trip-toolbar-icon { color: var(--muted); }
.trip-row-menu-items { border-color: var(--surface-border); background: #202522; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28); }

.global-expenses-table-wrap { padding: 20px 22px 16px; }
.global-expenses-footer { color: var(--muted); }
.trip-detail-atmosphere { background-color: #202522; background-image: linear-gradient(180deg, rgba(16, 19, 16, 0.24), rgba(16, 19, 16, 0.62)), var(--theme-image, url("./assets/terra-wallpaper.webp")); }
.trip-detail-atmosphere::before { background: rgba(16, 19, 16, 0.44); }
.trip-detail .trip-settings-action,
.trip-detail .trip-summary,
.trip-detail .expense-form { border-color: var(--surface-border); background: rgba(32, 37, 35, 0.72); color: var(--ink); box-shadow: var(--shadow-soft); }
.trip-detail .trip-settings-action:hover, .trip-detail .trip-settings-action:focus-visible { border-color: rgb(var(--accent-rgb) / 0.5); background: rgba(40, 45, 42, 0.9); color: var(--accent); }
.trip-summary div + div { border-left-color: var(--line); }
.trip-summary-icon { background: rgb(var(--accent-rgb) / 0.14); color: var(--accent); }

.settings-page { gap: 16px; }
.settings-section { padding: 22px 24px; }
.settings-notice { border-color: rgb(var(--accent-rgb) / 0.3); background: var(--accent-soft); color: var(--ink) !important; }
.settings-action { border-top-color: var(--line); }

.auth-page { min-height: 62vh; background: transparent; }
.auth-card { max-width: 460px; border-radius: 18px; }
.auth-brand { color: var(--ink); }
.auth-heading h1 { font-family: Instrument Serif, Georgia, serif; font-weight: 400; }
.auth-switch a, .auth-options a { color: var(--accent); }

.trip-form-backdrop,
.expense-form-backdrop,
.cover-crop-backdrop { background: rgba(4, 7, 5, 0.68); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.trip-form-modal, .expense-form-modal, .cover-crop-modal { background: rgba(22, 26, 25, 0.94); color: var(--ink); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.trip-form-close, .expense-form-close { color: var(--muted); }
.trip-form-close:hover, .expense-form-close:hover { background: var(--accent-soft); color: var(--accent); }
.form-field label, .cover-field-label { color: var(--muted); }
.date-picker-popover { border-color: var(--surface-border); background: #202522; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34); }
.date-picker-day.is-selected { background: var(--accent); color: #17200f; }
.date-picker-day.is-today { border-color: var(--accent); }
.cover-crop-stage { background: #101310; }
.cover-crop-frame { border-color: rgba(255, 255, 255, 0.92); box-shadow: 0 0 0 999px rgba(4, 7, 5, 0.62); }
.cover-crop-zoom input[type="range"] { accent-color: var(--accent); }

.mobile-header { border-bottom-color: var(--surface-border); background: rgba(16, 19, 16, 0.82); color: var(--ink); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.mobile-menu-button, .mobile-nav-close { border-color: var(--surface-border); background: rgba(32, 37, 35, 0.78); color: var(--ink); }

@media (max-width: 767px) {
  .main-content { padding: 24px 16px 44px; }
  .page-header h1 { font-size: 40px; }
  .page-subtitle { font-size: 14px; }
  .view-content { padding-top: 18px; }
  .global-expenses-header, .trips-header-actions { margin-top: 0; }
  .overview-surface { padding: 18px 16px; }
  .mobile-header .brand-image { height: 36px; }
  .trip-form-modal, .expense-form-modal, .cover-crop-modal { background: rgba(22, 26, 25, 0.98); }
}

/* V2.13 Obsidian Glass design system */
:root {
  color-scheme: dark;
  --canvas: #101310;
  --sidebar: rgba(16, 19, 16, 0.78);
  --paper: #171b19;
  --ink: #f5f5f1;
  --muted: #b5bab4;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --accent: #b7e47b;
  --accent-rgb: 183 228 123;
  --accent-ink: #17200f;
  --accent-soft: rgb(var(--accent-rgb) / 0.14);
  --focus: var(--accent);
  --surface: rgba(22, 26, 25, 0.76);
  --surface-border: rgba(255, 255, 255, 0.12);
  --surface-soft: rgba(40, 45, 42, 0.84);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --radius-sm: 9px;
  --radius-md: 14px;
  font-family: Geist, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html,
body {
  background-color: #101310;
}

body {
  background-image: linear-gradient(180deg, rgba(10, 14, 13, 0.3), rgba(10, 14, 13, 0.7)), url("./assets/terra-wallpaper.webp");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
  opacity: 0.18;
  content: "";
}

.app-shell,
.main-content,
.content-column,
.view-content {
  background: transparent;
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  border-right-color: var(--surface-border);
  background: rgba(16, 19, 16, 0.76);
  backdrop-filter: blur(24px) saturate(115%);
  -webkit-backdrop-filter: blur(24px) saturate(115%);
}

.brand,.nav-item,.sidebar-account {
  color: var(--ink);
}

.brand-image {
  height: 44px;
  filter: brightness(1.08) saturate(0.9);
}

.nav-item {
  border-left-color: transparent;
  color: var(--muted);
  border-radius: 10px;
  transition: background 180ms ease, color 180ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.nav-item.is-active {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.nav-icon,
.mobile-menu-icon,
.mobile-nav-close-icon {
  stroke-width: 1.8;
}

.main-content {
  padding: 34px 36px 56px;
}

.content-column {
  width: min(100%, 1240px);
  margin: 0 auto;
}

.page-header h1 {
  color: var(--ink);
  font-family: Instrument Serif, Georgia, serif;
  font-size: clamp(3rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
}

.page-subtitle {
  color: var(--muted);
}

.view-content {
  padding-top: 22px;
}

.button {
  min-height: 42px;
  border-color: var(--line-strong);
  border-radius: 10px;
  background: rgba(32, 37, 35, 0.8);
  color: var(--ink);
  font-weight: 500;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.button:hover {
  border-color: rgb(var(--accent-rgb) / 0.46);
  background: rgba(40, 45, 42, 0.9);
}

.button:active { transform: translateY(1px); }

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #17200f;
}

.button-primary:hover {
  border-color: #c8ed98;
  background: #c8ed98;
  color: #17200f;
}

.text-button { color: var(--accent); }
.text-button-danger { color: #e77d82; }

.overview-surface,.trip-row,.settings-section,.global-expenses-table-wrap,.global-expenses-empty,.page-empty-illustration,.trip-hero,.trip-detail-header,.auth-card,.trip-form-modal,.expense-form-modal {
  border-color: var(--surface-border);
  background: rgba(22, 26, 25, 0.76);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(115%);
  -webkit-backdrop-filter: blur(20px) saturate(115%);
}

.overview-summary strong,.section-heading h2,.overview-empty-copy h3,.trip-row-identity strong,.trip-row-financials strong,.global-expense-date strong,.global-expense-trip .trip-link strong,.trip-detail h2,.trip-detail .trip-country,.trip-summary dd,.settings-action strong,.auth-heading h1,.trip-form-modal-heading h2,.expense-form-modal-heading h2 {
  color: var(--ink);
}

.section-link,
.section-link:hover,
.section-link:focus-visible,
.trip-link:hover,
.trip-link:focus-visible {
  color: var(--accent);
}

.trip-row-identity > span:not(.trip-row-dates),.trip-row-dates,.trip-row-financials small,.global-expense-date span,.global-expense-trip .trip-link span,.expense-note,.expense-eur-equivalent,.settings-section p,.expense-section-meta,.trip-detail .trip-dates,.trip-detail .trip-currency-summary {
  color: var(--muted);
}

.overview-section,
.trip-year-group + .trip-year-group { margin-top: 20px; }
.overview-lower-grid { gap: 16px; margin-top: 16px; }
.overview-surface { padding: 20px 22px; }

.trip-cover-placeholder { background: rgba(40, 45, 42, 0.9); color: var(--accent); }
.trip-progress { background: rgba(255, 255, 255, 0.12); }
.trip-progress span { background: var(--accent); }

.category-donut::after { background: #202522; }
.category-donut-total small { color: var(--muted); }
.category-breakdown div { border-bottom-color: var(--line); }
.global-expense-table th,.global-expense-table td,.trip-detail .trip-table th,.trip-detail .trip-table td {
  border-bottom-color: var(--line);
}

.trip-search,
.trip-sort,
.trip-view-toggle,
.global-expense-search,
.global-expense-filter,
.date-picker-control,
input,
select,
textarea {
  border-color: var(--line-strong);
  background: rgba(32, 37, 35, 0.66);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder { color: #858c85; }

.trip-search input,.trip-sort select,.global-expense-search input,.global-expense-filter select {
  color: var(--ink);
}

.trip-view-toggle button.is-active { background: var(--accent-soft); color: var(--accent); }
.trip-toolbar-icon,
.trip-search-icon,
.trip-sort-icon { color: var(--muted); }

.trip-year-heading {
  border-bottom-color: var(--line);
}

.trip-row {
  border-bottom-color: var(--line);
}

.trip-row-menu summary:hover,
.trip-row-menu[open] summary { background: var(--accent-soft); color: var(--accent); }
.trip-row-menu-items { border-color: var(--surface-border); background: #202522; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28); }

.global-expenses-header,
.trips-header-actions { margin-top: -58px; }
.global-expenses-table-wrap { padding: 20px 22px 16px; }
.global-expenses-footer { color: var(--muted); }

.trip-detail-atmosphere {
  background-color: #202522;
  background-image: linear-gradient(180deg, rgba(16, 19, 16, 0.24), rgba(16, 19, 16, 0.62)), var(--theme-image, url("./assets/terra-wallpaper.webp"));
}

.trip-detail-atmosphere::before { background: rgba(16, 19, 16, 0.44); }
.trip-detail .trip-settings-action,
.trip-detail .trip-summary,
.trip-detail .expense-form {
  border-color: var(--surface-border);
  background: rgba(32, 37, 35, 0.72);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.trip-detail .trip-settings-action:hover,
.trip-detail .trip-settings-action:focus-visible { border-color: rgb(var(--accent-rgb) / 0.5); background: rgba(40, 45, 42, 0.9); color: var(--accent); }
.trip-summary div + div { border-left-color: var(--line); }
.trip-summary-icon { background: rgb(var(--accent-rgb) / 0.14); color: var(--accent); }
.trip-detail .trip-table { border-top-color: var(--line); }

.settings-page { gap: 16px; }
.settings-section { padding: 22px 24px; }
.settings-notice { border-color: rgb(var(--accent-rgb) / 0.3); background: var(--accent-soft); color: var(--ink) !important; }
.settings-action { border-top-color: var(--line); }

.auth-page { min-height: 62vh; background: transparent; }
.auth-card { max-width: 460px; border-radius: 18px; }
.auth-brand { color: var(--ink); }
.auth-heading h1 { font-family: Instrument Serif, Georgia, serif; font-size: 42px; font-weight: 400; }
.auth-heading p,
.auth-switch,
.auth-options { color: var(--muted); }
.auth-switch a,
.auth-options a { color: var(--accent); }

.trip-form-backdrop,
.expense-form-backdrop,
.cover-crop-backdrop {
  background: rgba(4, 7, 5, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.trip-form-modal,
.expense-form-modal,
.cover-crop-modal {
  border-color: var(--surface-border);
  background: rgba(22, 26, 25, 0.94);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.trip-form-close,
.expense-form-close { color: var(--muted); }
.trip-form-close:hover,
.expense-form-close:hover { background: var(--accent-soft); color: var(--accent); }
.form-field label,
.cover-field-label { color: var(--muted); }
.date-picker-popover { border-color: var(--surface-border); background: #202522; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34); }
.date-picker-day.is-selected { background: var(--accent); color: #17200f; }
.date-picker-day.is-today { border-color: var(--accent); }

.cover-crop-stage { background: #101310; }
.cover-crop-frame { border-color: rgba(255, 255, 255, 0.92); box-shadow: 0 0 0 999px rgba(4, 7, 5, 0.62); }
.cover-crop-zoom input[type="range"] { accent-color: var(--accent); }

.mobile-header {
  border-bottom-color: var(--surface-border);
  background: rgba(16, 19, 16, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.mobile-menu-button,
.mobile-nav-close { border-color: var(--surface-border); background: rgba(32, 37, 35, 0.78); color: var(--ink); }

@media (max-width: 767px) {
  .main-content { padding: 24px 16px 44px; }
  .page-header h1 { font-size: 40px; }
  .page-subtitle { font-size: 14px; }
  .view-content { padding-top: 18px; }
  .global-expenses-header,
  .trips-header-actions { margin-top: 0; }
  .overview-surface { padding: 18px 16px; }
  .trip-form-modal,
  .expense-form-modal,
  .cover-crop-modal { background: rgba(22, 26, 25, 0.98); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

/* V2.12.1 responsive Sign In view */
.app-shell.is-auth-view {
  display: block;
  min-height: 100vh;
}

.app-shell.is-auth-view .sidebar,
.app-shell.is-auth-view .mobile-header,
.app-shell.is-auth-view .mobile-nav-backdrop {
  display: none;
}

.app-shell.is-auth-view .main-content {
  min-height: 100vh;
  padding: 0;
}

.app-shell.is-auth-view .content-column {
  width: 100%;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 40px 24px;
}

.auth-card {
  width: min(100%, 430px);
  padding: 36px;
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 34px;
}

.auth-brand img {
  display: block;
  width: auto;
  height: 48px;
  max-width: 100%;
}

.auth-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.auth-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.auth-password-control {
  position: relative;
}

.auth-password-control input {
  padding-right: 78px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  color: var(--ink);
}

.auth-password-toggle svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.75;
}

.auth-options {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.auth-options a {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.auth-options a:hover,
.auth-options a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  border-radius: var(--radius-sm);
}

.auth-notice {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--surface));
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.auth-switch {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover,
.auth-switch a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 520px) {
  .auth-page {
    align-items: start;
    padding: 24px 16px;
  }

  .auth-card {
    padding: 28px 22px;
    border-radius: 16px;
  }

  .auth-brand {
    margin-bottom: 28px;
  }
}

/* V2.8 Settings page */
.settings-page {
  display: grid;
  width: min(100%, 760px);
  gap: 16px;
}

.settings-section {
  padding: 22px 24px;
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.annual-budget-form {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin-top: 18px;
}

.annual-budget-form .form-field { margin: 0; }
.annual-budget-form .button { min-height: 40px; }

.settings-section h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.settings-section p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.settings-actions {
  display: grid;
  gap: 0;
  margin-top: 18px;
}

.settings-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 55%, var(--surface));
}

.settings-action strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.settings-action .button,
.settings-action label.button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  gap: 10px;
}

.settings-action .button svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
  position: static;
  stroke-width: 1.8;
}

.settings-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.settings-file-input:focus-visible + .button {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.settings-notice {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--surface));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 65%, var(--surface));
  color: var(--ink) !important;
}

.settings-notice.is-error {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--surface));
}

@media (max-width: 767px) {
  .settings-page {
    width: 100%;
    gap: 12px;
  }

  .settings-section {
    width: 100%;
    min-width: 0;
    padding: 18px 16px;
    border-radius: 14px;
  }

  .settings-action > div {
    min-width: 0;
  }

  .settings-section h2,
  .settings-section p,
  .settings-action strong {
    overflow-wrap: anywhere;
  }

  .settings-actions {
    margin-top: 14px;
  }

  .settings-action {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0;
  }

  .annual-budget-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .annual-budget-form .button { grid-column: 1 / -1; width: 100%; }

  .settings-action p {
    margin-top: 5px;
  }

  .settings-action .button,
  .settings-action label.button {
    width: 100%;
    justify-content: center;
  }

  

  

  

  
}

/* V2.6 final Global Expenses table cascade */
.global-expenses-page .global-expense-table {
  table-layout: fixed;
}

.global-expenses-page .global-expense-table th {
  padding-bottom: 12px;
  border-bottom-color: color-mix(in srgb, var(--line-strong) 52%, var(--surface));
  font-size: 12px;
}

.global-expenses-page .global-expense-table td {
  padding-top: 15px;
  padding-bottom: 15px;
  border-bottom-color: color-mix(in srgb, var(--line) 46%, var(--surface));
  white-space: normal;
  vertical-align: middle;
}

.global-expenses-page .global-expense-table tbody tr:last-child td {
  border-bottom: 0;
}

.global-expenses-page .global-expense-trip .trip-link,
.global-expenses-page .global-expense-trip .trip-link:hover,
.global-expenses-page .global-expense-trip .trip-link:focus-visible {
  color: var(--ink);
  text-decoration: none;
}

.global-expenses-page .global-expense-trip .trip-link:hover,
.global-expenses-page .global-expense-trip .trip-link:focus-visible {
  color: var(--accent);
}

/* V2.6 Global Expenses page */
.global-expenses-page {
  position: relative;
}

.global-expenses-header {
  display: flex;
  justify-content: flex-end;
  margin: -70px 0 30px;
}

.global-expenses-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(150px, 0.32fr));
  gap: 16px;
  margin-bottom: 24px;
}

.global-expense-search,
.global-expense-filter {
  display: flex;
  min-width: 0;
  align-items: center;
  border: 1px solid var(--surface-border);
  border-radius: 9px;
  background: rgba(250, 244, 235, 0.46);
  color: var(--muted);
}

.global-expense-search {
  gap: 12px;
  padding: 0 15px;
}

.global-expense-search-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.global-expense-search input,
.global-expense-filter select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.global-expense-search input {
  padding: 12px 0;
}

.global-expense-search input:focus,
.global-expense-search input:focus-visible,
.global-expense-filter select:focus,
.global-expense-filter select:focus-visible {
  border: 0;
  outline: none;
  box-shadow: none;
  caret-color: var(--accent);
}

.global-expense-filter {
  padding: 0 14px;
}

.global-expense-filter select {
  appearance: none;
  cursor: pointer;
  padding: 13px 20px 13px 0;
}

.global-expenses-table-wrap {
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 24px 26px 18px;
}

.global-expense-table {
  table-layout: fixed;
}

.global-expense-table .global-expense-col-date { width: 14%; }
.global-expense-table .global-expense-col-trip { width: 20%; }
.global-expense-table .global-expense-col-category { width: 28%; }
.global-expense-table .global-expense-col-amount { width: 17%; }
.global-expense-table .global-expense-col-note { width: 21%; }

.global-expense-table th {
  padding-bottom: 12px;
  border-bottom-color: color-mix(in srgb, var(--line-strong) 52%, var(--surface));
  font-size: 12px;
}

.global-expense-table td {
  padding-top: 15px;
  padding-bottom: 15px;
  border-bottom-color: color-mix(in srgb, var(--line) 46%, var(--surface));
  white-space: normal;
  vertical-align: middle;
}

.global-expense-table tbody tr:last-child td {
  border-bottom: 0;
}

.global-expense-trip .trip-link {
  display: grid;
  gap: 2px;
}

.global-expense-date strong,
.global-expense-date span {
  display: block;
}

.global-expense-date strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.05;
}

.global-expense-date span,
.global-expense-trip .trip-link span {
  color: var(--muted);
  font-size: 14px;
}

.global-expense-trip .trip-link {
  color: var(--ink);
  text-decoration: none;
}

.global-expense-trip .trip-link:hover,
.global-expense-trip .trip-link:focus-visible {
  color: var(--accent);
  text-decoration: none;
}

.global-expense-trip .trip-link strong {
  font-size: 16px;
  font-weight: 650;
}

.global-expense-table .category-label {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.global-expense-table .expense-amount {
  white-space: nowrap;
}

.global-expense-table .expense-original-amount {
  display: block;
  font-weight: 650;
}

.global-expense-table .expense-eur-equivalent {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.global-expense-table .expense-note {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.global-expenses-footer {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.global-expenses-empty {
  display: grid;
  min-height: 180px;
  place-content: center;
  justify-items: center;
  gap: 12px;
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.global-expenses-empty p {
  margin: 0;
}

@media (max-width: 900px) {
  .global-expenses-filters {
    grid-template-columns: 1fr 1fr;
  }

  .global-expense-search {
    grid-column: 1 / -1;
  }

  .global-expenses-table-wrap {
    overflow-x: auto;
  }

  .global-expense-table {
    min-width: 760px;
  }
}

@media (max-width: 520px) {
  .global-expenses-header {
    margin: -48px 0 22px;
  }

  .global-expenses-filters {
    grid-template-columns: 1fr;
  }

  .global-expense-search {
    grid-column: auto;
  }

  .global-expenses-table-wrap {
    padding: 18px;
  }
}

/* Keep the Trip Detail settings control compact and visually aligned. */
.trip-detail .trip-settings-icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

/* V2.3.2.7 reference-matched frosted controls and icon weight */
.trip-detail .trip-summary {
  background: rgba(250, 244, 235, 0.72);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 5px 16px rgba(71, 52, 35, 0.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.trip-detail .trip-summary div {
  grid-template-columns: 40px minmax(0, 1fr);
}

.trip-detail .trip-summary-icon {
  width: 40px;
  height: 40px;
  background: rgba(247, 225, 211, 0.68);
}

.trip-detail .trip-summary-icon-svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
}

.trip-detail .trip-settings-action {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(250, 244, 235, 0.58);
  box-shadow: 0 4px 12px rgba(71, 52, 35, 0.025);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.trip-detail .trip-settings-action:hover,
.trip-detail .trip-settings-action:focus-visible {
  background: rgba(250, 244, 235, 0.7);
}

.back-link::before {
  content: none;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font: inherit;
  text-decoration: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid rgb(var(--accent-rgb) / 0.65);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgb(var(--accent-rgb) / 0.14);
}

.app-shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.is-app-loading {
  visibility: hidden;
}

.app-loading-state {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}

.app-loading-state[hidden] {
  display: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  padding: 30px 20px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: 48px;
}

.primary-nav {
  display: grid;
  gap: 5px;
  margin-top: 64px;
}

.nav-item {
  display: block;
  border-left: 2px solid transparent;
  color: var(--muted);
  padding: 9px 12px 9px 14px;
  font-size: 15px;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--ink);
}

.nav-item.is-active {
  border-left-color: var(--accent);
  background: rgba(255, 255, 255, 0.38);
  color: var(--ink);
  font-weight: 650;
}

.main-content {
  min-width: 0;
  padding: 48px 56px 72px;
}

.content-column {
  width: min(100%, 920px);
}

.page-header {
  padding-bottom: 4px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.page-subtitle {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.view-content {
  padding-top: 24px;
}

.empty-state {
  display: grid;
  min-height: 128px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  align-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin: 0;
}

.button,
.text-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 650;
}

.button-icon {
  width: 16px;
  height: 16px;
  margin-inline-end: 6px;
  vertical-align: -3px;
}

.trips-header-actions .button,
.trip-detail .expenses-section .section-heading > .button {
  height: 44px;
  min-height: 44px;
  border-radius: 8px;
}

.trips-header-actions .button-icon,
.trip-detail .expenses-section .button-icon {
  width: 18px;
  height: 18px;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf5;
}

.button-secondary {
  color: var(--ink);
}

.text-button {
  padding: 3px 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
}

.text-button-danger {
  color: var(--muted);
}

.trips-empty-state {
  gap: 10px;
}

/* Empty states for the Trips and Expenses pages */
.page-empty-illustration {
  display: grid;
  min-height: 390px;
  margin-top: 28px;
  padding: 38px 24px 34px;
  align-content: center;
  justify-items: center;
  gap: 12px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  text-align: center;
}

.page-empty-illustration img {
  display: block;
  width: min(100%, 330px);
  height: 170px;
  object-fit: contain;
}

.page-empty-illustration h2 {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.page-empty-illustration p {
  max-width: 470px;
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.45;
}

.page-empty-illustration .button {
  min-height: 44px;
}

.global-expenses-empty.page-empty-illustration {
  min-height: 390px;
}

@media (max-width: 767px) {
  .page-empty-illustration,
  .global-expenses-empty.page-empty-illustration {
    min-height: 340px;
    margin-top: 20px;
    padding: 30px 18px 28px;
  }

  .page-empty-illustration img {
    width: min(100%, 270px);
    height: 140px;
  }

  .page-empty-illustration h2 {
    font-size: 20px;
  }

  .page-empty-illustration p {
    max-width: 340px;
    font-size: 15px;
  }
}

.trip-form {
  margin: 0 0 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.trip-form-heading h2 {
  margin: 0 0 18px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.trip-form-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(67, 51, 39, 0.16);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.trip-form-modal {
  width: min(100%, 680px);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: rgba(250, 244, 235, 0.97);
  box-shadow: 0 14px 34px rgba(71, 52, 35, 0.12);
}

.trip-form-modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 0;
}

.trip-form-modal-heading h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.trip-form-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.trip-form-close:hover { background: var(--surface-soft); color: var(--ink); }
.trip-form-close-icon { width: 19px; height: 19px; }
.trip-form-modal .trip-form { margin: 0; border: 0; padding: 20px 26px 26px; }
.trip-form-modal .trip-form-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.trip-form-modal .trip-currency-fields { margin-top: 16px; }
.trip-form-modal .form-actions { margin-top: 22px; }

.expense-form-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(67, 51, 39, 0.16);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.expense-form-modal {
  width: min(100%, 640px);
  max-height: min(680px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: rgba(250, 244, 235, 0.97);
  box-shadow: 0 14px 34px rgba(71, 52, 35, 0.12);
}

.expense-form-modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 0;
}

.expense-form-modal-heading h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.expense-form-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.expense-form-close:hover { background: var(--surface-soft); color: var(--ink); }
.expense-form-close-icon { width: 19px; height: 19px; }
.expense-form-modal .expense-form { margin: 0; border: 0; padding: 20px 26px 26px; }
.expense-form-modal .expense-form-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.expense-form-modal .expense-form-fields > .form-field:last-child { grid-column: 1 / -1; }
.expense-form-modal .expense-amount-group { align-self: start; }
.expense-form-modal .form-actions { margin-top: 22px; }

.trip-detail .expense-form-modal .expense-form {
  margin: 0;
  border: 0;
  background: transparent;
  padding: 20px 26px 26px;
}

.trip-detail .expense-form-modal .expense-form-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.trip-detail .expense-form-modal .form-actions { margin-top: 22px; }

@media (max-width: 700px) {
  .expense-form-backdrop { padding: 12px; }
  .expense-form-modal { max-height: calc(100vh - 24px); }
  .expense-form-modal-heading { padding: 18px 18px 0; }
  .expense-form-modal .expense-form { padding: 16px 18px 20px; }
  .expense-form-modal .expense-form-fields { grid-template-columns: 1fr; }
  .expense-form-modal .expense-form-fields > .form-field:last-child { grid-column: auto; }
}

@media (max-width: 700px) {
  .trip-detail .expense-form-modal .expense-form { padding: 16px 18px 20px; }
  .trip-detail .expense-form-modal .expense-form-fields { grid-template-columns: 1fr; }
  .trip-detail .expense-form-modal .expense-form-fields > .form-field:last-child { grid-column: auto; }
}

@media (max-width: 767px) {
  .trip-form-backdrop { padding: 12px; }
  .trip-form-modal { max-height: calc(100vh - 24px); }
  .trip-form-modal { max-height: calc(100dvh - 24px); }
  .trip-form-modal-heading { padding: 18px 18px 0; }
  .trip-form-modal .trip-form { padding: 16px 18px 20px; }
  .trip-form-modal .trip-form-fields { grid-template-columns: 1fr; }
}

.trip-form-fields {
  display: grid;
  grid-template-columns: 1.25fr 1.1fr 0.9fr 0.9fr 0.8fr;
  gap: 14px;
}

.form-field {
  min-width: 0;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.form-field input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 7px 9px;
}

.form-field select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%23746e66' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 5 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 14px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 7px 32px 7px 9px;
}

.date-picker-control {
  position: relative;
}

.date-picker-input {
  padding-right: 42px !important;
  cursor: pointer;
}

.date-picker-trigger {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.date-picker-trigger:hover,
.date-picker-trigger:focus-visible {
  background: var(--surface-soft);
  color: var(--accent);
}

.date-picker-icon { width: 18px; height: 18px; }

.date-picker-popover {
  position: fixed;
  z-index: 60;
  width: 286px;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(71, 52, 35, 0.14);
  padding: 12px;
}

.date-picker-popover[hidden] { display: none; }

.date-picker-header,
.date-picker-selects,
.date-picker-weekdays,
.date-picker-grid {
  display: grid;
}

.date-picker-header {
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.date-picker-selects {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.date-picker-selects select {
  min-width: 0;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 5px 6px;
}

.date-picker-nav {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.date-picker-nav:hover,
.date-picker-nav:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
}

.date-picker-nav-icon { width: 17px; height: 17px; }

.date-picker-weekdays,
.date-picker-grid {
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.date-picker-weekdays {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.date-picker-day {
  display: grid;
  min-height: 32px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.date-picker-day:hover,
.date-picker-day:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.date-picker-day.is-today { border-color: var(--accent-soft); font-weight: 700; }
.date-picker-day.is-selected { background: var(--accent); color: #fffaf5; font-weight: 700; }
.date-picker-day.is-selected:hover,
.date-picker-day.is-selected:focus-visible { background: var(--accent); color: #fffaf5; }
.date-picker-day:disabled { cursor: not-allowed; opacity: 0.3; }
.date-picker-day.is-empty { pointer-events: none; }

.form-field input::placeholder {
  color: #9a9389;
}

.form-field input[aria-invalid="true"],
.form-field select[aria-invalid="true"] {
  border-color: var(--accent);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.trip-settings-action:focus,
.trip-settings-close:focus,
.button:focus {
  border-color: rgb(var(--accent-rgb) / 0.65);
  box-shadow: 0 0 0 2px rgb(var(--accent-rgb) / 0.14);
  outline: none;
}

.form-field input[type="number"]::-webkit-inner-spin-button,
.form-field input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.form-field input[type="number"] {
  -moz-appearance: textfield;
}

.field-error {
  margin: 5px 0 0;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.35;
}

.form-error {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.4;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

.trip-table-wrap {
  overflow-x: auto;
}

.trip-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.trip-table th {
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0 12px 10px 0;
  text-transform: uppercase;
}

.trip-table th:last-child,
.trip-table td:last-child {
  padding-right: 0;
}

.trip-table td {
  border-bottom: 1px solid var(--line);
  padding: 15px 12px 15px 0;
  font-size: 15px;
  white-space: nowrap;
}

.trip-row {
  cursor: pointer;
}

.trip-row:hover td:not(.trip-actions) {
  color: var(--accent);
}

.trip-row td:first-child {
  font-weight: 650;
}

.trip-row-link {
  color: inherit;
  text-decoration: none;
}

.trip-actions {
  cursor: default;
  text-align: right;
}

.trip-actions .text-button + .text-button {
  margin-left: 14px;
}

.back-link {
  display: inline-block;
  margin-bottom: 32px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.trip-detail {
  max-width: 620px;
}

.trip-country {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 16px;
}

.trip-detail h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.page-header.is-hidden {
  display: none;
}

.expenses-section {
  margin-top: 44px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.expense-form {
  margin: 0 0 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.expense-form-fields {
  display: grid;
  grid-template-columns: 0.9fr 1.15fr 0.8fr 1.4fr;
  gap: 14px;
}

.expense-amount-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.expense-amount-group .expense-conversion {
  grid-column: 1 / -1;
  margin: -2px 0 0;
}

.compact-empty {
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  padding: 20px 0;
}

.expense-note {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.category-marker {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.category-petal { background: #9BBE70; }
.category-morning { background: #F1BE62; }
.category-fern { background: #6097DF; }
.category-early { background: #AE7ADE; }

.trip-link {
  color: var(--ink);
  font-weight: 650;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.overview-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.overview-summary div {
  padding: 18px 22px 18px 0;
}

.overview-summary div + div {
  border-left: 1px solid var(--line);
  padding-left: 22px;
}

.overview-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.overview-section {
  margin-top: 46px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.section-link {
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.overview-trips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.trip-progress {
  grid-column: 1 / -1;
  height: 3px;
  margin-top: 3px;
  background: var(--line);
}

.trip-progress span {
  display: block;
  width: var(--progress);
  height: 100%;
  background: var(--accent);
}

.category-content {
  display: grid;
  grid-template-columns: 146px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}

.category-donut {
  position: relative;
  width: 122px;
  height: 122px;
  border-radius: 50%;
  background: var(--donut);
}

.category-donut::after {
  position: absolute;
  inset: 27px;
  border-radius: 50%;
  background: var(--canvas);
  content: "";
}

.category-breakdown {
  display: grid;
}

.category-breakdown div {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto 44px;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  font-size: 14px;
}

.category-breakdown div:last-child {
  border-bottom: 0;
}

.category-breakdown div span:last-child {
  color: var(--muted);
  text-align: right;
}

.category-breakdown div span:nth-child(2) {
  min-width: 64px;
  text-align: right;
  white-space: nowrap;
}

.category-breakdown div span:first-child {
  min-width: 0;
}

.trip-dates {
  margin: 8px 0 36px;
  color: var(--muted);
}

.trip-summary {
  margin: 0;
  border-top: 1px solid var(--line);
}

.trip-summary div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}

.trip-summary dt {
  color: var(--muted);
}

.trip-summary dd {
  margin: 0;
  font-weight: 650;
}

.missing-trip-state {
  margin-top: 0;
}

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

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 20px;
  }

  .primary-nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 24px;
  }

  .nav-item {
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 9px 8px;
    text-align: center;
  }

  .nav-item.is-active {
    border-bottom-color: var(--accent);
    border-left-color: transparent;
  }

  .main-content {
    padding: 38px 20px 56px;
  }
}

/* V2.1 Overview and navigation refinements */
.sidebar { padding: 28px 18px 24px; }
.primary-nav { gap: 7px; margin-top: 58px; }
.nav-item { display: flex; align-items: center; gap: 13px; border-left: 3px solid transparent; border-radius: var(--radius-sm); padding: 12px 13px; }
.nav-icon { width: 22px; height: 22px; flex: 0 0 auto; }
.nav-item.is-active { border-left-color: var(--accent); background: var(--accent-soft); }
.view-content { padding-top: 30px; }

.sidebar-account {
  display: grid;
  gap: 7px;
  margin-top: auto;
  padding: 16px 13px 0;
  border-top: 1px solid var(--line);
}

.sidebar-account .text-button {
  justify-self: start;
  padding: 0;
}

.mobile-header,
.mobile-nav-close,
.mobile-nav-backdrop {
  display: none;
}

@media (max-width: 767px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    border-bottom: 1px solid var(--line);
    background: var(--canvas);
    padding: 16px 20px;
  }

  .mobile-header .brand {
    font-size: 15px;
  }

  .mobile-header .brand-image {
    height: 36px;
  }

  .mobile-menu-button,
  .mobile-nav-close {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
  }

  .mobile-menu-icon,
  .mobile-nav-close-icon {
    width: 20px;
    height: 20px;
  }

  .sidebar {
    display: none;
  }

  .app-shell.is-mobile-nav-open .sidebar {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    display: flex;
    width: min(82vw, 300px);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    background: var(--sidebar);
    box-shadow: 10px 0 28px rgba(71, 52, 35, 0.08);
    overflow-y: auto;
    padding: 28px 18px 24px;
  }

  .mobile-nav-close {
    position: absolute;
    top: 22px;
    right: 18px;
  }

  .app-shell.is-mobile-nav-open .primary-nav {
    grid-template-columns: 1fr;
    gap: 7px;
    width: 100%;
    margin-top: 58px;
  }

  .app-shell.is-mobile-nav-open .nav-item {
    border-left: 3px solid transparent;
    border-bottom: 0;
    padding: 12px 13px;
    text-align: left;
  }

  .app-shell.is-mobile-nav-open .nav-item.is-active {
    border-left-color: var(--accent);
    background: var(--accent-soft);
  }

  .mobile-nav-backdrop {
    position: fixed;
    z-index: 40;
    inset: 0;
    background: rgba(41, 35, 29, 0.24);
  }

  .app-shell.is-mobile-nav-open .mobile-nav-backdrop {
    display: block;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .main-content {
    min-width: 0;
    padding: 30px 20px 56px;
  }
}

.overview-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); border: 0; }

.overview-summary strong { margin-top: 3px; font-size: 28px; }

.overview-section { margin-top: 30px; }
.section-heading { margin-bottom: 12px; }
.section-heading h2 { font-size: 22px; }
.section-link { display: inline-flex; align-items: center; gap: 6px; }
.section-link-arrow { width: 17px; height: 17px; }

.overview-trips { gap: 14px 24px; border: 0; }

.trip-cover-placeholder { display: grid; align-self: stretch; place-items: center; border-radius: 15px 0 0 15px; background: var(--surface-soft); color: var(--accent); }
.trip-cover-placeholder svg { width: 31px; height: 31px; }

.trip-progress { display: block; width: 100%; height: 4px; margin-top: 10px; border-radius: 99px; }
.trip-progress span { border-radius: inherit; }
.trip-arrow { position: absolute; top: 16px; right: 12px; width: 16px; height: 16px; color: var(--muted); }

.overview-lower-grid { display: grid; gap: 20px; margin-top: 30px; }
.overview-lower-grid .overview-section { margin-top: 0; }
.overview-surface { min-width: 0; border: 1px solid var(--surface-border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); padding: 20px 22px 16px; }

.category-content { grid-template-columns: clamp(122px, 12vw, 136px) minmax(0, 1fr); gap: 20px; align-items: center; border: 0; padding: 10px 0 0; }
.category-donut { display: grid; position: relative; width: clamp(108px, 10vw, 122px); height: clamp(108px, 10vw, 122px); place-items: center; }
.category-donut::after { inset: clamp(23px, 2.2vw, 26px); background: var(--surface); }
.category-donut-total { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 2px; font-size: clamp(20px, 2vw, 23px); font-weight: 650; letter-spacing: -0.03em; line-height: 1.05; text-align: center; }
.category-donut-total small { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.category-breakdown div { grid-template-columns: minmax(124px, 1fr) auto 36px; gap: 12px; padding: 7px 0; }

@media (min-width: 1100px) {
  .content-column { width: min(100%, 1240px); }
  .main-content { padding-top: 34px; padding-bottom: 48px; }
  .page-subtitle { margin-top: 6px; }
  .view-content { padding-top: 20px; }
  .overview-section { margin-top: 18px; }
  
  
  
  
  .trip-progress { grid-column: 1 / -1; }
  .trip-arrow { position: static; width: 20px; height: 20px; }
  .overview-lower-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* V2.7.2.1 mobile Overview composition */
@media (max-width: 767px) {
  .overview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 18px;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  

  

  

  

  

  

  

  

  

  .overview-summary span {
    font-size: 10px;
    letter-spacing: 0.045em;
    white-space: nowrap;
  }

  .overview-summary strong {
    margin-top: 3px;
    font-size: 20px;
    white-space: nowrap;
  }

  

  .overview-section {
    margin-top: 26px;
  }

  .overview-trips {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    border-top: 0;
  }

  

  

  

  

  

  

  

  

  

  .trip-progress {
    margin-top: 8px;
  }

  .overview-lower-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 26px;
  }

  .overview-surface {
    padding: 16px 14px 14px;
  }

  .category-content {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 0 8px;
  }

  .category-donut {
    width: 96px;
    height: 96px;
  }

  .category-donut::after {
    inset: 21px;
  }

  .category-overview .category-donut-total {
    align-content: center;
    justify-items: center;
    gap: 2px;
    max-width: 100%;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
  }

  .category-overview .category-donut-total small {
    max-width: 100%;
    font-size: 9px;
    font-weight: 400;
    line-height: 1.1;
    white-space: nowrap;
  }

  .category-breakdown div {
    grid-template-columns: minmax(0, 1fr) auto 32px;
    gap: 6px;
    padding: 6px 0;
    font-size: 13px;
  }

  .category-breakdown .category-label {
    min-width: 0;
    gap: 6px;
    white-space: nowrap;
  }

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  
}

/* V2.3.1 local currency context */
.trip-currency-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.rate-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.rate-input span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.expense-conversion {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.expense-conversion strong { color: var(--ink); font-weight: 600; }
.expense-conversion span { color: var(--muted); }
.expense-conversion.is-muted { display: block; }

.expense-amount { white-space: nowrap; }
.expense-original-amount { display: inline-block; }
.expense-eur-equivalent { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }

.trip-currency-context { margin: 7px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 767px) {
  .trip-currency-fields { grid-template-columns: 1fr; }
}

/* V2.3.2 Trip Detail visual redesign */
.trip-detail {
  width: 100%;
  max-width: none;
}

.trip-detail .back-link {
  margin-bottom: 24px;
}

.trip-hero {
  display: grid;
  grid-template-columns: minmax(35%, 40%) minmax(0, 1fr);
  min-height: 368px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.trip-hero > .trip-detail-cover {
  min-width: 0;
  min-height: 368px;
  overflow: hidden;
}

.trip-detail-cover-image {
  width: 100%;
  height: 100%;
}

.trip-detail-cover-image .trip-cover-placeholder,
.trip-detail-cover-image .trip-cover-image {
  border-radius: 0;
}

.trip-detail-atmosphere {
  position: relative;
  min-width: 0;
  background-color: #eadfce;
  background-image: url("./assets/terra-wallpaper.webp");
  background-position: center;
  background-size: cover;
}

.trip-detail-atmosphere::before {
  position: absolute;
  inset: 0;
  background: rgba(250, 244, 235, 0.62);
  content: "";
}

.trip-detail-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 368px;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 34px 34px 24px;
}

.trip-detail-identity {
  padding: 0;
}

.trip-detail-title-row {
  align-items: center;
}

.trip-detail h2 {
  font-size: clamp(40px, 4.2vw, 58px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.trip-detail .trip-country {
  margin-top: 10px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
}

.trip-detail .trip-dates {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  color: var(--ink);
  font-size: 16px;
}

.trip-meta-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--accent);
}

.trip-calendar-icon {
  width: 18px;
  height: 18px;
}

.trip-detail .trip-currency-summary {
  margin-top: 16px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.trip-detail .trip-settings-action {
  border-color: rgba(116, 110, 102, 0.32);
  background: rgba(250, 244, 235, 0.58);
  color: var(--ink);
  font-size: 14px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(71, 52, 35, 0.025);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.trip-detail .trip-settings-action:hover,
.trip-detail .trip-settings-action:focus-visible {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--accent);
}

.trip-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  margin: 0;
  border: 1px solid rgba(116, 110, 102, 0.2);
  border-radius: 18px;
  background: rgba(250, 244, 235, 0.72);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 5px 16px rgba(71, 52, 35, 0.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.trip-summary div {
  gap: 5px;
  min-width: 0;
  padding: 16px 18px;
}

.trip-summary div + div {
  border-left: 1px solid rgba(116, 110, 102, 0.22);
}

.trip-summary dt {
  color: var(--muted);
  font-size: 13px;
}

.trip-summary dd {
  color: var(--ink);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.trip-detail .expenses-section {
  margin-top: 30px;
}

.trip-detail .expenses-section .section-heading {
  align-items: flex-end;
  margin-bottom: 14px;
}

.trip-detail .expenses-section h3 {
  font-size: 27px;
  letter-spacing: -0.04em;
}

.expense-section-meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.trip-detail .expense-form {
  margin: 0 0 20px;
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  background: rgba(250, 244, 235, 0.72);
  padding: 18px;
}

.trip-detail .expense-form-fields {
  grid-template-columns: minmax(150px, 0.95fr) minmax(175px, 1.2fr) minmax(180px, 1fr) minmax(190px, 1.65fr);
  gap: 14px;
}

.trip-detail .expense-form .form-actions {
  margin-top: 12px;
}

.trip-detail .expense-conversion {
  gap: 8px;
  font-size: 12px;
  white-space: nowrap;
}

.trip-detail .expense-conversion span {
  white-space: nowrap;
}

.trip-detail .expense-form .button-secondary {
  background: transparent;
}

.trip-detail .trip-table {
  border-top: 1px solid var(--line);
}

.trip-detail .trip-table th {
  padding-top: 12px;
  padding-bottom: 10px;
}

.trip-detail .trip-table td {
  padding-top: 17px;
  padding-bottom: 17px;
}

.trip-detail .trip-table td:first-child {
  color: var(--muted);
}

.trip-detail .trip-actions .text-button {
  color: var(--muted);
  font-weight: 600;
}

.trip-detail .trip-actions .text-button:first-child {
  color: var(--accent);
}

.trip-detail .trip-actions .text-button-danger:hover,
.trip-detail .trip-actions .text-button-danger:focus-visible {
  color: var(--accent);
}

.trip-detail .trip-actions {
  width: 1%;
  text-align: right;
  position: relative;
}

.trip-detail .expense-row-menu {
  position: relative;
  display: inline-block;
  width: 38px;
  flex: 0 0 38px;
  margin: 0;
  vertical-align: middle;
}

.trip-detail .expense-row-menu > summary {
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 0;
}

.trip-detail .expense-row-menu .trip-row-more {
  display: block;
}

.trip-detail .expense-row-menu .trip-row-menu-items {
  top: calc(100% + 8px);
  right: 0;
  bottom: auto;
  max-width: calc(100vw - 24px);
  z-index: 5;
}

.trip-detail .trip-table td:last-child {
  border-bottom-color: rgba(116, 110, 102, 0.08);
}

@media (min-width: 901px) {
  .trip-detail .trip-table-wrap {
    overflow: visible;
  }
}

.trip-detail .trip-table th {
  overflow: visible;
  padding-left: 0;
  padding-right: 16px;
  white-space: nowrap;
}

.trip-detail .trip-table th:last-child {
  padding-right: 0;
}

.trip-detail .expense-row-menu[data-menu-placement="above"] .trip-row-menu-items {
  top: auto;
  bottom: calc(100% + 8px);
}

.trip-detail .expense-row-menu .text-button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 6px 4px;
  text-align: left;
}

@media (max-width: 900px) {
  .trip-hero {
    grid-template-columns: 38% minmax(0, 1fr);
  }

  .trip-detail-hero-content {
    padding: 28px 24px 20px;
  }

  .trip-detail .expense-form-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* V2.2 Trip identity and optional cover images */
.trip-cover {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--surface-soft);
}

.trip-cover-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: var(--surface-soft);
  color: var(--accent);
}

.trip-cover.has-image .trip-cover-placeholder {
  display: none;
}

.trip-cover.is-fallback .trip-cover-placeholder {
  display: grid;
}

.trip-cover-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--cover-fit, cover);
  object-position: var(--cover-position, center);
  transform: scale(var(--cover-zoom, 1));
  transform-origin: center;
}

.trip-cover-image[hidden] {
  display: none;
}

.trip-list {
  display: grid;
  gap: 14px;
}

.trip-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 18px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.trip-card-main {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  min-width: 0;
  min-height: 128px;
  color: inherit;
  text-decoration: none;
}

.trip-card-cover {
  border-radius: 15px 0 0 15px;
}

.trip-card-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 24px;
  min-width: 0;
  padding: 16px 22px 16px 18px;
}

.trip-card-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.trip-card-heading strong {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.trip-card-heading span,
.trip-card-dates,
.trip-card-financials small {
  color: var(--muted);
}

.trip-card-dates {
  grid-column: 1;
  font-size: 14px;
}

.trip-card-financials {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  gap: 6px;
  align-content: start;
  text-align: right;
}

.trip-card-financials span {
  display: grid;
  gap: 1px;
}

.trip-card-financials small {
  font-size: 12px;
}

.trip-card-financials strong {
  font-size: 14px;
  font-weight: 650;
}

.trip-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 112px;
  padding: 0 18px 0 8px;
}

/* V2.4 Trips list */
.trips-page { position: relative; }
.trips-header-actions { display: flex; justify-content: flex-end; margin: -70px 0 30px; }
.trips-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; margin-bottom: 30px; }
.trip-search,
.trip-sort,
.trip-view-toggle { display: flex; align-items: center; }
.trip-search { min-width: 0; gap: 12px; border: 1px solid var(--surface-border); border-radius: 9px; background: rgba(250, 244, 235, 0.46); color: var(--muted); padding: 0 15px; }
.trip-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; padding: 12px 0; }
.trip-search input:focus,
.trip-search input:focus-visible { border: 0; outline: none; box-shadow: none; caret-color: var(--accent); }
.trip-search input[type="search"]::-webkit-search-cancel-button { opacity: 0.58; filter: grayscale(1); }
.trip-search input::placeholder { color: var(--muted); opacity: 0.9; }
.trip-search-icon { width: 22px; height: 22px; flex: 0 0 auto; }
.trip-toolbar-controls { display: flex; align-items: center; gap: 12px; }
.trip-view-toggle { overflow: hidden; border: 1px solid var(--surface-border); border-radius: 9px; }
.trip-view-toggle button { display: grid; width: 50px; height: 48px; place-items: center; border: 0; border-left: 1px solid var(--surface-border); background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.trip-view-toggle button:first-child { border-left: 0; }
.trip-view-toggle button.is-active { background: var(--accent-soft); color: var(--ink); }
.trip-view-toggle button:disabled { cursor: not-allowed; opacity: 0.75; }
.trip-toolbar-icon { width: 20px; height: 20px; }
.trip-sort { gap: 9px; border: 1px solid var(--surface-border); border-radius: 9px; background: rgba(250, 244, 235, 0.46); color: var(--muted); padding: 0 13px; }
.trip-sort-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.trip-sort select { appearance: none; border: 0; outline: 0; background: transparent; color: var(--ink); cursor: pointer; font: inherit; padding: 13px 20px 13px 0; }
.trip-year-group + .trip-year-group { margin-top: 30px; }
.trip-year-heading { display: flex; align-items: baseline; gap: 18px; border-bottom: 1px solid color-mix(in srgb, var(--line) 52%, var(--surface)); padding-bottom: 8px; }
.trip-year-heading h2 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.04em; }
.trip-year-heading span { color: var(--muted); font-size: 16px; }
.trip-rows { display: grid; }
.trip-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-width: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, var(--surface)); }
.trip-row-link { display: grid; grid-template-columns: 222px minmax(0, 1fr) 196px; gap: 30px; align-items: center; min-width: 0; color: inherit; text-decoration: none; padding: 10px 0; }
.trip-row-cover { display: block; width: 222px; height: 98px; overflow: hidden; border-radius: 11px; background: var(--surface-soft); }
.trip-row-cover > .trip-cover { width: 100%; height: 100%; }
.trip-row-cover-image { border-radius: 11px; }
.trip-row-identity { display: grid; gap: 2px; min-width: 0; }
.trip-row-identity strong { font-size: 19px; font-weight: 700; letter-spacing: -0.025em; }
.trip-row-identity > span:not(.trip-row-dates) { color: var(--muted); font-size: 16px; }
.trip-row-dates { display: inline-flex; align-items: center; gap: 8px; margin-top: 7px; color: var(--muted); font-size: 15px; }
.trip-row-calendar { width: 17px; height: 17px; }
.trip-row-financials { display: grid; grid-template-columns: repeat(2, minmax(74px, 1fr)); column-gap: 28px; }
.trip-row-financials span { display: grid; gap: 2px; padding-left: 0; }
.trip-row-financials span + span { border-left: 0; padding-left: 0; }
.trip-row-financials small { color: var(--muted); font-size: 14px; }
.trip-row-financials strong { font-size: 18px; font-weight: 650; }
.trip-row-menu { position: relative; align-self: center; margin-left: 18px; }
.trip-row-menu summary { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: var(--muted); cursor: pointer; list-style: none; }
.trip-row-menu summary::-webkit-details-marker { display: none; }
.trip-row-menu summary:hover,
.trip-row-menu[open] summary { background: var(--surface-soft); color: var(--ink); }
.trip-row-more { width: 20px; height: 20px; }
.trip-row-menu-items { position: absolute; z-index: 2; top: 42px; right: 0; display: grid; min-width: 110px; gap: 4px; border: 1px solid var(--surface-border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); padding: 7px 10px; }
.trip-row-menu-items .text-button { padding: 6px 4px; text-align: left; }

@media (max-width: 1099px) {
  .trips-header-actions { margin: 0 0 22px; }
  .trips-toolbar { gap: 14px; }
  .trip-row-link { grid-template-columns: 170px minmax(0, 1fr) 170px; gap: 18px; }
  .trip-row-cover { width: 170px; height: 88px; }
  .trip-row-financials span,
  .trip-row-financials span + span { padding-left: 16px; }
}

@media (max-width: 767px) {
  .trips-header-actions {
    margin: 0 0 16px;
  }

  .trips-header-actions .button {
    max-width: 100%;
  }

  .trips-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 22px;
  }

  .trip-search {
    width: 100%;
  }

  .trip-toolbar-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .trip-view-toggle {
    display: none;
  }

  .trip-sort {
    width: 100%;
    min-width: 0;
  }

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

  .trip-year-group + .trip-year-group {
    margin-top: 24px;
  }

  .trip-year-heading {
    gap: 10px;
    padding-bottom: 7px;
  }

  .trip-year-heading h2 {
    font-size: 26px;
  }

  .trip-year-heading span {
    font-size: 14px;
  }

  .trip-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .trip-row-link {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 9px 0;
  }

  .trip-row-cover {
    width: 76px;
    height: auto;
    min-height: 72px;
    align-self: stretch;
  }

  .trip-row-financials {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: baseline;
    border-left: 0;
    text-align: left;
  }

  .trip-row-financials span,
  .trip-row-financials span + span {
    padding-left: 0;
  }

  .trip-row-financials span + span {
    border-left: 0;
  }

  .trip-row-menu {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    margin-left: 4px;
  }

  .trip-row-identity strong {
    font-size: 17px;
  }

  .trip-row-identity > span:not(.trip-row-dates) {
    font-size: 14px;
  }

  .trip-row-dates {
    gap: 6px;
    margin-top: 5px;
    font-size: 13px;
  }

  .trip-row-calendar {
    width: 16px;
    height: 16px;
  }

  .trip-row-financials small {
    font-size: 12px;
  }

  .trip-row-financials strong {
    font-size: 15px;
  }
}

.trip-detail {
  max-width: 760px;
}

.trip-detail-header {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.trip-detail-cover {
  min-height: 148px;
  border-radius: 15px 0 0 15px;
}

.trip-detail-identity {
  align-self: center;
  padding: 20px 24px;
}

.trip-detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.trip-settings-action {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
}

.trip-settings-action:hover,
.trip-settings-action:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.trip-settings-icon {
  width: 15px;
  height: 15px;
}

.trip-detail h2 {
  font-size: 28px;
}

.trip-country {
  margin: 5px 0 0;
}

.trip-dates {
  margin: 5px 0 0;
  font-size: 14px;
}

.trip-currency-summary {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.trip-settings-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(67, 51, 39, 0.16);
  padding: 24px;
}

.trip-settings-panel {
  width: min(100%, 420px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: rgba(250, 244, 235, 0.96);
  box-shadow: 0 14px 34px rgba(71, 52, 35, 0.12);
  padding: 20px;
}

.trip-settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.trip-settings-heading h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

.trip-settings-close {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.trip-settings-close-icon {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.trip-settings-close:hover,
.trip-settings-close:focus-visible {
  background: var(--surface-soft);
  color: var(--ink);
}

.trip-settings-form {
  display: grid;
  gap: 14px;
}

.trip-settings-form .form-field label {
  font-size: 15px;
  font-weight: 600;
}

.trip-settings-form input,
.trip-settings-form select {
  font-size: 16px;
}

.trip-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 4px;
}

.trip-settings-actions .button {
  font-size: 15px;
}

.trip-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.trip-summary div {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 0;
}

.trip-summary div + div {
  border-left: 1px solid var(--surface-border);
}

.trip-summary dt {
  font-size: 13px;
}

.trip-summary dd {
  font-size: 16px;
}

/* V2.2.1 Local trip cover uploads */
.trip-cover-field {
  margin-top: 16px;
}

.cover-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.cover-upload-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cover-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.cover-upload-control .button {
  display: inline-flex;
  align-items: center;
}

.cover-file-status {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cover-upload-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.cover-upload-preview img {
  width: 46px;
  height: 34px;
  border: 1px solid var(--surface-border);
  border-radius: 5px;
  object-fit: cover;
}

.cover-upload-preview .text-button {
  margin-left: 4px;
}

.cover-adjust-button {
  margin-left: auto;
  white-space: nowrap;
}

.cover-crop-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(40, 30, 24, 0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cover-crop-modal {
  width: min(100%, 720px);
  padding: 24px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(53, 38, 27, 0.2);
}

.cover-crop-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.cover-crop-heading h3 { margin: 0; font-size: 22px; }
.cover-crop-heading p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.cover-crop-stage {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  place-items: center;
  border-radius: 12px;
  background: #2b211c;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.cover-crop-stage:active { cursor: grabbing; }
.cover-crop-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: center; pointer-events: none; }
.cover-crop-frame { position: absolute; z-index: 2; width: 86%; aspect-ratio: 16 / 9; border: 2px solid rgba(255, 255, 255, 0.95); border-radius: 6px; box-shadow: 0 0 0 999px rgba(25, 18, 14, 0.48); pointer-events: none; }
.cover-crop-shade { display: none; }
.cover-crop-zoom { display: grid; gap: 8px; margin-top: 18px; color: var(--muted); font-size: 13px; font-weight: 650; }
.cover-crop-zoom input { width: 100%; accent-color: var(--accent); }
.cover-crop-modal .form-actions { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; margin-top: 20px; }

@media (max-width: 767px) {
  .cover-crop-backdrop { padding: 12px; }
  .cover-crop-modal { padding: 18px; }
  .cover-crop-modal .form-actions { grid-template-columns: 1fr 1fr; }
  .cover-crop-modal .form-actions span { display: none; }
  .cover-crop-modal .form-actions button { width: 100%; }
}

/* V2.2.2 Overview desktop density */
@media (min-width: 1100px) {
  .main-content { padding-top: 22px; padding-bottom: 28px; }
  .page-subtitle { margin-top: 2px; }
  .view-content { padding-top: 10px; }
  .overview-section { margin-top: 16px; }
  .section-heading { margin-bottom: 8px; }
  .overview-trips { gap: 8px 18px; }
  
  .trip-progress { margin-top: 8px; }
  .overview-lower-grid { gap: 18px; margin-top: 14px; align-items: stretch; }
  .overview-surface { padding: 12px 18px 8px; }
  .category-content { grid-template-columns: 148px minmax(0, 1fr); gap: 20px; padding-top: 3px; }
  .category-donut { width: 138px; height: 138px; }
  .category-donut::after { inset: 28px; }
  .category-breakdown div { grid-template-columns: minmax(0, 1fr) 64px 42px; padding-top: 3px; padding-bottom: 3px; border-bottom-color: color-mix(in srgb, var(--line) 38%, var(--surface)); }
  
  
  
  
  
  
  
  
  
  
  
  
  
  
}

/* Keep the shared desktop shell fixed while the page content scrolls. */
@media (min-width: 768px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    min-height: 0;
  }

  .sidebar {
    height: 100vh;
    min-height: 0;
  }

  .main-content {
    height: 100vh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* V2.3.2 final cascade for the redesigned Trip Detail */
.trip-detail { width: 100%; max-width: none; }
.trip-detail-identity { align-self: auto; padding: 0; }
.trip-detail h2 { font-size: clamp(40px, 4.2vw, 58px); font-weight: 700; letter-spacing: -0.055em; line-height: 0.98; }
.trip-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin: 0; border: 1px solid rgba(116, 110, 102, 0.2); border-radius: 18px; background: rgba(250, 244, 235, 0.78); box-shadow: 0 5px 16px rgba(71, 52, 35, 0.04); backdrop-filter: blur(4px); }
.trip-summary div { gap: 5px; min-width: 0; padding: 16px 18px; }
.trip-summary div + div { border-left: 1px solid rgba(116, 110, 102, 0.22); }
.trip-summary dt { color: var(--muted); font-size: 13px; }
.trip-summary dd { color: var(--ink); font-size: 23px; font-weight: 700; letter-spacing: -0.03em; }

/* V2.3.2.1 compact desktop hero proportions */
@media (min-width: 1100px) {
  .trip-hero {
    grid-template-columns: minmax(32%, 34%) minmax(0, 1fr);
    height: 280px;
    min-height: 280px;
  }

  .trip-hero > .trip-detail-cover,
  .trip-detail-hero-content {
    height: 280px;
    min-height: 280px;
  }

  .trip-detail-hero-content {
    gap: 10px;
    padding: 20px 30px 14px;
  }

  .trip-detail .trip-country { margin-top: 5px; }
  .trip-detail .trip-dates { margin-top: 8px; }
  .trip-detail .trip-currency-summary { margin-top: 8px; }

  .trip-summary div {
    padding: 11px 15px;
  }

  .trip-summary dd {
    font-size: 21px;
  }

  .trip-detail .expenses-section {
    margin-top: 18px;
  }
}

/* V2.3.2.2 compact financial summary strip */
@media (min-width: 1100px) {
  .trip-detail .back-link::before {
    content: none;
  }

  .trip-detail .back-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
  }

  .back-link-icon {
    width: 16px;
    height: 16px;
    stroke-width: 1.8;
  }

  .trip-detail h2 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
  }

  .trip-detail .trip-country {
    font-size: 17px;
    font-weight: 600;
  }

  .trip-detail .trip-dates {
    font-size: 14px;
    font-weight: 500;
  }

  .trip-detail .trip-currency-summary {
    font-size: 13px;
    font-weight: 500;
  }

  .trip-calendar-icon {
    width: 16px;
    height: 16px;
    stroke-width: 1.8;
  }

  .trip-settings-icon {
    width: 16px;
    height: 16px;
    stroke-width: 1.8;
  }

  .trip-summary-label {
    font-size: 12px;
    font-weight: 500;
  }

  .trip-summary-copy strong {
    font-size: 20px;
    font-weight: 650;
  }

  .trip-summary-icon {
    width: 33px;
    height: 33px;
    background: rgba(247, 225, 211, 0.72);
  }

  .trip-summary-icon-svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.8;
  }

  .trip-detail .expenses-section h3 {
    font-size: 23px;
    font-weight: 700;
  }

  .trip-detail .expense-section-meta {
    font-size: 13px;
  }

  .trip-detail .trip-table th {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
  }

  .trip-detail .trip-table td {
    font-size: 14px;
  }

  .trip-detail .trip-actions .text-button {
    font-size: 13px;
  }

  .trip-summary {
    min-height: 68px;
  }

  .trip-summary div {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    min-height: 68px;
    padding: 8px 13px;
  }

  .trip-summary-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    min-height: auto;
    gap: 2px;
    padding: 0;
  }

  .trip-summary-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .trip-summary-copy strong {
    display: block;
    color: var(--ink);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    white-space: nowrap;
  }

  .trip-summary div + div {
    border-left: 0;
  }

  .trip-summary div + div::before {
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 1px;
    background: rgba(116, 110, 102, 0.22);
    content: "";
  }

  .trip-summary dt {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .trip-summary dd {
    display: block;
    margin: 2px 0 0;
    font-size: 21px;
    line-height: 1.05;
    white-space: nowrap;
  }

  .trip-summary-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 250, 245, 0.7);
    color: var(--accent);
  }

  .trip-summary-icon-svg {
    width: 18px;
    height: 18px;
  }
}

/* V2.3.2.4 final Trip Detail compactness and separator cleanup */
@media (min-width: 1100px) {
  .trip-hero,
  .trip-hero > .trip-detail-cover,
  .trip-detail-hero-content {
    height: 220px;
    min-height: 220px;
  }

  .trip-detail-hero-content {
    gap: 6px;
    padding: 12px 28px 10px;
  }

  .trip-detail h2 {
    font-size: 42px;
    line-height: 0.96;
  }

  .trip-detail .trip-country {
    margin-top: 4px;
    font-size: 19px;
    line-height: 1.05;
  }

  .trip-detail .trip-dates {
    margin-top: 7px;
    font-size: 15px;
  }

  .trip-detail .trip-currency-summary {
    margin-top: 6px;
    font-size: 14px;
  }

  .trip-detail .trip-settings-action {
    font-size: 13px;
    padding: 8px 12px;
  }

  .trip-summary div + div,
  .trip-summary div + div::before {
    border-left: 0;
    background: transparent;
  }

  .trip-summary-copy strong {
    font-size: 20px;
  }

  .trip-detail .expenses-section {
    margin-top: 26px;
  }

  .trip-detail .expenses-section .section-heading {
    margin-bottom: 10px;
  }

  .trip-detail .expenses-section h3 {
    font-size: 24px;
    line-height: 1.05;
  }

  .trip-detail .expense-section-meta {
    font-size: 14px;
  }

  .trip-detail .trip-table {
    border-top: 0;
  }

  .trip-detail .trip-table th {
    padding-top: 0;
    padding-bottom: 8px;
  }

  .trip-detail .trip-table td {
    border-bottom-color: rgba(116, 110, 102, 0.08);
    padding-top: 13px;
    padding-bottom: 13px;
  }

  .trip-detail .trip-table td:last-child {
    border-bottom-color: rgba(116, 110, 102, 0.08);
  }

  .trip-detail .trip-actions .text-button {
    font-size: 14px;
  }
}

/* V2.3.2.6 final Trip Detail typography and icon system */
.trip-detail .back-link::before {
  content: none;
}

.trip-detail .back-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
}

.back-link-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

@media (min-width: 1100px) {
  .trip-detail h2 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
  }

  .trip-detail .trip-country {
    font-size: 17px;
    font-weight: 600;
  }

  .trip-detail .trip-dates {
    font-size: 14px;
    font-weight: 500;
  }

  .trip-detail .trip-currency-summary {
    font-size: 13px;
    font-weight: 500;
  }

  .trip-calendar-icon,
  .trip-settings-icon {
    width: 16px;
    height: 16px;
    stroke-width: 1.8;
  }

  .trip-summary-label {
    font-size: 12px;
    font-weight: 500;
  }

  .trip-summary-copy strong {
    font-size: 20px;
    font-weight: 650;
  }

  .trip-summary-icon {
    width: 40px;
    height: 40px;
    background: rgba(247, 225, 211, 0.68);
  }

  .trip-summary-icon-svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.9;
  }

  .trip-detail .expenses-section h3 {
    font-size: 23px;
    font-weight: 700;
  }

  .trip-detail .expense-section-meta {
    font-size: 13px;
  }

  .trip-detail .trip-table th {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
  }

  .trip-detail .trip-table td {
    font-size: 14px;
  }

  .trip-detail .trip-actions .text-button {
    font-size: 13px;
  }
}

/* V2.7.4.1 mobile Trip Detail layout refinement */
@media (max-width: 767px) {
  .trip-detail .trip-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .trip-detail .trip-summary > div {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 7px;
    min-height: 0;
    padding: 9px 10px;
  }

  .trip-detail .trip-summary > div:first-child {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 11px 12px;
  }

  .trip-detail .trip-summary > div:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  .trip-detail .trip-summary > div:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }

  .trip-detail .trip-summary-icon {
    width: 22px;
    height: 22px;
    background: transparent;
  }

  .trip-detail .trip-summary-icon-svg {
    width: 15px;
    height: 15px;
  }

  .trip-detail .trip-summary-label {
    font-size: 10px;
  }

  .trip-detail .trip-summary-copy strong {
    font-size: 16px;
  }

  .trip-detail .trip-summary > div:first-child .trip-summary-label {
    font-size: 11px;
  }

  .trip-detail .trip-summary > div:first-child .trip-summary-copy strong {
    font-size: 21px;
  }

  .trip-detail .trip-summary > div + div::before {
    display: none;
  }

  .trip-detail .expense-table tbody tr {
    grid-template-areas: "date amount" "category actions" "note note";
    gap: 5px 10px;
    padding: 10px 0;
  }

  .trip-detail .expense-table td.expense-note.is-empty {
    display: none;
  }

  .trip-detail .expense-table td:nth-child(5) {
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }
}

/* V2.7 final mobile Trip Detail composition */
@media (max-width: 767px) {
  .trip-detail .trip-hero {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .trip-detail .trip-hero > .trip-detail-cover {
    width: 100%;
    height: clamp(168px, 48vw, 210px);
    min-height: 168px;
    flex: 0 0 auto;
    border-radius: 18px 18px 0 0;
  }

  .trip-detail .trip-detail-hero-content {
    min-height: 0;
    gap: 20px;
    padding: 20px 16px 16px;
  }

  .trip-detail .trip-detail-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }

  .trip-detail .trip-detail-title-row h2 {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .trip-detail .trip-settings-action {
    display: grid;
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    place-items: center;
    border-radius: 13px;
  }

  .trip-detail .trip-settings-action span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .trip-detail .trip-settings-icon { width: 20px; height: 20px; }
  .trip-detail .trip-country { margin-top: 8px; font-size: 18px; line-height: 1.1; }
  .trip-detail .trip-dates { margin-top: 16px; font-size: 15px; }
  .trip-detail .trip-currency-summary { margin-top: 10px; font-size: 12px; line-height: 1.35; }

  .trip-detail .trip-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    width: 100%;
    margin: 0;
    padding: 16px;
    border-radius: 16px;
  }

  .trip-detail .trip-summary > div {
    display: flex;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
  }

  .trip-detail .trip-summary > div:first-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 0 0 14px;
    border-bottom: 1px solid rgba(116, 110, 102, .14);
  }

  .trip-detail .trip-summary > div:nth-child(2),
  .trip-detail .trip-summary > div:nth-child(3) {
    align-items: center;
    gap: 8px;
    padding-top: 14px;
  }

  .trip-detail .trip-summary-icon {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: rgba(247, 225, 211, .68);
  }

  .trip-detail .trip-summary-icon-svg { width: 14px; height: 14px; }

  .trip-detail .trip-summary-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
  }

  .trip-detail .trip-summary-label {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .08em;
    white-space: nowrap;
  }

  .trip-detail .trip-summary-copy strong {
    min-width: 0;
    font-size: 25px;
    line-height: 1;
    white-space: nowrap;
  }

  .trip-detail .trip-summary > div:nth-child(2) .trip-summary-copy strong,
  .trip-detail .trip-summary > div:nth-child(3) .trip-summary-copy strong { font-size: 18px; }

  .trip-detail .trip-summary > div:nth-child(2) .trip-summary-icon,
  .trip-detail .trip-summary > div:nth-child(3) .trip-summary-icon { display: none; }

  .trip-detail .expenses-section { margin-top: 26px; }
  .trip-detail .expenses-section .section-heading { align-items: flex-end; gap: 10px; margin-bottom: 14px; }
  .trip-detail .expenses-section h3 { font-size: 27px; line-height: 1; }

  .trip-detail .expenses-section .section-heading > .button {
    height: 44px;
    min-height: 44px;
    padding: 0 13px;
    border-radius: 9px;
    font-size: 13px;
    white-space: nowrap;
  }

  .trip-detail .expense-table tbody tr {
    grid-template-areas: "category amount" "date actions" "note note";
    gap: 10px 12px;
    padding: 17px 0;
  }

  .trip-detail .expense-table td:nth-child(1) { grid-area: date; color: var(--muted); font-size: 14px; }
  .trip-detail .expense-table td:nth-child(2) { grid-area: category; }
  .trip-detail .expense-table td:nth-child(3) { grid-area: amount; text-align: right; }
  .trip-detail .expense-table td:nth-child(4) { grid-area: note; }
  .trip-detail .expense-table td:nth-child(5) { grid-area: actions; }
  .trip-detail .expense-table .expense-amount,
  .trip-detail .expense-table .category-label { white-space: nowrap; }
  .trip-detail .expense-table .expense-note { color: var(--ink); font-size: 14px; }
  .trip-detail .expense-row-menu { width: 30px; flex-basis: 30px; }
  .trip-detail .expense-row-menu > summary { width: 30px; height: 30px; }

  .trip-detail .expense-form-backdrop {
    display: grid;
    place-items: end center;
    padding: 0;
  }

  .trip-detail .expense-form-modal {
    width: 100%;
    max-width: none;
    max-height: min(90dvh, 760px);
    overflow: auto;
    border-right: 0;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
  }

  .trip-detail .expense-form-modal::before {
    display: block;
    width: 42px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: var(--line-strong);
    content: "";
  }

  .trip-detail .expense-form-modal-heading { padding: 12px 18px 0; }
  .trip-detail .expense-form-modal-heading h2 { font-size: 23px; }
  .trip-detail .expense-form-modal .expense-form { padding: 16px 18px 22px; }
  .trip-detail .expense-form-modal .expense-form-fields { grid-template-columns: 1fr; gap: 14px; }
  .trip-detail .expense-form-modal .expense-form-fields > .form-field:last-child { grid-column: auto; }

  .trip-detail .expense-form-modal .form-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 18px -18px -22px;
    padding: 12px 18px 22px;
    background: rgba(250, 244, 235, .97);
  }

  .trip-detail .expense-form-modal .form-actions .button { min-height: 46px; }
}

/* V2.7 compact mobile expense rows */
@media (max-width: 767px) {
  .trip-detail .expense-table tbody tr {
    grid-template-columns: auto minmax(0, 1fr) auto 30px;
    grid-template-areas:
      "category category amount actions"
      "date note note .";
    align-items: center;
    column-gap: 16px;
    row-gap: 7px;
    min-height: 72px;
    padding: 16px 0;
  }

  .trip-detail .expense-table td:nth-child(1) {
    grid-area: date;
    min-width: max-content;
    font-size: 13px;
    line-height: 1.2;
  }

  .trip-detail .expense-table td:nth-child(2) {
    grid-area: category;
    min-width: 0;
    line-height: 1.2;
  }

  .trip-detail .expense-table td:nth-child(3) {
    grid-area: amount;
    min-width: max-content;
    line-height: 1.2;
    text-align: right;
  }

  .trip-detail .expense-table td:nth-child(4) {
    grid-area: note;
    min-width: 0;
    max-width: none;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .trip-detail .expense-table td.expense-note.is-empty { display: none; }

  .trip-detail .expense-table td:nth-child(5) {
    grid-area: actions;
    display: flex;
    width: 30px;
    min-width: 30px;
    align-items: center;
    justify-content: flex-end;
  }

  .trip-detail .expense-table .expense-amount,
  .trip-detail .expense-table .category-label { white-space: nowrap; }

  .trip-detail .expense-row-menu,
  .trip-detail .expense-row-menu > summary {
    width: 30px;
    height: 30px;
  }
}

/* V2.7.5 mobile Trip Detail expense list */
.trip-detail .trip-detail-category-label .category-icon { display: none; }

@media (max-width: 767px) {
  .trip-detail .expense-table tbody tr {
    grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1fr) 30px;
    grid-template-areas:
      "category category amount actions"
      ". date note .";
    column-gap: 10px;
    row-gap: 6px;
    min-height: 72px;
    padding: 16px 0;
  }

  .trip-detail .expense-table td:nth-child(1) {
    grid-area: date;
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
  }

  .trip-detail .expense-table td:nth-child(2) {
    grid-area: category;
    min-width: 0;
    line-height: 1.2;
  }

  .trip-detail .expense-table td:nth-child(3) {
    grid-area: amount;
    min-width: 0;
    line-height: 1.2;
    text-align: right;
  }

  .trip-detail .expense-table td:nth-child(4) {
    grid-area: note;
    min-width: 0;
    max-width: none;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .trip-detail .expense-table td.expense-note.is-empty { display: none; }

  .trip-detail .expense-table td:nth-child(5) {
    grid-area: actions;
    display: flex;
    width: 30px;
    min-width: 30px;
    align-items: center;
    justify-content: flex-end;
  }

  .trip-detail .trip-detail-category-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .trip-detail .trip-detail-category-label .category-marker { display: none; }

  .trip-detail .trip-detail-category-label .category-icon {
    display: block;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 8px;
    border-radius: 50%;
    stroke-width: 1.75;
  }

  .trip-detail .trip-detail-category-label .category-icon-petal { color: #c77883; background: #f4d9dc; }
  .trip-detail .trip-detail-category-label .category-icon-morning { color: #bd8a32; background: #f6e5bf; }
  .trip-detail .trip-detail-category-label .category-icon-fern { color: #5d886d; background: #dcebe0; }
  .trip-detail .trip-detail-category-label .category-icon-early { color: #5d98a0; background: #dcecef; }

  .trip-detail .expense-table .expense-amount { white-space: nowrap; }
  .trip-detail .expense-row-menu,
  .trip-detail .expense-row-menu > summary { width: 30px; height: 30px; }
}

/* V2.7.5.1 compact mobile expense row alignment */
.trip-detail .trip-detail-expense-content { display: contents; }
.trip-detail .trip-detail-expense-meta { display: none; }

@media (max-width: 767px) {
  .trip-detail .expense-table tbody {
    display: block;
  }

  .trip-detail .expense-table tbody tr {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 80px;
    padding: 16px 0;
  }

  .trip-detail .expense-table tbody tr > td:nth-child(1),
  .trip-detail .expense-table tbody tr > td:nth-child(4) {
    display: none;
  }

  .trip-detail .expense-table tbody tr > td:nth-child(2) {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    padding: 0;
  }

  .trip-detail .trip-detail-expense-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
  }

  .trip-detail .trip-detail-category-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    font-weight: 700;
    line-height: 1.2;
  }

  .trip-detail .trip-detail-category-label .category-icon {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    padding: 13px;
  }

  .trip-detail .trip-detail-expense-meta {
    display: block;
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .trip-detail .expense-table tbody tr > td:nth-child(3) {
    display: block;
    min-width: max-content;
    flex: 0 0 auto;
    padding: 0;
    text-align: right;
  }

  .trip-detail .expense-table tbody tr > td:nth-child(5) {
    display: flex;
    width: 30px;
    min-width: 30px;
    flex: 0 0 30px;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
  }

  .trip-detail .expense-table .expense-amount { white-space: nowrap; }
}

/* V2.7.5.3 explicit mobile expense text column alignment */
@media (max-width: 767px) {
  .trip-detail .trip-detail-expense-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
  }

  .trip-detail .trip-detail-expense-category-row {
    display: flex;
    min-width: 0;
  }

  .trip-detail .trip-detail-category-label {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    gap: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .trip-detail .trip-detail-category-label .category-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    padding: 13px;
  }

  .trip-detail .trip-detail-expense-meta {
    display: block;
    min-width: 0;
    padding-left: 60px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
}

/* V2.7.5.5 compact mobile expense text grouping */
@media (max-width: 767px) {
  .trip-detail .trip-detail-expense-content {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
  }

  .trip-detail .trip-detail-expense-category-row,
  .trip-detail .trip-detail-category-label {
    display: contents;
  }

  .trip-detail .trip-detail-category-label .category-marker { display: none; }

  .trip-detail .trip-detail-category-label .category-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .trip-detail .trip-detail-category-name {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    align-self: end;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .trip-detail .trip-detail-expense-meta {
    grid-column: 2;
    grid-row: 2;
    padding-left: 0;
    align-self: start;
    line-height: 1.2;
  }
}

/* V2.7.5.6 centered mobile Total Spent summary */
@media (max-width: 767px) {
  .trip-detail .trip-summary > div:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
  }

  .trip-detail .trip-summary > div:first-child .trip-summary-icon {
    display: none;
  }

  .trip-detail .trip-summary > div:first-child .trip-summary-copy {
    align-items: center;
    text-align: center;
  }
}

/* V2.7.5.7 centered mobile Budget and Remaining columns */
@media (max-width: 767px) {
  .trip-detail .trip-summary > div:nth-child(2),
  .trip-detail .trip-summary > div:nth-child(3) {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .trip-detail .trip-summary > div:nth-child(2) .trip-summary-copy,
  .trip-detail .trip-summary > div:nth-child(3) .trip-summary-copy {
    align-items: center;
    text-align: center;
  }
}

/* V2.7.5.8 compact mobile Trip Detail top spacing */
@media (max-width: 767px) {
  .main-content:has(.trip-detail) {
    padding-top: 24px;
  }

  .main-content:has(.trip-detail) .view-content {
    padding-top: 0;
  }

  .main-content:has(.trip-detail) .trip-detail {
    margin-top: 0;
  }

  .main-content:has(.trip-detail) .trip-detail .back-link {
    margin-top: 0;
    margin-bottom: 22px;
    padding-top: 0;
  }
}

/* V2.7.7 compact mobile Global Expenses layout */
@media (max-width: 767px) {
  .global-expenses-header {
    justify-content: flex-start;
    margin: 8px 0 20px;
  }

  .global-expenses-header .button {
    min-height: 44px;
  }

  .global-expenses-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 18px;
  }

  .global-expense-search {
    grid-column: 1 / -1;
  }

  .global-expense-filter:last-child {
    grid-column: 1 / -1;
  }

  .global-expenses-table-wrap {
    overflow: visible;
    padding: 0 16px;
  }

  .global-expense-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .global-expense-table thead {
    display: none;
  }

  .global-expense-table tbody {
    display: grid;
  }

  .global-expense-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "trip amount"
      "category amount"
      "date note";
    gap: 5px 12px;
    min-width: 0;
    padding: 14px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 46%, var(--surface));
  }

  .global-expense-table tbody tr:last-child {
    border-bottom: 0;
  }

  .global-expense-table td,
  .global-expense-table td:last-child {
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
    vertical-align: middle;
  }

  .global-expense-table td:nth-child(1) {
    grid-area: date;
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: var(--muted);
    font-size: 13px;
  }

  .global-expense-table td:nth-child(2) {
    grid-area: trip;
  }

  .global-expense-table td:nth-child(3) {
    grid-area: category;
  }

  .global-expense-table td:nth-child(4) {
    grid-area: amount;
    align-self: start;
    text-align: right;
  }

  .global-expense-table td:nth-child(5) {
    grid-area: note;
    max-width: 46vw;
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
    text-align: right;
  }

  .global-expense-table .global-expense-date strong,
  .global-expense-table .global-expense-date span {
    display: inline;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
  }

  .global-expense-table .global-expense-trip .trip-link {
    display: block;
    min-width: 0;
  }

  .global-expense-table .global-expense-trip .trip-link strong {
    display: block;
    min-width: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 650;
    overflow-wrap: anywhere;
  }

  .global-expense-table .global-expense-trip .trip-link span {
    display: none;
  }

  .global-expense-table .category-label {
    min-width: 0;
    max-width: 100%;
    gap: 8px;
    white-space: normal;
  }

  .global-expense-table .expense-amount {
    display: block;
    white-space: nowrap;
  }

  .global-expense-table .expense-original-amount {
    font-size: 16px;
    font-weight: 650;
  }

  .global-expense-table .expense-eur-equivalent {
    margin-top: 2px;
    font-size: 11px;
  }

  .global-expense-table .expense-note.is-empty {
    display: none;
  }

  .global-expenses-footer {
    margin: 14px 0 16px;
  }
}

/* V2.7.8 compact mobile expenses and filters */
.global-expense-filter-panel {
  display: contents;
}

.global-expense-filter-toggle {
  display: none;
}

@media (max-width: 767px) {
  .global-expenses-header {
    margin: 4px 0 14px;
  }

  .global-expenses-filters {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 10px;
    margin-bottom: 14px;
  }

  .global-expense-search {
    grid-column: 1;
  }

  .global-expense-filter-toggle {
    position: relative;
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--surface-border);
    border-radius: 9px;
    background: rgba(250, 244, 235, 0.46);
    color: var(--ink);
    cursor: pointer;
  }

  .global-expense-filter-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .global-expense-filter-icon {
    width: 19px;
    height: 19px;
    stroke-width: 1.75;
  }

  .global-expense-filter-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    display: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
  }

  .global-expense-filter-toggle.is-active .global-expense-filter-indicator {
    display: block;
  }

  .global-expense-filter-panel {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }

  .global-expense-filter-panel.is-open {
    display: grid;
  }

  .global-expense-filter-panel .global-expense-filter:last-child {
    grid-column: 1 / -1;
  }

  .global-expenses-table-wrap {
    padding-top: 0;
    padding-bottom: 0;
  }

  .global-expense-table,
  .global-expense-table tbody {
    height: auto;
    min-height: 0;
    margin: 0;
  }

  .global-expense-table tbody tr {
    grid-template-areas:
      "trip amount"
      "category date"
      "note note";
    grid-template-rows: auto auto auto;
    align-content: start;
    row-gap: 5px;
    column-gap: 12px;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 12px 0;
  }

  .global-expense-table td:nth-child(1) {
    justify-self: end;
    white-space: nowrap;
  }

  .global-expense-table td:nth-child(5) {
    max-width: none;
    justify-self: start;
    text-align: left;
  }

  .global-expense-table .category-label {
    gap: 7px;
    line-height: 1.2;
  }

  .global-expense-table .expense-original-amount {
    font-size: 15px;
  }

  .global-expense-table .expense-eur-equivalent {
    font-size: 10px;
  }
}

/* V2.7.8.2 dedicated mobile Global Expenses rows */
.global-mobile-expense-list {
  display: none;
}

@media (max-width: 767px) {
  .global-expense-table {
    display: none;
  }

  .global-mobile-expense-list {
    display: grid;
    width: 100%;
    min-width: 0;
  }

  .global-mobile-expense-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 4px;
    min-width: 0;
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 46%, var(--surface));
  }

  .global-mobile-expense-row:last-child {
    border-bottom: 0;
  }

  .global-mobile-expense-primary,
  .global-mobile-expense-secondary {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    align-items: center;
    column-gap: 12px;
  }

  .global-mobile-expense-trip {
    min-width: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 650;
    overflow-wrap: anywhere;
    text-decoration: none;
  }

  .global-mobile-expense-trip:hover,
  .global-mobile-expense-trip:focus-visible {
    color: var(--accent);
    text-decoration: none;
  }

  .global-mobile-expense-amount {
    min-width: max-content;
    color: var(--ink);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
  }

  .global-mobile-expense-amount .expense-original-amount,
  .global-mobile-expense-amount .expense-eur-equivalent {
    display: block;
  }

  .global-mobile-expense-amount .expense-eur-equivalent {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
  }

  .global-mobile-expense-category {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .global-mobile-expense-category .category-label {
    min-width: 0;
    gap: 7px;
    white-space: normal;
  }

  .global-mobile-expense-secondary time {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
  }

  .global-mobile-expense-note {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
}

/* V2.8 Overview empty states */
.overview-empty-state {
  display: grid;
  grid-template-columns: minmax(230px, 34%) minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 22px 42px;
}

.overview-empty-state img {
  display: block;
  width: min(100%, 250px);
  max-height: 150px;
  margin: 0 auto;
  object-fit: contain;
}

.overview-empty-copy {
  min-width: 0;
}

.overview-empty-copy h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.overview-empty-copy p {
  max-width: 420px;
  margin: 8px 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

.overview-empty-copy .button {
  min-height: 42px;
}

.overview-surface .overview-empty-state {
  grid-template-columns: minmax(145px, 42%) minmax(0, 1fr);
  min-height: 210px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px 0 4px;
}

.overview-surface .overview-empty-state img {
  width: min(100%, 190px);
  max-height: 145px;
}

.overview-surface .overview-empty-copy h3 {
  font-size: 18px;
}

@media (max-width: 767px) {
  .overview-empty-state,
  .overview-surface .overview-empty-state {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 12px;
    padding: 22px 18px;
    text-align: center;
  }

  .overview-empty-state img,
  .overview-surface .overview-empty-state img {
    width: min(100%, 210px);
    max-height: 130px;
  }

  .overview-empty-copy p {
    margin: 7px auto 16px;
  }

  .overview-empty-copy .button {
    width: 100%;
    justify-content: center;
  }
}

/* V2.13 final Obsidian Glass cascade */
html, body { color-scheme: dark; background-color: #101310; color: var(--ink); }
body { background-image: linear-gradient(180deg, rgba(8, 11, 10, .38), rgba(8, 11, 10, .72)), url("./assets/terra-wallpaper.webp"); background-position: center; background-size: cover; background-attachment: fixed; }
.app-shell, .main-content, .content-column, .view-content { background: transparent; }
.sidebar { border-right-color: var(--surface-border); background: rgba(16, 19, 16, .68); color: var(--ink); backdrop-filter: blur(22px) saturate(115%); -webkit-backdrop-filter: blur(22px) saturate(115%); }
.brand,.sidebar-account { color: var(--ink); }
.brand-image { height: 44px; filter: brightness(1.08) saturate(.9); }
.nav-item { border-left-color: transparent; border-radius: 10px; color: var(--muted); background: transparent; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: var(--ink); }
.nav-item.is-active { border-left-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.main-content { padding: 34px 36px 56px; }
.page-header h1 { color: var(--ink); font-family: Instrument Serif, Georgia, serif; font-weight: 400; }
.page-subtitle { color: var(--muted); }
.button { border-color: var(--line-strong); border-radius: 10px; background: rgba(32, 37, 35, .8); color: var(--ink); }
.button:hover { border-color: rgb(var(--accent-rgb) / .46); background: rgba(40, 45, 42, .9); }
.button-primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { border-color: color-mix(in srgb, var(--accent) 78%, white); background: color-mix(in srgb, var(--accent) 78%, white); color: var(--accent-ink); }
.text-button, .section-link { color: var(--accent); }
.text-button-danger { color: #e77d82; }
.overview-surface,.settings-section,.global-expenses-table-wrap,.global-expenses-empty,.page-empty-illustration,.trip-hero,.trip-detail-header,.auth-card,.trip-form-modal,.expense-form-modal,.cover-crop-modal { border-color: var(--surface-border); background: rgba(24, 28, 27, .46); box-shadow: var(--shadow-soft); backdrop-filter: blur(18px) saturate(115%); -webkit-backdrop-filter: blur(18px) saturate(115%); }

.trip-row { border-bottom-color: var(--line); background: transparent; box-shadow: none; }
.trip-year-heading,.category-breakdown div,.global-expense-table th,.global-expense-table td,.trip-detail .trip-table th,.trip-detail .trip-table td { border-color: var(--line); }
.trip-summary-icon { background: rgb(var(--accent-rgb) / .14); color: var(--accent); }
.category-donut::after { background: #202522; }
.trip-search, .trip-sort, .trip-view-toggle, .global-expense-search, .global-expense-filter, .date-picker-control, input, select, textarea { border-color: var(--line-strong); background: rgba(32, 37, 35, .5); color: var(--ink); }
input::placeholder, textarea::placeholder { color: #858c85; }
.trip-view-toggle button.is-active { background: var(--accent-soft); color: var(--accent); }
.trip-search-icon, .trip-sort-icon, .trip-toolbar-icon { color: var(--muted); }
.trip-row-menu-items, .date-picker-popover { border-color: var(--surface-border); background: #202522; box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.global-expenses-table-wrap { padding: 20px 22px 16px; }
.global-expenses-footer,.trip-row-dates,.trip-row-financials small,.expense-note,.expense-eur-equivalent,.settings-section p,.expense-section-meta,.trip-detail .trip-dates,.trip-detail .trip-currency-summary,.auth-heading p,.auth-switch,.auth-options { color: var(--muted); }
.trip-detail-atmosphere { background-color: #202522; background-image: linear-gradient(180deg, rgba(16, 19, 16, .24), rgba(16, 19, 16, .62)), var(--theme-image, url("./assets/terra-wallpaper.webp")); }
.trip-detail-atmosphere::before { background: rgba(16, 19, 16, .44); }
.trip-detail .trip-settings-action, .trip-detail .trip-summary, .trip-detail .expense-form { border-color: var(--surface-border); background: rgba(32, 37, 35, .54); color: var(--ink); box-shadow: var(--shadow-soft); }
.settings-notice { border-color: rgb(var(--accent-rgb) / .3); background: var(--accent-soft); color: var(--ink) !important; }
.settings-action { border-top-color: var(--line); }

.auth-page { min-height: 62vh; background: transparent; }
.auth-card { max-width: 460px; border-radius: 18px; }
.auth-brand { color: var(--ink); }
.auth-heading h1 { color: var(--ink); font-family: Instrument Serif, Georgia, serif; font-weight: 400; }
.auth-switch a, .auth-options a { color: var(--accent); }
.trip-form-backdrop, .expense-form-backdrop, .cover-crop-backdrop { background: rgba(4, 7, 5, .68); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.trip-form-modal, .expense-form-modal, .cover-crop-modal { background: rgba(22, 26, 25, .86); color: var(--ink); box-shadow: 0 24px 70px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04); }
.trip-form-close, .expense-form-close { color: var(--muted); }
.form-field label, .cover-field-label { color: var(--muted); }
.date-picker-day.is-selected { background: var(--accent); color: #17200f; }
.date-picker-day.is-today { border-color: var(--accent); }
.cover-crop-stage { background: #101310; }
.cover-crop-frame { border-color: rgba(255, 255, 255, .92); box-shadow: 0 0 0 999px rgba(4, 7, 5, .62); }
.cover-crop-zoom input[type="range"] { accent-color: var(--accent); }
.mobile-header { border-bottom-color: var(--surface-border); background: rgba(16, 19, 16, .82); color: var(--ink); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.mobile-menu-button, .mobile-nav-close { border-color: var(--surface-border); background: rgba(32, 37, 35, .78); color: var(--ink); }
@media (max-width: 767px) {
  .main-content { padding: 24px 16px 44px; }
  .page-header h1 { font-size: 40px; }
  .page-subtitle { font-size: 14px; }
  .view-content { padding-top: 18px; }
  .global-expenses-header, .trips-header-actions { margin-top: 0; }
  .overview-surface { padding: 18px 16px; }
  .mobile-header .brand-image { height: 36px; }
  .trip-form-modal, .expense-form-modal, .cover-crop-modal { background: rgba(22, 26, 25, .92); }
}

/* V2.13 Overview visual refinement */
.overview-summary {
  gap: 16px;
}

/* Override the earlier adjacent-card rule so each metric has identical
   horizontal insets and icon-to-copy spacing. */

/* The legacy summary rule targets every nested div.  Reset it here so the
   metric's content column does not inherit card-sized vertical padding. */

.overview-summary strong,.category-breakdown div span:nth-child(2),.category-breakdown div span:last-child {
  font-variant-numeric: tabular-nums;
}

.overview-summary strong {
  font-size: 29px;
}

.overview-section {
  margin-top: 24px;
}

.overview-section .section-heading {
  margin-bottom: 14px;
}

.overview-trips {
  gap: 16px;
}

.trip-progress {
  height: 5px;
  background: rgba(255, 255, 255, .1);
}

.overview-lower-grid {
  gap: 16px;
  margin-top: 24px;
}

.overview-surface {
  background: rgba(27, 31, 30, .59);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .15), inset 0 1px 0 rgba(255, 255, 255, .035);
}

.category-content {
  gap: 24px;
  padding-top: 14px;
}

.category-donut::after {
  background: #202522;
}

.category-breakdown div {
  padding: 8px 0;
}

.overview-section .button-primary {
  min-height: 42px;
  border-radius: var(--terra-radius-control, 10px);
  background: var(--accent);
  color: #17200f;
}

@media (max-width: 767px) {
  .overview-summary {
    gap: 12px;
  }

  

  

  

  

  

  .overview-summary strong {
    font-size: 24px;
  }

  .overview-section {
    margin-top: 20px;
  }

  .overview-trips {
    gap: 12px;
  }

  

  .category-content {
    gap: 14px;
  }
}

@media (min-width: 768px) {
  .overview-summary {
    grid-template-columns: minmax(0, .9fr) minmax(0, .9fr) minmax(0, 1.35fr);
  }

  .app-shell {
    grid-template-columns: 172px minmax(0, 1fr);
    min-height: 100vh;
    padding: 8px 0 8px 8px;
  }

  .sidebar {
    border: 1px solid var(--surface-border);
    border-right-color: var(--surface-border);
    border-radius: 16px;
    background: rgba(16, 19, 16, .62);
  }

  .main-content {
    padding: 30px 34px 52px;
  }

  .content-column:has(.overview-summary) .page-header::before {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    content: "YOUR TRAVEL ATLAS";
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .24em;
    line-height: 1.2;
  }

  .content-column:has(.overview-summary) .page-header h1 {
    font-size: clamp(54px, 5vw, 64px);
    line-height: 1;
    letter-spacing: -.035em;
  }
}

@media (min-width: 768px) and (max-width: 1099px) {
  .overview-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  .overview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  
}

/* Overview layout reconstruction: map-ready main area plus compact trip index. */
.overview-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 16px;
}

.overview-atlas-panel,
.overview-all-trips {
  min-width: 0;
  min-height: 316px;
  margin-top: 0;
}

.overview-atlas-panel {
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.overview-all-trips {
  padding: 16px 18px 10px;
}

.overview-all-trips .section-heading {
  margin-bottom: 4px;
}

@media (max-width: 1099px) and (min-width: 768px) {
  .overview-main-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr);
  }
}

@media (max-width: 767px) {
  .overview-main-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 14px;
  }

  .overview-atlas-panel,
  .overview-all-trips {
    min-height: 0;
  }

  .overview-atlas-panel {
    padding: 12px;
  }

  

  

  

  

  .overview-all-trips {
    padding: 14px 14px 8px;
  }
}

/* Overview map and monthly spending panels */

.overview-map-container {
  position: relative;
  flex: 1 1 auto;
  min-height: 282px;
  overflow: hidden;
  border: 1px solid rgb(var(--accent-rgb) / .16);
  border-radius: 14px;
  background: rgba(10, 18, 22, .48);
}



.overview-map-status {
  position: absolute;
  z-index: 500;
  inset: 50% auto auto 50%;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(24, 28, 27, .78);
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.overview-map-container.is-map-error .overview-map-status {
  color: #f2bb61;
}







.overview-map-container .leaflet-bar a {
  border-bottom-color: rgba(255, 255, 255, .1);
  background: rgba(16, 19, 16, .78);
}

.overview-map-container .leaflet-bar a:last-child {
  border-bottom: 0;
}







.overview-map-empty {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}







.monthly-overview .section-heading {
  align-items: flex-start;
}

.monthly-spending-chart {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  min-height: 238px;
  padding-top: 8px;
}

.monthly-spending-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 0 24px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.monthly-spending-plot {
  position: relative;
  min-width: 0;
}

.monthly-spending-gridlines {
  position: absolute;
  inset: 2px 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.monthly-spending-gridlines span {
  border-top: 1px dashed rgba(255, 255, 255, .12);
}

.monthly-spending-bars {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(12px, 1fr));
  gap: clamp(4px, 1vw, 10px);
  height: 100%;
  min-height: 238px;
}

.monthly-spending-column {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.monthly-spending-bar {
  display: flex;
  width: min(30px, 100%);
  height: 184px;
  align-items: flex-end;
}

.monthly-spending-stack {
  display: flex;
  width: 100%;
  height: var(--bar-size);
  min-height: 0;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 4px 4px 2px 2px;
  background: rgba(255, 255, 255, .04);
}

.monthly-spending-segment {
  display: block;
  min-height: 2px;
  flex: 0 0 var(--segment-size);
  background: var(--segment-color);
}

.monthly-spending-zero {
  display: block;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, .12);
}

.monthly-spending-month {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.monthly-spending-tooltip {
  position: absolute;
  bottom: 34px;
  left: 50%;
  z-index: 3;
  display: grid;
  gap: 3px;
  min-width: 132px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(16, 19, 16, .92);
  color: var(--ink);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .16s ease, transform .16s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.monthly-spending-tooltip strong {
  color: #fff;
  font-size: 11px;
}

.monthly-spending-tooltip span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, .72);
  white-space: nowrap;
}

.monthly-spending-tooltip i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--segment-color);
}

.monthly-spending-column:hover .monthly-spending-tooltip,
.monthly-spending-column:focus-within .monthly-spending-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 767px) {
  .overview-map-container {
    min-height: 220px;
  }

  .monthly-spending-chart {
    min-height: 210px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 6px;
  }

  .monthly-spending-bars {
    min-height: 210px;
    gap: 3px;
  }

  .monthly-spending-bar {
    height: 160px;
  }

  .monthly-spending-month {
    font-size: 9px;
  }

  .monthly-spending-tooltip {
    display: none;
  }
}

/* V3 design: toolbar, KPI cards, atlas map, statistics, search */
select option { background: #171b19; color: #f5f5f1; }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-header-main { min-width: 0; }
.page-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.page-toolbar[hidden] { display: none; }
.toolbar-icon-button,
.toolbar-year { display: inline-flex; align-items: center; gap: 10px; height: 46px; border: 1px solid var(--surface-border); border-radius: 12px; background: rgba(40, 45, 42, .62); color: var(--ink); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.toolbar-icon-button { justify-content: center; width: 46px; padding: 0; cursor: pointer; }
.toolbar-year { padding: 0 6px 0 14px; }
.toolbar-year select { height: 100%; padding: 0 28px 0 2px; border: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b5bab4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 6px center; color: inherit; font: inherit; font-weight: 600; appearance: none; -webkit-appearance: none; cursor: pointer; }
.toolbar-icon { width: 20px; height: 20px; flex: none; }
.toolbar-add { height: 46px; }
.toolbar-icon-button:hover,
.toolbar-year:hover { border-color: var(--line-strong); background: rgba(55, 62, 58, .72); }
.toolbar-icon-button:focus-visible,
.toolbar-year:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

.kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; border: 0; padding: 0; background: none; }
.statistics-page .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-card { display: flex; align-items: center; gap: 16px; min-width: 0; padding: 18px 20px; border: 1px solid var(--surface-border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-soft); color: var(--ink); text-decoration: none; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
a.kpi-card:hover { border-color: var(--line-strong); background: rgba(30, 35, 33, .82); }
a.kpi-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.kpi-icon { display: grid; flex: none; width: 54px; height: 54px; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--accent); }
.kpi-icon-svg { width: 26px; height: 26px; }
.kpi-body { display: grid; flex: 1 1 auto; gap: 3px; min-width: 0; }
.kpi-body strong { overflow: hidden; font-size: 30px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.kpi-label { color: var(--ink); font-size: 14px; }
.kpi-sub { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.kpi-trend.is-up { color: var(--accent); }
.kpi-trend.is-down { color: #8fb8f0; }
.trend-icon { width: 14px; height: 14px; }
.kpi-arrow { flex: none; width: 18px; height: 18px; color: var(--muted); }
.kpi-progress { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.kpi-bar { display: block; flex: 1 1 auto; height: 8px; min-width: 70px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .12); }
.kpi-bar span { display: block; width: var(--progress, 0%); height: 100%; border-radius: inherit; background: var(--accent); }
.kpi-progress em { flex: none; color: var(--muted); font-size: 13px; font-style: normal; }
.kpi-progress.is-over .kpi-bar span { background: #e87979; }
.kpi-progress.is-over em { color: #e87979; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-select,
.section-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--surface-border); border-radius: 10px; background: rgba(40, 45, 42, .62); color: var(--ink); font: inherit; font-size: 14px; }
.section-select { padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b5bab4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; appearance: none; -webkit-appearance: none; cursor: pointer; }
.section-select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.section-chip-icon { width: 16px; height: 16px; color: var(--muted); }

.overview-main-grid,
.map-page { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(290px, 1fr); gap: 16px; margin-top: 16px; align-items: stretch; }
.atlas-panel { position: relative; display: block; min-height: 440px; padding: 0; overflow: hidden; }
.atlas-panel-large { min-height: clamp(480px, calc(100vh - 230px), 760px); }
.atlas-panel .overview-map-container { position: absolute; inset: 0; min-height: 0; border: 0; border-radius: inherit; }

.atlas-panel .atlas-locate-bar { border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; overflow: hidden; background: rgba(22, 26, 25, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: none; }
.atlas-locate-button { display: grid; width: 42px; height: 42px; place-items: center; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .1); border-radius: 0; background: transparent; color: var(--ink); line-height: 42px; cursor: pointer; }
.atlas-panel .atlas-locate-bar { margin-top: 8px; }
.atlas-locate-button { border-bottom: 0; }
.atlas-locate-button:hover { background: rgba(255, 255, 255, .08); }
.atlas-control-icon { width: 19px; height: 19px; }
.atlas-fullscreen-button { position: absolute; z-index: 600; top: 12px; right: 12px; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: rgba(22, 26, 25, .82); color: var(--ink); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); cursor: pointer; }
.atlas-fullscreen-button:hover { background: rgba(50, 56, 52, .9); }
.atlas-filter { position: absolute; z-index: 600; bottom: 26px; left: 12px; display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 14px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: rgba(22, 26, 25, .82); color: var(--ink); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.atlas-filter-icon { width: 19px; height: 19px; color: var(--muted); }
.atlas-filter select { height: 100%; max-width: 180px; padding: 0 26px 0 0; border: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b5bab4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 4px center; color: inherit; font: inherit; appearance: none; -webkit-appearance: none; cursor: pointer; }
.atlas-filter:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.atlas-panel.is-map-empty .overview-map-empty { position: absolute; z-index: 600; right: 16px; bottom: 16px; left: 16px; margin: 0; padding: 10px 14px; border-radius: 10px; background: rgba(22, 26, 25, .86); color: var(--muted); font-size: 13px; text-align: center; }
.atlas-panel.is-fullscreen { position: fixed; z-index: 1500; inset: 0; min-height: 0; border-radius: 0; }
body.atlas-fullscreen { overflow: hidden; }




.atlas-popup { display: flex; align-items: center; gap: 14px; }
.atlas-popup-copy { display: grid; flex: 1 1 auto; gap: 3px; min-width: 0; font-size: 13px; line-height: 1.3; }
.atlas-popup-copy strong { font-size: 17px; }
.atlas-popup-copy span { color: var(--muted); }
.atlas-popup-go { display: grid; flex: none; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; color: var(--ink); text-decoration: none; }
.atlas-popup-go:hover { background: rgba(255, 255, 255, .1); }
.atlas-popup-go-icon { width: 18px; height: 18px; }

.atlas-popup-cover,
.atlas-trip-cover,
.search-result-cover { position: relative; display: block; flex: none; overflow: hidden; background: var(--surface-soft); }
.atlas-popup-cover { width: 84px; height: 84px; border-radius: 12px; }
.atlas-trip-cover { width: 64px; height: 56px; border-radius: 10px; }
.search-result-cover { width: 44px; height: 44px; border-radius: 9px; }
.atlas-popup-cover .trip-cover-image,
.atlas-trip-cover .trip-cover-image,
.search-result-cover .trip-cover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: var(--cover-fit, cover); object-position: var(--cover-position, center); transform: scale(var(--cover-zoom, 1)); }
.atlas-popup-cover .trip-cover-placeholder,
.atlas-trip-cover .trip-cover-placeholder,
.search-result-cover .trip-cover-placeholder { width: 100%; height: 100%; border-radius: 0; }

.atlas-trip-list { display: grid; gap: 4px; }
.atlas-trip { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 16px; align-items: center; gap: 14px; width: 100%; padding: 9px 4px; border: 0; border-bottom: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.atlas-trip:last-child { border-bottom: 0; }
.atlas-trip:hover { background: rgba(255, 255, 255, .05); }
.atlas-trip:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.atlas-trip:disabled { opacity: .55; cursor: default; }
.atlas-trip-body { display: grid; gap: 4px; min-width: 0; }
.atlas-trip-body strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.atlas-trip-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.trip-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--dot, var(--accent)); }
.atlas-trip-spent { font-weight: 600; font-size: 15px; white-space: nowrap; }
.atlas-trip-arrow { width: 16px; height: 16px; color: var(--muted); }
.map-page-note { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.map-page-list { margin-top: 0; align-self: stretch; max-height: clamp(480px, calc(100vh - 230px), 760px); overflow: auto; }

.category-row-label { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.category-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.category-row-icon { width: 19px; height: 19px; flex: none; color: var(--muted); }

.stat-bars { display: grid; gap: 14px; }
.stat-bar-row { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) auto; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.stat-bar-row:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.stat-bar-label { display: grid; gap: 2px; min-width: 0; }
.stat-bar-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-bar-label small,
.stat-bar-value small { color: var(--muted); font-size: 12px; }
.stat-bar-track { display: block; height: 10px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .08); }
.stat-bar-track span { display: block; width: var(--bar); height: 100%; border-radius: inherit; background: var(--c); }
.stat-bar-value { display: grid; justify-items: end; font-weight: 600; white-space: nowrap; }
.stat-table-wrap { overflow-x: auto; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table th,
.stat-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.stat-table th:first-child { text-align: left; font-weight: 500; }
.stat-table thead th { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.stat-table tfoot th,
.stat-table tfoot td { border-bottom: 0; font-weight: 650; }
.stat-table td.is-up { color: #e5a95a; }
.stat-table td.is-down { color: #8fb8f0; }

.account-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) 16px; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.account-card:hover { background: rgba(255, 255, 255, .06); }
.account-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.account-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 17px; }
.account-meta { display: grid; min-width: 0; }
.account-meta strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.account-meta small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-arrow { width: 16px; height: 16px; color: var(--muted); }

.search-backdrop { position: fixed; z-index: 2000; inset: 0; display: grid; place-items: start center; padding: 12vh 16px 16px; background: rgba(6, 9, 8, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.search-dialog { position: relative; width: min(640px, 100%); max-height: 70vh; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 14px; border: 1px solid var(--surface-border); border-radius: 16px; background: rgba(22, 26, 25, .97); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.search-field-icon { position: absolute; top: 28px; left: 30px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search-input { width: 100%; height: 48px; padding: 0 14px 0 44px; border: 1px solid var(--surface-border); border-radius: 12px; background: rgba(255, 255, 255, .05); color: var(--ink); font: inherit; font-size: 16px; }
.search-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.search-results { margin-top: 10px; overflow-y: auto; }
.search-hint { margin: 14px 8px; color: var(--muted); font-size: 14px; }
.search-group { margin: 12px 8px 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.search-result { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.search-result:hover,
.search-result:focus-visible { background: rgba(255, 255, 255, .07); outline: none; }
.search-result:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.search-result-body { display: grid; flex: 1 1 auto; gap: 2px; min-width: 0; }
.search-result-body strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.search-result-body small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.search-result-amount { flex: none; font-weight: 600; font-size: 14px; }
body.search-open { overflow: hidden; }

@media (max-width: 1099px) {
  .overview-main-grid,
  .map-page { grid-template-columns: minmax(0, 1fr); }
  .kpi-row,
  .statistics-page .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-row > .kpi-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .map-page-list { max-height: none; }
}

@media (max-width: 700px) {
  .page-header { flex-direction: column; }
  .page-toolbar { width: 100%; }
  .toolbar-add { flex: 1 1 auto; justify-content: center; }
  .kpi-row,
  .statistics-page .kpi-row { grid-template-columns: minmax(0, 1fr); }
  .kpi-body strong { font-size: 26px; }
  .atlas-panel,
  .atlas-panel-large { min-height: 360px; }
  .atlas-popup-cover { width: 64px; height: 64px; }
  .stat-bar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .stat-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .search-backdrop { padding-top: 8vh; }
}

/* V3 fixes: keep the eyebrow inside the title block and neutralise legacy KPI span styles */
.page-header-main { flex: 1 1 320px; text-align: left; }
.page-header-main h1,
.page-header-main .page-subtitle { text-align: left; }
@media (min-width: 768px) {
  .content-column:has(.overview-summary) .page-header::before { content: none; display: none; }
  .content-column:has(.overview-summary) .page-header-main::before { display: block; margin-bottom: 6px; color: var(--muted); content: "YOUR TRAVEL ATLAS"; font-size: 11px; font-weight: 600; letter-spacing: .24em; line-height: 1.2; }
}
.kpi-row .kpi-label,
.kpi-row .kpi-sub,
.kpi-row .kpi-progress em { margin: 0; padding: 0; text-transform: none; letter-spacing: 0; font-weight: 400; }
.kpi-row .kpi-label { color: var(--ink); font-size: 15px; }
.kpi-row .kpi-sub { color: var(--muted); font-size: 13px; }
.kpi-row .kpi-trend.is-up { color: var(--accent); }
.kpi-row .kpi-trend.is-down { color: #8fb8f0; }
.kpi-row .kpi-body strong { margin: 0; font-size: 30px; }
.kpi-row .kpi-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.kpi-row .kpi-progress { display: flex; }
.kpi-row .kpi-bar { display: block; }
.kpi-row .kpi-sub { display: inline-flex; }
.statistics-page .kpi-row .kpi-body strong { font-size: 26px; }
@media (max-width: 700px) {
  .page-header-main { flex: 0 0 auto; width: 100%; }
}

/* Accessibility: skip link, 44px touch targets, reduced motion */
.skip-link { position: fixed; z-index: 3000; top: 8px; left: 8px; padding: 10px 16px; border-radius: 10px; background: var(--accent); color: #11160f; font-weight: 600; text-decoration: none; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
#view-content:focus { outline: none; }
.atlas-locate-button,
.atlas-fullscreen-button { width: 44px; height: 44px; line-height: 44px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* V3.1 wider glass sidebar */
@media (min-width: 768px) {
  .app-shell { grid-template-columns: clamp(220px, 22vw, 260px) minmax(0, 1fr); }
}
@media (min-width: 1100px) {
  .app-shell { grid-template-columns: clamp(272px, 20vw, 320px) minmax(0, 1fr); }
  .sidebar { padding: 30px 20px 24px; }
  .nav-item { gap: 14px; padding: 13px 16px; font-size: 15.5px; }
  .primary-nav { gap: 6px; }
}
@media (min-width: 768px) {
  .sidebar {
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 22px;
    background:
      linear-gradient(155deg, rgba(255, 255, 255, .17) 0%, rgba(255, 255, 255, .05) 38%, rgba(255, 255, 255, .03) 62%, rgb(var(--accent-rgb) / .07) 100%),
      rgba(18, 22, 20, .34);
    -webkit-backdrop-filter: blur(34px) saturate(170%) brightness(1.08);
    backdrop-filter: blur(34px) saturate(170%) brightness(1.08);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .28),
      inset 1px 0 0 rgba(255, 255, 255, .08),
      inset 0 -1px 0 rgba(0, 0, 0, .25),
      0 28px 70px rgba(0, 0, 0, .38);
  }
  .nav-item { border-left-width: 0; border-radius: 13px; }
  .nav-item:hover { background: rgba(255, 255, 255, .09); }
  .nav-item.is-active {
    border: 1px solid rgb(var(--accent-rgb) / .38);
    background: linear-gradient(135deg, rgb(var(--accent-rgb) / .26), rgb(var(--accent-rgb) / .1));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 20px rgba(0, 0, 0, .22);
  }
  .sidebar-account { border-top-color: rgba(255, 255, 255, .14); }
  .account-card { border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .06); }
}
.sidebar-account .sidebar-account-demo { color: var(--muted); font-size: 12px; line-height: 1.4; }
.sidebar-account .text-button { font-size: 13px; }
.account-meta strong,
.account-meta small { max-width: 100%; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar { background: rgba(24, 29, 27, .94); }
}
.atlas-trip-meta { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (min-width: 1100px) {
  .overview-main-grid,
  .map-page { grid-template-columns: minmax(0, 1.9fr) minmax(320px, 1fr); }
  .atlas-trip { grid-template-columns: 56px minmax(0, 1fr) auto 14px; gap: 12px; }
  .atlas-trip-cover { width: 56px; height: 52px; }
}

/* V3.2 content glass, consistent with the sidebar */
@media (min-width: 768px) {
  .kpi-card,
  .overview-surface,
  .search-dialog {
    border-color: rgba(255, 255, 255, .14);
    background:
      linear-gradient(155deg, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, .02) 45%, rgba(255, 255, 255, .03) 100%),
      rgba(18, 22, 20, .5);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 14px 40px rgba(0, 0, 0, .28);
  }
  a.kpi-card:hover { background: linear-gradient(155deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .04)), rgba(26, 31, 29, .6); }
  .atlas-panel { background: rgba(18, 22, 20, .4); }
}

/* V4 glass system: one frosted material with a thin light edge, soft specular
   and a cursor-following highlight. Moderate transparency keeps text safe. */
@property --glow { syntax: "<number>"; inherits: false; initial-value: 0; }
:root {
  --glass-fill: rgba(20, 25, 23, .46);
  --glass-fill-strong: rgba(20, 25, 23, .72);
  --glass-sheen: linear-gradient(155deg, rgba(255, 255, 255, .13) 0%, rgba(255, 255, 255, .035) 40%, rgba(255, 255, 255, .02) 70%, rgb(var(--accent-rgb) / .045) 100%);
  --glass-blur: blur(26px) saturate(165%);
  --glass-border: rgba(255, 255, 255, .17);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .32), inset 0 0 0 1px rgba(255, 255, 255, .045), inset 0 -1px 0 rgba(0, 0, 0, .22);
  --glass-shadow: 0 18px 48px rgba(0, 0, 0, .32);
  --glass-glow: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, calc(.16 * var(--glow))), rgba(255, 255, 255, 0) 70%);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --muted: #c4c9c2;
}

.sidebar,
.kpi-card,
.overview-surface,
.settings-section,
.auth-card,
.search-dialog,
.account-card,
.toolbar-icon-button,
.toolbar-year,
.section-select,
.section-chip,
.atlas-filter,
.atlas-fullscreen-button,
.trip-form-modal,
.expense-form-modal,
.cover-crop-modal,
.date-picker-popover,
.trip-row-menu-items {
  border: 1px solid var(--glass-border);
  background: var(--glass-glow), var(--glass-sheen), var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), var(--glass-shadow);
  transition: --glow .35s var(--ease-out), transform .3s var(--ease-out), border-color .25s ease, box-shadow .3s ease;
}
.sidebar { background: var(--glass-glow), var(--glass-sheen), rgba(18, 22, 20, .36); border-radius: 22px; }
.toolbar-icon-button,
.toolbar-year,
.section-select,
.section-chip,
.atlas-filter,
.atlas-fullscreen-button,
.account-card { box-shadow: var(--glass-edge), 0 6px 18px rgba(0, 0, 0, .22); }
.trip-form-modal,
.expense-form-modal,
.cover-crop-modal,
.search-dialog,
.date-picker-popover,
.trip-row-menu-items { background: var(--glass-glow), var(--glass-sheen), var(--glass-fill-strong); --glass-blur: blur(34px) saturate(170%); }
.trip-form-backdrop,
.expense-form-backdrop,
.cover-crop-backdrop { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* Leaflet controls and popups use the same material */
.atlas-panel .atlas-locate-bar {
  border: 1px solid var(--glass-border);
  background: var(--glass-sheen), var(--glass-fill-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), 0 8px 24px rgba(0, 0, 0, .3);
}

.atlas-panel { background: rgba(18, 22, 20, .3); }

/* Cursor-following highlight and soft hover lift (fine pointers only) */
@media (hover: hover) and (pointer: fine) {
  .sidebar:hover,
  .kpi-card:hover,
  .overview-surface:hover,
  .account-card:hover { --glow: 1; }
  a.kpi-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .26); box-shadow: var(--glass-edge), 0 22px 54px rgba(0, 0, 0, .38); }
  .toolbar-icon-button:hover,
  .toolbar-year:hover,
  .atlas-fullscreen-button:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .28); }
  .atlas-trip { transition: background-color .25s ease, transform .3s var(--ease-out); }
  .atlas-trip:hover { transform: translateX(3px); background: rgba(255, 255, 255, .07); }
}
.toolbar-icon-button:active,
.toolbar-year:active,
.atlas-fullscreen-button:active,
a.kpi-card:active { transform: scale(.985); }

@media (prefers-reduced-motion: reduce) {
  .sidebar, .kpi-card, .overview-surface, .atlas-trip, .toolbar-icon-button, .toolbar-year, .atlas-fullscreen-button { transition: none; transform: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-fill: rgba(24, 29, 27, .96); --glass-fill-strong: rgba(24, 29, 27, .98); --glass-blur: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass-fill: rgba(24, 29, 27, .94); --glass-fill-strong: rgba(24, 29, 27, .97); }
}
@media (max-width: 767px) {
  .sidebar { background: var(--glass-sheen), rgba(18, 22, 20, .86); }
}
.section-select {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c4c9c2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px 16px,
    var(--glass-sheen), var(--glass-fill);
}

/* V4.1 reference glass: lighter, greener, more transparent; the mountain
   wallpaper stays clearly visible behind every surface. */
:root {
  --glass-fill: rgba(38, 50, 40, .30);
  --glass-fill-strong: rgba(30, 40, 33, .62);
  --glass-sheen: linear-gradient(160deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .05) 38%, rgba(255, 255, 255, .03) 70%, rgb(var(--accent-rgb) / .08) 100%);
  --glass-blur: blur(18px) saturate(150%);
  --glass-border: rgba(255, 255, 255, .22);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .34), inset 0 0 0 1px rgba(255, 255, 255, .05), inset 0 -1px 0 rgba(0, 0, 0, .16);
  --glass-shadow: 0 14px 38px rgba(0, 0, 0, .26);
  --muted: #d0d5cd;
}
body { background-image: linear-gradient(180deg, rgba(10, 14, 13, .1), rgba(10, 14, 13, .46)), url("./assets/terra-wallpaper.webp"); }
.sidebar { background: var(--glass-glow), var(--glass-sheen), rgba(24, 32, 26, .26); }
.kpi-card,
.overview-surface,
.sidebar,
.account-card { text-shadow: 0 1px 2px rgba(0, 0, 0, .32); }
.kpi-icon { background: radial-gradient(circle at 30% 25%, rgb(var(--accent-rgb) / .3), rgb(var(--accent-rgb) / .1)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.kpi-row .kpi-icon { background: radial-gradient(circle at 30% 25%, rgb(var(--accent-rgb) / .3), rgb(var(--accent-rgb) / .1)); }
.kpi-icon-svg { width: 28px; height: 28px; color: var(--accent); stroke-width: 2; }
.kpi-bar { background: rgba(255, 255, 255, .2); }
.kpi-bar span { background: linear-gradient(90deg, var(--accent), var(--accent)); }

.overview-map-container { border: 0; background: rgba(40, 60, 70, .4); }
.category-row-icon { width: 21px; height: 21px; color: var(--c); }
.category-row:nth-child(1) .category-row-icon { color: #9BBE70; }
.category-row:nth-child(2) .category-row-icon { color: #F1BE62; }
.category-row:nth-child(3) .category-row-icon { color: #6097DF; }
.category-row:nth-child(4) .category-row-icon { color: #AE7ADE; }
.atlas-panel { background: rgba(30, 44, 50, .2); }



.atlas-filter,
.atlas-fullscreen-button,
.atlas-panel .atlas-locate-bar { background: var(--glass-sheen), rgba(24, 32, 27, .6); }

/* V4.2 calmer glass: more transparent, less bright, no extra contrast helpers */
:root {
  --glass-fill: rgba(28, 38, 31, .16);
  --glass-fill-strong: rgba(26, 35, 29, .5);
  --glass-sheen: linear-gradient(160deg, rgba(255, 255, 255, .075) 0%, rgba(255, 255, 255, .02) 40%, rgba(255, 255, 255, .012) 70%, rgb(var(--accent-rgb) / .03) 100%);
  --glass-blur: blur(14px) saturate(125%);
  --glass-border: rgba(255, 255, 255, .15);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 0 0 1px rgba(255, 255, 255, .025);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, .16);
  --glass-glow: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, calc(.09 * var(--glow))), rgba(255, 255, 255, 0) 70%);
  --muted: #b5bab4;
}
.kpi-card,
.overview-surface,
.sidebar,
.account-card { text-shadow: none; }
.sidebar { background: var(--glass-glow), var(--glass-sheen), rgba(24, 32, 26, .14); }
.kpi-icon,
.kpi-row .kpi-icon { background: rgb(var(--accent-rgb) / .1); box-shadow: none; }
.kpi-icon-svg { color: var(--accent); stroke-width: 1.75; }
.kpi-bar { background: rgba(255, 255, 255, .14); }
.kpi-bar span { background: var(--accent); }
.nav-item.is-active { background: rgb(var(--accent-rgb) / .16); border-color: rgb(var(--accent-rgb) / .28); box-shadow: none; }
.atlas-filter,
.atlas-fullscreen-button,
.atlas-panel .atlas-locate-bar { background: var(--glass-sheen), rgba(24, 32, 27, .42); }


.category-row-icon { opacity: .9; }
.toolbar-icon-button,
.toolbar-year,
.section-select,
.section-chip,
.account-card { box-shadow: var(--glass-edge); }

/* V4.3 slightly darker glass tint */
:root {
  --glass-fill: rgba(16, 22, 18, .34);
  --glass-fill-strong: rgba(14, 19, 16, .62);
}
.sidebar { background: var(--glass-glow), var(--glass-sheen), rgba(14, 19, 16, .3); }
.atlas-filter,
.atlas-fullscreen-button,
.atlas-panel .atlas-locate-bar { background: var(--glass-sheen), rgba(14, 19, 16, .5); }


/* V4.4 donut: larger chart with a wider hole so the total never touches the ring */
.category-content { grid-template-columns: clamp(148px, 13vw, 176px) minmax(0, 1fr); gap: 24px; }
.category-donut { width: clamp(148px, 13vw, 176px); height: clamp(148px, 13vw, 176px); aspect-ratio: 1; }
.category-donut::after { inset: 19%; }
.category-donut-total { inset: 19%; gap: 1px; font-size: clamp(14px, 1.15vw, 18px); line-height: 1.1; white-space: nowrap; }
.category-donut-total small { font-size: 10.5px; line-height: 1.2; }
@media (max-width: 520px) {
  .category-content { grid-template-columns: minmax(0, 1fr); justify-items: center; }
}

/* V4.5 matte finish: no glossy specular edge or sheen, soft frosted surface */
:root {
  --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .02));
  --glass-blur: blur(22px) saturate(105%);
  --glass-border: rgba(255, 255, 255, .1);
  --glass-edge: inset 0 0 0 1px rgba(255, 255, 255, .025);
  --glass-shadow: 0 10px 28px rgba(0, 0, 0, .14);
  --glass-glow: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, calc(.035 * var(--glow))), rgba(255, 255, 255, 0) 70%);
}
.nav-item.is-active { box-shadow: none; }
a.kpi-card:hover { border-color: rgba(255, 255, 255, .16); box-shadow: var(--glass-edge), 0 16px 40px rgba(0, 0, 0, .22); }
.toolbar-icon-button:hover,
.toolbar-year:hover,
.atlas-fullscreen-button:hover { border-color: rgba(255, 255, 255, .18); }
.kpi-icon,
.kpi-row .kpi-icon { box-shadow: none; }
.account-avatar { box-shadow: none; }

/* V4.6 matte toolbar controls (trips and expenses filters) */
.trip-search,
.trip-sort,
.trip-view-toggle,
.global-expense-search,
.global-expense-filter {
  border: 1px solid var(--glass-border);
  background: rgba(14, 19, 16, .42);
  -webkit-backdrop-filter: blur(22px) saturate(105%);
  backdrop-filter: blur(22px) saturate(105%);
  box-shadow: var(--glass-edge);
  color: var(--ink);
}
.trip-view-toggle button { border-left-color: var(--glass-border); }
.trip-view-toggle button.is-active { background: rgb(var(--accent-rgb) / .16); color: var(--ink); }
.trip-search:focus-within,
.trip-sort:focus-within,
.global-expense-search:focus-within { border-color: rgb(var(--accent-rgb) / .45); outline: 0; }
.trip-search input,
.global-expense-search input { background: transparent; border: 0; box-shadow: none; }

/* V4.7 trips list: each trip is a matte card with clearly separated columns */
.trip-year-group .trip-row { margin-bottom: 12px; }
@media (min-width: 768px) {
  .trip-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: center;
    padding: 12px 6px 12px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    background: var(--glass-sheen), var(--glass-fill);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-edge), var(--glass-shadow);
    transition: transform .3s var(--ease-out), border-color .25s ease;
  }
  .trip-row:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .18); }
  .trip-row-link { display: grid; grid-template-columns: 190px minmax(160px, 1fr) minmax(300px, 1.25fr); align-items: center; gap: 24px; padding: 0; }
  .trip-row-cover { width: 190px; height: 104px; border-radius: 12px; overflow: hidden; }
  .trip-row-identity { display: grid; gap: 4px; min-width: 0; }
  .trip-row-financials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 0; padding: 4px 0; text-align: left; }
  .trip-row-financials .trip-stat { display: grid; align-content: center; gap: 6px; padding: 6px 18px; border-left: 1px solid var(--line-strong); }
  .trip-row-financials small { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
  .trip-row-financials strong { font-size: 18px; font-variant-numeric: tabular-nums; }
  .trip-row-financials .trip-stat.is-over strong { color: #e87979; }
  .trip-row-progress { grid-column: 1 / -1; display: block; height: 6px; margin: 12px 18px 0; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .12); }
  .trip-row-progress span { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: var(--accent); }
  .trip-row-progress.is-over span { background: #e87979; }
  .trip-row-menu { justify-self: center; }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .trip-row-link { grid-template-columns: 150px minmax(0, 1fr); }
  .trip-row-cover { width: 150px; height: 96px; }
  .trip-row-financials { grid-column: 1 / -1; }
  .trip-row-financials .trip-stat:first-child { border-left: 0; padding-left: 4px; }
}

/* The toolbar owns "New trip" / "Add expense"; hide the duplicated in-page buttons that overlapped it */
.trips-header-actions,
.global-expenses-header { display: none; }

/* V4.8 softer dividers everywhere: lines hint at structure instead of cutting through the glass */
:root {
  --line: rgba(255, 255, 255, .055);
  --line-strong: rgba(255, 255, 255, .09);
  --surface-border: rgba(255, 255, 255, .1);
}
.trip-table th,
.trip-table td,
.global-expense-table th,
.global-expense-table td,
.expense-table th,
.expense-table td,
.stat-table th,
.stat-table td { border-bottom-color: var(--line); border-top-color: transparent; }
.global-expenses-table-wrap,
.trip-table-wrap { border-color: var(--line-strong); }
.trip-row-financials .trip-stat { border-left-color: var(--line-strong); }
.atlas-trip { border-bottom-color: var(--line); }
.category-breakdown div { border-bottom-color: var(--line); }
.sidebar-account { border-top-color: var(--line); }
.trip-year-heading { border-color: var(--line); }
hr { border-color: var(--line); }
.global-expenses-table-wrap .global-expense-table th,
.global-expenses-table-wrap .global-expense-table td,
.trip-table-wrap .trip-table th,
.trip-table-wrap .trip-table td { border-bottom-color: var(--line); }
.global-expenses-table-wrap .global-expense-table thead th { border-bottom-color: var(--line-strong); }
.global-expense-table tbody tr:last-child td { border-bottom-color: transparent; }
.trip-year-heading { border-bottom-color: var(--line); }

/* V5 theme: wallpaper lives on a fixed backdrop so a custom photo can be darkened and blurred */
html,
body { background-color: #101310; }
body { background-image: none; }
#theme-backdrop {
  position: fixed;
  z-index: -2;
  inset: -40px;
  pointer-events: none;
  background-color: #101310;
  background-image:
    linear-gradient(180deg, rgb(10 14 13 / var(--theme-overlay-top, .1)), rgb(10 14 13 / var(--theme-overlay-bottom, .46))),
    var(--theme-image, url("./assets/terra-wallpaper.webp"));
  background-position: center;
  background-size: cover;
  filter: blur(var(--theme-blur, 0px));
}

/* Settings: Appearance */

.appearance-preview { position: relative; display: grid; align-content: end; gap: 12px; min-height: 200px; padding: 16px; overflow: hidden; border: 1px solid var(--glass-border); border-radius: 16px; background-color: #101310; background-position: center; background-size: cover; isolation: isolate; }
.appearance-preview::before { position: absolute; z-index: -1; inset: -20px; content: ""; background: inherit; filter: blur(var(--preview-blur, 0px)); }
.appearance-preview::after { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(180deg, rgb(10 14 13 / calc(var(--preview-overlay, .46) * .22)), rgb(10 14 13 / var(--preview-overlay, .46))); }

.appearance-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.appearance-slider { display: grid; grid-template-columns: 110px minmax(0, 1fr) 52px; align-items: center; gap: 12px; font-size: 14px; }
.appearance-slider input[type="range"] { width: 100%; accent-color: var(--accent); }
.appearance-slider output { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.swatch-group { display: grid; gap: 8px; }
.swatch-group > span { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 38px; height: 38px; padding: 0; border: 2px solid rgb(255 255 255 / .22); border-radius: 50%; background: var(--swatch); cursor: pointer; transition: transform .2s var(--ease-out, ease), border-color .2s ease; }
.swatch:hover { transform: scale(1.08); }
.swatch:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.swatch[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px rgb(255 255 255 / .18); }
.swatch[aria-pressed="true"]::after { position: absolute; inset: 0; display: grid; place-items: center; color: #11160f; content: "✓"; font-size: 16px; font-weight: 700; mix-blend-mode: normal; text-shadow: 0 0 3px rgb(255 255 255 / .6); }
.accent-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.accent-custom input[type="color"] { width: 46px; height: 38px; padding: 2px; border: 1px solid var(--glass-border); border-radius: 10px; background: rgb(14 19 16 / .42); cursor: pointer; }
.accent-custom input[type="text"] { width: 110px; height: 38px; padding: 0 12px; border: 1px solid var(--glass-border); border-radius: 10px; background: rgb(14 19 16 / .42); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; text-transform: lowercase; }
.accent-custom input[type="text"][aria-invalid="true"] { border-color: #e87979; }

@media (max-width: 800px) {
  
  .appearance-slider { grid-template-columns: 90px minmax(0, 1fr) 46px; }
}
/* The body must not paint over the fixed backdrop that sits at z-index -2 */
html { background-color: #101310; }
body { background-color: transparent; }
.appearance-section { max-width: none; }
.button:disabled { opacity: .45; cursor: not-allowed; }

/* V6 glass controls: density, frost and shine come from account settings.
   Derived tokens are declared on :root and on the Appearance preview so the
   preview can show unsaved values without touching the rest of the app. */
:root,
.appearance-preview {
  --glass-fill: rgb(16 22 18 / var(--glass-alpha, .34));
  --glass-fill-strong: rgb(14 19 16 / min(.95, calc(var(--glass-alpha, .34) + .28)));
  --glass-blur: blur(var(--glass-blur-px, 22px)) saturate(calc(105% + var(--glass-gloss, 0) * 45%));
  --glass-sheen: linear-gradient(160deg, rgb(255 255 255 / calc(.02 + var(--glass-gloss, 0) * .14)) 0%, rgb(255 255 255 / calc(.012 + var(--glass-gloss, 0) * .04)) 60%, rgb(255 255 255 / calc(.012 + var(--glass-gloss, 0) * .06)) 100%);
  --glass-edge: inset 0 1px 0 rgb(255 255 255 / calc(.04 + var(--glass-gloss, 0) * .3)), inset 0 0 0 1px rgb(255 255 255 / calc(.025 + var(--glass-gloss, 0) * .03));
  --glass-border: rgb(255 255 255 / calc(.1 + var(--glass-gloss, 0) * .1));
}
.sidebar { background: var(--glass-glow), var(--glass-sheen), rgb(14 19 16 / calc(var(--glass-alpha, .34) * .88)); }
.trip-search,
.trip-sort,
.trip-view-toggle,
.global-expense-search,
.global-expense-filter { background: rgb(14 19 16 / min(.9, calc(var(--glass-alpha, .34) + .08))); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.atlas-filter,
.atlas-fullscreen-button,
.atlas-panel .atlas-locate-bar { background: var(--glass-sheen), rgb(14 19 16 / min(.9, calc(var(--glass-alpha, .34) + .16))); }

.trip-form-modal,
.expense-form-modal,
.cover-crop-modal,
.search-dialog,
.date-picker-popover,
.trip-row-menu-items { --glass-blur: blur(calc(var(--glass-blur-px, 22px) * 1.5)) saturate(calc(110% + var(--glass-gloss, 0) * 45%)); }

.button[aria-pressed="true"] { border-color: var(--accent); background: rgb(var(--accent-rgb) / .16); }

/* Logo: the wide white wordmark (SVG) replaces the old PNG */
.brand-image { display: block; width: min(100%, 178px); height: auto; filter: drop-shadow(0 1px 6px rgb(0 0 0 / .35)); }
.mobile-header .brand-image { width: 150px; height: auto; }
.auth-brand img { width: min(100%, 210px); height: auto; filter: drop-shadow(0 1px 6px rgb(0 0 0 / .35)); }

/* V7 expenses table: one calm type scale, category chips, tabular amounts, hover rows */
.global-expenses-table-wrap .global-expense-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.global-expense-table thead th { padding: 14px 16px 12px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.global-expense-table td { padding: 13px 16px; font-size: 14.5px; vertical-align: middle; transition: background-color .2s ease; }
.global-expense-table tbody tr:hover td { background: rgb(255 255 255 / .04); }
.global-expense-table tbody tr:hover td:first-child { border-radius: 12px 0 0 12px; }
.global-expense-table tbody tr:hover td:last-child { border-radius: 0 12px 12px 0; }

.global-expense-date { white-space: nowrap; }
.global-expense-date strong,
.global-expense-date span { display: inline; }
.global-expense-date strong { margin-right: 6px; font-size: 15px; font-weight: 600; letter-spacing: 0; }
.global-expense-date span { color: var(--muted); font-size: 14px; font-weight: 400; }

.global-expense-trip .trip-link { display: grid; gap: 3px; }
.global-expense-trip .trip-link strong { font-size: 15px; font-weight: 600; }
.global-expense-trip .trip-link span { color: var(--muted); font-size: 13px; font-weight: 400; }

.global-expense-table .category-label { gap: 8px; padding: 5px 12px 5px 10px; border: 1px solid var(--line-strong); border-radius: 99px; background: rgb(255 255 255 / .05); font-size: 13px; font-weight: 500; }
.global-expense-table .category-marker { width: 8px; height: 8px; flex: none; border-radius: 50%; }

.global-expense-table th:nth-child(4),
.global-expense-table td.expense-amount { text-align: right; font-variant-numeric: tabular-nums; }
.global-expense-table td.expense-amount { font-size: 15px; font-weight: 600; }
.global-expense-table .expense-original-amount { font-weight: 600; }
.global-expense-table .expense-eur-equivalent { margin-top: 2px; font-size: 12px; font-weight: 400; }
.global-expense-table .expense-note { color: var(--muted); font-size: 14px; }
.global-expense-table .expense-note.is-empty { opacity: .5; }
.global-expense-table th:nth-child(5),
.global-expense-table td.expense-note { padding-left: 32px; }
.global-expense-table tbody tr:last-child td { border-bottom-color: transparent; }

/* Logo centred in the sidebar block */
.sidebar > .brand { display: flex; justify-content: center; width: 100%; margin: 4px 0 6px; }
.sidebar > .brand .brand-image { margin-inline: auto; }

/* Tighter gap between the logo and the navigation */
@media (min-width: 768px) {
  .sidebar > .brand { margin: 2px 0 0; }
  .sidebar .primary-nav { margin-top: 20px; }
}

/* V8 settings: section rail + cards, live preview stage, segmented controls, save bar */
.glass-option {
  --glass-fill: rgb(16 22 18 / var(--glass-alpha, .34));
  --glass-blur: blur(var(--glass-blur-px, 22px)) saturate(calc(105% + var(--glass-gloss, 0) * 45%));
  --glass-sheen: linear-gradient(160deg, rgb(255 255 255 / calc(.02 + var(--glass-gloss, 0) * .14)) 0%, rgb(255 255 255 / calc(.012 + var(--glass-gloss, 0) * .04)) 60%, rgb(255 255 255 / calc(.012 + var(--glass-gloss, 0) * .06)) 100%);
  --glass-edge: inset 0 1px 0 rgb(255 255 255 / calc(.04 + var(--glass-gloss, 0) * .3)), inset 0 0 0 1px rgb(255 255 255 / calc(.025 + var(--glass-gloss, 0) * .03));
  --glass-border: rgb(255 255 255 / calc(.1 + var(--glass-gloss, 0) * .1));
}
.settings-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-rail { position: sticky; top: 16px; display: grid; gap: 4px; padding: 10px; border: 1px solid var(--glass-border); border-radius: 18px; background: var(--glass-sheen), var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge); }
.settings-rail-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.settings-rail-item:hover { background: rgb(255 255 255 / .06); color: var(--ink); }
.settings-rail-item[aria-current="page"] { border-color: rgb(var(--accent-rgb) / .3); background: rgb(var(--accent-rgb) / .14); color: var(--ink); font-weight: 600; }
.settings-rail-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.settings-rail-icon { width: 19px; height: 19px; flex: none; }
.settings-content { min-width: 0; display: grid; gap: 16px; }
.settings-card { display: grid; gap: 16px; padding: 24px; border: 1px solid var(--glass-border); border-radius: 18px; background: var(--glass-sheen), var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), var(--glass-shadow); }
.settings-card-head h2 { margin: 0; font-size: 22px; }
.settings-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }



.appearance-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.appearance-stage { position: sticky; top: 16px; display: grid; gap: 10px; }
.appearance-stage-label { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.appearance-preview { display: block; min-height: 0; aspect-ratio: 16 / 11; padding: 12px; border-radius: 16px; }
.pv-app { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; height: 100%; }
.pv-side { display: grid; align-content: start; justify-items: center; gap: 8px; padding: 8px 0; border: 1px solid var(--glass-border); border-radius: 10px; background: var(--glass-sheen), var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge); }
.pv-logo { width: 16px; height: 8px; margin-bottom: 4px; border-radius: 2px; background: rgb(255 255 255 / .85); }
.pv-nav { width: 18px; height: 6px; border-radius: 3px; background: rgb(255 255 255 / .28); }
.pv-nav.is-active { background: var(--accent); }
.pv-main { display: grid; align-content: start; gap: 10px; min-width: 0; }
.pv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pv-head b { font-family: "Instrument Serif", Georgia, serif; font-size: 18px; font-weight: 400; }
.pv-button { padding: 4px 10px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 600; white-space: nowrap; }
.pv-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pv-card { display: grid; align-content: center; gap: 4px; padding: 8px 10px; border: 1px solid var(--glass-border); border-radius: 10px; background: var(--glass-sheen), var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge); }
.pv-card small { color: var(--muted); font-size: 9px; }
.pv-card b { font-size: 15px; }
.pv-bar { display: block; height: 5px; border-radius: 99px; background: rgb(255 255 255 / .18); overflow: hidden; }
.pv-bar i { display: block; width: 62%; height: 100%; background: var(--accent); }
.pv-wide { padding: 10px; }
.pv-rows { display: grid; gap: 6px; }
.pv-rows i { display: block; width: var(--w); height: 6px; border-radius: 99px; background: var(--accent); opacity: .85; }
.pv-rows i:nth-child(2) { opacity: .55; }
.pv-rows i:nth-child(3) { opacity: .3; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; border: 1px solid var(--glass-border); border-radius: 12px; background: rgb(14 19 16 / .35); }
.segmented-item { padding: 9px 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.segmented-item:hover { color: var(--ink); }
.segmented-item[aria-selected="true"] { border-color: var(--glass-border); background: rgb(255 255 255 / .1); color: var(--ink); font-weight: 600; }
.segmented-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.appearance-panel { display: grid; gap: 16px; min-width: 0; }
.appearance-tabpanel { display: grid; gap: 16px; }
.appearance-file { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.theme-drop-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.theme-drop { display: grid; justify-items: center; gap: 6px; padding: 26px 18px; border: 1.5px dashed rgb(255 255 255 / .22); border-radius: 16px; background: rgb(255 255 255 / .03); text-align: center; cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.theme-drop:hover,
.theme-drop.is-dragging { border-color: var(--accent); background: rgb(var(--accent-rgb) / .08); }
.theme-drop-input:focus-visible + .theme-drop { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme-drop-icon { width: 26px; height: 26px; color: var(--accent); }
.theme-drop small { color: var(--muted); font-size: 12.5px; }

.glass-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.glass-option { display: grid; align-content: end; gap: 3px; min-height: 118px; padding: 8px; border: 2px solid transparent; border-radius: 14px; background-color: #101310; background-position: center; background-size: cover; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform .25s var(--ease-out, ease), border-color .2s ease; }
.glass-option:hover { transform: translateY(-2px); }
.glass-option[aria-pressed="true"] { border-color: var(--accent); }
.glass-option:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.glass-sample { display: block; height: 34px; margin-bottom: 6px; border: 1px solid var(--glass-border); border-radius: 9px; background: var(--glass-sheen), var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge); }
.glass-option strong { padding: 0 4px; font-size: 13.5px; text-shadow: 0 1px 3px rgb(0 0 0 / .6); }
.glass-option small { padding: 0 4px 2px; color: rgb(255 255 255 / .8); font-size: 11.5px; text-shadow: 0 1px 3px rgb(0 0 0 / .6); }

.accent-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.accent-tile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--glass-border); border-radius: 12px; background: rgb(255 255 255 / .04); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.accent-tile:hover { background: rgb(255 255 255 / .08); }
.accent-tile[aria-pressed="true"] { border-color: var(--swatch-on, var(--accent)); background: rgb(var(--accent-rgb) / .14); }
.accent-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.accent-dot { width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .35); }

.appearance-savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--glass-border); border-radius: 14px; background: rgb(14 19 16 / .78); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 10px 30px rgb(0 0 0 / .3); }
.savebar-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.savebar-status::before { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); content: ""; }
.savebar-status.is-dirty::before { background: #f2bb61; }
.savebar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button-ghost { border: 1px solid transparent; background: transparent; color: var(--muted); }
.button-ghost:hover { background: rgb(255 255 255 / .06); color: var(--ink); }

@media (max-width: 1099px) {
  .appearance-layout { grid-template-columns: minmax(0, 1fr); }
  .appearance-stage { position: static; }
}
@media (max-width: 820px) {
  .settings-shell { grid-template-columns: minmax(0, 1fr); }
  .settings-rail { position: static; display: flex; overflow-x: auto; gap: 6px; padding: 8px; }
  .settings-rail-item { width: auto; flex: none; white-space: nowrap; }
  .settings-card { padding: 18px; }
  .glass-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  
  
}
@media (prefers-reduced-motion: reduce) { .glass-option, .settings-rail-item, .segmented-item { transition: none; transform: none !important; } }

/* V45 Destination autocomplete (glass dropdown under the field) */
.place-field { position: relative; }
.place-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: 6px; list-style: none; max-height: 260px; overflow-y: auto; border-radius: 14px; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); background: color-mix(in srgb, #14161a 88%, transparent); -webkit-backdrop-filter: blur(var(--glass-blur-px, 22px)); backdrop-filter: blur(var(--glass-blur-px, 22px)); box-shadow: 0 18px 40px rgb(0 0 0 / .45); }
.place-list[hidden] { display: none; }
.place-list li { padding: 10px 12px; min-height: 40px; border-radius: 10px; color: rgb(255 255 255 / .86); font-size: 14px; line-height: 1.3; cursor: pointer; display: flex; align-items: center; }
.place-list li:hover, .place-list li.is-active { background: rgb(var(--accent-rgb) / .16); color: #fff; }

/* V46 Quick add expense */
.form-notice { margin: 0 0 14px; color: var(--accent); font-size: 13px; line-height: 1.4; }

/* V47 Expense row actions and undo toast */
.global-expense-table .global-expense-col-actions { width: 52px; }
.global-expense-table .trip-actions { text-align: right; }
.global-mobile-expense-primary .expense-row-menu { margin-left: 6px; }
.undo-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); background: color-mix(in srgb, #14161a 88%, transparent); -webkit-backdrop-filter: blur(var(--glass-blur-px, 22px)); backdrop-filter: blur(var(--glass-blur-px, 22px)); color: #fff; font-size: 14px; box-shadow: 0 18px 40px rgb(0 0 0 / .45); }
.undo-toast .text-button { color: var(--accent); font-weight: 600; min-height: 36px; padding: 0 8px; }

/* V48 Category editor */
.category-edit-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.category-edit-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 12px; background: rgb(255 255 255 / .04); }
.category-edit-row input[type="color"] { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.category-edit-row span { overflow-wrap: anywhere; }

/* V49 Expense date filters */
.global-expense-filter input[type="date"] { min-height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); background: rgb(255 255 255 / .06); color: inherit; color-scheme: dark; font: inherit; }
.global-expenses-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.global-expenses-footer p { margin: 0; }
.global-expenses-footer .text-button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }

/* V50 Trip statistics */
.trip-insights { margin: 18px 0; padding: 18px 20px; border-radius: 20px; border: 1px solid var(--glass-border, rgb(255 255 255 / .12)); background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.trip-insights .section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.trip-insights h3 { margin: 0; }
.trip-over-budget { margin: 0; color: #E87979; font-size: 13px; font-weight: 600; }
.trip-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.trip-metric { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: rgb(255 255 255 / .04); }
.trip-metric span { font-size: 12px; opacity: .7; }
.trip-metric strong { font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.trip-day-bars { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 4px; height: 110px; }
.trip-day-bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.trip-day-fill { width: 100%; max-width: 28px; border-radius: 6px 6px 2px 2px; background: rgb(var(--accent-rgb) / .55); min-height: 0; }
.trip-day-fill.is-today { background: var(--accent); }
.trip-day-bar small { font-size: 10px; opacity: .6; height: 12px; }
@media (max-width: 640px) { .trip-metrics { grid-template-columns: 1fr; } }

/* V51 Category budgets */
.trip-category-budgets { margin: 4px 0 14px; }
.trip-category-budgets summary { cursor: pointer; font-size: 14px; padding: 8px 0; }
.trip-category-budgets summary small { opacity: .65; }
.category-budget-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.category-budget-field { display: grid; gap: 6px; font-size: 13px; }
.category-budget-field span { display: flex; align-items: center; gap: 8px; }
.category-budget-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.category-budget-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.category-budget-head span { display: flex; align-items: center; gap: 8px; }
.category-budget-track { height: 8px; margin-top: 6px; border-radius: 999px; background: rgb(255 255 255 / .1); overflow: hidden; }
.category-budget-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.category-budget-row.is-warn .category-budget-track span { background: #F2BB61; }
.category-budget-row.is-over .category-budget-track span { background: #E87979; }
.category-budget-row small { display: block; margin-top: 4px; font-size: 12px; opacity: .75; }
.category-budget-row.is-over small { color: #E87979; opacity: 1; }
@media (max-width: 520px) { .category-budget-grid { grid-template-columns: 1fr; } }

/* V52 Offline sync banner */
.sync-banner { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 79; display: flex; align-items: center; gap: 14px; max-width: min(92vw, 560px); padding: 10px 16px; border-radius: 14px; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); background: color-mix(in srgb, #14161a 88%, transparent); -webkit-backdrop-filter: blur(var(--glass-blur-px, 22px)); backdrop-filter: blur(var(--glass-blur-px, 22px)); color: #fff; font-size: 13px; box-shadow: 0 18px 40px rgb(0 0 0 / .45); }
.sync-banner.has-error { border-color: #E87979; }
.sync-banner .text-button { color: var(--accent); font-weight: 600; min-height: 36px; white-space: nowrap; }
.global-mobile-expense-row.is-pending, .global-expense-table tr.is-pending { opacity: .7; }

/* V51b Category budget fields reuse the trip form field look */
.trip-category-budgets summary { list-style: none; display: flex; align-items: center; gap: 8px; }
.trip-category-budgets summary::-webkit-details-marker { display: none; }
.trip-category-budgets summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; opacity: .7; }
.trip-category-budgets[open] summary::before { transform: rotate(45deg); }
.category-budget-field label { display: flex; align-items: center; gap: 8px; }
.category-budget-field .category-dot { flex: none; }

/* V54 Shared trips: people, invitations, balances */
.share-badge { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; font-size: 11px; background: rgb(var(--accent-rgb) / .18); color: var(--accent); vertical-align: middle; }
.trip-people .section-heading { gap: 12px; flex-wrap: wrap; }
.trip-people small { opacity: .6; font-weight: 400; }
.person-list, .balance-list, .settle-list, .invite-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.person-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: rgb(255 255 255 / .04); }
.person-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgb(var(--accent-rgb) / .22); color: var(--accent); font-weight: 700; }
.person-name { overflow-wrap: anywhere; }
.person-name small { opacity: .6; }
.person-role { font-size: 12px; opacity: .65; }
.invite-box { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgb(255 255 255 / .05); }
.invite-box p { margin: 0 0 8px; font-size: 13px; opacity: .8; }
.invite-link { display: flex; gap: 8px; }
.invite-link input { flex: 1; min-width: 0; min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); background: rgb(0 0 0 / .25); color: inherit; font: inherit; font-size: 12px; }
.invite-list { margin-top: 12px; font-size: 13px; }
.invite-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.trip-people-hint { margin: 10px 0 0; font-size: 12px; opacity: .65; }
.balance-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 12px; background: rgb(255 255 255 / .04); }
.balance-row.is-plus strong { color: #6FBF8A; }
.balance-row.is-minus strong { color: #E8A06A; }
.trip-insights h4 { margin: 14px 0 8px; font-size: 13px; opacity: .8; }
.settle-list li { padding: 8px 12px; border-radius: 12px; background: rgb(255 255 255 / .04); font-size: 14px; }
@media (max-width: 640px) { .person-row { grid-template-columns: 34px minmax(0, 1fr) auto; } .person-role { display: none; } }

/* V54b Shared expense fields */
.expense-split { margin: 14px 0 0; padding: 12px 14px 14px; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); border-radius: 14px; display: grid; gap: 10px; }
.expense-split legend { padding: 0 6px; font-size: 13px; opacity: .8; }
.split-label { margin: 4px 0 0; font-size: 13px; opacity: .75; }
.split-people { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.split-person, .split-custom { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-height: 36px; cursor: pointer; }
.split-amounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.split-amounts[hidden] { display: none; }
.split-amount { display: grid; gap: 4px; font-size: 13px; }

/* V55 Join page */
.join-card { max-width: 720px; }
.join-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 8px; }
.join-option { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 16px; background: rgb(255 255 255 / .05); border: 1px solid var(--glass-border, rgb(255 255 255 / .12)); }
.join-option p { margin: 0; font-size: 13px; opacity: .75; line-height: 1.45; }
@media (max-width: 640px) { .join-options { grid-template-columns: 1fr; } }
.nav-item[hidden] { display: none; }

/* V58 Date picker popovers inside modals. A backdrop-filter on the modal makes it the containing block of
   position:fixed children, so the calendar was positioned inside (and clipped by) the modal. The modal therefore has no
   backdrop-filter of its own (the page behind is already blurred by the overlay) and a slightly denser fill. */
.trip-form-modal, .expense-form-modal { -webkit-backdrop-filter: none; backdrop-filter: none; background-color: rgba(14, 19, 16, 0.84); }

/* V59 Shared expense fields */
.split-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split-amount { display: grid; gap: 6px; min-width: 0; }
.split-amount input { width: 100%; min-width: 0; box-sizing: border-box; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); background: rgb(0 0 0 / .28); color: inherit; font: inherit; -moz-appearance: textfield; }
.split-amount input::-webkit-outer-spin-button, .split-amount input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.split-amount input:focus { outline: none; border-color: var(--accent); }
.expense-split { min-width: 0; }
.expense-form-modal-heading { margin-bottom: 4px; }

/* V60 Trip page tabs (Expenses / Balances / People / Statistics) */
.trip-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0 16px; padding: 5px; width: fit-content; max-width: 100%; border-radius: 16px; background: rgb(255 255 255 / .06); border: 1px solid var(--glass-border, rgb(255 255 255 / .1)); }
.trip-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 12px; background: transparent; color: inherit; font: inherit; font-size: 14px; cursor: pointer; opacity: .75; transition: background .15s ease, opacity .15s ease; }
.trip-tab:hover { opacity: 1; background: rgb(255 255 255 / .06); }
.trip-tab.is-active { opacity: 1; background: rgb(var(--accent-rgb) / .22); color: #fff; font-weight: 600; }
.trip-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.trip-tab-count { min-width: 20px; padding: 1px 7px; border-radius: 999px; background: rgb(255 255 255 / .12); font-size: 12px; text-align: center; }
.trip-tab.is-active .trip-tab-count { background: rgb(var(--accent-rgb) / .35); }
.trip-tab-panel > .trip-insights:first-child { margin-top: 0; }
.balances-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.balances-grid h4 { margin-top: 0; }
.trip-summary-icon { background: rgb(var(--accent-rgb) / .18); }
@media (max-width: 720px) { .balances-grid { grid-template-columns: 1fr; } .trip-tabs { width: 100%; } .trip-tab { flex: 1 1 auto; justify-content: center; padding: 0 10px; } }
@media (prefers-reduced-motion: reduce) { .trip-tab { transition: none; } }
/* V60b Trip summary cards: never overlap, wrap when narrow */
.trip-detail .trip-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.trip-detail .trip-summary > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.trip-detail .trip-summary-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgb(var(--accent-rgb) / .18); }
.trip-detail .trip-summary-icon-svg { width: 20px; height: 20px; color: var(--accent); }
.trip-detail .trip-summary-copy { min-width: 0; display: grid; }
.trip-detail .trip-summary-copy strong { overflow-wrap: anywhere; }
/* V60c Mobile polish: summary in one row, tabs in one scrollable row; round colour swatches */
@media (max-width: 640px) {
  .trip-detail .trip-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .trip-detail .trip-summary > div { flex-direction: column; text-align: center; gap: 2px; }
  .trip-detail .trip-summary-icon { display: none; }
  .trip-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .trip-tabs::-webkit-scrollbar { display: none; }
  .trip-tab { flex: 0 0 auto; padding: 0 12px; }
}
.category-edit-row input[type="color"] { -webkit-appearance: none; appearance: none; border-radius: 50%; overflow: hidden; border: 2px solid rgb(255 255 255 / .25); }
.category-edit-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.category-edit-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.category-edit-row input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }

/* V63 Loading screen: dark glass look, logo, moving track, reduced-motion safe */
.app-loading-state { background: radial-gradient(900px 520px at 50% 38%, rgb(255 255 255 / .07), transparent 70%), linear-gradient(180deg, #151a16 0%, #0d100e 100%); color: rgb(255 255 255 / .78); z-index: 100; }
.app-loading-state[hidden] { display: none; }
.loader { display: grid; justify-items: center; gap: 22px; padding: 24px; text-align: center; }
.loader-logo { width: min(240px, 62vw); height: auto; animation: loader-breathe 2.4s ease-in-out infinite; }


.loader-text { margin: 0; font-size: 14px; letter-spacing: .02em; }
.loader-slow { margin: 0; font-size: 13px; opacity: 0; pointer-events: none; animation: loader-show .4s ease 9s forwards; }
.loader-slow a { color: #b8e57a; pointer-events: auto; }
@keyframes loader-breathe { 0%, 100% { opacity: .72; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes loader-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(290%); } }
@keyframes loader-show { to { opacity: .85; pointer-events: auto; } }
@media (prefers-reduced-motion: reduce) { .loader-logo { animation: none; }  }

/* V64 Global toasts */
.undo-toast { max-width: min(92vw, 520px); animation: toast-in .22s ease-out; }
.undo-toast.is-success::before, .undo-toast.is-error::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.undo-toast.is-error::before { background: #E87979; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .undo-toast { animation: none; } }

/* V65 Date filters use the app's own calendar */
.global-date-filter .date-picker { margin: 0; }
.global-date-filter .date-picker-control { position: relative; }
.global-date-filter .date-picker-input { min-height: 40px; }
.date-picker-clear { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgb(255 255 255 / .1); color: inherit; cursor: pointer; padding: 0; }
.date-picker-clear .date-picker-icon { width: 12px; height: 12px; }
.date-picker-clear:hover { background: rgb(255 255 255 / .2); }
/* V65b The date filter wrappers must not create a containing block for the fixed calendar (no backdrop-filter) */
.global-date-filter { -webkit-backdrop-filter: none; backdrop-filter: none; min-width: 0; background: rgb(255 255 255 / .06); }
.global-date-filter .date-picker-control, .global-date-filter .date-picker-input { width: 100%; min-width: 0; box-sizing: border-box; }
.global-date-filter .date-picker-input { font-size: 14px; padding-right: 68px; background: transparent; border: 0; }
.global-date-filter .date-picker-trigger { right: 6px; }

/* V66 Pick a place on the map */
.place-map-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; min-height: 32px; }
.place-map-button { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.place-pinned { font-size: 12px; opacity: .8; }
.place-map-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / .55); }
.place-map-card { width: min(640px, 100%); max-height: 100%; overflow: auto; display: grid; gap: 12px; padding: 18px; border-radius: 20px; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); background: #151a16; }
.place-map-card h3 { margin: 0; }
.place-map-hint, .place-map-coords { margin: 0; font-size: 13px; opacity: .75; }
.place-map { height: min(52vh, 420px); border-radius: 14px; overflow: hidden; background: #0d100e; }

/* V70 Trip page on glass tokens (follows the account's glass density, blur and shine) */
.trip-detail .trip-detail-atmosphere { background-color: transparent; background-image: linear-gradient(rgb(16 19 16 / .08), rgb(16 19 16 / .30)); }
.trip-detail .trip-cover-placeholder { background: rgb(255 255 255 / .06); }
.trip-detail .trip-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 14px 6px; background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-border); }
.trip-detail .trip-summary > div { padding: 4px 18px; border-left: 1px solid rgb(255 255 255 / .1); }
.trip-detail .trip-summary > div:first-child { border-left: 0; }
.trip-tabs { background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-color: var(--glass-border); }
.trip-tab-panel > .expenses-section { padding: 20px 22px; border-radius: 22px; border: 1px solid var(--glass-border); background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.trip-tab-panel > .trip-insights, .stats-grid > .trip-insights { background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-color: var(--glass-border); }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.stats-grid > .trip-insights { margin: 0; }
.stats-grid > .trip-insights:only-child { grid-column: 1 / -1; }
.trip-day-bars { height: 140px; }
@media (max-width: 1200px) { .trip-detail .trip-summary-icon { display: none; } .trip-detail .trip-summary > div { padding: 4px 12px; } }
@media (max-width: 1180px) { .stats-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .trip-detail .trip-summary { padding: 12px 4px; } .trip-detail .trip-summary > div { padding: 2px 6px; border-left: 0; } .trip-tab-panel > .expenses-section { padding: 14px 12px; border-radius: 18px; } }
/* Edit / new trip: compact, less stretched */
.trip-form-modal { max-width: min(680px, calc(100vw - 32px)); }
.trip-form .trip-form-fields { gap: 12px 16px; }
.category-budget-grid.trip-form-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.category-budget-field label { font-size: 12px; }
@media (max-width: 640px) { .category-budget-grid.trip-form-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* V71 Expenses filters: search + one filter button; the panel opens below in a single flexible row */
.global-expenses-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.global-expenses-filters .global-expense-filter-toggle { display: inline-grid; place-items: center; position: relative; width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--glass-border); background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); color: inherit; cursor: pointer; }
.global-expenses-filters .global-expense-filter-toggle.is-active { border-color: var(--accent); }
.global-expenses-filters .global-expense-filter-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.global-expenses-filters .global-expense-filter-panel { display: none; }
.global-expenses-filters .global-expense-filter-panel.is-open { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.global-expenses-filters .global-expense-filter-panel .global-expense-filter, .global-expenses-filters .global-expense-filter-panel select { min-width: 0; width: 100%; box-sizing: border-box; }

/* V72 Several trips in one place */
.atlas-popup-switch { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 8px; font-size: 12px; opacity: .9; }
.atlas-popup-switch button { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / .18); border-radius: 50%; background: rgb(255 255 255 / .08); color: inherit; cursor: pointer; padding: 0; }
.atlas-popup-switch button:hover { background: rgb(255 255 255 / .18); }
.atlas-popup-step-icon { width: 14px; height: 14px; }
.atlas-popup-switch button:first-child .atlas-popup-step-icon { transform: none; }



/* V73 Settling up and payer column */
.settle-list { gap: 10px; }
.settle-step, .settle-incoming, .settle-history { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: rgb(255 255 255 / .05); }
.settle-wait { font-size: 12px; opacity: .75; }
.settle-buttons { display: inline-flex; align-items: center; gap: 8px; }
.settle-incoming-box { margin-bottom: 14px; padding: 12px 14px; border-radius: 16px; border: 1px solid rgb(var(--accent-rgb) / .45); background: rgb(var(--accent-rgb) / .08); }
.settle-incoming-box h4 { margin: 0 0 8px; }
.settle-history small { opacity: .65; }
.settle-history.is-declined span { opacity: .6; text-decoration: line-through; }
.expense-payer strong { display: block; font-weight: 600; }
.expense-payer small { display: block; opacity: .65; font-size: 12px; margin-top: 2px; }
.trip-detail-expense-meta { overflow-wrap: anywhere; }

/* V74 Account: name, photo, password */
.profile-form { display: grid; gap: 14px; }
.profile-photo-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-photo-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-actions { display: flex; justify-content: flex-start; }
.account-avatar.has-photo { padding: 0; overflow: hidden; }
.account-avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-avatar-large { width: 72px; height: 72px; font-size: 28px; flex: none; }
@media (max-width: 560px) { .profile-names { grid-template-columns: 1fr; } }

/* V75 Dialogs, map popup row, hero on the same glass as the panels, filter pills, account layout */
.app-dialog-overlay { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / .58); animation: toast-fade .15s ease-out; }
.app-dialog { width: min(420px, 100%); display: grid; gap: 14px; padding: 22px; border-radius: 22px; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); background: #151a16; color: rgb(255 255 255 / .92); box-shadow: 0 24px 60px rgb(0 0 0 / .55); }
.app-dialog h3 { margin: 0; font-size: 20px; }
.app-dialog p { margin: 0; font-size: 14px; line-height: 1.5; opacity: .78; }
.app-dialog-input { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--glass-border, rgb(255 255 255 / .16)); background: rgb(0 0 0 / .3); color: inherit; font: inherit; }
.app-dialog-input:focus { outline: none; border-color: var(--accent); }
.app-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.button-danger { background: #e87979; color: #1a0d0d; border-color: transparent; font-weight: 600; }
.button-danger:hover { filter: brightness(1.08); }
@keyframes toast-fade { from { opacity: 0; } to { opacity: 1; } }
.atlas-popup-group { display: grid; gap: 8px; }
.atlas-popup-group .atlas-popup-switch { margin: 0; justify-content: center; font-size: 12px; white-space: nowrap; }
.atlas-popup-group .atlas-popup-switch span { min-width: 44px; text-align: center; }
.atlas-popup-group .atlas-popup { margin: 0; }
.atlas-popup-copy span, .atlas-popup-copy strong { overflow-wrap: anywhere; }
.trip-detail .trip-hero { background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-border); }
.trip-detail .trip-detail-atmosphere { background: none; }
.trip-detail .trip-cover-placeholder { background: rgb(255 255 255 / .05); }
.trip-detail .trip-summary { background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .08); -webkit-backdrop-filter: none; backdrop-filter: none; }
.trip-detail .trip-summary > div { display: flex; align-items: center; justify-content: flex-start; gap: 12px; text-align: left; }
.trip-detail .trip-summary-copy { display: grid; gap: 2px; text-align: left; align-items: start; }
.trip-detail .trip-summary-label { white-space: nowrap; }
.global-expenses-filters .global-expense-filter-toggle { width: 52px; height: 52px; }
.global-expenses-filters .global-expense-filter-panel .global-expense-filter, .global-expenses-filters .global-expense-filter-panel select, .global-date-filter { min-height: 52px; border-radius: 14px; border: 1px solid var(--glass-border); background: var(--glass-fill); box-sizing: border-box; }
.global-date-filter .date-picker, .global-date-filter .date-picker-control { height: 100%; }
.global-date-filter .date-picker-input { height: 50px; min-height: 50px; }


.settings-actions-inline { margin-top: 6px; }
.settings-actions-inline .button { width: auto; }
.account-avatar-large { width: 84px; height: 84px; font-size: 30px; border-radius: 50%; }



/* V76 Modals keep their buttons in view, hero summary without an inner pill, dialog buttons, filters, account */
.expense-form-modal, .trip-form-modal { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); overflow: hidden; }
.expense-form-modal > form, .trip-form-modal form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.expense-form-modal .expense-form-fields, .trip-form-modal .trip-form-fields { overflow-y: auto; min-height: 0; padding-right: 4px; }
.expense-form-modal .form-actions, .trip-form-modal .form-actions { flex: none; padding-top: 14px; margin-top: 8px; border-top: 1px solid rgb(255 255 255 / .08); }
.trip-form-modal form { overflow-y: auto; }
.trip-form-modal form > .form-actions { position: sticky; bottom: 0; background: inherit; }
.trip-detail .trip-summary { background: transparent; border: 0; padding: 6px 0 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.app-dialog .button-danger, .app-dialog .button.button-danger { background: #e87979; color: #1a0d0d; border: 1px solid transparent; font-weight: 600; }
.app-dialog .button-danger:focus-visible, .app-dialog .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
.global-expenses-filters { align-items: stretch; }
.global-expenses-filters .global-expense-search { min-height: 52px; }
.global-expenses-filters .global-expense-filter-panel.is-open { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.global-expenses-filters .global-expense-filter-panel > * { min-width: 0; margin: 0; }
.account-stack { display: grid; gap: 16px; }
.account-stack > .settings-card { margin: 0; }
.account-stack .profile-names { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-stack .password-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .account-stack .profile-names, .account-stack .password-fields { grid-template-columns: 1fr; } }

/* V77 Private ("only me") expenses */
.expense-scope { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.scope-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); background: rgb(255 255 255 / .04); cursor: pointer; min-height: 56px; }
.scope-option:has(input:checked) { border-color: var(--accent); background: rgb(var(--accent-rgb) / .12); }
.scope-option input { margin-top: 3px; accent-color: var(--accent); }
.scope-option strong { display: block; font-size: 14px; }
.scope-option small { display: block; margin-top: 2px; font-size: 12px; opacity: .7; }

[data-split-shared] { display: grid; gap: 10px; }
[data-split-shared][hidden] { display: none; }
@media (max-width: 560px) { .expense-scope { grid-template-columns: 1fr; } }

/* V78 Menus above neighbours, solid row menus, one filter pill style, accent checkboxes, calmer expense scope block */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
.trip-row, .trip-table tr { position: relative; }
.trip-row:has(.trip-row-menu[open]), .global-mobile-expense-row:has(.trip-row-menu[open]) { z-index: 20; }
.trip-table tr:has(.trip-row-menu[open]) { z-index: 20; }
.trip-row-menu-items { background: #1b201e; -webkit-backdrop-filter: none; backdrop-filter: none; min-width: 120px; padding: 6px; z-index: 30; }
.trip-row-menu-items .text-button, .trip-detail .expense-row-menu .text-button { display: block; width: 100%; text-align: left; padding: 8px 10px; margin: 0; border-radius: 8px; }
.trip-row-menu-items .text-button:hover { background: rgb(255 255 255 / .07); }
.global-expenses-filters .global-expense-filter-toggle { align-self: stretch; height: auto; min-height: 52px; width: 52px; }
.global-expense-filter-icon { width: 22px; height: 22px; }
.global-expenses-filters .global-expense-filter-panel.is-open { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; align-items: stretch; }
.global-expenses-filters .global-expense-filter-panel .global-expense-filter { display: block; position: relative; overflow: visible; }
.global-expenses-filters .global-expense-filter-panel .global-expense-filter select { border: 0; background: transparent; box-shadow: none; min-height: 50px; height: 50px; border-radius: 0; padding: 0 14px; }
.expense-split { border: 0; padding: 0; margin: 14px 0 0; }
.expense-split legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; opacity: .9; }
.expense-form-modal .expense-scope { grid-template-columns: 1fr 1fr; }
.expense-form-modal .scope-option { min-width: 0; }
.expense-form-modal .split-person { display: inline-flex; align-items: center; gap: 8px; }

/* V79 Expense form: backdrop-filter on an ancestor trapped the fixed overlay inside the page; modal now opaque like Trip settings */
:is(section, div, article, main):has(.expense-form-backdrop, .trip-form-backdrop) { -webkit-backdrop-filter: none; backdrop-filter: none; }
.trip-form-modal, .expense-form-modal { background: #151a18; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); }
.trip-detail .expenses-section:has(.expense-form-backdrop), .expenses-section:has(.expense-form-backdrop), .global-expenses-table-wrap:has(.expense-form-backdrop), .trip-detail .trip-tab-panel:has(.expense-form-backdrop) { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.expense-form-modal .expense-split { grid-column: 1 / -1; width: 100%; box-sizing: border-box; }
.expense-form-modal .expense-split select, .expense-form-modal .expense-split .form-field { width: 100%; }
.expense-form-modal .expense-form-fields > .form-field:has(input[name="amount"]) { min-width: 0; }

/* V80 Trip categories picker in the trip form */
.trip-categories { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.trip-categories legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.trip-category-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.trip-category-option { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); background: rgb(255 255 255 / .04); cursor: pointer; font-size: 14px; }
.trip-category-option:has(input:checked) { border-color: var(--accent); background: rgb(var(--accent-rgb) / .12); }
.trip-category-option input { margin: 0; }

/* V81 Member budget dialog */
.my-budget-dialog { max-width: 460px; width: calc(100% - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; display: grid; gap: 12px; text-align: left; }
.my-budget-limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 460px) { .my-budget-limits { grid-template-columns: 1fr; } }

/* V82 Hidden budget fields stay hidden */
.category-budget-field[hidden], [data-split-shared][hidden] { display: none !important; }

/* V83 Menu fixes, filter pills in one style, styled dropdown (cselect) instead of the browser's own select menu */
.trip-table tr { position: static; }
.trip-row:has(.trip-row-menu[open]) { z-index: 20; }
.trip-table td.trip-actions:has(.trip-row-menu[open]), .global-mobile-expense-primary:has(.trip-row-menu[open]) { position: relative; z-index: 25; }
.trip-row-menu-items .text-button, .trip-row-menu-items .text-button-danger, .trip-detail .expense-row-menu .text-button { margin: 0; width: 100%; text-align: left; justify-content: flex-start; }
.cselect-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
.cselect { position: relative; width: 100%; }
.cselect-button { width: 100%; text-align: left; font: inherit; font-size: 15px; color: var(--ink, #fff); background: transparent; border: 0; padding: 0 40px 0 16px; min-height: 50px; cursor: pointer; border-radius: inherit; position: relative; }
.cselect-button::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); opacity: .7; }
.cselect-button.is-placeholder { opacity: .7; }
.cselect-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cselect-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; max-height: 260px; overflow-y: auto; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); border-radius: 14px; background: #1b201e; box-shadow: 0 16px 40px rgb(0 0 0 / .4); min-width: 160px; }
.cselect-list[hidden] { display: none; }
.cselect-list.is-above { top: auto; bottom: calc(100% + 6px); }
.cselect-list li { padding: 9px 12px 9px 30px; border-radius: 9px; cursor: pointer; font-size: 15px; position: relative; }
.cselect-list li:hover, .cselect-list li.is-active { background: rgb(255 255 255 / .08); }
.cselect-list li.is-selected { color: var(--accent); }
.cselect-list li.is-selected::before { content: ""; position: absolute; left: 12px; top: 50%; width: 5px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-65%) rotate(45deg); }
.global-expenses-filters .global-expense-filter { overflow: visible; }
.global-expenses-filters .global-expense-filter-panel .global-expense-filter .cselect { height: 100%; }
.global-expense-filter .cselect-button, .global-date-filter .date-picker-input { font-size: 15px; color: var(--ink, #fff); }
.global-date-filter .date-picker-input { padding-left: 16px; }
.form-field .cselect { border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); border-radius: 12px; background: rgb(255 255 255 / .04); }
.global-expense-filter-toggle { display: inline-grid; place-items: center; }
.global-expense-filter-toggle .global-expense-filter-icon { display: block; margin: 0; }
.global-expense-filter-indicator { position: absolute; top: 10px; right: 10px; }
.global-expenses-filters .global-expense-filter:has(.cselect.is-open), .form-field:has(.cselect.is-open) { position: relative; z-index: 70; }
.global-expenses-filters .global-expense-filter-panel { position: relative; z-index: 5; }
.global-expenses-filters .global-expense-filter-panel .global-expense-filter { -webkit-backdrop-filter: none; backdrop-filter: none; }
.global-date-filter input::placeholder, .global-date-filter .date-picker-input::placeholder { color: inherit; opacity: .7; }

/* V84 Date filter pills: the inner control had its own grey fill on top of the pill's fill */
.global-date-filter .date-picker-control, .global-date-filter .date-picker-input { background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* V85 Loading screen: a route drawn between three stops, a traveller moving along it, rotating hints */
.loader-route { width: min(320px, 78vw); height: auto; overflow: visible; }
.loader-route path { fill: none; stroke-linecap: round; }
.route-base { stroke: rgb(255 255 255 / .14); stroke-width: 2; stroke-dasharray: 2 7; }
.route-draw { stroke: var(--accent, #b8e57a); stroke-width: 2.5; stroke-dasharray: 100; stroke-dashoffset: 100; animation: route-draw 3.2s cubic-bezier(.5, 0, .2, 1) infinite; filter: drop-shadow(0 0 6px rgb(var(--accent-rgb, 184 229 122) / .55)); }
.route-pin { fill: #12160f; stroke: var(--accent, #b8e57a); stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.route-pin-1 { animation: pin-pop 3.2s ease infinite; }
.route-pin-2 { animation: pin-pop 3.2s ease infinite; animation-delay: 1.05s; }
.route-pin-3 { animation: pin-pop 3.2s ease infinite; animation-delay: 2.1s; }
.route-traveler { fill: var(--accent, #b8e57a); offset-path: path("M24 66 C 72 8, 118 96, 168 48 S 268 4, 296 42"); offset-rotate: 0deg; animation: traveler 3.2s cubic-bezier(.5, 0, .2, 1) infinite; filter: drop-shadow(0 0 8px var(--accent, #b8e57a)); }
.loader-text { display: grid; justify-items: center; min-height: 20px; }
.loader-text span { grid-area: 1 / 1; opacity: 0; animation: loader-phrase 9.6s ease infinite; }
.loader-text span:nth-child(2) { animation-delay: 3.2s; }
.loader-text span:nth-child(3) { animation-delay: 6.4s; }
@keyframes route-draw { 0% { stroke-dashoffset: 100; opacity: 1; } 78% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes traveler { 0% { offset-distance: 0%; opacity: 1; } 78% { offset-distance: 100%; opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
@keyframes pin-pop { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.5); } 28% { transform: scale(1); } }
@keyframes loader-phrase { 0% { opacity: 0; transform: translateY(6px); } 6%, 30% { opacity: 1; transform: translateY(0); } 36%, 100% { opacity: 0; transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) {
  .route-draw { animation: none; stroke-dashoffset: 0; opacity: .8; }
  .route-traveler, .route-pin { animation: none; }
  .route-traveler { offset-distance: 100%; }
  .loader-text span { animation: none; }
  .loader-text span:first-child { opacity: 1; }
}

/* V86 Date filters in the same ink as the lists, reset button */
.global-date-filter .date-picker-input, .global-date-filter .date-picker-input::placeholder, .global-date-filter .date-picker-trigger, .global-date-filter .date-picker-icon { color: var(--ink, #f5f5f1); opacity: 1; }
.global-expense-reset { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 14px; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); background: var(--glass-fill, rgb(16 22 18 / .34)); color: var(--accent); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.global-expense-reset:hover { border-color: var(--accent); }
.global-expense-reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.global-expense-reset-icon { width: 16px; height: 16px; }

/* V87 Lower dropdown rows */
.cselect-list { padding: 4px; }
.cselect-list li { padding: 6px 12px 6px 30px; font-size: 14.5px; line-height: 1.3; border-radius: 8px; }
.cselect-list li.is-selected::before { left: 11px; }

/* V88 Row menu: the old ".trip-actions .text-button + .text-button" margin pushed Delete to the right */
.trip-actions .trip-row-menu-items .text-button + .text-button, .trip-row-menu-items .text-button + .text-button { margin-left: 0; }
/* Open row menu rises by itself; the row cells stay plain so the hover highlight is one even plate */
.trip-table td.trip-actions:has(.trip-row-menu[open]), .global-mobile-expense-primary:has(.trip-row-menu[open]) { position: static; z-index: auto; }
.trip-row-menu[open] { position: relative; z-index: 30; }
.global-expense-table tbody tr:hover td, .trip-table tbody tr:hover td { background: rgb(255 255 255 / .05); }
.global-expense-table tbody tr:hover td:first-child { border-radius: 12px 0 0 12px; }
.global-expense-table tbody tr:hover td:last-child { border-radius: 0 12px 12px 0; }

/* V89 Row hover without per-cell fills (they showed up as steps): one plate on the row plus an accent bar */
.global-expense-table td, .trip-table td { transition: none; }
.global-expense-table tbody tr:hover td, .trip-table tbody tr:hover td, .global-expense-table tbody tr:focus-within td, .trip-table tbody tr:focus-within td { background: transparent !important; border-radius: 0 !important; }
.global-expense-table tbody tr, .trip-table tbody tr { transition: background-color .15s ease; }
.global-expense-table tbody tr:hover, .trip-table tbody tr:hover, .global-expense-table tbody tr:focus-within, .trip-table tbody tr:focus-within { background: rgb(255 255 255 / .045); }
.global-expense-table tbody tr:hover td:first-child, .trip-table tbody tr:hover td:first-child, .global-expense-table tbody tr:focus-within td:first-child, .trip-table tbody tr:focus-within td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* V90 The "···" button sits inside the hover plate */
.global-expense-table td.trip-actions .trip-row-menu, .trip-table td.trip-actions .trip-row-menu { right: 18px; }

/* V91 Map popup arrow uses the accent colour */
.atlas-popup-go { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.atlas-popup-go:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* V92 Leaflet paints links blue; force the popup arrow itself to the accent */
.atlas-popup-go .atlas-popup-go-icon { color: var(--accent); stroke: var(--accent); }

/* V93 iOS zooms the page when a focused field is under 16px: keep fields at 16px on touch screens */
@media (hover: none) and (pointer: coarse) {
  input, select, textarea, .cselect-button { font-size: 16px; }
}

/* V94 Mobile only: expense card row has three items (trip, amount, menu) in one line */
@media (max-width: 767px) {
  .global-mobile-expense-primary { grid-template-columns: minmax(0, 1fr) auto 38px; }
  .global-mobile-expense-primary .global-mobile-expense-trip { grid-column: 1; grid-row: 1; }
  .global-mobile-expense-primary .global-mobile-expense-amount { grid-column: 2; grid-row: 1; }
  .global-mobile-expense-primary .expense-row-menu { grid-column: 3; grid-row: 1; margin-left: 0; }
}

/* V95 Mobile only: expense form footer on the dark modal surface, compact; amount fills the row when there is no currency field */
@media (max-width: 767px) {
  .trip-detail .expense-form-modal .form-actions, .expense-form-modal .form-actions {
    grid-template-columns: 1fr 1fr;
    background: rgb(21, 26, 24);
    border-top: 1px solid rgb(255 255 255 / .1);
  }
  .expense-form-modal .form-actions .button-primary { grid-column: 1 / -1; order: -1; }
  .expense-form-modal .expense-amount-group > .form-field:only-of-type { grid-column: 1 / -1; }
  .expense-form-modal .expense-amount-group { grid-template-columns: minmax(0, 1fr); }
  .expense-form-modal .expense-amount-group:has(#expense-currency) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* V96 iPhone PWA: keep content out of the notch, status bar and home indicator (env() is 0 everywhere else, so desktop is unchanged) */
@media (max-width: 767px) {
  .mobile-header { padding-top: calc(16px + env(safe-area-inset-top)); padding-left: calc(20px + env(safe-area-inset-left)); padding-right: calc(20px + env(safe-area-inset-right)); }
  .app-shell { padding-bottom: env(safe-area-inset-bottom); }
  .expense-form-modal .form-actions, .trip-detail .expense-form-modal .form-actions { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .sidebar { padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* V97 Mobile bottom navigation in the TERRA glass style (hidden from 768 px up, so desktop is unchanged) */
.bottom-nav { display: none; }
@media (max-width: 767px) {
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: end;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--surface-border);
    background: rgba(16, 19, 16, .82); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  }
  .bottom-nav-item { display: grid; justify-items: center; gap: 3px; min-height: 48px; padding: 6px 0 2px; color: var(--muted); font-size: 11px; font-weight: 500; text-decoration: none; }
  .bottom-nav-item.is-active { color: var(--accent); }
  .bottom-nav-icon { width: 22px; height: 22px; }
  .bottom-nav-add { justify-self: center; display: grid; place-items: center; width: 54px; height: 54px; margin-top: -22px; border: 0; border-radius: 50%; background: var(--accent); color: #11160f; cursor: pointer; box-shadow: 0 0 0 5px rgba(16, 19, 16, .82); }
  .bottom-nav-add svg { width: 26px; height: 26px; }
  .main-content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .app-shell.is-auth-view .bottom-nav, .app-shell.is-app-loading .bottom-nav { display: none; }
  body.search-open .bottom-nav, .app-shell.is-mobile-nav-open .bottom-nav { display: none; }
}

/* V98 Hide the bottom bar while a form dialog is open */
@media (max-width: 767px) {
  body:has(.expense-form-backdrop) .bottom-nav, body:has(.trip-form-backdrop) .bottom-nav, body:has(.cover-crop-backdrop) .bottom-nav { display: none; }
}

/* V99 Mobile "Today" card on the overview (hidden from 768 px up) */
.mobile-today { display: none; }
@media (max-width: 767px) {
  .mobile-today { display: grid; gap: 16px; margin: 0 0 16px; padding: 18px 16px; border: 1px solid var(--surface-border); border-radius: 20px; background: var(--glass-sheen, none), rgba(20, 26, 22, .52); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
  .today-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .today-state { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
  .mobile-today h2 { margin: 2px 0 0; font-family: "Instrument Serif", Georgia, serif; font-size: 30px; font-weight: 400; line-height: 1.1; }
  .today-switch { padding: 8px 12px; border: 1px solid var(--surface-border); border-radius: 999px; color: var(--ink); font-size: 13px; text-decoration: none; }
  .today-left { display: grid; gap: 6px; }
  .today-label { color: var(--muted); font-size: 13px; }
  .today-amount { font-size: 40px; font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; }
  .today-amount.is-over { color: #e6907f; }
  .today-bar { display: block; height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .12); }
  .today-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
  .today-bar.is-over span { background: #e6907f; }
  .today-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
  .today-recent-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
  .today-recent-head h3 { margin: 0; font-size: 15px; }
  .today-recent-head a, .today-link { color: var(--accent); font-size: 13px; text-decoration: none; }
  .today-recent ul { margin: 0; padding: 0; list-style: none; }
  .today-expense { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
  .today-expense-main, .today-expense-amount { display: grid; gap: 2px; min-width: 0; }
  .today-expense-amount { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
  .today-expense small { color: var(--muted); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .today-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
  .today-link-icon { width: 16px; height: 16px; }
  .today-empty { margin: 0; color: var(--muted); font-size: 14px; }
}

/* V100 Mobile: every expense form is a bottom sheet with a big amount and quick category chips (desktop unchanged) */
.category-chips { display: none; }
@media (max-width: 767px) {
  .expense-form-backdrop { display: grid; place-items: end center; padding: 0; background: rgba(6, 9, 7, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  .expense-form-modal { width: 100%; max-width: none; max-height: min(92dvh, 780px); overflow: auto; border-radius: 22px 22px 0 0; border-bottom: 0; animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
  .expense-form-modal::before { display: block; width: 42px; height: 4px; margin: 10px auto 0; border-radius: 999px; background: rgb(255 255 255 / .22); content: ""; }
  .expense-form-modal .form-field:has(#expense-amount) input { height: 64px; font-size: 34px; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }
  .expense-form-modal .form-field:has(#expense-category) select, .expense-form-modal .form-field:has(#expense-category) .cselect { display: none; }
  .category-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .category-chip { min-height: 44px; padding: 0 16px; border: 1px solid var(--surface-border); border-radius: 999px; background: rgb(255 255 255 / .06); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
  .category-chip.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .expense-form-modal { animation: none !important; } }

/* V101 Mobile sheet footer: Add on top, Cancel and Add and next below */
@media (max-width: 767px) {
  .expense-form-modal .expense-form .form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; justify-content: stretch; }
  .expense-form-modal .expense-form .form-actions .button { width: 100%; min-height: 48px; justify-content: center; }
}

/* V102 Mobile app feel: bigger touch targets, no page rubber band, balances on one column, tab scroll hint, sync banner above the bottom bar */
@media (max-width: 767px) {
  html, body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
  body { -webkit-touch-callout: none; }
  input, textarea { -webkit-touch-callout: default; user-select: text; }
  .button, .text-button, .section-link, .section-select, .trip-tab { min-height: 44px; }
  .trip-row-menu > summary { width: 44px; height: 44px; }
  .trip-tabs { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); scroll-snap-type: x proximity; }
  .trip-tab { scroll-snap-align: start; }
  .balances-grid { grid-template-columns: 1fr; gap: 14px; }
  .settle-step, .settle-incoming { flex-direction: column; align-items: stretch; gap: 10px; }
  .settle-pay, .settle-buttons .button { width: 100%; min-height: 48px; }
  .sync-banner { bottom: calc(86px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  .view-content.is-entering { animation: view-in .22s ease-out; }
  .global-mobile-expense-primary { grid-template-columns: minmax(0, 1fr) auto 44px; }
}
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view-content.is-entering { animation: none !important; } }

/* V103 Mobile: remaining small touch targets */
@media (max-width: 767px) {
  .mobile-menu-button { width: 44px; height: 44px; }
  .today-switch, .today-recent-head a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* V104 Mobile: Confirm / Not received side by side, full width */
@media (max-width: 767px) {
  .settle-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
  .settle-buttons .text-button { justify-content: center; white-space: nowrap; }
}

/* V105 Mobile polish: compact summary cards, shorter trip cover, no duplicate Add expense in the header (the + in the bottom bar does it) */
@media (max-width: 767px) {
  .page-toolbar [data-action="add-expense"] { display: none; }
  .page-header h1 { font-size: 34px; }
  .kpi-row { gap: 10px; }
  .kpi-card { gap: 12px; padding: 12px 14px; border-radius: 16px; }
  .kpi-icon { width: 40px; height: 40px; }
  .kpi-body strong { font-size: 24px; line-height: 1.1; }
  .kpi-body .kpi-label { font-size: 13px; }
  .trip-detail-cover { max-height: 160px; overflow: hidden; }
  .trip-detail-cover .trip-cover-image, .trip-detail-cover img, .trip-detail-cover .trip-cover-placeholder { height: 160px; }
  .trip-detail-title-row h2 { font-size: 30px; line-height: 1.1; }
  .trip-detail .trip-country { margin-top: 2px; }
}

/* V106 Mobile: the bottom bar hides what scrolls under it; trip cover without a grey strip; tighter trip header */
@media (max-width: 767px) {
  .bottom-nav { background: rgba(14, 17, 14, .95); }
  .trip-detail-cover { height: 160px; max-height: 160px; background: none; }
  .trip-detail .trip-country { font-size: 16px; }
  .trip-detail .trip-dates { margin-top: 6px; font-size: 14px; }
}

/* V107 Chart and caption text is never smaller than 11 px (axes, month labels, tooltips, conversion hints, donut caption, day bars) */
.monthly-spending-axis, .monthly-spending-month, .monthly-spending-tooltip, .category-donut-total small, .category-overview .category-donut-total small,
.expense-eur-equivalent, .global-expense-table .expense-eur-equivalent, .global-mobile-expense-amount .expense-eur-equivalent, .trip-day-bar small { font-size: 11px; }
@media (max-width: 767px) { .monthly-spending-month { font-size: 11px; } }

/* V108 Former members: quieter rows for people who left the trip but keep their history */
.former-heading { margin: 18px 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, rgba(255,255,255,.6)); }
.former-list .person-row.is-former { opacity: .7; }
.former-list .person-row.is-former .person-avatar { filter: grayscale(1); }
.former-list .person-row.is-former .person-role { font-style: italic; }
@media (max-width: 767px) { .former-list .person-row.is-former { min-height: 44px; } }

/* V109 Category rename: default tag, action group, inline rename form */
.category-default-tag { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; opacity: .6; }
.category-edit-actions { display: inline-flex; gap: 4px; }
.category-rename-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.category-rename-form input { min-width: 0; min-height: 40px; }
@media (max-width: 767px) {
  .category-edit-row { grid-template-columns: 36px minmax(0, 1fr); }
  .category-edit-row .category-edit-actions, .category-edit-row .category-default-tag { grid-column: 2; justify-self: start; }
  .category-edit-actions .text-button, .category-rename-form .text-button { min-height: 44px; }
  .category-edit-row.is-renaming .category-rename-form { grid-template-columns: minmax(0, 1fr) auto auto; }
}

/* V110 Export choice dialog */
.app-choice-list { display: grid; gap: 10px; margin: 14px 0 8px; }
.app-choice-option { display: grid; gap: 4px; text-align: left; padding: 14px 16px; min-height: 56px; border-radius: 16px; border: 1px solid rgb(255 255 255 / .18); background: rgb(255 255 255 / .06); color: inherit; font: inherit; cursor: pointer; }
.app-choice-option strong { font-size: 16px; }
.app-choice-option small { font-size: 13px; opacity: .72; }
.app-choice-option:hover, .app-choice-option:focus-visible { border-color: var(--accent, #9BBE70); background: rgb(255 255 255 / .1); outline: none; }

/* V111 Mobile: trip tabs fade only where more tabs hide; 44 px touch targets for trip links and the logo */
@media (max-width: 767px) {
  .trip-tabs { -webkit-mask-image: none; mask-image: none; }
  .trip-tabs.can-scroll-right:not(.can-scroll-left) { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); }
  .trip-tabs.can-scroll-left:not(.can-scroll-right) { -webkit-mask-image: linear-gradient(to left, #000 88%, transparent); mask-image: linear-gradient(to left, #000 88%, transparent); }
  .trip-tabs.can-scroll-left.can-scroll-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent); }
  .global-mobile-expense-primary .global-mobile-expense-trip { display: inline-flex; align-items: center; min-height: 44px; }
  .mobile-header .brand { display: inline-flex; align-items: center; min-height: 44px; }
}

/* V112 Touch: every text field is at least 16 px so iOS never auto-zooms on focus (class selectors such as .form-field input used to win with 14 px) */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
select,
textarea,
.cselect-button,
.date-picker-selects select { font-size: 16px !important; }
}

/* V113 Mobile: trip form is a bottom sheet like the expense form; forms get one field height (48 px) and 44 px touch targets (desktop unchanged) */
@media (max-width: 767px) {
  .trip-form-backdrop { display: grid; place-items: end center; padding: 0; background: rgba(6, 9, 7, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  .trip-form-modal { width: 100%; max-width: none; max-height: min(94dvh, 820px); border-radius: 22px 22px 0 0; border-bottom: 0; animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
  .trip-form-modal::before { display: block; flex: none; width: 42px; height: 4px; margin: 10px auto 0; border-radius: 999px; background: rgb(255 255 255 / .22); content: ""; }
  .trip-form-modal form > .form-actions { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .trip-form-modal .form-actions .button { min-height: 48px; }
  .trip-form-modal .form-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  .trip-form-modal .form-field select, .trip-form-modal .cselect-button,
  .expense-form-modal .form-field input:not(#expense-amount):not([type="checkbox"]):not([type="radio"]),
  .expense-form-modal .form-field select, .expense-form-modal .cselect-button { min-height: 48px; }
  .trip-form-close, .expense-form-close { width: 44px; height: 44px; }
  .date-picker [data-action="toggle-date-picker"]:not(.date-picker-field) { min-width: 44px; min-height: 44px; }
  .trip-form-modal label:has(input[type="checkbox"]), .trip-form-modal label:has(input[type="radio"]),
  .expense-form-modal label:has(input[type="checkbox"]), .expense-form-modal label:has(input[type="radio"]) { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .trip-form-modal { animation: none !important; } }

/* V114 Mobile: rounded glass trip cards, one scroll in the trip form (fields no longer squeezed into a hidden inner scroll, suggestions are not clipped), trip summary as hero total + two equal columns */
@media (max-width: 767px) {
  .trip-rows { display: grid; gap: 10px; }
  .trip-row { margin: 0; border: 1px solid rgb(255 255 255 / .12); border-radius: 18px; background: rgb(255 255 255 / .06); }

  .trip-form-modal form { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .trip-form-modal .trip-form-fields { flex: none; overflow: visible; padding-right: 0; }
  .trip-form-modal .trip-form { padding-bottom: 0; }
  .trip-form-modal form > .form-actions { background: rgb(22 26 25); display: flex; gap: 10px; margin-top: 0; padding-top: 12px; z-index: 2; }
  .trip-form-modal form > .form-actions .button { flex: 1 1 0; }

  .trip-detail .trip-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 4px 0 0; }
  .trip-detail .trip-summary > div { flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 12px 8px; border-left: 0; text-align: center; }
  .trip-detail .trip-summary > div:first-child { grid-column: 1 / -1; padding: 6px 8px 14px; border-bottom: 1px solid rgb(255 255 255 / .1); }
  .trip-detail .trip-summary > div:nth-child(3) { border-left: 1px solid rgb(255 255 255 / .1); }
  .trip-detail .trip-summary-icon { display: none; }
  .trip-detail .trip-summary-copy { justify-items: center; align-items: center; text-align: center; }
  .trip-detail .trip-summary-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .72; }
  .trip-detail .trip-summary-copy strong { font-size: 20px; line-height: 1.15; }
  .trip-detail .trip-summary > div:first-child .trip-summary-copy strong { font-size: 32px; }
}

/* V115 Mobile: profile avatar instead of the burger, account menu as a bottom sheet (mobile only) */
@media (max-width: 767px) {
  .mobile-menu-button.has-avatar { width: 44px; height: 44px; padding: 0; border-radius: 50%; overflow: hidden; }
  .mobile-menu-button.has-avatar .mobile-menu-icon { display: none; }
  .mobile-menu-button .account-avatar { width: 40px; height: 40px; font-size: 17px; }
  .app-shell.is-mobile-nav-open .sidebar {
    inset: auto 0 0 0; width: 100%; height: auto; max-height: 82dvh; padding: 64px 18px calc(22px + env(safe-area-inset-bottom));
    border: 1px solid var(--surface-border); border-bottom: 0; border-radius: 28px 28px 0 0;
    background: rgb(22 26 25 / .96); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 -18px 48px rgb(0 0 0 / .45);
  }
  .app-shell.is-mobile-nav-open .sidebar::before { content: ""; position: absolute; top: 8px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: rgb(255 255 255 / .25); }
  .app-shell.is-mobile-nav-open .sidebar > .brand { display: none; }
  .app-shell.is-mobile-nav-open .mobile-nav-close { top: 12px; right: 14px; width: 44px; height: 44px; }
  .app-shell.is-mobile-nav-open .sidebar-account { order: -1; margin: 0 0 8px; }
  .app-shell.is-mobile-nav-open .primary-nav { margin-top: 8px; gap: 4px; }
  /* these four are already in the bottom bar */
  .app-shell.is-mobile-nav-open .nav-item[data-view="overview"], .app-shell.is-mobile-nav-open .nav-item[data-view="trips"],
  .app-shell.is-mobile-nav-open .nav-item[data-view="statistics"], .app-shell.is-mobile-nav-open .nav-item[data-view="map"] { display: none; }
  .app-shell.is-mobile-nav-open .nav-item { min-height: 52px; }
  .app-shell.is-mobile-nav-open .mobile-nav-backdrop { background: rgb(0 0 0 / .55); }
}

/* V116 Mobile: the calendar opens as a bottom sheet with big day cells (mobile only) */
@media (max-width: 767px) {
  .date-picker-popover:not([hidden]) {
    position: fixed !important; z-index: 400; inset: auto 0 0 0 !important; top: auto !important; left: 0 !important; width: 100% !important;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: rgb(22 26 25 / .98);
    box-shadow: 0 0 0 100vmax rgb(0 0 0 / .55), 0 -18px 48px rgb(0 0 0 / .45);
  }
  .date-picker-popover::before { content: ""; display: block; width: 44px; height: 5px; margin: -8px auto 12px; border-radius: 3px; background: rgb(255 255 255 / .25); }
  .date-picker-popover .date-picker-nav { width: 44px; height: 44px; }
  .date-picker-popover .date-picker-day { min-height: 44px; font-size: 16px; }
  .date-picker-popover select { min-height: 44px; font-size: 16px; }
}

/* V117 Mobile: Overview summary tiles as one compact row of three (mobile only) */
@media (max-width: 767px) {
  .overview-summary.kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
  .overview-summary .kpi-card { display: grid; align-content: center; justify-items: center; gap: 0; min-height: 0; padding: 14px 6px; text-align: center; border-radius: 18px; }
  .overview-summary.kpi-row > .kpi-card:last-child:nth-child(odd) { grid-column: auto; }
  .overview-summary .kpi-icon, .overview-summary .kpi-arrow { display: none; }
  .overview-summary .kpi-body { display: grid; justify-items: center; gap: 2px; min-width: 0; }
  .overview-summary .kpi-body strong { font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; }
  .overview-summary .kpi-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
  .overview-summary .kpi-sub, .overview-summary .kpi-trend, .overview-summary .kpi-progress em { font-size: 11px; line-height: 1.25; }
  .overview-summary .kpi-progress { display: grid; justify-items: center; gap: 3px; width: 100%; }
}

/* V118 Mobile: 44px targets for the row menus (mobile only) */
@media (max-width: 767px) {
  .trip-row-menu summary { width: 44px; height: 44px; }
  .trip-row-menu-items .text-button { min-height: 44px; }
}

/* V119 Mobile: trip photo full height, expense cards + swipe actions (no ⋯), compact amount field, toast at the top (mobile only) */
@media (max-width: 767px) {
  /* trip list card: photo runs the full height of the card on the left */
  .trip-row-link { grid-template-columns: 92px minmax(0, 1fr); column-gap: 0; row-gap: 0; padding: 0; align-items: stretch; }
  .trip-row-link > .trip-row-cover { grid-column: 1; grid-row: 1 / span 2; width: 92px; height: auto; min-height: 100%; border-radius: 18px 0 0 18px; }
  .trip-row-link > .trip-row-cover > .trip-cover, .trip-row-link > .trip-row-cover .trip-row-cover-image { height: 100%; border-radius: 18px 0 0 18px; }
  .trip-row-link > .trip-row-identity { grid-column: 2; grid-row: 1; padding: 12px 40px 4px 14px; }
  .trip-row-link > .trip-row-financials { grid-column: 2; grid-row: 2; padding: 0 14px 12px; }

  /* expenses: separate rounded cards, no ⋯ button — a left swipe opens Edit / Delete */
  .global-mobile-expense-list { gap: 10px; }
  .global-mobile-expense-row { padding: 14px; border: 1px solid rgb(255 255 255 / .12); border-bottom: 1px solid rgb(255 255 255 / .12); border-radius: 18px; background: rgb(18 22 20 / .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .global-mobile-expense-row:last-child { border-bottom: 1px solid rgb(255 255 255 / .12); }
  .global-mobile-expense-primary { grid-template-columns: minmax(0, 1fr) auto; }
  .expense-row-menu { display: none !important; }
  .global-expenses-table-wrap { padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .row-action-sheet { position: fixed; inset: 0; z-index: 400; }
  .row-action-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .55); }
  .row-action-panel { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 8px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: rgb(22 26 25 / .98); box-shadow: 0 -18px 48px rgb(0 0 0 / .45); }
  .row-action-panel .text-button { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 16px; background: rgb(255 255 255 / .08); font-size: 17px; }
  .row-action-panel [data-action="edit-expense"] { color: var(--accent); }

  /* add-expense form: the amount is a normal field */
  .expense-form-modal .form-field:has(#expense-amount) input { height: 48px; font-size: 16px; font-weight: 400; text-align: left; }

  /* notifications appear at the top of the screen */
  .undo-toast { top: calc(env(safe-area-inset-top) + 12px); bottom: auto; animation: toast-in-top .22s ease-out; }
  @keyframes toast-in-top { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
}
@media (max-width: 767px) { .row-action-panel [data-row-actions-cancel] { color: var(--muted); } }
@media (max-width: 767px) { .expense-form-modal .form-actions { display: grid; grid-template-columns: 1fr; gap: 10px; } .expense-form-modal .form-actions .button { width: 100%; } }

/* V120 Mobile: expense filters are a compact bottom sheet (two columns, Reset and Done) instead of six full-width fields (desktop unchanged) */
.filter-sheet-head, .filter-sheet-done, .filter-sheet-backdrop { display: none; }
@media (max-width: 767px) {
  .global-expenses-filters { position: relative; }
  .filter-sheet-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 58; background: rgba(6, 9, 7, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .global-expenses-filters .global-expense-filter-panel { display: none; }
  .global-expenses-filters .global-expense-filter-panel.is-open {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start;
    position: fixed; z-index: 59; left: 0; right: 0; bottom: 0; max-height: min(86dvh, 640px); overflow-y: auto; overscroll-behavior: contain;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); border-bottom: 0;
    background: #151a18; animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1);
  }
  .global-expense-filter-panel.is-open::before { content: ""; grid-column: 1 / -1; justify-self: center; width: 42px; height: 4px; border-radius: 999px; background: rgb(255 255 255 / .22); }
  .global-expense-filter-panel.is-open .filter-sheet-head { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; }
  .global-expense-filter-panel.is-open .filter-sheet-head strong { font-family: var(--serif, inherit); font-size: 20px; }
  .global-expense-filter-panel.is-open .filter-sheet-done { display: inline-flex; grid-column: 1 / -1; justify-content: center; min-height: 48px; margin-top: 4px; }
  /* trip and category get a full row, the other four pair up */
  .global-expense-filter-panel.is-open > label.global-expense-filter:nth-of-type(1),
  .global-expense-filter-panel.is-open > label.global-expense-filter:nth-of-type(2) { grid-column: 1 / -1; }
  .global-expense-filter-panel.is-open > .date-filter-from { grid-column: 1; }
  .global-expense-filter-panel.is-open > .date-filter-to { grid-column: 2; }
  .global-expense-filter-panel.is-open .global-expense-filter, .global-expense-filter-panel.is-open .global-date-filter { min-height: 48px; }
  .global-expense-filter-panel.is-open .cselect-button, .global-expense-filter-panel.is-open .global-date-filter input { padding-left: 14px; padding-right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 767px) { .date-picker-popover:not([hidden]) { background: #151a18; } }
@media (prefers-reduced-motion: reduce) { .global-expense-filter-panel.is-open { animation: none !important; } }

/* V121 Mobile: the bottom bar is fully opaque so page text never shows through it (mobile only) */
@media (max-width: 767px) { .bottom-nav { background: #0e110e !important; -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* V122 Settings forms: custom dropdowns and number fields share one look and one height; the year and budget row aligns at the bottom */
.annual-budget-form { align-items: end; }
.settings-card .cselect-button { background: rgb(21 26 24 / .92); border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); }
.settings-card .form-field input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]), .settings-card .cselect-button { min-height: 52px; }
.settings-card input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.settings-card input[type="number"]::-webkit-inner-spin-button, .settings-card input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* V123 Appearance: the background photo is picked from built-in photos (no uploads) */
.photo-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo-option { display: grid; gap: 8px; padding: 8px; border: 1.5px solid rgb(255 255 255 / .14); border-radius: 16px; background: rgb(255 255 255 / .04); color: inherit; text-align: left; cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.photo-option:hover { background: rgb(255 255 255 / .08); }
.photo-option[aria-checked="true"] { border-color: var(--accent); background: rgb(var(--accent-rgb) / .1); }
.photo-option:disabled { opacity: .6; cursor: default; }
.photo-option-image { display: block; aspect-ratio: 16 / 10; border-radius: 10px; background-size: cover; background-position: center; }
.photo-option-name { font-size: 14px; font-weight: 600; padding: 0 2px 2px; }
.photo-options { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-height: 360px; overflow-y: auto; padding: 2px; }
.bg-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bg-color-custom { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 6px; border: 1.5px solid rgb(255 255 255 / .14); border-radius: 999px; cursor: pointer; font-size: 14px; }
.bg-color-custom input[type="color"] { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }

/* V124 Restore: Leaflet map rules (zoom, popups, count labels, tiles) removed by an earlier CSS cleanup that could not see library-created classes */
.overview-map-container .leaflet-container { background: rgba(10, 18, 22, .48); }
.overview-map-container .leaflet-tile-pane { filter: brightness(0.48) saturate(0.95) contrast(1.05); }
.overview-map-container .leaflet-control-zoom, .overview-map-container .leaflet-control-attribution { border: 1px solid rgba(255, 255, 255, .1); border-radius: 8px; overflow: hidden; background: rgba(16, 19, 16, .78); color: rgba(255, 255, 255, .68); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.overview-map-container .leaflet-control-zoom a { width: 38px; height: 38px; border-color: rgba(255, 255, 255, .1); background: transparent; color: var(--ink); line-height: 36px; }
.overview-map-container .leaflet-control-zoom a:hover, .overview-map-container .leaflet-control-zoom a:focus-visible { background: rgba(255, 255, 255, .09); color: var(--accent); }
.overview-map-container .leaflet-control-zoom a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.overview-map-container .leaflet-control-attribution a { color: var(--accent); }
.overview-map-container .leaflet-popup-content-wrapper, .overview-map-container .leaflet-popup-tip { border: 1px solid rgba(255, 255, 255, .22); background: rgba(24, 28, 27, .86); color: var(--ink); box-shadow: 0 12px 28px rgba(0, 0, 0, .28); }
.overview-map-container .leaflet-popup-content { margin: 10px 12px; }
.overview-map-container .leaflet-popup-close-button { color: var(--muted); }
.atlas-panel .leaflet-top.leaflet-left { margin: 6px 0 0 6px; }
.atlas-panel .leaflet-control-zoom { border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; overflow: hidden; background: rgba(22, 26, 25, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: none; }
.atlas-panel .leaflet-control-zoom a { display: grid; width: 42px; height: 42px; place-items: center; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .1); border-radius: 0; background: transparent; color: var(--ink); line-height: 42px; cursor: pointer; }
.atlas-panel .leaflet-control-zoom a:hover { background: rgba(255, 255, 255, .08); }
.atlas-popup-shell .leaflet-popup-content-wrapper { border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; background: rgba(22, 26, 25, .94); color: var(--ink); box-shadow: 0 18px 40px rgba(0, 0, 0, .4); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.atlas-popup-shell .leaflet-popup-content { margin: 12px; }
.atlas-popup-shell .leaflet-popup-tip { background: rgba(22, 26, 25, .94); }
.atlas-panel .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; }
.atlas-panel .leaflet-control-zoom, .atlas-popup-shell .leaflet-popup-content-wrapper { border: 1px solid var(--glass-border); background: var(--glass-sheen), var(--glass-fill-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), 0 8px 24px rgba(0, 0, 0, .3); }
.atlas-popup-shell .leaflet-popup-tip { background: rgba(28, 33, 31, .9); }
.overview-map-container .leaflet-tile-pane { filter: brightness(.82) saturate(1.1) contrast(1.05); }
.atlas-popup-shell .leaflet-popup-content-wrapper { background: var(--glass-sheen), rgba(34, 44, 37, .5); }
.atlas-popup-shell .leaflet-popup-tip { background: rgba(40, 52, 44, .7); }
.overview-map-container .leaflet-tile-pane { filter: brightness(.6) saturate(1.05) contrast(1.08) hue-rotate(-4deg); }
.atlas-panel .leaflet-control-zoom { background: var(--glass-sheen), rgba(24, 32, 27, .6); }
.atlas-panel .leaflet-control-zoom { background: var(--glass-sheen), rgba(24, 32, 27, .42); }
.atlas-popup-shell .leaflet-popup-content-wrapper { background: var(--glass-sheen), rgba(30, 40, 33, .5); }
.overview-map-container .leaflet-tile-pane { filter: brightness(.62) saturate(1.0) contrast(1.05); }
.atlas-panel .leaflet-control-zoom { background: var(--glass-sheen), rgba(14, 19, 16, .5); }
.atlas-popup-shell .leaflet-popup-content-wrapper { background: var(--glass-sheen), rgba(14, 19, 16, .6); }
.atlas-panel .leaflet-control-zoom { background: var(--glass-sheen), rgb(14 19 16 / min(.9, calc(var(--glass-alpha, .34) + .16))); }
.atlas-popup-shell .leaflet-popup-content-wrapper { background: var(--glass-sheen), rgb(14 19 16 / min(.92, calc(var(--glass-alpha, .34) + .26))); }
.leaflet-tooltip.atlas-count { background: transparent; border: 0; box-shadow: none; padding: 0; color: #101310; font-weight: 700; font-size: 11px; }
.leaflet-tooltip.atlas-count::before { display: none; }
.leaflet-container a.atlas-popup-go, .leaflet-container a.atlas-popup-go .atlas-popup-go-icon { color: var(--accent); stroke: var(--accent); }

/* V125 Readability on bright backgrounds, compact photo grid, compact selects in forms (desktop) */
#page-title, #page-subtitle, .page-eyebrow, .eyebrow { text-shadow: 0 1px 14px rgb(0 0 0 / .55), 0 0 2px rgb(0 0 0 / .4); }
.photo-options { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; max-height: none; overflow: visible; padding: 0; }
.photo-option { gap: 6px; padding: 6px; border-radius: 14px; }
.photo-option-name { font-size: 12.5px; line-height: 1.2; }
.appearance-hint { margin: 0; color: var(--muted); font-size: 12.5px; }
@media (min-width: 768px) {
  .trip-form-modal .cselect-button, .expense-form-modal .cselect-button { min-height: 40px; padding-left: 12px; font-size: 14px; }
}
.appearance-preview::after { background: linear-gradient(180deg, rgb(10 14 13 / calc(var(--preview-overlay, .46) * .5)), rgb(10 14 13 / var(--preview-overlay, .46))); }
#page-subtitle { color: rgb(255 255 255 / .86); }

/* V126 Page header stays readable on any background: accent eyebrow, brighter subtitle, stronger shadow */
.page-header-main::before { color: var(--accent) !important; font-weight: 700; text-shadow: 0 1px 10px rgb(0 0 0 / .7), 0 0 2px rgb(0 0 0 / .5); }
#page-title, #page-subtitle { text-shadow: 0 1px 14px rgb(0 0 0 / .7), 0 0 3px rgb(0 0 0 / .45); }
#page-subtitle { color: rgb(255 255 255 / .94); }
.page-header-main::before { color: color-mix(in srgb, var(--accent) 50%, white) !important; }

/* V127 Sidebar account card: the full e-mail is always shown (wraps instead of being cut with an ellipsis), the arrow no longer steals width */
.sidebar .account-card { gap: 10px; padding: 10px 12px; }
.sidebar .account-card .account-arrow { display: none; }
.sidebar .account-meta { min-width: 0; flex: 1 1 auto; }
.sidebar .account-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .account-meta small { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.sidebar .account-card .account-avatar { width: 36px; height: 36px; flex: none; }
/* V128 Sidebar: the bottom gap matches the top one (desktop) */
@media (min-width: 768px) { .sidebar { padding-bottom: 42px; } }

/* V129 Text fields: the same rounded, softly bordered look as the dropdowns, with a clear hover and accent focus */
.form-field input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
.form-field textarea {
  border: 1px solid var(--glass-border, rgb(255 255 255 / .14));
  border-radius: 12px;
  padding-left: 14px;
  background: rgb(21 26 24 / .72);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.form-field textarea { padding-top: 10px; padding-bottom: 10px; }
.form-field input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):hover:not(:focus),
.form-field textarea:hover:not(:focus) { border-color: rgb(255 255 255 / .26); background: rgb(21 26 24 / .86); }
.form-field input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):focus,
.form-field textarea:focus { border-color: rgb(var(--accent-rgb) / .7); background: rgb(21 26 24 / .92); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .16); }
.form-field input::placeholder, .form-field textarea::placeholder { color: rgb(255 255 255 / .42); }

/* V130 Appearance: ready themes, photo categories, one Background tab with the accent under the photos */
.theme-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.theme-set { position: relative; display: grid; padding: 0; overflow: hidden; border: 1.5px solid rgb(255 255 255 / .14); border-radius: 14px; background: rgb(255 255 255 / .04); color: inherit; text-align: left; cursor: pointer; transition: border-color .18s ease, transform .18s ease; }
.theme-set:hover { border-color: rgb(255 255 255 / .3); transform: translateY(-1px); }
.theme-set[aria-pressed="true"] { border-color: var(--set-accent, var(--accent)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--set-accent, var(--accent)) 30%, transparent); }
.theme-set-image { display: block; aspect-ratio: 16 / 9; background-size: cover; background-position: center; }
.theme-set-name { display: flex; align-items: center; gap: 7px; padding: 7px 9px; font-size: 12.5px; font-weight: 600; background: rgb(14 19 16 / .75); }
.theme-set-name i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--set-accent); }
.photo-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-cat { min-height: 32px; padding: 0 12px; border: 1px solid rgb(255 255 255 / .14); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.photo-cat[aria-selected="true"] { border-color: var(--accent); background: rgb(var(--accent-rgb) / .14); color: var(--ink); }
.photos-toggle { justify-self: start; margin-top: 4px; }
@media (hover: none) and (pointer: coarse) { .photo-cat { min-height: 40px; } }

/* V131 Segmented control: equal columns for any number of tabs, centred labels, comfortable height */
.segmented { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
.segmented-item { display: grid; place-items: center; min-height: 40px; padding: 0 12px; text-align: center; }

/* V132 No layout jump: space for the scrollbar is always reserved; photo grid keeps two rows of height whatever the category */
@media (min-width: 768px) { html { scrollbar-gutter: stable; } }
.photo-options { min-height: 222px; align-content: start; }

/* V133 The page scrolls inside .main-content, so the scrollbar space is reserved there (not on html): sections no longer change width when the scrollbar appears */
.main-content { scrollbar-gutter: stable; }

/* V134 Trips: tile (grid) view next to the list view (screens from 768 px; the phone keeps the list) */
@media (min-width: 768px) {
  .trip-rows.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 14px; }
  .trip-rows.is-grid .trip-row { position: relative; display: block; overflow: hidden; padding: 0; border: 1px solid var(--glass-border, rgb(255 255 255 / .14)); border-radius: 18px; background: var(--glass-fill, rgb(255 255 255 / .06)); transition: transform .18s ease, border-color .18s ease; }
  .trip-rows.is-grid .trip-row:hover { transform: translateY(-2px); border-color: rgb(255 255 255 / .3); }
  .trip-rows.is-grid .trip-row-link { display: grid; grid-template-columns: 1fr; gap: 0; padding: 0; }
  .trip-rows.is-grid .trip-row-cover { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 0; border-radius: 0; overflow: hidden; }
  .trip-rows.is-grid .trip-row-cover > *, .trip-rows.is-grid .trip-row-cover img { width: 100%; height: 100%; object-fit: cover; }
  .trip-rows.is-grid .trip-row-identity { padding: 12px 14px 4px; }
  .trip-rows.is-grid .trip-row-financials { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 8px; padding: 8px 14px 14px; }
  .trip-rows.is-grid .trip-row-progress { grid-column: 1 / -1; }
  .trip-rows.is-grid .trip-row-menu { position: absolute; top: 10px; right: 10px; z-index: 2; }
  .trip-rows.is-grid .trip-row-menu summary { background: rgb(14 19 16 / .65); border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
}

/* V135 Trip tiles: three equal columns that always fit the card (the numbers no longer run past the edge) */
@media (min-width: 768px) {
  .trip-rows.is-grid .trip-row-financials { grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: stretch; gap: 0; padding: 10px 6px 14px; }
  .trip-rows.is-grid .trip-row-financials .trip-stat { min-width: 0; padding: 4px 10px; }
  .trip-rows.is-grid .trip-row-financials .trip-stat:first-child { padding-left: 8px; }
  .trip-rows.is-grid .trip-row-financials .trip-stat strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
  .trip-rows.is-grid .trip-row-financials .trip-stat small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
  .trip-rows.is-grid .trip-row-progress { margin: 6px 8px 0; }
}

/* V136 Trip tiles: no divider line under the year heading (it only belongs to the list) */
@media (min-width: 768px) { .trip-year-group:has(.trip-rows.is-grid) .trip-year-heading { border-bottom: 0; margin-bottom: 4px; } }
@media (min-width: 768px) {
  .trip-rows.is-grid .trip-row-financials .trip-stat { padding: 4px 6px; }
  .trip-rows.is-grid .trip-row-financials .trip-stat:first-child { padding-left: 6px; }
  .trip-rows.is-grid .trip-row-financials .trip-stat strong { font-size: 14px; letter-spacing: -.01em; }
}

/* V137 Loading screen: a glass card over the account's own theme, a little plane flying between two stops. ?loading=hold|slow|error keeps it on screen for design checks */
.app-loading-state { display: grid; place-items: center; background: rgb(8 12 10 / .42); -webkit-backdrop-filter: blur(20px) saturate(1.1); backdrop-filter: blur(20px) saturate(1.1); }
.loader { display: block; padding: 0; }
.loader-card { display: grid; justify-items: center; gap: 24px; width: min(380px, calc(100vw - 40px)); padding: 36px 32px 30px; border: 1px solid var(--glass-border, rgb(255 255 255 / .16)); border-radius: 28px; background: linear-gradient(180deg, rgb(255 255 255 / .09), rgb(255 255 255 / .02)), rgb(14 19 16 / .55); box-shadow: 0 30px 80px rgb(0 0 0 / .45), inset 0 1px 0 rgb(255 255 255 / .12); animation: loader-in .55s cubic-bezier(.2, .8, .2, 1) both; }
.loader-card .loader-logo { width: min(190px, 56vw); animation: none; opacity: .95; }
.loader-card .loader-text { margin: 0; color: rgb(255 255 255 / .82); }
.loader-card .loader-slow { margin: -8px 0 0; text-align: center; }
.loader-error { display: none; justify-items: center; gap: 8px; text-align: center; }
.loader-error strong { font-size: 17px; color: #fff; }
.loader-error span { color: rgb(255 255 255 / .7); font-size: 14px; line-height: 1.4; }
.loader-retry { display: inline-grid; place-items: center; min-height: 44px; margin-top: 6px; padding: 0 22px; border-radius: 12px; background: var(--accent, #b7e47b); color: #10150f; font-weight: 700; text-decoration: none; }
.app-loading-state.is-slow .loader-slow { opacity: .9; pointer-events: auto; animation: none; }
.app-loading-state.is-error .loader-compass, .app-loading-state.is-error .loader-text, .app-loading-state.is-error .loader-slow { display: none; }
.app-loading-state.is-error .loader-error { display: grid; }
@keyframes loader-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .loader-card { animation: none; }
}
.loader-card { background: linear-gradient(180deg, rgb(255 255 255 / .1), rgb(255 255 255 / .03)), rgb(12 16 14 / .72); border-color: rgb(255 255 255 / .22); }
.loader-card .loader-logo { width: min(230px, 62vw); opacity: 1; }
.loader-card .loader-text { font-size: 15px; color: rgb(255 255 255 / .92); }
.loader-slow a { color: var(--accent, #b7e47b); }

/* V138 Loading animation: a compass whose needle swings and settles */
.app-loading-state.is-error .loader-compass { display: none; }
.loader-compass { width: 68px; height: 68px; }
.c-ring { fill: none; stroke: rgb(255 255 255 / .2); stroke-width: 2; }
.c-ticks path { stroke: rgb(255 255 255 / .35); stroke-width: 2; stroke-linecap: round; }
.c-needle { transform-origin: 32px 32px; animation: la-needle 2.8s cubic-bezier(.4, 0, .2, 1) infinite; }
.c-north { fill: var(--accent, #b7e47b); filter: drop-shadow(0 0 5px rgb(var(--accent-rgb, 183 228 123) / .7)); }
.c-south { fill: rgb(255 255 255 / .4); }
.c-pivot { fill: #0d110e; stroke: rgb(255 255 255 / .6); stroke-width: 1.5; }
@keyframes la-needle { 0% { transform: rotate(-70deg); } 30% { transform: rotate(70deg); } 48% { transform: rotate(-30deg); } 64% { transform: rotate(18deg); } 78%, 100% { transform: rotate(0); } }

@media (prefers-reduced-motion: reduce) { .c-needle { animation: none; } }

/* V139 Sign-up: first and last name side by side */
.auth-name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-name-row .form-field { min-width: 0; }

/* V140 Sign-in, sign-up and reset screens: the card sits exactly in the middle of the window, not near the top */
.app-shell.is-auth-view .main-content { margin: 0; padding: 0; }
.app-shell.is-auth-view .content-column, .app-shell.is-auth-view #view-content { display: grid; min-height: 100vh; min-height: 100dvh; margin: 0; padding: 0; }
.app-shell.is-auth-view .auth-page { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px 16px; }

/* V141 Empty-state icons instead of illustrations, city suggestions never clipped, expense dialog without an inner scroll, selection bar away from the date, calmer account card, glass dialogs */
.empty-art { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto; border-radius: 28px; border: 1px solid rgb(var(--accent-rgb) / .35); background: radial-gradient(circle at 30% 25%, rgb(var(--accent-rgb) / .28), rgb(var(--accent-rgb) / .08)); box-shadow: 0 0 0 8px rgb(var(--accent-rgb) / .06); color: var(--accent); }
.empty-art-icon { width: 38px; height: 38px; stroke-width: 1.5; }
.overview-empty-state .empty-art { width: 68px; height: 68px; border-radius: 22px; flex: none; }
.overview-empty-state .empty-art-icon { width: 30px; height: 30px; }

.trip-form-modal .place-list { position: static; margin-top: 6px; max-height: 220px; }

@media (min-width: 768px) {
  .expense-form-modal { width: min(660px, calc(100vw - 32px)); max-width: none; max-height: none; overflow: visible; }
  .expense-form-modal > form { overflow: visible; }
  .expense-form-modal .expense-form-fields { overflow: visible; padding-right: 0; }
  .global-expense-table th:first-child, .global-expense-table td:first-child, .trip-table th:first-child, .trip-table td:first-child { padding-left: 20px; }
}

.sidebar .account-card { background: rgb(255 255 255 / .04); border-color: rgb(255 255 255 / .09); box-shadow: none; }
.sidebar .account-card .account-avatar { background: rgb(255 255 255 / .1); color: rgb(255 255 255 / .85); border-color: transparent; }
.sidebar .account-card .account-meta strong { font-size: 14px; font-weight: 600; }
.sidebar .account-card .account-meta small { font-size: 12px; opacity: .6; overflow-wrap: anywhere; }
.sidebar-account .text-button { color: var(--muted); font-size: 13px; }
.sidebar-account .text-button:hover { color: var(--ink); }

.app-dialog, .expense-form-modal, .trip-form-modal { background: color-mix(in srgb, #14181a 74%, transparent); -webkit-backdrop-filter: blur(var(--glass-blur-px, 22px)); backdrop-filter: blur(var(--glass-blur-px, 22px)); box-shadow: var(--glass-edge, inset 0 1px 0 rgb(255 255 255 / .08)), 0 24px 60px rgb(0 0 0 / .5); }
.app-choice-option { background: rgb(255 255 255 / .05); border-color: rgb(255 255 255 / .12); }

@media (max-width: 767px) {
  /* account and Log out come after Expenses and Settings */
  .app-shell.is-mobile-nav-open .sidebar-account { order: 1; margin: 10px 0 0; padding-top: 12px; border-top: 1px solid rgb(255 255 255 / .08); }
  .app-shell.is-mobile-nav-open .sidebar .account-avatar { width: 40px; height: 40px; }
  .expense-form-modal, .trip-form-modal { background: rgb(22 26 25 / .97); }
}
.expense-form-modal .form-field:has(#expense-amount), .expense-form-modal #expense-amount { width: 100%; max-width: none; }

/* V142 Danger zone in Settings → Account */
.danger-zone { border-color: rgb(231 125 130 / .38); }
.danger-zone .settings-card-head h2 { color: #f0a0a4; }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid rgb(255 255 255 / .08); }
.danger-row:first-of-type { border-top: 0; }
.danger-row strong { display: block; font-weight: 600; }
.danger-row p { margin: 4px 0 0; color: var(--muted, rgb(255 255 255 / .62)); font-size: .9rem; }
.danger-zone .button-danger { flex: none; min-height: 44px; min-width: 150px; background: rgb(231 125 130 / .16); color: #f4b3b6; border: 1px solid rgb(231 125 130 / .5); }
.danger-zone .button-danger:hover:not(:disabled) { background: rgb(231 125 130 / .28); }
@media (max-width: 767px) {
  .danger-row { flex-direction: column; align-items: stretch; }
  .danger-zone .button-danger { width: 100%; }
}

/* V143 The trip and expense forms hold a fixed-position calendar: a backdrop-filter on the form would clip it (it becomes the containing block), so these two stay solid-glass without the blur */
.expense-form-modal, .trip-form-modal { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgb(20 24 26 / .94); }

/* V144 Empty-state illustrations (grey line art on a transparent background); the grid for the overview cards comes from the older `.overview-empty-state` rules */
.empty-illustration { display: block; width: min(220px, 58%); height: auto; margin: 0 auto; object-fit: contain; opacity: .92; filter: drop-shadow(0 10px 22px rgb(0 0 0 / .35)); }
.overview-empty-state .empty-illustration { width: min(100%, 190px); max-height: 145px; }
@media (max-width: 767px) {
  .page-empty-illustration .empty-illustration { width: min(190px, 56%); }
  .overview-empty-state .empty-illustration { width: min(100%, 170px); max-height: 120px; }
}

/* V145 Expense filters: the date cells keep the same single box (border + glass fill) as the list filters; the date field inside is flat, so there is no box inside a box and the colour matches the neighbours */
.global-expenses-filters .global-expense-filter.global-date-filter { padding: 0; background: var(--glass-fill); border: 1px solid var(--glass-border); }
.global-expenses-filters .global-expense-filter.global-date-filter .form-field.date-picker { width: 100%; margin: 0; }
.global-expenses-filters .global-expense-filter.global-date-filter .date-picker-input { width: 100%; min-height: 50px; border: 0 !important; background: transparent !important; box-shadow: none !important; }

/* V146 Edit/New trip on desktop: the whole dialog scrolls (the actions stay at the bottom) instead of the field block shrinking and hiding the dates behind an inner scroll */
@media (min-width: 768px) {
  .trip-form-modal { overflow-y: auto; }
  .trip-form-modal form { flex: 0 0 auto; min-height: auto; overflow: visible; }
  .trip-form-modal .trip-form-fields { flex: 0 0 auto; overflow: visible; padding-right: 0; }
  .trip-form-modal .form-actions { position: sticky; bottom: 0; z-index: 2; margin-top: 8px; padding: 12px 0 2px; background: rgb(20 24 26 / .96); }
}

/* V147 Exchange rate input looks like the other fields (same height, fill, border, radius as the currency select); width unchanged */
.trip-form-modal .rate-input input#trip-exchangeRate {
  min-height: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgb(255 255 255 / .1);
  background: rgb(255 255 255 / .04);
  box-shadow: none;
  font-size: 14px;
}
.trip-form-modal .rate-input input#trip-exchangeRate:focus { border-color: rgb(255 255 255 / .22); }

/* V148 Trip categories: calm toggle chips, no native checkbox; the color dot carries the state */
.trip-form-modal .trip-category-options { gap: 8px; }
.trip-form-modal .trip-category-option { position: relative; gap: 9px; padding: 0 16px 0 12px; min-height: 40px; border-radius: 12px; border: 1px solid rgb(255 255 255 / .1); background: rgb(255 255 255 / .04); color: rgb(245 245 241 / .55); font-size: 14px; transition: background .15s, border-color .15s, color .15s; }
.trip-form-modal .trip-category-option input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.trip-form-modal .trip-category-option .category-dot { width: 10px; height: 10px; opacity: .45; box-shadow: none; transition: opacity .15s, box-shadow .15s; }
.trip-form-modal .trip-category-option:has(input:checked) { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .28); color: var(--text, #f5f5f1); }
.trip-form-modal .trip-category-option:has(input:checked) .category-dot { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 28%, transparent); }
.trip-form-modal .trip-category-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* V149 Trip/expense forms get the real glass look back: the blur lives on a pseudo-element, so it does not become the containing block of the fixed calendar popover */
@media (min-width: 768px) {
  .expense-form-modal, .trip-form-modal { position: relative; isolation: isolate; background: transparent; border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow), var(--glass-edge); }
  .expense-form-modal::before, .trip-form-modal::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; background: var(--glass-sheen), var(--glass-fill-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
}
@media (min-width: 768px) {
  .trip-form-modal .form-actions { background: transparent; }
}

/* V150 Cover image field: a dashed drop area when empty, one tidy card with thumbnail and actions when set */
.trip-cover-field .cover-upload-control { display: block; }
.cover-dropzone { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px dashed rgb(255 255 255 / .22); border-radius: 12px; background: rgb(255 255 255 / .03); color: var(--muted); cursor: pointer; transition: background .15s, border-color .15s; }
.cover-dropzone:hover, .cover-file-input:focus-visible + .cover-dropzone { background: rgb(255 255 255 / .07); border-color: rgb(var(--accent-rgb) / .6); }
.cover-dropzone-icon { flex: none; width: 40px; height: 40px; padding: 9px; border-radius: 10px; background: rgb(255 255 255 / .06); color: var(--accent); }
.cover-dropzone span { display: grid; gap: 2px; }
.cover-dropzone strong { color: var(--ink); font-size: 14px; font-weight: 650; }
.cover-dropzone small, .cover-card-info small { color: var(--muted); font-size: 12.5px; }
.cover-card { display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px solid rgb(255 255 255 / .1); border-radius: 12px; background: rgb(255 255 255 / .04); }
.cover-card-thumb { flex: none; width: 88px; height: 60px; border-radius: 8px; object-fit: cover; border: 1px solid rgb(255 255 255 / .12); }
.cover-card-info { display: grid; gap: 2px; min-width: 0; flex: 1; }
.cover-card-info strong { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cover-card-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.cover-card-actions .button { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.cover-card-actions .cover-adjust-button { margin-left: 0; }
.cover-card-actions .cover-remove { margin: 0; color: var(--muted); font-size: 13.5px; }
.cover-card-actions .cover-remove:hover { color: #ff9d94; }
@media (max-width: 767px) {
  .cover-card { flex-wrap: wrap; }
  .cover-card-actions { width: 100%; }
  .cover-card-actions .cover-remove { margin-left: auto; }
}

/* V151 Sticky form buttons: content fades out beneath them instead of colliding with them */
@media (min-width: 768px) {
  .trip-form-modal .form-actions { margin-top: 0; padding: 34px 0 4px; background: linear-gradient(to top, rgb(14 18 16 / .96) 0%, rgb(14 18 16 / .9) 45%, rgb(14 18 16 / 0) 100%); pointer-events: none; }
  .trip-form-modal .form-actions > * { pointer-events: auto; }
}

/* V152 Cover image set: no extra plate, just a simple row (thumbnail, name, quiet text actions) */
.cover-card { padding: 0; border: 0; border-radius: 0; background: transparent; gap: 14px; }
.cover-card-thumb { width: 72px; height: 50px; }
.cover-card-actions { gap: 4px; align-items: center; }
.cover-card-actions .button, .cover-card-actions .cover-remove { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.cover-card-actions .button:hover, .cover-card-actions .cover-remove:hover { background: rgb(255 255 255 / .07); color: var(--ink); }
.cover-card-actions .cover-remove:hover { color: #ff9d94; }

/* V153 No hairline above the sticky buttons; a taller, firmer fade so nothing shows through behind them */
@media (min-width: 768px) {
  .trip-form-modal .form-actions { border-top: 0; padding-top: 44px; background: linear-gradient(to top, rgb(14 18 16 / 1) 0%, rgb(14 18 16 / 1) 52%, rgb(14 18 16 / 0) 100%); }
}

/* V154 Trip form buttons sit in normal flow after the last field (no sticky, so they never cover the content) */
@media (min-width: 768px) {
  .trip-form-modal form > .form-actions { position: static; margin-top: 24px; padding: 0; background: none; pointer-events: auto; }
}

/* V155 Every scrollbar follows the page accent (thin, translucent track-less thumb) */
* { scrollbar-width: thin; scrollbar-color: rgb(var(--accent-rgb) / .55) transparent; }
@supports not (scrollbar-color: auto) {
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: rgb(var(--accent-rgb) / .55) padding-box; }
  *::-webkit-scrollbar-thumb:hover { background: rgb(var(--accent-rgb) / .85) padding-box; }
}

/* V156 Desktop trip form: the modal itself no longer scrolls (so its glass layer covers all of it); an inner wrapper scrolls the heading and fields together */
@media (min-width: 768px) {
  .trip-form-modal { overflow: hidden; }
  .trip-form-scroll { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}
@media (max-width: 767px) { .trip-form-scroll { display: contents; } }

/* V157 Trip form buttons: normal flow, no background plate (the form now sits inside .trip-form-scroll, so the old "> form >" selectors no longer match) */
@media (min-width: 768px) {
  .trip-form-modal .trip-form > .form-actions { position: static; margin-top: 24px; padding: 0; border: 0; box-shadow: none; background: none !important; background-image: none !important; pointer-events: auto; }
}

/* V158 Expense form: even fields (Amount is as wide as the others when there is no currency picker) and no inner plate inside the glass modal */
.expense-form-modal .expense-amount-group:not(:has(> :nth-child(2))) { grid-template-columns: minmax(0, 1fr); }
.expense-form-modal .expense-form, .trip-detail .expense-form-modal .expense-form { border: 0; border-radius: 0; background: transparent; box-shadow: none; }

/* V159 Expense split block: people as toggle chips (like trip categories), custom amounts as a switch, labels like the other fields */
.expense-form-modal .expense-split [data-split-shared] { display: grid; gap: 16px; margin-top: 16px; }
.expense-form-modal .split-label { margin: 0 0 -8px; font-size: 13px; font-weight: 650; opacity: 1; color: var(--muted); }
.expense-form-modal .split-people { display: flex; flex-wrap: wrap; gap: 8px; }
.expense-form-modal .split-person { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid rgb(255 255 255 / .1); background: rgb(255 255 255 / .04); color: rgb(245 245 241 / .55); font-size: 14px; transition: background .15s, border-color .15s, color .15s; }
.expense-form-modal .split-person input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.expense-form-modal .split-person:has(input:checked) { background: rgb(var(--accent-rgb) / .16); border-color: rgb(var(--accent-rgb) / .6); color: var(--ink); }
.expense-form-modal .split-person:has(input:focus-visible), .expense-form-modal .split-custom:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.expense-form-modal .split-custom { position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 36px; width: fit-content; color: var(--muted); font-size: 14px; cursor: pointer; }
.expense-form-modal .split-custom input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.expense-form-modal .split-custom::before { content: ""; flex: none; width: 36px; height: 20px; border-radius: 999px; background: rgb(255 255 255 / .14); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12); transition: background .15s; }
.expense-form-modal .split-custom::after { content: ""; position: absolute; left: 3px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: #fff; transition: transform .15s; }
.expense-form-modal .split-custom:has(input:checked)::before { background: rgb(var(--accent-rgb) / .8); }
.expense-form-modal .split-custom:has(input:checked)::after { transform: translateX(16px); }
.expense-form-modal .split-custom:has(input:checked) { color: var(--ink); }
.expense-form-modal .split-amount { font-size: 13px; font-weight: 650; color: var(--muted); }

/* V160 Expense form on desktop: limited to the screen height; the form scrolls inside (heading stays), buttons follow the last field */
@media (min-width: 768px) {
  .expense-form-modal { max-height: calc(100dvh - 32px); overflow: hidden; }
  .expense-form-modal > form { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}
@media (min-width: 768px) {
  .expense-form-modal .expense-form > .form-actions { position: static; margin-top: 24px; padding: 14px 0 0; background: none !important; }
}
@media (min-width: 768px) {
  .expense-form-modal .expense-form { display: block; }
  .expense-form-modal .expense-form-fields { flex: 0 0 auto; min-height: auto; overflow: visible; }
}

/* V161 Balances: avatar rows with a signed amount, and settle-up steps as "A → B  €10  [I paid]" */
.balances-grid .balance-list { gap: 6px; }
.balance-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgb(255 255 255 / .04); border: 1px solid rgb(255 255 255 / .06); }
.bal-avatar { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgb(var(--accent-rgb) / .16); color: var(--accent); font-style: normal; font-size: 14px; font-weight: 700; }
.bal-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.bal-name small { color: var(--muted); }
.bal-amount { display: grid; justify-items: end; line-height: 1.15; }
.bal-amount strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.bal-amount small { color: var(--muted); font-size: 12px; }
.balance-row.is-plus .bal-amount strong { color: #6FBF8A; }
.balance-row.is-minus .bal-amount strong { color: #E8A06A; }
.balance-row.is-even .bal-amount strong { color: var(--muted); }
.settle-list .settle-step { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: rgb(255 255 255 / .04); border: 1px solid rgb(255 255 255 / .06); }
.settle-flow { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.settle-flow .bal-avatar { width: 30px; height: 30px; font-size: 13px; }
.settle-text { display: grid; gap: 2px; min-width: 0; font-size: 14px; color: var(--muted); }
.settle-text small { color: var(--muted); }
.settle-text strong { color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.settle-action { display: inline-flex; align-items: center; gap: 8px; }
.settle-action .settle-pay { width: auto; min-height: 38px; padding: 0 18px; }
.settle-action .settle-wait { font-size: 12.5px; }
@media (max-width: 767px) {
  .settle-list .settle-step { grid-template-columns: auto minmax(0, 1fr); }
  .settle-action { grid-column: 1 / -1; }
  .settle-action .settle-pay { width: 100%; min-height: 48px; }
}

/* V162 Balances: no plates on top of plates; rows are flat with hairline dividers, only the "waiting for confirmation" box keeps its accent outline */
.trip-insights .balance-list, .trip-insights .settle-list { gap: 0; }
.balance-row, .settle-list .settle-step, .settle-list .settle-incoming, .settle-list .settle-history { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 12px 2px; border-bottom: 1px solid rgb(255 255 255 / .08); }
.balance-list > :last-child, .settle-list > :last-child { border-bottom: 0; }
.settle-incoming-box { background: transparent; }
.settle-incoming-box .settle-list .settle-incoming { padding-top: 8px; padding-bottom: 4px; }

/* V163 Very long names never break the layout: wrap anywhere, keep columns shrinkable, clamp the title */
.trip-row-link { min-width: 0; }
.trip-row-identity { min-width: 0; }
.trip-row-identity > strong, .trip-row-identity > span { min-width: 0; overflow-wrap: anywhere; word-break: normal; }
.trip-row-identity > strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trip-row-identity > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trip-detail-hero-content, .trip-detail-identity, .trip-detail-title-row { min-width: 0; max-width: 100%; }
.trip-detail-title-row h2, .trip-country { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.trip-detail-title-row h2 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.trip-detail, .trip-hero { min-width: 0; max-width: 100%; }
.trip-detail-title-row { flex-wrap: wrap; }
.account-meta strong, .account-meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* V164 Huge numbers stay inside their cell (summary under the trip title) */
.trip-summary > div, .trip-summary-copy { min-width: 0; }
.trip-summary-copy strong { overflow-wrap: anywhere; }
.cselect-button { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }

/* V165 The trip header grows with its content (long names, tall summaries) instead of cutting the figures off; the title keeps at most two lines */
@media (min-width: 768px) {
  .trip-detail .trip-hero { height: auto !important; min-height: 220px !important; }
  .trip-detail .trip-hero > .trip-detail-cover, .trip-detail .trip-detail-hero-content { height: auto !important; min-height: 220px !important; }
  .trip-detail .trip-detail-cover .trip-cover-image, .trip-detail .trip-detail-cover .trip-cover-placeholder, .trip-detail .trip-detail-cover img { height: 100%; min-height: 220px; }
  .trip-detail-title-row h2 { -webkit-line-clamp: 2; }
}

/* V166 Summary figures never spill into the next cell: one line, cut with an ellipsis (the full value is in the list below) */
.trip-summary-copy { overflow: hidden; }
.trip-summary-copy strong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }

/* V167 Expenses table: trip name and country are limited to one line each (ellipsis); full text in the tooltip */
.global-expense-table td.global-expense-trip { max-width: 0; overflow: hidden; }
.global-expense-table td.global-expense-trip .trip-link { display: block; min-width: 0; }
.global-expense-table td.global-expense-trip .trip-link strong,
.global-expense-table td.global-expense-trip .trip-link span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }

/* V168 Trip list row figures stay in their cell (ellipsis) */
.trip-row-financials .trip-stat { min-width: 0; overflow: hidden; }
.trip-row-financials .trip-stat strong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* V169 Terratrips stacked logo is taller than the old wide one: smaller everywhere */
.brand-image { width: min(100%, 132px); }
.auth-brand img { width: min(100%, 132px); }
.loader-logo, .loader-card .loader-logo { width: min(150px, 44vw); }
@media (max-width: 767px) {
  .mobile-header .brand-image { width: auto; height: 52px; }
}

/* V170 Mobile header is frosted glass: the photo and scrolling content show through, blurred */
@media (max-width: 767px) {
  .mobile-header { background: rgb(16 19 16 / .38) !important; -webkit-backdrop-filter: blur(22px) saturate(1.2) !important; backdrop-filter: blur(22px) saturate(1.2) !important; border-bottom: 1px solid rgb(255 255 255 / .12); }
}

/* V171 Sign-in / sign-up logo is centred in the card */
.auth-brand { display: flex; justify-content: center; align-items: center; width: 100%; }
.auth-brand img { margin-inline: auto; }

/* V172 Auth headings (Welcome / Create your account …) are centred under the logo */
.auth-heading { text-align: center; }
.auth-heading h1, .auth-heading p { text-align: center; margin-inline: auto; }

/* V173 Mobile polish: chart tooltip on tap, equal expense cards, aligned form fields and tabs, crisper Today card */
@media (max-width: 767px) {
  .monthly-spending-column.is-active .monthly-spending-tooltip { opacity: 1; transform: translate(-50%, 0); z-index: 5; }
  .monthly-spending-column { -webkit-tap-highlight-color: transparent; cursor: pointer; }
  .global-mobile-expense-row { min-height: 108px; display: grid; align-content: space-between; box-sizing: border-box; }
  .expense-form-modal .expense-form-fields > *, .expense-form-modal .expense-form-fields label { min-width: 0; box-sizing: border-box; }
  .expense-form-modal .expense-form-fields input, .expense-form-modal .expense-form-fields select, .expense-form-modal .expense-form-fields textarea { width: 100%; box-sizing: border-box; min-height: 48px; margin-inline: 0; }
  .trip-tabs { padding-inline: 6px; box-sizing: border-box; scroll-padding-inline: 6px; }
  .mobile-today { background: var(--glass-sheen, none), rgba(20, 26, 22, .74); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
}

/* V174 Swipe rows (iOS style), chart tooltip on tap, aligned KPI tiles */
.swipe-bg { position: absolute; z-index: 0; display: flex; align-items: center; justify-content: space-between; box-sizing: border-box; padding: 0 22px; border-radius: 18px; color: #fff; font-weight: 650; font-size: 15px; pointer-events: none; overflow: hidden; }
.swipe-bg[data-side="edit"] { background: #3b82c4; }
.swipe-bg[data-side="delete"] { background: #d4483f; }
.swipe-bg[data-side="edit"] .swipe-bg-delete, .swipe-bg[data-side="delete"] .swipe-bg-edit { visibility: hidden; }
.swipe-bg.is-armed { filter: saturate(1.25) brightness(1.05); }
.is-swiping { position: relative; z-index: 1; touch-action: pan-y; background: rgb(24 28 26) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; will-change: transform; }
@media (max-width: 767px) {
  .global-mobile-expense-row, .trip-row { touch-action: pan-y; }
  .monthly-spending-column.is-active .monthly-spending-tooltip { display: grid; opacity: 1; transform: translate(-50%, 0); z-index: 6; }
  .monthly-spending-column:nth-child(-n+3) .monthly-spending-tooltip { left: 0; transform: translate(0, 0); }
  .monthly-spending-column:nth-last-child(-n+3) .monthly-spending-tooltip { left: auto; right: 0; transform: translate(0, 0); }
  .overview-summary.kpi-row .kpi-card { text-align: center; }
  .overview-summary .kpi-body { display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; width: 100%; }
  .overview-summary .kpi-body > strong { line-height: 1.1; }
  .overview-summary .kpi-label, .overview-summary .kpi-sub { display: block; width: 100%; line-height: 1.3; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .overview-summary .kpi-sub { font-size: 12px; }
}

/* V175 Shared expenses on mobile: the payer cell is folded into the meta line, the actions cell keeps its own narrow column */
@media (max-width: 767px) {
  .trip-detail .expense-table tbody tr > td.expense-payer { display: none; }
  .trip-detail .expense-table tbody tr > td.trip-actions { display: flex; width: 30px; min-width: 30px; flex: 0 0 30px; align-items: center; justify-content: flex-end; padding: 0; }
  .trip-detail .expense-table tbody tr { touch-action: pan-y; }
}

/* V176 Elegant swipe: soft gradient actions that fade in with the drag, rounded clip, shadow on the moving card */
.swipe-bg { --p: 0; padding: 0; border-radius: 18px; overflow: hidden; color: #fff; }
.swipe-bg[data-side="edit"] { background: linear-gradient(90deg, #2b6cb0 0%, #4f98d8 100%); }
.swipe-bg[data-side="delete"] { background: linear-gradient(270deg, #bf3b34 0%, #e4574c 100%); }
.swipe-bg.is-armed { filter: none; }
.swipe-act { position: absolute; top: 0; bottom: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 84px; font-size: 12px; font-weight: 600; letter-spacing: .02em; opacity: var(--p); transform: scale(calc(.72 + .28 * var(--p))); transition: transform .18s cubic-bezier(.3,1.6,.5,1); }
.swipe-act svg { display: block; }
.swipe-bg[data-side="edit"] .swipe-act-edit { display: flex; left: 6px; }
.swipe-bg[data-side="delete"] .swipe-act-delete { display: flex; right: 6px; }
.swipe-bg.is-armed .swipe-act { transform: scale(1.14); }
.swipe-bg[data-side="edit"], .swipe-bg[data-side="delete"] { transition: none; }
.swipe-bg.is-armed[data-side="delete"] { background: linear-gradient(270deg, #b3302a 0%, #ef5a4e 100%); }
.swipe-bg.is-armed[data-side="edit"] { background: linear-gradient(90deg, #235f9f 0%, #5aa3e6 100%); }
.is-swiping { box-shadow: 0 8px 28px rgb(0 0 0 / .38); border-radius: 18px; }

/* V177 Swiping row: the moving plate has no divider/margin of its own, so the action strip underneath matches it exactly */
.is-swiping { border-bottom: 0 !important; border-top: 0 !important; box-sizing: border-box; }
.swipe-bg { box-sizing: border-box; }
/* V178 The action icon + label stay centred in the part of the strip that is uncovered */
.swipe-bg[data-side="edit"] .swipe-act-edit { left: 0; width: var(--w, 84px); }
.swipe-bg[data-side="delete"] .swipe-act-delete { right: 0; width: var(--w, 84px); }

/* V179 Expense rows on mobile: even side padding (icon no longer hugs the left edge), amount flush right, no empty actions column (swipe replaces the menu); the moving plate is always opaque */
.is-swiping { box-shadow: inset 0 0 0 999px rgb(24 28 26), 0 8px 28px rgb(0 0 0 / .38) !important; }
@media (max-width: 767px) {
  .trip-detail .expense-table tbody tr > td.trip-actions { display: none !important; }
  .trip-detail .expense-table tbody tr { padding-inline: 14px; box-sizing: border-box; }
  .trip-detail .expense-table tbody tr > td.expense-amount { margin-left: auto; text-align: right; padding-left: 10px; }
}

/* V180 Demo: sections that need an account are covered by a dark veil with a "For registered users" label; welcome dialog once per session */
.demo-lock { position: relative; border-radius: 22px; outline: none; }
.demo-lock-body { pointer-events: none; user-select: none; }
.demo-lock::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; background: rgb(8 10 9 / .66); backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); cursor: not-allowed; }
.demo-lock-tip { position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -42%); padding: 9px 16px; border: 1px solid rgb(255 255 255 / .22); border-radius: 999px; background: rgb(20 24 22 / .92); color: var(--ink, #fff); font-size: 14px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.demo-lock:hover .demo-lock-tip, .demo-lock:focus .demo-lock-tip, .demo-lock:focus-within .demo-lock-tip { opacity: 1; transform: translate(-50%, -50%); }
.demo-welcome { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 20px; background: rgb(6 8 7 / .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: demo-welcome-in .24s ease both; }
.demo-welcome-card { width: min(440px, 100%); padding: 26px 24px; border: 1px solid rgb(255 255 255 / .16); border-radius: 22px; background: rgb(20 24 22 / .94); color: var(--ink, #fff); box-shadow: 0 24px 60px rgb(0 0 0 / .5); }
.demo-welcome-card h2 { margin: 0 0 12px; font-family: var(--font-serif, Georgia, serif); font-size: 26px; font-weight: 500; line-height: 1.15; }
.demo-welcome-card p { margin: 0 0 10px; color: var(--muted, #c9cfc9); font-size: 15px; line-height: 1.55; }
.demo-welcome-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.demo-welcome-actions .button { text-decoration: none; }
@keyframes demo-welcome-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .demo-welcome { animation: none; } }

/* V181 Demo: sidebar call to action */
.sidebar-account .sidebar-demo-cta { display: flex; justify-content: center; width: 100%; margin: 8px 0 2px; padding: 10px 12px; text-decoration: none; font-size: 14px; }

/* V182 Demo: calmer sidebar footer (one quiet pill, small links in a row) */
.sidebar-account .sidebar-demo-cta { display: inline-flex; align-self: flex-start; width: auto; margin: 6px 0 0; padding: 7px 14px; border: 1px solid color-mix(in srgb, var(--accent, #b7e47b) 55%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--accent, #b7e47b) 16%, transparent); color: var(--accent-text, var(--accent, #b7e47b)); font-size: 13px; font-weight: 600; text-decoration: none; }
.sidebar-account .sidebar-demo-cta:hover { background: color-mix(in srgb, var(--accent, #b7e47b) 26%, transparent); }
.sidebar-account .sidebar-demo-links { display: flex; align-items: center; gap: 8px; margin-top: 2px; color: var(--muted); font-size: 12px; }
.sidebar-account .sidebar-demo-links .text-button { padding: 2px 0; font-size: 12px; font-weight: 500; }
.sidebar-account .sidebar-demo-links i { font-style: normal; opacity: .5; }

/* V183 Demo: one floating pill (Demo · Reset · Create account) instead of crowding the sidebar */
.demo-pill { position: fixed; z-index: 60; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 5px 5px 5px 14px; border: 1px solid rgb(255 255 255 / .16); border-radius: 999px; background: rgb(18 22 20 / .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgb(0 0 0 / .35); font-size: 13px; }
.demo-pill-label { margin-right: 4px; color: var(--muted, #c9cfc9); letter-spacing: .08em; text-transform: uppercase; font-size: 11px; font-weight: 600; }
.demo-pill-reset { padding: 7px 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted, #c9cfc9); font: inherit; font-weight: 500; cursor: pointer; }
.demo-pill-reset:hover { color: #fff; }
.demo-pill-cta { padding: 8px 14px; border-radius: 999px; background: var(--accent, #b7e47b); color: #11160f; font-weight: 700; text-decoration: none; white-space: nowrap; }
@media (max-width: 767px) { .demo-pill { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); } }

/* V184 Demo: desktop keeps the actions in the sidebar under Settings; the floating pill is for phones only */
.sidebar-demo-box { display: grid; gap: 4px; margin: 14px 4px 0; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / .08); }
.sidebar-demo-box .sidebar-demo-cta { display: flex; align-self: auto; justify-content: center; margin: 0; padding: 10px 14px; border: 0; border-radius: 14px; background: var(--accent, #b7e47b); color: #11160f; font-size: 14px; font-weight: 700; text-decoration: none; }
.sidebar-demo-box .sidebar-demo-cta:hover { filter: brightness(1.06); }
.sidebar-demo-reset { padding: 8px; border: 0; background: transparent; color: var(--muted, #c9cfc9); font: inherit; font-size: 13px; cursor: pointer; }
.sidebar-demo-reset:hover { color: #fff; }
@media (min-width: 768px) { .demo-pill { display: none; } }
@media (max-width: 767px) { .sidebar-demo-box { display: none; } }

/* V185 Demo: sidebar actions share the nav-item look; Create account only gets the accent colour */
.sidebar-demo-box { gap: 0; margin: 10px 0 0; padding-top: 10px; }
.sidebar-demo-box .nav-item { width: 100%; font: inherit; text-align: left; cursor: pointer; background: transparent; border: 0; }
.sidebar-demo-box .nav-item-accent, .sidebar-demo-box .nav-item-accent .nav-icon { color: var(--accent, #b7e47b); }
.sidebar-demo-box .nav-item-accent .nav-item-label { font-weight: 600; }

/* V186 Demo: a lock over a small inline control (Invite button) stays pill-shaped and compact */
.section-heading > .demo-lock { border-radius: 14px; }
.person-list.demo-lock, .demo-lock > .demo-lock-body > .person-list { margin: 0; }
