:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-strong: #eef2f7;
  --text: #17202a;
  --muted: #5f6b7a;
  --line: #c9d2df;
  --accent: #1868db;
  --accent-strong: #0f4fa8;
  --danger: #a83b30;
  --ok: #146c43;
  --focus: #b45f06;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary,
#stop-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

button.secondary:hover,
#stop-button:hover {
  border-color: #9ba9ba;
  background: var(--surface-strong);
}

input {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
}

input:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 10;
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--text);
  color: #fff;
}

.skip-link:focus {
  top: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #17202a;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shell {
  min-height: calc(100vh - 56px);
}

.auth-view {
  display: grid;
  min-height: calc(100vh - 56px);
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
}

.auth-heading {
  margin-bottom: 22px;
}

.auth-heading h1 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: 0;
}

.auth-heading p,
.message {
  margin: 0;
  color: var(--muted);
}

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

.form + .form {
  margin-top: 18px;
}

.form button {
  margin-top: 8px;
}

.message {
  min-height: 24px;
  margin-top: 16px;
  font-size: 14px;
}

.message.error {
  color: var(--danger);
}

.message.ok {
  color: var(--ok);
}

.browser-view {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: calc(100vh - 56px);
}

.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  background: var(--surface);
}

.address-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  flex: 1;
  gap: 10px;
}

.browser-frame {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 24px;
  background: #dfe7f1;
}

.worker-frame {
  width: 100%;
  height: min(72vh, 820px);
  min-height: 460px;
  border: 1px solid #aebccc;
  border-radius: 8px;
  background: #fff;
}

.mock-page {
  width: min(720px, 100%);
  border: 1px solid #aebccc;
  border-radius: 8px;
  padding: 28px;
  background: #fff;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mock-page h1 {
  overflow-wrap: anywhere;
  margin: 0 0 22px;
  font-size: 28px;
  letter-spacing: 0;
}

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

.session-meta div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #f8fafc;
}

.session-meta dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.session-meta dd {
  overflow-wrap: anywhere;
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

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

  .browser-toolbar,
  .address-form {
    grid-template-columns: 1fr;
  }

  .browser-toolbar {
    display: grid;
  }

  .session-meta {
    grid-template-columns: 1fr;
  }
}
