:root {
  --bg: #030712;
  --bg-alt: #08142a;
  --card: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.15);
  --text: #f5f7ff;
  --muted: rgba(245, 247, 255, 0.7);
  --accent: #67f3c5;
  --accent-strong: #06c6a6;
  --danger: #ff6b6b;
  --font-body: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-display: 'Newsreader', 'Times New Roman', serif;
  --filing-grid: 60px 110px 150px minmax(360px, 2.2fr) 140px 220px 120px 140px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, rgba(103, 243, 197, 0.2), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(6, 198, 166, 0.35), transparent 40%),
    linear-gradient(135deg, var(--bg) 0%, #040a18 45%, #020409 100%);
  padding: 2rem clamp(1rem, 4vw, 4rem);
}

.page {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero {
  background: rgba(3, 7, 18, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: clamp(1.5rem, 4vw, 3rem);
  backdrop-filter: blur(12px);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 0%, rgba(103, 243, 197, 0.25), transparent 50%);
  z-index: -1;
}

.eyebrow {
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin: 0 0 0.75rem;
}

.intro {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 70ch;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.field-grow {
  flex: 1;
}

select,
input[type='search'] {
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  padding: 0.75rem 1.2rem;
  outline: none;
  transition: border 0.2s, transform 0.2s;
}

select:focus,
input[type='search']:focus {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.primary {
  align-self: flex-end;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #03121a;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary:focus-visible,
.primary:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 30px rgba(103, 243, 197, 0.35);
}

.status {
  font-size: 0.95rem;
  color: var(--muted);
  min-height: 1.5rem;
}

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

.secondary-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(103, 243, 197, 0.45);
  padding: 0.75rem 1.4rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: border 0.2s ease, color 0.2s ease;
}

.secondary-link:hover,
.secondary-link:focus-visible {
  color: var(--accent-strong);
  border-color: var(--accent-strong);
}

.muted-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.search-panel {
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: rgba(3, 7, 18, 0.7);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

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

.ghost {
  border-radius: 999px;
  border: 1px dashed rgba(245, 247, 255, 0.45);
  background: transparent;
  color: var(--muted);
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.ghost:hover,
.ghost:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

.search-hint em {
  color: var(--accent);
  font-style: normal;
}

.search-results {
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: rgba(3, 7, 18, 0.75);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.entity-section {
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: rgba(3, 7, 18, 0.75);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.entity-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.1rem 1.3rem;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.04), rgba(3, 7, 18, 0.6));
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.entity-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

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

.detail-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.45rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.detail-row dt {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-row dd {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.search-summary {
  font-size: 1rem;
  color: var(--muted);
}

.aggregation-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.agg-block {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.agg-heading {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.agg-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
}

.search-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.readable-facts {
  display: grid;
  gap: 12px;
}

.readable-facts.single-box {
  background: #f7f8fb;
  border: 1px solid #e3e7ee;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.readable-meta-block {
  color: #4b5563;
  font-size: 13px;
  margin-bottom: 8px;
}

.readable-table {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.readable-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #e5e7eb;
}

.readable-idx {
  font-weight: 600;
  color: #6b7280;
}

.readable-heading {
  font-weight: 600;
  color: #0f172a;
}

.readable-value {
  color: #111827;
  text-align: right;
}

.readable-meta {
  color: #6b7280;
  font-size: 13px;
}

.readable-row:last-child {
  border-bottom: none;
}

.result-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.05), rgba(3, 7, 18, 0.6));
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.result-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chip {
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--accent);
}

.result-entity {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

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

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

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

.result-link {
  align-self: flex-start;
  text-decoration: none;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid transparent;
}

.result-data-btn {
  border: 1px solid rgba(103, 243, 197, 0.5);
  background: transparent;
  color: var(--accent);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.result-data {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-data-status {
  color: var(--muted);
  font-size: 0.9rem;
}

.result-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.4rem 1rem;
  margin: 0;
}

.result-data-grid dt {
  font-weight: 600;
  color: var(--accent);
}

.result-data-grid dd {
  margin: 0;
  color: var(--text);
}

.result-footnotes {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  color: var(--muted);
}

.result-xbrl-link {
  align-self: flex-start;
  text-decoration: none;
  font-weight: 600;
  color: var(--accent-strong);
  border-bottom: 1px solid transparent;
}

.result-xbrl-link:hover,
.result-xbrl-link:focus-visible {
  border-color: var(--accent-strong);
}

.xbrl-panel {
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: rgba(3, 7, 18, 0.7);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.xbrl-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.xbrl-filing-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text);
}

.xbrl-filing-meta {
  font-size: 0.9rem;
  color: var(--muted);
}

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

.xbrl-content {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  min-height: 300px;
}

.xbrl-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
  font-size: 0.9rem;
  color: var(--text);
  margin: 0;
}

.result-link:hover,
.result-link:focus-visible {
  border-color: var(--accent);
}

.disabled-link {
  pointer-events: none;
  opacity: 0.6;
}

.archive-search-panel {
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: rgba(3, 7, 18, 0.7);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.archive-results {
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: rgba(3, 7, 18, 0.78);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.archive-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2.4fr) 150px 130px 110px 200px;
  gap: 1rem;
  padding: 1rem 1.5rem;
  align-items: center;
}

.archive-header {
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.archive-list {
  display: flex;
  flex-direction: column;
}

.archive-row {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0));
}

.archive-row:nth-child(odd) {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0));
}

.col-file {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.file-link {
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  word-break: break-all;
}

.file-link:hover,
.file-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.file-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.col-type,
.col-month,
.col-size,
.col-updated {
  font-size: 0.85rem;
  color: var(--muted);
}

.col-type {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.col-size {
  font-variant-numeric: tabular-nums;
}

.col-updated {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.updated-relative {
  font-size: 0.75rem;
  color: var(--muted);
}

.archive-embed {
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 1.5rem;
  background: rgba(3, 7, 18, 0.75);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.embed-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.archive-frame {
  width: 100%;
  min-height: 70vh;
  border: none;
  background: #fff;
}

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

.embed-hint a {
  color: var(--accent);
  text-decoration: none;
}

.embed-hint a:hover,
.embed-hint a:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}


.filings {
  border: 1px solid var(--card-border);
  border-radius: 24px;
  overflow: auto;
  background: rgba(3, 7, 18, 0.65);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.filings-header,
.filing-row {
  display: grid;
  grid-template-columns: var(--filing-grid);
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.5rem;
  min-width: 1200px;
}

.filings-header {
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.filings-list {
  display: flex;
  flex-direction: column;
}

.filing-row {
  font-size: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  transition: background 0.2s ease;
}

.filing-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.filing-row .col {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.col-index {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.col-form {
  font-family: var(--font-display);
  letter-spacing: 0.15em;
  color: var(--accent);
}

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

.col-title {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.col-title::after {
  content: '↗';
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.col-title:hover,
.col-title:focus-visible {
  color: var(--accent);
}

.col-title:hover::after,
.col-title:focus-visible::after {
  opacity: 1;
}

.col-accession {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
  font-size: 0.9rem;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: var(--muted);
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
}

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

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

@media (max-width: 960px) {
  body {
    padding: 1.5rem;
  }

  :root {
    --filing-grid: 50px 90px 110px minmax(260px, 1.8fr) 110px 200px 100px 120px;
  }

  .archive-grid {
    grid-template-columns: minmax(180px, 2fr) 120px 110px 90px 160px;
  }
}

@media (max-width: 720px) {
  .filings-header {
    display: none;
  }

  .filing-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 1.25rem;
  }

  .filing-row .col {
    white-space: normal;
  }

  .col-index {
    order: -3;
  }

  .col-form {
    order: -2;
  }

  .col-time {
    order: -1;
  }

  .primary {
    width: 100%;
  }


  .col-xml {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
  }

  .col-xml.disabled {
    color: var(--muted);
    pointer-events: none;
    text-decoration: none;
  }
  .archive-grid {
    grid-template-columns: 1fr;
  }

  .archive-row {
    padding: 1.25rem;
  }

  .col-type,
  .col-month,
  .col-size,
  .col-updated {
    font-size: 0.8rem;
  }

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

  .ghost {
    width: 100%;
    text-align: center;
  }
}
