:root {
  --paper: #f4f3ed;
  --surface: #ffffff;
  --ink: #171a18;
  --muted: #686d68;
  --line: #d9d8d0;
  --accent: #0f766e;
  --accent-strong: #0b5d56;
  --accent-soft: #d9f0ec;
  --warn: #a14f13;
  --warn-soft: #fff0dc;
  --danger: #a12b2b;
  --danger-soft: #fbe5e2;
  --size: 18px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  align-items: center;
  background: rgba(244, 243, 237, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 clamp(20px, 5vw, 72px);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

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

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 4px;
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.browser-status,
.signature-state,
.target-chip,
.phase-label {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.browser-status {
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  background: #a2a6a2;
  border-radius: 50%;
  height: 8px;
  width: 8px;
}

.browser-status[data-state="ok"] .status-dot {
  background: var(--accent);
}

.browser-status[data-state="bad"] .status-dot {
  background: var(--danger);
}

.workspace {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  margin: 0 auto;
  max-width: 1160px;
  padding: 44px 24px 56px;
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.section-heading,
.panel-title,
.progress-header,
.release-line > div {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.section-heading {
  margin-bottom: 6px;
}

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

h1 {
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: 0;
  line-height: 1.04;
  margin-bottom: 0;
}

h2 {
  font-size: 17px;
  line-height: 1.3;
  margin-bottom: 4px;
}

.eyebrow {
  color: var(--accent);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}

.target-chip {
  background: var(--accent-soft);
  border: 1px solid #b8ded8;
  border-radius: 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 9px;
  white-space: nowrap;
}

.target-chip svg,
.button svg,
.signature-state svg,
.message-box svg {
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 17px;
}

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.panel-title {
  justify-content: flex-start;
}

.panel-title p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 0;
}

.step-number {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 28px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  height: 28px;
  justify-content: center;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  font-size: 14px;
  font-weight: 650;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 9px 15px;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button.primary {
  background: var(--ink);
  color: #fff;
}

.button.primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.button.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.button.secondary:hover:not(:disabled) {
  border-color: #a9aaa4;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button.wide {
  margin-top: 18px;
  width: 100%;
}

#connect-button {
  margin-top: 18px;
}

.facts {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 20px 0 0;
  overflow: hidden;
}

.facts > div {
  background: #f7f7f3;
  min-width: 0;
  padding: 12px;
}

.facts > div:first-child {
  border-radius: 6px 0 0 6px;
}

.facts > div:last-child {
  border-radius: 0 6px 6px 0;
}

dt {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}

dd {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.migration-panel {
  border-color: #e5bd8d;
}

.migration-panel .step-number {
  background: var(--warn-soft);
  border-color: #e5bd8d;
  color: var(--warn);
}

code,
pre {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 7px;
}

.inline-field {
  align-items: stretch;
  display: flex;
  gap: 8px;
}

input {
  background: #fff;
  border: 1px solid #bfc0b9;
  border-radius: 6px;
  color: var(--ink);
  min-height: 42px;
  min-width: 0;
  padding: 9px 11px;
  width: 100%;
}

input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(15, 118, 110, 0.13);
}

.consent {
  align-items: flex-start;
  color: var(--muted);
  display: flex;
  font-size: 11px;
  font-weight: 400;
  gap: 8px;
  line-height: 1.5;
  margin: 12px 0 0;
}

.consent input {
  flex: 0 0 auto;
  margin: 2px 0 0;
  min-height: 0;
  width: auto;
}

.release-line {
  margin-top: 18px;
}

.release-version {
  font-family: "IBM Plex Mono", monospace;
  font-size: 24px;
  font-weight: 700;
}

.signature-state {
  background: var(--accent-soft);
  border-radius: 4px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 650;
  margin-left: 10px;
  padding: 4px 7px;
  vertical-align: 4px;
}

#release-changelog {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 9px 0 0;
}

.progress-column {
  align-self: start;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  min-width: 0;
  padding: 24px;
  position: sticky;
  top: 90px;
}

.progress-column .eyebrow {
  color: #86d4ca;
}

.progress-header {
  align-items: flex-start;
}

.phase-label {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 4px;
  color: #d9ddd9;
  font-size: 11px;
  padding: 5px 8px;
}

.progress-ring {
  align-items: center;
  display: flex;
  height: 154px;
  justify-content: center;
  margin: 22px auto 10px;
  position: relative;
  width: 154px;
}

.progress-ring svg {
  height: 100%;
  transform: rotate(-90deg);
  width: 100%;
}

.progress-ring circle {
  fill: none;
  stroke-width: 8;
}

.ring-track {
  stroke: rgba(255, 255, 255, 0.1);
}

.ring-value {
  stroke: #86d4ca;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  stroke-linecap: round;
  transition: stroke-dashoffset 180ms ease;
}

.progress-ring > span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 28px;
  font-weight: 700;
  position: absolute;
}

.stage-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: center;
}

.stage-copy strong {
  font-size: 15px;
}

.stage-copy span {
  color: #b9bfba;
  font-size: 12px;
  line-height: 1.5;
}

.progress-bar {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  height: 5px;
  margin: 22px 0;
  overflow: hidden;
}

.progress-bar > span {
  background: #86d4ca;
  display: block;
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.message-box {
  align-items: flex-start;
  background: var(--danger-soft);
  border: 1px solid #e9b6b1;
  border-radius: 6px;
  color: #7f1d1d;
  display: flex;
  font-size: 12px;
  gap: 8px;
  line-height: 1.5;
  padding: 11px;
}

.message-box[hidden] {
  display: none;
}

.log-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 20px;
  padding-top: 15px;
}

.log-panel summary {
  color: #b9bfba;
  cursor: pointer;
  font-size: 12px;
}

.log-panel pre {
  color: #dce1dc;
  font-size: 10px;
  line-height: 1.55;
  margin: 12px 0 0;
  max-height: 190px;
  overflow: auto;
  white-space: pre-wrap;
}

.footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 11px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1160px;
  padding: 20px 24px 32px;
}

.footer a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .workspace {
    grid-template-columns: 1fr;
    padding-top: 28px;
  }

  .progress-column {
    position: static;
  }

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

  .facts > div:first-child,
  .facts > div:last-child {
    border-radius: 0;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 12px;
    padding-top: 12px;
    position: static;
  }

  .section-heading,
  .panel-title {
    flex-direction: column;
  }

  .target-chip {
    white-space: normal;
  }

  .tool-panel,
  .progress-column {
    padding: 18px;
  }

  .inline-field {
    flex-direction: column;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}
