:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: rgba(255, 255, 255, .9);
  --text: #162033;
  --muted: #526078;
  --line: #e4e8f0;
  --primary: #2454d6;
  --primary-dark: #1d43ad;
  --danger: #9b3d49;
  --shadow: 0 18px 50px rgba(31, 51, 91, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font: 15px/1.6 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
button, a { font: inherit; }
.page-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 36px; }
.hero { padding: 18px 4px 28px; }
.hero-row, .welcome-row, .card-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.02em; line-height: 1.25; }
h2 { margin-bottom: 6px; font-size: 24px; letter-spacing: -.02em; }
.hero p { max-width: 640px; color: var(--muted); font-size: 18px; }
.muted, .hint { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card, .notice { border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.card { padding: 24px; }
.login-card { display: flex; align-items: center; gap: 18px; }
.product-card { min-height: 305px; }
.badge { padding: 5px 10px; border-radius: 999px; color: var(--muted); background: #f0f2f7; font-size: 12px; font-weight: 700; }
.badge-primary { color: var(--primary); background: #edf2ff; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 0 15px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; text-decoration: none; font-weight: 700; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled, .button[aria-disabled="true"] { opacity: .55; cursor: default; pointer-events: none; transform: none; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
::selection { background: #dce7ff; color: var(--text); }
.welcome-row { margin-bottom: 24px; }
.hero p, .hint { max-width: 70ch; }
td, .token-meta { font-variant-numeric: tabular-nums; }
#user-name, #user-email, td { overflow-wrap: anywhere; }
.button-primary { color: #fff; background: var(--primary); }
.button-primary:hover { background: var(--primary-dark); }
.button-ghost { color: var(--text); border-color: var(--line); background: rgba(255, 255, 255, .68); }
.button-danger { color: var(--danger); border-color: #efd8dc; background: #fff6f7; }
.button-wide { width: 100%; margin: 22px 0 12px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.steps { padding-left: 22px; color: var(--muted); }
details { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
summary { cursor: pointer; color: var(--text); font-weight: 700; }
.token-card, .devices-card { margin-top: 18px; }
.token-meta { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: #f4f6fb; color: var(--muted); }
.hint { margin: 12px 0 0; font-size: 12px; }
.user-chip { padding: 8px 12px; border: 1px solid #dfe6ff; border-radius: 999px; color: var(--primary); background: #f1f4ff; font-weight: 800; }
.notice { margin-bottom: 18px; padding: 14px 17px; color: #774b00; border-color: #f0dfb7; background: #fffaf0; }
.empty-state { padding: 22px 0 4px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 560px; border-collapse: collapse; }
th, td { padding: 14px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; font-weight: 700; }
td small { display: block; color: var(--muted); }
.status { color: var(--muted); }
.status.online { color: #178051; font-weight: 800; }
code { padding: 2px 5px; border-radius: 5px; background: #eef1f7; }
footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding: 0 4px; color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  .page-shell { width: min(100% - 22px, 640px); padding-top: 24px; }
  .grid.two { grid-template-columns: 1fr; }
  .hero-row, .welcome-row, .card-head { flex-direction: column; }
  .product-card .card-head { flex-direction: row; }
  .hero-row .button, .card-head .button { align-self: stretch; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:hover { transform: none; }
}
