* {
  box-sizing: border-box;
}

@font-face {
  font-family: "PriceInfoTitle";
  src: url("fonts/Outfit/Outfit-VariableFont_wght.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

:root {
  --page-bg: #ffffff;
  --text-color: #202124;
  --muted-color: #5f6368;
  --accent-color: #0b57d0;
  --accent-strong: #174ea6;
  --input-bg: #ffffff;
  --input-border: #dfe1e5;
  --input-shadow: rgba(32, 33, 36, 0.28);
  --button-bg: #f8f9fa;
  --button-border: #f8f9fa;
  --button-hover-border: #dadce0;
  --card-bg: #ffffff;
  --card-border: #e8eaed;
  --soft-bg: #f8fafd;
  --link-color: #1a0dab;
  --success-bg: #e6f4ea;
  --success-text: #137333;
  --success-muted: #188038;
  --danger-text: #b3261e;
  --shell-bg: rgba(255, 255, 255, 0.82);
  --hero-bg: #f7faff;
  --hero-border: #e6edf8;
  --hero-shadow: 0 18px 60px rgba(60, 64, 67, 0.12);
  --control-bg: rgba(248, 249, 250, 0.88);
  --gold-bg: #fff7d7;
  --gold-border: #eed98b;
  --gold-text: #7a4f00;
}

body[data-theme="dark"] {
  --page-bg: #202124;
  --text-color: #e8eaed;
  --muted-color: #bdc1c6;
  --accent-color: #8ab4f8;
  --accent-strong: #aecbfa;
  --input-bg: #303134;
  --input-border: #5f6368;
  --input-shadow: rgba(0, 0, 0, 0.36);
  --button-bg: #303134;
  --button-border: #303134;
  --button-hover-border: #5f6368;
  --card-bg: #303134;
  --card-border: #3c4043;
  --soft-bg: #252629;
  --link-color: #8ab4f8;
  --success-bg: #133a29;
  --success-text: #81c995;
  --success-muted: #a8dab5;
  --danger-text: #f28b82;
  --shell-bg: rgba(32, 33, 36, 0.86);
  --hero-bg: #252629;
  --hero-border: #3c4043;
  --hero-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --control-bg: rgba(48, 49, 52, 0.88);
  --gold-bg: #3a311b;
  --gold-border: #6f5b22;
  --gold-text: #f8d979;
}

body {
  margin: 0;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text-color);
  transition: background 160ms ease, color 160ms ease;
}

.coming-soon-gate {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  background: rgba(248, 249, 250, 0.52);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

body[data-theme="dark"] .coming-soon-gate {
  background: rgba(32, 33, 36, 0.58);
}

.coming-soon-gate[hidden] {
  display: none;
}

body.is-gated {
  overflow: hidden;
}

body.is-gated .top-bar,
body.is-gated .page {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.gate-panel {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid var(--card-border);
  border-radius: 30px;
  background: var(--shell-bg);
  box-shadow: 0 24px 80px rgba(60, 64, 67, 0.22);
  text-align: center;
  pointer-events: auto;
}

.gate-brand {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  font-family: "PriceInfoTitle", "Montserrat", sans-serif;
  font-size: 20px;
  font-weight: 900;
}

.gate-brand:hover,
.gate-brand:focus {
  color: var(--accent-color);
  outline: none;
}

.gate-kicker {
  margin: 0 0 10px;
  color: var(--accent-color);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.gate-panel h2 {
  margin: 0 0 24px;
  color: var(--text-color);
  font-size: 44px;
  line-height: 1;
}

.page {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 96px 24px 44px;
}

.top-bar {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 68px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--card-border);
  background: var(--shell-bg);
  backdrop-filter: blur(18px);
}

.brand-mini {
  flex: 0 0 auto;
  color: var(--text-color);
  font-family: "PriceInfoTitle", "Montserrat", sans-serif;
  font-size: 15px;
  font-weight: 800;
}

.top-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  transition: gap 180ms ease;
}

.design-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--control-bg);
  overflow-x: auto;
  transition: border-color 160ms ease, background 160ms ease, padding 180ms ease, gap 180ms ease;
}

.design-switcher button,
.language-switcher button,
.quick-actions button {
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-color);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, min-width 180ms ease, padding 180ms ease;
}

.design-switcher button {
  padding: 0 12px;
}

.language-switcher {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--control-bg);
}

.language-switcher button {
  min-width: 36px;
  padding: 0 8px;
}

.design-switcher button:hover,
.design-switcher button:focus,
.design-switcher button.is-active,
.language-switcher button:hover,
.language-switcher button:focus,
.language-switcher button.is-active,
.quick-actions button:hover,
.quick-actions button:focus {
  border-color: var(--button-hover-border);
  background: var(--button-bg);
  color: var(--text-color);
  outline: none;
}

.theme-toggle,
.api-toggle,
.constructor-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--button-hover-border);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--text-color);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, width 180ms ease, padding 180ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus,
.api-toggle:hover,
.api-toggle:focus,
.api-toggle.is-active,
.constructor-link:hover,
.constructor-link:focus {
  border-color: var(--accent-color);
  color: var(--accent-color);
  outline: none;
}

.admin-panel {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: stretch;
}

.admin-panel[hidden] {
  display: none;
}

.admin-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 33, 36, 0.42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.admin-panel-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, calc(100vw - 32px));
  height: min(820px, calc(100dvh - 32px));
  margin: auto;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: 0 24px 80px rgba(32, 33, 36, 0.24);
  overflow: hidden;
  animation: adminPanelIn 180ms ease;
}

.admin-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
  background: var(--card-bg);
}

.admin-panel-header h2 {
  margin: 2px 0 0;
  color: var(--text-color);
  font-size: 18px;
  line-height: 1.15;
}

.admin-close {
  position: relative;
  width: 38px;
  height: 38px;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  background: var(--button-bg);
  cursor: pointer;
}

.admin-close::before,
.admin-close::after {
  position: absolute;
  top: 18px;
  left: 10px;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-color);
  content: "";
}

.admin-close::before {
  transform: rotate(45deg);
}

.admin-close::after {
  transform: rotate(-45deg);
}

.admin-close:hover,
.admin-close:focus {
  border-color: var(--button-hover-border);
  outline: none;
}

#adminFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--page-bg);
}

body.admin-panel-open {
  overflow: hidden;
}

@keyframes adminPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 360px;
  padding: 106px 0 34px;
  text-align: center;
}

body[data-search-open="true"] .search-home {
  justify-content: flex-start;
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 24px;
}

.history-panel {
  width: min(460px, 100%);
  margin: 0 auto 22px;
  padding: 14px;
  border-radius: 24px;
  text-align: left;
}

.info-panel {
  padding: 18px;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: var(--card-bg);
  box-shadow: 0 12px 36px rgba(60, 64, 67, 0.08);
}

.gold-panel {
  border-color: var(--gold-border);
  background: var(--gold-bg);
}

.exchange-panel {
  background: var(--hero-bg);
}

.rate-panel {
  position: relative;
  z-index: 20;
  padding: 0;
  border-radius: 999px;
  background: var(--card-bg);
  box-shadow: 0 10px 34px rgba(60, 64, 67, 0.12);
  overflow: hidden;
  transition:
    border-color 160ms ease,
    box-shadow 180ms ease,
    background-color 160ms ease;
}

.rate-panel.is-open {
  border-radius: 24px;
}

.exchange-panel.rate-panel {
  background: var(--hero-bg);
}

.gold-panel.rate-panel {
  background: var(--gold-bg);
}

.rate-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 9px 14px 9px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.rate-panel.is-open .rate-toggle {
  border-radius: 0;
}

.rate-toggle span:first-child {
  overflow: hidden;
  color: var(--muted-color);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.gold-panel .rate-toggle span:first-child {
  color: var(--gold-text);
}

.rate-toggle strong {
  color: var(--text-color);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.gold-panel .rate-toggle strong {
  color: var(--gold-text);
}

.rate-arrow {
  position: relative;
  width: 16px;
  height: 16px;
}

.rate-arrow::before {
  position: absolute;
  top: 4px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.rate-panel.is-open .rate-arrow::before {
  top: 6px;
  transform: rotate(225deg);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--muted-color);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel-heading strong {
  color: var(--text-color);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.gold-panel .panel-heading,
.gold-panel .panel-heading strong {
  color: var(--gold-text);
}

.rate-grid {
  display: none;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0 12px 12px;
  background: transparent;
}

.rate-panel.is-open .rate-grid {
  display: grid;
}

.rate-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px 2px;
  border-bottom: 1px solid var(--card-border);
  border-radius: 0;
  background: transparent;
}

.rate-grid div:last-child {
  border-bottom: 0;
}

body[data-theme="dark"] .rate-grid div {
  background: transparent;
}

.rate-grid span,
.rate-grid strong {
  display: block;
}

.rate-grid span {
  margin-bottom: 0;
  color: var(--muted-color);
  font-size: 12px;
  font-weight: 800;
}

.gold-panel .rate-grid span {
  color: var(--gold-text);
}

.rate-grid strong {
  color: var(--text-color);
  font-size: 17px;
  font-weight: 900;
}

.search-copy {
  width: min(720px, 100%);
  margin-bottom: 48px;
  transition: margin 220ms ease, opacity 180ms ease, transform 180ms ease;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-color);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--text-color);
  font-family: "PriceInfoTitle", "Montserrat", sans-serif;
  font-size: 58px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.subtitle {
  margin: 16px auto 28px;
  max-width: 560px;
  color: var(--muted-color);
  font-size: 17px;
  line-height: 1.45;
}

.search-wrapper {
  position: relative;
  z-index: 30;
  width: min(720px, 100%);
  border: 1px solid var(--input-border);
  border-radius: 999px;
  background: var(--card-bg);
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.14);
  overflow: hidden;
  transition:
    border-color 160ms ease,
    box-shadow 180ms ease,
    background-color 160ms ease;
}

body[data-search-open="true"] .search-wrapper {
  border-color: var(--card-border);
  border-radius: 22px;
  box-shadow: 0 10px 34px rgba(60, 64, 67, 0.12);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: background-color 160ms ease;
}

body[data-search-open="true"] .search-box {
  border-radius: 0;
  box-shadow: none;
}

input {
  width: 100%;
  height: 35px;
  padding: 0 42px 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-color);
  font-size: 16px;
  outline: none;
}

.clear-search {
  position: absolute;
  right: 82px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-color);
  cursor: pointer;
  opacity: 1;
  transition: background 160ms ease, color 160ms ease, opacity 140ms ease, transform 140ms ease;
}

.clear-search[hidden] {
  display: none;
}

.clear-search::before,
.clear-search::after {
  position: absolute;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.clear-search::before {
  transform: rotate(45deg);
}

.clear-search::after {
  transform: rotate(-45deg);
}

.clear-search:hover,
.clear-search:focus {
  background: var(--soft-bg);
  color: var(--text-color);
  outline: none;
}

input:hover,
input:focus {
  box-shadow: none;
}

#searchBtn {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--button-border);
  border-radius: 999px;
  background: var(--accent-color);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, transform 140ms ease, padding 180ms ease;
}

#searchBtn:hover,
#searchBtn:focus {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  outline: none;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

body[data-has-results="true"] .quick-actions {
  display: none;
}

.quick-actions button {
  padding: 0 14px;
  border-color: var(--card-border);
  background: var(--soft-bg);
}

body[data-design="focus"] .search-home {
  min-height: 390px;
  border-radius: 32px;
}

body[data-design="focus"] .market-strip {
  position: fixed;
  z-index: 9;
  top: 96px;
  right: 24px;
  left: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin: 0;
  pointer-events: none;
}

body[data-design="focus"] .info-panel {
  width: 224px;
  border-radius: 28px;
  pointer-events: auto;
}

body[data-design="focus"] .rate-panel {
  border-radius: 999px;
}

body[data-design="focus"] .rate-panel.is-open {
  border-radius: 24px;
}

body[data-design="focus"] .history-panel {
  position: fixed;
  z-index: 9;
  top: 350px;
  right: 24px;
  width: 224px;
  margin: 0;
  pointer-events: auto;
}

body[data-design="focus"] .rate-grid {
  grid-template-columns: 1fr;
}

body[data-design="focus"] .rate-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-radius: 0;
}

body[data-design="focus"] .rate-grid span,
body[data-design="focus"] .rate-grid strong {
  margin: 0;
}

body[data-design="focus"] .search-wrapper {
  box-shadow: var(--hero-shadow);
}

body[data-design="focus"] #searchBtn,
body[data-design="focus"] .quick-actions button,
body[data-design="focus"] .theme-toggle,
body[data-design="focus"] .design-switcher,
body[data-design="focus"] .language-switcher,
body[data-design="focus"] .design-switcher button,
body[data-design="focus"] .language-switcher button {
  border-radius: 999px;
}

body:not([data-design="focus"]) .market-strip {
  display: none;
}

body[data-design="market"] {
  --page-bg: #f6f8f4;
  --accent-color: #176d58;
  --accent-strong: #0f513f;
  --hero-bg: #edf6ee;
  --hero-border: #d8e7dc;
  --soft-bg: #eef4ef;
}

body[data-theme="dark"][data-design="market"] {
  --page-bg: #202421;
  --hero-bg: #26322b;
  --hero-border: #385142;
  --soft-bg: #26322b;
}

body[data-design="market"] .search-home {
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 42px;
  border: 1px solid var(--hero-border);
  border-radius: 8px;
  background: var(--hero-bg);
  text-align: left;
}

body[data-design="market"] .subtitle {
  margin-left: 0;
}

body[data-design="market"] .quick-actions {
  justify-content: flex-start;
}

body[data-design="compare"] {
  --page-bg: #fbfaf7;
  --accent-color: #9a3412;
  --accent-strong: #7c2d12;
  --hero-bg: #ffffff;
  --hero-border: #e7e0d4;
  --soft-bg: #f7f1e8;
}

body[data-theme="dark"][data-design="compare"] {
  --page-bg: #242220;
  --hero-bg: #2d2a25;
  --hero-border: #4a4237;
  --soft-bg: #342f28;
}

body[data-design="compare"] .page {
  width: min(1180px, 100%);
}

body[data-design="compare"] .search-home {
  min-height: 300px;
  border-bottom: 1px solid var(--hero-border);
}

body[data-design="compare"] .results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-design="command"] {
  --page-bg: #f4f7fb;
  --accent-color: #3559e0;
  --accent-strong: #2342ad;
  --hero-bg: #ffffff;
  --hero-border: #d9e2f2;
  --soft-bg: #eef3fb;
}

body[data-theme="dark"][data-design="command"] {
  --page-bg: #1f232b;
  --hero-bg: #272d37;
  --hero-border: #3a4556;
  --soft-bg: #2b3340;
}

body[data-design="command"] .search-home {
  min-height: 0;
  align-items: stretch;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--hero-border);
  border-radius: 8px;
  background: var(--hero-bg);
  box-shadow: var(--hero-shadow);
  text-align: left;
}

body[data-design="command"] .search-copy {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  align-items: end;
  width: 100%;
}

body[data-design="command"] .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

body[data-design="command"] h1 {
  font-size: 32px;
}

body[data-design="command"] .subtitle {
  margin: 0;
  max-width: none;
  font-size: 14px;
}

body[data-design="command"] .search-box {
  width: 100%;
  margin-top: 16px;
}

body[data-design="command"] .quick-actions {
  justify-content: flex-start;
}

body[data-design="compact"] {
  --page-bg: #f7f7fb;
  --accent-color: #5b3cc4;
  --accent-strong: #43289a;
  --hero-bg: #ffffff;
  --hero-border: #dedbf0;
  --soft-bg: #f0eef8;
}

body[data-theme="dark"][data-design="compact"] {
  --page-bg: #222126;
  --hero-bg: #2c2934;
  --hero-border: #443d55;
  --soft-bg: #342f42;
}

body[data-design="compact"] .page {
  width: min(680px, 100%);
}

body[data-design="compact"] .search-home {
  min-height: 280px;
  padding-top: 18px;
}

body[data-design="compact"] h1 {
  font-size: 42px;
}

body[data-design="compact"] .subtitle {
  margin-bottom: 20px;
  font-size: 15px;
}

body[data-has-results="true"] .search-home {
  align-items: center;
  justify-content: center;
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

body[data-has-results="true"] .search-copy {
  display: block;
}

body[data-has-results="true"] .search-box {
  width: 100%;
}

.status {
  min-height: 0;
  margin: 0;
  color: var(--muted-color);
  font-size: 13px;
}

.search-home .status {
  width: min(720px, 100%);
  margin: 0 auto;
  text-align: left;
}

.api-inspector {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  transition: opacity 180ms ease, transform 180ms ease, max-height 220ms ease, padding 180ms ease, margin 180ms ease;
}

.api-inspector[hidden] {
  display: none;
}

.api-inspector-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.api-kicker {
  margin: 0 0 4px;
  color: var(--muted-color);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.api-inspector h2 {
  margin: 0;
  color: var(--text-color);
  font-size: 18px;
  line-height: 1.2;
}

.api-status-pill {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft-bg);
  color: var(--muted-color);
  font-size: 12px;
  font-weight: 900;
}

.api-inspector[data-state="success"] .api-status-pill {
  background: var(--success-bg);
  color: var(--success-text);
}

.api-inspector[data-state="error"] .api-status-pill {
  background: #fce8e6;
  color: #b3261e;
}

body[data-theme="dark"] .api-inspector[data-state="error"] .api-status-pill {
  background: #3f1d1a;
  color: #f2b8b5;
}

.api-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.api-metrics div,
.api-row,
.api-body-grid > div {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft-bg);
}

.api-metrics span,
.api-row span,
.api-body-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-color);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.api-metrics strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text-color);
  font-size: 15px;
}

.api-row code,
.api-body-grid pre {
  display: block;
  margin: 0;
  overflow: auto;
  color: var(--text-color);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.api-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr);
  gap: 8px;
}

.api-body-grid pre {
  max-height: 260px;
}

.results {
  display: grid;
  gap: 0;
}

.live-results {
  grid-template-columns: 1fr;
  width: 100%;
  max-height: min(430px, calc(100dvh - 220px));
  margin: 0;
  border: 0;
  border-top: 1px solid var(--card-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: left;
  transform-origin: top center;
  transition:
    max-height 220ms ease,
    opacity 180ms ease;
}

.live-results:empty {
  display: none;
}

.live-results[data-mode="recent"] {
  display: grid;
  gap: 0;
  max-height: min(280px, calc(100dvh - 220px));
  overflow-y: auto;
}

.search-empty-state {
  display: grid;
  gap: 4px;
  min-height: 72px;
  place-items: center;
  padding: 18px 16px 20px;
  color: var(--muted-color);
  text-align: center;
}

.search-empty-title {
  color: var(--text-color);
  font-size: 14px;
  font-weight: 750;
}

.search-empty-subtitle {
  color: var(--muted-color);
  font-size: 13px;
  font-weight: 550;
}

.price-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--card-border);
  background: var(--card-bg);
}

.price-summary-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.price-summary-main span {
  color: var(--muted-color);
  font-size: 13px;
  font-weight: 650;
}

.price-summary-main strong {
  color: var(--text-color);
  font-size: clamp(30px, 6vw, 42px);
  font-weight: 760;
  line-height: 1;
}

.price-summary-main small {
  color: var(--muted-color);
  font-size: 13px;
  font-weight: 600;
}

.summary-trend {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 70px;
  justify-content: flex-end;
  color: var(--muted-color);
  font-size: 22px;
  font-weight: 800;
}

.summary-trend strong {
  font-size: 14px;
  font-weight: 800;
}

.summary-trend.is-up {
  color: var(--success-text);
}

.summary-trend.is-down {
  color: var(--danger-text);
}

.summary-trend-neutral {
  color: var(--muted-color);
  font-size: 18px;
}

.found-products-title {
  padding: 9px 12px 6px;
  color: var(--muted-color);
  font-size: 12px;
  font-weight: 750;
}

.product-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 132px auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--card-border);
  cursor: pointer;
  transition: min-height 180ms ease, padding 180ms ease, background 160ms ease, grid-template-columns 180ms ease;
}

.product-row:last-child {
  border-bottom: 0;
}

.product-row:hover,
.product-row:focus-within,
.product-row.is-active {
  background: var(--soft-bg);
}

.product-thumb {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  background: var(--page-bg);
  color: var(--accent-color);
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-main {
  min-width: 0;
}

.product-main h2 {
  margin: 0;
  overflow: hidden;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-source-line {
  min-width: 0;
  color: var(--muted-color);
  font-size: 12px;
  white-space: nowrap;
}

.product-source-line a,
.product-source-line span {
  display: block;
  overflow: hidden;
  color: var(--link-color);
  text-decoration: none;
  text-overflow: ellipsis;
}

.product-source-line a:hover,
.product-source-line a:focus {
  text-decoration: underline;
}

.product-price-stack {
  min-width: 86px;
  color: var(--text-color);
  text-align: right;
}

.product-price-stack strong,
.product-price-stack span {
  display: block;
}

.product-price-stack strong {
  font-size: 14px;
  font-weight: 850;
}

.product-price-stack span {
  margin-top: 4px;
  color: var(--muted-color);
  font-size: 12px;
  font-weight: 700;
  text-decoration: line-through;
}

.product-row-loading {
  pointer-events: none;
}

.loading-line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--soft-bg), var(--card-border), var(--soft-bg));
  background-size: 220% 100%;
  animation: loading 900ms ease-in-out infinite;
}

.loading-title {
  width: min(320px, 80%);
  height: 14px;
}

.loading-price {
  width: 78px;
  margin-left: auto;
}

.recent-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 7px 12px;
  border: 0;
  border-bottom: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  text-align: left;
  transition: min-height 180ms ease, padding 180ms ease, background 160ms ease;
}

.recent-row:last-child {
  border-bottom: 0;
}

.recent-row span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-row:hover,
.recent-row:focus {
  background: var(--soft-bg);
  outline: none;
}

.recent-clock {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
  border: 2px solid var(--muted-color);
  border-radius: 50%;
}

.recent-clock::before,
.recent-clock::after {
  position: absolute;
  left: 7px;
  bottom: 7px;
  display: block;
  width: 2px;
  border-radius: 999px;
  background: var(--muted-color);
  content: "";
  transform-origin: bottom center;
}

.recent-clock::before {
  height: 6px;
}

.recent-clock::after {
  height: 5px;
  transform: rotate(90deg);
}

@keyframes loading {
  from {
    background-position: 120% 0;
  }

  to {
    background-position: -120% 0;
  }
}

.history-panel[hidden] {
  display: none;
}

.history-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.history-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  width: 100%;
}

.history-header h2 {
  margin: 0;
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.25;
}

.history-header strong {
  display: block;
  color: var(--text-color);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.history-header span {
  color: var(--muted-color);
  font-size: 12px;
  text-align: right;
}

.history-chart {
  min-height: 128px;
  color: var(--accent-color);
}

.history-chart svg {
  display: block;
  width: 100%;
  height: 128px;
}

.chart-grid {
  stroke: var(--card-border);
  stroke-width: 1;
}

.chart-area {
  fill: url(#priceArea);
}

.chart-line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-dot {
  fill: var(--card-bg);
  stroke: currentColor;
  stroke-width: 2;
}

.chart-label {
  fill: var(--muted-color);
  font-size: 11px;
  font-weight: 700;
}

.chart-date {
  font-size: 11px;
}

.chart-skeleton {
  display: grid;
  gap: 14px;
  align-content: center;
  min-height: 220px;
}

.chart-skeleton div {
  height: 12px;
  border-radius: 999px;
  background: var(--soft-bg);
}

.chart-skeleton div:nth-child(1) {
  width: 86%;
}

.chart-skeleton div:nth-child(2) {
  width: 64%;
}

.chart-skeleton div:nth-child(3) {
  width: 74%;
}

@media (max-width: 1120px) {
  body[data-design="focus"] .market-strip {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 24px;
  }

  body[data-design="focus"] .info-panel {
    width: auto;
  }

  body[data-design="focus"] .history-panel {
    position: static;
    width: min(460px, 100%);
    margin: 0 auto 18px;
  }
}

@media (max-width: 600px) {
  .top-bar {
    position: static;
    display: grid;
    min-height: 0;
    padding: 12px;
  }

  .top-controls {
    display: grid;
    gap: 10px;
  }

  .design-switcher {
    width: 100%;
  }

  .language-switcher {
    width: 100%;
    justify-content: stretch;
  }

  .language-switcher button {
    flex: 1;
  }

  .theme-toggle {
    width: 100%;
  }

  .page,
  body[data-design="compare"] .page,
  body[data-design="compact"] .page {
    width: 100%;
    padding: 22px 16px 32px;
  }

  .search-home {
    min-height: 300px;
    padding: 92px 0 26px;
  }

  .market-strip {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
  }

  .info-panel {
    padding: 14px;
    border-radius: 22px;
  }

  .rate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-design="focus"] .market-strip {
    position: static;
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
  }

  body[data-design="focus"] .info-panel {
    width: auto;
  }

  body[data-design="focus"] .rate-grid {
    grid-template-columns: 1fr;
  }

  body[data-design="market"] .search-home,
  body[data-design="command"] .search-home {
    padding: 22px;
  }

  h1 {
    font-size: 42px;
  }

  body[data-design="command"] .search-copy {
    display: block;
  }

  body[data-design="command"] h1,
  body[data-design="compact"] h1 {
    font-size: 34px;
  }

  .subtitle {
    font-size: 15px;
  }

  .search-box {
    display: flex;
    gap: 16px;
  }

  #searchBtn {
    width: auto;
  }

  body[data-design="compare"] .results {
    grid-template-columns: 1fr;
  }

  .api-metrics,
  .api-body-grid {
    grid-template-columns: 1fr;
  }

  .product-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    min-height: 56px;
    padding: 8px 10px;
  }

  .product-thumb {
    width: 30px;
    height: 30px;
  }

  .product-source-line {
    display: none;
  }

  .product-price-stack {
    min-width: 0;
    text-align: right;
  }

  .history-header {
    display: grid;
  }

  .history-info {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .history-header span {
    text-align: left;
  }

  .gate-panel {
    padding: 22px;
    border-radius: 26px;
  }

  .gate-panel h2 {
    font-size: 34px;
  }
}
