:root {
  color-scheme: dark;
  --bg: #06080d;
  --surface: #0d141d;
  --surface-2: #121c29;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f7f9fc;
  --muted: #96a4b8;
  --gold: #ffb529;
  --gold-2: #ffe066;
  --blue: #2d8cff;
  --green: #2be09b;
  --red: #ff6578;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 181, 41, 0.08), transparent 260px),
    linear-gradient(135deg, #05070b 0%, #0a111a 48%, #080b11 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000, transparent 72%);
}

button,
input,
select {
  font: inherit;
}

.app {
  position: relative;
  width: min(480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px;
}

.cover {
  overflow: hidden;
  border: 1px solid rgba(255, 181, 41, 0.2);
  border-radius: 18px;
  background: #030407;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.cover img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.workspace {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18, 28, 41, 0.98), rgba(8, 12, 18, 0.99));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
}

.topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.topline p {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: 0;
}

.topline > span {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(43, 224, 155, 0.36);
  border-radius: 999px;
  background: rgba(43, 224, 155, 0.1);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.metrics div {
  min-height: 66px;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  font-size: 17px;
}

.metrics span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 14px;
}

.tab,
.secondary {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-weight: 850;
}

.tab.active {
  border-color: rgba(255, 181, 41, 0.58);
  background: linear-gradient(135deg, rgba(255, 181, 41, 0.24), rgba(45, 140, 255, 0.12));
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.direction {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.wide {
  grid-column: 1 / -1;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #080d14;
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(45, 140, 255, 0.16);
}

.quote {
  margin: 4px 0 14px;
  padding: 14px;
  border: 1px solid rgba(45, 140, 255, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(45, 140, 255, 0.15), rgba(255, 181, 41, 0.1)),
    rgba(255, 255, 255, 0.035);
}

.quote span,
.quote small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.quote strong {
  display: block;
  margin: 5px 0;
  font-size: 22px;
  line-height: 1.15;
}

.quote-large {
  margin-top: 12px;
}

.primary {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #10120d;
  font-weight: 950;
}

.secondary {
  width: 100%;
  margin-top: 10px;
}

.error {
  min-height: 20px;
  margin: 2px 0 10px;
  color: var(--red);
  font-size: 13px;
}

.hidden {
  display: none;
}

.rates-list {
  display: grid;
  gap: 8px;
}

.rate-row,
.status-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.rate-row span {
  color: var(--muted);
}

.status-panel {
  display: grid;
}

.status-panel span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 390px) {
  .workspace {
    padding: 13px;
  }

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

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

  .wide {
    grid-column: auto;
  }
}
