/* Watchlist uses the same neutral surfaces and compact controls as Idea Vault. */
#library-view.library-watch-page {
  --watch-surface:#1c1c1e;
  --watch-raised:#2c2c2e;
  --watch-hover:#3a3a3c;
  --watch-text:#f5f5f7;
  --watch-muted:#a1a1a6;
  --watch-line:#38383a;
  --watch-button:#fff;
  --watch-button-ink:#000;
  --watch-control-surface:#1c1c1e;
  --watch-control-shadow:0 1px 4px #0003;
  --watch-suggestion-shadow:0 2px 6px #0003,0 6px 16px #0002;
  --sp-panel:var(--watch-surface);
  --sp-raised:var(--watch-raised);
  --sp-text:var(--watch-text);
  --sp-muted:var(--watch-muted);
  --sp-border:var(--watch-line);
  --sorty-field-bg:var(--watch-raised);
  --sorty-field-text:var(--watch-text);
  --sorty-field-muted:var(--watch-muted);
  --sorty-field-border:var(--watch-line);
  --sorty-field-accent:var(--watch-muted);
  --sorty-field-ring:rgba(128,128,128,.12);
  --sorty-button-secondary:var(--watch-raised);
  --sorty-button-text:var(--watch-text);
  --sorty-button-focus:var(--watch-muted);
  color:var(--watch-text);
}
@media(prefers-color-scheme:light) {
  #library-view.library-watch-page {
    --watch-surface:#fff; --watch-raised:#f2f2f7; --watch-hover:#eaeaef;
    --watch-text:#1c1c1e; --watch-muted:#68686e; --watch-line:#e5e5ea;
    --watch-button:#000; --watch-button-ink:#fff;
    --watch-control-surface:#fff;
    --watch-control-shadow:0 1px 4px #00000012;
    --watch-suggestion-shadow:0 2px 5px #0000000a,0 5px 12px #00000008;
  }
}
#library-view .library-page-header {
  display:grid; grid-template-columns:auto 1fr; align-items:center; gap:16px;
  height:auto; min-height:0; margin-bottom:16px; padding:16px;
  border:0; border-radius:18px; background:var(--watch-surface); box-shadow:0 2px 10px #00000012;
}
#library-view .library-page-header h1 {
  margin:0; padding:0; border:0; font-size:20px; line-height:28px; font-weight:700; letter-spacing:-.5px;
}
#library-view .watchlist-header-fields { display:contents; }
#library-view .library-watchlist-tabs {
  justify-self:start; width:232px; max-width:100%; margin:0;
}
#library-view .library-watchlist-tabs button {
  font:500 14px/20px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
#library-view .library-watchlist-tabs button:focus-visible { outline-offset:-3px; }
#library-view .library-watch-add {
  grid-column:1 / -1; display:grid; grid-template-columns:minmax(0,1fr) auto;
  align-items:center; gap:10px; margin:0; padding:0; background:transparent;
}
#library-view .library-watch-search-field {
  display:flex; align-items:center; gap:8px; min-width:0; height:44px;
  padding:0 14px; box-sizing:border-box; border:1px solid transparent; border-radius:999px; background:var(--watch-raised);
}
#library-view .library-watch-search-icon { display:grid; place-items:center; color:var(--watch-muted); }
#library-view .library-watch-search-icon svg { width:18px; height:18px; }
#library-view .library-watch-add input {
  width:100%; height:100%; padding:6px 0; border:0; border-radius:6px;
  background:transparent; color:var(--watch-text); font-size:13px;
}
#library-view .library-watch-add input:focus { box-shadow:none; }
#library-view .library-watch-search-field:focus-within { border-color:var(--sorty-field-accent); outline:none; box-shadow:none; }
body.vault-buttons #vault-workspace #library-view .library-watch-add-button.sorty-button {
  width:auto; height:44px; min-height:44px; padding:8px 18px; border:0; border-radius:999px;
  background:var(--watch-raised); color:var(--watch-text); font-size:12px;
}
body.vault-buttons #vault-workspace #library-view .library-watch-search-button.sorty-button { background:var(--watch-button); color:var(--watch-button-ink); }
#library-view .library-watch-search-button svg { width:18px; height:18px; }
body.vault-buttons #vault-workspace #library-view.library-watch-page .library-watch-add-button.sorty-button:hover:not(:disabled) { background:color-mix(in srgb,var(--watch-raised) 94%,var(--watch-text)); color:var(--watch-text); }
body.vault-buttons #vault-workspace #library-view.library-watch-page .library-watch-add-button.sorty-button:active:not(:disabled) { background:color-mix(in srgb,var(--watch-hover) 88%,var(--watch-text)); box-shadow:inset 0 1px 3px #0002; }
body.vault-buttons #vault-workspace #library-view.library-watch-page .library-watch-search-button.sorty-button:hover:not(:disabled) { background:color-mix(in srgb,var(--watch-button) 80%,var(--watch-button-ink)); color:var(--watch-button-ink); box-shadow:none; }
body.vault-buttons #vault-workspace #library-view.library-watch-page .library-watch-search-button.sorty-button:active:not(:disabled) { background:color-mix(in srgb,var(--watch-button) 70%,var(--watch-button-ink)); color:var(--watch-button-ink); box-shadow:none; }
body.vault-buttons #vault-workspace #library-view .library-watch-add-button.sorty-button:disabled { opacity:.4; cursor:not-allowed; }
body.vault-buttons #vault-workspace #library-view .library-watch-add-button.sorty-button[aria-busy="true"] { position:relative; opacity:1; cursor:progress; }
#library-view .library-watch-add-button[aria-busy="true"] > span { visibility:hidden; }
#library-view .library-watch-add-button > [data-watchlist-spinner] { position:absolute; inset:0; margin:auto; width:18px; height:18px; }
#library-view .library-watchlist-columns {
  grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px;
  margin:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none;
}
#library-view .library-watch-column {
  padding:12px; border:0; border-radius:18px; background:var(--watch-surface);
}
#library-view .library-watch-column h2 { margin:0 0 12px; gap:8px; font-size:13px; line-height:24px; }
#library-view .library-watch-column h2 > svg { width:18px; height:18px; }
#library-view .library-watch-column-count {
  min-width:24px; padding:0 6px; border:0; border-radius:8px;
  background:var(--watch-raised); color:var(--watch-muted); font-size:11px; line-height:24px;
}
#library-view .library-watch-column-cards { gap:8px; }
#library-view .library-watch-card {
  display:grid; box-sizing:border-box; grid-template-columns:40px minmax(0,1fr) 24px; align-items:center;
  height:66px; min-width:0; gap:8px; padding:6px 8px; border:0; border-radius:12px;
  background:var(--watch-raised); box-shadow:none;
}
#library-view .library-watch-card-creator { grid-template-columns:40px minmax(0,1fr) 52px; }
#library-view .library-watchlist:not(.library-watchlist-columns) { padding:0; gap:12px; }
#library-view .library-watchlist:not(.library-watchlist-columns) .library-watch-card { background:var(--watch-surface); }
#library-view .library-watchlist:not(.library-watchlist-columns) .library-watch-card:hover { background:var(--watch-raised); }
#library-view .library-watchlist:not(.library-watchlist-columns) .library-keyword-avatar { background:var(--watch-raised); }
#library-view .library-watch-empty { grid-column:1 / -1; margin:0; padding:24px; border-radius:18px; background:var(--watch-surface); color:var(--watch-muted); font-size:13px; }
#library-view .library-watch-card:hover { background:var(--watch-hover); }
#library-view :is(.library-watch-avatar,.library-watch-card img,.library-keyword-avatar) { width:40px; height:40px; }
#library-view .library-watch-details {
  display:flex; flex-direction:column; justify-content:center; height:auto; min-width:0; gap:1px;
}
#library-view .library-watch-details :is(a,strong) { font-size:12px; line-height:16px; font-weight:650; color:var(--watch-text); }
#library-view .library-watch-meta { margin:0; color:var(--watch-muted); font-size:10px; line-height:14px; }
#library-view .library-watch-actions {
  grid-column:3; display:flex; flex-direction:column; align-items:center; gap:4px; margin:0;
}
#library-view .library-watch-actions button {
  position:relative; display:grid; place-items:center; flex:none; width:24px; height:24px; min-height:24px;
  padding:5px; border:0; border-radius:50%; background:var(--watch-control-surface); color:var(--watch-text);
}
#library-view .library-watch-actions button svg { width:14px; height:14px; }
#library-view .library-watch-actions button:hover { background:var(--watch-control-surface); color:var(--watch-text); box-shadow:0 0 0 1px var(--watch-line); }
#library-view .library-watch-actions .library-watch-delete { color:var(--sorty-button-danger); }
#library-view .library-watch-actions .library-watch-delete:hover { color:var(--sorty-button-danger); background:var(--sorty-button-danger-fill); }
#library-view .library-watch-actions button:disabled { opacity:.4; cursor:not-allowed; box-shadow:none; }
#library-view .library-watch-actions-creators { display:grid; grid-template-columns:repeat(2,24px); gap:4px; align-items:center; }
#library-view .library-watch-actions-creators > button { border-radius:7px; box-shadow:var(--watch-control-shadow); }
#library-view .library-watch-actions-creators > button:first-child { grid-column:1 / -1; width:52px; height:22px; min-height:22px; border-radius:7px; padding:0; font-size:12px; font-weight:500; line-height:22px; }
#library-view .library-watch-actions-creators > button:not(.library-watch-delete):not(:disabled):hover {
  background:color-mix(in srgb,var(--watch-surface) 94%,var(--watch-text));
  color:var(--watch-text); box-shadow:var(--watch-control-shadow);
}
#library-view .library-watch-actions-creators > button:not(.library-watch-delete):not(:disabled):active {
  background:color-mix(in srgb,var(--watch-surface) 90%,var(--watch-text));
  color:var(--watch-text); box-shadow:var(--watch-control-shadow);
}
#library-view .library-watch-tooltip {
  position:absolute; right:calc(100% + 8px); top:50%; z-index:3; transform:translateY(-50%);
  width:max-content; max-width:220px; padding:6px 10px; border-radius:8px; pointer-events:none;
  background:var(--vault-popover-surface); box-shadow:var(--vault-popover-shadow); color:var(--watch-text);
  font:500 11px/16px -apple-system,BlinkMacSystemFont,sans-serif; opacity:0; visibility:hidden;
  transition:opacity 120ms ease,visibility 120ms;
}
#library-view .library-watch-actions button:is(:hover,:focus-visible) .library-watch-tooltip { opacity:1; visibility:visible; transition-delay:100ms; }
#library-view .library-watch-tooltip[data-side] { left:50%; right:auto; transform:translateX(-50%); }
#library-view .library-watch-tooltip[data-side=top] { top:auto; bottom:calc(100% + 8px); }
#library-view .library-watch-tooltip[data-side=bottom] { top:calc(100% + 8px); bottom:auto; }
#library-view .library-watch-platform {
  right:auto; left:85.355%; top:14.645%; transform:translate(-50%,-50%);
  width:16px; height:16px; padding:1px; border:0; box-sizing:border-box;
}
#library-view .library-keyword-avatar {
  display:grid; place-items:center; border-radius:10px; background:var(--watch-surface); color:var(--watch-muted); font-size:24px;
}
#library-view .library-watch-column-empty { padding:12px 0; color:var(--watch-muted); font-size:12px; }
#library-view .library-watch-column-note { margin-top:12px; padding-top:12px; border-color:var(--watch-line); color:var(--watch-muted); }
#library-view .library-watch-clear { margin-top:16px; }
#library-view .library-watch-suggestions { grid-column:1 / -1; margin:0; padding:12px 0 0; border:0; border-top:1px solid var(--watch-line); border-radius:0; background:transparent; }
#library-view .library-suggestions-heading { color:var(--watch-muted); }
#library-view .library-suggestions-heading button { display:grid; place-items:center; }
#library-view .library-suggestions-heading button { --sorty-close-size:13px; }
#library-view .library-suggestions-heading button:hover { background:var(--watch-hover); color:var(--watch-text); }
#library-view .library-suggestions-heading button:active { background:var(--watch-line); }
#library-view .library-suggestion-results { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; padding:2px; max-height:none; overflow:visible; }
#library-view .library-suggestion-card {
  display:grid; grid-template-columns:40px minmax(0,1fr) 22px; grid-template-rows:auto auto;
  align-items:center; gap:3px 10px; width:auto; padding:10px; border-radius:12px; background:var(--watch-raised);
}
#library-view .library-suggestion-avatar { grid-column:1; grid-row:1 / 3; width:40px; height:40px; }
#library-view .library-suggestion-card strong { grid-column:2; grid-row:1; width:100%; color:var(--watch-text); font-size:12px; text-align:left; }
#library-view .library-suggestion-card > span { grid-column:2; grid-row:2; color:var(--watch-muted); font-size:11px; }
#library-view .library-suggestion-details { grid-column:2; grid-row:1 / 3; display:flex; flex-direction:column; justify-content:center; gap:1px; min-width:0; }
#library-view .library-suggestion-details strong { margin:0; line-height:16px; }
#library-view .library-suggestion-details > span { color:var(--watch-muted); font-size:11px; line-height:14px; }
#library-view .library-suggestion-add {
  position:static; inset:auto; grid-column:3; grid-row:1 / 3; width:22px; height:22px;
  padding:0; opacity:1; border:0; border-radius:50%; background:var(--watch-button); color:var(--watch-button-ink);
}
#library-view .library-suggestion-add svg { width:14px; height:14px; }
#library-view .library-suggestion-add:hover:not(:disabled) { background:color-mix(in srgb,var(--watch-button) 80%,var(--watch-button-ink)); box-shadow:none; }
#library-view .library-suggestion-add:active:not(:disabled) { background:color-mix(in srgb,var(--watch-button) 70%,var(--watch-button-ink)); }
#library-view .library-suggestion-add:disabled { color:var(--watch-button-ink); background:var(--watch-button); opacity:1; cursor:default; }
#library-view .library-suggestion-placeholder { grid-template-columns:40px minmax(0,1fr); min-height:66px; box-sizing:border-box; }
#library-view .library-suggestion-platform-icon { display:grid; place-items:center; border-radius:50%; background:var(--watch-surface); color:var(--watch-muted); }
#library-view .library-suggestion-platform-icon svg { width:20px; height:20px; }
#library-view .library-suggestion-placeholder > span:last-child { line-height:16px; }
#library-view .library-watch-platform-search { grid-column:auto; margin-bottom:12px; gap:6px; }
#library-view .library-watch-platform-search .library-watch-search-field { height:36px; padding:0 10px; gap:6px; }
#library-view .library-watch-platform-search .library-watch-search-icon svg { width:16px; height:16px; }
#library-view .library-watch-platform-search input { font-size:11px; }
body.vault-buttons #vault-workspace #library-view .library-watch-platform-search .library-watch-add-button.sorty-button { height:36px; min-height:36px; padding:4px 9px; font-size:11px; }
body.vault-buttons #vault-workspace #library-view .library-watch-platform-search .library-watch-search-button.sorty-button { width:36px; padding:0; }
#library-view .library-watch-platform-search .library-watch-search-field:has(input:disabled) { opacity:.4; }
#library-view .library-watch-platform-search :disabled { cursor:not-allowed; }
#library-view .library-watch-suggestions-scoped {
  margin:0 0 16px; padding:10px; border:1px solid var(--watch-line); border-radius:12px; background:var(--watch-raised);
}
#library-view .library-watch-suggestions-scoped .library-suggestion-card { background:var(--watch-surface); padding:8px; gap:3px 8px; box-shadow:var(--watch-suggestion-shadow); }
#library-view .library-watch-suggestions-scoped .library-suggestion-results { grid-template-columns:minmax(0,1fr); padding:0; }
#library-view .library-watch-suggestions-scoped .library-suggestions-heading { font-size:11px; margin-bottom:4px; }
#library-view :is(button,a):focus-visible { outline:2px solid var(--watch-muted); outline-offset:2px; }
#library-view :is(.library-watch-add-button,.library-suggestion-add,.library-suggestions-heading button,.library-watch-actions button) {
  transition:background-color 120ms ease,box-shadow 120ms ease;
}
#library-view .library-watch-actions button:active:not(:disabled) { background:var(--watch-line); }
@media(pointer:coarse) {
  #library-view .library-watch-platform-search :is(.library-watch-search-field,button) { height:44px; min-height:44px; }
  body.vault-buttons #vault-workspace #library-view .library-watch-platform-search .library-watch-add-button.sorty-button { height:44px; min-height:44px; }
  body.vault-buttons #vault-workspace #library-view .library-watch-platform-search .library-watch-search-button.sorty-button { width:44px; }
}
@media(max-width:1150px) {
  #library-view .library-watchlist-columns { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #library-view .library-watch-suggestions-all .library-suggestion-results { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #library-view .library-watchlist:not(.library-watchlist-columns) { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:600px) {
  #library-view .library-page-header { grid-template-columns:1fr; gap:12px; padding:12px; }
  #library-view .library-page-header h1 { display:flex; align-items:center; min-height:40px; padding-right:56px; }
  #library-view .library-watchlist-tabs { justify-self:stretch; width:100%; }
  #library-view .library-watchlist-columns,#library-view .library-watchlist { grid-template-columns:minmax(0,1fr); }
  #library-view .library-watch-suggestions-all .library-suggestion-results { grid-template-columns:minmax(0,1fr); }
  #library-view .library-watch-column { padding:12px; }
  body.vault-buttons #vault-workspace #library-view .library-watch-add-button.sorty-button { padding-inline:10px; }
  #library-view .library-watch-tooltip { max-width:min(220px,calc(100vw - 100px)); }
}
@media(prefers-reduced-motion:reduce) {
  #library-view :is(button,.library-watch-tooltip) { transition:none; }
}
