:root {
  color-scheme: light;
  --ink: #101923;
  --muted: #617080;
  --line: rgba(255, 255, 255, 0.44);
  --glass: rgba(255, 255, 255, 0.34);
  --glass-strong: rgba(255, 255, 255, 0.58);
  --glass-faint: rgba(255, 255, 255, 0.2);
  --aqua: #3fb7c3;
  --blue: #5b8dff;
  --green: #4f8a70;
  --coral: #ff6f61;
  --violet: #9a7cff;
  --shadow: 0 26px 72px rgba(42, 62, 80, 0.22);
  --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.78), inset 0 -1px 0 rgba(255, 255, 255, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 12%, rgba(91, 141, 255, 0.36), transparent 31vw),
    radial-gradient(circle at 82% 20%, rgba(255, 111, 97, 0.28), transparent 28vw),
    radial-gradient(circle at 61% 86%, rgba(63, 183, 195, 0.28), transparent 32vw),
    linear-gradient(135deg, #ecf7fb 0%, #f9f6ff 42%, #fff3ed 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(115deg, transparent 0%, #000 30%, #000 68%, transparent 100%);
  opacity: 0.32;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-hero-bar,
.site-shell {
  display: none;
}

.is-authenticated .site-hero-bar {
  display: grid;
}

.is-authenticated .site-shell {
  display: block;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 24% 18%, rgba(91, 141, 255, 0.32), transparent 32vw),
    radial-gradient(circle at 80% 72%, rgba(255, 111, 97, 0.24), transparent 30vw),
    linear-gradient(135deg, #ecf7fb 0%, #f9f6ff 46%, #fff3ed 100%);
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.26));
  box-shadow: var(--inner-highlight), 0 28px 80px rgba(42, 62, 80, 0.22);
  backdrop-filter: blur(32px) saturate(1.65);
}

.login-logo {
  width: 108px;
  height: 108px;
  justify-self: center;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: var(--inner-highlight), 0 18px 44px rgba(31, 44, 55, 0.16);
}

.login-card h1 {
  max-width: none;
  text-align: center;
  font-size: clamp(1.8rem, 6vw, 3rem);
}

.login-card label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: #a92821;
  font-weight: 760;
  text-align: center;
}

.site-hero-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(480px, 1fr);
  gap: 18px;
  align-items: center;
  margin: 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 30px;
  padding: 12px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.82), transparent 28%),
    radial-gradient(circle at 86% 35%, rgba(112, 214, 229, 0.28), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.22));
  box-shadow: var(--inner-highlight), 0 24px 70px rgba(45, 69, 88, 0.18);
  backdrop-filter: blur(34px) saturate(1.7);
}

.site-hero-bar::before {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.7), transparent 38%, rgba(255, 255, 255, 0.22));
}

.site-hero-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
}

.site-hero-brand:hover,
.site-hero-brand:focus-visible {
  transform: translateY(-1px);
}

.logout-button {
  position: relative;
  z-index: 1;
  justify-self: end;
}

.site-hero-brand strong,
.site-hero-brand span {
  display: block;
}

.site-hero-brand strong {
  overflow-wrap: anywhere;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  line-height: 1.12;
}

.site-hero-brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(560px, 1fr);
  min-height: calc(100vh - 116px);
}

.hero-panel {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-shade {
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.24), transparent 34%),
    linear-gradient(90deg, rgba(14, 24, 32, 0.64), rgba(14, 24, 32, 0.2) 60%, rgba(14, 24, 32, 0.04)),
    linear-gradient(0deg, rgba(17, 25, 31, 0.3), rgba(17, 25, 31, 0.02));
  backdrop-filter: saturate(1.25);
}

.overview {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: min(520px, calc(100% - 40px));
  min-height: 100vh;
  padding: 36px 0 36px 36px;
  color: #fff;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1.04rem;
  font-weight: 800;
}

.mark,
.logo-mark {
  display: grid;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.16));
  box-shadow: var(--inner-highlight), 0 14px 32px rgba(7, 18, 27, 0.22);
  backdrop-filter: blur(24px) saturate(1.45);
}

.mark {
  place-items: center;
}

.logo-mark {
  display: block;
  object-fit: cover;
  object-position: center;
  padding: 2px;
}

.logo-mark.small {
  width: 38px;
  height: 38px;
}

.trip-form {
  display: grid;
  gap: 14px;
  margin-top: auto;
  width: min(430px, 100%);
}

label,
.trip-form span {
  display: grid;
  gap: 7px;
}

.trip-form span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: var(--inner-highlight), 0 14px 34px rgba(22, 43, 58, 0.08);
  backdrop-filter: blur(24px) saturate(1.55);
  outline: none;
}

input {
  height: 42px;
  padding: 0 12px;
}

select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 100px;
  padding: 12px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--inner-highlight), 0 0 0 4px rgba(63, 183, 195, 0.22), 0 18px 42px rgba(22, 43, 58, 0.13);
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(430px, 100%);
}

.stats div {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.14));
  box-shadow: var(--inner-highlight), 0 18px 44px rgba(4, 18, 28, 0.2);
  backdrop-filter: blur(28px) saturate(1.5);
}

.stats div::before,
.column::before,
.icon-button::before,
.tab::before,
.view-tab::before,
.item::before,
.empty-state::before,
.calendar-day::before {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.56), transparent 38%, rgba(255, 255, 255, 0.16) 72%, transparent);
  opacity: 0.78;
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.stats span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.planner {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 20px;
  min-width: 0;
  padding: 34px;
  overflow: hidden;
}

.glass-aurora {
  position: absolute;
  inset: 18px;
  z-index: -1;
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 18%, rgba(91, 141, 255, 0.28), transparent 31%),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.78), transparent 20%),
    radial-gradient(circle at 72% 78%, rgba(255, 111, 97, 0.22), transparent 29%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.1));
  filter: blur(0.2px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 28px 90px rgba(59, 82, 102, 0.13);
}

.planner-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #247987;
  font-size: 0.77rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  max-width: 650px;
  font-size: clamp(2rem, 4.6vw, 3.8rem);
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.68);
}

h2 {
  font-size: 1.05rem;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: end;
}

.icon-button {
  position: relative;
  overflow: hidden;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  color: var(--ink);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.28));
  box-shadow: var(--inner-highlight), 0 14px 32px rgba(43, 67, 86, 0.12);
  backdrop-filter: blur(26px) saturate(1.55);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.76);
  transform: translateY(-1px);
}

.icon-button.danger:hover {
  border-color: #dda093;
  color: #a13f2c;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tabs {
  display: flex;
  gap: 8px;
  min-height: 42px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.view-tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  gap: 10px;
  min-height: 76px;
  overflow: hidden;
  padding: 0;
}

.tab,
.view-tab {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  padding: 0 15px;
  color: #516273;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.26));
  box-shadow: var(--inner-highlight), 0 12px 26px rgba(40, 62, 78, 0.08);
  backdrop-filter: blur(22px) saturate(1.45);
  font-weight: 750;
}

.view-tab {
  display: grid;
  align-content: center;
  gap: 3px;
  height: 62px;
  padding: 0 18px;
  text-align: left;
  white-space: nowrap;
}

.view-tab strong,
.view-tab span {
  position: relative;
  z-index: 1;
}

.view-tab strong {
  font-size: 0.98rem;
  line-height: 1.1;
}

.view-tab span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tab.active,
.view-tab.active {
  color: #0a2f3a;
  border-color: rgba(255, 255, 255, 0.78);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(112, 214, 229, 0.42));
  box-shadow: var(--inner-highlight), 0 18px 36px rgba(63, 183, 195, 0.2);
}

.view-tab.active span {
  color: #226b77;
}

.view-panel {
  display: none;
  min-height: 0;
}

.view-panel.active {
  display: grid;
}

.board {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(270px, 0.72fr);
  gap: 18px;
  min-height: 0;
}

.builder-grid,
.budget-page {
  grid-template-columns: minmax(320px, 0.82fr) minmax(360px, 1fr);
  gap: 18px;
}

.calendar-page {
  grid-template-columns: 1fr;
}

.side-grid {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 18px;
  min-height: 0;
}

.column {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.28));
  box-shadow: var(--inner-highlight), var(--shadow);
  backdrop-filter: blur(32px) saturate(1.6);
}

.compact {
  min-height: 0;
}

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

.small-action,
.primary {
  border: 0;
  border-radius: 14px;
  font-weight: 800;
}

.small-action {
  height: 34px;
  padding: 0 12px;
  color: #153e45;
  background: rgba(213, 249, 246, 0.58);
  box-shadow: var(--inner-highlight), 0 10px 24px rgba(43, 67, 86, 0.1);
  backdrop-filter: blur(18px) saturate(1.5);
}

.primary {
  height: 42px;
  padding: 0 12px;
  color: #10202b;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 132, 117, 0.54));
  box-shadow: var(--inner-highlight), 0 14px 30px rgba(199, 83, 70, 0.18);
}

.stop-form,
.cost-form,
.pack-form,
.expense-form,
.builder-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.stop-form {
  grid-template-columns: 112px minmax(140px, 1fr) minmax(100px, 0.65fr) auto;
}

.cost-form {
  grid-template-columns: minmax(0, 1fr) 78px auto;
}

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

.expense-form {
  grid-template-columns: minmax(120px, 1fr) 132px 96px auto;
}

.list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 245px);
  overflow: auto;
  padding-right: 2px;
}

.tight {
  max-height: 31vh;
}

.item {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: var(--inner-highlight), 0 14px 32px rgba(38, 58, 75, 0.08);
  backdrop-filter: blur(20px) saturate(1.45);
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item strong {
  overflow-wrap: anywhere;
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.pill {
  display: inline-grid;
  min-height: 30px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  padding: 0 10px;
  color: #16434c;
  background: rgba(222, 250, 250, 0.5);
  box-shadow: var(--inner-highlight), 0 10px 22px rgba(38, 58, 75, 0.08);
  font-size: 0.8rem;
  font-weight: 800;
}

.route-summary {
  min-height: 34px;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 750;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.calendar-day {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: var(--inner-highlight), 0 14px 32px rgba(38, 58, 75, 0.08);
  backdrop-filter: blur(22px) saturate(1.45);
}

.calendar-date {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.calendar-date strong {
  font-size: 1.25rem;
}

.calendar-date span,
.budget-meters span,
.category-row span,
.budget-target span,
.builder-controls span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-events {
  display: grid;
  gap: 8px;
}

.calendar-event {
  display: grid;
  gap: 3px;
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--inner-highlight);
}

.budget-summary {
  display: grid;
  gap: 16px;
  align-content: start;
}

.budget-target {
  width: min(150px, 100%);
}

.budget-meters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.budget-meters div {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: var(--inner-highlight), 0 12px 28px rgba(38, 58, 75, 0.08);
}

.budget-meters strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(1.1rem, 2vw, 1.7rem);
}

.budget-bar,
.category-row i {
  display: block;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 2px rgba(21, 37, 49, 0.08);
}

.budget-bar span,
.category-row i {
  background: linear-gradient(90deg, var(--aqua), var(--blue), var(--coral));
}

.budget-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.category-bars {
  display: grid;
  gap: 10px;
}

.category-row {
  display: grid;
  gap: 7px;
}

.category-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.delete-button,
.check-button {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: var(--inner-highlight), 0 10px 22px rgba(38, 58, 75, 0.08);
  backdrop-filter: blur(18px) saturate(1.45);
}

.check-button.done {
  color: #08372f;
  border-color: rgba(255, 255, 255, 0.78);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(99, 220, 178, 0.62));
}

.empty-state {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.66);
  border-radius: 18px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(18px) saturate(1.35);
}

.empty-state strong {
  color: var(--ink);
}

@media (max-width: 1040px) {
  .site-hero-bar {
    grid-template-columns: 1fr;
  }

  .app-shell,
  .board,
  .builder-grid,
  .budget-page {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .overview {
    min-height: 620px;
  }

  .planner {
    padding: 26px 18px 32px;
  }

  .side-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .list,
  .tight {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .site-hero-bar {
    margin: 10px;
    border-radius: 24px;
    padding: 10px;
    gap: 8px;
  }

  .site-hero-brand span {
    display: none;
  }

  .overview {
    width: calc(100% - 28px);
    padding: 24px 0 24px 18px;
  }

  .planner-header {
    display: grid;
  }

  .toolbar {
    justify-content: start;
  }

  .stop-form,
  .cost-form,
  .pack-form,
  .expense-form,
  .side-grid,
  .date-grid,
  .stats,
  .budget-meters {
    grid-template-columns: 1fr;
  }

  .view-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-height: 108px;
  }

  .view-tab {
    height: 50px;
    padding: 0 14px;
  }

  .hero-panel,
  .overview {
    min-height: 700px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .hero-panel,
  .toolbar,
  .tabs form,
  .stop-form,
  .cost-form,
  .pack-form,
  .small-action {
    display: none;
  }

  .app-shell,
  .board,
  .side-grid {
    display: block;
  }

  .planner {
    padding: 0;
  }

  .column {
    margin: 0 0 16px;
    box-shadow: none;
  }
}

/* Place-based app layout */
.site-hero-bar {
  grid-template-columns: minmax(220px, 0.34fr) minmax(300px, 0.4fr) minmax(540px, 1fr) auto;
}

.view-tabs {
  grid-template-columns: repeat(5, minmax(100px, 1fr));
}

.trip-switcher {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  min-width: 280px;
}

.trip-switcher select {
  height: 38px;
  font-weight: 850;
}

.trip-actions {
  display: grid;
  grid-template-columns: minmax(155px, 1fr) auto auto auto;
  gap: 6px;
}

.trip-actions input {
  height: 34px;
  min-width: 0;
  padding-inline: 10px;
  font-size: 0.86rem;
}

.trip-actions .icon-button {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.trip-actions .small-action {
  height: 34px;
}

.trip-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.site-shell {
  min-height: calc(100vh - 118px);
  padding: 22px;
}

.home-page {
  min-height: calc(100vh - 162px);
  align-content: start;
  gap: 24px;
  text-align: center;
}

.home-intro {
  display: grid;
  justify-items: center;
}

.home-logo {
  width: min(220px, 46vw);
  aspect-ratio: 1;
  border-radius: 30px;
  object-fit: cover;
  box-shadow: var(--inner-highlight), 0 28px 80px rgba(31, 44, 55, 0.18);
}

.home-page h1 {
  margin-top: 14px;
  max-width: none;
  font-size: clamp(2rem, 5vw, 4.2rem);
}

.trip-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.trip-tile {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 24px;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.3));
  box-shadow: var(--inner-highlight), 0 18px 48px rgba(31, 44, 55, 0.14);
  backdrop-filter: blur(28px) saturate(1.5);
}

.trip-tile:hover,
.trip-tile:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--inner-highlight), 0 24px 60px rgba(31, 44, 55, 0.2);
}

.trip-tile strong {
  position: relative;
  z-index: 1;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.trip-flag-art {
  position: relative;
  display: grid;
  min-height: 132px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  box-shadow: var(--inner-highlight), inset 0 -14px 34px rgba(31, 44, 55, 0.08);
  font-size: 2rem;
  font-weight: 900;
}

.flag-country .trip-flag-art {
  color: #fff;
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.34), transparent 30%),
    linear-gradient(135deg, rgba(16, 25, 35, 0.92), rgba(35, 62, 86, 0.82));
  font-size: 4.4rem;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.flag-state .trip-flag-art {
  color: #17324d;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.95) 0 30px, transparent 31px),
    linear-gradient(145deg, #ffffff, #edf5ff);
  font-size: 2.2rem;
}

.flag-state .trip-flag-art::before {
  content: "";
  position: absolute;
  width: 74px;
  height: 74px;
  border: 5px solid #1f4ea3;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(31, 44, 55, 0.12);
}

.flag-state .trip-flag-art {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.flag-france .trip-flag-art {
  background: linear-gradient(90deg, #1f4ea3 0 33.33%, #fff 33.33% 66.66%, #e63b43 66.66%);
}

.flag-italy .trip-flag-art {
  background: linear-gradient(90deg, #168b4d 0 33.33%, #fff 33.33% 66.66%, #d33b35 66.66%);
}

.flag-united-kingdom .trip-flag-art {
  background:
    linear-gradient(27deg, transparent 42%, #fff 42% 47%, #c8102e 47% 53%, #fff 53% 58%, transparent 58%),
    linear-gradient(153deg, transparent 42%, #fff 42% 47%, #c8102e 47% 53%, #fff 53% 58%, transparent 58%),
    linear-gradient(90deg, transparent 41%, #fff 41% 59%, transparent 59%),
    linear-gradient(0deg, transparent 36%, #fff 36% 64%, transparent 64%),
    linear-gradient(90deg, transparent 45%, #c8102e 45% 55%, transparent 55%),
    linear-gradient(0deg, transparent 42%, #c8102e 42% 58%, transparent 58%),
    #012169;
}

.flag-england .trip-flag-art {
  background:
    linear-gradient(90deg, transparent 43%, #c8102e 43% 57%, transparent 57%),
    linear-gradient(0deg, transparent 39%, #c8102e 39% 61%, transparent 61%),
    #fff;
}

.flag-japan .trip-flag-art {
  background: radial-gradient(circle at center, #bc002d 0 23%, transparent 24%), #fff;
}

.flag-united-states .trip-flag-art {
  background:
    linear-gradient(90deg, #21468b 0 42%, transparent 42%),
    repeating-linear-gradient(0deg, #b22234 0 10px, #fff 10px 20px);
}

.flag-massachusetts .trip-flag-art {
  background: #fff;
}

.flag-massachusetts .trip-flag-art::before {
  content: "";
  position: absolute;
  width: 54px;
  height: 54px;
  border: 5px solid #1f4ea3;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, #f2c94c 0 7px, transparent 8px),
    linear-gradient(135deg, transparent 44%, #1f4ea3 45% 55%, transparent 56%),
    #fff;
  box-shadow: 0 10px 24px rgba(31, 44, 55, 0.12);
}

.flag-generic .trip-flag-art {
  color: #fff;
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.42), transparent 28%),
    linear-gradient(135deg, #3fb7c3, #5b8dff 52%, #ff6f61);
}

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

.page-heading select {
  width: min(260px, 100%);
}

.places-page,
.map-page,
.flights-page,
.itinerary-page,
.calendar-page,
.budget-page {
  align-content: start;
}

.map-layout,
.flights-layout,
.builder-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1fr);
  gap: 18px;
}

.budget-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(420px, 1fr);
  gap: 18px;
}

.flights-page {
  gap: 18px;
}

.flight-search-form,
.flight-form,
.travel-form,
.budget-entry-form {
  display: grid;
  gap: 10px;
}

.external-link {
  display: inline-grid;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.flight-card {
  border-left-color: #5b8dff;
}

.car-rental-card {
  border-left-color: #5b8dff;
}

.accommodation-card {
  border-left-color: #9a7cff;
}

.food-card {
  border-left-color: #2f9d62;
}

.map-controls {
  display: grid;
  grid-template-columns: minmax(170px, 1fr);
  gap: 8px;
  width: min(260px, 100%);
}

.place-form {
  display: grid;
  gap: 10px;
}

.place-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.lookup-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.booked-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--inner-highlight), 0 14px 34px rgba(22, 43, 58, 0.08);
}

.booked-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #dc4f46;
  box-shadow: inset 0 2px 5px rgba(21, 37, 49, 0.18), 0 8px 18px rgba(38, 58, 75, 0.08);
  transition: background 180ms ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(21, 37, 49, 0.22);
  transition: transform 180ms ease;
}

.booked-toggle input:checked + .toggle-track {
  background: #2f9d62;
}

.booked-toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.booked-toggle input:focus-visible + .toggle-track {
  outline: 3px solid rgba(63, 183, 195, 0.38);
  outline-offset: 3px;
}

.filter-control {
  margin-bottom: 12px;
}

.filter-control span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.place-table {
  max-height: none;
}

.place-card {
  border-left: 8px solid #dc4f46;
}

.place-card.booked {
  border-left-color: #2f9d62;
}

.place-card.unbooked {
  border-left-color: #dc4f46;
}

.place-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.place-meta span {
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.42);
}

.place-card p {
  margin: 0;
  color: var(--muted);
}

.place-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(210px, 100%);
}

.price-edit span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.price-edit input {
  width: 118px;
  height: 34px;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: #dc4f46;
  font-size: 0.78rem;
  font-weight: 850;
}

.booked .status-pill,
.calendar-event.booked {
  background: linear-gradient(145deg, rgba(68, 181, 112, 0.92), rgba(33, 135, 82, 0.82));
}

.unbooked .status-pill,
.calendar-event.unbooked {
  background: linear-gradient(145deg, rgba(229, 83, 73, 0.92), rgba(185, 57, 51, 0.82));
}

.map-canvas {
  position: relative;
  min-height: 560px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    radial-gradient(circle at 22% 28%, rgba(91, 141, 255, 0.28), transparent 22%),
    radial-gradient(circle at 78% 68%, rgba(255, 111, 97, 0.22), transparent 26%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.22));
  background-size: 54px 54px, 54px 54px, auto, auto, auto;
}

.map-status {
  margin: -6px 0 14px;
  border-radius: 16px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--inner-highlight), 0 12px 30px rgba(31, 44, 55, 0.1);
  font-size: 0.88rem;
  font-weight: 760;
  backdrop-filter: blur(18px) saturate(1.45);
}

.leaflet-map,
.fallback-map {
  position: absolute;
  inset: 0;
  min-height: inherit;
  border-radius: inherit;
  overflow: hidden;
}

.leaflet-map[hidden],
.fallback-map[hidden] {
  display: none;
}

.leaflet-map {
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: inherit;
  background: rgba(255, 255, 255, 0.4);
}

.leaflet-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  font: inherit;
}

.leaflet-pane,
.leaflet-map-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-pane {
  z-index: 400;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-tile {
  width: 256px;
  height: 256px;
  user-select: none;
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  margin: 10px;
  pointer-events: auto;
}

.leaflet-control-zoom a {
  display: block;
  width: 30px;
  height: 30px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
  text-decoration: none;
  line-height: 30px;
}

.leaflet-control-container {
  font-weight: 800;
}

.map-number-tooltip {
  border: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  font-weight: 900;
}

.map-number-tooltip::before {
  display: none;
}

.fallback-map {
  display: grid;
  place-items: center;
  padding: 18px;
  background: transparent;
}

.map-pin {
  position: absolute;
  display: grid;
  gap: 4px;
  max-width: 150px;
  border: 0;
  border-radius: 16px;
  padding: 8px 10px;
  color: #fff;
  background: #dc4f46;
  box-shadow: 0 14px 34px rgba(31, 44, 55, 0.2);
  transform: translate(-50%, -50%);
}

.map-pin.booked {
  background: #2f9d62;
}

.map-pin span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  font-weight: 900;
}

.map-pin strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.calendar-grid {
  align-items: start;
}

.calendar-itinerary {
  margin-top: 18px;
}

.calendar-event {
  color: #fff;
}

.calendar-event small {
  font-weight: 750;
  opacity: 0.82;
}

.budget-summary {
  min-height: 220px;
}

.budget-summary > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.budget-summary > strong {
  display: block;
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  line-height: 1;
}

.budget-note {
  margin: -8px 0 0;
  color: var(--muted);
  font-weight: 780;
}

.budget-items-column {
  grid-column: auto;
}

@media (max-width: 1100px) {
  .site-hero-bar,
  .map-layout,
  .flights-layout,
  .budget-layout,
  .builder-grid {
    grid-template-columns: 1fr;
  }

  .view-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trip-actions {
    grid-template-columns: minmax(155px, 1fr) auto auto auto;
  }
}

@media (max-width: 720px) {
  .site-shell {
    padding: 14px;
  }

  .view-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: auto;
  }

  .trip-actions {
    grid-template-columns: minmax(155px, 1fr) auto auto;
  }

  .trip-actions .danger {
    grid-column: 3;
  }

  .site-hero-brand span {
    display: none;
  }

  .page-heading {
    display: grid;
    align-items: start;
  }

  .map-canvas {
    min-height: 420px;
  }

  .map-controls {
    grid-template-columns: 1fr;
  }

  .place-name-row {
    grid-template-columns: 1fr;
  }

  .place-actions,
  .price-edit {
    align-items: stretch;
    flex-direction: column;
  }

  .price-edit input {
    width: 100%;
  }

}

body:not(.is-authenticated) .site-hero-bar,
body:not(.is-authenticated) .site-shell {
  display: none;
}
