:root {
  color-scheme: dark;
  --bg: #0c0e12;
  --surface: #14171d;
  --surface-2: #1b2028;
  --line: #313846;
  --muted: #9aa5b5;
  --text: #f3f6fb;
  --amber: #ff9f2d;
  --amber-2: #5a3515;
  --green: #30d470;
  --red: #ff6969;
  --blue: #5aa7ff;
  --cyan: #31d1c4;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --shell-max: 430px;
  --screen-pad-x: 14px;
  --screen-pad-top: 14px;
  --screen-pad-bottom: 92px;
  --nav-height: 74px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(255, 159, 45, 0.08), transparent 28%),
    linear-gradient(235deg, rgba(49, 209, 196, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: 100%;
  max-width: var(--shell-max);
  min-height: 100svh;
  margin: 0 auto;
  background:
    linear-gradient(rgba(12, 14, 18, 0.84), rgba(12, 14, 18, 0.96)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 18px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  overflow-x: hidden;
}

.screen {
  min-height: 100svh;
  padding:
    max(var(--screen-pad-top), env(safe-area-inset-top))
    var(--screen-pad-x)
    max(var(--screen-pad-bottom), calc(var(--nav-height) + env(safe-area-inset-bottom) + 18px));
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-mark,
.icon-tile {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 159, 45, 0.6);
  border-radius: 8px;
  background: rgba(255, 159, 45, 0.12);
}

.brand-mark img {
  width: 24px;
  height: 24px;
}

.title {
  min-width: 0;
}

.title strong {
  display: block;
  overflow: hidden;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.hero-status {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 23, 29, 0.88);
}

.status-row,
.metric-row,
.plan-row,
.setup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.status-row {
  flex-wrap: wrap;
}

.status-pill,
.mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid rgba(48, 212, 112, 0.4);
  border-radius: 8px;
  background: rgba(48, 212, 112, 0.12);
  color: #dfffe8;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.warning {
  border-color: rgba(255, 159, 45, 0.55);
  background: rgba(255, 159, 45, 0.12);
  color: #ffe5c7;
}

.mini-pill {
  border-color: rgba(154, 165, 181, 0.3);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.signal {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(48, 212, 112, 0.12);
}

.status-copy h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.05;
}

.status-copy p,
.muted {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.connect-orb {
  display: grid;
  place-items: center;
  width: 102px;
  height: 102px;
  margin: 6px auto 0;
  border: 1px solid rgba(255, 159, 45, 0.72);
  border-radius: 50%;
  background: #11151b;
  box-shadow: inset 0 0 0 8px rgba(255, 159, 45, 0.08);
}

.connect-orb.connected {
  border-color: rgba(48, 212, 112, 0.7);
  box-shadow: inset 0 0 0 8px rgba(48, 212, 112, 0.08);
}

.connect-orb img {
  width: 52px;
  height: 52px;
}

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

.split-actions,
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.quick-card {
  min-height: 74px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 23, 29, 0.84);
  text-align: left;
}

.quick-card.primary-quick {
  border-color: rgba(255, 159, 45, 0.68);
  background: rgba(255, 159, 45, 0.11);
}

.quick-card strong,
.quick-card span {
  display: block;
}

.quick-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  width: 100%;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 760;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.button.primary {
  border: 1px solid rgba(255, 159, 45, 0.8);
  background: linear-gradient(180deg, #ffab3f, #df7e17);
  color: #171007;
}

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

.button.ghost {
  border: 1px solid rgba(255, 159, 45, 0.5);
  background: rgba(255, 159, 45, 0.08);
  color: #ffd39b;
}

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

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

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 23, 29, 0.84);
}

.metric {
  min-height: 86px;
  padding: 13px;
}

.metric-button {
  color: inherit;
  text-align: left;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.status-list,
.check-list,
.plan-grid {
  display: grid;
  gap: 10px;
}

.status-item,
.check-row {
  display: grid;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 23, 29, 0.84);
}

.status-item {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.status-item strong,
.status-item span,
.check-row strong,
.check-row span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-item span,
.check-row span,
.status-item em,
.status-item small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.health-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(48, 212, 112, 0.12);
}

.health-dot.watch {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 159, 45, 0.12);
}

.doctor-card,
.recommendation,
.privacy-note,
.ticket-card,
.payment-summary,
.timeline-item {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 23, 29, 0.88);
}

.doctor-card h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.05;
}

.doctor-card p,
.recommendation p,
.privacy-note p,
.ticket-card p,
.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.recommendation {
  border-color: rgba(49, 209, 196, 0.4);
  background: rgba(49, 209, 196, 0.07);
}

.check-row {
  grid-template-columns: 34px minmax(0, 1fr);
}

.check-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(154, 165, 181, 0.32);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.check-icon.pass {
  border-color: rgba(48, 212, 112, 0.42);
  background: rgba(48, 212, 112, 0.11);
  color: #dfffe8;
}

.check-icon.warn {
  border-color: rgba(255, 159, 45, 0.5);
  background: rgba(255, 159, 45, 0.12);
  color: #ffe5c7;
}

.plan-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plan-card {
  min-height: 92px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 23, 29, 0.84);
  text-align: left;
}

.plan-card.active {
  border-color: rgba(255, 159, 45, 0.75);
  background: rgba(255, 159, 45, 0.11);
}

.plan-card span,
.plan-card strong {
  display: block;
}

.plan-card span {
  color: var(--muted);
  font-size: 12px;
}

.plan-card strong {
  margin-top: 12px;
  font-size: 20px;
}

.section {
  margin-top: 16px;
}

.section-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.device-card {
  display: grid;
  gap: 13px;
  justify-items: center;
  padding: 18px;
}

.setup-flow-card {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.setup-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.setup-progress-step {
  min-width: 0;
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.setup-progress-step.done {
  border-color: rgba(48, 212, 112, 0.45);
  background: rgba(48, 212, 112, 0.09);
}

.setup-progress-step.active {
  border-color: rgba(255, 159, 45, 0.8);
  background: rgba(255, 159, 45, 0.13);
}

.setup-progress-step span,
.setup-progress-step strong,
.setup-progress-step small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-progress-step span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-bottom: 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.setup-progress-step.active span {
  background: rgba(255, 159, 45, 0.22);
  color: #ffd39b;
}

.setup-progress-step.done span {
  background: rgba(48, 212, 112, 0.18);
  color: #dfffe8;
}

.setup-progress-step strong {
  font-size: 12px;
}

.setup-progress-step small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.setup-main-action h1 {
  margin: 12px 0 0;
  font-size: 24px;
  line-height: 1.08;
}

.setup-main-action p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.platform-glyph {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border: 1px solid rgba(255, 159, 45, 0.72);
  border-radius: 8px;
  background: #11151b;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.platform-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.platform-choice {
  min-height: 84px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.platform-choice.active {
  border-color: rgba(255, 159, 45, 0.82);
  background: rgba(255, 159, 45, 0.12);
}

.platform-choice strong {
  display: block;
  margin-top: 8px;
}

.app-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.app-choice.active {
  border-color: rgba(255, 159, 45, 0.82);
  background: rgba(255, 159, 45, 0.12);
}

.app-choice > span:last-child {
  min-width: 0;
}

.app-choice .app-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 159, 45, 0.16);
  color: #ffd39b;
  font-weight: 800;
}

.app-choice small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.install-source-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 23, 29, 0.84);
}

.install-source-card strong,
.install-source-card span,
.install-source-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.install-source-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.install-source-card small {
  width: max-content;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 12px;
}

.source-ok {
  background: rgba(48, 212, 112, 0.11);
  color: #dfffe8;
}

.source-watch {
  background: rgba(255, 159, 45, 0.12);
  color: #ffd39b;
}

.step-list {
  display: grid;
  gap: 10px;
}

.step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 23, 29, 0.84);
}

.step-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(49, 209, 196, 0.14);
  color: #adfff7;
  font-weight: 800;
}

.step h3 {
  margin: 0;
  font-size: 15px;
}

.step p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.qr-panel {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 23, 29, 0.84);
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(17, var(--qr-cell, 8px));
  gap: 3px;
  padding: 13px;
  border-radius: 8px;
  background: #11151b;
  max-width: 100%;
  overflow: hidden;
}

.qr-grid i {
  width: var(--qr-cell, 8px);
  height: var(--qr-cell, 8px);
  background: #ff9f2d;
}

.qr-grid i.off {
  background: #252b35;
}

.form {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
}

.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11151b;
  color: var(--text);
}

.field select {
  min-height: 44px;
  padding: 0 12px;
}

.field textarea {
  min-height: 86px;
  padding: 12px;
  resize: vertical;
}

.report {
  padding: 12px;
  border: 1px solid rgba(90, 167, 255, 0.35);
  border-radius: 8px;
  background: rgba(90, 167, 255, 0.08);
  color: #dbeaff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ticket-card {
  background: rgba(20, 23, 29, 0.84);
}

.payment-summary {
  position: sticky;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 8px);
  z-index: 2;
  margin-top: 16px;
  border-color: rgba(255, 159, 45, 0.42);
  background: rgba(18, 14, 11, 0.95);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.payment-summary span,
.payment-summary strong {
  display: block;
}

.payment-summary span {
  color: var(--muted);
  font-size: 12px;
}

.payment-summary strong {
  margin-top: 6px;
  font-size: 22px;
}

.faq-list,
.tag-list,
.timeline {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 23, 29, 0.84);
}

.faq-item summary {
  cursor: pointer;
  padding: 15px;
  font-weight: 760;
}

.faq-item p {
  margin: 0;
  padding: 0 15px 15px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.tag-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tag-list span {
  min-height: 38px;
  padding: 10px;
  border: 1px solid rgba(48, 212, 112, 0.32);
  border-radius: 8px;
  background: rgba(48, 212, 112, 0.09);
  color: #dfffe8;
  font-size: 12px;
  font-weight: 720;
}

.tag-list.danger span {
  border-color: rgba(255, 105, 105, 0.32);
  background: rgba(255, 105, 105, 0.08);
  color: #ffd1d1;
}

.timeline-item {
  position: relative;
  padding-left: 18px;
}

.timeline-item::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 3px;
  border-radius: 99px;
  background: var(--amber);
  content: "";
}

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 23, 29, 0.84);
  min-width: 0;
  text-align: left;
}

.list-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.list-row span {
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.bottom-nav {
  position: fixed;
  right: auto;
  bottom: 0;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: var(--shell-max);
  padding: 10px 14px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 14, 18, 0.94);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}

.nav-item {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 390px) {
  :root {
    --screen-pad-x: 12px;
    --screen-pad-top: 12px;
  }

  .hero-status,
  .doctor-card,
  .recommendation,
  .privacy-note,
  .ticket-card,
  .payment-summary,
  .timeline-item {
    padding: 14px;
  }

  .status-copy h1,
  .doctor-card h1,
  .setup-main-action h1 {
    font-size: 24px;
  }

  .platform-glyph {
    width: 116px;
    height: 116px;
  }

  .status-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .status-item small {
    display: none;
  }
}

@media (max-width: 360px) {
  :root {
    --screen-pad-x: 10px;
    --screen-pad-top: 10px;
    --qr-cell: 7px;
  }

  .split-actions,
  .quick-actions,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .grid,
  .platform-picker,
  .tag-list,
  .setup-progress {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 8px;
  }

  .brand-mark,
  .icon-tile {
    width: 34px;
    height: 34px;
  }

  .nav-item {
    font-size: 11px;
  }

  .platform-glyph {
    width: 104px;
    height: 104px;
  }
}

.nav-item.active {
  background: rgba(255, 159, 45, 0.12);
  color: #ffd39b;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 8px);
  left: 14px;
  z-index: 20;
  width: min(402px, calc(100% - 28px));
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid rgba(48, 212, 112, 0.45);
  border-radius: 8px;
  background: #112018;
  color: #dfffe8;
  box-shadow: var(--shadow);
}

@media (min-width: 720px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100svh - 48px);
    border-radius: 8px;
    overflow: hidden;
  }

  .screen {
    min-height: calc(100svh - 48px);
  }

  .bottom-nav {
    bottom: 24px;
    border-radius: 0 0 8px 8px;
  }
}

@media (max-height: 700px) {
  :root {
    --screen-pad-top: 10px;
  }

  .topbar {
    min-height: 40px;
    margin-bottom: 10px;
  }

  .hero-status,
  .device-card {
    gap: 11px;
    padding: 13px;
  }

  .connect-orb {
    width: 88px;
    height: 88px;
  }

  .connect-orb img {
    width: 44px;
    height: 44px;
  }

  .platform-glyph {
    width: 104px;
    height: 104px;
  }

  .quick-card,
  .metric,
  .platform-choice,
  .plan-card {
    min-height: 72px;
  }
}
