:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f1f5fb;
  --ink: #111827;
  --muted: #667085;
  --line: #dbe3ef;
  --brand: #0f766e;
  --brand-2: #2563eb;
  --success: #0f9f6e;
  --warning: #b7791f;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 52%, #eef4fb 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(16px, 5vw, 64px);
  border-bottom: 1px solid rgba(219, 227, 239, 0.82);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 70% 28%, #ffffff 0 9%, transparent 10%),
    linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.2);
}

.topbar-actions,
.action-grid,
.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.button.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.button.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.button.neutral {
  background: #111827;
  color: #ffffff;
}

.button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.46;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: stretch;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 16px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.06;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 18px;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.55;
}

.status-card,
.instructions-panel,
.device-sidebar,
.install-card {
  border: 1px solid rgba(219, 227, 239, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.status-card {
  display: grid;
  gap: 24px;
  padding: clamp(18px, 3vw, 28px);
}

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

.status-pill,
.profile-count,
.device-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.status-card[data-state="active"] .status-pill,
.status-card[data-state="ready"] .status-pill {
  border-color: rgba(15, 159, 110, 0.32);
  color: var(--success);
  background: rgba(15, 159, 110, 0.08);
}

.subscription-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.subscription-grid div {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.subscription-grid dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.subscription-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 850;
}

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
  align-items: start;
}

.device-sidebar {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.device-tab {
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  text-align: left;
  padding: 0 12px;
}

.device-tab:hover,
.device-tab.active {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.instructions-panel {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 3vw, 24px);
}

.notice {
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.07);
  color: #1d4ed8;
  padding: 12px 14px;
  line-height: 1.5;
}

.instruction-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.install-card {
  display: grid;
  gap: 12px;
  background: #ffffff;
  padding: clamp(16px, 3vw, 22px);
}

.install-card p,
.profile-list {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.link-list a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 0 12px;
  color: var(--ink);
  font-weight: 800;
}

.copy-field {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.copy-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.copy-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
}

.profile-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  padding: 12px 14px;
  font-weight: 850;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.22);
}

@media (max-width: 920px) {
  .topbar,
  .instruction-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .device-sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .device-tab {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }
}

@media (max-width: 620px) {
  .subscription-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .action-grid .button,
  .topbar-actions .button {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
  }
}
