:root {
  --paper: #fffdf6;
  --dot: #ece4d2;
  --ink: #3f3a4a;
  --muted: #6b6478;
  --accent: #a0506a;
  --pink: #f6c6d0;
  --mint: #bfe3d4;
  --lavender: #d8cbf0;
  --butter: #fbe3b8;
  --sky: #c9d6f2;
  --peach: #f8d3bf;
  --wood: #dcb58e;
  --wood-edge: #c29a73;
  --card: #ffffff;
  --line: #e6dccb;
  --line-soft: #f1e8d8;
  --well: #f3eee4;
  --faint: #b3a99a;
  --rule: #eef1f8;
  --draw: #3f3a4a;
  --gold: #d79a2b;
  --pink-soft: #fdf0f3;
  --pink-edge: #e9a9b8;
  --lavender-edge: #b9a6e0;
  --mint-edge: #8fc7b0;
  --butter-edge: #e9c47e;
  --sky-edge: #a9bbe3;
  --tape-pink-a: #f6c6d0;
  --tape-pink-b: #f9d6de;
  --tape-mint-a: #bfe3d4;
  --tape-mint-b: #d4ede3;
  color-scheme: light;
  --nav-h: 72px;
  --radius: 14px;
  --shadow: 0 2px 0 rgba(63, 58, 74, 0.06), 0 6px 18px rgba(63, 58, 74, 0.08);
}

/* Dark theme: app.js sets data-theme from the saved choice or the device setting. */
:root[data-theme="dark"] {
  --paper: #23202a;
  --dot: #34303e;
  --ink: #eee8f4;
  --muted: #aba3b9;
  --accent: #f2a7bf;
  --pink: #6d3e51;
  --mint: #2e5b4e;
  --lavender: #4c4174;
  --butter: #6a5530;
  --sky: #3a4a70;
  --peach: #6d4939;
  --wood: #8a6a4c;
  --wood-edge: #a07c5a;
  --card: #2e2a37;
  --line: #474053;
  --line-soft: #3c3647;
  --well: #3a3446;
  --faint: #756e85;
  --rule: #38344a;
  --gold: #f0bd5a;
  --pink-soft: #4a3040;
  --pink-edge: #95596f;
  --lavender-edge: #7464a8;
  --mint-edge: #4f8b78;
  --butter-edge: #9a7d45;
  --sky-edge: #5a6d9c;
  --tape-pink-a: #b98394;
  --tape-pink-b: #a87485;
  --tape-mint-a: #7fae9d;
  --tape-mint-b: #6e9c8c;
  --shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 6px 18px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}
:root[data-theme="dark"] .sheet::backdrop { background: rgba(0, 0, 0, 0.55); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 18px 18px;
  font: 400 17px/1.5 Nunito, system-ui, sans-serif;
}

h1, h2, h3 { font-family: Caveat, cursive; font-weight: 700; line-height: 1.1; margin: 0 0 0.4em; }
h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.6rem; }

a { color: var(--accent); }

.view {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom));
}

.muted { color: var(--muted); }

.card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px 18px;
  margin: 22px 0;
}

/* Washi tape strip across the top of a card */
.card.taped::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 96px;
  height: 22px;
  transform: translateX(-50%) rotate(-2deg);
  background: repeating-linear-gradient(45deg, var(--tape-pink-a) 0 8px, var(--tape-pink-b) 8px 16px);
  opacity: 0.9;
  border-radius: 2px;
}

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--dot);
}
.checklist li:last-child { border-bottom: 0; }
.checklist .dot {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  display: grid;
  place-items: center;
}
.checklist .ok .dot { background: var(--mint); border-color: #5f9e86; }
.checklist .bad .dot { background: var(--pink); border-color: var(--accent); }
.checklist .dot svg { width: 14px; height: 14px; stroke-width: 3; }
.checklist strong { display: block; }
.checklist small { color: var(--muted); font-size: 0.9rem; word-break: break-word; }

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: var(--paper);
  border-top: 2px solid var(--wood-edge);
  z-index: 10;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}
.bottom-nav svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bottom-nav a[aria-current="page"] { color: var(--accent); }
.bottom-nav a.add {
  justify-self: center;
  width: 60px;
  height: 60px;
  min-height: 0;
  margin-top: -22px;
  border-radius: 50%;
  background: var(--pink);
  color: var(--ink);
  border: 3px solid var(--card);
  box-shadow: var(--shadow);
}
.bottom-nav a.add svg { width: 30px; height: 30px; stroke-width: 2.4; }
.wide-only { display: none !important; }

a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Shared bits ---------- */
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.filled { fill: currentColor; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: 0.9rem; }
.error-text { color: var(--accent); font-weight: 600; }
.page-head { display: flex; align-items: baseline; gap: 4px 12px; }
.page-head h1 { margin-bottom: 0.2em; white-space: nowrap; min-width: 0; }
.page-head > .muted { white-space: nowrap; }
@media (max-width: 699px) { .page-head h1 { font-size: 2.3rem; } }

input[type="text"], input[type="search"], textarea, select {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 48px;
  width: 100%;
}
textarea { resize: vertical; line-height: 1.4; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px;
  font: 700 1rem Nunito, sans-serif;
  border: 2px solid transparent; border-radius: 999px;
  cursor: pointer; color: var(--ink); background: var(--butter);
}
.btn.primary { background: var(--pink); border-color: var(--pink-edge); }
.btn.danger { background: transparent; color: var(--accent); border-color: var(--pink-edge); }
.btn:active { transform: translateY(1px); }
a.btn { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--ink); color: var(--paper); font-weight: 600; box-shadow: var(--shadow);
  transition: opacity .2s, transform .2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--accent); }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px;
  font: 600 0.95rem Nunito, sans-serif; color: var(--ink);
  background: var(--card); border: 2px solid var(--line); border-radius: 999px; cursor: pointer;
}
.chip .n { color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.chip.on { background: var(--lavender); border-color: var(--lavender-edge); }
.chip.on .n { color: var(--ink); }
.chip .icon { width: 18px; height: 18px; }
.star-chip.on { background: var(--butter); border-color: var(--butter-edge); }

/* ---------- Idea library ---------- */
.quick-add { display: flex; gap: 8px; margin: 8px 0 16px; }
.quick-add.stacked { flex-direction: column; align-items: stretch; margin: 0; }
.quick-add .btn { flex: none; }
.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 13px; color: var(--muted); }
.search input { padding-left: 42px; }
.list-bar { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 8px; font-size: 0.95rem; }
.sort { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.sort select { width: auto; min-height: 40px; padding: 4px 10px; }

.idea-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.idea {
  --stripe: var(--pink);
  display: flex; align-items: center;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 8px solid var(--stripe);
}
.idea.type-theme { --stripe: var(--lavender); }
.idea.type-technique { --stripe: var(--mint); }
.idea.type-material { --stripe: var(--butter); }
.idea.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: var(--butter); } to { background: var(--card); } }
.idea-main {
  flex: 1; min-width: 0; text-align: left; padding: 12px 4px 12px 14px;
  background: none; border: 0; font: inherit; color: inherit; cursor: pointer;
}
.idea-text { display: block; font-weight: 600; overflow-wrap: anywhere; }
.idea-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.type-pill, .tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.8rem; font-weight: 700; line-height: 1; padding: 5px 9px; border-radius: 999px;
}
.type-pill { background: var(--stripe); color: var(--ink); }
.tag { background: var(--well); color: var(--muted); }
.tag.pieces { background: var(--sky); color: var(--ink); }
.star.on { color: var(--gold); }
.empty { text-align: center; color: var(--muted); }

/* ---------- Sheet (edit dialogs) ---------- */
.sheet {
  width: 100%; max-width: min(640px, 100%); max-height: 92vh; margin: auto auto 0; overflow: hidden;
  padding: 0; border: 0; border-radius: 22px 22px 0 0;
  background: var(--paper); color: var(--ink); box-shadow: 0 -8px 30px rgba(63, 58, 74, 0.2);
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(63, 58, 74, 0.35); }
.sheet:focus { outline: none; }
.sheet-head .icon-btn:focus-visible { outline-offset: -4px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 0 20px; }
.sheet-head h2 { margin: 0; }
.sheet-body { flex: 1; min-height: 0; padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 22px; max-width: 540px; max-height: min(84vh, 780px); } }
/* Phones: a shorter sheet that never slides under the browser bar, with tighter fields. */
@media (max-width: 699px) {
  .sheet { max-height: 86vh; max-height: 86dvh; }
  .sheet-head { padding-top: 10px; }
  .sheet-head h2 { font-size: 1.7rem; }
  .sheet-body { padding: 4px 16px calc(18px + env(safe-area-inset-bottom)); }
  .sheet .form { gap: 12px; }
  .sheet .field { gap: 4px; }
  .sheet .field > span { font-size: 0.95rem; }
  .sheet input[type="text"], .sheet input[type="search"], .sheet input[type="number"], .sheet input[type="date"], .sheet select { min-height: 42px; font-size: 1rem; }
  .sheet .tag-editor input { min-height: 30px; }
  .sheet .seg span { min-height: 38px; padding: 0 4px; font-size: 0.85rem; }
  .sheet .segmented.stages { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .sheet .tag-suggest .chip { min-height: 30px; padding: 0 10px; font-size: 0.8rem; }
  .sheet .shape-pick { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 5px; }
  .sheet .shape-opt > span { padding: 4px 2px; font-size: 0.72rem; }
  .sheet .shape-icon { width: 32px; height: 32px; }
}

.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.field > span { font-weight: 700; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }
.plain { margin: 0; padding-left: 18px; }

.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 420px) { .segmented { grid-template-columns: repeat(4, 1fr); } }
.seg input { position: absolute; opacity: 0; }
.seg span {
  display: grid; place-items: center; min-height: 44px; padding: 0 8px;
  font-weight: 700; border: 2px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer;
}
.seg input:checked + span { background: var(--pink); border-color: var(--pink-edge); }
.seg.type-theme input:checked + span { background: var(--lavender); border-color: var(--lavender-edge); }
.seg.type-technique input:checked + span { background: var(--mint); border-color: var(--mint-edge); }
.seg.type-material input:checked + span { background: var(--butter); border-color: var(--butter-edge); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.tag-editor {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 6px; background: var(--card); border: 2px solid var(--line); border-radius: 12px;
}
.tag-editor:focus-within { border-color: var(--accent); }
.tag-list { display: contents; }
.tag-editor input { flex: 1; min-width: 120px; border: 0; min-height: 36px; padding: 4px 6px; }
.tag.removable { padding-right: 2px; font-size: 0.9rem; color: var(--ink); background: var(--lavender); }
.tag.removable button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: none; cursor: pointer; color: var(--ink); }
.tag.removable .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.tag-suggest { margin: 4px 0 0; gap: 6px; }
.tag-suggest:empty { display: none; }
.tag-suggest .chip { min-height: 34px; padding: 0 12px; font-size: 0.85rem; }

/* ---------- Home and quick add ---------- */
.card h2 .icon { width: 26px; height: 26px; vertical-align: -3px; }
.soon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.soon {
  display: grid; justify-items: center; gap: 4px; padding: 14px 6px; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-weight: 700; font-size: 0.9rem;
}
.soon small { font-weight: 600; font-size: 0.75rem; }

/* ---------- Glazes ---------- */
.tab {
  min-height: 44px; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  font: 700 1rem Nunito, sans-serif; color: var(--muted);
}
.tab .n { font-size: 0.85rem; }
.tab.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.wide-btn { width: 100%; margin-bottom: 12px; }

.jar-shelf {
  --jar-h: 80px; --top: 8px; --row: 170px; --gap: 14px;
  --plank: calc(var(--top) + var(--jar-h) - 3px);
  list-style: none; margin: 8px 0 0; padding: 0 6px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  grid-auto-rows: var(--row); row-gap: var(--gap);
  background: repeating-linear-gradient(to bottom,
    transparent 0 var(--plank),
    var(--wood) var(--plank) calc(var(--plank) + 12px),
    var(--wood-edge) calc(var(--plank) + 12px) calc(var(--plank) + 16px),
    transparent calc(var(--plank) + 16px) calc(var(--row) + var(--gap)));
}
.jar-shelf.wishlist { --row: 214px; }
.jar { display: flex; flex-direction: column; align-items: center; padding: var(--top) 4px 0; gap: 6px; min-width: 0; }
.jar-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 100%; padding: 0 2px; border: 0; background: none; cursor: pointer; color: var(--ink); font: inherit;
  border-radius: 12px;
}
.jar-svg { width: 64px; height: var(--jar-h, 80px); flex: none; overflow: visible; }
.jar-btn .jar-svg { margin-bottom: 18px; }
.jar-btn:active .jar-svg { transform: translateY(2px); }
.jar-lid { fill: #f6efe2; stroke: var(--draw); stroke-width: 2.5; }
.jar-body { stroke: var(--draw); stroke-width: 2.5; }
.jar-label { fill: #fff; opacity: 0.85; }
.jar-shine { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; opacity: 0.6; }
.jar-svg.wish .jar-body { stroke-dasharray: 5 4; fill-opacity: 0.55; }
.jar-svg.wish .jar-lid { stroke-dasharray: 5 4; }
.jar-star { position: absolute; top: 0; right: calc(50% - 44px); color: var(--gold); }
.jar-star .icon { width: 20px; height: 20px; stroke: var(--ink); stroke-width: 1.2; }
.jar-name {
  font-weight: 700; font-size: 0.92rem; line-height: 1.2; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.jar-brand { font-size: 0.78rem; color: var(--muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.got-it { min-height: 40px; padding: 0 12px; font-size: 0.9rem; background: var(--mint); border-color: var(--mint-edge); }
.got-it .icon { width: 18px; height: 18px; }
.shelf-empty { grid-column: 1 / -1; align-self: center; margin: 0 8px; }

.glaze-detail { display: grid; gap: 18px; }
.glaze-hero { display: flex; gap: 20px; align-items: flex-start; }
.glaze-hero .jar-svg { width: 88px; height: 110px; }
.swatch-pick .jar-svg { height: 80px; }
.status-pill { display: inline-block; margin: 0 0 8px; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; background: var(--mint); }
.status-pill.wishlist { background: var(--sky); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.notes { margin: 0; white-space: pre-wrap; }
.form-actions.wrap { flex-wrap: wrap; justify-content: flex-end; }
.form-actions .spacer { flex: 1; }
.star-btn { background: var(--card); border-color: var(--line); }
.star-btn.on { background: var(--butter); border-color: var(--butter-edge); }
.star-btn.on .icon { color: var(--gold); }

.swatch-row { display: flex; gap: 14px; align-items: flex-end; }
.swatch-row .grow { flex: 1; }
.swatch-pick { position: relative; flex: none; cursor: pointer; }
.swatch-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.swatch-pick::after {
  content: "Tap to color"; display: block; text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--muted);
}
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.segmented.two { grid-template-columns: 1fr 1fr; }
@media (min-width: 420px) { .segmented.two { grid-template-columns: 1fr 1fr; } }
a.soon.ready { border-style: solid; border-color: var(--mint-edge); background: var(--card); color: var(--ink); text-decoration: none; }
a.soon.ready small { color: var(--muted); }

/* ---------- Tiles section ---------- */
.section-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; background: var(--well); border-radius: 16px; margin: 4px 0 16px; }
.section-tabs .tab { display: grid; place-items: center; text-decoration: none; text-align: center; }
.filter-title { margin: 14px 0 0; font-weight: 700; color: var(--muted); font-size: 0.9rem; }
.filter-group .chips { margin-top: 6px; }
.glaze-filter { margin-top: 14px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 700; text-decoration: none; color: var(--accent); }
.back-link .icon { width: 20px; height: 20px; }
.icon-btn.small { width: 40px; height: 40px; }
.icon-btn.small .icon { width: 18px; height: 18px; }

/* Corkboard */
.tile-wall {
  list-style: none; margin: 0; padding: 22px 16px 26px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 26px 18px;
  border-radius: 18px; border: 10px solid #b98c62;
  background-color: #d4ab7d;
  background-image:
    radial-gradient(rgba(120, 78, 40, 0.28) 1px, transparent 1.6px),
    radial-gradient(rgba(255, 240, 215, 0.35) 1px, transparent 1.6px),
    radial-gradient(rgba(120, 78, 40, 0.18) 1.5px, transparent 2px);
  background-size: 9px 9px, 13px 13px, 23px 23px;
  background-position: 0 0, 4px 6px, 10px 3px;
  box-shadow: inset 0 2px 10px rgba(80, 50, 20, 0.25);
  min-height: 220px;
}
.tile-pin:nth-child(3n+1) .tile-card { transform: rotate(-2deg); }
.tile-pin:nth-child(3n+2) .tile-card { transform: rotate(1.5deg); }
.tile-pin:nth-child(3n) .tile-card { transform: rotate(-0.5deg); }
.tile-card {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 10px 10px 12px; background: var(--card); border-radius: 4px; text-decoration: none; color: var(--ink);
  box-shadow: 0 3px 8px rgba(60, 35, 10, 0.3);
}
.tile-card:active { transform: scale(0.98); }
.pin {
  position: absolute; top: -9px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 18%, var(--accent) 22% 100%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
}
.tile-pin:nth-child(4n+2) .pin { background: radial-gradient(circle at 35% 35%, #fff 0 18%, #5f9e86 22% 100%); }
.tile-pin:nth-child(4n+3) .pin { background: radial-gradient(circle at 35% 35%, #fff 0 18%, #7b68b5 22% 100%); }
.tile-pin:nth-child(4n) .pin { background: radial-gradient(circle at 35% 35%, #fff 0 18%, var(--gold) 22% 100%); }
.tile-face { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 2px; background: var(--well); }
.tile-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-swatch { display: block; width: 100%; height: 100%; }
.tile-swatch.big { aspect-ratio: 1; border-radius: 2px; }
.tile-label { font-size: 0.95rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-label strong { color: var(--accent); }
.tile-sub { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-badges { position: absolute; top: 14px; right: 14px; display: flex; gap: 4px; }
.badge { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.badge .icon { width: 16px; height: 16px; }
.star-badge { color: var(--gold); }
.wall-empty { grid-column: 1 / -1; align-self: center; text-align: center; padding: 30px 16px; background: var(--card); border-radius: 6px; color: var(--muted); font-weight: 600; box-shadow: 0 3px 8px rgba(60,35,10,.25); }

/* Recipe card */
.recipe-layout { display: grid; gap: 20px; }
.recipe-photos { display: grid; gap: 18px; align-content: start; }
.polaroid {
  position: relative; margin: 0; padding: 10px 10px 4px; background: var(--card); border-radius: 3px;
  box-shadow: 0 4px 12px rgba(63, 58, 74, 0.18); transform: rotate(-1.5deg);
}
.polaroid.tilt-r { transform: rotate(1.2deg); }
.polaroid::before {
  content: ""; position: absolute; top: -10px; left: 50%; width: 90px; height: 22px; transform: translateX(-50%) rotate(2deg);
  background: repeating-linear-gradient(45deg, var(--tape-mint-a) 0 8px, var(--tape-mint-b) 8px 16px); opacity: 0.9;
}
.polaroid-img { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.polaroid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.polaroid figcaption { display: flex; align-items: center; justify-content: space-between; font: 600 1.15rem Caveat, cursive; color: var(--muted); padding-left: 4px; min-height: 40px; }
.empty-photo figcaption { justify-content: center; }
.photo-full { display: block; width: 100%; border-radius: 8px; }

.recipe-card {
  position: relative; background-color: var(--card); border-radius: 6px; border-top: 12px solid var(--pink);
  box-shadow: var(--shadow); padding: 18px 20px 20px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px);
  background-position: 0 6px;
}
.recipe-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.recipe-head h1 { font-size: 2.4rem; margin: 0; overflow-wrap: anywhere; }
.recipe-kicker { margin: 0; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; }
.recipe-card h2 { font-size: 1.7rem; margin: 18px 0 6px; }
.recipe-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.recipe-facts dt { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.recipe-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.layers { list-style: none; counter-reset: layer; margin: 0; padding: 0; display: grid; gap: 10px; }
.layers li { counter-increment: layer; display: flex; gap: 10px; align-items: flex-start; }
.layers li::before { content: counter(layer); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--butter); font-weight: 800; font-size: 0.8rem; margin-top: 2px; }
.layer-dot { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); margin-top: 2px; }
.layer-name { display: block; font-weight: 700; color: var(--ink); }
a.layer-name { text-decoration: underline; text-decoration-color: var(--pink-edge); text-underline-offset: 3px; }
.layer-how { display: block; color: var(--muted); font-size: 0.92rem; }

/* Tile form */
.two-col.narrow-first { grid-template-columns: 110px minmax(0, 1fr); }
input[type="number"], input[type="date"] {
  font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 12px;
  padding: 10px 12px; min-height: 48px; width: 100%;
}
.layer-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.layer-row { display: grid; gap: 8px; padding: 10px; background: var(--card); border: 2px solid var(--line); border-radius: 14px; }
.layer-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.layer-top select { flex: 1; min-width: 0; }
.layer-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--butter); font-weight: 800; font-size: 0.8rem; }
.layer-top .layer-dot { margin-top: 0; }
.layer-move { display: flex; flex: none; }
.layer-sub { display: grid; grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.layer-sub label { display: grid; gap: 2px; font-size: 0.8rem; font-weight: 700; color: var(--muted); }

/* Pick from photo */
.pick-btn { width: 100%; margin-bottom: 8px; background: var(--sky); border-color: var(--sky-edge); }
.pick-sources { display: grid; gap: 12px; }
.pick-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.pick-thumb { padding: 0; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; background: none; cursor: pointer; aspect-ratio: 1; }
.pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-canvas-wrap { position: relative; touch-action: none; width: fit-content; max-width: 100%; margin: 0 auto; }
.pick-canvas-wrap canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 55vh; border-radius: 10px; cursor: crosshair; }
.pick-marker { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--ink), 0 3px 8px rgba(0,0,0,.3); pointer-events: none; }
.pick-result { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pick-swatch { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--ink); background: repeating-linear-gradient(45deg, var(--well) 0 6px, var(--card) 6px 12px); }
.pick-hex { font-weight: 700; font-size: 1rem; }
.pick-result .spacer { flex: 1; }

/* Tiles in glaze detail */
.mini-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.mini-tile { display: grid; gap: 4px; align-content: start; min-width: 0; text-decoration: none; color: var(--ink); font-size: 0.85rem; font-weight: 700; }
.mini-tile span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-tile img, .mini-blank { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--well); display: block; }

/* ---------- Home overview ---------- */
/* Phone: one column in a useful order. iPad: two columns (see the wide-screen block). */
.home-grid { display: flex; flex-direction: column; }
.home-col { display: contents; }
#idea-day { order: 1; } #home-shelf { order: 2; } #home-tiles { order: 3; } #home-colors { order: 4; } #home-starred { order: 5; } .studio-links { order: 6; }
.home-head { margin-bottom: 26px; }
.home-head h1 { margin-bottom: 0; }
.home-head p { margin: 0; font-weight: 600; }
.warn { display: flex; gap: 8px; align-items: center; background: var(--pink); font-weight: 600; }
.home-grid .card { margin: 0 0 22px; }
.idea-big { font: 700 2rem/1.15 Caveat, cursive; margin: 6px 0 10px; overflow-wrap: anywhere; }
.idea-day .type-pill { --stripe: var(--pink); }
.idea-day .type-pill.type-theme { --stripe: var(--lavender); }
.idea-day .type-pill.type-technique { --stripe: var(--mint); }
.idea-day .type-pill.type-material { --stripe: var(--butter); }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--accent); }
.starred-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.starred-list li a { display: flex; gap: 10px; align-items: flex-start; min-height: 36px; font-weight: 600; color: var(--ink); text-decoration: none; }
.starred-list .icon { width: 20px; height: 20px; color: var(--muted); margin-top: 2px; }
a.chip { text-decoration: none; }
a.chip .icon { color: var(--gold); }
.mini-shelf {
  list-style: none; margin: 6px 0 8px; padding: 0 4px 14px; display: flex; flex-wrap: nowrap; overflow: hidden; gap: 2px;
  background: linear-gradient(to bottom, transparent calc(100% - 14px), var(--wood) calc(100% - 14px) calc(100% - 4px), var(--wood-edge) calc(100% - 4px));
}
.mini-shelf li { flex: none; width: 38px; display: grid; place-items: end center; }
.mini-shelf .jar-svg { width: 34px; height: 44px; margin-bottom: -2px; }

/* Pencils and crayons on the shelf */
.pencil-wood { fill: #f3dcb8; stroke: var(--draw); stroke-width: 2.2; stroke-linejoin: round; }
.pencil-point { stroke: var(--draw); stroke-width: 1.2; }
.pencil-facet { stroke: rgba(255,255,255,.55); stroke-width: 1.5; }
.supply-crayon .jar-label { opacity: 0.9; }
.crayon-band { stroke: var(--draw); stroke-width: 1.5; opacity: .5; }
.supply-pencil.wish .jar-body, .supply-crayon.wish .jar-body { stroke-dasharray: 5 4; fill-opacity: 0.55; }
.shelf-group { margin-bottom: 26px; }
.shelf-group h2 { font-size: 1.8rem; margin: 0 0 4px; }
.shelf-group h2 .n { font: 700 1rem Nunito, sans-serif; color: var(--muted); }
.swatch-preview { display: block; }

/* ---------- Studio Shelf ---------- */
.stage-jump { display: none; }
.piece-shelf {
  --top: 6px; --photo: 96px; --row: 168px; --gap: 14px;
  --plank: calc(var(--top) + var(--photo));
  list-style: none; margin: 4px 0 0; padding: 0 6px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  grid-auto-rows: var(--row); row-gap: var(--gap);
  background: repeating-linear-gradient(to bottom,
    transparent 0 var(--plank),
    var(--wood) var(--plank) calc(var(--plank) + 12px),
    var(--wood-edge) calc(var(--plank) + 12px) calc(var(--plank) + 16px),
    transparent calc(var(--plank) + 16px) calc(var(--row) + var(--gap)));
}
.piece-item { padding-top: var(--top); min-width: 0; }
.piece-link { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--ink); }
.piece-photo { width: var(--photo); height: var(--photo); display: grid; place-items: end center; margin-bottom: 18px; }
.piece-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 3px 8px rgba(63,58,74,.25); }
.pot-svg, .shape-icon { overflow: visible; }
.pot-svg { width: 92%; height: 92%; display: block; }
.pot-svg path, .pot-svg ellipse, .pot-svg rect, .pot-svg circle, .shape-icon path, .shape-icon ellipse, .shape-icon rect, .shape-icon circle { stroke: var(--draw); stroke-width: 2.5; stroke-linejoin: round; }
.pot-svg .rim, .shape-icon .rim { fill: #fff; fill-opacity: .55; stroke-width: 2; }
.pot-svg .rim-edge, .shape-icon .rim-edge { stroke: none; }
.pot-svg .handle, .shape-icon .handle { fill: none; stroke-width: 7; stroke-linecap: round; }
.pot-svg .handle-fill, .shape-icon .handle-fill { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.pot-svg .string, .shape-icon .string { stroke: var(--muted); }
.pot-svg .line, .shape-icon .line { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.pot-svg .ink, .shape-icon .ink { fill: var(--draw); stroke: none; }
.pot-svg .hole, .shape-icon .hole { fill: #fffdf6; stroke-width: 1.5; }
.pot-svg .cheek, .shape-icon .cheek { fill: #f09bb0; stroke: none; opacity: .8; }
.shape-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.shape-opt input { position: absolute; opacity: 0; }
.shape-opt > span { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.shape-icon { width: 40px; height: 40px; display: block; }
.shape-auto { display: block; }
.shape-opt input:checked + span { border-color: var(--accent); background: var(--pink-soft); }
.shape-opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.field > span small { font-weight: 600; }
.piece-name { font-weight: 700; font-size: 0.92rem; line-height: 1.2; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; padding: 0 2px; }
.piece-sub { font-size: 0.78rem; color: var(--muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piece-link .jar-star { right: calc(50% - 56px); top: -4px; }
.sold-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--mint); color: var(--ink); font-weight: 700; }
.piece-shelf.empty { --photo: 34px; --row: 50px; }
.shelf-empty-slot { grid-column: 1 / -1; align-self: start; padding: 8px 0 0 8px; color: var(--faint); font-weight: 600; font-style: italic; font-size: 0.92rem; }

.journal-card {
  position: relative; background: var(--card); border-radius: 6px; border-top: 12px solid var(--lavender);
  box-shadow: var(--shadow); padding: 18px 20px 20px;
}
.journal-card h2 { font-size: 1.7rem; margin: 20px 0 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-head h2 { margin-bottom: 0; }
.section-head .text-link { background: none; border: 0; font: 700 1rem Nunito, sans-serif; cursor: pointer; padding: 0; }
button.text-link { background: none; border: 0; font: 700 1rem Nunito, sans-serif; cursor: pointer; padding: 0 2px; }

.trail { list-style: none; margin: 14px 0 16px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.trail::before { content: ""; position: absolute; top: 21px; left: 10%; right: 10%; height: 3px; background: var(--line); }
.trail li { position: relative; }
.trail button { display: grid; justify-items: center; gap: 2px; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--muted); min-height: 72px; }
.trail-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 3px solid var(--line); }
.trail-dot .icon { width: 20px; height: 20px; stroke-width: 3; }
.trail .past .trail-dot { background: var(--mint); border-color: var(--mint-edge); color: var(--ink); }
.trail .now .trail-dot { background: var(--pink); border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 4px var(--pink-soft); }
.trail .now .trail-label { color: var(--ink); }
.trail-label { font-weight: 700; font-size: 0.85rem; }
.trail-date { font-size: 0.75rem; min-height: 1em; }

.stage-pill { display: inline-block; padding: 0 8px; border-radius: 999px; font: 700 0.75rem/1.6 Nunito, sans-serif; background: var(--butter); color: var(--ink); vertical-align: 2px; }
.stage-pill.stage-drying { background: var(--well); }
.stage-pill.stage-bisqued { background: var(--peach); }
.stage-pill.stage-glazed { background: var(--lavender); }
.stage-pill.stage-done { background: var(--mint); }
.empty-pot { display: grid; place-items: center; aspect-ratio: 1; background: var(--well); border-radius: 2px; }
.empty-pot .pot-svg { width: 60%; height: 60%; }
.add-photo-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

.idea-chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.idea-chips li { padding: 6px 12px; border-radius: 12px; background: var(--pink); font-weight: 600; font-size: 0.92rem; }
.idea-chips li.type-theme { background: var(--lavender); }
.idea-chips li.type-technique { background: var(--mint); }
.idea-chips li.type-material { background: var(--butter); }

.sale-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; align-items: end; }
.sale-form .check { grid-column: 1 / -1; }
.sale-form .btn { grid-column: 1 / -1; justify-self: start; }

.note-form { display: grid; gap: 8px; }
.note-form .btn { justify-self: end; }
.notes-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.notes-list li {
  padding: 10px 0 6px; border-top: 1px dashed var(--line);
}
.note-date { margin: 0; font: 700 1.3rem Caveat, cursive; color: var(--accent); }
.note-body { margin: 2px 0 0; white-space: pre-wrap; line-height: 1.55; }
.note-actions { display: flex; gap: 14px; }
.note-actions .text-link { min-height: 36px; font-size: 0.9rem; }

.pick-list { list-style: none; margin: 10px 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.pick-list li { border-bottom: 1px solid var(--line-soft); }
.tile-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tile-choice { position: relative; display: grid; gap: 4px; padding: 6px; border: 3px solid transparent; border-radius: 12px; background: var(--card); cursor: pointer; font: 700 0.85rem Nunito, sans-serif; color: var(--ink); text-align: left; }
.tile-choice img, .tile-choice .mini-blank { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.tile-choice .tick { position: absolute; top: 10px; right: 10px; display: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--paper); }
.tile-choice .tick .icon { width: 16px; height: 16px; stroke-width: 3; }
.tile-choice.on { border-color: var(--accent); }
.tile-choice.on .tick { display: grid; }
.segmented.stages { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 420px) { .segmented.stages { grid-template-columns: repeat(5, 1fr); } }

.shelf-summary { display: block; text-decoration: none; color: var(--ink); }
.stage-counts { list-style: none; margin: 4px 0 8px; padding: 0 0 14px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  background: linear-gradient(to bottom, transparent calc(100% - 14px), var(--wood) calc(100% - 14px) calc(100% - 4px), var(--wood-edge) calc(100% - 4px)); }
.stage-counts li { display: grid; justify-items: center; gap: 2px; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.stage-counts .count { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px 12px 6px 6px; background: var(--well); font: 700 1.3rem Nunito, sans-serif; color: var(--faint); }
.stage-counts li.has .count { background: var(--pink); color: var(--ink); }
.stage-counts li.has { color: var(--ink); }

/* ---------- Stego companion ---------- */
.stego { display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 4px rgba(63, 58, 74, 0.18)); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.home-hero { display: flex; align-items: flex-end; gap: 22px; margin: 4px 0 26px; }
.stego-big { flex: none; width: 112px; padding: 0; border: 0; background: none; cursor: pointer; margin-bottom: -4px; }
.speech {
  position: relative; flex: 1; min-width: 0; background: var(--card); border-radius: 20px; padding: 12px 16px 10px;
  box-shadow: var(--shadow); border: 2px solid var(--line-soft);
}
.speech::before {
  content: ""; position: absolute; left: -12px; bottom: 11px; width: 22px; height: 22px; background: var(--card);
  border-left: 2px solid var(--line-soft); border-bottom: 2px solid var(--line-soft); transform: rotate(45deg); border-radius: 0 0 0 5px;
}
.speech h1 { font-size: 2.2rem; margin: 0; }
.speech-date { margin: 0; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.speech-text { margin: 4px 0 2px; font-weight: 600; font-size: 1.05rem; position: relative; }
.speech-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; position: relative; }
.small-btn { min-height: 40px; padding: 0 14px; font-size: 0.92rem; }
@keyframes hop { 0% { transform: translateY(0); } 35% { transform: translateY(-12px) rotate(-3deg); } 70% { transform: translateY(0); } 85% { transform: translateY(-3px); } 100% { transform: translateY(0); } }
.hop .stego { animation: hop 0.6s ease-out; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.stego-big .stego { animation: bob 3.2s ease-in-out infinite; }
.stego-big.hop .stego { animation: hop 0.6s ease-out; }
@media (prefers-reduced-motion: reduce) { .stego-big .stego, .hop .stego { animation: none; } }

.page-head { position: relative; }
.stego-mini { flex: none; width: 62px; height: 48px; padding: 0; margin-left: auto; border: 0; background: none; cursor: pointer; align-self: center; }
.stego-mini { transform: scaleX(-1); } /* face toward the middle of the page */
.stego-side { display: none; }
.mini-bubble {
  position: fixed; z-index: 60; padding: 12px 14px; background: var(--card); color: var(--ink); border-radius: 16px;
  font-weight: 600; box-shadow: 0 6px 22px rgba(63,58,74,.22); border: 2px solid var(--line-soft); animation: pop .18s ease-out;
}
.mini-bubble::after {
  content: ""; position: absolute; left: calc(var(--tail, 50%) - 9px); bottom: -9px; width: 16px; height: 16px; background: var(--card);
  border-right: 2px solid var(--line-soft); border-bottom: 2px solid var(--line-soft); transform: rotate(45deg);
}
.mini-bubble.below::after { bottom: auto; top: -9px; transform: rotate(225deg); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Statement and backup ---------- */
.statement-card { max-width: 760px; }
article.statement-card p { font: 600 1.7rem/1.35 Caveat, cursive; margin: 0 0 18px; }
.statement-card textarea { font: 1.05rem/1.6 Nunito, sans-serif; }
.statement-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.backup-card .btn, .backup-card + .card .btn { margin-top: 4px; }
.progress { margin-top: 14px; }
.progress .bar { height: 12px; border-radius: 999px; background: var(--well); overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--mint); transition: width .2s; }
.studio-links { display: grid; gap: 2px; }
.studio-links a { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; color: var(--ink); text-decoration: none; }
.studio-links .icon { color: var(--accent); }
.side-more { display: none; }

/* ---------- Split layout (filters beside content on wide screens) ---------- */
.split-main { min-width: 0; }

/* ---------- Wide screens: iPad landscape and up ---------- */
@media (min-width: 900px) {
  :root { --side-w: 212px; }
  .wide-only { display: revert !important; }
  .bottom-nav a.wide-only { display: flex !important; }

  .view {
    max-width: 1240px;
    margin: 0 0 0 var(--side-w);
    padding: 28px 40px 48px;
  }
  @media (min-width: 1452px) { .view { margin-left: calc(var(--side-w) + (100vw - var(--side-w) - 1240px) / 2); } }

  .bottom-nav {
    top: 0; right: auto; bottom: 0;
    width: var(--side-w); height: auto;
    padding: 24px 14px calc(24px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    border-top: 0; border-right: 2px solid var(--wood-edge);
  }
  .bottom-nav .brand {
    display: block; font: 700 2rem/1 Caveat, cursive; color: var(--ink);
    padding: 0 10px 18px;
  }
  .bottom-nav a {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    min-height: 52px; padding: 0 14px; border-radius: 14px;
    font-size: 1.05rem;
  }
  .bottom-nav a[aria-current="page"] { background: var(--card); box-shadow: var(--shadow); }
  .bottom-nav a.add {
    order: 10; margin: 18px 0 0; width: auto; height: 52px; justify-self: stretch;
    border-radius: 999px; border-width: 2px; justify-content: center; gap: 8px;
  }
  .bottom-nav a.add svg { width: 24px; height: 24px; }
  .bottom-nav .side-more { display: grid !important; order: 15; gap: 0; margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line); }
  .bottom-nav .side-more a { min-height: 40px; font-size: 0.92rem; padding: 0 14px; }
  .home-grid .studio-links { display: none; }
  .bottom-nav .stego-side { display: block !important; order: 20; margin: auto auto 0; width: 132px; padding: 0; border: 0; background: none; cursor: pointer; }
  .bottom-nav .stego-side img { width: 100%; height: auto; }
  .page-head .stego-mini { display: none; }
  .stego-big { width: 170px; }
  .home-hero { gap: 28px; }
  .speech::before { bottom: 24px; }
  .speech { padding: 16px 22px 12px; }
  .speech h1 { font-size: 2.8rem; }

  .toast { bottom: 28px; left: calc(50% + var(--side-w) / 2); }

  h1 { font-size: 3rem; }

  .split {
    display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 32px; align-items: start;
  }
  .split-side { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; padding: 2px 6px 12px 2px; }
  .split-side .chips.scroll { flex-wrap: wrap; overflow: visible; margin-right: 0; padding-right: 0; }

  .idea-list { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
  .idea { align-items: stretch; }
  .idea-main { padding: 14px 4px 14px 16px; }

  .recipe-layout { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .recipe-photos { position: sticky; top: 24px; }
  .tile-wall { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .piece-shelf { --photo: 116px; --row: 190px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .piece-shelf.empty { --photo: 34px; --row: 50px; }
  .stage-jump { display: grid; gap: 4px; margin-top: 14px; }
  .stage-jump a { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--card); text-decoration: none; color: var(--ink); font-weight: 700; box-shadow: 0 1px 0 rgba(63,58,74,.06); }
  .stage-jump .n { color: var(--muted); }
  .section-tabs { max-width: 520px; }
  .home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
  .home-col { display: block; }
  .soon-grid { max-width: 640px; }
  .jar-shelf { --jar-h: 95px; --row: 190px; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .jar-shelf.wishlist { --row: 236px; }
  .jar-shelf .jar-svg { width: 76px; }
  .jar-name { font-size: 1rem; }
  .jar-brand { font-size: 0.85rem; }
  .add-wrap { max-width: 640px; }
}

/* ---------- Appearance switch ---------- */
.theme-switch { display: inline-grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--well); border-radius: 12px; }
.theme-switch button { min-height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: 700 0.85rem Nunito, sans-serif; cursor: pointer; }
.theme-switch button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.theme-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; font-weight: 700; }
.bottom-nav .side-more .theme-switch { margin: 10px 14px 0; }

/* ---------- Idea reference photos ---------- */
.idea-main { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 12px; align-content: start; }
.idea-main:has(.idea-thumb) { grid-template-columns: 56px minmax(0, 1fr); }
.idea-thumb { position: relative; grid-row: span 2; align-self: start; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--well); }
.idea-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.idea-thumb .n { position: absolute; right: 3px; bottom: 3px; min-width: 20px; padding: 0 5px; border-radius: 999px; background: rgba(35, 32, 42, 0.75); color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 20px; text-align: center; }
.ref-photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.ref-photos li { position: relative; }
.ref-photos .ref-empty, .ref-photos .muted { grid-column: 1 / -1; font-size: 0.92rem; }
.ref-thumb { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--well); cursor: zoom-in; }
.ref-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ref-remove { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(35, 32, 42, 0.7); color: #fff; cursor: pointer; }
.ref-remove .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.ref-add { justify-self: start; margin-top: 4px; background: var(--sky); border-color: var(--sky-edge); }

/* ---------- Little animations (skipped when the device asks for reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Pages float up gently when you arrive */
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  .view > * { animation: rise .38s ease-out both; }
  .view > *:nth-child(2) { animation-delay: .04s; }
  .view > *:nth-child(3) { animation-delay: .08s; }
  .view > *:nth-child(n+4) { animation-delay: .12s; }
  .home-grid .card { animation: rise .4s ease-out both; }
  .home-grid .card:nth-child(2) { animation-delay: .08s; }
  .home-grid .card:nth-child(3) { animation-delay: .16s; }

  /* Jars and pots wobble when touched */
  @keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-7deg); } 45% { transform: rotate(5deg); } 65% { transform: rotate(-3deg); } 85% { transform: rotate(1deg); } }
  .jar-btn .jar-svg, .piece-photo .pot-svg { transform-origin: 50% 100%; }
  .jar-btn:hover .jar-svg, .jar-btn:active .jar-svg,
  .piece-link:hover .pot-svg, .piece-link:active .pot-svg { animation: wobble .6s ease-in-out; }

  /* Tiles on the cork board lift and straighten */
  .tile-card { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), box-shadow .25s; }
  .tile-pin .tile-card:hover, .tile-pin .tile-card:active { transform: rotate(0) translateY(-4px) scale(1.03); box-shadow: 0 10px 18px rgba(60, 35, 10, 0.3); }

  /* Shelf photos lift a little */
  .piece-photo img { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
  .piece-link:hover .piece-photo img, .piece-link:active .piece-photo img { transform: translateY(-4px) rotate(-1.5deg); }

  /* The nav icon hops when you land on its page */
  @keyframes navhop { 0% { transform: translateY(0); } 40% { transform: translateY(-6px) scale(1.08); } 70% { transform: translateY(1px); } 100% { transform: none; } }
  .bottom-nav a[aria-current="page"] svg { animation: navhop .45s ease-out; }

  /* The + button turns when pressed */
  .bottom-nav a.add svg { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
  .bottom-nav a.add:hover svg, .bottom-nav a.add:active svg { transform: rotate(90deg); }

  /* Buttons and chips squish a bit */
  .chip, .seg span, .shape-opt > span, .theme-switch button { transition: transform .12s; }
  .chip:active, .seg:active span, .shape-opt:active > span, .theme-switch button:active { transform: scale(.94); }

  /* Toasts bounce in */
  .toast { transition: opacity .2s, transform .35s cubic-bezier(.3, 1.6, .5, 1); }

  /* Stage counts pop in on Home */
  @keyframes popin { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
  .stage-counts .count { animation: popin .4s ease-out both; }
  .stage-counts li:nth-child(2) .count { animation-delay: .05s; }
  .stage-counts li:nth-child(3) .count { animation-delay: .1s; }
  .stage-counts li:nth-child(4) .count { animation-delay: .15s; }
  .stage-counts li:nth-child(5) .count { animation-delay: .2s; }

  /* The little stegos fidget now and then */
  @keyframes fidget { 0%, 90%, 100% { transform: none; } 92% { transform: rotate(-6deg) translateY(-2px); } 94% { transform: rotate(4deg); } 96% { transform: rotate(-2deg); } }
  .stego-mini .stego { animation: fidget 11s ease-in-out infinite; transform-origin: 50% 100%; }
  .stego-side .stego { animation: fidget 14s ease-in-out 3s infinite; transform-origin: 50% 100%; }
  .stego-mini.hop .stego, .stego-side.hop .stego { animation: hop .6s ease-out; }
}

/* Sparkles when something gets starred */
.sparkle { position: fixed; z-index: 70; width: 0; height: 0; pointer-events: none; }
.sparkle i { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; background: var(--gold);
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
  animation: burst .65s ease-out forwards; }
@keyframes burst { 0% { transform: rotate(var(--a)) translateY(0) scale(.4); opacity: 1; } 100% { transform: rotate(var(--a)) translateY(-30px) scale(1); opacity: 0; } }

/* ---------- Studio Stego welcome ---------- */
.welcome { display: grid; gap: 14px; }
.welcome-stego { width: 150px; justify-self: center; margin-top: 4px; }
.welcome-hi { margin: 0; font-weight: 600; font-size: 1.05rem; text-align: center; }
.welcome-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.welcome-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px; background: var(--card); border: 2px solid var(--line-soft); border-radius: 14px; }
.welcome-list .icon { width: 34px; height: 34px; padding: 6px; border-radius: 10px; background: var(--mint); color: var(--ink); }
.welcome-list li:nth-child(2) .icon { background: var(--pink); }
.welcome-list li:nth-child(3) .icon { background: var(--butter); }
.welcome-go { justify-self: center; min-width: 200px; }
@media (prefers-reduced-motion: no-preference) { .welcome-stego .stego { animation: bob 3.2s ease-in-out infinite; } }
