/* Tokens (colours, type, spacing, themes, dark mode) live in tokens.css, loaded first. */

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

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, color-mix(in srgb, var(--bcg) 3.5%, transparent), transparent 220px),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      color-mix(in srgb, var(--bcg) 2%, transparent) 3px,
      color-mix(in srgb, var(--bcg) 2%, transparent) 4px
    );
  background-attachment: fixed;
}

body.ready .content-inner > .page-header,
body.ready .content-inner > .meeting-hero,
body.ready .content-inner > .briefing-hero,
body.ready .content-inner > .panel:first-of-type,
body.ready .content-inner > .alert:first-of-type {
  animation: paperIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.ready .content-inner > .page-header { animation-delay: 0ms; }
body.ready .content-inner > .briefing-hero,
body.ready .content-inner > .meeting-hero { animation-delay: 50ms; }
body.ready .content-inner > .panel:first-of-type { animation-delay: 80ms; }

@keyframes paperIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.ready .content-inner,
  * {
    animation: none !important;
    transition: none !important;
  }
}

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

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus-color);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 1px;
  box-shadow: var(--focus-ring);
}

/* Instant-nav progress */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  background: transparent;
  opacity: 0;
}

.nav-progress.active {
  opacity: 1;
  background: linear-gradient(90deg, var(--bcg-gold), var(--bcg), var(--bcg-gold));
  background-size: 200% 100%;
  animation: navBar 0.9s ease infinite;
  transform-origin: left;
}

.nav-progress.done {
  animation: none;
  background: var(--bcg-gold);
  opacity: 0;
  transition: opacity 0.3s ease;
}

@keyframes navBar {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* —— App shell (sidebar + main) —— */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-shell.has-sidebar {
  flex-direction: row;
  align-items: stretch;
}

.app-shell.is-viewer {
  background: #1a2420;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.app-main.full-bleed {
  width: 100%;
}

/* Desktop aristocratic sidebar */
.sidebar-nav {
  display: none;
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  flex-direction: column;
  padding: var(--space-5) var(--space-4);
  border-right: 1px solid var(--sidebar-border);
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--sidebar-fg);
  padding: var(--space-2) var(--space-2) var(--space-5);
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: var(--space-4);
}

.sidebar-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  padding: 0;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.sidebar-brand-text .brand-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--sidebar-fg);
}

.sidebar-brand-text .brand-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  color: var(--sidebar-accent);
  letter-spacing: 0.02em;
  font-weight: 600;
}

.sidebar-label {
  margin: 0 0 var(--space-2) var(--space-2);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-accent);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.7rem 0.85rem;
  min-height: 44px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--sidebar-fg);
  opacity: 0.86;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.sidebar-link:hover {
  background: var(--sidebar-active);
  opacity: 1;
}

.sidebar-link.is-active {
  background: var(--sidebar-active);
  opacity: 1;
  box-shadow: inset 3px 0 0 var(--sidebar-accent);
  color: #fff;
}

.sidebar-ico {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  opacity: 0.9;
}

.sidebar-ico svg {
  width: 18px;
  height: 18px;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--sidebar-border);
  display: grid;
  gap: var(--space-3);
}

.sidebar-user {
  display: grid;
  gap: 2px;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--sidebar-accent) 12%, transparent);
  border: 1px solid var(--sidebar-border);
}

.sidebar-user-name {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--sidebar-fg);
}

.sidebar-user-role {
  display: block;
  font-size: 0.72rem;
  color: var(--sidebar-muted);
  margin-top: 1px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 650;
}

.sidebar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.15s ease;
}

.sidebar-logout:hover {
  background: var(--sidebar-active);
}

/* Slim mobile PWA topbar */
.mobile-topbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: calc(var(--safe-top) + 10px) var(--space-4) 10px;
  min-height: calc(52px + var(--safe-top));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.mobile-brand {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--bcg-gold) 45%, var(--border));
  box-shadow: var(--shadow-sm);
}

.mobile-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.mobile-topbar-meta {
  min-width: 0;
  flex: 1;
}

.mobile-page-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--bcg-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-page-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.mobile-topbar.contextual .back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--bcg-dark);
  text-decoration: none;
  background: var(--bcg-soft);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--bcg-dark);
  text-decoration: none;
  background: var(--bcg-soft);
  flex-shrink: 0;
}

.layout {
  display: flex;
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-4);
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-5));
}

.app-shell.no-bottom-pad .layout {
  padding-bottom: var(--space-5);
}

.app-shell.is-viewer .layout {
  max-width: none;
  padding: 0;
  padding-bottom: 0;
}

.content {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.content-inner {
  width: 100%;
}

.app-shell.has-sidebar .content-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.app-shell.has-sidebar .content-inner:has(.mind-map-page),
.app-shell.has-sidebar .content-inner:has(.viewer-panel) {
  max-width: none;
}

.footer {
  display: none;
  padding: var(--space-4) var(--space-5);
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  border-top: 1px solid var(--border);
  background: transparent;
  opacity: 0.85;
}

.brand-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  display: block;
  font-size: 0.75rem;
}

@media (display-mode: standalone), (display-mode: minimal-ui) {
  body {
    -webkit-user-select: none;
    user-select: none;
  }

  body.auth-page .login-shell {
    min-height: 100svh;
  }

  input,
  textarea,
  [contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
  }

  .mobile-topbar {
    padding-top: max(0.55rem, env(safe-area-inset-top));
  }

  .bottom-nav {
    padding-bottom: max(var(--safe-bottom), env(safe-area-inset-bottom));
  }

  .app-main:has(.mind-map-page) {
    height: 100svh;
    max-height: 100svh;
  }

  .install-banner {
    display: none !important;
  }
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(16, 35, 29, 0.06);
}

.bottom-nav a,
.bottom-nav button.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--bottom-nav-h);
  padding: var(--space-2) 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.bottom-nav a.is-active,
.bottom-nav button.nav-tab.is-active {
  color: var(--bcg);
}

.bottom-nav a.is-active .nav-icon,
.bottom-nav button.nav-tab.is-active .nav-icon {
  color: var(--bcg);
}

.bottom-nav a[href*="meetings"].is-active {
  color: var(--bcg-dark);
}

.bottom-nav a[href*="meetings"].is-active .nav-icon {
  color: var(--bcg-gold);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
}

/* More sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 35, 29, 0.4);
  z-index: 60;
}

.more-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-4) var(--space-4) calc(var(--space-5) + var(--safe-bottom));
  box-shadow: var(--shadow-md);
  max-height: 70dvh;
  overflow-y: auto;
}

.more-sheet h2 {
  margin: 0 0 var(--space-3);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.more-sheet-label {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.more-sheet-label:first-of-type {
  margin-top: 0;
}

.more-sheet a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  min-height: 48px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
}

.more-sheet a:hover,
.more-sheet a:active {
  background: var(--bcg-soft);
}

.more-sheet a.danger {
  color: var(--bcg-red);
}

body.sheet-open {
  overflow: hidden;
}

/* FAB */
.fab {
  position: fixed;
  right: var(--space-4);
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-4));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 52px;
  padding: 0 var(--space-4);
  border-radius: 999px;
  background: var(--bcg);
  color: var(--on-primary);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--bcg) 38%, transparent);
  border: none;
  cursor: pointer;
}

.fab:hover {
  background: var(--bcg-dark);
}

.fab-icon {
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 400;
}

/* Install banner */
.install-banner {
  position: fixed;
  left: var(--space-3);
  right: var(--space-3);
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-3));
  z-index: 55;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Author `display: flex` otherwise overrides the HTML [hidden] attribute */
.install-banner[hidden],
.install-banner.is-hidden {
  display: none !important;
}

.install-banner p {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Pull to refresh */
.ptr-indicator {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.2s ease, padding 0.2s ease;
}

.ptr-indicator.visible,
.ptr-indicator.refreshing {
  opacity: 1;
  transform: none;
  max-height: 40px;
  padding: var(--space-2);
}

/* —— Page primitives —— */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.page-header .title-group h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--bcg-dark);
}

.page-header .title-group p {
  margin: var(--space-2) 0 0;
  max-width: 540px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--bcg-soft);
  color: var(--bcg-dark);
  font-weight: 650;
  font-size: 0.8rem;
  white-space: nowrap;
}

.badge-accent {
  background: rgba(244, 200, 31, 0.25);
  color: #6b5500;
}

.badge-danger {
  background: var(--bcg-red-soft);
  color: #8a1f1f;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.panel h2 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--bcg-dark);
}

.panel p,
.panel li {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-2);
  box-shadow: var(--shadow-sm);
  min-height: auto;
}

.stat-card strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bcg-dark);
}

.stat-card span {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.stat-card a {
  color: var(--bcg);
  font-weight: 600;
  text-decoration: none;
}

.stat-card a:hover {
  text-decoration: underline;
}

.action-list {
  display: grid;
  gap: var(--space-2);
}

.action-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  min-height: 56px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.action-row:hover {
  background: var(--bcg-soft);
  border-color: color-mix(in srgb, var(--bcg-gold) 55%, var(--border));
}

.action-row-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bcg-soft);
  color: var(--bcg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.action-row strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
}

.action-row span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.action-row-chevron {
  margin-left: auto;
  color: var(--muted);
  opacity: 0.6;
}

/* Legacy aliases */
.action-grid {
  display: grid;
  gap: var(--space-2);
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.action-card:hover {
  background: var(--bcg-soft);
  border-color: var(--border-strong);
}

.action-card strong {
  color: var(--bcg-dark);
  font-size: 1rem;
}

.action-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Forms */
.form-grid {
  display: grid;
  gap: var(--space-4);
}

.form-group {
  display: grid;
  gap: var(--space-2);
}

label {
  font-weight: 650;
  font-size: 0.875rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--bcg);
  outline: none;
  box-shadow: var(--focus-ring);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.button,
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: none;
  border-radius: var(--radius-md);
  background: var(--bcg);
  color: var(--on-primary);
  padding: 0.7rem 1.1rem;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.button:hover,
button:hover {
  background: var(--bcg-dark);
}

.button:disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.button-secondary:hover {
  background: var(--bcg-soft);
  color: var(--bcg-dark);
}

.button-ghost {
  background: transparent;
  color: var(--bcg);
  border: none;
}

.button-danger {
  background: var(--bcg-red);
}

.button-block {
  width: 100%;
}

.form-actions-sticky {
  position: sticky;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
  padding: var(--space-4) 0 var(--space-2);
  margin-top: var(--space-2);
}

/* Search */
.search-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
}

.search-pipeline li {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bcg-soft) 45%, var(--surface));
}

.search-pipeline span {
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bcg);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.search-pipeline strong {
  font-size: 0.88rem;
  color: var(--text);
}

.search-pipeline em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}

.search-lang-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--space-3);
}

.search-lang-btn {
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}

.search-lang-btn.is-active,
.search-lang-btn.is-active:hover {
  border-color: var(--bcg);
  background: color-mix(in srgb, var(--bcg) 12%, var(--surface));
  color: var(--bcg-dark);
}

.search-lang-hint,
.search-intel-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.search-intel-note {
  margin-top: calc(var(--space-3) * -1);
  margin-bottom: var(--space-4);
}

.search-reason-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.55rem 0 0.35rem;
}

.search-reason-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.search-reason-summary { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.search-reason-chunk { border-color: #bbf7d0; color: #15803d; background: #f0fdf4; }
.search-reason-keyword { border-color: #fde68a; color: #b45309; background: #fffbeb; }
.search-reason-project { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.search-reason-doc_id { border-color: #ddd6fe; color: #6d28d9; background: #f5f3ff; }

.result-snippet {
  margin: 0.35rem 0;
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--bcg-gold);
  background: color-mix(in srgb, var(--bcg-soft) 40%, var(--surface));
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
}

@media (max-width: 820px) {
  .search-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .search-pipeline {
    grid-template-columns: 1fr;
  }
}

.search-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  padding: 3px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.search-tab {
  flex: 1;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  min-height: 40px;
  box-shadow: none;
}

.search-tab:hover {
  background: color-mix(in srgb, var(--bcg) 8%, transparent);
  transform: none;
  box-shadow: none;
}

.search-tab.active {
  color: var(--bcg-dark);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.search-panel {
  display: block;
  margin-bottom: var(--space-4);
}

.search-panel.is-hidden,
.is-hidden {
  display: none !important;
}

.metadata-search-grid {
  grid-template-columns: 1fr;
  margin-bottom: var(--space-4);
}

.metadata-search-grid .form-group label {
  display: block;
}

.metadata-search-grid input {
  display: block;
  min-height: 44px;
}

.search-control {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

@media (min-width: 560px) {
  .search-control {
    grid-template-columns: 1fr auto;
  }
}

.search-results {
  display: grid;
  gap: var(--space-3);
}

.result-card,
.list-row {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.result-card:hover,
.list-row:hover {
  border-color: color-mix(in srgb, var(--bcg-gold) 60%, var(--border));
  box-shadow: var(--shadow-sm);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.result-header h3 {
  margin: 0;
  font-size: 1rem;
}

.result-card p {
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.doc-link {
  color: var(--bcg);
  text-decoration: none;
  font-weight: 650;
}

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

/* Tables → mobile lists */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.data-table th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.mobile-card-list {
  display: none;
  gap: var(--space-3);
}

.mobile-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--surface);
}

.mobile-card h3 {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
}

.mobile-card dl {
  margin: 0;
  display: grid;
  gap: var(--space-1);
  font-size: 0.85rem;
}

.mobile-card dt {
  color: var(--muted);
  display: inline;
}

.mobile-card dd {
  display: inline;
  margin: 0 0 0 0.35rem;
}

@media (max-width: 719px) {
  .table-desktop {
    display: none;
  }
  .mobile-card-list {
    display: grid;
  }
}

/* Meetings */
.meeting-list {
  display: grid;
  gap: var(--space-3);
}

.meeting-card {
  display: block;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.meeting-card:hover {
  border-color: color-mix(in srgb, var(--bcg-gold) 60%, var(--border));
  box-shadow: var(--shadow-sm);
}

.meeting-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.meeting-card-header h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.meeting-card-header h3 a {
  color: var(--bcg-dark);
  text-decoration: none;
}

.meeting-card-header h3 a:hover {
  text-decoration: underline;
}

.meeting-card p {
  margin: 0.25rem 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.checkbox-list {
  display: grid;
  gap: var(--space-2);
  max-height: 260px;
  overflow-y: auto;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 500;
  min-height: 40px;
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--bcg);
}

/* Section tabs (meeting detail) */
.section-tabs {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  margin: 0 0 var(--space-4);
  padding: 4px;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: calc(52px + var(--safe-top));
  z-index: 25;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.section-tabs a {
  flex-shrink: 0;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
  background: transparent;
  border: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.section-tabs a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

/* Alerts */
.alert {
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-weight: 600;
  font-size: 0.9rem;
}

.alert-success {
  background: rgba(22, 124, 73, 0.1);
  border: 1px solid rgba(22, 124, 73, 0.22);
  color: #0f4f2c;
}

.alert-error {
  background: rgba(178, 34, 34, 0.08);
  border: 1px solid rgba(178, 34, 34, 0.22);
  color: #8a1f1f;
}

.demo-hint {
  background: var(--bcg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  color: var(--text);
  line-height: 1.45;
}

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

/* Empty / skeleton */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  background: var(--bcg-soft);
  color: var(--bcg);
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--bcg-gold) 35%, var(--border));
}

.empty-state h3 {
  margin: 0 0 var(--space-2);
  color: var(--bcg-dark);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
}

.empty-state p {
  margin: 0 0 var(--space-4);
  color: var(--muted);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.skeleton {
  background: linear-gradient(90deg, #e8eee9 25%, #f4f7f5 50%, #e8eee9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: 6px;
}

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

.skeleton-list {
  display: grid;
  gap: var(--space-3);
}

.skeleton-row {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: grid;
  gap: var(--space-2);
}

.skeleton-line {
  height: 12px;
}

.skeleton-line.short {
  height: 10px;
}

/* Upload pipeline */
.upload-flow {
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bcg-soft) 70%, var(--surface)) 0%, var(--surface) 100%);
}

.upload-flow-header {
  margin-bottom: var(--space-4);
}

.upload-flow-title {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
  font-weight: 700;
  color: var(--bcg-dark);
}

.upload-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.upload-steps {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 720px) {
  .upload-steps {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
  }
  .upload-split .upload-steps {
    grid-template-columns: 1fr 1fr;
  }
}

.upload-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  min-height: 72px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.upload-step-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.upload-step-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.upload-step-body strong {
  font-size: 0.9rem;
  color: var(--text);
}

.upload-step-body span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.upload-step.is-pending {
  opacity: 0.72;
}

.upload-step.is-active {
  border-color: color-mix(in srgb, var(--bcg-gold) 55%, var(--border));
  background: var(--bcg-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bcg-gold) 16%, transparent);
}

.upload-step.is-active .upload-step-index {
  background: var(--bcg);
  color: #fff;
  border-color: var(--bcg);
  animation: pulseStep 1.1s ease infinite;
}

.upload-step.is-done {
  border-color: color-mix(in srgb, var(--bcg-gold) 40%, var(--border));
  background: color-mix(in srgb, var(--bcg-soft) 55%, var(--surface));
}

.upload-step.is-done .upload-step-index {
  background: var(--bcg);
  color: #fff;
  border-color: var(--bcg);
}

.upload-flow.is-complete .upload-step.is-done .upload-step-index::after {
  content: none;
}

@keyframes pulseStep {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.progress-wrap {
  display: grid;
  gap: var(--space-2);
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--bcg), var(--bcg-gold));
  transition: width 0.45s ease;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding-right: 0.55rem;
  min-width: 0;
}

.progress-fill.is-complete {
  width: 100% !important;
  background: linear-gradient(90deg, var(--bcg-dark), var(--bcg));
}

.progress-fill.indeterminate {
  width: 40% !important;
  animation: indeterminate 1.1s ease infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}

.progress-hint {
  margin: 0;
  font-size: 0.82rem;
}

.upload-state {
  margin-bottom: var(--space-4);
  display: none;
}

.upload-state.is-active {
  display: block;
}

.form-section {
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

/* Viewer immersive */
.viewer-chrome .page-header {
  display: none;
}

body.viewer-chrome,
body.viewer-mode {
  overflow: hidden;
}

.app-shell.is-viewer .layout,
.app-shell.is-viewer .content,
.app-shell.is-viewer .content-inner {
  padding: 0;
  margin: 0;
  max-width: none;
}

.viewer-panel {
  padding: 0;
  margin: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: #121a17;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.viewer-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem 0.85rem;
  padding: calc(var(--safe-top, 0px) + 0.65rem) 0.85rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(20, 32, 28, 0.94);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.viewer-title-block {
  min-width: 0;
}

.viewer-doc-title {
  color: #f3f7f4;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-panel .secure-note {
  color: rgba(200, 220, 210, 0.7);
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

.viewer-status {
  display: none;
}

.viewer-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.viewer-page-info {
  min-width: 3.4rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.78);
  font-variant-numeric: tabular-nums;
}

.viewer-sep {
  width: 1px;
  height: 1.1rem;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 0.15rem;
}

.viewer-controls button,
.viewer-controls a,
.viewer-toolbar .button {
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  min-height: 38px;
  min-width: 38px;
  white-space: nowrap;
}

.viewer-toolbar .button-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.viewer-toolbar .button-secondary:disabled {
  opacity: 0.35;
}

.pdf-viewer-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  background:
    radial-gradient(ellipse at top, rgba(55, 90, 72, 0.22), transparent 55%),
    #121a17;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.pdf-container,
#pdf-container {
  width: 100%;
  overflow: auto;
  padding: 0.85rem;
  -webkit-overflow-scrolling: touch;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#pdf-container canvas {
  display: block;
  margin: 0 auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  max-width: none;
  height: auto;
  border-radius: 2px;
}

.viewer-panel,
.pdf-viewer-frame {
  user-select: none;
}

.page-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.pdf-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 0.14;
  color: #0a2a1f;
  font-size: clamp(0.7rem, 2.2vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 1rem;
  transform: rotate(-24deg);
  white-space: pre-wrap;
  line-height: 1.35;
}

.viewer-loading,
.viewer-error {
  margin: 3rem auto;
  max-width: 26rem;
  text-align: center;
  color: rgba(236, 244, 239, 0.88);
  padding: 1.5rem;
}

.viewer-loading p {
  margin: 0.85rem 0 0;
  color: rgba(220, 232, 226, 0.75);
}

.viewer-spinner {
  width: 2rem;
  height: 2rem;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #8fd6b5;
  animation: viewer-spin 0.8s linear infinite;
}

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

.viewer-error {
  color: #ffc9c9;
  background: rgba(80, 24, 24, 0.35);
  border: 1px solid rgba(255, 140, 140, 0.25);
  border-radius: 12px;
}

.viewer-error p {
  margin: 0.6rem 0 1rem;
  color: rgba(255, 220, 220, 0.85);
}

.viewer-seal-footer {
  margin: 0;
  padding: 0.45rem 0.85rem calc(0.45rem + var(--safe-bottom, 0px));
  font-size: 0.68rem;
  color: rgba(210, 225, 218, 0.55);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #0e1512;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 820px) {
  .viewer-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .viewer-controls {
    grid-column: 1 / -1;
    justify-content: space-between;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .viewer-download {
    margin-left: auto;
  }

  .viewer-sep {
    display: none;
  }
}

@media (max-width: 520px) {
  .viewer-back {
    padding-inline: 0.55rem;
  }

  .viewer-doc-title {
    font-size: 0.82rem;
  }

  .pdf-container,
  #pdf-container {
    padding: 0.5rem;
  }
}

/* Signature */
.sig-wrap {
  display: grid;
  gap: var(--space-3);
}

#sig-pad {
  width: 100%;
  max-width: 100%;
  height: 180px;
  min-height: 160px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  touch-action: none;
  background: #fff;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--bcg-gold) 18%, transparent);
}

.sig-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.attendance-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

/* Login */
body.auth-page {
  background: var(--bg);
}

body.auth-page .app-shell {
  min-height: 100dvh;
}

body.auth-page .sidebar-nav,
body.auth-page .mobile-topbar,
body.auth-page .bottom-nav,
body.auth-page .footer {
  display: none !important;
}

body.auth-page .app-shell.has-sidebar {
  flex-direction: column;
}

body.auth-page .layout {
  padding: 0;
  max-width: none;
  padding-bottom: 0;
}

body.auth-page .content-inner {
  padding: 0;
}

body.auth-page .ptr-indicator {
  display: none !important;
}

.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}

.login-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(200px, 34vh, 320px);
  padding: var(--space-5);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  background: #0b5e45;
  border-bottom: 1px solid rgba(212, 168, 75, 0.22);
}

.login-brand-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
  transform: none;
  filter: none;
}

.login-brand-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.login-brand-scrim--photo {
  background:
    linear-gradient(180deg, rgba(15, 15, 51, 0.08) 0%, rgba(15, 15, 51, 0.04) 55%, rgba(15, 15, 51, 0.72) 100%);
}

.login-brand-inner--minimal {
  margin-top: auto;
}

.login-brand-inner--minimal .brand-tagline-bn,
.login-brand-inner--minimal .brand-tagline {
  text-align: left;
}

.login-brand-stack {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  max-width: 440px;
}

.login-brand-inner {
  position: relative;
  z-index: 3;
  max-width: 440px;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 8px 28px rgba(0, 0, 0, 0.45);
}

.login-brand-logo {
  width: clamp(88px, 16vw, 120px);
  height: clamp(88px, 16vw, 120px);
  object-fit: contain;
  margin-bottom: var(--space-3);
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}

.brand-org-bn {
  margin: 0 0 var(--space-2);
  font-family: var(--font-bengali, "Noto Sans Bengali", sans-serif);
  font-size: 1.05rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}

.login-brand-banner {
  width: min(100%, 420px);
  height: auto;
  object-fit: contain;
  margin-bottom: var(--space-3);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.brand-tagline-bn {
  margin: 0 0 var(--space-2);
  font-family: var(--font-bengali, "Noto Sans Bengali", sans-serif);
  font-size: 1.05rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.95);
}

.login-brand-panel .brand-wordmark {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
}

.login-brand-panel .brand-tagline {
  margin: 0;
  max-width: 340px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.login-brand-footer {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}

.login-brand-credit {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.login-brand-credit a {
  color: #f0d9a0;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.06em;
}

.login-brand-credit a:hover,
.login-brand-credit a:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.login-brand-credit-link {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.login-brand-credit-link:hover,
.login-brand-credit-link:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-4) calc(var(--space-6) + var(--safe-bottom));
  background:
    radial-gradient(ellipse at 80% 0%, color-mix(in srgb, var(--bcg) 8%, transparent), transparent 45%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 3vw, 2.15rem);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: authCardIn 0.45s ease both;
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.auth-card h1 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--bcg-dark);
}

.auth-card > .auth-lead {
  margin: 0 0 var(--space-5);
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.98rem;
}

.auth-card .brand-splash {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.auth-card .brand-splash img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
  filter: drop-shadow(0 2px 6px rgba(26, 26, 84, 0.15));
}

.auth-card .brand-splash strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--bcg-dark);
}

.auth-card .brand-splash span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.auth-kicker {
  margin: 0 0 0.2rem;
  font-family: var(--font-bengali, "Noto Sans Bengali", sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--bcg);
}

.auth-credit {
  display: none;
  margin: var(--space-5) 0 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-credit a {
  color: var(--bcg);
  font-weight: 700;
  text-decoration: none;
}

.auth-credit a:hover,
.auth-credit a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 4.5rem;
}

.password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  min-height: 36px;
  min-width: 3.25rem;
  padding: 0.35rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--bcg);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: none;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--bcg-soft);
  color: var(--bcg-dark);
  transform: translateY(-50%);
}

.auth-card .form-group input:focus-visible {
  border-color: var(--bcg);
}

.auth-card .button-block.is-loading {
  opacity: 0.85;
  cursor: wait;
}

.auth-card .button-block .login-submit-busy {
  display: none;
}

.auth-card .button-block.is-loading .login-submit-busy {
  display: inline;
}

.auth-card .button-block.is-loading .login-submit-label {
  display: none;
}

/* Theme picker */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}

.theme-option {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: left;
  cursor: pointer;
  min-height: 96px;
  display: grid;
  gap: var(--space-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.theme-option:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.theme-option.is-active {
  border-color: var(--bcg);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--bcg) 25%, transparent);
}

.theme-swatch {
  display: flex;
  gap: 4px;
  height: 18px;
}

.theme-swatch span {
  flex: 1;
  border-radius: 4px;
}

.theme-option strong {
  font-size: 0.95rem;
  color: var(--text);
}

.theme-option span.theme-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.search-lang-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.lang-toggle button {
  border: none;
  background: transparent;
  padding: 0.45rem 0.9rem;
  min-height: 40px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.lang-toggle button.is-active {
  background: var(--bcg);
  color: var(--on-primary);
}

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

.result-why {
  margin: 0.35rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #1f6f54) 16%, transparent);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
}

.result-snippet {
  margin: 0.35rem 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
}

.result-meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.field-error {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #b42318;
  font-weight: 600;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: #f04438;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.12);
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.inline-form {
  display: inline;
  margin: 0;
}

.danger-action {
  color: #b42318 !important;
  border-color: rgba(180, 35, 24, 0.35) !important;
}

.user-edit-row td {
  background: color-mix(in srgb, var(--surface, #fff) 92%, #1f6f54 8%);
  padding: 1rem !important;
}

.user-edit-form {
  margin: 0;
}

.form-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.push-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0.75rem 0 0.35rem;
}

@media (max-width: 720px) {
  .result-card .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .result-download {
    margin-left: 0;
    margin-top: 0.35rem;
    display: inline-flex;
  }
}

.page-header .title-group h1 {
  font-family: var(--font-display);
  font-weight: 600;
}

.secure-note {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Desktop layout */
@media (min-width: 900px) {
  .sidebar-nav {
    display: flex;
  }

  .mobile-topbar,
  .bottom-nav,
  .fab,
  .install-banner {
    display: none !important;
  }

  .footer {
    display: block;
  }

  .layout {
    padding: var(--space-7) var(--space-7);
    padding-bottom: var(--space-7);
    max-width: 1120px;
  }

  .app-shell.has-sidebar .layout {
    margin: 0;
    max-width: none;
    padding: var(--space-7) var(--space-8);
  }

  .section-tabs {
    top: var(--space-4);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .metadata-search-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .form-actions-sticky {
    position: static;
    background: none;
    padding: 0;
  }

  .login-shell {
    grid-template-columns: minmax(0, 1.12fr) minmax(380px, 0.88fr);
    min-height: 100dvh;
  }

  .login-brand-panel {
    min-height: 100dvh;
    padding: var(--space-8);
    border-bottom: none;
    border-right: 1px solid rgba(212, 168, 75, 0.22);
  }

  .login-brand-photo {
    object-position: center center;
    z-index: 0;
    filter: none;
  }

  .login-brand-scrim--photo {
    background:
      linear-gradient(105deg, rgba(15, 15, 51, 0.12) 0%, rgba(15, 15, 51, 0.04) 40%, transparent 62%),
      linear-gradient(180deg, rgba(15, 15, 51, 0.06) 0%, transparent 30%, rgba(15, 15, 51, 0.55) 100%);
  }

  .login-brand-stack {
    max-width: 460px;
    gap: var(--space-5);
    padding: var(--space-4) var(--space-4) var(--space-3);
    margin: 0;
    border-radius: 0;
    background: transparent;
  }

  .login-brand-inner {
    z-index: 3;
    padding: 0;
    margin: 0;
    background: none;
  }

  .login-brand-footer {
    padding-top: var(--space-4);
  }

  .login-brand-credit {
    font-size: 0.8rem;
  }

  .login-brand-credit-link {
    font-size: 0.88rem;
  }

  .login-brand-logo {
    width: 72px;
    height: 72px;
    margin-bottom: var(--space-4);
  }

  .login-brand-panel .brand-wordmark {
    font-size: clamp(2.4rem, 3.4vw, 3.35rem);
  }

  .login-brand-panel .brand-tagline {
    font-size: 1.05rem;
    max-width: 360px;
  }

  .login-form-panel {
    padding: var(--space-7) var(--space-6);
  }

  .fab {
    bottom: var(--space-5);
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metadata-search-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .form-actions-sticky {
    position: static;
    background: none;
    padding: 0;
  }
}

@media (max-width: 899px) {
  .app-shell.has-sidebar {
    flex-direction: column;
  }
}

/* Phone + tablet portrait: never overlay HTML on the baked-in lockup */
@media (max-width: 899px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    min-height: 100svh;
  }

  .login-brand-panel {
    min-height: calc(var(--safe-top) + 180px);
    height: calc(var(--safe-top) + min(36dvh, calc(100vw * 2 / 3)));
    max-height: calc(var(--safe-top) + 280px);
    padding: 0;
    justify-content: stretch;
    border-bottom: 0;
  }

  .login-brand-photo {
    inset: var(--safe-top) 0 0 0;
    width: 100%;
    height: calc(100% - var(--safe-top));
    object-fit: contain;
    object-position: center center;
  }

  .login-brand-scrim,
  .login-brand-stack {
    display: none;
  }

  .login-form-panel {
    align-items: flex-start;
    padding: var(--space-5) var(--space-4) calc(var(--space-6) + var(--safe-bottom));
  }

  .auth-card {
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
    max-width: none;
    animation: none;
  }

  .auth-card .brand-splash {
    display: flex;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
  }

  .auth-card h1 {
    font-size: 1.75rem;
  }

  .auth-card .form-group input,
  .auth-card .button-block {
    min-height: 48px;
  }

  .auth-credit {
    display: block;
  }
}

@media (max-width: 767px) {
  .page-header .badge {
    display: none;
  }

  .panel {
    padding: var(--space-4);
    border-radius: var(--radius-md);
  }
}

@media (max-width: 899px) and (max-height: 520px) {
  .login-brand-panel {
    min-height: calc(var(--safe-top) + 112px);
    height: calc(var(--safe-top) + 132px);
    max-height: calc(var(--safe-top) + 140px);
  }
}

@media (max-height: 640px) {
  .login-brand-stack {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card {
    animation: none;
  }
}

/* Document mind map */
.mind-map-page {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
}

.mind-map-page .page-header {
  margin: 0;
  padding: 0 0 var(--space-1);
  gap: var(--space-3);
}

.mind-map-page .page-header .title-group h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
}

.mind-map-page .page-header .title-group p {
  margin: 0;
  max-width: 42rem;
  line-height: 1.45;
}

.neural-detail-kicker,
.viewer-related-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bcg-gold);
}

.mind-map-workspace.panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  min-height: calc(100dvh - 10.5rem);
  margin: 0;
}

.mind-map-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(110px, 140px)) auto;
  gap: var(--space-3);
  align-items: end;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bcg-soft) 55%, var(--surface));
}

.mind-map-toolbar-meta {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.mind-map-focus-label,
.neural-toolbar-group label,
.mind-map-doc-panel-head label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.mind-map-focus-value {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bcg-dark);
  line-height: 1.35;
  word-break: break-word;
}

.neural-toolbar-group {
  display: grid;
  gap: 0.4rem;
}

.neural-toolbar-group select {
  min-height: 40px;
  width: 100%;
}

.mind-map-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: end;
  justify-content: flex-end;
}

.mind-map-toolbar-controls {
  display: contents;
}

.mind-map-mobile-nav,
.mind-map-filters-toggle,
.mind-map-sheet-backdrop,
#mapBrowseDocsBtn {
  display: none;
}

.neural-toolbar-btn {
  white-space: nowrap;
  min-height: 40px;
  padding: 0.55rem 0.95rem;
}

.mind-map-workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.mind-map-step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.mind-map-step span {
  width: 1.55rem;
  height: 1.55rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bcg) 10%, transparent);
  color: var(--bcg);
  font-size: 0.72rem;
  font-weight: 700;
}

.mind-map-step.is-active {
  border-color: color-mix(in srgb, var(--bcg-gold) 50%, var(--border));
  color: var(--text);
  background: color-mix(in srgb, var(--bcg-gold) 10%, var(--surface));
}

.mind-map-step.is-active span {
  background: var(--bcg-gold);
  color: #fff;
}

.mind-map-step.is-done {
  color: var(--text-secondary);
}

.mind-map-step.is-done span {
  background: rgba(45, 154, 114, 0.16);
  color: #2d9a72;
}

.mind-map-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(240px, 300px);
  gap: var(--space-3);
  flex: 1;
  min-height: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
}

.mind-map-layout.has-detail .mind-map-workflow-panel {
  display: none;
}

.mind-map-layout.has-detail .neural-detail-drawer:not([hidden]) {
  display: flex;
}

.mind-map-doc-panel,
.mind-map-canvas-column,
.mind-map-workflow-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.neural-detail-drawer {
  display: none;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

.neural-detail-drawer[hidden] {
  display: none !important;
}

.mind-map-canvas-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 520px;
  border-right: 1px solid var(--border);
  background: var(--bcg-soft);
}

.mind-map-page button.mind-map-view-tab,
.mind-map-page button.mind-map-type-chip,
.mind-map-page button.mind-map-doc-item,
.mind-map-page button.mind-map-overview-card,
.mind-map-page button.mind-map-workflow-doc,
.mind-map-page button.mind-map-mobile-tab,
.mind-map-page button.mind-map-filters-toggle,
.mind-map-page .neural-tree-controls button,
.mind-map-page .neural-detail-close {
  min-height: 0;
  box-shadow: none;
}

.mind-map-visual-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.mind-map-visual-panel[hidden] {
  display: none !important;
}

.nlm-overview-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  margin: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--map-canvas-bg);
  box-shadow: var(--shadow-sm);
}

.nlm-overview-shell .nlm-canvas-header {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
}

.nlm-overview-shell .mind-map-overview-grid {
  flex: 1;
  margin-top: 52px;
  background: transparent;
}

.nlm-canvas.mind-map-canvas,
.neural-tree-shell.nlm-canvas {
  position: relative;
  flex: 1;
  min-height: 520px;
  margin: 12px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--bcg-gold);
  border-radius: 16px;
  overflow: hidden;
  background: var(--map-canvas-bg);
  box-shadow: var(--shadow-sm);
}

.nlm-canvas-header {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  display: flex;
  gap: 8px;
}

.nlm-pills {
  display: inline-flex;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
}

.mind-map-page button.mind-map-view-tab.pill-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.mind-map-page button.mind-map-view-tab.pill-btn:hover {
  background: var(--bcg-soft);
  color: var(--bcg);
}

.mind-map-page button.mind-map-view-tab.pill-btn.is-active,
.mind-map-page button.mind-map-view-tab.pill-btn.is-active:hover {
  background: var(--bcg);
  color: var(--on-primary);
  border-color: var(--bcg);
  box-shadow: inset 0 -2px 0 var(--bcg-gold);
}

.nlm-keyword-tags {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 48%;
}

.nlm-keyword-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}

.nlm-keyword-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--stat-color, var(--edge-keyword));
}

.nlm-canvas-hint {
  position: absolute;
  top: 56px;
  left: 20px;
  z-index: 5;
  margin: 0;
  padding: 4px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  font-size: 11px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.nlm-zoom-toolbar.neural-tree-controls {
  top: 120px;
  right: 16px;
  gap: 6px;
}

.mind-map-page .nlm-zoom-toolbar button.zoom-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--bcg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.mind-map-page .nlm-zoom-toolbar button.zoom-btn:hover {
  background: var(--bcg-soft);
  color: var(--bcg);
}

.nlm-zoom-toolbar button.zoom-btn:last-child {
  width: 32px;
  min-width: 32px;
  padding: 0;
  font-size: 10px;
}

.nlm-legend-bar.neural-tree-legend {
  left: 16px;
  right: 16px;
  bottom: 16px;
  width: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  padding: 8px 20px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.nlm-legend-bar .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.edge-semantic { background: var(--edge-semantic); }
.edge-project { background: var(--edge-project); }
.edge-person { background: var(--edge-person); }
.edge-organization { background: var(--edge-organization); }
.edge-keyword { background: var(--edge-keyword); }

.mind-map-canvas-head,
.mind-map-connection-stats,
.mind-map-view-tabs:not(.nlm-pills) {
  display: none !important;
}

.mind-map-canvas {
  flex: 1;
  min-height: 480px;
  height: 100%;
}

.mind-map-overview-grid {
  flex: 1;
  min-height: 480px;
  overflow: auto;
  padding: var(--space-5);
  display: grid;
  gap: var(--space-5);
  align-content: start;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--bcg-gold) 8%, transparent), transparent 36%),
    var(--surface);
}

.mind-map-overview-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.mind-map-overview-section h3 span {
  color: var(--bcg-gold);
}

.mind-map-overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 0.75rem;
}

.mind-map-overview-card {
  text-align: left;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
}

.mind-map-page button.mind-map-overview-card:hover,
.mind-map-overview-card.is-focused {
  border-color: color-mix(in srgb, var(--bcg-gold) 55%, var(--border));
  background: color-mix(in srgb, var(--bcg-gold) 10%, var(--surface));
  color: inherit;
}

.mind-map-overview-empty,
.mind-map-workflow-empty,
.mind-map-doc-empty {
  margin: 0;
  padding: var(--space-5) var(--space-4);
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.mind-map-workflow-panel-head,
.mind-map-doc-panel-head {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.mind-map-workflow-panel-head h2 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--bcg-dark);
}

.mind-map-workspace.panel .mind-map-workflow-lead,
.mind-map-workspace.panel .mind-map-doc-count,
.mind-map-workspace.panel .neural-map-status {
  color: var(--text-secondary);
}

.mind-map-workflow-panel-head h2 {
  color: var(--bcg-dark);
}

.mind-map-workflow-lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
}

.mind-map-workflow-groups {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.mind-map-workflow-placeholder {
  padding: 1rem 1.05rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bcg-soft) 55%, var(--surface));
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.5;
}

.mind-map-workflow-placeholder p {
  margin: 0;
  font-weight: 700;
  color: var(--bcg-dark);
}

.mind-map-workflow-placeholder ol {
  margin: 0.65rem 0 0;
  padding-left: 1.15rem;
}

.mind-map-relation-guide ul {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.4;
}

.mind-map-relation-guide strong {
  color: var(--text);
}

.mind-map-relation-tip {
  margin: 0.85rem 0 0 !important;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem !important;
  color: var(--muted) !important;
}

.mind-map-load-more {
  width: 100%;
  margin-top: 0.35rem;
}

.mind-map-overview-lead {
  margin: 0 0 0.85rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
}

.mind-map-overview-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.neural-tree-canvas .neural-node-card,
.neural-tree-canvas .nlm-node {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.nlm-canvas-hint,
.nlm-keyword-tags,
.nlm-legend-bar {
  pointer-events: none;
}

.nlm-zoom-toolbar,
.nlm-canvas-header {
  pointer-events: auto;
}

.mind-map-workflow-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.mind-map-workflow-group header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bcg-soft) 70%, var(--surface));
  font-size: 0.8rem;
}

.mind-map-workflow-group header strong {
  flex: 1;
  color: var(--text);
}

.mind-map-workflow-group header span {
  color: var(--muted);
  font-size: 0.72rem;
}

.mind-map-workflow-docs {
  display: grid;
}

.mind-map-workflow-doc {
  display: grid;
  gap: 0.18rem;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.mind-map-workflow-doc:last-child {
  border-bottom: 0;
}

.mind-map-page button.mind-map-workflow-doc:hover,
.mind-map-page button.mind-map-workflow-doc:focus-visible {
  background: color-mix(in srgb, var(--bcg-gold) 10%, var(--surface));
  color: inherit;
  outline: none;
}

.mind-map-workflow-doc-id {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

.mind-map-workflow-doc-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.mind-map-workflow-doc-reason {
  font-size: 0.72rem;
  color: var(--muted);
}

.mind-map-doc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mind-map-type-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  cursor: pointer;
}

.mind-map-page button.mind-map-type-chip:hover {
  background: var(--bcg-soft);
  color: var(--bcg-dark);
}

.mind-map-type-chip.is-active,
.mind-map-page button.mind-map-type-chip.is-active,
.mind-map-page button.mind-map-type-chip.is-active:hover {
  border-color: var(--bcg-gold);
  background: color-mix(in srgb, var(--bcg-gold) 14%, var(--surface));
  color: var(--text);
}

.mind-map-doc-group {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mind-map-doc-group-title {
  margin: 0;
  padding: 0.15rem 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.mind-map-doc-group-title span {
  color: var(--bcg-gold);
}

.neural-node-reason {
  display: block;
  font-size: 0.66rem;
  color: var(--muted);
  line-height: 1.3;
}

.mind-map-mode-workflow .neural-tree-link.is-solid {
  stroke-dasharray: none;
  opacity: 0.95;
}

.mind-map-mode-workflow .neural-tree-link.is-dashed {
  stroke-dasharray: 4 4;
  opacity: 1;
}

.mind-map-doc-panel-head input {
  width: 100%;
  min-height: 40px;
}

.mind-map-doc-count {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.mind-map-doc-list-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.65rem 0.75rem;
}

.mind-map-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.mind-map-doc-item {
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.mind-map-page button.mind-map-doc-item:hover,
.mind-map-page button.mind-map-doc-item:focus-visible {
  border-color: color-mix(in srgb, var(--bcg-gold) 50%, var(--border));
  background: color-mix(in srgb, var(--bcg-gold) 8%, var(--surface));
  color: inherit;
  outline: none;
  transform: none;
}

.mind-map-doc-item.is-focused,
.mind-map-page button.mind-map-doc-item.is-focused {
  border-color: var(--bcg-gold);
  background: color-mix(in srgb, var(--bcg-gold) 12%, var(--surface));
  box-shadow: inset 3px 0 0 var(--bcg-gold);
}

.mind-map-doc-item.is-selected {
  box-shadow: inset 3px 0 0 var(--bcg);
}

.mind-map-doc-id {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

.mind-map-doc-title {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.mind-map-doc-meta {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.neural-tree-shell,
.neural-tree-shell-compact {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--bcg-gold) 11%, transparent), transparent 46%),
    radial-gradient(circle at 14% 12%, color-mix(in srgb, var(--bcg) 8%, transparent), transparent 28%),
    linear-gradient(180deg, var(--surface), var(--bg));
}

.neural-tree-shell.nlm-canvas {
  background: var(--map-canvas-bg);
}

.neural-tree-shell-compact {
  min-height: 220px;
  border-radius: 14px;
}

.viewer-mini-graph.neural-tree-shell-compact {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.08), transparent 45%),
    rgba(255, 255, 255, 0.03);
}

.neural-tree-canvas {
  position: absolute;
  inset: 0;
  cursor: grab;
  touch-action: none;
}

.mind-map-canvas .neural-tree-canvas {
  inset: 72px 56px 64px 16px;
}

.neural-tree-canvas.is-panning {
  cursor: grabbing;
}

.neural-tree-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.neural-tree-link {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.95;
  animation: neural-link-draw 700ms ease forwards;
}

.neural-tree-link.is-dashed {
  stroke-dasharray: 4 4;
  stroke: var(--edge-muted);
  opacity: 1;
}

.neural-tree-link.is-solid {
  stroke-dasharray: none;
  opacity: 0.95;
}

@keyframes neural-link-draw {
  from {
    stroke-dashoffset: 24;
    opacity: 0;
  }
  to {
    stroke-dashoffset: 0;
    opacity: 0.95;
  }
}

.neural-tree-node-wrap {
  overflow: visible;
}

.neural-node-card {
  display: grid;
  align-content: start;
  gap: 0.15rem;
  width: 100%;
  height: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  animation: neural-node-rise 520ms ease both;
}

@keyframes neural-node-rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.neural-node-card:hover,
.neural-node-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--bcg-gold) 55%, var(--border));
  box-shadow: var(--shadow-md);
  outline: none;
}

.neural-node-card.is-selected {
  border-color: var(--bcg-gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bcg-gold) 28%, transparent), var(--shadow-md);
}

.neural-node-center {
  background: var(--bcg);
  color: var(--on-primary);
  border: 2px solid var(--bcg-gold);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--bcg-gold) 18%, transparent), var(--shadow-md);
}

.neural-node-center .neural-node-sub {
  color: color-mix(in srgb, var(--on-primary) 72%, transparent);
}

.neural-node-center .neural-node-eyebrow {
  color: var(--bcg-accent-bright);
}

[data-mode="dark"] .neural-node-center .neural-node-eyebrow {
  color: color-mix(in srgb, var(--on-primary) 72%, transparent);
}

.neural-node-center strong {
  color: var(--on-primary);
}

.neural-node-hub,
.nlm-hub {
  display: grid;
  place-content: center;
  text-align: center;
  padding: 0.55rem 0.75rem;
  border-radius: 28px;
  border: 1.5px dashed var(--border-strong);
  background: var(--surface);
  cursor: default;
  box-shadow: var(--shadow-sm);
}

.neural-node-hub .neural-node-eyebrow {
  letter-spacing: 0.05em;
}

.neural-node-hub strong {
  font-size: 0.72rem;
}

.nlm-doc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.neural-node-eyebrow {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.neural-node-card strong {
  font-size: 0.78rem;
  line-height: 1.25;
  word-break: break-word;
  color: var(--text);
}

.neural-node-sub,
.neural-node-score {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.3;
}

.neural-node-score {
  color: var(--bcg-accent);
  font-weight: 700;
  white-space: nowrap;
}

.neural-tree-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  gap: 0.4rem;
  z-index: 2;
}

.neural-tree-controls button {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

.mind-map-page .neural-tree-controls button:hover {
  background: var(--bcg-soft);
  color: var(--bcg-dark);
}

.neural-tree-controls button:last-child {
  width: auto;
  min-width: 2.4rem;
  padding: 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.neural-tree-hint {
  position: absolute;
  top: 1rem;
  left: 1rem;
  margin: 0;
  z-index: 2;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.neural-tree-legend {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--text-secondary);
  z-index: 2;
}

.mind-map-canvas.is-empty .neural-tree-hint,
.mind-map-canvas.is-empty .neural-tree-legend,
.mind-map-canvas.is-empty .neural-tree-controls,
.mind-map-canvas.is-empty .nlm-canvas-hint,
.mind-map-canvas.is-empty .nlm-legend-bar,
.mind-map-canvas.is-empty .nlm-zoom-toolbar,
.mind-map-canvas.is-empty .nlm-keyword-tags,
.mind-map-canvas.is-loading .neural-tree-hint,
.mind-map-canvas.is-loading .neural-tree-legend,
.mind-map-canvas.is-loading .neural-tree-controls,
.mind-map-canvas.is-loading .nlm-canvas-hint,
.mind-map-canvas.is-loading .nlm-legend-bar,
.mind-map-canvas.is-loading .nlm-zoom-toolbar,
.mind-map-canvas.is-loading .nlm-keyword-tags {
  display: none;
}

.mind-map-canvas.is-updating .neural-tree-canvas {
  opacity: 0.82;
  transition: opacity 120ms ease;
}

.mind-map-canvas.is-updating .neural-tree-link,
.mind-map-canvas.is-updating .neural-node-card {
  animation: none !important;
}

.mind-map-skeleton {
  display: grid;
  gap: 0.65rem;
}

.mind-map-page .skeleton {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--bcg-soft) 80%, var(--border)) 25%,
    var(--surface) 50%,
    color-mix(in srgb, var(--bcg-soft) 80%, var(--border)) 75%
  );
  background-size: 200% 100%;
}

.mind-map-page .skeleton-row {
  padding: 0.75rem 0.8rem;
}

.mind-map-spinner {
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid color-mix(in srgb, var(--bcg-gold) 25%, transparent);
  border-top-color: var(--bcg-gold);
  border-radius: 999px;
  animation: mind-map-spin 0.8s linear infinite;
}

@keyframes mind-map-spin {
  to { transform: rotate(360deg); }
}

.neural-tree-empty .mind-map-spinner {
  display: none;
}

.neural-tree-empty.is-loading .mind-map-spinner {
  display: block;
}

.neural-tree-empty.is-loading .neural-tree-empty-mark {
  display: none;
}

.neural-tree-empty-mark {
  display: block;
}

.edge-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 0.35rem;
  vertical-align: -1px;
}

.neural-tree-empty {
  position: absolute;
  inset: 1.25rem;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  z-index: 3;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.neural-tree-empty[hidden] {
  display: none !important;
}

.neural-tree-empty-icon {
  width: 3.75rem;
  height: 3.75rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bcg-gold) 16%, var(--bcg-soft));
  color: var(--bcg-gold);
  margin-bottom: 1rem;
}

.neural-tree-empty h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--bcg-dark);
}

.neural-tree-empty p {
  margin: 0;
  max-width: 38ch;
  color: var(--text-secondary);
  line-height: 1.55;
}

.neural-tree-empty .button {
  margin-top: var(--space-4);
}

.neural-detail-close {
  align-self: flex-end;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.mind-map-page .neural-detail-close:hover {
  background: var(--bcg-soft);
  color: var(--bcg-dark);
}

.neural-detail-drawer h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--bcg-dark);
}

.neural-detail-meta {
  margin: 0 0 var(--space-3);
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.neural-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: var(--space-3);
}

.neural-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bcg-soft);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
}

.neural-detail-drawer h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.neural-detail-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.neural-detail-list li span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.neural-detail-actions {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.neural-map-status {
  padding: 0.85rem var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
}

.neural-list-score {
  display: inline-block;
  margin-top: 0.2rem;
  font-style: normal;
  font-size: 0.72rem;
  color: #d4af37;
}

.viewer-panel-with-related .viewer-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  flex: 1;
  min-height: 0;
}

.viewer-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.viewer-related-panel {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 16, 14, 0.96);
  color: #eef2ef;
  padding: 0.85rem;
  overflow: auto;
}

.viewer-related-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.viewer-related-head h2 {
  margin: 0;
  font-size: 0.95rem;
  color: #fff;
}

.viewer-related-head .text-link {
  color: #d4af37;
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
}

.viewer-mini-graph {
  height: 220px;
  margin-bottom: 0.65rem;
  overflow: hidden;
}

.viewer-mini-graph .neural-node-card {
  padding: 0.35rem 0.45rem;
  border-radius: 10px;
  box-shadow: none;
}

.viewer-mini-graph .neural-node-card strong {
  font-size: 0.62rem;
}

.viewer-mini-graph .neural-node-sub,
.viewer-mini-graph .neural-node-score,
.viewer-mini-graph .neural-node-eyebrow {
  display: none;
}

.viewer-related-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.viewer-related-list a {
  display: block;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}

.viewer-related-list strong {
  display: block;
  color: #fff;
  font-size: 0.84rem;
}

.viewer-related-list span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.68);
}

.viewer-related-panel .field-hint {
  color: rgba(255, 255, 255, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .neural-tree-link,
  .neural-node-card,
  .mind-map-spinner {
    animation: none;
  }
}

@media (max-width: 1280px) {
  .mind-map-toolbar {
    grid-template-columns: minmax(160px, 1fr) repeat(2, minmax(100px, 130px)) auto;
    padding: var(--space-3);
    gap: var(--space-2);
  }

  .mind-map-workflow-steps,
  .mind-map-layout {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .mind-map-layout {
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(220px, 260px);
    gap: var(--space-2);
    padding-top: var(--space-2);
    padding-bottom: var(--space-3);
  }
}

@media (max-width: 960px) {
  .viewer-panel-with-related .viewer-body {
    grid-template-columns: 1fr;
  }

  .viewer-related-panel {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 360px;
  }
}

@media (max-width: 899px) {
  body:has(.mind-map-page) {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-main:has(.mind-map-page) {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .app-main:has(.mind-map-page) .layout {
    flex: 1;
    min-height: 0;
    max-width: none;
    width: 100%;
    padding: 0;
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
    display: flex;
    flex-direction: column;
  }

  .app-main:has(.mind-map-page) .content,
  .app-main:has(.mind-map-page) .content-inner {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .mind-map-page {
    flex: 1;
    min-height: 0;
    gap: 0;
    display: flex;
    flex-direction: column;
  }

  .mind-map-page .breadcrumbs,
  .mind-map-page .page-header,
  .mind-map-workflow-steps,
  .nlm-canvas-hint,
  .neural-tree-hint {
    display: none !important;
  }

  .mind-map-mobile-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 8px 12px 0;
    padding: 4px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--bcg-soft) 70%, var(--surface));
    border: 1px solid var(--border);
    flex-shrink: 0;
  }

  .mind-map-page button.mind-map-mobile-tab {
    min-height: 40px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: none;
  }

  .mind-map-page button.mind-map-mobile-tab.is-active,
  .mind-map-page button.mind-map-mobile-tab.is-active:hover {
    background: var(--bcg-dark);
    color: #fff;
    transform: none;
  }

  .mind-map-page button.mind-map-mobile-tab:hover {
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    color: var(--text);
  }

  .mind-map-workspace.panel {
    flex: 1;
    min-height: 0;
    margin: 8px 12px 0;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    overflow: hidden;
  }

  .mind-map-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 10px 12px;
    gap: 8px;
  }

  .mind-map-toolbar-controls {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mind-map-workspace.is-filters-open .mind-map-toolbar-controls {
    display: grid;
  }

  .mind-map-filters-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--bcg-dark);
    font-size: 0.78rem;
    font-weight: 700;
  }

  .mind-map-workspace.is-filters-open .mind-map-filters-toggle {
    border-color: color-mix(in srgb, var(--bcg-gold) 55%, var(--border));
    background: color-mix(in srgb, var(--bcg-gold) 14%, var(--surface));
  }

  .mind-map-page button.mind-map-filters-toggle:hover {
    background: var(--surface);
    color: var(--bcg-dark);
  }

  .mind-map-focus-value {
    font-size: 0.86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mind-map-toolbar-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .mind-map-toolbar-actions .button,
  .neural-toolbar-btn {
    flex: 1;
    width: auto;
    min-height: 44px;
  }

  .mind-map-layout,
  .mind-map-layout.has-detail {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    padding: 0;
    flex: 1;
    min-height: 0;
    background: var(--surface);
    overflow: hidden;
  }

  .mind-map-doc-panel,
  .mind-map-canvas-column,
  .mind-map-workflow-panel {
    display: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 0;
    max-height: none;
    height: 100%;
  }

  .mind-map-page[data-mobile-stage="docs"] .mind-map-doc-panel,
  .mind-map-page[data-mobile-stage="map"] .mind-map-canvas-column,
  .mind-map-page[data-mobile-stage="links"] .mind-map-workflow-panel {
    display: flex;
  }

  .mind-map-layout.has-detail .mind-map-workflow-panel {
    display: none;
  }

  .mind-map-page[data-mobile-stage="links"] .mind-map-layout.has-detail .mind-map-workflow-panel {
    display: flex;
  }

  .mind-map-canvas-column {
    border-right: 0;
    background: #eef2f6;
  }

  .nlm-canvas.mind-map-canvas,
  .neural-tree-shell.nlm-canvas,
  .nlm-overview-shell {
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .mind-map-canvas,
  .mind-map-overview-grid {
    min-height: 0;
  }

  .nlm-canvas-header,
  .nlm-overview-shell .nlm-canvas-header {
    position: relative;
    top: auto;
    left: auto;
    padding: 10px 10px 0;
    z-index: 4;
  }

  .mind-map-page button.mind-map-view-tab.pill-btn {
    min-height: 36px;
    padding: 0 14px;
  }

  .nlm-keyword-tags {
    position: relative;
    top: auto;
    right: auto;
    max-width: none;
    padding: 8px 10px 0;
    justify-content: flex-start;
  }

  .nlm-zoom-toolbar.neural-tree-controls {
    top: auto;
    right: 10px;
    bottom: 58px;
  }

  .mind-map-page .nlm-zoom-toolbar button.zoom-btn,
  .nlm-zoom-toolbar button.zoom-btn:last-child {
    width: 44px;
    min-width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .nlm-legend-bar.neural-tree-legend {
    left: 10px;
    right: 10px;
    bottom: 10px;
    gap: 8px 12px;
    padding: 8px 12px;
    border-radius: 16px;
  }

  .mind-map-canvas .neural-tree-canvas {
    inset: 52px 8px 96px 8px;
  }

  .neural-tree-empty {
    inset: 56px 12px 12px;
    padding: 1.25rem 1rem;
  }

  .neural-tree-empty h2 {
    font-size: 1.2rem;
  }

  #mapBrowseDocsBtn {
    display: inline-flex;
    margin-top: var(--space-4);
    min-height: 44px;
  }

  .mind-map-doc-panel-head,
  .mind-map-workflow-panel-head {
    padding: 12px;
  }

  .mind-map-doc-panel-head input {
    min-height: 44px;
    font-size: 16px;
  }

  .mind-map-doc-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mind-map-doc-filters::-webkit-scrollbar {
    display: none;
  }

  .mind-map-page button.mind-map-type-chip {
    flex-shrink: 0;
    min-height: 32px;
  }

  .mind-map-doc-list-wrap,
  .mind-map-workflow-groups {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .mind-map-page button.mind-map-doc-item,
  .mind-map-page button.mind-map-workflow-doc,
  .mind-map-page button.mind-map-overview-card {
    min-height: 52px;
    padding: 0.8rem 0.85rem;
  }

  .neural-map-status {
    padding: 8px 12px;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
  }

  .mind-map-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(16, 18, 36, 0.42);
  }

  .mind-map-sheet-backdrop[hidden] {
    display: none !important;
  }

  .mind-map-layout.has-detail .neural-detail-drawer:not([hidden]),
  .neural-detail-drawer:not([hidden]) {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
    z-index: 56;
    display: flex;
    max-height: min(72dvh, 560px);
    border-radius: 22px 22px 0 0;
    border: 1px solid var(--border);
    box-shadow: 0 -16px 40px rgba(16, 18, 36, 0.18);
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .neural-detail-drawer:not([hidden])::before {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: var(--border-strong, var(--border));
  }

  .mind-map-page .neural-detail-close {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }

  .mind-map-overview-grid {
    padding: 12px;
  }

  .nlm-overview-shell .mind-map-overview-grid {
    margin-top: 0;
  }

  .neural-tree-empty.is-loading #mapBrowseDocsBtn {
    display: none !important;
  }

  .neural-toolbar-group select {
    min-height: 44px;
    font-size: 16px;
  }

  .mind-map-overview-cards,
  .mind-map-overview-types {
    grid-template-columns: 1fr;
  }
}

/* —— Boardroom Paper — premium product surfaces —— */
.banner {
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-weight: 600;
  font-size: 0.9rem;
}
.banner.success {
  background: rgba(22, 124, 73, 0.1);
  border: 1px solid rgba(22, 124, 73, 0.22);
  color: #0f4f2c;
}
.banner.error {
  background: rgba(178, 34, 34, 0.08);
  border: 1px solid rgba(178, 34, 34, 0.22);
  color: #8a1f1f;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-chip-upcoming {
  background: color-mix(in srgb, var(--bcg-gold) 18%, var(--surface));
  color: #6b4e12;
  border-color: color-mix(in srgb, var(--bcg-gold) 45%, var(--border));
}
.status-chip-open {
  background: color-mix(in srgb, var(--bcg) 14%, var(--surface));
  color: var(--bcg-dark);
  border-color: color-mix(in srgb, var(--bcg) 30%, var(--border));
}
.status-chip-closed,
.status-chip-neutral {
  background: var(--bcg-soft);
  color: var(--muted);
  border-color: var(--border);
}
.status-chip-danger {
  background: var(--bcg-red-soft);
  color: #8a1f1f;
  border-color: color-mix(in srgb, var(--bcg-red) 28%, var(--border));
}
.status-chip-approved {
  background: color-mix(in srgb, var(--bcg-gold) 16%, var(--surface));
  color: #5c4310;
  border-color: color-mix(in srgb, var(--bcg-gold) 40%, var(--border));
}
.status-chip-pending {
  background: var(--bcg-soft);
  color: var(--bcg-dark);
  border-color: var(--border);
}

.trust-line {
  margin: var(--space-6) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid color-mix(in srgb, var(--bcg-gold) 35%, var(--border));
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.briefing-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(165deg, var(--bcg-dark) 0%, var(--bcg) 62%, #2a2468 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 3vw, 2rem);
  margin-bottom: var(--space-5);
  border: 1px solid color-mix(in srgb, var(--bcg-gold) 40%, transparent);
  box-shadow: var(--shadow-md);
}
.briefing-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--bcg-gold) 35%, transparent), transparent 70%);
  pointer-events: none;
}
.briefing-kicker {
  margin: 0 0 var(--space-2);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bcg-gold);
  font-weight: 700;
}
.briefing-hero h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
}
.briefing-hero p {
  margin: 0 0 var(--space-4);
  max-width: 38rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.98rem;
  line-height: 1.5;
}
.briefing-hero .button {
  background: var(--bcg-gold);
  color: #1a1408;
}
.briefing-hero .button:hover {
  background: var(--bcg-accent-bright);
  color: #1a1408;
}
.briefing-hero .button-secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.briefing-hero .button-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.briefing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  position: relative;
  z-index: 1;
}

.dest-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
.dest-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 1rem 1.1rem;
  min-height: 76px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.dest-card:hover {
  border-color: color-mix(in srgb, var(--bcg-gold) 55%, var(--border));
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.dest-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bcg-soft);
  color: var(--bcg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.dest-card-icon svg {
  width: 20px;
  height: 20px;
}
.dest-card-copy {
  min-width: 0;
  flex: 1;
}
.dest-card-copy strong {
  display: block;
  font-size: 1rem;
  color: var(--bcg-dark);
  font-weight: 700;
}
.dest-card-copy span {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}
.dest-card-chevron {
  color: var(--bcg-gold);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.stats-grid {
  margin-bottom: var(--space-5);
}
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--bcg-gold);
}

.meeting-group {
  margin-bottom: var(--space-5);
}
.meeting-group-label {
  margin: 0 0 var(--space-3);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bcg-gold);
}
.meeting-list {
  display: grid;
  gap: var(--space-3);
}
.meeting-brief {
  display: flex;
  align-items: stretch;
  gap: var(--space-4);
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  overflow: hidden;
  min-height: 92px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.meeting-brief:hover {
  border-color: color-mix(in srgb, var(--bcg-gold) 65%, var(--border));
  box-shadow: var(--shadow-sm);
}
.meeting-dateblock {
  flex-shrink: 0;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--bcg-dark);
  color: #fff;
  padding: var(--space-3) var(--space-2);
}
.meeting-dateblock-day {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}
.meeting-dateblock-month {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bcg-gold);
}
.meeting-brief-body {
  flex: 1;
  min-width: 0;
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  display: grid;
  align-content: center;
  gap: 0.2rem;
}
.meeting-brief-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.meeting-brief-top h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--bcg-dark);
  line-height: 1.15;
}
.meeting-brief-meta,
.meeting-brief-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.meeting-hero {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding: clamp(1.2rem, 2.5vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--bcg-gold);
}
.meeting-hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}
.meeting-hero h1 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--bcg-dark);
}
.meeting-hero-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.meeting-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.attendance-flag {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bcg-soft);
  border: 1px solid var(--border);
}
.attendance-flag strong {
  display: block;
  font-size: 1.05rem;
  color: var(--bcg-dark);
}
.attendance-flag.is-open {
  background: color-mix(in srgb, var(--bcg) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--bcg) 28%, var(--border));
}

.meeting-hero-copy {
  min-width: 0;
  flex: 1;
}
.meeting-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}
.meeting-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.meeting-hero-facts li {
  position: relative;
}
.meeting-hero-facts li + li::before {
  content: "·";
  position: absolute;
  left: -0.7rem;
  color: color-mix(in srgb, var(--bcg-gold) 70%, var(--muted));
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.panel-head h2 {
  margin: 0;
}

.sitting-ops {
  margin-bottom: var(--space-5);
}
.sitting-ops-head {
  margin-bottom: var(--space-3);
}
.sitting-ops-head h2 {
  margin: 0.15rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--bcg-dark);
}
.sitting-ops-head p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}
.sitting-ops-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 820px) {
  .sitting-ops-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
  }
}
.sitting-card {
  display: grid;
  gap: 0.55rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.sitting-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--bcg-dark);
}
.sitting-card-kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bcg-gold);
}
.sitting-card-lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}
.sitting-card-metric {
  margin: 0.2rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.sitting-card-metric strong {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--bcg-dark);
  line-height: 1;
}
.sitting-card-metric span {
  color: var(--muted);
  font-size: 0.82rem;
}
.sitting-card-state {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.sitting-card-state.is-on {
  color: #0f4f2c;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.sitting-card.is-active {
  border-color: color-mix(in srgb, var(--bcg) 32%, var(--border));
  box-shadow: inset 3px 0 0 var(--bcg);
}
.sitting-card-transcript.is-live {
  border-color: color-mix(in srgb, var(--bcg-gold) 55%, var(--border));
  background:
    radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--bcg-gold) 16%, transparent), transparent 42%),
    var(--surface);
  box-shadow: inset 3px 0 0 var(--bcg-gold);
}
.sitting-card-transcript.is-saved {
  border-color: color-mix(in srgb, var(--bcg-gold) 28%, var(--border));
}
.sitting-card form {
  margin-top: 0.15rem;
}

.tx-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.tx-eq i {
  display: block;
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: var(--bcg-gold);
  animation: tx-eq 0.9s ease-in-out infinite;
}
.tx-eq i:nth-child(2) { animation-delay: 0.12s; height: 12px; }
.tx-eq i:nth-child(3) { animation-delay: 0.24s; height: 8px; }
.tx-eq i:nth-child(4) { animation-delay: 0.36s; height: 14px; }
@keyframes tx-eq {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

.soft-details {
  margin-top: var(--space-4);
  border-top: 1px dashed var(--border);
  padding-top: var(--space-3);
}
.soft-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--bcg-dark);
  font-size: 0.9rem;
}
.soft-details summary:hover {
  color: var(--bcg);
}

.notify-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.transcription-log {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.75rem;
  display: grid;
  gap: 0.7rem;
  max-height: min(42vh, 340px);
  overflow: auto;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bcg-soft) 55%, var(--surface));
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
.transcription-log li {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px 12px 12px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.transcription-speaker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bcg-gold);
}
.transcription-text {
  color: var(--text);
  line-height: 1.45;
  font-size: 0.9rem;
}
.transcription-meta {
  margin-left: 0.45rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.75;
}
.transcription-rewrite {
  display: block;
  margin-top: 0.25rem;
  color: var(--text);
  line-height: 1.45;
  font-size: 0.88rem;
}

.minutes-draft {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  min-height: 18rem;
}

.minutes-locked {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 0;
  max-height: 32rem;
  overflow: auto;
  padding: var(--space-3);
  border: 1px solid var(--border, #d9dee5);
  border-radius: var(--radius-md);
}

.checkin-card .sig-wrap {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bcg-soft) 50%, var(--surface));
  border: 1px dashed color-mix(in srgb, var(--bcg-gold) 40%, var(--border));
}
.checkin-done {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  text-align: center;
}
.checkin-done strong {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--bcg-dark);
}

.agenda-paper {
  white-space: pre-wrap;
  color: var(--text) !important;
  line-height: 1.7;
  font-size: 1.02rem;
  padding: var(--space-4);
  border-left: 3px solid var(--bcg-gold);
  background: color-mix(in srgb, var(--bcg-soft) 40%, var(--surface));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.form-step {
  display: grid;
  gap: var(--space-3);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.form-step:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.form-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--bcg-dark);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  margin-right: 0.5rem;
}
.form-section-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bcg-gold);
  font-weight: 700;
}
.form-hint-inline {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.people-list .checkbox-item {
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.checkbox-list.people-list {
  max-height: 280px;
  background: color-mix(in srgb, var(--bcg-soft) 40%, var(--surface));
}

.invitee-state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.doc-actions .button,
.doc-actions .doc-link {
  min-height: 40px;
}

.search-hero-field #searchQuery {
  min-height: 56px;
  font-size: 1.05rem;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
}
.search-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}
.search-examples span {
  display: inline-flex;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 650;
}
.search-empty {
  text-align: center;
  padding: var(--space-6) var(--space-3);
}

.upload-split {
  display: grid;
  gap: var(--space-5);
}
.file-drop {
  position: relative;
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px dashed color-mix(in srgb, var(--bcg-gold) 45%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bcg-soft) 45%, var(--surface));
  text-align: center;
}
.file-drop input[type="file"] {
  min-height: 48px;
}
.file-drop-label {
  font-weight: 700;
  color: var(--bcg-dark);
}
.upload-flow.is-complete .upload-flow-title::before {
  content: "✓ ";
  color: var(--bcg-gold);
}

.access-card,
.review-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.access-card-top,
.review-card-top {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: flex-start;
}
.access-card h3,
.review-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--bcg-dark);
}
.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.review-actions input[type="number"] {
  width: 4.75rem;
  min-height: 40px;
}
.review-actions input[type="text"] {
  min-width: 10rem;
  flex: 1;
}

.user-edit-row td,
.user-edit-row {
  background: color-mix(in srgb, var(--bcg-soft) 65%, var(--surface)) !important;
}
.user-edit-form {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.mind-map-page .page-header .title-group h1 {
  font-size: clamp(1.7rem, 2.6vw, 2.1rem);
}
.mind-map-workspace {
  border-color: color-mix(in srgb, var(--bcg-gold) 28%, var(--border));
}

.auth-card {
  border-top: 3px solid var(--bcg-gold);
}
.auth-kicker {
  margin: 0 0 2px;
  font-size: 0.78rem;
  color: var(--bcg-gold);
  letter-spacing: 0.04em;
}

.panel-quiet {
  border-color: transparent;
  box-shadow: none;
  background: color-mix(in srgb, var(--bcg-soft) 40%, var(--surface));
}

@media (min-width: 720px) {
  .dest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .upload-split {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    align-items: start;
  }
  .stats-grid.stats-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .stats-grid.stats-compact {
    grid-template-columns: repeat(2, minmax(180px, 280px));
  }
}

@media (max-width: 560px) {
  .meeting-dateblock {
    width: 64px;
  }
  .meeting-dateblock-day {
    font-size: 1.4rem;
  }
  .meeting-brief-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .meeting-hero-actions {
    width: 100%;
  }
  .meeting-hero-actions .button,
  .meeting-hero-actions button,
  .meeting-hero .button {
    width: 100%;
  }
  .sitting-card-metric strong {
    font-size: 1.7rem;
  }
}

[data-mode="dark"] .status-chip-upcoming,
[data-mode="dark"] .status-chip-approved {
  color: var(--bcg-gold);
  background: color-mix(in srgb, var(--bcg-gold) 14%, var(--surface));
}
[data-mode="dark"] .status-chip-open {
  color: var(--bcg-accent-bright);
}
[data-mode="dark"] .meeting-brief-top h3,
[data-mode="dark"] .meeting-hero h1,
[data-mode="dark"] .dest-card-copy strong {
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  .briefing-hero,
  .meeting-brief,
  .dest-card {
    transition: none;
  }
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 var(--space-4);
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--muted);
}
.breadcrumbs a {
  color: var(--bcg);
  text-decoration: none;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}
.breadcrumbs-sep {
  opacity: 0.45;
}

.agenda-list {
  margin: 0;
  padding: 0 0 0 1.2rem;
  display: grid;
  gap: 0.55rem;
  color: var(--text);
}
.agenda-list li {
  color: var(--text);
  line-height: 1.45;
}

.intel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.intel-actions .button {
  max-width: 100%;
  text-align: left;
  justify-content: flex-start;
}

.wizard-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
}
.wizard-progress li {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.wizard-progress li.is-active {
  color: var(--bcg-dark);
  border-color: color-mix(in srgb, var(--bcg-gold) 55%, var(--border));
  background: color-mix(in srgb, var(--bcg-gold) 12%, var(--surface));
}
.wizard-progress li.is-done {
  color: var(--bcg);
}
.wizard-pane[hidden] {
  display: none !important;
}
.wizard-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.review-list {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.review-list div {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}
.review-list dt {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.review-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 650;
}
.req {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bcg-gold);
  margin-left: 0.25rem;
}

/* Ask Sonali */
.ask-panel .panel-header {
  margin-bottom: var(--space-4);
}
.ask-panel .eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bcg-gold);
}
.ask-panel h1 {
  margin: 0 0 0.5rem;
  font-size: 1.55rem;
}
.ask-panel .lede {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.5;
}
.ask-form {
  margin-top: var(--space-4);
}
.ask-form .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: end;
}
.ask-form .form-row .form-group {
  flex: 1 1 10rem;
}
.ask-status {
  margin-top: var(--space-4);
  color: var(--muted);
  font-size: 0.92rem;
}
.ask-answer {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2, transparent);
  white-space: pre-wrap;
  line-height: 1.55;
}
.ask-citations {
  margin-top: var(--space-4);
}
.ask-citations h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.ask-citations ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.55rem;
}
.ask-citations li {
  color: var(--muted);
  line-height: 1.4;
}



/* Two-step verification */
.login-shell--single { grid-template-columns: 1fr; justify-items: center; }
.mfa-steps { margin: 0 0 1rem; padding-left: 1.2rem; line-height: 1.6; }
.mfa-secret {
  display: block;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  font-size: 1rem;
  letter-spacing: 0.08em;
  word-break: break-all;
  background: var(--surface-muted, #f3f4f6);
  border-radius: 6px;
  user-select: all;
}
.mfa-recovery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.mfa-recovery code { font-size: 0.95rem; letter-spacing: 0.05em; }

/* OCR verification: page scan beside its editable text. */
.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.review-image {
  margin: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  overflow: auto;
  max-height: 80vh;
  background: #fff;
}
.review-image img { display: block; width: 100%; height: auto; }
.review-grid textarea {
  width: 100%;
  min-height: 60vh;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}
.badge-warn { background: #fdecc8; color: #7a4b00; }
@media (max-width: 900px) {
  .review-grid { grid-template-columns: 1fr; }
}

.briefing-banner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: var(--space-3, 1rem);
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 2px solid;
}
.briefing-banner strong { text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem; }
.briefing-banner.is-ai_draft {
  border-style: dashed;
  border-color: #c98a00;
  background: repeating-linear-gradient(135deg, #fff8e6, #fff8e6 12px, #fdf0cf 12px, #fdf0cf 24px);
  color: #5c3a00;
}
.briefing-banner.is-management_reviewed { border-color: #2f6db5; background: #eaf2fc; color: #173b66; }
.briefing-banner.is-approved { border-color: #1f7a4a; background: #e7f5ec; color: #0f4429; }
.briefing.is-ai_draft .briefing-section { border-left: 4px dashed #c98a00; }
.briefing.is-management_reviewed .briefing-section { border-left: 4px solid #2f6db5; }
.briefing.is-approved .briefing-section { border-left: 4px solid #1f7a4a; }
.briefing-points { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.5rem; }
.briefing-cite {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.06);
  text-decoration: none;
  white-space: nowrap;
}
.briefing-quote summary, .briefing-edit summary { cursor: pointer; font-size: 0.85rem; color: var(--muted, #666); }
.briefing-quote blockquote { margin: 0.35rem 0 0; padding-left: 0.75rem; border-left: 3px solid rgba(0, 0, 0, 0.15); font-size: 0.9rem; }
.briefing-edit { margin-top: 0.75rem; }
.briefing-edit textarea { width: 100%; font-size: 0.9rem; line-height: 1.5; }
