:root {
  --red: #d8232a;
  --red-dark: #a8161c;
  --red-tint: #fdf1f1;
  --red-line: #f3c8c9;
  --ink: #17161a;
  --muted: #6d6a71;
  --line: #e7e4e6;
  --bg: #ffffff;
  --alt: #faf8f8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23, 22, 26, .06), 0 8px 24px rgba(23, 22, 26, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Footer sits at the bottom of the viewport when the page is short, and
     flows below the content normally once content pushes past it. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--red-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.015em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.25rem; }
code { background: var(--alt); border: 1px solid var(--line); border-radius: 4px; padding: .1em .35em; font-size: .875em; }

/* ---------- chrome ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 3px solid var(--red);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--red);
  position: relative; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 7px 5px 5px; background: #fff; border-radius: 2px;
}
.brand-text { font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; }

.topnav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.topnav a { color: var(--ink); text-decoration: none; font-size: .925rem; font-weight: 500; }
.topnav a:hover { color: var(--red); }
.topnav .btn-primary { color: #fff; }
.inline { display: inline; margin: 0; }
.linkish {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  font-size: .925rem; font-weight: 500; color: var(--ink);
}
.linkish:hover { color: var(--red); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; align-items: stretch; gap: 5px;
  width: 34px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer; flex: none;
}
.nav-toggle-bar { height: 2px; background: var(--ink); border-radius: 2px; transition: transform .15s ease, opacity .15s ease; }
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay { position: fixed; inset: 0; z-index: 20; background: transparent; }
.nav-overlay[hidden] { display: none; }

@media (max-width: 680px) {
  .nav-toggle { display: flex; }
  .topnav {
    position: absolute; top: calc(100% + .6rem); right: clamp(1rem, 4vw, 2.5rem); z-index: 30;
    width: min(78vw, 260px); max-height: calc(100vh - 5rem);
    flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 2px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: .4rem; overflow-y: auto;
    opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
    transition: opacity .12s ease, transform .12s ease;
  }
  .topnav.is-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
  .topnav a, .topnav .linkish {
    width: 100%; padding: .65rem .7rem; border-radius: 8px; font-size: .925rem;
  }
  .topnav a:hover, .topnav .linkish:hover { background: var(--alt); color: var(--red); }
  .topnav .btn-primary { display: block; text-align: center; margin-top: 2px; }
  .topnav .btn-primary:hover { color: #fff; }
  .topnav form.inline { width: 100%; }
}

.page { max-width: 1180px; margin: 0 auto; padding: clamp(1.25rem, 4vw, 2.5rem); flex: 1 0 auto; width: 100%; }

.footer {
  flex: none;
  display: flex; flex-wrap: wrap; gap: .3rem 1rem; justify-content: space-between;
  border-top: 1px solid var(--line); margin-top: 3rem;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
  color: var(--muted); font-size: .85rem;
}
.footer a { color: inherit; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: 999px; border: 1px solid transparent;
  padding: .55rem 1.1rem; font-size: .925rem; font-weight: 600;
  text-decoration: none; cursor: pointer; font-family: inherit;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-danger { background: #fff; color: var(--red-dark); border-color: var(--red-line); }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm { padding: .35rem .8rem; font-size: .85rem; }
.btn-lg { padding: .75rem 1.6rem; font-size: 1rem; }

/* ---------- panels & forms ---------- */

.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem); margin-bottom: 1.5rem;
}
.narrow { max-width: 480px; margin-inline: auto; }
.center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); font-size: .925rem; }
.hint { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; margin-top: .3rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .72rem; font-weight: 700; color: var(--red); margin: 0 0 .3rem; }
.lede { color: var(--muted); max-width: 58ch; margin: 0; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--red); margin: 0; }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack label { font-size: .875rem; font-weight: 600; display: block; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; margin-top: .35rem; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: 9px; font: inherit; font-weight: 400;
  background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red);
}
input[type=file] { margin-top: .35rem; font-size: .875rem; }
textarea { resize: vertical; }
.checkbox { display: flex; align-items: center; gap: .55rem; font-weight: 500; }
.checkbox input { width: auto; margin: 0; accent-color: var(--red); }
.form-actions { display: flex; gap: .6rem; align-items: center; }
.row-form { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row-form input[type=text] { width: auto; max-width: 200px; margin: 0; }
.slug-row { display: flex; align-items: center; gap: .35rem; margin-top: .35rem; }
.slug-prefix { color: var(--muted); font-size: .9rem; }
.slug-row input { margin-top: 0; }

.alert { border-radius: 9px; padding: .7rem .9rem; font-size: .9rem; margin: 0 0 1rem; }
.alert-error { background: var(--red-tint); border: 1px solid var(--red-line); color: var(--red-dark); }
.alert-warn { background: #fff8e8; border: 1px solid #f0dca8; color: #6b4e05; }
.alert-ok { background: #f0f8f1; border: 1px solid #c6e4c9; color: #1f5a29; }

/* ---------- landing ---------- */

.hero { padding: clamp(2rem, 7vw, 4.5rem) 0 2.5rem; max-width: 75ch; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.1rem); }
.hero .lede { font-size: 1.075rem; }
.hero-actions { display: flex; gap: .75rem; margin-top: 1.75rem; flex-wrap: wrap; }
/* Wraps .hero (unchanged above, stays put on the left) next to a toy-chest
   icon + wordmark, for the blog-focused homepage only -- the app-pitch
   hero doesn't use this. .hero-mark gets flex: 1 (grows to fill whatever
   width .hero doesn't use) plus align-items: center, so its content sits
   centered *within its own column* rather than pinned to the far right
   edge the way justify-content: space-between on .hero-split would do.
   The mark stays out of the flow below the breakpoint: there's no spare
   width to give it on a normal screen, only on one wide enough that
   .hero's own max-width: 75ch already leaves the page's right side empty. */
.hero-split { display: flex; align-items: center; gap: 3rem; }
.hero-mark { display: none; flex: none; }
@media (min-width: 1150px) {
  .hero-mark { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 1.1rem; }
  .hero-mark-icon { width: 340px; height: auto; }
  .hero-mark-text {
    font-weight: 700; font-size: 1.6rem; letter-spacing: -.02em; color: var(--ink);
  }
}
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.how-step { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.how-step h3 { font-size: 1rem; }
.how-step p { color: var(--muted); font-size: .9rem; margin: 0; }
.step-num {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--red); color: #fff;
  font-weight: 700; font-size: .85rem; margin-bottom: .8rem;
}

.blog-teaser {
  display: flex; gap: 2rem; align-items: center; flex-wrap: wrap;
  margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line);
}
.blog-teaser-text { flex: 1 1 260px; }
.blog-teaser-text h2 { font-size: 1.3rem; margin: 0 0 .5rem; }
.blog-teaser-text .muted { max-width: 42ch; margin: 0 0 1rem; }
.blog-teaser-post {
  flex: 1 1 320px; max-width: 420px; display: flex; gap: 1rem; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: #fff; padding: .8rem; text-decoration: none; color: inherit;
  transition: box-shadow .12s ease;
}
.blog-teaser-post:hover { box-shadow: var(--shadow); }
.blog-teaser-post-cover { flex: none; width: 96px; border-radius: 9px; overflow: hidden; background: var(--alt); }
.blog-teaser-post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-teaser-post-body { min-width: 0; }
.blog-teaser-post-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--red); margin: 0 0 .25rem; }
.blog-teaser-post-title { font-size: .95rem; margin: 0 0 .25rem; }
.blog-teaser-post-excerpt {
  color: var(--muted); font-size: .82rem; margin: 0;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* ---------- toybox header ---------- */

.toybox-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.head-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.score { min-width: 190px; }
.score-num { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.score-label { color: var(--muted); font-size: .85rem; margin-left: .3rem; }
.score-bar { height: 7px; border-radius: 999px; background: var(--alt); border: 1px solid var(--line); overflow: hidden; margin-top: .5rem; }
.score-bar span { display: block; height: 100%; background: var(--red); transition: width .2s ease; }

.share-strip {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: var(--red-tint); border: 1px solid var(--red-line);
  border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1.5rem;
}
.share-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--red-dark); }
#copy-share {
  /* "Copy" -> "Copied" is a couple characters wider -- without a fixed
     width the row's flex-wrap recalculates and the button jumps to its own
     line for the ~1.6s the label is swapped, then jumps back. */
  min-width: 5rem;
}
.share-strip input {
  /* iOS Safari zooms the whole page in on focus for any input under 16px
     (1rem) -- confirmed this is what threw off the layout. 16px is the
     floor to prevent that, not a deliberate size choice. */
  flex: 1 1 240px; margin: 0; background: #fff; font-size: 1rem;
  border-color: var(--red-line);
}
.share-warn { font-size: .82rem; color: var(--red-dark); }

/* ---------- controls ---------- */

.controls { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.5rem; }
.search { flex: 1 1 240px; margin: 0; }
.select {
  width: auto; max-width: 100%; margin: 0; appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 2.3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d6a71' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  background-size: 13px;
}
.chips { display: flex; gap: .35rem; background: var(--alt); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.chip {
  border: 0; background: none; border-radius: 999px; padding: .4rem .9rem;
  font: inherit; font-size: .875rem; font-weight: 600; color: var(--muted); cursor: pointer;
}
.chip:hover { color: var(--ink); }
.chip.is-active { background: var(--red); color: #fff; }

/* ---------- cards ---------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.grid[hidden] { display: none; }

.grid-spinner { display: flex; justify-content: center; padding: 3.5rem 0; }
.grid-spinner[hidden] { display: none; }
.spinner-ring {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--red);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner-ring { animation: none; border-top-color: var(--line); }
}
.card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.card.is-owned { border-color: var(--red); }
.card.is-missing .card-thumb { filter: grayscale(1); opacity: .5; }
.card.is-selected { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.card.is-selected .card-thumb { filter: none; opacity: .85; }
.card.is-editable .card-thumb { cursor: pointer; }

/* View All: browse the whole catalog without the "still needed" fade. */
.grid-colored .card.is-missing .card-thumb { filter: none; opacity: 1; }

.card-thumb {
  position: relative; aspect-ratio: 1 / 1; background: var(--alt);
  display: grid; place-items: center; border-bottom: 1px solid var(--line);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-fallback { font-size: 2rem; font-weight: 800; color: #cfcacd; letter-spacing: -.03em; }

.img-toggle {
  position: absolute; bottom: .5rem; right: .5rem; width: 24px; height: 24px;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.9);
  color: var(--muted); font-size: .85rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.img-toggle:hover { border-color: var(--red); color: var(--red); }
.img-toggle.is-alt { border-color: var(--red); color: var(--red-dark); background: var(--red-tint); }

.card-flag { position: absolute; top: .5rem; right: .5rem; width: 22px; height: 22px; }
.card.is-owned .card-flag, .card.is-selected .card-flag {
  border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 2px #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 14px; background-repeat: no-repeat; background-position: center;
}

.wish-toggle, .wish-badge {
  position: absolute; top: .5rem; left: .5rem; width: 24px; height: 24px;
  border-radius: 50%; border: 0; padding: 0;
  background-color: rgba(255,255,255,.9); box-shadow: 0 0 0 1px var(--line);
  background-repeat: no-repeat; background-position: center; background-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d6a71' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.6l-1-1a5.5 5.5 0 0 0-7.8 7.8l1 1L12 21l7.8-7.8 1-1a5.5 5.5 0 0 0 0-7.6z'/%3E%3C/svg%3E");
}
.wish-toggle { cursor: pointer; }
.wish-toggle:hover { box-shadow: 0 0 0 1px var(--red); }
.wish-toggle.is-wished, .wish-badge {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d8232a' stroke='%23d8232a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.6l-1-1a5.5 5.5 0 0 0-7.8 7.8l1 1L12 21l7.8-7.8 1-1a5.5 5.5 0 0 0 0-7.6z'/%3E%3C/svg%3E");
}
.wish-toggle.is-busy { opacity: .55; pointer-events: none; }

.card-body { padding: .7rem .8rem .4rem; flex: 1; }
.card-name { font-size: .95rem; margin: 0 0 .15rem; }
.card-meta { font-size: .78rem; color: var(--muted); margin: 0; }
.card-warn { font-size: .7rem; color: #8a6d0b; margin: .35rem 0 0; text-transform: uppercase; letter-spacing: .05em; }

.card-foot { padding: .5rem .8rem .8rem; display: flex; align-items: center; gap: .5rem; justify-content: space-between; }

.card-buy {
  font-size: .74rem; color: var(--muted); white-space: nowrap;
  text-decoration: none; border-bottom: 1px solid transparent;
}
.card-buy:hover { color: var(--red); border-bottom-color: var(--red); }

.own-toggle {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  padding: .45rem .6rem; font: inherit; font-size: .85rem; font-weight: 600;
  color: var(--muted); cursor: pointer; text-align: left;
}
.own-toggle:hover { border-color: var(--red); color: var(--red); }
.own-toggle-box { width: 16px; height: 16px; border: 2px solid #cfcacd; border-radius: 4px; flex: none; }
.own-toggle[aria-pressed="true"] { border-color: var(--red); color: var(--red-dark); background: var(--red-tint); }
.own-toggle[aria-pressed="true"] .own-toggle-box {
  background: var(--red); border-color: var(--red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 11px; background-repeat: no-repeat; background-position: center;
}
.own-toggle.is-busy { opacity: .55; pointer-events: none; }

.status-pill {
  display: inline-block; border-radius: 999px; padding: .25rem .7rem;
  font-size: .78rem; font-weight: 700; border: 1px solid var(--line); color: var(--muted);
}
.card.is-owned .status-pill { background: var(--red); border-color: var(--red); color: #fff; }

.empty-filter { text-align: center; color: var(--muted); padding: 2.5rem 0; }
.card[hidden] { display: none; }

/* ---------- table ---------- */

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.row-placeholder { background: #fffdf5; }
.row-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.tag {
  display: inline-block; border-radius: 999px; padding: .1rem .5rem;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: var(--alt); border: 1px solid var(--line); color: var(--muted);
}
.tag-ok { background: var(--red-tint); border-color: var(--red-line); color: var(--red-dark); }
.tag-warn { background: #fdf6e3; border-color: #f0dfa0; color: #8a6d0b; margin-left: .35rem; }
.danger-zone { border-color: var(--red-line); background: var(--red-tint); }

.review-list { margin-top: .75rem; }
.review-list summary { cursor: pointer; font-weight: 600; }
.review-list ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.review-list li { margin-bottom: .3rem; font-size: .9rem; }

/* ---------- selection bar & review modal ---------- */

.select-bar {
  position: fixed; left: 50%; bottom: 1.1rem; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: .9rem;
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: .55rem .55rem .55rem 1.1rem; box-shadow: var(--shadow);
  max-width: calc(100% - 2rem);
}
.select-bar[hidden] { display: none; }
.select-bar-count { font-size: .875rem; font-weight: 600; white-space: nowrap; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(23, 22, 26, .5);
  display: flex; align-items: flex-end; justify-content: center; padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal-panel {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 420px; padding: 1.2rem;
  max-height: min(70vh, 560px); display: flex; flex-direction: column;
}
.modal-panel h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
.modal-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; border-top: 1px solid var(--line); }
.modal-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.modal-item-thumb {
  width: 40px; height: 40px; flex: none; border-radius: 8px; overflow: hidden;
  background: var(--alt); display: grid; place-items: center;
}
.modal-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-item-thumb-fallback { font-size: .75rem; font-weight: 800; color: #cfcacd; letter-spacing: -.03em; }
.modal-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-item-remove {
  border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1;
  cursor: pointer; padding: .2rem .5rem; border-radius: 6px; flex: none;
}
.modal-item-remove:hover { color: var(--red); background: var(--red-tint); }
.modal-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
body.modal-open { overflow: hidden; }

/* ---------- blog ---------- */

.html-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.55; }

.html-toolbar {
  display: flex; flex-wrap: wrap; gap: .35rem;
  border: 1px solid var(--line); border-radius: 9px; background: var(--alt);
  padding: .5rem; margin-bottom: .75rem;
}
.toolbar-btn {
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
  padding: .3rem .65rem; font-size: .8rem; line-height: 1.2; font-family: inherit;
  cursor: pointer;
}
.toolbar-btn:hover { border-color: var(--red); color: var(--red); }
.toolbar-btn strong, .toolbar-btn em { font-family: inherit; }

/* ---------- post editor (dashboard-style) ---------- */

.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.editor-back { font-size: .875rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.editor-back:hover { color: var(--red); }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
.editor-main { display: flex; flex-direction: column; min-width: 0; }

input.editor-title-input {
  font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 0 0 .8rem; margin: 0 0 1.25rem; background: transparent;
}
input.editor-title-input:focus { outline: none; border-bottom-color: var(--red); }
textarea.editor-body-input { flex: 1; min-height: 480px; margin-top: 0; }

.html-tips {
  border: 1px solid var(--line); border-radius: 9px; background: var(--alt);
  padding: .7rem .9rem; margin-bottom: 1rem; font-size: .85rem;
}
.html-tips summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.html-tips[open] summary { margin-bottom: .8rem; color: var(--ink); }
.html-tips summary:hover { color: var(--red); }
.cheatsheet-list {
  margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .55rem 1.4rem;
}
.cheatsheet-list > div { display: flex; gap: .55rem; align-items: baseline; }
.cheatsheet-list dt { margin: 0; flex: none; }
.cheatsheet-list dt code { font-size: .78rem; white-space: nowrap; }
.cheatsheet-list dd { margin: 0; color: var(--muted); font-size: .78rem; }

.editor-sidebar { display: flex; flex-direction: column; gap: 1.1rem; position: sticky; top: 5.5rem; }
.editor-actions { display: flex; gap: .6rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.editor-cover-preview { aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--alt); margin-bottom: .9rem; }
.editor-cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Uncropped, unlike .editor-cover-preview -- matches how .post-cover
   actually renders the header image, so this preview isn't misleading. */
.editor-header-preview {
  border-radius: 9px; overflow: hidden; background: var(--alt); margin-bottom: .9rem;
  display: flex; justify-content: center;
}
.editor-header-preview img { display: block; max-width: 100%; max-height: 180px; width: auto; height: auto; }
.editor-sidebar .sidebar-panel label { margin-top: .9rem; display: block; }
.editor-sidebar .sidebar-panel label:first-of-type { margin-top: 0; }

/* Latest post gets a big banner treatment, like most blog homepages;
   everything else falls into a regular card grid below it. */
.post-feature {
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 0 2rem;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: #fff; text-decoration: none; color: inherit;
  transition: box-shadow .12s ease;
}
.post-feature:hover { box-shadow: var(--shadow); }
.post-feature.no-cover { grid-template-columns: 1fr; }
.post-feature-cover { aspect-ratio: 4 / 3; background: var(--alt); }
.post-feature-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-feature-body { padding: 1.6rem 1.9rem 1.6rem 0; }
.post-feature.no-cover .post-feature-body { padding: 1.9rem clamp(1.25rem, 4vw, 2.5rem); }
.post-feature-eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .72rem; font-weight: 700; color: var(--red); margin: 0 0 .5rem; }
.post-feature-title { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin: 0 0 .4rem; letter-spacing: -.015em; text-wrap: balance; }
.post-feature-excerpt { color: var(--muted); font-size: .95rem; margin: .7rem 0 0; max-width: 58ch; }
.post-feature-cta { display: inline-block; margin-top: 1.1rem; font-weight: 700; color: var(--red-dark); font-size: .875rem; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.3rem; margin-top: 2rem; }
.post-card {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: #fff; transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.post-card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.post-card-cover { aspect-ratio: 16 / 10; background: var(--alt); }
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-body { flex: 1; display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem 1.2rem; min-width: 0; }
.post-card-title { font-size: 1.02rem; margin: 0; }
.post-card-date { color: var(--muted); font-size: .78rem; margin: 0; }
.post-card-excerpt {
  color: var(--muted); font-size: .875rem; margin: .2rem 0 0;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}

.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.5rem; align-items: start; }
.blog-main { min-width: 0; }
.blog-sidebar { display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 5.5rem; }
.sidebar-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.sidebar-title { font-size: .95rem; margin: 0 0 .8rem; }
.sidebar-recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.sidebar-recent-link { display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: inherit; }
.sidebar-recent-title { font-size: .875rem; font-weight: 600; line-height: 1.35; }
.sidebar-recent-link:hover .sidebar-recent-title { color: var(--red); }
.sidebar-recent-date { font-size: .75rem; color: var(--muted); }

.post { max-width: 68ch; margin: 0 auto; }
/* No forced aspect-ratio here (unlike the cropped covers below) -- this is
   a standalone hero, not a grid tile that needs to line up with others, so
   it shows at its natural shape instead of cutting off a portrait photo. A
   fixed max-height (not viewport-relative) keeps a portrait photo from
   dominating the page regardless of screen size; the --alt background
   letterboxes anything narrower than the column. */
.post-cover {
  border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; background: var(--alt);
  display: flex; justify-content: center;
}
.post-cover img { display: block; max-width: 100%; max-height: 250px; width: auto; height: auto; }
.post-head { margin-bottom: 1.75rem; }
.breadcrumbs { font-size: .8rem; color: var(--muted); margin: 0 0 .5rem; }
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: var(--red); }
.breadcrumb-sep { margin: 0 .35rem; }
.post-date { color: var(--muted); font-size: .875rem; margin: .2rem 0 0; }
.post-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 0; }
.tag-chip {
  display: inline-block; border-radius: 999px; padding: .15rem .65rem; font-size: .78rem;
  background: var(--alt); border: 1px solid var(--line); color: var(--muted); text-decoration: none;
}
.tag-chip:hover { color: var(--red); border-color: var(--red-line); }
.post-rating { display: flex; align-items: center; gap: .4rem; margin: .4rem 0 0; }
/* Fractional star fill via a clipped ::before overlay, so e.g. a 4.5 rating
   shows a half-lit star instead of rounding to 4 or 5. */
.star-rating {
  position: relative; display: inline-block; font-size: 1.05rem; letter-spacing: .1rem;
  color: var(--line, #ddd);
}
.star-rating::before {
  content: "★★★★★"; position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap;
  width: calc(var(--rating) / 5 * 100%); color: var(--red);
}
.post-rating-value, .post-rating-product { color: var(--muted); font-size: .875rem; }
.post-body { font-size: 1.02rem; line-height: 1.7; }
.post-body h2 { font-size: 1.4rem; margin: 1.8rem 0 .6rem; }
.post-body h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.post-body p { margin: 0 0 1.1rem; }
.post-body ul, .post-body ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
.post-body li { margin-bottom: .4rem; }
/* max-height stops a naturally tall image (e.g. a portrait "pin"-style
   graphic) from displaying at nearly full column height just because it's
   full column *width* -- width/height stay unset (auto), so the browser
   still shrinks it to fit both bounds at once without cropping or
   distorting it, same as .post-cover img's height cap below. 850px is
   deliberately generous: it's meant to catch a genuinely extreme case (a
   screenshot several times taller than wide), not trim an ordinary tall
   photo down to a thumbnail. Centered (auto side margins) since a
   height-capped image is then narrower than the column, unlike the normal
   full-width case where auto and 0 look identical. */
.post-body img { max-width: 100%; max-height: 850px; border-radius: 9px; display: block; margin: 1.2rem auto; }
.post-body blockquote {
  margin: 0 0 1.1rem; padding: .2rem 1rem; border-left: 3px solid var(--red-line); color: var(--muted);
}
.post-body pre {
  background: var(--alt); border: 1px solid var(--line); border-radius: 9px;
  padding: .9rem 1rem; overflow-x: auto; margin: 0 0 1.1rem; font-size: .85rem;
}
.post-body code { font-size: .875em; }
.post-body pre code { background: none; border: 0; padding: 0; }

@media (max-width: 860px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .blog-sidebar .sidebar-panel { flex: 1 1 240px; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .editor-sidebar .sidebar-panel { flex: 1 1 240px; }
  textarea.editor-body-input { min-height: 320px; }
}

@media (max-width: 720px) {
  .post-feature { grid-template-columns: 1fr; }
  .post-feature-cover { aspect-ratio: 16 / 9; }
  .post-feature-body { padding: 1.4rem; }
  .post-feature.no-cover .post-feature-body { padding: 1.4rem; }
  .blog-sidebar { flex-direction: column; }
}

@media (max-width: 560px) {
  .toybox-head { align-items: flex-start; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .select { width: 100%; }
}

@media (min-width: 561px) {
  .modal-overlay { align-items: center; }
}

/* ---------- guided tour ---------- */

.tour-backdrop { position: fixed; inset: 0; z-index: 300; background: rgba(23, 22, 26, .55); }
.tour-highlight {
  position: fixed; z-index: 301; pointer-events: none;
  border-radius: 12px;
  box-shadow: 0 0 0 3px var(--red), 0 0 24px rgba(216, 35, 42, .5);
  transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease;
}
.tour-tooltip {
  position: fixed; z-index: 302; max-width: 320px; width: calc(100% - 24px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem;
}
.tour-tooltip.tour-tooltip-centered { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tour-eyebrow {
  text-transform: uppercase; letter-spacing: .07em; font-size: .68rem;
  font-weight: 700; color: var(--red); margin: 0 0 .4rem;
}
.tour-title { font-size: 1rem; margin: 0 0 .4rem; }
.tour-body { font-size: .875rem; color: var(--muted); margin: 0 0 1rem; }
.tour-actions { display: flex; align-items: center; gap: .5rem; }
.tour-actions-spacer { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  .tour-highlight { transition: none; }
}

/* ---------- angel tree ---------- */

.angel-family.is-taken { opacity: .65; }
.angel-family.is-mine { border-color: var(--red-line); background: var(--red-tint); }
.angel-family-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.angel-family-head h2 { margin: 0 0 .2rem; }
.angel-family-meta { margin: 0; }
.angel-family-action { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.angel-family-notes { font-size: .9rem; margin: 1rem 0 0; }

.angel-children {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.3rem; margin-top: 1.4rem;
}
.angel-child { border-top: 1px solid var(--line); padding-top: 1rem; }
.angel-child-label { font-size: 1rem; margin: 0 0 .3rem; }
.angel-child-meta { font-weight: 400; font-size: .85rem; }
.angel-child-notes { font-size: .875rem; margin: 0 0 .7rem; }

.wish-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.wish-item {
  display: flex; align-items: center; gap: .8rem;
  border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem;
}
.wish-photo { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--alt); }
.wish-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wish-body { flex: 1; min-width: 0; }
.wish-name { font-weight: 600; margin: 0; }
.wish-name a { color: inherit; }
.wish-description { margin: .15rem 0 0; }

.wish-manage-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.wish-manage-row {
  display: flex; align-items: flex-start; gap: .8rem;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem;
}
.wish-manage-row form.stack { flex: 1; }
.wish-manage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.wish-manage-status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.child-manage-list { display: flex; flex-direction: column; gap: 1.2rem; margin-bottom: 1.5rem; }
.child-manage-row {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem;
  display: flex; flex-direction: column; gap: .8rem;
}
.child-manage-row > form.stack { width: 100%; }
.child-gifts { border-top: 1px solid var(--line); padding-top: .8rem; }
/* The disclosure triangle looks odd next to .btn's padding/border -- hiding
   it keeps "Gifts (n)" reading as a plain toggle button instead. */
.child-gifts > summary.btn { list-style: none; cursor: pointer; }
.child-gifts > summary.btn::-webkit-details-marker { display: none; }
.child-gifts[open] > summary.btn { margin-bottom: .8rem; }
.child-gifts .wish-manage-list,
.child-gifts > form.stack { margin-top: .8rem; }

.share-link-row input {
  width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem;
  background: var(--alt); cursor: text;
}

.org-directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.3rem; }
.org-directory-card { text-decoration: none; color: inherit; display: block; transition: box-shadow .15s, transform .15s; }
.org-directory-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.org-directory-card h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.org-directory-cta { color: var(--red); font-weight: 600; font-size: .9rem; }
