/* =========================================================================
   Em & Trish — palette tokens
   ========================================================================= */
:root {
  /* surfaces & neutrals */
  --canvas:        #FFFFFF;
  --cream:         #FCF5ED;
  --cream-2:       #FAEEE3;
  --cream-chip:    #F0E0D2;
  --cream-border:  #E5CFB8;

  /* text */
  --ink:           #1F2933;
  --ink-80:        #3C4A5C;
  --muted:         #6B7785;
  --faint:         #9CA5B3;
  --faint-70:      #ADBAC8;

  /* brand */
  --cerulean-deep: #2E5F94;
  --cerulean:      #4D86C9;
  --cerulean-mist: #BFD4EC;
  --lavender-deep: #A77EB5;
  --lavender:      #D9B6E1;
  --lavender-mist: #F0E0F4;
  --lavender-past: #F5F0F8;

  /* status */
  --confirmed-bg:  #EFF3CC;
  --lime:          #C5D34D;
  --olive:         #A8B500;
  --olive-ink:     #6B7400;
  --coral-mist:    #FCE4D8;
  --coral:         #E85D2C;
  --coral-deep:    #B83D11;

  /* booking sources */
  --src-booking:   #4D86C9;
  --src-agoda:     #E85D2C;
  --src-chase:     #2E5F94;
  --src-trip:      #A77EB5;
  --src-direct:    #6B7785;
  --src-kiwi:      #4D86C9;

  /* shadows */
  --shadow-soft:   0 6px 16px rgba(46, 95, 148, 0.06);
  --shadow-deep:   0 10px 28px rgba(46, 95, 148, 0.20);
  --shadow-pop:    0 14px 40px rgba(46, 95, 148, 0.18);
}

/* =========================================================================
   reset + base
   ========================================================================= */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body { overscroll-behavior-y: none; }
button, input, textarea, select {
  font: inherit; color: inherit;
}
button { background: none; border: none; cursor: pointer; padding: 0; }
input, textarea {
  background: var(--canvas);
  border: 1px solid var(--cream-chip);
}
a { color: inherit; text-decoration: none; }

/* =========================================================================
   layout
   ========================================================================= */
.app {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}
.appbar {
  padding: max(env(safe-area-inset-top, 12px), 12px) 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.appbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.appbar h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 0;
}
.appbar .sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.day-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  background: var(--canvas);
  border: 1px solid var(--cream-chip);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cerulean-deep);
  white-space: nowrap;
  cursor: pointer;
}
.day-chip svg { stroke: var(--cerulean-deep); width: 14px; height: 14px; }
.day-chip-chev svg { width: 12px; height: 12px; }
.day-chip.open { border-color: var(--cerulean-deep); border-width: 1.5px; padding: 5px 9px 5px 11px; }

.main { padding: 0 16px 24px; }

/* =========================================================================
   date picker popover
   ========================================================================= */
.date-picker {
  background: var(--canvas);
  border: 1px solid var(--cream-chip);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  margin: 0 0 12px;
  overflow: hidden;
  max-height: 60vh;
  overflow-y: auto;
}
.date-picker-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--cream-chip);
  position: sticky; top: 0;
  background: var(--canvas);
  z-index: 1;
}
.date-picker-title {
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.6px; text-transform: uppercase;
}
.date-picker-range { font-size: 11px; color: var(--faint); }
.date-picker-list { display: flex; flex-direction: column; }

.date-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--cream-2);
  text-align: left;
  width: 100%;
}
.date-row:last-child { border-bottom: 0; }
.date-row.past { opacity: 0.55; }
.date-row.today {
  background: var(--lavender-mist);
  padding: 13px 16px;
}
.date-row-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--faint-70);
  flex-shrink: 0;
}
.date-row.today .date-row-dot { width: 8px; height: 8px; background: var(--cerulean); }
.date-row-dot.wedding { background: var(--coral); }
.date-row-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.date-row-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.date-row.today .date-row-title { font-size: 14px; font-weight: 700; }
.date-row.past .date-row-title { color: var(--muted); }
.date-row-meta { font-size: 11px; color: var(--faint); }
.date-row-meta.wedding { color: var(--coral-deep); font-weight: 600; }
.date-row-check { width: 12px; height: 12px; stroke: var(--olive); }
.date-row-check svg { width: 12px; height: 12px; stroke: var(--olive); stroke-width: 2.5; }
.date-row-now {
  font-size: 10px; font-weight: 700; color: var(--cerulean-deep);
  background: var(--canvas); padding: 2px 8px; border-radius: 999px;
}

/* snap-back to today chip */
.snap-today {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 10px;
  background: var(--lavender-mist);
  color: var(--cerulean-deep);
  font-size: 13px; font-weight: 600;
  border-radius: 12px;
  margin-bottom: 12px;
}
.snap-today svg { width: 14px; height: 14px; stroke: var(--cerulean-deep); }

/* =========================================================================
   sync card
   ========================================================================= */
.sync {
  background: var(--cerulean-deep);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-deep);
  margin: 8px 0 18px;
}
.sync-time-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--cerulean-mist);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.sync-time {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 38px;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1;
  letter-spacing: -0.5px;
}
.sync-deadline { display: flex; align-items: center; gap: 12px; }
.sync-deadline-tile {
  width: 38px; height: 38px;
  background: var(--lime);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sync-deadline-tile svg { width: 18px; height: 18px; stroke: var(--cerulean-deep); }
.sync-deadline-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sync-deadline-text .label {
  font-size: 11px;
  color: var(--cerulean-mist);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sync-deadline-text .value { font-size: 15px; font-weight: 600; color: #FFFFFF; }
.sync-deadline-text .accent { color: var(--lime); }

/* =========================================================================
   day section + event card
   ========================================================================= */
.day-section {
  background: var(--lavender-mist);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.day-section + .day-section { margin-top: 18px; }
.day-section.past { background: var(--lavender-past); opacity: 0.85; }

.day-header {
  display: flex; align-items: center; justify-content: space-between;
}
.day-header-left { display: flex; align-items: center; gap: 10px; }
.day-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--faint-70); }
.day-section.today .day-dot { background: var(--cerulean); }
.day-section.past .day-dot { background: var(--olive); opacity: 0.6; }
.day-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px; font-weight: 600;
  color: var(--ink);
}
.day-sub { font-size: 12px; color: var(--muted); }
.day-count {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--canvas);
  border-radius: 999px; padding: 3px 8px;
}
.day-section.today .day-count {
  background: var(--confirmed-bg); color: var(--olive-ink);
}

.event-list { display: flex; flex-direction: column; gap: 10px; }

.event-card {
  display: flex; gap: 12px;
  background: var(--canvas);
  border: 1px solid var(--cream-chip);
  border-radius: 14px;
  padding: 14px;
}
.event-card.highlight {
  background: var(--coral);
  border-color: var(--coral);
}
.event-card.highlight .event-time-main { color: #FFFFFF; }
.event-card.highlight .event-time-tz   { color: var(--coral-mist); }
.event-card.highlight .event-title     { color: #FFFFFF; }
.event-card.highlight .event-meta      { color: var(--coral-mist); }
.event-card.past { opacity: 0.7; }

.event-time { display: flex; flex-direction: column; align-items: flex-end; min-width: 64px; gap: 2px; flex-shrink: 0; }
.event-time-main { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.event-time-tz   { font-size: 11px; color: var(--muted); }

.event-body { display: flex; flex-direction: column; flex: 1; gap: 4px; min-width: 0; }
.event-title-row { display: flex; align-items: center; gap: 6px; }
.event-title { font-size: 15px; font-weight: 600; color: var(--ink); flex: 1; word-break: break-word; }
.event-meta { font-size: 12px; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.event-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.pill .dot { width: 6px; height: 6px; border-radius: 999px; }
.pill.confirmed { background: var(--confirmed-bg); color: var(--olive-ink); }
.pill.confirmed .dot { background: var(--olive); }
.pill.tentative { background: var(--coral-mist); color: var(--coral-deep); }
.pill.tentative .dot { background: var(--coral); }
.pill.done      { background: var(--lavender-mist); color: var(--lavender-deep); }
.pill.done .dot { background: var(--lavender-deep); }
.pill.trip-begins { background: var(--confirmed-bg); color: var(--cerulean-deep); }
.pill.trip-begins .dot { background: var(--cerulean-deep); }

.lock-icon, .edit-icon { width: 12px; height: 12px; stroke: var(--muted); }
.event-card.highlight .lock-icon, .event-card.highlight .edit-icon { stroke: var(--coral-mist); }

/* A/B toggle */
.ab-toggle {
  display: flex;
  padding: 4px;
  background: var(--cream);
  border-radius: 12px;
  gap: 4px;
  margin-top: 8px;
}
.ab-option {
  flex: 1;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1.5px solid transparent;
  display: flex; flex-direction: column; gap: 4px;
  text-align: left;
  cursor: pointer;
}
.ab-option.selected {
  background: var(--canvas);
  border-color: var(--cerulean);
}
.ab-option-head { display: flex; justify-content: space-between; align-items: center; }
.ab-option-name { font-size: 13px; font-weight: 600; color: var(--muted); }
.ab-option.selected .ab-option-name { color: var(--ink); font-weight: 700; }
.ab-option-radio {
  width: 16px; height: 16px;
  border-radius: 999px; border: 1.5px solid var(--faint-70);
  display: flex; align-items: center; justify-content: center;
}
.ab-option.selected .ab-option-radio {
  border-color: var(--cerulean); background: var(--cerulean);
}
.ab-option-radio svg { width: 10px; height: 10px; stroke: #FFF; opacity: 0; }
.ab-option.selected .ab-option-radio svg { opacity: 1; }
.ab-option-text { font-size: 11px; color: var(--muted); line-height: 1.4; }

/* notes */
.event-notes {
  display: flex; gap: 8px;
  padding: 10px 12px;
  background: var(--cream);
  border: 1px dashed var(--cream-border);
  border-radius: 10px;
  margin-top: 8px;
}
.event-notes-icon { width: 14px; height: 14px; stroke: var(--muted); margin-top: 2px; flex-shrink: 0; }
.event-notes-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  letter-spacing: 0.4px; text-transform: uppercase;
}
.event-notes-text { font-size: 12px; color: var(--ink-80); line-height: 1.4; margin-top: 2px; }

/* =========================================================================
   vault
   ========================================================================= */
.country-toggle {
  display: flex; gap: 4px; padding: 4px;
  background: var(--cerulean-deep);
  border-radius: 999px;
  margin: 8px 0 12px;
}
.country-toggle button {
  flex: 1; padding: 9px 12px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--cerulean-mist);
}
.country-toggle button .dates { font-size: 10px; font-weight: 500; }
.country-toggle button.active {
  background: var(--canvas);
  color: var(--cerulean-deep);
}
.country-toggle button.active .dates { color: var(--muted); }

.section-pills {
  display: flex; gap: 4px; padding: 4px;
  background: var(--cream-chip);
  border-radius: 999px;
  margin-bottom: 16px;
}
.section-pills button {
  flex: 1; padding: 8px 12px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--muted);
}
.section-pills button.active {
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.section-pills button svg { width: 13px; height: 13px; stroke: currentColor; }

.vault-section { margin-bottom: 22px; }
.vault-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 10px;
}
.vault-section-header-left { display: flex; align-items: center; gap: 8px; }
.vault-section-icon {
  width: 22px; height: 22px;
  background: var(--cerulean);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.vault-section-icon svg { width: 12px; height: 12px; stroke: #FFFFFF; }
.vault-section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 17px; font-weight: 600;
  color: var(--ink);
}
.vault-section-count { font-size: 11px; color: var(--faint); }

.vault-card {
  background: var(--canvas);
  border: 1px solid var(--cream-chip);
  border-radius: 14px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.vault-card + .vault-card { margin-top: 10px; }

.vault-card-collapsed {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.vault-card-collapsed .chevron { width: 16px; height: 16px; stroke: var(--muted); flex-shrink: 0; }

.vault-flight-head, .vault-stay-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.vault-flight-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.airline-pill {
  width: 30px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #FFF;
  flex-shrink: 0;
  padding: 0 4px;
}
.vault-flight-title, .vault-stay-title { font-size: 14px; font-weight: 700; color: var(--ink); word-break: break-word; }
.vault-flight-sub, .vault-stay-sub { font-size: 11px; color: var(--muted); word-break: break-word; }

.confirmation-row {
  background: var(--cream);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.confirmation-row-label {
  font-size: 10px; color: var(--muted);
  letter-spacing: 0.5px; text-transform: uppercase;
}
.confirmation-row-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; font-weight: 700; color: var(--ink);
  letter-spacing: 1px;
  word-break: break-all;
}
.copy-btn { padding: 4px; }
.copy-btn svg { width: 16px; height: 16px; stroke: var(--muted); }

.action-row { display: flex; gap: 8px; }
.action-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.action-btn.primary { background: var(--cerulean-deep); color: #FFFFFF; }
.action-btn.primary svg { stroke: #FFFFFF; }
.action-btn.primary:disabled { background: var(--faint-70); cursor: not-allowed; }
.action-btn.secondary {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--cream-chip);
}
.action-btn.secondary svg { stroke: var(--ink); }
.action-btn svg { width: 13px; height: 13px; }

.source-row {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--faint);
}
.source-row .label { color: var(--faint); }
.source-row .source-pill {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px; font-weight: 700; color: #FFF;
}
.source-row a {
  color: var(--muted);
  text-decoration: underline;
}
.source-row .drive {
  display: inline-flex; align-items: center; gap: 4px;
}
.source-row .drive svg { width: 11px; height: 11px; }

/* vault locked state */
.vault-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 24px 40px;
  gap: 16px;
}
.vault-locked-icon {
  width: 72px; height: 72px;
  border-radius: 999px;
  background: var(--lavender-mist);
  display: flex; align-items: center; justify-content: center;
}
.vault-locked-icon svg {
  width: 30px; height: 30px;
  stroke: var(--cerulean-deep);
}
.vault-locked h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px; font-weight: 600;
  margin: 0;
  color: var(--ink);
}
.vault-locked p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 320px;
}
.unlock-btn-large {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: var(--cerulean-deep);
  color: #FFFFFF;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 8px;
}
.unlock-btn-large svg {
  width: 14px; height: 14px;
  stroke: #FFFFFF;
}

/* on the ground */
.otg-card {
  background: var(--canvas);
  border: 1px solid var(--cream-chip);
  border-radius: 14px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.otg-card + .otg-card { margin-top: 10px; }
.otg-card.danger { background: var(--coral-mist); border-color: var(--coral-mist); }
.otg-card-head { display: flex; align-items: center; justify-content: space-between; }
.otg-card-head-left { display: flex; align-items: center; gap: 8px; }
.otg-card-head svg { width: 16px; height: 16px; stroke: var(--ink); }
.otg-card.danger .otg-card-head svg { stroke: var(--coral-deep); }
.otg-card-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.otg-card.danger .otg-card-title { color: var(--coral-deep); }
.otg-card-body { padding-left: 24px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-80); }
.otg-card-body.hidden { display: none; }
.otg-card-body .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.otg-card-body .row a { color: var(--cerulean); text-decoration: none; }
.otg-card-body .row svg { width: 12px; height: 12px; stroke: var(--cerulean); }

/* =========================================================================
   journal
   ========================================================================= */
.journal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 8px 0 14px;
}
.journal-header h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.3px;
  margin: 0;
  color: var(--ink);
}
.journal-header .sub { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.journal-header-actions { display: flex; gap: 6px; }

.post-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--cerulean-deep);
  color: #FFFFFF;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.post-btn svg { width: 14px; height: 14px; stroke: #FFFFFF; }

.unlock-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: var(--canvas);
  border: 1px solid var(--cream-chip);
  color: var(--cerulean-deep);
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.unlock-btn .unlock-icon { width: 13px; height: 13px; stroke: var(--cerulean-deep); }

.logout-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--cream);
}
.logout-btn svg { width: 14px; height: 14px; stroke: var(--muted); }

.journal-feed { display: flex; flex-direction: column; gap: 20px; padding-bottom: 20px; }

.journal-post {
  background: var(--canvas);
  border-radius: 18px;
  border: 1px solid var(--cream-chip);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex; flex-direction: column;
}

.post-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
}
.post-header-left { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 14px; font-weight: 600;
  flex-shrink: 0;
}
.avatar.small { width: 26px; height: 26px; font-size: 12px; }
.post-author { font-size: 13px; font-weight: 700; color: var(--ink); }
.post-time { font-size: 11px; color: var(--faint); }

.day-badge {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  background: var(--confirmed-bg);
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  color: var(--olive-ink);
}
.day-badge .dot { width: 5px; height: 5px; border-radius: 999px; background: var(--olive-ink); }

.post-photo {
  position: relative;
  background: var(--cream);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.post-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.post-photo-pin {
  position: absolute;
  bottom: 12px; left: 12px;
  display: flex; align-items: center; gap: 4px;
  padding: 5px 10px;
  background: rgba(31,41,51,0.55);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 10px; font-weight: 600; color: #FFFFFF;
}
.post-photo-pin svg { width: 11px; height: 11px; stroke: #FFFFFF; }

.post-body {
  display: flex; flex-direction: column;
  padding: 14px 16px;
  gap: 10px;
}
.post-caption {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-comments {
  display: flex; flex-direction: column; gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--cream-2);
}

.comment {
  display: flex; gap: 8px;
}
.comment-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: baseline; gap: 6px; }
.comment-name { font-size: 12px; font-weight: 700; color: var(--ink); }
.comment-time { font-size: 10px; color: var(--faint); }
.comment-text {
  font-size: 12px;
  color: var(--ink-80);
  line-height: 1.4;
  word-break: break-word;
}

.comment-input {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px 6px 12px;
  background: var(--cream);
  border: 1px solid var(--cream-chip);
  border-radius: 999px;
  margin-top: 4px;
}
.comment-name-input {
  border: 0; background: transparent;
  font-size: 11px; font-weight: 600;
  color: var(--cerulean-deep);
  width: 90px;
  outline: none;
}
.comment-text-input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  font-size: 12px;
  color: var(--ink);
  outline: none;
}
.comment-text-input::placeholder { color: var(--faint); }
.comment-name-input::placeholder { color: var(--faint); }
.comment-send {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cerulean-deep);
  border-radius: 999px;
  flex-shrink: 0;
}
.comment-send svg { width: 13px; height: 13px; stroke: #FFFFFF; }

/* journal empty / not configured */
.journal-empty {
  display: flex; flex-direction: column;
  align-items: center; gap: 18px;
  padding: 40px 20px;
}
.polaroid-stack { position: relative; width: 220px; height: 220px; }
.polaroid {
  position: absolute; width: 180px; height: 200px;
  background: var(--canvas);
  border-radius: 4px;
  box-shadow: var(--shadow-soft);
  padding: 12px 12px 28px;
  display: flex; flex-direction: column; gap: 8px;
}
.polaroid .image { flex: 1; border-radius: 2px; }
.polaroid .caption {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 11px; color: var(--muted);
  text-align: center;
}
.polaroid.back  { top: 18px; left: -8px;  transform: rotate(-7deg); }
.polaroid.back .image { background: var(--cerulean-mist); }
.polaroid.front { top: 10px; left: 30px;  transform: rotate(4deg); }
.polaroid.front .image { background: var(--lavender); }

.journal-headline {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px; font-weight: 600;
  text-align: center;
}
.journal-sub {
  font-size: 13px; color: var(--muted);
  line-height: 1.5; text-align: center;
  max-width: 320px;
}
.journal-sub code {
  background: var(--cream);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink);
  border: 1px solid var(--cream-chip);
}

/* =========================================================================
   modals (passcode + composer)
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 51, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal {
  width: 100%;
  max-width: 420px;
  background: var(--canvas);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-pop);
  max-height: 92dvh;
  overflow-y: auto;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.modal-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
  border-radius: 999px;
}
.modal-close svg { width: 14px; height: 14px; stroke: var(--muted); }
.modal-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.modal-input {
  border: 1px solid var(--cream-chip);
  background: var(--canvas);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  width: 100%;
}
.modal-input:focus { border-color: var(--cerulean); }
.modal-input.passcode-input { letter-spacing: 4px; text-align: center; font-family: 'JetBrains Mono', monospace; }
.modal-error {
  font-size: 12px;
  color: var(--coral-deep);
  min-height: 16px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.modal-actions .action-btn { flex: 0 1 auto; padding: 10px 18px; }

/* composer */
.composer-modal { gap: 10px; }
.who-toggle {
  display: flex;
  padding: 4px;
  background: var(--cream);
  border-radius: 999px;
  gap: 4px;
}
.who-toggle button {
  flex: 1;
  padding: 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.who-toggle button.active {
  background: var(--cerulean-deep);
  color: #FFFFFF;
}

.photo-drop {
  position: relative;
  display: block;
  border: 1.5px dashed var(--cream-border);
  border-radius: 14px;
  background: var(--cream);
  cursor: pointer;
  overflow: hidden;
  min-height: 180px;
}
.photo-drop.has-photo { border-style: solid; padding: 0; min-height: 0; }
.photo-drop-cta {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 30px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.photo-drop-cta svg { width: 24px; height: 24px; stroke: var(--cerulean); }
.photo-preview {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}
.photo-clear {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  background: rgba(31, 41, 51, 0.7);
  color: #FFFFFF;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
.photo-clear svg { width: 14px; height: 14px; stroke: #FFFFFF; }

.caption-input {
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
}

.modal-input-row {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--cream-chip);
  background: var(--canvas);
  border-radius: 12px;
  padding: 10px 12px;
}
.modal-input-row .modal-input {
  border: 0;
  padding: 0;
  background: transparent;
}

/* =========================================================================
   tab bar
   ========================================================================= */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  display: flex; gap: 8px;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--cream-chip);
  max-width: 480px; margin: 0 auto;
  z-index: 5;
}
.tabbar button {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0;
  color: var(--faint);
  font-size: 11px; font-weight: 500;
}
.tabbar button svg { width: 22px; height: 22px; stroke: var(--faint); }
.tabbar button.active { color: var(--cerulean-deep); font-weight: 700; }
.tabbar button.active svg { stroke: var(--cerulean-deep); stroke-width: 2.2; }
.tabbar button .indicator {
  width: 24px; height: 2px;
  background: transparent;
  border-radius: 999px;
  margin-top: 2px;
}
.tabbar button.active .indicator { background: var(--cerulean-deep); }

/* =========================================================================
   misc
   ========================================================================= */
.toast {
  position: fixed;
  bottom: calc(100px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--ink);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

.loading { padding: 40px; text-align: center; color: var(--muted); }

@media (min-width: 600px) {
  .app { padding-bottom: 110px; }
}
