:root {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #111827;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-muted: #1d4ed8;
  --border: #1f2937;
  --text: #e2e8f0;
  --text-white: #ffffff;
  --muted: #94a3b8;
  --muted-dark: #64748b;
  --error: #f87171;
  --success: #34d399;
  
  /* Standardized spacing scale */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.75rem;
  --spacing-lg: 1rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;
  --spacing-3xl: 3rem;
  
  /* Standardized border radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-pill: 999px;
  --radius-circle: 50%;
  
  /* Standardized background opacities */
  --bg-opacity-light: rgba(15, 23, 42, 0.3);
  --bg-opacity-medium: rgba(15, 23, 42, 0.6);
  --bg-opacity-heavy: rgba(15, 23, 42, 0.8);
  --bg-opacity-strong: rgba(15, 23, 42, 0.9);
  --bg-opacity-full: rgba(15, 23, 42, 0.95);
}

* {
  box-sizing: border-box;
}

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;
}

/* Add padding to body to account for fixed navbar (except graph page) */
body:not(.graph-fullscreen) {
  padding-top: 70px; /* Increased to ensure content starts below navbar with proper margin */
}

.shell {
  max-width: 960px;
  margin: 0 auto;
  margin-top: 1rem; /* Additional margin to ensure content starts below navbar */
  padding: 3rem 1.5rem 4rem;
  display: grid;
  gap: 1.5rem;
}

.hero {
  position: relative;
  text-align: center;
  padding: 0;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(15,23,42,0.6);
}

.hero__banner-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero__banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: 3rem 2rem;
  width: 100%;
}

.hero__title {
  margin: 0;
  font-size: 2.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 0, 0, 0.3);
}

.hero__subtitle {
  color: var(--muted);
  margin: 0.75rem 0 1.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 0, 0, 0.3);
}

.cta {
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-pill);
  border: none;
  font-weight: 600;
  background: var(--accent);
  color: var(--text-white);
  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;
}

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

.panel h2 {
  margin-top: 0;
}

.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: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-opacity-medium);
  color: var(--text);
}

.form button {
  background: var(--accent);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-md);
  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: var(--radius-md);
  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: var(--radius-md);
  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: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-opacity-medium);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.workspace__actions select {
  background: var(--bg-opacity-heavy);
}

.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: var(--text-white);
}

.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: var(--bg-opacity-medium);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  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: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: var(--bg-opacity-medium);
}

.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: var(--radius-md);
  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 {
  min-width: 700px;
  max-width: 960px;
  width: 100%;
}

.modal__meta {
  font-size: 0.875rem;
  color: rgba(148, 163, 184, 0.8);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

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

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

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

.modal__body p {
  margin: 0 0 1rem;
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.95rem;
}

.modal__body p:last-child {
  margin-bottom: 0;
}

/* Publication content styling - scoped to modal only */
.modal__body .publication-content {
  font-family: 'Segoe UI', Roboto, sans-serif;
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.6;
  color: var(--text);
}

.modal__body .publication-content h1,
.modal__body .publication-content h2,
.modal__body .publication-content h3,
.modal__body .publication-content h4 {
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.modal__body .publication-content h1 {
  font-size: 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.modal__body .publication-content h2 {
  font-size: 1.5rem;
}

.modal__body .publication-content h3 {
  font-size: 1.25rem;
}

.modal__body .publication-content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--muted);
  font-style: italic;
}

.modal__body .publication-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.modal__body .publication-content th,
.modal__body .publication-content td {
  border: 1px solid var(--border);
  padding: 0.5rem;
  text-align: left;
}

.modal__body .publication-content th {
  background: var(--panel);
  font-weight: 600;
}

.modal__body .publication-content p {
  margin: 1rem 0;
}

.modal__body .publication-content ul,
.modal__body .publication-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.modal__body .publication-content li {
  margin: 0.5rem 0;
}

.modal__body .publication-content code {
  background: var(--panel);
  padding: 0.2rem 0.4rem;
  border-radius: var(--spacing-xs);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.modal__body .publication-content pre {
  background: var(--panel);
  padding: 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1rem 0;
}

.modal__body .publication-content pre code {
  background: none;
  padding: 0;
}

.modal__graph {
  min-height: 320px;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: var(--radius-md);
  background: var(--bg-opacity-light);
}

.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: var(--radius-md);
  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: var(--bg-opacity-medium);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.search-panel input[type="text"] {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-opacity-medium);
  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: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-opacity-medium);
  color: var(--text);
  padding: 0.45rem 0.6rem;
}

.search-panel button {
  border-radius: var(--radius-md);
  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: var(--radius-sm);
  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: var(--radius-lg);
  background: var(--bg-opacity-medium);
  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: var(--radius-sm);
  background: var(--bg-opacity-heavy);
  padding: 0.4rem;
}

.context-menu {
  position: absolute;
  display: none;
  flex-direction: column;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-opacity-strong);
  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);
}

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

.modal__dialog {
  width: fit-content;
  min-width: 400px;
  max-width: 90vw;
  max-height: 90vh;
  background: rgba(10, 18, 35, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-xl);
  padding: 0;
  box-shadow: 0 32px 82px rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal__dialog--md {
  min-width: 500px;
  max-width: 600px;
}

.modal__dialog--lg {
  min-width: 700px;
  max-width: 900px;
}

.modal__dialog--xl {
  min-width: 900px;
  max-width: 1200px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  flex-shrink: 0;
}

.modal__header h2,
.modal__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-white);
  margin: 0;
  line-height: 1.3;
}

.modal__close {
  background: transparent;
  border: none;
  color: var(--text-white);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.modal__close:hover {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-white);
}

.modal__body {
  padding: 1.5rem 1.85rem;
  overflow-y: auto;
  flex: 1;
  color: var(--text-white);
  line-height: 1.6;
}

.modal__body p {
  margin: 0 0 1rem;
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.95rem;
}

.modal__body p:last-child {
  margin-bottom: 0;
}

.modal__body ul,
.modal__body ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.95rem;
}

.modal__body li {
  margin-bottom: 0.5rem;
}

.modal__separator {
  height: 1px;
  background: rgba(148, 163, 184, 0.15);
  margin: 1.5rem 0;
  border: none;
}

.modal__section {
  margin-bottom: 1.5rem;
}

.modal__section:last-child {
  margin-bottom: 0;
}

.modal__section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-white);
  margin: 0 0 0.75rem;
}

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

/* Form grid labels (outside modals) */
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
}

/* Form grid inputs (outside modals) */
.form-grid input,
.form-grid select,
.form-grid textarea {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-opacity-medium);
  color: var(--text);
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-opacity-heavy);
}

.form-grid input::placeholder {
  color: var(--muted);
}

.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: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: var(--bg-opacity-medium);
  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: var(--bg-opacity-heavy);
}

.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: var(--radius-sm);
  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;
  padding: 1rem 1.85rem 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  flex-shrink: 0;
  background: rgba(10, 18, 35, 0.5);
}

.modal__actions button {
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(37, 99, 235, 0.25);
  color: var(--text-white);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.modal__actions button[type="button"] {
  background: var(--bg-opacity-medium);
  color: var(--text-white);
}

.modal__actions button:hover {
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.4);
  border-color: rgba(96, 165, 250, 0.5);
}

.modal__actions button:active {
  transform: translateY(0);
}

/* 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: var(--text-white);
  border: none;
  border-radius: var(--radius-sm);
  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: var(--spacing-xs);
  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: var(--radius-pill);
  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: var(--error);
  color: var(--text-white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.button--danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(248, 113, 113, 0.3);
}

.button--secondary {
  background: var(--muted-dark);
  color: var(--text-white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s ease;
}

.button--secondary:hover {
  background: var(--muted);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.button--warning {
  background: #f59e0b;
  color: var(--text-white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.button--warning:hover {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* 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: var(--accent-light);
  font-variant-numeric: tabular-nums;
}

.expertise-reason {
  font-size: 0.875rem;
  color: var(--muted-dark);
  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: var(--radius-sm);
  border-left: 3px solid var(--accent-light);
}

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

.expertise-item__score {
  font-weight: 600;
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
}

.button--focus {
  background: var(--accent-light);
  color: var(--text-white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.button--focus:hover {
  background: var(--accent);
  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: var(--accent);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.publication-card__separator {
  color: var(--muted);
}

.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: var(--bg-opacity-light);
  border-radius: var(--radius-sm);
  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-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: var(--radius-sm);
  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: var(--bg-opacity-full);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-sm);
  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: var(--text);
  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: var(--bg-opacity-medium);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

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

.extracted-node p {
  color: var(--text);
  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: var(--muted);
  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;
}

.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: var(--radius-sm);
  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: var(--radius-lg);
  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: var(--radius-sm);
  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: var(--text-white);
  border: none;
  border-radius: var(--radius-sm);
  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: var(--radius-sm);
  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: var(--text-white);
}

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

/* Hero mobile styles */
@media (max-width: 768px) {
  .hero {
    min-height: 400px;
  }
  
  .hero__content {
    padding: 2rem 1.5rem;
  }
  
  .hero__title {
    font-size: 2rem;
  }
  
  .hero__subtitle {
    font-size: 1rem;
  }
}

/* Responsive navigation */
@media (max-width: 768px) {
  .workspace__header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg-opacity-heavy);
    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 */
  }

  /* Mobile modal adjustments */
  .modal {
    padding: 0.5rem;
    align-items: flex-start;
    padding-top: 1rem;
  }

  .modal__dialog {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - 2rem) !important;
    margin: 0;
    border-radius: var(--radius-lg);
  }

  .modal__dialog--md,
  .modal__dialog--lg,
  .modal__dialog--xl,
  .modal__dialog--wide {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .modal__header {
    padding: 1rem 1rem 0.75rem;
  }

  .modal__header h2,
  .modal__title {
    font-size: 1.25rem;
  }

  .modal__close {
    width: 28px;
    height: 28px;
    font-size: 1.5rem;
  }

  .modal__body {
    padding: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 12rem); /* Account for header and actions */
  }

  .modal__actions {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .modal__actions button {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }

  /* Adjust form elements for mobile */
  .modal__dialog input,
  .modal__dialog select,
  .modal__dialog textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
  }

  .form-grid textarea {
    min-height: 100px;
  }

  /* Tags input container on mobile */
  .tags-input-container {
    padding: 0.5rem;
    min-height: 2.25rem;
  }

  .tag-chip {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  /* Thematics selection list on mobile */
  .thematics-selection-list {
    max-height: 300px;
  }

  /* Checkpoints list on mobile */
  .checkpoints-list {
    max-height: 300px;
  }
}

/* Canvas control floating button */
.canvas-control-button {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-circle);
  background: var(--accent);
  color: var(--text-white);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.canvas-control-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.canvas-control-button:active {
  transform: translateY(0);
}

.canvas-control-button svg {
  width: 24px;
  height: 24px;
}

/* Canvas modal */
.canvas-modal__content {
  display: grid;
  gap: 2rem;
}

.canvas-modal__section {
  display: grid;
  gap: 1rem;
}

.canvas-modal__section h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.canvas-modal__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Checkpoints list */
.checkpoints-list {
  display: grid;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

/* Thematics selection list (for modal) */
.thematics-selection-list {
  max-height: 400px;
  overflow-y: auto;
  margin-top: 1rem;
}

.thematics-selection-list .thematic-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  background: var(--bg-opacity-medium);
  border: 1px solid rgba(148, 163, 184, 0.15);
  transition: background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.thematics-selection-list .thematic-checkbox-label:hover {
  background: var(--bg-opacity-heavy);
  border-color: rgba(96, 165, 250, 0.3);
}

.thematics-selection-list .thematic-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Thematics list */
.thematics-list {
  display: grid;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.thematic-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.thematic-checkbox-label:hover {
  background: var(--bg-opacity-light);
}

.thematic-checkbox-label input[type="checkbox"] {
  cursor: pointer;
}

.thematics-loading,
.thematics-empty,
.thematics-error {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

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

/* Tags Input Component */
.tags-input-container {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-opacity-medium);
  padding: 0.5rem;
  min-height: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tags-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--accent);
  color: var(--text-white);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  line-height: 1;
  white-space: nowrap;
}

.tag-chip-remove {
  background: none;
  border: none;
  color: var(--text-white);
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
  font-size: 1rem;
  line-height: 1;
}

.tag-chip-remove:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tags-input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.25rem 0.5rem;
  outline: none;
}

.tags-input::placeholder {
  color: var(--muted);
}

.tags-input-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.tag-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tag-suggestion {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.tag-suggestion:hover {
  background: var(--bg-opacity-medium);
}

.tag-suggestion:first-child {
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.tag-suggestion:last-child {
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* Account Page Styles */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-lg);
}

.content-section {
  display: grid;
  gap: var(--spacing-xl);
}

.section-header {
  margin-bottom: var(--spacing-xl);
}

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

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

.account-panel {
  margin-bottom: var(--spacing-2xl);
}

.account-panel:last-child {
  margin-bottom: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

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

.panel-title--danger {
  color: var(--error);
}

.panel-description {
  margin: 0 0 var(--spacing-lg) 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.account-panel--danger {
  border: 2px solid var(--error);
}

/* User Info Styles */
.user-info {
  display: grid;
  gap: var(--spacing-md);
}

.user-info__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.user-info__item:last-child {
  border-bottom: none;
}

.user-info__label {
  font-weight: 500;
  color: var(--muted);
  min-width: 180px;
  flex-shrink: 0;
}

.user-info__value {
  flex: 1;
  color: var(--text);
  font-weight: 500;
}

/* Form Grid for Account Page */
.form-grid--account {
  max-width: 600px;
}

.form-grid--account label {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  font-size: 0.9rem;
  color: var(--text);
}

.form-grid--account input,
.form-grid--account select,
.form-grid--account textarea {
  padding: var(--spacing-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-opacity-medium);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-grid--account input:focus,
.form-grid--account select:focus,
.form-grid--account textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-opacity-heavy);
}

.form-grid--account textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

/* Form Actions */
.form-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
  flex-wrap: wrap;
}

.form-actions--inline {
  margin-top: var(--spacing-md);
}

.form-status {
  color: var(--muted);
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
}

.form-status:empty {
  display: none;
}

/* Button Sizes */
.button--small {
  font-size: 0.875rem;
  padding: var(--spacing-sm) var(--spacing-md);
}

.button--inline {
  margin-left: var(--spacing-md);
}

/* Button Primary */
.button--primary {
  background: var(--accent);
  color: var(--text-white);
  border: none;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.button--primary:hover {
  background: var(--accent-muted);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.button--primary:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .main-content {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
  }

  .user-info__label {
    min-width: 140px;
    font-size: 0.875rem;
  }

  .form-grid--account {
    max-width: 100%;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions button {
    width: 100%;
  }
}

.checkpoint-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-opacity-light);
  gap: 1rem;
}

.checkpoint-info {
  display: grid;
  gap: 0.25rem;
  flex: 1;
}

.checkpoint-info strong {
  color: var(--text);
  font-size: 0.9rem;
}

.checkpoint-date {
  font-size: 0.75rem;
  color: var(--muted);
}

.checkpoint-actions {
  display: flex;
  gap: 0.5rem;
}

.button--small {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.checkpoints-loading,
.checkpoints-empty,
.checkpoints-error {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

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

/* Notification badge */
.notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: #ef4444;
  color: var(--text-white);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.nav-dropdown__item .notification-badge {
  margin-left: auto;
  margin-right: 0.5rem;
}

.nav-link .notification-badge {
  margin-left: 0.5rem;
}

/* Hero Section */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

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

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

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

.hero-heading {
  margin: 0 0 1.5rem;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-white);
  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-white);
  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;
  justify-content: flex-start;
  flex-wrap: wrap;
}

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

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

.cta-secondary {
  padding: 0.9rem 2rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 600;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cta-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Content Section */
.content-section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  scroll-margin-top: 2rem;
}

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

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text);
}

.section-description {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
}

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

.feature-card {
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

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

.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* Auth Container */
.auth-container {
  max-width: 800px;
  margin: 0 auto;
}

.auth-toggle {
  display: inline-flex;
  gap: 0.5rem;
  margin: 0 auto 1.5rem;
  padding: 0.35rem;
  background: var(--bg-opacity-medium);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.auth-toggle__btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.auth-toggle__btn.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--text-white);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.auth-forms {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.auth-form {
  display: none;
  width: min(420px, 100%);
  margin: 0 auto;
}

.auth-form.is-active {
  display: block;
}

@media (max-width: 768px) {
  .auth-forms {
    grid-template-columns: 1fr;
  }
  
  .auth-toggle {
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
  }
  
  .auth-toggle__btn {
    flex: 1;
    text-align: center;
  }
}

/* Scroll Arrow */
.scroll-arrow {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-circle);
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--text-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10;
  animation: bounce 2s infinite;
}

.scroll-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-50%) translateY(-4px);
}

.scroll-arrow--up {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  left: auto;
  transform: none;
  background: var(--accent);
  border-color: var(--accent);
}

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

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

.scroll-arrow--up {
  animation: none;
}

@media (max-width: 768px) {
  .hero-container {
    padding: 3rem 1.5rem;
    text-align: left;
  }
  
  .hero-heading {
    font-size: 2rem;
  }
  
  .hero-description {
    font-size: 1.1rem;
  }
  
  .content-section {
    padding: 3rem 1.5rem;
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .scroll-arrow {
    width: 2.5rem;
    height: 2.5rem;
    bottom: 1.5rem;
  }
  
  .scroll-arrow--up {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

/* Site Header / Navbar */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-opacity-heavy);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 100%;
  margin: 0;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  scroll-behavior: smooth;
  scroll-snap-type: none;
  will-change: scroll-position;
  overscroll-behavior-x: contain;
}

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

.header-brand {
  flex-shrink: 0;
  padding-right: 1rem;
}

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

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: max-content;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: pan-x pan-y;
}

.nav-link:hover {
  background: var(--bg-opacity-light);
  color: var(--accent-light);
}

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

.nav-link--button {
  background: var(--accent);
  color: var(--text-white);
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-link--button:hover {
  background: var(--accent-muted);
  color: var(--text-white);
}

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

.nav-link--admin:hover {
  background: rgba(248, 113, 113, 0.1);
  color: var(--error);
}

@media (max-width: 768px) {
  .header-container {
    padding: 0.5rem 1rem;
    gap: 0.75rem;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .header-nav {
    gap: 0.25rem;
  }

  .nav-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }

  body:not(.graph-fullscreen) {
    padding-top: 65px; /* Increased to ensure content starts below navbar with proper margin on mobile */
  }
}

/* Graph Fullscreen Mode */
html.graph-fullscreen,
html.graph-fullscreen body {
  overflow: hidden !important;
  height: 100vh !important;
  width: 100vw !important;
  position: fixed !important;
  touch-action: none;
  overscroll-behavior: none;
}

body.graph-fullscreen {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  touch-action: none;
  overscroll-behavior: none;
}

body.graph-fullscreen .site-header {
  display: none;
}

.graph-fullscreen-main {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
  z-index: 1;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

.graph-fullscreen-main .workspace__grid {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.graph-fullscreen-main .workspace__canvas {
  height: 100%;
  width: 100%;
  position: relative;
}

.graph-fullscreen-main .search-panel {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  background: var(--bg-opacity-strong);
  border: 1px solid rgba(148, 163, 184, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Floating Menu Button */
.graph-menu-button {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-circle);
  background: var(--accent);
  border: none;
  color: var(--text-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.graph-menu-button:hover {
  background: var(--accent-muted);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.graph-menu-button:active {
  transform: translateY(0);
}

/* Graph Menu Modal */
.graph-menu-modal .modal__dialog {
  max-width: 500px;
}

.graph-menu-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.graph-menu-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.graph-menu-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.graph-menu-badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.graph-menu-select {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-opacity-heavy);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
}

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

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

.graph-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.graph-menu-actions button {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.graph-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.graph-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-opacity-medium);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.graph-menu-link:hover {
  background: var(--bg-opacity-heavy);
  border-color: var(--accent);
}

.graph-menu-link--active {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--accent);
  color: var(--accent);
}

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

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