:root {
  --bg: #0f1015;
  --card: #161821;
  --card-2: #1b1e29;
  --text: #f5f6fb;
  --muted: #a2a8c1;
  --accent: #6ae2ff;
  --accent-2: #7c8bff;
  --accent-3: #9c7bff;
  --stroke: #24283b;
  --success: #6ef3c5;
  --danger: #ff7b9c;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(124, 139, 255, 0.08), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(106, 226, 255, 0.1), transparent 25%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.bg-noise {
  position: fixed;
  inset: 0;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160"%3E%3Cfilter id="n" x="0" y="0" width="100%25" height="100%25"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="2" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23n)" opacity="0.08"/%3E%3C/svg%3E');
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: 0.4;
  z-index: 0;
}

.orb {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(120px);
  opacity: 0.35;
  z-index: 0;
}
.orb-a { background: #6ae2ff; top: -80px; left: -40px; }
.orb-b { background: #7c8bff; bottom: -120px; right: 0; }
.orb-c { background: #9c7bff; top: 40%; right: 20%; }

.app {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.app__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(22, 24, 33, 0.75);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.app__brand { display: flex; align-items: center; gap: 10px; }
.app__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.brand__logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6ae2ff, #7c8bff);
  display: grid; place-items: center;
  font-size: 20px;
  box-shadow: 0 10px 35px rgba(106, 226, 255, 0.3);
}
.brand__name { margin: 0; font-weight: 700; }
.brand__tagline { margin: 0; color: var(--muted); font-size: 14px; }

.hero { display: flex; justify-content: space-between; gap: 18px; margin: 28px 0; flex-wrap: wrap; }
.hero h1 { margin: 6px 0 10px; font-size: 32px; letter-spacing: -0.02em; }
.note-sm { font-size: 13px; }
.hero__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--stroke); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat--pill { border-radius: 999px; padding: 10px 16px; }
.stat__value { margin: 4px 0 0; font-size: 20px; font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card.wide { grid-column: span 2; min-height: 200px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h2 { margin: 4px 0 6px; }

.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; color: var(--muted); margin: 0; }
.muted { color: var(--muted); margin: 0; }
.accent { color: var(--accent); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(124, 139, 255, 0.1);
  color: #b8c3ff;
  border-radius: 999px;
  border: 1px solid rgba(124, 139, 255, 0.4);
  font-weight: 600;
  font-size: 13px;
}

.pill, .primary, .ghost {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease, border 160ms ease;
  font-family: inherit;
}

.pill { background: rgba(124, 139, 255, 0.18); border: 1px solid rgba(124, 139, 255, 0.4); }
.pill:hover { transform: translateY(-1px); }

.primary {
  width: 100%;
  background: linear-gradient(135deg, #7c8bff, #6ae2ff);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 12px 30px rgba(124, 139, 255, 0.4);
}
.primary:active { transform: translateY(1px) scale(0.995); }

.ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
}
.ghost:hover { background: rgba(255, 255, 255, 0.1); }

.slider-row { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; }
input[type="range"] { width: 100%; accent-color: #7c8bff; }
.rate-value { min-width: 90px; text-align: right; font-weight: 700; font-size: 18px; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; font-weight: 600; }
.field__row { display: flex; gap: 8px; align-items: center; background: var(--card-2); border: 1px solid var(--stroke); border-radius: 14px; padding: 6px 8px; }
.field input { background: transparent; border: none; color: var(--text); font-size: 16px; width: 100%; font-family: inherit; outline: none; }
.field input[type="number"] { text-align: center; font-weight: 700; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }

.dual { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.panel { background: var(--card-2); border: 1px solid var(--stroke); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }

.options { display: flex; gap: 8px; flex-wrap: wrap; }
.option.selected { border-color: #b8c3ff; background: rgba(124, 139, 255, 0.15); color: #e6eaff; }

.total { display: flex; align-items: center; justify-content: space-between; background: var(--card-2); border: 1px solid var(--stroke); border-radius: 14px; padding: 10px 12px; gap: 8px; }
.total__value { margin: 0; font-size: 20px; font-weight: 700; }
.total__note { color: var(--muted); font-size: 13px; }

.help { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.share-box { margin-top: 12px; background: var(--card-2); border: 1px dashed rgba(124, 139, 255, 0.5); border-radius: 12px; padding: 10px 12px; }
.share-box__head { display: flex; align-items: center; justify-content: space-between; }
.share-box__text { margin: 8px 0 0; color: var(--text); white-space: pre-line; }

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 18px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 160ms ease, visibility 160ms ease;
  z-index: 5;
}
.sheet[open] { visibility: visible; opacity: 1; }
.sheet__content {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  animation: rise 220ms ease;
}
.sheet__grab { width: 44px; height: 5px; border-radius: 999px; background: var(--stroke); margin: 0 auto 10px; opacity: 0.7; }
.sheet__amount { font-size: 20px; font-weight: 700; margin: 10px 0 8px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 6;
}
.toast[show] { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 16px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 160ms ease, visibility 160ms ease;
  z-index: 8;
}
.modal[open] { visibility: visible; opacity: 1; }
.modal__content {
  width: min(520px, 100%);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  animation: rise 200ms ease;
  max-height: 80vh;
  overflow: auto;
}
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal__body { color: var(--muted); line-height: 1.6; font-size: 14px; white-space: pre-line; }

@media (max-width: 700px) {
  .app { padding: 22px 14px 70px; }
  .app__header { flex-direction: column; align-items: flex-start; }
  .card.wide { grid-column: span 1; }
  .hero h1 { font-size: 28px; }
}
