:root {
  color-scheme: light;
  --paper:#f7f2e8;
  --surface:#fffbf4;
  --ink:#202e27;
  --muted:#596258;
  --line:#d9d4c8;
  --forest:#243e33;
  --forest-dark:#1c3027;
  --sage:#e5eadf;
  --rust:#843e2d;
  --sand:#e9dac4;
  --focus:#9a4b30;
  --serif:Iowan Old Style, Baskerville, Georgia, serif;
  --sans:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --gutter:clamp(16px, 5vw, 34px);
  --safe-bottom:env(safe-area-inset-bottom, 0px);
  font:16px/1.5 var(--sans);
  background:var(--paper);
  color:var(--ink);
}
html { min-height:100%; }
body { margin:0; min-width:0; }
*, *::before, *::after { box-sizing:border-box; }
[hidden] { display:none !important; }
h1,h2,h3,p,figure,fieldset { margin:0; }
h1,h2,h3 { font-family:var(--serif); font-weight:500; line-height:1.08; overflow-wrap:anywhere; }
h1 { font-size:clamp(2.5rem, 10.5vw, 4.2rem); letter-spacing:-.055em; }
h2 { font-size:clamp(1.6rem, 6vw, 2.15rem); letter-spacing:-.037em; }
h3 { font-size:1.35rem; letter-spacing:-.023em; }
p,span,a { overflow-wrap:anywhere; }
button,input,select,textarea { font:inherit; }
button,summary,a { -webkit-tap-highlight-color:transparent; }
button,summary { cursor:pointer; }
button { color:inherit; }
button:disabled { cursor:default; opacity:.48; }
button:focus-visible,summary:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline:2px solid var(--focus);
  outline-offset:3px;
}
input:not([type=checkbox]),select,textarea {
  display:block; width:100%; min-width:0; min-height:46px; padding:.57rem .65rem;
  color:var(--ink); border:1px solid #aaa99d; border-radius:10px; background:var(--surface);
}
select { text-overflow:ellipsis; }
textarea { resize:vertical; }
label { min-width:0; font-size:.88rem; font-weight:620; }
label > input:not([type=checkbox]),label > select,label > textarea { margin-top:.26rem; font-size:1rem; font-weight:400; }
a { color:inherit; }
summary { min-height:44px; padding:.66rem 0; font-weight:630; }
summary > span { color:var(--muted); font-weight:450; font-size:.8em; margin-inline-start:.24rem; }
img,video { display:block; max-width:100%; }
audio { display:block; width:100%; min-width:0; height:52px; }
.sr-only { position:absolute; inline-size:1px; block-size:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.shell {
  max-width:830px; min-height:100svh; margin-inline:auto; padding-inline:var(--gutter);
  padding-bottom:calc(103px + var(--safe-bottom)); padding-top:env(safe-area-inset-top, 0px);
}
.masthead {
  display:flex; align-items:center; justify-content:space-between; height:74px; gap:12px;
  border-bottom:1px solid var(--line); margin-bottom:18px;
}
.wordmark { font:700 2.04rem/1 var(--serif); letter-spacing:.092em; text-decoration:none; display:grid; grid-auto-flow:column; align-items:center; min-height:44px; }
.wordmark span { color:var(--rust); margin-left:-.1em; }
.avatar {
  display:grid; place-items:center; width:44px; height:44px; border-radius:50%;
  background:var(--sage); border:1px solid #bcc6b8; font:600 1.3rem var(--serif);
}
.primary,.secondary,.danger,.text-button,.icon-button,.place-chip,.link-button {
  display:inline-flex; align-items:center; justify-content:center; gap:.4rem; min-height:44px;
  border:1px solid transparent; border-radius:10px; padding:.48rem .86rem; font-weight:640;
  font-size:.89rem; text-align:center; text-decoration:none;
}
.primary { background:var(--forest); color:var(--surface); }
.primary:hover:not(:disabled) { background:var(--forest-dark); }
.secondary { background:var(--surface); border-color:var(--line); }
.secondary:hover:not(:disabled), .place-chip:hover { background:#eee7d9; }
.danger { color:#fffaf3; background:var(--rust); }
.text-button { background:transparent; color:var(--rust); padding-inline:.35rem; }
.text-button:hover { text-decoration:underline; }
.icon-button { padding:0; width:44px; flex:none; color:var(--ink); background:var(--surface); border-color:var(--line); font-size:1.25rem; }
.notice { background:#f0e3ce; color:#563922; padding:.7rem .84rem; border-radius:10px; font-size:.875rem; }
.muted { color:var(--muted); font-size:.91rem; }
.kicker { color:var(--rust); font-size:.69rem; line-height:1.45; font-weight:740; letter-spacing:.115em; text-transform:uppercase; }
.stack { display:grid; gap:.8rem; }
.row { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.section-bar { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.section-bar h2 { min-width:0; }
.section-bar > button { flex-shrink:0; }
.notice#boot { margin-bottom:14px; }
.login {
  overflow:hidden; background:var(--surface); border:1px solid var(--line); border-radius:22px; box-shadow:0 12px 38px #58462512;
}
.login-art {
  display:flex; flex-direction:column; justify-content:flex-end; gap:10px; min-height:clamp(285px, 62vw, 440px);
  padding:clamp(24px, 6vw, 60px); color:#fff6e7;
  background:linear-gradient(0deg,#12271ff2 1%,#192f239e 44%,#2d402713 100%),url('/route-cover.webp') 50% 49%/cover,var(--forest);
}
.login-art .kicker { color:#f3d8ac; }
.login-art h1 { font-size:clamp(2.4rem, 10.9vw, 5.3rem); }
.login-actions { display:grid; gap:12px; padding:clamp(17px, 5vw, 38px); }
.login-actions details { border-block:1px solid var(--line); }
.login-actions details[open] { padding-bottom:12px; }
#enrollment { display:grid; gap:10px; margin-top:10px; }
.credit { display:block; padding:10px 0; min-height:44px; color:var(--muted); font-size:.73rem; text-underline-offset:3px; }
.trip-hero {
  overflow:hidden; position:relative; isolation:isolate; min-height:213px; display:flex; align-items:flex-end;
  background:radial-gradient(ellipse at 106% -28%,#597360 0%,#304d3e 67%,#243e33 92%);
  color:#fff6e5; padding:clamp(22px, 6vw, 47px); border-radius:20px;
}
.trip-hero::before,.trip-hero::after {
  content:""; position:absolute; z-index:-1; border:1px solid #ecdbc24a; border-radius:50%;
  width:340px; height:210px; top:-90px; right:-135px; transform:rotate(-27deg);
  box-shadow:0 0 0 14px #ecdbc219,0 0 0 32px #ecdbc217,0 0 0 52px #ecdbc215,0 0 0 76px #ecdbc211;
  pointer-events:none;
}
.trip-hero::after { top:auto; right:-245px; bottom:-180px; transform:rotate(-42deg); }
.trip-hero .kicker { color:#f4d4a9; margin-bottom:9px; }
.trip-words { min-width:0; }
.today-context { margin-top:10px; color:#eceddf; }
progress {
  display:block; margin-top:17px; width:min(178px, 100%); height:5px; appearance:none; border:0; border-radius:4px; background:#ffffff3c;
}
progress::-webkit-progress-bar { background:#ffffff3c; border-radius:4px; }
progress::-webkit-progress-value { background:#e7bd85; border-radius:4px; }
progress::-moz-progress-bar { background:#e7bd85; border-radius:4px; }
.route-section { margin-top:16px; padding:12px 0 18px; border-bottom:1px solid var(--line); }
.place-chips { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.place-chip { background:var(--surface); border-color:var(--line); text-align:left; max-width:100%; }
.route-days { display:grid; gap:4px; }
.route-day {
  width:100%; min-height:44px; text-align:left; padding:.52rem .65rem; background:var(--surface); border:1px solid var(--line); border-radius:8px;
}
.route-day[aria-current] { background:var(--sage); color:var(--forest-dark); font-weight:630; }
.route-city > .route-day { margin-bottom:5px; }
.feed-bar { margin:17px 0 8px; }
.pinned-spot:not(:empty) { margin-block:18px; }
#page:focus { outline:none; }
.section-heading { padding:7px 0 18px; }
.section-heading .kicker { margin-bottom:5px; }
.filters {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));
  gap:8px; padding:10px 0; min-width:0;
}
.filters > label { color:var(--muted); }
.segmented { display:flex; gap:4px; margin:6px 0 14px; padding:4px; background:#eae5da; border-radius:12px; }
.segment {
  min-width:0; flex:1; min-height:44px; background:transparent; border:1px solid transparent;
  border-radius:9px; font-size:.82rem; font-weight:640; padding:.35rem .2rem;
}
.segment[aria-pressed="true"] { background:var(--surface); border-color:var(--line); }
.page-panel { display:grid; gap:14px; }
.loading { min-height:64px; }
.empty,.empty-note {
  padding:clamp(17px, 5vw, 28px); background:var(--surface); border:1px solid var(--line); border-radius:15px;
}
.empty .muted { margin:.44rem 0 .65rem; }
.empty h3 { font-size:1.65rem; }
.entry {
  border:1px solid var(--line); border-radius:16px; overflow:hidden; background:var(--surface); min-width:0;
}
.entry-head { padding:10px 14px; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.entry-byline { font-size:.88rem; font-weight:710; }
.entry-context,.media-caption { color:var(--muted); font-size:.77rem; }
.entry-actions { font-size:1.45rem; }
.medium { background:#e6e9df; min-width:0; position:relative; }
.medium-photo img,.medium-video video { width:100%; max-height:62vh; object-fit:cover; }
.medium-photo img { aspect-ratio:4 / 3; }
.medium-audio { padding:12px; background:var(--sage); }
.audio-name { font-size:.84rem; font-weight:640; display:block; margin-bottom:2px; }
.photo-open { width:100%; display:block; border:0; background:transparent; padding:0; }
.photo-open:focus-visible { outline-offset:-4px; }
.media-placeholder { display:grid; place-items:center; min-height:82px; color:var(--muted); padding:8px; font-size:.84rem; }
.media-caption { padding:6px 14px 10px; }
.entry-text { white-space:pre-wrap; padding:12px 14px 15px; overflow-wrap:anywhere; }
.carousel { display:flex; flex-wrap:wrap; padding:0 10px; }
.carousel-button {
  min-width:44px; min-height:44px; border:0; background:transparent; color:var(--muted); font-size:.75rem;
}
.carousel-button[aria-pressed="true"] { font-weight:750; color:var(--forest); text-decoration:underline; text-underline-offset:4px; }
.entry-emotions { padding:0 14px 14px; }
.entry-head:last-child { padding-block:14px; }
.observer-entry .media-caption { padding-block:10px; }
.dock {
  z-index:3; position:fixed; inset:auto 0 0; margin-inline:auto; max-width:830px; width:100%;
  display:flex; align-items:stretch; justify-content:space-around; gap:2px;
  padding:5px max(5px, env(safe-area-inset-right)) calc(5px + var(--safe-bottom)) max(5px, env(safe-area-inset-left));
  background:#fffbf4; border-top:1px solid var(--line); box-shadow:0 -6px 27px #2c27190c;
}
.dock-item {
  display:grid; place-items:center; align-content:center; min-height:59px; gap:1px; min-width:0;
  flex:1; color:var(--muted); background:none; border:1px solid transparent; border-radius:10px;
  padding:2px 1px; font-size:clamp(.65rem, 2.6vw, .76rem); line-height:1.15; font-weight:640;
}
.dock-item[aria-current] { background:var(--sage); color:var(--forest-dark); }
.dock-icon { font:500 1.42rem/1.1 var(--sans); min-height:26px; }
.dock-capture .dock-icon {
  display:grid; place-items:center; width:37px; height:33px; min-height:33px; font:400 1.55rem/1 var(--sans);
  background:var(--rust); border-radius:11px; color:#fff5eb;
}
.toast {
  z-index:8; position:fixed; bottom:calc(79px + var(--safe-bottom)); inset-inline:14px; margin-inline:auto;
  width:fit-content; max-width:calc(100% - 28px); background:var(--forest-dark); color:#fff8eb;
  padding:9px 13px; border-radius:10px; font-size:.86rem; pointer-events:none;
}
.sheet {
  width:min(100%, 580px); max-width:100%; max-height:calc(var(--visible-height, 100dvh) - env(safe-area-inset-top, 0px));
  position:fixed; inset:auto 0 var(--keyboard-offset, 0px); margin:0 auto; padding:0; background:var(--paper); color:var(--ink);
  border:1px solid var(--line); border-radius:18px 18px 0 0; overflow:hidden;
}
.sheet[open] { display:flex; flex-direction:column; }
.sheet::backdrop { background:#19241dc7; }
.sheet > form { display:flex; min-height:0; flex-direction:column; }
.sheet-head {
  flex-shrink:0; display:flex; justify-content:space-between; align-items:center; gap:8px;
  padding:11px max(14px,env(safe-area-inset-right)) 10px max(14px,env(safe-area-inset-left));
  background:var(--surface); border-bottom:1px solid var(--line);
}
.sheet-body {
  min-height:0; overflow:auto; overscroll-behavior:contain; padding:14px max(14px,env(safe-area-inset-right)) 16px max(14px,env(safe-area-inset-left));
}
#overlay .sheet-body { padding-bottom:calc(16px + var(--safe-bottom)); }
#overlay-status { margin:0 14px calc(10px + var(--safe-bottom)); }
#overlay[data-mode="lightbox"] img { aspect-ratio:auto; object-fit:contain; max-height:75dvh; background:var(--forest-dark); }
.sheet-actions {
  display:flex; flex-shrink:0; align-items:center; gap:6px; flex-wrap:wrap; border-top:1px solid var(--line); background:var(--surface);
  padding:7px max(12px,env(safe-area-inset-right)) calc(7px + var(--safe-bottom)) max(12px,env(safe-area-inset-left));
}
.sheet-actions .primary { flex:1 1 125px; }
.sheet-actions .text-button { font-size:.81rem; }
.fields { border:0; padding:0; min-width:0; display:grid; gap:9px; }
.fields > details { border-top:1px solid var(--line); }
.fields > textarea { min-height:88px; }
#editor-status,#conflict-actions { margin-bottom:11px; }
#conflict-actions { margin-top:10px; }
.capture-actions { display:flex; align-items:flex-start; gap:8px; flex-wrap:wrap; }
.capture-actions > button { flex:1 1 133px; }
.capture-more { flex:1 1 115px; }
.capture-more > summary { padding-inline:8px; color:var(--muted); font-size:.86rem; }
.capture-more button { min-height:44px; border:1px solid var(--line); border-radius:8px; background:var(--surface); font-size:.82rem; }
.capture-more .stack { gap:4px; }
.inset { padding:0 4px 10px; }
.attachments { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,185px),1fr)); gap:8px; }
.file-card { min-width:0; border-radius:10px; background:var(--surface); border:1px solid var(--line); overflow:hidden; }
.file-card img,.file-card video { max-height:200px; }
.file-card > details { padding:0 8px 2px; }
.file-card > .secondary { margin:6px; }
.check,.chip {
  display:flex; align-items:center; gap:8px; min-height:44px; padding:.3rem .54rem; cursor:pointer;
  border:1px solid var(--line); border-radius:9px; background:var(--surface);
}
.check input,.chip input { accent-color:var(--forest); flex:none; margin:0; width:17px; height:17px; }
.file-card .check { margin-top:8px; }
.chips { display:flex; align-items:center; flex-wrap:wrap; gap:5px; }
.chip:has(:checked) { border-color:var(--forest); background:var(--sage); }
.emotion-tag { border-radius:20px; background:var(--sage); padding:3px 9px; font-size:.75rem; }
.emotion-awe,.emotion-surprise { color:#68391f; }
.emotion-calm,.emotion-reflection { color:#364c39; }
.emotion-joy,.emotion-tenderness { color:#733929; }
.emotion-irritation,.emotion-overload { color:#6e3c3e; }
.emotion-sadness { color:#3e4968; }
.selection-list { display:grid; gap:6px; }
.selection-row {
  min-width:0; display:flex; align-items:center; gap:6px; justify-content:space-between;
  padding:.3rem .46rem .3rem .65rem; background:var(--surface); border:1px solid var(--line); border-radius:9px;
}
.selection-row > span { flex:1; min-width:0; font-size:.88rem; overflow-wrap:anywhere; }
.selection-row > button { flex-shrink:0; }
.edition-results { display:grid; gap:13px; margin-bottom:8px; }
.reveal-pair { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:9px; }
.album-cover { background:var(--forest); color:#fff6e5; border-radius:15px; overflow:hidden; }
.album-cover .medium img { aspect-ratio:2 / 1; max-height:320px; }
.album-caption { padding:14px 20px 17px; }
.album-caption h3 { font-size:1.8rem; }
.album-caption .kicker { color:#f1d3ac; margin-bottom:4px; }
.album-caption .muted { color:#e5eadd; margin-top:4px; }
.album-gallery { display:grid; gap:10px; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); }
.album-gallery:empty { display:none; }
.album-gallery .empty-note,.album-gallery .afterword { grid-column:1 / -1; }
.album-gallery img { aspect-ratio:4 / 3; }
.album-builder { display:grid; background:#eee8db; border:1px solid var(--line); border-radius:12px; padding:2px 11px; }
.album-builder > :not(summary) { margin-bottom:9px; }
.album-order { display:grid; gap:6px; padding:0; list-style:none; }
.afterword { font:1.25rem/1.42 var(--serif); white-space:pre-wrap; padding:10px 6px; }
.profile-name { font:1.65rem var(--serif); }
.account-section { display:grid; gap:8px; }
@media (min-width:650px) {
  .masthead { height:84px; }
  .dock { border-radius:15px 15px 0 0; border-inline:1px solid var(--line); }
  .sheet { inset:0; margin:auto; max-height:calc(var(--visible-height, 100dvh) - 32px); border-radius:19px; height:max-content; }
  .sheet-head,.sheet-body,.sheet-actions { padding-inline:20px; }
  .sheet-body { padding-bottom:20px; }
  .filters { gap:15px; }
  .entry-head,.entry-text { padding-inline:21px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; transition:none !important; animation:none !important; }
}
