/* ShorSighted Relearn theme overrides: brand-color variables, a themed
   sidebar, and a homepage brand-mark hero that replaces the redundant
   front-matter H1. Brand colors: violet #8b5cf6 to cyan #22d3ee. */

:root,
:root[data-r-theme-variant="relearn-dark"],
:root[data-r-theme-variant="relearn-light"],
:root[data-r-theme-variant="relearn-bright"],
:root[data-r-theme-variant="zen-dark"],
:root[data-r-theme-variant="zen-light"] {
  --PRIMARY-color: #8b5cf6 !important;
  --PRIMARY-HOVER-color: #22d3ee !important;
  --SECONDARY-color: #8b5cf6 !important;
  --SECONDARY-HOVER-color: #22d3ee !important;
  --ACCENT-color: #8b5cf6 !important;
  --ACCENT-HOVER-color: #22d3ee !important;
  --CODE-INLINE-color: #a78bfa !important;
  /* Relearn caps content at 81.25rem; give data-heavy tables room. */
  --MAIN-WIDTH-MAX: 110rem;
}

/* Tables: use the full width, scroll sideways rather than squash. */
#R-body-inner table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}
#R-body-inner th,
#R-body-inner td {
  vertical-align: middle;
}
/* Never break chips, dates or identifiers mid-token in any table. */
#R-body-inner td:has(.chip),
#R-body-inner td:has(> code:only-child) {
  white-space: nowrap;
}
/* Generated data tables (deadlines, real-world results) are one line per cell. */
.nowrap-table th,
.nowrap-table td {
  white-space: nowrap;
}

.logo-title {
  color: #ffffff !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

.R-sidebarmenu li.active > a {
  color: #22d3ee !important;
  font-weight: 700 !important;
}

/* Homepage hero: dark art in dark variants, light art in light variants. */
.brand-hero {
  margin: 0.5rem 0 1.5rem;
}
.brand-hero img {
  max-width: 100%;
  height: auto;
}
.brand-hero-light {
  display: none !important;
}
:root[data-r-theme-variant="relearn-light"] .brand-hero-dark,
:root[data-r-theme-variant="relearn-bright"] .brand-hero-dark,
:root[data-r-theme-variant="zen-light"] .brand-hero-dark {
  display: none !important;
}
:root[data-r-theme-variant="relearn-light"] .brand-hero-light,
:root[data-r-theme-variant="relearn-bright"] .brand-hero-light,
:root[data-r-theme-variant="zen-light"] .brand-hero-light {
  display: inline-block !important;
}
#R-body-inner > .flex-block-wrapper article:has(.brand-hero) > h1:first-of-type {
  display: none;
}

/* Severity, kind and grade chips on the generated pages. */
.chip {
  display: inline-block;
  padding: 0 0.45em;
  border-radius: 0.35em;
  font-size: 0.85em;
  font-weight: 600;
  white-space: nowrap;
}
.chip-critical { background: #7f1d1d; color: #fecaca; }
.chip-high { background: #9a3412; color: #fed7aa; }
.chip-medium { background: #854d0e; color: #fef08a; }
.chip-low { background: #1e3a8a; color: #bfdbfe; }
.chip-info { background: #334155; color: #e2e8f0; }
.chip-fix { background: #5b21b6; color: #ede9fe; }
.chip-plan { background: #155e75; color: #cffafe; }
.chip-note { background: #334155; color: #e2e8f0; }
.chip-pass { background: #14532d; color: #bbf7d0; }
/* Grades: the HTML report's scale (report/html.py --A..--F), A green to F red. */
.chip-grade-A { background: #1f9d55; color: #fff; }
.chip-grade-B { background: #6cae2f; color: #fff; }
.chip-grade-C { background: #d4a20b; color: #1a1a1a; }
.chip-grade-D { background: #e8710a; color: #fff; }
.chip-grade-F { background: #d0312d; color: #fff; }

/* Real-world results page: filter controls and sortable headers. */
.rw-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.5rem 0 1rem;
}
.rw-filter {
  flex: 1 1 20rem;
  max-width: 32rem;
  padding: 0.4em 0.7em;
  border: 1px solid var(--INTERNAL-MAIN-TEXT-color, #888);
  border-radius: 0.4em;
  background: transparent;
  color: inherit;
  font: inherit;
}
.rw-select {
  flex: 0 1 14rem;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2em;
  cursor: pointer;
  /* Chevron in the text color. */
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    right 1.05em center,
    right 0.75em center;
  background-size: 0.3em 0.3em;
  background-repeat: no-repeat;
}
.rw-select option {
  background: var(--INTERNAL-MAIN-BG-color, #fff);
  color: var(--INTERNAL-MAIN-TEXT-color, #000);
}
.rw-search {
  position: relative;
  display: flex;
  flex: 1 1 20rem;
  max-width: 32rem;
}
.rw-search .rw-filter {
  flex: 1;
  max-width: none;
  padding-right: 2.2em;
}
/* .rw-clear replaces WebKit's clear button. */
.rw-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.rw-clear {
  position: absolute;
  top: 50%;
  right: 0.4em;
  transform: translateY(-50%);
  width: 1.6em;
  height: 1.6em;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.1em;
  line-height: 1;
  opacity: 0.6;
  cursor: pointer;
}
.rw-clear[hidden] {
  display: none;
}
.rw-clear:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--INTERNAL-MAIN-TEXT-color, #888) 14%, transparent);
}
.rw-clear:focus-visible {
  opacity: 1;
  outline: 2px solid var(--PRIMARY-color);
}
.rw-count {
  opacity: 0.75;
  font-size: 0.9em;
}
.rw-sortable th button {
  all: unset;
  cursor: pointer;
  white-space: nowrap;
}
.rw-sortable th button:focus-visible {
  outline: 2px solid var(--PRIMARY-color);
  outline-offset: 2px;
}
.rw-sortable th button::after {
  content: " \2195";
  opacity: 0.35;
}
.rw-sortable th[aria-sort="ascending"] button::after {
  content: " \2191";
  opacity: 1;
}
.rw-sortable th[aria-sort="descending"] button::after {
  content: " \2193";
  opacity: 1;
}
/* Long free-text columns wrap instead of widening the table past the page
   (real-world targets and the key-exchange group glossary). */
#R-body-inner td.rw-wrap {
  white-space: normal;
  min-width: 14rem;
  max-width: 22rem;
}
/* One long hostname shouldn't size the column for every row: break after dots. */
#R-body-inner .rw-sortable td.rw-target {
  white-space: normal;
  max-width: 18rem;
}
#R-body-inner .rw-sortable .rw-none {
  opacity: 0.45;
  cursor: help;
}
/* Grade rules: one per line, in the theme's code font. */
#R-body-inner .rw-sortable a.rw-rule {
  display: block;
  font-family: var(--INTERNAL-CODE-font, monospace);
  font-size: 0.85em;
  line-height: 1.6;
}
/* Real-world dashboard: cards and stacked bars. */
.rw-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}
.rw-cards-2 {
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
}
.rw-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--INTERNAL-MAIN-TEXT-color, #888) 18%, transparent);
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--INTERNAL-MAIN-TEXT-color, #888) 4%, transparent);
}
.rw-card > div:last-child {
  flex: 1;
  min-width: 0;
}
.rw-card-hero {
  grid-column: span 2;
  border-color: color-mix(in srgb, #a78bfa 55%, transparent);
  background: linear-gradient(
    120deg,
    color-mix(in srgb, #a78bfa 14%, transparent),
    color-mix(in srgb, #22d3ee 10%, transparent)
  );
}
@media (max-width: 40rem) {
  .rw-card-hero { grid-column: auto; }
}
.rw-k {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}
.rw-v {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.rw-v small {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.6;
}
.rw-sub {
  font-size: 0.8rem;
  opacity: 0.7;
}
/* Ring gauge for the post-quantum share. */
.rw-gauge {
  --p: 0;
  --c: #a78bfa;
  flex: none;
  width: 5.2rem;
  height: 5.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, var(--INTERNAL-MAIN-BG-color, #fff) 74%, transparent 75%),
    conic-gradient(var(--c) calc(var(--p) * 1%),
      color-mix(in srgb, var(--INTERNAL-MAIN-TEXT-color, #888) 14%, transparent) 0);
}
.rw-gauge span {
  color: var(--c);
  font-weight: 700;
  font-size: 1.1rem;
}
.rw-bar {
  display: flex;
  height: 0.85rem;
  margin: 0.5rem 0 0.4rem;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--INTERNAL-MAIN-TEXT-color, #888) 12%, transparent);
}
.rw-bar span {
  display: block;
  height: 100%;
}
.rw-bar-thin {
  height: 0.55rem;
  min-width: 8rem;
  margin: 0.35rem 0;
}
.rw-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-size: 0.8rem;
}
.rw-legend span {
  opacity: 0.85;
}
.rw-legend i {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.3rem;
  border-radius: 2px;
  vertical-align: -1px;
}
/* Same scale as the HTML report and the grade chips. */
.rw-c-pq_hybrid { background: #1f9d55; }
.rw-c-legacy_draft_pq { background: #d4a20b; }
.rw-c-classical_only { background: #e8710a; }
.rw-c-no_tls13 { background: #d0312d; }
.rw-c-grade-A { background: #1f9d55; }
.rw-c-grade-B { background: #6cae2f; }
.rw-c-grade-C { background: #d4a20b; }
.rw-c-grade-D { background: #e8710a; }
.rw-c-grade-F { background: #d0312d; }
