:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07101f;
  color: #f7fbff;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(39, 132, 255, .24), transparent 34rem),
    radial-gradient(circle at 90% 85%, rgba(0, 220, 181, .16), transparent 30rem),
    #07101f;
}

button, input, select { font: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.converter {
  width: min(760px, 100%);
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 28px;
  background: rgba(12, 23, 41, .86);
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  backdrop-filter: blur(18px);
}

header { text-align: center; }
.eyebrow {
  margin: 0 0 10px;
  color: #70d7ff;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .16em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.2rem);
  line-height: 1;
  letter-spacing: -.055em;
}

h1 span { color: #36e0b8; }
.subtitle { margin: 14px 0 0; color: #aab8cb; }

.system-control {
  display: grid;
  gap: 8px;
  margin: 34px auto 18px;
  max-width: 340px;
  color: #b9c7d9;
  font-size: .86rem;
  font-weight: 700;
}

select {
  width: 100%;
  padding: 13px 44px 13px 15px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 13px;
  background: #111f34;
  color: #fff;
  outline: none;
}

.conversion-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.field-card {
  display: grid;
  gap: 9px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  background: rgba(255,255,255,.045);
}

.field-card:focus-within {
  border-color: #55caff;
  box-shadow: 0 0 0 3px rgba(85, 202, 255, .13);
}

.field-label { color: #aab8cb; font-size: .82rem; font-weight: 750; }
.input-row { display: flex; align-items: baseline; gap: 8px; }
input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
}
input::placeholder { color: #526177; }
.unit { color: #70d7ff; font-weight: 800; }

.swap-button {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  background: #152942;
  color: #36e0b8;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}
.swap-button:hover { transform: rotate(180deg); background: #1b3554; }

.reference {
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 14px;
  background: rgba(54, 224, 184, .08);
  color: #bfeee2;
  text-align: center;
  font-size: .92rem;
}

.clear-button {
  display: block;
  margin: 22px auto 0;
  padding: 11px 18px;
  border: 0;
  background: transparent;
  color: #91a1b7;
  cursor: pointer;
}
.clear-button:hover { color: #fff; }

@media (max-width: 640px) {
  .app-shell { padding: 14px; }
  .converter { padding: 24px 18px; border-radius: 22px; }
  .conversion-grid { grid-template-columns: 1fr; }
  .swap-button { justify-self: center; transform: rotate(90deg); }
  .swap-button:hover { transform: rotate(270deg); }
}
