/* --------------------------------------------------------------------------
   Sift — a private image board
   A quiet, analog-feeling archive: paper, ink, moss, and a little clay.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/fraunces-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 100%;
  font-display: swap;
  src: url("assets/fonts/instrument-sans-latin.woff2") format("woff2");
}

:root {
  --paper: #f2eee4;
  --paper-raised: #fbf8f0;
  --paper-sunk: #e8e1d2;
  --ink: #20221d;
  --ink-2: #50554a;
  --ink-3: #787c6f;
  --line: #d6cfbd;
  --line-strong: #b6ae9a;
  --moss: #365a43;
  --moss-ink: #f3eee2;
  --moss-soft: #dfe7da;
  --clay: #b25e44;
  --clay-soft: #f0ddd4;
  --gold: #a58136;
  --card: #fbf8f0;
  --overlay: rgba(22, 24, 19, 0.58);
  --shadow-soft: 0 1px 1px rgba(52, 48, 36, 0.04), 0 8px 24px rgba(52, 48, 36, 0.05);
  --shadow-lift: 0 2px 3px rgba(52, 48, 36, 0.05), 0 20px 44px rgba(52, 48, 36, 0.12);
  --shadow-dialog: 0 40px 100px rgba(36, 33, 24, 0.24), 0 3px 12px rgba(36, 33, 24, 0.08);
  --grain-opacity: 0.035;
  --radius: 5px;
  --topbar-h: 76px;
  --sidebar-w: 256px;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dusk"] {
  --paper: #151712;
  --paper-raised: #1c1f18;
  --paper-sunk: #10120e;
  --ink: #eae5d7;
  --ink-2: #b6b7a8;
  --ink-3: #898d7f;
  --line: #33372b;
  --line-strong: #505544;
  --moss: #9bc1a5;
  --moss-ink: #10130e;
  --moss-soft: #26342a;
  --clay: #dc9074;
  --clay-soft: #3a2922;
  --gold: #c7a45c;
  --card: #1b1e17;
  --overlay: rgba(0, 0, 0, 0.7);
  --shadow-soft: 0 1px 1px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-lift: 0 2px 3px rgba(0, 0, 0, 0.35), 0 20px 44px rgba(0, 0, 0, 0.34);
  --shadow-dialog: 0 40px 100px rgba(0, 0, 0, 0.6), 0 3px 12px rgba(0, 0, 0, 0.4);
  --grain-opacity: 0.06;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 760px at 92% -8%, rgba(178, 94, 68, 0.07), transparent 62%),
    radial-gradient(900px 680px at -8% 18%, rgba(54, 90, 67, 0.08), transparent 60%);
  background-attachment: fixed;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="dusk"] body {
  background-image:
    radial-gradient(1100px 760px at 92% -8%, rgba(220, 144, 116, 0.055), transparent 62%),
    radial-gradient(900px 680px at -8% 18%, rgba(155, 193, 165, 0.055), transparent 60%);
}

body.nav-open {
  overflow: hidden;
}

::selection {
  background: var(--moss);
  color: var(--paper-raised);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper-raised);
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: none;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Chrome
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 22px;
  height: var(--topbar-h);
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: var(--moss);
  stroke-width: 2;
  stroke-linecap: round;
  transition: transform 0.7s var(--ease);
}

.brand-mark circle {
  fill: var(--clay);
  stroke: var(--clay);
}

.brand:hover .brand-mark {
  transform: rotate(45deg);
}

.brand-word {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 380;
  letter-spacing: -0.055em;
  line-height: 1;
}

.brand-tag {
  max-width: 82px;
  margin-left: 1px;
  padding-left: 13px;
  border-left: 1px solid var(--line-strong);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 400px;
  max-width: 640px;
  height: 46px;
  padding: 0 5px 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-raised) 82%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

[data-theme="dusk"] .search {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.search:focus-within {
  border-color: var(--moss);
  background: var(--paper-raised);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--moss) 13%, transparent);
}

.search-icon {
  color: var(--ink-3);
  width: 18px;
  height: 18px;
}

.search input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14.5px;
  outline: none;
}

.search input::placeholder {
  color: var(--ink-3);
  opacity: 0.8;
}

.search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
}

.search-submit {
  height: 36px;
  margin-left: 6px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  background: var(--moss);
  color: var(--moss-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.search-submit:hover {
  background: color-mix(in srgb, var(--moss) 86%, var(--ink));
}

.search-submit:active {
  transform: scale(0.97);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}

.icon-btn:hover {
  border-color: var(--line);
  background: var(--paper-raised);
  color: var(--ink);
}

.icon-btn:active {
  transform: scale(0.94);
}

.menu-btn {
  display: none;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  margin-right: 5px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.privacy-pill .icon {
  width: 14px;
  height: 14px;
  color: var(--moss);
}

.privacy-pill:hover {
  border-color: var(--moss);
  background: var(--moss-soft);
  color: var(--ink);
}

.privacy-pill.is-protected {
  border-color: color-mix(in srgb, var(--moss) 55%, var(--line));
  background: var(--moss-soft);
  color: var(--moss);
}

.privacy-pill.is-exposed {
  border-color: color-mix(in srgb, var(--clay) 55%, var(--line));
  background: var(--clay-soft);
  color: var(--clay);
}

.privacy-pill.is-exposed .icon {
  color: var(--clay);
}

.privacy-pill.is-unknown {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
  background: color-mix(in srgb, var(--gold) 12%, var(--paper-raised));
  color: var(--gold);
}

.privacy-pill.is-unknown .icon {
  color: var(--gold);
}

/* --------------------------------------------------------------------------
   Shell + sidebar
   -------------------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h));
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  display: flex;
  flex-direction: column;
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 52%, transparent);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 30px 18px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav > .eyebrow {
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.nav-item .icon {
  width: 17px;
  height: 17px;
  color: var(--ink-3);
}

.nav-item:hover {
  background: color-mix(in srgb, var(--paper-raised) 72%, transparent);
  color: var(--ink);
}

.nav-item.is-active {
  background: var(--moss-soft);
  color: var(--moss);
  font-weight: 600;
}

.nav-item.is-active .icon {
  color: var(--moss);
}

.nav-count {
  min-width: 18px;
  margin-left: auto;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  text-align: right;
}

.nav-item.is-active .nav-count {
  color: var(--moss);
  opacity: 0.8;
}

.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 4px 7px 12px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}

.mini-btn .icon {
  width: 14px;
  height: 14px;
}

.mini-btn:hover {
  border-color: var(--line);
  background: var(--paper-raised);
  color: var(--ink);
}

.board-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.board-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.board-item:hover {
  background: color-mix(in srgb, var(--paper-raised) 72%, transparent);
  color: var(--ink);
}

.board-item.is-active {
  background: var(--moss-soft);
  color: var(--moss);
  font-weight: 600;
}

.board-swatch {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--swatch, var(--moss));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--swatch, var(--moss)) 14%, transparent);
}

.board-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-item .nav-count {
  margin-left: auto;
}

.new-board-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  margin-top: 2px;
  padding: 0 12px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.new-board-link .icon {
  width: 15px;
  height: 15px;
}

.new-board-link:hover {
  border-color: var(--moss);
  background: var(--moss-soft);
  color: var(--moss);
}

.sidebar-note {
  position: relative;
  margin: 34px 10px 0;
  padding: 16px 15px 15px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: color-mix(in srgb, var(--paper-raised) 54%, transparent);
  transform: rotate(-0.45deg);
}

.note-pin {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--clay);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sidebar-note p {
  margin: 0;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.6;
}

.sidebar-note strong {
  color: var(--ink-2);
  font-weight: 600;
}

.sidebar-foot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 12px 13px;
  border-top: 1px solid var(--line);
}

.sidebar-foot button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  height: 34px;
  padding: 0 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.sidebar-foot button .icon {
  width: 13px;
  height: 13px;
}

.sidebar-foot button:hover {
  background: var(--paper-raised);
  color: var(--ink);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.sidebar-close {
  display: none;
}

/* --------------------------------------------------------------------------
   Main canvas
   -------------------------------------------------------------------------- */

.view {
  min-width: 0;
  padding: 44px clamp(26px, 3.6vw, 58px) 110px;
  outline: none;
}

.view-inner {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
}

.view-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.7rem, 5.7vw, 5.5rem);
  font-weight: 320;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.view-title em {
  color: var(--moss);
  font-weight: 320;
}

.view-sub {
  max-width: 60ch;
  margin: 15px 0 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.65;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 58px 0 22px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.section-head .eyebrow {
  margin-bottom: 5px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.7rem, 2.7vw, 2.6rem);
  font-weight: 340;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.section-head p {
  max-width: 48ch;
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.5;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   Buttons, chips, fields
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--moss);
  color: var(--moss-ink);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--moss) 84%, var(--ink));
}

.btn-quiet {
  border-color: var(--line);
  background: var(--paper-raised);
  color: var(--ink-2);
}

.btn-quiet:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-danger {
  border-color: color-mix(in srgb, var(--clay) 32%, transparent);
  color: var(--clay);
}

.btn-danger:hover {
  border-color: var(--clay);
  background: var(--clay-soft);
}

.btn-small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 11.5px;
}

.ghost-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--moss);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ghost-action .icon {
  width: 15px;
  height: 15px;
}

.ghost-action:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.icon-action .icon {
  width: 14px;
  height: 14px;
}

.icon-action:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.icon-action:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.chip:hover {
  border-color: var(--moss);
  background: var(--moss-soft);
  color: var(--moss);
}

.chip.is-active {
  border-color: var(--moss);
  background: var(--moss);
  color: var(--moss-ink);
}

.seed-chip {
  display: inline-flex;
  align-items: center;
  max-width: 250px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seed-chip::before {
  content: "#";
  margin-right: 4px;
  color: var(--clay);
}

.seed-chip.is-active {
  border-color: var(--moss);
  background: var(--moss-soft);
  color: var(--moss);
}

/* Feed mix + source mix chips */

.feed-mix {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-raised);
}

.mix-chip {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.mix-chip:hover {
  color: var(--ink);
}

.mix-chip.is-active {
  background: var(--moss);
  color: var(--moss-ink);
}

.source-mix {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper-raised) 66%, transparent);
}

.source-mix-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-mix-label .icon {
  width: 13px;
  height: 13px;
  color: var(--moss);
}

.source-mix-buttons {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 200px;
}

.source-chip {
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.source-chip:hover {
  border-color: var(--moss);
  color: var(--moss);
}

.source-chip.is-active {
  border-color: var(--moss);
  background: var(--moss);
  color: var(--moss-ink);
}

/* --------------------------------------------------------------------------
   Empty / home hero
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.78fr);
  align-items: center;
  gap: clamp(30px, 5vw, 80px);
  min-height: calc(100vh - var(--topbar-h) - 175px);
  padding: 16px 0 30px;
}

.hero-copy {
  max-width: 760px;
}

.hero .eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.hero .eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--clay);
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.5rem, 8.2vw, 7.3rem);
  font-weight: 300;
  line-height: 0.88;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.hero h1 em {
  color: var(--moss);
  font-style: italic;
  font-weight: 300;
}

.hero-lead {
  max-width: 52ch;
  margin: 26px 0 0;
  color: var(--ink-2);
  font-size: clamp(14px, 1.15vw, 16px);
  line-height: 1.7;
}

.hero-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 640px;
  height: 64px;
  margin-top: 34px;
  padding: 0 7px 0 21px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper-raised);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.hero-search:focus-within {
  border-color: var(--moss);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--moss) 12%, transparent), var(--shadow-soft);
}

.hero-search .icon {
  width: 21px;
  height: 21px;
  color: var(--ink-3);
}

.hero-search input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  outline: none;
}

.hero-search input::placeholder {
  color: var(--ink-3);
}

.hero-search button {
  height: 50px;
  padding: 0 23px;
  border: 0;
  border-radius: 6px;
  background: var(--moss);
  color: var(--moss-ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search button:hover {
  background: color-mix(in srgb, var(--moss) 84%, var(--ink));
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 17px;
}

.search-suggestions > span {
  margin-right: 2px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-footnote {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin-top: 38px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-footnote span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-footnote span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--moss);
}

/* Specimen collage */

.specimen {
  position: relative;
  width: min(100%, 460px);
  height: 500px;
  margin-left: auto;
}

.specimen-card {
  position: absolute;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line-strong) 88%, transparent);
  background: var(--paper-raised);
  box-shadow: 0 22px 55px rgba(54, 48, 33, 0.16), 0 2px 5px rgba(54, 48, 33, 0.1);
  transition: transform 0.7s var(--ease);
}

.specimen:hover .specimen-card.a {
  transform: rotate(-8deg) translate(-4px, -3px);
}

.specimen:hover .specimen-card.b {
  transform: rotate(7deg) translate(4px, -2px);
}

.specimen:hover .specimen-card.c {
  transform: rotate(1deg) translateY(3px);
}

.specimen-card.a {
  top: 10px;
  left: 4%;
  width: 64%;
  height: 76%;
  transform: rotate(-5deg);
  background:
    radial-gradient(90% 70% at 80% 10%, rgba(255, 248, 226, 0.55), transparent 55%),
    linear-gradient(160deg, #d9c9aa 0%, #c7b28d 56%, #ab9670 100%);
}

.specimen-card.a::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(63, 52, 34, 0.23);
  pointer-events: none;
}

.specimen-card.b {
  right: 1%;
  bottom: 5%;
  width: 51%;
  height: 61%;
  transform: rotate(5deg);
  background:
    radial-gradient(120% 80% at 90% 10%, rgba(200, 220, 193, 0.22), transparent 55%),
    linear-gradient(150deg, #426a51, #2b4836 70%);
}

.specimen-card.c {
  left: 1%;
  bottom: 0;
  width: 39%;
  height: 31%;
  transform: rotate(-1.5deg);
  background: #f6f0df;
}

.specimen-label {
  position: absolute;
  z-index: 2;
  color: #f4efdf;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  line-height: 1.6;
  text-transform: uppercase;
}

.specimen-card.a .specimen-label {
  top: 26px;
  left: 27px;
  color: rgba(54, 45, 29, 0.7);
}

.specimen-card.b .specimen-label {
  top: 25px;
  left: 24px;
}

.specimen-no {
  position: absolute;
  right: 22px;
  bottom: 20px;
  color: rgba(244, 239, 223, 0.46);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.specimen-card.c .specimen-copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 18px 17px;
}

.specimen-copy strong {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 350;
  line-height: 1;
  letter-spacing: -0.035em;
}

.specimen-copy small {
  color: #8b7d63;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.09em;
  line-height: 1.6;
  text-transform: uppercase;
}

.botanical {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.botanical path,
.botanical circle,
.botanical ellipse {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.botanical .leaf {
  fill: rgba(239, 233, 213, 0.09);
}

.botanical-a {
  color: rgba(66, 53, 32, 0.58);
}

.botanical-b {
  color: rgba(239, 233, 213, 0.64);
}

.image-fallback-note {
  display: block;
  padding: 20px 12px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
}

.pin-media.is-fallback,
.related-card.is-fallback,
.detail-media.is-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.detail-media.is-fallback {
  min-height: 320px;
}

.save-preview.is-fallback {
  min-height: 58px;
}

.specimen-tack {
  position: absolute;
  z-index: 3;
  top: 1px;
  left: 50%;
  width: 13px;
  height: 13px;
  margin-left: -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #d88d72, #a1462e 68%);
  box-shadow: 0 2px 4px rgba(70, 37, 26, 0.4);
}

/* Compact home hero */

.home-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 5px 0 0;
}

.home-intro .view-title {
  font-size: clamp(2.6rem, 5vw, 4.7rem);
}

.greeting {
  display: flex;
  align-items: center;
  gap: 9px;
}

.greeting::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--clay);
}

.home-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding-bottom: 9px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-stat strong {
  color: var(--ink);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 360;
  letter-spacing: -0.04em;
}

/* --------------------------------------------------------------------------
   Masonry + pin cards
   -------------------------------------------------------------------------- */

.masonry {
  columns: 4;
  column-gap: 20px;
}

.pin-card {
  position: relative;
  break-inside: avoid;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.25s;
}

.pin-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.pin-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: var(--paper-sunk);
  cursor: zoom-in;
}

.pin-media {
  position: relative;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(100% 100% at 20% 15%, rgba(255, 255, 255, 0.16), transparent 55%),
    var(--paper-sunk);
}

.pin-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.85s var(--ease), opacity 0.35s;
}

.pin-card:hover .pin-media img {
  transform: scale(1.035);
}

.pin-media.is-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--ink-3);
}

.pin-media.is-fallback .icon {
  width: 28px;
  height: 28px;
  opacity: 0.6;
}

.pin-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s;
}

.pin-card:hover .pin-actions,
.pin-card:focus-within .pin-actions {
  opacity: 1;
  transform: none;
}

.save-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-raised) 94%, transparent);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(6px);
  transition: background 0.18s, color 0.18s;
}

.save-btn .icon {
  width: 13px;
  height: 13px;
}

.save-btn:hover {
  background: var(--moss);
  color: var(--moss-ink);
}

.save-btn.is-saved {
  background: var(--moss);
  color: var(--moss-ink);
}

.source-flag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  max-width: calc(100% - 20px);
  padding: 4px 8px;
  border-radius: 3px;
  background: rgba(16, 18, 14, 0.48);
  color: rgba(255, 255, 255, 0.84);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.2s, transform 0.2s;
  backdrop-filter: blur(5px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-card:hover .source-flag,
.pin-card:focus-within .source-flag {
  opacity: 1;
  transform: none;
}

.pin-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 11px 10px;
}

.pin-caption-text {
  min-width: 0;
  flex: 1;
}

.pin-title {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-meta {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.pin-caption .icon {
  width: 14px;
  height: 14px;
  color: var(--ink-3);
}

.board-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 0 11px 9px;
  padding: 3px 7px;
  border-radius: 3px;
  background: var(--moss-soft);
  color: var(--moss);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Loader + empty cards */

.skeleton-card {
  break-inside: avoid;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--paper-sunk) 20%, var(--paper-raised) 40%, var(--paper-sunk) 60%);
  background-size: 220% 100%;
  animation: shimmer 1.8s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

.empty-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 50px 26px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: color-mix(in srgb, var(--paper-raised) 34%, transparent);
  text-align: center;
}

.empty-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  pointer-events: none;
}

.empty-inner {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.empty-mark {
  width: 55px;
  height: 55px;
  margin: 0 auto 18px;
  fill: none;
  stroke: var(--moss);
  stroke-width: 2;
  stroke-linecap: round;
}

.empty-mark circle {
  fill: var(--clay);
  stroke: var(--clay);
}

.empty-panel h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 340;
  letter-spacing: -0.035em;
}

.empty-panel p {
  margin: 0 auto;
  max-width: 40ch;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.65;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 22px;
}

.load-error {
  padding: 34px;
  border: 1px solid color-mix(in srgb, var(--clay) 28%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--clay-soft) 32%, transparent);
}

.load-error h3 {
  margin: 0 0 7px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
}

.load-error p {
  max-width: 60ch;
  margin: 0 0 16px;
  color: var(--ink-2);
  font-size: 13px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 3px;
  background: color-mix(in srgb, var(--paper-raised) 52%, transparent);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.55;
}

.notice .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--gold);
}

.spinner-mark {
  width: 34px;
  height: 34px;
  margin: 0 auto 16px;
  fill: none;
  stroke: var(--moss);
  stroke-width: 2;
  stroke-linecap: round;
  animation: spin 2.4s linear infinite;
}

.spinner-mark circle {
  fill: var(--clay);
  stroke: var(--clay);
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.loading-copy {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Search view
   -------------------------------------------------------------------------- */

.search-view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.search-view-head .view-title {
  max-width: 1000px;
  font-size: clamp(2.6rem, 6.3vw, 5.8rem);
  overflow-wrap: anywhere;
}

.search-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 13px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.engine-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper-raised) 66%, transparent);
}

.engine-strip-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.engine-strip-label .icon {
  width: 13px;
  height: 13px;
  color: var(--moss);
}

.engine-buttons {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 220px;
}

.engine-btn {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.engine-btn:hover {
  border-color: var(--moss);
  color: var(--moss);
}

.buffer-section {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.buffer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.buffer-head h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 350;
  letter-spacing: -0.035em;
}

.buffer-head p:not(.eyebrow) {
  max-width: 580px;
  margin: 6px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.55;
}

.results-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding-bottom: 3px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 36px 0 0;
}

.feed-sentinel,
.feed-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 38px 0 22px;
  text-align: center;
}

.feed-sentinel p,
.feed-end p {
  max-width: 480px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.55;
}

.feed-end {
  border-top: 1px solid var(--line);
  margin-top: 34px;
}

/* --------------------------------------------------------------------------
   Board view
   -------------------------------------------------------------------------- */

.board-head {
  position: relative;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.board-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.board-title-wrap {
  min-width: 0;
}

.board-title-row .view-title {
  max-width: 1000px;
  overflow-wrap: anywhere;
}

.board-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 15px;
  margin-top: 14px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.board-sub .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-raised) 72%, transparent);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.tag-chip span {
  color: var(--ink-3);
  font-size: 7.5px;
}

.tag-chip:hover {
  border-color: var(--moss);
  color: var(--moss);
}

.default-badge,
.privacy-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--moss) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--moss) 8%, transparent);
  color: var(--moss);
  font-family: var(--mono);
  font-size: 7.5px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.default-badge {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.privacy-badge.is-private {
  border-color: color-mix(in srgb, var(--clay) 38%, transparent);
  background: color-mix(in srgb, var(--clay) 7%, transparent);
  color: var(--clay);
  text-transform: none;
}

.lock-badge {
  display: inline-flex;
  margin-left: 6px;
  color: var(--clay);
}

.lock-badge .icon {
  width: 11px;
  height: 11px;
}

.board-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-top: 10px;
}

.board-menu-wrap {
  position: relative;
}

.menu-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-raised);
  box-shadow: var(--shadow-lift);
}

.menu-popover button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.menu-popover button .icon {
  width: 15px;
  height: 15px;
}

.menu-popover button:hover {
  background: var(--paper-sunk);
  color: var(--ink);
}

.menu-popover button.is-danger {
  color: var(--clay);
}

.menu-popover button.is-danger:hover {
  background: var(--clay-soft);
}

.seed-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.board-pins {
  margin-top: 26px;
}

.board-pins .pin-card,
#board-related .pin-card {
  border-radius: 14px;
}

.board-pins .pin-media,
#board-related .pin-media {
  border-radius: 12px;
}

/* --------------------------------------------------------------------------
   Dialogs
   -------------------------------------------------------------------------- */

.dialog {
  width: min(520px, calc(100vw - 34px));
  max-width: none;
  max-height: calc(100vh - 34px);
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.dialog::backdrop {
  background: var(--overlay);
  backdrop-filter: blur(4px);
}

.dialog[open] {
  animation: dialog-in 0.28s var(--ease);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

.dialog-inner {
  max-height: calc(100vh - 34px);
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-raised);
  box-shadow: var(--shadow-dialog);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 21px;
}

.dialog-head .eyebrow {
  margin-bottom: 5px;
}

.dialog-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 340;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.dialog-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: -4px -4px 0 0;
}

.dialog-close .icon {
  width: 18px;
  height: 18px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 25px;
}

.save-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
}

.save-preview img {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 3px;
  object-fit: cover;
}

.save-preview-text {
  min-width: 0;
}

.save-preview-text strong {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-preview-text span {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.save-boards {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 310px;
  overflow-y: auto;
}

.save-board {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
}

.save-board:hover {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.save-board .board-swatch {
  width: 9px;
  height: 9px;
}

.save-board-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-board-count {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 8px;
}

.save-board .icon {
  width: 15px;
  height: 15px;
  color: var(--moss);
}

.save-board.is-contained {
  background: var(--moss-soft);
  color: var(--moss);
}

.save-dialog .ghost-action {
  width: 100%;
  margin-top: 8px;
  padding-left: 10px;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.field {
  display: block;
  margin-bottom: 15px;
}

.field[hidden] {
  display: none;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.field > span em {
  color: var(--ink-3);
  font-style: normal;
  font-weight: 400;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: var(--moss);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--moss) 12%, transparent);
}

.field-hint {
  margin: 2px 0 0;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.5;
}

/* Detail dialog */

.detail-dialog {
  width: min(1100px, calc(100vw - 40px));
}

.detail-inner {
  padding: 0;
  overflow: hidden auto;
}

.detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(300px, 0.84fr);
  min-height: 470px;
}

.detail-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 470px;
  max-height: 72vh;
  padding: 22px;
  background:
    radial-gradient(100% 100% at 20% 0%, rgba(255, 255, 255, 0.18), transparent 45%),
    var(--paper-sunk);
  overflow: hidden;
}

.detail-media img {
  display: block;
  max-width: 100%;
  max-height: calc(72vh - 44px);
  border-radius: 2px;
  object-fit: contain;
  box-shadow: 0 16px 50px rgba(36, 33, 24, 0.22);
}

.detail-side {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 30px 30px 27px;
  border-left: 1px solid var(--line);
}

.detail-side .dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: color-mix(in srgb, var(--paper-raised) 78%, transparent);
}

.detail-side-head {
  padding-right: 32px;
}

.detail-side h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.5vw, 2.35rem);
  font-weight: 340;
  line-height: 1.08;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.detail-creator {
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 13px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 17px;
}

.detail-description {
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.55;
}

.detail-tags button,
.detail-tags span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.detail-tags button:hover {
  border-color: var(--moss);
  color: var(--moss);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
}

.detail-actions .btn {
  min-height: 40px;
  padding: 0 15px;
  font-size: 11.5px;
}

.detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin: auto 0 0;
  padding-top: 26px;
}

.detail-meta div {
  min-width: 0;
}

.detail-meta dt {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-meta dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
}

.detail-meta dd a {
  color: var(--moss);
}

.detail-remove {
  align-self: flex-start;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
}

.detail-remove:hover {
  color: var(--clay);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-related {
  padding: 27px 30px 32px;
  border-top: 1px solid var(--line);
  background: var(--paper-raised);
}

.detail-related-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
}

.detail-related-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 350;
  letter-spacing: -0.03em;
}

.detail-related-sub {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.45;
}

.detail-related > .tag-row {
  margin: 0 0 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.related-card {
  position: relative;
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper-sunk);
  cursor: zoom-in;
  overflow: hidden;
}

.related-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.related-card:hover img {
  transform: scale(1.04);
}

.related-empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

/* Web image capture */

.capture-steps {
  margin: 18px 0 0;
  border-top: 1px solid var(--line);
}

.capture-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.capture-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--moss);
  font-family: var(--mono);
  font-size: 9px;
}

.capture-step h3 {
  margin: 1px 0 5px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.capture-step p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.55;
}

.capture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.engine-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.capture-step .field.compact {
  margin: 12px 0 0;
}

.capture-step .field.compact input {
  height: 38px;
  font-size: 13px;
}

.capture-waiting {
  padding: 22px 0;
  text-align: center;
}

.capture-waiting .dialog-note {
  max-width: 430px;
  margin: 12px auto 16px;
}

/* Pinterest import */

.pinterest-dialog {
  width: min(620px, calc(100vw - 34px));
}

.pinterest-lede {
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.65;
}

.pinterest-steps {
  border-top: 1px solid var(--line);
}

.pinterest-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.pinterest-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--moss);
  font-family: var(--mono);
  font-size: 10px;
}

.pinterest-step-body h3 {
  margin: 2px 0 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.pinterest-step-body p {
  margin: 0 0 10px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.55;
}

.pinterest-step-body .field {
  margin: 8px 0 4px;
}

.pinterest-bookmark-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.bookmarklet-link {
  cursor: grab;
  text-decoration: none;
}

.bookmarklet-link:active {
  cursor: grabbing;
}

.bookmarklet-link[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
}

.pinterest-note {
  margin: 18px 0 0;
  padding: 11px 14px;
  border-left: 2px solid var(--gold);
  background: var(--paper-sunk);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.55;
}

.pinterest-waiting {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px 0 4px;
}

.pinterest-waiting p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
}

.pinterest-progress {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pinterest-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-sunk);
}

.pinterest-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--moss);
  transition: width 0.25s var(--ease);
}

.pinterest-progress-text {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pinterest-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 15px;
}

.pinterest-summary span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pinterest-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.pinterest-board-list {
  max-height: min(42vh, 340px);
  margin: 0 0 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-raised);
}

.pinterest-board-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.pinterest-board-row:last-child {
  border-bottom: 0;
}

.pinterest-board-row:hover {
  background: var(--paper-sunk);
}

.pinterest-board-row input {
  margin: 0;
  accent-color: var(--moss);
}

.pinterest-board-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pinterest-board-meta {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pinterest-warning,
.pinterest-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 11.5px;
  line-height: 1.5;
}

.pinterest-warning {
  background: var(--paper-sunk);
  color: var(--ink-2);
}

.pinterest-error {
  background: var(--clay-soft);
  color: var(--clay);
}

.pinterest-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 5px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

/* Prose + settings */

.prose-dialog {
  width: min(700px, calc(100vw - 34px));
}

.vpn-dialog {
  width: min(620px, calc(100vw - 34px));
}

.vpn-dialog .dialog-actions {
  gap: 6px;
}

.vpn-dialog .dialog-actions .btn {
  padding: 0 14px;
}

.vpn-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 6px;
  background: var(--paper-sunk);
}

.vpn-status strong {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.vpn-status p {
  margin: 3px 0 0;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.vpn-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--ink-3);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink-3) 18%, transparent);
}

.vpn-status.is-good {
  border-left-color: var(--moss);
}

.vpn-status.is-good .vpn-dot {
  background: var(--moss);
  box-shadow: 0 0 0 3px var(--moss-soft);
}

.vpn-status.is-warn {
  border-left-color: var(--clay);
}

.vpn-status.is-warn .vpn-dot {
  background: var(--clay);
  box-shadow: 0 0 0 3px var(--clay-soft);
}

.vpn-status.is-unknown {
  border-left-color: var(--gold);
}

.vpn-status.is-unknown .vpn-dot {
  background: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent);
}

.prose {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.7;
}

.prose .lede {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 23px;
  font-weight: 340;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.privacy-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.privacy-list li {
  position: relative;
  padding-left: 21px;
}

.privacy-list li::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 6px;
  height: 6px;
  border: 1px solid var(--clay);
  border-radius: 50%;
}

.privacy-list strong {
  color: var(--ink);
  font-weight: 600;
}

.prose code {
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--paper-sunk);
  font-family: var(--mono);
  font-size: 0.86em;
}

.prose-foot {
  margin: 22px 0 0;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 11.5px;
}

.settings-block {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.settings-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.settings-block h3 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.settings-copy {
  max-width: 58ch;
  margin: 0 0 12px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.65;
}

.settings-copy a {
  color: var(--moss);
}

.settings-copy.fine {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.segmented button {
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-size: 11.5px;
  cursor: pointer;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button.is-active {
  background: var(--moss);
  color: var(--moss-ink);
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 16px;
  border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper-raised);
  box-shadow: var(--shadow-lift);
  font-size: 12.5px;
  line-height: 1.45;
  animation: toast-in 0.3s var(--ease);
}

.toast[hidden] {
  display: none;
}

.toast button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.toast button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

/* --------------------------------------------------------------------------
   Controlled reveal
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 1500px) {
  .masonry {
    columns: 3;
  }
}

@media (max-width: 1180px) {
  .brand-tag {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.7fr);
    gap: 30px;
  }

  .specimen {
    height: 430px;
  }

  .related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .menu-btn {
    display: inline-flex;
  }

  .topbar {
    gap: 12px;
    padding: 0 16px;
  }

  .brand-tag {
    display: none;
  }

  .privacy-pill span {
    display: none;
  }

  .privacy-pill {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: min(326px, 88vw);
    height: 100dvh;
    border-right: 1px solid var(--line);
    background: var(--paper);
    transform: translateX(-105%);
    transition: transform 0.36s var(--ease);
  }

  body.nav-open .sidebar {
    transform: none;
  }

  .sidebar-close {
    display: inline-flex;
    position: absolute;
    top: 13px;
    right: 13px;
    z-index: 2;
  }

  .sidebar-scroll {
    padding-top: 26px;
  }

  .sidebar-foot {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .scrim[hidden] {
    display: none;
  }

  .view {
    padding: 34px 26px 90px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-top: 20px;
  }

  .specimen {
    display: none;
  }

  .masonry {
    columns: 2;
    column-gap: 16px;
  }

  .pin-card,
  .skeleton-card {
    margin-bottom: 16px;
  }

  .detail-top {
    grid-template-columns: 1fr;
  }

  .detail-media {
    min-height: 0;
    max-height: 50vh;
    padding: 14px;
  }

  .detail-media img {
    max-height: calc(50vh - 28px);
  }

  .detail-side {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .detail-side .dialog-close {
    top: 10px;
    right: 10px;
  }

  .detail-meta {
    margin-top: 24px;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-h: 124px;
  }

  .topbar {
    flex-wrap: wrap;
    align-content: center;
    gap: 7px 9px;
    height: auto;
    min-height: var(--topbar-h);
    padding: 11px 14px 10px;
  }

  .brand {
    order: 1;
    margin-right: auto;
  }

  .brand-word {
    font-size: 29px;
  }

  .brand-mark {
    width: 27px;
    height: 27px;
  }

  .menu-btn {
    order: 0;
    width: 38px;
    height: 38px;
  }

  .top-actions {
    order: 2;
    gap: 0;
  }

  .top-actions .icon-btn {
    width: 38px;
    height: 38px;
  }

  .privacy-pill {
    display: none;
  }

  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    height: 46px;
    padding-left: 14px;
  }

  .search kbd {
    display: none;
  }

  .search-submit {
    height: 36px;
    padding: 0 15px;
  }

  .view {
    padding: 26px 16px 80px;
  }

  .hero {
    padding: 10px 0 20px;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 15vw, 5rem);
  }

  .hero-lead {
    margin-top: 20px;
  }

  .hero-search {
    height: 56px;
    margin-top: 25px;
    padding-left: 16px;
  }

  .hero-search button {
    height: 44px;
    padding: 0 16px;
  }

  .hero-footnote {
    margin-top: 26px;
  }

  .home-intro {
    display: block;
  }

  .home-stat {
    margin-top: 16px;
    padding-bottom: 0;
  }

  .section-head {
    display: block;
    margin-top: 42px;
  }

  .section-actions {
    flex-wrap: wrap;
    margin-top: 14px;
  }

  .source-mix {
    display: block;
    padding: 12px;
  }

  .source-mix-label {
    margin-bottom: 9px;
  }

  .source-mix-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .source-chip {
    justify-content: center;
    text-align: center;
  }

  .search-view-head,
  .board-title-row {
    display: block;
  }

  .engine-strip {
    display: block;
    padding: 14px;
  }

  .engine-strip-label {
    margin-bottom: 10px;
  }

  .engine-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    margin-bottom: 10px;
  }

  .engine-btn {
    padding: 8px 6px;
    text-align: center;
  }

  .engine-strip > .btn {
    width: 100%;
  }

  .buffer-head {
    flex-direction: column;
    gap: 12px;
  }

  .results-tools,
  .board-tools {
    margin-top: 18px;
    padding-top: 0;
  }

  .board-tools {
    flex-wrap: wrap;
  }

  .view-title {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .masonry {
    column-gap: 11px;
  }

  .pin-card,
  .skeleton-card {
    margin-bottom: 11px;
  }

  .pin-caption {
    min-height: 34px;
    padding: 7px 8px 8px;
  }

  .pin-title {
    font-size: 10px;
  }

  .pin-meta {
    font-size: 6.5px;
  }

  .source-flag {
    display: none;
  }

  .pin-actions {
    top: 7px;
    right: 7px;
    opacity: 1;
    transform: none;
  }

  .save-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
  }

  .save-btn span {
    display: none;
  }

  .dialog {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
  }

  .dialog-inner {
    max-height: calc(100dvh - 18px);
    padding: 22px 18px;
    border-radius: 8px;
  }

  .detail-dialog {
    width: 100vw;
    max-height: 100dvh;
  }

  .detail-inner {
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .detail-media {
    max-height: 44vh;
    padding: 10px;
  }

  .detail-media img {
    max-height: calc(44vh - 20px);
  }

  .detail-side {
    padding: 23px 19px;
  }

  .detail-related {
    padding: 23px 19px 30px;
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-side h2 {
    font-size: 28px;
  }

  .detail-actions .btn {
    flex: 1;
    min-width: 120px;
  }

  .dialog-actions .btn {
    flex: 1;
  }

  .settings-actions .btn {
    flex: 1 1 100%;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }

  .empty-panel {
    min-height: 300px;
    padding: 42px 20px;
  }
}

@media (max-width: 390px) {
  .hero h1 {
    font-size: 3.1rem;
  }

  .hero-search input {
    padding: 0 9px;
    font-size: 14px;
  }

  .hero-search button {
    padding: 0 13px;
  }

  .search input {
    font-size: 13.5px;
  }

  .search-submit {
    padding: 0 12px;
  }

  .home-stat strong {
    font-size: 24px;
  }

  .board-tools .btn {
    padding: 0 12px;
  }
}

@media (hover: none) {
  .pin-actions {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
