:root {
  --bg: #0a0b0d;
  --panel: #111316;
  --ink: #eceef2;
  --muted: #8d939e;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #ff8a3d;
  --ok: #74c99b;
  --warn: #d4a85a;
  --danger: #d87b7b;
  --font: "Sora", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.pulse-page {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

.px-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 2;
}

.px-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}

.px-brand img {
  border-radius: 6px;
}

.px-brand em {
  font-style: normal;
  color: var(--muted);
  font-weight: 600;
}

.px-brand em::before {
  content: "/";
  margin-right: 8px;
  color: rgba(255, 255, 255, 0.2);
}

.px-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.px-pill {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.px-pill.is-ok {
  color: var(--ok);
}

.px-pill.is-warn {
  color: var(--warn);
}

.px-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.px-link:hover {
  color: var(--ink);
}

.px-shell {
  width: min(1000px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 12px;
  align-items: stretch;
}

.px-shell.is-connect {
  grid-template-columns: 1fr;
  min-height: calc(100vh - 56px);
  align-content: center;
  padding: 32px 0 48px;
}

.px-boot,
.px-gate {
  grid-column: 1 / -1;
  min-height: 50vh;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}

.px-gate h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
}

.px-gate p {
  margin: 0;
  max-width: 36ch;
  justify-self: center;
  font-size: 14px;
  line-height: 1.5;
}

.px-onboard {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.9fr);
  gap: 20px;
  align-items: stretch;
  width: 100%;
}

.px-onboard-copy,
.px-onboard-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 28px 24px;
  min-height: 360px;
}

.px-onboard-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.px-onboard-copy h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 16ch;
}

.px-lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 46ch;
}

.px-steps {
  list-style: none;
  margin: auto 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.px-steps li {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.px-steps li:last-child {
  border-bottom: 0;
}

.px-steps strong {
  font-size: 13px;
  font-weight: 650;
}

.px-steps span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.px-onboard-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.px-onboard-panel h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.px-onboard-panel > p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.px-session {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

.px-session-copy {
  display: grid;
  gap: 4px;
}

.px-session h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.px-session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.px-msg {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 1.1em;
  font-size: 12px;
  color: var(--muted);
}

.px-msg.is-ok {
  color: var(--ok);
}

.px-msg.is-error {
  color: var(--danger);
}

.px-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 16px;
}

.px-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
}

.px-card-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.px-card-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.px-plan,
.px-insights,
.px-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.px-plan li,
.px-note,
.px-bar-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.px-plan li {
  grid-template-columns: 28px minmax(0, 1fr) 48px;
  align-items: start;
}

.px-plan li:last-child,
.px-note:last-child,
.px-bar-row:last-child {
  border-bottom: 0;
}

.px-num {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  padding-top: 1px;
}

.px-plan strong,
.px-note strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 2px;
}

.px-plan p,
.px-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.px-mins {
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.px-mins small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}

.px-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.px-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: transparent;
}

.px-btn.primary {
  color: #111;
  background: var(--accent);
  border-color: var(--accent);
}

.px-btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.px-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.px-riotform label {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}

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

.px-riot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.px-riot-row input {
  width: 100%;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
}

.px-btn-block {
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
}

.px-chart-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 8px 4px;
  color: var(--accent);
}

.px-chart text {
  fill: var(--muted);
  font-size: 10px;
  font-family: var(--font);
}

.px-bar-row {
  grid-template-columns: 90px minmax(0, 1fr) 56px;
  align-items: center;
  font-size: 12px;
}

.px-bar-row span {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.px-bar-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.px-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.px-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.px-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  padding: 4px 0;
}

@media (max-width: 800px) {
  .px-shell,
  .px-shell.is-connect {
    grid-template-columns: 1fr;
    align-content: start;
    min-height: auto;
  }

  .px-onboard {
    grid-template-columns: 1fr;
  }

  .px-onboard-copy,
  .px-onboard-panel {
    min-height: 0;
  }

  .px-onboard-copy h1 {
    max-width: none;
  }

  .px-riot-row {
    grid-template-columns: 1fr;
  }

  .px-session-actions {
    width: 100%;
  }

  .px-session-actions .px-btn {
    flex: 1;
  }
}
