:root {
  --blue: #1D4E9E;
  --blue-dark: #163C7A;
  --blue-pale: #EAF0FA;
  --accent: #1D4E9E;
  --bg: #F5F6F8;
  --white: #FFFFFF;
  --text: #1F2530;
  --text-soft: #5A6472;
  --border: #D5DAE2;
  --green: #1E7E44;
  --red: #C22B2B;
  --yellow-note: #FFF6D9;
  --yellow-border: #E8D48A;
  --row-alt: #FAFBFD;
  --note-text: #6B5A18;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 22px;
  --space-5: 34px;
  --fs-base: 15px;
  --fs-h1: 1.35rem;
  --radius: 6px;
  --tooltip-bg: #1F2530; --tooltip-fg: #FFFFFF;
}
[data-theme="dark"] {
  --blue-pale: #1E2A3D;
  --accent: #6DA0F0;
  --bg: #12151A;
  --white: #1B2028;
  --text: #E4E8EF;
  --text-soft: #99A3B2;
  --border: #2A313C;
  --yellow-note: #2C2814;
  --yellow-border: #4A421F;
  --row-alt: #171C24;
  --note-text: #D9C77A;
  --tooltip-bg: #333D4A; --tooltip-fg: #E4E8EF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
.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; }
.page { flex: 1 0 auto; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.site-header { position: sticky; top: 0; z-index: 20; }

.topbar {
  background: var(--blue);
  color: #fff;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 6px;
  padding-block: var(--space-2);
}
.brand { display: flex; align-items: baseline; gap: 8px; color: #fff; text-decoration: none; }
.brand b {
  font-size: 1.15rem;
  letter-spacing: 0.2px;
}
.brand span { font-size: 0.8rem; opacity: 0.85; display: none; }
.brand b:hover { text-decoration: underline; text-underline-offset: 3px; }
.brand:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.topbar__tagline { width: 100%; font-size: 0.8rem; color: #C9D6EE; }
.topnav { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.topnav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: 4px;
}
.topnav a:hover,
.topnav a:focus-visible {
  background: var(--blue-dark);
}
.topnav a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}
.topnav a[aria-current="page"] { background: var(--blue-dark); box-shadow: inset 0 -3px 0 var(--blue-pale); }
.subbar {
  background: var(--blue-dark);
  color: #C9D6EE;
  font-size: 0.8rem;
  padding: 5px 0;
}
.subbar__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.subbar__msg { display: none; }
.theme-switch { display: none; }
[data-theme-pref] .theme-switch {
  display: inline-flex;
  gap: 2px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  vertical-align: middle;
}
.theme-switch__btn {
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #C9D6EE;
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}
.theme-switch__btn:hover { color: #fff; }
[data-theme-pref="system"] .theme-switch__btn[data-theme-value="system"],
[data-theme-pref="light"] .theme-switch__btn[data-theme-value="light"],
[data-theme-pref="dark"] .theme-switch__btn[data-theme-value="dark"] { background: var(--blue); color: #fff; }
.theme-switch__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.page-head { padding: var(--space-4) 0 var(--space-1); }
.page-head h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
}
.page-head p {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin-top: 4px;
  max-width: 70ch;
}
.page-head p + p { margin-top: var(--space-2); }
.main {
  display: grid; grid-template-columns: 1fr; gap: var(--space-4);
  padding: var(--space-3) 0 var(--space-5); align-items: start;
}
.panel,
.info-card,
.article-card,
.faq__item,
.rate-highlight {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.panel { overflow: hidden; scroll-margin-top: calc(var(--header-h, 74px) + 12px); }
.panel-head {
  background: var(--blue-pale);
  border-bottom: 1px solid var(--border);
  padding: 9px var(--space-3);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.panel-head__tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--white);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
}
.panel-body { padding: var(--space-3); }
.f-row { margin-bottom: 12px; }
.f-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.field-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.field-head label { margin-bottom: 0; }
.f-row select,
.f-row input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
  background: var(--white);
  color: var(--text);
  font-family: inherit;
}
.f-row select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%235A6472' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.f-row select:focus,
.f-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(76, 130, 216, 0.2);
}
.f-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.tooltip { position: relative; display: inline-flex; }
.tooltip__icon {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 700;
  font-style: italic;
  font-family: inherit;
  line-height: 1;
  cursor: help;
}
.tooltip__icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tooltip__bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 220px;
  padding: 8px 10px;
  background: var(--tooltip-bg);
  color: var(--tooltip-fg);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 4px;
  display: none;
  z-index: 5;
}
.tooltip:hover .tooltip__bubble,
.tooltip:focus-within .tooltip__bubble { display: block; }
.btn {
  width: 100%;
  padding: 11px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.btn:hover { background: var(--blue-dark); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.promo {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4);
  margin-top: var(--space-4); padding: var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(135deg, #EAF0FA, #F3EEFB); color: var(--text);
}
[data-theme="dark"] .promo { background: linear-gradient(135deg, #1E2A3D, #16121F); border-color: #2A313C; }
.promo__body { flex: 1 1 240px; }
.promo__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-soft); }
.promo__title { font-size: 1.08rem; font-weight: 700; margin: var(--space-1) 0; }
.promo__text { font-size: 0.85rem; color: var(--text-soft); margin: 0; }
.promo .btn { width: auto; flex: none; text-decoration: none; }

.result {
  border-top: 1px solid var(--border);
  margin-top: var(--space-3);
  padding-top: 12px;
}
.result__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.result__table td {
  padding: 5px 0;
  vertical-align: top;
}
.result__table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.result__total td {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-weight: 700;
  font-size: 1rem;
}
.result__value--positive { color: var(--green); }
.result__value--negative { color: var(--red); }
.result__note { margin-top: var(--space-2); font-size: 0.75rem; color: var(--text-soft); line-height: 1.45; }
.rates-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.rates-table th {
  text-align: left;
  background: var(--blue-pale);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.rates-table th:last-child,
.rates-table__rate { text-align: right; }
.rates-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.rates-table__row[data-href] { cursor: pointer; }
.rates-table__row:nth-child(even) td { background: var(--row-alt); }
.rates-table__row:hover td { background: var(--blue-pale); }
.rates-table__rate {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.flags-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.flag {
  display: inline-block;
  width: 20px;
  height: 14px;
  margin-right: 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  vertical-align: -2px;
  overflow: hidden;
}
.rates-table__link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.rates-table__link:hover { color: var(--accent); text-decoration: underline; }
.note-box {
  background: var(--yellow-note);
  border: 1px solid var(--yellow-border);
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 0.8rem;
  color: var(--note-text);
}


.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
}
.info-card,
.article-card { padding: var(--space-3); }
.info-card { display: flex; flex-direction: column; }
.info-card h2 { font-size: 0.95rem; margin-bottom: 6px; }
.info-card p { font-size: 0.85rem; color: var(--text-soft); }
.info-card a {
  font-size: 0.85rem;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 8px;
}
.article-card h2 { font-size: 1.05rem; margin-bottom: 4px; }
.article-card p { font-size: 0.88rem; color: var(--text-soft); }
.article-card__meta { font-size: 0.78rem; margin-top: 6px; }

.breadcrumbs { font-size: 0.8rem; color: var(--text-soft); padding-top: var(--space-3); }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span[aria-hidden] { margin: 0 6px; }
.rate-highlight {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  border-left: 4px solid var(--accent);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-2);
}
.rate-highlight__value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.rate-highlight__unit { font-size: 0.9rem; color: var(--text-soft); }
.rate-highlight__flag { width: 40px; height: 28px; margin: 0; align-self: center; }
.rate-highlight__tag { margin-left: auto; align-self: center; }

.content {
  max-width: 72ch;
  padding: var(--space-2) 0 var(--space-5);
}
.content h2 {
  font-size: 1.05rem;
  margin: var(--space-4) 0 var(--space-1);
}
.content h3 {
  font-size: 0.95rem;
  margin: var(--space-3) 0 var(--space-1);
}
.content p { margin-bottom: var(--space-2); }
.content ul { margin: 0 0 var(--space-2) 20px; }
.content li { margin-bottom: 4px; }
.article-meta { font-size: 0.8rem; color: var(--text-soft); }

.article-list {
  display: grid; grid-template-columns: 1fr; gap: var(--space-3);
  padding: var(--space-2) 0 var(--space-5);
}
.article-ad .promo { margin-top: 0; }
.faq { padding: var(--space-2) 0 var(--space-4); }
.faq__item { margin-bottom: 8px; }
.faq__question {
  padding: 11px var(--space-3);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.faq__question:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq__answer { padding: 0 var(--space-3) 11px; font-size: 0.88rem; color: var(--text-soft); }
.related { margin-bottom: var(--space-5); }
.related__list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: var(--space-2);
}
.related__list a { text-decoration: none; }
.related__list a:hover { text-decoration: underline; }

.footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: var(--space-4) 0 var(--space-5);
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-top: var(--space-5);
  flex-shrink: 0;
}
.footer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}
.footer__brand b { font-size: 0.95rem; letter-spacing: 0.2px; }
.footer__logo { display: block; flex-shrink: 0; }
.footer__brand:hover b { text-decoration: underline; text-underline-offset: 3px; }
.footer__brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.footer__disclaimer {
  max-width: 80ch;
  margin-bottom: var(--space-2);
  line-height: 1.5;
}
.footer__links { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.footer__links a { color: var(--text-soft); text-decoration: none; }
.footer__links a:hover { text-decoration: underline; }
.footer__links a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.footer__links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.list-search { display: none; }
.js .list-search {
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-3); padding: 0 var(--space-3);
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
}
.list-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
#normos .list-search { margin-bottom: 0; border-radius: 0; border-width: 0 0 1px; }
#normos .list-search:focus-within { outline-offset: -2px; }
.list-search__icon { width: 18px; height: 18px; flex: none; color: var(--text-soft); }
.list-search__icon, .pagination__btn svg, .to-top__btn svg, .ext-icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ext-icon { width: 14px; height: 14px; margin-left: 6px; vertical-align: -2px; }
.list-search__input {
  flex: 1; min-width: 0; padding: var(--space-2) 0;
  font: inherit; color: var(--text); background: none; border: 0;
}
.list-search__input:focus-visible { outline: none; }
.list-search__input::placeholder { color: var(--text-soft); }
.list-search__empty { color: var(--text-soft); text-align: center; padding: var(--space-5) var(--space-3); }
.js .article-card--offpage { display: none; }
mark { background: var(--yellow-border); color: var(--text); padding: 0 .12em; border-radius: 3px; }
.pagination { flex-wrap: wrap; justify-content: center; gap: var(--space-1); margin-top: var(--space-4); }
.pagination:not([hidden]) { display: flex; }
.pagination__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; min-height: 40px; padding: var(--space-1) var(--space-2);
  font: inherit; color: var(--accent); background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.pagination__btn svg { width: 16px; height: 16px; }
.pagination__btn:hover { background: var(--blue-pale); }
.pagination__btn--current { background: var(--blue); color: #fff; border-color: var(--blue); }
.pagination__btn:disabled { opacity: .45; cursor: default; }
.pagination__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.to-top {
  position: fixed; z-index: 30;
  right: calc(env(safe-area-inset-right, 0px) + var(--space-3));
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-3));
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.to-top--visible { opacity: 1; visibility: visible; pointer-events: auto; }
.to-top__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; color: #fff; background: var(--blue);
  border: 1px solid var(--blue-dark); border-radius: 50%; cursor: pointer;
}
.to-top__btn svg { width: 18px; height: 18px; }
.to-top__btn:hover { background: var(--blue-dark); }
.to-top__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.to-top .tooltip__bubble { width: auto; white-space: nowrap; }

@media (min-width: 760px) {
  .brand span { display: inline; }
  .topbar__tagline { display: none; }
  .subbar__msg { display: block; }
  .topnav { width: auto; }
  .main { grid-template-columns: 340px 1fr; }
  .home-aside { position: sticky; top: calc(var(--header-h, 74px) + 12px); }
  .info-grid { grid-template-columns: 1fr 1fr 1fr; }
  .related__list { grid-template-columns: 1fr 1fr; }
}

@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-group(site-header) { animation-duration: 150ms; }
::view-transition-old(root) { animation: page-fade-out 90ms linear both; }
::view-transition-new(root) { animation: page-fade-in 190ms ease-out both; }
@keyframes page-fade-out {
  to { opacity: 0; }
}
@keyframes page-fade-in {
  from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  .to-top { transition: none; }
}
