/*
 * Itinerary Planner
 * Redesigned with Plus Jakarta Sans, dark navbar, warm neutrals,
 * consistent spacing, accessible focus states, and unified button system.
 */

/* === Custom Properties === */

:root {
  /* Provider colors */
  --color-airbnb: #FF5A5F;
  --color-booking: #003580;
  --color-hotelscom: #D4111E;
  --color-vrbo: #3B5998;
  --color-other: #71717A;

  /* Theme */
  --color-primary: #0B7FD6;
  --color-primary-hover: #0966B3;
  --color-primary-light: #E0F2FE;
  --color-accent: #E8600A;
  --color-accent-hover: #C2510A;
  --color-danger: #DC2626;
  --color-danger-hover: #B91C1C;
  --color-danger-light: #FEF2F2;
  --color-success: #16A34A;
  --color-success-light: #DCFCE7;
  --color-warning: #D97706;

  /* Neutrals — warmer palette */
  --color-bg: #F4F6F8;
  --color-bg-warm: #F9FAFB;
  --color-surface: #FFFFFF;
  --color-border: #E2E5E9;
  --color-border-strong: #C5CAD1;
  --color-text: #1A2332;
  --color-text-muted: #5F6B7A;
  --color-text-subtle: #9CA3AF;

  /* Dark surface (navbar) */
  --color-nav-bg: #1A2332;
  --color-nav-text: #E2E5E9;
  --color-nav-text-muted: #9CA3AF;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.9375rem;
  --font-size-lg: 1.0625rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;

  /* Spacing — 4px base */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Borders & shadows */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.12);

  /* Layout */
  --nav-height: 56px;
  --sidebar-width: 380px;

  /* Focus ring */
  --focus-ring: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-primary);
}


/* === Reset & Base === */

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

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
  letter-spacing: -0.015em;
}
h1 { font-size: var(--font-size-3xl); font-weight: 800; }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p { margin: 0 0 var(--space-4); }

a { color: var(--color-primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--color-primary-hover); }

img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* Global focus-visible */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  box-shadow: 0 0 0 3px rgba(11, 127, 214, .2);
}


/* === Layout: Container === */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}


/* === Navbar === */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--nav-height);
  background: var(--color-nav-bg);
  box-shadow: 0 1px 0 rgba(255,255,255,.05);
}

.navbar > .container,
.navbar > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  padding: 0 var(--space-6);
}

.navbar-brand {
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: #FFFFFF;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.navbar-brand:hover { color: var(--color-primary-light); text-decoration: none; }

.navbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.navbar-email {
  font-size: var(--font-size-sm);
  color: var(--color-nav-text-muted);
}
.navbar-email:hover { color: var(--color-nav-text); }

/* Navbar button override */
.navbar .btn-small,
.navbar .btn--sm {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.15);
  color: var(--color-nav-text);
  font-size: var(--font-size-xs);
}
.navbar .btn-small:hover,
.navbar .btn--sm:hover {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.25);
  color: #fff;
}


/* === Flash messages === */

.flash {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  margin-bottom: var(--space-6);
  font-size: var(--font-size-sm);
  font-weight: 500;
}
.flash-notice {
  background: var(--color-success-light);
  color: #166534;
  border: 1px solid #BBF7D0;
}
.flash-alert {
  background: var(--color-danger-light);
  color: #991B1B;
  border: 1px solid #FECACA;
}


/* === Buttons === */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 18px;
  min-height: 36px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--color-bg);
  border-color: var(--color-border-strong);
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible { box-shadow: var(--focus-ring); }

/* Primary */
.btn-primary, .btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover, .btn--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: #fff;
}

/* Danger */
.btn-danger, .btn--danger {
  background: transparent;
  color: var(--color-danger);
  border-color: var(--color-danger);
}
.btn-danger:hover, .btn--danger:hover {
  background: var(--color-danger);
  color: #fff;
}

/* Secondary */
.btn--secondary {
  background: var(--color-bg);
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn--secondary:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-muted);
}
.btn--ghost:hover { background: var(--color-bg); color: var(--color-text); }

/* Sizes */
.btn-small, .btn--sm {
  padding: 5px 12px;
  min-height: 30px;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
}

/* Provider buttons */
.btn--airbnb { background: var(--color-airbnb); color: #fff; border-color: var(--color-airbnb); }
.btn--airbnb:hover { background: #E04E53; border-color: #E04E53; color: #fff; }
.btn--booking { background: var(--color-booking); color: #fff; border-color: var(--color-booking); }
.btn--booking:hover { background: #002A66; border-color: #002A66; color: #fff; }
.btn--hotelscom { background: var(--color-hotelscom); color: #fff; border-color: var(--color-hotelscom); }
.btn--hotelscom:hover { background: #B30E1A; border-color: #B30E1A; color: #fff; }
.btn--vrbo { background: var(--color-vrbo); color: #fff; border-color: var(--color-vrbo); }
.btn--vrbo:hover { background: #2D4A7E; border-color: #2D4A7E; color: #fff; }


/* === Mini Action Buttons === */

.btn-xs {
  padding: 4px 10px;
  min-height: 26px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all .12s;
  line-height: 1.3;
}
.btn-xs:hover { background: var(--color-bg); color: var(--color-text); }
.btn-xs:active { transform: scale(.97); }
.btn-xs:focus-visible { box-shadow: var(--focus-ring); }
.btn-xs--primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-xs--primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.btn-xs--ghost { background: none; border-color: transparent; }
.btn-xs--ghost:hover { background: var(--color-bg); border-color: var(--color-border); }
.btn-xs--danger { color: var(--color-danger); border-color: transparent; background: none; }
.btn-xs--danger:hover { background: var(--color-danger-light); border-color: var(--color-danger-light); }


/* === Forms === */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: .01em;
}

.form-control,
.form-input,
.form-textarea,
.form-select {
  display: block;
  width: 100%;
  padding: 9px 14px;
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.form-control:focus,
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(11, 127, 214, .15);
}
.form-control--error {
  border-color: var(--color-danger);
}
.form-control--error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%235F6B7A' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

.form-error, .form-errors {
  color: var(--color-danger);
  font-size: var(--font-size-sm);
}
.form-errors {
  background: var(--color-danger-light);
  border: 1px solid #FECACA;
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}
.form-errors ul {
  list-style: disc;
  padding-left: var(--space-6);
  margin-top: var(--space-2);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.form--inline {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
}
.form--inline .form-group { margin-bottom: 0; flex: 1; }
.form--inline .form-actions { margin-top: 0; }

.form-card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}
.form-card__title {
  text-align: center;
  margin-bottom: var(--space-6);
}
.form-card__back {
  margin-bottom: var(--space-6);
}
.form-card__section {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}
.form-card__subtitle {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-3);
}

/* Score inputs in form */
.score-inputs { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.form-group--inline { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 80px; }
.form-group--inline .form-control--sm { width: 64px; }
.form-fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}
.form-fieldset legend { font-weight: 600; padding: 0 var(--space-2); }


/* === Page Header === */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}
.page-header h1 { margin-bottom: 0; }


/* === Trips Grid === */

.trips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
}

.trip-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  transition: box-shadow .2s, border-color .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.trip-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
}

.trip-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  margin-bottom: var(--space-4);
  cursor: pointer;
}
.trip-card-link:hover { text-decoration: none; color: inherit; }

.trip-card-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.trip-card-dates {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.trip-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.trip-card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}


/* === Status Badges === */

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-planning {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.status-trip {
  background: var(--color-success-light);
  color: var(--color-success);
}
.status-badge--booked {
  background: var(--color-success-light);
  color: var(--color-success);
}
.status-badge--option {
  background: #FEF3C7;
  color: var(--color-warning);
}


/* === Trip Mode Nav (Plan / Budget / Trip Mode / Settings) === */

.trip-mode-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-5);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.trip-mode-nav__links { display: flex; gap: var(--space-1); }
.trip-mode-nav__settings { margin-left: auto; }
.trip-mode-nav__link {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.trip-mode-nav__link:hover {
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
}
.trip-mode-nav__link--active {
  background: var(--color-primary);
  color: #fff;
}
.trip-mode-nav__link--active:hover {
  background: var(--color-primary-hover);
  color: #fff;
}


/* === Planner Layout (Sidebar + Map + Timeline) === */

.planner {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--nav-height));
  overflow: hidden;
}

.planner__top {
  display: flex;
  flex: 1;
  min-height: 0;
}

.planner__panel {
  width: 370px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  overflow: hidden;
}

.planner__map {
  flex: 1;
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--color-bg);
}


/* === Map Overlay === */

.map-overlay--top {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  right: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-4);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.map-overlay__title-link {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--font-size-sm);
}
.map-overlay__title-link:hover { color: var(--color-primary); text-decoration: none; }
.map-overlay__dates { color: var(--color-text-muted); font-weight: 400; }
.map-overlay__actions { display: flex; gap: var(--space-2); }


/* === Left Panel === */

.panel__header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  background: var(--color-bg-warm);
}

.panel__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin: 0;
}

.panel__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xl);
  color: var(--color-text-muted);
  text-decoration: none;
  line-height: 1;
}
.panel__close:hover { background: var(--color-bg); color: var(--color-text); }

.panel__dates {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.panel__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
}

.panel__section { margin-bottom: var(--space-6); }

.panel__section-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-border);
}

.panel__section-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.panel__section-count {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.panel__section-link {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-primary);
  margin-left: auto;
  text-decoration: none;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  transition: background .12s, color .12s;
}
.panel__section-link:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-hover);
}

.panel__empty {
  font-size: var(--font-size-sm);
  color: var(--color-text-subtle);
  text-align: center;
  padding: var(--space-6);
}


/* === Provider Search Row === */

.provider-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.scrape-url-row {
  margin-bottom: var(--space-3);
}
.scrape-url-form {
  display: flex;
  gap: var(--space-2);
}
.scrape-url-form .form-control--sm {
  flex: 1;
  font-size: var(--font-size-sm);
  padding: var(--space-1) var(--space-2);
}
.scrape-url-form .btn--sm {
  flex-shrink: 0;
}

.pill {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: #fff;
  transition: opacity .15s;
  text-decoration: none;
  line-height: 1.4;
}
.pill:hover { opacity: .85; color: #fff; text-decoration: none; }
.pill--airbnb { background: var(--color-airbnb); }
.pill--booking { background: var(--color-booking); }
.pill--hotelscom { background: var(--color-hotelscom); }
.pill--vrbo { background: var(--color-vrbo); }
.pill--add {
  background: none;
  color: var(--color-primary);
  border: 1px dashed var(--color-primary);
}
.pill--add:hover { background: var(--color-primary-light); color: var(--color-primary); }


/* === Accommodation Cards (panel) === */

.accom-list { display: flex; flex-direction: column; gap: var(--space-2); }

.accom-card {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: var(--space-3);
  border-left: 3px solid transparent;
  transition: box-shadow .12s, border-color .12s;
  overflow: hidden;
}
.accom-card__photo {
  margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-3)) var(--space-2);
  height: 120px;
  overflow: hidden;
}
.accom-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.accom-card:hover { box-shadow: var(--shadow-sm); border-color: var(--color-border-strong); }
.accom-card--booked { border-left-color: var(--color-success); background: var(--color-success-light); }

.accom-card__top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.provider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.8);
}

.accom-card__name {
  flex: 1;
  font-weight: 600;
  font-size: var(--font-size-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.accom-card__name a { color: var(--color-text); }
.accom-card__name a:hover { color: var(--color-primary); }

.booked-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-success);
  background: rgba(22,163,74,.12);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.booked-tag--sm { font-size: 9px; padding: 1px 6px; }

.accom-card__details {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.accom-card__price { color: var(--color-text); font-weight: 500; }
.accom-card__price small { color: var(--color-text-muted); font-weight: 400; }
.accom-card__rating { color: var(--color-accent); font-weight: 700; }

/* Score badge */
.accom-card__score {
  background: var(--color-primary);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .02em;
}

/* Pros/cons chips */
.accom-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: var(--space-1);
  margin-bottom: var(--space-2);
}
.chip {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .01em;
}
.chip--pro {
  background: var(--color-success-light);
  color: #15803D;
}
.chip--con {
  background: var(--color-danger-light);
  color: #B91C1C;
}

.accom-card__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.accom-card__icon-actions {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

/* Icon buttons — square, minimal, SVG-based */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-subtle);
  cursor: pointer;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--color-bg); color: var(--color-text); }
.icon-btn:focus-visible { box-shadow: var(--focus-ring); }
.icon-btn:active { transform: scale(.92); }

.icon-btn--ghost { color: var(--color-text-subtle); }
.icon-btn--ghost:hover { background: var(--color-bg); color: var(--color-text-muted); }

.icon-btn--danger { color: var(--color-text-subtle); }
.icon-btn--danger:hover { background: var(--color-danger-light); color: var(--color-danger); }

.icon-btn svg { display: block; }


/* === Activity Cards === */

.activity-list { display: flex; flex-direction: column; gap: 4px; }

.act-card {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: var(--font-size-sm);
  border-left: 3px solid transparent;
  transition: box-shadow .12s;
}
.act-card--booked { border-left-color: var(--color-success); }
.act-card:hover { box-shadow: var(--shadow-sm); }
.act-card + .act-card { margin-top: 0; }

.act-card__top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.act-card__name {
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.act-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-1);
}
.act-card__cost { font-weight: 700; color: var(--color-text); white-space: nowrap; }
.act-card__actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.act-card__icon-actions { display: flex; gap: 2px; }


/* === Activity Add Form === */

.act-add-form {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.act-add-form__input {
  flex: 1;
  padding: 5px 10px;
  font-size: var(--font-size-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}
.act-add-form__input:focus { outline: none; border-color: var(--color-primary); }
.act-add-form__cost {
  width: 60px;
  padding: 5px 8px;
  font-size: var(--font-size-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}
.act-add-form__cost:focus { outline: none; border-color: var(--color-primary); }
.act-add-form__btn {
  padding: 5px 12px;
  font-size: var(--font-size-sm);
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
}
.act-add-form__btn:hover { background: var(--color-primary-hover); }


/* === Budget Mini (panel) === */

.budget-mini {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.budget-mini__row {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  padding: 2px 0;
}
.budget-mini__row strong { color: var(--color-text); }
.budget-mini__row--ok strong { color: var(--color-success); }
.budget-mini__row--over strong { color: var(--color-danger); }
.budget-mini__footer { margin-top: var(--space-2); text-align: right; }


/* === Timeline Bar === */

.timeline-bar {
  flex-shrink: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 8px rgba(0,0,0,.04);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.timeline-bar::-webkit-scrollbar { height: 5px; }
.timeline-bar::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 3px; }

/* Timeline grid: ruler row 1, cards row 2.
   Uses CSS grid with subgrid on columns so spacers can span rows
   while their + button centers in the stop-card row. */
.timeline-grid {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-auto-flow: column;
  grid-auto-columns: auto;
  padding: var(--space-3) var(--space-4);
  min-width: max-content;
}

/* Column wrapper: spans both rows via subgrid */
.timeline-col {
  display: grid;
  grid-row: 1 / -1;
  grid-template-rows: subgrid;
  flex-shrink: 0;
}

/* Spacer between stops — spans both rows, + button in row 2 */
.timeline-spacer {
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: subgrid;
  width: clamp(var(--space-3), 3vw, var(--space-8));
}
.timeline-spacer .timeline-plus {
  grid-row: 2;
  align-self: center;
  justify-self: center;
}


/* Ruler block in row 1 */
.timeline-ruler__block {
  grid-row: 1;
  display: flex;
  border-bottom: 1px solid var(--color-border);
}
.timeline-ruler__day {
  flex: 1;
  text-align: center;
  padding: 4px 0 3px;
  border-left: 1px solid var(--color-border);
  min-width: 0;
}
.timeline-ruler__day:last-child {
  border-right: 1px solid var(--color-border);
}
.timeline-ruler__daynum {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}
.timeline-ruler__month {
  display: block;
  font-size: 9px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

/* Stop card in row 2 */

.timeline-stop {
  grid-row: 2;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-2) var(--space-3);
  padding-right: var(--space-5);
  background: var(--color-bg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  transition: border-color .15s, background .15s, box-shadow .15s;
  flex-shrink: 0;
  min-height: 56px;
  min-width: 120px;
  user-select: none;
}
.timeline-stop:hover {
  background: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
}
.timeline-stop--selected {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}
.timeline-stop--resizing {
  opacity: 0.9;
  box-shadow: 0 0 0 2px var(--color-primary);
}

.timeline-stop__top {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.timeline-stop__link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: inherit;
  line-height: 1.3;
  min-width: 0;
  flex: 1;
}
.timeline-stop__link:hover { text-decoration: none; color: inherit; }

.timeline-stop__number {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.timeline-stop--selected .timeline-stop__number {
  background: var(--color-success);
}

.timeline-stop__name {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.timeline-stop__del {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color .12s, background .12s;
  padding: 0;
}
.timeline-stop__del svg { display: block; }
.timeline-stop__del:hover { color: var(--color-danger); background: var(--color-danger-light); }

.timeline-stop__bottom {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: 2px;
}

.timeline-stop__nights {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-primary);
}

.timeline-stop__dates {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Drag handle on right edge */
.timeline-stop__resize-handle {
  position: absolute;
  right: 0;
  top: 4px;
  bottom: 4px;
  width: 10px;
  cursor: ew-resize;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--color-border);
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline-stop__resize-handle::after {
  content: "";
  width: 3px;
  height: 20px;
  border-left: 2px dotted var(--color-text-subtle);
  border-right: 2px dotted var(--color-text-subtle);
}
.timeline-stop__resize-handle:hover,
.timeline-stop--resizing .timeline-stop__resize-handle {
  background: var(--color-primary);
}
.timeline-stop__resize-handle:hover::after,
.timeline-stop--resizing .timeline-stop__resize-handle::after {
  border-color: white;
}

/* Timeline + button */
.timeline-plus {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px dashed var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-subtle);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  padding: 0;
}
.timeline-plus:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-style: solid;
}


/* Add Stop Dialog */
.add-stop-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.add-stop-backdrop[hidden] { display: none; }

.add-stop-dialog {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0;
  max-width: 400px;
  width: 90vw;
  background: white;
  position: relative;
  z-index: 9001;
}

.add-stop-dialog__content {
  padding: var(--space-6);
}

.add-stop-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
.add-stop-dialog__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin: 0;
}
.add-stop-dialog__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: var(--font-size-xl);
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background .12s, color .12s;
}
.add-stop-dialog__close:hover { background: var(--color-bg); color: var(--color-text); }

.add-stop-dialog__field {
  margin-bottom: var(--space-4);
}

.add-stop-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

/* Ensure Google Places autocomplete dropdown renders above the dialog */
.pac-container { z-index: 10000 !important; }
gmp-place-autocomplete::part(list) { z-index: 10000 !important; }


/* === Provider Badges === */

.provider-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: #fff;
  border-radius: var(--radius-sm);
  letter-spacing: .02em;
  white-space: nowrap;
}


/* === Transport Items === */

.transport-list-section { margin-bottom: var(--space-6); }
.transport-list-section h3 {
  font-size: var(--font-size-sm);
  font-weight: 700;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-border);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.transport-list-section h4 {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
}

.transport-list { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-4); }
.transport-list__empty { font-size: var(--font-size-sm); color: var(--color-text-subtle); }
.transport-list__add { margin-top: var(--space-4); }

.transport-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  transition: box-shadow .12s;
}
.transport-item:hover { box-shadow: var(--shadow-sm); }

.transport-item__icon { font-size: var(--font-size-xl); line-height: 1; flex-shrink: 0; }
.transport-item__body { flex: 1; min-width: 0; }
.transport-item__route { font-weight: 600; }
.transport-item__route-arrow { margin: 0 var(--space-1); color: var(--color-text-subtle); }
.transport-item__times { font-size: var(--font-size-xs); color: var(--color-text-muted); margin-top: 2px; }
.transport-item__meta { display: flex; gap: var(--space-3); font-size: var(--font-size-xs); color: var(--color-text-muted); margin-top: 2px; }
.transport-item__cost { font-weight: 700; color: var(--color-text); }
.transport-item__provider { }
.transport-item__status { }
.transport-item__actions { display: flex; gap: var(--space-1); flex-shrink: 0; }

.transport-type { font-weight: 700; text-transform: capitalize; }


/* === Trip Mode Layout === */

.trip-layout {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-6);
}

.trip-layout__header {
  margin-bottom: var(--space-6);
}

.trip-layout__title {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-1);
}

.trip-layout__meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0;
}


/* === Stop Navigator (Trip Mode) === */

.stop-navigator {
  overflow-x: auto;
  margin-bottom: var(--space-6);
  -webkit-overflow-scrolling: touch;
}
.stop-navigator::-webkit-scrollbar { height: 4px; }
.stop-navigator::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 2px; }

.stop-navigator__list {
  display: flex;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
}

.stop-navigator__item { flex-shrink: 0; }

.stop-navigator__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text);
  transition: all .15s;
  min-width: 120px;
  cursor: pointer;
}
.stop-navigator__tab:hover {
  border-color: var(--color-primary);
  text-decoration: none;
  color: var(--color-text);
}
.stop-navigator__tab--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.stop-navigator__tab--active:hover { color: #fff; }

.stop-navigator__tab-name { font-weight: 700; font-size: var(--font-size-sm); }
.stop-navigator__tab-dates { font-size: var(--font-size-xs); opacity: .8; }


/* === Section Cards (Trip Mode) === */

.section-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-6);
  overflow: hidden;
}

.section-card__header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-warm);
}

.section-card__title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-1);
}

.section-card__body {
  padding: var(--space-5) var(--space-6);
}


/* === Detail Panel Sections (Trip Mode) === */

.detail-panel__section { margin-bottom: var(--space-6); }
.detail-panel__section:last-child { margin-bottom: 0; }
.detail-panel__section-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-border);
}

/* Activity items in trip mode */
.activity-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-2);
  border-left: 3px solid transparent;
}
.activity-item--booked { border-left-color: var(--color-success); }
.activity-item__name { flex: 1; font-weight: 600; }
.activity-item__cost { font-weight: 700; color: var(--color-text); white-space: nowrap; }
.activity-item__actions { display: flex; gap: var(--space-1); flex-shrink: 0; }


/* === Empty States === */

.empty-state {
  text-align: center;
  padding: var(--space-10);
  color: var(--color-text-muted);
}
.empty-state__icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
  opacity: .5;
}
.empty-state__title {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-3);
}
.empty-state--compact {
  padding: var(--space-5);
}
.empty-state--compact .empty-state__icon { font-size: 1.5rem; }


/* === Import Section === */

.import-section {
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}
.import-section__title {
  font-weight: 700;
  margin-bottom: var(--space-1);
}
.import-hint {
  font-size: var(--font-size-sm);
  color: #92400E;
}


/* === Map Container === */

.map-container {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--color-bg);
}


/* === Utility Classes === */

.row { display: flex; align-items: center; gap: var(--space-2); }
.row--between { justify-content: space-between; }
.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }


/* === Auth Pages === */

.sessions-new, .passwords-new, .passwords-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
}


/* === Responsive === */

@media (max-width: 768px) {
  .planner__top {
    flex-direction: column;
  }
  .planner__panel {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .planner__map {
    min-height: 30vh;
  }

  .trips-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .form-actions {
    flex-direction: column;
  }
  .form-actions .btn { width: 100%; }

  .trip-layout { padding: var(--space-4); }

  .container { padding: var(--space-6) var(--space-4); }

  .trip-mode-nav {
    padding: var(--space-2) var(--space-3);
  }
  .trip-mode-nav__link {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
  }
}

@media (max-width: 480px) {
  .provider-row .pill {
    padding: 3px 8px;
    font-size: 10px;
  }

  .stop-navigator__tab {
    min-width: 100px;
    padding: var(--space-2) var(--space-3);
  }

  .timeline-stop__name { font-size: var(--font-size-xs); }
}


/* === Trix (Action Text) overrides === */

.trix-content { font-size: var(--font-size-base); line-height: 1.6; }


/* ============================================================
   Budget Page
   ============================================================ */

.budget-page {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-6);
}
.budget-header { margin-bottom: var(--space-5); }
.budget-header__nav { margin-bottom: var(--space-2); }
.budget-header h1 { font-size: var(--font-size-xl); }

.budget-summary {
  display: flex;
  gap: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.budget-summary__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
}
.budget-summary__label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.budget-summary__value { font-size: var(--font-size-lg); font-weight: 700; }
.budget-summary__item--ok .budget-summary__value { color: var(--color-success); }
.budget-summary__item--over .budget-summary__value { color: var(--color-danger); }

.budget-cards { display: flex; flex-direction: column; gap: var(--space-3); }
.budget-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.budget-card__header {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.budget-card__header:hover { background: var(--color-bg); }
.budget-card__title { display: flex; align-items: center; gap: var(--space-2); flex: 1; }
.budget-card__title h3 { font-size: var(--font-size-base); margin: 0; }
.budget-card__icon { font-size: 1.2em; }
.budget-card__totals { display: flex; align-items: baseline; gap: var(--space-2); margin-right: var(--space-3); }
.budget-card__estimated { font-weight: 700; }
.budget-card__booked { font-size: var(--font-size-xs); color: var(--color-text-muted); }
.budget-card__arrow {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  transition: transform 0.15s;
}
.budget-card__body {
  border-top: 1px solid var(--color-border);
  padding: var(--space-4);
}
.budget-card__empty { color: var(--color-text-muted); font-size: var(--font-size-sm); }

.budget-table { width: 100%; font-size: var(--font-size-sm); }
.budget-table__row td { padding: var(--space-2); vertical-align: middle; }
.budget-table__name { font-weight: 600; }
.budget-table__name a { color: inherit; text-decoration: underline; }
.budget-table__detail { color: var(--color-text-muted); }
.budget-table__amount { text-align: right; font-weight: 600; white-space: nowrap; }
.budget-table__status { text-align: center; }
.budget-table__action { text-align: right; white-space: nowrap; }
.budget-table__action-btns { display: inline-flex; gap: var(--space-1); align-items: center; }
.budget-table__attachments td { padding: 0 var(--space-2) var(--space-2); }

.budget-card__add { padding: var(--space-3) 0 0; }

.attachment-list { display: flex; flex-direction: column; gap: var(--space-2); }
.attachment-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}
.attachment-link { color: var(--color-primary); font-weight: 500; text-decoration: none; }
.attachment-link:hover { text-decoration: underline; }
.attachment-size { color: var(--color-text-muted); font-size: var(--font-size-xs); }
.attachment-delete {
  margin-left: auto;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--color-text-subtle);
  cursor: pointer; font-size: 14px; line-height: 1;
  transition: all .12s;
}
.attachment-delete:hover { background: var(--color-danger-light); color: var(--color-danger); }
.attachment-upload {
  display: flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-warm);
}
.attachment-input { font-size: var(--font-size-sm); flex: 1; }
.attachment-upload .btn-xs--ghost {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  border-radius: var(--radius-sm);
}
.attachment-upload .btn-xs--ghost:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.budget-item-form { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-border); }
.budget-item-form__row { display: flex; gap: var(--space-2); align-items: end; flex-wrap: wrap; }
.budget-item-form__amount { max-width: 100px; }

.form-check-wrapper { display: flex; align-items: center; gap: var(--space-1); padding-top: var(--space-2); }
.form-label--inline { font-size: var(--font-size-sm); margin: 0; }


/* ============================================================
   Comparison Page
   ============================================================ */

.compare-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-6);
}

.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-border);
}
.compare-header h1 {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--color-text);
  margin: 0;
}
.compare-header__sub {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-top: 4px;
}

.compare-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: white;
  box-shadow: var(--shadow);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.compare-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.compare-table thead tr {
  background: var(--color-bg-warm);
  border-bottom: 2px solid var(--color-border);
}
.compare-table th {
  padding: var(--space-4);
  text-align: left;
  vertical-align: bottom;
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}
.compare-table th a {
  color: var(--color-primary);
  text-decoration: none;
}
.compare-table th a:hover { text-decoration: underline; }

.compare-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.compare-table__label {
  width: 110px;
  color: var(--color-text-muted);
  font-weight: 600;
  white-space: nowrap;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.compare-table__col { min-width: 180px; }

.compare-table__row--highlight {
  background: var(--color-bg-warm);
}
.compare-table__row--highlight td {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-border);
}

.compare-table__dash { color: var(--color-border-strong); }

/* Stars in comparison */
.compare-table .compare-stars {
  color: var(--color-accent);
  letter-spacing: 1px;
}
.compare-table .compare-stars--empty {
  color: var(--color-border);
}

/* Section separator rows */
.compare-table__section-break td {
  border-top: 2px solid var(--color-border);
  padding-top: var(--space-3);
}

/* Actions row */
.compare-table__actions td {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: none;
}
.compare-table__action-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
