:root {
  --tcmb-ink: #10233a;
  --tcmb-muted: #607188;
  --tcmb-line: #dce5eb;
  --tcmb-soft: #f2f7f8;
  --tcmb-teal: #0f857c;
  --tcmb-teal-dark: #08665f;
  --tcmb-lime: #bfe7bd;
  --tcmb-paper: #fff;
  --tcmb-shadow: 0 24px 70px rgba(12, 42, 60, .12);
}

.tcmb-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  min-height: 600px;
  padding: clamp(4rem, 8vw, 7.5rem) 0;
}

.tcmb-hero__eyebrow,
.tcmb-kicker {
  margin: 0 0 .8rem;
  color: #74d8cc;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.tcmb-hero h1 {
  max-width: 760px;
  margin: 0;
  color: #fff;
  font-size: clamp(3.15rem, 7vw, 6.4rem);
  font-weight: 780;
  letter-spacing: -.065em;
  line-height: .96;
}

.tcmb-hero__lead {
  max-width: 670px;
  margin: 1.65rem 0 0;
  color: #c5d2de;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  line-height: 1.7;
}

.tcmb-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 2rem;
}

.tcmb-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: .85rem 1.15rem;
  font: inherit;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.tcmb-button:hover { transform: translateY(-2px); }
.tcmb-button--primary { background: #7de0d4; color: #092e32; box-shadow: 0 14px 36px rgba(40, 205, 185, .22); }
.tcmb-button--primary:hover { background: #96eadf; color: #061f23; }
.tcmb-button--ghost { border: 1px solid rgba(255,255,255,.23); background: rgba(255,255,255,.06); color: #fff; }
.tcmb-button--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

.tcmb-source-date {
  display: flex;
  gap: .6rem;
  align-items: center;
  margin: 1.5rem 0 0;
  color: #aebfca;
  font-size: .9rem;
}

.tcmb-source-date span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #72dfc7;
  box-shadow: 0 0 0 6px rgba(114,223,199,.11);
}

.tcmb-hero__rates {
  display: grid;
  gap: .85rem;
  transform: rotate(1deg);
}

.tcmb-rate-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  grid-template-areas: "code name value" "code foot value";
  gap: .2rem 1rem;
  align-items: center;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 22px;
  padding: 1.2rem 1.35rem;
  background: rgba(255,255,255,.085);
  color: #fff;
  box-shadow: 0 16px 60px rgba(0,0,0,.12);
  text-decoration: none;
  backdrop-filter: blur(18px);
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.tcmb-rate-card:nth-child(2) { transform: translateX(-20px); }
.tcmb-rate-card:hover { border-color: rgba(126,225,213,.62); background: rgba(255,255,255,.13); color: #fff; transform: translateX(-5px); }
.tcmb-rate-card:nth-child(2):hover { transform: translateX(-25px); }
.tcmb-rate-card__code { grid-area: code; display: grid; width: 54px; height: 54px; place-items: center; border-radius: 16px; background: #7de0d4; color: #0b3237; font-weight: 850; letter-spacing: .03em; }
.tcmb-rate-card__name { grid-area: name; color: #f4f8fa; font-size: .98rem; font-weight: 740; }
.tcmb-rate-card > strong { grid-area: value; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.035em; }
.tcmb-rate-card > strong small { font-size: .72rem; font-weight: 700; opacity: .7; }
.tcmb-rate-card__foot { grid-area: foot; color: #9fb3c0; font-size: .8rem; }
.tcmb-rate-card__foot b { margin-left: .35rem; color: #7de0d4; }

.tcmb-tool-section {
  margin: clamp(2rem, 5vw, 4.5rem) 0;
}

.tcmb-section-heading {
  display: flex;
  gap: 2rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.tcmb-section-heading h2,
.tcmb-history h2,
.tcmb-currency-overview h2,
.tcmb-information-panel h2 {
  margin: 0;
  color: var(--tcmb-ink);
  font-size: clamp(1.65rem, 4vw, 2.6rem);
  letter-spacing: -.035em;
  line-height: 1.12;
}

.tcmb-section-heading > p {
  max-width: 520px;
  margin: 0;
  color: var(--tcmb-muted);
  font-size: .95rem;
  line-height: 1.65;
}

.tcmb-kicker { color: var(--tcmb-teal); }

.tcmb-converter {
  display: grid;
  grid-template-columns: minmax(135px,.8fr) minmax(230px,1.35fr) minmax(180px,1fr) 52px minmax(250px,1.45fr);
  gap: .75rem;
  align-items: end;
  border: 1px solid var(--tcmb-line);
  border-radius: 26px;
  padding: clamp(1rem, 3vw, 1.5rem);
  background: var(--tcmb-paper);
  box-shadow: var(--tcmb-shadow);
}

.tcmb-converter label,
.tcmb-history label {
  display: grid;
  gap: .45rem;
}

.tcmb-converter label > span,
.tcmb-history label > span {
  color: #52677b;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tcmb-converter input,
.tcmb-converter select,
.tcmb-history input,
.tcmb-history select,
.tcmb-search input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #d8e2e8;
  border-radius: 13px;
  padding: .75rem .9rem;
  background: #f8fbfc;
  color: var(--tcmb-ink);
  font: inherit;
  font-weight: 680;
  outline: none;
}

.tcmb-converter input:focus,
.tcmb-converter select:focus,
.tcmb-history input:focus,
.tcmb-history select:focus,
.tcmb-search input:focus { border-color: var(--tcmb-teal); box-shadow: 0 0 0 4px rgba(15,133,124,.11); }

.tcmb-swap {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid #d6e3e7;
  border-radius: 14px;
  background: #edf6f5;
  color: var(--tcmb-teal-dark);
  font-size: 1.4rem;
  cursor: pointer;
}

.tcmb-converter__result {
  display: flex;
  min-height: 90px;
  flex-direction: column;
  justify-content: center;
  border-radius: 18px;
  padding: 1rem 1.2rem;
  background: var(--tcmb-ink);
  color: #fff;
}

.tcmb-converter__result > span { color: #a9bdca; font-size: .75rem; font-weight: 750; text-transform: uppercase; }
.tcmb-converter__result strong { margin-top: .2rem; font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.03em; }
.tcmb-converter__result small { margin-top: .2rem; color: #89a2b1; font-size: .72rem; }

.tcmb-search { width: min(310px, 100%); }
.tcmb-search input { min-height: 46px; padding-left: 1rem; }

.tcmb-rates-table-wrap {
  overflow: hidden;
  border: 1px solid var(--tcmb-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 58px rgba(12,42,60,.08);
}

.tcmb-rates-table {
  width: 100%;
  border: 0;
  border-collapse: collapse;
  margin: 0;
}

.tcmb-rates-table thead { background: #eef5f6; }
.tcmb-rates-table th,
.tcmb-rates-table td { border: 0; border-bottom: 1px solid #e7edf0; padding: 1rem 1.15rem; text-align: right; vertical-align: middle; }
.tcmb-rates-table thead th { color: #5b6f7f; font-size: .73rem; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.tcmb-rates-table thead th:first-child { text-align: left; }
.tcmb-rates-table tbody tr:last-child th,
.tcmb-rates-table tbody tr:last-child td { border-bottom: 0; }
.tcmb-rates-table tbody tr:hover { background: #f8fbfb; }
.tcmb-rates-table tbody th { width: 34%; text-align: left; }
.tcmb-rates-table tbody th a { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: .1rem .75rem; align-items: center; color: var(--tcmb-ink); text-decoration: none; }
.tcmb-rates-table tbody th span { grid-row: 1 / span 2; display: grid; width: 50px; height: 44px; place-items: center; border-radius: 12px; background: #edf5f5; color: var(--tcmb-teal-dark); font-size: .76rem; font-weight: 850; }
.tcmb-rates-table tbody th strong { font-size: .94rem; line-height: 1.25; }
.tcmb-rates-table tbody th small { color: #7d8c99; font-size: .7rem; font-weight: 650; }
.tcmb-rates-table td { color: #243d52; font-variant-numeric: tabular-nums; font-weight: 730; }
.tcmb-empty-filter { margin: 0; padding: 2rem; color: var(--tcmb-muted); text-align: center; }

.tcmb-source-note {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  border: 1px solid #dbe6e8;
  border-radius: 17px;
  padding: 1rem 1.2rem;
  background: #f7fafb;
}

.tcmb-source-note strong { color: var(--tcmb-ink); font-size: .86rem; }
.tcmb-source-note p { margin: .15rem 0 0; color: var(--tcmb-muted); font-size: .82rem; }
.tcmb-source-note a { color: var(--tcmb-teal-dark); font-size: .84rem; font-weight: 800; white-space: nowrap; }
.tcmb-source-note--stale { border-color: #ecd7aa; background: #fff9eb; }

.tcmb-currency-overview {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 1.25rem;
  margin: 2rem 0 4rem;
}

.tcmb-currency-summary,
.tcmb-chart-card,
.tcmb-history,
.tcmb-information-panel {
  border: 1px solid var(--tcmb-line);
  border-radius: 26px;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: #fff;
  box-shadow: 0 18px 58px rgba(12,42,60,.08);
}

.tcmb-currency-date { margin: .65rem 0 1.5rem; color: var(--tcmb-muted); }
.tcmb-currency-values { display: grid; grid-template-columns: repeat(2,1fr); gap: .75rem; }
.tcmb-currency-values > div { display: grid; gap: .2rem; border-radius: 16px; padding: 1rem; background: #f1f7f7; }
.tcmb-currency-values span { color: var(--tcmb-muted); font-size: .78rem; }
.tcmb-currency-values strong { color: var(--tcmb-ink); font-size: 1.12rem; }

.tcmb-chart-card { display: flex; min-height: 330px; flex-direction: column; background: var(--tcmb-ink); color: #fff; }
.tcmb-chart-card__header { display: flex; justify-content: space-between; color: #8ea6b6; font-size: .78rem; }
.tcmb-chart-card__header div { display: grid; gap: .25rem; }
.tcmb-chart-card__header strong { color: #fff; font-size: 1.25rem; }
.tcmb-sparkline { flex: 1; min-height: 220px; margin-top: 1rem; }
.tcmb-sparkline svg { width: 100%; height: 100%; overflow: visible; }

.tcmb-history { margin: 2rem 0; }
.tcmb-history__intro { max-width: 760px; }
.tcmb-history__intro p:last-child { color: var(--tcmb-muted); line-height: 1.7; }
.tcmb-history__form { display: grid; grid-template-columns: minmax(180px,.8fr) minmax(280px,1.25fr) auto; gap: .85rem; align-items: end; margin-top: 1.5rem; }
.tcmb-history__result { min-height: 0; margin-top: 1rem; }
.tcmb-history__result:not(:empty) { border-radius: 18px; padding: 1.2rem; background: #eef6f5; }
.tcmb-history-result__grid { display: grid; grid-template-columns: repeat(4,1fr); gap: .65rem; margin-top: .8rem; }
.tcmb-history-result__grid div { display: grid; gap: .2rem; border-radius: 12px; padding: .85rem; background: #fff; }
.tcmb-history-result__grid span { color: var(--tcmb-muted); font-size: .72rem; }
.tcmb-history-result__grid strong { color: var(--tcmb-ink); }
.tcmb-information-panel { margin: 1.25rem 0 4rem; background: #f7fafb; box-shadow: none; }
.tcmb-information-panel p { color: var(--tcmb-muted); line-height: 1.75; }

.tcmb-status { display: grid; gap: .25rem; border-radius: 18px; padding: 1rem 1.2rem; }
.tcmb-status--warning { border: 1px solid #ecd7aa; background: #fff8e9; color: #6d521d; }

@media (max-width: 1050px) {
  .tcmb-hero { grid-template-columns: 1fr; min-height: auto; }
  .tcmb-hero__rates { grid-template-columns: repeat(3,1fr); transform: none; }
  .tcmb-rate-card, .tcmb-rate-card:nth-child(2) { grid-template-columns: 1fr; grid-template-areas: "code" "name" "value" "foot"; transform: none; }
  .tcmb-rate-card:hover, .tcmb-rate-card:nth-child(2):hover { transform: translateY(-3px); }
  .tcmb-converter { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tcmb-swap { display: none; }
  .tcmb-converter__result { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .tcmb-hero { padding: 4rem 0; }
  .tcmb-hero h1 { font-size: clamp(3rem, 16vw, 4.7rem); }
  .tcmb-hero__rates { grid-template-columns: 1fr; }
  .tcmb-rate-card { grid-template-columns: 54px minmax(0,1fr) auto; grid-template-areas: "code name value" "code foot value"; }
  .tcmb-section-heading { display: grid; gap: .8rem; }
  .tcmb-search { width: 100%; }
  .tcmb-converter { grid-template-columns: 1fr; }
  .tcmb-converter__result { grid-column: auto; }
  .tcmb-currency-overview { grid-template-columns: 1fr; }
  .tcmb-history__form { grid-template-columns: 1fr; }
  .tcmb-history-result__grid { grid-template-columns: repeat(2,1fr); }
  .tcmb-source-note { display: grid; }
  .tcmb-source-note a { white-space: normal; }

  .tcmb-rates-table-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .tcmb-rates-table, .tcmb-rates-table tbody { display: grid; gap: .75rem; }
  .tcmb-rates-table thead { display: none; }
  .tcmb-rates-table tr { display: grid; grid-template-columns: repeat(2,1fr); overflow: hidden; border: 1px solid var(--tcmb-line); border-radius: 18px; background: #fff; box-shadow: 0 9px 30px rgba(12,42,60,.06); }
  .tcmb-rates-table tbody th { grid-column: 1 / -1; width: auto; background: #f2f7f7; }
  .tcmb-rates-table th, .tcmb-rates-table td { display: grid; gap: .15rem; border: 0; border-bottom: 1px solid #e7edf0; padding: .85rem 1rem; text-align: left; }
  .tcmb-rates-table td::before { content: attr(data-label); color: var(--tcmb-muted); font-size: .68rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
  .tcmb-rates-table td:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 440px) {
  .tcmb-hero__actions { display: grid; }
  .tcmb-button { width: 100%; }
  .tcmb-rate-card { grid-template-columns: 48px minmax(0,1fr); grid-template-areas: "code name" "code value" "foot foot"; }
  .tcmb-rate-card > strong { font-size: 1.45rem; }
  .tcmb-rate-card__code { width: 46px; height: 46px; }
  .tcmb-currency-values,
  .tcmb-history-result__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .tcmb-button, .tcmb-rate-card { transition: none; }
}

