:root {
  --paper: #f7f4ed;
  --paper-deep: #eee9df;
  --card: rgba(255, 253, 248, 0.9);
  --card-solid: #fffdf8;
  --ink: #20211f;
  --muted: #73746f;
  --faint: #a8a7a0;
  --line: #e6e0d5;
  --line-strong: #d8d0c3;
  --red: #e64439;
  --red-deep: #c9322b;
  --red-soft: #fae9e5;
  --teal: #247c72;
  --teal-soft: #dff0ec;
  --gold: #b87c2c;
  --shadow: 0 24px 70px rgba(48, 40, 30, 0.09);
  --shadow-small: 0 10px 30px rgba(48, 40, 30, 0.07);
  --radius: 28px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family: "SF Pro Display", "Avenir Next", "PingFang SC", "Noto Sans SC",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.ambient-one {
  top: -19rem;
  right: -8rem;
  background: radial-gradient(circle, rgba(230, 68, 57, 0.15), transparent 67%);
}

.ambient-two {
  bottom: -21rem;
  left: -15rem;
  background: radial-gradient(circle, rgba(36, 124, 114, 0.12), transparent 67%);
}

.app-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 94px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--red);
  box-shadow: 0 9px 20px rgba(230, 68, 57, 0.24);
}

.brand-mark svg {
  width: 32px;
  fill: none;
  stroke: white;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-pill,
.icon-button,
.text-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.74);
  color: var(--muted);
  text-decoration: none;
}

.connection-pill {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(184, 124, 44, 0.11);
}

.connection-pill.online .connection-dot {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(36, 124, 114, 0.11);
}

.connection-pill.offline .connection-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(230, 68, 57, 0.1);
}

.icon-button {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button:hover,
.secondary-button:hover,
.text-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.icon-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button.is-spinning svg {
  animation: spin 0.9s linear infinite;
}

main {
  padding-bottom: 32px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(380px, 0.96fr);
  gap: clamp(48px, 8vw, 110px);
  align-items: center;
  min-height: 390px;
  padding: 70px 34px 66px;
  overflow: hidden;
  border: 1px solid rgba(230, 224, 213, 0.9);
  border-radius: 36px;
  background:
    radial-gradient(circle at 93% 12%, rgba(230, 68, 57, 0.08), transparent 31%),
    linear-gradient(125deg, rgba(255, 253, 248, 0.94), rgba(248, 242, 233, 0.9));
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  right: 42%;
  bottom: -120px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(230, 68, 57, 0.08);
  border-radius: 50%;
  content: "";
}

.hero-copy,
.rate-feature {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--red-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
}

.eyebrow span {
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--red);
}

.hero h1 {
  margin: 21px 0 19px;
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1.12;
}

.hero h1 em {
  color: var(--red);
  font-family: "Songti SC", "STSong", serif;
  font-style: normal;
  font-weight: 650;
}

.hero-intro {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  color: var(--faint);
  font-size: 12px;
}

.meta-divider {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

.rate-feature {
  padding: 30px;
  border: 1px solid rgba(230, 68, 57, 0.2);
  border-radius: 26px;
  background: rgba(255, 253, 249, 0.78);
  box-shadow: 0 18px 48px rgba(82, 54, 39, 0.08);
  backdrop-filter: blur(14px);
}

.rate-feature-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.currency-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

#heroRate {
  font-size: clamp(46px, 5vw, 67px);
  font-weight: 680;
  letter-spacing: -0.06em;
  line-height: 1;
}

.change-badge {
  display: flex;
  min-width: 94px;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(115, 116, 111, 0.07);
  color: var(--muted);
  font-size: 12px;
}

.change-badge.up {
  background: var(--red-soft);
  color: var(--red-deep);
}

.change-badge.down {
  background: var(--teal-soft);
  color: var(--teal);
}

.change-badge strong {
  font-size: 13px;
}

.change-badge small {
  color: currentColor;
  font-size: 9px;
  opacity: 0.72;
}

.rate-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 27px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
}

.rate-labels div {
  padding: 0 16px;
  border-left: 1px solid var(--line);
}

.rate-labels div:first-child {
  padding-left: 0;
  border-left: 0;
}

.rate-labels div:last-child {
  padding-right: 0;
}

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

.rate-labels span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.rate-labels strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.rate-note {
  margin: 21px 0 0;
  color: var(--faint);
  font-size: 10px;
  text-align: right;
}

.status-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  margin: 18px 0 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.72);
}

.status-strip.is-busy {
  grid-template-columns: 1fr auto auto;
}

.status-strip-copy {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.status-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--red-soft);
  color: var(--red);
}

.status-icon svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.status-strip strong,
.status-strip p {
  display: block;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-strip strong {
  font-size: 12px;
}

.status-strip p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.status-progress {
  width: 150px;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-deep);
}

.status-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #f58c66);
  transition: width 300ms ease;
}

.text-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.text-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 18px;
  margin-top: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(14px);
}

.converter-card,
.snapshot-card {
  min-height: 370px;
  padding: 28px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.card-heading h2 {
  margin: 7px 0 0;
  font-size: 25px;
  font-weight: 660;
  letter-spacing: -0.035em;
}

.live-chip,
.record-count {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.live-chip {
  gap: 7px;
}

.live-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.direction-tabs {
  display: flex;
  gap: 5px;
  width: fit-content;
  margin-top: 29px;
  padding: 4px;
  border-radius: 12px;
  background: var(--paper-deep);
}

.direction-tabs button {
  min-height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.direction-tabs button.active {
  background: var(--card-solid);
  color: var(--ink);
  box-shadow: 0 4px 13px rgba(50, 43, 34, 0.08);
}

.converter-fields {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.amount-field {
  display: flex;
  min-width: 0;
  min-height: 98px;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.55);
}

.amount-field span {
  color: var(--muted);
  font-size: 10px;
}

.amount-field input,
.amount-field output {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(21px, 2.4vw, 28px);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amount-field input::-webkit-outer-spin-button,
.amount-field input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.amount-field input[type="number"] {
  appearance: textfield;
}

.result-field {
  border-color: rgba(230, 68, 57, 0.19);
  background: linear-gradient(145deg, var(--red-soft), rgba(255, 253, 248, 0.76));
}

.result-field output {
  color: var(--red-deep);
}

.swap-button {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  width: 35px;
  height: 35px;
  transform: translate(-50%, -50%);
  place-items: center;
  border: 4px solid var(--card-solid);
  border-radius: 50%;
  background: var(--ink);
  color: white;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.swap-button:hover {
  transform: translate(-50%, -50%) rotate(180deg);
  background: var(--red);
}

.swap-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.amount-shortcuts {
  display: flex;
  gap: 7px;
  margin-top: 14px;
}

.amount-shortcuts button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.amount-shortcuts button:hover {
  border-color: rgba(230, 68, 57, 0.25);
  background: var(--red-soft);
  color: var(--red-deep);
}

.conversion-footnote {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  color: var(--muted);
}

.conversion-footnote svg {
  width: 15px;
  flex: 0 0 auto;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.conversion-footnote p {
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}

.spread-visual {
  position: relative;
  height: 54px;
  margin: 32px 2px 6px;
}

.spread-line {
  position: absolute;
  top: 25px;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--teal), var(--line), var(--red));
}

.spread-knob {
  position: absolute;
  top: 20px;
  width: 11px;
  height: 11px;
  border: 3px solid var(--card-solid);
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.12);
}

.buy-knob {
  left: 10%;
  background: var(--teal);
}

.sell-knob {
  right: 10%;
  background: var(--red);
}

.snapshot-values {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 10px;
  text-align: center;
}

.snapshot-values span,
.snapshot-values strong {
  display: block;
}

.snapshot-values span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
}

.snapshot-values strong {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.spread-value strong {
  color: var(--red-deep);
}

.snapshot-details {
  margin: 28px 0 0;
  padding-top: 5px;
}

.snapshot-details div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.snapshot-details dt {
  color: var(--muted);
  font-size: 10px;
}

.snapshot-details dd {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.snapshot-details a {
  color: var(--red-deep);
  text-decoration: none;
}

.chart-card,
.records-card {
  margin-top: 18px;
  padding: 28px;
}

.records-card {
  scroll-margin-top: 24px;
}

.chart-heading {
  align-items: center;
}

.heading-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.range-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: var(--paper-deep);
}

.range-tabs button {
  min-width: 48px;
  min-height: 31px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.range-tabs button.active {
  background: var(--card-solid);
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(50, 43, 34, 0.08);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 10px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 15px;
  height: 2px;
  border-radius: 99px;
}

.legend-buy {
  background: var(--teal);
}

.legend-sell {
  background: var(--red);
}

.chart-legend strong {
  margin-left: auto;
  color: var(--faint);
  font-size: 10px;
  font-weight: 500;
}

.chart-wrap {
  position: relative;
  min-height: 300px;
  margin-top: 8px;
}

#trendChart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--line);
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.chart-axis-label {
  fill: var(--faint);
  font-family: inherit;
  font-size: 10px;
}

.chart-line-buy,
.chart-line-sell {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-buy {
  stroke: var(--teal);
  stroke-width: 2.3;
}

.chart-line-sell {
  stroke: var(--red);
  stroke-width: 2.3;
}

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

.chart-dot {
  stroke-width: 3;
}

.chart-empty {
  position: absolute;
  inset: 50px 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  font-size: 12px;
}

.chart-empty small {
  color: var(--faint);
  font-size: 10px;
}

.records-heading {
  align-items: center;
}

.records-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 37px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.48);
}

.search-field svg {
  width: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search-field input {
  width: 128px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
}

.search-field input::placeholder {
  color: var(--faint);
}

.secondary-button {
  height: 37px;
  padding: 0 12px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 10px;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 25px;
}

table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

th {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-align: left;
}

th:not(:first-child),
td:not(:first-child) {
  text-align: right;
}

td {
  padding: 15px 14px;
  border-bottom: 1px solid rgba(230, 224, 213, 0.68);
  color: #50514d;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(250, 233, 229, 0.33);
}

.date-cell {
  color: var(--ink);
  font-weight: 650;
}

.date-cell span {
  margin-left: 7px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 500;
}

.latest-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 7px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--red-soft);
  color: var(--red-deep);
  font-size: 8px;
  font-weight: 700;
  vertical-align: 1px;
}

.buy-cell {
  color: var(--teal);
  font-weight: 650;
}

.sell-cell {
  color: var(--red-deep);
  font-weight: 650;
}

.placeholder-row td {
  height: 160px;
  color: var(--faint);
  text-align: center !important;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 17px;
}

.table-footer p {
  margin: 0;
  color: var(--faint);
  font-size: 10px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
}

.pagination button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--ink);
}

.pagination button:disabled {
  cursor: default;
  opacity: 0.35;
}

.pagination svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 100px;
  color: var(--faint);
  font-size: 9px;
}

footer div {
  display: flex;
  align-items: center;
  gap: 9px;
}

footer strong {
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.08em;
}

footer p {
  margin: 0;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 16px;
  transform: translateY(18px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 15px 40px rgba(25, 20, 15, 0.22);
  color: white;
  font-size: 11px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
    padding: 56px 34px;
  }

  .hero-copy {
    max-width: 680px;
  }

  .rate-feature {
    max-width: 680px;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .snapshot-card {
    min-height: auto;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 28px, 1180px);
  }

  .topbar {
    min-height: 78px;
  }

  .brand small,
  .icon-button span,
  .connection-pill span:not(.connection-dot) {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .connection-pill {
    width: 35px;
    height: 35px;
    padding: 0;
  }

  .icon-button {
    width: 36px;
    height: 36px;
    padding: 0;
  }

  .hero {
    min-height: 0;
    padding: 42px 22px 24px;
    border-radius: 27px;
  }

  .hero h1 {
    margin-top: 17px;
    font-size: 40px;
  }

  .hero-intro {
    font-size: 13px;
    line-height: 1.75;
  }

  .rate-feature {
    padding: 22px 18px;
    border-radius: 20px;
  }

  #heroRate {
    font-size: 48px;
  }

  .change-badge {
    min-width: 84px;
    padding: 8px;
  }

  .rate-labels {
    margin-top: 22px;
  }

  .rate-labels div {
    padding: 0 10px;
  }

  .rate-labels strong {
    font-size: 15px;
  }

  .status-strip,
  .status-strip.is-busy {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 11px;
    padding: 14px;
  }

  .status-strip .text-button {
    width: 100%;
  }

  .status-progress {
    width: 100%;
  }

  .converter-card,
  .snapshot-card,
  .chart-card,
  .records-card {
    padding: 21px 17px;
    border-radius: 22px;
  }

  .card-heading h2 {
    font-size: 22px;
  }

  .direction-tabs {
    width: 100%;
  }

  .direction-tabs button {
    flex: 1;
    padding: 0 8px;
  }

  .converter-fields {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .amount-field {
    min-height: 84px;
  }

  .swap-button {
    top: 50%;
  }

  .swap-button:hover {
    transform: translate(-50%, -50%) rotate(180deg);
  }

  .amount-shortcuts {
    overflow-x: auto;
  }

  .amount-shortcuts button {
    flex: 0 0 auto;
  }

  .chart-heading,
  .records-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .range-tabs {
    width: 100%;
  }

  .range-tabs button {
    flex: 1;
  }

  .chart-wrap {
    min-height: 230px;
  }

  .chart-legend strong {
    display: none;
  }

  .records-actions {
    width: 100%;
  }

  .search-field {
    flex: 1;
  }

  .search-field input {
    width: 100%;
  }

  .secondary-button {
    flex: 0 0 auto;
  }

  footer {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 25px 0;
    text-align: center;
  }

  footer div {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
