:root {
  --bg: #f7f4ef;
  --surface: #fffdf9;
  --text: #241f1b;
  --muted: #726a62;
  --line: #e8e1d8;
  --accent: #7b5d48;
  --accent-soft: #ece0d4;
  --success: #426b57;
  --danger: #9a5b55;
  --shadow: 0 16px 40px rgba(61, 45, 33, .08);
  --radius: 24px;
}

[data-theme="dark"] {
  --bg: #171514;
  --surface: #211e1c;
  --text: #f6f0e9;
  --muted: #b7ada3;
  --line: #38322e;
  --accent: #d4ae92;
  --accent-soft: #3a2e27;
  --success: #82b596;
  --danger: #d88f86;
  --shadow: 0 18px 44px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

#header-root, #footer-root { width: 100%; }
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; padding: 0 4vw;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: var(--bg); }
.site-context-title { position: absolute; left: 50%; transform: translateX(-50%); font-size: .92rem; letter-spacing: .02em; }
.local-data-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: end; margin-top: 28px; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.local-data-card h2 { margin: 6px 0 8px; }
.local-data-card p:last-child { max-width: 620px; margin: 0; color: var(--muted); }
.local-data-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.danger-button { color: #a33b3b; }
.desktop-nav { display: flex; gap: 8px; }
.desktop-nav a { padding: 10px 14px; color: var(--muted); border-radius: 999px; }
.desktop-nav a.active { color: var(--text); background: var(--accent-soft); }
.icon-button { border: 1px solid var(--line); background: var(--surface); color: var(--text); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }

.page { width: min(1180px, 92vw); margin: 0 auto; padding: 56px 0 100px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 4.5rem); line-height: .98; letter-spacing: -.05em; }
h2 { margin: 0; font-size: clamp(1.4rem, 2.8vw, 2.2rem); letter-spacing: -.03em; }
p { line-height: 1.65; }
.hero-copy { max-width: 740px; }
.hero-copy > p:last-child { color: var(--muted); max-width: 660px; }

.button { border: 0; border-radius: 999px; padding: 13px 18px; cursor: pointer; background: var(--text); color: var(--bg); font-weight: 700; }
.button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.button.ghost { background: transparent; color: var(--muted); }
.button.danger { background: var(--danger); color: white; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.toolbar-end { justify-content: flex-end; }
.toolbar-group { display: flex; flex-wrap: wrap; gap: 10px; }
select, input, textarea { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 14px; padding: 12px 14px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.optional { color: var(--muted); font-size: .76rem; font-weight: 400; }

.stats-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.stat strong { display: block; font-size: 1.5rem; margin-bottom: 4px; }
.stat span { color: var(--muted); font-size: .9rem; }

.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.product-grid.list { grid-template-columns: 1fr; }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; cursor: pointer; }
.product-card:hover { transform: translateY(-3px); }
.product-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.product-card-body { padding: 18px; }
.product-card h3 { margin: 0 0 7px; font-size: 1.05rem; }
.product-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.price-row { display: flex; gap: 8px; align-items: baseline; margin: 12px 0; }
.price { font-weight: 800; font-size: 1.25rem; }
.original-price { color: var(--muted); text-decoration: line-through; font-size: .88rem; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; color: var(--muted); margin-top: 14px; }
.product-grid.list .product-card { display: grid; grid-template-columns: 180px 1fr; }
.product-grid.list .product-card img { height: 100%; aspect-ratio: auto; }

.segmented { display: inline-flex; background: var(--accent-soft); padding: 4px; border-radius: 999px; }
.segmented button { border: 0; background: transparent; color: var(--muted); padding: 10px 16px; border-radius: 999px; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 3px 10px rgba(0,0,0,.06); }

.modal { position: fixed; inset: 0; background: rgba(20, 16, 13, .45); display: none; place-items: center; z-index: 80; padding: 20px; }
.modal.open { display: grid; }
.modal-card { width: min(680px, 96vw); max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 28px; padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal-card img { width: 100%; max-height: 340px; object-fit: cover; border-radius: 20px; }
.modal-card h2 { margin-top: 14px; }
.modal-card > h2 + .form-grid,
.modal-card > h2 + form { margin-top: 22px; }
#editContent > .eyebrow,
#historyDetailContent > .eyebrow { display: none; }
#editContent > .eyebrow + h2::before,
#historyDetailContent > .eyebrow + h2::before { content: 'Edit '; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.close { float: right; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: grid; gap: 7px; color: var(--muted); font-size: .9rem; }
.form-grid .full { grid-column: 1 / -1; }
.compact-note textarea { min-height: 68px; resize: vertical; }
.product-link { display: inline-flex; margin: 2px 0 12px; color: var(--accent); font-weight: 700; }
.detail-note { margin-top: 12px; padding: 14px 16px; background: var(--accent-soft); border-radius: 16px; }
.detail-note span { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.detail-note p { margin: 4px 0 0; }
.detail-meta { color: var(--muted); font-size: .9rem; }

.history-card { display: grid; grid-template-columns: 150px 1fr auto; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 14px; margin-bottom: 14px; }
.history-card img { width: 150px; height: 120px; object-fit: cover; border-radius: 16px; }
.stars button { border: 0; background: transparent; font-size: 1.4rem; cursor: pointer; color: var(--line); }
.stars span, .stars button { color: var(--line); font-size: 1.35rem; }
.stars span.on, .stars button.on { color: #c79133; }
.history-list { display: grid; gap: 14px; }
.history-row { display: grid; grid-template-columns: 180px 1fr; min-height: 152px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.history-row:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.history-row > img { width: 180px; height: 100%; object-fit: cover; }
.history-row-main { display: grid; gap: 12px; padding: 18px 20px; }
.history-row-heading, .history-row-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.history-row h3 { margin: 7px 0 0; }
.history-journey { display: flex; flex-wrap: wrap; gap: 8px; }
.history-journey span { padding: 7px 10px; border-radius: 10px; background: var(--bg); color: var(--muted); font-size: .82rem; }
.history-journey strong { color: var(--text); }
.history-row-footer { color: var(--muted); font-size: .82rem; }
.outcome-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.outcome-pill.letGo { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.saved-label { color: var(--success) !important; font-weight: 700; }
.floating-add { position: fixed; right: 32px; bottom: 32px; z-index: 45; width: 60px; height: 60px; border: 0; border-radius: 50%; background: var(--text); color: var(--bg); font-size: 2rem; line-height: 1; cursor: pointer; box-shadow: 0 12px 32px rgba(0,0,0,.22); transition: transform .2s ease; }
.floating-add:hover { transform: translateY(-3px) scale(1.03); }
.rating-field { margin: 0; padding: 0; border: 0; }
.rating-field legend { color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.rating-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
.rating-input input { position: absolute; opacity: 0; pointer-events: none; }
.rating-input label { display: block; color: var(--line); font-size: 1.9rem; cursor: pointer; }
.rating-input label:hover, .rating-input label:hover ~ label, .rating-input input:checked ~ label { color: #c79133; }

.memory-shell { display: grid; place-items: center; min-height: 620px; }
.memory-card { width: min(440px, 92vw); background: var(--surface); border: 1px solid var(--line); border-radius: 30px; padding: 18px; box-shadow: var(--shadow); }
.memory-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 22px; }
.memory-card h2 { margin-top: 18px; }
.memory-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.memory-actions button { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 14px 8px; border-radius: 16px; cursor: pointer; }
.memory-actions .want { background: var(--accent-soft); }
.progress-dots { display: flex; justify-content: center; gap: 6px; margin-top: 18px; }
.progress-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.progress-dots span.active { background: var(--accent); }

.goal-card { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 30px; padding: 28px; box-shadow: var(--shadow); }
.goal-visual { min-height: 320px; border-radius: 24px; background: linear-gradient(145deg, var(--accent-soft), var(--surface)); display: grid; place-items: center; padding: 28px; text-align: center; }
.progress-track { height: 16px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 18px 0 8px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: inherit; }

.settings-list { display: grid; gap: 14px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.setting-row p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.toggle { width: 52px; height: 30px; border-radius: 999px; border: 0; background: var(--line); padding: 3px; cursor: pointer; }
.toggle::after { content: ''; display: block; width: 24px; height: 24px; background: var(--surface); border-radius: 50%; transition: transform .2s ease; }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(22px); }

.site-footer { border-top: 1px solid var(--line); padding: 36px 4vw 96px; display: flex; justify-content: space-between; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.mobile-nav { display: none; }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--text); color: var(--bg); padding: 13px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s ease; z-index: 100; }
.toast.show { opacity: 1; transform: translateY(0); }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goal-card { grid-template-columns: 1fr; }
  .desktop-nav { display: none; }
}

@media (max-width: 640px) {
  .page { width: min(94vw, 560px); padding: 32px 0 110px; }
  .hero { align-items: stretch; flex-direction: column; }
  h1 { font-size: 2.65rem; }
  .stats-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .stat { min-width: 0; padding: 11px 8px; border-radius: 14px; text-align: center; }
  .stat strong { font-size: 1.05rem; margin-bottom: 3px; white-space: nowrap; }
  .stat span { display: block; font-size: .68rem; line-height: 1.25; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-grid.list { grid-template-columns: 1fr; }
  .product-grid:not(.list) .product-card { border-radius: 18px; }
  .product-grid:not(.list) .product-card-body { padding: 11px; }
  .product-grid:not(.list) .product-card h3 { font-size: .92rem; }
  .product-grid:not(.list) .price { font-size: 1.02rem; }
  .product-grid:not(.list) .price-row { margin: 8px 0; }
  .product-grid:not(.list) .card-meta { flex-direction: column; gap: 3px; margin-top: 8px; font-size: .7rem; }
  .product-grid.list .product-card { grid-template-columns: 110px 1fr; }
  .product-grid.list .product-card img { min-height: 132px; }
  .product-grid.list .product-card-body { padding: 14px; }
  .product-grid.list .card-meta { flex-direction: column; margin-top: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .history-row { grid-template-columns: 100px 1fr; min-height: 150px; }
  .history-row > img { width: 100px; }
  .history-row-main { padding: 13px; gap: 9px; }
  .history-row-heading { align-items: flex-start; }
  .history-row-heading .price { font-size: 1rem; }
  .history-journey { gap: 5px; }
  .history-journey span { padding: 5px 7px; font-size: .72rem; }
  .history-row-footer { align-items: flex-end; flex-direction: column; }
  .site-footer { display: none; }
  .local-data-card { grid-template-columns: 1fr; padding: 20px; }
  .local-data-actions { justify-content: stretch; }
  .local-data-actions .button { flex: 1 1 100%; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(18px); border-top: 1px solid var(--line); padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); }
  .mobile-nav a { display: grid; place-items: center; gap: 3px; color: var(--muted); font-size: .68rem; }
  .mobile-nav a span { font-size: 1.15rem; }
  .mobile-nav a.active { color: var(--accent); font-weight: 700; }
  .toast { left: 16px; right: 16px; bottom: 86px; text-align: center; }
  .floating-add { right: 20px; bottom: 88px; }
}

/* Version two: mobile-first three-view workspace */
.v2-app { background: var(--bg); transition: background-color .35s ease, color .35s ease; }
.v2-shell { width: min(1080px, 100%); margin: 0 auto; padding: 0 22px 140px; }
.v2-header { position: sticky; top: 0; z-index: 35; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 12px; padding: 18px 0 12px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(22px); }
.v2-brand span, .v2-theme { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; }
.v2-brand span { background: var(--text); color: var(--bg); font-weight: 800; }
.v2-theme { border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.v2-tabs { display: flex; justify-content: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.v2-tabs::-webkit-scrollbar { display: none; }
.v2-tab { position: relative; border: 0; padding: 10px 13px; background: transparent; color: var(--muted); font-weight: 750; cursor: pointer; white-space: nowrap; }
.v2-tab::after { content: ''; position: absolute; left: 25%; right: 25%; bottom: 2px; height: 3px; border-radius: 999px; background: transparent; }
.v2-tab.active { color: var(--text); }
.v2-tab.active::after { background: var(--text); }
.v2-panel { display: none; animation: panelIn .22s ease; }
.v2-panel.active { display: block; }
@keyframes panelIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
.v2-page-heading { padding: 42px 0 26px; }
.v2-page-heading h1 { max-width: 760px; font-size: clamp(2.6rem, 8vw, 5.2rem); }
.v2-page-heading.compact-heading { padding: 36px 0 18px; }
.v2-page-heading.compact-heading .eyebrow { margin: 0; font-size: .78rem; }
.v2-page-heading.minimal-page-heading { padding: 38px 0 20px; }
.v2-page-heading.minimal-page-heading h1 { margin: 0; font-size: .9rem; font-weight: 800; letter-spacing: .13em; line-height: 1.2; text-transform: uppercase; }
.minimal-page-heading.heading-with-action { align-items: center; }
.heading-with-action { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.context-add-button,
.collection-context-add {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  color: var(--text);
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(22,18,15,.12), inset 0 1px rgba(255,255,255,.2);
  backdrop-filter: blur(20px) saturate(145%);
  transition: transform .2s ease, box-shadow .2s ease;
}
.context-add-button:hover,
.collection-context-add:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 34px rgba(22,18,15,.17); }
.context-add-button.primary { width: 56px; height: 56px; border-color: transparent; background: var(--text); color: var(--bg); }

.journey-card { display: grid; grid-template-columns: 1.2fr 1fr; min-height: 260px; padding: 30px; overflow: hidden; border-radius: 32px; background: linear-gradient(140deg, #7d74e8, #b99dde); color: white; box-shadow: 0 22px 55px rgba(92, 75, 175, .22); }
.journey-card > div:first-child { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; }
.journey-kicker { font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 750; opacity: .85; }
.journey-card > div:first-child strong { font-size: clamp(4rem, 12vw, 7rem); line-height: .85; }
.journey-card span { opacity: .82; }
.journey-metrics { display: grid; align-content: center; gap: 22px; }
.journey-metrics p { margin: 0; }
.journey-metrics strong, .journey-metrics span { display: block; }
.journey-metrics strong { font-size: 2rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 48px 0 18px; }
.section-heading > h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); }
.collection-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.collection-preview { display: grid; gap: 11px; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.collection-collage { display: grid; grid-template-columns: 1.2fr .8fr; grid-template-rows: 1fr 1fr; height: 220px; overflow: hidden; border-radius: 24px; background: var(--line); gap: 2px; }
.collection-collage img { width: 100%; height: 100%; object-fit: cover; }
.collection-collage img:first-child { grid-row: 1 / 3; }
.collection-empty { display: grid; grid-column: 1 / -1; grid-row: 1 / -1; place-items: center; font-size: 2rem; }
.collection-preview-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 4px; }
.collection-preview-meta strong { font-size: 1.05rem; }
.collection-preview-meta small { color: var(--muted); }

.v2-search { display: flex; align-items: center; gap: 10px; padding: 0 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.v2-search span { font-size: 1.7rem; color: var(--muted); transform: rotate(-20deg); }
.v2-search input { width: 100%; padding: 15px 0; border: 0; background: transparent; box-shadow: none !important; }
.v2-filterbar { display: flex; gap: 9px; margin: 14px 0 22px; overflow-x: auto; scrollbar-width: none; }
.v2-filterbar::-webkit-scrollbar { display: none; }
.v2-filterbar select { min-width: max-content; border-radius: 14px; }
.view-switch { display: flex; flex: 0 0 auto; padding: 4px; border-radius: 14px; background: var(--line); }
.view-switch button { width: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.view-switch button.active { background: var(--surface); color: var(--text); box-shadow: 0 3px 10px rgba(0,0,0,.06); }
.v2-wish-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.v2-wish-grid.list { grid-template-columns: 1fr; }
.product-image-wrap { position: relative; min-width: 0; }
.product-image-wrap > img { height: 100%; }
.favorite-badge { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.9); color: #ad5b70; box-shadow: 0 5px 16px rgba(0,0,0,.12); }
.collection-label { display: inline-block; margin-bottom: 6px; color: var(--accent); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.empty-state { grid-column: 1 / -1; padding: 80px 20px; text-align: center; color: var(--muted); }
.empty-state span { font-size: 2rem; }
.empty-state h3 { margin: 12px 0 4px; color: var(--text); }
.empty-state p { margin: 0; }
.detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.detail-heading h2 { margin-top: 0; }
.detail-favorite { flex: 0 0 auto; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 1.55rem; cursor: pointer; }
.detail-favorite.on { background: #f7e7eb; color: #ad5b70; border-color: transparent; }
.favorite-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; justify-content: start; }
.favorite-check input { width: 18px; height: 18px; }

.saved-card { padding: 30px 32px; border-radius: 32px; background: #173d34; color: #f4f7ed; }
.saved-card > span { opacity: .72; }
.saved-card > strong { display: block; margin: 12px 0 0; font-size: clamp(4rem, 12vw, 7rem); line-height: 1; letter-spacing: -.07em; }
.saved-card p { max-width: 520px; margin: 0; opacity: .72; }
.ultimate-buckets-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 34px 2px 14px; }
.ultimate-buckets-heading h2 { font-size: 1.45rem; }
.ultimate-buckets-heading span { color: var(--muted); font-size: .82rem; }
.ultimate-bucket-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ultimate-bucket-card { display: flex; flex-direction: column; min-height: 260px; padding: 22px; border: 1px solid var(--line); border-radius: 25px; background: var(--surface); box-shadow: var(--shadow); }
.bucket-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bucket-card-heading h2 { margin-top: 5px; font-size: 1.35rem; }
.bucket-card-heading > strong { font-size: 1.05rem; }
.bucket-type { color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ultimate-bucket-card > p { margin: 10px 0 4px; color: var(--muted); font-size: .9rem; }
.ultimate-bucket-card .progress-track { margin-top: auto; }
.bucket-balance { display: flex; align-items: baseline; gap: 7px; margin-top: auto; }
.bucket-balance strong { font-size: 2.25rem; letter-spacing: -.04em; }
.bucket-balance span { color: var(--muted); font-size: .8rem; }
.bucket-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.bucket-actions .button { padding: 10px 14px; }
.v2-goal-card { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: center; margin-top: 22px; padding: 32px; border: 1px solid var(--line); border-radius: 32px; background: var(--surface); box-shadow: var(--shadow); }
.goal-orbit { display: grid; place-items: center; width: 190px; height: 190px; border-radius: 50%; background: conic-gradient(var(--accent) 36%, var(--accent-soft) 0); }
.goal-orbit::before { content: ''; grid-area: 1 / 1; width: 145px; height: 145px; border-radius: 50%; background: var(--surface); }
.goal-orbit span { grid-area: 1 / 1; z-index: 1; font-size: 2rem; font-weight: 800; }
.goal-values { display: flex; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: .86rem; }
.goal-values strong { color: var(--text); }
.goal-save-button { margin-top: 18px; }
.savings-modal-card { width: min(460px, 94vw); }
.add-wish-card { width: min(680px, 94vw); }
.product-fetch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.product-fetch-actions .button { padding: 11px 15px; }
#productFetchStatus { flex: 1 1 100%; min-height: 1.2em; color: var(--muted); font-size: .84rem; }
#productFetchStatus.error { color: #a33b3b; }
.product-fetch-preview { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.product-fetch-preview img { width: 92px; height: 92px; border-radius: 15px; object-fit: cover; background: var(--line); }
.product-fetch-preview span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .74rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.product-fetch-preview strong { display: block; line-height: 1.25; }
.add-item-fields > .form-grid { margin: 0; }

.bubble-nav { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 55; display: flex; align-items: end; gap: 9px; padding: 8px; transform: translateX(-50%); border-radius: 28px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(24px); box-shadow: 0 16px 45px rgba(28, 24, 20, .18); }
.bubble-nav-item { display: grid; place-items: center; align-content: center; width: 72px; height: 66px; border: 0; border-radius: 22px; background: var(--surface); color: var(--muted); cursor: pointer; box-shadow: 0 5px 16px rgba(0,0,0,.05); }
.bubble-nav-item > span { font-size: 1.45rem; line-height: 1; }
.bubble-nav-item small { margin-top: 5px; font-size: .66rem; font-weight: 750; }
.bubble-nav-item.active { color: var(--accent); }
.bubble-nav-item.add-bubble { width: 64px; height: 64px; border-radius: 50%; background: var(--text); color: var(--bg); }
.bubble-nav-item.add-bubble span { font-size: 2rem; transition: transform .2s ease; }
.quick-add-menu.open + .bubble-nav .add-bubble span { transform: rotate(45deg); }
.quick-add-menu { position: fixed; left: 50%; bottom: 104px; z-index: 54; display: grid; gap: 8px; width: min(280px, calc(100vw - 36px)); padding: 10px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 20px 50px rgba(0,0,0,.2); transition: .2s ease; }
.quick-add-menu.open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.quick-add-menu button, .quick-add-menu a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 0; border-radius: 14px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.quick-add-menu button:hover, .quick-add-menu a:hover { background: var(--accent-soft); }
.quick-add-menu span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--bg); }
.collection-sheet { width: min(900px, 96vw); }
.collection-hero { padding: 24px 4px 28px; }
.collection-hero h2 { font-size: clamp(2rem, 6vw, 4rem); }
.collection-hero p { max-width: 620px; color: var(--muted); }
.collection-hero > span { color: var(--accent); font-weight: 700; }
.collection-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.page-topbar { display: flex; align-items: center; min-height: 48px; margin-bottom: 24px; }
.page-back { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; background: color-mix(in srgb, var(--surface) 84%, transparent); color: var(--text); font-size: 1.25rem; box-shadow: 0 10px 28px rgba(20,16,13,.08); backdrop-filter: blur(20px); }
.compact-page-hero { margin-bottom: 24px; }
.compact-page-hero h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
.compact-page-hero .hero-copy > p:last-child { margin-bottom: 0; }
.shared-bubble-nav { z-index: 90; }
body:not(.v2-app) { padding-bottom: 96px; }

@media (max-width: 720px) {
  .v2-shell { padding: 0 14px 130px; }
  .v2-header { grid-template-columns: 38px 1fr 38px; padding-top: 12px; }
  .v2-brand span, .v2-theme { width: 38px; height: 38px; }
  .v2-tab { padding-inline: 10px; font-size: .87rem; }
  .v2-page-heading { padding: 30px 3px 20px; }
  .v2-page-heading.compact-heading { padding: 24px 3px 14px; }
  .v2-page-heading h1 { font-size: 2.65rem; }
  .heading-with-action { align-items: center; }
  .context-add-button.primary { width: 50px; height: 50px; }
  .journey-card { min-height: 200px; padding: 22px; border-radius: 26px; }
  .journey-card > div:first-child strong { font-size: 4rem; }
  .journey-metrics { gap: 12px; }
  .journey-metrics strong { font-size: 1.45rem; }
  .journey-card span { font-size: .76rem; }
  .section-heading { margin-top: 34px; }
  .section-heading > h2 { font-size: 1.55rem; }
  .collection-list { grid-template-columns: 1fr; gap: 22px; }
  .collection-collage { height: 210px; }
  .v2-wish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .v2-wish-grid.list { grid-template-columns: 1fr; }
  .v2-filterbar select { max-width: 150px; }
  .v2-goal-card { grid-template-columns: 1fr; padding: 24px; }
  .ultimate-bucket-grid { grid-template-columns: 1fr; }
  .ultimate-bucket-card { min-height: 240px; }
  .goal-orbit { width: 145px; height: 145px; margin: 0 auto; }
  .goal-orbit::before { width: 108px; height: 108px; }
  .collection-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* V2 visual browsing: image-first Pinterest-style feed */
html { background: var(--bg); transition: background-color .35s ease; }
html[data-theme="dark"] { color-scheme: dark; background: #171514; }
.v2-app::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--accent-soft) 62%, transparent), transparent 34%),
    radial-gradient(circle at 88% 68%, color-mix(in srgb, var(--accent-soft) 38%, transparent), transparent 30%);
  opacity: .72;
  transition: opacity .35s ease;
}
[data-theme="dark"] .v2-app::before { opacity: .34; }
.v2-header,
.v2-search,
.view-switch,
.v2-filterbar select,
.bubble-nav,
.quick-add-menu,
.modal-card,
.v2-goal-card,
.collection-preview,
.saved-card,
.journey-card {
  transition: background-color .35s ease, border-color .35s ease, color .35s ease, box-shadow .35s ease;
}
.v2-search,
.v2-filterbar {
  position: relative;
  z-index: 5;
}
.v2-filterbar {
  position: sticky;
  top: 74px;
  flex-wrap: wrap;
  overflow: visible;
  padding: 10px;
  margin-inline: -10px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.v2-wish-grid:not(.list) {
  display: block;
  columns: 4;
  column-gap: 13px;
}
.v2-wish-grid:not(.list) .visual-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 13px;
  break-inside: avoid;
}
.v2-wish-grid.list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.product-grid.v2-wish-grid.list .visual-card { display: block; grid-template-columns: none; }
.visual-card {
  position: relative;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: var(--line);
  box-shadow: none;
  cursor: zoom-in;
  outline: none;
  isolation: isolate;
  opacity: 0;
  transform: translateY(24px) scale(.985);
  transition:
    opacity .55s cubic-bezier(.22,.75,.18,1) var(--reveal-delay, 0ms),
    transform .55s cubic-bezier(.22,.75,.18,1) var(--reveal-delay, 0ms),
    box-shadow .28s ease;
}
.visual-card.visible { opacity: 1; transform: translateY(0) scale(1); }
.visual-card:hover { transform: translateY(-4px) scale(1.008); box-shadow: 0 20px 44px rgba(22, 18, 15, .18); }
.visual-card:focus-visible { box-shadow: 0 0 0 4px var(--accent-soft), 0 20px 44px rgba(22, 18, 15, .18); }
.visual-card .product-image-wrap {
  position: relative;
  width: 100%;
  height: auto;
  overflow: hidden;
  background: var(--line);
}
.v2-wish-grid:not(.list) .visual-card:nth-child(6n + 1) .product-image-wrap { aspect-ratio: .76; }
.v2-wish-grid:not(.list) .visual-card:nth-child(6n + 2) .product-image-wrap { aspect-ratio: 1.04; }
.v2-wish-grid:not(.list) .visual-card:nth-child(6n + 3) .product-image-wrap { aspect-ratio: .84; }
.v2-wish-grid:not(.list) .visual-card:nth-child(6n + 4) .product-image-wrap { aspect-ratio: 1.2; }
.v2-wish-grid:not(.list) .visual-card:nth-child(6n + 5) .product-image-wrap { aspect-ratio: .7; }
.v2-wish-grid:not(.list) .visual-card:nth-child(6n + 6) .product-image-wrap { aspect-ratio: .96; }
.v2-wish-grid.list .visual-card .product-image-wrap { aspect-ratio: 2.15; }
.visual-card .product-image-wrap > img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.2,.75,.2,1), filter .35s ease;
}
.visual-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 54%, rgba(12, 10, 8, .2));
  opacity: 0;
  transition: opacity .3s ease;
}
.visual-card:hover::after { opacity: 1; }
.visual-card:hover .product-image-wrap > img { transform: scale(1.045); filter: saturate(1.04); }
.product-hover-meta {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 16px;
  background: rgba(20,18,16,.56);
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  transition: opacity .25s ease, transform .3s cubic-bezier(.2,.75,.2,1);
  pointer-events: none;
}
.product-hover-meta strong { min-width: 0; overflow: hidden; font-size: .9rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.product-hover-meta small { flex: 0 0 auto; font-size: .82rem; font-weight: 800; }
.visual-card:hover .product-hover-meta,
.visual-card:focus-visible .product-hover-meta { opacity: 1; transform: translateY(0); }
.collection-select-card.select-mode .product-hover-meta { display: none; }
.visual-card .favorite-badge,
.visual-card-glass {
  z-index: 3;
  border: 1px solid rgba(255,255,255,.36);
  background: rgba(255,255,255,.68);
  color: #6f3445;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
[data-theme="dark"] .visual-card .favorite-badge,
[data-theme="dark"] .visual-card-glass {
  border-color: rgba(255,255,255,.14);
  background: rgba(24,21,20,.62);
  color: #f0b7c6;
}
.visual-card-glass {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 999px;
  font-size: .68rem;
  letter-spacing: .08em;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .25s ease, transform .25s ease;
}
.visual-card:hover .visual-card-glass,
.visual-card:focus-visible .visual-card-glass { opacity: 1; transform: translateY(0); }
.collection-products .visual-card { opacity: 1; transform: none; }
.collection-products .visual-card .product-image-wrap { aspect-ratio: .86; }

@media (max-width: 900px) {
  .v2-wish-grid:not(.list) { columns: 3; }
}

@media (hover: none) {
  .product-hover-meta { display: none; }
}

@media (max-width: 620px) {
  .v2-filterbar { top: 63px; border-radius: 18px; }
  .v2-wish-grid:not(.list) { columns: 2; column-gap: 9px; }
  .v2-wish-grid:not(.list) .visual-card { margin-bottom: 9px; border-radius: 18px; }
  .v2-wish-grid.list .visual-card { border-radius: 20px; }
  .v2-wish-grid.list .visual-card .product-image-wrap { aspect-ratio: 1.65; }
  .visual-card-glass { opacity: .78; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .visual-card,
  .visual-card .product-image-wrap > img,
  .v2-panel {
    animation: none;
    transition: none;
  }
  .visual-card { opacity: 1; transform: none; }
}

/* Collection route, frosted filters, and floating add actions */
.collection-page { display: none; min-height: 100vh; padding: 24px 0 100px; animation: collectionIn .38s cubic-bezier(.2,.75,.18,1); }
.collection-page.active { display: block; }
@keyframes collectionIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
.collection-open .v2-header,
.collection-open .bubble-nav { opacity: 0; pointer-events: none; transform: translateY(-12px); }
.collection-open .bubble-nav { transform: translate(-50%, 18px); }
.collection-back {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(20,16,13,.1);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.collection-back span { font-size: 1.2rem; }
.collection-page-toolbar {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.collection-page-toolbar .collection-back {
  position: static;
  width: 48px;
  height: 48px;
  padding: 0;
  justify-content: center;
}
.collection-toolbar-actions { display: flex; align-items: center; gap: 10px; }
.collection-context-add { width: 48px; height: 48px; }
.collection-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 17px;
  border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(20,16,13,.1);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.collection-add-card { width: min(560px, 94vw); }
.collection-add-card > p:not(.eyebrow) { color: var(--muted); }
.collection-add-choices { display: grid; gap: 10px; margin-top: 22px; }
.collection-add-choices > button {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease;
}
.collection-add-choices > button:hover { transform: translateY(-2px); background: var(--accent-soft); }
.collection-add-choices > button > span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface); font-size: 1.35rem; }
.collection-add-choices strong,
.collection-add-choices small { display: block; }
.collection-add-choices small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.collection-page-header { max-width: 720px; padding: 58px 2px 30px; }
.collection-page-header h1 { font-size: clamp(3rem, 9vw, 6rem); }
.collection-page-header > p:not(.eyebrow) { max-width: 620px; color: var(--muted); font-size: 1.02rem; }
.collection-page-header > span { display: inline-block; margin-top: 6px; color: var(--accent); font-weight: 750; }
.collection-selection-bar { position: sticky; top: 82px; z-index: 18; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; padding: 10px 12px 10px 18px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 20px; background: color-mix(in srgb, var(--surface) 86%, transparent); box-shadow: 0 12px 30px rgba(20,16,13,.1); backdrop-filter: blur(22px); }
.collection-selection-bar > span { font-weight: 750; }
.collection-selection-bar > div { display: flex; gap: 8px; }
.collection-selection-bar .button { padding: 10px 15px; }
.collection-remove-selected { background: var(--text); color: var(--bg); }
.collection-remove-selected:disabled { opacity: .35; cursor: not-allowed; }
.collection-select-card { position: relative; }
.collection-select-card.selected { opacity: .72; transform: scale(.985); }
.collection-select-check { position: absolute; top: 12px; left: 12px; z-index: 4; display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid rgba(255,255,255,.95); border-radius: 9px; background: rgba(24,21,19,.32); color: #fff; font-size: .9rem; font-weight: 900; box-shadow: 0 4px 14px rgba(0,0,0,.16); backdrop-filter: blur(12px); }
.collection-select-card.selected .collection-select-check { background: var(--text); }
.collection-page-grid { padding-top: 8px; }

.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.frost-select { position: relative; flex: 0 0 auto; }
.frost-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text);
  font-size: .96rem;
  font-weight: 720;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255,255,255,.22), 0 8px 22px rgba(25,20,17,.06);
  backdrop-filter: blur(18px) saturate(155%);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
  transition: transform .2s ease, background-color .25s ease, border-color .25s ease;
}
.frost-select-trigger:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--surface) 84%, transparent); }
.select-chevron { font-size: 1.05rem; transition: transform .22s ease; }
.frost-select.open .select-chevron { transform: rotate(180deg); }
.frost-select-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 70;
  display: grid;
  gap: 5px;
  width: max-content;
  min-width: 190px;
  max-height: min(390px, 58vh);
  padding: 8px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-7px) scale(.97);
  transform-origin: top right;
  border: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  border-radius: 21px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow: 0 24px 60px rgba(20,16,13,.2);
  backdrop-filter: blur(28px) saturate(165%);
  -webkit-backdrop-filter: blur(28px) saturate(165%);
  transition: opacity .2s ease, transform .24s cubic-bezier(.2,.75,.18,1);
}
.frost-select.open .frost-select-menu { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.frost-select-option {
  padding: 11px 13px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-size: .94rem;
  text-align: left;
  cursor: pointer;
}
.frost-select-option:hover { background: color-mix(in srgb, var(--accent-soft) 68%, transparent); }
.frost-select-option.selected { background: var(--text); color: var(--bg); font-weight: 750; }

.quick-add-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  border: 0;
  background: rgba(12,10,9,.48);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: opacity .28s ease;
}
.quick-add-backdrop.open { opacity: 1; pointer-events: auto; }
.quick-add-menu {
  z-index: 58;
  gap: 10px;
  width: min(310px, calc(100vw - 34px));
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.quick-add-menu button,
.quick-add-menu a {
  min-height: 58px;
  padding: 10px 14px;
  opacity: 0;
  transform: translateY(34px) scale(.92);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow: 0 16px 38px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.2);
  backdrop-filter: blur(24px) saturate(165%);
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  transition: opacity .28s ease, transform .36s cubic-bezier(.18,.88,.22,1.18), background-color .2s ease;
}
.quick-add-menu.open button,
.quick-add-menu.open a { opacity: 1; transform: translateY(0) scale(1); }
.quick-add-menu.open > :nth-child(4) { transition-delay: 20ms; }
.quick-add-menu.open > :nth-child(3) { transition-delay: 65ms; }
.quick-add-menu.open > :nth-child(2) { transition-delay: 110ms; }
.quick-add-menu.open > :nth-child(1) { transition-delay: 155ms; }
.quick-add-menu button:hover,
.quick-add-menu a:hover { background: color-mix(in srgb, var(--surface) 90%, transparent); }
.bubble-nav-item.add-bubble.open span { transform: rotate(45deg); }
.v2-app .modal {
  background: rgba(12,10,9,.56);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.v2-app .modal-card {
  border: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
}
.v2-app .modal.open .modal-card { animation: modalFloatIn .36s cubic-bezier(.18,.88,.22,1.08); }
@keyframes modalFloatIn { from { opacity: 0; transform: translateY(34px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.open-product-button {
  display: inline-flex;
  align-items: center;
  margin: 4px 0 14px;
  padding: 9px 13px;
  border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 60%, transparent);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 800;
  transition: transform .2s ease, background-color .2s ease;
}
.open-product-button:hover { transform: translateY(-1px); background: var(--accent-soft); }
.visual-edit {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  color: #2b2521;
  font-size: .95rem;
  cursor: pointer;
  opacity: .84;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  transition: transform .2s ease, opacity .2s ease, background-color .2s ease;
}
.visual-edit:hover { opacity: 1; transform: scale(1.08); }
[data-theme="dark"] .visual-edit { border-color: rgba(255,255,255,.13); background: rgba(25,22,20,.68); color: #f6f0e9; }
.preview-pop { will-change: transform, opacity; }
.v2-panel.active .preview-pop { animation: previewPopIn .52s cubic-bezier(.18,.88,.22,1.08) both; }
.v2-panel.active .collection-preview:nth-child(2) { animation-delay: 70ms; }
.v2-panel.active .collection-preview:nth-child(3) { animation-delay: 140ms; }
.v2-panel.active .v2-goal-card { animation-delay: 90ms; }
@keyframes previewPopIn { from { opacity: 0; transform: translateY(22px) scale(.965); } to { opacity: 1; transform: translateY(0) scale(1); } }
.outcome-record {
  display: grid;
  gap: 5px;
  margin: 14px 0;
  padding: 18px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent-soft) 62%, transparent);
}
.outcome-record > span { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.outcome-record > strong { font-size: 1.05rem; }
.outcome-record > small { color: var(--muted); }
.letgo-record { background: color-mix(in srgb, var(--success) 12%, transparent); }
.purchase-review { margin-top: 16px; padding-top: 18px; border-top: 1px solid var(--line); }
.review-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.review-heading span { color: var(--muted); font-size: .75rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.review-heading h3 { margin: 4px 0 0; }
.review-heading .stars { display: flex; flex-wrap: nowrap; }
.review-heading .stars button { padding: 2px; }
.comment-display { margin-top: 14px; padding: 15px 16px; border-radius: 17px; background: var(--bg); }
.comment-display p { margin: 0; }
.comment-display .button { margin-top: 8px; padding: 7px 0; }
.experience-form { display: none; gap: 11px; margin-top: 14px; }
.experience-form.open { display: grid; }
.experience-form label { display: grid; gap: 7px; color: var(--muted); font-size: .84rem; font-weight: 700; }
.experience-form textarea { width: 100%; resize: vertical; }
.experience-form .button { justify-self: start; }

@media (max-width: 620px) {
  .collection-page { padding-top: 12px; }
  .collection-page-header { padding-top: 44px; }
  .collection-page-header h1 { font-size: 3.1rem; }
  .frost-select-trigger { min-height: 46px; padding-inline: 13px; font-size: .9rem; }
  .frost-select-menu {
    position: absolute;
    left: 0;
    right: auto;
    top: calc(100% + 8px);
    bottom: auto;
    width: min(260px, calc(100vw - 28px));
    transform-origin: top left;
  }
  .frost-select:last-child .frost-select-menu { left: auto; right: 0; transform-origin: top right; }
  .review-heading { align-items: flex-start; flex-direction: column; }
}

/* Refined detail card, filter drawer, and separated bottom bubbles */
.filter-summary-bar {
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px 9px 8px 18px;
  border-color: color-mix(in srgb, var(--line) 62%, transparent);
}
.filter-summary-bar .frost-select { flex: 0 0 auto; }
.filter-summary-bar .frost-select-trigger {
  min-height: 42px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: .98rem;
  letter-spacing: -.01em;
}
.filter-drawer-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}
.filter-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 72;
  border: 0;
  background: rgba(10,9,8,.42);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(3px);
  transition: opacity .3s ease;
}
.filter-drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.filter-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 73;
  width: min(390px, 90vw);
  padding: 28px 22px;
  overflow-y: auto;
  border-right: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 24px 0 70px rgba(10,8,7,.2);
  backdrop-filter: blur(30px) saturate(140%);
  transform: translateX(-104%);
  transition: transform .38s cubic-bezier(.2,.78,.18,1);
}
.filter-drawer.open { transform: translateX(0); }
.filter-drawer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.filter-drawer-heading h2 { font-size: 2rem; }
.filter-section { display: grid; gap: 9px; padding: 18px 0; border-top: 1px solid var(--line); }
.filter-section > label,
.filter-section > span { color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.filter-drawer .view-switch { width: 100%; }
.filter-drawer .view-switch button { width: auto; flex: 1; min-height: 44px; font-size: .9rem; }
.filter-drawer .frost-select,
.filter-drawer .frost-select-trigger { width: 100%; }
.filter-drawer .frost-select-menu {
  position: static;
  display: none;
  width: 100%;
  min-width: 0;
  max-height: none;
  margin-top: 8px;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  box-shadow: none;
}
.filter-drawer .frost-select.open .frost-select-menu { display: grid; transform: none; }
.filter-history-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 22px;
  background: transparent;
}
.filter-history-link + .filter-apply { margin-top: 10px; }
.filter-apply { position: sticky; bottom: 0; width: 100%; margin-top: 22px; background: var(--text); }

.bubble-nav {
  gap: 13px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.bubble-nav-item {
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  box-shadow: 0 14px 38px rgba(22,18,15,.15), inset 0 1px rgba(255,255,255,.22);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}
.bubble-nav-item.add-bubble { border-color: transparent; box-shadow: 0 16px 38px rgba(20,16,13,.24); }

#detailModal,
#historyDetailModal { padding: 14px; }
#detailModal .modal-card,
#historyDetailModal .modal-card {
  position: relative;
  width: min(700px, 96vw);
  max-height: min(94dvh, 880px);
  padding: 0;
  overflow: hidden;
  border-radius: 30px;
  background: var(--surface);
}
.detail-close { position: absolute; top: 14px; right: 14px; z-index: 8; float: none; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.72); color: #211d1a; backdrop-filter: blur(16px); }
.detail-image-stage { width: 100%; height: min(48vh, 430px); overflow: hidden; background: var(--line); }
#detailModal .detail-image-stage img,
#historyDetailModal .detail-image-stage img { width: 100%; height: 100%; max-height: none; border-radius: 0; object-fit: cover; }
.detail-secondary { padding: 20px 22px 22px; overflow-y: auto; max-height: 45dvh; }
.detail-heading { margin-top: 0; }
.detail-heading h2 { font-size: clamp(1.55rem, 4vw, 2.15rem); }
.detail-commerce-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.detail-commerce-row .price-row { margin: 9px 0; }
.detail-commerce-row .open-product-button { flex: 0 0 auto; margin: 0; }
.detail-note,
.outcome-record,
.comment-display { background: var(--bg); }
.letgo-record { background: var(--bg); }
.outcome-record { margin-block: 10px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 16px; }
.purchase-review { margin-top: 10px; padding-top: 12px; }
.comment-display { margin-top: 9px; padding: 11px 13px; }
.experience-form { margin-top: 9px; }
.detail-secondary .modal-actions { align-items: center; margin-top: 13px; }
.detail-edit-row { display: flex; justify-content: flex-end; margin-top: 10px; }
.detail-edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  cursor: pointer;
}
.detail-edit-button:hover { background: var(--bg); color: var(--text); }
.form-grid .frost-select,
.form-grid .frost-select-trigger { width: 100%; }

.card-manage-overlay {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  background: rgba(20,18,17,.66);
  color: white;
  text-align: center;
  backdrop-filter: grayscale(1) blur(8px);
  -webkit-backdrop-filter: grayscale(1) blur(8px);
  transition: opacity .24s ease;
}
.card-manage-overlay > span { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.card-manage-overlay > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.card-manage-overlay button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: white;
  font-weight: 750;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.card-manage-overlay .card-manage-delete { background: rgba(143,49,43,.72); }
.visual-card.manage-open { cursor: default; transform: scale(.985); }
.visual-card.manage-open .card-manage-overlay { opacity: 1; pointer-events: auto; }
.visual-card.manage-open .product-image-wrap > img { filter: grayscale(1) brightness(.62); transform: scale(1.02); }

.collection-builder-card { width: min(820px, 96vw); }
.collection-builder-card > p:not(.eyebrow) { margin-bottom: 20px; color: var(--muted); }
.collection-create-fields { display: grid; grid-template-columns: .9fr 1.1fr; gap: 12px; }
.collection-create-fields label,
.collection-target-field { display: grid; gap: 7px; color: var(--muted); font-size: .88rem; font-weight: 700; }
.collection-target-field .frost-select,
.collection-target-field .frost-select-trigger { width: 100%; }
.selection-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 24px 0 12px; }
.selection-heading > div { display: grid; gap: 3px; }
.selection-heading span { color: var(--muted); font-size: .8rem; }
.selection-heading button { border: 0; background: transparent; color: var(--accent); font-weight: 800; cursor: pointer; }
.collection-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-height: 42vh;
  overflow-y: auto;
  padding: 2px;
}
.collection-pick {
  position: relative;
  overflow: hidden;
  aspect-ratio: .82;
  border: 2px solid transparent;
  border-radius: 17px;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, opacity .2s ease;
}
.collection-pick input { position: absolute; opacity: 0; pointer-events: none; }
.collection-pick img { width: 100%; height: 100%; border-radius: 0; object-fit: cover; }
.pick-check {
  position: absolute;
  top: 9px;
  left: 9px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 8px;
  background: rgba(20,18,17,.25);
  color: transparent;
  font-weight: 900;
  backdrop-filter: blur(10px);
}
.collection-pick.selected { border-color: var(--accent); transform: scale(.97); }
.collection-pick.selected img { opacity: .72; }
.collection-pick.selected .pick-check { border-color: var(--accent); background: var(--accent); color: white; }
.collection-builder-save { width: 100%; margin-top: 18px; }

@media (max-width: 620px) {
  .filter-summary-bar { top: 63px; }
  .filter-drawer { width: min(360px, 92vw); padding: 24px 18px; }
  #detailModal .modal-card,
  #historyDetailModal .modal-card { max-height: 95dvh; border-radius: 26px; }
  .detail-image-stage { height: 39dvh; min-height: 250px; }
  .detail-secondary { max-height: 54dvh; padding: 17px 17px 19px; }
  .detail-commerce-row { align-items: flex-start; }
  .detail-secondary .modal-actions { gap: 7px; }
  .detail-secondary .button { padding: 10px 13px; font-size: .86rem; }
  .bubble-nav { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .collection-create-fields { grid-template-columns: 1fr; }
  .collection-picker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 38vh; }
  .collection-builder-card { padding: 20px 16px; }
}
