:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #08080a;
  color: #f7f7f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% -10%, rgba(131, 83, 255, 0.2), transparent 35rem),
    radial-gradient(circle at 100% 20%, rgba(39, 169, 255, 0.12), transparent 30rem),
    #08080a;
}

body[data-site-auth="checking"],
body[data-site-auth="locked"] {
  overflow: hidden;
}

body[data-site-auth="checking"] .shell,
body[data-site-auth="locked"] .shell {
  visibility: hidden;
}

button,
input,
a {
  font: inherit;
}

button,
.back {
  border: 1px solid #35353d;
  border-radius: 12px;
  background: #1a1a20;
  color: #f5f5f7;
  min-height: 42px;
  padding: 0 15px;
}

button {
  cursor: pointer;
}

button:hover,
.back:hover {
  border-color: #696978;
}

button.primary {
  border-color: #f4f4f5;
  background: #f4f4f5;
  color: #09090b;
  font-weight: 700;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.site-auth-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 20% -10%, rgba(131, 83, 255, 0.2), transparent 35rem),
    radial-gradient(circle at 100% 20%, rgba(39, 169, 255, 0.12), transparent 30rem),
    #08080a;
}

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

.site-auth-card {
  display: grid;
  gap: 14px;
  width: min(390px, 100%);
  border: 1px solid #35353d;
  border-radius: 18px;
  background: rgba(20, 20, 24, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  padding: 22px;
}

.site-auth-card h1 {
  margin: 0;
  font-size: 26px;
}

.site-auth-card input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #3a3a43;
  border-radius: 12px;
  outline: none;
  background: #0d0d10;
  color: #fff;
  padding: 0 14px;
}

.site-auth-card input:focus {
  border-color: #858594;
}

.site-auth-copy,
.site-auth-message {
  margin: 0;
  color: #a8a8b4;
  font-size: 13px;
  line-height: 1.55;
}

.site-auth-message {
  min-height: 20px;
  color: #ffc274;
}

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.head h1 {
  margin: 2px 0 0;
  font-size: clamp(24px, 4vw, 38px);
}

.kicker {
  color: #9898a7;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.back {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.status {
  border: 1px solid #464650;
  border-radius: 999px;
  padding: 8px 12px;
  color: #b9b9c4;
  font-size: 13px;
}

.status[data-state="ok"] {
  border-color: #246b44;
  color: #70e6a2;
}

.status[data-state="out"] {
  border-color: #7a5327;
  color: #ffc274;
}

.notice,
.browser-card,
.input-card,
.capability-card {
  border: 1px solid #292930;
  border-radius: 18px;
  background: rgba(20, 20, 24, 0.9);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.notice {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 16px;
  color: #b8b8c3;
}

.notice strong {
  color: #fff;
}

.toolbar,
.input-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.browser-card {
  overflow: hidden;
}

.browser-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid #292930;
  color: #9292a0;
  font-size: 12px;
}

.browser-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1280 / 900;
  max-height: 78vh;
  background: #050506;
  overflow: hidden;
}

#screen {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: crosshair;
  user-select: none;
  -webkit-user-drag: none;
}

.screen-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #777783;
}

.input-card,
.capability-card {
  margin-top: 16px;
  padding: 16px;
}

.input-card label,
.capability-card h2 {
  display: block;
  margin: 0 0 10px;
  color: #ededf1;
  font-weight: 700;
}

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

.input-row input {
  min-width: 0;
  min-height: 46px;
  border: 1px solid #3a3a43;
  border-radius: 12px;
  outline: none;
  background: #0d0d10;
  color: #fff;
  padding: 0 14px;
}

.input-row input:focus {
  border-color: #858594;
}

.input-card p,
.capability-card p {
  margin: 10px 0 0;
  color: #9292a0;
  line-height: 1.55;
  font-size: 13px;
}

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

.capabilities span {
  border: 1px solid #373740;
  border-radius: 999px;
  padding: 7px 11px;
  color: #d0d0d8;
  font-size: 13px;
}

.message {
  min-height: 24px;
  margin: 14px 4px 0;
  color: #ffc274;
}

@media (max-width: 650px) {
  .shell {
    width: min(100% - 18px, 1180px);
    padding-top: 12px;
  }

  .head {
    gap: 10px;
  }

  .status {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .toolbar button {
    flex: 1 1 auto;
  }

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