:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --sidebar-bg: #f8f9fa;
  --ink: #202124;
  --ink-muted: #5f6368;
  --accent: #1a0dab;
  --green: #188038;
  --border: #ebebeb;
  --shadow: none;
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --purple: #6b21a8;
  --sidebar-w: 220px;
  --active-nav-bg: #eff6ff;
  --quick-notes-bg: var(--surface);
  --ai-banner-bg: linear-gradient(135deg, #f5f3ff, #ede9fe);
  --ai-banner-border: #ddd6fe;
  --bottom-dock-bg: rgba(255, 255, 255, 0.96);
  --input-focus-bg: white;
  --drawer-bg: rgba(255, 255, 255, 0.85);
  --drawer-header-bg: rgba(255, 255, 255, 0.45);
}

[data-theme="light"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --sidebar-bg: #f8f9fa;
  --ink: #202124;
  --ink-muted: #5f6368;
  --accent: #1a0dab;
  --green: #188038;
  --border: #ebebeb;
  --shadow: none;
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --purple: #6b21a8;
  --active-nav-bg: #eff6ff;
  --quick-notes-bg: var(--surface);
  --ai-banner-bg: linear-gradient(135deg, #f5f3ff, #ede9fe);
  --ai-banner-border: #ddd6fe;
  --bottom-dock-bg: rgba(255, 255, 255, 0.96);
  --input-focus-bg: white;
  --drawer-bg: rgba(255, 255, 255, 0.85);
  --drawer-header-bg: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --sidebar-bg: #0f172a;
  --ink: #f8fafc;
  --ink-muted: #94a3b8;
  --accent: #3b82f6;
  --green: #22c55e;
  --border: #334155;
  --shadow: none;
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --purple: #a855f7;
  --active-nav-bg: #1e293b;
  --quick-notes-bg: #0f172a;
  --ai-banner-bg: linear-gradient(135deg, #3b0764, #1e1b4b);
  --ai-banner-border: #581c87;
  --bottom-dock-bg: rgba(30, 41, 59, 0.96);
  --input-focus-bg: #0f172a;
  --drawer-bg: rgba(15, 23, 42, 0.85);
  --drawer-header-bg: rgba(15, 23, 42, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f172a;
    --surface: #1e293b;
    --sidebar-bg: #0f172a;
    --ink: #f8fafc;
    --ink-muted: #94a3b8;
    --accent: #3b82f6;
    --green: #22c55e;
    --border: #334155;
    --shadow: none;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --purple: #a855f7;
    --active-nav-bg: #1e293b;
    --quick-notes-bg: #0f172a;
    --ai-banner-bg: linear-gradient(135deg, #3b0764, #1e1b4b);
    --ai-banner-border: #581c87;
    --bottom-dock-bg: rgba(30, 41, 59, 0.96);
    --input-focus-bg: #0f172a;
    --drawer-bg: rgba(15, 23, 42, 0.85);
    --drawer-header-bg: rgba(15, 23, 42, 0.45);
  }
}


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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── HERO (chat home) ── */
.hero-burger {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  transition: all 0.15s;
  z-index: 100;
}

.hero-news-btn {
  position: absolute;
  top: 1.5rem;
  left: 4.75rem;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.85rem;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
  z-index: 100;
}

.hero-news-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-repo-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.85rem;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
  z-index: 100;
}

.hero-repo-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-news-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: calc(50vw - 340px);
  min-width: 300px;
  max-width: 400px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 90;
  padding: 4.5rem 1.5rem 1.5rem;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.hero-news-panel.visible {
  transform: translateX(0);
}

.news-header {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--ink);
}

.news-item {
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: block;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.news-item-title:hover {
  text-decoration: underline;
}

.news-item-meta {
  font-size: 0.72rem;
  color: var(--ink-muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.news-item-src {
  background: #f1f5f9;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.hero-burger:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-menu-dropdown {
  position: absolute;
  top: 4.5rem;
  left: 1.5rem;
  width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  display: none;
  flex-direction: column;
  padding: 0.5rem;
  z-index: 100;
}

.hero-menu-dropdown.visible {
  display: flex;
}

#hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg);
  position: relative;
}

#hero.hidden {
  display: none;
}

.hero-top {
  text-align: center;
  margin-bottom: 1.75rem;
}

.logo-hero {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 3rem;
  letter-spacing: -1px;
}

.logo-hero span {
  color: var(--accent);
}

.tagline {
  color: var(--ink-muted);
  font-size: 0.92rem;
  font-weight: 300;
  margin-top: 0.3rem;
}

.chat-window {
  width: 100%;
  max-width: 680px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  scroll-behavior: smooth;
  min-height: 280px;
  max-height: 50vh;
}

.msg {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.msg.user {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
}

.msg.ai .msg-avatar {
  background: #eff6ff;
  color: var(--accent);
  border: 1px solid #bfdbfe;
}

.msg.user .msg-avatar {
  background: var(--accent);
  color: white;
}

.msg-bubble {
  max-width: 82%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.6;
}

.msg.ai .msg-bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg.user .msg-bubble {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-bubble.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.9rem 1rem;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-muted);
  animation: bounce 1.2s infinite;
}

.dot:nth-child(2) {
  animation-delay: .2s
}

.dot:nth-child(3) {
  animation-delay: .4s
}

@keyframes bounce {

  0%,
  60%,
  100% {
    transform: translateY(0)
  }

  30% {
    transform: translateY(-6px)
  }
}

.search-trigger {
  margin: .5rem 1rem .75rem;
  padding: .65rem 1rem;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: opacity .2s;
  width: calc(100% - 2rem);
}

.search-trigger.visible {
  display: flex;
}

.search-trigger:hover {
  opacity: .9;
}

.chat-input-row {
  display: flex;
  gap: .5rem;
  padding: .85rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-input {
  flex: 1;
  padding: .65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  resize: none;
  background: var(--bg);
  transition: border-color .2s;
  max-height: 120px;
  overflow-y: auto;
}

.chat-input:focus {
  border-color: var(--accent);
  background: white;
}

.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
}

.chat-send svg {
  width: 16px;
  height: 16px;
  stroke: white;
  fill: none;
}

.chat-clear {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
  color: var(--ink-muted);
  transition: all 0.15s;
}

.chat-clear:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}

.chat-clear svg {
  width: 16px;
  height: 16px;
}

.chat-hint {
  font-size: .72rem;
  color: var(--ink-muted);
  text-align: center;
  margin-top: .75rem;
}

.chat-actions {
  display: flex;
  gap: .5rem;
  padding: 0 1rem .75rem;
  flex-wrap: wrap;
}

.quick-chip {
  padding: .3rem .75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .75rem;
  font-family: inherit;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all .15s;
}

.quick-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── DASHBOARD LAYOUT ── */
#dashboard {
  display: none;
  flex: 1;
  height: 100vh;
  overflow: hidden;
}

#dashboard.visible {
  display: flex;
}

/* SIDEBAR */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar.collapsed {
  width: 48px !important;
  margin-left: 0;
  overflow: hidden;
}

#sidebar.collapsed .logo-hide,
#sidebar.collapsed .nav-group-label,
#sidebar.collapsed .nav-item span,
#sidebar.collapsed .sidebar-notes-section,
#sidebar.collapsed .user-name,
#sidebar.collapsed .user-sub {
  display: none !important;
}

#sidebar.collapsed .sidebar-logo {
  padding: 1.25rem 0.25rem;
  justify-content: center;
}

#sidebar.collapsed .sidebar-nav {
  padding: .75rem .4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#sidebar.collapsed .nav-item {
  justify-content: center;
  padding: .55rem 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  margin-bottom: .5rem;
}

#sidebar.collapsed .user-chip {
  padding: .25rem 0;
  justify-content: center;
}

#sidebar.collapsed .profile-dropdown {
  left: .5rem;
  right: auto;
  width: 220px;
  bottom: 4rem;
  z-index: 200;
}

.sidebar-logo {
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-text {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.2rem;
  cursor: pointer;
}

.sidebar-logo-text span {
  color: var(--accent);
}

.sidebar-nav {
  padding: .75rem .75rem;
  flex: 1;
}

.nav-group-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .5rem .5rem .25rem;
  margin-top: .5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--ink-muted);
  transition: all .15s;
  margin-bottom: .1rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--ink);
}

.nav-item.active {
  background: var(--active-nav-bg);
  color: var(--accent);
  font-weight: 500;
}

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

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

.sidebar-bottom {
  padding: .75rem;
  border-top: 1px solid var(--border);
  position: relative;
}

.profile-dropdown {
  position: absolute;
  bottom: 4.25rem;
  left: .75rem;
  right: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  display: none;
  flex-direction: column;
  padding: 0.5rem;
  z-index: 100;
}

.profile-dropdown.visible {
  display: flex;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.78rem;
  color: var(--ink);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.profile-dropdown-item:hover {
  background: #f3f4f6;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}

.user-chip:hover {
  background: var(--bg);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 600;
  flex-shrink: 0;
}

.user-name {
  font-size: .8rem;
  font-weight: 500;
}

.user-sub {
  font-size: .7rem;
  color: var(--ink-muted);
}

/* MAIN AREA */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* TOP BAR */
#topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  padding: .6rem 1rem .6rem 2.5rem;
  font-size: .9rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color .2s;
}

.topbar-search input:focus {
  border-color: var(--accent);
  background: white;
}

.topbar-search .search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--ink-muted);
}

.topbar-search .search-kbd {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .68rem;
  color: var(--ink-muted);
  background: var(--border);
  padding: .1rem .35rem;
  border-radius: 4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  transition: all .15s;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

/* CONTENT AREA */
#content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

#center-col {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

#right-panel {
  width: 320px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  margin-right: -320px;
  transition: margin-right .3s cubic-bezier(.4, 0, .2, 1);
  position: relative;
}

#right-panel.visible {
  margin-right: 0;
}

/* PAGE VIEWS */
.page {
  display: none;
}

.page.active {
  display: block;
  position: relative;
}

#page-notes.active,
#page-reader.active {
  display: flex !important;
}

#page-atlas.active {
  display: block !important;
}

/* HOME PAGE */
.home-hero {
  margin-bottom: 1.75rem;
}

.home-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 2rem;
  margin-bottom: .35rem;
}

.home-sub {
  color: var(--ink-muted);
  font-size: .9rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .85rem;
}

.section-title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
}

.section-link {
  font-size: .78rem;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.section-link:hover {
  text-decoration: underline;
}

.recent-chips {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.recent-chip {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .76rem;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all .15s;
}

.recent-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.recent-chip svg {
  width: 11px;
  height: 11px;
  opacity: .6;
}

/* TOOLS GRID */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1.75rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all .15s;
}

.tool-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #c8c7bf;
  transform: translateY(-1px);
}

.tool-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .6rem;
  font-size: 1rem;
}

.tool-name {
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .2rem;
}

.tool-desc {
  font-size: .73rem;
  color: var(--ink-muted);
}

/* RESULTS */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

.results-count {
  font-size: .82rem;
  color: var(--ink-muted);
}

.results-count strong {
  color: var(--ink);
}

.sort-bar {
  display: flex;
  gap: .35rem;
  align-items: center;
}

.sort-label {
  font-size: .75rem;
  color: var(--ink-muted);
}

.sort-btn {
  padding: .2rem .6rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .72rem;
  font-family: inherit;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all .15s;
}

.sort-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sort-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.level-filter-btn {
  padding: .2rem .65rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .72rem;
  font-family: inherit;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all .15s;
}

.level-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.level-filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.badge-level-beginner {
  color: #15803d !important;
  font-weight: 600 !important;
}

.badge-level-intermediate {
  color: #b45309 !important;
  font-weight: 600 !important;
}

.badge-level-scholar {
  color: #6d28d9 !important;
  font-weight: 600 !important;
}

.ai-banner {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .9rem;
  background: var(--ai-banner-bg);
  border: 1px solid var(--ai-banner-border);
  border-radius: 8px;
  margin-bottom: .85rem;
  font-size: .78rem;
  color: var(--purple);
}

/* FLOATING BOTTOM DOCK */
#bottom-dock {
  position: fixed;
  bottom: 0;
  left: 260px;
  right: 0;
  height: 48px;
  background: var(--bottom-dock-bg);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  display: none;
  align-items: center;
  padding: 0 1.5rem;
  gap: .75rem;
  z-index: 9999;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  transition: left 0.2s ease-in-out;
}

#sidebar.collapsed~#main #bottom-dock {
  left: 64px !important;
}

.minimized-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .3rem .6rem;
  font-size: .75rem;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all .15s;
  box-shadow: var(--shadow-sm);
}

.minimized-tab:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.minimized-tab .close-btn {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: .85rem;
  font-weight: bold;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.minimized-tab .close-btn:hover {
  background: #f3f4f6;
  color: #ef4444;
}

/* PAPER CARD */
.paper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  margin-bottom: .75rem;
  transition: border-color .2s;
  cursor: default;
}

.paper-card:hover {
  border-color: #d0d0d0;
}

.paper-card.ai-curated {
  border-left: 3px solid var(--purple);
}

.paper-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .3rem;
}

.paper-title {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.3;
  flex: 1;
}

.paper-title:hover {
  text-decoration: underline;
}

.paper-bookmark {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-muted);
  padding: .1rem;
  transition: color .15s;
  flex-shrink: 0;
}

.paper-bookmark:hover {
  color: var(--accent);
}

.paper-bookmark.saved {
  color: var(--green);
}

.paper-bookmark svg {
  width: 16px;
  height: 16px;
}

.paper-authors {
  font-size: .73rem;
  color: var(--green);
  margin-bottom: .25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paper-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin-bottom: .5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  font-size: .75rem;
  font-weight: 400;
  background: none !important;
  color: var(--ink-muted) !important;
  border: none !important;
}

.badge::after {
  content: "-";
  margin: 0 0.35rem;
  color: #ccc;
}

.badge:last-child::after {
  content: "";
}

.paper-abstract {
  font-size: .78rem;
  color: var(--ink-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: .65rem;
}

.paper-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .78rem;
  font-weight: 400;
  padding: 0;
  border: none;
  background: none !important;
  color: var(--accent) !important;
  cursor: pointer;
  font-family: inherit;
}

.action-btn:hover {
  text-decoration: underline;
}

.action-btn svg {
  width: 12px;
  height: 12px;
  stroke-width: 2;
  opacity: 0.8;
}

/* RIGHT PANEL CONTENT */
.rp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 5;
}

.rp-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.1rem;
}

.rp-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink-muted);
}

.rp-body {
  padding: 1.25rem;
}

.level-bar {
  display: flex;
  gap: .35rem;
  margin-bottom: 1rem;
}

.level-btn {
  padding: .22rem .6rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .71rem;
  font-family: inherit;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all .15s;
}

.level-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.level-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.sum-paper-title {
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: .2rem;
  line-height: 1.35;
}

.sum-paper-meta {
  font-size: .72rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.sum-content {
  font-size: .82rem;
  line-height: 1.75;
  color: var(--ink);
}

.rp-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 3rem auto;
  display: block;
}

/* LIBRARY */
.lib-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: .6rem;
}

.lib-card-title {
  font-size: .92rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: block;
  margin-bottom: .2rem;
}

.lib-card-title:hover {
  text-decoration: underline;
}

.lib-meta {
  font-size: .72rem;
  color: var(--ink-muted);
  margin-bottom: .5rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.lib-notes {
  width: 100%;
  margin-top: .5rem;
  padding: .4rem .6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .76rem;
  font-family: inherit;
  resize: vertical;
  min-height: 48px;
}

.lib-tags {
  width: 100%;
  margin-top: .35rem;
  padding: .32rem .6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .76rem;
  font-family: inherit;
}

.lib-actions {
  display: flex;
  gap: .4rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}

.lib-del {
  font-size: .71rem;
  padding: .22rem .55rem;
  border-radius: 5px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  cursor: pointer;
  font-family: inherit;
}

.lib-save {
  font-size: .71rem;
  padding: .22rem .55rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink-muted);
  cursor: pointer;
  font-family: inherit;
}

/* AUTH MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.modal-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

.modal-tab {
  flex: 1;
  padding: .5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: .85rem;
  cursor: pointer;
  color: var(--ink-muted);
  transition: all .15s;
}

.modal-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: .76rem;
  color: var(--ink-muted);
  margin-bottom: .3rem;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-submit {
  width: 100%;
  padding: .75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
}

.form-error {
  font-size: .76rem;
  color: #b91c1c;
  margin-top: .5rem;
}

.modal-close {
  float: right;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--ink-muted);
  margin-top: -.5rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--ink-muted);
}

.spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 2rem;
  gap: 1rem;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.spinner-label {
  font-size: .8rem;
  color: var(--ink-muted);
}

.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1rem;
  color: #b91c1c;
  font-size: .82rem;
}

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

/* ── MAP OVERLAYS ── */
@keyframes map-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  100% {
    transform: scale(3.5);
    opacity: 0;
  }
}

.ol-beacon {
  position: relative;
  width: 14px;
  height: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.ol-beacon:hover {
  z-index: 20;
  transform: scale(1.15);
  transition: transform 0.2s;
}

.ol-beacon-dot {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: 2;
  transition: transform 0.2s;
}

.ol-beacon-glow {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: map-pulse 2.5s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
  transition: transform 0.2s;
}

.ol-beacon-text {
  font-size: 24px;
  position: absolute;
  top: -32px;
  filter: drop-shadow(0px 2px 2px rgba(255, 255, 255, 0.9));
}

/* ── REPO DRAWER STYLES ── */
#repo-toggle-btn {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: .85rem .6rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--ink);
  cursor: pointer;
  box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.08);
  writing-mode: vertical-rl;
  text-orient: mixed;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
}

#repo-toggle-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  padding-right: .95rem;
}

/* ── MOBILE RESPONSIVENESS AND DYNAMIC SCALING (max-width: 768px) ── */
@media (max-width: 768px) {
  /* 1. Global Viewport Adjustments */
  body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  /* 2. Hero Chat Section Mobile Optimization */
  #hero {
    height: auto;
    min-height: 100vh;
    padding: 1rem;
    justify-content: flex-start;
  }

  .hero-top {
    margin-top: 3.5rem;
    margin-bottom: 1.25rem;
  }

  .logo-hero {
    font-size: 2.2rem !important;
  }

  .tagline {
    font-size: 0.8rem !important;
    padding: 0 0.5rem;
  }

  .chat-window {
    max-width: 100%;
    border-radius: 12px;
  }

  .chat-messages {
    min-height: 220px;
    max-height: 45vh;
    padding: 1rem 1rem 0.5rem;
  }

  .msg-bubble {
    max-width: 90%;
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
  }

  .chat-hint {
    margin-top: 0.5rem;
    font-size: 0.65rem;
  }

  /* Burger Menu Dropdowns & Drawer on Hero */
  .hero-news-panel {
    width: 100% !important;
    max-width: 100% !important;
    z-index: 10002;
  }

  .hero-news-btn {
    left: 4.25rem;
  }

  /* 3. Dashboard Mobile Drawer Navigation */
  #dashboard {
    height: auto;
    min-height: 100vh;
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 9999;
  }

  .sidebar-backdrop.visible {
    opacity: 1;
    visibility: visible;
  }

  #sidebar {
    position: fixed;
    top: 0;
    left: -240px; /* Hidden offscreen by default */
    width: 240px !important;
    height: 100vh;
    z-index: 10000;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.15);
    background: var(--surface) !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #sidebar.visible-mobile {
    left: 0 !important;
  }

  /* Make sure items don't hide on mobile sidebar drawer */
  #sidebar.visible-mobile .logo-hide,
  #sidebar.visible-mobile .nav-group-label,
  #sidebar.visible-mobile .nav-item span,
  #sidebar.visible-mobile .sidebar-notes-section,
  #sidebar.visible-mobile .user-name,
  #sidebar.visible-mobile .user-sub {
    display: block !important;
  }

  #sidebar.visible-mobile .sidebar-notes-section {
    display: flex !important;
  }

  #main {
    width: 100%;
    min-height: 100vh;
  }

  #topbar {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .topbar-search {
    max-width: 180px;
  }

  .topbar-search input {
    font-size: 0.8rem;
    padding: 0.5rem 0.5rem 0.5rem 2rem;
  }

  .topbar-search .search-icon {
    left: 0.6rem;
  }

  .topbar-search .search-kbd {
    display: none !important; /* Hide keyboard shortcut hints on mobile */
  }

  /* 4. Page Layout Auto-stacking */
  #center-col {
    padding: 1rem;
  }

  .home-hero {
    margin-bottom: 1.25rem;
    text-align: center;
  }

  .home-title {
    font-size: 1.6rem;
  }

  .home-sub {
    font-size: 0.8rem;
  }

  .tools-grid {
    grid-template-columns: 1fr !important; /* Stack dashboard cards */
    gap: 0.75rem;
  }

  .tool-card {
    padding: 0.85rem;
  }

  /* 5. Notes View Stacking */
  #page-notes > div {
    flex-direction: column !important;
    height: auto !important;
    gap: 1.5rem !important;
  }

  #page-notes > div > div:first-child {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    padding-right: 0 !important;
    padding-bottom: 1.25rem !important;
    height: 250px !important;
    flex-shrink: 0 !important;
  }

  #page-notes > div > #note-editor-wrap {
    width: 100% !important;
    height: 450px !important;
    margin-top: 0 !important;
    flex: none !important;
  }

  /* 6. In-App PDF Reader & Annotation Panel Stacking */
  #page-reader {
    flex-direction: column !important;
    height: auto !important;
    min-height: calc(100vh - 120px) !important;
    gap: 1.5rem !important;
  }

  #page-reader > div:first-child {
    width: 100% !important;
    height: 480px !important; /* Fixed height for mobile PDF viewer */
    flex: none !important;
  }

  #page-reader > div:last-child {
    width: 100% !important;
    height: 450px !important; /* Fixed height for annotations */
    flex: none !important;
  }

  /* 7. Atlas Page Mobile Layout */
  #page-atlas {
    height: auto !important;
    padding-bottom: 4rem !important;
  }

  #page-atlas > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  #atlas-map-container {
    height: 320px !important; /* Make map smaller on mobile */
  }

  #page-atlas > div:last-child {
    grid-template-columns: 1fr !important; /* Stack density columns */
    height: auto !important;
    gap: 1.5rem !important;
  }

  /* 8. Bottom Minimized Dock */
  #bottom-dock {
    padding: 0.5rem;
    height: auto;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  #bottom-dock > div:first-child {
    border-right: none !important;
    padding-right: 0 !important;
    width: 100%;
    margin-bottom: 0.25rem;
  }

  /* 9. GitHub Drawer Sizing */
  #repo-drawer {
    width: 100% !important;
    right: -100% !important;
  }

  #repo-toggle-btn {
    display: none !important; /* Hide floating tab to save layout space */
  }
}

/* ── SOURCE STATUS PILLS ── */
.source-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.85rem 0 0.6rem;
  align-items: center;
}

.source-pills-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.15rem;
  flex-basis: 100%;
  margin-bottom: 0.3rem;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  border: 1.5px solid transparent;
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.2s;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

.source-pill.loading {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink-muted);
}

.source-pill.loading .pill-dot {
  background: var(--ink-muted);
  animation: pill-pulse 1.2s ease-in-out infinite;
}

.source-pill.success {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
  transform: scale(1.02);
}

.source-pill.success .pill-dot {
  background: #22c55e;
  animation: none;
}

.source-pill.failed {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
  opacity: 0.75;
}

.source-pill.failed .pill-dot {
  background: #ef4444;
  animation: none;
}

[data-theme="dark"] .source-pill.success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

[data-theme="dark"] .source-pill.failed {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .source-pill.success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86efac;
  }
  :root:not([data-theme="light"]) .source-pill.failed {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
  }
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

@keyframes pill-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

/* ── SKELETON CARD LOADER ── */
.skeleton-results-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: hidden;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg,
    var(--border) 25%,
    var(--bg) 50%,
    var(--border) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-line.title {
  height: 16px;
  width: 75%;
}

.skeleton-line.author {
  width: 50%;
}

.skeleton-line.meta {
  width: 35%;
  height: 10px;
}

.skeleton-line.abstract {
  width: 100%;
}

.skeleton-line.abstract-short {
  width: 85%;
}

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

/* ── SOURCE STATUS BANNER ── */
.source-status-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border-radius: 10px;
  border: 1.5px solid;
  margin-bottom: 1rem;
  font-size: 0.83rem;
}

.source-status-banner.partial {
  background: #fffbeb;
  border-color: #fcd34d;
}

.source-status-banner.warn {
  background: #eff6ff;
  border-color: #93c5fd;
}

.source-status-banner.error {
  background: #fef2f2;
  border-color: #fca5a5;
}

[data-theme="dark"] .source-status-banner.partial {
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.3);
}

[data-theme="dark"] .source-status-banner.warn {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .source-status-banner.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .source-status-banner.partial {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.3);
  }
  :root:not([data-theme="light"]) .source-status-banner.warn {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
  }
  :root:not([data-theme="light"]) .source-status-banner.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
  }
}

.ssb-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.ssb-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.ssb-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.4;
}

.ssb-desc {
  color: var(--ink-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.ssb-failed-label {
  font-size: 0.74rem;
  color: var(--ink-muted);
  margin-top: 0.1rem;
}

.ssb-failed-list {
  color: var(--ink);
  font-weight: 500;
}

.ssb-retry {
  margin-top: 0.5rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  align-self: flex-start;
}

.ssb-retry:hover {
  background: var(--accent);
  color: white;
}

/* ── TOAST NOTIFICATION ──────────────────────────────────────── */
#ov-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #f8fafc;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#ov-toast.ov-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── UNDER DEVELOPMENT OVERLAY ───────────────────────────────── */
#under-dev-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 50;
  border-radius: 12px;
  min-height: 400px;
}
.under-dev-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 2.5rem 2rem;
  max-width: 420px;
}
.under-dev-icon {
  font-size: 3.5rem;
  line-height: 1;
  animation: ud-pulse 2s ease-in-out infinite;
}
@keyframes ud-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.under-dev-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
}
.under-dev-sub {
  font-size: 0.925rem;
  color: var(--ink-muted);
  line-height: 1.6;
  margin: 0;
}
.under-dev-btn {
  margin-top: 0.5rem;
  padding: 0.7rem 2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.under-dev-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
