/* H2OhMy: dusty laboratory, warm brass, cream notebook paper. */
:root {
  --ink: #f3ead8;
  --ink-dim: #c9bfae;
  --bg: #16120f;
  --panel: rgba(24, 19, 14, 0.86);
  --line: rgba(240, 226, 200, 0.22);
  --gold: #ffe08a;
  --brass: #c9a46a;
  --paper: #f4ecd8;
  --paper-ink: #2f261c;
  --paper-dim: #6d5e4b;
  --accent: #7ab8ff;
  --danger: #e2685a;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Iowan Old Style', Palatino, 'Palatino Linotype', Georgia, serif;
  --hand: 'Bradley Hand', 'Segoe Print', 'Comic Sans MS', cursive;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
}

#safe-probe {
  position: fixed;
  visibility: hidden;
  pointer-events: none;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* --- HUD ------------------------------------------------------------------ */

.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.hud > * {
  pointer-events: auto;
}

.hud-btn {
  position: absolute;
  top: calc(10px + var(--safe-top));
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.hud-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hud-menu {
  left: calc(10px + var(--safe-left));
}

.hud-notebook {
  right: calc(10px + var(--safe-right));
}

.hud-notebook.bump,
.hud-points.bump {
  animation: bump 0.45s ease-out;
}

.badge[hidden] {
  display: none;
}

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--gold);
  color: #2a2016;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.hud-points {
  position: absolute;
  top: calc(10px + var(--safe-top));
  left: calc(62px + var(--safe-left));
  height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.hud-points .atom {
  color: var(--gold);
  font-size: 18px;
}

.hud-question {
  min-height: 44px;
  position: absolute;
  top: calc(62px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  /* max-content: an absolutely placed box at left 50% would otherwise shrink to half the screen. */
  width: max-content;
  max-width: min(92vw, 420px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  background: rgba(24, 19, 14, 0.72);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.25;
  text-align: left;
}

.hud-question[hidden] {
  display: none;
}

.hud-question .q-mark {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--gold);
  color: #2a2016;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.hud-question.fresh {
  animation: fresh 0.8s ease-out;
}

.hud-question.nudge {
  animation: nudge 1.2s ease-in-out 2;
}

.hud-nav {
  position: absolute;
  /* In the hands band beside the bay dots, where nothing in the world is touchable. */
  bottom: calc(26px + var(--safe-bottom));
  height: 44px;
  min-width: 44px;
  justify-content: center;
  padding: 0 6px;
  border-radius: 12px;
  background: rgba(24, 19, 14, 0.38);
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.75;
}

.hud-nav span {
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
}

.hud-nav small {
  display: none;
  font-size: 11px;
  color: var(--ink-dim);
}

@media (min-width: 700px) {
  .hud-nav small {
    display: inline;
  }
}

.hud-left {
  left: calc(110px + var(--safe-left));
}

.hud-right {
  right: calc(110px + var(--safe-right));
}

.hud-nav[hidden] {
  display: none;
}

.hud-dots {
  position: absolute;
  bottom: calc(46px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  pointer-events: none;
}

.hud-dots i {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: rgba(240, 226, 200, 0.3);
}

.hud-dots i.on {
  background: var(--gold);
  width: 18px;
}

/* --- inner voice ------------------------------------------------------------ */

.thought {
  position: fixed;
  left: 50%;
  top: var(--thought-top, calc(108px + var(--safe-top)));
  transform: translate(-50%, -6px);
  width: max-content;
  max-width: min(88vw, 440px);
  padding: 10px 16px;
  border-radius: 16px;
  background: rgba(16, 12, 9, 0.78);
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.35s,
    transform 0.35s;
  z-index: 5;
}

.thought.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.thought.mood-wow {
  font-size: 20px;
  color: #fff6dc;
  box-shadow: 0 0 0 1px rgba(255, 224, 138, 0.35);
}

.thought.mood-oops {
  color: #ffd5cc;
}

.thought.mood-hint {
  font-style: normal;
  font-family: var(--font);
  font-size: 15px;
  box-shadow: 0 0 0 1px rgba(255, 224, 138, 0.5);
}

/* --- discovery splash and moments ---------------------------------------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 6, 4, 0);
  transition: background 0.3s;
  padding: 0 10px calc(14px + var(--safe-bottom));
}

.splash.in {
  background: rgba(8, 6, 4, 0.55);
}

.splash-card {
  width: min(100%, 440px);
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 22px;
  padding: 20px 20px 18px;
  text-align: center;
  transform: translateY(110%);
  transition: transform 0.38s cubic-bezier(0.2, 1.2, 0.4, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.splash.in .splash-card {
  transform: translateY(0);
}

.splash.out .splash-card {
  transform: translateY(110%);
  transition-duration: 0.24s;
}

.splash .kicker {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-dim);
  font-weight: 700;
}

.splash .icon {
  font-size: 54px;
  margin: 6px 0 2px;
  animation: pop-in 0.6s cubic-bezier(0.2, 1.6, 0.4, 1);
}

.splash .sensed {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  margin: 4px 0 12px;
  color: var(--paper-dim);
}

.splash .prompt {
  font-weight: 700;
  font-size: 17px;
  margin: 8px 0 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chips.stack {
  flex-direction: column;
}

.chips button {
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 14px;
  background: #fffaf0;
  border: 1.5px solid #d9c9a8;
  color: var(--paper-ink);
  font-family: var(--hand);
  font-size: 19px;
}

.chips.stack button {
  font-family: var(--font);
  font-size: 15px;
}

.chips button:active {
  transform: scale(0.97);
  background: #fff3cf;
}

.chips button.ghost {
  background: transparent;
  border-style: dashed;
}

.fine {
  font-size: 12.5px;
  color: var(--ink-dim);
  line-height: 1.4;
}

.splash-card .fine,
.nb .fine,
.sheet .fine {
  color: var(--paper-dim);
}

.nb .fine,
.sheet .fine {
  font-size: 13.5px;
}

.nb .evidence {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(47, 38, 28, 0.07);
  color: var(--paper-ink);
  font-size: 14px;
  line-height: 1.4;
}

.nb .evidence .q-mark {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--gold);
  color: #2a2016;
  font-weight: 900;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.moment {
  align-items: center;
}

.moment h2 {
  font-family: var(--serif);
  margin: 4px 0 10px;
}

.moment-body {
  text-align: left;
  font-size: 15px;
  line-height: 1.45;
}

.stats {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stats li {
  background: #fffaf0;
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid #e4d6b8;
}

.stats li b {
  display: block;
  font-size: 18px;
}

.moment-away .stats {
  grid-template-columns: 1fr;
}

button.primary {
  min-height: 50px;
  padding: 12px 26px;
  border-radius: 16px;
  background: linear-gradient(#ffe7a0, #f2c35e);
  color: #2a2016;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 4px 0 #b9893a;
}

button.primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b9893a;
}

/* --- toasts --------------------------------------------------------------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(112px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(70vw, 380px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 15;
  pointer-events: none;
}

.satchel-open .toasts {
  /* Hands updates the clearance when the vial rack wraps into more rows. */
  bottom: var(--rack-toast-bottom, calc(198px + var(--safe-bottom)));
}

/* Toasts never steal touches from the experiment under them. A quick tap on a
   tappable one still opens it: the input layer routes taps (never drags) to it. */
.toast {
  pointer-events: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.3s,
    transform 0.3s;
}

.toast.in {
  opacity: 1;
  transform: none;
}


.toast .t-k {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
}

.toast-understood {
  border-color: rgba(255, 224, 138, 0.6);
}

.toast .el {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--gold);
  color: #2a2016;
  margin-right: 4px;
}

/* --- notebook and menu ----------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(8, 6, 4, 0);
  transition: background 0.25s;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.overlay.in {
  background: rgba(8, 6, 4, 0.6);
}

.overlay[hidden] {
  display: none;
}

.nb,
.sheet {
  width: min(100%, 560px);
  height: calc(100% - 28px - var(--safe-top));
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1);
  background-image: repeating-linear-gradient(transparent 0 29px, rgba(120, 150, 190, 0.18) 29px 30px);
}

.sheet {
  height: auto;
  max-height: calc(100% - 28px - var(--safe-top));
}

.overlay.in .nb,
.overlay.in .sheet {
  transform: none;
}

.nb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 6px;
}

.nb-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
}

.nb-close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 20px;
  color: var(--paper-ink);
}

.nb-tabs {
  display: flex;
  gap: 4px;
  padding: 0 10px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid #e0d2b4;
}

.nb-tabs button {
  flex: 1 0 auto;
  min-width: 52px;
  min-height: 44px;
  padding: 8px 4px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  color: var(--paper-dim);
}

.nb-tabs button.on {
  background: #2f261c;
  color: var(--paper);
}

.nb-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px calc(24px + var(--safe-bottom));
  -webkit-user-select: text;
  user-select: text;
  -webkit-overflow-scrolling: touch;
  line-height: 1.45;
  font-size: 15px;
}

.reading {
  padding: 16px 0 22px;
  border-bottom: 1px solid #796b55;
  line-height: 1.55;
}
.reading-kicker, .reading-state { color: #685940; font-size: 12px; }
.reading-story { font-family: Georgia, serif; font-style: italic; }
.reading-bookmark { min-height: 48px; width: 100%; padding: 10px; color: #f3e6ca; background: #61553e; border: 1px solid #ae9470; border-radius: 8px; }
.reading details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.reading a { overflow-wrap: anywhere; color: #32605c; }
.nb-body h3 {
  font-family: var(--serif);
  margin: 18px 0 6px;
}

.nb-body h4 {
  margin: 16px 0 4px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.nb-sum {
  color: var(--paper-dim);
  margin: 4px 0 12px;
}

.nb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.nb-card {
  min-height: 112px;
  border-radius: 14px;
  background: #fffaf0;
  border: 1.5px solid #e0d2b4;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  color: var(--paper-ink);
}

.nb-card .ic {
  font-size: 30px;
}

.nb-card .nm {
  font-family: var(--hand);
  font-size: 16px;
  line-height: 1.1;
}

.nb-card .acc {
  font-size: 11px;
  color: var(--paper-dim);
  line-height: 1.2;
}

.nb-card.understood {
  border-color: #d8a94a;
  box-shadow: inset 0 0 0 1px #f1d58e;
}

.nb-card.unknown {
  background: rgba(47, 38, 28, 0.06);
  border-style: dashed;
  justify-content: center;
}

.nb-card.unknown .ic {
  color: #b8a888;
}

.back {
  color: var(--paper-dim);
  font-weight: 700;
  padding: 6px 0;
}

.card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 6px 0 4px;
}

.card-head .ic {
  font-size: 46px;
}

.yours {
  font-family: var(--hand);
  font-size: 26px;
  margin: 0;
}

.accepted {
  margin: 2px 0 0;
  font-weight: 700;
}

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

.guesses li {
  padding: 6px 0;
  border-bottom: 1px dashed #e0d2b4;
}

.guesses li small {
  display: block;
  color: var(--paper-dim);
  text-decoration: none;
}

.guesses li.crossed {
  color: #9b8b72;
}

.guesses li.crossed::first-line {
  text-decoration: line-through;
  text-decoration-color: #c4473a;
  text-decoration-thickness: 2px;
}

.guesses li.right {
  font-weight: 700;
}

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #2f261c;
  color: var(--paper);
  font-weight: 700;
  vertical-align: middle;
}

.eq {
  margin: 12px 0 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #2f261c;
  color: #fff4d8;
  font-family: var(--serif);
  font-size: 22px;
  text-align: center;
}

.atoms {
  font-size: 13px;
  color: var(--paper-dim);
  margin: 4px 0;
}

details {
  margin: 12px 0;
  border-radius: 12px;
  background: #fffaf0;
  border: 1px solid #e0d2b4;
  padding: 8px 12px;
}

summary {
  font-weight: 700;
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.dl dt {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--paper-dim);
  margin-top: 8px;
}

.dl dd {
  margin: 2px 0 0;
}

.dl a {
  color: #2d5aa0;
}

.safety {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.safety-sim {
  background: #fde4dc;
  border: 1px solid #f0a896;
}

.safety-reviewed {
  background: #fdf3d6;
  border: 1px solid #ecd28c;
}

.safety-everyday {
  background: #e3f2df;
  border: 1px solid #a9d39e;
}

.q {
  padding: 10px 0;
  border-bottom: 1px dashed #e0d2b4;
}

.q p {
  margin: 0;
  font-weight: 700;
}

.q.done p {
  color: var(--paper-dim);
  font-weight: 500;
}

.q-hints {
  margin: 4px 0;
  padding-left: 18px;
  color: var(--paper-dim);
}

button.small {
  margin-top: 4px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  background: #2f261c;
  color: var(--paper);
  font-weight: 700;
  font-size: 13px;
}

.idea {
  padding: 8px 0;
  border-bottom: 1px dashed #e0d2b4;
}

.idea-seen {
  margin: 4px 0 0;
  padding-left: 22px;
  font-size: 13.5px;
  color: var(--paper-ink);
}

.idea-seen .missing {
  color: var(--paper-dim);
  list-style: none;
  margin-left: -12px;
  font-style: italic;
}

.idea .dots {
  color: #c48f2a;
  letter-spacing: 2px;
}

.idea.unknown {
  color: #a8987c;
}

.mol {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed #e0d2b4;
}

.mol .f {
  flex: none;
  min-width: 56px;
  height: 40px;
  padding: 0 6px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #2f261c;
  color: #fff4d8;
  font-family: var(--serif);
  font-weight: 700;
}

.mol.base .f {
  background: #6d5e4b;
}

.mol.locked .f,
.mol.future .f {
  background: rgba(47, 38, 28, 0.12);
  color: #a8987c;
}

.mol small {
  display: block;
  color: var(--paper-dim);
  font-size: 12.5px;
}

.ptable {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  grid-template-rows: repeat(10, auto);
  gap: 2px;
}

.ptable .el {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 3px;
  background: rgba(47, 38, 28, 0.1);
  font-size: clamp(7px, 2.2vw, 12px);
  font-weight: 800;
  padding: 0;
  color: var(--paper-ink);
}

.ptable .el.on {
  background: #f2c35e;
  box-shadow: inset 0 0 0 1px #b9893a;
}

.ptable .el.cat-noble.on {
  background: #b9d3f2;
}

.ptable .el.cat-halogen.on {
  background: #d7e88a;
}

.ptable .el.cat-alkali.on {
  background: #f6b48a;
}

.ptable .el.cat-alkaline.on {
  background: #f3d08a;
}

.ptable .el.cat-nonmetal.on {
  background: #a9e0b0;
}

.el-detail {
  min-height: 60px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #fffaf0;
  border: 1px solid #e0d2b4;
}

.log {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

.log li {
  padding: 6px 0;
  border-bottom: 1px dashed #e0d2b4;
}

.log time {
  color: var(--paper-dim);
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}

.sheet-body {
  padding: 4px 16px calc(20px + var(--safe-bottom));
  overflow-y: auto;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed #e0d2b4;
  min-height: 56px;
}

.set-row small {
  display: block;
  color: var(--paper-dim);
  font-size: 13px;
}

.set-row input {
  width: 26px;
  height: 26px;
  accent-color: #2f261c;
  flex: none;
}

button.danger {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--danger);
  color: #a33a2d;
  font-weight: 700;
  width: 100%;
}

.about {
  margin-top: 16px;
}

/* --- title ------------------------------------------------------------------ */

.title {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #3a3129 0%, #16120f 70%);
  transition: opacity 0.7s;
  padding: 24px;
  text-align: center;
}

.title.out {
  opacity: 0;
  pointer-events: none;
}

.title h1 {
  font-family: var(--serif);
  font-size: clamp(44px, 13vw, 76px);
  margin: 14px 0 6px;
  letter-spacing: -0.01em;
  color: #fff4d8;
}

.title h1 sub {
  font-size: 0.5em;
}

.title .tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-dim);
  max-width: 340px;
  margin: 0 auto 26px;
  line-height: 1.4;
}

/* What the last ride achieved, shown above Continue. */
.last-ride {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 320px;
  margin: -10px auto 20px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 244, 216, 0.05);
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-dim);
}

.last-ride b {
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.title-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.title-actions button {
  min-width: 220px;
}

.title-actions [data-new]:not(:only-of-type) {
  background: transparent;
  box-shadow: none;
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.title-bottle {
  width: 74px;
  height: 120px;
  margin: 0 auto;
  border-radius: 18px 18px 14px 14px;
  border: 2px solid rgba(238, 248, 255, 0.5);
  background: linear-gradient(90deg, rgba(160, 180, 185, 0.3), rgba(220, 240, 245, 0.1), rgba(150, 165, 170, 0.3));
  position: relative;
  display: grid;
  place-items: center;
  animation: float 4s ease-in-out infinite;
}

.title-bottle::before {
  content: '';
  position: absolute;
  top: -18px;
  width: 26px;
  height: 18px;
  border-radius: 4px;
  background: #6d5a3e;
}

.title-bottle span {
  width: 40px;
  height: 34px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--serif);
  font-weight: 800;
  font-size: 24px;
  display: grid;
  place-items: center;
}

/* --- motion ----------------------------------------------------------------- */

@keyframes bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fresh {
  0% {
    transform: translateX(-50%) scale(0.9);
    opacity: 0;
  }
  60% {
    transform: translateX(-50%) scale(1.04);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

@keyframes nudge {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 224, 138, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 224, 138, 0.35);
  }
}

@keyframes pop-in {
  0% {
    transform: scale(0.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

.reduced-motion *,
.reduced-motion *::before {
  animation-duration: 0.01s !important;
  transition-duration: 0.01s !important;
}

/* Notebook building-block routes: a thumb-sized, growing record of experiments. */
.molecule-map {
  overflow-wrap: anywhere;
}

.mm-summary,
.mm-totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
}

.mm-summary {
  padding: 10px 12px;
  border-radius: 12px;
  background: #2f261c;
  color: var(--paper);
}

.mm-key,
.mm-history {
  color: var(--paper-dim);
  font-size: 12px;
  line-height: 1.5;
}

.mm-route {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #d5c6a8;
  border-radius: 16px;
  background: #fffaf0;
}

.mm-known {
  border-left: 4px solid #b7964b;
}

.mm-observed {
  border-style: dashed;
}

.mm-inputs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.mm-input {
  flex: 1 1 90px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 9px;
  background: #eee5d1;
  font-size: 12px;
}

.mm-input span {
  display: block;
  color: var(--paper-dim);
}

.mm-plus {
  color: var(--paper-dim);
  font-weight: 800;
}

.mm-arrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  color: var(--paper-dim);
  font-size: 11px;
}

.mm-arrow > span:first-child {
  font-size: 28px;
  line-height: 1.2;
  color: #92703a;
}

.mm-product {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 10px;
}

.mm-formula {
  flex: 0 1 auto;
  max-width: 48%;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
}

.mm-formula.mm-mix {
  font-size: 17px;
  white-space: nowrap;
}

.mm-product > div {
  min-width: 0;
}

.nb-body .mm-product h3 {
  margin: 0;
  font-size: 18px;
}

.mm-product p {
  margin: 2px 0 0;
  color: var(--paper-dim);
  font-size: 11px;
}

.mm-totals {
  padding: 8px 0;
  border-top: 1px dashed #d5c6a8;
  font-size: 13px;
}

.mm-history {
  margin: 0 0 8px;
}

.mm-uses {
  padding-left: 18px;
  margin: 8px 0;
  font-size: 13px;
}

.mm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mm-action {
  min-height: 44px;
  flex: 1 1 130px;
  padding: 9px 10px;
  border: 1px solid #bfae88;
  border-radius: 10px;
  color: var(--paper-ink);
  background: #f2e8ce;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.mm-action:active {
  background: #e2d1a9;
  transform: translateY(1px);
}

.mm-action:focus-visible {
  outline-color: #795b20;
}

.mm-supplies {
  border-top: 1px solid #d5c6a8;
  margin-top: 18px;
}

.mm-supplies > summary {
  min-height: 48px;
  padding: 12px 0;
  cursor: pointer;
  font-weight: 700;
}

.mm-supplies > summary span {
  color: var(--paper-dim);
  font-size: 12px;
  margin-left: 6px;
}

.mm-supply-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.mm-supply {
  padding: 10px;
  border-radius: 10px;
  background: #eee5d1;
  font-size: 13px;
}

.mm-supply-formula {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  margin-top: 2px;
}

.mm-supply p {
  margin: 4px 0 8px;
  color: var(--paper-dim);
  font-size: 12px;
}

.mm-empty,
.mm-ahead {
  padding: 12px;
  border: 1px dashed #baaa8c;
  border-radius: 12px;
  color: var(--paper-dim);
  font-size: 13px;
}

.mm-ahead > span {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin-right: 6px;
}
