:root {
  --trips-text: var(--color-foreground-primary, #fff);
  --trips-muted: #b4bab8;
  --trips-line: #343b38;
  --trips-panel: #171b19;
  --trips-accent: #c2dfb8;
  --trips-ink: #142215;
  --trips-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --trips-mono: var(--shell-font, "JetBrains Mono", monospace);
}
* { box-sizing: border-box; }
html, body, #pwa-root { height: 100%; margin: 0; }
body { background: var(--color-background-canvas, #000); }
.trips-pane {
  height: 100%; color: var(--trips-text); background: #101311;
  font: 16px/1.5 var(--trips-font); text-align: left;
}
.trips-pane :where(h1,h2,h3,h4,p) { margin: 0; }
.trips-pane :where(h1,h2,h3,h4) { color: inherit; font-family: var(--trips-font); }
.trips-pane h1, .trips-pane h2 { font-weight: 590; letter-spacing: -.05em; line-height: 1.07; }
.trips-pane h1 { font-size: clamp(34px, 4.2vw, 54px); }
.trips-pane h1:focus { outline: none; }
.trips-pane h2 { font-size: clamp(26px, 3vw, 36px); }
.trips-pane button, .trips-pane input, .trips-pane textarea, .trips-pane select { font: inherit; }
.trips-pane button { cursor: pointer; appearance: none; -webkit-tap-highlight-color: transparent; }
.trips-pane button:disabled { opacity: .55; cursor: default; }
.trips-pane :where(button,select,input,textarea,summary):focus-visible { outline: 3px solid #91bdff; outline-offset: 3px; }
.trips-pane .travel-icon { width: 19px; height: 19px; flex: none; vertical-align: middle; }
.trip-scroll { height: 100%; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.app-header { background: #101311; border-bottom: 1px solid var(--trips-line); padding-top: env(safe-area-inset-top); }
.header-inner, .trip-page { width: min(100%, 1072px); margin-inline: auto; padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right)); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 10px; align-items: center; font: 600 21px var(--trips-font); letter-spacing: -.055em; }
.brand img { display: block; width: 32px; height: 32px; border-radius: 8px; }
.trip-page { padding-block: clamp(30px, 6vw, 68px) calc(72px + env(safe-area-inset-bottom)); }
.trips-pane .action {
  min-height: 44px; padding: 9px 15px; display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; font: 550 14px/1.25 var(--trips-font); color: var(--trips-text);
  overflow-wrap: anywhere; transition: background-color .15s, border-color .15s;
}
.trips-pane .action.primary { color: var(--trips-ink); background: var(--trips-accent); border-color: var(--trips-accent); }
.trips-pane .action.secondary, .trips-pane .header-settings { background: #1c211e; border-color: var(--trips-line); }
.trips-pane .header-settings { min-height: 40px; font-weight: 500; }
.trips-pane .action.text-button { background: transparent; padding-inline: 0; color: var(--trips-muted); }
.trips-pane .action.icon-button { width: 44px; padding: 0; border-color: var(--trips-line); border-radius: 50%; background: #202522; }
.trips-pane .action.danger { color: #ffb1a7; background: #372421; border-color: #64413b; }
.list-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.atlas-panel { position: relative; isolation: isolate; overflow: hidden; border: 1px solid #354b3d; border-radius: 20px; background: #182a20; }
.atlas-art { position: absolute; inset: 0; pointer-events: none; z-index: -1; background: url('./atlas.svg?trips-version=trips-frontends-v1') right center / auto 120% no-repeat; }
.atlas-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #182a20 22%, rgba(24,42,32,.96) 31%, rgba(24,42,32,.45) 53%, transparent 73%); }
.atlas-content { position: relative; width: min(58%, 560px); padding: clamp(28px, 5vw, 64px); overflow-wrap: anywhere; }
.first-trip { min-height: 322px; display: flex; align-items: center; }
.first-trip h2 { margin-block: 14px 8px; font-size: clamp(30px, 4vw, 46px); }
.first-trip p { max-width: 32ch; color: #d1ded4; font-size: 16px; }
.first-trip .primary { margin-top: 24px; }
.hero-icon { display: inline-flex; justify-content: center; align-items: center; width: 40px; height: 40px; border: 1px solid #5a7361; border-radius: 12px; color: #cee5c9; }
.hero-icon .travel-icon { width: 23px; height: 23px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 20px; border-bottom: 1px solid var(--trips-line); }
.trips-pane .filter { background: transparent; border: 1px solid transparent; border-radius: 999px; min-height: 40px; padding: 6px 15px; color: var(--trips-muted); font-size: 14px; }
.trips-pane .filter[aria-pressed=true] { background: #27352c; color: #ddf0d8; border-color: #415345; }
.trip-group { margin-top: 33px; }
.trip-group h2, .day-heading h3 { display: flex; gap: 10px; align-items: center; font: 550 19px/1.4 var(--trips-font); letter-spacing: -.03em; }
.count { color: var(--trips-muted); font: 400 12px/1 var(--trips-mono); }
.trip-grid { margin-top: 12px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit,minmax(min(100%,360px),1fr)); }
.trips-pane .trip-card {
  display: flex; align-items: center; gap: 17px; min-width: 0; padding: 19px; text-align: left;
  border: 1px solid var(--trips-line); border-radius: 14px; color: inherit; background: var(--trips-panel);
}
.trip-card > .travel-icon { color: var(--trips-muted); margin-left: auto; }
.card-date { flex: none; display: grid; place-content: center; text-align: center; width: 50px; height: 59px; border-radius: 10px; color: #dbecd7; background: #2a372e; }
.card-date span { text-transform: uppercase; font: 500 11px var(--trips-mono); letter-spacing: .07em; }
.card-date strong { font: 520 24px/1.15 var(--trips-font); }
.card-copy { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.card-copy strong { font-size: 19px; letter-spacing: -.025em; line-height: 1.25; }
.card-copy span, .card-copy small { color: var(--trips-muted); font-size: 14px; }
.card-copy small { margin-top: 2px; font: 12px/1.4 var(--trips-mono); }
.quiet-panel, .empty-itinerary { border: 1px dashed var(--trips-line); border-radius: 14px; padding: 22px; color: var(--trips-muted); }
.quiet-panel { margin-top: 22px !important; }
.details-top { margin: -15px 0 12px; }
.trip-hero .atlas-content { padding-block: 38px; }
.trip-hero h1 { margin-block: 13px; font-size: clamp(34px, 4.8vw, 58px); }
.hero-meta, .entry-meta, .day-heading > span { font: 500 12px/1.5 var(--trips-mono); }
.hero-meta { display: flex; align-items: center; gap: 8px; color: #ceddcf; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--trips-accent); }
.hero-location, .hero-date, .entry-body p { display: flex; align-items: baseline; gap: 8px; }
.hero-date { color: #ceddcf; margin-top: 6px !important; }
.hero-date .travel-icon, .hero-location .travel-icon, .entry-body p .travel-icon { width: 16px; height: 16px; align-self: flex-start; margin-top: 4px; }
.trip-tools { display: flex; gap: 23px; }
.trip-notes { margin: 10px 0 26px !important; white-space: pre-wrap; overflow-wrap: anywhere; color: #e0e5e0; }
.itinerary { margin-top: 38px; }
.itinerary > .list-heading { margin-bottom: 18px; }
.day-group + .day-group { margin-top: 27px; }
.day-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 13px 0 10px; border-bottom: 1px solid var(--trips-line); }
.day-heading > span { flex: none; color: var(--trips-muted); }
.timeline { display: grid; }
.entry-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px 2px; border-bottom: 1px solid var(--trips-line); }
.kind-icon, .empty-itinerary > span { display: grid; place-items: center; border-radius: 10px; width: 40px; height: 40px; flex: none; }
.kind-flight { color: #c2dbf5; background: #273341; }
.kind-stay { color: #e2cdec; background: #3a2d40; }
.kind-transport { color: #ecdcae; background: #3c3428; }
.kind-activity, .empty-itinerary > span { color: #c5dfbe; background: #2b382d; }
.entry-body { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.entry-meta { color: var(--trips-muted); font-size: 11px; }
.entry-body h4 { font-size: 19px; font-weight: 580; letter-spacing: -.025em; line-height: 1.35; }
.entry-body p { font-size: 14px; margin-top: 4px; color: var(--trips-muted); }
.entry-notes { margin-top: 9px; white-space: pre-wrap; font-size: 15px; }
.empty-itinerary { display: flex; gap: 16px; align-items: center; }
.empty-itinerary h3 { color: var(--trips-text); font-weight: 580; font-size: 17px; margin-bottom: 2px; }
.empty-itinerary p { font-size: 15px; }
.trip-dialog {
  color-scheme: dark; width: min(calc(100% - 32px), 520px); max-width: none;
  max-height: calc(100dvh - env(safe-area-inset-top) - 32px); overflow: auto; overscroll-behavior: contain;
  background: #191f1b; color: var(--trips-text); border: 1px solid #424e45; border-radius: 20px;
  padding: 0; box-shadow: 0 20px 80px #0008; font: 16px/1.5 var(--trips-font);
}
.trip-dialog::backdrop { background: rgba(0,0,0,.68); }
.dialog-body { padding: 26px; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 24px; }
.sheet-heading h2 { font-size: 26px; }
.sheet-heading .icon-button { width: 38px !important; min-height: 38px !important; }
.editor-fields { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; color: var(--trips-text); }
.field > span { font: 550 14px/1.4 var(--trips-font); color: #d7ded8; }
.field input, .field textarea, .field select {
  box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; min-height: 46px;
  font: 400 16px/1.45 var(--trips-font); color: var(--trips-text); background: #111613;
  padding: 10px 12px; border: 1px solid #454e47; border-radius: 9px;
}
.field input::-webkit-date-and-time-value { text-align: left; }
.field textarea { resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #9aa49c; }
.field-pair { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.extra-fields { border-bottom: 1px solid var(--trips-line); padding-bottom: 10px; }
.extra-fields summary { color: #d1e3ce; cursor: pointer; min-height: 40px; padding: 8px 0; font-size: 14px; }
.extra-fields[open] > :not(summary) { margin-top: 10px; }
.form-actions, .setting-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.form-actions { margin-top: 22px; justify-content: flex-end; border-top: 1px solid var(--trips-line); padding-top: 18px; }
.form-actions .danger:first-child { margin-right: auto; }
.confirm-copy { font-weight: 600; margin-bottom: 8px !important; overflow-wrap: anywhere; }
.setting-group + .setting-group { margin-top: 22px; border-top: 1px solid var(--trips-line); padding-top: 18px; }
.setting-group h3 { font: 580 18px var(--trips-font); margin-bottom: 6px; }
.setting-group p { overflow-wrap: anywhere; }
.setting-group .muted { color: var(--trips-muted); font-size: 14px; }
.setting-actions { margin-top: 10px; }
.workspace-list { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 12px; }
.workspace-list button { border: 1px solid var(--trips-line); border-radius: 8px; background: #27322b; color: inherit; min-height: 44px; overflow-wrap: anywhere; padding: 8px 12px; }
.workspace-create { display: flex; align-items: flex-end; gap: 8px; }
.workspace-create .field { flex: 1; }
.sheet-error, .view-alert { color: #ffbeb6; background: #392420; border: 1px solid #77483f; border-radius: 10px; padding: 12px; overflow-wrap: anywhere; }
.sheet-error { margin-bottom: 15px !important; }
.view-alert { position: absolute; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), 540px); z-index: 5; }
@media (hover:hover) {
  .trips-pane .primary:hover { background: #d2ebc9; }
  .trips-pane :is(.secondary,.header-settings,.icon-button,.trip-card,.filter):hover { border-color: #647266; }
  .trips-pane .text-button:hover { color: white; }
}
@media (max-width:620px) {
  .header-inner,.trip-page { padding-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right)); }
  .header-inner { min-height: 63px; }
  .header-settings .travel-icon { width: 16px; height: 16px; }
  .list-heading { margin-bottom: 18px; }
  .atlas-content { width: 74%; padding: 25px; }
  .atlas-art { background-size: auto 92%; background-position: 29% 4%; }
  .atlas-art::after { background: linear-gradient(90deg, rgba(24,42,32,.98) 10%,rgba(24,42,32,.90) 35%, rgba(24,42,32,.32) 72%,rgba(24,42,32,.05)); }
  .first-trip { display: flex; align-items: flex-end; min-height: 388px; }
  .first-trip .atlas-art { background-size: auto 71%; background-position: 60% -10%; }
  .first-trip .atlas-art::after { background: linear-gradient(0deg, #182a20 20%, rgba(24,42,32,.97) 36%, rgba(24,42,32,.82) 48%, rgba(24,42,32,.04) 82%); }
  .first-trip .atlas-content { width: 100%; padding-top: 150px; }
  .first-trip p { font-size: 15px; }
  .first-trip .hero-icon { display: none; }
  .first-trip .primary { margin-top: 18px; }
  .filters { gap: 2px; padding-bottom: 14px; }
  .trips-pane .filter { min-height: 40px; padding-inline: 10px; font-size: 13px; }
  .trip-hero .atlas-content { width: 88%; padding-block: 29px; }
  .trip-group { margin-top: 24px; }
  .itinerary { margin-top: 25px; }
  .entry-card { gap: 12px; }
  .empty-itinerary { align-items: flex-start; }
  .trip-dialog { margin: auto 0 0; width: 100%; border-radius: 20px 20px 0 0; max-height: calc(100dvh - env(safe-area-inset-top) - 16px); }
  .dialog-body { padding: 22px max(18px, env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
}
@media (max-width:340px) {
  .field-pair { grid-template-columns: minmax(0,1fr); }
  .trip-card { gap: 12px; }
}
@media (prefers-reduced-motion:reduce) { .trips-pane .action { transition: none; } }
