/*
  styles.css: how the app looks.
  Mobile first: the basic rules are for phones; wider screens get small tweaks.

  APPEARANCE
  Every colour used anywhere below comes from the named "variables" in this
  section, so a whole look can be swapped at once. js/appearance.js sets
  these marks on the <html> element from the choices in Settings:
    data-palette = sage | sea | earth      (colour set)
    data-scheme  = light | dark            (Automatic follows the phone)
    data-text    = standard | large | larger
    data-font    = classic | modern        (font for lessons)
  Every colour pair was checked for readable contrast (WCAG AA).
*/

/* ---------- Colour sets ---------- */

/* Sage, light (also the default before any choice is made) */
:root {
  color-scheme: light;    /* tells the phone to draw date pickers etc. in light style */
  --bg: #f6f3ec;          /* page background: warm paper */
  --surface: #fffdf8;     /* cards, panels */
  --sunken: #ece6d8;      /* photo placeholders, theme labels */
  --field: #ffffff;       /* text boxes */
  --border: #ddd6c6;      /* soft lines */
  --border-strong: #8f8775; /* text box and chip outlines */
  --text: #24332b;        /* main text: deep forest green */
  --muted: #4f5f55;       /* softer text, still readable */
  --accent: #567358;      /* buttons, links, highlights: sage green */
  --on-accent: #ffffff;   /* text on accent-coloured buttons */
  --focus: #7c9076;       /* keyboard focus outline */
  --danger: #9b2c1f;      /* errors, Delete */
  --banner-bg: #fff4d6;   /* "new version" banner */
  --banner-border: #e3c873;

  --font: Georgia, "Times New Roman", serif;
  --font-lesson: var(--font);
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Sage, dark */
:root[data-palette='sage'][data-scheme='dark'] {
  color-scheme: dark;
  --bg: #151a17;
  --surface: #1e2521;
  --sunken: #29312c;
  --field: #111513;
  --border: #333c36;
  --border-strong: #6d7a71;
  --text: #e6ebe4;
  --muted: #a7b3ab;
  --accent: #8fb592;
  --on-accent: #0f1411;
  --focus: #5f8a63;
  --danger: #f2a69b;
  --banner-bg: #3a3221;
  --banner-border: #7a6a3a;
}

/* Sea, light */
:root[data-palette='sea'] {
  --bg: #f1f5f7;
  --surface: #fbfdfe;
  --sunken: #dfe8ee;
  --field: #ffffff;
  --border: #d2dde4;
  --border-strong: #7f94a3;
  --text: #1c2e3b;
  --muted: #475c6b;
  --accent: #2d6a89;
  --on-accent: #ffffff;
  --focus: #708c9b;
  --danger: #a12f29;
  --banner-bg: #fff4d6;
  --banner-border: #e3c873;
}

/* Sea, dark */
:root[data-palette='sea'][data-scheme='dark'] {
  color-scheme: dark;
  --bg: #11181d;
  --surface: #19232a;
  --sunken: #233039;
  --field: #0d1317;
  --border: #2e3d47;
  --border-strong: #637b8a;
  --text: #e3ecf1;
  --muted: #a1b4c0;
  --accent: #7fb8d6;
  --on-accent: #0b1418;
  --focus: #4d8cad;
  --danger: #f2a69b;
  --banner-bg: #3a3221;
  --banner-border: #7a6a3a;
}

/* Earth, light */
:root[data-palette='earth'] {
  --bg: #f7f1e9;
  --surface: #fffaf3;
  --sunken: #ede0d1;
  --field: #ffffff;
  --border: #e1d2c0;
  --border-strong: #9a826a;
  --text: #392a1e;
  --muted: #6a5343;
  --accent: #87562f;
  --on-accent: #ffffff;
  --focus: #a1866a;
  --danger: #9b2c1f;
  --banner-bg: #fff4d6;
  --banner-border: #e3c873;
}

/* Earth, dark */
:root[data-palette='earth'][data-scheme='dark'] {
  color-scheme: dark;
  --bg: #1b1612;
  --surface: #251f19;
  --sunken: #302821;
  --field: #16110e;
  --border: #3c3229;
  --border-strong: #7a6754;
  --text: #f0e7dc;
  --muted: #bfae9b;
  --accent: #d69e6d;
  --on-accent: #1a120b;
  --focus: #a87850;
  --danger: #f2a69b;
  --banner-bg: #3a3221;
  --banner-border: #7a6a3a;
}

/* ---------- Text size and lesson font ---------- */
/* Almost all sizes are in "rem", which scales with the page's base size,
   so changing it here scales the whole app evenly. */
:root[data-text='large'] { font-size: 112.5%; }
:root[data-text='larger'] { font-size: 125%; }

:root[data-font='modern'] { --font-lesson: var(--font-ui); }

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1.125rem;  /* 18px: comfortable on a phone */
  line-height: 1.6;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Extra padding keeps content clear of the iPhone notch / home bar */
  padding: max(2rem, env(safe-area-inset-top)) 1.5rem max(2rem, env(safe-area-inset-bottom));
  max-width: 36rem;
  margin: 0 auto;
  text-align: center;
}

.title {
  font-family: var(--font);
  font-weight: normal;
  font-size: 3rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 1rem;
  /* The lily logo above the name (opening and sign-in) */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.1;
}

/* The lily logo: the glossy app icon, drawn in index.html in its own colours */
.logo {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  flex: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18)); /* sits up off the page */
}

.verse {
  font-family: var(--font);
  font-style: italic;
  font-size: 1.25rem;
  margin: 0 0 2rem;
}

.ref {
  display: block;
  font-style: normal;
  font-size: 1rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.status {
  color: var(--muted);
  font-size: 1rem;
  margin: 0.25rem 0;
}

/* ---------- Milestone 2: sign-in forms ---------- */

/* Make sure anything marked "hidden" really stays hidden */
[hidden] {
  display: none !important;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

label {
  font-weight: 600;
}

input {
  font: inherit;
  /* 16px or more stops iPhones zooming in when you tap the box */
  font-size: 1.125rem;
  padding: 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
}

#code {
  letter-spacing: 0.3em;
  font-size: 1.5rem;
  text-align: center;
}

button {
  font: inherit;
  font-weight: 600;
  /* At least 44px tall, so it's easy to tap */
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--accent);
}

.link-button {
  background: none;
  color: var(--accent);
  text-decoration: underline;
  font-weight: normal;
}

/* Visible keyboard focus, for people not using a touch screen */
input:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.hint {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
}

.message {
  margin: 0 0 1rem;
  min-height: 1.6em;
  font-size: 1rem;
}

.message.error {
  color: var(--danger); /* dark red, still readable on the paper background */
}

/* ---------- Milestone 3: feed and add form ---------- */

/* Once signed in, line things up from the top-left like a normal app,
   instead of centring them like the sign-in screen. */
.page:has(#app-view:not([hidden])) {
  justify-content: flex-start;
  text-align: left;
}

.page:has(#app-view:not([hidden])) .title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  text-align: center;
  /* Signed in: a small lily beside the name */
  flex-direction: row;
  justify-content: center;
  gap: 0.55rem;
}

.page:has(#app-view:not([hidden])) .logo {
  width: 2.1rem;
  height: 2.1rem;
}

.screen-title {
  font-family: var(--font);
  font-weight: normal;
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

button.wide {
  width: 100%;
  margin-bottom: 1.25rem;
}

textarea {
  font: inherit;
  font-size: 1.125rem;
  padding: 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
  resize: vertical;
}

textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.optional {
  font-weight: normal;
  color: var(--muted);
  font-size: 0.95rem;
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.sight-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.125rem;
}

/* The lesson is the main line of each card */
.sight-lesson {
  font-family: var(--font-lesson);
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.sight-saw {
  margin: 0 0 0.375rem;
  color: var(--text);
  font-size: 1rem;
}

.sight-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Milestone 4: photos ---------- */

/* Looks like a <label>, for the photo section (which has no single input) */
.field-label {
  font-weight: 600;
}

.photo-preview {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 8px;
  background: var(--sunken);
}

/* Feed photos: same shape on every card, cropped to fill neatly */
.sight-photo {
  display: block;
  width: calc(100% + 2.25rem);  /* stretch to the card's edges */
  margin: -1rem -1.125rem 0.875rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  background: var(--sunken);          /* soft placeholder while loading */
}

/* Nothing to say? Then take up no space. */
.message:empty {
  min-height: 0;
  margin: 0;
}

/* ---------- Milestone 5: view, edit, delete ---------- */

/* The whole feed card is a link to the sight */
.sight-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

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

.back {
  padding-left: 0;
  margin-bottom: 0.5rem;
  text-decoration: none;
  font-weight: 600;
}

.sight-full {
  gap: 1rem;
}

.view-photo {
  width: calc(100% + 2.5rem);   /* stretch to the card's edges */
  margin: -1.25rem -1.25rem 0;
  border-radius: 12px 12px 0 0;
  background: var(--sunken);
}

.view-lesson {
  font-family: var(--font-lesson);
  font-weight: normal;
  font-size: 1.4rem;
  line-height: 1.4;
  margin: 0;
  white-space: pre-line;  /* keep line breaks you typed */
}

.view-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.view-text {
  margin: 0;
  white-space: pre-line;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.actions button {
  flex: 1;
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}


/* ---------- Milestone 6: themes, type, Bible, browse, search, settings ---------- */

/* Hidden on screen but still read by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Comfortable space below the last card or the Save button (when signed in),
   clear of the tab bar along the bottom */
.page:has(#app-view:not([hidden])) {
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
}

/* The tab bar sits along the BOTTOM of the screen, where a thumb reaches,
   above the phone's home bar (safe-area). Icon over the word. */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 0.3rem 0.25rem calc(0.3rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.06);
  z-index: 50;
}

.tab-bar[hidden] { display: none; }

.tab-bar a {
  position: relative;
  flex: 1;
  max-width: 6.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-height: 52px;
  padding: 0.35rem 0.1rem 0.25rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 14px;
  -webkit-tap-highlight-color: transparent;
}

.tab-icon {
  box-sizing: content-box; /* the pill padding goes around the 26px icon */
  width: 26px;
  height: 26px;
  padding: 1px 12px;
  border-radius: 999px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease, background-color 0.25s ease;
}

.tab-label { line-height: 1.1; }

.tab-bar a[aria-current='page'] {
  color: var(--accent);
}

/* The current tab: a soft pill behind its icon, a slightly bolder line */
.tab-bar a[aria-current='page'] .tab-icon {
  stroke-width: 2.1;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.tab-bar a:active .tab-icon { transform: scale(0.9); }

.tab-bar a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

/* Groups of choices (type, themes) */
fieldset.choice-group {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

fieldset.choice-group legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 0.5rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

/* A tick-box or radio shown as a rounded "chip" you tap */
.chip {
  position: relative;
  display: inline-flex;
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip span {
  display: inline-block;
  min-height: 2.75rem; /* easy to tap */
  line-height: 1.6;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--field);
  font-size: 1rem;
  cursor: pointer;
}

.chip input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.chip input:checked + span::before {
  content: '✓ ';
}

.chip input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.inline-add {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.inline-add input {
  flex: 1;
  min-width: 0;
}

.hint.ok {
  color: var(--accent);
  font-weight: 600;
}

/* Labels on the View screen */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--text);
  font-size: 0.9rem;
}

.tag-type {
  background: var(--accent);
  color: var(--on-accent);
}

.bible-link {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* Browse and Search */
select {
  font: inherit;
  font-size: 1.125rem;
  padding: 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
}

select:focus-visible,
#search-input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.filters-fold {
  margin-bottom: 0.75rem;
}

.filters {
  gap: 0.5rem;
}

.filters .link-button {
  align-self: flex-start;
  padding-left: 0;
}

#search-input {
  width: 100%;
}

.count {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.75rem 0;
}

/* Settings */
.settings-section {
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font);
  font-weight: normal;
  font-size: 1.2rem;
  margin: 0;
}

.theme-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.theme-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-bottom: 1px solid var(--sunken);
}

.theme-name {
  flex: 1;
  overflow-wrap: anywhere;
}

.danger-link {
  color: var(--danger);
}

.account-email {
  margin: 0;
  overflow-wrap: anywhere; /* long email addresses wrap instead of overflowing */
}

/* ---------- Update banner ---------- */
.update-banner {
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  background: var(--banner-bg);   /* soft, warm yellow so it's noticed */
  color: var(--text);
  border: 1px solid var(--banner-border);
  font-weight: 600;
  text-align: center;
}

/* ---------- Appearance settings ---------- */
.appearance {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Little colour dots on the Colour choices. These show each colour set
   itself, so they use fixed colours on purpose. */
.swatch {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  border-radius: 50%;
  margin-right: 0.45em;
  vertical-align: -0.1em;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.swatch-sage { background: #567358; }
.swatch-sea { background: #2d6a89; }
.swatch-earth { background: #87562f; }

/* Show each font choice in its own font */
.font-classic { font-family: var(--font); }
.font-modern { font-family: var(--font-ui); }

/* Example text inside empty boxes, in each colour set's soft text colour */
::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

/* ---------- About ---------- */
.about p {
  margin: 0;
}

.about-verse {
  margin: 0.25rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--sunken);
  border-radius: 0 8px 8px 0;
}

.about-verse p {
  font-family: var(--font);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.5;
}

.about-verse footer {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.about .bible-link {
  align-self: flex-start;
}

.about-list {
  margin: 0;
  padding-left: 1.25rem;
}

.about-heading {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.about-version {
  font-size: 0.85rem;
}

/* The motto under "About Consider" */
.about-motto {
  font-family: var(--font);
  font-size: 1.35rem;
  color: var(--accent);
  letter-spacing: 0.01em;
}

/* ---------- Share as a picture ---------- */
.share-hint {
  margin-bottom: 1rem;
}

.share-preview {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

/* ---------- "Did I live it?" ---------- */
.checkin {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
}

.checkin p {
  margin: 0;
}

.checkin .actions {
  margin-top: 0.25rem;
}

.checkin .link-button {
  align-self: flex-start;
  padding-left: 0;
}

.checkin-title {
  font-weight: 600;
}

/* Waiting for its week: just a quiet line */
.checkin-quiet {
  padding: 0;
}

/* Time to check in: gently highlighted */
.checkin-due {
  background: var(--sunken);
  border-left: 3px solid var(--accent);
}

/* Due but not opened yet: one row, the title and a "How did it go?" button */
.checkin-ready {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* "Delete this sight": quiet, at the bottom of a sight */
.view-delete {
  display: block;
  margin: 0.5rem auto 1.5rem;
  padding: 0.5rem;
}

/* Lived: a calm, settled look */
.checkin-lived {
  background: var(--sunken);
}

.checkin-lived .checkin-title {
  color: var(--accent);
}

/* "Ready to check in" at the top of the feed */
.due-panel {
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--accent);
}

.due-panel p {
  margin: 0;
}

.due-list {
  margin: 0;
  padding-left: 1.25rem;
}

.due-list a {
  color: var(--accent);
  text-underline-offset: 3px;
}

/* ---------- On this day / Revisit ---------- */
.revisit {
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem 1rem;
}

.revisit p {
  margin: 0;
}

.revisit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.revisit-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

/* The ✕: still a comfortable 44px to tap, but visually small */
.revisit-close {
  background: none;
  color: var(--muted);
  min-width: 2.75rem;
  padding: 0.25rem;
  margin: -0.5rem -0.5rem -0.5rem 0;
  font-weight: normal;
}

.revisit-link {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

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

.revisit-photo {
  flex: 0 0 auto;
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 8px;
  background: var(--sunken);
}

.revisit-lesson {
  font-family: var(--font-lesson);
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 0.2rem !important;
}

/* ---------- Verse text on a sight ---------- */
/* Uses the same quote-box look as About (.about-verse) */
.view-verse {
  margin: 0;
}

.view-verse p {
  margin: 0;
  font-family: var(--font);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.55;
}

.view-verse sup {
  font-style: normal;
  font-family: var(--font-ui);
  font-size: 0.7em;
  color: var(--muted);
  margin: 0 0.15em 0 0.25em;
}

.view-verse sup:first-child {
  margin-left: 0;
}

.view-verse footer {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- "Things to consider" prompts ---------- */
/* "Something else to consider", at the foot of the This week card */
.idea-toggle {
  display: block;
  margin: 0 auto;
  padding: 0.5rem;
}

.idea-panel {
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--accent);
}

.idea-panel p {
  margin: 0;
}

.idea-text {
  font-family: var(--font-lesson);
  font-size: 1.25rem;
  line-height: 1.45;
}

/* The chosen prompt at the top of "Add a sight" */
.form-prompt {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--sunken);
  border-left: 3px solid var(--accent);
}

.form-prompt p {
  margin: 0.2rem 0 0;
}

/* ---------- This week's common prompt (S3-5) ---------- */
/* Uses the idea-panel look; the card on Sights and on a circle's screen */
.week-card .actions {
  margin-top: 0.25rem;
}

.week-card .feed {
  margin-top: 0.5rem;
}

/* The folded card with its ✕ beside it */
.week-row {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}

.week-row > .week-fold {
  flex: 1;
  min-width: 0;
}

.week-row > .revisit-close {
  margin-top: 0;
}

/* Once you've answered this week's prompt, the card is one line that opens */
.week-fold > summary .fold-title {
  font-family: var(--font-lesson);
  font-size: 1.05rem;
  line-height: 1.4;
}

/* "✦ This week's prompt" on a sight that answers it: one line that opens */
.prompt-note {
  margin: 0;
}

.prompt-note .form-prompt {
  margin: 0;
}

/* ---------- Book of sights ---------- */
.book-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.book-toolbar .back {
  align-self: flex-start;
}

/* The pages: always the light version of your colour set (set by book.js) */
.book {
  color-scheme: light;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.book-page {
  background: var(--book-bg);
  color: var(--book-text);
  border: 1px solid var(--book-line);
  border-radius: 6px;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.book-page p,
.book-page h2,
.book-page h3 {
  margin: 0;
}

.book-title-page {
  text-align: center;
  justify-content: center;
  min-height: 24rem;
  gap: 1rem;
}

.book-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  color: var(--book-muted);
}

.book-title {
  font-family: var(--font);
  font-weight: normal;
  font-size: 2.6rem;
  color: var(--book-accent);
}

.book-motto {
  font-family: var(--font);
  font-style: italic;
  font-size: 1.15rem;
}

.book-verse {
  font-family: var(--font);
  font-style: italic;
  color: var(--book-muted);
  margin-top: 1rem !important;
}

.book-verse-ref,
.book-count,
.book-date,
.book-tags {
  color: var(--book-muted);
  font-size: 0.9rem;
}

.book-photo {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
}

.book-lesson {
  font-family: var(--font-lesson);
  font-weight: normal;
  font-size: 1.45rem;
  line-height: 1.4;
  white-space: pre-line;
}

.book-part p {
  white-space: pre-line;
}

.book-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--book-muted);
  margin-bottom: 0.15rem !important;
}

.book-lived {
  margin-top: 0.35rem !important;
  color: var(--book-accent);
  font-weight: 600;
}

.book-scripture {
  border-left: 3px solid var(--book-accent);
  padding-left: 0.85rem;
}

.book-verse-text {
  font-family: var(--font);
  font-style: italic;
}

/* ---------- Printing: only the book's pages ---------- */
@media print {
  @page {
    size: A4;
    margin: 14mm;
  }

  html,
  body {
    background: #fff !important;
  }

  /* Hide everything except the book (tab bar, buttons, messages, badges…) */
  body > *:not(.page),
  .page > *:not(#app-view),
  #app-view > *:not(#book-view),
  .book-toolbar {
    display: none !important;
  }

  .page {
    display: block;
    padding: 0 !important;
    max-width: none;
    min-height: 0;
  }

  .book {
    gap: 0;
  }

  /* One sight per sheet of paper */
  .book-page {
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    background: #fff;
  }

  .book-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .book-title-page {
    min-height: 240mm;
  }

  .book-photo {
    max-height: 125mm;
  }
}

/* ---------- Circles ---------- */
.circles-intro {
  margin-bottom: 1rem;
}

.circle-card .circle-name {
  font-family: var(--font);
  font-size: 1.25rem;
  margin: 0 0 0.25rem;
}

.circle-create {
  margin-top: 1.25rem;
}

.circle-coming {
  margin: -0.5rem 0 1rem;
}

/* The invite link: long, so let it wrap anywhere */
.invite-link {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: var(--sunken);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
  user-select: all;
}

.invite-more {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}

.invite-more .link-button {
  padding-left: 0;
}

.circle-end {  /* the last part of "Circle settings" */
  margin-top: 0;
}

.circle-end button {
  width: 100%;
}


/* ---------- Sharing into circles (S3-2) ---------- */
.shared-here {
  margin-bottom: 1.25rem;
}

.shared-here .section-title {
  margin-bottom: 0.75rem;
}

.view-circles {
  margin-top: 1.25rem;
}

/* ---------- One sight, many lessons (S3-3) ---------- */
.circle-lessons {
  margin-top: 1.25rem;
}

.circle-lessons .section-title {
  margin-bottom: 0.75rem;
}

.lesson-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lesson-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* The sharer's own lesson is marked with the accent colour */
.lesson-sharer {
  border-left: 3px solid var(--accent);
}

.lesson-item p {
  margin: 0;
}

.lesson-text {
  font-family: var(--font-lesson);
  font-size: 1.15rem;
  line-height: 1.45;
  white-space: pre-line;
}

.lesson-ref {
  align-self: flex-start;
  font-size: 0.95rem;
}

.lesson-spoke {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.lesson-actions {
  display: flex;
  gap: 1rem;
}

.lesson-actions .link-button {
  padding-left: 0;
}

.spoke-chip {
  align-self: flex-start;
}

.lesson-form {
  margin-top: 0.5rem;
}

/* ---------- Keeping it kind (S3-4) ---------- */
/* A hidden lesson: dashed and faded, so it's clearly not visible to the circle */
.lesson-hidden {
  border-style: dashed;
  opacity: 0.8;
}

.lesson-hidden-note {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}


.guidelines {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 1rem;
}

/* ---------- Drop-downs ("folds") used across the app ----------
   <details class="fold"> with a <summary> row: a title on the left, an
   optional short value (e.g. "Sage · Light") and an arrow on the right.
   The contents go in .fold-body. A .card can be a fold too. */
details.fold {
  display: block;
}

.fold > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;              /* easy to tap */
  cursor: pointer;
  list-style: none;
}

.fold > summary::-webkit-details-marker {
  display: none;
}

.fold-title {
  flex: 1;
  margin: 0;
}

.fold-value {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: right;
}

/* The arrow: points right when closed, down when open */
.fold > summary::after {
  content: '';
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin: 0 0.25rem 0.2rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

.fold[open] > summary::after {
  transform: rotate(45deg);
}

.fold > summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.fold-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Parts inside one fold (e.g. a circle's "Circle settings"), divided by lines */
.fold-part {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.fold-part:first-child {
  padding-top: 0.25rem;
  border-top: none;
}

.fold-part .section-title {
  font-size: 1.05rem;
}

/* This week's prompt on a circle's screen: one or two lines */
.week-prompt {
  font-family: var(--font-lesson);
  line-height: 1.4;
}

/* The "⋯" menu on a lesson in a circle, beside "This spoke to me" */
.lesson-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lesson-menu {
  position: relative;
  margin-left: auto;
}

.lesson-menu > summary {
  list-style: none;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  border-radius: 8px;
}

.lesson-menu > summary::-webkit-details-marker {
  display: none;
}

.lesson-menu > summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.lesson-menu-items {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 5;
  min-width: 13rem;
  display: flex;
  flex-direction: column;
  padding: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.lesson-menu-items .link-button {
  text-align: left;
  text-decoration: none;
  padding: 0.65rem 0.75rem;
}

.lesson-menu-items .hint {
  padding: 0.65rem 0.75rem;
}

.add-lesson {
  margin-top: 0.5rem;
}

/* A quieter fold inside a card ("Read more", "More details") */
.fold-quiet > summary {
  color: var(--accent);
  min-height: 40px;
}

.fold-quiet > summary .fold-title {
  flex: 0 1 auto;
  text-decoration: underline;
}

.fold-quiet > summary::after {
  border-color: var(--accent);
}

/* The creator's reports: noticed, but calm */
.reports-card {
  border-left: 3px solid var(--danger);
  margin-bottom: 1.25rem;
}

.reports-card .lesson-actions {
  flex-wrap: wrap;
  gap: 0 1rem;
}

/* ---------- Ready for others: welcome, backup reminder, privacy, delete ---------- */
/* The welcome, the first time someone signs in (account.js) */
.welcome-card {
  margin-top: 1rem;
}

.welcome-card p {
  margin: 0;
}

.welcome-card .screen-title:focus {
  outline: none; /* focused only so screen readers announce each step */
}

.welcome-skip {
  align-self: center;
  padding: 0.5rem;
}

/* "Download a backup" reminder on Sights */
.backup-nudge .actions {
  margin-top: 0.25rem;
  align-items: center;
}

.backup-nudge .link-button {
  flex: 0 0 auto;
}

/* Settings → Your privacy */
.privacy p {
  margin: 0;
}

/* Settings → Account → Delete my account: quiet until opened */
.danger-fold > summary {
  color: var(--danger);
}

.danger-fold > summary::after {
  border-color: var(--danger);
}

.danger-fold .fold-body p {
  margin: 0;
}

.inline-link {
  display: inline;
  padding: 0;
  min-height: 0;
  font-size: inherit;
}

.about-welcome {
  /* Settings → About: "How Consider works", shown so people find it */
  display: block;
  margin-top: 0.9rem;
}

/* ---------- Snap now, write later: "To finish" on Sights ---------- */
.drafts-panel {
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--accent);
}

.drafts-panel p {
  margin: 0;
}

.draft-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.draft-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}

.draft-link img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  flex: none;
}

.draft-link span {
  text-decoration: underline;
  text-decoration-color: var(--border);
}

/* "Waiting to send" (saved with no signal): like "To finish", in a calmer colour */
.outbox-panel {
  border-left-color: var(--muted);
}

.outbox-panel .draft-link span {
  text-decoration: none;
}

/* A problem saving the Add/Edit form, shown just above Save */
.form-error {
  margin: 0;
  min-height: 0;
}

.form-error:empty {
  display: none;
}

/* ---------- "New in your circles" ---------- */
/* A small dot on the Circles tab when someone else has shared or added a lesson */
.tab-bar a.has-news {
  position: relative;
}

.tab-bar a.has-news::after {
  content: '';
  position: absolute;
  top: 0.3rem;
  left: calc(50% + 0.85rem);
  box-shadow: 0 0 0 2px var(--bg);
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

/* "New" on a circle, or on a sight inside a circle */
.new-badge {
  align-self: flex-start;
  display: inline-block;
  margin: 0 0 0.35rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- Looking after circles: reports to Consider, admin ---------- */
.report-consider {
  align-self: flex-start;
  padding-left: 0;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.theme-row .lesson-menu {
  margin-left: auto;
}

.admin-section {
  border-left: 3px solid var(--danger);
}

.admin-report {
  margin-bottom: 1rem;
  border-left: 3px solid var(--danger);
}

.admin-report p {
  margin: 0;
}

.admin-photo {
  border-radius: 8px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

/* ---------- Ask to join, and invite links that expire (015) ---------- */
.approval-chip {
  align-self: flex-start;
}

.invite-limits {
  font-size: 0.9rem;
}

.new-link select {
  width: 100%;
}

.waiting-card {
  border-left: 3px solid var(--accent);
  margin-bottom: 1.25rem;
}

.waiting-buttons {
  display: flex;
  gap: 0.75rem;
  margin-left: auto;
}

.waiting-note {
  color: var(--accent);
  font-weight: 600;
}

/* "Take a photo" (camera) and "Choose a photo" (library), side by side */
.photo-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.photo-buttons button {
  flex: 1 1 9rem;
}

/* ---------- Notifications (016) ---------- */
.notify-chip {
  align-self: flex-start;
}

.notify-off {
  align-self: flex-start;
  padding-left: 0;
}

.notify-card .link-button {
  flex: 0 0 auto;
}

/* The matching back button at the bottom of a screen (app.js) */
.back-bottom {
  display: block;
  margin: 1.5rem 0 0.5rem;
}

@media print {
  .back-bottom {
    display: none !important;
  }
}

/* ---------- Up to 4 photos on a sight (018) ---------- */
/* The form: each photo with its caption, Move up / Make cover, Remove */
.photo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.photo-list:empty {
  display: none;
}

.photo-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.photo-item-img {
  width: 5.5rem;
  height: 5.5rem;
  object-fit: cover;
  border-radius: 10px;
  flex: none;
  background: var(--sunken);
}

.photo-item-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.photo-item-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.photo-item-side input {
  width: 100%;
}

.photo-item-actions {
  display: flex;
  gap: 1rem;
}

.photo-item-actions .link-button {
  padding: 0.25rem 0;
}

/* Viewing: swipe sideways, one photo at a time */
.gallery {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gallery-strip {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.gallery-strip::-webkit-scrollbar {
  display: none;
}

.gallery-item {
  flex: 0 0 100%;
  scroll-snap-align: center;
  margin: 0;
}

.gallery-caption {
  margin-top: 0.35rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
}

.gallery-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.gallery-dots {
  display: flex;
  gap: 0.2rem;
}

.gallery-dot {
  width: 28px;          /* a comfortable tap area… */
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  position: relative;
}

.gallery-dot::after {   /* …around a small dot */
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--border);
}

.gallery-dot.on::after {
  background: var(--accent);
}

.gallery-compare-button {
  padding: 0.4rem 0;
}

/* Compare: two side by side, choose which */
.gallery-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.gallery-compare-side {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.gallery-compare-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  background: var(--sunken);
}

.gallery-compare-side select {
  width: 100%;
  font-size: 0.9rem;
}

/* The gallery stretches to the card's edges (as the single photo did) */
.gallery {
  width: calc(100% + 2.5rem);
  margin: -1.25rem -1.25rem 0;
}

.gallery .view-photo {
  display: block;
  width: 100%;
  margin: 0;
}

.gallery-item:first-child .view-photo,
.gallery-strip .view-photo {
  border-radius: 12px 12px 0 0;
}

.gallery-caption,
.gallery-bar,
.gallery-compare {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Keep the gallery dots round (ordinary button sizing would stretch them) */
.gallery-dot {
  flex: none;
  min-width: 0;
  min-height: 0;
  width: 28px;
  height: 28px;
}

.gallery-dot::after {
  inset: auto;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
}

/* "New" on a card with a photo: a small badge on the photo's top corner
   (above it, the photo's stretch to the card's edge would half cover it) */
.sight-card {
  position: relative;
}

.new-badge.on-photo {
  position: absolute;
  top: 0.6rem;            /* just inside the card's top corner, on the photo */
  left: 0.6rem;
  z-index: 1;
  margin: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* ---------- Full-screen photo viewer (viewer.js) ---------- */
.gallery .view-photo {
  cursor: zoom-in;
}

body.viewer-open {
  overflow: hidden;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.96);
  color: #fff;
}

.photo-viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0.5rem, env(safe-area-inset-top)) 0.75rem 0.5rem;
}

.photo-viewer-count {
  font-size: 0.95rem;
  opacity: 0.85;
  padding-left: 0.5rem;
}

.photo-viewer-close {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 1.4rem;
}

.photo-viewer-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;       /* pinch and drag are handled by viewer.js */
}

.photo-viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-select: none;
}

/* Highlights: the photo with rounded corners (sight photos stay square) */
.photo-viewer.is-highlight .photo-viewer-img {
  border-radius: 16px;
  max-width: calc(100% - 16px); /* a little gap at the sides so the corners show */
}

.photo-viewer-caption {
  margin: 0;
  padding: 0.6rem 1rem max(0.9rem, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 1rem;
}

.photo-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  min-width: 44px;
  min-height: 64px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border: 0;
  font-size: 2rem;
  line-height: 1;
}

.photo-viewer-nav.prev { left: 0; border-radius: 0 10px 10px 0; }
.photo-viewer-nav.next { right: 0; border-radius: 10px 0 0 10px; }

/* Treasured (019): the star button on a sight */
.treasure-toggle.on {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Year in review (review.js) ---------- */
.review-title {
  font-family: var(--font-lesson);
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.review-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.review-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.review-tile p {
  margin: 0;
}

.review-number {
  font-family: var(--font-lesson);
  font-size: 1.6rem;
  color: var(--accent);
  line-height: 1.2;
}

.review-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.review-bars {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.25rem;
  height: 9rem;
  align-items: end;
}

.review-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 0.2rem;
}

.review-bar {
  width: 100%;
  max-width: 1.4rem;
  min-height: 2px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
}

.review-bar-count,
.review-bar-month {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1;
}

.review-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.review-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--sunken);
}

.review-quote {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 0.5rem 0;
}

.review-lesson {
  margin: 0.2rem 0 0;
  font-family: var(--font-lesson);
  font-size: 1.15rem;
  line-height: 1.4;
}

.review-motto {
  text-align: center;
  margin: 1.5rem 0 0.5rem;
}

.review-card .link-button {
  flex: 0 0 auto;
}

/* "Show all photos" on the share screen */
.share-all {
  align-self: flex-start;
  margin-bottom: 0.75rem;
}

/* The book: a sight's other photos, in a row under the main one (018) */
.book-more-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 6px 0 0.75rem;
}

.book-more {
  margin: 0;
}

.book-more-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
}

.book-more-caption {
  font-size: 0.8rem;
  text-align: center;
  margin-top: 2px;
}

/* A page with extra photos: the main one a little smaller, to fit one sheet */
.book-page.with-more .book-photo {
  max-height: 46vh;
}

@media print {
  .book-page.with-more .book-photo {
    max-height: 120mm;
  }

  .book-more-photos {
    break-inside: avoid;
  }
}

/* ---------- Highlights: 24 hours, from your circles (highlights.js) ---------- */
.highlights {
  margin: 0.25rem 0 1rem;
}

.highlight-row {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  list-style: none;
  margin: 0;
  padding: 0.25rem 0.1rem 0.35rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.highlight-row::-webkit-scrollbar {
  display: none;
}

.highlight-bubble {
  flex: 0 0 auto;
}

.highlight-open,
.highlight-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 4.6rem;
  padding: 0;
  background: none;
  border: 0;
  color: var(--text);
  text-decoration: none;
  font-weight: normal;
  min-height: 0;
}

/* The ring: accent while unseen, quiet once you've looked */
.highlight-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.1rem;
  height: 4.1rem;
  border-radius: 50%;
  padding: 3px;
  border: 2.5px solid var(--accent);
  background: var(--surface);
}

.highlight-ring.seen {
  border-color: var(--border-strong);
}

.highlight-ring.add {
  border-style: dashed;
  color: var(--accent);
  font-size: 1.8rem;
  line-height: 1;
}

.highlight-thumb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--sunken);
}

.highlight-name {
  max-width: 100%;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.highlight-empty {
  margin: 0.25rem 0 0;
}

.highlight-preview {
  display: block;
  width: 100%;
  max-height: 22rem;
  object-fit: contain;
  border-radius: 10px;
  background: var(--sunken);
  margin-bottom: 0.75rem;
}

.highlight-from-sight {
  margin-top: 0.85rem;
}

.highlight-from-sight-hint {
  margin: 0.35rem 0 0;
  text-align: center;
}

/* Under a highlight in the full-screen viewer (always on the dark viewer) */
.photo-viewer-details {
  padding: 0 1rem max(0.9rem, env(safe-area-inset-bottom));
  text-align: center;
}

.photo-viewer-caption + .photo-viewer-details {
  margin-top: -0.4rem;
}

.highlight-details p {
  margin: 0.2rem 0;
}

.highlight-meta {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.highlight-meta.quiet {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.highlight-spoke {
  margin: 0.4rem auto 0.2rem;
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
}

.highlight-spoke.on {
  background: #fff;
  color: #1b1b1b;
}

.highlight-delete {
  color: #ffb4a8;
}

/* ---------- A sight in a circle: one card, read top to bottom ---------- */
.circlesight-by {
  margin: 0.75rem 0 0.25rem;
}

.circlesight-learned {
  margin-top: 1rem;
}

.circlesight-lesson {
  margin-top: 0.15rem;
}

.circlesight-sharer-foot {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.circlesight-sharer-foot:empty {
  display: none;
}

/* The circle's lessons, inside the same card under a soft line */
.circle-lessons.in-card {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.circle-lessons.in-card .lesson-list {
  margin-bottom: 0.5rem;
}

.circle-lessons.in-card .lesson-item {
  background: var(--bg);
}

.lesson-author {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

/* How many highlights a person has posted, on their bubble */
.highlight-ring {
  position: relative;
}

.highlight-count {
  position: absolute;
  right: -0.3rem;
  bottom: -0.2rem;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  border: 2px solid var(--bg);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.05rem;
  text-align: center;
}

/* ---------- Your saved highlights (highlights.js, 022) ---------- */
.saved-highlights {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.saved-highlight-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  min-height: 0;
  color: var(--text);
  font-weight: normal;
  text-align: left;
}

.saved-highlight-photo {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  background: var(--sunken);
}

.saved-highlight-date {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.saved-highlight-live {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.7rem;
  font-weight: 600;
}

.saved-highlight-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.highlight-saved-link {
  display: block;
  margin: 0.2rem auto 0;
  color: #fff;
}

.keep-highlights-chip {
  margin-bottom: 0.25rem;
}

/* Own sight: a little room before "How I'll live it" (now after the verse) */
#view-application-block {
  margin-top: 1rem;
}

/* "Use all photos, as one picture" on a highlight from a sight */
.highlight-collage {
  margin: 0 0 0.75rem;
}

.highlight-preview.making {
  opacity: 0.5;
}

/* ---------- "Respond" with a few kind words (circles.js, 023) ---------- */
.respond-button {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--field);
  color: var(--text);
  font-weight: normal;
  font-size: 0.95rem;
}

.respond-button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* The choices: one wrapping row under the button */
.respond-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.respond-choices[hidden] {
  display: none;
}

.respond-choice {
  min-height: 2.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: normal;
  font-size: 0.9rem;
}

.respond-choice[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

/* On a highlight, full screen (always dark) */
.photo-viewer .respond-button {
  margin: 0.4rem auto 0.2rem;
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
}

.photo-viewer .respond-button.on {
  background: #fff;
  color: #1b1b1b;
}

.photo-viewer .respond-choices {
  justify-content: center;
  margin-bottom: 0.3rem;
}

.photo-viewer .respond-choice {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.photo-viewer .respond-choice[aria-pressed="true"] {
  background: #fff;
  color: #1b1b1b;
}

/* The sharer's further lessons (025), numbered under "What … learned" */
.sharer-more {
  margin: 0.75rem 0 0;
  padding-left: 1.4rem;
  list-style: decimal;
  color: var(--muted);
}

.sharer-more .lesson-item {
  background: transparent;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  padding: 0.25rem 0 0.25rem 0.75rem;
  color: var(--text);
}

/* ---------- More than one lesson (025) ---------- */
/* On the form: each further lesson in its own soft box */
.extra-lessons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.extra-lessons:empty {
  display: none;
}

.extra-lesson {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--bg);
}

.extra-lesson-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.extra-lesson-title {
  font-weight: 600;
  margin: 0;
}

.extra-lesson .hint {
  margin: 0;
}

.add-extra-lesson {
  align-self: flex-start;
  margin: 0.25rem 0 0.5rem;
  padding-left: 0;
}

/* On the sight page: each further lesson's own plan */
.more-lesson-application {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
}

/* Several check-ins on one sight */
.checkin-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.checkin-group[hidden] {
  display: none;
}

.checkin-for {
  flex-basis: 100%;
  font-size: 0.85rem;
  color: var(--muted);
}

/* The book: a sight's further lessons (025) */
.book-more-lesson {
  font-family: var(--font-lesson);
  margin: 0.2rem 0 0;
}

.book-more-plan {
  margin: 0.1rem 0 0.3rem;
  font-size: 0.9em;
  color: var(--book-muted);
}

/* ---------- Languages (i18n.js) ---------- */
/* Hidden for a moment while the language loads, so English doesn't flash */
.i18n-loading body {
  visibility: hidden;
}

.signin-language {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--muted);
}

.signin-language select {
  width: auto;
  display: inline-block;
}

/* Highlights move on by themselves every 10 seconds (viewer.js) */
.photo-viewer-progress {
  position: absolute;
  top: max(0.25rem, env(safe-area-inset-top));
  left: 0.75rem;
  right: 0.75rem;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}
.photo-viewer-progress-fill {
  height: 100%;
  width: 0;
  background: #fff;
}
.photo-viewer-pause {
  min-width: 44px;
  min-height: 44px;
  margin-left: auto;
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 1rem;
}

/* Mute this circle (028) */
.mute-chip { margin-top: 0.25rem; }

/* Owner screen: space used (028) */
.storage-line { margin: 0.5rem 0 0.25rem; }
.storage-line.warn { color: var(--danger); font-weight: 600; }
.storage-bar {
  height: 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  overflow: hidden;
}
.storage-bar-fill { height: 100%; background: var(--accent); }
.storage-line.warn + .storage-bar .storage-bar-fill { background: var(--danger); }
.storage-warning { color: var(--danger); }
/* "How is Consider for you?" (029) */
.rating-stars { display: flex; gap: 0.25rem; margin: 0.25rem 0 0.5rem; }
.rating-star {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 1.9rem;
  line-height: 1;
}
.rating-star[aria-pressed="true"] { color: #c9952b; }
.rating-more textarea { width: 100%; }
.feedback-stars { margin: 0.25rem 0; color: #c9952b; font-size: 1.2rem; letter-spacing: 0.1em; }

/* ---------- Look and feel: depth, sights without a photo, movement ---------- */

/* Cards sit slightly above the page, and press in a touch when tapped */
.sight-card {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 18px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sight-card:active {
  transform: scale(0.985);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* A sight with no photo: a soft tint of the colour set and an accent edge,
   with the lesson a little larger, so it looks intended, not missing */
.sight-card.no-photo {
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, var(--surface)) 0%, var(--surface) 75%);
  border-left: 4px solid color-mix(in srgb, var(--accent) 60%, transparent);
  padding-top: 1.25rem;
  padding-bottom: 1.15rem;
}
.sight-card.no-photo .sight-lesson {
  font-size: 1.32rem;
  line-height: 1.35;
}

/* A different screen fades and rises in */
@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.screen-in { animation: screen-in 0.22s ease-out both; }

/* Cards fade in one after another the first time a list fills */
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.card-in { animation: card-in 0.35s ease-out both; animation-delay: calc(var(--i, 0) * 45ms); }

/* A tap on Treasure, Respond or a star */
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.pop { animation: pop 0.28s ease-out; }

/* Phones set to "reduce motion": no fades, slides or pops at all */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- "Add a sight": a warm card-button under the highlights ---------- */
.add-sight {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0.95rem 1rem 0.95rem 0.95rem;
  text-align: left;
  border-radius: 18px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--on-accent) 16%, transparent) 0%, transparent 55%),
    linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 78%, #000) 100%);
  color: var(--on-accent);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent), 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.add-sight:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 30%, transparent);
}
.add-sight svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.add-sight-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--on-accent) 18%, transparent);
}
.add-sight-icon svg { width: 28px; height: 28px; }
.add-sight-text { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.add-sight-title { font-family: var(--font-lesson); font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.add-sight-sub { font-size: 0.9rem; font-weight: 500; opacity: 0.88; }
.add-sight-plus {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--on-accent);
  color: var(--accent);
}
.add-sight-plus svg { width: 20px; height: 20px; stroke-width: 2.4; }

/* ---------- A sight's Edit / Share image / Treasure: icons with a small word ---------- */
.icon-actions {
  display: flex;
  justify-content: space-around;
  gap: 0.5rem;
  margin-top: 1rem;
}
.icon-action {
  flex: 1;
  max-width: 7.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-height: auto;
  padding: 0.35rem 0.25rem;
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.icon-action svg {
  box-sizing: content-box;
  width: 24px;
  height: 24px;
  padding: 13px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease, background-color 0.2s ease;
}
.icon-action:active svg { transform: scale(0.92); }
.icon-action-label { line-height: 1.15; text-align: center; }
/* Edit is the main one: a filled circle */
#view-edit svg { background: var(--accent); border-color: var(--accent); stroke: var(--on-accent); }
/* Treasured: the star fills in gold */
.treasure-toggle.icon-action.on { color: var(--text); }
.treasure-toggle.on svg { fill: #e0b13d; stroke: #b8861b; }

/* ---------- A slimmer header ---------- */
/* Signed in, the page starts closer to the top… */
.page:has(#app-view:not([hidden])) {
  padding-top: max(0.75rem, env(safe-area-inset-top));
}
/* …"Consider" is a slim line on Sights… */
.page:has(#app-view:not([hidden])) .title {
  font-size: 1.45rem;
  margin-bottom: 0.65rem;
  gap: 0.45rem;
}
.page:has(#app-view:not([hidden])) .logo {
  width: 1.65rem;
  height: 1.65rem;
}
/* …and gone on every other screen, which has its own title */
body:not([data-screen="feed"]) .page:has(#app-view:not([hidden])) .title {
  display: none;
}

/* ---------- A calmer Add form ---------- */
/* Start with the photo: a large, soft, dashed place to tap */
.photo-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.4rem 1rem 1.1rem;
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  text-align: center;
}
.photo-zone[hidden] { display: none; }
.photo-zone-icon {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.photo-zone-text {
  margin: 0;
  font-family: var(--font);
  font-size: 1.15rem;
  color: var(--text);
}
.photo-zone-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.photo-zone-buttons button {
  flex: 1 1 8.5rem;
  border-radius: 999px;
}
/* With a photo already: just two small "another" buttons */
.photo-zone.has-photos {
  padding: 0;
  border: 0;
  background: none;
}
.photo-zone.has-photos .photo-zone-icon,
.photo-zone.has-photos .photo-zone-text { display: none; }

/* The three questions read like a journal page */
label.question {
  margin-top: 0.4rem;
  font-family: var(--font);
  font-weight: normal;
  font-size: 1.2rem;
  color: var(--text);
}
label.question .optional { font-family: var(--font-ui, inherit); }
textarea.journal-field {
  font-family: var(--font-lesson);
  line-height: 1.5;
  border: 1px solid transparent;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 12px 12px 4px 4px;
  background: var(--sunken);
  padding: 0.8rem 0.9rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
textarea.journal-field:focus {
  border-bottom-color: var(--accent);
  background: var(--field);
}

/* One clear Save; "Save for later" and "Cancel" quieter, side by side */
.form-save {
  width: 100%;
  margin-top: 0.5rem;
  border-radius: 999px;
  min-height: 3.1rem;
  font-size: 1.05rem;
}
.form-quiet-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}
.form-quiet-actions button { min-height: 2.75rem; }
.form-quiet-actions button[hidden] { display: none; }

/* ---------- Placeholders while loading ---------- */
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.sight-card.placeholder {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  box-shadow: none;
  pointer-events: none;
}
.ph {
  border-radius: 8px;
  background: linear-gradient(90deg,
    var(--sunken) 0%, color-mix(in srgb, var(--sunken) 55%, var(--surface)) 50%, var(--sunken) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.ph-photo {
  width: calc(100% + 2.25rem);
  margin: -1rem -1.125rem 0.35rem;
  aspect-ratio: 4 / 3;
  border-radius: 12px 12px 0 0;
}
.ph-line { height: 0.95rem; width: 62%; }
.ph-line.wide { height: 1.25rem; width: 88%; }
.ph-line.short { width: 38%; }

/* ---------- Tidy-up: one corner rounding, finger-sized links ---------- */
/* Cards and the photos inside them share one rounding (matches the new
   buttons); the photo's top corners follow the card's. */
.card, .sight-card { border-radius: 16px; }
.sight-photo, .view-photo, .ph-photo { border-radius: 16px 16px 0 0; }

/* Links that stand alone (not inside a sentence) are at least 44px tall */
.bible-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---------- A crisp header (signed in) ---------- */
/* On the big sign-in logo the soft shadows and shine look glossy; on the
   small header logo they smudge its edges. So the small one goes flat and
   sharp: no outer shadow, no shadow under the lily, no shine. */
.page:has(#app-view:not([hidden])) .logo {
  width: 1.85rem;
  height: 1.85rem;
  filter: none;
  shape-rendering: geometricPrecision;
}
.page:has(#app-view:not([hidden])) .logo [filter] { filter: none; }
.page:has(#app-view:not([hidden])) .logo path[fill="url(#lg-shine)"] { display: none; }
/* The name: steady weight, no smoothing tricks, sits level with the lily */
.page:has(#app-view:not([hidden])) .title-text {
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

/* ---------- Finding your sights, on Sights (browse.js) ---------- */
.page { position: relative; }

/* The search and filter icons sit on the header line, on Sights only */
.find-icons {
  position: absolute;
  top: max(0.35rem, calc(env(safe-area-inset-top) - 0.4rem));
  right: 1rem;
  display: none;
  gap: 0.25rem;
}
body[data-screen="feed"] .page:has(#app-view:not([hidden])) .find-icons { display: flex; }

.find-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.find-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.find-icon.on,
.find-icon[aria-expanded="true"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.find-badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}

/* The search box */
.find-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
}
.find-box input {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
}
.find-close {
  flex: none;
  width: 44px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
}

/* The filter panel: tappable chips, then theme and Bible book */
.filter-panel { margin: 0 0 0.9rem; gap: 0.5rem; }
.filter-chips-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.4rem; }
.filter-chip,
.filter-on-chip {
  min-height: 40px;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-weight: 600;
  font-size: 0.95rem;
}
.filter-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.filter-panel-end {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}
.filter-panel-end .secondary { min-width: 6rem; border-radius: 999px; }

/* The filters that are on, above the list, each with ✕ */
.filter-on { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.75rem; }
.filter-on-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.filter-on-x { font-size: 0.85rem; opacity: 0.75; }

/* While searching or filtering, the other cards on Sights step aside */
#feed-view.finding > :not(.find-area):not(#feed-list) { display: none !important; }

/* ---------- Put Consider on your Home Screen (notify.js) ---------- */
.install-steps { margin: 0.25rem 0 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 0.3rem; }
.install-steps li { padding-left: 0.2rem; }

/* ---------- Looking back on last month (browse.js) ---------- */
.month-card {
  position: relative;
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 10%, var(--surface)) 0%, var(--surface) 70%);
}
.month-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 44px;
  padding: 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 1.1rem;
}
.month-count { margin: 0; font-family: var(--font); font-size: 1.3rem; line-height: 1.35; }
.month-quote {
  display: block;
  font-family: var(--font-lesson);
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid color-mix(in srgb, var(--accent) 60%, transparent);
  padding-left: 0.75rem;
}
.month-see { align-self: flex-start; border-radius: 999px; }

/* ---------- A brand-new journal: your first sight (sights.js) ---------- */
.first-sight { display: flex; flex-direction: column; gap: 0.75rem; margin: 0.25rem 0 1rem; }
.first-sight[hidden] { display: none; }
.first-sight-title { margin: 0; font-family: var(--font); font-weight: normal; font-size: 1.5rem; }
.first-sight-text { margin: 0; color: var(--muted); }
.example-sight { position: relative; pointer-events: none; }
.example-photo {
  display: block;
  width: calc(100% + 2.25rem);
  margin: -1rem -1.125rem 0.875rem;
  aspect-ratio: 4 / 3;
  height: auto;
  border-radius: 16px 16px 0 0;
}
.example-lesson { font-family: var(--font-lesson); font-size: 1.2rem; margin: 0 0 0.5rem; }
.example-saw { margin: 0 0 0.375rem; font-size: 1rem; }
.example-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 1;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #24332b;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ---------- Share image: the style chips (share.js) ---------- */
.share-styles { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 0.75rem; }
.share-styles .filter-chip[hidden] { display: none; }

/* ---------- Adjust a photo: rotate and crop (photo-edit.js) ---------- */
.photo-editor {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: #111;
  color: #fff;
}
.photo-editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0.5rem, env(safe-area-inset-top)) 0.75rem 0.5rem;
}
.photo-editor-title { font-weight: 600; }
.photo-editor-cancel { color: #ddd; }
.photo-editor-done { border-radius: 999px; min-width: 5.5rem; }
.photo-editor-stage { flex: 1; display: grid; place-items: center; padding: 0.5rem 1rem; overflow: hidden; }
.photo-editor-canvas {
  touch-action: none;
  cursor: grab;
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 8px 30px rgba(0, 0, 0, 0.5);
}
.photo-editor-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.75rem 1rem max(1rem, env(safe-area-inset-bottom));
  background: #1b1b1b;
}
.photo-editor-controls .secondary { color: #fff; border-color: rgba(255, 255, 255, 0.5); align-self: flex-start; border-radius: 999px; }
.photo-editor-shapes { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.photo-editor-shapes .filter-chip { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.photo-editor-shapes .filter-chip[aria-pressed="true"] { background: #fff; color: #111; border-color: #fff; }
.photo-editor-zoom-label { font-size: 0.9rem; color: #ccc; }
.photo-editor-zoom { width: 100%; accent-color: #fff; }
.photo-editor-hint { color: #bbb; margin: 0; }

/* ---------- Owner screen: problems (admin.js) ---------- */
.problem-message { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; word-break: break-word; }

/* ---------- The header (signed in): centred, as Gary prefers ---------- */
/* The lily and name stay centred; the search and filter icons sit on the
   right of the same line. */
/* "Good morning", centred under the name, on Sights only */
.greeting {
  margin: -0.45rem 0 0.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.greeting[hidden],
body:not([data-screen="feed"]) .greeting { display: none; }
.page:not(:has(#app-view:not([hidden]))) .greeting { display: none; } /* never on sign-in */
/* Equal room on both sides keeps the name centred AND clear of the icons on
   the right. The header is a logo, so its size stays fixed (it doesn't grow
   with Settings → Appearance → text size). */
.page:has(#app-view:not([hidden])) .title {
  font-size: 23px;
  padding: 0 84px;
}
.page:has(#app-view:not([hidden])) .logo {
  width: 30px;
  height: 30px;
}
/* The icons tucked near the right edge (tap areas still 44px), so the
   centred name has room to breathe; fixed in px like the header. */
.find-icons { right: 4px; gap: 0; }
/* Very narrow phones: slightly slimmer icon buttons so they never touch the name */
@media (max-width: 350px) {
  .find-icon { width: 38px; }
  .page:has(#app-view:not([hidden])) .title { font-size: 21px; }
}

/* ---------- Header clear of the phone's top fade, and fading as you scroll ---------- */
/* Newer iPhones softly fade whatever sits under the clock. The header now
   starts a little lower, so the name, lily and icons sit clear of it... */
:root { --head-top: calc(max(0.75rem, env(safe-area-inset-top, 0px)) + 14px); }
.page:has(#app-view:not([hidden])) { padding-top: var(--head-top); }
.find-icons { top: calc(var(--head-top) - 7px); }
/* ...and on Sights they fade away as you scroll (sights.js sets --head-fade) */
.page:has(#app-view:not([hidden])) .title,
.greeting,
.find-icons {
  opacity: var(--head-fade, 1);
  transition: opacity 0.12s linear;
}

/* "Adjust photo" under a highlight's photo, only while there is one */
.highlight-adjust { align-self: flex-start; }
#highlight-preview[hidden] + .highlight-adjust { display: none; }
.share-adjust { align-self: flex-start; margin: -0.25rem 0 0.5rem; }

/* ---------- Reporting a highlight (032) ---------- */
/* The "⋯" in the highlight viewer's top bar, beside pause and close:
   white and finger-sized, its menu dropping down from the right */
.photo-viewer-extra { margin-left: auto; display: flex; }
.photo-viewer-extra + .photo-viewer-pause { margin-left: 0; }
.photo-viewer .viewer-menu { margin-left: 0; }
.photo-viewer .viewer-menu > summary { color: #fff; font-size: 1.6rem; line-height: 1; }
.photo-viewer .viewer-menu .lesson-menu-items { top: 100%; bottom: auto; right: 0; }
.photo-viewer .report-note-inline { color: #f3d98f; }
/* A reported highlight on the circle and owner screens */
.reported-highlight-photo { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; }

/* ---------- Back to the top (sights.js) ---------- */
.to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 49;
  display: grid;
  place-items: center;
  width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  animation: card-in 0.2s ease-out both;
}
.to-top svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Pictures beside names (avatars.js, 033) ---------- */
.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  line-height: 1;
  background: var(--sunken);
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 26px; height: 26px; font-size: 0.75rem; }
.avatar-md { width: 34px; height: 34px; font-size: 0.9rem; }
.avatar-lg { width: 96px; height: 96px; font-size: 2.4rem; }
/* A name line with its picture in front */
.avatar-line { display: flex; align-items: center; gap: 0.5rem; }
.theme-row .avatar { margin-right: 0.6rem; }
.theme-row:has(.avatar) { display: flex; align-items: center; }
/* Settings → Your picture */
.avatar-settings { align-items: flex-start; }
.avatar-preview { display: flex; }

/* ---------- Several photos on a card: swipe sideways (gallery.js) ---------- */
.card-photos {
  position: relative;
  width: calc(100% + 2.25rem);       /* to the card's edges, like a single cover */
  margin: -1rem -1.125rem 0.875rem;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  background: var(--sunken);
}
.card-photos-strip {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.card-photos-strip::-webkit-scrollbar { display: none; }
.card-photos .card-photos-item {
  flex: 0 0 100%;
  width: 100%;
  margin: 0;
  border-radius: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.card-photos-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.55rem;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}
.card-photos-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.card-photos-dots span.on { background: #fff; transform: scale(1.2); }
.card-photos-count {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  pointer-events: none;
}

/* ---------- Long lessons on cards: first lines, then "See more" (gallery.js) ---------- */
.sight-lesson.clampable:not(.clamp-open) {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 60%, transparent 100%);
}
.see-more {
  display: inline-block;
  min-height: 36px;
  margin: -0.35rem 0 0.35rem;
  padding: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---------- Search and filters inside a circle (circles.js) ---------- */
.circle-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.circle-head .screen-title { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.circle-find-icons { display: flex; flex: none; }
.circle-find { margin: 0.75rem 0 0; display: flex; flex-direction: column; }
.circle-find:has(> :not([hidden])) { margin-bottom: 0.5rem; }
.label-like { margin: 0; font-weight: 600; }
.person-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding-left: 0.35rem; }
.person-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.filter-panel .filter-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* While searching or filtering, the circle's other sections step aside */
#circle-body.circle-finding > :not(.circle-head):not(.circle-find) { display: none !important; }

/* ---------- Write your own encouragement (circles.js, 034) ---------- */
.respond-write { font-style: italic; }
.note-composer { flex-basis: 100%; display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.25rem; }
.note-box { width: 100%; font-family: var(--font-lesson); }
.note-actions { display: flex; align-items: center; gap: 0.75rem; }
.note-left { margin: 0 auto 0 0; font-variant-numeric: tabular-nums; }
.note-send { border-radius: 999px; min-width: 5rem; }
.note-take-back[hidden] { display: none; }
/* For the person encouraged: each note on its own line, with its writer */
.responses-block { display: flex; flex-direction: column; gap: 0.4rem; }
.response-note { display: flex; align-items: flex-start; gap: 0.5rem; }
.response-note .avatar { margin-top: 0.15rem; }
.response-note-text { margin: 0; flex: 1; font-family: var(--font-lesson); }
.response-note .lesson-menu { margin-left: 0; }
.photo-viewer .response-note-text { color: #fff; }
.photo-viewer .response-note .lesson-menu > summary { color: #fff; }
.reported-note { font-style: italic; }

/* ---------- A bigger header name, with the greeting set a little lower ---------- */
/* The lily and "Consider" are larger, and "Good morning" sits further below
   them with matching room underneath, for a more balanced top. */
.page:has(#app-view:not([hidden])) .title { font-size: 29px; }
.page:has(#app-view:not([hidden])) .logo { width: 38px; height: 38px; }
.find-icons { top: calc(var(--head-top) - 3px); }
.greeting { margin: 0.4rem 0 1.1rem; font-size: 1rem; }
@media (max-width: 350px) {
  .page:has(#app-view:not([hidden])) .title { font-size: 24px; }
  .page:has(#app-view:not([hidden])) .logo { width: 32px; height: 32px; }
}

/* ---------- Unviewed highlights: a bright ring that stands out ---------- */
/* A warm amber-to-raspberry ring, the same in every colour set (it should
   catch the eye rather than match). Light sets use a deeper amber so both
   ends stay at least 3:1 against the page; dark sets use brighter ends.
   Seen rings stay quiet (.seen), and the "+" keeps the accent. */
:root { --ring-a: #c96a00; --ring-b: #d6246e; }
:root[data-scheme='dark'] { --ring-a: #ffb020; --ring-b: #ff5a8a; }
.highlight-ring:not(.seen):not(.add) {
  border: 3px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(45deg, var(--ring-a), var(--ring-b)) border-box;
}

/* ---------- A picture for each circle (avatars.js, 035) ---------- */
/* A rounded square (people are round circles, so the two never get mixed up) */
.circle-pic {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 22%;
  color: #fff;
  font-weight: 600;
  line-height: 1;
}
.circle-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.circle-pic-sm { width: 44px; height: 44px; font-size: 1.2rem; }
.circle-pic-lg { width: 56px; height: 56px; font-size: 1.5rem; }
.circle-name-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; }
.circle-name-row .circle-name { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.circle-title-row { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.circle-title-row .screen-title { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.circle-head > .circle-title-row { flex: 1; }
.circle-pic-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.circle-pic-preview .circle-pic-lg { width: 96px; height: 96px; font-size: 2.4rem; }
.circle-pic-buttons { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }

/* ---------- Messages float at the bottom of the screen (app.js showMessage) ---------- */
/* Saving, loading and problems show just above the tab bar, wherever you've
   scrolled to. Tap one to dismiss it. */
.message {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
  width: min(32rem, calc(100% - 2rem));
  margin: 0;
  min-height: 0;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  z-index: 60;
  cursor: pointer;
  animation: message-in 0.18s ease-out;
}
.message.error { color: var(--danger); border-color: var(--danger); }
.message:empty { display: none; }
/* Above the tab bar when it's showing */
body:has(.tab-bar:not([hidden])) .message { bottom: calc(env(safe-area-inset-bottom, 0px) + 5.25rem); }
@keyframes message-in {
  from { opacity: 0; transform: translate(-50%, 0.5rem); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) { .message { animation: none; } }

/* A circle's small picture inside a choice chip (avatars.js circleChipText) */
.chip .chip-with-pic { display: inline-flex; align-items: center; gap: 0.45rem; box-sizing: border-box; padding: 0.3rem 0.95rem 0.3rem 0.35rem; }
.circle-pic-xs { width: 28px; height: 28px; font-size: 0.85rem; }
.chip input:checked + .chip-with-pic::before { content: '✓'; }

/* ---------- Pull down to refresh (pull-refresh.js) ---------- */
/* Our own pull-to-refresh replaces the browser's (which reloads the whole page) */
html { overscroll-behavior-y: contain; }
.pull-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 55;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border-strong);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  font-size: 1.35rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(var(--pull, 0px) - 44px + env(safe-area-inset-top, 0px))) rotate(var(--turn, 0deg));
  transition: opacity 0.15s;
}
.pull-indicator.showing { opacity: 1; }
.pull-indicator.ready { color: var(--accent); border-color: var(--accent); }
.pull-indicator.spinning { animation: pull-spin 0.8s linear infinite; }
@keyframes pull-spin {
  from { transform: translateY(calc(26px + env(safe-area-inset-top, 0px))) rotate(0deg); }
  to { transform: translateY(calc(26px + env(safe-area-inset-top, 0px))) rotate(360deg); }
}

/* ---------- "You're offline" bar (outbox.js) ---------- */
.offline-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 58;
  padding: calc(env(safe-area-inset-top, 0px) + 0.4rem) 1rem 0.4rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9rem;
  text-align: center;
}
.offline-bar[hidden] { display: none; }
body.is-offline .page,
body.is-offline .page:has(#app-view:not([hidden])) { padding-top: calc(var(--head-top, 1rem) + 2.4rem); }
body.is-offline .find-icons { top: calc(var(--head-top) - 3px + 2.4rem); }

/* "What's new" card (whats-new.js) */
.whats-new-list { margin: 0.25rem 0 0.75rem; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; }
/* The picture is a span inside the chip: don't give it the chip's own look */
.chip .circle-pic { display: inline-flex; min-height: 0; padding: 0; border: 0; border-radius: 22%; line-height: 1; font-size: 0.85rem; cursor: inherit; }
.chip input:checked + .chip-with-pic .circle-pic::before { content: none; }

/* ---------- Invite QR code (qr.js) ---------- */
.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
}
.qr-panel {
  width: min(24rem, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.25rem;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.qr-heading { display: flex; align-items: center; gap: 0.6rem; max-width: 100%; }
.qr-title { margin: 0; font-size: 1.3rem; overflow-wrap: anywhere; }
/* Always black on white (cameras read it best), whatever the colour set */
.qr-code { width: 100%; max-width: 20rem; height: auto; border-radius: 8px; background: #fff; }
.qr-hint { margin: 0; text-align: center; color: var(--muted); }
.qr-actions { justify-content: center; flex-wrap: wrap; }
/* Messages show above the QR screen too */
.message { z-index: 80; }
.qr-actions button { white-space: nowrap; }

/* ---------- Past prompts (prompts.js) ---------- */
.past-prompts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.past-prompt .idea-text { margin: 0.25rem 0; }
.past-prompts-link { display: inline-block; margin-top: 0.6rem; }

/* ---------- Account: your profile card (profile.js) ---------- */
.profile-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.profile-picture .avatar-lg { width: 72px; height: 72px; font-size: 1.9rem; }
.profile-who { min-width: 0; }
.profile-name { margin: 0 0 0.2rem; font-family: var(--font); font-size: 1.35rem; font-weight: 600; overflow-wrap: anywhere; }
.profile-who .account-email { margin: 0; overflow-wrap: anywhere; }

/* ---------- A circle's header: name, then four icons (circles.js) ---------- */
/* Search, filter, members and settings. On a narrow phone with a long name
   the icons drop to their own line, on the right. */
.circle-head { flex-wrap: wrap; row-gap: 0.25rem; }
.circle-head > .circle-title-row { flex: 1 1 auto; min-width: 0; }
.circle-find-icons { margin-left: auto; }
.circle-find-icons .find-icon { width: 40px; }
.circle-find-icons .find-icon.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
details.fold[hidden] { display: none; }

/* ---------- Account → Your fruit (themes.js) ---------- */
.fruit-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.fruit-row { display: grid; grid-template-columns: 7.5rem 1fr 2rem; align-items: center; gap: 0.6rem; }
.fruit-name { overflow-wrap: anywhere; }
.fruit-bar { height: 0.6rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); overflow: hidden; }
.fruit-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.fruit-count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.themes-tidy { margin-top: 0.5rem; }

/* ---------- Account → Your prayer list (prayer.js) ---------- */
.prayer-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.prayer-item { padding: 0.75rem; border: 1px solid var(--border); border-radius: 12px; background: var(--field); }
.prayer-item.prayed { opacity: 0.75; }
.prayer-who { margin: 0 0 0.35rem; }
.prayer-words { margin: 0 0 0.5rem; font-family: var(--font-lesson); overflow-wrap: anywhere; }
.prayer-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }

/* ---------- A pinned sight in a circle (circles.js, 037) ---------- */
.pinned-here { margin-bottom: 1rem; }
.pin-button { display: block; margin: -0.25rem 0 0.75rem; }

/* ---------- Prayer answered (038) ---------- */
.lesson-answered { margin: 0.25rem 0 0.4rem; font-weight: 600; color: var(--accent); }
.answer-button { display: block; margin-top: 0.35rem; }

/* ---------- Swiping card photos on iPhone ---------- */
/* iOS cancels a sideways scroll if the card shrinks under your finger (the
   :active press effect), which it does once the page listens for touches
   (pull-refresh.js). So cards with several photos don't shrink, and the
   strip says plainly it scrolls sideways; the photos can't be dragged out. */
.sight-card:has(.card-photos):active { transform: none; }
.card-photos-strip { touch-action: pan-x pan-y; }
.card-photos-strip img { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }

/* ---------- Your own highlight's details, tidied (highlights.js) ---------- */
.highlight-own { text-align: left; max-width: 26rem; margin: 0 auto; }
.hl-own-who { display: flex; align-items: center; gap: 0.65rem; }
.hl-own-who .avatar { width: 40px; height: 40px; font-size: 1.05rem; }
.hl-own-who-text p { margin: 0; }
.hl-own-name { color: #fff; font-weight: 600; }
.hl-own-info {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.hl-own-line { display: flex; align-items: flex-start; gap: 0.55rem; }
.hl-own-line > :last-child { flex: 1; min-width: 0; margin: 0; }
.hl-own-icon { flex: none; width: 1.2rem; text-align: center; line-height: 1.5; }
.hl-own-actions { justify-content: center; gap: 2rem; margin-top: 0.9rem; }
.hl-own-action { color: rgba(255, 255, 255, 0.85); background: transparent; border: 0; }
.hl-own-action svg {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: none;
  stroke: #fff;
}
.hl-own-delete svg { stroke: #ffb4a8; border-color: rgba(255, 180, 168, 0.45); }
.hl-own-delete { color: #ffb4a8; }

/* ---------- This week in a circle: a sideways row of tiles (circles.js) ---------- */
.week-strip-count { margin: 0.25rem 0 0.4rem; }
.week-strip {
  list-style: none;
  margin: 0 -0.25rem;
  padding: 0 0.25rem 0.35rem;
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}
.week-strip::-webkit-scrollbar { display: none; }
.week-tile { flex: 0 0 9.25rem; scroll-snap-align: start; }
.week-tile-link {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 100%;
  padding: 0.45rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: normal;
}
.week-tile-photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: 9px;
  overflow: hidden;
  background: var(--sunken);
  display: grid;
  place-items: center;
}
.week-tile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.week-tile-photo.no-photo span { font-size: 1.6rem; color: var(--muted); }
.week-tile-who { margin: 0; font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-tile-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- "This week", folded to one line (prompts.js, circles.js) ---------- */
.week-card.week-card-folded { padding: 0; }
.week-folded {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 2.9rem;
  padding: 0.55rem 0.9rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: normal;
}
.week-folded-label { flex: none; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.week-folded-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.week-folded-open { flex: none; color: var(--muted); font-size: 1.1rem; line-height: 1; }

/* A photo being prepared: a tile straight away (sights.js usePhotoFile) */
.photo-item-coming {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5rem;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  animation: coming-pulse 1.2s ease-in-out infinite;
}
@keyframes coming-pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .photo-item-coming { animation: none; } }

/* The arrow that folds "This week" (prompts.js, circles.js): matches the ⌄ on the folded line */
.week-fold-arrow { font-size: 1.15rem; line-height: 1; padding-top: 0.35rem; }
.week-fold-arrow { display: grid; place-items: center; padding: 0; }
.week-fold-arrow svg, .week-folded-open svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.week-folded-open { display: grid; place-items: center; }

/* Compare: just the two photos (gallery.js); with more than two, tap one to change it */
.gallery-compare:not([hidden]) { display: block; }
.gallery-compare-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
button.gallery-compare-side { padding: 0; min-height: 0; border: 0; background: none; border-radius: 10px; cursor: pointer; }
.gallery-compare-hint { margin: 0.4rem 0 0; text-align: center; }

/* ---------- The photo viewer: a blurred copy of the photo behind it (viewer.js) ---------- */
.photo-viewer { overflow: hidden; }
.photo-viewer-backdrop {
  position: absolute;
  inset: -12%;                 /* past the edges, so the blur has no hard border */
  z-index: -1;                 /* behind everything in the viewer, above its black */
  background: center / cover no-repeat;
  filter: blur(28px) brightness(0.42) saturate(1.25);
  transform: translateZ(0);
  pointer-events: none;
}
@media (prefers-reduced-transparency: reduce) { .photo-viewer-backdrop { display: none; } }

/* ---------- Lessons as quotes, Bible references as tags ---------- */
/* "What I learned" is the heart of each sight: a quote with a thin accent line */
.sight-card .sight-lesson,
.lesson-text,
.view-lesson {
  border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  padding-left: 0.75rem;
}
.sight-card .sight-lesson { font-style: italic; }
/* Bible references: small rounded tags */
.lesson-ref,
#view-bible {
  display: inline-block;
  align-self: flex-start;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  text-decoration: none;
  font-size: 0.9rem;
}

/* ---------- Treasured sights: a soft gold edge (sights.js) ---------- */
.sight-card.treasured {
  box-shadow: 0 0 0 2px rgba(224, 177, 61, 0.65), 0 6px 18px rgba(224, 177, 61, 0.18);
}

/* ---------- Friendlier empty screens: a small line-drawn lily ---------- */
.empty-art { text-align: center; }
.empty-art::before {
  content: '';
  display: block;
  width: 64px;
  height: 64px;
  margin: 0.5rem auto 0.75rem;
  background: color-mix(in srgb, var(--accent) 75%, transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M32 36c0 8-1 14-3 20'/%3E%3Cpath d='M32 36c-9-1-15-7-17-16 9 1 15 7 17 16z'/%3E%3Cpath d='M32 36c9-1 15-7 17-16-9 1-15 7-17 16z'/%3E%3Cpath d='M32 10c6 8 6 18 0 26-6-8-6-18 0-26z'/%3E%3Cpath d='M30 50c-6-1-10-4-12-9 6 0 10 4 12 9z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M32 36c0 8-1 14-3 20'/%3E%3Cpath d='M32 36c-9-1-15-7-17-16 9 1 15 7 17 16z'/%3E%3Cpath d='M32 36c9-1 15-7 17-16-9 1-15 7-17 16z'/%3E%3Cpath d='M32 10c6 8 6 18 0 26-6-8-6-18 0-26z'/%3E%3Cpath d='M30 50c-6-1-10-4-12-9 6 0 10 4 12 9z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- The greeting, softly tinted by the time of day (sights.js) ---------- */
.greeting[data-part] {
  display: table;
  margin-left: auto;
  margin-right: auto;
  padding: 0.15rem 1rem;
  border-radius: 999px;
}
.greeting[data-part='dawn']  { background: linear-gradient(90deg, rgba(255, 196, 140, 0.22), rgba(255, 226, 170, 0.22)); }
.greeting[data-part='day']   { background: linear-gradient(90deg, rgba(255, 224, 130, 0.18), rgba(190, 225, 170, 0.18)); }
.greeting[data-part='dusk']  { background: linear-gradient(90deg, rgba(240, 160, 150, 0.2), rgba(190, 160, 220, 0.2)); }
.greeting[data-part='night'] { background: linear-gradient(90deg, rgba(110, 130, 200, 0.2), rgba(150, 120, 200, 0.18)); }

/* ---------- A sight's photos: one frame for all (gallery.js) ---------- */
/* Several photos of different shapes sit in the same 4:5 frame, each shown
   whole over a blurred copy of itself, so the strip never jumps in height or
   leaves a gap under a wide photo. */
.gallery-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 72vh;
  width: 100%;
  overflow: hidden;
  background: var(--sunken);
}
.gallery-item:first-child .gallery-frame,
.gallery-strip .gallery-frame { border-radius: 12px 12px 0 0; }
.gallery-fill {
  position: absolute;
  inset: -10%;
  background: center / cover no-repeat;
  filter: blur(22px) brightness(0.8) saturate(1.15);
  transform: translateZ(0);
}
.gallery-frame .view-photo {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}

/* ---------- Pin a sight: a pushpin icon under the lesson (circles.js) ---------- */
.pin-row { display: flex; justify-content: flex-end; margin: 0.35rem 0 0; }
.pin-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.pin-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transform: rotate(35deg); }
.pin-icon.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pin-icon.on svg { fill: currentColor; }

/* ---------- No accidental page zoom (viewer.js) ---------- */
/* A double-tap never zooms the whole app (which can get stuck, especially
   near a photo); pinch-to-zoom stays available everywhere. The photo itself
   has its own double-tap zoom in the viewer. */
html, .photo-viewer { touch-action: manipulation; }

/* ---------- Month headings in your Sights list (browse.js) ---------- */
.month-divider {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0 -0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.month-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.month-divider:first-child { margin-top: 0; }

/* ---------- Sliding between screens (sights.js showScreen) ---------- */
@keyframes screen-forward { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes screen-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.screen-forward { animation: screen-forward 0.24s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.screen-back { animation: screen-back 0.24s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
@media (prefers-reduced-motion: reduce) { .screen-forward, .screen-back { animation: none; } }

/* ---------- A circle's cover band (avatars.js circleBannerEl) ---------- */
.circle-banner {
  position: relative;
  height: 92px;
  margin: 0 0 0;
  border-radius: 18px;
  overflow: hidden;
}
.circle-banner-photo {
  position: absolute;
  inset: -20%;
  background: center / cover no-repeat;
  filter: blur(18px) brightness(0.92) saturate(1.2);
  transform: translateZ(0);
}
/* The circle's picture overlaps the bottom of the band */
.circle-banner + .circle-head .circle-title-row,
.circle-banner + .circle-title-row { align-items: flex-end; }
.circle-banner + .circle-head .circle-pic-lg,
.circle-banner + .circle-title-row .circle-pic-lg {
  margin-top: -30px;
  margin-left: 0.75rem;
  border: 3px solid var(--bg);
  box-sizing: content-box;
}
.circle-banner + .circle-head { margin-top: 0; }
/* Searching or filtering: just the header */
#circle-body.circle-finding > .circle-banner { display: none !important; }
body { overflow-x: clip; } /* screens sliding in never make the page scroll sideways */

/* ---------- A little bounce on respond / treasure / pin (sights.js) ---------- */
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(0.9); } 75% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes twirl { 0% { transform: scale(1) rotate(0); } 50% { transform: scale(1.3) rotate(72deg); } 100% { transform: scale(1) rotate(144deg); } }
.pop { animation: pop 0.32s ease-out; }
.treasure-toggle.pop svg { animation: twirl 0.45s ease-out; }
@media (prefers-reduced-motion: reduce) { .pop, .treasure-toggle.pop svg { animation: none; } }

/* ---------- Dark mode: gentler photos, cards with a soft edge ---------- */
:root[data-scheme='dark'] .sight-photo,
:root[data-scheme='dark'] .view-photo,
:root[data-scheme='dark'] .week-tile-photo img,
:root[data-scheme='dark'] .gallery-compare-photo,
:root[data-scheme='dark'] .highlight-thumb {
  filter: brightness(0.9);
}
:root[data-scheme='dark'] .sight-card,
:root[data-scheme='dark'] .card {
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 6px 18px rgba(0, 0, 0, 0.35);
}
:root[data-scheme='dark'] .sight-card.treasured {
  box-shadow: 0 0 0 2px rgba(224, 177, 61, 0.55), 0 6px 18px rgba(224, 177, 61, 0.12);
}

/* The circle's picture sits IN FRONT of the banner's bottom edge (the banner
   is positioned, so the picture needs its own layer above it) */
.circle-banner + .circle-head .circle-pic-lg,
.circle-banner + .circle-title-row .circle-pic-lg {
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.circle-banner { z-index: 0; }
