/* The field journal (src/ui/journal.js), the island notes and the tap card (src/ui/island-notes.js).
   Cream paper with night text and Fraunces italic for observations (docs/15). A 440 px panel on
   the right, above the bottom controls. Panels animate only opacity and transform. */

:root {
  --jr-paper: #F4EEE4;
  --jr-ink: #1E2624;
  --jr-soft: #4A5551;
  --jr-pencil: #8A8478;
  --jr-rule: #DCCFBB;
  --jr-binding: #C8B89A;
  --jr-moss: #5F7F5B;
  /* The Web's soft tint per kind (journal-web.js): wash (chip fill), line, ink (text on the wash,
     at least 6:1 on it) and card (the focus card's paper). Part of the journal's paper palette: the
     journal is cream paper in every Look palette and in dark mode, so these sit beside --jr-paper
     and change with it if a night paper is ever added. */
  --jw-ground-wash: #F3E6C1; --jw-ground-line: #CDAE5C; --jw-ground-ink: #66500F; --jw-ground-card: #F8F0DC;
  --jw-plants-wash: #E1ECD3; --jw-plants-line: #98B87E; --jw-plants-ink: #42613A; --jw-plants-card: #EEF2E3;
  --jw-small-wash: #D8ECE8; --jw-small-line: #82B9B0; --jw-small-ink: #2B5D57; --jw-small-card: #E9F1EC;
  --jw-animals-wash: #F6DFCC; --jw-animals-line: #D69868; --jw-animals-ink: #87431F; --jw-animals-card: #F8EBDF;
  --jr-btn: 48px;
  --jr-edge: 12px;
}

/* --- the book button, top right: Settings has the corner (settings.css), the Look button sits to
   the book's left (look.css) --- */
.ebb-jbtn {
  position: fixed;
  top: max(var(--jr-edge), env(safe-area-inset-top));
  right: calc(max(var(--jr-edge), env(safe-area-inset-right)) + var(--jr-btn) + 8px);
  z-index: 11;
  pointer-events: none;
}
.ebb-jbtn__btn {
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  width: var(--jr-btn);
  height: var(--jr-btn);
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(30, 38, 36, 0.72);
  border: 1px solid rgba(244, 238, 228, 0.12);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(10, 14, 13, 0.28);
  color: var(--ui-cream);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 160ms ease;
}
@media (pointer: fine) {
  .ebb-jbtn__btn { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
.ebb-jbtn__btn:hover { background: rgba(48, 58, 55, 0.8); }
.ebb-jbtn__btn.is-on { background: var(--wordmark-light); }
.ebb-jbtn__btn:focus-visible { outline: 2px solid var(--wordmark-dark); outline-offset: 2px; }
.ebb-jbtn .icon { width: 28px; height: 28px; display: block; }

/* --- the panel --- */
.ebb-journal {
  position: fixed;
  z-index: 20;
  top: calc(max(var(--jr-edge), env(safe-area-inset-top)) + var(--jr-btn) + 10px);
  right: max(var(--jr-edge), env(safe-area-inset-right));
  /* Above the bottom row (tool bar and time flow, 62 px tall) so time can still be changed. */
  bottom: calc(max(var(--jr-edge), env(safe-area-inset-bottom)) + var(--jr-btn) + 26px);
  width: min(440px, calc(100vw - 2 * var(--jr-edge)));
  display: flex;
  flex-direction: column;
  background: var(--jr-paper);
  color: var(--jr-ink);
  border-left: 10px solid var(--jr-binding);
  border-radius: 8px 16px 16px 8px;
  box-shadow: 0 10px 36px rgba(10, 14, 13, 0.35);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--text-body);
  line-height: 1.45;
  opacity: 0;
  transform: translateX(16px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms ease, transform 240ms ease, visibility 0s linear 240ms;
}
.ebb-journal.is-open {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 200ms ease, transform 240ms ease, visibility 0s;
}
.ebb-journal [hidden] { display: none !important; }
.ebb-journal .icon { width: 24px; height: 24px; display: block; flex: none; }
.ebb-journal button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.ebb-journal :focus-visible { outline: 2px solid var(--jr-moss); outline-offset: 2px; }

.ebb-journal__head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 10px 4px 16px;
}
.ebb-journal__title {
  margin: 0 auto 0 0;
  min-width: 0;
  font-size: calc(22px * var(--text-scale, 1));
  font-weight: 800;
  line-height: 1.2;
}
.ebb-journal__icon-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ebb-journal__icon-btn:hover { background: rgba(30, 38, 36, 0.07); }

/* Six sections: three to a row in two even rows (two to a row in a narrow window, below). */
.ebb-journal__nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px 16px 10px;
  border-bottom: 1px solid var(--jr-rule);
}
.ebb-journal__tab {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 6px 14px 6px 10px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--jr-rule);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.ebb-journal__tab:hover { background: rgba(30, 38, 36, 0.05); }
.ebb-journal__tab[aria-pressed='true'] { background: var(--jr-moss); border-color: var(--jr-moss); color: var(--jr-paper); }

.ebb-journal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 12px 16px 18px;
  outline: none;
}
.ebb-journal__voice {
  font-family: var(--font-voice);
  font-style: italic;
  font-weight: 400;
}
.ebb-journal__empty { margin: 8px 0; font-size: calc(18px * var(--text-scale, 1)); color: var(--jr-soft); }

/* living things list */
.ebb-jlist, .ebb-jnotes, .ebb-jpage__list, .ebb-jpage__notes { list-style: none; margin: 0; padding: 0; }
.ebb-jlist { display: grid; gap: 4px; }
.ebb-jlist__row {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  margin: 0;
  padding: 10px 10px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  text-align: left;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.ebb-jlist__row:hover { background: rgba(30, 38, 36, 0.06); }
.ebb-jlist__icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(95, 127, 91, 0.14); color: var(--jr-moss); }
.ebb-jlist__icon .icon { width: 28px; height: 28px; }
.ebb-jlist__text { display: grid; gap: 2px; min-width: 0; overflow-wrap: break-word; }
.ebb-jlist__text b { font-weight: 800; }
.ebb-jlist__text .ebb-journal__voice { font-size: calc(17px * var(--text-scale, 1)); color: var(--jr-soft); line-height: 1.35; }
.ebb-jlist__row.is-pencil b, .ebb-jlist__row.is-pencil .ebb-journal__voice { color: var(--jr-pencil); }
/* Small lives (docs/future/11): a heading after the living things, a row of marks, then the finds found. */
.ebb-jlist__group { margin: 18px 0 6px; font-size: calc(17px * var(--text-scale, 1)); font-weight: 800; }
.ebb-jlist__hint { margin: 0 0 8px; font-size: calc(17px * var(--text-scale, 1)); color: var(--jr-pencil); }
.ebb-jlist__marks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.ebb-jlist__marks .ebb-journal__voice { font-size: calc(16px * var(--text-scale, 1)); color: var(--jr-soft); margin-right: 4px; }
.ebb-jlist__mark { display: inline-flex; width: 26px; height: 26px; }
.ebb-jlist__mark .icon { width: 100%; height: 100%; }
.ebb-jlist__row.is-pencil .ebb-jlist__icon { background: transparent; color: var(--jr-pencil); }

/* a species page */
.ebb-jpage { display: grid; gap: 14px; }
.ebb-jpage__top { display: flex; align-items: center; gap: 14px; }
.ebb-jpage__top h3 { margin: 0; font-size: calc(24px * var(--text-scale, 1)); font-weight: 800; line-height: 1.2; min-width: 0; }
.ebb-jpage__sketch { width: 72px; height: 72px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(95, 127, 91, 0.14); color: var(--jr-moss); }
.ebb-jpage__sketch .icon { width: 48px; height: 48px; }
.ebb-jpage__sketch.is-pencil { background: transparent; border: 1.5px dashed var(--jr-pencil); color: var(--jr-pencil); }
.ebb-jpage__status { margin: 0; font-size: calc(19px * var(--text-scale, 1)); line-height: 1.45; }
.ebb-jpage__status.is-pencil { color: var(--jr-pencil); }
.ebb-jpage section { display: grid; gap: 6px; }
.ebb-jpage h4 { margin: 0; font-size: var(--text-small); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--jr-moss); }
.ebb-jpage__list { display: grid; gap: 6px; }
.ebb-jpage__list li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: start; overflow-wrap: break-word; }
.ebb-jpage__list li::before { content: ''; width: 9px; height: 9px; margin-top: 8px; border-radius: 50%; background: var(--jr-moss); }
.ebb-jpage__list li.is-pencil { color: var(--jr-pencil); }
.ebb-jpage__list li.is-pencil::before { background: transparent; border: 1.5px dashed var(--jr-pencil); width: 8px; height: 8px; }
/* A collection's rarity beside its name (the Shells page). */
.ebb-jpage__rarity { font-size: var(--text-small); color: var(--jr-pencil); margin-left: 4px; }
.ebb-jpage__seasons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
/* Each season box wears a soft wash of its season, with its drawn mark; an unseen season stays pencil. */
.ebb-jpage__season {
  --s-wash: transparent; --s-line: var(--jr-rule); --s-ink: var(--jr-ink);
  min-width: 0; min-height: 80px; padding: 6px 7px;
  background: var(--s-wash); border: 1.5px solid var(--s-line); border-radius: 10px;
  display: grid; align-content: start; gap: 2px; overflow-wrap: break-word;
}
.ebb-jpage__season.is-spring { --s-wash: #E6EFD8; --s-line: #A7C489; --s-ink: #4F6E3E; }
.ebb-jpage__season.is-summer { --s-wash: #F7E9C2; --s-line: #DDB65A; --s-ink: #7E5A12; }
.ebb-jpage__season.is-autumn { --s-wash: #F3DCCB; --s-line: #CF8C5F; --s-ink: #8A4524; }
.ebb-jpage__season.is-winter { --s-wash: #E1E8EE; --s-line: #9FB3C2; --s-ink: #45606F; }
.ebb-jpage__season b { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: var(--text-small); font-weight: 800; color: var(--s-ink); }
.ebb-jpage__season b .icon { width: 18px; height: 18px; }
.ebb-jpage__season span { font-family: var(--font-voice); font-style: italic; font-weight: 400; font-size: var(--text-small); line-height: 1.3; }
.ebb-jpage__season.is-empty { background: transparent; border-style: dashed; color: var(--jr-pencil); }
.ebb-jpage__season.is-empty b { color: var(--jr-pencil); }
.ebb-jpage__season.is-empty b .icon { opacity: 0.6; }
.ebb-jpage__notes { display: grid; gap: 8px; }
.ebb-jpage__notes li { overflow-wrap: break-word; }
/* A date keeps together on its line, and wraps only when it is wider than the line (large text). */
.ebb-jpage__notes small, .ebb-jnotes small { display: inline-block; max-width: 100%; font-size: var(--text-small); color: var(--jr-soft); }

/* The field sketch across the top of a page (J1.6): drawn at the page's width. Its labels are 18
   drawing units, so it stays wide enough (about 340 px or more) for them to read at 16 px. */
.ebb-jpage__art { margin: 0; display: grid; justify-items: center; }
.ebb-jpage__art .ebb-sketch { width: 100%; max-width: 400px; height: auto; max-height: 380px; display: block; }

/* Show me, beside the page's name */
.ebb-jpage__top .ebb-jpage__show { margin-left: auto; }
.ebb-jpage__show {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 6px 14px 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--jr-moss);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  flex: none;
}
.ebb-jpage__show:hover { background: rgba(95, 127, 91, 0.12); }
.ebb-jpage__top { flex-wrap: wrap; }
.ebb-jpage__field li, .ebb-jpage__story li { font-family: var(--font-voice); font-style: italic; font-weight: 400; font-size: calc(17px * var(--text-scale, 1)); line-height: 1.4; }
.ebb-jpage__field li.is-pencil { font-family: var(--font-ui); font-style: normal; font-weight: 600; font-size: var(--text-body); }

/* Moments: four frames; an empty one shows only a pencil question mark. */
.ebb-jpage__moments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
/* Seasons and moments: four to a row at the usual text size; with larger text (Settings,
   --text-scale above 1) two to a row, so the words still fit. The column floor is a quarter of
   the row at scale 1 and half of it at any larger scale. */
.ebb-jpage__seasons, .ebb-jpage__moments {
  grid-template-columns: repeat(auto-fit, minmax(max(calc((100% - 19px) / 4), min(calc((100% - 7px) / 2), calc((var(--text-scale, 1) - 1) * 10000px))), 1fr));
}
.ebb-jpage__moment {
  min-width: 0; min-height: 108px; padding: 6px;
  display: grid; align-content: end; justify-items: start; gap: 1px;
  border: 1.5px solid #CF8C5F; border-radius: 10px; background: #F7E4D3; overflow-wrap: break-word;
}
.ebb-jpage__moment.is-empty { border: 1.5px dashed var(--jr-rule); background: transparent; align-content: center; justify-items: center; }
.ebb-jpage__q { font-family: var(--font-voice); font-style: italic; font-size: calc(30px * var(--text-scale, 1)); line-height: 1; color: var(--jr-pencil); }
.ebb-jpage__mart { position: relative; width: 44px; height: 40px; color: var(--jr-moss); }
.ebb-jpage__mart .ebb-jpage__mmain { width: 34px; height: 34px; position: absolute; left: 0; top: 0; }
.ebb-jpage__mart .ebb-jpage__mmark { width: 20px; height: 20px; position: absolute; right: 0; bottom: 0; color: #8A4524; }
.ebb-jpage__mlabel { font-family: var(--font-voice); font-style: italic; font-weight: 400; font-size: var(--text-small); line-height: 1.25; }
.ebb-jpage__moment small { font-size: var(--text-small); color: var(--jr-soft); line-height: 1.25; }

/* almanac */
.ebb-jalm { margin: 0; display: grid; gap: 8px; }
.ebb-jalm__row { display: grid; gap: 2px; padding: 8px 10px; border: 1.5px solid var(--jr-rule); border-radius: 10px; }
.ebb-jalm dt { font-size: var(--text-small); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--jr-moss); }
.ebb-jalm dd { margin: 0; font-size: calc(18px * var(--text-scale, 1)); line-height: 1.4; overflow-wrap: break-word; }

/* web: what needs what (journal-web.js). A trail of recent taps, the focus card with its ties as
   chips, and a shelf of kind tabs and icon tiles. Everything wraps or sits in a fixed-column grid,
   so it never widens the page, however many things the recipe holds. */
.is-ground { --jw-wash: var(--jw-ground-wash); --jw-line: var(--jw-ground-line); --jw-ink: var(--jw-ground-ink); --jw-card: var(--jw-ground-card); }
.is-plants { --jw-wash: var(--jw-plants-wash); --jw-line: var(--jw-plants-line); --jw-ink: var(--jw-plants-ink); --jw-card: var(--jw-plants-card); }
.is-small { --jw-wash: var(--jw-small-wash); --jw-line: var(--jw-small-line); --jw-ink: var(--jw-small-ink); --jw-card: var(--jw-small-card); }
.is-animals { --jw-wash: var(--jw-animals-wash); --jw-line: var(--jw-animals-line); --jw-ink: var(--jw-animals-ink); --jw-card: var(--jw-animals-card); }
.ebb-jw { display: grid; gap: 14px; min-width: 0; }
.ebb-jw button { appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; touch-action: manipulation; }
.ebb-jw-q { font-family: var(--font-voice); font-style: italic; font-weight: 400; font-size: calc(22px * var(--text-scale, 1)); line-height: 1; color: var(--jr-pencil); }

/* the trail */
.ebb-jw-trail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; }
.ebb-jw-trail li { display: flex; align-items: center; min-width: 0; }
.ebb-jw-trail li + li::before { content: ''; width: 14px; margin: 0 4px; border-top: 1.5px solid var(--jr-rule); flex: none; }
.ebb-jw-crumb {
  min-height: 40px; padding: 4px 6px; border: 0; border-radius: 8px; background: transparent;
  font-size: var(--text-small); color: var(--jw-ink, var(--jr-soft)); overflow-wrap: anywhere; text-align: left;
}
button.ebb-jw-crumb { text-decoration: underline; text-decoration-color: var(--jw-line, var(--jr-rule)); text-underline-offset: 4px; }
button.ebb-jw-crumb:hover { background: var(--jw-wash, rgba(30, 38, 36, 0.06)); }
span.ebb-jw-crumb { display: inline-flex; align-items: center; font-weight: 800; }
.ebb-jw-crumb.is-unknown { color: var(--jr-pencil); }

/* the focus card */
.ebb-jw-card { display: grid; gap: 12px; padding: 14px; min-width: 0; border: 1.5px solid var(--jw-line, var(--jr-rule)); border-radius: 14px; background: var(--jw-card, transparent); }
.ebb-jw-card.is-unknown { border-style: dashed; border-color: var(--jr-pencil); }
.ebb-jw-card__head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ebb-jw-card__icon { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--jw-wash); color: var(--jw-ink); }
.ebb-jw-card__icon .icon { width: 42px; height: 42px; }
.ebb-jw-card__icon.is-unknown { background: transparent; border: 1.5px dashed var(--jr-pencil); }
.ebb-jw-card__icon.is-unknown .ebb-jw-q { font-size: calc(32px * var(--text-scale, 1)); }
.ebb-jw-card__name { display: grid; gap: 4px; min-width: 0; }
.ebb-jw-card__name h3 { margin: 0; font-size: calc(22px * var(--text-scale, 1)); font-weight: 800; line-height: 1.2; overflow-wrap: break-word; }
.ebb-jw-card.is-unknown h3 { color: var(--jr-pencil); }
.ebb-jw-card__name p { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: var(--text-small); }
.ebb-jw-kind { padding: 1px 10px; border-radius: 999px; background: var(--jw-wash, transparent); color: var(--jw-ink, var(--jr-pencil)); font-weight: 800; }
.ebb-jw-card.is-unknown .ebb-jw-kind { border: 1.5px dashed var(--jr-rule); }
.ebb-jw-status { color: var(--jr-soft); }
.ebb-jw-hint { margin: 0; font-size: calc(17px * var(--text-scale, 1)); line-height: 1.4; color: var(--jr-soft); }
.ebb-jw-group { display: grid; gap: 6px; min-width: 0; }
.ebb-jw .ebb-jw-group h4, .ebb-jw-ties h4 { margin: 0; font-size: var(--text-small); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--jr-soft); }
.ebb-jw-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ebb-jw-chip {
  max-width: 100%; min-height: 40px; padding: 4px 12px 4px 8px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--jw-line); border-radius: 999px; background: var(--jw-wash);
  color: var(--jw-ink); font-size: var(--text-body); font-weight: 700; line-height: 1.2; text-align: left;
}
.ebb-jw-chip span { min-width: 0; overflow-wrap: anywhere; }
.ebb-journal .ebb-jw-chip .icon { width: 22px; height: 22px; }
.ebb-jw-chip:hover { border-color: var(--jw-ink); }
/* A tie not yet seen: the same tint in pencil, no fill. */
.ebb-jw-chip.is-pencil { background: transparent; border-style: dashed; }
/* A thing not yet seen: a pencil question mark. */
.ebb-jw-chip.is-unknown { min-width: 48px; justify-content: center; padding: 4px 14px; background: transparent; border: 1.5px dashed var(--jr-pencil); }
.ebb-jw-open {
  justify-self: start; min-height: 44px; padding: 6px 16px 6px 12px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--jr-moss); border-radius: 12px; background: transparent; color: var(--jr-moss); font-weight: 700;
}
.ebb-jw-open:hover { background: rgba(95, 127, 91, 0.1); }

/* the shelf */
.ebb-jw-shelf { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--jr-rule); min-width: 0; }
.ebb-jw-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.ebb-jw-tab {
  min-width: 0; min-height: 56px; padding: 6px 2px;
  display: grid; justify-items: center; align-content: center; gap: 2px;
  border: 1.5px solid transparent; border-radius: 12px; background: transparent;
  color: var(--jw-ink); font-size: var(--text-small); line-height: 1.15; text-align: center; overflow-wrap: anywhere;
}
.ebb-jw-tab:hover { background: var(--jw-card); }
.ebb-jw-tab[aria-pressed='true'] { background: var(--jw-wash); border-color: var(--jw-line); font-weight: 800; }
.ebb-jw-tiles { display: grid; grid-template-columns: repeat(var(--jw-cols, 6), minmax(0, 1fr)); gap: 6px; }
.ebb-jw-tile {
  min-width: 0; aspect-ratio: 1; max-height: 64px; padding: 0;
  display: grid; place-items: center;
  border: 1.5px solid var(--jw-line); border-radius: 12px; background: var(--jw-wash); color: var(--jw-ink);
}
.ebb-journal .ebb-jw-tile .icon { width: 62%; height: 62%; max-width: 34px; max-height: 34px; }
.ebb-jw-tile:hover { border-color: var(--jw-ink); }
.ebb-jw-tile.is-on { box-shadow: 0 0 0 2.5px var(--jr-paper), 0 0 0 4.5px var(--jw-ink, var(--jr-ink)); }
.ebb-jw-tile.is-unknown { background: transparent; border: 1.5px dashed var(--jr-pencil); }

/* Living things, tidied (journal.js livingView, list.js): filter and sort chips, then groups that
   fold shut under a tinted header. Chips wrap, so nothing widens the page. */
.ebb-jl-controls { display: grid; gap: 6px; margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--jr-rule); }
.ebb-jl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.ebb-jl-label { font-size: var(--text-small); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--jr-soft); margin-right: 2px; }
.ebb-jl-chip {
  appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; touch-action: manipulation;
  min-height: 38px; padding: 3px 10px; max-width: 100%; overflow-wrap: anywhere;
  border: 1.5px solid var(--jr-rule); border-radius: 999px; background: transparent;
  font-size: var(--text-small); font-weight: 700; color: var(--jr-soft);
}
.ebb-jl-chip:hover { border-color: var(--jr-soft); }
.ebb-jl-chip[aria-pressed='true'] { background: var(--jr-moss); border-color: var(--jr-moss); color: var(--jr-paper); }
.ebb-jl-group { display: grid; gap: 4px; margin-top: 8px; min-width: 0; }
.ebb-jl-head { margin: 0; }
.ebb-jl-fold {
  appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; touch-action: manipulation;
  width: 100%; min-height: 48px; padding: 4px 6px 4px 4px;
  display: flex; align-items: center; gap: 8px;
  border: 0; border-radius: 12px; background: transparent; text-align: left;
}
.ebb-jl-fold:hover { background: var(--jw-card); }
.ebb-jl-pill { display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 14px 4px 10px; border-radius: 999px; background: var(--jw-wash); border: 1.5px solid var(--jw-line); color: var(--jw-ink); font-size: calc(17px * var(--text-scale, 1)); font-weight: 800; }
.ebb-journal .ebb-jl-pill .icon { width: 22px; height: 22px; }
.ebb-jl-fold .ebb-new { position: static; flex: none; }
.ebb-journal .ebb-jl-fold .ebb-jl-chev { margin-left: auto; width: 22px; height: 22px; color: var(--jw-ink); transition: transform 160ms ease; }
.ebb-jl-group.is-shut .ebb-jl-chev { transform: rotate(180deg); }
.ebb-jl-group .ebb-jlist__row .ebb-jlist__icon { background: var(--jw-wash); color: var(--jw-ink); }
.ebb-jl-group .ebb-jlist__row.is-pencil .ebb-jlist__icon { background: transparent; color: var(--jr-pencil); }
@media (prefers-reduced-motion: reduce) { :root:not(.ebb-motion-full) .ebb-jl-chev { transition: none; } }
/* A collection's found items under its row (Shells): one text block each, so they wrap as words. */
.ebb-jl-items { list-style: none; margin: 0 0 4px 62px; padding: 0; display: grid; gap: 2px; min-width: 0; }
.ebb-jl-item {
  appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; width: 100%;
  padding: 6px 8px; border: 0; border-left: 2px solid var(--jw-line); border-radius: 0 10px 10px 0; background: transparent; text-align: left;
}
.ebb-jl-item:hover { background: var(--jw-card); }
.ebb-jl-item__text { display: block; min-width: 0; overflow-wrap: break-word; line-height: 1.35; }
.ebb-jl-item__text b { font-weight: 800; }
.ebb-jl-item__text .ebb-jpage__rarity { margin-left: 2px; }
.ebb-jl-item__text .ebb-journal__voice { display: block; font-size: calc(17px * var(--text-scale, 1)); color: var(--jr-soft); }

/* the Ties strip on a journal page */
.ebb-jw-ties { display: grid; gap: 8px; padding: 12px; border: 1.5px solid var(--jr-rule); border-radius: 12px; min-width: 0; }
.ebb-jw-ties .ebb-jw-group { gap: 4px; }
.ebb-jpage .ebb-jw-ties h4 { color: var(--jr-moss); }
.ebb-jpage .ebb-jw-ties .ebb-jw-group h4 { color: var(--jr-soft); letter-spacing: 0.04em; }
.ebb-jw-ties button { appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; touch-action: manipulation; }

/* notes view */
.ebb-jnotes { display: grid; gap: 2px; }
.ebb-jnotes__row {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: transparent;
  overflow-wrap: break-word;
}
button.ebb-jnotes__row { cursor: pointer; }
button.ebb-jnotes__row:hover { background: rgba(30, 38, 36, 0.06); }
.ebb-jnotes__row .ebb-journal__voice { font-size: calc(18px * var(--text-scale, 1)); }

@media (max-width: 380px) {
  .ebb-jpage__seasons, .ebb-jpage__moments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Section buttons: two to a row on narrow screens, so they never run off the side; an odd one out
   at the end takes the whole row. */
@media (max-width: 480px) {
  .ebb-journal__nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ebb-journal__tab { min-width: 0; text-align: left; }
  /* With large text a label wraps inside its button rather than running past it. */
  .ebb-journal__tab span { min-width: 0; overflow-wrap: anywhere; }
  .ebb-journal__tab:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* From 130 percent text (src/ui/motion.js) the buttons take a row each, so no word breaks. */
  :root.ebb-text-large .ebb-journal__nav { grid-template-columns: minmax(0, 1fr); }
}

/* --- notes on the island, bottom left above the tool bar --- */
.ebb-notes {
  position: fixed;
  z-index: 9;
  left: max(var(--jr-edge), env(safe-area-inset-left));
  bottom: calc(max(var(--jr-edge), env(safe-area-inset-bottom)) + var(--jr-btn) + 26px);
  max-width: min(420px, calc(100vw - 2 * var(--jr-edge)));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
  transition: opacity 200ms ease, visibility 0s;
}
.ebb-notes__note {
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  max-width: 100%;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid rgba(244, 238, 228, 0.12);
  border-radius: 14px;
  background: rgba(30, 38, 36, 0.62);
  color: var(--ui-cream);
  font-family: var(--font-voice);
  font-style: italic;
  font-weight: 400;
  font-size: calc(18px * var(--text-scale, 1));
  line-height: 1.35;
  text-align: left;
  overflow-wrap: break-word;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 500ms ease, transform 500ms ease;
}
@media (pointer: fine) {
  .ebb-notes__note { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}
.ebb-notes__note.is-shown { opacity: 1; transform: none; }
/* A note that an animal came or stayed: its words open the journal, and Show me sits under them. */
.ebb-notes__note.has-show { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; cursor: default; }
.ebb-notes__text {
  appearance: none; -webkit-appearance: none;
  margin: 0; padding: 0; border: 0; background: none; color: inherit;
  font: inherit; text-align: left; overflow-wrap: break-word; cursor: pointer;
}
.ebb-notes__show {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0; padding: 6px 14px 6px 10px; min-height: 40px;
  border: 1px solid rgba(244, 238, 228, 0.28); border-radius: 12px;
  background: rgba(244, 238, 228, 0.1); color: var(--ui-cream);
  font-family: var(--font-ui, 'Nunito', system-ui, sans-serif); font-style: normal; font-weight: 700;
  font-size: calc(16px * var(--text-scale, 1)); line-height: 1.2; cursor: pointer;
}
.ebb-notes__show svg { width: 20px; height: 20px; flex: none; }
.ebb-notes__show:hover { background: rgba(244, 238, 228, 0.18); }
.ebb-notes__text:focus-visible, .ebb-notes__show:focus-visible { outline: 2px solid var(--wordmark-dark); outline-offset: 2px; }
/* "3 more in the journal": the notes that never got their turn on the island. */
.ebb-notes__more {
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  display: none;
  margin: 0;
  padding: 6px 14px;
  border: 1px solid rgba(244, 238, 228, 0.12);
  border-radius: 14px;
  background: rgba(30, 38, 36, 0.5);
  color: var(--ui-cream);
  font-family: var(--font-ui, 'Nunito', system-ui, sans-serif);
  font-weight: 700;
  font-size: calc(16px * var(--text-scale, 1));
  line-height: 1.3;
  max-width: 100%;
  text-align: left;
  overflow-wrap: break-word;
  cursor: pointer;
}
.ebb-notes__more.is-shown { display: block; }
.ebb-notes__more:focus-visible { outline: 2px solid var(--wordmark-dark); outline-offset: 2px; }

/* --- read marks (src/world/journal/read.js): new since you last looked, and notes you may have missed --- */
.ebb-new {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--jr-moss);
  box-shadow: 0 0 0 2px rgba(95, 127, 91, 0.18);
  vertical-align: middle;
}
.ebb-jbtn__btn { position: relative; }
.ebb-jbtn__btn .ebb-new { position: absolute; top: 6px; right: 6px; background: var(--ui-cream, #F4EEE4); box-shadow: 0 0 0 2px rgba(30, 38, 36, 0.5); }
.ebb-journal__tab { position: relative; }
.ebb-journal__tab .ebb-new { position: absolute; top: 5px; right: 5px; }
.ebb-journal__tab[aria-pressed='true'] .ebb-new { background: var(--jr-paper); }
.ebb-jlist__row .ebb-new, .ebb-jnotes__row .ebb-new, .ebb-jpage__notes .ebb-new { margin-right: 8px; }
.ebb-jnotes__head { margin: 6px 0 4px; font-size: var(--text-small); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--jr-moss); }
.ebb-jnotes__head + .ebb-jnotes { margin-bottom: 14px; }
.ebb-notes__note:focus-visible { outline: 2px solid var(--wordmark-dark); outline-offset: 2px; }
/* Narrow windows: the time-flow button sits at the right just above the bar (time-flow.css), so
   the notes leave it room. */
@media (max-width: 560px) {
  .ebb-notes { max-width: calc(100vw - 2 * var(--jr-edge) - var(--jr-btn) - 12px); }
}
/* Narrow windows: undo and redo sit above the bar at the left (tools.css), so the notes sit above
   them in turn. */
@media (max-width: 560px) {
  .ebb-notes { bottom: calc(max(var(--jr-edge), env(safe-area-inset-bottom)) + 2 * var(--jr-btn) + 50px); }
}
/* A tool's card opens above the bar in the middle; on narrower screens the notes step aside. */
@media (max-width: 1180px) {
  .ebb-notes.has-tool { opacity: 0; visibility: hidden; }
}

/* --- the tap card --- */
.ebb-idcard {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 15;
  width: min(300px, calc(100vw - 2 * var(--jr-edge)));
  padding: 12px 14px 14px;
  display: grid;
  gap: 8px;
  background: var(--jr-paper);
  color: var(--jr-ink);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(10, 14, 13, 0.35);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--text-body);
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, visibility 0s linear 160ms;
}
.ebb-idcard.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 160ms ease, visibility 0s; }
.ebb-idcard.is-open.is-away { opacity: 0; visibility: hidden; pointer-events: none; }
.ebb-idcard .icon { width: 24px; height: 24px; display: block; flex: none; }

/* Show me: the arrow at the screen edge pointing to a ring out of view. */
.ebb-pointer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 14;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--jr-paper);
  color: var(--jr-ink);
  box-shadow: 0 4px 16px rgba(10, 14, 13, 0.3);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 0s linear 200ms;
}
/* Show me: the spot, ringed at a size that reads from any distance; it breathes gently. */
.ebb-mark { position: fixed; left: 0; top: 0; z-index: 13; width: 0; height: 0; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 0s linear 200ms; }
.ebb-mark.is-on { opacity: 1; visibility: visible; transition: opacity 200ms ease, visibility 0s; }
.ebb-mark::before, .ebb-mark::after {
  content: '';
  position: absolute;
  left: -20px;
  top: -20px;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 3px solid var(--jr-paper);
  box-shadow: 0 0 0 1.5px rgba(30, 38, 36, 0.55), inset 0 0 0 1.5px rgba(30, 38, 36, 0.55);
}
.ebb-mark::after { border-width: 2px; box-shadow: none; animation: ebb-mark-breathe 2.4s ease-out infinite; }
@keyframes ebb-mark-breathe { from { transform: scale(1); opacity: 0.9; } to { transform: scale(1.9); opacity: 0; } }
/* Reduced motion: the system's (unless Settings says Full), or Settings' Calm (src/ui/motion.js). */
@media (prefers-reduced-motion: reduce) { :root:not(.ebb-motion-full) .ebb-mark::after { animation: none; opacity: 0; } }
:root.ebb-motion-calm .ebb-mark::after { animation: none; opacity: 0; }
.ebb-pointer.is-on { opacity: 1; visibility: visible; transition: opacity 200ms ease, visibility 0s; }
.ebb-pointer .icon { width: 26px; height: 26px; display: block; }
.ebb-idcard button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.ebb-idcard :focus-visible { outline: 2px solid var(--jr-moss); outline-offset: 2px; }
.ebb-idcard__head { display: flex; align-items: center; gap: 10px; }
.ebb-idcard__head b { font-weight: 800; font-size: calc(18px * var(--text-scale, 1)); margin-right: auto; min-width: 0; overflow-wrap: break-word; }
/* How well a creature knows you (S6c): one word, never a number. */
.ebb-idcard__word { flex: none; padding: 2px 10px; border-radius: 999px; background: rgba(95, 127, 91, 0.14); color: #3F5C3B; font-size: var(--text-small); font-weight: 800; white-space: nowrap; }
.ebb-idcard__icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(95, 127, 91, 0.14); color: var(--jr-moss); }
.ebb-idcard__close { appearance: none; -webkit-appearance: none; width: 40px; height: 40px; margin: -6px -6px -6px 0; padding: 0; border: 0; border-radius: 10px; background: transparent; display: grid; place-items: center; cursor: pointer; }
.ebb-idcard__text { margin: 0; font-family: var(--font-voice); font-style: italic; font-weight: 400; font-size: calc(18px * var(--text-scale, 1)); }
.ebb-idcard__suits { margin: 0; font-size: var(--text-small); color: var(--jr-soft); }
.ebb-idcard__suits.is-pencil { color: var(--jr-pencil); }
.ebb-idcard__open {
  appearance: none;
  -webkit-appearance: none;
  justify-self: start;
  min-height: 44px;
  margin: 0;
  padding: 6px 14px 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--jr-moss);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.ebb-idcard__open:hover { background: rgba(95, 127, 91, 0.12); }
.ebb-idcard__open[hidden], .ebb-idcard__name[hidden] { display: none; }
/* A named frog (S6c-3): what it is and since when, under its name; the name field on the card. */
.ebb-idcard__sub { margin: -4px 0 0 46px; font-size: var(--text-small); color: var(--jr-soft); }
.ebb-idcard__name { display: grid; gap: 8px; margin: 0; }
.ebb-idcard__label { font-weight: 800; }
.ebb-idcard__row { display: flex; flex-wrap: wrap; gap: 8px; }
.ebb-idcard__input {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 44px;
  padding: 6px 12px;
  border: 1.5px solid var(--jr-moss);
  border-radius: 10px;
  background: #FBF7F0;
  color: var(--jr-ink);
  font: inherit;
  font-size: max(16px, var(--text-body));
}
.ebb-idcard__chip,
.ebb-idcard__give {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--jr-binding);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.ebb-idcard .ebb-idcard__give { justify-self: start; background: var(--jr-moss); border-color: var(--jr-moss); color: var(--jr-paper); }
.ebb-idcard__error { margin: 0; min-height: 0; font-size: var(--text-small); color: #8A4524; }
.ebb-idcard__error:empty { display: none; }

/* Reduced motion: the system's (unless Settings says Full), or Settings' Calm (src/ui/motion.js). */
@media (prefers-reduced-motion: reduce) {
  :root:not(.ebb-motion-full) .ebb-journal,
  :root:not(.ebb-motion-full) .ebb-journal.is-open { transform: none; transition: opacity 120ms ease, visibility 0s; }
  :root:not(.ebb-motion-full) .ebb-notes__note { transform: none; transition: opacity 200ms ease; }
}
:root.ebb-motion-calm .ebb-journal,
:root.ebb-motion-calm .ebb-journal.is-open { transform: none; transition: opacity 120ms ease, visibility 0s; }
:root.ebb-motion-calm .ebb-notes__note { transform: none; transition: opacity 200ms ease; }

/* The naturalist's notes (src/ui/journal.js, src/world/expansion.js). In Small lives, one row that
   opens its page; the page is a trail down the paper: a line on the left with a stop per row and
   the words beside it, so nothing crosses and nothing wraps sideways at any width. Ink for what is
   found and given; past the last find, pencil, as far as the next reward. */
.ebb-nat-entry {
  appearance: none; -webkit-appearance: none;
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 4px 0 12px; padding: 10px 12px;
  border: 1px solid var(--jr-rule); border-radius: 12px; background: var(--jw-small-card); color: var(--jr-ink);
  text-align: left; cursor: pointer; font: inherit;
}
.ebb-nat-entry:hover { border-color: var(--jw-small-line); }
.ebb-nat-entry__icon { flex: 0 0 auto; display: inline-flex; width: 36px; height: 36px; padding: 6px; box-sizing: border-box; border-radius: 8px; background: var(--jw-small-wash); color: var(--jw-small-ink); }
.ebb-nat-entry__icon .icon { width: 100%; height: 100%; }
.ebb-nat-entry .ebb-jlist__text { flex: 1 1 auto; min-width: 0; }
.ebb-nat-entry__chev { flex: 0 0 auto; width: 20px; height: 20px; transform: rotate(-90deg); color: var(--jr-soft); }

.ebb-trail__title { margin: 4px 0 2px; font-family: var(--font-voice); font-style: italic; font-weight: 400; font-size: calc(24px * var(--text-scale, 1)); color: var(--jr-ink); }
.ebb-trail__intro { margin: 0 0 14px; color: var(--jr-soft); }
.ebb-trail__list { list-style: none; margin: 0; padding: 0; }
.ebb-trail__stop { position: relative; }
/* The trail: a line down the stops' column, from the middle of this stop to the middle of the next. */
.ebb-trail__stop::before {
  content: ''; position: absolute; left: 25px; top: 28px; height: 100%; width: 0;
  border-left: 1.75px solid var(--jr-ink);
}
.ebb-trail__stop.is-last::before { display: none; }
.ebb-trail__stop:has(+ .is-gap)::before, .ebb-trail__stop:has(+ .is-pencil)::before, .ebb-trail__stop.is-gap::before { border-left-style: dashed; border-left-color: var(--jr-pencil); }
.ebb-trail__row {
  appearance: none; -webkit-appearance: none; position: relative; z-index: 1;
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; margin: 0; padding: 4px 0;
  border: 0; background: none; color: var(--jr-ink); text-align: left; font: inherit;
}
button.ebb-trail__row { cursor: pointer; }
button.ebb-trail__row:hover b { text-decoration: underline; text-decoration-color: var(--jr-rule); }
.ebb-trail__dot {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin: 0 7px; box-sizing: border-box; border-radius: 50%;
  border: 1.75px solid var(--jr-ink); background: var(--jr-paper); color: var(--jr-ink);
}
.ebb-trail__dot .icon { width: 24px; height: 24px; }
.ebb-trail__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: break-word; }
.ebb-trail__text b { font-weight: 800; font-size: calc(16px * var(--text-scale, 1)); }
.ebb-trail__text small { font-size: calc(15px * var(--text-scale, 1)); color: var(--jr-pencil); }
/* A gap: a small pencil ring on the trail, nothing beside it. */
.ebb-trail__stop.is-gap { height: 36px; }
.ebb-trail__stop.is-gap::before { top: 18px; }
.ebb-trail__stop.is-gap .ebb-trail__dot { position: absolute; left: 15px; top: 7px; width: 22px; height: 22px; margin: 0; border: 1.5px dashed var(--jr-pencil); }
/* A reward: a larger square stop, with a soft wash once given. */
.ebb-trail__stop.is-station::before { top: 36px; }
.ebb-trail__stop.is-station .ebb-trail__row { min-height: 72px; }
.ebb-trail__stop.is-station .ebb-trail__dot { width: 52px; height: 52px; margin: 0; border-radius: 12px; background: var(--jw-small-wash); }
.ebb-trail__stop.is-station .ebb-trail__dot .icon { width: 32px; height: 32px; }
.ebb-trail__stop.is-pencil .ebb-trail__dot { border-style: dashed; border-color: var(--jr-pencil); color: var(--jr-pencil); background: var(--jr-paper); }
.ebb-trail__stop.is-pencil .ebb-trail__text .ebb-journal__voice { color: var(--jr-pencil); }

/* A gift's card (src/ui/island-notes.js): cream paper, low in the middle, fading in and out. */
.ebb-gift {
  appearance: none;
  -webkit-appearance: none;
  position: fixed;
  z-index: 11;
  left: 50%;
  bottom: calc(max(var(--jr-edge), env(safe-area-inset-bottom)) + var(--jr-btn) + 96px);
  width: min(420px, calc(100vw - 2 * var(--jr-edge) - 8px));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin: 0;
  border: 1px solid var(--jr-rule);
  border-radius: 14px;
  background: var(--jr-paper);
  color: var(--jr-ink);
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 800ms ease, transform 800ms ease;
  box-shadow: 0 6px 24px rgba(30, 38, 36, 0.18);
}
.ebb-gift.is-shown { opacity: 1; transform: translate(-50%, 0); }
/* With the journal open: the card keeps to the island's side of the panel. */
@media (min-width: 700px) {
  :root.ebb-journal-open .ebb-gift { left: calc((100vw - 440px - var(--jr-edge)) / 2); width: min(420px, calc(100vw - 440px - 3 * var(--jr-edge))); }
}
.ebb-gift__icon { flex: 0 0 auto; display: inline-flex; width: 44px; height: 44px; color: var(--jr-ink); }
.ebb-gift__icon .icon { width: 100%; height: 100%; }
.ebb-gift__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ebb-gift__text b { font-family: var(--font-ui); font-weight: 800; font-size: calc(17px * var(--text-scale, 1)); line-height: 1.25; }
.ebb-gift__text .ebb-journal__voice { font-size: calc(16px * var(--text-scale, 1)); line-height: 1.35; color: var(--jr-soft); overflow-wrap: break-word; }
.ebb-gift:focus-visible { outline: 2px solid var(--wordmark-dark); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { :root:not(.ebb-motion-full) .ebb-gift { transition: opacity 300ms ease; transform: translate(-50%, 0); } }
:root.ebb-motion-calm .ebb-gift { transition: opacity 300ms ease; transform: translate(-50%, 0); }

/* The Shelf (src/ui/journal-shelf.js, docs/future/12): sixteen spaces, four to a row at every width,
   each a keepsake's ink sketch on its rarity's paper; the empty ones a dashed outline. */
.ebb-shelf { display: grid; gap: 12px; }
.ebb-shelf__title { margin: 4px 0 0; font-family: var(--font-voice); font-style: italic; font-weight: 400; font-size: calc(24px * var(--text-scale, 1)); color: var(--jr-ink); }
.ebb-shelf__text { margin: 0; color: var(--jr-soft); }
.ebb-shelf__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px; border-radius: 12px; background: #E9DFCE; }
.ebb-shelf__cell { display: grid; gap: 6px; align-content: start; }
.ebb-shelf__slot {
  appearance: none; -webkit-appearance: none; display: block; width: 100%; aspect-ratio: 1; min-width: 0;
  margin: 0; padding: 2px; box-sizing: border-box; border-radius: 10px; color: inherit; cursor: pointer;
}
.ebb-shelf__slot svg { display: block; width: 100%; height: 100%; }
.ebb-shelf__slot.is-empty { border: 1.5px dashed #C9BDA6; background: transparent; cursor: default; }
.ebb-shelf__slot:focus-visible { outline: 2px solid var(--jr-moss); outline-offset: 2px; }
.ebb-shelf__new { display: flex; gap: 14px; align-items: center; }
.ebb-shelf__new .ebb-shelf__slot { flex: 0 0 96px; width: 96px; cursor: default; }
.ebb-shelf__new p { margin: 0; min-width: 0; overflow-wrap: break-word; }
.ebb-shelf__hand { width: min(100%, 300px); aspect-ratio: 1; justify-self: center; border-radius: 12px; overflow: hidden; }
.ebb-shelf__turn { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.ebb-shelf__name { margin: 0; font-family: var(--font-voice); font-style: italic; font-size: calc(19px * var(--text-scale, 1)); color: var(--jr-ink); }
.ebb-shelf__rarity { margin: 0; font-weight: 800; color: var(--jr-moss); }
.ebb-shelf__message { margin: 0; padding: 10px 14px; border-left: 3px solid var(--jr-rule); font-family: var(--font-voice); font-style: italic; color: var(--jr-ink); }
.ebb-shelf__row { display: flex; flex-wrap: wrap; gap: 8px; }
.ebb-shelf__btn {
  appearance: none; -webkit-appearance: none; justify-self: start; min-height: 44px; margin: 0; padding: 6px 12px;
  display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--jr-moss); border-radius: 12px;
  background: transparent; color: var(--jr-ink); font: inherit; font-size: var(--text-small); text-align: left; cursor: pointer;
}
.ebb-shelf__btn:hover { background: rgba(95, 127, 91, 0.12); }
.ebb-shelf__btn.is-wide { justify-self: stretch; justify-content: center; }
.ebb-shelf__cell .ebb-shelf__btn { justify-self: stretch; padding: 4px 6px; justify-content: center; }
@media (max-width: 699px) {
  .ebb-shelf__grid { gap: 6px; padding: 6px; }
}

/* Bottle letters (src/ui/journal-letters.js): the Letters list and a letter on its paper. */
.ebb-letters { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ebb-letters__row {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: 48px; margin: 0; padding: 8px 12px;
  display: grid; gap: 2px; text-align: left; border: 1px solid var(--jr-rule); border-radius: 10px;
  background: #FBF7F0; color: var(--jr-ink); font: inherit; cursor: pointer;
}
.ebb-letters__row:hover { border-color: var(--jr-binding); }
.ebb-letters__row span { font-size: var(--text-small); color: var(--jr-soft); }
.ebb-letter {
  padding: 18px 18px 22px; border-radius: 6px; background: linear-gradient(175deg, #FCF8EF, #F1E8D6);
  box-shadow: 0 1px 0 rgba(30, 38, 36, 0.08), 0 6px 18px rgba(30, 38, 36, 0.10); color: var(--jr-ink);
  overflow-wrap: break-word;
}
.ebb-letter p { margin: 0 0 12px; }
.ebb-letter__form { font-size: var(--text-small); color: var(--jr-pencil); }
.ebb-letter__preface { font-family: var(--font-voice); font-weight: 400; font-style: italic; color: var(--jr-soft); }
.ebb-letter__body { font-family: var(--font-voice); font-weight: 400; font-size: calc(18px * var(--text-scale, 1)); line-height: 1.55; }
.ebb-letter.is-haiku .ebb-letter__body { text-align: center; font-style: italic; padding: 12px 0; }
.ebb-letter.is-paper .ebb-letter__body { font-family: Georgia, serif; font-size: calc(17px * var(--text-scale, 1)); }
.ebb-letter__h1, .ebb-letter__h2, .ebb-letter__h3 { font-weight: 800; font-size: calc(19px * var(--text-scale, 1)); line-height: 1.25; }
.ebb-letter.is-paper .ebb-letter__h3 { text-transform: uppercase; letter-spacing: 0.04em; border-top: 2px solid var(--jr-ink); border-bottom: 1px solid var(--jr-ink); padding: 6px 0; }
.ebb-letter__h4 { font-style: italic; color: var(--jr-soft); }
.ebb-letter.is-paper .ebb-letter__body > p:first-child b { display: block; text-align: center; font-size: calc(20px * var(--text-scale, 1)); letter-spacing: 0.08em; }
