:root {
  --bg: #e8e0f0;
  --panel: rgba(255, 255, 255, 0.82);
  --sidebar-panel: #ffffff;
  --sidebar-border: #e4e4e7;
  --sidebar-accent: #f8fafc;
  --sidebar-accent-strong: #f4f4f5;
  --sidebar-active: #eadcff;
  --sidebar-active-text: #6d28d9;
  --sidebar-ring: rgba(109, 40, 217, 0.13);
  --sidebar-muted: #64748b;
  --sidebar-ink: #0f172a;
  --sidebar-width: 272px;
  --surface-border: #e4e4e7;
  --surface-hover: #f8fafc;
  --surface-selected: #eadcff;
  --surface-muted: #64748b;
  --surface-ink: #0f172a;
  --main-panel-bg: #ffffff;
  --main-panel-soft: #fbfbfd;
  --main-panel-border: #e1e1eb;
  --main-panel-hover: #f8f1ff;
  --main-panel-selected: #efe4ff;
  --main-panel-ring: rgba(109, 40, 217, 0.14);
  --paper-title: #25205f;
  --panel-solid: #ffffff;
  --ink: #172033;
  --muted: #4f5b73;
  --line: rgba(92, 104, 136, 0.44);
  --toolbar-line: #b7bac8;
  --toolbar-gap: 8px;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --cyan: #18c6d7;
  --green: #11a36a;
  --orange: #f59e0b;
  --red: #ef4444;
  --violet: #7c3aed;
  --shadow: 0 24px 80px rgba(29, 78, 216, 0.16);
  --font: "Segoe UI Variable Text", "Aptos", "Segoe UI", system-ui, sans-serif;
  --sidebar-font: "Inter", var(--font);
  --radius-panel-xl: 22px;
  --radius-panel-lg: 16px;
  --radius-panel-md: 12px;
  --radius-control-lg: 8px;
  --radius-control-md: 7px;
  --radius-control-sm: 6px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(circle at 14% 18%, rgba(192, 132, 252, 0.11), transparent 28%),
    radial-gradient(circle at 86% 20%, rgba(168, 85, 247, 0.09), transparent 30%),
    radial-gradient(circle at 52% 100%, rgba(148, 163, 184, 0.08), transparent 36%),
    linear-gradient(180deg, #f1ebf7 0%, var(--bg) 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.auth-page {
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: clamp(20px, 3vw, 36px);
  align-items: stretch;
  overflow: hidden;
  padding: clamp(18px, 3vw, 42px);
  background:
    linear-gradient(135deg, rgba(255, 90, 79, 0.13), transparent 32%),
    linear-gradient(315deg, rgba(255, 139, 99, 0.18), transparent 34%),
    linear-gradient(180deg, #fff8f7 0%, #f9f7fb 54%, #ffffff 100%);
}

.auth-art {
  position: relative;
  min-height: 0;
  display: grid;
}

.glass-card,
.auth-card,
.sidebar,
.main-panel,
.filter-panel,
.modal-card,
.floating-menu {
  border: 1px solid rgba(221, 223, 232, 0.86);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 70px rgba(41, 44, 61, 0.12);
}

.glass-card {
  position: relative;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 20px;
  padding: clamp(28px, 5vw, 58px);
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(43, 45, 58, 0.16), rgba(43, 45, 58, 0.58)),
    linear-gradient(145deg, #ff5a4f 0%, #ff8b63 38%, #6d375f 100%);
  box-shadow: 0 34px 90px rgba(255, 90, 79, 0.2);
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  pointer-events: none;
}

.glass-card::after {
  content: "";
  position: absolute;
  width: 56%;
  aspect-ratio: 1;
  right: -14%;
  top: -16%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.02) 62%, transparent 70%);
  pointer-events: none;
}

.auth-brandline,
.auth-logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.auth-brandline {
  position: absolute;
  top: clamp(24px, 4vw, 42px);
  left: clamp(28px, 5vw, 58px);
  z-index: 1;
  font-size: 18px;
}

.eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
}

.glass-card h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 18px 0 16px;
  font-size: 76px;
  line-height: 0.94;
  letter-spacing: 0;
}

.glass-card p,
.muted {
  color: var(--muted);
}

.glass-card p {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  line-height: 1.55;
}

.auth-proof-grid {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: clamp(22px, 4vh, 34px);
}

.auth-proof-grid span {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 11px;
}

.auth-card {
  align-self: center;
  display: grid;
  gap: 13px;
  max-height: calc(100vh - clamp(36px, 6vw, 84px));
  overflow: hidden;
  border-radius: 20px;
  padding: clamp(24px, 3.5vw, 38px);
  background: rgba(255, 255, 255, 0.92);
}

.auth-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
}

.auth-access-pill {
  border-radius: 999px;
  background: #fff1ed;
  color: #e43e35;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
}

.auth-card h2 {
  margin: 6px 0 0;
  color: #2b2d3a;
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0;
}

.auth-card .muted {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.45;
}

.auth-card .primary-button {
  background: linear-gradient(135deg, #ff5a4f, #ff8b63);
  box-shadow: 0 16px 30px rgba(255, 90, 79, 0.24);
}

.auth-card .ghost-button:hover,
.auth-card .primary-button:hover {
  transform: translateY(-1px);
}

.auth-card .primary-button,
.auth-card .ghost-button {
  min-height: 44px;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff5a4f, #ff8b63);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 12px 28px rgba(255, 90, 79, 0.28);
}
.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-control-lg);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-control-lg);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  outline: none;
  padding: 12px 13px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(59, 130, 246, 0.68);
  box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.12);
}

.primary-button,
.danger-button,
.ghost-button,
.add-button,
.toolbar button,
.nav-item,
.subtle-link,
.signout {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-control-lg);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-weight: 800;
  padding: 11px 13px;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: white;
}

.danger-button {
  border: 0;
  background: linear-gradient(135deg, #c43d62, #8f2c6e);
  color: white;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.55);
}

.library-app {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  isolation: isolate;
}

.sidebar,
.main-panel {
  min-height: 0;
  border-radius: var(--radius-panel-lg);
}

.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  font-family: var(--sidebar-font);
  gap: 13px;
  border: 1px solid var(--sidebar-border);
  border-radius: 20px;
  overflow: visible;
  background: var(--sidebar-panel);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 20px 44px rgba(15, 23, 42, 0.08);
  padding: 14px;
}

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

.sidebar-fixed-top,
.sidebar-fixed-bottom {
  min-width: 0;
  flex: 0 0 auto;
  display: grid;
  gap: 13px;
}

.sidebar-fixed-top {
  position: relative;
  z-index: 90;
}

.sidebar-scroll-region {
  position: relative;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 11px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 12px 2px 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.sidebar-scroll-region::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.sidebar-scroll-region::-webkit-scrollbar-button,
.sidebar-scroll-region::-webkit-scrollbar-track,
.sidebar-scroll-region::-webkit-scrollbar-thumb {
  display: none;
}

.sidebar-scrollbar {
  position: fixed;
  z-index: 20;
  width: 7px;
  border-radius: 999px;
  pointer-events: none;
}

.sidebar-scrollbar-thumb {
  position: absolute;
  left: 1px;
  top: 0;
  width: 3px;
  min-height: 44px;
  border-radius: 999px;
  background: #cbd5e1;
  pointer-events: auto;
  cursor: grab;
}

.sidebar-scrollbar-thumb:active {
  cursor: grabbing;
}

.brand-row {
  position: relative;
  z-index: 120;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 72px;
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  background:
    radial-gradient(circle at 9% 18%, rgba(196, 245, 253, 0.96), transparent 36%),
    radial-gradient(circle at 93% 16%, rgba(250, 226, 245, 0.98), transparent 38%),
    linear-gradient(116deg, #c4f5fd 0%, #f4fdff 34%, #fffafe 60%, #fae2f5 100%);
  background-clip: padding-box;
  padding: 11px 12px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    0 1px 2px rgba(15, 23, 42, 0.05);
  isolation: isolate;
  overflow: visible;
}

.brand-row::before {
  content: none;
}

.sidebar-fixed-top > .nav-section {
  position: relative;
  z-index: 1;
}

.brand-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 4px;
}

.account-menu-toggle {
  position: relative;
  margin-left: auto;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.86);
  color: #475569;
  font-size: 0;
  line-height: 1;
  font-weight: 900;
  padding: 0;
}

.account-menu-toggle:hover {
  border-color: rgba(203, 213, 225, 0.9);
  background: #ffffff;
  color: var(--sidebar-ink);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.account-menu-toggle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 17px;
  background: currentColor;
  border: 0;
  transform: translate(-50%, -50%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 17px 17px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 17px 17px no-repeat;
}

.account-menu {
  position: absolute;
  z-index: 500;
  top: calc(100% + 8px);
  right: 2px;
  min-width: 156px;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--sidebar-border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.06);
  padding: 4px;
}

.account-menu button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--sidebar-ink);
  font-size: 13px;
  font-weight: 560;
  padding: 10px 12px;
  text-align: left;
}

.account-menu button:hover {
  background: #f8fafc;
}

.brand-row span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--sidebar-muted);
  font-size: 11.5px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy .brand-email {
  max-width: 180px;
}

.brand-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0;
}

.brand-row strong {
  color: transparent;
  background: linear-gradient(105deg, #2300a8 0%, #1d1fd1 42%, #075da8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 16px;
  font-weight: 820;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-shadow: 0 8px 20px rgba(29, 78, 216, 0.16);
}

.brand-badge {
  display: none !important;
}

.brand-email {
  color: #64748b !important;
  font-size: 11px !important;
  line-height: 1.45;
  padding-bottom: 1px;
}

.brand-row [data-sync-status] {
  width: fit-content;
  max-width: 100%;
  margin-top: 1px;
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.08);
  color: var(--orange);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  padding: 3px 6px;
}

.brand-row [data-sync-status][data-state="synced"] {
  border-color: rgba(5, 150, 105, 0.16);
  background: rgba(5, 150, 105, 0.08);
  color: #059669;
}

.brand-row [data-sync-status][data-state="local"] {
  border-color: rgba(239, 68, 68, 0.16);
  background: rgba(239, 68, 68, 0.08);
  color: var(--red);
}

.add-button {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  background: var(--ink);
  color: white;
}

.topbar-add {
  align-self: center;
  justify-self: start;
  min-width: 92px;
  min-height: 36px;
  height: 36px;
  padding-inline: 11px;
}

.command-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(auto, max-content);
  gap: var(--toolbar-gap);
  align-items: center;
  padding: 16px 22px 14px;
  border-bottom: 1.5px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.36));
}

.command-cluster {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr);
  gap: var(--toolbar-gap);
  align-items: center;
}

.add-button span {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control-sm);
  background: var(--green);
  color: transparent;
  font-size: 0;
  padding: 0;
}

.add-button span::before,
.add-button span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  transform: translate(-50%, -50%);
}

.add-button span::after {
  width: 2px;
  height: 10px;
}

.floating-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 12px);
  left: 0;
  width: min(560px, calc(100vw - 96px));
  max-height: min(72vh, 560px);
  display: grid;
  gap: 0;
  border-radius: var(--radius-panel-md);
  padding: 0;
  overflow: hidden;
}

.add-menu {
  background:
    linear-gradient(180deg, rgba(239, 245, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.add-menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid rgba(116, 132, 166, 0.18);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 14px 18px;
  text-align: left;
  transition: background 140ms ease, transform 140ms ease;
}

.add-menu-item:last-child {
  border-bottom: 0;
}

.add-menu-item:hover {
  background: rgba(59, 130, 246, 0.07);
}

.add-menu-item.featured {
  background: rgba(59, 130, 246, 0.08);
}

.add-menu-item.utility {
  background: rgba(23, 32, 51, 0.02);
}

.add-menu-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.add-menu-copy strong {
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.add-menu-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.add-menu-item kbd {
  min-width: 36px;
  border: 1px solid rgba(116, 132, 166, 0.24);
  border-radius: var(--radius-control-sm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 8px;
  text-align: center;
}

.add-menu-icon {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-block;
  color: #8e99b5;
}

.add-menu-icon::before,
.add-menu-icon::after {
  content: "";
  position: absolute;
}

.add-menu-icon.upload::before {
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 7px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 6px 6px;
}

.add-menu-icon.upload::after {
  left: 8px;
  top: 1px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 7px solid currentColor;
  box-shadow: 0 8px 0 -2px currentColor;
}

.add-menu-icon.manual::before {
  left: 2px;
  top: 10px;
  width: 14px;
  height: 3px;
  background: currentColor;
  border-radius: 999px;
  transform: rotate(-38deg);
}

.add-menu-icon.manual::after {
  right: 1px;
  top: 2px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(-38deg);
}

.add-menu-icon.search::before {
  left: 2px;
  top: 2px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.add-menu-icon.search::after {
  right: 2px;
  bottom: 2px;
  width: 8px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transform: rotate(45deg);
  transform-origin: right center;
}

.add-menu-icon.paste::before,
.add-menu-icon.paste::after {
  width: 11px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.add-menu-icon.paste::before {
  left: 7px;
  top: 5px;
}

.add-menu-icon.paste::after {
  left: 2px;
  top: 1px;
  background: rgba(255, 255, 255, 0.45);
}

.add-menu-icon.migrate::before {
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  border-radius: 0 0 0 5px;
}

.add-menu-icon.migrate::after {
  right: 0;
  top: 0;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.add-menu-icon.share::before,
.add-menu-icon.share::after {
  border-radius: 999px;
  background: currentColor;
}

.add-menu-icon.share::before {
  left: 2px;
  bottom: 3px;
  width: 7px;
  height: 7px;
  box-shadow: 12px -5px 0 0 currentColor, 12px 6px 0 0 currentColor;
}

.add-menu-icon.share::after {
  left: 6px;
  top: 8px;
  width: 11px;
  height: 2px;
  transform: rotate(-24deg);
  box-shadow: 0 7px 0 0 currentColor;
}

.add-menu-icon.demo::before {
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border: 2px dashed currentColor;
  border-radius: 6px;
}

.add-menu-icon.demo::after {
  left: 8px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

@media (max-width: 900px) {
  .floating-menu {
    width: min(430px, calc(100vw - 24px));
    max-height: min(74vh, 520px);
  }

  .command-bar {
    grid-template-columns: 1fr;
    padding-inline: 18px;
  }

  .command-cluster {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .search-popover {
    left: 0;
    width: min(560px, calc(100vw - 52px));
  }

  .topbar-add {
    width: fit-content;
  }

  .add-menu-item {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 14px;
  }

  .add-menu-item kbd {
    display: none;
  }
}

.nav-section {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.nav-section p,
.section-heading p {
  margin: 0;
  color: var(--sidebar-muted);
  font-size: 10.5px;
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding-left: 0;
  margin-left: 0;
  min-height: 38px;
  width: 100%;
}

.section-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 34px;
  min-width: 34px;
  gap: 0;
  overflow: visible;
}

.section-heading-actions > button {
  transform: none;
}

.section-heading-actions > button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #f1e8ff;
  border-radius: 12px;
  background: #fbf7ff;
  color: var(--sidebar-active-text);
  font-size: 16px;
  font-weight: 760;
}

.section-heading-actions > button:hover {
  border-color: #ead5ff;
  background: #f6edff;
  box-shadow: 0 1px 0 rgba(109, 40, 217, 0.04);
}

.section-toggle {
  width: 100% !important;
  min-width: 0;
  flex: 1 1 auto;
  display: inline-flex !important;
  align-items: center;
  justify-content: start;
  gap: 9px;
  min-height: 34px;
  border: 0 !important;
  border-radius: 10px !important;
  padding: 0 4px !important;
  background: transparent !important;
  color: #475569 !important;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: none !important;
}

.section-toggle:focus,
.section-toggle:focus-visible {
  outline: none;
  box-shadow: none;
  color: var(--sidebar-ink) !important;
}

.section-toggle:hover {
  background: transparent !important;
  color: var(--sidebar-ink) !important;
  box-shadow: none !important;
}

.section-toggle span:last-child {
  overflow: hidden;
  font-size: 11px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-chevron {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  background: currentColor;
  border: 0;
  transform: none;
  transition: transform 140ms ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
}

.collapsible-section.collapsed .section-chevron {
  transform: rotate(-90deg);
}

.collapsible-section.collapsed .section-body {
  display: none;
}

.section-menu-button {
  letter-spacing: 0.08em;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  position: relative;
  color: #475569;
  font-size: 13px;
  font-weight: 570;
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  min-height: 40px;
  border-radius: 12px;
  padding: 9px 10px;
  text-align: left;
  outline: none;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-item-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-item-main span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item.active,
.nav-item:hover {
  background:
    linear-gradient(90deg, rgba(234, 220, 255, 0.92), rgba(255, 255, 255, 0.78) 72%);
  color: var(--sidebar-active-text);
}

.nav-item.active {
  font-weight: 680;
}

.nav-item:focus-visible {
  box-shadow: 0 0 0 3px var(--sidebar-ring);
}

.nav-item > span:last-child {
  min-width: 30px;
  color: inherit;
  font-size: 13px;
  font-weight: 680;
  text-align: right;
  opacity: 0.88;
}

.nav-item.active > span:last-child {
  color: var(--sidebar-active-text);
}

.nav-item[data-view="all"]:hover,
.nav-item[data-view="all"].active {
  background:
    linear-gradient(90deg, rgba(191, 219, 254, 0.92), rgba(239, 246, 255, 0.82) 54%, rgba(255, 255, 255, 0.86) 100%);
  color: #1d4ed8;
}

.nav-item[data-view="starred"]:hover,
.nav-item[data-view="starred"].active {
  background:
    linear-gradient(90deg, rgba(254, 240, 138, 0.92), rgba(255, 247, 205, 0.84) 54%, rgba(255, 255, 255, 0.9) 100%);
  color: #d97706;
}

.nav-item[data-view="trash"]:hover,
.nav-item[data-view="trash"].active {
  background:
    linear-gradient(90deg, rgba(254, 202, 202, 0.94), rgba(255, 241, 242, 0.84) 56%, rgba(255, 255, 255, 0.88) 100%);
  color: #dc2626;
}

.nav-item[data-view="all"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.nav-item[data-view="starred"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.nav-item[data-view="trash"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.nav-item[data-view="all"].active > span:last-child,
.nav-item[data-view="all"]:hover > span:last-child {
  color: #1d4ed8;
}

.nav-item[data-view="starred"].active > span:last-child,
.nav-item[data-view="starred"]:hover > span:last-child {
  color: #d97706;
}

.nav-item[data-view="trash"].active > span:last-child,
.nav-item[data-view="trash"]:hover > span:last-child {
  color: #dc2626;
}

.sidebar-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 18px;
  color: currentColor;
}

.sidebar-icon::before,
.sidebar-icon::after {
  content: "";
  position: absolute;
}

.folder-icon::before {
  left: 1px;
  top: 5px;
  width: 16px;
  height: 11px;
  border-radius: 3px;
  background: #f0bd21;
  box-shadow: inset 0 -2px 0 rgba(204, 132, 14, 0.16), inset 0 0 0 1px rgba(157, 103, 14, 0.08);
}

.folder-icon::after {
  left: 2px;
  top: 2px;
  width: 8px;
  height: 5px;
  border-radius: 2px 2px 0 0;
  background: #f7ca3a;
}

.flag-icon::before {
  left: 3px;
  top: 2px;
  width: 2px;
  height: 14px;
  border-radius: 999px;
  background: #9f1239;
}

.flag-icon::after {
  left: 5px;
  top: 3px;
  width: 10px;
  height: 8px;
  background: linear-gradient(180deg, #ef476f, #d90452);
  clip-path: polygon(0 0, 100% 12%, 76% 50%, 100% 88%, 0 100%);
  border-radius: 2px 3px 3px 2px;
}

.star-icon::before {
  inset: 1px;
  background: #667388;
  clip-path: polygon(50% 0%, 62% 35%, 100% 38%, 71% 59%, 81% 96%, 50% 73%, 19% 96%, 29% 59%, 0% 38%, 38% 35%);
}

.trash-icon::before {
  inset: 1px;
  background: #667388;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M8.2 3.2h7.6c.7 0 1.3.5 1.5 1.2l.25 1.05h3.05c.65 0 1.2.54 1.2 1.2v1.05c0 .65-.55 1.2-1.2 1.2H3.4c-.66 0-1.2-.55-1.2-1.2V6.65c0-.66.54-1.2 1.2-1.2h3.05l.25-1.05c.16-.7.78-1.2 1.5-1.2Zm1.2 2.25h5.2l-.13-.52H9.53l-.13.52ZM4.5 10.2h15l-1.05 9.1c-.12 1.14-1.08 2-2.24 2H7.79c-1.16 0-2.12-.86-2.24-2L4.5 10.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M8.2 3.2h7.6c.7 0 1.3.5 1.5 1.2l.25 1.05h3.05c.65 0 1.2.54 1.2 1.2v1.05c0 .65-.55 1.2-1.2 1.2H3.4c-.66 0-1.2-.55-1.2-1.2V6.65c0-.66.54-1.2 1.2-1.2h3.05l.25-1.05c.16-.7.78-1.2 1.5-1.2Zm1.2 2.25h5.2l-.13-.52H9.53l-.13.52ZM4.5 10.2h15l-1.05 9.1c-.12 1.14-1.08 2-2.24 2H7.79c-1.16 0-2.12-.86-2.24-2L4.5 10.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.trash-icon::after {
  content: none;
}

.collection-icon::before {
  inset: 2px;
  border: 2px solid #667388;
  border-radius: 4px;
}

.collection-icon::after {
  right: 0;
  top: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid #667388;
  border-top: 2px solid #667388;
  border-radius: 2px;
}

.collection-icon::before,
.folder-icon::before,
.flag-icon::before,
.star-icon::before,
.trash-icon::before {
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: currentColor;
  box-shadow: none;
  clip-path: none;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 18px 18px;
  mask-size: 18px 18px;
}

.collection-icon::after,
.folder-icon::after,
.flag-icon::after,
.star-icon::after,
.trash-icon::after {
  content: none;
}

.collection-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E");
}

.folder-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E");
}

.flag-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 22V4'/%3E%3Cpath d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V4s-1 1-4 1-5-2-8-2-4 1-4 1z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 22V4'/%3E%3Cpath d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V4s-1 1-4 1-5-2-8-2-4 1-4 1z'/%3E%3C/svg%3E");
}

.star-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E");
}

.trash-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3C/svg%3E");
}

.pencil-icon::before {
  left: 2px;
  top: 9px;
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-45deg);
}

.pencil-icon::after {
  right: 1px;
  top: 3px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(-45deg);
}

.subfolder-icon::before {
  left: 2px;
  top: 6px;
  width: 10px;
  height: 9px;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.75;
}

.subfolder-icon::after {
  right: 1px;
  top: 3px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  border: 2px solid currentColor;
  background: rgba(255, 255, 255, 0.8);
}

.share-icon::before,
.share-icon::after,
.flow-icon::before,
.flow-icon::after,
.export-icon::before,
.export-icon::after,
.download-icon::before,
.download-icon::after {
  background: currentColor;
}

.share-icon::before {
  left: 2px;
  top: 2px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  box-shadow: 9px 3px 0 0 currentColor, 9px 10px 0 0 currentColor;
}

.share-icon::after {
  left: 6px;
  top: 8px;
  width: 8px;
  height: 2px;
  transform: rotate(-20deg);
  box-shadow: 0 6px 0 0 currentColor;
}

.flow-icon::before {
  left: 2px;
  top: 4px;
  width: 13px;
  height: 2px;
  box-shadow: 0 5px 0 0 currentColor, 0 10px 0 0 currentColor;
}

.flow-icon::after {
  right: 0;
  top: 1px;
  width: 7px;
  height: 13px;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 0 8px 8px 0;
  background: transparent;
}

.export-icon::before,
.download-icon::before {
  left: 7px;
  top: 2px;
  width: 4px;
  height: 9px;
  border-radius: 999px;
}

.export-icon::after,
.download-icon::after {
  left: 4px;
  top: 8px;
  width: 10px;
  height: 10px;
  clip-path: polygon(50% 100%, 0% 42%, 26% 42%, 26% 0%, 74% 0%, 74% 42%, 100% 42%);
}

.download-icon::before {
  top: 3px;
}

.folder-tree {
  display: grid;
  gap: 4px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.folder-node {
  position: relative;
}

.folder-node.dragging {
  opacity: 0.55;
}

.folder-node.dragging .folder-row {
  cursor: grabbing;
}

.folder-row {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  border-radius: 12px;
  padding: 0 8px 0 calc(8px + (var(--folder-depth, 0) * 18px));
  color: #475569;
  font-size: 12.5px;
  font-weight: 570;
  cursor: grab;
  outline: none;
  transition: background 140ms ease, color 140ms ease;
}

.folder-row.active,
.folder-row:hover {
  background: #f8fafc;
  color: var(--sidebar-ink);
}

.folder-row.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 680;
}

.folder-row.menu-open {
  background: #f4f4f5;
}

.folder-row.drop-before::before,
.folder-row.drop-after::after {
  content: "";
  position: absolute;
  left: calc(12px + (var(--folder-depth, 0) * 18px));
  right: 10px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  pointer-events: none;
}

.folder-row.drop-before::before {
  top: -3px;
}

.folder-row.drop-after::after {
  bottom: -3px;
}

.folder-row.drop-inside {
  background: #eef2ff;
  outline: 2px solid #c7d2fe;
  outline-offset: -2px;
  color: #4338ca;
}

.folder-row.reference-drop-target,
.chip.reference-drop-target,
.nav-item.reference-drop-target {
  background: rgba(17, 163, 106, 0.14);
  outline: 2px solid rgba(17, 163, 106, 0.26);
  outline-offset: -2px;
  color: #16684c;
}

.nav-item[data-view="trash"].reference-drop-target {
  background: rgba(239, 68, 68, 0.12);
  outline-color: rgba(239, 68, 68, 0.28);
  color: #b91c1c;
}

.folder-toggle,
.folder-menu-toggle {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.folder-toggle {
  width: 14px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  outline: none;
}

.folder-toggle.empty {
  cursor: default;
  width: 14px;
  overflow: hidden;
}

.folder-toggle.empty + .folder-body {
  margin-left: 0;
}

.folder-chevron {
  width: 15px;
  height: 15px;
  display: block;
  background: currentColor;
  transform: rotate(-90deg);
  transition: transform 140ms ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
}

.folder-chevron.expanded {
  transform: rotate(0deg);
}

.folder-body {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 12.5px;
  font-weight: inherit;
  padding: 8px 0;
  text-align: left;
  cursor: inherit;
  outline: none;
}

.folder-name {
  display: inline-block;
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-count {
  color: inherit;
  font-size: 12.5px;
  font-weight: 680;
  min-width: 24px;
  text-align: right;
  opacity: 0.86;
}

.folder-menu-toggle {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  opacity: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  outline: none;
  transition: opacity 140ms ease, background 140ms ease, color 140ms ease;
}

.folder-row:hover .folder-menu-toggle,
.folder-row.menu-open .folder-menu-toggle,
.folder-menu-toggle:focus-visible {
  opacity: 1;
}

.folder-menu-toggle:hover {
  background: #e9e5f6;
  color: var(--sidebar-active-text);
}

.folder-children {
  display: grid;
  gap: 3px;
}

.label-toggle-spacer {
  width: 14px;
  height: 18px;
  display: inline-block;
  overflow: hidden;
}

.label-row .folder-body {
  margin-left: 0;
}

.folder-drop-zone {
  height: 8px;
  margin: 0 0 0 calc(12px + (var(--folder-depth, 0) * 18px));
  border-radius: 999px;
  transition: background 140ms ease;
}

.folder-drop-zone:hover {
  background: transparent;
}

.folder-menu {
  position: fixed;
  top: var(--folder-menu-top, 0);
  left: var(--folder-menu-left, 0);
  z-index: 140;
  width: 188px;
  max-width: min(224px, calc(100vw - 20px));
  display: grid;
  border: 1px solid var(--sidebar-border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow:
    0 18px 38px rgba(15, 23, 42, 0.14),
    0 2px 6px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  padding: 4px;
  font-family: var(--sidebar-font);
  color: #0f172a;
}

.folder-actions-menu {
  width: 224px;
  max-height: min(256px, calc(100vh - 132px));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.label-actions-menu,
.trash-actions-menu {
  width: 188px;
}

.folder-menu.drop-up {
  transform-origin: bottom left;
}

.folder-menu-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  position: relative;
  border: 0;
  border-radius: 8px;
  border-bottom: 0;
  background: transparent;
  color: #334155;
  font-size: 12px;
  font-weight: 520;
  letter-spacing: -0.01em;
  line-height: 1.2;
  min-height: 32px;
  padding: 7px 8px;
  text-align: left;
  outline: none;
  transition: background 120ms ease, color 120ms ease;
}

.folder-menu-item .sidebar-icon,
.folder-menu-item .restore-symbol,
.folder-menu-item .delete-symbol {
  width: 16px;
  height: 16px;
  color: currentColor;
  opacity: 0.88;
}

.folder-menu .pencil-icon::before,
.folder-menu .subfolder-icon::before,
.folder-menu .share-icon::before,
.folder-menu .flow-icon::before,
.folder-menu .export-icon::before,
.folder-menu .download-icon::before,
.folder-menu .trash-icon::before,
.folder-menu .restore-symbol::before {
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: currentColor;
  box-shadow: none;
  clip-path: none;
  opacity: 1;
  transform: none;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 16px 16px;
  mask-size: 16px 16px;
}

.folder-menu .pencil-icon::after,
.folder-menu .subfolder-icon::after,
.folder-menu .share-icon::after,
.folder-menu .flow-icon::after,
.folder-menu .export-icon::after,
.folder-menu .download-icon::after,
.folder-menu .trash-icon::after,
.folder-menu .restore-symbol::after {
  content: none;
}

.folder-menu .pencil-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z'/%3E%3Cpath d='m15 5 4 4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z'/%3E%3Cpath d='m15 5 4 4'/%3E%3C/svg%3E");
}

.folder-menu .subfolder-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 10v6'/%3E%3Cpath d='M9 13h6'/%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 10v6'/%3E%3Cpath d='M9 13h6'/%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E");
}

.folder-menu .share-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='m8.59 13.51 6.83 3.98'/%3E%3Cpath d='m15.41 6.51-6.82 3.98'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='m8.59 13.51 6.83 3.98'/%3E%3Cpath d='m15.41 6.51-6.82 3.98'/%3E%3C/svg%3E");
}

.folder-menu .flow-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 6h12'/%3E%3Cpath d='M15 6l-3-3'/%3E%3Cpath d='M15 6l-3 3'/%3E%3Cpath d='M3 12h18'/%3E%3Cpath d='M3 18h12'/%3E%3Cpath d='M15 18l-3-3'/%3E%3Cpath d='M15 18l-3 3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 6h12'/%3E%3Cpath d='M15 6l-3-3'/%3E%3Cpath d='M15 6l-3 3'/%3E%3Cpath d='M3 12h18'/%3E%3Cpath d='M3 18h12'/%3E%3Cpath d='M15 18l-3-3'/%3E%3Cpath d='M15 18l-3 3'/%3E%3C/svg%3E");
}

.folder-menu .export-icon::before,
.folder-menu .download-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E");
}

.folder-menu .trash-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3C/svg%3E");
}

.folder-menu .restore-symbol::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/%3E%3Cpath d='M3 21v-5h5'/%3E%3Cpath d='M3 12a9 9 0 0 1 15.74-6.26L21 8'/%3E%3Cpath d='M16 8h5V3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/%3E%3Cpath d='M3 21v-5h5'/%3E%3Cpath d='M3 12a9 9 0 0 1 15.74-6.26L21 8'/%3E%3Cpath d='M16 8h5V3'/%3E%3C/svg%3E");
}

.folder-menu-item:last-child {
  border-bottom: 0;
}

.folder-menu-item.disabled {
  color: #94a3b8;
  cursor: default;
  opacity: 0.72;
  pointer-events: none;
}

.folder-menu-item.danger {
  color: #e11d48;
  font-weight: 560;
}

.folder-menu-item:hover {
  background: #f8fafc;
  color: #0f172a;
}

.folder-menu-item.danger:hover {
  background: #fff1f2;
  color: #be123c;
}

.folder-actions-menu .folder-menu-item:nth-child(5),
.folder-actions-menu .folder-menu-item:nth-child(7),
.label-actions-menu .folder-menu-item.danger,
.trash-actions-menu .folder-menu-item.danger {
  margin-top: 5px;
}

.folder-actions-menu .folder-menu-item:nth-child(5)::before,
.folder-actions-menu .folder-menu-item:nth-child(7)::before,
.label-actions-menu .folder-menu-item.danger::before,
.trash-actions-menu .folder-menu-item.danger::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: -3px;
  height: 1px;
  background: #f1f5f9;
}

.chip-list {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.chip-list[data-folder-list] {
  max-height: none;
  overflow: visible;
  align-content: flex-start;
  padding-right: 4px;
}

.chip-list[data-label-list] {
  display: grid;
  gap: 4px;
  max-height: none;
  overflow: visible;
  align-content: flex-start;
  padding-right: 4px;
}

.chip-list[data-folder-list]::-webkit-scrollbar,
.chip-list[data-label-list]::-webkit-scrollbar {
  width: 8px;
}

.chip-list[data-folder-list]::-webkit-scrollbar-thumb,
.chip-list[data-label-list]::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(109, 120, 144, 0.55);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 9px;
}

.label-row .folder-body,
.label-row .folder-count {
  color: inherit;
}

.chip.active {
  border-color: rgba(124, 58, 237, 0.32);
  background: rgba(124, 58, 237, 0.2);
  color: var(--blue-dark);
}

.chip-count {
  color: #5f6982;
}

.signout {
  border-color: #fecdd3;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff7f8, #fff1f3);
  color: #be123c;
  font-size: 13px;
  font-weight: 680;
  min-height: 42px;
  padding: 10px 12px;
  box-shadow: 0 1px 0 rgba(190, 18, 60, 0.04);
}

.signout:hover {
  border-color: #fda4af;
  background: #ffe4e6;
  color: #9f1239;
}

.main-panel {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--toolbar-gap);
  align-items: center;
}

.top-search > input {
  height: 36px;
  min-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
}

.search-box kbd {
  border: 1px solid var(--line);
  border-radius: var(--radius-control-sm);
  background: white;
  color: var(--muted);
  padding: 7px 9px;
}

.search-box button,
.sort-row button,
.filter-title button,
.modal-card header button {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-control-lg);
  background: white;
  color: var(--muted);
  font-weight: 800;
  padding: 10px;
}

.toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--toolbar-gap);
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.toolbar button,
.search-box button {
  appearance: none;
  -webkit-appearance: none;
  min-height: 36px;
  height: 36px;
  padding: 7px 10px;
  white-space: nowrap;
  border-width: 1.5px;
  border-color: var(--toolbar-line);
  box-shadow: none;
  background-image: none;
}

.toolbar-icon {
  width: 36px;
  min-width: 36px;
  display: inline-grid;
  place-items: center;
  padding: 8px !important;
  flex: 0 0 auto;
}

.bulk-folder-control {
  position: relative;
}

.folder-picker-button {
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative;
  color: var(--muted);
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: var(--radius-control-lg) !important;
  background: rgba(255, 255, 255, 0.55) !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.folder-picker-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--toolbar-line);
  border-radius: inherit;
  pointer-events: none;
}

.folder-picker-button:hover,
.folder-picker-button:focus-visible,
.folder-picker-button.active {
  background: rgba(255, 255, 255, 0.55) !important;
  color: var(--muted);
}

.bulk-folder-menu {
  position: absolute;
  z-index: 75;
  top: calc(100% + 10px);
  right: 0;
  width: min(245px, calc(100vw - 80px));
  height: min(58vh, 420px);
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-panel-md);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  padding: 10px 18px 10px 10px;
}

.bulk-folder-scroll-region {
  height: 100%;
  overflow-y: auto;
  padding-right: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.bulk-folder-scroll-region::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.bulk-folder-scrollbar {
  position: absolute;
  top: 14px;
  right: 6px;
  bottom: 14px;
  width: 8px;
}

.bulk-folder-scrollbar-thumb {
  width: 8px;
  min-height: 44px;
  border-radius: 999px;
  background: rgba(109, 120, 144, 0.72);
  cursor: grab;
  touch-action: none;
}

.bulk-folder-scrollbar-thumb:active {
  cursor: grabbing;
}

.bulk-folder-list {
  display: grid;
  gap: 2px;
}

.bulk-folder-row {
  display: grid;
  grid-template-columns: 18px 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 36px;
  border: 0;
  border-radius: var(--radius-control-md);
  background: transparent;
  color: #5f6982;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 8px 7px calc(8px + (var(--folder-depth, 0) * 20px));
  text-align: left;
}

.bulk-folder-row:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--blue-dark);
}

.bulk-folder-check {
  position: relative;
  width: 16px;
  height: 16px;
  border: 2px solid #a8afbd;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.88);
}

.bulk-folder-row.checked .bulk-folder-check {
  border-color: #4f6edb;
  background: #4f6edb;
}

.bulk-folder-row.checked .bulk-folder-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg);
}

.bulk-folder-row.mixed .bulk-folder-check {
  border-color: #7c879b;
}

.bulk-folder-row.mixed .bulk-folder-check::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 6px;
  height: 2px;
  border-radius: 999px;
  background: #7c879b;
}

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

.bulk-folder-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 10px;
}

.toolbar > button:not(.toolbar-icon) {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 13px;
  letter-spacing: 0;
  padding-inline: 18px;
}


.toolbar-symbol {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-block;
  color: currentColor;
}

.select-symbol::before {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1.5px solid #94a3b8;
  border-radius: 5px;
  background: #ffffff;
}

.select-symbol::after {
  content: none;
}

.toolbar-icon.active .select-symbol::before {
  background: var(--sidebar-active-text);
  border-color: var(--sidebar-active-text);
}

.toolbar-icon.active .select-symbol::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 10px;
  height: 10px;
  background: #ffffff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center / 10px 10px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center / 10px 10px no-repeat;
}

.toolbar-icon:hover .select-symbol::before,
.toolbar-icon:focus-visible .select-symbol::before {
  border-color: #7c8fb8;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
  outline: none;
}

.toolbar-icon.active:hover .select-symbol::before,
.toolbar-icon.active:focus-visible .select-symbol::before {
  border-color: var(--sidebar-active-text);
  background: var(--sidebar-active-text);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
  outline: none;
}

.label-symbol::before {
  content: "";
  position: absolute;
  inset: 3px 2px 3px 4px;
  border-radius: 3px;
  background: currentColor;
  clip-path: polygon(0 0, 72% 0, 100% 50%, 72% 100%, 0 100%);
}

.label-symbol::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 8px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: white;
}

.sliders-symbol::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='21' x2='14' y1='4' y2='4'/%3E%3Cline x1='10' x2='3' y1='4' y2='4'/%3E%3Cline x1='21' x2='12' y1='12' y2='12'/%3E%3Cline x1='8' x2='3' y1='12' y2='12'/%3E%3Cline x1='21' x2='16' y1='20' y2='20'/%3E%3Cline x1='12' x2='3' y1='20' y2='20'/%3E%3Cline x1='14' x2='14' y1='2' y2='6'/%3E%3Cline x1='8' x2='8' y1='10' y2='14'/%3E%3Cline x1='16' x2='16' y1='18' y2='22'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='21' x2='14' y1='4' y2='4'/%3E%3Cline x1='10' x2='3' y1='4' y2='4'/%3E%3Cline x1='21' x2='12' y1='12' y2='12'/%3E%3Cline x1='8' x2='3' y1='12' y2='12'/%3E%3Cline x1='21' x2='16' y1='20' y2='20'/%3E%3Cline x1='12' x2='3' y1='20' y2='20'/%3E%3Cline x1='14' x2='14' y1='2' y2='6'/%3E%3Cline x1='8' x2='8' y1='10' y2='14'/%3E%3Cline x1='16' x2='16' y1='18' y2='22'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sliders-symbol::after {
  content: none;
}

.toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.search-help {
  display: grid;
  gap: 0;
}

.search-popover {
  position: absolute;
  z-index: 70;
  top: calc(100% + 10px);
  left: 132px;
  width: min(560px, calc(100vw - 420px));
  border: 1px solid var(--line);
  border-radius: var(--radius-panel-md);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-help-row {
  width: 100%;
  display: grid;
  grid-template-columns: 26px auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid rgba(116, 132, 166, 0.18);
  border-radius: 0;
  background: transparent;
  color: #596373;
  padding: 13px 18px;
  text-align: left;
}

.search-help-row:hover {
  background: rgba(59, 130, 246, 0.06);
}

.search-help-row strong {
  color: #4b5563;
  font-size: 13px;
  font-weight: 850;
}

.search-help-row span:not(.search-option-icon) {
  overflow: hidden;
  color: #858d9a;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-help-row kbd {
  border: 1px solid var(--line);
  border-radius: var(--radius-control-sm);
  background: white;
  color: #8a93a1;
  padding: 5px 8px;
}

.search-help-section {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid rgba(116, 132, 166, 0.18);
  padding: 14px 18px;
}

.search-help-section > span {
  flex: 0 0 100%;
  color: #a2a9b4;
  font-size: 13px;
  font-weight: 850;
}

.search-help-section button {
  border: 0;
  border-radius: var(--radius-control-sm);
  background: #e4effb;
  color: #5f6982;
  font-size: 12px;
  font-weight: 850;
  padding: 6px 8px;
}

.include-section {
  display: grid;
  gap: 12px;
  border-bottom: 0;
}

.include-section label {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  color: #596373;
  font-size: 13px;
  font-weight: 850;
}

.include-section input {
  width: 34px;
  height: 18px;
  accent-color: var(--blue);
}

.search-option-icon {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-block;
  color: #98a1ae;
}

.search-option-icon::before,
.search-option-icon::after {
  content: "";
  position: absolute;
}

.lookup-icon::before {
  left: 2px;
  top: 2px;
  width: 10px;
  height: 10px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.lookup-icon::after {
  right: 2px;
  bottom: 2px;
  width: 8px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
}

.online-icon::before {
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.online-icon::after {
  left: 3px;
  right: 3px;
  top: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px 0 -1px currentColor, 0 5px 0 -1px currentColor;
}

.quote-icon::before {
  left: 3px;
  top: 5px;
  width: 5px;
  height: 8px;
  border-radius: 5px;
  background: currentColor;
  box-shadow: 9px 0 0 currentColor;
}

.exclude-icon::before {
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.exclude-icon::after {
  left: 4px;
  top: 9px;
  width: 12px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.document-icon::before,
.notes-icon::before,
.pdf-icon::before {
  inset: 2px 4px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.notes-icon::after {
  left: 4px;
  top: 8px;
  width: 12px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.pdf-icon::after {
  content: "PDF";
  left: 2px;
  bottom: 0;
  font-size: 6px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .search-popover {
    left: 0;
    width: min(560px, calc(100vw - 52px));
  }
}

.search-help code {
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.11);
  color: var(--blue-dark);
  padding: 4px 6px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
}

.list-header > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.trash-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 2px;
}

.trash-sidebar-taxonomy,
.trash-taxonomy {
  display: grid;
  gap: 8px;
}

.trash-sidebar-taxonomy {
  width: 100%;
  margin: 0;
  gap: 6px;
}

.trash-sidebar-taxonomy:empty {
  display: none;
}

.trash-sidebar-taxonomy .trash-taxonomy {
  gap: 6px;
}

.trash-sidebar-taxonomy .trash-taxonomy-section {
  gap: 4px;
}

.trash-sidebar-taxonomy .trash-taxonomy-section .section-heading {
  min-height: 34px;
  padding-right: 0;
}

.trash-sidebar-taxonomy .section-toggle {
  min-height: 34px;
  padding-left: 0 !important;
}

.trash-sidebar-taxonomy .section-toggle span:last-child {
  font-size: 11px;
}

.trash-sidebar-taxonomy .folder-row {
  min-height: 36px;
  padding-left: calc(8px + (var(--folder-depth, 0) * 18px));
}

.trash-taxonomy-section {
  gap: 6px;
}

.trash-taxonomy-section .section-heading {
  min-height: 30px;
}

.trash-taxonomy-section .section-body {
  margin-top: 0;
}

.trash-taxonomy-count {
  flex: 0 0 34px;
  min-width: 34px;
  color: #475569;
  font-size: 12.5px;
  font-weight: 680;
  text-align: right;
  opacity: 0.88;
}

.trash-taxonomy-row {
  cursor: default;
}

.trash-taxonomy-row .folder-body {
  cursor: pointer;
}

.trash-taxonomy-row .folder-menu-toggle {
  opacity: 1;
}

.trash-action {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-control-lg);
  background: rgba(255, 255, 255, 0.64);
  color: #7b8495;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.trash-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.trash-action:not(:disabled).restore:hover {
  border-color: rgba(17, 163, 106, 0.4);
  background: rgba(17, 163, 106, 0.1);
  color: #0f8b5b;
}

.trash-action:not(:disabled).delete:hover {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.restore-symbol,
.delete-symbol {
  position: relative;
  width: 17px;
  height: 17px;
  display: inline-block;
  color: currentColor;
}

.delete-symbol::before,
.delete-symbol::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 7px;
  width: 15px;
  height: 2.5px;
  border-radius: 999px;
  background: currentColor;
}

.delete-symbol::before {
  transform: rotate(45deg);
}

.delete-symbol::after {
  transform: rotate(-45deg);
}

.restore-symbol::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 4a8 8 0 1 0 7.75 10h-2.69A5.5 5.5 0 1 1 12 6.5c1.39 0 2.66.52 3.63 1.37L13.5 10H21V2.5l-2.61 2.61A7.96 7.96 0 0 0 12 4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 4a8 8 0 1 0 7.75 10h-2.69A5.5 5.5 0 1 1 12 6.5c1.39 0 2.66.52 3.63 1.37L13.5 10H21V2.5l-2.61 2.61A7.96 7.96 0 0 0 12 4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.restore-symbol::after {
  content: none;
}

.list-header h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.list-header span,
.sort-row {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sort-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sort-row button,
.sort-row select {
  min-height: 36px;
  height: 36px;
  font-size: 13px;
  padding-top: 0;
  padding-bottom: 0;
}

.sort-direction-button {
  width: 36px;
  min-width: 36px;
  padding-inline: 0 !important;
  display: inline-grid;
  place-items: center;
}

.sort-direction-symbol {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-block;
  color: currentColor;
}

.sort-direction-symbol::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M7 14V4.41L3.7 7.7 2.3 6.3 8 0.59 13.7 6.3 12.3 7.7 9 4.41V14H7Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M7 14V4.41L3.7 7.7 2.3 6.3 8 0.59 13.7 6.3 12.3 7.7 9 4.41V14H7Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sort-direction-button[data-direction="desc"] .sort-direction-symbol::before {
  transform: rotate(180deg);
}

.content-grid {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 0 18px 18px;
}

.reference-list {
  min-height: 0;
  overflow: auto;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  -ms-overflow-style: none;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.reference-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.reference-list::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.reference-list::-webkit-scrollbar-track {
  display: none;
}

.reference-list::-webkit-scrollbar-thumb {
  display: none;
}

.reference-list::-webkit-scrollbar-thumb:hover {
  display: none;
}

.reference-list::-webkit-scrollbar-corner {
  display: none;
}

.reference-scrollbar {
  position: absolute;
  z-index: 20;
  top: 14px;
  right: 24px;
  bottom: 32px;
  width: 7px;
  border-radius: 999px;
  pointer-events: none;
}

.reference-scrollbar-thumb {
  position: absolute;
  left: 1px;
  top: 0;
  width: 5px;
  min-height: 44px;
  border-radius: 999px;
  background: rgba(109, 120, 144, 0.72);
  pointer-events: auto;
  cursor: grab;
}

.reference-scrollbar-thumb:active {
  cursor: grabbing;
}

.reference-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  border-bottom: 1.5px solid var(--line);
  padding: 14px 16px;
}

.card-select-stack {
  width: 24px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  padding-top: 4px;
}

.card-select-stack > input[type="checkbox"] {
  margin: 0;
}

.reference-drag-handle {
  width: 24px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  color: #b8bcc9;
  cursor: grab;
}

.reference-drag-handle::before {
  content: "";
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  transform: translateX(-3px);
  box-shadow:
    0 6px 0 currentColor,
    0 12px 0 currentColor,
    6px 0 0 currentColor,
    6px 6px 0 currentColor,
    6px 12px 0 currentColor;
}

.reference-drag-handle:hover {
  color: #8e98ab;
}

.reference-drag-handle:active {
  cursor: grabbing;
}

.reference-card:last-child {
  border-bottom: 0;
}

.reference-card.selected {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), transparent);
}

.reference-card.dragging {
  opacity: 0.72;
}

.reference-card.trashed {
  opacity: 0.58;
}

.title-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.reference-title {
  margin: 0;
  color: #213a70;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.18;
}

.star {
  border: 0;
  background: transparent;
  color: #b7bfcb;
  font-size: 14px;
  line-height: 1;
  align-self: start;
  padding: 0 2px;
}

.card-select-stack .star {
  display: none;
}

.title-row .star {
  display: none;
}

.star.active {
  color: var(--orange);
}

.meta,
.links,
.abstract-preview {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.32;
}

.source {
  color: var(--green);
  font-weight: 850;
}

.meta-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-row .meta {
  flex: 0 1 auto;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  margin-top: 6px;
}

.links-inline {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  margin-top: 0;
}

.links a,
.links button {
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 15px;
  padding: 0;
  text-decoration: none;
}

.links:empty {
  display: none;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pill-row .reference-chip {
  max-width: min(100%, 172px);
  gap: 6px;
  border: 1.5px solid rgba(92, 104, 136, 0.44);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 4px 8px;
}

.pill-row .reference-chip::before {
  content: "";
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  order: 1;
}

.pill-row .reference-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  order: 2;
}

.pill-row .reference-chip-folder::before {
  border-radius: 3px;
  background:
    linear-gradient(#f7ca3a 0 5px, transparent 5px),
    linear-gradient(#f0bd21, #f0bd21);
  background-size: 8px 5px, 14px 10px;
  background-position: 1px 1px, 0 4px;
  background-repeat: no-repeat;
}

.folder-chip-remove {
  position: relative;
  order: 0;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: #626b7f;
  cursor: pointer;
}

.folder-chip-remove::before,
.folder-chip-remove::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.folder-chip-remove::before {
  transform: rotate(45deg);
}

.folder-chip-remove::after {
  transform: rotate(-45deg);
}

.folder-chip-remove:hover,
.folder-chip-remove:focus-visible {
  color: #dc2626;
}

.folder-chip-remove:focus-visible {
  outline: 2px solid rgba(220, 38, 38, 0.28);
  outline-offset: 2px;
}

.pill-row .reference-chip-label::before {
  background: #d90452;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 2.5c.6 0 1 .4 1 1v13c0 .55-.4 1-1 1s-1-.45-1-1v-13c0-.6.4-1 1-1Zm2 .8 9 .9-2.6 3.1L15 10l-9-.9V3.3Z' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 2.5c.6 0 1 .4 1 1v13c0 .55-.4 1-1 1s-1-.45-1-1v-13c0-.6.4-1 1-1Zm2 .8 9 .9-2.6 3.1L15 10l-9-.9V3.3Z' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
}

.pill-row .reference-chip-label {
  background: rgba(255, 241, 243, 0.92);
  border-color: rgba(217, 4, 82, 0.18);
}

.abstract-preview {
  margin: 8px 0 0;
  max-width: 96ch;
}

.card-actions {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto 1fr;
  gap: 8px;
  align-items: flex-start;
  justify-content: flex-end;
  justify-items: end;
  align-self: stretch;
  align-content: stretch;
  min-height: 100%;
}

.card-actions .ghost-button {
  grid-row: 1;
}

.card-actions .ghost-button {
  min-height: 0;
  padding: 7px 11px;
  border-width: 1.5px;
  border-color: var(--line);
  border-radius: var(--radius-control-lg);
  font-size: 12px;
}

.card-action-star {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  padding: 0;
  min-width: 14px;
  min-height: 14px;
  display: inline-grid;
  place-items: center;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 360px;
  color: var(--muted);
  text-align: center;
}

.filter-panel {
  min-height: 0;
  overflow: auto;
  border-radius: 22px;
  padding: 18px;
}

.filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.type-title {
  margin-top: 22px;
}

.filter-grid,
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-control-lg);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  padding: 10px;
}

.filter-option.active {
  border-color: rgba(59, 130, 246, 0.36);
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue-dark);
}

.modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(760px, calc(100vw - 36px));
  max-width: calc(100vw - 36px);
  border: 0;
  background: transparent;
  padding: 0;
}

.modal[open] {
  display: grid;
  place-items: center;
}

.wide-modal {
  width: min(1040px, calc(100vw - 36px));
}

.editor-modal {
  width: clamp(860px, 68vw, 1320px);
  min-width: 0;
}

.settings-modal {
  width: min(780px, calc(100vw - 36px));
}

.export-modal {
  width: min(680px, calc(100vw - 36px));
}

.modal::backdrop {
  background: rgba(40, 24, 68, 0.52);
  backdrop-filter: blur(8px);
}

.modal-card {
  display: grid;
  gap: 18px;
  border-radius: 22px;
  padding: 22px;
}

.modal-card header,
.modal-card footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.modal-card h2 {
  margin: 0;
  letter-spacing: 0;
}

.settings-card {
  min-height: min(720px, calc(100vh - 72px));
}

.confirm-card {
  width: min(520px, calc(100vw - 36px));
}

.confirm-copy {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-line;
}

.settings-section {
  display: grid;
  gap: 16px;
}

.settings-section h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.export-card header {
  align-items: start;
}

.export-card header p {
  margin: 6px 0 0;
}

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

.export-format-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 74px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-control-lg);
  background: rgba(255, 255, 255, 0.72);
  padding: 12px 14px;
  cursor: pointer;
}

.export-format-option:has(input:checked) {
  border-color: rgba(83, 112, 223, 0.92);
  box-shadow: 0 0 0 4px rgba(83, 112, 223, 0.12);
  background: rgba(244, 247, 255, 0.88);
}

.export-format-option input {
  width: 20px;
  height: 20px;
  padding: 0;
  accent-color: var(--blue);
}

.export-format-option span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.export-format-option strong {
  color: var(--ink);
  font-size: 15px;
}

.export-format-option small,
.export-compat-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.export-compat-note {
  margin: -2px 0 0;
}

.integration-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  max-height: min(460px, 54vh);
  overflow: auto;
  padding: 4px 6px 4px 0;
}

.integration-toggle {
  grid-template-columns: auto minmax(0, 1fr);
  display: grid;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control-md);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font-size: 13px;
  padding: 10px 11px;
}

.integration-toggle input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--blue);
}

.integration-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-card {
  max-height: min(88vh, 940px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border-color: rgba(203, 213, 225, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88)),
    radial-gradient(circle at 0% 0%, rgba(196, 245, 253, 0.34), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(250, 226, 245, 0.48), transparent 38%);
  font-family: var(--sidebar-font);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.editor-header,
.editor-footer {
  padding: 22px 28px;
  background: rgba(255, 255, 255, 0.72);
}

.editor-header {
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.editor-footer {
  border-top: 1px solid rgba(226, 232, 240, 0.95);
  justify-content: flex-end;
}

.editor-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.editor-title-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(59, 130, 246, 0.10)),
    rgba(255, 255, 255, 0.72);
  color: var(--violet);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.86);
}

.editor-title-icon::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin: 10px auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M12 18v-6'/%3E%3Cpath d='M9 15h6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M12 18v-6'/%3E%3Cpath d='M9 15h6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.editor-card h2 {
  font-size: clamp(24px, 2vw, 32px);
  font-weight: 850;
  color: #0f172a;
}

.editor-title-wrap p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 560;
}

.editor-close {
  min-width: 90px;
  border-color: rgba(244, 63, 94, 0.34) !important;
  background: linear-gradient(180deg, rgba(255, 241, 242, 0.96), rgba(255, 228, 230, 0.72)) !important;
  color: #be123c !important;
  box-shadow: 0 10px 22px rgba(244, 63, 94, 0.10);
}

.editor-close:hover {
  border-color: rgba(225, 29, 72, 0.54) !important;
  background: linear-gradient(180deg, rgba(255, 228, 230, 0.98), rgba(255, 205, 211, 0.82)) !important;
}

.editor-close:focus-visible {
  outline: none;
  border-color: rgba(225, 29, 72, 0.58) !important;
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.16), 0 10px 22px rgba(244, 63, 94, 0.10);
}

.editor-grid {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 22px 28px 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.82) rgba(241, 245, 249, 0.82);
}

.editor-grid::-webkit-scrollbar {
  width: 10px;
}

.editor-grid::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.82);
}

.editor-grid::-webkit-scrollbar-thumb {
  border: 2px solid rgba(241, 245, 249, 0.82);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.82);
}

.editor-section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.92), rgba(255, 255, 255, 0.84)),
    rgba(255, 255, 255, 0.86);
  padding: 16px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.9);
}

.editor-section-core {
  background:
    linear-gradient(135deg, rgba(250, 226, 245, 0.50), rgba(255, 255, 255, 0.84) 52%, rgba(196, 245, 253, 0.34)),
    rgba(255, 255, 255, 0.9);
}

.editor-section-ids {
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.94), rgba(255, 255, 255, 0.86) 55%, rgba(250, 245, 255, 0.76)),
    rgba(255, 255, 255, 0.9);
}

.editor-section h3 {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  color: #475569;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.editor-section label {
  gap: 6px;
  min-width: 0;
  color: #475569;
  font-size: 12.5px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.editor-section input,
.editor-section select,
.editor-section textarea {
  min-height: 42px;
  border: 1.5px solid rgba(148, 163, 184, 0.56);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
  font-size: 13.5px;
  font-weight: 520;
  padding: 10px 12px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.88);
}

.editor-section input::placeholder,
.editor-section textarea::placeholder {
  color: #94a3b8;
  font-weight: 560;
}

.editor-section input:focus,
.editor-section select:focus,
.editor-section textarea:focus {
  border-color: rgba(124, 58, 237, 0.72);
  box-shadow:
    0 0 0 4px rgba(124, 58, 237, 0.12),
    inset 0 1px rgba(255, 255, 255, 0.92);
}

.editor-section textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

.editor-section .field-sm {
  grid-column: span 3;
}

.editor-section .field-md {
  grid-column: span 4;
}

.editor-section .field-lg {
  grid-column: span 6;
}

.editor-section .field-xl {
  grid-column: 1 / -1;
}

.editor-footer .ghost-button,
.editor-footer .primary-button {
  min-height: 42px;
  border-radius: 12px;
  font-family: var(--sidebar-font);
  font-size: 13px;
  font-weight: 760;
  padding: 10px 16px;
}

.editor-footer .primary-button {
  background: linear-gradient(135deg, #4f46e5, #3b82f6 48%, #06b6d4);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.20);
}

.large-textarea {
  min-height: 260px;
}

.import-file-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control-lg);
  background: rgba(255, 255, 255, 0.62);
  padding: 12px;
}

.import-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.import-file-list {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.import-folder-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.online-results {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.online-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.online-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  padding: 12px;
}

.online-modal {
  width: min(640px, calc(100vw - 36px));
}

.online-modal::backdrop {
  background: rgba(44, 34, 58, 0.46);
  backdrop-filter: blur(10px) saturate(0.92);
}

.online-modal-card {
  gap: 16px;
  border: 1.5px solid #d9d9e6;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--sidebar-ink);
  font-family: var(--sidebar-font);
  padding: 22px;
  box-shadow:
    0 24px 70px rgba(15, 23, 42, 0.18),
    0 1px 2px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

.online-modal-card header {
  align-items: center;
  border-bottom: 1px solid #ececf4;
  margin: -4px -4px 0;
  padding: 0 0 14px;
}

.online-modal-card h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.1;
}

.online-modal-card h2::before {
  content: "";
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  background: var(--sidebar-active-text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.online-modal-card header button {
  min-height: 38px;
  border: 1.5px solid #fecdd3;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff7f8, #fff1f3);
  color: #be123c;
  font-size: 13px;
  font-weight: 760;
  padding: 8px 13px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 1px rgba(190, 18, 60, 0.05);
}

.online-modal-card header button:hover {
  border-color: #fda4af;
  background: linear-gradient(180deg, #fff1f3, #ffe4e9);
  color: #9f1239;
}

.online-modal-card .ghost-button {
  min-height: 38px;
  border: 1.5px solid #d9d9e6;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 680;
  padding: 8px 13px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 1px rgba(15, 23, 42, 0.04);
}

.online-modal-card .ghost-button:hover {
  border-color: #c9c9d8;
  background: #f8fafc;
  color: #0f172a;
}

.online-modal-card label {
  gap: 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0;
}

.online-modal-card input[name="query"] {
  min-height: 44px;
  border: 2px solid #d9d9e6;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 520;
  padding: 0 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.online-modal-card input[name="query"]::placeholder {
  color: #8a8fa3;
  font-weight: 600;
}

.online-modal-card input[name="query"]:focus {
  border-color: rgba(109, 40, 217, 0.58);
  box-shadow: 0 0 0 4px var(--main-panel-ring);
}

.online-modal-card input[name="query"].is-invalid {
  border-color: #fb7185;
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.14);
}

.online-modal-card .online-results {
  max-height: min(320px, 38vh);
  border-radius: 14px;
  padding-right: 4px;
}

.online-modal-card .online-results:empty {
  display: none;
}

.online-modal-card .online-results > .muted {
  margin: 0;
  border: 1px dashed #d9d9e6;
  border-radius: 12px;
  background: #fbfbfd;
  color: #64748b;
  font-size: 13px;
  font-weight: 580;
  line-height: 1.5;
  padding: 13px 14px;
}

.online-modal-card .online-card {
  gap: 8px;
  border: 1px solid #e4e4ef;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
}

.online-modal-card .online-card strong {
  color: #1f1b4d;
  font-size: 13.5px;
  font-weight: 760;
  line-height: 1.25;
}

.online-modal-card .online-card .muted {
  color: #64748b;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.35;
}

.online-modal-card .online-card-subject {
  color: #7c3aed;
  font-size: 11.5px;
  font-weight: 720;
  letter-spacing: 0.01em;
}

.online-modal-card .online-card-abstract {
  color: #4b5563;
  font-size: 12px;
  font-weight: 520;
  line-height: 1.45;
  margin: 0;
}

.online-modal-card footer {
  border-top: 1px solid #ececf4;
  margin: 0 -4px -4px;
  padding-top: 14px;
  justify-content: flex-end;
}

.online-actions {
  width: 100%;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.online-modal-card footer .ghost-button,
.online-modal-card footer .primary-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 760;
  padding: 9px 14px;
}

.online-modal-card footer [data-online-search]::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  background: currentColor;
  opacity: 0.96;
}

.online-modal-card footer [data-online-search="pubmed"]::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M4 4.5A2.5 2.5 0 0 1 6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M4 4.5A2.5 2.5 0 0 1 6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.online-modal-card footer [data-online-search="arxiv"]::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M4 17h16'/%3E%3Cpath d='M7 4l10 16'/%3E%3Cpath d='M17 4 7 20'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M4 17h16'/%3E%3Cpath d='M7 4l10 16'/%3E%3Cpath d='M17 4 7 20'/%3E%3C/svg%3E") center / contain no-repeat;
}

.online-modal-card footer [data-online-search="isbn"]::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 7v14'/%3E%3Cpath d='M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 7v14'/%3E%3Cpath d='M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.online-modal-card footer [data-online-search="crossref"]::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l2-2a5 5 0 0 0-7.07-7.07l-1.14 1.14'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-2 2a5 5 0 0 0 7.07 7.07l1.14-1.14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l2-2a5 5 0 0 0-7.07-7.07l-1.14 1.14'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-2 2a5 5 0 0 0 7.07 7.07l1.14-1.14'/%3E%3C/svg%3E") center / contain no-repeat;
}

.online-modal-card footer .ghost-button[data-online-search="pubmed"] {
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(24, 198, 215, 0.22);
}

.online-modal-card footer .ghost-button[data-online-search="pubmed"]:hover {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #ffffff;
}

.online-modal-card footer .ghost-button[data-online-search="arxiv"] {
  border: 0;
  background: linear-gradient(135deg, #b91c1c, #dc2626 52%, #ef4444);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.20);
}

.online-modal-card footer .ghost-button[data-online-search="arxiv"]:hover {
  background: linear-gradient(135deg, #991b1b, #b91c1c 52%, #dc2626);
  color: #ffffff;
}

.online-modal-card footer .ghost-button[data-online-search="isbn"] {
  border: 0;
  background: linear-gradient(135deg, #facc15, #f59e0b 52%, #ea580c);
  color: #431407;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.20);
}

.online-modal-card footer .ghost-button[data-online-search="isbn"]:hover {
  background: linear-gradient(135deg, #fbbf24, #d97706 52%, #c2410c);
  color: #431407;
}

.online-modal-card footer .primary-button {
  background: linear-gradient(135deg, #f59e0b, #f97316 46%, #ef4444 100%);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.24);
}

.online-modal-card footer .primary-button:hover {
  background: linear-gradient(135deg, #d97706, #ea580c 46%, #dc2626 100%);
  color: #ffffff;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: 360px;
  transform: translateY(20px);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel-md);
  background: var(--ink);
  color: white;
  opacity: 0;
  padding: 14px 16px;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Right panel: shadcn/Radix-inspired paper workspace polish */
.main-panel {
  font-family: var(--sidebar-font);
  border: 1px solid var(--main-panel-border);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 251, 253, 0.98)),
    var(--main-panel-bg);
  backdrop-filter: none;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 22px 54px rgba(51, 65, 85, 0.10);
}

.command-bar {
  padding: 14px 22px;
  border-bottom: 1px solid var(--main-panel-border);
  background: rgba(255, 255, 255, 0.92);
}

.topbar-add {
  min-width: 96px;
  height: 38px;
  min-height: 38px;
  border: 1px solid #20233a;
  border-radius: 12px;
  background: linear-gradient(180deg, #17172e, #101123);
  color: #ffffff;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: -0.02em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 2px rgba(15, 23, 42, 0.18);
}

.topbar-add:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #202042, #131426);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 18px rgba(15, 23, 42, 0.16);
}

.add-button span {
  width: 17px;
  height: 17px;
  border-radius: 6px;
  background: #00c970;
}

.top-search > input {
  height: 38px;
  min-height: 38px;
  border: 1px solid #d9d9e6;
  border-radius: 12px;
  background: #ffffff;
  color: var(--sidebar-ink);
  font-size: 14px;
  font-weight: 450;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
}

.top-search > input::placeholder {
  color: #8a8fa3;
}

.top-search > input:focus {
  border-color: rgba(109, 40, 217, 0.55);
  box-shadow: 0 0 0 4px var(--main-panel-ring);
}

.toolbar button,
.search-box button,
.sort-row button,
.sort-row select {
  height: 38px;
  min-height: 38px;
  border: 1px solid #d9d9e6;
  border-radius: 12px;
  background: #ffffff;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 1px rgba(15, 23, 42, 0.04);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.toolbar button:hover:not(:disabled),
.search-box button:hover:not(:disabled),
.sort-row button:hover:not(:disabled),
.sort-row select:hover {
  border-color: #c9c9d8;
  background: var(--surface-hover);
  color: #111827;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 4px 12px rgba(15, 23, 42, 0.06);
}

.toolbar button:active:not(:disabled),
.search-box button:active:not(:disabled),
.sort-row button:active:not(:disabled) {
  transform: translateY(1px);
}

.toolbar button:disabled,
.search-box button:disabled,
.sort-row button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  box-shadow: none;
}

.toolbar-icon {
  width: 38px;
  min-width: 38px;
}

.folder-picker-button {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  border: 1px solid #d9d9e6 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: #475569 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 1px rgba(15, 23, 42, 0.04) !important;
}

.folder-picker-button::after {
  content: none;
}

.folder-picker-button:hover,
.folder-picker-button:focus-visible,
.folder-picker-button.active {
  border-color: #c9c9d8 !important;
  background: var(--surface-hover) !important;
  color: #111827 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 4px 12px rgba(15, 23, 42, 0.06) !important;
}

.toolbar-symbol,
.select-symbol,
.sort-direction-symbol {
  color: currentColor;
}

.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sf-select {
  position: relative;
  min-width: 172px;
}

.sf-select[data-custom-select="type"] {
  min-width: 178px;
}

.sf-select-trigger {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  gap: 10px;
  align-items: center;
  border: 1px solid #d9d9e6;
  border-radius: 12px;
  background: #ffffff;
  color: #1f2937;
  font-size: 13px;
  font-weight: 680;
  line-height: 1;
  padding: 0 12px;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 1px 1px rgba(15, 23, 42, 0.04);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease;
}

.sf-select-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sf-select-trigger:hover,
.sf-select-trigger[aria-expanded="true"] {
  border-color: #c9c9d8;
  background: var(--surface-hover);
  color: #111827;
}

.sf-select-trigger:focus-visible {
  border-color: rgba(109, 40, 217, 0.58);
  box-shadow: 0 0 0 4px var(--main-panel-ring);
}

.sf-select-chevron {
  width: 15px;
  height: 15px;
  color: currentColor;
}

.sf-select-chevron::before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sf-select-content {
  position: absolute;
  z-index: 220;
  top: calc(100% + 7px);
  left: 0;
  width: max(100%, 210px);
  max-height: min(42vh, 292px);
  overflow: auto;
  border: 1px solid #d9d9e6;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 18px 46px rgba(15, 23, 42, 0.14),
    0 1px 2px rgba(15, 23, 42, 0.06);
  padding: 6px;
}

.sf-select-content::-webkit-scrollbar,
.search-popover::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.sf-select-content::-webkit-scrollbar-track,
.search-popover::-webkit-scrollbar-track {
  background: transparent;
}

.sf-select-content::-webkit-scrollbar-thumb,
.search-popover::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

.sf-select-content.hidden {
  display: none;
}

.sf-select-item {
  width: 100%;
  min-height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  gap: 8px;
  align-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #334155;
  font-size: 12.5px;
  font-weight: 620;
  padding: 7px 9px;
  text-align: left;
}

.sf-select-item:hover,
.sf-select-item.is-hovered {
  background: linear-gradient(90deg, rgba(242, 228, 255, 0.92), rgba(255, 255, 255, 0.98));
  color: #3b0764;
}

.sf-select-item.active {
  background: transparent;
  color: #334155;
  font-weight: 760;
}

.sf-select-item.active:hover,
.sf-select-item.active.is-hovered {
  background: linear-gradient(90deg, rgba(242, 228, 255, 0.92), rgba(255, 255, 255, 0.98));
  color: #3b0764;
}

.sf-select-item strong {
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

.sf-select-item.active strong {
  color: #64748b;
}

.sf-select-check {
  width: 16px;
  height: 16px;
  color: var(--sidebar-active-text);
  opacity: 0;
}

.sf-select-item.active .sf-select-check {
  opacity: 1;
}

.sf-select-check::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.floating-menu.add-menu,
.search-popover,
.bulk-folder-menu {
  border: 1px solid #d9d9e6;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  box-shadow:
    0 18px 48px rgba(15, 23, 42, 0.13),
    0 1px 2px rgba(15, 23, 42, 0.06);
}

.floating-menu.add-menu {
  width: min(560px, calc(100vw - 96px));
  overflow: hidden;
  padding: 6px;
}

.add-menu-item {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 60px;
  border: 0;
  border-radius: 11px;
  color: #334155;
  padding: 10px 12px;
}

.add-menu-item + .add-menu-item {
  margin-top: 2px;
}

.add-menu-item:hover,
.add-menu-item.featured:hover {
  background: #f8f1ff;
  color: #111827;
}

.add-menu-item.featured {
  background: linear-gradient(90deg, rgba(234, 220, 255, 0.54), rgba(255, 255, 255, 0.88));
}

.add-menu-copy strong {
  color: #111827;
  font-size: 13.5px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.add-menu-copy small {
  color: #64748b;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.35;
}

.add-menu-icon {
  width: 19px;
  height: 19px;
  color: #64748b;
}

.add-menu-icon::before {
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: currentColor !important;
  box-shadow: none !important;
  transform: none !important;
}

.add-menu-icon::after {
  content: none !important;
}

.add-menu-icon.upload::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m17 8-5-5-5 5'/%3E%3Cpath d='M12 3v12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m17 8-5-5-5 5'/%3E%3Cpath d='M12 3v12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.add-menu-icon.paste::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='14' height='14' x='8' y='8' rx='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='14' height='14' x='8' y='8' rx='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.add-menu-icon.manual::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3Cpath d='M12 18v-6'/%3E%3Cpath d='M9 15h6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3Cpath d='M12 18v-6'/%3E%3Cpath d='M9 15h6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.add-menu-icon.search::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.add-menu-icon.share::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='m8.6 13.5 6.8 4'/%3E%3Cpath d='m15.4 6.5-6.8 4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='m8.6 13.5 6.8 4'/%3E%3Cpath d='m15.4 6.5-6.8 4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.add-menu-item:hover .add-menu-icon {
  color: var(--sidebar-active-text);
}

.add-menu-item kbd,
.search-help-row kbd {
  min-width: 34px;
  border: 1px solid #e4e4e7;
  border-radius: 9px;
  background: #fafafa;
  color: #64748b;
  font-size: 11px;
  font-weight: 680;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.03);
}

.search-popover {
  z-index: 210;
  left: 116px;
  width: min(620px, calc(100vw - 360px));
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: 6px;
}

.search-help-row {
  min-height: 46px;
  grid-template-columns: 22px auto minmax(0, 1fr) auto;
  border: 0;
  border-radius: 10px;
  color: #334155;
  padding: 8px 12px;
}

.search-help-row + .search-help-row {
  margin-top: 2px;
}

.search-help-row:hover {
  background: #f8f1ff;
}

.search-help-row strong {
  color: #111827;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.search-help-row span:not(.search-option-icon) {
  color: #64748b;
  font-size: 12px;
  font-weight: 560;
}

.search-option-icon {
  width: 18px;
  height: 18px;
  color: #64748b;
}

.search-option-icon::before {
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: currentColor !important;
  box-shadow: none !important;
  transform: none !important;
}

.search-option-icon::after {
  content: none !important;
}

.lookup-icon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.online-icon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 0 20'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 0 0 20'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 0 20'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 0 0 20'/%3E%3C/svg%3E") center / contain no-repeat;
}

.quote-icon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 21c3 0 7-1 7-8V5c0-1.25-.75-2-2-2H5c-1.25 0-2 .75-2 2v6c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-3 2'/%3E%3Cpath d='M14 21c3 0 7-1 7-8V5c0-1.25-.75-2-2-2h-3c-1.25 0-2 .75-2 2v6c0 1.25.75 2 2 2h.75c0 2.25-.25 4-2.75 4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 21c3 0 7-1 7-8V5c0-1.25-.75-2-2-2H5c-1.25 0-2 .75-2 2v6c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-3 2'/%3E%3Cpath d='M14 21c3 0 7-1 7-8V5c0-1.25-.75-2-2-2h-3c-1.25 0-2 .75-2 2v6c0 1.25.75 2 2 2h.75c0 2.25-.25 4-2.75 4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.exclude-icon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m4.9 4.9 14.2 14.2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m4.9 4.9 14.2 14.2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.document-icon::before,
.notes-icon::before,
.pdf-icon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.notes-icon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4h16v16H4z'/%3E%3Cpath d='M8 8h8'/%3E%3Cpath d='M8 12h8'/%3E%3Cpath d='M8 16h5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4h16v16H4z'/%3E%3Cpath d='M8 8h8'/%3E%3Cpath d='M8 12h8'/%3E%3Cpath d='M8 16h5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.search-help-row:hover .search-option-icon {
  color: var(--sidebar-active-text);
}

.search-help-section {
  gap: 8px;
  border: 0;
  border-top: 1px solid #ececf3;
  padding: 12px;
}

.search-help-section > span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.02em;
}

.search-help-section button {
  border: 1px solid #dbe3f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 680;
  padding: 6px 9px;
}

.search-help-section button:hover {
  border-color: #d8c7ff;
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
}

.include-section label {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  color: #334155;
  font-size: 12.5px;
  font-weight: 650;
}

.include-section input {
  width: 18px;
  height: 18px;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid #94a3b8;
  border-radius: 5px;
  background: #ffffff;
  accent-color: var(--sidebar-active-text);
}

.include-section input:checked {
  border-color: var(--sidebar-active-text);
  background: var(--sidebar-active-text);
}

.include-section input:checked::before,
.card-select-stack > input[type="checkbox"]:checked::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: #ffffff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center / 13px 13px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center / 13px 13px no-repeat;
}

.bulk-folder-menu {
  z-index: 210;
  width: min(280px, calc(100vw - 80px));
  padding: 8px 18px 8px 8px;
}

.bulk-folder-row {
  min-height: 36px;
  border-radius: 11px;
  color: #334155;
  font-size: 13px;
  font-weight: 620;
}

.bulk-folder-row:hover {
  background: #f8f1ff;
  color: var(--sidebar-active-text);
}

.bulk-folder-check {
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
}

.bulk-folder-row.checked .bulk-folder-check {
  border-color: var(--sidebar-active-text);
  background: var(--sidebar-active-text);
}

.bulk-folder-row.mixed .bulk-folder-check {
  border-color: var(--sidebar-active-text);
}

.bulk-folder-empty {
  color: #64748b;
  font-size: 12.5px;
  font-weight: 620;
}

.list-header {
  padding: 14px 22px 12px;
  background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.86));
}

.list-header h1 {
  color: var(--sidebar-ink);
  font-size: 15.5px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.list-header span,
.sort-row {
  color: var(--sidebar-muted);
  font-size: 13px;
  font-weight: 650;
}

.content-grid {
  padding: 0 22px 20px;
}

.reference-list {
  border: 1px solid var(--main-panel-border);
  border-radius: 18px;
  background: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 1px 2px rgba(15, 23, 42, 0.04);
}

.reference-card {
  position: relative;
  gap: 12px;
  border-bottom: 1px solid #e8e8f0;
  background: #ffffff;
  padding: 16px 18px;
  transition:
    background 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.reference-card::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background 140ms ease, opacity 140ms ease;
}

.reference-card:hover {
  background:
    linear-gradient(90deg, rgba(231, 205, 255, 0.94), rgba(246, 238, 255, 0.88) 36%, rgba(255, 255, 255, 0.97) 68%),
    #ffffff;
}

.reference-card:hover::before,
.reference-card.selected::before {
  background: var(--sidebar-active-text);
}

.reference-card.selected {
  background:
    linear-gradient(90deg, rgba(239, 228, 255, 0.92), rgba(255, 255, 255, 0.96) 52%),
    #ffffff;
  box-shadow: inset 0 0 0 1px rgba(109, 40, 217, 0.10);
}

.reference-card.trashed {
  opacity: 0.68;
  background: #fafafa;
}

.card-select-stack {
  width: 28px;
  gap: 10px;
  padding-top: 2px;
}

.card-select-stack > input[type="checkbox"] {
  width: 15px;
  height: 15px;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid #94a3b8;
  border-radius: 4px;
  background: #ffffff;
  accent-color: var(--sidebar-active-text);
}

.card-select-stack > input[type="checkbox"]:checked {
  border-color: var(--sidebar-active-text);
  background: var(--sidebar-active-text);
}

.reference-drag-handle {
  color: #c7cad6;
  transition: color 140ms ease, transform 140ms ease;
}

.reference-drag-handle:hover {
  color: #94a3b8;
  transform: translateY(-1px);
}

.reference-title {
  color: var(--paper-title);
  font-size: 15.5px;
  font-weight: 760;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.meta,
.links,
.abstract-preview {
  color: #64748b;
  font-size: 13.5px;
  line-height: 1.38;
}

.source {
  color: #059669;
  font-weight: 730;
}

.links {
  gap: 8px;
  margin-top: 5px;
}

.links a,
.links button {
  color: #4f00e8;
  font-size: 13.5px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.links a:hover,
.links button:hover {
  color: #3800a8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pill-row {
  gap: 7px;
  margin-top: 9px;
}

.pill-row .reference-chip {
  max-width: min(100%, 188px);
  min-height: 28px;
  gap: 6px;
  border: 1px solid #d9d9e6;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 11.5px;
  font-weight: 660;
  padding: 4px 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.pill-row .reference-chip-folder {
  background: linear-gradient(180deg, #fffdf2, #fff8db);
  border-color: #f3de8a;
}

.pill-row .reference-chip-label {
  background: linear-gradient(180deg, #fff5f8, #fff0f5);
  border-color: #ffd1df;
}

.folder-chip-remove {
  color: #64748b;
}

.folder-chip-remove:hover,
.folder-chip-remove:focus-visible {
  background: rgba(244, 63, 94, 0.10);
  color: #e11d48;
}

.star {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  color: #c4c8d4;
  font-size: 0;
  transition: color 140ms ease, transform 140ms ease;
}

.star::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 2 3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 2 3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.star:hover {
  color: #f59e0b;
  transform: scale(1.08);
}

.star.active {
  color: #f59e0b;
}

.card-select-stack .star,
.title-row .star {
  display: none;
}

.card-actions {
  gap: 8px;
}

.card-actions .ghost-button {
  min-height: 34px;
  border: 1px solid #d9d9e6;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  font-size: 12.5px;
  font-weight: 680;
  padding: 7px 12px;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.card-actions .ghost-button:hover {
  border-color: #c9c9d8;
  background: var(--surface-hover);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.sort-row .sf-select-content {
  width: max(100%, 198px);
  max-height: min(42vh, 292px);
  padding: 6px;
  border-radius: 14px;
}

.sort-row .sf-select-item {
  min-height: 32px;
  border: 0 !important;
  border-radius: 9px !important;
  background: transparent;
  box-shadow: none !important;
  color: #334155;
  font-size: 12.5px;
  font-weight: 620;
  padding: 7px 9px !important;
}

.sort-row .sf-select-item + .sf-select-item {
  margin-top: 2px;
}

.sort-row .sf-select-item:hover,
.sort-row .sf-select-item.is-hovered {
  background: linear-gradient(90deg, rgba(242, 228, 255, 0.92), rgba(255, 255, 255, 0.98));
  color: #3b0764;
}

.sort-row .sf-select-item.active {
  background: transparent;
  color: #334155;
  font-weight: 740;
}

.sort-row .sf-select-item.active:hover,
.sort-row .sf-select-item.active.is-hovered {
  background: linear-gradient(90deg, rgba(242, 228, 255, 0.92), rgba(255, 255, 255, 0.98));
  color: #3b0764;
}

.reference-card {
  gap: 10px;
  padding: 10px 14px;
}

.reference-card::before {
  inset: 9px auto 9px 0;
  width: 3px;
}

.card-select-stack {
  width: 22px;
  gap: 8px;
  padding-top: 2px;
}

.card-select-stack > input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  padding: 0 !important;
  border: 1.5px solid #94a3b8;
  border-radius: 5px;
  background: #ffffff;
  box-shadow: none;
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.card-select-stack > input[type="checkbox"]:checked {
  border-color: var(--sidebar-active-text);
  background: var(--sidebar-active-text);
}

.card-select-stack > input[type="checkbox"]:checked::before {
  background: #ffffff;
  -webkit-mask-size: 13px 13px;
  mask-size: 13px 13px;
}

.card-select-stack > input[type="checkbox"]:hover,
.card-select-stack > input[type="checkbox"]:focus-visible {
  border-color: #7c8fb8;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
  outline: none;
}

.pill-row .reference-chip-folder::before {
  border-radius: 0;
  background: linear-gradient(180deg, #facc15 0%, #eab308 100%);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z'/%3E%3C/svg%3E");
  -webkit-mask-size: 15px 15px;
  mask-size: 15px 15px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.select-symbol::before {
  inset: 0;
  border: 1.5px solid #94a3b8;
  border-radius: 5px;
  border-color: #94a3b8;
  background: #ffffff;
}

.toolbar-icon.active .select-symbol::before {
  background: var(--sidebar-active-text);
  border-color: var(--sidebar-active-text);
}

.toolbar-icon.active .select-symbol::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border: 0;
  transform: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center / 13px 13px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center / 13px 13px no-repeat;
}

.reference-title {
  font-size: 14px;
  font-weight: 720;
  line-height: 1.18;
}

.meta,
.links,
.abstract-preview {
  font-size: 12.5px;
  line-height: 1.28;
}

.source {
  font-weight: 700;
}

.links {
  gap: 6px;
  margin-top: 3px;
}

.links a,
.links button {
  font-size: 12.5px;
  font-weight: 690;
}

.pill-row {
  gap: 5px;
  margin-top: 6px;
}

.pill-row .reference-chip {
  min-height: 24px;
  max-width: min(100%, 158px);
  font-size: 10.8px;
  font-weight: 650;
  padding: 3px 8px;
}

.pill-row .reference-chip::before {
  flex-basis: 13px;
  width: 13px;
  height: 13px;
}

.folder-chip-remove {
  flex-basis: 13px;
  width: 13px;
  height: 13px;
}

.card-actions .ghost-button {
  min-height: 30px;
  border-radius: 10px;
  font-size: 11.8px;
  font-weight: 650;
  padding: 5px 10px;
}

.card-action-star {
  width: 15px;
  min-width: 15px;
  min-height: 15px;
}

.reference-drag-handle {
  width: 20px;
  height: 16px;
}

.card-action-star {
  width: 15px;
  min-width: 15px;
  min-height: 15px;
}

.empty-state {
  color: #64748b;
}

.empty-state h2 {
  color: #111827;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.reference-scrollbar {
  right: 27px;
  top: 18px;
  bottom: 36px;
  width: 5px;
}

.reference-scrollbar-thumb {
  left: 0;
  width: 5px;
  background: #cbd5e1;
}

.reference-scrollbar-thumb:hover {
  background: #94a3b8;
}

.sort-row .sf-select-content .sf-select-item:hover,
.sort-row .sf-select-content .sf-select-item.is-hovered,
.sort-row .sf-select-content .sf-select-item.active:hover,
.sort-row .sf-select-content .sf-select-item.active.is-hovered {
  background:
    linear-gradient(90deg, rgba(231, 205, 255, 0.96), rgba(246, 238, 255, 0.9) 52%, rgba(255, 255, 255, 0.98) 100%) !important;
  color: #4c1d95 !important;
}

.sort-row .sf-select-content .sf-select-item:hover strong,
.sort-row .sf-select-content .sf-select-item.is-hovered strong {
  color: #4c1d95 !important;
}

.top-search > input,
.toolbar button,
.search-box button,
.sort-row button,
.sf-select-trigger {
  border-width: 2px;
}

.command-bar {
  display: flex;
  column-gap: 10px;
  row-gap: 10px;
  align-items: center;
}

.command-cluster {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  column-gap: 10px;
  align-items: center;
}

.topbar-add {
  flex: 0 0 auto;
}

.top-search {
  flex: 1 1 320px;
  min-width: 240px;
  display: flex;
  gap: 10px;
}

.top-search > input {
  flex: 1 1 auto;
  min-width: 0;
}

.toolbar {
  flex: 0 0 auto;
  gap: 8px;
  margin-left: 0;
}

.bulk-folder-control {
  display: flex;
  flex: 0 0 auto;
  width: 42px;
  min-width: 42px;
  margin: 0;
  justify-content: center;
  position: relative;
}

.toolbar-icon,
.folder-picker-button {
  flex: 0 0 40px;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
}

.toolbar > button:not(.toolbar-icon) {
  min-width: 0;
  padding-inline: 14px;
}

.toolbar > button[data-action="auto-fetch"] {
  padding-inline: 16px;
}

.toolbar > button[data-action="open-export"] {
  padding-inline: 18px;
}

.folder-picker-button {
  border-width: 2px !important;
}

.folder-picker-button::after {
  border-width: 2px;
}

.top-search > input:focus,
.sf-select-trigger:focus-visible {
  border-width: 2px;
}

.sort-row .sf-select-content {
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding: 8px 14px 8px 8px;
  background: #ffffff;
  background-clip: padding-box;
}

.sort-row .sf-select-content::-webkit-scrollbar {
  width: 8px;
}

.sort-row .sf-select-content::-webkit-scrollbar-track {
  margin-block: 10px;
  border-radius: 999px;
  background: transparent;
}

.sort-row .sf-select-content::-webkit-scrollbar-thumb {
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #cbd5e1;
}

.sf-select[data-custom-select="sort"] .sf-select-content {
  width: max(100%, 220px);
}

.sf-select[data-custom-select="sort"] .sf-select-item {
  grid-template-columns: minmax(0, 1fr) 18px;
}

.sf-select[data-custom-select="type"] .sf-select-content {
  width: max(100%, 264px);
}

.sf-select[data-custom-select="type"] .sf-select-item {
  grid-template-columns: minmax(0, 1fr) 52px 18px;
  column-gap: 10px;
}

.sf-select-item > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sf-select-item strong {
  min-width: 0;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .library-app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    max-height: none;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    order: -1;
  }
}

@media (max-width: 760px) {
  .auth-page {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.9fr) auto;
    gap: 12px;
    padding: 12px;
  }

  .auth-art {
    min-height: 0;
  }

  .glass-card {
    padding: 58px 20px 20px;
    border-radius: 16px;
  }

  .glass-card::before {
    inset: 10px;
    border-radius: 12px;
  }

  .auth-brandline {
    top: 20px;
    left: 20px;
    font-size: 15px;
  }

  .glass-card h1 {
    max-width: 440px;
    margin: 12px 0 10px;
    font-size: 34px;
    line-height: 0.98;
  }

  .glass-card p {
    font-size: 13px;
    line-height: 1.42;
  }

  .auth-proof-grid {
    display: none;
  }

  .auth-card {
    align-self: stretch;
    gap: 9px;
    max-height: none;
    padding: 18px;
    border-radius: 16px;
  }

  .auth-card h2 {
    font-size: 28px;
  }

  .auth-card .muted {
    font-size: 13px;
    line-height: 1.35;
  }


  .library-app {
    padding: 10px;
  }

  .topbar,
  .list-header {
    display: grid;
    gap: 12px;
  }

  .toolbar {
    justify-content: start;
  }

  .reference-card {
    grid-template-columns: auto 1fr;
  }

  .card-actions {
    grid-column: 2;
    justify-self: end;
    align-self: start;
    margin-top: 6px;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-modal {
    width: calc(100vw - 24px);
    min-width: 0;
  }

  .editor-header,
  .editor-footer {
    padding: 18px;
  }

  .editor-grid {
    padding: 18px;
  }

  .editor-section .field-sm,
  .editor-section .field-md,
  .editor-section .field-lg,
  .editor-section .field-xl {
    grid-column: 1 / -1;
  }
}

/* LumaCite cloud shell refresh, 2026-06-04. */
:root {
  --bg: #f8f5f3;
  --panel: rgba(255, 255, 255, 0.9);
  --sidebar-panel: rgba(255, 255, 255, 0.88);
  --sidebar-border: rgba(44, 47, 61, 0.1);
  --sidebar-accent: rgba(255, 245, 241, 0.78);
  --sidebar-accent-strong: #fff1ed;
  --sidebar-active: #fff0ed;
  --sidebar-active-text: #e43e35;
  --sidebar-ring: rgba(255, 90, 79, 0.17);
  --sidebar-muted: #626978;
  --sidebar-ink: #242733;
  --surface-border: rgba(44, 47, 61, 0.1);
  --surface-hover: #fff8f6;
  --surface-selected: #fff1ed;
  --surface-muted: #626978;
  --surface-ink: #242733;
  --main-panel-bg: rgba(255, 255, 255, 0.9);
  --main-panel-soft: #fbfcff;
  --main-panel-border: rgba(44, 47, 61, 0.1);
  --main-panel-hover: #fff8f6;
  --main-panel-selected: #fff1ed;
  --main-panel-ring: rgba(255, 90, 79, 0.18);
  --paper-title: #242733;
  --panel-solid: #ffffff;
  --ink: #242733;
  --muted: #626978;
  --line: rgba(44, 47, 61, 0.13);
  --toolbar-line: rgba(44, 47, 61, 0.13);
  --blue: #588de8;
  --blue-dark: #315fbd;
  --cyan: #4aa7a4;
  --green: #78c268;
  --orange: #f2a93b;
  --red: #e43e35;
  --violet: #a75fb2;
  --brand: #ff5a4f;
  --brand-dark: #e43e35;
  --shadow: 0 24px 70px rgba(44, 47, 61, 0.12);
  --font: "Inter", "Segoe UI Variable Text", "Aptos", "Segoe UI", system-ui, sans-serif;
  --sidebar-font: var(--font);
  --radius-panel-xl: 18px;
  --radius-panel-lg: 16px;
  --radius-panel-md: 12px;
  --radius-control-lg: 8px;
  --radius-control-md: 8px;
  --radius-control-sm: 6px;
}

body {
  background:
    linear-gradient(120deg, rgba(255, 90, 79, 0.13), transparent 34%),
    linear-gradient(245deg, rgba(88, 141, 232, 0.13), transparent 40%),
    linear-gradient(180deg, #fff9f4 0%, #f7fbff 44%, #ffffff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(44, 47, 61, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 47, 61, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 72%);
  pointer-events: none;
}

.library-app {
  gap: 16px;
  padding: 20px;
}

.sidebar,
.main-panel {
  border: 1px solid rgba(44, 47, 61, 0.1);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(22px);
  box-shadow:
    0 28px 70px rgba(44, 47, 61, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.sidebar {
  border-radius: 18px;
  padding: 12px;
}

.main-panel {
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86)),
    var(--main-panel-bg);
}

.brand-row {
  min-height: 82px;
  border: 1px solid rgba(255, 90, 79, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 90, 79, 0.16), transparent 38%),
    linear-gradient(90deg, #ffffff 0%, #fff8f6 50%, #f7fbff 100%);
  box-shadow:
    0 14px 32px rgba(255, 90, 79, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.brand-row strong {
  color: #242733;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  font-size: 18px;
  font-weight: 900;
  text-shadow: none;
}

.brand-row strong::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 999px;
  background: #78c268;
  box-shadow: 0 0 0 4px rgba(120, 194, 104, 0.16);
  vertical-align: middle;
}

.brand-email {
  color: #626978 !important;
  font-weight: 700;
}

.brand-row [data-sync-status] {
  border-color: rgba(255, 90, 79, 0.18);
  background: rgba(255, 90, 79, 0.09);
  color: #e43e35;
  font-weight: 850;
}

.nav-section p,
.section-heading p,
.section-toggle {
  letter-spacing: 0.06em;
}

.nav-item,
.folder-row,
.chip,
.signout {
  border-radius: 8px;
}

.nav-item {
  min-height: 40px;
  border: 1px solid transparent;
  color: #343746;
  font-weight: 780;
}

.nav-item:hover,
.folder-row:hover {
  border-color: rgba(255, 90, 79, 0.14);
  background: #fff8f6;
  color: #242733;
}

.nav-item.active,
.folder-row.active,
.label-row.active {
  border-color: rgba(255, 90, 79, 0.22);
  background:
    linear-gradient(90deg, rgba(255, 90, 79, 0.13), rgba(255, 255, 255, 0.82));
  color: #e43e35;
  box-shadow: inset 3px 0 0 #ff5a4f;
}

.signout {
  border-color: rgba(228, 62, 53, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: #b9342d;
}

.command-bar {
  border-bottom: 1px solid rgba(44, 47, 61, 0.09);
  background:
    linear-gradient(135deg, rgba(255, 90, 79, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.8);
  padding: 16px 18px 14px;
}

.topbar-add {
  min-width: 96px;
  height: 42px;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff5a4f, #ff8b63);
  box-shadow: 0 14px 28px rgba(255, 90, 79, 0.22);
}

.add-button span {
  background: rgba(255, 255, 255, 0.22);
}

.top-search {
  min-width: 280px;
}

.top-search > input,
.toolbar button,
.search-box button,
.sort-row button,
.sf-select-trigger {
  height: 42px;
  min-height: 42px;
  border: 1px solid rgba(44, 47, 61, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow:
    0 8px 22px rgba(44, 47, 61, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.top-search > input {
  color: #242733;
  padding-inline: 16px;
}

.top-search > input::placeholder {
  color: #8b91a0;
}

.toolbar button,
.search-box button,
.sort-row button,
.sf-select-trigger {
  color: #343746;
  font-weight: 850;
}

.toolbar button:hover:not(:disabled),
.search-box button:hover:not(:disabled),
.sort-row button:hover,
.sf-select-trigger:hover {
  border-color: rgba(255, 90, 79, 0.24);
  background: #ffffff;
  box-shadow:
    0 14px 28px rgba(44, 47, 61, 0.09),
    0 0 0 4px rgba(255, 90, 79, 0.08);
  transform: translateY(-1px);
}

.toolbar-icon,
.folder-picker-button {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
}

.list-header {
  padding: 16px 20px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.46));
}

.list-header h1 {
  color: #242733;
  font-size: 18px;
  font-weight: 900;
}

.list-header span,
.sort-row {
  color: #626978;
}

.sort-row {
  gap: 10px;
}

.sort-row > span:last-child {
  border: 1px solid rgba(44, 47, 61, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
}

.content-grid {
  padding: 0 20px 20px;
}

.reference-list {
  border: 1px solid rgba(44, 47, 61, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 252, 255, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 16px 36px rgba(44, 47, 61, 0.07);
}

.reference-card {
  border-bottom: 1px solid rgba(44, 47, 61, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

.reference-card:hover {
  background:
    linear-gradient(90deg, rgba(255, 240, 237, 0.96), rgba(255, 255, 255, 0.98) 62%),
    #ffffff;
}

.reference-card:hover::before,
.reference-card.selected::before {
  background: #ff5a4f;
}

.reference-card.selected {
  background:
    linear-gradient(90deg, rgba(255, 241, 237, 0.96), rgba(247, 251, 255, 0.96));
  box-shadow: inset 0 0 0 1px rgba(255, 90, 79, 0.14);
}

.reference-title {
  color: #242733;
  font-weight: 850;
}

.source,
.links a,
.links button {
  color: #e43e35;
}

.pill-row .reference-chip {
  border-color: rgba(44, 47, 61, 0.1);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(44, 47, 61, 0.05);
}

.pill-row .reference-chip-folder {
  background: #fff8de;
}

.pill-row .reference-chip-label {
  background: #fff0ed;
}

.empty-state {
  min-height: 430px;
  padding: 48px 24px;
  background:
    linear-gradient(135deg, rgba(255, 90, 79, 0.08), transparent 36%),
    linear-gradient(245deg, rgba(88, 141, 232, 0.1), transparent 40%);
}

.empty-state > div {
  display: grid;
  justify-items: center;
  max-width: 560px;
}

.empty-state > div::before {
  content: "LC";
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff5a4f, #ff8b63);
  color: #ffffff;
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 18px 34px rgba(255, 90, 79, 0.26);
}

.empty-state h2 {
  margin: 0;
  color: #242733;
  font-size: 24px;
  font-weight: 950;
}

.empty-state p {
  max-width: 500px;
  margin: 10px 0 0;
  color: #626978;
  font-size: 14px;
  line-height: 1.6;
}

.floating-menu,
.search-popover,
.bulk-folder-menu,
.sf-select-content,
.account-menu {
  border: 1px solid rgba(44, 47, 61, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 58px rgba(44, 47, 61, 0.15);
}

.add-menu-item:hover,
.add-menu-item.featured {
  background: #fff3ef;
}

.modal-card {
  border-color: rgba(44, 47, 61, 0.1);
  background: rgba(255, 255, 255, 0.96);
}

@media (max-width: 1100px) {
  .library-app {
    gap: 12px;
    padding: 14px;
  }

  .sidebar {
    border-radius: 14px;
  }

  .main-panel {
    border-radius: 16px;
  }
}

@media (max-width: 760px) {
  .library-app {
    padding: 10px;
  }

  .command-bar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }

  .command-cluster {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }

  .topbar-add {
    width: fit-content;
  }

  .top-search {
    width: 100%;
    flex-basis: auto;
    min-width: 0;
  }

  .toolbar {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow: visible;
    padding-bottom: 4px;
  }

  .toolbar button,
  .bulk-folder-control {
    flex: 0 0 auto;
  }

  .list-header {
    align-items: stretch;
  }

  .list-header > div:first-child,
  .sort-row {
    flex-wrap: wrap;
  }

  .content-grid {
    padding: 0 12px 14px;
  }
}

/* Stronger cloud-facing library shell. */
body {
  background:
    linear-gradient(135deg, rgba(255, 90, 79, 0.2), transparent 30%),
    linear-gradient(245deg, rgba(120, 194, 104, 0.12), transparent 34%),
    linear-gradient(180deg, #fff9f4 0%, #f7fbff 42%, #ffffff 100%);
}

.library-app {
  gap: 18px;
  padding: 22px;
}

.sidebar {
  border: 1px solid rgba(44, 47, 61, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 249, 244, 0.86)),
    #ffffff;
  box-shadow:
    0 28px 72px rgba(44, 47, 61, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.brand-row {
  min-height: 96px;
  border: 0;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 90, 79, 0.98), rgba(255, 139, 99, 0.9) 48%, rgba(36, 39, 51, 0.92)),
    #ff5a4f;
  color: #ffffff;
  box-shadow:
    0 22px 42px rgba(255, 90, 79, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-row strong,
.brand-email,
.brand-row span {
  color: #ffffff !important;
}

.brand-row [data-sync-status] {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.17);
  color: #ffffff;
}

.account-menu-toggle {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.nav-section p,
.section-toggle span:last-child {
  color: #6a7280;
}

.nav-item.active,
.folder-row.active,
.label-row.active {
  background:
    linear-gradient(90deg, rgba(255, 90, 79, 0.18), rgba(255, 255, 255, 0.82));
  box-shadow:
    inset 4px 0 0 #ff5a4f,
    0 10px 24px rgba(255, 90, 79, 0.09);
}

.main-panel {
  border: 1px solid rgba(44, 47, 61, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.command-bar {
  margin: 16px 16px 0;
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #242733 0%, #343746 58%, #1f3a49 100%);
  box-shadow:
    0 24px 54px rgba(44, 47, 61, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 16px;
}

.command-bar .top-search > input,
.command-bar .toolbar button,
.command-bar .search-box button,
.command-bar .folder-picker-button {
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.94) !important;
}

.command-bar .toolbar > button:not(.toolbar-icon) {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff;
}

.command-bar .toolbar > button:not(.toolbar-icon):disabled {
  color: rgba(255, 255, 255, 0.48);
}

.topbar-add {
  background: linear-gradient(135deg, #ff5a4f, #ff8b63);
  box-shadow: 0 18px 34px rgba(255, 90, 79, 0.34);
}

.list-header {
  padding: 20px 24px 14px;
}

.list-header h1 {
  font-size: 21px;
}

.content-grid {
  padding: 0 24px 24px;
}

.reference-list {
  border: 1px solid rgba(44, 47, 61, 0.09);
  border-radius: 20px;
  overflow: hidden;
}

.empty-state {
  min-height: 520px;
  background:
    linear-gradient(135deg, rgba(255, 90, 79, 0.14), transparent 34%),
    linear-gradient(245deg, rgba(88, 141, 232, 0.13), transparent 42%),
    linear-gradient(180deg, #fffaf8 0%, #f7fbff 100%);
}

.empty-state > div {
  max-width: 620px;
}

.empty-state > div::before {
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #ff5a4f, #ff8b63 52%, #242733);
  box-shadow: 0 24px 48px rgba(255, 90, 79, 0.32);
}

.empty-state h2 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
  letter-spacing: 0;
}

.empty-state p {
  margin-top: 14px;
  font-size: 16px;
}

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

.empty-actions .primary-button,
.empty-actions .ghost-button {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 18px;
}

.empty-actions .primary-button {
  background: linear-gradient(135deg, #ff5a4f, #ff8b63);
  box-shadow: 0 16px 32px rgba(255, 90, 79, 0.24);
}

.empty-actions .ghost-button {
  border: 1px solid rgba(44, 47, 61, 0.1);
  background: rgba(255, 255, 255, 0.86);
  color: #242733;
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .library-app {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 10px;
  }

  .sidebar,
  .main-panel {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
    max-width: calc(100vw - 20px);
  }

  .brand-row {
    min-height: 86px;
  }

  .command-bar {
    margin: 12px 12px 0;
    border-radius: 16px;
    width: calc(100% - 24px);
    max-width: none;
    box-sizing: border-box;
  }

  .command-cluster,
  .toolbar {
    min-width: 0;
    max-width: 100%;
  }

  .top-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
  }

  .top-search .toolbar-icon {
    display: none;
  }

  .top-search > input {
    min-width: 0;
  }

  .content-grid {
    padding: 0 12px 14px;
  }

  .empty-state {
    min-height: 430px;
    padding: 38px 18px;
  }
}

.beta-access-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 90, 79, 0.18), transparent 34%),
    rgba(20, 22, 30, 0.62);
  backdrop-filter: blur(14px);
  padding: 22px;
}

.beta-access-card {
  position: relative;
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 90, 79, 0.16), transparent 38%),
    linear-gradient(160deg, #242733 0%, #343746 56%, #1f3a49 100%);
  color: #ffffff;
  box-shadow:
    0 34px 90px rgba(20, 22, 30, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  padding: clamp(26px, 5vw, 42px);
}

.beta-access-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -58px;
  top: -58px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 42px;
  transform: rotate(18deg);
}

.beta-access-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0;
}

.beta-access-close::before,
.beta-access-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.beta-access-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.beta-access-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.beta-access-mark {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff5a4f, #ff8b63);
  color: #ffffff;
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 18px 36px rgba(255, 90, 79, 0.32);
}

.beta-access-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-top: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 11px;
}

.beta-access-card h2,
.beta-access-card p,
.beta-access-actions,
.beta-access-foot {
  position: relative;
  z-index: 1;
}

.beta-access-card h2 {
  margin: 18px 0 0;
  color: #ffffff;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.beta-access-card p {
  max-width: 470px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 16px;
  line-height: 1.58;
}

.beta-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.beta-access-actions .primary-button,
.beta-access-actions .ghost-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  text-decoration: none;
}

.beta-access-actions .primary-button {
  background: linear-gradient(135deg, #ff5a4f, #ff8b63);
  box-shadow: 0 16px 32px rgba(255, 90, 79, 0.28);
}

.beta-access-actions .ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.beta-access-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.beta-access-foot span {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}
