/* The sidebar and the mobile sheet. Self-contained: it carries its own copy
   of the site's tokens so the React homepage, which does not load syb.css,
   can use it too. Kept in step with syb.css and src/home/theme.js by hand. */

.syb-side, .syb-sheet, .side-layout, .cs-modal, .linkish {
  --sb-bg: #fff6fa; --sb-paper: #ffffff; --sb-text: #2f1f2e; --sb-text2: #6b5570;
  --sb-divider: #f3d3e2; --sb-primary: #ff4d8d; --sb-on-primary: #ffffff; --sb-tint: #fff0f6;
  --sb-shadow: 0 1px 2px rgba(47,31,46,.06), 0 8px 24px rgba(47,31,46,.07);
  --sb-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sb-display: "Bricolage Grotesque", Verdana, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .syb-side, :root:not([data-theme="light"]) .syb-sheet {
    --sb-bg: #1c1420; --sb-paper: #2a1f2e; --sb-text: #fbf2f7; --sb-text2: #c9b6c6;
    --sb-divider: #4d3a4d; --sb-primary: #ff7ab0; --sb-on-primary: #1c1420; --sb-tint: #33263a;
    --sb-shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] .syb-side, :root[data-theme="dark"] .syb-sheet {
  --sb-bg: #1c1420; --sb-paper: #2a1f2e; --sb-text: #fbf2f7; --sb-text2: #c9b6c6;
  --sb-divider: #4d3a4d; --sb-primary: #ff7ab0; --sb-on-primary: #1c1420; --sb-tint: #33263a;
  --sb-shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.35);
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout: hidden below 1024, a sticky column above ---------- */
.syb-side { display: none; }
@media (min-width: 1024px) {
  .side-layout { display: flex; align-items: flex-start; gap: 20px; }
  .side-layout > .side-main { flex: 1 1 auto; min-width: 0; }
  .syb-side {
    display: block; flex: 0 0 260px; width: 260px;
    position: sticky; top: 68px; max-height: calc(100vh - 80px); overflow-y: auto;
    padding: 4px 4px 16px 16px; box-sizing: border-box;
    font-family: var(--sb-sans); color: var(--sb-text); font-size: 14px; line-height: 1.45;
    scrollbar-width: thin;
  }
  /* the header heart gives way to the sidebar, on pages that have one */
  body:has(#syb-sidebar) [data-open-sheet] { display: none !important; }
}

/* ---------- pieces ---------- */
.syb-side h2, .syb-sheet h2 { font: 800 15px/1.2 var(--sb-display); margin: 0; color: var(--sb-text); letter-spacing: -.01em; }
.sb-sec { margin: 18px 0 0; }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sb-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--sb-primary);
  color: var(--sb-on-primary); font: 700 11px/20px var(--sb-sans); text-align: center; vertical-align: 2px; }
.sb-link { background: none; border: 0; padding: 8px 4px; min-height: 44px; display: inline-flex; align-items: center;
  font: 600 13px var(--sb-sans); color: var(--sb-primary); cursor: pointer; text-decoration: none; }
.sb-link:hover { text-decoration: underline; }
.sb-list, .sb-nav { list-style: none; margin: 0; padding: 0; }
.sb-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 6px; border-radius: 12px;
  color: var(--sb-text); text-decoration: none; }
.sb-row:hover { background: var(--sb-tint); }
.sb-row img, .sb-cart-row img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--sb-tint); flex: none; }
.sb-results .sb-row img { width: 40px; height: 40px; }
.sb-noimg { width: 48px; height: 48px; border-radius: 10px; background: var(--sb-tint); display: flex; align-items: center; justify-content: center; flex: none; }
.sb-row-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; display: block; }
.sb-row-name small { display: block; font-weight: 500; font-size: 11.5px; color: var(--sb-text2); }
.sb-row-wrap { display: flex; align-items: center; gap: 6px; }
/* A shopping row: picture beside the name, then Shop and remove on their
   own line, so the name gets the width instead of the buttons. */
.sb-cart-row { display: grid; grid-template-columns: 44px 1fr auto; grid-template-areas: "img main x" "img shop x"; column-gap: 10px; row-gap: 4px; align-items: center; }
.sb-cart-row img, .sb-cart-row .sb-noimg { grid-area: img; width: 44px; height: 44px; }
.sb-cart-row .sb-cart-main { grid-area: main; }
.sb-cart-row .sb-shop { grid-area: shop; justify-self: start; }
.sb-cart-row .sb-x { grid-area: x; }
.sb-row-wrap .sb-row { flex: 1; min-width: 0; }
.sb-x { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--sb-text2);
  font-size: 20px; cursor: pointer; }
.sb-x:hover { background: var(--sb-tint); color: var(--sb-text); }
.sb-empty { color: var(--sb-text2); font-size: 13px; margin: 0; }
.sb-fine { color: var(--sb-text2); font-size: 11.5px; line-height: 1.4; margin: 6px 0 0; }

.sb-cart-row { padding: 6px 0; border-bottom: 1px solid var(--sb-divider); }
.sb-cart-row:last-child { border-bottom: 0; }
.sb-cart-main { flex: 1; min-width: 0; }
.sb-cart-meta { display: block; font-size: 12px; color: var(--sb-text2); }
.sb-shop { min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px;
  background: var(--sb-primary); color: var(--sb-on-primary); font: 700 12.5px var(--sb-sans); text-decoration: none; }
.sb-total { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 0 0; padding-top: 8px;
  border-top: 1px solid var(--sb-divider); font-size: 14px; }
.sb-total strong { font-family: var(--sb-display); font-size: 17px; }
.sb-save summary { list-style: none; cursor: pointer; }
.sb-save summary::-webkit-details-marker { display: none; }
.sb-save-row { display: flex; gap: 6px; margin-top: 6px; }
.sb-save-row input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--sb-divider);
  border-radius: 999px; background: var(--sb-paper); color: var(--sb-text); font: 500 14px var(--sb-sans); }
.sb-btn { min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--sb-primary);
  color: var(--sb-on-primary); font: 700 13px var(--sb-sans); cursor: pointer; }

.sb-browse summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; list-style: none; }
.sb-browse summary::-webkit-details-marker { display: none; }
.sb-browse summary::after { content: "▾"; margin-left: auto; color: var(--sb-text2); transition: transform .15s; }
.sb-browse[open] summary::after { transform: rotate(180deg); }
.sb-nav a { display: flex; align-items: center; min-height: 44px; padding: 0 8px; border-radius: 10px;
  color: var(--sb-text); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.sb-nav a:hover { background: var(--sb-tint); }

/* ---------- search ---------- */
.sb-search { position: relative; margin-top: 10px; }
.sb-search input {
  width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--sb-divider); border-radius: 999px; background: var(--sb-paper); color: var(--sb-text);
  font: 500 14px var(--sb-sans); box-shadow: 0 1px 2px rgba(47,31,46,.05);
}
.sb-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; margin: 0; padding: 6px;
  list-style: none; background: var(--sb-paper); border-radius: 16px; box-shadow: var(--sb-shadow); max-height: 60vh; overflow-y: auto; }
.sb-results li.is-active .sb-row, .sb-results li[aria-selected="true"] .sb-row { background: var(--sb-tint); }
.sb-none { padding: 10px 12px; color: var(--sb-text2); font-size: 13px; }

.syb-side :where(a, button, input, summary):focus-visible, .syb-sheet :where(a, button, input, summary):focus-visible {
  outline: 3px solid var(--sb-primary); outline-offset: 2px; border-radius: 10px;
}

/* ---------- the mobile sheet ---------- */
.syb-sheet { position: fixed; inset: 0; z-index: 80; background: var(--sb-bg); color: var(--sb-text);
  font-family: var(--sb-sans); overflow-y: auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom));
  padding-top: env(safe-area-inset-top); }
.syb-sheet[hidden] { display: none; }
.sheet-top { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; background: var(--sb-bg); border-bottom: 1px solid var(--sb-divider); font-family: var(--sb-display); font-size: 18px; }
.sheet-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--sb-tint); color: var(--sb-text); font-size: 22px; cursor: pointer; }
body.sheet-open { overflow: hidden; }
.sb-heart { position: relative; }
.sb-heart [data-sb-count] { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--sb-primary, #ff4d8d); color: #fff; font: 700 10px/16px var(--sb-sans); text-align: center; }
.sb-heart [data-sb-count][hidden] { display: none; }

/* the full /saved/ page uses the same rows, a little larger */
#saved-page .sb-sec { max-width: 560px; }
#saved-page h2 { font-size: 20px; }

/* ---------- link-style buttons and the coming-soon modal ----------
   Shared by every page, the homepage included, so they live here. */
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--sb-primary); cursor: pointer;
  text-decoration: underline; min-height: 44px; display: inline-flex; align-items: center; text-align: left; }
.cs-pill { display: inline-block; vertical-align: middle; font: 700 11px/1 var(--sb-sans); letter-spacing: .04em; text-transform: uppercase;
  background: #fde68a; color: #2f1f2e; border-radius: 999px; padding: 5px 9px; margin-left: 6px; }
.cs-modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px;
  font-family: var(--sb-sans); }
.cs-modal[hidden] { display: none; }
.cs-backdrop { position: absolute; inset: 0; background: rgba(28, 20, 32, .45); }
.cs-box { position: relative; width: 100%; max-width: 440px; background: var(--sb-paper); color: var(--sb-text);
  border-radius: 22px; box-shadow: var(--sb-shadow); padding: 22px 22px 18px; }
.cs-box h2 { font: 800 22px/1.15 var(--sb-display); margin: 0 0 8px; padding-right: 44px; letter-spacing: -.02em; }
.cs-box p { margin: 0 0 12px; line-height: 1.5; }
.cs-box .small { font-size: 12.5px; }
.cs-box .muted { color: var(--sb-text2); }
.cs-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--sb-tint); color: var(--sb-text); font-size: 22px; cursor: pointer; }
.cs-box label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.cs-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cs-row input { flex: 1 1 180px; min-height: 48px; padding: 10px 16px; font: 500 16px/1.2 var(--sb-sans);
  border: 1px solid var(--sb-divider); border-radius: 999px; background: var(--sb-bg); color: var(--sb-text); }
.cs-row .btn, .cs-box .btn-primary { min-height: 48px; padding: 10px 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--sb-primary); color: var(--sb-on-primary); font: 700 15px var(--sb-sans); }
.cs-modal :where(button, input):focus-visible { outline: 3px solid var(--sb-primary); outline-offset: 2px; border-radius: 10px; }
body.cs-open { overflow: hidden; }

/* ---------- named lists, the "keep it in a list" popover, Bags for… ---------- */
.sb-named { border: 1px solid var(--sb-divider); border-radius: 12px; padding: 0 10px; margin: 8px 0; }
.sb-named > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; cursor: pointer;
  font: 700 14px/1.3 var(--sb-sans); color: var(--sb-text); }
.sb-named > summary::-webkit-details-marker { display: none; }
.sb-named > summary::before { content: "▸"; margin-right: 6px; color: var(--sb-text2); font-size: 12px; }
.sb-named[open] > summary::before { content: "▾"; }
.sb-named-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-badge-soft { background: var(--sb-tint); color: var(--sb-text); }
.sb-named-tools { display: flex; gap: 12px; padding: 2px 0 8px; }
.sb-newlist { margin-top: 8px; }
.sb-pick { font-size: 15px; }
.sb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--sb-divider);
  background: var(--sb-paper); color: var(--sb-text); font: 600 13px/1.2 var(--sb-sans); text-decoration: none; cursor: pointer; }
.sb-chip[aria-pressed="true"] { background: var(--sb-primary); color: var(--sb-on-primary); border-color: transparent; }
.sb-h-link { color: inherit; text-decoration: none; }
.sb-h-link:hover { text-decoration: underline; }
.sb-pop { position: absolute; z-index: 90; background: var(--sb-paper, #fff); color: var(--sb-text, #2b2730); border: 1px solid var(--sb-divider, #eadfe6);
  border-radius: 14px; box-shadow: var(--sb-shadow, 0 8px 24px rgba(0,0,0,.12)); padding: 12px 14px; font-family: var(--sb-sans, system-ui, sans-serif); }
.sb-pop[hidden] { display: none; }
.sb-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.sb-pop .sb-fine { margin: 4px 0 8px; }
.sb-pop .sb-chips { margin-bottom: 8px; }
.sb-pop .sb-newlist { margin-top: 4px; }
