:root {
  --blue: #003ec7;
  --blue-dark: #0035ab;
  --ink: #191b25;
  --muted: #505f76;
  --line: #c3c5d9;
  --panel: #fdfff8;
  --card: #ffffff;
  --green: #10b981;
  --green-bg: #ecfdf5;
  --green-border: #a7f3d0;
  --green-text: #047857;
  --red: #dc3545;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--panel);
  overflow-x: hidden;
}

.shell {
  width: min(1280px, 100%);
  min-height: 100vh;
  margin: 0 auto;
}

.app-frame {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  background: var(--panel);
}

.topbar {
  display: flex;
  align-items: center;
  flex: 0 0 65px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--card);
}

.logo {
  color: var(--blue);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.24px;
  text-decoration: none;
  white-space: nowrap;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.button:hover {
  background: var(--blue-dark);
}

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

.button:disabled {
  cursor: wait;
  opacity: 0.85;
}

.button-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button.is-loading .button-loader {
  display: inline-block;
}

.button.is-loading .button-label {
  opacity: 0.85;
}

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

.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 39px 24px 40px;
}

.hero {
  max-width: 820px;
  margin: 0 auto;
  flex: 0 0 auto;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: -0.72px;
}

.lede {
  max-width: 710px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
}

.check-form {
  display: grid;
  grid-template-columns: 1fr 184px;
  align-items: center;
  max-width: 768px;
  min-height: 62px;
  margin: 24px auto 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 16px;
}

.input-wrap svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: #80879a;
}

input[type="url"] {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}

.check-form .button {
  height: 58px;
  padding: 0 40px;
  white-space: nowrap;
}

.results {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: start;
  gap: 24px;
  margin-top: 40px;
}

.screenshot-card {
  min-width: 0;
  min-height: 0;
  order: 1;
}

.screenshot-frame {
  display: grid;
  place-items: center;
  overflow: hidden;
  height: clamp(320px, 48vh, 520px);
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e1e1ef;
}

.screenshot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.screenshot-link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  text-decoration: none;
}

.screenshot-link img {
  display: block;
}

.screenshot-fallback {
  padding: 24px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.result-stack {
  display: grid;
  grid-template-rows: minmax(0, auto) auto;
  gap: 16px;
  min-height: 0;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.status-card {
  width: 100%;
  padding: 25px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.card-head .title {
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid var(--green-border);
  border-radius: 12px;
  background: var(--green-bg);
  color: var(--green-text);
  font-size: 11px;
  font-weight: 700;
}

.pill.offline {
  border-color: #ffd0d5;
  background: #fff0f2;
  color: var(--red);
}

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

.pill.offline .dot {
  background: var(--red);
}

.checked-url {
  overflow-wrap: anywhere;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.code {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 36px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.72px;
}

.code span {
  color: var(--muted);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.2px;
}

.error-message {
  margin: -6px 0 14px;
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
}

.divider {
  height: 1px;
  margin: 16px 0 18px;
  background: var(--line);
}

.metric {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.metric .metric-result {
  max-width: 58%;
  color: var(--ink);
  text-align: right;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.node-card {
  padding: 25px;
}

.node-title {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.pin {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 2px;
  background: #d3e4fe;
  color: var(--blue);
}

.node-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.node-region {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.node-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.service-notice {
  max-width: 480px;
  margin: 48px auto 0;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  text-align: center;
}

.service-notice strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.service-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
}

.footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer a:hover {
  color: var(--ink);
}

@media (max-width: 850px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .shell {
    width: 100%;
    height: auto;
    min-height: 100vh;
    margin-top: 0;
  }

  .app-frame {
    height: auto;
    min-height: 100vh;
  }

  .main {
    padding: 50px 16px;
  }

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

  .check-form .button {
    width: 100%;
    margin-top: 8px;
  }

  .status-card {
    padding: 25px 20px;
  }

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

  .screenshot-frame {
    min-height: 320px;
  }

  .node-card {
    padding: 25px 20px;
  }
}

@media (max-width: 1100px) {
  .results {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }

  .status-card {
    padding: 20px 22px 24px;
  }

  .card-head,
  .metric {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric {
    gap: 4px;
  }

  .metric strong {
    text-align: left;
  }
}

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

  .logo {
    font-size: 20px;
  }

  .card-head,
  .metric {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric strong {
    text-align: left;
  }
}
