/* ==========================================================================
   Bookmarks — design system
   Soft and spacious: a warm paper background, generous gaps, round corners,
   no hairline boxes around everything. Chrome stays quiet so the work leads.
   Motion follows Emil Kowalski's rules: ease-out for anything entering, short
   (≤ 300 ms) for things you do often, never from scale(0), origin-aware
   popovers, exits faster than entrances, and none of it when motion is reduced.
   ========================================================================== */

:root {
  --bg: #fbfaf8;
  --bg-2: #f3f1ed;
  --bg-3: #eae7e1;
  --bg-stage: #f4f2ee;
  --surface: #ffffff;
  --line: rgba(60, 45, 25, 0.07);
  --line-2: rgba(60, 45, 25, 0.12);
  --text: #1b1a18;
  --text-2: #57534d;
  --text-3: #8f8a82;
  --text-4: #bbb6ad;
  --accent: #1b1a18;
  --accent-fg: #fbfaf8;
  --new: #16a34a;
  --danger: #d92d20;
  --focus: rgba(27, 26, 24, 0.1);
  --overlay: rgba(20, 16, 10, 0.32);
  --shadow-sm: 0 1px 2px rgba(40, 30, 15, 0.05);
  --shadow-md: 0 14px 40px -18px rgba(40, 30, 15, 0.22), 0 2px 8px -2px rgba(40, 30, 15, 0.05);
  --shadow-lg: 0 30px 80px -24px rgba(40, 30, 15, 0.3), 0 6px 20px -6px rgba(40, 30, 15, 0.08);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  /* Type: Inter throughout — one family, one scale, three weights (400 / 500 / 600).
     No mono: numbers use Inter's tabular, open-digit figures instead. */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: var(--font);
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 30px;
  --gap: 20px;
  --pad-x: 40px;
  --header-h: 68px;
  --filters-h: 0px;
  /* Curves: ease-out for entering/UI, in-out for things moving on screen, drawer for big travel. */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
  --t-fast: 140ms;
  --t: 200ms;
  --t-slow: 320ms;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #100f0e;
  --bg-2: #1a1917;
  --bg-3: #252421;
  --bg-stage: #141312;
  --surface: #1c1b19;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f3f3f1;
  --text-2: #c2c2bd;
  --text-3: #85857f;
  --text-4: #56564f;
  --accent: #f3f3f1;
  --accent-fg: #100f0e;
  --new: #34d399;
  --focus: rgba(255, 255, 255, 0.14);
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-md: 0 8px 28px -6px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 28px 72px -12px rgba(0, 0, 0, 0.75);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  letter-spacing: -0.006em;
  font-optical-sizing: auto;
  font-feature-settings: "ss01", "cv11"; /* open digits, single-storey a */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
img { display: block; }
::selection { background: var(--text); color: var(--bg); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.no-scroll { overflow: hidden; }
i.ph, i.ph-bold, i.ph-fill { line-height: 1; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Buttons & controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; user-select: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), opacity var(--t-fast);
}
.btn:active { transform: scale(0.97); }
.btn i { font-size: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { opacity: 0.88; }
.btn-soft { background: var(--bg-2); color: var(--text); }
.btn-soft:hover { background: var(--bg-3); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }
.btn-lg { height: 44px; font-size: 14px; border-radius: 999px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-md); color: var(--text-2);
  transition: background var(--t-fast) var(--ease), color var(--t-fast), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn i { font-size: 18px; }
.icon-btn.square { background: transparent; border-radius: 999px; width: 40px; height: 40px; color: var(--text-2); }
.icon-btn.square:hover { background: var(--bg-2); color: var(--text); }
.icon-btn.square:disabled { opacity: 0.3; }
.icon-btn.is-active { background: var(--accent); color: var(--accent-fg); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: 999px;
  background: var(--bg-2); color: var(--text-2);
  font-size: 13px; font-weight: 500; white-space: nowrap; user-select: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.chip:hover { background: var(--bg-3); color: var(--text); }
.chip:active { transform: scale(0.96); }
.chip.is-active { background: var(--accent); color: var(--accent-fg); }
.chip .count { color: var(--text-3); font-weight: 400; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.chip.is-active .count { color: inherit; opacity: 0.6; }
.chip-sm { height: 26px; padding: 0 10px; font-size: 12px; }
.chip i { font-size: 13px; }
.chip .x { margin-right: -4px; opacity: 0.55; }
.chip:hover .x { opacity: 1; }

.tag {
  display: inline-flex; align-items: center; height: 28px; padding: 0 10px;
  background: var(--bg-2); border-radius: var(--r-sm); font-size: 13px; color: var(--text);
  transition: background var(--t-fast);
}
button.tag:hover { background: var(--bg-3); }

.kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 5px; background: var(--bg); border: 1px solid var(--line-2);
  font-size: 11px; font-weight: 500; color: var(--text-3); font-family: inherit;
}

.seg {
  display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border-radius: var(--r-md);
}
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; min-width: 32px; padding: 0 10px; border-radius: 8px; color: var(--text-3); font-size: 13px; font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.seg button i { font-size: 16px; }
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
[data-theme="dark"] .seg button.is-active { background: var(--bg-3); }

.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-md);
  background: var(--bg-2); border: 1px solid transparent; outline: none; font-size: 14px;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.input:focus { background: var(--bg); border-color: var(--line-2); box-shadow: 0 0 0 4px var(--focus); }
.input::placeholder { color: var(--text-3); }

/* ---------- Popovers, menus, toasts ---------- */

.popover {
  position: fixed; z-index: 800; min-width: 220px; max-width: calc(100vw - 24px);
  background: var(--surface); border: none; border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-lg); padding: 6px;
  opacity: 0; transform: scale(0.96); transform-origin: top;
  transition: opacity 120ms var(--ease), transform 120ms var(--ease);
  pointer-events: none;
}
/* In: 200 ms ease-out from 96% at the trigger. Out: faster, no fuss. */
.popover.is-open { opacity: 1; transform: none; pointer-events: auto; transition: opacity 160ms var(--ease-out), transform 200ms var(--ease-out); }
[data-theme="dark"] .popover { background: var(--surface); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px;
  border-radius: 8px; font-size: var(--fs-sm); color: var(--text); text-align: left;
  transition: background var(--t-fast);
}
.menu-item:hover, .menu-item.is-hover { background: var(--bg-2); }
[data-theme="dark"] .menu-item:hover, [data-theme="dark"] .menu-item.is-hover { background: var(--bg-3); }
.menu-item i { font-size: 16px; color: var(--text-2); }
.menu-item .check { margin-left: auto; opacity: 0; }
.menu-item.is-active .check { opacity: 1; }
.menu-item .meta { margin-left: auto; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.menu-label { padding: 10px 10px 4px; font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

.toasts {
  position: fixed; left: 50%; top: calc(var(--header-h) + 14px); z-index: 900; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px; padding: 0 8px 0 16px; height: 44px;
  background: rgba(27, 26, 24, 0.94); color: #fff; border-radius: 22px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: var(--fs-sm); pointer-events: auto; white-space: nowrap;
  animation: toast-in 320ms var(--ease-out);
}
[data-theme="dark"] .toast { background: #f3f3f1; color: #111; }
.toast img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; margin-left: -8px; }
.toast .toast-action { height: 30px; padding: 0 10px; border-radius: 8px; font-weight: 600; color: inherit; }
.toast .toast-action:hover { background: rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .toast .toast-action:hover { background: rgba(0, 0, 0, 0.08); }
.toast.is-leaving { animation: toast-out 220ms var(--ease) forwards; }
/* Toasts live at the top: they drop in, and leave faster than they came. */
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px) scale(0.98); } }

/* ---------- Header ---------- */

/* Top bar: brand · All / New / Liked · three quiet actions. Transparent at the
   top of the page, frosted once content is under it, gone while you scroll down. */
.header {
  position: sticky; top: 0; z-index: 100;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; height: var(--header-h); padding: 0 var(--pad-x);
  background: transparent;
  transition: transform 320ms var(--ease-drawer), background var(--t-slow) var(--ease), backdrop-filter var(--t-slow);
}
.header.is-stuck {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.header.is-hidden { transform: translateY(-100%); }
.brand { justify-self: start; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: var(--fs-md); letter-spacing: -0.02em; }
/* The mark: four tiles, one of them a circle — a collection with one find standing out. */
.mark { display: block; fill: currentColor; }
.brand .mark { width: 22px; height: 22px; }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -0.035em; }
/* Pluto and its moon: on hover the moon eases a little way along its orbit. */
.mark circle:last-child { transform-origin: 10px 13px; transition: transform 520ms var(--ease-spring); }
@media (hover: hover) { .brand:hover .mark circle:last-child { transform: rotate(-38deg); } }
.brand:active .mark { transform: scale(0.94); }

.tabs { position: relative; display: flex; align-items: center; gap: 2px; padding: 4px; }
.header .tabs, .header .filter-btn { transition: opacity var(--t) var(--ease), visibility 0s; }
.header.on-boards .tabs, .header.on-boards .filter-btn { opacity: 0; visibility: hidden; transition: opacity 120ms var(--ease), visibility 0s linear 120ms; }
.tabs .chip {
  position: relative; z-index: 1; height: 36px; padding: 0 16px; border-radius: 999px; background: none; box-shadow: none; gap: 7px;
  font-size: var(--fs-md); font-weight: 500; color: var(--text-3); letter-spacing: -0.01em;
  transition: color var(--t) var(--ease), transform var(--t-fast) var(--ease-out);
}
@media (hover: hover) { .tabs .chip:hover { background: none; color: var(--text); } }
.tabs .chip.is-active { background: none; color: var(--text); }
.tabs .chip:active { transform: scale(0.97); }
/* One soft pill travels between tabs (moves on screen → ease-in-out-ish drawer curve, 300 ms). */
.tab-ind {
  position: absolute; left: 0; top: 50%; height: 36px; margin-top: -18px; border-radius: 999px; background: var(--surface); opacity: 0; pointer-events: none;
  box-shadow: 0 1px 2px rgba(40, 30, 15, 0.06), 0 4px 14px -6px rgba(40, 30, 15, 0.12), 0 0 0 1px var(--line);
  transition: transform 300ms var(--ease-drawer), width 300ms var(--ease-drawer), opacity 160ms var(--ease);
}
[data-theme="dark"] .tab-ind { background: var(--bg-3); box-shadow: 0 0 0 1px var(--line); }


.header-actions { justify-self: end; display: flex; align-items: center; gap: 6px; }
.header-actions .icon-btn { width: 40px; height: 40px; border-radius: 999px; color: var(--text-2); position: relative; }
@media (hover: hover) { .header-actions .icon-btn:hover { color: var(--text); background: var(--bg-2); } }
.header-actions .icon-btn i { font-size: 20px; }
.pill-btn {
  position: relative; height: 40px; padding: 0 16px 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-md); font-weight: 500; color: var(--text-2);
  transition: background var(--t) var(--ease), color var(--t) var(--ease), transform var(--t-fast) var(--ease-out);
}
@media (hover: hover) { .pill-btn:hover { background: var(--bg-2); color: var(--text); } }
.pill-btn:active { transform: scale(0.97); }
.pill-btn i { font-size: 18px; }
.pill-btn.has-active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line), 0 4px 14px -6px rgba(40, 30, 15, 0.12); }
.refine-count:empty { display: none; }
.refine-count { min-width: 20px; height: 20px; padding: 0 6px; margin-right: -6px; border-radius: 10px; display: grid; place-items: center; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; animation: pop-in 260ms var(--ease-out) both; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.6); } }
.boards-btn .badge { position: absolute; top: 3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 9.5px; font-weight: 600; background: var(--bg-3); color: var(--text-2); box-shadow: 0 0 0 2px var(--bg); }
.boards-btn.is-active { color: var(--text); background: var(--bg-2); }
.search {
  position: relative; width: 100%; max-width: 640px;
}
.search-input {
  width: 100%; height: 42px; padding: 0 84px 0 42px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid transparent; outline: none; font-size: 14px;
  transition: background var(--t) var(--ease), border-color var(--t), box-shadow var(--t);
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus { background: var(--bg); border-color: var(--line-2); box-shadow: 0 0 0 4px var(--focus); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--text-3); pointer-events: none; }
.search-right { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 6px; }
.search-ai {
  display: none; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 7px;
  font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); background: var(--bg-3);
}
.search-ai.is-on { display: inline-flex; }
.search-ai i { font-size: 13px; }
.search-ai.is-loading i { animation: spin 1s linear infinite; }
.search-clear { display: none; width: 26px; height: 26px; border-radius: 7px; color: var(--text-3); align-items: center; justify-content: center; }
.search-clear:hover { background: var(--bg-3); color: var(--text); }
.search.has-value .search-clear { display: inline-flex; }
.search.has-value .kbd { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: auto; }
.header-actions .divider { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.boards-btn .badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bg-3); color: var(--text-2);
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
}

.suggest { top: calc(100% + 8px); left: 0; right: 0; position: absolute; max-height: min(60vh, 520px); overflow-y: auto; }
.suggest .menu-item img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--bg-3); }
.suggest .swatch-dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); margin: 0 4px; }
.suggest .menu-item em { font-style: normal; color: var(--text-3); margin-left: 4px; }

/* ---------- Filter bar ---------- */

.filters {
  position: sticky; top: var(--header-h); z-index: 90;
  display: flex; align-items: center; gap: 12px; height: var(--filters-h); padding: 0 var(--pad-x);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  transition: box-shadow var(--t);
}
.filters.is-stuck { box-shadow: 0 1px 0 var(--line); }
.chips {
  flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0;
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  padding-right: 40px;
}
.chips::-webkit-scrollbar { display: none; }
.filters-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.filter-btn { position: relative; }

/* Filters panel */
.filters-pop { padding: 0; width: min(760px, calc(100vw - 24px)); overflow: hidden; border-radius: var(--r-xl); }
.fp { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: min(620px, calc(100vh - 140px)); }
.fp-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); }
.fp-search { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--text-3); }
.fp-search i { font-size: 17px; }
.fp-search-input { flex: 1; border: none; outline: none; background: none; font-size: var(--fs-md); height: 32px; color: var(--text); }
.fp-search-input::placeholder { color: var(--text-4); }
.fp-clear { font-size: var(--fs-sm); color: var(--text-2); padding: 6px 10px; border-radius: 8px; transition: background var(--t-fast); }
.fp-clear:hover { background: var(--bg-2); color: var(--text); }
.fp-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 0; }
.fp-rail { padding: 10px 8px; border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.fp-facet {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left;
  color: var(--text-2); transition: background var(--t-fast), color var(--t-fast);
}
.fp-facet i { font-size: 17px; color: var(--text-3); flex-shrink: 0; }
.fp-facet:hover { background: var(--bg-2); color: var(--text); }
.fp-facet.is-active { background: var(--bg-2); color: var(--text); }
[data-theme="dark"] .fp-facet.is-active, [data-theme="dark"] .fp-facet:hover { background: var(--bg-3); }
.fp-facet.is-active i { color: var(--text); }
.fp-facet-text { display: flex; flex-direction: column; min-width: 0; }
.fp-facet-title { font-size: var(--fs-sm); font-weight: 500; }
.fp-facet-value { font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-pane { overflow-y: auto; padding: 16px 18px 20px; overscroll-behavior: contain; }
.fp-pane-title { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-sm); font-weight: 600; margin: 4px 2px 12px; }
.fp-pane-title + .fp-grid + .fp-pane-title { margin-top: 22px; }
.fp-pane-title.is-quiet:empty { display: none; }
.fp-pane-title.is-quiet { justify-content: flex-end; margin: -2px 2px 8px; }
.fp-reset { font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); }
.fp-reset:hover { color: var(--text); }
.fp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fp-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 6px 6px 9px; border-radius: 12px; text-align: left;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease), opacity var(--t-fast);
}
.fp-card:hover { background: var(--bg-2); }
[data-theme="dark"] .fp-card:hover { background: var(--bg-3); }
.fp-card:active { transform: scale(0.98); }
.fp-card.is-on { background: var(--bg-2); box-shadow: inset 0 0 0 1.5px var(--text); }
[data-theme="dark"] .fp-card.is-on { background: var(--bg-3); }
.fp-card.is-empty { opacity: 0.4; }
.fp-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; height: 58px; border-radius: 8px; overflow: hidden; background: var(--bg-2); }
.fp-strip img { width: 100%; height: 100%; object-fit: cover; }
.fp-strip-icon { display: grid; place-items: center; color: var(--text-2); background: var(--bg-3); }
.fp-strip-icon i { font-size: 18px; }
.fp-strip-empty { grid-column: span 3; }
.fp-check { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; }
.fp-check i { font-size: 11px; }
.fp-card-label { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 0 4px; }
.fp-card-name { font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-card-count { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.fp-grid.is-colors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fp-color { align-items: center; padding: 12px 6px 10px; }
.fp-color .fp-card-label { flex-direction: column; align-items: center; gap: 1px; }
.fp-swatch { width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); display: grid; place-items: center; color: #fff; transition: transform var(--t-fast) var(--ease-spring); }
.fp-color:hover .fp-swatch { transform: scale(1.06); }
.fp-color.is-on { box-shadow: none; }
.fp-color.is-on .fp-swatch { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.fp-swatch i { font-size: 16px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.35)); }
.fp-none { color: var(--text-3); font-size: var(--fs-sm); padding: 24px 4px; }
.fp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; border-top: 1px solid var(--line); }
.fp-summary { font-size: var(--fs-xs); color: var(--text-4); font-variant-numeric: tabular-nums; }
.fp-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.fp-sort-opt {
  height: 28px; padding: 0 11px; border-radius: 14px; display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 500; color: var(--text-3);
  transition: background var(--t) var(--ease), color var(--t) var(--ease), transform var(--t-fast) var(--ease-out);
}
.fp-sort-opt i { font-size: 12px; }
@media (hover: hover) { .fp-sort-opt:hover { color: var(--text); background: var(--bg-2); } }
.fp-sort-opt:active { transform: scale(0.96); }
.fp-sort-opt.is-on { background: var(--text); color: var(--bg); }
.fp-show { height: 38px; padding: 0 16px; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .fp-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .fp-rail { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .fp-facet { width: auto; flex-shrink: 0; }
  .fp-facet-value { display: none; }
  .fp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fp-grid.is-colors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.filters-panel { width: 340px; padding: 14px; }
.filters-panel h4 { font-size: 12px; font-weight: 500; color: var(--text-3); margin: 4px 2px 8px; }
.filters-panel .row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2);
  transition: transform var(--t-fast) var(--ease-spring), box-shadow var(--t-fast);
}
.swatch:hover { transform: scale(1.12); }
.swatch.is-active { box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }

/* ---------- Page heading ---------- */

.page { padding: 4px var(--pad-x) 160px; max-width: 2200px; margin: 0 auto; } /* room for the floating bar */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 16px; }
.page-head:empty { margin: 0 0 8px; }
.page-head > .page-tags { margin-top: 0; }
.page-title { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; display: flex; align-items: baseline; gap: 10px; }
.page-title .count { font-size: var(--fs-lg); font-weight: 400; letter-spacing: -0.01em; color: var(--text-3); font-variant-numeric: tabular-nums; }
.page-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.page-tags-icon { font-size: 14px; color: var(--text-4); margin-right: 2px; }
.chip-quiet { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-2); pointer-events: none; }
.chip-heart { color: #e5484d; }
.chip.is-active .chip-heart { color: inherit; }
.chips-sep { width: 1px; height: 18px; background: var(--line-2); align-self: center; margin: 0 4px; flex-shrink: 0; }
.filters-foot { margin-top: 12px; text-align: center; font-size: var(--fs-xs); color: var(--text-4); font-variant-numeric: tabular-nums; }
.search-ai.is-refining i { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.swatch-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); }
.page-sub { color: var(--text-3); font-size: var(--fs-sm); margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-sub .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-4); }
.interp { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.interp-label { font-size: var(--fs-xs); color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Feed (virtualised masonry) ---------- */

.feed { position: relative; }
.card {
  position: absolute; top: 0; left: 0; border-radius: var(--r-md); overflow: hidden;
  background: var(--bg-2); cursor: zoom-in; contain: layout paint;
  transition: box-shadow 400ms var(--ease-out);
}
/* The faintest edge, just enough for white images on the paper background. */
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(40, 30, 15, 0.045); pointer-events: none; }
[data-theme="dark"] .card::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04); }
.card img.card-img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 360ms var(--ease-out), transform 900ms var(--ease-out); }
.card.is-loaded img.card-img { opacity: 1; }
/* Autoplay layer: sits over the still until it's actually playing, then fades in. */
.card-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; transition: opacity 420ms var(--ease-out), transform 900ms var(--ease-out); }
.card.is-playing .card-vid { opacity: 1; }
.card.is-playing .badge-play:not(.is-gif) { opacity: 0; transform: scale(0.8); }
.badge-play { transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out); }
@media (hover: hover) { .card.is-loaded:hover .card-vid { transform: scale(1.025); } }
.card-shade {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 300ms var(--ease-out);
  background: linear-gradient(to bottom, rgba(0,0,0,0.22), transparent 30%, transparent 62%, rgba(0,0,0,0.42));
}
.card-author {
  position: absolute; left: 12px; bottom: 11px; right: 52px; display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: var(--fs-xs); font-weight: 500; opacity: 0; transform: translateY(4px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.card-author img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,0.2); }
.card-author span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; align-items: center; }
.card-save {
  position: relative; height: 32px; padding: 0 14px; border-radius: 999px;
  background: rgba(24, 22, 19, 0.82); color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(-3px); transition: opacity var(--t) var(--ease-out), transform var(--t) var(--ease-out), background var(--t-fast);
}
.card-save:hover { background: rgba(24, 22, 19, 0.95); }
.card-save:active { transform: scale(0.96); }
.card-save.is-saved { background: rgba(255, 255, 255, 0.94); color: #1b1a18; }
.card-check {
  position: absolute; top: 10px; left: 10px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.85); box-shadow: 0 0 0 1px rgba(0,0,0,0.08); color: transparent;
  display: grid; place-items: center; opacity: 0; transform: scale(0.9);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease-spring), background var(--t-fast), color var(--t-fast);
}
.card-check i { font-size: 14px; }
.card-check:hover { background: #fff; color: var(--text-3); }
/* Bottom-right, out of the way of the hover controls. */
.card-badges { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: row-reverse; gap: 5px; pointer-events: none; }
.badge-play {
  min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; display: inline-grid; place-items: center;
  background: rgba(20, 18, 15, 0.32); color: #fff; font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.badge-play i { font-size: 10px; margin-left: 1px; }
.badge-chip {
  height: 26px; padding: 0 9px; border-radius: 13px; display: inline-flex; align-items: center; gap: 4px;
  background: rgba(20, 18, 15, 0.32); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.badge-chip.on-hover { opacity: 0; transform: translateY(3px); transition: opacity var(--t) var(--ease-out), transform var(--t) var(--ease-out); }
.badge-chip i { font-size: 10px; }

@media (hover: hover) {
  .card:hover { box-shadow: var(--shadow-md); }
  .card.is-loaded:hover img.card-img { transform: scale(1.025); }
  .card:hover .card-shade, .card:hover .card-author, .card:hover .card-save, .card:hover .card-check, .card:hover .badge-chip.on-hover { opacity: 1; transform: none; }
}
.feed.is-selecting .card { cursor: pointer; }
.feed.is-selecting .card-check { opacity: 1; transform: none; }

.card.is-selected .card-check { background: var(--accent); color: var(--accent-fg); box-shadow: none; }
[data-theme="dark"] .card.is-selected .card-check { background: #fff; color: #111; }
.card.is-selected::after { box-shadow: inset 0 0 0 2.5px var(--text); }
.card.is-selected img.card-img { transform: scale(0.94); border-radius: 6px; }
.card img.card-img { transition: opacity 400ms var(--ease), transform var(--t) var(--ease), border-radius var(--t); }

.card-text { cursor: pointer; background: var(--bg-2); padding: 18px; display: flex; flex-direction: column; justify-content: space-between; }
.card-text p { font-size: 14.5px; line-height: 1.5; color: var(--text); letter-spacing: -0.005em; overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 75%, transparent); -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent); }
.card-text .who { font-size: 12px; color: var(--text-3); margin-top: 10px; font-weight: 500; }

.feed-empty { padding: 120px 20px; text-align: center; color: var(--text-3); }
.feed-empty i { font-size: 32px; color: var(--text-4); }
.feed-empty h3 { color: var(--text); font-size: 16px; font-weight: 600; margin: 12px 0 4px; }
/* One loading language everywhere: soft tiles with a slow, staggered shimmer. */
.feed-loading { columns: 4 260px; column-gap: var(--gap); }
.feed-loading .skeleton { display: block; margin-bottom: var(--gap); break-inside: avoid; }
.feed-loading .skeleton { height: 280px; }
.feed-loading .skeleton:nth-child(5n + 1) { height: 360px; } .feed-loading .skeleton:nth-child(5n + 2) { height: 220px; }
.feed-loading .skeleton:nth-child(5n + 3) { height: 310px; } .feed-loading .skeleton:nth-child(5n + 4) { height: 250px; }
.skeleton {
  border-radius: var(--r-md); background: linear-gradient(100deg, var(--bg-2) 30%, color-mix(in srgb, var(--bg-3) 70%, var(--bg-2)) 50%, var(--bg-2) 70%);
  background-size: 300% 100%; animation: shimmer 1.8s var(--ease) infinite;
}
.skeleton:nth-child(2n) { animation-delay: 0.15s; } .skeleton:nth-child(3n) { animation-delay: 0.3s; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Selection bar ---------- */

.select-bar {
  position: fixed; left: 50%; bottom: 24px; z-index: 300;
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 16px; height: 52px;
  background: #111; color: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  transform: translate(-50%, 90px); opacity: 0; transition: transform 380ms var(--ease-out), opacity 200ms;
}
.select-bar.is-open { transform: translate(-50%, 0); opacity: 1; }
[data-theme="dark"] .select-bar { background: #f3f3f1; color: #111; }
.select-bar .count { font-size: var(--fs-sm); font-weight: 600; margin-right: 8px; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.select-bar .btn { height: 40px; color: inherit; }
.select-bar .btn-ghost:hover { background: rgba(255,255,255,0.1); color: inherit; }
[data-theme="dark"] .select-bar .btn-ghost:hover { background: rgba(0,0,0,0.06); }
.select-bar .btn-primary { background: #fff; color: #111; }
[data-theme="dark"] .select-bar .btn-primary { background: #111; color: #fff; }
.select-bar .icon-btn { color: inherit; opacity: 0.7; }
.select-bar .icon-btn:hover { opacity: 1; background: rgba(255,255,255,0.1); }

/* ---------- Detail view ---------- */

/* Open/close choreography lives in detail.js (shared-element flight + fades). */
.detail {
  --peek: 96px; /* set from JS: leaves a sliver of "More like this" in view */
  position: fixed; inset: 0; z-index: 200; background: var(--bg); overflow-y: auto; overscroll-behavior: contain;
  visibility: hidden;
}
.detail.is-open { visibility: visible; }
.detail-top { display: grid; grid-template-columns: minmax(0, 1fr) 420px; height: calc(100vh - var(--peek)); }
.detail-stage {
  position: sticky; top: 0; height: calc(100vh - var(--peek)); display: flex; align-items: center; justify-content: center;
  background: var(--bg-stage); padding: 40px 56px; overflow: hidden;
}
.detail-media { position: relative; max-width: 100%; max-height: 100%; display: flex; }
.detail-media img, .detail-media video {
  max-width: 100%; object-fit: contain; /* size set inline by detail.js */
  border-radius: 14px; box-shadow: var(--shadow-md);
}
.detail-media .hi { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 300ms var(--ease); }
.detail-media .hi.is-loaded { opacity: 1; }
.detail-media.is-flying { will-change: transform, clip-path; }
.detail-media.is-flying video { opacity: 0 !important; transition: none; }
.detail-media.text-post {
  width: min(640px, 100%); padding: 48px; background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  font-size: clamp(18px, 2vw, 24px); line-height: 1.5; letter-spacing: -0.01em; white-space: pre-line;
}
.detail-panel { padding: 24px 32px 28px; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.detail-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.detail-nav .group { display: flex; gap: 2px; }
.detail-nav .detail-hide { margin-right: 6px; }
.detail-kicker { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.detail-title { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 12px; }
.detail-author { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.detail-author img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--bg-2); }
.detail-author .name { font-weight: 600; font-size: 14px; }
.detail-author .handle { color: var(--text-3); font-size: var(--fs-sm); }
.detail-author .handle:hover { color: var(--text); }
.detail-text { font-size: var(--fs-md); line-height: 1.6; color: var(--text); white-space: pre-line; word-break: break-word; margin-bottom: 18px; }
.detail-caption {
  font-size: var(--fs-sm); line-height: 1.55; color: var(--text-3); margin-bottom: 22px; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.detail-caption.is-open { display: block; }
.detail-caption { color: var(--text-2); }
.detail-caption-more { display: none; margin-top: 8px; color: var(--text-4); font-size: var(--fs-xs); }
.detail-caption.is-open .detail-caption-more { display: block; }
.detail-caption i { font-size: 12px; color: var(--text-4); }
.detail-author .handle-row { display: flex; align-items: center; gap: 8px; }
.detail-author .date { font-size: var(--fs-xs); color: var(--text-4); font-variant-numeric: tabular-nums; }
.detail-author .date::before { content: "·"; margin-right: 8px; }
.detail-rows { display: grid; grid-template-columns: 88px 1fr; gap: 12px 12px; align-items: center; margin-bottom: 24px; }
.detail-rows dt { font-size: var(--fs-sm); color: var(--text-3); }
.detail-rows dd { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-rows .swatch { width: 24px; height: 24px; }
.detail-stats { display: flex; gap: 16px; font-size: var(--fs-xs); color: var(--text-3); margin-bottom: 24px; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; flex-wrap: wrap; }
.detail-stats span { display: inline-flex; align-items: center; gap: 5px; }
.detail-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.detail-actions .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-hint { margin-top: auto; padding-top: 28px; font-size: 12px; color: var(--text-4); display: flex; gap: 14px; }
.detail-hint span { display: inline-flex; align-items: center; gap: 5px; }
.detail-related { padding: 26px var(--pad-x) 80px; }
.detail-related h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.detail-media img:not(.hi) { background: var(--bg-2); }
.related-grid { columns: 5 240px; column-gap: var(--gap); }
.related-grid .rel {
  break-inside: avoid; margin-bottom: var(--gap); border-radius: var(--r-md); overflow: hidden; background: var(--bg-2);
  cursor: zoom-in; position: relative; display: block; width: 100%;
  animation: rise 420ms var(--ease-out) both;
}
.related-grid .rel img { width: 100%; height: auto; }
.related-grid .rel::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(40, 30, 15, 0.045); }
.related-grid .rel img { transition: transform 900ms var(--ease-out); }
@media (hover: hover) { .related-grid .rel:hover img { transform: scale(1.025); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* Carousel */
.stage-nav {
  position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 88%, transparent); color: var(--text); box-shadow: var(--shadow-md), 0 0 0 1px var(--line);
  display: grid; place-items: center; opacity: 0; transition: opacity var(--t) var(--ease), transform var(--t-fast) var(--ease), background var(--t-fast);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 2;
}
.stage-nav i { font-size: 18px; }
.stage-nav.prev { left: 20px; }
.stage-nav.next { right: 20px; }
.stage-nav:hover { background: var(--bg); }
.stage-nav:active { transform: scale(0.92); }
.stage-nav:disabled { opacity: 0 !important; pointer-events: none; }
.detail-stage:hover .stage-nav { opacity: 1; }
@media (hover: none) { .stage-nav { opacity: 1; } }
.stage-count {
  position: absolute; top: 20px; right: 20px; height: 26px; padding: 0 10px; border-radius: 999px; z-index: 2;
  background: color-mix(in srgb, var(--bg) 88%, transparent); box-shadow: 0 0 0 1px var(--line);
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; color: var(--text-2);
}
.stage-dots { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
.stage-dots button { width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); transition: background var(--t-fast), transform var(--t-fast) var(--ease-spring); }
.stage-dots button.is-active { background: var(--text); transform: scale(1.25); }

/* Likes */
.like-btn.is-liked { color: #e5484d; }
.like-btn.is-liked i { color: #e5484d; }
.card-like {
  position: relative; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: #111; display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06); opacity: 0; transform: translateY(-4px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), background var(--t-fast);
}
.card-like i { font-size: 16px; }
.card-like:hover { background: #fff; }
.card-like.is-liked { color: #e5484d; opacity: 1; transform: none; }
@media (hover: hover) { .card:hover .card-like { opacity: 1; transform: none; } }
.liked-pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: color-mix(in srgb, #e5484d 10%, transparent); color: #e5484d; font-size: var(--fs-xs); font-weight: 600; transition: background var(--t-fast); }
.liked-pill:hover { background: color-mix(in srgb, #e5484d 18%, transparent); }
.liked-pill.is-active { background: #e5484d; color: #fff; }
.liked-pill i { font-size: 13px; }

.flip-ghost { position: fixed; z-index: 250; object-fit: cover; border-radius: var(--r-md); pointer-events: none; will-change: transform; }

/* ---------- Boards view ---------- */

.boards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 20px; }
.board-card { cursor: pointer; }
.board-cover {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-2); isolation: isolate;
  display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px;
  transition: transform var(--t) var(--ease), box-shadow var(--t);
}
.board-card:hover .board-cover { box-shadow: var(--shadow-md); }
.board-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
@media (hover: hover) { .board-card:hover .board-cover img { transform: scale(1.03); } }
.board-cover img:first-child { grid-row: span 2; }
.board-cover.one img { grid-column: span 2; grid-row: span 2; }
.board-cover.empty { display: grid; place-items: center; grid-template-columns: 1fr; color: var(--text-4); }
.board-cover.empty i { font-size: 28px; }
.board-card h4 { font-size: 15px; font-weight: 600; margin-top: 10px; letter-spacing: -0.01em; }
.board-card p { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.board-card .shared { color: var(--text-3); display: inline-flex; align-items: center; gap: 3px; }
.board-new {
  aspect-ratio: 4 / 3; border-radius: var(--r-lg); background: var(--bg-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-3);
  transition: border-color var(--t), color var(--t), background var(--t);
}
.board-new:hover { color: var(--text); background: var(--bg-3); }
.board-new i { font-size: 24px; }
.prompt-card {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 20px; margin-bottom: 8px;
  border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 10px 30px -16px rgba(40, 30, 15, 0.22);
  transition: box-shadow var(--t) var(--ease);
}
.prompt-card:focus-within { box-shadow: 0 0 0 1px var(--line-2), 0 0 0 5px var(--focus), 0 10px 30px -16px rgba(40, 30, 15, 0.22); }
[data-theme="dark"] .prompt-card { background: var(--bg-2); }
.prompt-card i.ph-sparkle { font-size: 20px; color: var(--text-2); }
.prompt-card input { flex: 1; background: none; border: none; outline: none; font-size: 15px; min-width: 0; }
.prompt-card input::placeholder { color: var(--text-3); }

/* Save-to-board popover */
.save-pop { width: 300px; padding: 8px; }
.save-pop .input { height: 36px; margin-bottom: 6px; }
.save-pick-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.save-pick-all { font-size: var(--fs-xs); font-weight: 500; color: var(--text-2); }
.save-pick-all:hover { color: var(--text); }
.save-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 2px 8px; }
.save-pick-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg-2); opacity: 0.5; transition: opacity var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease); }
.save-pick-item:hover { opacity: 0.8; }
.save-pick-item:active { transform: scale(0.95); }
.save-pick-item img { width: 100%; height: 100%; object-fit: cover; }
.save-pick-item.is-on { opacity: 1; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text); }
.save-pick-item .tick { position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; opacity: 0; transform: scale(0.6); transition: opacity var(--t-fast), transform var(--t-fast) var(--ease-spring); }
.save-pick-item .tick i { font-size: 9px; }
.save-pick-item.is-on .tick { opacity: 1; transform: none; }
.save-list { max-height: 300px; overflow-y: auto; }
.save-list .menu-item { height: 48px; }
.save-list .thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--bg-2); flex-shrink: 0; }
.save-list .thumb.empty { display: grid; place-items: center; color: var(--text-4); }
.save-list .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-list .menu-item .added { color: var(--text); font-size: 12px; font-weight: 600; }

/* ---------- Moodboard builder (modal) ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 500; background: var(--overlay);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 2.5vh 2vw;
  opacity: 0; transition: opacity 220ms var(--ease);
}
.modal-backdrop.is-open { opacity: 1; }
.builder {
  width: min(1720px, 100%); height: 100%; background: var(--bg); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); display: grid; grid-template-rows: 64px minmax(0, 1fr); overflow: hidden;
  transform: translateY(14px) scale(0.98); transition: transform 360ms var(--ease-drawer);
}
.modal-backdrop.is-open .builder { transform: none; }
.builder-head { display: flex; align-items: center; gap: 8px; padding: 0 14px 0 22px; }
.builder-title {
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em; border: none; outline: none; background: none;
  padding: 6px 8px; margin-left: -8px; border-radius: 8px; min-width: 60px; max-width: 42vw;
  transition: background var(--t-fast);
}
.builder-title:hover { background: var(--bg-2); }
.builder-title:focus { background: var(--bg-2); }
.save-state { font-size: var(--fs-xs); color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; }
.save-state i { font-size: 14px; }
.builder-head .spacer { flex: 1; }
.builder-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; }
.builder-canvas {
  position: relative; overflow: hidden; background: var(--bg-2); margin: 0 0 12px 12px; border-radius: 18px;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px); background-size: 18px 18px;
}
.builder-canvas.is-dragover::after {
  content: "Drop images to add them"; position: absolute; inset: 16px; border: 2px dashed var(--text-3); border-radius: var(--r-lg);
  display: grid; place-items: center; font-weight: 600; color: var(--text-2); background: color-mix(in srgb, var(--bg) 70%, transparent);
}
.canvas-scroll { position: absolute; inset: 0; overflow: auto; display: flex; padding: 48px; }
.frame {
  position: relative; box-shadow: 0 30px 70px -30px rgba(40, 30, 15, 0.35), 0 0 0 1px rgba(40, 30, 15, 0.04); border-radius: 6px; transition: background var(--t);
}
.frame-title { position: absolute; left: 0; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame-item {
  position: absolute; overflow: hidden; cursor: grab; background: rgba(127,127,127,0.12);
  transition: left 320ms var(--ease-out), top 320ms var(--ease-out), width 320ms var(--ease-out), height 320ms var(--ease-out), border-radius 200ms, box-shadow 200ms, opacity 200ms;
  touch-action: none;
}
.frame-item img { width: 100%; height: 100%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.frame-item.is-dragging { opacity: 0.3; }
.frame-item.is-uploading::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.frame-tools {
  position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity var(--t-fast);
}
.frame-item:hover .frame-tools { opacity: 1; }
.frame-tools button {
  width: 30px; height: 30px; border-radius: 999px; background: rgba(24, 22, 19, 0.7); color: #fff; display: grid; place-items: center;
  backdrop-filter: blur(6px); transition: background var(--t-fast), transform var(--t-fast);
}
.frame-tools button:hover { background: #111; }
.frame-tools button:active { transform: scale(0.9); }
.frame-tools i { font-size: 15px; }
.drag-ghost {
  position: fixed; z-index: 700; pointer-events: none; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-lg);
  transform: rotate(-2deg) scale(1.03); transition: transform 160ms var(--ease-spring); opacity: 0.95;
}
.drag-ghost img { width: 100%; height: 100%; object-fit: cover; }
.frame-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--text-3); text-align: center; padding: 40px;
}
.frame-empty i { font-size: 34px; color: var(--text-4); }
.frame-empty h3 { font-size: 20px; color: var(--text); font-weight: 600; }
.canvas-zoom { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 4px; background: var(--surface); border-radius: 999px; padding: 3px; box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); font-size: 12px; align-items: center; }
.canvas-zoom span { min-width: 44px; text-align: center; color: var(--text-3); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.canvas-zoom .icon-btn { width: 28px; height: 28px; }
.canvas-zoom .icon-btn i { font-size: 15px; }

.inspector { overflow-y: auto; display: flex; flex-direction: column; padding: 0 6px; }
.inspector section { padding: 14px 16px 16px; }
.inspector section + section { border-top: 1px solid color-mix(in srgb, var(--text) 5%, transparent); }
.inspector h5 { font-size: 12px; font-weight: 500; color: var(--text-3); margin-bottom: 10px; display: flex; justify-content: space-between; }
.inspector h5 output { color: var(--text-2); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.inspector .seg { width: 100%; }
.inspector .seg button { flex: 1; }
.ratio-row { display: flex; flex-wrap: wrap; gap: 6px; }
.range { width: 100%; -webkit-appearance: none; appearance: none; height: 20px; background: none; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--text) var(--p, 50%), var(--bg-3) var(--p, 50%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-md); margin-top: -6px; transition: transform var(--t-fast); }
.range:active::-webkit-slider-thumb { transform: scale(1.15); }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--bg-3); }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--text); }
.range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: none; box-shadow: 0 0 0 1px var(--line-2), var(--shadow-md); }
.control-row { display: flex; align-items: center; gap: 12px; }
.control-row + .control-row { margin-top: 12px; }
.control-row label { width: 64px; font-size: 13px; color: var(--text-2); flex-shrink: 0; }
.control-row output { width: 26px; text-align: right; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.bg-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bg-swatches .swatch { width: 24px; height: 24px; }
.bg-custom { position: relative; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); box-shadow: inset 0 0 0 1px var(--line-2); }
.bg-custom input { position: absolute; inset: -8px; opacity: 0; cursor: pointer; }
.toggle { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-2); cursor: pointer; }
.toggle input { display: none; }
.toggle .track { width: 34px; height: 20px; border-radius: 10px; background: var(--bg-3); position: relative; transition: background var(--t); }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--t) var(--ease-spring); }
.toggle input:checked + .track { background: var(--text); }
.toggle input:checked + .track::after { transform: translateX(14px); }
[data-theme="dark"] .toggle input:checked + .track::after { background: #111; }
.inspector-foot { margin-top: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; }

/* Add-images drawer inside the builder */
.picker {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 92%); z-index: 5;
  background: var(--surface); box-shadow: var(--shadow-lg); border-radius: 18px 0 0 18px;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr); transform: translateX(104%); transition: transform 360ms var(--ease-drawer);
}
.picker.is-open { transform: none; }
.picker-head { display: flex; align-items: center; gap: 8px; padding: 14px; }
.picker-head .search { max-width: none; }
.picker-tabs { display: flex; gap: 6px; padding: 0 14px 12px; }
.picker-grid { overflow-y: auto; padding: 0 14px 14px; columns: 3 140px; column-gap: 8px; }
.picker-grid .pick { break-inside: avoid; margin-bottom: 8px; position: relative; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--bg-2); display: block; width: 100%; }
.picker-grid .pick img { width: 100%; height: auto; transition: transform var(--t) var(--ease), filter var(--t); }
.picker-grid .pick:hover img { filter: brightness(0.92); }
.picker-grid .pick-more {
  position: absolute; left: 6px; bottom: 6px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; backdrop-filter: blur(8px);
  transition: background var(--t-fast), transform var(--t-fast) var(--ease);
}
.picker-grid .pick-more i { font-size: 11px; }
.picker-grid .pick-more:not(.is-index):hover { background: rgba(0,0,0,0.8); transform: scale(1.05); }
.picker-grid .pick-more.is-open:not(.is-index), .picker-grid .pick-more.is-open:not(.is-index):hover { background: #fff; color: #111; }
.picker-grid .pick-more.is-index { background: rgba(0,0,0,0.35); pointer-events: none; }
.picker-grid .pick .tick { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.9); color: transparent; box-shadow: 0 0 0 1px rgba(0,0,0,0.08); transition: background var(--t-fast), color var(--t-fast), transform var(--t) var(--ease-spring); }
.picker-grid .pick:hover .tick { color: var(--text-3); }
.picker-grid .pick.is-added .tick { background: var(--text); color: var(--bg); box-shadow: none; transform: scale(1.05); }
.picker-grid .pick.is-added img { transform: scale(0.94); border-radius: 6px; }
.dropzone {
  break-inside: avoid; margin-bottom: 8px; aspect-ratio: 1; border-radius: 8px; border: 1.5px dashed var(--line-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-3); font-size: var(--fs-xs); width: 100%;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.dropzone:hover { border-color: var(--text-3); color: var(--text); background: var(--bg-2); }
.dropzone i { font-size: 22px; }

/* Share popover */
.share-pop { width: 340px; padding: 16px; }
.share-pop h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.share-pop p { font-size: var(--fs-xs); color: var(--text-3); margin-bottom: 14px; }
.share-link { display: flex; gap: 6px; margin-top: 12px; }
.about-pop { width: 320px; padding: 18px 18px 6px; }
.about-pop h4 { font-size: 15px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.about-pop p { font-size: var(--fs-xs); color: var(--text-2); line-height: 1.55; margin-bottom: 12px; }
.about-pop p + p { color: var(--text-3); }
.share-link input { font-size: var(--fs-xs); height: 36px; }
.share-link .btn { height: 36px; }

/* ---------- Canvas view (infinite pan) ---------- */

.canvas-view { position: fixed; inset: var(--header-h) 0 0 0; overflow: hidden; cursor: grab; background: var(--bg-2); touch-action: none; }
.canvas-view.is-grabbing { cursor: grabbing; }
.canvas-view .card { cursor: inherit; }
/* Measured: per-tile containment/will-change + the image fade made panning drop to ~37 fps. */
.canvas-world { position: absolute; left: 0; top: 0; will-change: transform; }
.canvas-card { contain: none; transition: none; }
.canvas-card img.card-img { transition: none; opacity: 1; }
.canvas-card::after { box-shadow: none; }
.canvas-view.is-grabbing .card { pointer-events: none; } /* no hover repaints mid-pan */
.canvas-zoom-pill { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--bg); box-shadow: var(--shadow-md), 0 0 0 1px var(--line); }

/* ---------- Responsive ---------- */

/* ---------- Ask bar (search + assistant, floating at the bottom) ---------- */
.glass {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(22px) saturate(180%); -webkit-backdrop-filter: blur(22px) saturate(180%);
}
/* At rest a small, quiet pill; it widens when you use it (width on one fixed element is cheap). */
.ask {
  position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 160; transform: translateX(-50%);
  width: min(460px, calc(100vw - 24px)); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
  transition: width 320ms var(--ease-out), opacity 180ms var(--ease), visibility 0s;
}
.ask:has(.ask-bar:is(:focus-within, .has-value, .in-session, .has-tray, .has-atts, .is-thinking)) { width: min(640px, calc(100vw - 24px)); }
/* A soft fade so the grid slips under the bar instead of being cut by it. */
body::after {
  content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 120px; z-index: 150; pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg) 85%, transparent), transparent);
}
.ask > * { pointer-events: auto; }
/* Aura: a faint halo of warm pastels that drifts slowly around the bar. It sits
   behind the glass (on the wrapper, so the bar's own blur doesn't swallow it),
   brightens a touch while you're asking, and holds still under reduced motion. */
.ask::before {
  content: ""; position: absolute; left: 3%; right: 3%; bottom: -6px; height: 66px; border-radius: 34px; z-index: -1; pointer-events: none;
  background: conic-gradient(from var(--aura-a, 0deg), #ffc2a1, #f7a8d0, #bca7ff, #9fd0ff, #b6ecd2, #ffe0a3, #ffc2a1);
  filter: blur(20px); opacity: 0.5;
  animation: aura-drift 14s linear infinite, aura-breathe 6s ease-in-out infinite;
  transition: opacity 600ms var(--ease-out), left 320ms var(--ease-out), right 320ms var(--ease-out);
}
[data-theme="dark"] .ask::before { opacity: 0.3; }
.ask:has(.ask-bar:focus-within)::before { opacity: 0.7; left: 0; right: 0; }
.ask:has(.ask-bar.is-thinking)::before { opacity: 0.8; animation-duration: 5s, 6s; }
[data-theme="dark"] .ask:has(.ask-bar:focus-within)::before { opacity: 0.45; }
@property --aura-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes aura-drift { to { --aura-a: 360deg; } }
@keyframes aura-breathe { 50% { transform: scaleX(1.04) scaleY(1.12); } }
@media (prefers-reduced-motion: reduce) { .ask::before { animation: none; } }
.ask { transition: opacity 180ms var(--ease), visibility 0s; }
/* Under an open bookmark the glass bar would keep re-blurring the flight beneath it. */
.detail.is-open ~ .ask { opacity: 0; visibility: hidden; transition: opacity 120ms var(--ease), visibility 0s linear 120ms; }
.ask-bar {
  position: relative; width: 100%; max-width: none; display: flex; align-items: center; gap: 4px; min-height: 54px; padding: 6px 6px 6px 18px; border-radius: 27px;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 9%, transparent), 0 18px 50px -18px rgba(0, 0, 0, 0.35), 0 2px 8px -2px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: box-shadow 260ms var(--ease), transform 260ms var(--ease-out), border-radius 260ms var(--ease);
}
[data-theme="dark"] .ask-bar { background: color-mix(in srgb, #1b1b1b 78%, transparent); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 18px 50px -18px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.ask-bar:focus-within { box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 16%, transparent), 0 24px 60px -18px rgba(0, 0, 0, 0.4), 0 0 0 6px color-mix(in srgb, var(--text) 5%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.ask-bar.has-atts { border-radius: 22px; }
.ask-bar.is-dragover, body.is-card-drag .ask-bar { transform: scale(1.03); box-shadow: 0 0 0 2px var(--text), 0 24px 60px -18px rgba(0, 0, 0, 0.4); }
.ask-mark { display: grid; place-items: center; width: 22px; flex-shrink: 0; color: var(--text); }
.ask-mark i { font-size: 18px; transition: transform 400ms var(--ease-spring); }
.ask-bar:focus-within .ask-mark i { transform: rotate(18deg) scale(1.06); }
/* Thinking: the mark breathes and a soft sheen runs along the edge. */
.ask-bar.is-thinking .ask-mark i { animation: ask-breathe 1.1s var(--ease) infinite; }
.ask-bar::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: 0; transition: opacity 240ms;
  background: conic-gradient(from var(--ask-a, 0deg), transparent 0 55%, #ff9a6b 68%, #f36bb2 76%, #8a70ff 84%, #4aa8ff 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.ask-bar.is-thinking::after { opacity: 1; animation: ask-spin 1.6s linear infinite; }
@property --ask-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes ask-spin { to { --ask-a: 360deg; } }
@keyframes ask-breathe { 50% { transform: scale(0.82) rotate(-12deg); opacity: 0.6; } }
.ask-bar .search-input {
  flex: 1; min-width: 0; height: 42px; padding: 0 8px 0 10px; border: none; border-radius: 0; background: none; box-shadow: none;
  font-size: var(--fs-md); letter-spacing: -0.005em; color: var(--text);
}
.ask-bar .search-input:focus { background: none; border: none; box-shadow: none; }
.ask-bar .search-input::placeholder { color: var(--text-3); }
.ask-bar.in-session .search-input::placeholder { color: var(--text-4); }
.ask-bar .search-right { position: static; transform: none; gap: 2px; flex-shrink: 0; }
.ask-bar .search-clear, .ask-icon { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text-3); transition: background var(--t-fast), color var(--t-fast); }
.ask-bar .search-clear:hover, .ask-icon:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.ask-icon i, .ask-bar .search-clear i { font-size: 18px; }
.ask-bar:not(.has-value):not(.in-session) .search-clear { display: none; }
/* Ask appears only when there's something to ask. */
.ask-go {
  height: 42px; padding: 0 18px; border-radius: 21px; margin-left: 4px; font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em;
  color: var(--bg); background: var(--text); transition: transform var(--t-fast) var(--ease-out), opacity var(--t-fast);
}
.ask-go:active { transform: scale(0.96); }
.ask-bar:not(.has-value):not(.has-atts) .ask-go { display: none; }
.ask-bar:is(.has-value, .has-atts) .ask-go { animation: pop-in 220ms var(--ease-out) both; }
.ask-bar .search-ai:not(.is-loading) { display: none; }
.ask-atts { display: none; gap: 6px; margin-left: 8px; }
.ask-bar.has-atts .ask-atts { display: flex; }
.ask-att { position: relative; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; flex-shrink: 0; animation: rise 240ms var(--ease-out) both; }
.ask-att img { width: 100%; height: 100%; object-fit: cover; }
.ask-att button { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.62); color: #fff; }
.ask-att button i { font-size: 9px; }
.ask .suggest { top: auto; bottom: calc(100% + 10px); border-radius: 18px; }

.ask-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; width: max-content; max-width: min(980px, calc(100vw - 24px)); }
.ask-chips:empty { display: none; }
.ask-token, .ask-chip {
  height: 32px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: var(--fs-sm); white-space: nowrap;
  background: color-mix(in srgb, var(--bg) 76%, transparent); backdrop-filter: blur(18px) saturate(180%); -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 9%, transparent), 0 6px 18px -10px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .ask-token, [data-theme="dark"] .ask-chip { background: color-mix(in srgb, #1b1b1b 80%, transparent); }
.ask-token { padding: 0 4px 0 12px; font-weight: 500; animation: rise 280ms var(--ease-out) both; }
.ask-token.is-base { background: var(--text); color: var(--bg); box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.4); }
.ask-token-neg { color: var(--text-3); font-weight: 400; }
.ask-token-x { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; opacity: 0.55; transition: opacity var(--t-fast), background var(--t-fast); }
.ask-token-x:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.ask-token-x i { font-size: 10px; }
.ask-token-thumbs { display: flex; margin-left: -8px; }
.ask-token-thumbs img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; box-shadow: 0 0 0 1.5px var(--bg); }
.ask-token-thumbs img + img { margin-left: -8px; }
.ask-chip { padding: 0 13px 0 11px; color: var(--text-2); font-weight: 500; transition: color var(--t-fast), transform var(--t-fast) var(--ease), background var(--t-fast); }
.ask-chip:hover { color: var(--text); transform: translateY(-1px); }
.ask-chip:active { transform: scale(0.96); }
.ask-chip i { font-size: 12px; color: var(--text-3); }
.ask-chip.is-primary { background: var(--text); color: var(--bg); }
.ask-chip.is-primary i { color: inherit; }
.ask-swatch { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }


/* ---------- Answer heading: your conversation, as the title ---------- */
.answer-head { display: flex; flex-direction: column; gap: 12px; animation: rise 420ms var(--ease-out) both; }
.answer-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.answer-spark { font-size: 18px; color: var(--text-3); margin-right: 2px; }
.answer-count { font-size: var(--fs-md); color: var(--text-4); font-variant-numeric: tabular-nums; margin-left: 2px; }
.search-q { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.035em; }
.answer-head .ask-token {
  height: 38px; padding: 0 6px 0 14px; background: var(--bg-2); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none;
  font-size: var(--fs-md); font-weight: 500; color: var(--text); animation: rise 320ms var(--ease-out) both;
}
[data-theme="dark"] .answer-head .ask-token { background: var(--bg-2); }
.answer-head .ask-token.is-base { height: auto; padding: 0 4px 0 0; background: none; font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; }
.answer-head .ask-token.is-base .ask-token-x { opacity: 0; width: 0; overflow: hidden; transition: opacity var(--t-fast), width var(--t-fast); }
.answer-head .ask-token.is-base:hover .ask-token-x { width: 24px; }
.answer-head .ask-token.is-base:hover .ask-token-x { opacity: 0.5; }
.answer-head .ask-token.is-ref { padding-left: 6px; }
.ask-token-op { color: var(--text-3); font-weight: 400; margin-right: -1px; }
.answer-head .ask-token-thumbs { margin-left: 0; }
.answer-head .ask-token-thumbs img { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 0 0 2px var(--bg-2); }
.answer-more { display: flex; flex-wrap: wrap; gap: 6px; }
.answer-head .ask-chip, .page-head .ask-chip {
  height: 30px; padding: 0 12px 0 10px; background: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: inset 0 0 0 1px var(--line-2); font-size: var(--fs-sm); color: var(--text-2);
}
.answer-head .ask-chip:hover, .page-head .ask-chip:hover { background: var(--bg-2); color: var(--text); transform: none; }
.page-tags .answer-count { margin-left: 4px; font-size: var(--fs-sm); }
.page-tags .chip-quiet { pointer-events: auto; }

/* Hero row + why line (answers) */
.card.is-hero { border-radius: 18px; }
.card-why {
  position: absolute; left: 12px; right: 52px; bottom: 11px; display: flex; align-items: center; gap: 6px; pointer-events: none;
  color: #fff; font-size: var(--fs-xs); font-weight: 500; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  opacity: 0; transform: translateY(4px); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.card-why i { font-size: 11px; opacity: 0.85; }
.card-why span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card:has(.card-why) .card-author { display: none; }
@media (hover: hover) { .card:hover .card-why { opacity: 1; transform: none; } }
.card.is-hero .card-why { font-size: var(--fs-sm); left: 16px; bottom: 14px; }
.gather-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.gather-layer .card-ghost { position: fixed; margin: 0; }

/* Tray: picks inside the ask bar */
.ask-tray { display: none; align-items: center; gap: 8px; padding-right: 6px; margin-right: 2px; border-right: 1px solid color-mix(in srgb, var(--text) 10%, transparent); flex-shrink: 0; }
.ask-bar.has-tray .ask-tray { display: flex; animation: rise 280ms var(--ease-out) both; }
.ask-bar.has-tray { padding-left: 10px; }
.ask-bar.has-tray .ask-mark { display: none; }
.tray-stack { display: flex; padding-left: 6px; }
.tray-stack img { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; margin-left: -12px; box-shadow: 0 0 0 2px var(--bg), 0 2px 6px rgba(0, 0, 0, 0.15); background: var(--bg-2); }
.tray-stack img:nth-child(1) { transform: rotate(-5deg); z-index: 3; }
.tray-stack img:nth-child(2) { transform: rotate(4deg) translateY(1px); z-index: 2; }
.tray-stack img:nth-child(3) { transform: rotate(-2deg); z-index: 1; }
.tray-count { font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 12px; }
.tray-make { height: 34px; padding: 0 14px; border-radius: 17px; background: var(--text); color: var(--bg); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; transition: transform var(--t-fast) var(--ease); }
.tray-make:active { transform: scale(0.95); }
.tray-more { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); }
.tray-more:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
@media (max-width: 899px) {
  .ask-go { padding: 0 16px; }
  .ask-bar .search-ai:not(.is-loading) { display: none; }
  .ask-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; width: calc(100vw - 24px); scrollbar-width: none; padding: 2px; }
  .ask-chips::-webkit-scrollbar { display: none; }
  .ask-chip { flex-shrink: 0; }
}
@media (max-width: 600px) { .header-actions .sort-btn { display: none; } }
/* More → Sources */
.src-pop { width: min(380px, calc(100vw - 24px)); padding: 6px; }
.src-sec { padding: 12px 12px 14px; }
.src-sec + .src-sec { border-top: 1px solid color-mix(in srgb, var(--text) 6%, transparent); }
.src-title { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 6px; }
.src-title em, .src-row em { font-style: normal; font-weight: 400; color: var(--text-4); font-size: var(--fs-xs); margin-left: 8px; font-variant-numeric: tabular-nums; }
.src-note { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; margin-bottom: 10px; }
.src-bookmarklet {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px 0 12px; border-radius: 18px; cursor: grab;
  background: var(--text); color: var(--bg); font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-md);
  transition: transform var(--t-fast) var(--ease-out);
}
.src-bookmarklet:active { cursor: grabbing; transform: scale(0.97); }
.src-bookmarklet .mark { width: 16px; height: 16px; }
.src-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); cursor: pointer; }
.src-chans { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.src-chans:empty { display: none; }
.src-x { display: inline-grid; place-items: center; }
.src-add { display: flex; gap: 6px; }
.src-input { flex: 1; min-width: 0; height: 36px; padding: 0 14px; border-radius: 18px; border: none; outline: none; background: var(--bg-2); font-size: var(--fs-sm); color: var(--text); }
.src-input:focus { box-shadow: 0 0 0 4px var(--focus); }
.src-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 8px; font-size: var(--fs-xs); color: var(--text-4); border-top: 1px solid color-mix(in srgb, var(--text) 6%, transparent); }
.tag-quiet { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-3); }
.hidden-title { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-md); font-weight: 600; margin-right: 4px; }
.hidden-title i { font-size: 16px; color: var(--text-3); }
/* Syncing: the logo's circle breathes until the Mac reports back. */
@keyframes sync-breathe { 50% { transform: scale(0.62); opacity: 0.55; } }
.fly-ghost { position: fixed; z-index: 170; object-fit: cover; pointer-events: none; border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.45); will-change: transform; }
@media (max-width: 720px) {
  .brand-name { display: none; }
  .header { gap: 10px; }
  .header-actions .icon-btn { width: 34px; }
  .ask-bar.has-tray .search-input { min-width: 60px; }
  .tray-make { padding: 0 11px; }
  .search-q, .answer-head .ask-token.is-base { font-size: var(--fs-xl); }
}

.file-drop { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; pointer-events: none; opacity: 0; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(6px); transition: opacity 160ms var(--ease); }
.file-drop > div { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: var(--fs-sm); padding: 32px 44px; border-radius: 22px; border: 1.5px dashed var(--text-4); background: var(--bg); box-shadow: var(--shadow-lg); }
.file-drop i { font-size: 30px; color: var(--text-2); }
body.is-file-drag .file-drop { opacity: 1; }


@media (max-width: 1100px) {
  :root { --pad-x: 28px; --gap: 16px; }
  .detail-top { grid-template-columns: minmax(0, 1fr) 360px; }
  .builder-body { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 820px) {
  :root { --pad-x: 16px; --gap: 10px; --header-h: 60px; }
  .brand-name, .header-actions .hide-sm, .pill-label { display: none; }
  .header { gap: 8px; }
  .pill-btn { padding: 0 11px; }
  .search-input { padding-right: 44px; }
  .search .kbd { display: none; }
  .detail-top { grid-template-columns: 1fr; height: auto; }
  .detail { --peek: 0px; }
  .detail-stage { position: relative; height: auto; min-height: 56vh; padding: 20px; }
  .detail-media img, .detail-media video { max-height: 70vh; }
  .detail-panel { border-left: none; min-height: 0; padding: 20px 16px 28px; overflow: visible; }
  .detail-hint { display: none; }
  .modal-backdrop { padding: 0; }
  .builder { border-radius: 0; }
  .builder-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .inspector { border-left: none; border-top: 1px solid var(--line); max-height: 38vh; }
  .page-title { font-size: 19px; }
  .select-bar { bottom: 12px; }
  .select-bar .btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.boards-btn .badge:empty { display: none; }
