/*
  Scrapbook styles: Seaside travel journal
  Last updated: 2026-10-26 by Claude
  Change: 2.0.0. New look replacing Bauhaus: sand and sea colours, soft serif headings
          (Fraunces), DM Sans for text, Caveat for handwritten notes. Pinned ideas are
          postcards with a stamp, postmark and a strip of tape; the five headings are
          luggage tags; the scrapbook is polaroids. Review banner, board, tags, minis
          and the card menu added. Lucky dip overlay styles removed.
          Colours per heading come in as --hc, set from script (data-c), because the
          site's security policy blocks style="" attributes.
  Before: 1.1.0 (2026-10-25) Spacing classes (m0, mt6 to mt18) added at the end, replacing the
          style="" attributes the site's security policy blocks.
  Before: 1.0.0 (2026-10-18) First build.
  Deployed version:
*/

:root {
  --sand: #F5EFE4;
  --sand-2: #EADFCB;
  --card: #FFFCF6;
  --foam: #E6F0F1;
  --sea: #4F86A0;
  --sea-deep: #2F4F63;
  --ink: #2C3E4C;
  --ink-soft: #6C7C86;
  --coral: #D9775B;
  --line: rgba(44, 62, 76, .14);
  --shadow: 0 1px 2px rgba(44, 62, 76, .08), 0 6px 18px rgba(44, 62, 76, .08);
  --radius: 14px;
  --gutter: 16px;
  --nav-h: 66px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --hand: 'Caveat', 'Segoe Print', cursive;
  --hc: var(--sea);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { scroll-padding-top: 80px; scroll-padding-bottom: 90px; }
body {
  background: linear-gradient(180deg, #E3EEF0 0, var(--sand) 340px) no-repeat, var(--sand);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
:focus-visible { outline: 2.5px solid var(--sea); outline-offset: 2px; border-radius: 6px; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  background: rgba(227, 238, 240, .86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.wordmark { display: flex; align-items: center; gap: 9px; }
.wm-mark { width: 28px; height: 28px; }
.wm-text { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; letter-spacing: -.01em; }
.icon-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink); }
.sync-dot { position: absolute; top: 7px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: transparent; }
.sync-dot.pending { background: #E3B04B; }
.sync-dot.error { background: var(--coral); }

/* ---------- Bottom nav ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 252, 246, .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .76rem; font-weight: 500; color: var(--ink-soft); text-align: center; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.on { color: var(--sea-deep); font-weight: 700; }
.tabs button.on svg { stroke: var(--sea); stroke-width: 2.1; }

/* ---------- Layout ---------- */
main { max-width: 720px; margin: 0 auto; padding: 14px var(--gutter) 40px; outline: none; }
h1, h2, h3 { margin: 0; line-height: 1.12; }
.kicker { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sea); }
.q { font-family: var(--serif); font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 500; letter-spacing: -.02em; margin: 2px 0 16px; }
.q em { font-style: italic; color: var(--sea); }
h2.sec { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
h2.sec::after { content: ''; flex: 1; height: 8px; background: radial-gradient(circle, var(--line) 1.2px, transparent 1.6px) 0 50% / 8px 8px repeat-x; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.row { display: flex; gap: 8px; align-items: center; }
.wrap-row { flex-wrap: wrap; }
.hand { font-family: var(--hand); font-size: 1.28rem; line-height: 1.15; color: var(--sea-deep); }

/* ---------- Buttons and chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card);
  font-weight: 600; font-size: .94rem; color: var(--ink); text-align: center;
}
.btn.primary { background: var(--sea); border-color: var(--sea); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .84rem; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px var(--gutter) 4px; margin: 0 calc(-1 * var(--gutter)); }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip { flex: 0 0 auto; white-space: nowrap; border: 1.5px solid var(--line); background: var(--card); padding: 7px 13px; font-size: .88rem; font-weight: 500; border-radius: 999px; }
.chip.on { background: var(--sea-deep); border-color: var(--sea-deep); color: #fff; }

/* ---------- Review banner ---------- */
.banner {
  display: grid; gap: 10px; margin: 0 0 14px; padding: 14px 14px 12px;
  background: linear-gradient(135deg, #FBE9DD, #FFF6EC); border: 1.5px dashed #E2A98F; border-radius: var(--radius);
}
.banner-txt strong { display: block; font-family: var(--serif); font-size: 1.12rem; font-weight: 600; }
.banner-txt span { font-size: .9rem; color: var(--ink-soft); }

/* ---------- Postcards (pinned) ---------- */
.board { display: grid; gap: 18px; padding-top: 6px; }
@media (min-width: 640px) { .board { grid-template-columns: 1fr 1fr; } }
.postcard {
  position: relative; background: var(--card); border-radius: 6px; box-shadow: var(--shadow);
  padding: 14px 14px 12px; border-left: 5px solid var(--hc);
  background-image: repeating-linear-gradient(0deg, transparent 0 29px, rgba(79, 134, 160, .07) 29px 30px);
  transform: rotate(-.6deg);
}
.board .postcard:nth-child(2n) { transform: rotate(.7deg); }
.board .postcard::before {
  content: ''; position: absolute; top: -9px; left: 50%; width: 74px; height: 20px; margin-left: -37px;
  background: rgba(233, 214, 175, .78); transform: rotate(-3deg); box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.postmark {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--hc);
  border: 1.5px solid var(--hc); border-radius: 999px; padding: 3px 9px; opacity: .9;
}
.stamp {
  order: 2; width: 44px; height: 50px; display: grid; place-items: center; background: #fff;
  outline: 1.5px dotted var(--hc); outline-offset: -5px; box-shadow: 0 0 0 3px #fff, 0 1px 4px rgba(0, 0, 0, .12);
  transform: rotate(3deg);
}
.stamp .hicon { width: 26px; height: 26px; }
.postcard h3 { font-family: var(--serif); font-size: 1.32rem; font-weight: 600; line-height: 1.15; }
.postcard .hand { margin: 6px 0 0; }
.part { margin: 4px 0 0; font-size: .82rem; color: var(--ink-soft); }
.since { margin: 8px 0 0; font-size: .8rem; color: var(--ink-soft); font-style: italic; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.stops { list-style: none; margin: 10px 0 0; padding: 0; font-size: .9rem; }
.stops li { padding-left: 20px; position: relative; color: var(--sea-deep); }
.stops li::before { content: '→'; position: absolute; left: 0; color: var(--hc); font-weight: 700; }
.pc-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; align-items: center; }
.pc-actions .btn.ghost { padding: 0 8px; }
.pc-actions .more { margin-left: auto; letter-spacing: .1em; }
.empty-board {
  border: 1.5px dashed rgba(79, 134, 160, .4); border-radius: var(--radius); padding: 22px 18px; text-align: center;
  color: var(--ink-soft); background: rgba(255, 252, 246, .5);
}
.empty-board strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin-bottom: 4px; }

/* ---------- Luggage tags (the five headings) ---------- */
.tags { display: grid; gap: 10px; }
.tag { background: var(--card); border-radius: 10px 10px 10px 10px; box-shadow: var(--shadow); overflow: hidden; border-top: 4px solid var(--hc); }
.tag-head { width: 100%; display: grid; grid-template-columns: 14px 30px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; }
.tag-hole { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--hc); background: var(--sand); }
.tag-head .hicon { width: 28px; height: 28px; }
.tag-txt b { display: block; font-family: var(--serif); font-size: 1.08rem; font-weight: 600; }
.tag-txt span { display: block; font-size: .86rem; color: var(--ink-soft); line-height: 1.3; }
.tag-n { min-width: 30px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--foam); color: var(--sea-deep); font-size: .8rem; font-weight: 700; display: grid; place-items: center; }
.tag.open .tag-n { background: var(--hc); color: #fff; }
.minis { display: grid; gap: 8px; padding: 0 12px; }
.mini { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--sand); border-radius: 10px; padding: 10px 10px 10px 12px; }
.mini-main b { display: block; font-weight: 600; line-height: 1.25; }
.mini-main span { display: block; font-size: .84rem; color: var(--ink-soft); margin-top: 2px; }
.pin-btn { border-color: var(--hc); color: var(--hc); }
.tag-foot { padding: 6px 6px 8px; justify-content: space-between; }
.tag-empty { padding: 0 14px; }

.nudge { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; background: var(--foam); border-radius: var(--radius); padding: 14px; margin-top: 18px; }
.nudge .hicon { width: 30px; height: 30px; }
.nudge p { margin: 0 0 8px; font-weight: 500; }

/* ---------- Scrapbook (polaroids) ---------- */
.month-head { font-family: var(--serif); font-size: 1.8rem; font-weight: 500; margin: 26px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.month-head small { font-family: var(--sans); font-size: .88rem; font-weight: 500; color: var(--ink-soft); }
.book { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.entry { background: #fff; padding: 8px 8px 12px; box-shadow: var(--shadow); text-align: left; display: flex; flex-direction: column; border-radius: 3px; transform: rotate(-.8deg); }
.entry:nth-child(3n) { transform: rotate(.9deg); }
.entry:nth-child(3n+2) { transform: rotate(-.2deg); }
.entry.wide { grid-column: 1 / -1; }
.entry .pic { aspect-ratio: 4 / 3; overflow: hidden; background: var(--foam); }
.entry.wide .pic { aspect-ratio: 16 / 9; }
.entry .pic img, .entry .pic svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.entry .txt { padding: 8px 2px 0; }
.entry .d { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.entry h3 { font-family: var(--serif); font-size: 1.04rem; font-weight: 600; margin-top: 3px; }
.entry.wide h3 { font-size: 1.3rem; }
.entry p { margin: 4px 0 0; font-size: .86rem; color: var(--ink-soft); }
.entry p.hand { font-size: 1.2rem; color: var(--sea-deep); }
.stars { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 6px; }
.stars i { width: 8px; height: 8px; border: 1.5px solid var(--sea); border-radius: 50%; }
.stars i.f { background: var(--coral); border-color: var(--coral); }
.badge { display: inline-block; font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; background: var(--foam); color: var(--sea-deep); margin-left: 6px; vertical-align: 2px; }
.fab {
  position: fixed; right: var(--gutter); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 15;
  width: 58px; height: 58px; border-radius: 50%; background: var(--sea); color: #fff; text-align: center;
  font-size: 1.9rem; font-weight: 400; line-height: 1; box-shadow: 0 6px 18px rgba(47, 79, 99, .35);
}

/* ---------- Look back ---------- */
.seg { display: inline-grid; grid-auto-flow: column; background: var(--card); border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.seg button { padding: 7px 18px; font-weight: 600; border-radius: 999px; }
.seg button.on { background: var(--sea-deep); color: #fff; }
.period { display: flex; align-items: center; gap: 8px; margin: 16px 0 4px; }
.period .lbl { flex: 1; text-align: center; font-weight: 600; }
.arrow { width: 40px; height: 40px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-weight: 700; text-align: center; }
.arrow[disabled] { opacity: .3; }
.headline { font-family: var(--serif); font-style: italic; font-size: clamp(1.9rem, 8vw, 2.8rem); font-weight: 500; margin: 14px 0 16px; color: var(--sea-deep); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--serif); font-size: 2.1rem; font-weight: 600; line-height: 1; color: var(--sea); }
.stat span { font-size: .76rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
ul.did { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
ul.did li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; font-size: 1.04rem; font-weight: 500; }
ul.did .hicon { width: 24px; height: 24px; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: .88rem; }
.bar .track { grid-column: 1 / -1; height: 10px; background: var(--sand-2); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--hc); border-radius: 999px; }
.timeline { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day { min-height: 52px; border-radius: 8px; background: var(--card); padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.day .n { font-size: .68rem; font-weight: 700; color: var(--ink-soft); }
.day .dots { display: flex; flex-wrap: wrap; gap: 3px; }
.day .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--hc); }
.day.blank { background: transparent; }
.day.today { box-shadow: inset 0 0 0 2px var(--sea); }
.dow { font-size: .66rem; font-weight: 700; text-align: center; letter-spacing: .1em; color: var(--ink-soft); }
.moments { display: grid; gap: 10px; }
.moment { display: grid; grid-template-columns: 68px 1fr; gap: 12px; align-items: center; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-align: left; }
.moment .pic { width: 68px; height: 68px; overflow: hidden; }
.moment .pic img, .moment .pic svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.moment h3 { font-size: 1rem; font-weight: 600; }
.moment p { margin: 2px 0 0; font-size: .82rem; color: var(--ink-soft); padding-right: 8px; }
.review { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.review h3 { font-family: var(--serif); font-size: 1.06rem; font-weight: 600; margin: 14px 0 4px; }
.review h3:first-child { margin-top: 0; }
.review p { margin: 0; white-space: pre-wrap; }

/* ---------- Ideas ---------- */
.quick { display: flex; background: var(--card); border-radius: 999px; box-shadow: var(--shadow); overflow: hidden; }
.quick input { flex: 1; border: 0; background: transparent; padding: 12px 16px; min-width: 0; outline: none; }
.quick button { padding: 0 18px; background: var(--sea); color: #fff; font-size: 1.4rem; }
.search { width: 100%; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); padding: 10px 16px; margin: 12px 0 10px; }
.list { display: grid; margin-top: 8px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 0 12px 0 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item-main { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; padding: 11px 0 11px 12px; text-align: left; }
.item-main .hicon { width: 24px; height: 24px; }
.item .t { font-weight: 500; line-height: 1.25; }
.item .m { font-size: .74rem; color: var(--ink-soft); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }
.item .flag { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.item .pin-btn { border-color: var(--sea); color: var(--sea); }
.item.archived .t { text-decoration: line-through; color: var(--ink-soft); }
.count { font-size: .85rem; color: var(--ink-soft); margin-top: 10px; }

/* ---------- Bottom sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-back { position: absolute; inset: 0; background: rgba(44, 62, 76, .35); }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto;
  background: var(--sand); border-radius: 22px 22px 0 0;
  padding: 22px var(--gutter) calc(22px + env(safe-area-inset-bottom));
  animation: up .24s ease both;
}
@media (min-width: 800px) { .sheet-body { left: 50%; width: 620px; margin-left: -310px; bottom: 24px; border-radius: 22px; animation: none; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h2 { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; margin-bottom: 14px; }
.sheet h2.sec { font-size: 1.15rem; font-weight: 600; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .field > .lbl { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.field input[type=text], .field input[type=date], .field input[type=password], .field textarea, .pieces input {
  width: 100%; border: 1.5px solid var(--line); background: var(--card); padding: 10px 12px; border-radius: 10px;
}
.field textarea { min-height: 84px; resize: vertical; }
.field textarea.tall { min-height: 260px; font-size: .86rem; }
.title-input { font-family: var(--serif); font-size: 1.25rem !important; font-weight: 600; }
.pieces { gap: 8px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.sheet-actions .grow { flex: 1; }
.menu { display: grid; gap: 8px; }
.menu .btn { justify-content: flex-start; padding: 0 18px; min-height: 48px; }
details.more { margin: 4px 0 12px; }
details.more summary, details summary { cursor: pointer; font-weight: 600; color: var(--sea-deep); }
.photo-pick { display: flex; gap: 10px; align-items: center; }
.photo-pick .thumb { width: 80px; height: 80px; border-radius: 8px; overflow: hidden; background: var(--foam); }
.photo-pick .thumb img, .photo-pick .thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.lucky { margin: 4px 0 6px; transform: rotate(-1deg); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { font-weight: 600; }
.kv dd { margin: 0; color: var(--ink-soft); word-break: break-all; }
.news { font-size: .88rem; padding-left: 18px; margin: 6px 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); z-index: 60;
  max-width: 520px; margin: 0 auto; border-radius: 14px;
  background: var(--sea-deep); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 24px rgba(47, 79, 99, .3); animation: rise .2s ease both;
}
.toast span { flex: 1; font-weight: 500; }
.toast button { color: #FFD9A8; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.welcome { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.welcome h2 { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; margin-bottom: 8px; }
.err { color: #B4513A; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Spacing classes ----------
   Stand-ins for style="" attributes, which the site's security policy blocks.
   Keep these last so they win over a component's own margin. */
.m0 { margin: 0; }
.mt6 { margin-top: 6px; }
.mt10 { margin-top: 10px; }
.mt12 { margin-top: 12px; }
.mt14 { margin-top: 14px; }
.mt18 { margin-top: 18px; }
