:root {
  color-scheme: light dark;
  --bg: #f4f6fa;
  --surface: #fff;
  --text: #172235;
  --muted: #58677e;
  --line: #e3e8f1;
  --soft: #f6f8fc;
  --accent: #4357d9;
  --accent-hover: #3445bd;
  --ok: #176d4a;
  --ok-bg: #eaf7f0;
  --pending: #8b5a16;
  --pending-bg: #fff5df;
  --shadow: 0 18px 65px #17264b0a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 0, #e6eaff 0, transparent 55%), var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  min-width: 280px;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:disabled, a[aria-disabled="true"] { opacity: .48; cursor: not-allowed; }
a[aria-disabled="true"] { pointer-events: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.page { width: min(1080px, 100%); margin: auto; padding: 30px 28px 20px; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); font-size: 26px; font-weight: 750; text-decoration: none; letter-spacing: -1px; }
.brand-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 23px; }
.brand-dot { color: var(--accent); }
.header-label { color: var(--muted); font-size: 13px; }
.intro { margin: 60px auto 34px; text-align: center; }
.eyebrow { color: var(--accent); font-size: 11px; letter-spacing: .17em; font-weight: 750; }
h1 { margin: 12px 0 16px; font-size: clamp(26px, 4.3vw, 42px); line-height: 1.18; letter-spacing: -.04em; text-wrap: balance; }
.intro p { margin: 0; color: var(--muted); }
.repo-card { display: grid; grid-template-columns: minmax(0, 326px) minmax(0, 1fr); gap: 42px; padding: 38px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); }
.qr-column { align-self: center; text-align: center; min-width: 0; }
.qr-frame { display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 15px; border: 1px solid #e3e8f1; border-radius: 18px; background: #fff; color: #5d687c; }
.qr-frame img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.qr-placeholder { display: grid; justify-items: center; gap: 18px; padding: 16px; font-size: 14px; }
.scan-hint { max-width: 300px; margin: 18px auto 0; font-size: 13px; color: var(--muted); }
.scan-hint strong { font-weight: 600; }
.details { min-width: 0; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 30px; color: var(--pending); background: var(--pending-bg); font-size: 12px; }
.status[data-state="ready"] { color: var(--ok); background: var(--ok-bg); }
.status-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
h2 { margin: 14px 0 8px; font-size: 25px; line-height: 1.25; letter-spacing: -.025em; }
.description { margin: 0; color: var(--muted); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 10px 14px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 650; text-decoration: none; cursor: pointer; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); }
.button-secondary { background: var(--surface); border-color: var(--line); color: var(--text); }
.button-secondary:hover:not(:disabled) { background: var(--soft); }
.info-field { min-width: 0; margin-top: 16px; }
h3 { margin: 0 0 5px; font-size: 12px; font-weight: 650; color: var(--muted); }
h3 span { font-size: 10px; font-weight: 500; white-space: nowrap; }
code { display: block; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; user-select: all; }
.fingerprint-field { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-heading h3 { margin: 0; }
.copy-small { flex-shrink: 0; padding: 10px 0 10px 6px; border: 0; background: transparent; color: var(--accent); font-size: 11px; font-weight: 650; cursor: pointer; min-height: 44px; }
.fingerprint-field code { letter-spacing: .035em; }
.feedback { min-height: 21px; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.retry { padding: 8px 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.notice { font-size: 13px; color: var(--muted); }
.clipboard-buffer { position: fixed; left: -9999px; top: 0; font-size: 16px; }
.notes { display: flex; justify-content: space-between; gap: 26px; margin: 20px 4px; font-size: 12px; color: var(--muted); }
.notes p { margin: 0; }
.note-icon { color: var(--ok); margin-right: 4px; }
footer { padding: 32px 0 12px; text-align: center; font-size: 11px; color: var(--muted); }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1320;
    --surface: #171e2e;
    --text: #edf0f9;
    --muted: #a4b0c7;
    --line: #303a50;
    --soft: #111827;
    --accent: #a3adff;
    --accent-hover: #b9c1ff;
    --ok: #90dfb4;
    --ok-bg: #15352c;
    --pending: #f0ce8e;
    --pending-bg: #3a3020;
    --shadow: 0 18px 65px #0002;
  }
  body { background: radial-gradient(ellipse at 50% 0, #202843 0, transparent 55%), var(--bg); }
  .button-primary, .brand-icon { color: #101832; }
}

@media (max-width: 800px) {
  .page { max-width: 580px; padding: 22px 20px 16px; }
  .intro { margin-top: 42px; }
  .repo-card { grid-template-columns: minmax(0, 1fr); padding: 28px; gap: 28px; }
  .qr-column { width: min(100%, 326px); margin: auto; }
  .notes { flex-direction: column; gap: 12px; }
}

@media (max-width: 400px) {
  .page { padding: 18px 12px 12px; }
  .header-label { max-width: 110px; text-align: right; font-size: 11px; }
  .intro { margin: 34px 0 26px; }
  .intro p { font-size: 14px; }
  .repo-card { padding: 20px 16px; border-radius: 20px; }
  .actions { flex-direction: column; }
  .button { width: 100%; }
  h2 { font-size: 23px; }
  .field-heading { flex-wrap: wrap; gap: 0; }
}
