/* Trips — one stylesheet for every page. Mobile-first, one column, big type.
   Light + dark via prefers-color-scheme; a print sheet for paper handouts. */

:root {
  color-scheme: light dark;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f1eee7;
  --ink: #1b2126;
  --ink-2: #4a545c;
  --line: #d6d0c4;
  --accent: #0a6560;
  --accent-strong: #08524e;
  --accent-ink: #ffffff;
  --accent-soft: #e1f0ee;
  --now: #fff3cf;
  --now-line: #b07900;
  --warn-bg: #fff3cf;
  --warn-ink: #5c3d00;
  --warn-line: #b07900;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --success-bg: #e3f4e6;
  --success-line: #2f7d3b;
  --focus: #1a5fd0;
  --shadow: 0 1px 2px rgba(20, 25, 29, .06), 0 4px 14px rgba(20, 25, 29, .06);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14191d;
    --surface: #1c2328;
    --surface-2: #242c33;
    --ink: #eef2f4;
    --ink-2: #b5c0c8;
    --line: #3a4650;
    --accent: #5cc8bd;
    --accent-strong: #7fd8cf;
    --accent-ink: #08201e;
    --accent-soft: #163330;
    --now: #3a3014;
    --now-line: #e3b341;
    --warn-bg: #3a3014;
    --warn-ink: #f6dd9c;
    --warn-line: #e3b341;
    --danger: #ff8a7f;
    --danger-soft: #3d1f1c;
    --success-bg: #17301c;
    --success-line: #6cc47a;
    --focus: #8ab4ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  }
}

/* ------------------------------------------------------------- base */

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

html {
  font-size: 112.5%; /* 18px */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  overflow-wrap: break-word;
}

main {
  display: block;
  max-width: 42rem;
  margin: 0 auto;
  padding: .5rem 1rem 3rem;
}
main:focus { outline: none; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 2rem; letter-spacing: -.01em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 .75rem; }

a { color: var(--accent); text-underline-offset: .15em; }
a:hover { color: var(--accent-strong); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.icon {
  width: 1.2em;
  height: 1.2em;
  flex: none;
  vertical-align: -.22em;
}

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

.muted { color: var(--ink-2); }
[hidden] { display: none !important; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 100;
  background: var(--surface);
  color: var(--ink);
  padding: .75rem 1rem;
  border-radius: 10px;
  border: 2px solid var(--focus);
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* ------------------------------------------------------------- header / footer */

.site-header {
  max-width: 42rem;
  margin: 0 auto;
  padding: .75rem 1rem .25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
}
.brand:hover { color: var(--ink); }

.logo { width: 32px; height: 32px; flex: none; }
.logo-small { width: 20px; height: 20px; vertical-align: -.3em; margin-right: .3em; }
.logo-tile { fill: var(--accent); }
.logo-route { stroke: var(--accent-ink); }
.logo-pin { fill: var(--accent-ink); }
.logo-dot { fill: var(--accent); }

.site-footer {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 6rem;
  color: var(--ink-2);
  font-size: .9rem;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .55rem 1.1rem;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--accent-soft); color: var(--accent-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary, .btn-map {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover, .btn-map:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }

.btn-quiet { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }

.btn-danger { border-color: var(--danger); color: var(--danger); background: var(--surface); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.dialog .btn-danger { background: var(--danger); color: var(--surface); }

.btn-small { min-height: 44px; padding: .4rem .8rem; font-size: .95rem; }
.btn-big { min-height: 56px; padding: .8rem 1.5rem; font-size: 1.1rem; }

.button-row, .action-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin: .75rem 0;
}

/* ------------------------------------------------------------- trip view */

.trip-header { margin: .5rem 0 1.25rem; }

.eyebrow {
  margin: 0 0 .25rem;
  color: var(--ink-2);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.trip-meta {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: 0 0 .35rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.trip-meta .icon { margin-top: .2em; color: var(--accent); }
.trip-tz { color: var(--ink-2); font-weight: 500; }

.trip-summary {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  white-space: pre-line;
}

/* Now / Up next */
.now-card {
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.2rem;
  border: 2px solid var(--accent);
  border-radius: 18px;
  background: var(--accent-soft);
}
.now-block + .now-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.now-label {
  margin: 0;
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.now-title { margin: 0; font-size: 1.4rem; font-weight: 800; line-height: 1.3; }
.now-title a { color: var(--ink); }
.now-when { display: flex; align-items: center; gap: .4rem; margin: .2rem 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.now-place { margin: .1rem 0 0; color: var(--ink-2); }
.now-headline { margin: 0; font-size: 1.5rem; font-weight: 800; line-height: 1.3; }
.now-sub, .now-first { margin: .35rem 0 0; }
.now-first a { font-weight: 700; }
.now-actions { margin-top: 1rem; }

/* Day navigation chips — scroll sideways inside themselves, never the page */
.day-nav { margin: 0 0 1.25rem; }
.day-nav ul {
  display: flex;
  gap: .5rem;
  margin: 0;
  padding: .1rem .1rem .5rem;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}
.day-nav a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  min-width: 5rem;
  padding: .35rem .8rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}
.day-nav a:hover { border-color: var(--accent); }
.day-nav-num { font-weight: 800; }
.day-nav-date { font-size: .85rem; color: var(--ink-2); }

.tick-note {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  color: var(--ink-2);
  font-size: .95rem;
}
.tick-note .icon { margin-top: .2em; color: var(--accent); }

/* Days and items */
.day { margin: 0 0 2rem; scroll-margin-top: .5rem; }
.day-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: .6rem 0 .35rem;
  background: var(--bg);
  font-size: 1.45rem;
}
.day-num { font-weight: 800; }
.day-sep { color: var(--ink-2); }
.day-date { font-weight: 700; }
.day-label { margin: 0 0 .75rem; font-size: 1.1rem; color: var(--ink-2); font-weight: 600; }
.day-empty { color: var(--ink-2); font-style: italic; }

.items { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .9rem; }

.item {
  position: relative;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scroll-margin-top: 4.5rem;
}
.item.kind-note { border-left-color: var(--line); }

.item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .9rem;
  margin-bottom: .2rem;
}
.item-time {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.time-sep { color: var(--ink-2); font-weight: 600; }
.time-any, .time-until { color: var(--ink-2); font-weight: 700; font-size: 1.15rem; }
.item-kind {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
  padding: .1rem .6rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 600;
}
.item-kind .icon { color: var(--accent); }
.item-title { margin: .25rem 0 .2rem; font-size: 1.3rem; font-weight: 800; }
.item-place { margin: 0; font-weight: 700; }
.item-address { margin: 0; color: var(--ink-2); }
.item-notes {
  margin: .6rem 0 0;
  padding: .6rem .8rem;
  background: var(--surface-2);
  border-radius: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.item-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.item-actions .btn { flex: 1 1 12rem; }
.item-actions .tick { flex: 0 0 auto; }
.link-host { font-weight: 500; opacity: .85; margin-left: .2em; }

.badge {
  display: inline-block;
  padding: .15rem .65rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 800;
}
.badge-now { background: var(--accent); color: var(--accent-ink); }
.badge-next { background: var(--now); color: var(--ink); border: 1px solid var(--now-line); }

.item.is-now { border: 3px solid var(--accent); border-left-width: 8px; box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.item.is-next { border-left-color: var(--now-line); }

.tick {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  justify-content: center;
  min-height: 48px;
  padding: 0 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  user-select: none;
}
.tick:hover { border-color: var(--accent); }
.tick-box { width: 1.4rem; height: 1.4rem; margin: 0; accent-color: var(--accent); cursor: pointer; }
.item.is-done { opacity: .62; }
.item.is-done .item-title { text-decoration: line-through; text-decoration-thickness: 2px; }
.item.is-done .tick { border-color: var(--accent); }

/* Footer actions */
.trip-actions {
  margin-top: 2.5rem;
  padding: 1.25rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.trip-actions h2 { font-size: 1.25rem; }
.action-row .btn { flex: 1 1 12rem; }
.share-url { color: var(--ink-2); font-size: .95rem; }
.url-text { font-family: var(--mono); font-size: .9rem; color: var(--ink); overflow-wrap: anywhere; }
.privacy-note { display: flex; gap: .5rem; align-items: flex-start; margin: 0; color: var(--ink-2); font-size: .95rem; }
.privacy-note .icon { margin-top: .2em; color: var(--accent); }

/* ------------------------------------------------------------- toast & dialog */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 50;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .75rem;
  max-width: calc(100vw - 2rem);
  border-radius: 12px;
  font-weight: 700;
}
.toast:not(:empty) {
  padding: .8rem 1.1rem;
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
.page-editor .toast { bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
.toast-action {
  min-height: 44px;
  padding: 0 .9rem;
  border: 2px solid currentColor;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.dialog {
  width: min(32rem, calc(100vw - 2rem));
  padding: 1.5rem;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.dialog::backdrop { background: rgba(10, 14, 17, .55); }
.dialog h2 { font-size: 1.3rem; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; margin-top: 1.25rem; }

/* ------------------------------------------------------------- home */

.hero { padding: 1.25rem 0 1rem; }
.hero h1 { font-size: 2.3rem; }
.lead { font-size: 1.2rem; color: var(--ink-2); }

.how, .example, .promise, .my-trips { margin-top: 2.5rem; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: .9rem; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: .9rem 1rem .9rem 3.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: .9rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  text-align: center;
  line-height: 1.9rem;
}

.example-frame {
  position: relative;
  padding: 1.25rem 1rem .5rem;
  border: 2px dashed var(--line);
  border-radius: 20px;
}
.example-caption {
  position: absolute;
  top: -.85rem;
  left: 1rem;
  margin: 0;
  padding: 0 .5rem;
  background: var(--bg);
  color: var(--ink-2);
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.example-frame .day { margin-bottom: 1rem; }
.example-frame .day-heading { position: static; font-size: 1.3rem; background: transparent; }

.promise-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.promise-list li { display: flex; gap: .75rem; align-items: flex-start; }
.promise-list .icon { width: 1.6rem; height: 1.6rem; margin-top: .1rem; color: var(--accent); }

.trip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.trip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.trip-row-text { flex: 1 1 12rem; min-width: 0; }
.trip-row-title { margin: 0; font-weight: 800; font-size: 1.1rem; }
.trip-row-meta { margin: 0; font-size: .9rem; }
.trip-row-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.not-found { padding: 2rem 0; }

/* ------------------------------------------------------------- notices */

.notice {
  position: relative;
  margin: 0 0 1rem;
  padding: .9rem 3.2rem .9rem 1.1rem;
  border-radius: 12px;
  border-left: 6px solid var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.notice p { margin: 0 0 .35rem; }
.notice p:last-of-type { margin-bottom: 0; }
.notice-title { font-weight: 800; }
.notice-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.notice-warn { border-left-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.notice-error { border-left-color: var(--danger); background: var(--danger-soft); }
.notice-success { border-left-color: var(--success-line); background: var(--success-bg); }
.notice-privacy { border-left-color: var(--accent); background: var(--accent-soft); }
.notice-close {
  position: absolute;
  top: .25rem;
  right: .25rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.notice-close:hover { background: rgba(127, 127, 127, .15); }

/* ------------------------------------------------------------- editor */

.editor h1 { margin-top: .5rem; }
.loading { color: var(--ink-2); }

.tip {
  margin: 0 0 1.25rem;
  padding: .9rem 1.1rem;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  font-size: .98rem;
}
.tip p { margin: 0; }

.panel {
  margin: 0 0 1.25rem;
  padding: 1.1rem 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel:focus { outline: none; }
.panel:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.panel > h2 { font-size: 1.3rem; }

.field { margin: 0 0 1rem; min-width: 0; }
.field label, .link-box > label { display: block; margin-bottom: .2rem; font-weight: 700; }
.req { font-weight: 500; color: var(--ink-2); }
.hint { margin: 0 0 .35rem; color: var(--ink-2); font-size: .92rem; }

input[type="text"], input[type="url"], input[type="date"], input[type="time"], select, textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: .55rem .75rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* never below 16px, so phones don't zoom */
  line-height: 1.4;
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[aria-invalid="true"] { border-color: var(--danger); }
select { appearance: auto; }

.field-error:not(:empty) { margin-top: .3rem; color: var(--danger); font-weight: 700; font-size: .95rem; }

.privacy-findings p {
  margin: .35rem 0 0;
  padding: .35rem .65rem;
  border-radius: 8px;
  font-size: .92rem;
}
.privacy-redact { background: var(--accent-soft); border-left: 4px solid var(--accent); }
.privacy-warn { background: var(--warn-bg); color: var(--warn-ink); border-left: 4px solid var(--warn-line); }

.field-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
.field-row-3 { grid-template-columns: 1fr 1fr; }
.field-row-3 > .field:last-child { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .day-card { padding: 1rem 1.1rem 1.1rem; }
  .item-card { padding: .9rem 1rem 1rem; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row-3 { grid-template-columns: 1fr 1fr 1.3fr; }
  .field-row-3 > .field:last-child { grid-column: auto; }
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
}
.check-row input { width: 1.4rem; height: 1.4rem; margin: 0; accent-color: var(--accent); }

.quick-start summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .2rem .75rem;
  min-height: 44px;
  cursor: pointer;
  list-style-position: inside;
}
.quick-start summary::marker, .item-more summary::marker { color: var(--accent); }
.summary-title { font-weight: 800; font-size: 1.15rem; }
.summary-hint { color: var(--ink-2); font-size: .92rem; }
.quick-start[open] summary { margin-bottom: .75rem; }
.quick-start label { display: block; font-weight: 700; margin-bottom: .2rem; }
.qs-example {
  margin: 0 0 1rem;
  padding: .75rem .9rem;
  background: var(--surface-2);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: .85rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.qs-result:not(:empty) { padding: .6rem .8rem; background: var(--accent-soft); border-radius: 10px; }

.day-list, .item-list { list-style: none; margin: 0; padding: 0; }
.day-list { display: grid; gap: 1.25rem; }
.item-list { display: grid; gap: .9rem; margin: .5rem 0 1rem; }

.day-card, .item-card { margin: 0; min-width: 0; }
.days-panel { padding: 0; background: transparent; border: 0; }
.days-panel > h2 { margin-top: .5rem; }
.remember-panel .hint { margin: .2rem 0 0; }
.day-card {
  padding: .75rem .75rem .9rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.day-card > legend {
  padding: 0 .4rem;
  font-size: 1.2rem;
  font-weight: 800;
}
.item-card {
  padding: .7rem .75rem .8rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
}
.item-card > legend {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem .5rem;
  padding: 0 .35rem;
  font-weight: 700;
  max-width: 100%;
}
.item-num { color: var(--ink-2); }
.item-summary { overflow-wrap: anywhere; }

.item-more { margin: 0 0 .75rem; }
.item-more summary {
  min-height: 44px;
  padding: .55rem 0;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  list-style-position: inside;
}
.item-more[open] summary { margin-bottom: .5rem; }

.day-controls, .item-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  justify-content: space-between;
}
.control-group, .item-controls { display: flex; flex-wrap: wrap; gap: .5rem; }
.item-controls { justify-content: flex-end; }
.btn-add { border-style: dashed; }
.day-controls { margin-top: .5rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.btn-remove { color: var(--danger); }

.links-panel { border: 2px solid var(--accent); }
.link-box { margin: 0 0 1rem; }
.link-box input { font-family: var(--mono); font-size: 1rem; }
.link-box .button-row { margin: .5rem 0 0; }
.link-box-private { padding: .8rem .9rem; border-radius: 12px; background: var(--warn-bg); border-left: 5px solid var(--warn-line); }
.link-warn { margin: 0 0 .5rem; color: var(--warn-ink); font-weight: 700; font-size: .95rem; }

.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }

.blocked h2:focus { outline: none; }

.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1rem;
  margin: 1.5rem -1rem 0;
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, .08);
}
.save-bar .btn-big { flex: 1 1 14rem; }
.save-state { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 700;
  font-size: .95rem;
}
.status-saved { color: var(--accent-strong); }
.status-error, .status-conflict, .status-invalid, .status-full { background: var(--danger-soft); color: var(--danger); }
.create-error {
  flex: 1 1 100%;
  margin: 0;
  padding: .6rem .8rem;
  border-left: 4px solid var(--danger);
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.4;
}

/* ------------------------------------------------------------- small screens */

@media (max-width: 420px) {
  h1 { font-size: 1.75rem; }
  .hero h1 { font-size: 2rem; }
  .item { padding: .9rem .9rem 1rem; }
  .item-time { font-size: 1.4rem; }
  .item-controls .btn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .item-controls .btn-small { min-width: 44px; padding: .4rem .6rem; }
}

/* ------------------------------------------------------------- motion */

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

/* ------------------------------------------------------------- print */

@media print {
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --ink: #000; --ink-2: #333;
    --line: #999; --accent: #000; --accent-soft: #fff;
  }
  @page { margin: 14mm 12mm; }
  html { font-size: 11.5pt; }
  body { background: #fff; color: #000; }
  main { max-width: none; padding: 0; }

  .site-header, .skip-link, .now-card, .day-nav, .tick-note, .tick, .badge,
  .item-actions, .action-row, .trip-actions h2, .toast, .site-footer,
  .save-bar, .notices, .dialog { display: none !important; }

  .trip-header { margin: 0 0 8mm; }
  h1 { font-size: 20pt; }
  .trip-summary { border: 1px solid #999; }
  .day { margin-bottom: 6mm; }
  .day-heading { position: static; font-size: 15pt; padding: 2mm 0 1mm; border-bottom: 2px solid #000; break-after: avoid; page-break-after: avoid; }
  .day-label { break-after: avoid; page-break-after: avoid; }
  .items { gap: 3mm; }
  .item {
    box-shadow: none;
    border: 1px solid #999;
    border-left: 4px solid #000;
    padding: 3mm 4mm;
    break-inside: avoid;
    page-break-inside: avoid;
    opacity: 1 !important;
  }
  .item.is-done .item-title { text-decoration: none; }
  .item-time { font-size: 14pt; }
  .item-title { font-size: 13pt; }
  .item-kind { background: none; padding: 0; }
  .item-notes { background: none; padding: 0; }
  .trip-actions { border: 0; padding: 0; margin-top: 6mm; }
  a { color: #000; text-decoration: none; }
}

/* ------------------------------------------------- privacy & save states */

.footer-promise { margin: .5rem 0 0; }
.notice-list { margin: .35rem 0 0; padding-left: 1.2rem; }
.notice-list li { margin: 0 0 .3rem; }
.notice-list li:last-child { margin-bottom: 0; }
.link-never { margin: .45rem 0 0; color: var(--warn-ink); font-weight: 800; font-size: .95rem; }
.privacy-danger { background: var(--danger-soft); color: var(--danger); border-left: 4px solid var(--danger); font-weight: 700; }
.field-danger input, .field-danger textarea { border-color: var(--danger); }
.status-paused, .status-retrying { background: var(--warn-bg); color: var(--warn-ink); }
/* Longer save states ("Saving paused for a moment…") wrap inside the bar
   instead of pushing Preview onto a second row on phones. */
.save-bar > .save-state { flex: 1 1 0; min-width: 0; }
.save-state .status-pill { min-width: 0; }
