:root {
  color-scheme: light;
  --ink: #242424;
  --ink-muted: #696969;
  --ink-faint: #969696;
  --paper: #ffffff;
  --canvas: #fbfbfb;
  --sidebar: rgba(245, 245, 247, .7);
  --soft: #f2f2f2;
  --hover: rgba(0, 0, 0, .045);
  --active: rgba(0, 0, 0, .075);
  --line: rgba(0, 0, 0, .075);
  --line-strong: rgba(0, 0, 0, .12);
  --palette-neutral: #737373;
  --palette-red: #ff3b3b;
  --palette-orange: #ff6422;
  --palette-yellow: #ffbd00;
  --palette-green: #00b84f;
  --palette-blue: #087cf2;
  --palette-purple: #8747f5;
  --palette-pink: #f85aa3;
  --focus: var(--ink);
  --focus-soft: rgba(36, 36, 36, .1);
  --red: var(--palette-red);
  --sidebar-width: 248px;
  --radius-xs: 3px;
  --radius-s: 7px;
  --radius-m: 10px;
  --radius-l: 16px;
  --surface-border: rgba(0, 0, 0, .09);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .025), 0 8px 26px rgba(0, 0, 0, .045);
  --menu-shadow: 0 12px 34px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .05), 0 0 0 1px rgba(0, 0, 0, .06);
  --modal-shadow: 0 24px 64px rgba(0, 0, 0, .18), 0 3px 12px rgba(0, 0, 0, .06), 0 0 0 1px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 1180px;
  background: var(--canvas);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 7px 11px;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: white;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform .16s ease;
}
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 6px 8px 8px;
  overflow: visible;
  border-right: 0;
  background:
    radial-gradient(circle at 16% 4%, rgba(225, 226, 231, .58), transparent 34%),
    linear-gradient(180deg, rgba(239, 239, 242, .76) 0%, rgba(249, 249, 250, .68) 36%, rgba(255, 255, 255, .62) 100%),
    var(--sidebar);
  box-shadow: inset -1px 0 rgba(255, 255, 255, .7);
  backdrop-filter: blur(42px) saturate(155%) contrast(102%);
  -webkit-backdrop-filter: blur(42px) saturate(155%) contrast(102%);
}
.brand-row { height: 48px; display: flex; align-items: center; justify-content: space-between; }
.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 7px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.018em;
}
.brand:hover { background: var(--hover); }
.brand-mark {
  width: 22px;
  height: 22px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255,255,255,.78);
  color: var(--ink);
}
.brand-mark svg { width: 14px; height: 14px; }
.icon-button, .mini-button, .menu-button, .view-button {
  border: 0;
  display: inline-grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
}
.icon-button { width: 32px; height: 32px; border-radius: var(--radius-s); color: var(--ink-muted); }
.icon-button:hover, .mini-button:hover, .menu-button:hover, .view-button:hover { background: var(--hover); color: var(--ink); }
.primary-nav { display: grid; gap: 2px; margin-top: 4px; }
.nav-item, .collection-item {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 14px;
  cursor: pointer;
  transition: background-color .12s ease;
}
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; color: var(--palette-neutral); }
.nav-icon svg { width: 18px; height: 18px; }
.nav-item strong, .collection-item strong { justify-self: center; color: var(--ink-faint); font-size: 11px; font-weight: 400; }
.nav-item:hover, .collection-item:hover { background: var(--hover); }
.nav-item.is-active, .collection-item.is-active { background: rgba(0, 0, 0, .065); font-weight: 500; }
.nav-section-heading {
  min-height: 28px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 0 8px;
}
.nav-section-heading > span { grid-column: 1 / 3; color: var(--ink-muted); font-size: 12px; font-weight: 500; }
.mini-button { grid-column: 3; width: 22px; height: 28px; justify-self: center; border-radius: var(--radius-s); color: var(--ink-muted); }
.mini-button svg { width: 16px; height: 16px; }
.collection-nav { display: grid; gap: 1px; }
.collection-symbol {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
}
.collection-symbol.is-colored { background: var(--collection-color); color: white; }
.collection-symbol svg { width: 14px; height: 14px; stroke-width: 2; }
.account-area {
  position: relative;
  margin-top: auto;
  padding-top: 8px;
}
.account-area::before {
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  left: -8px;
  height: 1px;
  background: rgba(0, 0, 0, .08);
}
.account-panel {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.account-panel:hover { background: var(--hover); }
.account-avatar {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--avatar-color, var(--palette-orange));
  color: white;
  font-size: 8px;
  font-weight: 650;
}
.account-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.account-avatar.has-image > span { display: none; }
.account-copy { min-width: 0; display: grid; }
.account-copy strong { overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.account-chevron { width: 18px; height: 18px; display: grid; place-items: center; color: var(--ink-faint); transition: transform .16s ease; }
.account-chevron svg { width: 14px; height: 14px; }
.account-panel[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
.account-menu {
  position: absolute;
  z-index: 50;
  right: 0;
  bottom: 49px;
  left: 0;
  padding: 5px;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  background: rgba(255,255,255,.97);
  box-shadow: var(--menu-shadow);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}
.account-menu[hidden] { display: none; }
.account-menu-header { min-height: 38px; display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 8px; padding: 4px 7px; }
.account-menu-header strong { overflow: hidden; font-size: 13px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-divider { height: 1px; margin: 4px 2px; background: var(--line); }
.account-menu button { width: 100%; min-height: 31px; display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 8px; padding: 4px 7px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; font-size: 12px; cursor: pointer; }
.account-menu button:hover, .account-menu button:focus-visible { background: var(--hover); outline: none; }
.account-menu button > span { width: 18px; height: 18px; display: grid; place-items: center; color: var(--palette-neutral); }
.account-menu button svg { width: 15px; height: 15px; }
.account-menu button.danger { color: var(--red); }
.account-menu button.danger > span { color: inherit; }

.main {
  position: relative;
  z-index: 40;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  border-left: 1px solid rgba(62, 65, 72, .09);
  background: var(--canvas);
  box-shadow: -14px 0 36px rgba(31, 35, 48, .075), -3px 0 10px rgba(31, 35, 48, .035);
}
.search-field {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink-muted);
  box-shadow: 0 1px 2px rgba(0,0,0,.025), 0 5px 18px rgba(0,0,0,.04);
}
.search-field:focus-within { border-color: color-mix(in srgb, var(--focus) 52%, transparent); box-shadow: 0 4px 18px rgba(15,15,15,.055), 0 0 0 3px var(--focus-soft); }
.search-field > span { width: 20px; height: 20px; display: grid; place-items: center; }
.search-field svg { width: 18px; height: 18px; }
.search-field input { min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-field input::placeholder { color: var(--ink-muted); }
.search-field input::-webkit-search-cancel-button { cursor: pointer; filter: grayscale(1) brightness(0); opacity: .82; }
kbd { padding: 3px 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--soft); color: var(--ink-faint); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }

.content { width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding: 28px 0 80px; }
.page-heading { min-height: 286px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .84fr); gap: 54px; align-items: stretch; }
.hero-copy { min-width: 0; padding-top: 6px; }
.eyebrow { margin: 0 0 7px; color: var(--ink-muted); font-size: 12px; font-weight: 500; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(42px, 4.6vw, 64px); font-weight: 700; line-height: 1.03; letter-spacing: -.045em; }
h1 span { color: var(--ink-muted); }
.hero-description { max-width: 580px; margin: 20px 0 0; color: var(--ink-muted); font-size: 16px; line-height: 1.55; }

.quick-capture {
  height: 100%;
  padding: 12px;
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--card-shadow);
}
.quick-capture-form { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 10px; }
.drop-zone {
  position: relative;
  isolation: isolate;
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(255,255,255,.36);
  text-align: center;
  transition: background-color .16s ease, border-color .16s ease;
}
.drop-zone::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -48%;
  background:
    radial-gradient(circle at 13% 28%, var(--palette-red) 0 12%, transparent 35%),
    radial-gradient(circle at 83% 18%, var(--palette-pink) 0 13%, transparent 38%),
    radial-gradient(circle at 72% 80%, var(--palette-orange) 0 15%, transparent 40%),
    radial-gradient(circle at 24% 82%, var(--palette-yellow) 0 12%, transparent 38%),
    radial-gradient(circle at 52% 48%, var(--palette-purple) 0 13%, transparent 38%),
    radial-gradient(circle at 88% 58%, var(--palette-blue) 0 12%, transparent 38%),
    radial-gradient(circle at 36% 52%, var(--palette-green) 0 11%, transparent 36%),
    linear-gradient(120deg, var(--palette-red), var(--palette-pink) 25%, var(--palette-purple) 43%, var(--palette-blue) 60%, var(--palette-green) 74%, var(--palette-yellow) 87%, var(--palette-orange));
  background-size: 130% 130%, 140% 140%, 135% 135%, 145% 145%, 150% 150%, 140% 140%, 145% 145%, 190% 190%;
  filter: blur(18px) saturate(112%);
  transform: translate3d(-4%, -2%, 0) scale(1.06);
  animation: drop-zone-mesh 16s ease-in-out infinite alternate;
  will-change: transform, background-position;
}
.drop-zone::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,.5), rgba(249,249,250,.66)),
    rgba(245,245,247,.42);
  box-shadow: inset 0 1px rgba(255,255,255,.72);
  backdrop-filter: blur(30px) saturate(145%) contrast(102%);
  -webkit-backdrop-filter: blur(30px) saturate(145%) contrast(102%);
}
.drop-zone > * { position: relative; z-index: 1; }
.drop-zone.is-dragging { border-color: var(--focus); background: rgba(255,255,255,.28); }
.drop-zone.is-dragging::before { animation-play-state: paused; }
.drop-zone svg { width: 22px; height: 22px; margin-bottom: 7px; color: var(--ink-muted); }
.drop-zone p { margin: 0; font-size: 13px; font-weight: 500; }
.drop-zone span { margin-top: 2px; color: var(--ink-faint); font-size: 11px; }
.quick-composer {
  min-height: 42px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 4px;
  margin-top: 0;
  padding: 3px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
}
.quick-composer:focus-within { border-color: var(--focus); box-shadow: 0 0 0 2px var(--focus-soft); }
.quick-composer input { min-width: 0; height: 32px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.quick-composer input::placeholder { color: var(--ink-faint); }
.composer-attach, .composer-submit { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: var(--radius-s); cursor: pointer; }
.composer-attach { background: transparent; color: var(--ink-muted); }
.composer-attach:hover { background: var(--hover); color: var(--ink); }
.composer-submit { background: var(--ink); color: white; }
.composer-submit { border-radius: 50%; }
.composer-submit:hover { background: #111; }
.composer-attach svg, .composer-submit svg { width: 16px; height: 16px; }
.quick-status { min-height: 16px; margin: -3px 2px 0; color: var(--ink-faint); font-size: 10px; }
.quick-status.has-file { color: var(--ink); }

.library-utility { min-width: 0; display: grid; grid-template-columns: minmax(260px, 1fr) max-content; align-items: center; gap: 10px; }
.library-facts { width: max-content; height: 46px; display: flex; flex: 0 0 auto; align-items: center; overflow: hidden; border: 1px solid var(--surface-border); border-radius: 14px; background: rgba(255,255,255,.78); box-shadow: 0 1px 2px rgba(0,0,0,.02); }
.library-facts p { height: 100%; display: flex; align-items: center; gap: 5px; margin: 0; padding: 0 16px; border-right: 1px solid var(--line); white-space: nowrap; }
.library-facts p:last-child { border-right: 0; }
.library-facts strong { font-size: 13px; font-weight: 600; }
.library-facts span { color: var(--ink-muted); font-size: 12px; }
.toolbar { min-height: 82px; display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) max-content; align-items: center; gap: 18px; margin-top: 34px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.toolbar .library-title { min-width: 0; margin: 0; overflow: hidden; font-size: 20px; font-weight: 600; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.view-controls { width: max-content; display: flex; flex: 0 0 auto; gap: 1px; padding: 2px; border-radius: var(--radius-s); background: var(--soft); }
.view-button { width: 30px; height: 28px; border-radius: 4px; color: var(--ink-muted); }
.view-button.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(15,15,15,.12); }
.view-button svg { width: 16px; height: 16px; }

.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding-top: 20px; }
.link-card {
  position: relative;
  min-width: 0;
  overflow: visible;
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  animation: card-in .28s backwards;
  animation-delay: calc(var(--index) * 28ms);
}
.link-card:hover { z-index: 3; border-color: rgba(0,0,0,.13); box-shadow: 0 18px 42px rgba(0,0,0,.105), 0 2px 5px rgba(0,0,0,.035); transform: translateY(-5px) scale(1.015); }
.card-click-target { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.card-click-target:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.card-preview { position: relative; aspect-ratio: 16 / 10; height: auto; overflow: hidden; border-radius: 13px 13px 0 0; border-bottom: 1px solid var(--line); background: #f4f4f2; }
.preview-fallback, .site-screenshot { position: absolute; inset: 0; width: 100%; height: 100%; }
.preview-fallback { display: grid; place-items: center; background: var(--preview-bg); color: var(--preview-ink); }
.preview-window { width: 78%; height: 72%; overflow: hidden; border: 1px solid color-mix(in srgb, var(--preview-ink) 18%, transparent); border-radius: 5px; background: color-mix(in srgb, white 78%, var(--preview-bg)); }
.preview-bar { height: 19px; display: flex; align-items: center; gap: 4px; padding: 0 7px; border-bottom: 1px solid color-mix(in srgb, var(--preview-ink) 12%, transparent); }
.preview-bar i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .35; }
.preview-copy { height: calc(100% - 19px); display: grid; place-content: center; justify-items: center; gap: 12px; padding: 14px; text-align: center; }
.preview-copy strong { font-size: 20px; letter-spacing: -.04em; }
.preview-shape { width: 65px; height: 7px; border-radius: 2px; background: currentColor; opacity: .18; }
.site-screenshot { z-index: 1; object-fit: contain; object-position: top center; background: #f4f4f2; opacity: 0; transition: opacity .2s ease; }
.site-screenshot.is-ready { opacity: 1; }
.card-body { min-height: 154px; display: flex; flex-direction: column; padding: 12px 13px; }
.card-topline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.card-name-wrap { min-width: 0; }
.card-title { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: -.012em; }
.card-domain { display: block; margin-top: 1px; overflow: hidden; color: var(--ink-faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { position: relative; z-index: 5; margin: -4px -5px 0 0; }
.card-action { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-muted); cursor: pointer; }
.card-action:hover { background: var(--hover); color: var(--ink); }
.card-action svg { width: 16px; height: 16px; }
.card-menu {
  position: absolute;
  z-index: 8;
  top: 32px;
  right: 0;
  width: 196px;
  padding: 4px;
  border: 1px solid var(--surface-border);
  border-radius: 9px;
  background: rgba(255,255,255,.97);
  box-shadow: var(--menu-shadow);
  backdrop-filter: blur(18px);
}
.card-menu[hidden] { display: none; }
.card-menu button { width: 100%; min-height: 31px; display: flex; align-items: center; gap: 8px; padding: 4px 7px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; font-size: 12px; cursor: pointer; }
.card-menu button:hover { background: var(--hover); }
.card-menu button.danger { color: var(--red); }
.card-menu button svg { width: 15px; height: 15px; }
.card-note { display: -webkit-box; margin: 8px 0 12px; overflow: hidden; color: var(--ink-muted); font-size: 11px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-note.is-empty { color: var(--ink-faint); font-style: italic; }
.card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-faint); font-size: 9px; }
.card-collection { min-width: 0; display: inline-flex; align-items: center; gap: 6px; max-width: 64%; overflow: hidden; padding: 4px 8px 4px 4px; border-radius: 999px; background: color-mix(in srgb, var(--tag-color) 11%, white); color: color-mix(in srgb, var(--tag-color) 78%, #37352f); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.card-collection-icon { width: 20px; height: 20px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--tag-color); color: white; }
.card-collection-icon svg { width: 12px; height: 12px; stroke-width: 2; }

.card-grid.compact-layout { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.compact-layout .link-card { border-radius: 12px; }
.compact-layout .card-preview { aspect-ratio: 16 / 10; height: auto; border-radius: 11px 11px 0 0; }
.compact-layout .card-body { min-height: 104px; padding: 9px 10px; }
.compact-layout .card-title { font-size: 12px; }
.compact-layout .card-domain { font-size: 9px; }
.compact-layout .card-note { display: none; }
.compact-layout .card-action { width: 24px; height: 24px; }
.compact-layout .card-action svg { width: 14px; height: 14px; }
.compact-layout .card-footer { font-size: 8px; }
.compact-layout .card-footer > span:last-child { display: none; }
.compact-layout .card-collection { max-width: 100%; gap: 4px; padding: 3px 6px 3px 3px; }
.compact-layout .card-collection-icon { width: 17px; height: 17px; }
.compact-layout .card-collection-icon svg { width: 10px; height: 10px; }

.primary-button, .secondary-button, .text-button { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: var(--radius-s); font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color .12s ease; }
.primary-button { border: 0; background: var(--ink); color: white; }
.primary-button:hover { background: #111; }
.secondary-button { border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); }
.secondary-button:hover, .text-button:hover { background: var(--hover); }
.text-button { border: 0; background: transparent; color: var(--ink); }
.empty-state { max-width: 390px; margin: 64px auto 0; text-align: center; }
.empty-mark { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto; border-radius: var(--radius-m); background: var(--soft); color: var(--ink-muted); }
.empty-mark svg { width: 24px; height: 24px; }
.empty-state h2 { margin: 15px 0 0; font-size: 20px; font-weight: 600; }
.empty-state p { margin: 5px auto 18px; color: var(--ink-muted); }

.modal { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: visible; border: 0; border-radius: var(--radius-m); background: transparent; }
.modal::backdrop { background: rgba(15,15,15,.34); }
.modal-card { max-height: calc(100vh - 32px); padding: 22px; overflow-y: auto; border: 1px solid var(--surface-border); border-radius: 14px; background: rgba(255,255,255,.98); box-shadow: var(--modal-shadow); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-header h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.025em; }
.modal-header .eyebrow { margin-bottom: 2px; }
.modal-header .icon-button { margin: -4px -4px 0 0; }
.modal-link-preview { min-height: 114px; display: grid; grid-template-columns: 148px minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 18px; padding: 10px; border: 1px solid var(--surface-border); border-radius: 12px; background: #fafafa; }
.modal-link-preview-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--ink-muted); }
.modal-link-preview-media > span { width: 24px; height: 24px; }
.modal-link-preview-media svg { width: 24px; height: 24px; }
.modal-link-preview-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: top center; background: #f4f4f2; }
.modal-link-preview-media img[hidden], .modal-link-preview-media > span[hidden] { display: none; }
.modal-link-preview-copy { min-width: 0; display: grid; gap: 3px; }
.modal-link-preview-copy strong, .modal-link-preview-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-link-preview-copy strong { font-size: 14px; font-weight: 600; }
.modal-link-preview-copy span { color: var(--ink-muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field > span, .color-picker legend, .icon-picker legend, .collection-picker legend { color: var(--ink); font-size: 12px; font-weight: 500; }
.field > span i { color: var(--ink-faint); font-style: normal; font-weight: 400; }
.field input, .field textarea, .field select { width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); outline: 0; background: var(--paper); color: var(--ink); font-size: 13px; }
.field textarea { min-height: 86px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: color-mix(in srgb, var(--focus) 58%, transparent); box-shadow: 0 0 0 2px var(--focus-soft); }
.field small { color: var(--ink-faint); font-size: 10px; }
.field textarea + small { justify-self: end; margin-top: -2px; }
.form-error { min-height: 18px; margin: -2px 0 5px; color: var(--red); font-size: 11px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 6px; padding-top: 2px; }
.modal-small { width: min(520px, calc(100vw - 32px)); }
.color-picker, .icon-picker { margin: 0 0 16px; padding: 0; border: 0; }
.color-picker legend, .icon-picker legend { margin-bottom: 7px; }
.color-picker > label, .icon-picker > label { display: inline-block; }
.color-picker input, .icon-picker input { position: absolute; opacity: 0; pointer-events: none; }
.color-picker span { width: 32px; height: 32px; overflow: hidden; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: var(--radius-s); color: transparent; cursor: pointer; }
.color-picker span::before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 .5px rgba(0,0,0,.12); }
.color-picker span.no-color::before { background: #737373; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.18); }
.color-picker input:checked + span { border-color: var(--ink); background: var(--hover); }
.color-picker input:focus-visible + span, .icon-picker input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.icon-picker { display: flex; flex-wrap: wrap; gap: 4px; }
.icon-picker legend { width: 100%; }
.icon-picker span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--ink-faint); font-size: 0; cursor: pointer; transition: background-color .15s ease, color .15s ease, transform .15s ease; }
.icon-picker span:hover { background: var(--soft); color: var(--ink-muted); }
.icon-picker span svg { width: 19px; height: 19px; stroke-width: 2; }
.icon-picker input:checked + span { border-color: var(--line-strong); background: var(--soft); color: var(--ink-muted); transform: scale(1.04); }
.icon-picker.has-color input:checked + span { border-color: transparent; background: var(--picker-color); color: white; box-shadow: 0 3px 9px color-mix(in srgb, var(--picker-color) 32%, transparent); }
.collection-picker { display: grid; gap: 3px; margin: 0 0 18px; padding: 0; border: 0; }
.collection-picker legend { margin-bottom: 7px; }
.collection-picker label { min-height: 38px; display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 8px; padding: 0 8px; border-radius: var(--radius-s); cursor: pointer; }
.collection-picker label:hover { background: var(--hover); }
.collection-picker input { width: 15px; height: 15px; margin: 0; accent-color: var(--ink); }
.collection-choice-symbol { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: transparent; color: var(--ink-faint); }
.collection-choice-symbol.is-colored { background: var(--choice-color); color: white; }
.collection-choice-symbol svg { width: 14px; height: 14px; stroke-width: 2; }
.toast { position: fixed; z-index: 60; right: 18px; bottom: 18px; max-width: min(360px, calc(100vw - 36px)); padding: 9px 12px; border-radius: var(--radius-s); background: var(--ink); color: white; box-shadow: var(--menu-shadow); font-size: 12px; }
.toast[hidden] { display: none; }

@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes drop-zone-mesh {
  0% {
    background-position: 0% 8%, 100% 0%, 100% 100%, 0% 100%, 44% 48%, 100% 54%, 30% 54%, 0% 50%;
    transform: translate3d(-4%, -2%, 0) scale(1.06);
  }
  50% {
    background-position: 24% 30%, 74% 22%, 72% 74%, 24% 76%, 58% 34%, 74% 68%, 48% 40%, 50% 50%;
    transform: translate3d(2%, 3%, 0) scale(1.1);
  }
  100% {
    background-position: 40% 12%, 58% 34%, 54% 60%, 42% 58%, 36% 66%, 56% 30%, 64% 62%, 100% 50%;
    transform: translate3d(5%, -1%, 0) scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
