:root {
  --bg-main: #0c1824;
  --bg-glow: #1a2d40;
  --panel: #24394b;
  --row: #516579;
  --row-border: #3f5368;
  --text: #f2f6fb;
  --text-muted: #9aa9b9;
  --brand-red: #e31e24;
  --gray-btn: #7d8794;
  --favorite-accent: #f7bf3d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(227, 30, 36, 0.2), transparent 35%),
    radial-gradient(circle at 85% 0%, rgba(51, 82, 114, 0.45), transparent 32%),
    linear-gradient(180deg, #060b12, var(--bg-main) 40%, #0a1623);
}

button {
  font: inherit;
}

.page {
  padding: 1.2rem 0.8rem 2rem;
  max-width: 980px;
  margin: 0 auto;
}

.controls {
  width: min(100%, 680px);
  margin: 0 auto 1rem;
  background: rgba(14, 26, 38, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.9rem;
  backdrop-filter: blur(8px);
}

.control-group + .control-group {
  margin-top: 0.8rem;
}

.control-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.seg-btn,
.button-row button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: #203346;
  color: var(--text);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.seg-btn.is-active,
.button-row button.is-active {
  background: var(--brand-red);
  border-color: transparent;
}

.button-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.button-row button:hover,
.seg-btn:hover {
  transform: translateY(-1px);
}

.button-row button:focus-visible,
.seg-btn:focus-visible,
.favorite-toggle:focus-visible,
.activate-btn:focus-visible,
.scan-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.phone {
  width: min(100%, 390px);
  margin: 0 auto;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  background: linear-gradient(180deg, #0a141f, #0f1d2b);
}

.hero {
  position: relative;
  height: 210px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.72)),
    radial-gradient(circle at 32% 25%, rgba(227, 30, 36, 0.45), rgba(18, 28, 41, 0) 40%),
    linear-gradient(135deg, #132334, #0f1926);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.03), transparent 38%),
    linear-gradient(300deg, rgba(255, 255, 255, 0.03), transparent 48%);
}

.hero-content {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
}

.hero h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.hero p {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.sheet {
  margin-top: -8px;
  background: var(--panel);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding-bottom: 1rem;
}

.grabber {
  width: 64px;
  height: 8px;
  border-radius: 8px;
  margin: 10px auto 12px;
  background: #708195;
}

.list {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section-label {
  padding: 0.45rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.row {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.85rem 0.85rem 0.85rem 1rem;
  background: var(--row);
  border-top: 1px solid var(--row-border);
  border-bottom: 1px solid var(--row-border);
  transition: transform 280ms ease, background-color 240ms ease, opacity 240ms ease;
}

.mode-before .row {
  animation: bump 300ms ease;
}

@keyframes bump {
  from {
    transform: translateY(-4px);
  }
  to {
    transform: translateY(0);
  }
}

.row-name {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.favorite-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #c2cfdb;
  cursor: pointer;
}

.favorite-toggle.is-on {
  color: var(--favorite-accent);
  border-color: rgba(247, 191, 61, 0.42);
  background: rgba(247, 191, 61, 0.16);
}

.row--favorite {
  box-shadow: inset 3px 0 0 rgba(247, 191, 61, 0.9);
}

.activate-btn {
  min-width: 118px;
  height: 45px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--brand-red);
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.activate-btn .pin-icon {
  width: 17px;
  height: 17px;
  display: inline-block;
}

.activate-btn .pin-icon path {
  fill: currentColor;
}

.row--unavailable {
  opacity: 0.92;
}

.row--unavailable .row-name {
  color: #c6cfda;
}

.row--unavailable .activate-btn {
  background: var(--gray-btn);
  color: #e9eef3;
}

.empty {
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.4;
}

.hint {
  color: var(--text-muted);
  padding: 0.95rem 1rem 0.65rem;
  font-size: 0.84rem;
  line-height: 1.45;
}

.divider {
  margin: 0 1rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #d7e0ea;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.divider span {
  font-weight: 700;
}

.scan-btn {
  width: calc(100% - 2rem);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  height: 56px;
  border-radius: 999px;
  border: 0;
  background: var(--brand-red);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.scan-icon {
  font-size: 1.2rem;
}

@media (max-width: 420px) {
  .page {
    padding: 0.75rem 0.4rem 1rem;
  }

  .controls {
    padding: 0.65rem;
  }

  .button-row button {
    flex: 1 1 auto;
    min-width: 102px;
  }

  .row-name {
    font-size: 0.72rem;
  }

  .activate-btn {
    min-width: 104px;
    height: 42px;
  }
}
