:root {
  color-scheme: light;
  --ink: #172036;
  --muted: #69738d;
  --soft: #8d96aa;
  --line: #dfe4ef;
  --paper: #ffffff;
  --canvas: #f5f7fb;
  --primary: #5167e9;
  --primary-deep: #3549bd;
  --primary-soft: #e8ebff;
  --green: #18a770;
  --green-soft: #e4f7ef;
  --amber: #d88a1b;
  --shadow: 0 22px 60px rgba(28, 39, 73, 0.09);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(112, 130, 244, 0.14), transparent 32rem),
    radial-gradient(circle at 90% 16%, rgba(60, 202, 151, 0.08), transparent 26rem),
    var(--canvas);
}

button,
input {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(81, 103, 233, 0.25);
  outline-offset: 3px;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand > span:last-child {
  display: grid;
  line-height: 1.1;
}

.brand strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.brand-mark {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(23, 32, 54, 0.2);
}

.brand-mark span,
.brand-mark i {
  position: absolute;
  display: block;
  background: #fff;
  transform: rotate(9deg);
}

.brand-mark span {
  width: 6px;
  height: 7px;
  border-radius: 50%;
}

.brand-mark span:nth-child(1) { left: 9px; top: 11px; }
.brand-mark span:nth-child(2) { left: 17px; top: 7px; }
.brand-mark span:nth-child(3) { left: 26px; top: 9px; }
.brand-mark span:nth-child(4) { left: 30px; top: 17px; }

.brand-mark i {
  left: 13px;
  top: 19px;
  width: 17px;
  height: 14px;
  border-radius: 55% 55% 44% 44%;
}

.version-pill {
  padding: 8px 13px;
  border: 1px solid rgba(81, 103, 233, 0.16);
  border-radius: 999px;
  color: var(--primary-deep);
  background: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(12px);
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr;
  gap: 38px;
  align-items: end;
  padding: 62px 64px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 32px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(245, 246, 255, 0.92)),
    var(--paper);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 20px;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero-description {
  max-width: 610px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.health-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 160px;
  padding: 28px;
  border: 1px solid rgba(81, 103, 233, 0.12);
  border-radius: 24px;
  background: linear-gradient(145deg, #f1f4ff, #fff);
}

.health-orbit {
  display: grid;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid rgba(24, 167, 112, 0.22);
  border-radius: 50%;
  background: var(--green-soft);
}

.health-dot {
  width: 14px;
  height: 14px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(24, 167, 112, 0.13);
}

.health-card > div:last-child {
  display: grid;
}

.health-label,
.health-card small {
  color: var(--muted);
  font-size: 12px;
}

.health-card strong {
  margin: 6px 0;
  font-size: 22px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 18px 0 0;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(223, 228, 239, 0.8);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
}

.metric-card > div {
  display: grid;
  min-width: 0;
}

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

.metric-card strong {
  margin: 5px 0 4px;
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card div > span {
  overflow: hidden;
  color: var(--soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-icon,
.action-symbol {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
}

.metric-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-soft);
}

.icon-source::before {
  width: 16px;
  height: 16px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  content: "";
  box-shadow: 9px 0 0 -5px var(--primary-soft), 9px 0 0 -3px var(--primary);
}

.icon-sites::before {
  width: 17px;
  height: 15px;
  border: 2px solid var(--primary);
  border-radius: 4px;
  content: "";
  box-shadow: 5px -5px 0 -2px var(--primary-soft), 5px -5px 0 0 var(--primary);
}

.icon-profile::before {
  width: 15px;
  height: 18px;
  border: 2px solid var(--primary);
  border-radius: 8px 8px 5px 5px;
  content: "";
}

.section-block {
  margin-top: 78px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-heading h2,
.source-intro h2 {
  margin-bottom: 0;
  font-size: 30px;
  letter-spacing: -0.035em;
}

.section-heading > p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.action-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 17px;
  align-items: center;
  min-height: 112px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  background: var(--paper);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.action-card:hover {
  border-color: rgba(81, 103, 233, 0.35);
  box-shadow: 0 14px 38px rgba(31, 41, 79, 0.09);
  transform: translateY(-2px);
}

.action-card > span:nth-child(2) {
  display: grid;
}

.action-card strong {
  font-size: 16px;
}

.action-card small {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.4;
}

.action-card > i {
  color: var(--soft);
  font-size: 20px;
  font-style: normal;
}

.action-symbol {
  width: 48px;
  height: 48px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 15px;
  font-weight: 800;
}

.action-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(140deg, #546bed, #3f52c9);
}

.action-primary small,
.action-primary > i {
  color: rgba(255, 255, 255, 0.75);
}

.action-primary .action-symbol {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.arrow-symbol::before {
  width: 17px;
  height: 13px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(-45deg);
}

.pulse-symbol::before {
  width: 19px;
  height: 10px;
  border-bottom: 2px solid var(--primary);
  content: "";
  transform: skew(-35deg);
}

.source-panel {
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 16px 50px rgba(28, 39, 73, 0.06);
}

.subscription-panel {
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 16px 50px rgba(28, 39, 73, 0.06);
}

.security-panel {
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 16px 50px rgba(28, 39, 73, 0.06);
}

.password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-top: 28px;
}

.password-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.password-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #f8f9fd;
}

.password-form .button {
  min-height: 48px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(480px, 100%);
}

.login-shell > .brand {
  margin: 0 0 22px 8px;
}

.login-card {
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin-bottom: 14px;
  font-size: 34px;
}

.login-card > p:not(.eyebrow),
.login-card > small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.login-card form {
  display: grid;
  gap: 12px;
  margin: 28px 0 20px;
}

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

.login-card form input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #f8f9fd;
}

.login-card form .button {
  min-height: 52px;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: #a63d46;
  font-size: 12px;
}

.login-lock {
  position: relative;
  display: block;
  width: 48px;
  height: 42px;
  margin-bottom: 26px;
  border-radius: 12px;
  background: var(--primary-soft);
}

.login-lock::before {
  position: absolute;
  left: 14px;
  top: -12px;
  width: 16px;
  height: 22px;
  border: 3px solid var(--primary);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  content: "";
}

.login-lock::after {
  position: absolute;
  left: 21px;
  top: 16px;
  width: 6px;
  height: 12px;
  border-radius: 999px;
  background: var(--primary);
  content: "";
}

.subscription-controls {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr auto;
  gap: 14px;
  align-items: stretch;
  margin-top: 30px;
}

.switch-control,
.select-control {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8f9fd;
}

.switch-control > span {
  display: grid;
  gap: 5px;
}

.switch-control small,
.select-control > span {
  color: var(--muted);
  font-size: 12px;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-control > i {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #c8ceda;
  transition: background 160ms ease;
}

.switch-control > i::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(28, 39, 73, 0.18);
  content: "";
  transition: transform 160ms ease;
}

.switch-control input:checked + i {
  background: var(--primary);
}

.switch-control input:checked + i::after {
  transform: translateX(20px);
}

.select-control select {
  min-width: 120px;
  height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid #ccd3e1;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.subscription-actions {
  display: grid;
  gap: 8px;
}

.subscription-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.subscription-status > div {
  display: grid;
  gap: 6px;
  padding: 17px 18px;
  border-radius: 14px;
  background: #f7f8fc;
}

.subscription-status small,
.subscription-status p {
  color: var(--muted);
  font-size: 12px;
}

.subscription-status strong {
  font-size: 14px;
}

.subscription-status p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 2px;
}

.source-intro {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 30px;
}

.source-intro > div {
  max-width: 750px;
}

.source-intro p:last-child {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  color: #087c53;
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 700;
}

.security-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.source-current {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin: 32px 0;
  padding: 16px 18px;
  border-radius: 14px;
  color: var(--muted);
  background: #f7f8fc;
  font-size: 12px;
}

.source-current code {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-mini {
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--primary-deep);
  background: var(--primary-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

#source-form {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
}

#source-form > label:first-child {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input[type="url"] {
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 1px solid #ccd3e1;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="url"]:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(81, 103, 233, 0.1);
}

.button {
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: opacity 160ms ease, transform 160ms ease;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.button-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(81, 103, 233, 0.22);
}

.button-quiet {
  color: var(--primary-deep);
  background: var(--primary-soft);
}

.trust-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.trust-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.trust-check span {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid #bbc3d2;
  border-radius: 6px;
  background: #fff;
}

.trust-check input:checked + span {
  border-color: var(--primary);
  background: var(--primary);
}

.trust-check input:checked + span::after {
  width: 7px;
  height: 4px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  content: "";
  transform: rotate(-45deg) translateY(-1px);
}

.form-note {
  margin: 14px 0 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.6;
}

.source-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
}

.source-footer > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.source-footer small {
  color: var(--muted);
}

.source-footer code {
  overflow: hidden;
  max-width: 720px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-card {
  min-height: 180px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
}

.detail-card-button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.detail-card-button:hover {
  border-color: rgba(81, 103, 233, 0.32);
  box-shadow: 0 12px 34px rgba(31, 41, 79, 0.08);
  transform: translateY(-2px);
}

.detail-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 23px;
  color: var(--muted);
  font-size: 12px;
}

.detail-head i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(24, 167, 112, 0.1);
}

.detail-card > strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.detail-card p,
.detail-card > small {
  display: block;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.detail-card > .detail-link {
  color: var(--primary);
  font-weight: 700;
}

.progress-track {
  height: 6px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ebf2;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #7d8df3);
  transition: width 300ms ease;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 44px 0 34px;
  color: var(--soft);
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(390px, calc(100% - 32px));
  padding: 14px 18px;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 16px 44px rgba(16, 24, 43, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #a63d46;
}

.site-layer {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 27, 48, 0.58);
  backdrop-filter: blur(10px);
}

.site-layer[hidden] {
  display: none;
}

.site-panel {
  width: min(960px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  overflow: auto;
  padding: 34px;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}

.site-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.site-panel-head h2 {
  margin-bottom: 9px;
  font-size: 28px;
}

.site-panel-head p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.site-panel-close {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--canvas);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.site-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.site-result-group {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfcfe;
}

.site-result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 14px;
}

.site-result-title > span {
  min-width: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.site-result-errors .site-result-title > span {
  color: #a63d46;
  background: #fbecef;
}

.site-result-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
}

.site-result-item {
  padding: 14px;
  border: 1px solid #e8ecf3;
  border-radius: 14px;
  background: #fff;
}

.site-result-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-result-item > div > strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.site-result-item > div > span {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.site-result-item.failed > div > span {
  color: #a63d46;
}

.site-result-item > small {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.site-result-empty {
  margin: 0;
  padding: 28px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.restart-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 27, 48, 0.58);
  backdrop-filter: blur(10px);
}

.restart-layer[hidden] {
  display: none;
}

.restart-card {
  width: min(420px, 100%);
  padding: 42px;
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.restart-card h2 {
  margin: 24px 0 10px;
}

.restart-card p,
.restart-card small {
  color: var(--muted);
}

.restart-spinner {
  display: inline-block;
  width: 52px;
  height: 52px;
  border: 4px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 24px, 680px);
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 42px 30px 30px;
  }

  .health-card {
    min-height: auto;
  }

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

  .action-grid,
  .detail-grid,
  .site-result-grid {
    grid-template-columns: 1fr;
  }

  .section-block {
    margin-top: 56px;
  }

  .source-panel {
    padding: 28px 22px;
  }

  .subscription-panel {
    padding: 28px 22px;
  }

  .security-panel {
    padding: 28px 22px;
  }

  .subscription-controls {
    grid-template-columns: 1fr;
  }

  .password-form {
    grid-template-columns: 1fr 1fr;
  }

  .subscription-actions {
    grid-template-columns: 1fr 1fr;
  }

  .source-intro {
    display: block;
  }

  .security-badge {
    margin-top: 20px;
  }

  .site-panel {
    padding: 26px 20px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 20px 2px;
  }

  .hero {
    border-radius: 24px;
  }

  h1 {
    font-size: 38px;
  }

  .password-form {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 34px 24px;
  }

  .section-heading {
    align-items: start;
  }

  .section-heading > p {
    display: none;
  }

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

  .button-primary {
    min-height: 52px;
  }

  .source-current {
    grid-template-columns: 1fr auto;
  }

  .source-current > span {
    grid-column: 1 / -1;
  }

  .source-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .source-footer .button {
    width: 100%;
  }

  .subscription-actions,
  .subscription-status {
    grid-template-columns: 1fr;
  }

  .subscription-status p {
    grid-column: auto;
  }

  footer {
    flex-direction: column;
    line-height: 1.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
