:root {
  color-scheme: light;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ink: #0f242d;
  --text-secondary: #475b66;
  --muted: #566b76;
  --paper: #f4f7f9;
  --surface: #ffffff;
  --subtle: #eff4f7;
  --line: #d8e2e7;
  --border-strong: #bcccd4;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-subtle: #e6f4f1;
  --accent-border: #99e2d8;
  --status-success: #15803d;
  --status-success-bg: #e8f7ee;
  --status-success-border: #b7ebc9;
  --status-danger: #b91c1c;
  --status-danger-bg: #fef2f2;
  --status-danger-border: #fecaca;
  --focus-ring: 0 0 0 3px rgba(15, 118, 110, 0.22);
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  background: radial-gradient(960px 440px at 12% 0%, rgba(20, 184, 166, 0.08), transparent 65%), var(--paper);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none !important;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 36, 45, 0.14);
}

.brand strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 7px 11px;
  border-radius: 8px;
  text-decoration: none !important;
  transition: background-color 120ms ease, color 120ms ease;
}

.nav-link:hover {
  background: var(--subtle);
  color: var(--ink);
}

.login-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none !important;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.login-link:hover {
  background: var(--subtle);
}

main {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 32px 48px;
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 36px;
  align-items: start;
  flex: 1;
}

.intro {
  min-width: 0;
}

.kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  color: var(--ink);
}

h2 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--ink);
}

h3 {
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 4px;
  color: var(--ink);
}

.lead {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 0 6px;
}

.intro-sublead {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 16px;
}

.intro-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.hero-showcase {
  margin: 0 0 20px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: #0d212a;
  color: #f4f7f8;
  padding: 14px;
  box-shadow: 0 12px 28px rgba(15, 36, 45, 0.12);
  min-width: 0;
}

.hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.hero-surfaces {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hero-surface-tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.14);
  border: 1px solid rgba(94, 234, 212, 0.35);
  color: #ccfbf1;
}

.hero-toggle {
  font-size: 12px;
  padding: 6px 12px;
  min-height: 34px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}

.hero-toggle:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: #5eead4;
  color: #ffffff;
}

.hero-stage {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #09161c;
  border: 1px solid rgba(153, 226, 216, 0.25);
  aspect-ratio: 1280 / 760;
}

.hero-stage picture,
.hero-stage img,
.hero-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.hero-step {
  font-size: 11.5px;
  font-weight: 600;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  text-align: center;
  line-height: 1.3;
}

.hero-step:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(94, 234, 212, 0.45);
  color: #ffffff;
}

.hero-step.is-active {
  background: var(--accent);
  border-color: #5eead4;
  color: #ffffff;
}

.hero-caption {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12.5px;
  color: #e2e8f0;
  line-height: 1.55;
}

.benefits {
  list-style: none;
  padding: 16px 18px;
  margin: 0 0 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.benefits li {
  font-size: 13.5px;
  color: var(--ink);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.55;
}

.benefits li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  flex: none;
  margin-top: 1px;
}

.availability {
  font-size: 12.5px;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--subtle);
  border: 1px solid var(--line);
  margin: 0 0 18px;
}

.download-card {
  padding: 18px 20px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(15, 36, 45, 0.04);
}

.download-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.download-meta {
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 600;
  margin: 3px 0 0;
  font-variant-numeric: tabular-nums;
}

.download-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.download-links a {
  font-weight: 600;
}

.download-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  padding: 28px 30px;
  min-width: 0;
  box-shadow: 0 10px 30px rgba(15, 36, 45, 0.06), 0 1px 3px rgba(15, 36, 45, 0.03);
}

.panel .panel-intro {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.6;
}

.panel .connect-banner {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  color: var(--accent-hover);
  font-weight: 600;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 14px 0 6px;
}

input,
textarea {
  font: inherit;
  font-size: 15px;
  width: 100%;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 10px 13px;
  min-height: 44px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input::placeholder {
  color: #8fa3ad;
  font-size: 13.5px;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: var(--focus-ring);
}

textarea {
  font-family: var(--font-mono);
  font-size: 12.5px;
  word-break: break-all;
  resize: vertical;
  background: var(--subtle);
}

button,
.button-link {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9px;
  min-height: 42px;
  padding: 9px 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none !important;
  transition: background-color 120ms ease, border-color 120ms ease, transform 80ms ease;
}

button:hover:not(:disabled),
.button-link:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

button:active:not(:disabled),
.button-link:active {
  transform: translateY(0.5px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

form button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 22px;
}

.inline-status,
.device-status {
  font-size: 12.5px;
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--subtle);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.inline-status.error,
.device-status.error {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  color: var(--status-danger);
}

.beta-note {
  padding-top: 18px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

.beta-note strong {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.beta-note .beta-note-sub {
  margin-top: 12px;
}

.beta-note p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
  margin: 4px 0 0;
}

.quiet,
.button-link.quiet {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 13px;
  min-height: 36px;
}

.quiet:hover:not(:disabled),
.button-link.quiet:hover {
  background: var(--subtle);
  border-color: #96adb9;
  color: var(--ink);
}

.quiet.danger:hover:not(:disabled) {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  color: var(--status-danger);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

#entitlement {
  font-size: 12.5px;
  color: var(--muted);
  margin: 4px 0 0;
  font-variant-numeric: tabular-nums;
}

.devices-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.devices-updated {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.devices-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.device {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px 20px;
  background: var(--subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.device.is-online {
  background: linear-gradient(180deg, #f3faf8 0%, #ffffff 100%);
  border-color: var(--accent-border);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.06);
}

.device-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.device strong {
  font-size: 16px;
  font-weight: 650;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.device p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 8px 0 16px;
  font-variant-numeric: tabular-nums;
}

.device p.device-status {
  margin: 10px 0 0;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e6ecef;
  color: var(--text-secondary);
  white-space: nowrap;
}

.state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8fa3ad;
}

.state.online {
  background: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  color: var(--status-success);
}

.state.online::before {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18);
}

.empty-devices {
  padding: 22px;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  background: var(--subtle);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.invite-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.invite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.invite-header .hint {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

#create-invite {
  flex: none;
}

.notice {
  margin: 16px 0 0;
  padding: 16px 18px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  overflow-wrap: anywhere;
}

.notice strong {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 4px;
}

.notice p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

.notice a {
  display: inline-flex;
  margin-top: 4px;
  margin-right: 10px;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.notice button {
  margin-top: 8px;
}

.security-details {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 0;
}

.fine {
  font-size: 12px;
  color: var(--muted);
  margin-top: 18px;
  line-height: 1.6;
}

#portal-status {
  font-size: 12.5px;
  margin: 14px 0 0;
  padding: 10px 13px;
  border-radius: 8px;
  background: var(--subtle);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

#portal-status:empty {
  display: none;
}

#portal-status.error {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  color: var(--status-danger);
}

.getting-started {
  max-width: 1180px;
  width: 100%;
  border-top: 1px solid var(--line);
  padding: 36px 32px 44px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
}

.getting-started h2 {
  font-size: 22px;
  margin: 0;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.steps li {
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 36, 45, 0.03);
}

.steps span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 8px;
}

.steps strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 6px;
}

.steps p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

footer {
  padding: 24px 32px 30px;
  background: #0d212a;
  color: #94a3b8;
  font-size: 12px;
}

footer > div,
footer > p {
  max-width: 1180px;
  margin: 0 auto 6px;
}

footer > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

footer strong {
  font-size: 16px;
  color: #f4f7f8;
  font-weight: 700;
}

footer span {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: #5eead4;
}

.footer-meta {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.footer-meta p,
.footer-meta a {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.signed-in .intro,
body.signed-in .getting-started,
body.signed-in .topbar-nav,
body.signed-in .login-link {
  display: none;
}

body.signed-in main {
  display: block;
  max-width: 960px;
  padding-top: 16px;
}

body.signed-in .panel {
  padding: 30px 32px;
}

body.signed-in #devices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.connect-mode #login-card {
  order: -1;
}

@media (max-width: 920px) {
  .topbar {
    padding: 16px 20px;
  }
  main {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 20px 36px;
    gap: 28px;
  }
  .panel,
  body.signed-in .panel {
    padding: 22px 20px;
  }
  body.signed-in #devices {
    grid-template-columns: minmax(0, 1fr);
  }
  .getting-started {
    grid-template-columns: minmax(0, 1fr);
    padding: 28px 20px 36px;
    gap: 20px;
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .hero-stage {
    aspect-ratio: 720 / 920;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 14px 16px;
  }
  main {
    padding: 10px 16px 28px;
  }
  .panel,
  body.signed-in .panel {
    padding: 18px 16px;
  }
  .hero-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}
