:root {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #111827;
  --accent: #2563eb;
  --accent-muted: #1d4ed8;
  --border: #1f2937;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --error: #f87171;
  --success: #34d399;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, rgba(37,99,235,0.18), transparent 55%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  display: grid;
  gap: 1.5rem;
}

.shell--splash {
  max-width: 1200px;
  padding: 2rem 1.5rem 4rem;
}

.hero {
  text-align: center;
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(37,99,235,0.25), rgba(15,23,42,0.95));
  box-shadow: 0 30px 80px rgba(15,23,42,0.6);
}

.hero__title {
  margin: 0;
  font-size: 2.5rem;
}

.hero__subtitle {
  color: var(--muted);
  margin: 0.75rem 0 1.5rem;
  line-height: 1.6;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hero__tagline {
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0.5rem 0 1rem;
}

.hero--splash {
  padding: 3rem 2rem;
}

.hero--splash .hero__title {
  font-size: 3rem;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.cta {
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}

.cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 45px rgba(37,99,235,0.35);
}

.cta.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cta--full {
  width: 100%;
  margin-top: 0.5rem;
}

.panel {
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(15,23,42,0.35);
}

.panel h2 {
  margin-top: 0;
}

.panel__intro {
  color: var(--muted);
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

.panel--auth {
  margin-top: 2rem;
}

.form {
  display: grid;
  gap: 0.75rem;
}

.form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.form input {
  padding: 0.6rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.6);
  color: var(--text);
}

.form button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0.65rem;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
}

.form button:hover {
  background: var(--accent-muted);
}

.form__actions {
  display: flex;
  gap: 0.75rem;
}

.demo-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.demo-grid button {
  border: 1px solid var(--border);
  background: rgba(37,99,235,0.12);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.demo-grid button:hover {
  background: rgba(37,99,235,0.25);
}

.twofa-field {
  display: none;
}

[data-login-form].is-twofa .twofa-field {
  display: grid;
}

.status {
  text-align: center;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.25);
  color: var(--accent);
}

.status--error { color: var(--error); border-color: rgba(248,113,113,0.35); background: rgba(248,113,113,0.12); }
.status--success { color: var(--success); border-color: rgba(52,211,153,0.35); background: rgba(52,211,153,0.12); }

.workspace {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1.5rem;
}

.workspace.no-scroll {
  height: 100vh;
  overflow: hidden;
}

.workspace__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.workspace__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.workspace__actions button,
.workspace__actions a,
.workspace__actions select {
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.6);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.workspace__actions select {
  background: rgba(15,23,42,0.8);
}

.workspace__actions select:hover {
  border-color: var(--accent);
}

.workspace__actions select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.workspace__actions button[data-generate-whitepaper] {
  background: var(--accent);
  color: #fff;
}

.workspace__actions button.is-disabled,
.workspace__actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.workspace__actions-extra {
  display: flex;
  gap: 0.5rem;
}

.whitepaper-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.publications {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
  display: grid;
  gap: 1.5rem;
}

.publications__header {
  display: grid;
  gap: 0.75rem;
  background: rgba(15,23,42,0.6);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 20px 45px rgba(15,23,42,0.35);
}

.publications__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.publications__list {
  display: grid;
  gap: 1rem;
}

.publications__empty {
  border: 1px dashed rgba(148,163,184,0.6);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: rgba(15,23,42,0.5);
}

.publication-card {
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: 1.1rem;
  padding: 1.25rem;
  background: rgba(37,99,235,0.08);
  box-shadow: 0 16px 40px rgba(15,23,42,0.3);
  display: grid;
  gap: 0.5rem;
}

.publication-card__meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.publication-card button {
  justify-self: start;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(37,99,235,0.18);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.publication-card button:hover {
  background: rgba(37,99,235,0.3);
}

.modal__dialog--wide {
  max-width: calc(100vw - 4rem);
  width: 90vw;
  display: grid;
  gap: 1rem;
  background: rgba(15,23,42,0.95);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
}

.modal__dialog--lg {
  max-width: calc(100vw - 4rem);
  width: 90vw;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal__meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 1rem 0;
}

.modal__meta details {
  margin: 0.5rem 0;
}

.modal__meta summary {
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  user-select: none;
  font-weight: 500;
  color: var(--text);
  transition: background 0.2s ease;
}

.modal__meta summary:hover {
  background: rgba(148, 163, 184, 0.2);
}

.modal__meta details[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
}

.modal__meta .publication-meta {
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
}

.modal__body {
  line-height: 1.6;
  color: white;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 0.85rem;
  padding: 1rem;
  background: rgba(15,23,42,0.6);
  max-height: 320px;
  overflow-y: auto;
}

.modal__body h1 {
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
}

.modal__body h2 {
  color: white;
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0.75rem 0 0.5rem 0;
}

.modal__body h3 {
  color: white;
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0.5rem 0 0.25rem 0;
}

.modal__body p {
  color: white;
  margin: 0.5rem 0;
}

.modal__graph {
  min-height: 320px;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 0.85rem;
  background: rgba(15,23,42,0.4);
}

.hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.hint--info {
  color: var(--accent);
}

.hint--error {
  color: var(--error);
}

.hint--success {
  color: var(--success);
}

.workspace__actions {
  display: flex;
  gap: 0.75rem;
}

.workspace__actions button,
.workspace__actions .link {
  padding: 0.55rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: rgba(37,99,235,0.15);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.workspace__grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
}

.workspace__grid > *:last-child {
  flex: 1;
  min-height: 0;
}

.workspace__canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  flex: 1;
}

.search-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  background: rgba(15,23,42,0.65);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
}

.search-panel input[type="text"] {
  width: 100%;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.6);
  color: var(--text);
  padding: 0.55rem 0.8rem;
}

.search-panel label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.search-panel select {
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.6);
  color: var(--text);
  padding: 0.45rem 0.6rem;
}

.search-panel button {
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: rgba(37,99,235,0.2);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-panel button:hover {
  background: rgba(37,99,235,0.35);
}

.search-panel button[data-clear-graph] {
  background: rgba(148,163,184,0.15);
}

.search-input-wrapper {
  flex: 1 1 220px;
  min-width: 160px;
  position: relative;
}

.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(15,23,42,0.98);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin-top: 0.25rem;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-autocomplete.is-visible {
  display: block;
}

.search-autocomplete-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(148,163,184,0.1);
  transition: background-color 0.2s ease;
}

.search-autocomplete-item:hover {
  background: rgba(37,99,235,0.1);
}

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

.search-autocomplete-item__icon {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

.search-autocomplete-item__name {
  font-weight: 500;
  color: var(--text);
}

.search-autocomplete-item__email {
  font-size: 0.875rem;
  color: var(--muted);
  margin-left: 0.5rem;
}

.graph-container {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(15,23,42,0.65);
  min-height: 0;
  height: 100%;
}

.graph-minimap {
  display: none;
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 140px;
  height: auto;
  border: 1px solid rgba(148,163,184,0.5);
  border-radius: 0.5rem;
  background: rgba(15,23,42,0.85);
  padding: 0.4rem;
}

.context-menu {
  position: absolute;
  display: none;
  flex-direction: column;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.92);
  box-shadow: 0 18px 40px rgba(15,23,42,0.5);
  padding: 0.4rem;
  min-width: 170px;
  z-index: 20;
}

.context-menu.is-visible {
  display: flex;
}

.context-menu button {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-radius: 0.55rem;
  cursor: pointer;
}

.context-menu button:hover {
  background: rgba(37,99,235,0.2);
}

.graph-status {
  margin-top: 0.5rem;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 24, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(10px);
  padding-top: 80px; /* Account for header height */
  padding-bottom: 2rem;
}

/* Modals should appear above fullscreen dialog and workspace */
.workspace--fullscreen .modal,
.workspace-fullscreen .modal {
  z-index: 9999 !important;
  position: fixed !important;
}

.workspace--fullscreen .modal__dialog,
.workspace-fullscreen .modal__dialog {
  z-index: 10000 !important;
  position: relative !important;
}

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

.modal__dialog {
  width: fit-content;
  max-width: calc(100vw - 4rem);
  max-height: calc(100vh - 100px); /* Account for header + padding */
  background: rgba(10, 18, 35, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1.35rem;
  padding: clamp(1.25rem, 2vw, 1.85rem);
  box-shadow: 0 32px 82px rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(14px);
  overflow-y: auto;
  margin: auto;
}

.modal__dialog h2 {
  font-size: 1.45rem;
  font-weight: 600;
  color: white;
  margin: 0 0 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal__dialog h2 button {
  margin-left: auto;
  flex-shrink: 0;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal__dialog label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.92);
}

.modal__dialog input,
.modal__dialog select,
.modal__dialog textarea {
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text);
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.modal__dialog input:focus,
.modal__dialog select:focus,
.modal__dialog textarea:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(15, 23, 42, 0.75);
}

.form-grid textarea {
  resize: vertical;
  min-height: 130px;
}

.form-grid input[data-node-relation] {
  font-size: 0.875rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--surface);
  color: var(--text);
}

.form-grid input[data-node-relation]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal__actions button {
  padding: 0.58rem 1.3rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(37, 99, 235, 0.25);
  color: var(--text);
  font-weight: 500;
  transition: transform 0.15s ease, background 0.2s ease;
}

.modal__actions button[type="button"] {
  background: rgba(15, 23, 42, 0.52);
}

.modal__actions button:hover {
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.4);
}

/* Details modal actions dropdown */
.details-modal__actions {
  margin-top: 1rem;
}

.actions-dropdown {
  width: 100%;
}

.actions-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  list-style: none;
}

.actions-summary:hover {
  background: var(--accent-hover, #3b82f6);
}

.actions-summary::-webkit-details-marker {
  display: none;
}

.actions-summary::after {
  content: '▼';
  transition: transform 0.2s;
  font-size: 0.75rem;
}

.actions-dropdown[open] .actions-summary::after {
  transform: rotate(180deg);
}

.actions-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  margin-top: -1px;
}

.actions-menu button {
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  transition: background-color 0.2s;
}

.actions-menu button:hover {
  background: var(--border);
}

.actions-menu .button--danger {
  color: #ef4444;
}

.actions-menu .button--danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.no-scroll {
  overflow: hidden;
  height: 100vh;
}

@media (max-width: 960px) {
  .workspace__grid {
    grid-template-columns: 1fr;
  }
  .workspace__sidebar {
    order: 2;
  }
  .workspace__canvas {
    order: 1;
  }
}

/* Leaderboard badges */
.results-list--compact {
  padding-left: 1rem;
}

.results-list__item--compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.results-list__item--compact:last-child {
  border-bottom: none;
}

.results-list__badge {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
  color: var(--text);
  font-size: 0.8rem;
}

/* Leaderboard */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
}

.leaderboard-table th {
  font-weight: 600;
  color: var(--text);
}

.leaderboard-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.button--danger {
  background: #dc2626;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.button--danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

.button--secondary {
  background: #6b7280;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.button--secondary:hover {
  background: #4b5563;
  transform: translateY(-1px);
}

.button--warning {
  background: #f59e0b;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.button--warning:hover {
  background: #d97706;
  transform: translateY(-1px);
}

/* Clickable list items */
.results-list__item--clickable {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.results-list__item--clickable:hover {
  background-color: rgba(59, 130, 246, 0.1);
}

/* Expertise Modal */
.expertise-content {
  padding: 1rem 0;
}

.expertise-summary {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.expertise-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.expertise-total__label {
  font-weight: 600;
  color: var(--text);
}

.expertise-total__value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #3b82f6;
  font-variant-numeric: tabular-nums;
}

.expertise-reason {
  font-size: 0.875rem;
  color: #64748b;
  font-style: italic;
}

.expertise-areas h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.expertise-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.expertise-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 0.375rem;
  border-left: 3px solid #3b82f6;
}

.expertise-item__tag {
  font-weight: 500;
  color: var(--text);
}

.expertise-item__score {
  font-weight: 600;
  color: #3b82f6;
  font-variant-numeric: tabular-nums;
}

.button--focus {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.button--focus:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.button--like {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.button--like:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

.button--liked {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.button--liked:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: rgba(239, 68, 68, 0.7);
  transform: translateY(-1px);
}

.publication-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.publication-card__status {
  background: rgba(37, 99, 235, 0.15);
  color: #2563eb;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.publication-card__separator {
  color: #94a3b8;
}

.publication-card__description {
  margin: 0.75rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.publication-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.3);
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

.publication-meta__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.publication-meta__item strong {
  color: var(--text);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.publication-meta__graph-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  transition: color 0.2s ease;
}

.publication-meta__graph-link:hover {
  color: var(--accent-muted);
  text-decoration: underline;
}

.publication-meta__deactivate-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  margin-top: 0.5rem;
}

.publication-meta__deactivate-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

.publication-meta__deactivate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.publication-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 2rem;
}

/* Styling for removed nodes */
.cytoscape-node[data-type="Removed"] {
  background-color: #ef4444 !important;
  border-color: #dc2626 !important;
  opacity: 0.6;
}

.cytoscape-node[data-type="Removed"] .cytoscape-label {
  color: white !important;
  font-style: italic;
}

/* Navigation Dropdown */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown__toggle {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-dropdown__toggle:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
}

.nav-dropdown__toggle:after {
  content: '▼';
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.nav-dropdown__toggle[aria-expanded="true"]:after {
  transform: rotate(180deg);
}

.nav-dropdown__menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.5rem;
  padding: 0.5rem 0;
  min-width: 200px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.nav-dropdown__menu.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown__item {
  display: block;
  padding: 0.75rem 1rem;
  color: #e2e8f0;
  text-decoration: none;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.nav-dropdown__item:last-child {
  border-bottom: none;
}

.nav-dropdown__item:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

.nav-dropdown__item--active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  font-weight: 500;
}

.nav-dropdown__item--danger {
  color: #f87171;
}

.nav-dropdown__item--danger:hover {
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

/* Update workspace actions to accommodate dropdown */
.workspace__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.workspace__actions .nav-dropdown {
  margin-left: auto;
}

/* Essay Upload Modal */
.essay-progress {
  text-align: center;
  padding: 2rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 4px;
}

.essay-results {
  max-height: 400px;
  overflow-y: auto;
}

.extracted-nodes {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.extracted-node {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.5rem;
  padding: 1rem;
}

.extracted-node h4 {
  color: #60a5fa;
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.extracted-node p {
  color: #e2e8f0;
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.extracted-node .node-type {
  color: #fbbf24;
  font-weight: 500;
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.extracted-node .node-tags {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.8rem;
}

.extracted-node .node-edges {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.extracted-node .node-edges strong {
  color: #fbbf24;
  font-size: 0.8rem;
}

.edge-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.edge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.5rem;
}

.edge-item button {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
}

.extracted-node .edge-list {
  color: #cbd5e1;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Mobile Header */
.workspace__header-mobile {
  display: none;
}

.workspace__mobile-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.workspace__mobile-toggle:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
}

.workspace__badges-mobile {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}


/* Admin page mobile titles */
.admin-title-mobile {
  display: none;
  color: #f1f5f9;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.admin-title-desktop {
  display: block;
  color: #f1f5f9;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

/* Mobile Menu Modal */
.mobile-menu-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
}

.mobile-menu-modal.is-visible {
  display: flex;
}

.mobile-menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.mobile-menu-content {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 1rem;
  margin: 1rem;
  max-width: 400px;
  width: 100%;
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.5);
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.mobile-menu-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.mobile-menu-close:hover {
  color: var(--text);
}

.mobile-menu-body {
  padding: 1.5rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
}

.mobile-menu-section {
  margin-bottom: 1.5rem;
}

.mobile-menu-section:last-child {
  margin-bottom: 0;
}

.mobile-menu-section label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.mobile-menu-section select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.mobile-menu-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.mobile-menu-btn:hover {
  background: var(--accent-muted);
  transform: translateY(-1px);
}

.mobile-menu-btn:active {
  transform: translateY(0);
}

.mobile-menu-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-menu-link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
  border: 1px solid transparent;
}

.mobile-menu-link:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.mobile-menu-link--active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  color: #60a5fa;
}

.mobile-menu-link--danger {
  color: #f87171;
}

.mobile-menu-link--danger:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
}

.mobile-menu-btn--danger {
  background: #dc2626;
  color: white;
}

.mobile-menu-btn--danger:hover {
  background: #b91c1c;
}

/* Features section for splash page */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-card {
  padding: 1.75rem;
  border-radius: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(15,23,42,0.35);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 70px rgba(15,23,42,0.45);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.feature-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}

.feature-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.auth-tab {
  padding: 0.6rem 1.2rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease;
}

.auth-tab:hover {
  background: rgba(37,99,235,0.1);
  color: var(--text);
}

.auth-tab--active {
  color: var(--accent);
  background: rgba(37,99,235,0.15);
}

.auth-form {
  display: none;
}

.auth-form:not([hidden]) {
  display: grid;
}

/* Ensure auth forms in new layout work */
.auth-forms .auth-form {
  display: none;
}

.auth-forms .auth-form:not([hidden]) {
  display: grid;
}

[data-auth-hidden][hidden] {
  display: none !important;
}

/* Responsive navigation */
@media (max-width: 768px) {
  .workspace__header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  }
  
  .admin-title-mobile {
    display: block;
  }
  
  .admin-title-desktop {
    display: none;
  }
  
  .workspace__actions {
    display: none; /* Hide the old dropdown menu on mobile */
  }

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

  .hero--splash .hero__title {
    font-size: 2.25rem;
  }

  .hero__tagline {
    font-size: 1.1rem;
  }
}

/* Chatham House-inspired Layout Styles */

/* Site Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.95);
  transition: transform 0.3s ease;
}

.site-header--hidden {
  transform: translateY(-100%);
}

.site-header__mobile-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 101;
  display: none;
}

.site-header__mobile-toggle:not([hidden]) {
  display: block;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  /* Hide scrollbar but keep scroll functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.header-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.header-brand {
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.header-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: nowrap; /* Always on one line */
  flex-shrink: 0;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-link--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-link--button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-link--button:hover {
  background: var(--accent-muted);
  transform: translateY(-1px);
  border-bottom: none;
}

.nav-link--admin {
  color: var(--error);
}

.nav-link {
  position: relative;
}

.nav-link__badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.user-stats {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.5rem;
}

.user-stats__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.user-stats__label {
  color: var(--muted);
  font-size: 0.9rem;
}

.user-stats__value {
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}

/* Hero Section */
.hero-section {
  padding: 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  min-height: 800px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-banner-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 5rem 2rem;
  text-align: left;
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-heading {
  margin: 0 0 1.5rem;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 0, 0, 0.3);
}

.hero-description {
  margin: 0 0 2.5rem;
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--text);
  max-width: 600px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 0, 0, 0.3);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Scroll Arrow */
.scroll-arrow {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.2);
  border: 2px solid rgba(37, 99, 235, 0.4);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.scroll-arrow:hover {
  background: rgba(37, 99, 235, 0.3);
  border-color: var(--accent);
  transform: translateX(-50%) translateY(4px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.scroll-arrow:active {
  transform: translateX(-50%) translateY(6px);
}

.scroll-arrow svg {
  width: 24px;
  height: 24px;
  stroke: var(--text);
  animation: bounce 2s infinite;
}

.scroll-arrow--up {
  bottom: auto;
  top: 2rem;
  right: 2rem;
  left: auto;
  transform: none;
}

.scroll-arrow--up:hover {
  transform: translateY(-4px);
}

.scroll-arrow--up:active {
  transform: translateY(-6px);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

.cta-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-primary:hover {
  background: var(--accent-muted);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.cta-primary--full {
  width: 100%;
}

.cta-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.cta-secondary:hover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.1);
}

/* Main Content */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.content-section {
  margin-bottom: 4rem;
}

.content-section--auth {
  margin-top: 3rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.section-intro {
  margin: 0;
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Features Grid - Chatham House style */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-item {
  padding: 2rem;
  border-radius: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.5);
  border-color: var(--accent);
}

.feature-item .feature-icon {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.feature-item .feature-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.feature-item .feature-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
}

/* Auth Container */
.auth-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 2.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.4);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-title {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.auth-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1rem;
}

.auth-forms {
  margin-top: 1.5rem;
}

.auth-form {
  display: grid;
  gap: 1.25rem;
}

.form-group {
  display: grid;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Site Footer */
.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
}

.footer-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Workspace pages with site header */
.workspace {
  padding-top: 0;
}

.workspace__header {
  border-top: 1px solid var(--border);
}

/* Full-screen mode */
.workspace-fullscreen {
  overflow: hidden;
}

.workspace--fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  z-index: 1000;
  padding: 0;
}

.workspace--fullscreen .workspace__canvas {
  height: 100vh;
}

.workspace--fullscreen .search-panel {
  position: relative;
  z-index: 100;
}

.site-header--hidden-fullscreen,
.workspace__header--hidden-fullscreen,
.workspace--fullscreen .site-footer {
  display: none !important;
}

.floating-menu-toggle {
  position: absolute;
  top: calc(1rem + 4rem); /* Below search bar (search panel height ~4rem + gap) */
  right: 1rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* In fullscreen mode, button should be below search bar */
.workspace--fullscreen .floating-menu-toggle {
  top: calc(1rem + 4rem); /* Below search bar (search panel height ~4rem + gap) */
  position: fixed;
  z-index: 1001;
}

.floating-menu-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.floating-menu-toggle:active {
  transform: scale(0.95);
}

/* Full-screen actions dialog */
.fullscreen-actions-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1002;
}

.fullscreen-actions-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.fullscreen-actions-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.fullscreen-actions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.fullscreen-actions-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.fullscreen-actions-close {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: background 0.2s ease;
}

.fullscreen-actions-close:hover {
  background: rgba(148, 163, 184, 0.2);
}

.fullscreen-actions-body {
  padding: 1.5rem;
  display: grid;
  gap: 1.5rem;
}

.fullscreen-actions-badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.fullscreen-actions-group {
  display: grid;
  gap: 0.5rem;
}

.fullscreen-actions-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.fullscreen-actions-group select {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  font-size: 1rem;
}

.fullscreen-actions-buttons {
  display: grid;
  gap: 0.75rem;
}

.fullscreen-action-btn {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(37, 99, 235, 0.15);
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  text-align: left;
}

.fullscreen-action-btn:hover {
  background: rgba(37, 99, 235, 0.25);
  transform: translateX(2px);
}

.fullscreen-action-btn--secondary {
  background: rgba(15, 23, 42, 0.6);
}

.fullscreen-action-btn--secondary:hover {
  background: rgba(15, 23, 42, 0.8);
}

.fullscreen-action-btn--toggle {
  background: rgba(37, 99, 235, 0.15);
  margin-top: 0.5rem;
}

.fullscreen-action-btn--exit {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--error);
  margin-top: 0.5rem;
}

.fullscreen-action-btn--exit:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Admin pages with site header */
.admin {
  padding-top: 0;
}

.admin .workspace__header {
  border-top: 1px solid var(--border);
}

/* Responsive adjustments for Chatham House layout */
@media (max-width: 768px) {
  /* Mobile toggle button removed on graph page - fullscreen mode provides this functionality */
  .workspace .site-header__mobile-toggle {
    display: none !important;
  }
  
  /* Remove padding that was for toggle button on graph page */
  .workspace .site-header {
    padding-right: 2rem;
  }

  .header-container {
    flex-direction: row; /* Keep horizontal layout even on mobile */
    align-items: center;
    padding: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    /* Hide scrollbar but keep scroll functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }

  .header-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }

  .header-nav {
    width: auto;
    flex-shrink: 0;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: nowrap; /* Always on one line */
  }
  
  /* On graph page, allow hiding header on mobile */
  .workspace .site-header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
  }
  
  .workspace .site-header--hidden {
    transform: translateY(-100%);
  }
  
  .workspace {
    padding-top: 0;
  }

  .hero-heading {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1.1rem;
  }

  .hero-section {
    min-height: 500px;
  }

  .hero-container {
    padding: 3rem 1.5rem;
    text-align: left;
  }

  .hero-heading {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1.1rem;
  }

  .scroll-arrow {
    width: 2.5rem;
    height: 2.5rem;
    bottom: 1.5rem;
  }

  .scroll-arrow--up {
    top: 1rem;
    right: 1rem;
  }

  .content-section {
    scroll-margin-top: 4rem;
  }

  .main-content {
    padding: 2.5rem 1.5rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .auth-container {
    padding: 1.5rem;
  }
}
