@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --rm7-paper: #f5f7fa;
  --rm7-card: #ffffff;
  --rm7-soft: #e9eef5;
  --rm7-ink: #102033;
  --rm7-muted: #5d6a79;
  --rm7-faint: #8a94a3;
  --rm7-line: #dce2e9;
  --rm7-accent: #2458d3;
  --rm7-accent-dark: #173f9d;
  --rm7-mint: #2b7b64;
  --rm7-signal: #b42318;
}

.rm7-shell {
  position: sticky;
  inset-block-start: 0;
  z-index: 60;
  width: 100%;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--rm7-line);
  background: rgb(245 247 250 / 92%);
  color: var(--rm7-ink);
  font: 400 .875rem/1.25 'Manrope', Inter, system-ui, sans-serif;
  backdrop-filter: blur(12px);
}

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

.rm7-shell__inner {
  width: 100%;
  max-width: 72rem;
  min-height: 68px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rm7-shell__brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: var(--rm7-ink);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}

.rm7-shell__mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--rm7-ink);
  color: #fff;
  font: 500 13px/1 'IBM Plex Mono', monospace;
  letter-spacing: -.05em;
  transition: background-color .15s ease;
}

.rm7-shell__brand:hover .rm7-shell__mark,
.rm7-shell__brand:focus-visible .rm7-shell__mark {
  background: var(--rm7-accent);
}

.rm7-shell__wordmark b {
  color: var(--rm7-accent);
  font-weight: 600;
}

.rm7-shell__nav {
  min-width: 0;
  margin-left: auto;
  display: flex;
  flex-wrap: wrap; /* never overlap the brand: too-tight rows wrap below it instead */
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.rm7-shell a,
.rm7-shell summary,
.rm7-shell button {
  font-family: inherit;
}

.rm7-shell__link,
.rm7-menu > summary {
  min-height: 36px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--rm7-muted);
  font-size: .875rem;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}

.rm7-shell__link:hover,
.rm7-menu > summary:hover {
  color: var(--rm7-ink);
}

.rm7-shell__link--news {
  color: var(--rm7-accent);
  font-weight: 600;
}

.rm7-shell__link--news:hover {
  color: var(--rm7-accent-dark);
}

.rm7-shell__link[aria-current='page'],
.rm7-menu > summary[aria-current='page'],
.rm7-menu[open] > summary {
  background: var(--rm7-accent);
  color: #fff;
}

/* Primary CTA — the product. Same look as the account button (blue background, white
   text), bold, never collapsed (no rm7-shell__desktop). */
.rm7-shell__ask,
.rm7-shell__ask:hover,
.rm7-shell__ask:focus-visible,
.rm7-shell__ask[aria-current='page'] {
  padding: 8px 16px;
  background: var(--rm7-accent);
  color: #fff;
  font-weight: 700;
}

.rm7-shell__ask:hover,
.rm7-shell__ask:focus-visible {
  background: var(--rm7-accent-dark);
}

.rm7-shell__ask[aria-current='page'] {
  background: var(--rm7-accent-dark);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6);
}

/* Thin top progress bar while a navigation is in flight (client-routed or native). */
.rm7-navbar-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--rm7-accent);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}

.rm7-navbar-progress.is-active {
  opacity: 1;
  animation: rm7-navbar-grow 4s cubic-bezier(.1, .7, .3, 1) forwards;
}

@keyframes rm7-navbar-grow {
  from { width: 0; }
  to { width: 92%; }
}

.rm7-shell__account {
  max-width: 190px;
  padding: 8px 14px;
  background: var(--rm7-accent);
  color: #fff;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm7-shell__account:hover {
  background: var(--rm7-accent-dark);
  color: #fff;
}

.rm7-shell__admin {
  color: var(--rm7-mint);
  font-weight: 600;
}

.rm7-shell__lang,
.rm7-lang-switch,
.rm7-lang-switch__languages {
  display: flex;
  align-items: center;
}

.rm7-shell__lang {
  flex: 0 0 auto;
}

.rm7-lang-switch {
  gap: 5px;
  color: var(--rm7-muted);
  font-size: .75rem;
  white-space: nowrap;
}

.rm7-lang-switch__languages {
  gap: 2px;
}

.rm7-lang-switch__native,
.rm7-lang-switch__english {
  padding: 5px 6px;
  border-radius: 5px;
  color: var(--rm7-muted);
  font-weight: 600;
  text-decoration: none;
}

.rm7-lang-switch__native:hover,
.rm7-lang-switch__english:hover {
  background: var(--rm7-soft);
  color: var(--rm7-ink);
}

.rm7-version-menu > summary {
  min-height: 36px;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  color: var(--rm7-muted);
  font-weight: 600;
  cursor: pointer;
}

.rm7-version-menu[open] > summary {
  background: var(--rm7-soft);
  color: var(--rm7-ink);
}

.rm7-version-menu .rm7-menu__panel {
  inset-inline-end: 0;
  inset-inline-start: auto;
  min-width: 220px;
}

.rm7-shell__avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgb(255 255 255 / 18%);
  font-size: .72rem;
  font-weight: 700;
}

.rm7-menu {
  position: relative;
}

.rm7-menu > summary {
  list-style: none;
  user-select: none;
}

.rm7-menu > summary::-webkit-details-marker {
  display: none;
}

.rm7-menu__chevron {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  transition: transform .15s ease;
}

.rm7-menu[open] .rm7-menu__chevron {
  transform: rotate(180deg);
}

.rm7-menu__panel {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 80;
  width: 292px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--rm7-line);
  border-radius: 8px;
  background: var(--rm7-card);
  box-shadow: 0 20px 25px -5px rgb(16 32 51 / 12%), 0 8px 10px -6px rgb(16 32 51 / 10%);
}

.rm7-menu--courts .rm7-menu__panel {
  width: 344px;
}

.rm7-menu--more .rm7-menu__panel,
[data-user-menu] .rm7-menu__panel {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

[data-user-menu] .rm7-menu__panel {
  width: 240px;
}

.rm7-menu__item {
  position: relative;
  padding: 9px 11px 9px 13px;
  display: grid;
  gap: 2px;
  border-radius: 5px;
  color: var(--rm7-ink);
  text-decoration: none;
}

.rm7-menu__item::before {
  content: '';
  position: absolute;
  inset-block: 8px;
  inset-inline-start: 0;
  width: 2px;
  border-radius: 2px;
  background: transparent;
}

.rm7-menu__item:hover,
.rm7-menu__item:focus-visible {
  background: #f1f5f9;
}

.rm7-menu__item[aria-current='page']::before {
  background: var(--rm7-accent);
}

.rm7-menu__item[aria-current='page'] .rm7-menu__label {
  color: var(--rm7-accent);
}

.rm7-menu__label {
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.25;
}

.rm7-menu__description {
  color: var(--rm7-muted);
  font-size: .74rem;
  line-height: 1.35;
}

.rm7-menu__heading {
  padding: 10px 11px 4px;
  color: var(--rm7-faint);
  font: 500 .67rem/1.2 'IBM Plex Mono', monospace;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.rm7-menu__hub {
  margin-top: 4px;
  padding: 10px 12px;
  border-top: 1px solid var(--rm7-line);
  color: var(--rm7-accent);
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
}

.rm7-menu__hub:hover {
  color: var(--rm7-accent-dark);
}

.rm7-menu--compact {
  display: none;
}

.rm7-menu--compact .rm7-menu__panel {
  position: fixed;
  inset-block-start: 62px;
  inset-inline: 12px;
  width: auto;
  max-height: calc(100vh - 74px);
  overflow: auto;
}

.rm7-shell__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.rm7-shell :focus-visible {
  outline: 2px solid var(--rm7-accent);
  outline-offset: 2px;
}

/* Report typography and spacing: content remains page-specific, but the shell and reading rhythm
   no longer inherit whichever font or warm palette a historical generator happened to embed. */
body.rm7-report {
  margin: 0;
  background: var(--rm7-paper) !important;
  color: var(--rm7-ink);
  font-family: 'Manrope', Inter, system-ui, sans-serif !important;
}

.rm7-report h1,
.rm7-report h2,
.rm7-report h3,
.rm7-report h4,
.rm7-report .stat b,
.rm7-report .flowhead .n {
  font-family: 'Manrope', Inter, system-ui, sans-serif !important;
}

.rm7-report h1 {
  letter-spacing: -.025em !important;
}

.rm7-report .rm7-report-kicker {
  margin: 0 0 8px;
  color: var(--rm7-accent);
  font: 500 .68rem/1.2 'IBM Plex Mono', monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.rm7-report-visual {
  margin: 4px 0 22px;
  padding: 18px 20px;
  border: 1px solid var(--rm7-line);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff 0%, #f4f7fc 100%);
  overflow: hidden;
}

.rm7-report-visual svg {
  width: 100%;
  height: auto;
  display: block;
}

.rm7-report-visual__caption {
  margin: 10px 0 0;
  color: var(--rm7-muted);
  font-size: .78rem;
  line-height: 1.45;
}

.rm7-context-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.05fr);
  align-items: stretch;
  gap: 12px;
}

.rm7-context-flow__source,
.rm7-context-flow__result {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--rm7-line);
  border-radius: 9px;
  background: #fff;
}

.rm7-context-flow__result {
  border-color: #b8c8ee;
  background: #eef3ff;
}

.rm7-context-flow small,
.rm7-context-flow b,
.rm7-context-flow span {
  display: block;
}

.rm7-context-flow small {
  margin-bottom: 7px;
  color: var(--rm7-accent);
  font: 500 .64rem/1.2 'IBM Plex Mono', monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rm7-context-flow b {
  color: var(--rm7-ink);
  font-size: .98rem;
}

.rm7-context-flow div > span {
  margin-top: 5px;
  color: var(--rm7-muted);
  font-size: .78rem;
  line-height: 1.4;
}

.rm7-context-flow__join {
  align-self: center;
  color: var(--rm7-accent);
  font: 600 1.2rem/1 'Manrope', sans-serif;
}

@media (max-width: 1149px) {
  .rm7-shell__desktop {
    display: none;
  }

  .rm7-menu--compact {
    display: block;
  }
}

@media (max-width: 639px) {
  .rm7-shell__inner {
    min-height: 62px;
    padding: 12px;
    gap: 4px;
  }

  .rm7-shell__wordmark {
    display: none;
  }

  .rm7-shell__link--news {
    min-height: 34px;
    padding: 6px;
    font-size: .75rem;
  }

  .rm7-shell__nav {
    gap: 2px;
  }

  .rm7-lang-switch {
    gap: 1px;
  }

  .rm7-lang-switch__separator,
  .rm7-lang-switch__name {
    display: none !important;
  }

  .rm7-lang-switch__language--current {
    display: none !important;
  }

  .rm7-version-menu > summary,
  .rm7-shell__lang .lang-dd > summary {
    min-height: 34px;
    padding: 6px;
  }

  .rm7-lang-switch__english {
    padding: 6px 4px;
  }

  .rm7-menu--compact > summary {
    min-width: 34px;
    min-height: 34px;
    padding: 7px 9px;
    justify-content: center;
  }

  .rm7-menu--compact > summary .rm7-menu__text,
  .rm7-menu--compact > summary .rm7-menu__chevron {
    display: none;
  }

  /* The name cannot fit beside the logo, language switch and menu on a phone: a 98px cap clipped
     it mid-word ("Paulius Br…"), which reads as breakage rather than design. Show the avatar
     alone — the full name is in the dropdown header, and the button carries it as aria-label.
     The :not() selector matches both shells (Astro SiteHeader and site_shell.py). */
  .rm7-shell__account {
    max-width: none;
    min-height: 34px;
    padding-inline: 8px;
    gap: 6px;
    font-size: .75rem;
  }

  .rm7-shell__account > span:not(.rm7-shell__avatar),
  .rm7-shell__account > .rm7-shell__account-name {
    display: none;
  }

  .rm7-menu--compact .rm7-menu__panel {
    inset-block-start: 56px;
  }

  .rm7-context-flow {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rm7-context-flow__join {
    justify-self: center;
    transform: rotate(90deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rm7-shell *,
  .rm7-shell *::before,
  .rm7-shell *::after {
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}


/* Pulsing "work in progress" text — used by the post-answer lanes (related news, Šaknys) while
   their searches run, so a finished-looking page still shows that something is happening. */
.rm-thinking {
  animation: rm7-pulse 1.4s ease-in-out infinite;
}

@keyframes rm7-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

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