:root {
  color-scheme: light dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --bg: #f4f3ef;
  --surface: #ffffff;
  --text: #171717;
  --muted: #686761;
  --border: #d8d6cf;
  --accent: #171717;
  --accent-text: #ffffff;
  --success: #176b43;
  --success-bg: #ecf7f0;
  --error: #a52a2a;
  --error-bg: #fff0ee;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
.page-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.panel { width: min(100%, 680px); background: var(--surface); border: 1px solid var(--border); padding: clamp(24px, 5vw, 48px); }
.panel-header { border-bottom: 1px solid var(--border); padding-bottom: 24px; }
.brand { color: inherit; font-size: 13px; font-weight: 800; letter-spacing: .18em; text-decoration: none; }
.eyebrow { margin: 32px 0 8px; color: var(--muted); font-size: 12px; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(30px, 6vw, 46px); line-height: 1.08; letter-spacing: -.04em; }
.lede { margin: 16px 0 0; color: var(--muted); line-height: 1.7; }
.auth-state { display: flex; align-items: center; gap: 10px; margin: 24px 0; color: var(--muted); font-size: 14px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #c89220; flex: none; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 13px; }
input { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 4px; background: transparent; color: var(--text); padding: 10px 12px; }
input[readonly] { cursor: default; }
.notice { margin: 24px 0 16px; border-left: 3px solid var(--text); background: color-mix(in srgb, var(--bg) 65%, transparent); padding: 14px 16px; }
.notice p { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.primary-button { width: 100%; min-height: 48px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: var(--accent-text); font-weight: 700; cursor: pointer; }
.primary-button:disabled { cursor: not-allowed; opacity: .45; }
.primary-button:focus-visible, .key-row button:focus-visible, a:focus-visible { outline: 3px solid #3b82f6; outline-offset: 3px; }
.status-message { margin: 12px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.error { margin: 16px 0; border: 1px solid color-mix(in srgb, var(--error) 35%, transparent); background: var(--error-bg); color: var(--error); padding: 12px 14px; font-size: 14px; }
.result { margin-top: 28px; border: 1px solid color-mix(in srgb, var(--success) 35%, transparent); background: var(--success-bg); padding: 20px; }
.result:focus { outline: none; }
.success-label { margin: 0 0 6px; color: var(--success); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.result h2 { margin: 0; font-size: 22px; }
.result > p:not(.success-label) { color: var(--muted); line-height: 1.6; }
.key-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 16px 0; }
.key-row button { border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: var(--accent-text); padding: 0 18px; cursor: pointer; }
.inline-link { color: inherit; font-weight: 700; text-underline-offset: 3px; }
.return-button { display: flex; min-height: 44px; align-items: center; justify-content: center; margin-top: 18px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: var(--accent-text); font-weight: 700; text-decoration: none; }

@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr; }
  .key-row { grid-template-columns: 1fr; }
  .key-row button { min-height: 44px; }
}

@media (prefers-color-scheme: dark) {
  :root { --bg: #11110f; --surface: #191917; --text: #f3f2ed; --muted: #aaa9a1; --border: #3b3a35; --accent: #f3f2ed; --accent-text: #171717; --success: #7fd7aa; --success-bg: #15281f; --error: #ffaaa0; --error-bg: #321c1a; }
}
