:root {
  color: #17191f;
  background: #f3f5f8;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #17191f;
  --muted: #677080;
  --line: #dfe4eb;
  --panel: #ffffff;
  --brand: #1268e5;
  --brand-hover: #0c58c5;
  --cyan: #38d8e8;
  --green: #29c673;
  --danger: #df5f65;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f3f5f8;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #f3f5f8;
  line-height: 1.5;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.site-header {
  width: min(760px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #07141a;
  background: var(--cyan);
  border-radius: 7px;
  font-size: 18px;
  font-weight: 850;
}

.secure-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 0 44px;
}

.status-panel {
  position: relative;
  overflow: hidden;
  padding: 26px;
  color: #ffffff;
  background: #111826;
  border: 1px solid #202b3b;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(20, 28, 42, 0.14);
}

.status-panel::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 100%;
  background: var(--green);
}

.status-panel.paused::after {
  background: var(--danger);
}

.status-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #788396;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.status-panel .eyebrow {
  color: #9aa6ba;
}

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

h1 {
  margin-bottom: 2px;
  font-size: 27px;
  line-height: 1.2;
  font-weight: 720;
}

h1 span {
  color: #65e7a4;
}

.paused h1 span {
  color: #ff9a9e;
}

.device-name {
  margin: 0;
  color: #b9c2d2;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.platform-badge {
  min-width: 54px;
  padding: 7px 10px;
  color: #07141a;
  background: var(--cyan);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.traffic-row {
  margin-top: 28px;
}

.traffic-labels {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #aab5c7;
  font-size: 13px;
}

.traffic-labels strong {
  color: #ffffff;
  font-weight: 650;
}

progress {
  width: 100%;
  height: 8px;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  appearance: none;
  background: #2b3546;
}

progress::-webkit-progress-bar {
  background: #2b3546;
  border-radius: 4px;
}

progress::-webkit-progress-value {
  background: var(--cyan);
  border-radius: 4px;
}

progress::-moz-progress-bar {
  background: var(--cyan);
  border-radius: 4px;
}

.status-meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  color: #9aa6ba;
  font-size: 12px;
}

.status-meta strong {
  color: #dfe6f0;
  font-weight: 650;
}

.guide-card,
.help-card {
  margin-top: 14px;
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.guide-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.guide-heading h2,
.help-card h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.25;
}

.app-icon {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(20, 28, 42, 0.15);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: #edf4ff;
  border: 1px solid #cfe0f9;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
}

.step-content {
  min-width: 0;
}

.step h3 {
  margin: 3px 0 5px;
  font-size: 17px;
  line-height: 1.3;
}

.step p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.button-grid,
.action-stack {
  margin-top: 15px;
  display: grid;
  gap: 9px;
}

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

.button-grid:has(.button:only-child) {
  grid-template-columns: 1fr;
}

.button {
  min-height: 46px;
  padding: 11px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  color: #ffffff;
  background: var(--brand);
  border-color: var(--brand);
}

.button-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.button-secondary {
  color: #202a38;
  background: #f7f9fc;
  border-color: #d9e0e9;
}

.button-secondary:hover,
.button-quiet:hover {
  background: #edf2f8;
  border-color: #c9d2df;
}

.button-quiet {
  width: 100%;
  color: #344155;
  background: #ffffff;
  border-color: #d9e0e9;
}

.tv-transfer {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.tv-transfer img {
  width: 180px;
  height: 180px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.success-box {
  margin-top: 22px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #145f3a;
  background: #eaf9f1;
  border: 1px solid #bde9d0;
  border-radius: 7px;
}

.success-box .icon {
  width: 24px;
  height: 24px;
}

.success-box div {
  display: grid;
}

.success-box span {
  color: #44705a;
  font-size: 13px;
}

.help-card h2 {
  margin-bottom: 10px;
}

details {
  border-bottom: 1px solid var(--line);
}

summary {
  padding: 15px 2px;
  font-size: 15px;
  font-weight: 680;
  cursor: pointer;
}

details p {
  margin: -4px 2px 16px;
  color: var(--muted);
  font-size: 14px;
}

.support-link {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.support-link .icon {
  width: 16px;
  height: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  color: #ffffff;
  background: #171d28;
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(12, 18, 28, 0.25);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

footer {
  padding: 0 16px 28px;
  color: #7b8491;
  font-size: 12px;
  text-align: center;
}

.error-shell {
  width: min(440px, calc(100% - 32px));
  min-height: 70vh;
  margin: 0 auto;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.error-shell h1 {
  margin: 18px 0 8px;
  font-size: 24px;
}

.error-shell p {
  color: var(--muted);
}

@media (max-width: 600px) {
  .site-header,
  .page-shell {
    width: min(100% - 20px, 760px);
  }

  .site-header {
    min-height: 62px;
  }

  .secure-label {
    font-size: 0;
  }

  .secure-label .icon {
    width: 21px;
    height: 21px;
  }

  .status-panel,
  .guide-card,
  .help-card {
    padding: 20px;
  }

  h1 {
    font-size: 23px;
  }

  .guide-heading h2,
  .help-card h2 {
    font-size: 20px;
  }

  .status-meta {
    display: grid;
  }

  .button-grid {
    grid-template-columns: 1fr;
  }

  .tv-transfer {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .tv-transfer .action-stack {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .status-panel,
  .guide-card,
  .help-card {
    padding: 17px;
  }

  .step {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
  }

  .step-number {
    width: 30px;
    height: 30px;
  }

  .platform-badge {
    min-width: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
