@font-face {
  font-family: Manrope;
  src: url("assets/manrope-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #f7fbff;
  --muted: #b4c7dd;
  --line: rgba(255, 255, 255, 0.22);
  --panel: rgba(7, 25, 52, 0.8);
  --panel-strong: rgba(11, 36, 72, 0.95);
  --green: #25c2a0;
  --cyan: #8fc9ff;
  --magenta: #9b5de5;
  --amber: #ff6a2a;
  --danger: #ff8b52;
  --yellow: #ffd166;
  --pink: #ef476f;
  --shadow: 0 22px 70px rgba(3, 15, 33, 0.42);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: #ffffff;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

#neuralCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 106, 42, 0.1), transparent 30%),
    radial-gradient(circle at 84% 16%, rgba(37, 194, 160, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.96));
}

.topbar,
main {
  position: relative;
}

main {
  z-index: 2;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr) auto 48px;
  grid-template-rows: auto 48px;
  gap: 10px 16px;
  align-items: center;
  padding: 16px clamp(16px, 4vw, 44px) 20px;
  border-bottom: 1px solid rgba(7, 25, 52, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: #12345c;
  backdrop-filter: blur(18px);
}

.topbar-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  grid-column: 3;
  grid-row: 2;
  align-self: end;
}

.topbar-menu {
  display: contents;
}

.mobile-menu-button {
  display: none;
}

.brand-logo {
  display: inline-flex;
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: start;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  height: 110px;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.brand-logo img {
  display: block;
  width: 100%;
  max-height: 100px;
  object-fit: contain;
  object-position: left center;
}

.info-button {
  display: grid;
  min-width: 38px;
  height: 48px;
  place-items: center;
  padding: 0 14px;
  border: 1px solid rgba(7, 25, 52, 0.16);
  border-radius: 8px;
  background: rgba(7, 25, 52, 0.04);
  color: #12345c;
  cursor: pointer;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid rgba(7, 25, 52, 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: #12345c;
  box-shadow: 0 10px 28px rgba(7, 25, 52, 0.06);
}

.search-wrap {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  min-width: 0;
}

.topbar-title {
  grid-column: 2 / -1;
  grid-row: 1;
  align-self: end;
  margin: 0;
  color: #12345c;
  font-family: Manrope, Inter, system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.info-button.wide {
  white-space: nowrap;
  font-family: Manrope, Inter, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
}

.public-relation-filters {
  display: flex;
  flex-wrap: wrap;
  width: min(720px, 100%);
  gap: 6px;
  justify-content: flex-start;
  margin-top: 0;
}

.public-theme-filter {
  display: inline-grid;
  grid-template-columns: auto 9px auto;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(7, 25, 52, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: #12345c;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
}

.public-theme-filter input {
  width: 13px;
  height: 13px;
  accent-color: var(--green);
}

.public-theme-filter.is-disabled {
  cursor: default;
  opacity: 0.42;
}

.search-results-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: 0;
  z-index: 100;
  max-height: min(520px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 17, 15, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(18px);
}

.search-results-panel .panel-heading {
  padding: 12px 14px;
}

.search-results-panel .results {
  max-height: min(440px, calc(100vh - 178px));
  padding: 12px;
}

.search svg,
.admin-link svg,
.drop-icon svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.search input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #12345c;
}

.search input::placeholder {
  color: rgba(18, 52, 92, 0.58);
}

.admin-link {
  display: grid;
  grid-column: 4;
  grid-row: 2;
  align-self: end;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(7, 25, 52, 0.16);
  border-radius: 8px;
  background: rgba(7, 25, 52, 0.04);
  color: var(--green);
}

.info-dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 24px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border: 1px solid rgba(255, 106, 42, 0.42);
  border-radius: 8px;
  background: rgba(7, 25, 52, 0.98);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.info-dialog::backdrop {
  background: rgba(2, 8, 18, 0.72);
  backdrop-filter: blur(4px);
}

.info-dialog h2 {
  margin: 0 0 12px;
  font-size: 1.45rem;
}

.info-dialog p {
  color: var(--muted);
  line-height: 1.65;
}

.map-info-dialog {
  width: min(760px, calc(100vw - 32px));
}

.map-example {
  position: relative;
  min-height: 230px;
  margin: 14px 0 14px;
  overflow: hidden;
  border: 1px solid rgba(143, 201, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(rgba(143, 201, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 201, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 28% 38%, rgba(79, 156, 251, 0.2), transparent 34%),
    radial-gradient(circle at 72% 56%, rgba(37, 194, 160, 0.16), transparent 30%),
    rgba(3, 15, 35, 0.72);
  background-size: 38px 38px, 38px 38px, auto, auto, auto;
}

.example-card {
  position: absolute;
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  width: 205px;
  aspect-ratio: 205 / 126;
  gap: 5px;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--accent, #4f9cfb) 58%, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 34%),
    linear-gradient(90deg, color-mix(in srgb, var(--accent, #4f9cfb) 16%, transparent), transparent 58%),
    rgba(5, 24, 54, 0.9);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.44), 0 0 32px color-mix(in srgb, var(--accent, #4f9cfb) 34%, transparent);
}

.example-card strong,
.example-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.example-card small {
  color: var(--muted);
}

.example-card.card-a {
  --accent: #4f9cfb;
  left: 16%;
  top: 54%;
  transform: translate(-50%, -50%) scale(0.92);
}

.example-card.card-b {
  --accent: #25c2a0;
  right: 10%;
  top: 36%;
  transform: scale(0.72);
  opacity: 0.72;
}

.example-node,
.example-line,
.legend-pin {
  position: absolute;
  pointer-events: none;
}

.example-node {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--node-color, #4f9cfb);
  box-shadow: 0 0 22px var(--node-color, #4f9cfb);
}

.node-a {
  --node-color: #4f9cfb;
  left: 38%;
  top: 62%;
}

.node-b {
  --node-color: #25c2a0;
  left: 64%;
  top: 44%;
}

.node-c {
  --node-color: #ffd166;
  left: 52%;
  top: 30%;
}

.example-line {
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(143, 201, 255, 0.86), transparent);
  box-shadow: 0 0 16px rgba(79, 156, 251, 0.34);
  transform-origin: left center;
}

.line-a {
  left: 34%;
  top: 61%;
  width: 34%;
  transform: rotate(-33deg);
}

.line-b {
  left: 51%;
  top: 31%;
  width: 22%;
  transform: rotate(33deg);
}

.legend-pin {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: #ff6a2a;
  color: #06111f;
  font-size: 0.82rem;
  font-weight: 950;
  box-shadow: 0 0 22px rgba(255, 106, 42, 0.44);
}

.pin-1 { left: 11%; top: 27%; }
.pin-2 { left: 29%; top: 43%; }
.pin-3 { left: 48%; top: 47%; }
.pin-4 { left: 63%; top: 33%; }
.map-legend {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.map-legend p {
  display: grid;
  grid-template-columns: minmax(120px, 0.36fr) minmax(0, 1fr);
  gap: 14px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.map-legend strong {
  color: var(--ink);
}

.map-legend span {
  color: var(--muted);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.2rem;
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 44px) 44px;
}

.site-footer {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  margin: 0;
  padding: 18px max(clamp(16px, 4vw, 44px), calc((100vw - 1480px) / 2 + 44px));
  background: #ffffff;
  border-top: 1px solid rgba(7, 25, 52, 0.12);
  box-shadow: 0 -12px 34px rgba(7, 25, 52, 0.12);
}

.simple-footer-link {
  display: inline-grid;
  align-items: center;
  justify-items: end;
  gap: 4px;
  color: #12345c;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.92;
  text-decoration: none;
}

.simple-footer-link span {
  color: #12345c;
  font-size: 8px;
  margin-right: 10px;
  margin-bottom: -8px;
  text-align: right;
  text-transform: uppercase;
  line-height: 1;
  order: 1;
}

.simple-footer-link img {
  display: block;
  width: min(160px, 34vw);
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  opacity: 1;
  order: 2;
}

.simple-footer-link:hover {
  color: var(--green);
  opacity: 1;
}

.footer-logo-link {
  display: inline-grid;
  align-items: center;
  justify-items: start;
  gap: 4px;
  padding: 7px 10px;
  border: 1px solid rgba(7, 25, 52, 0.12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(7, 25, 52, 0.08);
  text-decoration: none;
}

.footer-logo-link span {
  color: #12345c;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.footer-logo {
  display: block;
  width: min(130px, 30vw);
  height: auto;
  opacity: 1;
  mix-blend-mode: normal;
}

.public-workspace {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
  min-height: calc(100vh - 138px);
}

.public-workspace::before,
.public-workspace::after {
  position: fixed;
  top: 210px;
  bottom: 96px;
  z-index: 0;
  width: min(240px, 18vw);
  pointer-events: none;
  content: "";
  background-image: url("assets/savoirs-eco-decoration.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.16;
  filter: saturate(1.05);
}

.public-workspace::before {
  left: 10px;
}

.public-workspace::after {
  right: 10px;
  transform: scaleX(-1);
}

.logo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.partner-logo {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 4px 10px;
  align-items: center;
  min-height: 48px;
  color: var(--ink);
}

.partner-logo small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.partner-logo strong {
  font-size: 0.95rem;
}

.logo-shape,
.eu-flag {
  grid-row: span 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  font-weight: 950;
}

.logo-shape {
  background: linear-gradient(135deg, #4f9cfb, #8fc9ff);
  color: white;
}

.logo-shape.eco {
  background: linear-gradient(135deg, #25c2a0, #ffd166);
  color: #062238;
}

.eu-flag {
  background: #244aa5;
  color: #ffd166;
}

.panel,
.graph-shell,
.admin-gate,
.admin-panel {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.graph-shell {
  border-color: rgba(255, 166, 92, 0.58);
  background: #031229;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.graph-shell:fullscreen,
.graph-shell.is-fullscreen-fallback {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.graph-shell.is-fullscreen-fallback {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

body.has-graph-fullscreen {
  overflow: hidden;
}

.graph-shell:fullscreen .document-graph,
.graph-shell.is-fullscreen-fallback .document-graph {
  min-height: 0;
  height: 100%;
}

.panel {
  display: flex;
  min-width: 0;
  min-height: 300px;
  flex-direction: column;
}

.graph-shell {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 76vh;
  overflow: hidden;
  grid-template-rows: auto minmax(680px, 1fr);
}

.graph-shell::before,
.graph-shell::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.graph-shell::before {
  z-index: 0;
  background:
    linear-gradient(rgba(143, 201, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 156, 251, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 48%, black, transparent 78%);
  transform: perspective(780px) rotateX(62deg) translateY(80px);
  transform-origin: 50% 100%;
}

.graph-shell::after {
  z-index: 1;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 7px);
  mix-blend-mode: screen;
  opacity: 0.28;
}

.panel-heading,
.graph-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.graph-toolbar {
  position: relative;
  z-index: 3;
  align-items: center;
  padding: 16px clamp(16px, 3vw, 36px);
}

.graph-toolbar > div:first-child {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.graph-controls {
  display: flex;
  flex: none;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: min(100%, 720px);
}

.pan-controls {
  position: relative;
  display: block;
  width: 86px;
  height: 86px;
  flex: 0 0 86px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.pan-controls .pan-button {
  position: absolute;
  width: 28px;
  height: 28px;
  min-width: 0;
  min-height: 0;
  border-radius: 6px;
}

.pan-controls .pan-button:nth-child(1) {
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
}

.pan-controls .pan-button:nth-child(2) {
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
}

.pan-controls .pan-button:nth-child(3) {
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
}

.pan-controls .pan-button:nth-child(4) {
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
}

.graph-controls > button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
}

.pan-controls button {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
}

.graph-controls > .zoom-reset-button {
  width: 58px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 900;
}

.graph-controls button:disabled {
  cursor: default;
  opacity: 0.38;
}

.graph-controls svg,
.pan-controls svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.fullscreen-exit-icon {
  display: none !important;
}

#fullscreenGraphButton[aria-pressed="true"] .fullscreen-enter-icon {
  display: none;
}

#fullscreenGraphButton[aria-pressed="true"] .fullscreen-exit-icon {
  display: block !important;
}

.pan-controls svg {
  width: 16px;
  height: 16px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2.15rem, 5vw, 4.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro,
.graph-toolbar p,
.form-note {
  color: var(--muted);
  line-height: 1.55;
}

.panel-heading span {
  display: grid;
  min-width: 32px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--green);
  font-weight: 800;
}

.results,
.library {
  display: grid;
  gap: 12px;
  padding: 16px;
  overflow: auto;
}

.library-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 0 16px 14px;
}

.library-tools input {
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.library-pagination {
  display: grid;
  grid-template-columns: auto minmax(78px, auto) auto;
  gap: 8px;
  align-items: center;
}

.library-pagination button {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
}

.library-pagination button:disabled {
  cursor: default;
  opacity: 0.42;
}

.library-pagination span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

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

.result-item,
.doc-item {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.rename-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.rename-form input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
}

.rename-form button {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(79, 156, 251, 0.32);
  border-radius: 8px;
  background: rgba(79, 156, 251, 0.12);
  color: var(--ink);
  cursor: pointer;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.delete-doc-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 111, 145, 0.34);
  border-radius: 8px;
  background: rgba(255, 111, 145, 0.1);
  color: #ff9caf;
  cursor: pointer;
}

.result-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.result-item {
  cursor: pointer;
}

.result-title,
.result-select-button,
.doc-title {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.result-select-button {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.result-open-link,
.result-missing-link {
  padding: 5px 9px;
  border: 1px solid rgba(79, 156, 251, 0.26);
  border-radius: 8px;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.result-missing-link {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.result-item mark {
  border-radius: 3px;
  background: rgba(255, 106, 42, 0.24);
  color: var(--amber);
}

.meta,
.snippet,
.tags {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(143, 201, 255, 0.12);
  color: #bdeeff;
}

.document-graph {
  position: relative;
  z-index: 2;
  min-height: 680px;
  overflow: hidden;
  perspective: 680px;
  perspective-origin: 50% 38%;
  transform-style: preserve-3d;
  cursor: grab;
  touch-action: none;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --pan-x: 0px;
  --pan-y: 0px;
  --focus-x: 0px;
  --focus-y: 0px;
  --graph-zoom: 1;
  --card-face-x: 10deg;
  --card-face-y: 0deg;
}

.document-graph.is-dragging {
  cursor: grabbing;
}

.document-graph.is-dragging .node-card {
  cursor: grabbing;
}

.document-graph.is-panning,
.document-graph.is-panning .node-card {
  cursor: move;
}

.depth-planes {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

.depth-planes span {
  position: absolute;
  left: 8%;
  top: var(--plane-y);
  width: 84%;
  height: 1px;
  transform: translateY(-50%) translateZ(var(--plane-depth)) rotateX(66deg);
  transform-origin: center;
  background: linear-gradient(90deg, transparent, rgba(143, 201, 255, 0.52), rgba(255, 106, 42, 0.26), transparent);
  box-shadow: 0 0 20px rgba(79, 156, 251, 0.24);
}

.depth-planes span::before {
  position: absolute;
  left: 0;
  right: 0;
  top: -44px;
  height: 88px;
  background:
    linear-gradient(rgba(143, 201, 255, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 106, 42, 0.055) 1px, transparent 1px);
  background-size: 32px 22px;
  content: "";
  mask-image: linear-gradient(90deg, transparent, black 18%, black 82%, transparent);
}

.connections-panel {
  position: absolute;
  right: 18px;
  top: 104px;
  z-index: 14;
  width: min(360px, calc(100% - 36px));
  max-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(8, 17, 15, 0.92), rgba(8, 13, 22, 0.9));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42), 0 0 28px rgba(143, 201, 255, 0.14);
  backdrop-filter: blur(16px);
}

.connections-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.connections-heading-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.connections-heading strong {
  display: grid;
  min-width: 28px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--green);
}

.connections-heading button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
}

.connections-heading button:hover {
  border-color: rgba(79, 156, 251, 0.46);
  color: var(--green);
}

.connections-heading button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.connections-list {
  display: grid;
  gap: 8px;
  max-height: 350px;
  padding: 10px;
  overflow-x: hidden;
  overflow-y: auto;
}

.connection-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent, #4f9cfb) 28%, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.selected-document-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 6px;
  align-items: start;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent, #4f9cfb) 48%, rgba(255, 255, 255, 0.16));
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent, #4f9cfb) 18%, transparent), transparent 70%),
    rgba(255, 255, 255, 0.075);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent, #4f9cfb) 18%, transparent);
}

.selected-document-card > div {
  min-width: 0;
}

.selected-document-card > div > span {
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.selected-document-card strong,
.selected-document-card small {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.selected-document-card strong {
  -webkit-line-clamp: 2;
}

.selected-document-card small {
  -webkit-line-clamp: 2;
}

.selected-document-card small {
  color: var(--muted);
  font-size: 0.82rem;
}

.connection-item button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.connection-item button strong,
.connection-item button span,
.connection-item button small {
  grid-column: 1;
}

.connection-item strong,
.connection-item span,
.connection-item small {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.connection-item strong {
  -webkit-line-clamp: 2;
}

.connection-item span,
.connection-item small {
  -webkit-line-clamp: 2;
}

.connection-item span,
.connection-item small,
.empty-connections {
  color: var(--muted);
  font-size: 0.82rem;
}

.selected-document-card a,
.connection-item a {
  grid-column: 1;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.graph-stage {
  position: absolute;
  left: 50%;
  top: 50%;
}

.graph-beams {
  position: absolute;
  inset: 0;
}

.graph-stage {
  transform: translate(-50%, -50%) translate3d(calc(var(--pan-x) + var(--focus-x)), calc(var(--pan-y) + var(--focus-y)), 0) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) scale(var(--graph-zoom));
  transform-origin: center;
  transform-style: preserve-3d;
  transition: transform 140ms ease-out;
  will-change: transform;
}

.three-graph-canvas,
.three-label-links,
.three-label-layer {
  position: absolute;
  inset: 0;
}

.three-graph-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.three-label-layer {
  z-index: 4;
  pointer-events: none;
}

.three-label-links {
  z-index: 3;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(143, 201, 255, 0.24));
}

.three-label-layer .node-card {
  width: 205px;
  aspect-ratio: 205 / 126;
  animation: none;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  transform: translate(-50%, -50%) scale(var(--screen-scale, 1));
  transform-origin: center;
  filter: brightness(var(--depth-brightness, 1)) saturate(var(--depth-saturation, 1)) blur(var(--depth-blur, 0px));
  box-shadow:
    0 18px 48px rgba(0, 0, 0, var(--depth-shadow-alpha, 0.42)),
    0 0 var(--depth-glow, 28px) color-mix(in srgb, var(--accent, #4f9cfb) 38%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: left 120ms ease, top 120ms ease, transform 120ms ease, opacity 120ms ease;
}

.document-graph.is-dragging .three-label-layer .node-card {
  transition: none;
}

.document-graph.is-auto-rotating .three-label-layer .node-card {
  transition: none;
}

.three-label-layer .node-card:hover {
  transform: translate(-50%, -50%) scale(calc(var(--screen-scale, 1) + 0.08));
}

.document-graph.is-dragging .graph-stage {
  transition: none;
}

.graph-beams {
  pointer-events: none;
  transform-style: preserve-3d;
}

.neural-beam {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0, var(--beam-color) 8%, var(--beam-color) 92%, transparent 100%);
  box-shadow:
    0 0 var(--beam-glow) color-mix(in srgb, var(--beam-color) 70%, transparent),
    0 0 calc(var(--beam-glow) * 1.8) color-mix(in srgb, var(--beam-color) 24%, transparent);
  opacity: var(--beam-opacity);
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}

.neural-beam.is-highlighted {
  animation: neuralPulse 7s linear infinite;
}

.neural-beam.is-muted {
  box-shadow: 0 0 10px color-mix(in srgb, var(--beam-color) 40%, transparent);
}

.node-card {
  position: absolute;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: 205px;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 205 / 126;
  align-content: start;
  gap: 8px;
  box-sizing: border-box;
  padding: 13px;
  user-select: none;
  -webkit-user-select: none;
  transform: translate(-50%, -50%) translate3d(0, 0, var(--depth)) rotateY(var(--card-face-y)) rotateX(var(--card-face-x)) rotateY(var(--card-ry, 0deg)) rotateX(var(--card-rx, 0deg)) scale(calc(var(--node-scale, 1) * var(--card-zoom-balance, 1)));
  border: 1px solid color-mix(in srgb, var(--accent, #4f9cfb) 52%, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(90deg, color-mix(in srgb, var(--accent, #4f9cfb) 16%, transparent), transparent 58%),
    #031229;
  box-shadow:
    0 26px 64px rgba(0, 0, 0, 0.56),
    0 0 28px color-mix(in srgb, var(--accent, #4f9cfb) 34%, transparent),
    -10px 0 26px rgba(255, 106, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  overflow: hidden;
  opacity: var(--level-opacity, 1);
  filter: blur(var(--level-blur, 0));
  contain: layout paint;
  transform-style: preserve-3d;
  animation: nodeFloat 6.4s ease-in-out infinite;
  animation-delay: var(--float-delay);
  transition: transform 160ms ease;
  will-change: transform;
}

.node-card.is-muted {
  pointer-events: auto;
}

.node-card:hover {
  border-color: color-mix(in srgb, var(--accent, #ff6a2a) 72%, white);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.54),
    0 0 52px color-mix(in srgb, var(--accent, #ff6a2a) 54%, transparent),
    -16px 0 44px rgba(255, 106, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translate(-50%, -50%) translate3d(0, 0, calc(var(--depth) + 86px)) rotateY(var(--card-face-y)) rotateX(var(--card-face-x)) rotateY(var(--card-ry, 0deg)) rotateX(var(--card-rx, 0deg)) scale(calc((var(--node-scale, 1) + 0.1) * var(--card-zoom-balance, 1)));
  z-index: 1200 !important;
}

.node-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent, #4f9cfb) 78%, white);
  outline-offset: 4px;
}

.node-card.is-active {
  border-color: color-mix(in srgb, var(--accent, #ff6a2a) 82%, white);
  box-shadow:
    0 34px 78px rgba(0, 0, 0, 0.58),
    0 0 54px color-mix(in srgb, var(--accent, #ff6a2a) 54%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.connection-count {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  min-width: 28px;
  height: 24px;
  place-items: center;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--accent, #4f9cfb) 46%, rgba(255, 255, 255, 0.16));
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(5, 24, 54, 0.88), rgba(8, 35, 76, 0.84));
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent, #4f9cfb) 24%, transparent);
  transform: translateZ(42px);
}

.card-open-link {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent, #4f9cfb) 48%, rgba(255, 255, 255, 0.18));
  border-radius: 8px;
  background: rgba(5, 24, 54, 0.84);
  color: var(--ink);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent, #4f9cfb) 24%, transparent);
  transform: translateZ(48px);
}

.card-open-link:hover {
  border-color: color-mix(in srgb, var(--accent, #ff6a2a) 78%, white);
  color: var(--amber);
}

.card-open-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.card-readable {
  display: grid;
  grid-template-rows: max-content minmax(0, 1fr);
  width: calc(100% - 42px);
  max-width: calc(100% - 42px);
  min-width: 0;
  height: 90px;
  min-height: 90px;
  max-height: 90px;
  gap: 5px;
  overflow: hidden;
  transform: translateZ(18px);
  transform-origin: left center;
  transform-style: preserve-3d;
}

.card-readable strong,
.card-readable small {
  display: block;
}

.node-card strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.16;
}

.node-card small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

@keyframes neuralPulse {
  0% {
    opacity: 0.42;
  }

  50% {
    opacity: 0.95;
  }

  100% {
    opacity: 0.42;
  }
}

@keyframes nodeFloat {
  0%,
  100% {
    margin-top: -7px;
  }

  50% {
    margin-top: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .neural-beam,
  .node-card {
    animation: none;
  }

  .graph-stage,
  .node-card {
    transition: none;
  }
}

.admin-view {
  display: grid;
  gap: 18px;
}

.admin-gate,
.admin-panel {
  padding: clamp(20px, 4vw, 34px);
}

.admin-gate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: start;
  min-height: 420px;
}

.admin-gate > div {
  align-self: start;
  text-align: left;
}

.admin-login {
  display: grid;
  gap: 10px;
}

.admin-login label {
  color: var(--muted);
  font-weight: 700;
}

.admin-login > input {
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.login-row input,
.captcha-row input {
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.captcha-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.captcha-row strong {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid rgba(79, 156, 251, 0.26);
  border-radius: 8px;
  background: rgba(79, 156, 251, 0.1);
  color: var(--cyan);
  white-space: nowrap;
}

.captcha-row button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
}

.captcha-row svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.admin-actions,
.login-row {
  align-items: center;
}

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

.admin-actions a,
.admin-actions button,
.login-row button {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 18px;
}

.settings-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(280px, 1.08fr);
  gap: 16px;
}

.settings-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.theme-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-option {
  display: inline-grid;
  grid-template-columns: auto 12px auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.theme-option input {
  accent-color: var(--green);
}

.theme-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--theme-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--theme-color) 75%, transparent);
}

.settings-panel textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: inherit;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.settings-actions button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(79, 156, 251, 0.34);
  border-radius: 8px;
  background: rgba(79, 156, 251, 0.14);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.settings-actions small {
  color: var(--cyan);
  font-weight: 800;
}

.drop-zone {
  display: grid;
  min-height: 340px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  border: 1px dashed rgba(143, 201, 255, 0.56);
  border-radius: 8px;
  background: rgba(8, 17, 15, 0.62);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}

.drop-zone input {
  display: none;
}

.drop-zone.is-dragging {
  border-color: var(--green);
  background: rgba(79, 156, 251, 0.13);
}

.drop-zone strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.upload-status {
  max-width: 100%;
  overflow: hidden;
  color: var(--cyan);
  font-size: 0.84rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  background: rgba(143, 201, 255, 0.16);
  color: var(--cyan);
}

.form-note {
  min-height: 22px;
  margin-bottom: 0;
  color: var(--danger);
}

@media (min-width: 1341px) {
  .topbar {
    padding: 20px 24px;
  }

  .brand-logo {
    height: 115px;
  }

  .topbar-title,
  .search-wrap,
  .topbar-actions,
  .admin-link {
    transform: translateY(-18px);
  }
}

@media (min-width: 1550px) {
  .topbar-title {
    font-size: 1.125rem;
  }
}

@media (max-width: 1450px) {
  .topbar-title {
    font-size: 0.99rem;
  }
}

@media (min-width: 1341px) and (max-width: 1380px) {
  .topbar-title {
    font-size: 0.96rem;
  }
}

@media (max-width: 1340px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto 48px;
    grid-template-rows: auto auto 48px;
  }

  .brand-logo {
    grid-column: 1 / -1;
    grid-row: 1;
    width: min(620px, 100%);
  }

  .topbar-title {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 1.15rem;
    text-align: center;
  }

  .search-wrap {
    grid-column: 1;
    grid-row: 3;
  }

  .topbar-actions {
    grid-column: 2;
    grid-row: 3;
  }

  .admin-link {
    grid-column: 3;
    grid-row: 3;
  }
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto 48px;
    grid-template-rows: auto auto 48px;
  }

  .brand-logo {
    grid-column: 1 / -1;
    grid-row: 1;
    width: min(540px, 100%);
    height: 90px;
  }

  .brand-logo img {
    max-height: 118px;
  }

  .search-wrap {
    grid-column: 1;
    grid-row: 3;
    align-self: center;
  }

  .topbar-actions {
    grid-column: 2;
    grid-row: 3;
    align-self: end;
  }

  .admin-link {
    grid-column: 3;
    grid-row: 3;
    align-self: end;
  }

  .public-workspace,
  .admin-grid,
  .settings-grid,
  .admin-gate {
    grid-template-columns: 1fr;
  }

  .panel,
  .graph-shell {
    min-height: 360px;
  }
}

@media (min-width: 761px) and (max-width: 1080px) {
  .topbar-title {
    font-size: 0.98rem;
  }
}

@media (min-width: 761px) and (max-width: 820px) {
  .topbar-title {
    font-size: 0.9rem;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) 48px;
    grid-template-rows: auto auto auto;
    gap: 8px 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .brand-logo {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    width: 100%;
    height: 64px;
    padding: 4px 0;
  }

  .brand-logo img {
    max-height: 60px;
  }

  .mobile-menu-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    grid-column: 2;
    grid-row: 1;
    gap: 4px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(7, 25, 52, 0.16);
    border-radius: 8px;
    background: rgba(7, 25, 52, 0.04);
    color: #12345c;
    cursor: pointer;
  }

  .mobile-menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
  }

  .library-tools {
    grid-template-columns: 1fr;
  }

  .library-pagination {
    grid-template-columns: 1fr auto 1fr;
  }

  .search-wrap {
    grid-column: 1 / -1;
    grid-row: 3;
    align-self: stretch;
    min-width: 0;
  }

  .topbar-title {
    font-size: 1.4rem;
    white-space: normal;
    text-wrap: balance;
  }

  .public-relation-filters {
    display: none;
  }

  .public-workspace::before,
  .public-workspace::after {
    display: none;
  }

  .topbar-menu {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(7, 25, 52, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 44px rgba(7, 25, 52, 0.16);
  }

  .topbar.is-menu-open .topbar-menu {
    display: inline-flex;
  }

  .topbar.is-menu-open .search-wrap {
    grid-row: 4;
  }

  .topbar.is-menu-open .topbar-title {
    grid-row: 3;
  }

  .topbar-actions {
    grid-column: auto;
    grid-row: auto;
    justify-content: end;
  }

  .info-button.wide {
    width: min(180px, 48vw);
    height: auto;
    min-height: 48px;
    white-space: normal;
    line-height: 1.2;
  }

  .admin-link {
    grid-column: auto;
    grid-row: auto;
    justify-self: end;
  }

  .logo-strip {
    justify-content: start;
  }

  .public-workspace {
    min-height: auto;
  }

  .graph-shell {
    grid-template-rows: auto minmax(430px, 1fr);
  }

  .graph-toolbar {
    display: grid;
    gap: 14px;
    align-items: start;
  }

  .graph-controls {
    width: 100%;
    max-width: 100%;
    justify-content: start;
    gap: 4px;
  }

  .graph-controls > button {
    width: 32px;
    height: 32px;
  }

  .graph-controls > .zoom-reset-button {
    width: 44px;
  }

  .pan-controls {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
  }

  .pan-controls .pan-button {
    width: 21px;
    height: 21px;
  }

  .document-graph {
    min-height: 430px;
  }

  h1 {
    font-size: clamp(2.3rem, 14vw, 3.7rem);
  }

  .admin-header {
    display: grid;
  }

  .login-row {
    grid-template-columns: 1fr;
  }

  .captcha-row {
    grid-template-columns: 1fr minmax(0, 1fr) 44px;
  }
}
