/* Remind UX — indigo brand + charcoal, soft UI */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  --bg: #ffffff;
  --bg-outer: #e2e2e2;
  --surface: #ffffff;
  --surface-muted: #f3f3f3;
  --surface-elevated: #fafafa;
  --dark: #121212;
  --border: #ebebeb;
  --border-strong: #d8d8d8;
  --text: #121212;
  --text-secondary: #5a5a5a;
  --text-muted: #8a8a8a;
  --text-on-dark: #ffffff;
  --brand: #6366f1;
  --accent: var(--brand);
  --accent-hover: color-mix(in srgb, var(--brand) 88%, #000000);
  --accent-soft: color-mix(in srgb, var(--brand) 22%, #ffffff);
  --shell-gap: 10px;
  --shell-radius: 36px;
  --panel-radius: 28px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-pill: 999px;
  --radius-square: 14px;
  --radius-square-lg: 18px;
  --card-radius: 28px;
  --card-inset-feed: 10px;
  --card-inset-board: 10px;
  --card-radius-inner-feed: calc(var(--card-radius) - var(--card-inset-feed));
  --card-radius-inner-board: calc(var(--card-radius) - var(--card-inset-board));
  --sidebar-w: 200px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --tracking-tight: -0.035em;
  --text-display: clamp(1.5rem, 2.2vw, 2rem);
  --text-title: 1.25rem;
  --text-heading: 1.0625rem;
  --text-body: 0.875rem;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.05);
  --shadow-soft: 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-lift: 0 12px 40px rgba(0, 0, 0, 0.1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-panel: 0.24s var(--ease);
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --source-badge-size: 28px;
  --source-badge-radius: 50%;
  --source-badge-icon: 13px;
  --chip-block-size: 29px;
  --corner-badge-pad: 8px;
  --corner-align: 0.292893;
  --media-aspect: 9 / 16;
  --theme-sidebar-primary: #121212;
  --theme-sidebar-secondary: var(--brand);
  --theme-sidebar-secondary-hover: color-mix(in srgb, var(--brand) 88%, #000000);
  --theme-sidebar-secondary-soft: color-mix(in srgb, var(--brand) 22%, #ffffff);
  --theme-sidebar-active-text: var(--on-brand);
  --shell-bg: var(--brand);
  /* Auto-contrast foreground for anything sitting on the brand color.
     Recomputed in JS from the chosen brand's luminance (light vs dark). */
  --on-brand: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Hide every scrollbar app-wide (scrolling still works) */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

body {
  font-family: var(--font);
  background: var(--bg-outer);
  color: var(--text);
  font-size: var(--text-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.015em;
  padding: 14px;
  min-height: 100vh;
}

a { color: var(--text); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { text-decoration: none; }

.app-shell {
  display: flex;
  height: calc(100vh - 28px);
  min-height: calc(100vh - 28px);
  max-width: 1680px;
  margin: 0 auto;
  padding: var(--shell-gap);
  gap: var(--shell-gap);
  border-radius: var(--shell-radius);
  overflow: hidden;
  background: var(--shell-bg);
  box-shadow: var(--shadow-lift);
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--theme-sidebar-primary);
  flex-shrink: 0;
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  align-self: stretch;
  border-radius: var(--panel-radius);
  overflow: hidden;
  gap: var(--space-3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 10px;
}

.sidebar-user-photo-btn {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: var(--radius-square);
  line-height: 0;
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}

.sidebar-user-photo-btn:hover {
  opacity: 0.88;
}

.sidebar-user-photo-btn:focus-visible {
  outline: 2px solid var(--theme-sidebar-secondary);
  outline-offset: 2px;
}

.sidebar-user-photo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-square);
  border: 2px solid rgba(255, 255, 255, 0.1);
  object-fit: cover;
  display: block;
  background: #dbeafe;
}

.sidebar-user-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-on-dark);
  line-height: 1.3;
}

.sidebar-user-email {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.42);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-context {
  margin: 0 0 10px;
  padding: 0 2px;
}

.sidebar-context-name {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  padding: 0 8px 6px;
  letter-spacing: 0.12em;
}

.sidebar-context-name:empty::before {
  content: 'Marketing Team';
}

html[data-remind-context="personal"] .sidebar-context-name:empty::before {
  content: 'Personal';
}

.sidebar-context-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
}

.sidebar-context-option {
  flex: 1;
  padding: 7px 8px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.48);
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.sidebar-context-switch.is-ready .sidebar-context-option {
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.sidebar-context-option:hover {
  color: rgba(255, 255, 255, 0.82);
}

html[data-remind-context="pro"] .sidebar-context-option[data-context="pro"],
html[data-remind-context="personal"] .sidebar-context-option[data-context="personal"],
.sidebar-context-option.is-active {
  background: var(--theme-sidebar-secondary);
  color: var(--theme-sidebar-active-text);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-on-dark);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
  transition: opacity 0.15s var(--ease);
}

.sidebar-brand:hover { opacity: 0.85; text-decoration: none; }

.sidebar-brand img {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-square);
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.44);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-weight: 700;
  box-shadow: none;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.65;
}

.nav-item.active svg { opacity: 1; }

.nav-item .count {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
}

.nav-item.active .count {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
}

.sidebar-footer {
  padding: 12px 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.sidebar-settings {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.sidebar-settings:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-on-dark);
}

.sidebar-settings svg {
  width: 18px;
  height: 18px;
}

.sidebar-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.94;
  transition: opacity 0.15s var(--ease);
}

.sidebar-logo:hover {
  opacity: 1;
  text-decoration: none;
}

.sidebar-logo img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-square);
  border: 2px solid rgba(255, 255, 255, 0.1);
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.06);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: var(--panel-radius);
  box-shadow: none;
}

.topbar {
  min-height: 72px;
  background: transparent;
  border-bottom: none;
  display: flex;
  align-items: center;
  padding: 28px 32px 12px;
  gap: var(--space-5);
  flex-shrink: 0;
}

.topbar-title {
  font-size: var(--text-display);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: 1.08;
}

.topbar-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

.topbar-lead { flex: 1; min-width: 0; }

.topbar-search { flex: 0 1 300px; margin-left: auto; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.btn-sm {
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-pill);
}

.search-input {
  width: 100%;
  padding: 11px 48px 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13px;
  background: var(--accent-soft);
  box-shadow: none;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.search-field .search-input {
  flex: 1;
  min-width: 0;
}

.search-submit {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--shell-bg);
  color: var(--on-brand);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
}

.search-submit svg {
  width: 16px;
  height: 16px;
}

.search-submit:hover {
  transform: translateY(-50%) scale(1.05);
}

.search-submit:active {
  transform: translateY(-50%) scale(0.94);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.search-input::placeholder { color: var(--text-muted); }

.content { flex: 1; min-height: 0; padding: var(--space-4) var(--space-6) var(--space-8); overflow-y: auto; }

.filter-tabs {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  background: transparent;
  border: none;
  padding: 0;
  width: fit-content;
}

.filter-tab {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-tab.active {
  background: var(--dark);
  border-color: var(--dark);
  color: var(--text-on-dark);
  font-weight: 600;
}

.section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.item-list { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-6); }

.item-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.item-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.item-card.analyzing { opacity: 0.75; }

.item-title {
  font-size: var(--text-heading);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-2);
}

.item-summary {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  line-height: 1.45;
}

.item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.tag {
  padding: 4px 12px;
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
}

.spinner-sm {
  width: 12px; height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--dark);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Avatars — initials, no stock photos */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-square);
  font-weight: 600;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  user-select: none;
  line-height: 1;
}

.avatar--xs { width: 24px; height: 24px; font-size: 10px; border: 2px solid var(--surface); margin-left: -8px; }
.avatar--xs:first-child { margin-left: 0; }
.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--md { width: 40px; height: 40px; font-size: 14px; }
.avatar--lg { width: 100%; height: 100%; font-size: 18px; border: 2px solid var(--surface); }

.avatar--marie { background: #dbeafe; color: #1d4ed8; }
.avatar--alex { background: #ffedd5; color: #c2410c; }
.avatar--sara { background: #f3e8ff; color: #7e22ce; }
.avatar--ben { background: #e8ebe9; color: #5c6360; }
.avatar--tom { background: #dcfce7; color: #15803d; }
.avatar--lea { background: #fce7f3; color: #be185d; }
.avatar--noah { background: #fef3c7; color: #b45309; }
.avatar--maman { background: #ede9fe; color: #6d28d9; }

/* Capture previews — realistic screenshot placeholders */
.capture-preview {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  overflow: hidden;
  background: #111;
}

.capture-preview::before {
  position: absolute;
  inset: 0;
  content: '';
  opacity: 0.9;
}

.capture-preview::after {
  position: absolute;
  left: 12px;
  right: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.35);
  white-space: pre-line;
}

.capture-preview--bundle::before {
  background: linear-gradient(165deg, #ff6b35 0%, #c1121f 55%, #780000 100%);
}
.capture-preview--bundle::after {
  content: '3 FOR €49\ALimited time only';
  top: 28%;
  font-size: clamp(18px, 5vw, 28px);
}

.capture-preview--hotel::before {
  background: linear-gradient(180deg, #0d9488 0%, #115e59 100%);
}
.capture-preview--hotel::after {
  content: 'Boutique stays\Afrom €89/night';
  top: 62%;
  font-size: clamp(14px, 4vw, 20px);
}

.capture-preview--landing::before {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}
.capture-preview--landing::after {
  content: 'Start free trial\A14 days · no card';
  top: 22%;
  color: #0f172a;
  text-shadow: none;
  font-size: clamp(14px, 4vw, 18px);
}

.capture-preview--ugc::before {
  background: linear-gradient(160deg, #fda4af 0%, #fb7185 50%, #e11d48 100%);
}
.capture-preview--ugc::after {
  content: 'POV: you finally\Afound the serum';
  top: 18%;
  font-size: clamp(14px, 4vw, 20px);
}

.capture-preview--pricing::before {
  background: linear-gradient(180deg, #312e81 0%, #1e1b4b 100%);
}
.capture-preview--pricing::after {
  content: 'Pro plan\A€29 / seat / mo';
  top: 30%;
  font-size: clamp(16px, 4.5vw, 24px);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.analyzing-skeleton {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--surface-muted) 25%, #e8ebe9 50%, var(--surface-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease);
}

.btn:hover { background: var(--surface-muted); }

.btn-primary {
  background: var(--dark);
  color: var(--text-on-dark);
  border-color: var(--dark);
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover { background: #2a2a2a; opacity: 1; transform: translateY(-1px); }

.btn-danger {
  background: #b42318;
  color: #fff;
  border: none;
}

.btn-danger:hover {
  background: #912018;
  opacity: 1;
  transform: translateY(-1px);
}
.btn-ghost { border: none; background: none; color: var(--text-secondary); padding-left: 0; }

.detail-layout {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: var(--space-4);
}

.detail-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.detail-wrap .topbar {
  flex-shrink: 0;
}

.detail-canvas {
  flex: 1;
  min-height: 0;
}

.detail-back {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  text-decoration: none;
}

.detail-back:hover {
  color: var(--dark);
  text-decoration: none;
}

.topbar-lead .detail-back {
  margin-bottom: var(--space-3);
}

.topbar-lead .topbar-title {
  margin-top: 0;
}

.detail-hero {
  display: flex;
  gap: var(--space-6);
  margin-bottom: var(--space-7);
  align-items: stretch;
}

.detail-thumb {
  width: 148px;
  flex-shrink: 0;
  aspect-ratio: var(--media-aspect);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: none;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  --media-corner-r: var(--radius-md);
}

.detail-thumb-badge {
  position: absolute;
  z-index: 2;
  top: max(6px, calc((var(--media-corner-r) - var(--source-badge-size)) * var(--corner-align) + 6px));
  left: max(6px, calc((var(--media-corner-r) - var(--source-badge-size)) * var(--corner-align) + 6px));
}

.detail-thumb img,
.detail-thumb .capture-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-grid-title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.detail-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.detail-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: none;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
}

.detail-card--wide {
  grid-column: 1 / -1;
}

.detail-card--featured {
  flex: 1;
  background: var(--accent-soft);
  color: var(--dark);
  border-color: #d4ef7a;
  box-shadow: none;
}

.detail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-card-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail-card--featured .detail-card-label {
  color: rgba(26, 26, 26, 0.5);
}

.detail-card-status {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(26, 26, 26, 0.12);
  color: var(--dark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-card-lead {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.02em;
}

.detail-card-value {
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.detail-card-value--mono {
  font-weight: 500;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.detail-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: var(--space-3);
}

.detail-card--featured .detail-card-meta {
  color: rgba(26, 26, 26, 0.45);
}

.detail-card-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dark);
  word-break: break-all;
}

.detail-card-link:hover { text-decoration: underline; }

.detail-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.detail-card-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(26, 26, 26, 0.12);
}

.detail-card-author img,
.detail-card-author .avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-square);
  object-fit: cover;
  flex-shrink: 0;
}

.detail-card-author strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
}

.detail-card-author span {
  font-size: 0.75rem;
  color: rgba(26, 26, 26, 0.5);
}

.detail-card-shared {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.detail-card-shared img,
.detail-card-shared .avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-square);
  border: 2px solid var(--surface);
  margin-left: -6px;
  object-fit: cover;
}

.detail-card-shared img:first-child,
.detail-card-shared .avatar:first-child { margin-left: 0; }

.detail-card-shared span {
  font-size: 0.875rem;
  font-weight: 600;
}

/* Legacy detail helpers */
.detail-title {
  font-size: var(--text-title);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  margin-bottom: 10px;
}

.detail-summary { font-size: 15px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
.detail-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

.detail-ai-panel {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.ai-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-sections {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.detail-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

.detail-section h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field { margin-bottom: 20px; }
.field-key { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.field-val { font-size: 14px; }

.actions { display: flex; gap: 8px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }

/* Shared page shell — feed + board */
.feed-wrap,
.board-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.board-wrap {
  position: relative;
  background-color: var(--surface-muted);
  --board-inset-x: 32px;
}

.feed-wrap {
  position: relative;
  background-color: var(--surface-muted);
  --board-inset-x: 32px;
  /* Shorter fades — feed only has a search bar, not the board header rectangle */
  --board-fade-h: 96px;
  --board-blur-h: 76px;
  --board-cap-h: 44px;
}

/* Fixed white-to-transparent fade pinned to the top of the board scroll area.
   Content scrolls behind it; the frosted header chrome sits on top of it. */
.feed-wrap::before,
.board-wrap::before {
  content: "";
  position: sticky;
  top: 0;
  /* White fade stays behind the pictures (.board-stage is 860), in its original
     place. The blur overlay (.board-fade-blur) is a separate layer on top. */
  z-index: 850;
  flex-shrink: 0;
  height: var(--board-fade-h, 258px);
  margin-bottom: calc(-1 * var(--board-fade-h, 258px));
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface) 55%, color-mix(in srgb, var(--surface) 45%, transparent) 80%, transparent 100%);
  border-top-left-radius: var(--panel-radius);
  border-top-right-radius: var(--panel-radius);
  pointer-events: none;
}

/* Blur overlay — sits OVER the pictures (z 870 > stage 860) so they blur as they
   scroll up. Shorter than the white fade: it finishes just after the header
   rectangle (its own --board-blur-h), and never covers the round-angle frame. */
.board-fade-blur {
  position: sticky;
  top: 0;
  z-index: 870;
  flex-shrink: 0;
  height: var(--board-blur-h, 190px);
  margin-bottom: calc(-1 * var(--board-blur-h, 190px));
  -webkit-backdrop-filter: blur(var(--m-glass-blur, 16px));
  backdrop-filter: blur(var(--m-glass-blur, 16px));
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 50%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 50%, transparent 100%);
  border-top-left-radius: var(--panel-radius);
  border-top-right-radius: var(--panel-radius);
  pointer-events: none;
}

/* White corner cap — sits ABOVE the blur (875) but below the header (900). It is a
   SHORT strip at the very top, only tall enough to keep the rounded top corners crisp
   white (no blurred brand-color fringe). It fades out well before the cards start, so
   it never paints a white box over the gallery. Real DOM element (placed right after
   .board-fade-blur) so sticky pins to the top in BOTH grid (S) and horizontal (L). */
.board-fade-cap {
  position: sticky;
  top: 0;
  z-index: 875;
  flex-shrink: 0;
  height: var(--board-cap-h, 56px);
  margin-bottom: calc(-1 * var(--board-cap-h, 56px));
  background: var(--surface);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  border-top-left-radius: var(--panel-radius);
  border-top-right-radius: var(--panel-radius);
  pointer-events: none;
}

/* Bottom blur — mirror of .board-fade-blur, rising from the bottom edge up into the
   board. S (grid) mode only; hidden in L (horizontal) mode below. */
/* board-wrap is the scroll container (desktop + mobile), so pin the bottom layer
   with sticky — the mirror of the sticky top fade — placed as the last child with a
   negative top margin so it overlays the content without adding scroll height. */
.board-fade-blur-bottom {
  position: sticky;
  bottom: 0;
  z-index: 870;
  flex-shrink: 0;
  height: var(--board-blur-bottom-h, 84px);
  margin-top: calc(-1 * var(--board-blur-bottom-h, 84px));
  /* surface-muted (#f3f3f3) gradient: solid at the very bottom so the rounded
     corners read #f3f3f3 (not the brand shell), fading up over the picture. */
  background: linear-gradient(0deg, var(--surface-muted) 0%, var(--surface-muted) 32%, transparent 100%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(0deg, #000 0%, transparent 70%);
  mask-image: linear-gradient(0deg, #000 0%, transparent 70%);
  border-bottom-left-radius: var(--panel-radius);
  border-bottom-right-radius: var(--panel-radius);
  pointer-events: none;
}

/* L (horizontal) mode has no vertical scroll — no bottom blur there. */
.board-wrap:has(.board-gallery[data-zoom="lg"]) .board-fade-blur-bottom {
  display: none;
}

.feed-wrap .feed-canvas.page-canvas,
.board-wrap .page-canvas {
  background: transparent;
}

.feed-wrap .topbar,
.board-wrap .topbar,
.page-subbar {
  flex-shrink: 0;
}

.page-subbar {
  background: transparent;
  border-bottom: none;
  padding: 8px 32px 18px;
  min-height: 48px;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.page-subbar-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  max-width: 100%;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.page-subbar-scroll::-webkit-scrollbar {
  display: none;
}

.page-subbar-track {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-width: min-content;
  padding: 3px 2px 2px;
  vertical-align: top;
}

.page-subbar-row {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  flex: 1;
  padding: 3px 0 2px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.page-subbar-row::-webkit-scrollbar { display: none; }

.page-canvas {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: auto;
  padding: 8px 32px 48px 32px;
  background: var(--surface-muted);
  position: relative;
  border-radius: 0 0 var(--panel-radius) var(--panel-radius);
}

/* Custom vertical scrollbar — single pill track with concentric round ends
   and the up/down arrows drawn inside, nested within the panel corners. */
.page-canvas::-webkit-scrollbar {
  width: 18px;
}

.page-canvas::-webkit-scrollbar-button {
  display: none;
  height: 0;
  width: 0;
}

.page-canvas::-webkit-scrollbar-track {
  background-color: var(--surface);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M5 2 1 8h8z' fill='%238a8a8a'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M5 8 9 2H1z' fill='%238a8a8a'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: center 8px, center calc(100% - 8px);
  background-size: 9px, 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin: 10px 6px 18px;
}

.page-canvas::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  background-clip: content-box;
  border: 4px solid transparent;
  border-radius: var(--radius-pill);
  min-height: 44px;
}

.page-canvas::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-muted);
}

/* Board — screenshot gallery */
.feed-wrap .page-search-panel {
  flex-shrink: 0;
}

.board-wrap .page-search-panel,
.board-wrap .board-header-panel {
  flex-shrink: 0;
}

/* Frosted search chrome — rounded panel (desktop + mobile app bar) */
.page-search-panel {
  position: relative;
  margin: 0 32px 12px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--surface-muted) 70%, transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur, var(--m-glass-blur, 16px)));
  backdrop-filter: blur(var(--glass-blur, var(--m-glass-blur, 16px)));
  border: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  border-radius: var(--radius-lg);
  box-shadow: none;
  min-width: 0;
  flex-shrink: 0;
}

/* No frame around the board search bar — the input spans the same width as the
   categories rectangle below it. */
.board-search-panel {
  display: flex;
  align-items: center;
  margin: 20px var(--board-inset-x, 32px) 8px;
  padding: 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
}

.board-search-panel .search-field {
  width: 100%;
  max-width: 100%;
}

.board-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.board-header-meta-lead {
  min-width: 0;
}

.board-header-active {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
}

.board-header-breadcrumb {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  flex-wrap: wrap;
}

.board-header-breadcrumb-folder {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: normal;
}

.board-header-breadcrumb-sep {
  color: var(--border-strong);
  font-weight: 400;
  font-size: 1.1rem;
}

.board-header-breadcrumb-board {
  color: var(--text);
}

.board-header-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.board-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 860;
}

.board-stage .board-canvas {
  flex: 1;
  border-radius: 0;
  padding-top: 0;
  padding-bottom: 48px;
  padding-left: var(--board-inset-x, 32px);
  padding-right: var(--board-inset-x, 32px);
}

.board-header-panel {
  margin: 0 var(--board-inset-x, 32px) 8px;
  padding: 14px 16px;
  background: var(--shell-bg);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Collapse grip lives inside the rectangle — mobile only */
.board-header-grip {
  display: none;
}

.board-header-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.board-header-toolbar .board-bar-shell {
  flex: 0 0 auto;
  min-width: 0;
  width: auto;
}

/* Desktop: picker + share + S/L grouped on the right of the toolbar row, with the
   picker as the wide central control. On mobile this wrapper drops below the
   rectangle (see the mobile override). */
.board-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.board-header-controls .board-mobile-picker {
  flex: 1 1 auto;
  min-width: 0;
}

.board-header-divider {
  display: none;
}

.board-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.board-header-actions .share-with-trigger,
.share-with .share-with-trigger {
  height: 40px;
  min-height: 40px;
  /* 5px right + 1px border = 6px; circle is 30px in a 40px pill so its centre
     lands on the right cap centre (concentric with the rounded corner) */
  padding: 0 5px 0 14px;
  box-sizing: border-box;
}

.board-header-actions .board-zoom {
  height: 40px;
  box-sizing: border-box;
  align-items: center;
}

/* Share with + S/L now live inside the header rectangle (toolbar), so no
   floating bottom-right pills are needed on desktop. */

.share-with {
  position: relative;
  flex-shrink: 0;
}

.share-with-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 5px 0 12px;
  cursor: pointer;
}

.share-with-prefix {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.share-with-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-with-chevron {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  padding: 8px;
  border-radius: 50%;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 14%, transparent);
  flex-shrink: 0;
  transition: transform 0.15s var(--ease);
}

.share-with.is-open .share-with-chevron {
  transform: rotate(180deg);
}

.share-with.is-open .share-with-trigger {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.share-with-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  max-width: min(320px, 88vw);
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  z-index: 30;
  transform-origin: top right;
}

.share-with-menu[hidden] {
  display: none !important;
}

.remind-panel-motion {
  opacity: 0;
  transform: translate3d(0, 6px, 0) scale(0.98);
  transition: opacity var(--motion-panel), transform var(--motion-panel);
  pointer-events: none;
}

.remind-panel-motion.is-open {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.remind-panel-motion.is-entering,
.remind-panel-motion.is-closing {
  pointer-events: none;
}

/* Share group picker inside a modal (mobile per-board share) */
.share-with-menu--modal {
  position: static;
  min-width: 0;
  max-width: none;
  width: 100%;
  margin: 0 0 4px;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  /* Visible overflow so the per-team emoji picker isn't clipped. */
  max-height: none;
  overflow: visible;
}

.share-with-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.share-with-option-main {
  flex: 1;
}

/* Leading team symbol — emoji if set, otherwise a people glyph; click to pick. */
.share-with-option-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.share-with-option-symbol:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.share-with-option-symbol svg {
  width: 17px;
  height: 17px;
}

.share-with-option-emoji {
  font-size: 19px;
  line-height: 1;
}

.share-emoji-pop {
  position: absolute;
  top: calc(100% - 2px);
  left: 8px;
  right: 8px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}

.share-emoji-pop[hidden] {
  display: none;
}

.share-emoji-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s var(--ease), border-color 0.12s var(--ease);
}

.share-emoji-opt:hover {
  background: var(--surface-muted);
}

.share-emoji-opt.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.share-emoji-clear {
  color: var(--text-muted);
  font-size: 14px;
}

.share-with-option:hover {
  background: var(--surface-muted);
}

.share-with-option.is-selected {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.share-with-option-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.share-with-option-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.share-with-option-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.board-menu-option-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.board-menu-option-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-menu-option-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.board-menu-option-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.board-menu-option-dot {
  color: var(--border-strong);
}

.board-menu-option-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-menu-option-group svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.share-with-option-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.share-with-option-avatars {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.share-with-option-avatars .avatar {
  margin-left: -6px;
  border: 2px solid var(--surface);
}

.share-with-option.is-selected .share-with-option-avatars .avatar {
  border-color: var(--accent-soft);
}

.share-with-option-avatars .avatar:first-child {
  margin-left: 0;
}

/* Trailing selection indicator: empty ring by default, accent check when chosen. */
.share-with-option-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  color: transparent;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.share-with-option-check svg {
  width: 12px;
  height: 12px;
}

.share-with-option.is-selected .share-with-option-check {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-brand, #fff);
}

.share-with-create {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
  padding: 11px 12px;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.share-with-create:hover {
  color: var(--dark);
}

.share-with-create-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
}

.share-with-create:hover .share-with-create-ico {
  border-color: var(--dark);
  color: var(--dark);
  background: var(--accent-soft);
}

.share-with-create-ico svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

/* Drag-and-drop reordering inside dropdown menus */
.share-with-option[draggable="true"],
.board-overflow-item--board[draggable="true"] {
  cursor: grab;
}

.menu-row-dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.menu-row-drop-before {
  box-shadow: inset 0 2px 0 var(--accent);
}

.menu-row-drop-after {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.member-picker-item--toggle.is-selected {
  border-color: var(--dark);
  background: var(--accent-soft);
}

.member-picker-item--toggle.is-selected .member-picker-action {
  color: var(--text);
  font-weight: 700;
}

.board-bar-shell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  width: 100%;
}

.board-bar-fixed {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Uniform control height across the whole header bar so single-line pills
   (Add board, Share with) match two-line ones (folder/board + count). */
.board-bar-shell .board-cat-pill,
.board-bar-shell .board-cat-add,
.board-bar-shell .board-overflow-trigger,
.board-bar-shell .board-round-btn {
  height: 40px;
  min-height: 40px;
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
}

.board-bar-shell .board-round-btn,
.board-bar-shell .board-overflow-trigger {
  width: 40px;
  justify-content: center;
}

.board-round-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.board-round-btn svg {
  width: 16px;
  height: 16px;
}

.board-round-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-muted);
}

.board-cat-wrap {
  flex-shrink: 0;
  cursor: grab;
}

.board-cat-wrap.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.board-cat-wrap.is-drag-over .board-cat-pill--category {
  border-color: var(--dark);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.board-category-drop-indicator {
  position: fixed;
  pointer-events: none;
  z-index: 260;
  background: var(--dark);
  border-radius: 1px;
}

.board-category-drop-indicator[data-orientation="vertical"] {
  width: 2px;
  transform: translate(-50%, -50%);
}

.board-category-drop-indicator[data-orientation="horizontal"] {
  height: 2px;
  transform: translate(-50%, -50%);
}

.board-category-drop-indicator[hidden] {
  display: none !important;
}

.board-cat-pill--category {
  min-height: 36px;
  padding: 8px 16px;
}

.board-cat-pill--with-meta {
  white-space: normal;
  align-items: center;
}

.board-cat-pill-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  text-align: left;
}

.board-cat-pill-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-cat-pill-main--folder .board-cat-pill-name {
  text-transform: none;
  letter-spacing: normal;
}

.board-cat-pill-count {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.2;
}

.board-cat-pill.active .board-cat-pill-count {
  color: color-mix(in srgb, var(--text-on-dark) 68%, transparent);
}

.board-context-menu {
  position: fixed;
  z-index: 1300;
  min-width: 168px;
  max-width: min(280px, 90vw);
  max-height: min(420px, 70vh);
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
}

.board-context-menu-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.board-context-menu-item:hover {
  background: var(--surface-muted);
}

.board-context-menu-item--danger {
  color: #b42318;
}

.board-context-menu-item--danger:hover {
  background: #fef3f2;
}

.board-archives-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.board-archives-empty {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 12px;
  margin: 0;
}

.board-archives-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.board-archives-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.board-archives-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.board-archives-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Horizontal category pills are replaced by the dropdown picker everywhere. */
.board-bar-scroll-wrap {
  display: none;
}

.board-bar-scroll-wrap .board-categories {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
  overflow: visible;
  padding: 3px 2px 2px;
}

.board-bar-scroll-wrap,
.board-header-toolbar,
.board-header-panel {
  overflow: visible;
}

.board-bar-overflow {
  position: relative;
  flex-shrink: 0;
}

/* Board picker (mobile-style dropdown) is now the selector on desktop too —
   the horizontal category pills are hidden in favour of this single pill. */
.board-mobile-picker {
  display: flex;
  position: relative;
  flex: 1;
  min-width: 0;
}

.board-mobile-picker-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 6px 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.board-mobile-picker-value {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-mobile-picker-breadcrumb {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  min-width: 0;
}

.board-mobile-picker-breadcrumb span:first-child {
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: normal;
}

.board-mobile-picker-sep {
  color: var(--border-strong);
  font-weight: 400;
}

.board-mobile-picker-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.18s var(--ease);
}

.board-mobile-picker-chevron-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  width: 30px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.board-mobile-picker-chevron-pill .board-mobile-picker-chevron {
  width: 18px;
  height: 18px;
}

.board-mobile-picker.is-open .board-mobile-picker-chevron {
  transform: rotate(180deg);
}

.board-mobile-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  transform-origin: top center;
}

.board-mobile-picker-menu[hidden] {
  display: none !important;
}

.board-mobile-picker-item {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.board-mobile-picker-item .board-menu-option-name {
  font-size: 14px;
}

.board-mobile-picker-item--child .board-menu-option-name {
  font-size: 13px;
}

.board-mobile-picker-item:hover {
  background: transparent;
}

.board-mobile-picker-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  border-radius: 12px;
}

.board-mobile-picker-row:not(.is-active):has(:hover) {
  background: var(--surface-muted);
}

.board-mobile-picker-row.is-active {
  background: var(--accent-soft);
  color: var(--text);
}

.board-mobile-picker-row.is-active .board-menu-option-name {
  font-weight: 700;
}

.board-mobile-picker-row .board-mobile-picker-item {
  color: inherit;
}

.board-mobile-picker-menu > .board-mobile-picker-row,
.board-mobile-picker-group,
.board-mobile-picker-row--child {
  cursor: grab;
}

.board-mobile-picker-menu > .board-mobile-picker-row.menu-row-dragging,
.board-mobile-picker-group.menu-row-dragging,
.board-mobile-picker-row--child.menu-row-dragging {
  cursor: grabbing;
}

.board-mobile-picker-row--child {
  padding-left: 8px;
}

.board-mobile-picker-row .board-mobile-picker-item {
  flex: 1;
  min-width: 0;
  padding-bottom: 0;
}

/* Per-board sharing: item count + team dropdown on one line under the board name. */
.board-mobile-picker-teams {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 14px 10px;
}

.board-mobile-picker-teams > * {
  max-width: 100%;
}

.board-mobile-picker-row--child .board-mobile-picker-teams {
  padding-left: 38px;
}

.board-mobile-picker-row.has-team-open:not(.is-active) {
  background: var(--surface-muted);
}

.board-mobile-picker-row--child .board-team-panel {
  padding-left: 38px;
}

.board-team-dd {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
}

.board-team-dd.is-open .board-team-chip-chev {
  transform: rotate(180deg);
}

.board-team-panel {
  box-sizing: border-box;
  width: 100%;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 14px;
  pointer-events: none;
  transition: max-height 0.28s var(--ease), opacity 0.22s var(--ease), padding 0.28s var(--ease);
}

.board-team-panel.is-open {
  max-height: 240px;
  opacity: 1;
  padding: 0 14px 8px;
  pointer-events: auto;
}

.board-team-panel[hidden]:not(.is-open) {
  display: none;
}

.board-team-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.board-team-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 22px;
  padding: 0 8px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.board-team-chip--empty {
  border: 1px dashed var(--border-strong);
  background: var(--bg);
  color: var(--text-muted);
}

.board-team-chip--trigger {
  padding-right: 6px;
}

.board-team-chip.is-open,
.board-team-dd.is-open .board-team-chip--trigger {
  background: var(--surface-muted);
}

.board-team-chip-ico {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.board-team-chip-ico svg {
  width: 11px;
  height: 11px;
}

.board-team-chip-emoji {
  font-size: 12px;
  line-height: 1;
}

.board-team-chip-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.board-team-chip-emoji--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  font-size: 9px;
  font-weight: 700;
  color: var(--text-secondary);
}

.board-team-chip-stack {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.board-team-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-team-chip-chev {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-left: 2px;
  opacity: 0.55;
  transition: transform 0.2s var(--ease);
}

.board-team-menu-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.board-team-menu-option:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.board-team-menu-option.is-selected {
  color: var(--text);
  font-weight: 700;
}

.board-team-menu-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.board-team-menu-emoji {
  font-size: 15px;
  line-height: 1;
}

.board-team-menu-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
}

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

.board-team-menu-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-left: auto;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  color: transparent;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.board-team-menu-check svg {
  width: 11px;
  height: 11px;
}

.board-team-menu-option.is-selected .board-team-menu-check {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-brand);
}

.board-team-menu-create {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  padding: 12px 8px;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.board-team-menu-create span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 12%, transparent);
  font-size: 15px;
  line-height: 1;
}

.board-team-menu-create:hover {
  color: var(--text);
  background: var(--surface-muted);
  border-radius: 8px;
}

.board-mobile-picker-item--child {
  padding-left: 38px;
}

.board-mobile-picker-group + .board-mobile-picker-group,
.board-mobile-picker-group + .board-mobile-picker-item,
.board-mobile-picker-item + .board-mobile-picker-group {
  margin-top: 4px;
}

.board-mobile-picker-folder {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: normal;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.board-mobile-picker-folder:active {
  background: var(--surface-muted);
}

.board-mobile-picker-group.is-drag-over .board-mobile-picker-folder {
  color: var(--text);
  background: var(--accent-soft);
  border-radius: var(--radius-md);
}

.board-mobile-picker-folder svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

.board-mobile-picker-empty {
  display: block;
  padding: 8px 14px 10px 38px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Footer of the picker menu: a separator then "Add a board" / "Add a folder". */
.board-mobile-picker-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.board-mobile-picker-add {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.board-mobile-picker-add:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.board-mobile-picker-add svg {
  width: 28px;
  height: 28px;
  padding: 7px;
  box-sizing: border-box;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 14%, transparent);
  stroke-width: 2.5;
  flex-shrink: 0;
}

.board-overflow-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.board-overflow-trigger svg {
  width: 16px;
  height: 16px;
}

.board-overflow-trigger:hover,
.board-overflow-trigger.is-active {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-muted);
}

.board-overflow-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  max-width: min(280px, 88vw);
  max-height: min(420px, 70vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  z-index: 40;
}

.board-overflow-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.board-overflow-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.board-overflow-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.board-overflow-item:hover {
  background: var(--surface-muted);
}

.board-overflow-item.is-active {
  background: var(--accent-soft);
}

.board-overflow-item--board {
  align-items: flex-start;
}

.board-overflow-item--board .board-menu-option-main {
  flex: 1;
}

.board-overflow-item--folder {
  justify-content: flex-start;
}

.board-overflow-item--folder span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: normal;
}

.board-overflow-folder-chevron {
  margin-left: auto;
  width: 14px !important;
  height: 14px !important;
  opacity: 0.55;
}

.board-overflow-folder {
  position: relative;
}

.board-overflow-folder:hover .board-overflow-submenu,
.board-overflow-folder:focus-within .board-overflow-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.board-overflow-submenu {
  position: absolute;
  top: 0;
  right: calc(100% + 6px);
  min-width: 180px;
  max-width: 240px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s var(--ease), visibility 0.15s var(--ease);
  z-index: 41;
}

.board-overflow-submenu-empty {
  display: block;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.board-cat-wrap--folder {
  position: relative;
}

.board-cat-folder {
  position: relative;
}

.board-cat-pill.board-cat-pill--folder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  /* 5px so the 30px icon/chevron circles centre on each 40px cap (concentric) */
  padding: 8px 5px;
  max-width: 220px;
}

.board-cat-pill--folder .board-cat-pill-main {
  flex: 0 1 auto;
  min-width: 0;
}

/* Folder glyph — no circle, but kept in a 30px box so it stays concentric
   with the pill's left cap. Gray matches the Add board icon exactly. */
.board-cat-folder-icon {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  padding: 8px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.board-cat-folder-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Chevron in a circle, concentric with the pill's right cap.
   Same gray + tint as the Add board badge. */
.board-cat-folder-chevron {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  padding: 8px;
  border-radius: 50%;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 14%, transparent);
  flex-shrink: 0;
  transition: transform 0.15s var(--ease);
}

/* Active folder pill (dark bg): keep icons legible */
.board-cat-pill--folder.active .board-cat-folder-icon,
.board-cat-pill--folder.active .board-cat-folder-chevron {
  color: var(--text-on-dark);
}

.board-cat-pill--folder.active .board-cat-folder-chevron {
  background: color-mix(in srgb, var(--text-on-dark) 16%, transparent);
}

.board-cat-wrap--folder.is-open .board-cat-folder-chevron {
  transform: rotate(180deg);
}

.board-cat-wrap--folder.is-drag-over .board-cat-pill--folder {
  border-color: var(--dark);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.board-cat-wrap--folder.is-drag-over .board-cat-pill--folder,
.board-cat-folder.is-drag-over .board-cat-pill--folder,
.board-folder-menu.is-drag-over {
  border-color: var(--dark);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.board-folder-menu.is-drag-over {
  background: var(--accent-soft);
}

.board-cat-pill--category[draggable="true"],
.board-folder-menu-item .board-cat-pill--in-folder[draggable="true"] {
  cursor: grab;
}

.board-cat-pill.is-dragging,
.board-folder-menu-item.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.board-folder-menu {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 240px;
  max-width: min(300px, 84vw);
  max-height: min(320px, 60vh);
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  z-index: 200;
}

.board-folder-menu.is-drop-through {
  pointer-events: none;
  opacity: 0.35;
}

.board-folder-menu[hidden] {
  display: none !important;
}

.board-folder-menu-item {
  display: block;
}

.board-folder-menu-item .board-cat-pill--in-folder {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 48px;
  max-width: none;
  padding: 8px 12px;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
  cursor: grab;
  transition: background 0.15s var(--ease);
}

.board-folder-menu-item .board-cat-pill--in-folder:hover {
  background: var(--surface-muted);
  border-color: transparent;
  color: var(--text);
  box-shadow: none;
}

.board-folder-menu-item .board-cat-pill--in-folder.active,
.board-folder-menu-item .board-cat-pill--in-folder.active:hover {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--text);
  box-shadow: none;
}

.board-folder-menu-item .board-cat-pill--in-folder:active {
  cursor: grabbing;
}

.board-folder-menu-empty {
  padding: 12px;
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.board-context-menu-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--border);
}

.board-context-menu-group-label {
  display: block;
  padding: 6px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.board-context-menu-item--active {
  background: var(--accent-soft);
}

.board-scroll-fade {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 104px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, color-mix(in srgb, var(--surface) 72%, transparent) 38%, var(--surface) 88%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.board-scroll-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.board-scroll-arrow svg {
  width: 14px;
  height: 14px;
}

.board-scroll-arrow:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.board-bar-shell.can-scroll-right .board-scroll-fade,
.board-bar-shell.can-scroll-right .board-scroll-arrow {
  opacity: 1;
  pointer-events: auto;
}

.board-bar-shell.can-scroll-right .board-scroll-fade {
  pointer-events: none;
}

.board-members-bar {
  padding-top: 0;
  padding-bottom: 16px;
}

.board-header-panel .board-scroll-fade {
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, color-mix(in srgb, var(--surface-muted) 72%, transparent) 38%, color-mix(in srgb, var(--surface-muted) 88%, transparent) 88%);
}

.board-members-empty {
  align-self: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0 4px;
}

.board-cat-pill.team-pill--board {
  padding-right: 8px;
}

.team-pill-label {
  line-height: 1;
}

.team-pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 2px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.team-pill-remove svg {
  width: 12px;
  height: 12px;
}

.team-pill--board:hover .team-pill-remove {
  color: var(--text-secondary);
}

.team-pill-remove:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.member-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.member-picker-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}

.member-picker-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.member-picker-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.member-picker-name {
  flex: 1;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.member-picker-action {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.board-cat-pill.team-pill.active {
  background: var(--accent);
  color: var(--on-brand);
  border-color: transparent;
}

.content-swapping {
  opacity: 0.55;
  transition: opacity 0.18s var(--ease);
}

.content-empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.feed-layout,
.board-gallery {
  transition: opacity 0.18s var(--ease);
}

.board-categories::-webkit-scrollbar,
.board-members::-webkit-scrollbar { display: none; }

.board-cat-pill {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s var(--ease);
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
}

.board-cat-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-muted);
  box-shadow: var(--shadow-soft);
}

.board-cat-pill.active {
  background: var(--dark);
  border-color: var(--dark);
  color: var(--text-on-dark);
  font-weight: 700;
  box-shadow: none;
}

.board-cat-pill.active:hover {
  background: #252525;
  border-color: #252525;
  color: var(--text-on-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.board-cat-pill.board-cat-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 16px 6px 5px;
  border-style: dashed;
  border-color: var(--border-strong);
  color: var(--text-muted);
  background: var(--bg);
  font-size: 13px;
  line-height: 1;
}

.board-cat-pill.board-cat-add:hover {
  border-color: var(--dark);
  color: var(--dark);
  background: var(--accent-soft);
}

/* Concentric circular badge for the + glyph (height/2 cap radius = 20px,
   badge centered 20px from the pill's left cap). */
.board-cat-pill.board-cat-add svg {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  padding: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 14%, transparent);
  stroke-width: 2.5;
}

.board-cat-pill.team-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 6px 14px 6px 6px;
  font-size: 13px;
  line-height: 1;
}

.board-cat-pill.team-pill .avatar--sm {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.board-cat-pill.team-pill--muted {
  opacity: 0.55;
}

.board-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: 0 32px 28px;
  background: transparent;
  border-bottom: none;
  flex-wrap: wrap;
}

.board-toolbar-hint {
  display: none;
}

.board-toolbar label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-square);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
}

.color-swatch:hover { transform: scale(1.08); }
.color-swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text);
}

.color-mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.brand-color-picker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-color-picker__swatch-btn {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.brand-color-picker__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}

.brand-color-picker__swatch {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--brand);
  pointer-events: none;
}

.brand-color-picker__hex {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-color-picker__hex:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.color-mode-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}

.color-mode-option:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.color-mode-option.active {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}

.color-mode-option__preview {
  display: grid;
  grid-template-columns: repeat(2, 14px);
  grid-template-rows: repeat(2, 14px);
  gap: 3px;
  flex-shrink: 0;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.color-mode-option__preview span {
  display: block;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.color-mode-option__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.color-mode-option__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.color-mode-option__hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.modal--settings {
  max-width: 420px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft), var(--shadow-lift);
}

.profile-photo-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.profile-photo-preview {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-square);
  object-fit: cover;
  display: block;
  border: 2px solid var(--border);
  background: var(--surface-muted);
}

.profile-photo-widget__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.profile-photo-upload {
  cursor: pointer;
  white-space: nowrap;
}

.profile-photo-remove {
  color: var(--text-secondary);
}

.profile-photo-remove:hover {
  color: var(--danger, #dc2626);
}

.profile-photo-input {
  display: none;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.profile-field:last-child {
  margin-bottom: 0;
}

.profile-field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-field-input {
  margin-bottom: 0;
}

.sidebar-user-text--interactive {
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease);
}

.sidebar-user-text--interactive:hover {
  background: var(--surface-muted);
}

.sidebar-user-text--interactive:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal-lead {
  margin-bottom: 20px;
}

.settings-section {
  margin-bottom: 18px;
}

.settings-section-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.settings-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.settings-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.settings-preview {
  margin: 8px 0 22px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.settings-preview-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--preview-primary, var(--theme-sidebar-primary));
}

.settings-preview-block {
  height: 12px;
  border-radius: 6px;
}

.settings-preview-block--primary {
  width: 56%;
  background: rgba(255, 255, 255, 0.18);
}

.settings-preview-block--secondary {
  width: 72%;
  background: var(--preview-secondary, var(--theme-sidebar-secondary));
}

.settings-preview-block--muted {
  width: 48%;
  background: rgba(255, 255, 255, 0.08);
}

.board-gallery {
  display: grid;
  gap: 36px;
  width: 100%;
  padding-bottom: 120px;
  transition: opacity 0.18s var(--ease), gap 0.2s var(--ease);
}

.board-gallery[data-zoom="lg"],
.board-gallery:not([data-zoom]) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: none;
}

.board-gallery[data-zoom="sm"] {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  /* Every card is exactly one row tall (uniform height); wide pictures span
     more columns (set per-card in JS, capped at 3) so they keep that same
     height while getting a wider box. `dense` backfills the gaps. */
  grid-auto-rows: var(--s-row-h, 240px);
  grid-auto-flow: row dense;
  gap: 8px;
  --card-inset-board: 6px;
  --card-radius-inner-board: calc(var(--radius-md) - var(--card-inset-board));
}

.board-gallery[data-zoom="lg"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: none;
  margin: 0;
}

/* Board zoom — compact cards */
.board-gallery[data-zoom="sm"] .board-card-inner,
.board-gallery[data-zoom="sm"] .board-face {
  border-radius: var(--radius-md);
}

.board-gallery[data-zoom="sm"] .board-media,
.board-gallery[data-zoom="sm"] .board-media .capture-preview {
  border-radius: inherit;
}

.board-gallery[data-zoom="sm"] .board-body {
  padding: 12px calc(6px + var(--card-inset-board)) 14px;
}

.board-gallery[data-zoom="sm"] .board-body-title {
  font-size: 0.8125rem;
  font-weight: 700;
}

.board-gallery[data-zoom="sm"] .board-ready-dot {
  width: 16px;
  height: 16px;
  margin-top: 0;
}

.board-gallery[data-zoom="sm"] .board-ready-dot svg {
  width: 9px;
  height: 9px;
}

.board-gallery[data-zoom="sm"] .board-body-desc {
  font-size: 11px;
  margin-bottom: 10px;
  -webkit-line-clamp: 1;
}

.board-gallery[data-zoom="sm"] .board-meta {
  font-size: 10px;
  gap: 6px;
}

.board-gallery[data-zoom="sm"] .board-meta svg {
  width: 11px;
  height: 11px;
}

.board-gallery[data-zoom="sm"] .pill-btn {
  padding: 6px 10px;
  font-size: 10px;
}

.board-gallery[data-zoom="sm"] .board-flip-btn {
  --flip-btn-size: 30px;
  border-radius: 8px;
}

.board-gallery[data-zoom="sm"] .board-flip-btn svg {
  width: 15px;
  height: 15px;
}

.board-gallery[data-zoom="sm"] .board-ai-chip {
  --chip-block-size: 22px;
  padding: 3px 8px;
  font-size: 9px;
}

.board-gallery[data-zoom="sm"] .board-source-badge {
  --source-badge-size: 24px;
  --source-badge-icon: 11px;
}

/* Card fills its grid area so every card is the same (one-row) height. */
.board-gallery[data-zoom="sm"] .board-card,
.board-gallery[data-zoom="sm"] .board-card-inner,
.board-gallery[data-zoom="sm"] .board-face,
.board-gallery[data-zoom="sm"] .board-face--front {
  height: 100%;
}

.board-gallery[data-zoom="sm"] .board-media {
  --media-corner-r: var(--card-radius-inner-board);
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.board-gallery[data-zoom="sm"] .board-media img,
.board-gallery[data-zoom="sm"] .board-media .board-capture-img,
.board-gallery[data-zoom="sm"] .board-media .capture-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* S mode — landscape card squeezed into a trailing row gap, cropped to portrait. */
.board-gallery[data-zoom="sm"] .board-card--sm-gap-fill .board-media {
  aspect-ratio: 9 / 16;
}

.board-gallery[data-zoom="sm"] .board-card--sm-gap-fill .board-media img,
.board-gallery[data-zoom="sm"] .board-card--sm-gap-fill .board-media .board-capture-img {
  object-fit: cover;
  object-position: center;
}

.board-gallery[data-zoom="sm"] .board-face--back {
  padding: 0;
}

.board-gallery[data-zoom="sm"] .board-add-slot {
  min-height: 0;
  aspect-ratio: 9 / 16;
  height: 100%;
  grid-column: span 1;
  border-radius: var(--radius-md);
}

.board-gallery[data-zoom="sm"] .board-add-slot .add-icon {
  font-size: 44px;
}

/* Board zoom — feed-scale cards */
.board-gallery[data-zoom="lg"] .board-body-title {
  font-size: 1.0625rem;
}

.board-gallery[data-zoom="lg"] .board-body {
  padding: 18px calc(10px + var(--card-inset-board)) 22px;
}

.board-gallery[data-zoom="lg"] .board-add-slot {
  min-height: 0;
}

.board-zoom {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  box-shadow: var(--shadow-soft);
}

.board-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 36px;
  height: 32px;
  padding: 0 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.board-zoom-btn:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.board-zoom-btn.is-active {
  background: var(--dark);
  color: var(--text-on-dark);
  box-shadow: none;
}

.board-zoom-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: 0.72;
}

.board-zoom-btn.is-active svg {
  opacity: 1;
}

.board-zoom-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Board style card — media 9:16 + body below */
.board-card {
  width: 100%;
  position: relative;
  perspective: 1200px;
  cursor: pointer;
}

.board-card-inner {
  width: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.2, 0.85, 0.25, 1);
  border-radius: var(--card-radius);
}

.board-card.flipped .board-card-inner {
  transform: rotateY(180deg);
}

.board-card:not(.flipped):hover .board-card-inner {
  transform: none;
}

.board-card.flipped:hover .board-card-inner {
  transform: rotateY(180deg);
}

.board-face {
  backface-visibility: hidden;
  border-radius: var(--card-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  border: 1px solid #d4d4d8;
  background: var(--surface);
}

.board-face--front {
  position: relative;
  background: transparent;
  padding: 0;
}

.board-flip-btn {
  position: absolute;
  z-index: 3;
  top: calc(var(--card-inset-board, 8px) + 8px);
  right: calc(var(--card-inset-board, 8px) + 8px);
  width: var(--flip-btn-size, 36px);
  height: var(--flip-btn-size, 36px);
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
}

.board-flip-btn svg {
  width: 18px;
  height: 18px;
}

.board-flip-btn:hover {
  transform: scale(1.04);
}

.board-flip-btn--close {
  z-index: 4;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.board-face--back > .board-flip-btn {
  top: 12px;
  right: 12px;
}

.board-media--zoomable {
  cursor: zoom-in;
}

.board-media-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.board-media-link .capture-preview,
.board-media-link .board-capture-img {
  width: 100%;
  height: 100%;
}

.board-face--back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  background: var(--surface-muted);
  color: var(--text);
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
}

.board-back-head {
  display: flex;
  align-items: center;
  padding: 14px 14px 10px;
  padding-right: calc(14px + var(--flip-btn-size, 36px) + 8px);
  flex-shrink: 0;
}

.board-back-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 14px;
  scrollbar-width: none;
}

.board-back-scroll::-webkit-scrollbar {
  display: none;
}

.board-back-widgets {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 10px;
}

.board-back-widget {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.board-back-widget--featured {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.board-back-widget--wide .board-back-widget-value {
  word-break: break-word;
}

.board-back-widget-label,
.board-back-widget-value,
.board-back-widget-meta,
.board-back-widget-link {
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
}

.board-back-widget-label {
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.board-back-widget-value {
  margin: 0;
  font-weight: 500;
  color: var(--text);
}

.board-back-widget-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.board-back-widget-tags .pill {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  padding: 5px 11px;
}

.board-back-widget-meta {
  margin: 0;
  font-weight: 400;
  color: var(--text-muted);
}

.board-back-widget-link {
  display: block;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-back-widget-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.board-card.flipped {
  z-index: 5;
}

.board-card[draggable="true"] {
  cursor: grab;
}

.board-card.is-dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.board-gallery[data-zoom="lg"] .board-card-drop-before {
  box-shadow: inset 4px 0 0 var(--accent);
}

.board-gallery[data-zoom="lg"] .board-card-drop-after {
  box-shadow: inset -4px 0 0 var(--accent);
}

.board-gallery[data-zoom="lg"] .board-add-slot.board-card-drop-after {
  box-shadow: inset -4px 0 0 var(--accent);
}

.board-gallery[data-zoom="sm"] .board-card-drop-before,
.board-add-slot.board-card-drop-before {
  box-shadow: inset 0 4px 0 var(--accent);
}

.board-gallery[data-zoom="sm"] .board-card-drop-after,
.board-add-slot.board-card-drop-after {
  box-shadow: inset 0 -4px 0 var(--accent);
}

.board-media {
  flex: none;
  width: 100%;
  aspect-ratio: var(--media-aspect);
  position: relative;
  overflow: hidden;
  border-radius: inherit;
  --media-corner-r: var(--card-radius);
}

.board-media img,
.board-media .capture-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.board-source-badge {
  position: absolute;
  z-index: 2;
  top: max(var(--corner-badge-pad), calc((var(--media-corner-r) - var(--source-badge-size)) * var(--corner-align) + var(--corner-badge-pad)));
  left: max(var(--corner-badge-pad), calc((var(--media-corner-r) - var(--source-badge-size)) * var(--corner-align) + var(--corner-badge-pad)));
}

/* Legacy — kept for feed/detail; board cards use .board-flip-btn */
.board-ai-chip {
  position: absolute;
  z-index: 2;
  top: max(var(--corner-badge-pad), calc((var(--media-corner-r) - var(--chip-block-size)) * var(--corner-align) + var(--corner-badge-pad)));
  right: max(var(--corner-badge-pad), calc((var(--media-corner-r) - var(--chip-block-size)) * var(--corner-align) + var(--corner-badge-pad)));
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  border: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.board-body {
  flex: none;
  padding: 24px calc(14px + var(--card-inset-board)) 26px;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.8);
}

.board-body-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: 10px;
}

.board-body-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
  flex: 1;
}

.board-ready-dot {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-square);
  background: var(--accent);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.board-ready-dot svg { width: 11px; height: 11px; color: var(--dark); }

.board-body-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-5);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-body-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-2);
}

.board-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.board-meta span { display: inline-flex; align-items: center; gap: 4px; }
.board-meta svg { width: 14px; height: 14px; opacity: 0.7; }

.pill-btn {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--dark);
  color: var(--text-on-dark);
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, opacity 0.15s;
  text-decoration: none;
}

.pill-btn:hover { opacity: 0.88; transform: scale(1.02); color: var(--text-on-dark); }

.pill-btn--light {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
}

.board-back-label {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

.board-back-foot {
  display: flex;
  align-items: center;
  padding: 12px 14px 14px;
  flex-shrink: 0;
  background: var(--surface-muted);
}

.board-back-detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--dark);
  color: var(--text-on-dark);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
}

.board-back-detail-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

.board-back-detail-btn:hover {
  opacity: 0.92;
  transform: scale(1.01);
  color: var(--text-on-dark);
}

.board-add-slot {
  aspect-ratio: 9 / 16;
  min-height: 0;
  border-radius: var(--card-radius);
  border: 2px dashed var(--border-strong);
  background: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.board-add-slot:hover {
  border-color: var(--dark);
  color: var(--dark);
  background: var(--accent-soft);
}

.board-add-slot .add-icon {
  font-size: 60px;
  font-weight: 200;
  line-height: 1;
}

.board-canvas {
  margin: 0;
  border-radius: 0;
}

.board-controls {
  display: none;
}

.fab-add {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-square-lg);
  background: var(--dark);
  color: var(--text-on-dark);
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  pointer-events: auto;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.fab-add:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.fab-add:active { transform: scale(0.96); }

.board-add-card {
  cursor: pointer;
}

.add-card-placeholder {
  width: 100%;
  height: 100%;
  aspect-ratio: var(--media-aspect);
  background: rgba(255,255,255,0.5);
  border: 2px dashed var(--border-strong);
  border-radius: var(--card-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}

.add-card-placeholder:hover {
  border-color: var(--dark);
  color: var(--dark);
  background: var(--accent-soft);
}

.add-card-placeholder .add-icon {
  font-size: 40px;
  font-weight: 200;
  line-height: 1;
}

.add-card-placeholder span {
  font-size: 13px;
  font-weight: 600;
}

.board-thumb {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 3px rgba(16,24,40,0.08);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
}

.board-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16,24,40,0.12);
}

.board-thumb img {
  width: 100%;
  aspect-ratio: var(--media-aspect);
  object-fit: cover;
  display: block;
  background: #eee;
}

.board-thumb-cap {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  border-top: 1px solid var(--border);
}

.board-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px;
  font-size: 14px;
}

/* Hub */
.hub {
  max-width: 560px;
  margin: 20px auto;
  padding: 40px 32px 48px;
  background: var(--bg);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.14);
}

.hub-hero {
  text-align: center;
  margin-bottom: var(--space-7);
}

.hub-hero img {
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
}

.hub h1 {
  font-size: 2.625rem;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: 1.05;
  margin-bottom: var(--space-3);
}

.hub p { color: var(--text-secondary); margin-bottom: 0; font-size: 1rem; }

.hub-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.hub-link {
  display: block;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.hub-link--featured {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--dark);
}

.hub-link--featured span { color: rgba(26, 26, 26, 0.55); }

.hub-link:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
  text-decoration: none;
}

.hub-link span {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: var(--space-2);
}

/* Flip card — from super/indexapp, B2B solid */
.flip-card {
  width: 100%;
  aspect-ratio: var(--media-aspect);
  position: relative;
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(16,24,40,0.1);
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  background: var(--surface);
}

.flip-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flip-front-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 45%, transparent 60%, rgba(0,0,0,0.4) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
}

.flip-front-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.flip-ai-btn {
  align-self: flex-end;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-square);
  background: var(--accent);
  color: var(--dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.flip-back {
  transform: rotateY(180deg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.flip-back-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.flip-back-summary {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  flex: 1;
  margin-bottom: 10px;
}

.flip-back .tag {
  font-size: 11px;
  padding: 2px 6px;
}

.flip-back-link {
  font-size: 11px;
  color: var(--dark);
  margin-top: 8px;
  font-weight: 600;
}

/* Feed */
.feed-wrap .feed-canvas.page-canvas {
  padding: 8px var(--board-inset-x, 32px) 88px;
}

.feed-layout {
  max-width: 440px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}

.feed-date-group {
  position: relative;
}

/* Discuss your board — dashboard right rail chat */
.memory-rail {
  width: 360px;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: width 0.25s var(--ease);
}

/* Collapsed: rail shrinks to a slim vertical tab on the right */
.memory-rail.is-collapsed {
  width: 48px;
}

.memory-rail.is-collapsed .memory-card {
  display: none;
}

.memory-rail-tab {
  display: none;
}

.memory-rail.is-collapsed .memory-rail-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 48px;
  height: 100%;
  padding: 16px 0;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, #ffffff);
  border-radius: var(--panel-radius);
  background: var(--accent-soft);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s var(--ease);
}

.memory-rail-tab:hover {
  background: color-mix(in srgb, var(--brand) 16%, #ffffff);
}

.memory-rail-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.memory-rail-arrow svg {
  width: 16px;
  height: 16px;
}

.memory-rail-arrow--mobile-only {
  display: none;
}

.memory-mobile-expand {
  display: none;
}

.memory-collapse-btn .memory-rail-arrow {
  width: 30px;
  height: 30px;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

.memory-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.memory-collapse-btn:hover {
  color: var(--text);
}

.memory-rail-tab-label {
  writing-mode: vertical-rl;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.memory-collapse-btn svg {
  width: 16px;
  height: 16px;
}

.memory-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, #ffffff);
  border-radius: var(--panel-radius);
}

.memory-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.memory-head-label {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.memory-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
}

.memory-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.memory-empty {
  margin-top: auto;
  margin-bottom: 8px;
}

.memory-discuss-suggestions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0 8px;
}

.memory-discuss-suggestions--empty {
  margin-top: auto;
}

.memory-discuss-suggestions-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.memory-discuss-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.memory-discuss-suggestion {
  display: inline-flex;
  align-items: center;
  width: auto;
  max-width: 100%;
  padding: 5px 11px;
  border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--border));
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.memory-discuss-suggestion:hover {
  background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 24%, var(--border));
  color: var(--text);
}

.memory-discuss-suggestion:active {
  transform: scale(0.98);
}

.memory-compare-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
  border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--border));
}

.memory-compare-banner.is-active {
  display: flex;
}

.memory-compare-banner[hidden] {
  display: none !important;
}

.memory-compare-banner-text {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-secondary);
}

.memory-compare-banner-cancel {
  flex-shrink: 0;
  padding: 6px 10px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.memory-capture-compare-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 4px;
}

.memory-capture-compare-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 2px;
}

.memory-capture-compare-divider::before,
.memory-capture-compare-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--brand) 18%, var(--border));
}

.memory-capture-compare-divider span {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.memory-compare-pick-overlay {
  position: absolute;
  inset: 0;
  z-index: 820;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14px;
  pointer-events: none;
  background: color-mix(in srgb, var(--brand) 6%, transparent);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  border-radius: inherit;
}

.memory-compare-pick-overlay-text {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--shell-bg);
  color: var(--on-brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-lift);
  animation: memory-compare-pick-pulse 2s var(--ease) infinite;
}

@keyframes memory-compare-pick-pulse {
  0%, 100% { transform: translateY(0); box-shadow: var(--shadow-lift); }
  50% { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16); }
}

body.memory-compare-pick .board-add-slot {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.4);
}

body.memory-compare-pick .memory-compare-primary {
  opacity: 0.42;
  filter: grayscale(0.35) saturate(0.7);
  pointer-events: none;
}

body.memory-compare-pick .memory-compare-primary::after {
  content: 'In discussion';
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: rgba(8, 10, 14, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
}

body.memory-compare-pick .memory-compare-candidate {
  z-index: 830;
}

body.memory-compare-pick .memory-compare-candidate .board-card-inner {
  transition: box-shadow 0.22s var(--ease), transform 0.22s var(--ease);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--brand) 45%, transparent),
    0 10px 28px color-mix(in srgb, var(--brand) 14%, transparent);
}

body.memory-compare-pick .memory-compare-candidate:hover .board-card-inner {
  transform: translateY(-5px) scale(1.025);
  box-shadow:
    0 0 0 3px var(--brand),
    0 16px 36px color-mix(in srgb, var(--brand) 22%, transparent);
}

body.memory-compare-pick .memory-compare-candidate::after {
  content: 'Add to compare';
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 4;
  transform: translateX(-50%) translateY(6px);
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: var(--shell-bg);
  color: var(--on-brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}

body.memory-compare-pick .memory-compare-candidate:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.memory-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0;
}

.memory-capture-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 2px 0 8px;
}

.memory-capture {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Capture dossier — visual + tabs in one white card */
.memory-capture-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--border));
  box-shadow: var(--shadow-soft);
}

.memory-capture-meta-visual {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-capture-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.memory-capture-source-row-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.memory-capture-meta-visual .memory-capture-player {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--border));
}

.memory-capture-meta-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

.memory-capture-source-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.memory-source-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.memory-source-pill--platform {
  background: var(--shell-bg);
  color: var(--on-brand);
}

.memory-source-pill--host {
  font-weight: 600;
  color: var(--text-secondary);
}

.memory-capture-player {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0b0d10;
  box-shadow: var(--shadow-soft);
}

.memory-capture-media-stage {
  position: relative;
}

.memory-capture-platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--border));
  box-shadow: var(--shadow-soft);
}

.memory-capture-platform-icon svg {
  width: 15px;
  height: 15px;
}

.memory-capture-insight-byline {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
}

.memory-capture-comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.memory-capture-comment {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-muted) 70%, var(--surface));
}

.memory-capture-comment--save {
  position: relative;
  background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--border));
  border-left: none;
  padding-left: 20px;
}

.memory-capture-comment--save::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--brand);
}

.memory-capture-comment--user {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--border));
}

.memory-capture-comment--compose {
  gap: 0;
}

.memory-capture-comment--compose .memory-capture-user-comment-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 120px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  outline: none;
}

.memory-capture-comment--compose .memory-capture-user-comment-input::placeholder {
  color: var(--text-muted);
}

.memory-capture-comment-byline {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.memory-capture-comment-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.memory-capture-comment-body--empty {
  color: var(--text-muted);
  font-style: italic;
}

.memory-capture-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-capture-comments-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-capture-comments-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.memory-capture-note {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.memory-capture-note-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-muted) 70%, var(--surface));
}

.memory-capture-note-byline {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.memory-capture-note-save {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.memory-capture-note-save--empty {
  color: var(--text-muted);
  font-style: italic;
}

.memory-capture-comment--compose:focus-within {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}

.memory-capture-player-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #333;
  background: #e8eaed;
}

.memory-capture-player-chrome--web {
  background: #e8eaed;
  color: #333;
}

.memory-capture-player-url {
  flex: 1;
  min-width: 0;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #fff;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memory-capture-viewport-hit {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: #0f1115;
  cursor: pointer;
  line-height: 0;
}

.memory-capture-viewport {
  position: relative;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #0f1115;
}

.memory-capture-viewport--portrait {
  aspect-ratio: 9 / 16;
  max-width: 100%;
}

.memory-capture-viewport--landscape {
  aspect-ratio: 16 / 9;
  max-width: 100%;
}

.memory-capture-player--portrait .memory-capture-viewport-hit {
  max-width: min(100%, 220px);
  margin: 0 auto;
}

.memory-capture-player--landscape .memory-capture-viewport-hit {
  max-width: 100%;
}

.memory-capture-frame-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.12s var(--ease);
  z-index: 2;
}

.memory-capture-viewport.is-capture-frame .memory-capture-frame-img,
.memory-capture-player.is-at-capture .memory-capture-frame-img {
  opacity: 1;
}

.memory-capture-viewport-motion {
  position: absolute;
  inset: -8%;
  background-size: cover;
  background-position: center;
  filter: saturate(1.08) brightness(0.92);
  transform: scale(1);
  z-index: 1;
}

.memory-capture-player.is-playing .memory-capture-viewport-motion {
  animation: memory-viewport-play 8s var(--ease) infinite alternate;
}

.memory-capture-player.is-paused .memory-capture-viewport-motion {
  animation-play-state: paused;
}

.memory-capture-player.is-at-capture .memory-capture-viewport-motion {
  opacity: 0.35;
}

@keyframes memory-viewport-play {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.12) translate(-2%, -1%); }
}

.memory-capture-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease);
  z-index: 3;
}

.memory-capture-play-overlay::after {
  content: '';
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23111'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 55% center;
  background-size: 22px;
}

.memory-capture-player.is-paused .memory-capture-play-overlay {
  opacity: 1;
}

.memory-capture-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 6px;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
}

.memory-capture-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.memory-capture-play-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.memory-capture-icon-play,
.memory-capture-icon-pause {
  width: 14px;
  height: 14px;
}

.memory-capture-icon-play {
  display: none;
}

.memory-capture-player.is-paused .memory-capture-icon-play {
  display: block;
}

.memory-capture-player.is-paused .memory-capture-icon-pause {
  display: none;
}

.memory-capture-time {
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  flex-shrink: 0;
}

.memory-capture-time--duration {
  color: rgba(255, 255, 255, 0.65);
}

.memory-capture-scrubber {
  position: relative;
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.memory-capture-scrubber-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}

.memory-capture-scrubber-fill {
  position: absolute;
  left: 0;
  height: 4px;
  width: 0;
  border-radius: 2px;
  background: #fff;
  pointer-events: none;
}

.memory-capture-scrubber-head {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 3;
}

.memory-capture-scrubber-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 16px;
  border-radius: 1px;
  background: var(--accent, #fbbf24);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  z-index: 2;
  pointer-events: none;
}

.memory-capture-scrubber-marker-thumb {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  width: 34px;
  height: 44px;
  border: 2px solid #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  background: #111;
}

.memory-capture-scrubber-marker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.memory-capture-open-link {
  display: inline-flex;
  align-self: center;
  margin: 0 auto 2px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.memory-capture-open-link:hover {
  background: color-mix(in srgb, var(--surface) 90%, var(--brand));
}

.memory-capture-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--border));
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.memory-capture-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s var(--ease);
}

.memory-capture-section-toggle:hover {
  background: color-mix(in srgb, var(--surface) 92%, var(--brand));
}

.memory-capture-section-toggle-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.memory-capture-section-toggle-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.memory-capture-section-toggle-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.memory-capture-section-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s var(--ease);
}

.memory-capture-section.is-open .memory-capture-section-chevron {
  transform: rotate(180deg);
}

.memory-capture-section-panel {
  padding: 0 12px 12px;
}

.memory-capture-section-panel[hidden] {
  display: none;
}

.memory-capture-insight-block,
.memory-capture-comment-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.memory-capture-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.memory-capture-text--comment {
  color: var(--text-secondary);
}

.memory-capture-text-empty {
  color: var(--text-muted);
  font-style: italic;
}

.memory-capture-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.memory-link-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: background 0.15s var(--ease);
}

.memory-link-pill:hover {
  background: color-mix(in srgb, var(--surface) 88%, var(--brand));
}

.memory-capture-preview {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.memory-capture-ref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
}

.memory-capture-source-pills {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.memory-capture-meta-head .memory-source-pill {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
  color: var(--text);
  box-shadow: none;
  border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--border));
}

.memory-capture-meta-head .memory-source-pill--platform {
  background: var(--shell-bg);
  color: var(--on-brand);
}

.memory-capture-source-row-left .memory-capture-source-host-link {
  max-width: min(220px, 48vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-capture-source-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  margin-left: auto;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--border));
  box-shadow: var(--shadow-soft);
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}

.memory-capture-source-icon-link svg {
  width: 14px;
  height: 14px;
}

.memory-capture-source-icon-link:hover {
  background: color-mix(in srgb, var(--accent-soft) 65%, var(--surface));
  transform: translateY(-1px);
}

.memory-capture-ref-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--shell-bg) 92%, #000);
  color: var(--on-brand);
}

.memory-capture-ref-badge-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.memory-capture-ref-badge-code {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.memory-capture-source-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-decoration: none;
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--border));
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.memory-capture-source-link svg {
  width: 14px;
  height: 14px;
}

.memory-capture-source-link:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent-soft) 80%, var(--surface));
}

.memory-capture-meta-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface-muted));
}

.memory-capture-meta-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.memory-capture-meta-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}

.memory-capture-meta-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.memory-capture-meta-tab.is-active svg {
  opacity: 1;
  color: var(--brand);
}

.memory-capture-meta-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 800;
  background: color-mix(in srgb, var(--brand) 14%, var(--surface-muted));
  color: var(--text-secondary);
}

.memory-capture-meta-tab.is-active .memory-capture-meta-tab-count {
  background: color-mix(in srgb, var(--brand) 18%, var(--surface));
  color: var(--text);
}

.memory-capture-meta-panels {
  min-height: 0;
}

.memory-capture-meta-panel {
  animation: memory-meta-in 0.2s var(--ease);
}

.memory-capture-meta-panel[hidden] {
  display: none;
}

@keyframes memory-meta-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.memory-capture-text--insight {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-style: italic;
  line-height: 1.55;
  color: var(--text);
  background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface));
  border-left: 3px solid var(--brand);
}

.memory-insight-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.memory-insight-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.memory-insight-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.memory-insight-section-body {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.memory-insight-section-body p {
  margin: 0;
}

.memory-insight-muted {
  color: var(--text-muted);
  font-size: 12px;
}

.memory-insight-section--lead {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--brand) 10%, var(--border));
}

.memory-capture-insight-byline + .memory-capture-text--insight {
  margin-top: 0;
}

.memory-capture-text--comment {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-muted) 70%, var(--surface));
  font-style: italic;
}

.memory-capture-ref-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.memory-capture-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}

.memory-capture-link-btn svg {
  width: 16px;
  height: 16px;
}

.memory-capture-link-btn:hover {
  background: color-mix(in srgb, var(--surface) 88%, var(--brand));
  transform: translateY(-1px);
}

.memory-capture-ref-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.memory-capture-ref-code {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
}

.memory-capture-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

.memory-capture-tags-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-capture-tags-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.memory-capture-tags-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.memory-capture-tags--editable {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.memory-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 4px;
}

.memory-tag-chip-label {
  line-height: 1.2;
}

.memory-tag-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}

.memory-tag-chip-remove:hover {
  background: rgba(0, 0, 0, 0.14);
  color: var(--text);
}

.memory-tag-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.memory-tag-add-btn svg {
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  padding: 5px;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 14%, transparent);
  stroke-width: 2.5;
  flex-shrink: 0;
}

.memory-tag-add-btn:hover {
  border-color: var(--dark);
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
  color: var(--dark);
}

.memory-capture-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.memory-tag--strong,
.detected-tag--strong {
  background: color-mix(in srgb, var(--brand) 18%, var(--surface));
  color: var(--text);
  font-weight: 700;
}

.memory-tag--mid,
.detected-tag--mid {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.memory-tag--subtle,
.detected-tag--subtle {
  background: color-mix(in srgb, var(--surface) 88%, var(--text-muted));
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 10px;
}

.memory-capture-tags .pill,
.board-back-widget-tags .detected-tag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
}

.memory-capture-tags-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.memory-capture-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0;
}

.board-back-widget--mono .board-back-widget-value,
.board-back-widget--mono .board-back-widget-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  word-break: break-all;
}

.memory-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-line;
}

.memory-msg--user {
  align-self: flex-start;
  background: var(--shell-bg);
  color: var(--on-brand);
  border-bottom-left-radius: 6px;
}

.memory-msg--bot {
  align-self: flex-start;
  background: var(--surface);
  color: var(--text);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-soft);
}

.memory-msg--bot.is-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.memory-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: memory-typing 1s var(--ease) infinite;
}

.memory-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.memory-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes memory-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.memory-input {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 8px 8px 8px 16px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
}

.memory-input-ico {
  display: inline-flex;
  color: var(--text-muted);
  flex-shrink: 0;
}

.memory-input-ico svg {
  width: 18px;
  height: 18px;
}

.memory-input input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
}

.memory-input input::placeholder {
  color: var(--text-muted);
}

.memory-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--shell-bg);
  color: var(--on-brand);
  cursor: pointer;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}

.memory-send:hover {
  background: color-mix(in srgb, var(--shell-bg) 88%, #000000);
}

.memory-send:active {
  transform: scale(0.92);
}

.memory-send svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 1180px) {
  .memory-rail {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 12px;
    width: auto;
    padding: 0 12px;
    z-index: 940;
    pointer-events: none;
  }

  .memory-rail .memory-card {
    pointer-events: auto;
  }

  .memory-rail .memory-input {
    display: flex;
    flex-shrink: 0;
  }

  /* Capture view: full-width bottom sheet (no side rail / arrows) */
  .memory-rail.is-capture-open {
    display: block;
  }

  .memory-rail.is-capture-open .memory-rail-tab {
    display: none !important;
  }

  .memory-rail.is-capture-open .memory-collapse-btn {
    display: inline-flex !important;
  }

  .memory-rail-arrow--desktop-only {
    display: none !important;
  }

  .memory-rail-arrow--mobile-only {
    display: inline-flex !important;
  }

  .memory-mobile-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 4px 0 2px;
    border: none;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
  }

  .memory-rail.is-active .memory-mobile-expand,
  .memory-rail.is-capture-open .memory-mobile-expand {
    display: none;
  }

  .memory-rail.is-capture-open .memory-head {
    flex-shrink: 0;
    align-items: center;
    max-height: 44px;
    cursor: pointer;
    display: grid;
    grid-template-columns: 32px 1fr 32px;
  }

  .memory-rail.is-capture-open .memory-collapse-btn {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .memory-rail.is-capture-open .memory-head-label {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
    padding: 0 36px;
  }

  .memory-rail.is-capture-open .memory-card {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    flex: none;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
    max-height: min(86dvh, calc(100dvh - var(--topbar-h, 56px) - 24px));
    padding: 10px;
    background: color-mix(in srgb, var(--accent-soft) 50%, transparent);
    -webkit-backdrop-filter: blur(var(--m-glass-blur, 16px));
    backdrop-filter: blur(var(--m-glass-blur, 16px));
    border: 1px solid color-mix(in srgb, var(--brand) 28%, #ffffff);
    border-radius: 22px;
    box-shadow: var(--shadow-lift);
  }

  .memory-rail.is-capture-open .memory-input {
    flex: 0 0 auto;
    margin-top: auto;
  }

  .memory-rail.is-capture-open .memory-head,
  .memory-rail.is-capture-open .memory-body {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    overflow: hidden;
  }

  .memory-rail.is-capture-open .memory-body {
    flex: 1;
    min-height: 0;
    max-height: none;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .memory-rail.is-capture-open .memory-body::-webkit-scrollbar {
    display: none;
  }

  .memory-rail.is-capture-open .memory-input {
    flex-shrink: 0;
  }

  .memory-rail.is-capture-open .memory-capture-player--portrait .memory-capture-viewport-hit {
    max-width: 100%;
  }

  /* Show the full capture — no crop / Ken Burns on narrow viewports */
  .memory-rail.is-capture-open .memory-capture-viewport-hit {
    max-width: 100%;
    height: auto;
  }

  .memory-rail.is-capture-open .memory-capture-viewport {
    aspect-ratio: unset;
    height: auto;
    overflow: visible;
    background: #0f1115;
  }

  .memory-rail.is-capture-open .memory-capture-viewport-motion {
    display: none;
  }

  .memory-rail.is-capture-open .memory-capture-frame-img {
    position: relative;
    inset: auto;
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center top;
    opacity: 1;
  }

  .memory-rail.is-capture-open .memory-capture-play-overlay {
    display: none;
  }
}

/* Mobile — chat docked at the bottom, LLM-style composer that expands up */
@media (max-width: 768px) {
  .memory-rail {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--m-bottombar-h, 56px) + env(safe-area-inset-bottom, 0px) + 8px);
    width: auto;
    z-index: 940;
    padding: 0 12px;
    pointer-events: none;
  }

  /* S/L now lives in the header controls, so the composer spans the full width. */

  /* Collapsed: only the white composer pill shows (clean LLM input bar) */
  .memory-card {
    pointer-events: auto;
    flex: none;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    max-height: min(68vh, 540px);
    transition: padding 0.28s var(--ease), background 0.28s var(--ease),
      border-color 0.28s var(--ease), box-shadow 0.28s var(--ease), gap 0.28s var(--ease);
  }

  .memory-rail.is-capture-open .memory-input {
    flex-shrink: 0;
  }

  /* Mobile composer always visible; sheet scrolls above it */
  .memory-input {
    flex: 0 0 auto;
    display: flex !important;
  }

  .memory-rail.is-active .memory-card,
  .memory-rail.is-capture-open .memory-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .memory-rail.is-active .memory-input,
  .memory-rail.is-capture-open .memory-input {
    flex: 0 0 auto;
    margin-top: auto;
  }

  .memory-head,
  .memory-body {
    display: flex;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.32s var(--ease), opacity 0.24s var(--ease);
  }

  .memory-body {
    flex-direction: column;
  }

  /* Side tab is desktop-only; mobile uses up/down chevrons */
  .memory-rail-tab {
    display: none !important;
  }

  .memory-rail-arrow--desktop-only {
    display: none !important;
  }

  .memory-rail-arrow--mobile-only {
    display: inline-flex !important;
  }

  .memory-collapse-btn {
    display: none;
  }

  .memory-rail.is-active .memory-collapse-btn,
  .memory-rail.is-capture-open .memory-collapse-btn {
    display: inline-flex !important;
  }

  .memory-mobile-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2px 0 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
  }

  .memory-rail.is-active .memory-mobile-expand,
  .memory-rail.is-capture-open .memory-mobile-expand {
    display: none;
  }

  /* Safety net: never let a lingering collapsed state hide the mobile chat */
  .memory-rail.is-collapsed {
    width: auto;
  }

  .memory-rail.is-collapsed .memory-card {
    display: flex;
  }

  /* Open: blue sheet with the conversation above the composer */
  .memory-rail.is-active .memory-card {
    padding: 10px;
    background: color-mix(in srgb, var(--accent-soft) 50%, transparent);
    -webkit-backdrop-filter: blur(var(--m-glass-blur, 16px));
    backdrop-filter: blur(var(--m-glass-blur, 16px));
    border: 1px solid color-mix(in srgb, var(--brand) 28%, #ffffff);
    border-radius: 22px;
    box-shadow: var(--shadow-lift);
    gap: 12px;
  }

  .memory-rail.is-active .memory-head {
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    max-height: 48px;
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
  }

  .memory-rail.is-active .memory-collapse-btn {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .memory-rail.is-active .memory-head-label {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
    padding: 0 36px;
  }

  /* Frosted composer: mostly white input, blur still applies behind it. */
  .memory-input {
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: blur(var(--m-glass-blur, 16px));
    backdrop-filter: blur(var(--m-glass-blur, 16px));
  }

  .memory-rail.is-active .memory-body {
    max-height: min(52vh, 420px);
    opacity: 1;
    pointer-events: auto;
  }

  .memory-rail.is-active .memory-body,
  .memory-rail.is-capture-open .memory-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Capture open: taller scrollable sheet for picture + sections */
  .memory-rail.is-capture-open {
    bottom: calc(var(--m-bottombar-h, 56px) + env(safe-area-inset-bottom, 0px) + 8px);
  }

  .memory-rail.is-capture-open .memory-head,
  .memory-rail.is-capture-open .memory-body {
    opacity: 1;
    pointer-events: auto;
  }

  .memory-rail.is-capture-open .memory-head {
    max-height: 44px;
    overflow: visible;
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
  }

  .memory-rail.is-capture-open .memory-collapse-btn {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .memory-rail.is-capture-open .memory-head-label {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
    padding: 0 36px;
  }

  .memory-rail.is-capture-open .memory-card {
    max-height: min(82dvh, calc(100dvh - var(--m-appbar-h, 52px) - var(--m-bottombar-h, 56px) - 28px));
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .memory-rail.is-capture-open .memory-body {
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.feed-date-pill {
  position: sticky;
  top: 10px;
  z-index: 6;
  display: flex;
  justify-content: center;
  padding: 4px 0 14px;
  pointer-events: none;
}

.feed-date-pill span {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.feed-post {
  background: var(--surface);
  border: none;
  border-radius: var(--card-radius);
  margin-bottom: var(--space-5);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.feed-post:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.feed-post--analyzing {
  opacity: 0.92;
}

.feed-post-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 16px 12px;
}

.feed-avatar {
  width: 40px;
  height: 40px;
}

.feed-author { flex: 1; min-width: 0; }

.feed-author-name {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
}

.feed-author-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.feed-more {
  border: none;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  line-height: 1;
  border-radius: var(--radius-pill);
  transition: background 0.15s var(--ease);
}

.feed-more:hover { background: var(--accent-soft); color: var(--dark); }

.feed-body { padding: 8px 22px 12px; }

.feed-media-wrap {
  position: relative;
  padding: var(--card-inset-feed) var(--card-inset-feed) 16px;
  --media-corner-r: var(--card-radius-inner-feed);
}

.feed-media {
  display: block;
  width: 100%;
  aspect-ratio: var(--media-aspect);
  overflow: hidden;
  border-radius: var(--card-radius-inner-feed);
}

.feed-media img,
.feed-media .capture-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--card-radius-inner-feed);
}

.feed-media.analyzing {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--media-aspect);
  overflow: hidden;
  border-radius: var(--card-radius-inner-feed);
  background: var(--surface-muted);
}

.feed-media.analyzing .capture-preview,
.feed-media.analyzing img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.analyzing-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(247, 248, 247, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius: inherit;
}

.analyzing-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.analyzing-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--dark);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.analyzing-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.feed-source-badge {
  position: absolute;
  z-index: 2;
  top: calc(max(var(--corner-badge-pad), (var(--media-corner-r) - var(--source-badge-size)) * var(--corner-align) + var(--corner-badge-pad)) + var(--card-inset-feed));
  left: calc(max(var(--corner-badge-pad), (var(--media-corner-r) - var(--source-badge-size)) * var(--corner-align) + var(--corner-badge-pad)) + var(--card-inset-feed));
}

.feed-ai-chip {
  position: absolute;
  z-index: 2;
  top: calc(max(var(--corner-badge-pad), (var(--media-corner-r) - var(--chip-block-size)) * var(--corner-align) + var(--corner-badge-pad)) + var(--card-inset-feed));
  right: calc(max(var(--corner-badge-pad), (var(--media-corner-r) - var(--chip-block-size)) * var(--corner-align) + var(--corner-badge-pad)) + var(--card-inset-feed));
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  border: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}

.feed-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 18px 12px;
}

.feed-action-btn {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.feed-action-btn:hover { background: var(--surface-muted); color: var(--text); }

.feed-action-btn svg { width: 16px; height: 16px; }

.feed-caption {
  padding: 0 0 var(--space-3);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--text);
}

.feed-caption strong { font-weight: 700; margin-right: var(--space-2); }

.feed-tags {
  padding: 0 0 var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Tag pills — from super/, B2B solid */
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-muted);
  color: var(--text-secondary);
  border: none;
}

.tag-pill--pending {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border);
}

.feed-source-link {
  padding: 0 0 var(--space-4);
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.feed-source-link a { color: inherit; text-decoration: none; }
.feed-source-link a:hover { text-decoration: underline; }

.feed-shared {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-3) 18px 18px;
  padding: 14px 16px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  border-top: none;
}

.feed-shared-avatars {
  display: flex;
  height: 24px;
  align-items: center;
}

.feed-mini-avatar,
.feed-shared-avatars .avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.feed-shared-text {
  font-size: 12px;
  color: var(--text-muted);
}

.feed-section-label {
  display: none;
}

.feed-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
}

.feed-badge--personal {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

/* Source logos — black circle, B&W all platforms */
.source-logo,
.feed-source-badge,
.board-source-badge,
.detail-thumb-badge {
  width: var(--source-badge-size);
  height: var(--source-badge-size);
  border-radius: var(--source-badge-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--dark);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.source-logo svg,
.feed-source-badge svg,
.board-source-badge svg,
.detail-thumb-badge svg {
  width: var(--source-badge-icon);
  height: var(--source-badge-icon);
}

.pill {
  padding: 6px 14px;
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
}

.story-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: 72px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.story-ring {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-square-lg);
  padding: 2px;
  background: var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-ring.active {
  background: var(--dark);
}

.story-ring.muted {
  background: var(--border);
}

.story-ring .avatar--lg {
  border-radius: calc(var(--radius-square-lg) - 2px);
}

.story-ring img {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius-square-lg) - 2px);
  object-fit: cover;
  border: 2px solid var(--surface);
  background: #eee;
}

.story-ring.add {
  background: var(--bg);
  border: 2px dashed var(--border-strong);
  padding: 0;
  border-radius: var(--radius-square-lg);
}

.story-ring.add span {
  font-size: 28px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1;
}

.story-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Invite modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16,24,40,0.4);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open { display: flex; }

.board-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  background: var(--shell-bg);
}

.board-lightbox:not(.is-open) {
  display: none;
}

.board-lightbox-layout {
  display: grid;
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
}

.board-lightbox-layout--portrait {
  grid-template-columns: minmax(260px, 38vw) 1fr;
}

.board-lightbox-layout--landscape {
  grid-template-columns: minmax(320px, 52%) 1fr;
}

.board-lightbox-media-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 56px 28px 28px;
  background: #0c0c10;
}

.board-lightbox-layout--portrait .board-lightbox-media-col {
  justify-content: center;
}

.board-lightbox-layout--landscape .board-lightbox-media-col {
  justify-content: flex-start;
  padding-top: 64px;
}

.board-lightbox-media-frame {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  background: #141418;
}

.board-lightbox-layout--portrait .board-lightbox-media-frame {
  aspect-ratio: 9 / 16;
  height: min(calc(100dvh - 112px), 100%);
  width: auto;
  max-width: 100%;
}

.board-lightbox-layout--landscape .board-lightbox-media-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 100%;
}

.board-lightbox-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.board-lightbox-preview {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.board-lightbox-layout--portrait .board-lightbox-preview {
  aspect-ratio: 9 / 16;
}

.board-lightbox-layout--landscape .board-lightbox-preview {
  aspect-ratio: 16 / 9;
}

.board-lightbox-journal {
  width: 100%;
  margin-top: 20px;
}

.board-lightbox-journal .board-back-widget {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.board-lightbox-journal .board-back-widget-label {
  color: rgba(255, 255, 255, 0.55);
}

.board-lightbox-journal .board-back-widget-value {
  color: #fff;
  font-size: 15px;
  line-height: 1.55;
}

.board-lightbox-journal .board-back-widget-meta {
  color: rgba(255, 255, 255, 0.45);
}

.board-lightbox-detail-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
}

.board-lightbox-detail-head {
  flex-shrink: 0;
  padding: 28px 32px 16px;
  border-bottom: 1px solid var(--border);
}

.board-lightbox-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
  color: var(--text);
}

.board-lightbox-meta {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.board-lightbox-detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 32px;
  -webkit-overflow-scrolling: touch;
}

.board-lightbox-widgets {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.board-lightbox-widgets .board-back-widget {
  padding: 16px 18px;
  border-radius: 16px;
}

.board-lightbox-widgets .board-back-widget-value {
  font-size: 15px;
  line-height: 1.55;
}

.board-lightbox-widgets .board-back-widget-label {
  font-size: 11px;
}

.board-lightbox-detail-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 32px 24px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--dark);
  color: var(--text-on-dark);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  align-self: flex-start;
}

.board-lightbox-detail-link svg {
  width: 16px;
  height: 16px;
}

.board-lightbox-detail-link:hover {
  opacity: 0.92;
  color: var(--text-on-dark);
  text-decoration: none;
}

.board-lightbox-dismiss {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.board-lightbox-dismiss:hover {
  background: var(--surface-muted);
}

body.board-lightbox-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .board-lightbox-layout--portrait,
  .board-lightbox-layout--landscape {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }

  .board-lightbox-media-col {
    padding: 56px 20px 20px;
  }

  .board-lightbox-layout--portrait .board-lightbox-media-frame {
    height: auto;
    width: min(72vw, 320px);
  }

  .board-lightbox-detail-col {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .board-lightbox-detail-head {
    padding: 20px 20px 12px;
  }

  .board-lightbox-detail-scroll {
    padding: 16px 20px;
    overflow: visible;
  }

  .board-lightbox-detail-link {
    margin: 0 20px 20px;
  }
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lift);
}

.modal h2 {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 8px;
}

.modal p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.modal-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 16px;
}

.modal-input:focus {
  outline: none;
  border-color: var(--dark);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Add capture modal — styled file picker */
.modal--add-capture .modal-lead {
  margin-bottom: 18px;
}

.modal-file-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  min-width: 0;
}

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

.modal-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.modal-file-btn:hover {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: var(--shadow-soft);
}

.modal-file-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
}

.modal-file-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-file-name.has-file {
  color: var(--text);
  font-weight: 600;
}

.modal--add-capture .modal-divider {
  margin: 14px 0 16px;
}

.modal--add-capture .modal-input {
  margin-bottom: 0;
}

.modal--add-capture .modal-actions {
  margin-top: 20px;
}

.board-capture-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--card-radius-inner-board);
}

/* ── Analyzing state ──────────────────────────────────────────
   A capture being processed: the preview is grayed out, a scan line
   sweeps top→bottom, and a live percentage counts up to 100%. */
.board-card.is-analyzing .board-capture-img,
.board-card.is-analyzing .capture-preview {
  filter: grayscale(1) brightness(0.55);
}

.board-analyzing {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 24, 0.38);
  pointer-events: none;
}

.board-analyzing-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand, #6366f1), transparent);
  box-shadow: 0 0 14px 3px color-mix(in srgb, var(--brand, #6366f1) 70%, transparent);
  animation: board-scan 1.8s ease-in-out infinite;
}

@keyframes board-scan {
  0% { top: 0%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.board-analyzing-pct {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 800;
  font-size: clamp(13px, 3.2vw, 30px);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

/* ============================================================
   MOBILE CHROME — app bar + bottom bar
   Hidden by default; revealed in the ≤768px media query below.
   ============================================================ */
.m-appbar,
.m-bottombar {
  display: none;
}

.m-appbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: auto;
  min-height: calc(var(--m-appbar-h, 72px) + env(safe-area-inset-top, 0px));
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px 0;
  align-items: stretch;
  gap: 0;
  /* Transparent — the frosted look behind the search row and rectangle comes
     from the board fade (.board-wrap::before), which matches the white gradient
     in both size and curve. */
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: none;
  z-index: 1000;
}

.m-appbar-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
}

.m-appbar-search {
  flex: 1;
  min-width: 0;
}

.m-appbar-search .search-field {
  width: 100%;
}

.m-appbar-search .search-submit {
  width: 32px;
  height: 32px;
}

.m-appbar-search .search-submit svg {
  width: 15px;
  height: 15px;
}

.m-context-pill {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex-shrink: 0;
  width: 132px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
}

.m-context-pill-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: var(--radius-pill);
  background: var(--theme-sidebar-secondary);
  transition: transform 0.2s var(--ease);
  pointer-events: none;
}

.m-context-pill[data-active="personal"] .m-context-pill-thumb {
  transform: translateX(100%);
}

.m-context-pill-opt {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.15s var(--ease);
}

.m-context-pill-opt.is-active {
  color: var(--on-brand);
}

.m-appbar-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
}

.m-appbar-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  text-decoration: none;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.m-appbar-tab.is-active {
  background: var(--dark);
  color: var(--text-on-dark);
}

.m-appbar-settings {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  color: var(--text-muted);
}

.m-appbar-settings svg {
  width: 22px;
  height: 22px;
}

.m-appbar-search:empty {
  display: none;
}

.m-appbar-search-input,
.m-appbar-search .search-input {
  width: 100%;
  min-height: 40px;
  padding: 10px 44px 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
}

.m-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.m-user-card--compact {
  padding: 8px 10px;
  gap: 10px;
  border-radius: 14px;
}

.m-user-card-photo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  object-fit: cover;
  background: #dbeafe;
}

.m-user-card--compact .m-user-card-photo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.m-user-card-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m-user-card-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-user-card--compact .m-user-card-name {
  font-size: 11px;
}

.m-user-card-email {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-user-card--compact .m-user-card-email {
  font-size: 9px;
}

.m-appbar-logo {
  flex-shrink: 0;
  display: inline-flex;
  line-height: 0;
}

.m-appbar-logo img {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: contain;
}

.m-icon-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}

.m-icon-btn:active {
  background: var(--surface-muted);
}

.m-icon-btn svg {
  width: 24px;
  height: 24px;
}

.m-appbar-avatar {
  padding: 0;
  flex-shrink: 0;
  border: none;
  background: none;
  border-radius: var(--radius-square);
  line-height: 0;
}

.m-appbar-avatar .m-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-square);
  border: 2px solid var(--border);
  object-fit: cover;
  display: block;
  background: #dbeafe;
}

.m-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.24s var(--ease);
}

.m-scrim.is-visible {
  opacity: 1;
}

.m-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(82vw, 320px);
  z-index: 1200;
  flex-direction: column;
  gap: 14px;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 16px calc(20px + env(safe-area-inset-bottom, 0px));
  background: #121212;
  color: #ffffff;
  transform: translateX(-100%);
  transition: transform 0.26s var(--ease);
  box-shadow: none;
  overflow-y: auto;
}

.m-drawer.is-open {
  transform: translateX(0);
}

.m-drawer .m-user-card {
  flex: none;
  width: 100%;
}

.m-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
}

.m-seg-opt {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.m-seg-opt.is-active {
  background: var(--theme-sidebar-secondary);
  color: var(--theme-sidebar-active-text);
}

.m-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.m-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.m-nav-item:hover {
  text-decoration: none;
  color: #fff;
}

.m-nav-item.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.m-nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  opacity: 0.85;
}

.m-nav-icon svg {
  width: 22px;
  height: 22px;
}

.m-bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 0;
  height: calc(var(--m-bottombar-h, 56px) + env(safe-area-inset-bottom, 0px));
  padding: 0 8px env(safe-area-inset-bottom, 0px);
  background: var(--shell-bg);
  border: none;
  border-radius: 0;
  z-index: 50;
  box-shadow: none;
}

.m-bottom-item {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 44px;
  padding: 6px;
  border: none;
  background: none;
  color: color-mix(in srgb, var(--on-brand) 55%, transparent);
  text-decoration: none;
  cursor: pointer;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.m-bottom-item:active {
  background: color-mix(in srgb, var(--shell-bg) 86%, #000000);
}

.m-bottom-item.is-active {
  color: var(--on-brand);
}

.m-bottom-item--btn {
  font-family: inherit;
}

.m-bottom-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.m-bottom-item-icon svg {
  width: 24px;
  height: 24px;
}

.m-bottom-item-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.m-bottom-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.m-bottom-zoom {
  display: none;
  align-items: center;
  gap: 4px;
}

.m-bottom-zoom-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.m-bottom-zoom-btn.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.m-bottom-zoom-btn:active {
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 1100px) {
  .detail-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-gallery[data-zoom="sm"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .board-gallery[data-zoom="lg"],
  .board-gallery:not([data-zoom]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .board-gallery[data-zoom="sm"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .board-gallery[data-zoom="lg"],
  .board-gallery:not([data-zoom]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  body { background: var(--surface); padding: 0; }
  :root {
    /* Real search-row height: 8px top pad + 40px search input.
       Keeping this exact means the header rectangle sits a true 8px below. */
    --m-appbar-h: 48px;
    --m-bottombar-h: 56px;
    --m-canvas-radius: 28px;
    --m-glass-blur: 16px;
    /* Fade reaches the top of the cards (taller header on mobile) */
    --board-fade-h: 276px;
    /* Blur is shorter — it finishes just after the header rectangle:
       app bar + safe area + 8px gap + rectangle (~68px) + a short fade tail. */
    --board-blur-h: calc(var(--m-appbar-h, 48px) + env(safe-area-inset-top, 0px) + 96px);
  }

  .feed-wrap {
    --board-fade-h: calc(env(safe-area-inset-top, 0px) + var(--m-appbar-h, 48px) + 20px);
    --board-blur-h: calc(env(safe-area-inset-top, 0px) + var(--m-appbar-h, 48px) + 8px);
    --board-cap-h: calc(env(safe-area-inset-top, 0px) + var(--m-appbar-h, 48px));
  }

  /* Reveal mobile chrome */
  .m-appbar { display: flex; }
  .m-appbar-panel.page-search-panel {
    margin: 0;
    padding: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
  }
  .m-bottombar {
    display: flex;
  }

  .m-appbar-panel {
    gap: 8px;
    padding: 8px 10px;
    align-items: center;
  }

  .m-appbar-search .search-input,
  .m-appbar-search-input {
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
  }

  .m-context-pill {
    width: 132px;
    height: 40px;
    box-sizing: border-box;
    padding: 3px;
    align-self: center;
  }

  .m-context-pill-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    font-size: 11px;
  }

  /* Shell: flex column — main panel above, footer strip reserved below */
  .app-shell {
    display: flex;
    flex-direction: column;
    margin: 0;
    gap: 0;
    border-radius: 0;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    box-shadow: none;
    background: var(--shell-bg);
    box-sizing: border-box;
    padding: 0 0 calc(var(--m-bottombar-h, 56px) + env(safe-area-inset-bottom, 0px));
  }
  .main {
    flex: 1;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    display: flex;
    flex-direction: column;
  }
  .feed-wrap,
  .detail-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    position: relative;
    background-color: var(--surface-muted);
    border-radius: 0 0 var(--m-canvas-radius) var(--m-canvas-radius);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--border) 75%, transparent);
  }

  .board-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* Stop the rubber-band overscroll that drags the sticky rectangle and the
       fixed bottom gradient out of place when you hit the top/bottom of the list. */
    overscroll-behavior: none;
    position: relative;
    background-color: var(--surface-muted);
    border-radius: 0 0 var(--m-canvas-radius) var(--m-canvas-radius);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--border) 75%, transparent);
  }
  .hub { margin: 0; border-radius: 0; box-shadow: none; min-height: 100vh; }
  .sidebar { display: none; }

  /* In-page search panels hidden — search lives in m-appbar panel */
  .feed-wrap > .board-search-panel,
  .board-wrap > .board-search-panel {
    display: none;
  }

  .detail-wrap .topbar {
    min-height: auto;
    padding: calc(var(--m-appbar-h, 52px) + env(safe-area-inset-top, 0px) + 10px) 8px 10px;
  }

  .detail-wrap .detail-canvas.page-canvas {
    padding: 12px 8px 20px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
  }
  .topbar-title,
  .topbar-sub { display: none; }

  .page-canvas {
    padding: calc(var(--m-appbar-h, 52px) + env(safe-area-inset-top, 0px) + 12px) 8px 20px;
    scrollbar-gutter: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
  }

  .feed-wrap .feed-canvas.page-canvas {
    flex: 1;
    min-height: 0;
    padding: calc(var(--m-appbar-h, 52px) + env(safe-area-inset-top, 0px) + 12px) var(--board-inset-x) 88px;
  }

  .page-canvas::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  /* Board — scroll on wrap so gallery blurs under frosted header panel */
  .feed-wrap,
  .board-wrap {
    --board-inset-x: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .feed-wrap::-webkit-scrollbar,
  .board-wrap::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  /* Panel top is square under the app bar on mobile — keep overlay corners square */
  .feed-wrap::before,
  .board-wrap::before,
  .feed-wrap .board-fade-blur,
  .board-wrap .board-fade-blur,
  .feed-wrap .board-fade-cap,
  .board-wrap .board-fade-cap {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  /* Pin the f3f3f3 bottom gradient to the viewport (fixed) so it never scrolls with
     the cards on mobile — sticky is unreliable inside the momentum-scrolling, rounded
     board-wrap. Sits just above the bottom bar, full width, matching the board's
     rounded bottom corners. */
  .board-fade-blur-bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--m-bottombar-h, 56px) + env(safe-area-inset-bottom, 0px));
    margin-top: 0;
    z-index: 870;
    border-bottom-left-radius: var(--m-canvas-radius, 28px);
    border-bottom-right-radius: var(--m-canvas-radius, 28px);
  }

  .board-wrap .board-header-panel {
    margin: calc(var(--m-appbar-h, 52px) + env(safe-area-inset-top, 0px) + 8px) var(--board-inset-x) 0;
    /* Match desktop vertical padding so the rectangle height is identical */
    padding: 14px 12px;
    position: sticky;
    /* top matches the panel's resting offset so it stays put from the first pixel */
    top: calc(var(--m-appbar-h, 52px) + env(safe-area-inset-top, 0px) + 8px);
    z-index: 900;
    background: var(--shell-bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
  }

  /* Toolbar in the rectangle = the action buttons row only. The board picker +
     S/L live in .board-header-controls, dropped BELOW the rectangle (see below). */
  .board-header-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .board-header-toolbar .board-bar-shell {
    flex: none;
    width: 100%;
  }

  .board-header-divider {
    display: none;
  }

  /* Board picker (wide) + S/L sit OUTSIDE / under the rectangle, almost its full
     width. Absolutely pinned to the sticky panel's bottom edge so they stick with
     the header. This frees the bottom chat bar (S/L no longer shares its line). */
  .board-header-controls {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 5;
  }

  .board-header-controls .board-mobile-picker {
    flex: 1 1 auto;
    min-width: 0;
  }

  .board-header-actions {
    position: static;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: auto;
    min-width: 0;
  }

  .board-header-actions .share-with {
    display: none !important;
  }

  .board-wrap .board-stage {
    /* Leave room for the absolutely-positioned controls row under the rectangle. */
    margin-top: 56px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
  }

  .board-wrap .board-stage .board-canvas {
    overflow: visible;
    flex: 1;
    min-height: 0;
    background: transparent;
    padding: 0 var(--board-inset-x) 88px;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    z-index: auto;
  }

  /* Board picker dropdown on mobile — same row as Add board */
  .board-wrap .board-bar-scroll-wrap { display: none !important; }
  .board-wrap .board-bar-fixed {
    width: 100%;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }
  .board-bar-fixed .board-round-btn {
    width: 40px;
    height: 40px;
  }
  .board-mobile-picker {
    display: block;
    flex: 1;
    min-width: 0;
  }
  .board-mobile-picker-trigger {
    height: 40px;
    padding: 0 6px 0 14px;
    font-size: 13px;
  }
  .board-bar-fixed .board-cat-add {
    flex-shrink: 0;
    height: 40px;
    padding: 0 16px 0 5px;
    align-items: center;
  }

  .board-gallery[data-zoom="sm"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 100%;
    gap: 8px;
    margin: 0;
  }

  .board-gallery[data-zoom="lg"],
  .board-gallery:not([data-zoom]) {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
    gap: 12px;
    margin: 0;
  }

  /* Detail */
  .detail-hero { flex-direction: column; }
  .detail-thumb { width: 100%; max-width: 180px; }
  .detail-cards-grid { grid-template-columns: 1fr; }
  .detail-card--wide { grid-column: auto; }

  /* Feed */
  .feed-layout { max-width: 100%; }
  .feed-media { max-height: none; }

  /* Modals fit the viewport */
  .modal { width: calc(100vw - 32px); max-width: 440px; }

  /* Collapse removed on mobile — the rectangle stays visible, no grip. */
  .board-header-grip {
    display: none;
  }
}

@media (max-width: 520px) {
  .m-appbar-tab {
    padding: 0 8px;
    font-size: 9px;
  }

  .m-context-pill {
    width: 124px;
  }
}

/* Desktop — frosted sticky chrome; main scrolls so content blurs behind headers */
@media (min-width: 769px) {
  .sidebar-context-option {
    font-size: 11px;
    padding: 8px 10px;
  }

  .m-appbar,
  .m-bottombar {
    display: none !important;
  }

  :root {
    --glass-blur: 16px;
    /* Search panel resting bottom: top gap (20) + input (~39) + bottom gap (8) */
    --page-search-panel-stuck-h: 67px;
    /* Fade reaches the top of the cards, just below the header rectangle */
    --board-fade-h: 258px;
    /* Blur is shorter — it finishes just after the header rectangle. */
    --board-blur-h: 150px;
  }

  .feed-wrap {
    /* sticky top (20) + search margin-top (20) + input (~40) + margin-bottom (8) */
    --board-fade-h: calc(20px + 20px + 40px + 8px + 12px);
    --board-blur-h: calc(20px + 20px + 40px + 8px);
    --board-cap-h: 52px;
  }

  .feed-wrap,
  .board-wrap,
  .detail-wrap {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: auto;
  }

  /* Pinned from the first pixel — top matches the panel's 20px top gap so it never drifts */
  .page-search-panel {
    position: sticky;
    top: 20px;
    z-index: 910;
  }

  .detail-wrap > .topbar {
    position: sticky;
    top: 0;
    z-index: 910;
    background: color-mix(in srgb, var(--surface-muted) 70%, transparent);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
  }

  .board-wrap .board-header-panel {
    position: sticky;
    top: var(--page-search-panel-stuck-h, 80px);
    z-index: 900;
    background: var(--shell-bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
  }

  .board-wrap .board-stage {
    flex: none;
    min-height: auto;
  }

  .feed-wrap .feed-canvas.page-canvas,
  .board-wrap .board-stage .board-canvas,
  .detail-wrap .detail-canvas {
    overflow: visible;
    flex: none;
    min-height: auto;
  }

  .feed-wrap::-webkit-scrollbar,
  .board-wrap::-webkit-scrollbar,
  .detail-wrap::-webkit-scrollbar {
    width: 18px;
  }

  .feed-wrap::-webkit-scrollbar-button,
  .board-wrap::-webkit-scrollbar-button,
  .detail-wrap::-webkit-scrollbar-button {
    display: none;
    height: 0;
    width: 0;
  }

  .feed-wrap::-webkit-scrollbar-track,
  .board-wrap::-webkit-scrollbar-track,
  .detail-wrap::-webkit-scrollbar-track {
    background-color: var(--surface-muted);
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M5 2 1 8h8z' fill='%238a8a8a'/%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M5 8 9 2H1z' fill='%238a8a8a'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: center 8px, center calc(100% - 8px);
    background-size: 9px, 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    margin: 10px 4px 18px 6px;
  }

  .feed-wrap::-webkit-scrollbar-track {
    background-color: var(--surface);
  }

  .feed-wrap::-webkit-scrollbar-thumb,
  .board-wrap::-webkit-scrollbar-thumb,
  .detail-wrap::-webkit-scrollbar-thumb {
    background-color: var(--border-strong);
    background-clip: content-box;
    border: 4px solid transparent;
    border-radius: var(--radius-pill);
    min-height: 44px;
  }

  .feed-wrap::-webkit-scrollbar-thumb:hover,
  .board-wrap::-webkit-scrollbar-thumb:hover,
  .detail-wrap::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
  }
}

/* ============================================================
   Board mode L — full-height horizontal infinite row.
   The page stops scrolling vertically; the gallery becomes a
   single horizontal strip whose cards fill the available height
   so the whole 9:16 card is visible without being cropped.
   Applies to both desktop and mobile.
   ============================================================ */
.board-wrap:has(.board-gallery[data-zoom="lg"]) {
  overflow: hidden;
  padding-bottom: 0;
  scrollbar-gutter: auto;
}

/* Sticky doesn't work when the wrap doesn't scroll vertically — pin the fade as an overlay */
.board-wrap:has(.board-gallery[data-zoom="lg"])::before {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--board-fade-h, 258px);
  margin-bottom: 0;
}

.board-wrap:has(.board-gallery[data-zoom="lg"]) .board-fade-blur {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--board-blur-h, 190px);
  margin-bottom: 0;
}

.board-wrap:has(.board-gallery[data-zoom="lg"]) .board-fade-cap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--board-cap-h, 56px);
  margin-bottom: 0;
}

.board-wrap:has(.board-gallery[data-zoom="lg"]) .board-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.board-wrap:has(.board-gallery[data-zoom="lg"]) .board-stage .board-canvas {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 4px;
  padding-bottom: 12px;
}

@media (min-width: 769px) {
  .board-wrap:has(.board-gallery[data-zoom="lg"]) .board-stage .board-canvas {
    padding-bottom: 12px;
  }
}

.board-gallery[data-zoom="lg"] {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
}

.board-gallery[data-zoom="lg"] .board-gallery-track {
  display: flex;
  flex-flow: row nowrap;
  align-items: stretch;
  gap: 12px;
  width: max-content;
  height: 100%;
  will-change: transform;
}

.board-gallery[data-zoom="lg"]::-webkit-scrollbar {
  display: none;
  height: 0;
  width: 0;
}

.board-gallery[data-zoom="lg"] .board-gallery-track .board-card {
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  /* No forced ratio — the picture's own proportions drive the width so
     nothing is cropped; every card shares the same height for unity. */
  aspect-ratio: auto;
}

.board-gallery[data-zoom="lg"] .board-card-inner {
  width: auto;
  height: 100%;
}

.board-gallery[data-zoom="lg"].board-gallery--native-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.board-gallery[data-zoom="lg"] .board-card-inner,
.board-gallery[data-zoom="lg"] .board-face {
  height: 100%;
  width: auto;
}

.board-gallery[data-zoom="lg"] .board-face--front {
  display: flex;
  width: auto;
  padding: 0;
  background: transparent;
}

.board-gallery[data-zoom="lg"] .board-media {
  flex: none;
  width: auto;
  height: 100%;
  aspect-ratio: var(--card-media-aspect, var(--media-aspect));
  /* Cap width at 3 portrait cards (3 × 9/16 of row height) + 2 gaps */
  max-width: calc(var(--row-h, 60vh) * 27 / 16 + 24px);
  border-radius: var(--card-radius);
  --media-corner-r: var(--card-radius);
}

.board-gallery[data-zoom="lg"] .board-media .board-capture-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--card-radius);
}

.board-gallery[data-zoom="lg"] .board-media .capture-preview {
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
}

.board-gallery[data-zoom="lg"] .board-flip-btn {
  top: 12px;
  right: 12px;
}

.board-gallery[data-zoom="lg"] .board-add-slot {
  display: flex;
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  aspect-ratio: 9 / 16;
  min-width: 0;
}

@media (max-width: 768px) {
  /* Leave just enough room for the docked chat composer (≈54px pill sitting
     8px above the bottom bar) plus an 8px gap, so the L-mode picture fills the
     rest of the height instead of leaving empty space below it. */
  .board-wrap:has(.board-gallery[data-zoom="lg"]) .board-stage .board-canvas {
    padding-bottom: 70px;
  }
}
