/* =============================================================================
   GSSV Labs - global design system
   Dark futuristic engineering laboratory. Deep near-black surfaces, hairline
   borders, restrained glow, mono typography for technical metadata.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;450;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Surfaces */
  --bg: #06070a;
  --bg-elevated: #0b0e13;
  --surface: #0c1017;
  --surface-2: #11161f;
  --surface-3: #161c26;

  /* Lines */
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --line-focus: rgba(45, 212, 191, 0.55);

  /* Text */
  --text: #e9edf4;
  --text-soft: #b6bfcf;
  --muted: #838ea1;
  --dim: #5b6577;

  /* Signal colours */
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-line: rgba(45, 212, 191, 0.32);
  --blue: #4f8dff;
  --violet: #7c5cff;
  --amber: #f5b14c;
  --danger: #f2585b;

  /* Status */
  --status-active: #2dd4bf;
  --status-pending: #f5b14c;
  --status-rejected: #f2585b;
  --status-neutral: #838ea1;

  /* Type */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* Shape */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 140ms;
  --t-med: 240ms;

  --shell-max: 1240px;
}

/* ----------------------------------------------------------------- reset */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The faint laboratory grid. Fixed so it never scrolls with content. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 100% 70% at 50% 0%, #000 35%, transparent 85%);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  top: -30vh;
  left: 50%;
  width: 90vw;
  max-width: 1100px;
  height: 70vh;
  transform: translateX(-50%);
  z-index: -1;
  background: radial-gradient(ellipse at center, rgba(45, 212, 191, 0.07), transparent 65%);
  pointer-events: none;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.4em;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}
h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
}
h3 {
  font-size: 1.08rem;
}

p {
  margin: 0 0 1rem;
  color: var(--text-soft);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
a:hover {
  color: #7ef0e0;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

/* ------------------------------------------------------------ scrollbars */

/*
 * Thin, unobtrusive scrollbars that belong to the dark surface rather than
 * cutting a bright channel through it. Firefox gets the two-property standard;
 * Chromium and Safari get the pseudo-elements, where a transparent border plus
 * background-clip keeps the thumb inset from the track edge.
 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.14);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
  transition: background-color var(--t-fast) var(--ease);
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.26);
}

::-webkit-scrollbar-thumb:active {
  background-color: var(--accent);
}

/* Where two scrollbars meet, so the square does not sit lighter than the page. */
::-webkit-scrollbar-corner {
  background: transparent;
}

/* The page scrollbar sits against the site background, not a panel. */
html {
  scrollbar-color: rgba(255, 255, 255, 0.18) var(--bg);
}
html::-webkit-scrollbar-track {
  background: var(--bg);
}

/*
 * Panels, tables and the admin sidebar scroll inside their own surface, so the
 * thumb picks up the accent to read as part of the component.
 */
.panel,
.modal,
.table-wrap,
.admin-side,
.textarea,
.chart-frame {
  scrollbar-color: rgba(45, 212, 191, 0.28) transparent;
}

.panel::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.admin-side::-webkit-scrollbar-thumb,
.textarea::-webkit-scrollbar-thumb,
.chart-frame::-webkit-scrollbar-thumb {
  background-color: rgba(45, 212, 191, 0.28);
}

.panel::-webkit-scrollbar-thumb:hover,
.modal::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.admin-side::-webkit-scrollbar-thumb:hover,
.textarea::-webkit-scrollbar-thumb:hover,
.chart-frame::-webkit-scrollbar-thumb:hover {
  background-color: rgba(45, 212, 191, 0.5);
}

/* Horizontal table scrollers are shorter, so the bar stays out of the way. */
.table-wrap::-webkit-scrollbar {
  height: 9px;
}
.table-wrap::-webkit-scrollbar-thumb {
  border-width: 2px;
}

/* ------------------------------------------------------------ a11y focus */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: #04211d;
  padding: 0.6rem 1rem;
  font-weight: 600;
  border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus {
  left: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------- layout */

.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 24px;
}

.stack > * + * {
  margin-top: var(--gap, 1rem);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 18px;
}

.page {
  padding: 40px 0 96px;
}

/* ------------------------------------------------------------ mono label */

.mono {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  display: inline-block;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.lede {
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 62ch;
}

/* --------------------------------------------------------------- surface */

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0.008));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  backdrop-filter: blur(8px);
}

.panel-flush {
  padding: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 1rem;
}

/* --------------------------------------------------------------- buttons */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  padding: 0.68rem 1.15rem;
  border-radius: var(--r-md);
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease), color var(--t-fast) var(--ease);
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.24);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  --btn-bg: linear-gradient(180deg, rgba(45, 212, 191, 0.22), rgba(45, 212, 191, 0.1));
  --btn-fg: #b8fff3;
  --btn-line: var(--accent-line);
  box-shadow: 0 0 0 0 rgba(45, 212, 191, 0);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(45, 212, 191, 0.32), rgba(45, 212, 191, 0.16));
  border-color: rgba(45, 212, 191, 0.5);
  box-shadow: 0 0 24px -6px rgba(45, 212, 191, 0.45);
  color: #d6fff8;
}

.btn-solid {
  --btn-bg: var(--accent);
  --btn-fg: #032925;
  --btn-line: transparent;
  font-weight: 600;
}
.btn-solid:hover:not(:disabled) {
  background: #4ce3d0;
  border-color: transparent;
}

.btn-danger {
  --btn-fg: #ffb3b5;
  --btn-line: rgba(242, 88, 91, 0.35);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(242, 88, 91, 0.14);
  border-color: rgba(242, 88, 91, 0.55);
}

.btn-ghost {
  --btn-line: transparent;
  --btn-fg: var(--muted);
  padding: 0.5rem 0.75rem;
}
.btn-ghost:hover:not(:disabled) {
  --btn-fg: var(--text);
}

.btn-sm {
  font-size: 0.78rem;
  padding: 0.45rem 0.8rem;
}
.btn-block {
  width: 100%;
}

/* Inline spinner used inside buttons during submits */
.btn.is-loading {
  color: transparent !important;
  position: relative;
  pointer-events: none;
}
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ----------------------------------------------------------------- chips */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.26rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}

.chip-pip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.chip-active,
.chip-approved {
  color: var(--status-active);
  border-color: rgba(45, 212, 191, 0.3);
  background: rgba(45, 212, 191, 0.08);
}
.chip-pending,
.chip-coming_soon {
  color: var(--status-pending);
  border-color: rgba(245, 177, 76, 0.3);
  background: rgba(245, 177, 76, 0.08);
}
.chip-rejected,
.chip-maintenance {
  color: var(--status-rejected);
  border-color: rgba(242, 88, 91, 0.3);
  background: rgba(242, 88, 91, 0.08);
}
.chip-revoked,
.chip-archived {
  color: var(--status-neutral);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
}
.chip-lock {
  color: var(--amber);
  border-color: rgba(245, 177, 76, 0.28);
  background: rgba(245, 177, 76, 0.07);
}
.chip-version {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
}

/* ----------------------------------------------------------------- forms */

.field {
  display: block;
  margin-bottom: 18px;
}

.field > label,
.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.input,
.select,
.textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 0.72rem 0.85rem;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}

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

.input::placeholder,
.textarea::placeholder {
  color: var(--dim);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--line-focus);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}

.input[readonly] {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.015);
  cursor: default;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}
.select option {
  background: var(--surface-2);
  color: var(--text);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--dim);
  margin-top: 7px;
}

.field-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 7px;
  min-height: 1em;
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: rgba(242, 88, 91, 0.6);
  animation: shake 260ms var(--ease);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.char-counter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--dim);
  letter-spacing: 0.08em;
}
.char-counter.is-near {
  color: var(--amber);
}
.char-counter.is-over {
  color: var(--danger);
}

.form-error {
  border: 1px solid rgba(242, 88, 91, 0.35);
  background: rgba(242, 88, 91, 0.08);
  color: #ffc0c2;
  border-radius: var(--r-md);
  padding: 0.7rem 0.9rem;
  font-size: 0.86rem;
  margin-bottom: 16px;
}
.form-error:empty {
  display: none;
}

/* -------------------------------------------------------------- markdown */

/*
 * Rendered project descriptions. Sized to sit inside a panel: headings start
 * at h3 because the page already owns h1 and h2, and the vertical rhythm is
 * tighter than page-level prose so a long description stays scannable.
 */
.markdown {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-soft);
  overflow-wrap: break-word;
}

.markdown > *:first-child {
  margin-top: 0;
}
.markdown > *:last-child {
  margin-bottom: 0;
}

.markdown p {
  margin: 0 0 1em;
}

.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
  color: var(--text);
  margin: 1.7em 0 0.6em;
  line-height: 1.3;
}
.markdown h3 {
  font-size: 1.12rem;
  letter-spacing: -0.015em;
}
.markdown h4 {
  font-size: 1rem;
}
.markdown h5,
.markdown h6 {
  font-size: 0.9rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.markdown strong {
  color: var(--text);
  font-weight: 600;
}
.markdown em {
  font-style: italic;
}
.markdown del {
  color: var(--dim);
}

.markdown a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(45, 212, 191, 0.35);
  text-underline-offset: 2px;
}
.markdown a:hover {
  text-decoration-color: var(--accent);
}

.markdown ul,
.markdown ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
}
.markdown li {
  margin-bottom: 0.4em;
}
.markdown li::marker {
  color: var(--dim);
}
.markdown ul ul,
.markdown ol ol,
.markdown ul ol,
.markdown ol ul {
  margin: 0.4em 0 0;
}

.markdown blockquote {
  margin: 0 0 1em;
  padding: 0.1em 0 0.1em 1em;
  border-left: 2px solid var(--accent-line);
  color: var(--muted);
}

.markdown code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: #b8fff3;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.12em 0.38em;
}

.markdown pre {
  margin: 0 0 1em;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow-x: auto;
}
.markdown pre code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.6;
}

/* The language tag sits in the corner of a fenced block. */
.markdown pre[data-lang]::before {
  content: attr(data-lang);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}

.markdown hr {
  margin: 1.6em 0;
}

.markdown-table-wrap {
  overflow-x: auto;
  margin: 0 0 1em;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.markdown-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.markdown-table-wrap th,
.markdown-table-wrap td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.markdown-table-wrap th {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.014);
}
.markdown-table-wrap tr:last-child td {
  border-bottom: 0;
}

/* Editor: monospace input, and a preview that mirrors the published page. */
.markdown-input {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
  resize: vertical;
}

.markdown-preview {
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.022);
}

/* ---------------------------------------------------------------- tables */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 0.86rem;
}

table.data th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.014);
}

table.data td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  vertical-align: middle;
}

table.data tbody tr {
  transition: background var(--t-fast) var(--ease);
}
table.data tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
table.data td strong {
  color: var(--text);
  font-weight: 550;
}

.cell-mono {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.cell-truncate {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------- states: empty */

.state {
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.012);
}
.state-glyph {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--dim);
  letter-spacing: 0.2em;
  margin-bottom: 14px;
}
.state h3 {
  margin-bottom: 6px;
}
.state p {
  color: var(--muted);
  max-width: 44ch;
  margin: 0 auto 18px;
  font-size: 0.9rem;
}
.state-error {
  border-color: rgba(242, 88, 91, 0.3);
  background: rgba(242, 88, 91, 0.04);
}

/* ------------------------------------------------------ states: skeleton */

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.045);
  border-radius: var(--r-sm);
  color: transparent !important;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  background: rgba(255, 255, 255, 0.012);
}
.skeleton-line {
  height: 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------- toasts */

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 0.86rem;
  color: var(--text-soft);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
  animation: toast-in var(--t-med) var(--ease);
}
.toast-error {
  border-left-color: var(--danger);
}
.toast-warn {
  border-left-color: var(--amber);
}
.toast strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}
.toast.is-leaving {
  animation: toast-out var(--t-med) var(--ease) forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* --------------------------------------------------------------- modals */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 4, 7, 0.78);
  backdrop-filter: blur(6px);
  animation: fade-in var(--t-fast) var(--ease);
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: min(88vh, 900px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95);
  animation: modal-in var(--t-med) var(--ease);
}
.modal-wide {
  max-width: 760px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
}
.modal-body {
  padding: 22px 24px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  flex-wrap: wrap;
}
.modal-close {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: all var(--t-fast) var(--ease);
}
.modal-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

body.modal-open {
  overflow: hidden;
}

/* ------------------------------------------------------------ definition */

.def-list {
  display: grid;
  gap: 14px;
  margin: 0;
}
.def-list > div {
  display: grid;
  gap: 3px;
}
.def-list dt {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.def-list dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

/* -------------------------------------------------------------- top nav */

.topnav {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 7, 10, 0.82);
  backdrop-filter: blur(14px);
}

.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 62px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.brand:hover {
  color: var(--text);
}
/* The GSSV Labs scarab mark. The artwork carries its own dark ground, so the
   frame stays a hairline rather than a filled tile. */
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(93, 214, 255, 0.26);
  border-radius: 8px;
  background: #060d14;
  overflow: hidden;
  flex-shrink: 0;
  transform: translateY(4px);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand:hover .brand-mark {
  border-color: rgba(93, 214, 255, 0.55);
  box-shadow: 0 0 14px -2px rgba(79, 141, 255, 0.5);
}

/* Larger lockup for the auth panel and the 404 page. */
.brand-lg {
  font-size: 1.2rem;
  gap: 12px;
}
.brand-lg .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  transform: translateY(6px);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--dim);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 0.42rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: 0.84rem;
  color: var(--muted);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.nav-link[aria-current='page'] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 -1px 0 var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  width: 36px;
  height: 34px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

@media (max-width: 800px) {
  .nav-toggle {
    display: block;
  }
  .topnav-inner {
    flex-wrap: wrap;
  }
  .nav-links {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 0 14px;
    border-top: 1px solid var(--line);
  }
  .nav-links.is-open {
    display: flex;
  }
  .nav-link {
    padding: 0.6rem 0.5rem;
  }
}

/* -------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  margin-top: 60px;
}
.site-footer .shell {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.footer-note {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.footer-links a:hover {
  color: var(--accent);
}

/* --------------------------------------------------------- misc helpers */

.text-muted {
  color: var(--muted);
}
.text-dim {
  color: var(--dim);
}
.text-accent {
  color: var(--accent);
}
.text-danger {
  color: var(--danger);
}
.text-amber {
  color: var(--amber);
}
.mt-0 {
  margin-top: 0;
}
.mb-0 {
  margin-bottom: 0;
}
.is-hidden {
  display: none !important;
}
.nowrap {
  white-space: nowrap;
}
.flex-1 {
  flex: 1;
}
