:root {
  --ca-navy: #172d47;
  --ca-green: #087541;
  --ca-green-dark: #065e35;
  --ca-mint: #eaf6ef;
  --ca-muted: #61748a;
  --ca-line: #dce5ec;
  --ca-rust: #b84635;
}

.ca-breadcrumbs {
  padding-top: 18px;
  padding-bottom: 16px;
  color: var(--ca-muted);
  font-size: 13px;
}

.ca-breadcrumbs a {
  color: var(--ca-muted);
}

.ca-hero {
  padding: 70px 0 50px;
  border-top: 1px solid #eef3f5;
  border-bottom: 1px solid var(--ca-line);
  background: radial-gradient(circle at 88% 15%, #cdeadd, transparent 30%), #fff;
}

.ca-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .55fr);
  gap: 42px;
  align-items: end;
}

.ca-eyebrow {
  margin: 0 0 12px;
  color: var(--ca-green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ca-hero h1 {
  max-width: 820px;
  margin: 0;
  color: var(--ca-navy);
  font-size: clamp(42px, 6vw, 72px);
  line-height: .99;
  letter-spacing: -.045em;
}

.ca-hero__lead {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--ca-muted);
  font-size: 20px;
  line-height: 1.5;
}

.ca-hero__card {
  padding: 26px;
  border-radius: 20px;
  background: var(--ca-navy);
  color: #fff;
  box-shadow: 0 18px 50px rgba(23, 45, 71, .16);
}

.ca-hero__card strong {
  display: block;
  font-size: 36px;
}

.ca-hero__card span {
  display: block;
  margin-top: 8px;
  color: #c6d7e6;
  line-height: 1.4;
}

.ca-page {
  padding-top: 42px;
  padding-bottom: 72px;
}

.ca-archive {
  padding: 30px;
  border: 1px solid var(--ca-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 44px rgba(23, 45, 71, .07);
}

.ca-heading {
  display: grid;
  grid-template-columns: 1fr minmax(250px, .55fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

.ca-heading h2 {
  margin: 0;
  color: var(--ca-navy);
  font-size: clamp(27px, 4vw, 40px);
  line-height: 1.1;
}

.ca-heading > p {
  margin: 0;
  color: var(--ca-muted);
  line-height: 1.5;
}

.ca-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 18px;
  border-radius: 14px;
  background: #f2f6f8;
}

.ca-codes {
  display: flex;
  gap: 6px;
}

.ca-codes button,
.ca-apply {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #aec0ce;
  border-radius: 8px;
  background: #fff;
  color: var(--ca-navy);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ca-codes button:hover,
.ca-apply:hover {
  border-color: var(--ca-green-dark);
}

.ca-codes button.active,
.ca-apply {
  border-color: var(--ca-green);
  background: var(--ca-green);
  color: #fff;
}

.ca-codes button.active:hover,
.ca-apply:hover {
  background: var(--ca-green-dark);
  color: #fff;
}

.ca-codes button:focus-visible,
.ca-apply:focus-visible,
.ca-controls input:focus-visible,
.ca-button:focus-visible {
  outline: 3px solid #21a9df;
  outline-offset: 3px;
}

.ca-apply:disabled {
  cursor: wait;
  opacity: .68;
}

.ca-controls label {
  display: grid;
  gap: 5px;
  color: #486078;
  font-size: 13px;
  font-weight: 800;
}

.ca-controls input {
  min-height: 44px;
  border: 1px solid #aec0ce;
  border-radius: 8px;
  padding: 0 9px;
  color: var(--ca-navy);
  background: #fff;
  font: inherit;
}

.ca-state {
  min-height: 24px;
  margin: 18px 0;
  color: #486078;
  font-weight: 700;
}

.ca-result[hidden] {
  display: none;
}

.ca-summary {
  color: var(--ca-navy);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}

.ca-chart {
  display: block;
  width: 100%;
  height: 250px;
  margin-top: 22px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--ca-mint), #fff);
}

.ca-chart path {
  fill: none;
  stroke: var(--ca-green);
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.ca-table-note {
  margin: 18px 0 8px;
  color: var(--ca-muted);
  font-size: 14px;
  line-height: 1.45;
}

.ca-table-wrap {
  max-height: 310px;
  overflow: auto;
  border: 1px solid var(--ca-line);
  border-radius: 12px;
}

.ca-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.ca-table-wrap th,
.ca-table-wrap td {
  padding: 12px 15px;
  border-bottom: 1px solid #e6edf1;
}

.ca-table-wrap th {
  position: sticky;
  top: 0;
  background: #f5f8f9;
}

.ca-table-wrap th:last-child,
.ca-table-wrap td:last-child {
  text-align: right;
}

.ca-note {
  margin: 22px 0 0;
  color: var(--ca-muted);
  line-height: 1.5;
}

.ca-note a {
  color: var(--ca-green);
}

.ca-next {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  margin-top: 28px;
  padding: 28px 30px;
  border-radius: 18px;
  background: var(--ca-navy);
  color: #fff;
}

.ca-next h2 {
  margin: 0 0 7px;
  color: #fff;
  font-size: 27px;
  line-height: 1.2;
}

.ca-next p {
  margin: 0;
  color: #d9e6ec;
}

.ca-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--ca-rust);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.ca-button:hover {
  background: #9f382a;
  color: #fff;
}

.ftr a.lt-cert {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #64778a;
  border-left: 3px solid #0ba037;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
}

.ftr a.lt-cert:hover {
  border-color: #b7dcca;
  background: rgba(255, 255, 255, .07);
}

.lt-cert:focus-visible,
.lt-cert-dialog a:focus-visible,
.lt-cert-close:focus-visible {
  outline: 3px solid #21a9df;
  outline-offset: 4px;
}

.lt-cert > img {
  display: block;
  width: 72px;
  height: 102px;
  flex: none;
  object-fit: contain;
  border-radius: 2px;
  background: #fff;
}

.lt-cert > span {
  min-width: 0;
}

.lt-cert strong {
  display: block;
  color: inherit;
  font-size: 16px;
  line-height: 1.4;
}

.lt-cert small {
  display: block;
  margin-top: 5px;
  color: #d2dce5;
  font-size: 12px;
  line-height: 1.4;
}

.lt-cert-hint {
  display: block;
  margin-top: 7px;
  color: #c6d5e2;
  font-size: 11px;
  line-height: 1.4;
}

.lt-cert-dialog {
  box-sizing: border-box;
  width: min(980px, calc(100vw - 32px));
  max-width: none;
  max-height: 92vh;
  max-height: 92dvh;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #edf1f4;
  color: #172b3d;
  overflow: auto;
  overscroll-behavior: contain;
}

.lt-cert-dialog::backdrop {
  background: rgba(8, 18, 29, .83);
}

.lt-cert-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: #fff;
  box-shadow: 0 1px 6px #0002;
}

.lt-cert-toolbar h2 {
  margin: 0;
  color: #172b3d;
  font: 600 19px/1.4 Arial, sans-serif;
}

.lt-cert-toolbar p {
  margin: 5px 0 0;
  color: #485b6b;
  font: 13px/1.5 Arial, sans-serif;
}

.lt-cert-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid #ccd5dd;
  border-radius: 8px;
  background: #f5f7f9;
  color: #172b3d;
  font: 32px/1 Arial, sans-serif;
  cursor: pointer;
}

.lt-cert-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 14px 22px;
  font: 13px/1.5 Arial, sans-serif;
}

.lt-cert-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #075e9a;
  font-weight: 600;
  text-decoration: underline;
}

.lt-cert-actions span {
  color: #4b5f70;
}

.lt-cert-dialog figure {
  margin: 0;
  padding: 0 18px 18px;
}

.lt-cert-dialog figure a {
  display: block;
  cursor: zoom-in;
}

.lt-cert-dialog figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.lt-cert-dialog figcaption {
  margin-top: 8px;
  color: #4b5f70;
  font: 12px/1.4 Arial, sans-serif;
  text-align: center;
}

@media (max-width: 720px) {
  .ca-hero {
    padding: 44px 0 38px;
  }

  .ca-hero__grid,
  .ca-heading,
  .ca-next {
    grid-template-columns: 1fr;
  }

  .ca-hero h1 {
    font-size: 44px;
  }

  .ca-hero__card {
    display: none;
  }

  .ca-page {
    padding-top: 28px;
  }

  .ca-archive {
    padding: 18px;
  }

  .ca-controls {
    padding: 12px;
  }

  .ca-controls label {
    flex: 1 1 140px;
  }

  .ca-codes {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .ca-chart {
    height: 190px;
  }

  .ca-button {
    width: 100%;
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .lt-cert-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 8px;
  }

  .lt-cert-toolbar {
    gap: 8px;
    padding: 12px;
  }

  .lt-cert-toolbar h2 {
    font-size: 16px;
  }

  .lt-cert-toolbar p {
    font-size: 12px;
  }

  .lt-cert-actions {
    gap: 4px;
    padding: 8px 12px;
  }

  .lt-cert-dialog figure {
    padding: 0 6px 14px;
  }
}

/* Добавить после основного currency-archive-page.css. */
@media (max-width: 720px) {
  .ca-codes {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 7px;
    overflow: visible;
    padding-bottom: 0;
  }

  .ca-codes button {
    min-width: 72px;
    flex: 1 1 calc(33.333% - 7px);
    padding-inline: 10px;
  }
}
