:root {
  color-scheme: light;
  --bg-top: #fffaf3;
  --bg-bottom: #f2e2cb;
  --panel: rgba(255, 250, 244, 0.84);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --panel-line: rgba(157, 107, 56, 0.14);
  --text: #2f2419;
  --muted: #7a6754;
  --accent: #dd6f34;
  --accent-strong: #bf5620;
  --shadow: 0 24px 60px rgba(104, 69, 28, 0.14);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 28%),
    radial-gradient(circle at bottom right, rgba(221, 111, 52, 0.12), transparent 30%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--text);
  font-family: "Avenir Next", "SF Pro Display", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding:
    max(14px, env(safe-area-inset-top))
    14px
    max(14px, env(safe-area-inset-bottom))
    14px;
}

.phone-frame {
  width: min(100%, 430px);
  min-height: calc(100dvh - max(28px, env(safe-area-inset-top)) - max(28px, env(safe-area-inset-bottom)));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-xl);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero,
.rate-panel,
.amount-card,
.status-panel {
  border: 1px solid var(--panel-line);
  background: var(--panel-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.hero {
  padding: 16px;
  border-radius: 28px;
}

.eyebrow,
.panel-label,
.card-topline,
.currency-note {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.5rem, 5.6vw, 2rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hero-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.4;
}

.rate-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
}

.panel-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rate {
  margin: 6px 0 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.secondary-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 14px;
  background: rgba(221, 111, 52, 0.12);
  color: var(--accent-strong);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.converter {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
}

.amount-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  border-radius: 26px;
}

.amount-card-primary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 239, 0.96));
}

.amount-card-secondary {
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.95), rgba(248, 239, 226, 0.95));
}

.currency-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.currency-name {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.currency-note {
  font-size: 0.88rem;
}

.amount-input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  appearance: none;
  -webkit-appearance: none;
}

.amount-input::placeholder {
  color: rgba(122, 103, 84, 0.45);
}

.status-panel {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
}

.status-text {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.35;
}

.secondary-button:active {
  transform: scale(0.98);
}

@media (max-height: 844px) {
  .phone-frame {
    gap: 10px;
    padding: 14px;
  }

  .hero {
    padding: 14px;
  }

  .hero h1 {
    font-size: clamp(1.35rem, 5vw, 1.8rem);
  }

  .hero-copy,
  .status-text,
  .currency-note,
  .secondary-button {
    font-size: 0.9rem;
  }

  .rate-panel,
  .status-panel {
    padding: 12px 14px;
  }

  .amount-card {
    padding: 14px;
  }

  .amount-input {
    font-size: clamp(1.82rem, 6.5vw, 2.5rem);
  }
}

@media (max-width: 390px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .phone-frame {
    padding: 12px;
  }

  .rate-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .secondary-button {
    width: 100%;
  }
}
