:root {
  color-scheme: light;
  --paper: #dce5df;
  --surface: #f5f7f2;
  --surface-bright: #fbfcf8;
  --ink: #1b3038;
  --muted: #60777b;
  --line: #b9c9c1;
  --steel: #314e56;
  --cobalt: #2c7c9c;
  --ember: #e96537;
  --signal: #4a8e7f;
  --amber: #d6a34d;
  --focus: #204df5;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.34), transparent 36%),
    var(--paper);
}

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

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

button, input, select { font: inherit; }

.account-shell {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 28px;
}

.account-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(49, 78, 86, 0.24);
}

.wordmark { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.wordmark > span:last-child { display: grid; gap: 2px; }
.wordmark strong { font-family: Bahnschrift, "Arial Narrow", sans-serif; font-size: 17px; }
.wordmark small { color: var(--muted); font-size: 12px; }
.brand-mark {
  width: 39px; height: 39px; display: grid; place-items: center;
  color: var(--surface-bright); background: var(--steel);
  border-radius: 11px 4px 11px 4px; font-weight: 800; transform: rotate(-4deg);
}
.account-header nav { display: flex; gap: 22px; font-size: 13px; font-weight: 700; }

.account-intro { max-width: 760px; padding: 52px 0 38px; }
.eyebrow { margin: 0 0 11px; color: var(--signal); font-size: 12px; font-weight: 700; }
.account-intro h1 {
  margin: 0; font-family: Bahnschrift, "Arial Narrow", "Segoe UI", sans-serif;
  font-size: clamp(38px, 6vw, 66px); line-height: 0.99; letter-spacing: -0.045em;
}
.account-intro > p:last-child { max-width: 700px; margin: 20px 0 0; color: #435e64; font-size: 16px; line-height: 1.65; }

.account-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.forms-panel { padding: 28px 32px 22px 0; }
.account-form { display: grid; gap: 9px; }
.account-form h2, .connection-panel h2, .credential-panel h2 { margin: 0 0 11px; font-size: 21px; letter-spacing: -0.025em; }
.account-form label { margin-top: 7px; color: var(--steel); font-size: 13px; font-weight: 700; }
.account-form input, .account-form select {
  width: 100%; min-height: 43px; padding: 9px 11px; color: var(--ink);
  background: var(--surface-bright); border: 1px solid #aebfba; border-radius: 4px;
}
.account-form button, .credential-value button {
  min-height: 42px; padding: 9px 15px; color: white; background: var(--steel);
  border: 0; border-radius: 4px; font-weight: 700; cursor: pointer;
}
.account-form button { margin-top: 7px; }
.account-form button:hover, .credential-value button:hover { background: #203d45; }
.account-form .button-secondary { color: var(--steel); background: transparent; border: 1px solid var(--steel); }
.account-form .button-secondary:hover { background: rgba(49, 78, 86, 0.08); }
.form-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.account-form--login { margin-top: 29px; padding-top: 25px; border-top: 1px solid var(--line); }
.status-message { min-height: 1.5em; margin: 16px 0 0; color: #8f3d28; font-size: 13px; line-height: 1.5; }
.status-message[data-kind="success"] { color: #286754; }

.connection-panel { padding: 29px 0 26px 34px; border-left: 1px solid var(--line); }
.flow-list { display: grid; gap: 14px; margin: 20px 0 24px; padding: 0; list-style: none; }
.flow-list li { display: grid; grid-template-columns: 28px 1fr; align-items: start; gap: 12px; }
.flow-list li > span { width: 27px; height: 27px; display: grid; place-items: center; color: white; background: var(--cobalt); border-radius: 50%; font-size: 12px; font-weight: 700; }
.flow-list p { margin: 2px 0 0; color: #435e64; font-size: 14px; line-height: 1.55; }
.flow-list code, .api-endpoints code { color: var(--steel); font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.api-endpoints { display: grid; grid-template-columns: 1fr auto; gap: 9px 18px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.api-endpoints span { color: var(--muted); font-size: 12px; }
.documentation-link { display: inline-block; margin-top: 18px; font-size: 13px; font-weight: 700; text-underline-offset: 4px; }

.credential-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr); align-items: center; gap: 25px; margin-top: 24px; padding: 22px 24px; background: #e9e2ce; border-left: 4px solid var(--amber); }
.credential-panel[hidden] { display: none; }
.credential-panel p:not(.eyebrow) { max-width: 570px; margin: 8px 0 0; color: #53696c; font-size: 13px; line-height: 1.55; }
.credential-value { display: grid; gap: 10px; }
.credential-value code { display: block; overflow-wrap: anywhere; padding: 12px; color: #243e43; background: var(--surface-bright); border: 1px solid #c4b994; font-family: Consolas, "Courier New", monospace; font-size: 12px; }

.account-shell footer { display: flex; justify-content: space-between; gap: 14px; padding-top: 24px; color: var(--muted); font-size: 12px; }
.account-shell footer a { font-weight: 700; }

@media (max-width: 740px) {
  .account-shell { width: min(100% - 32px, 560px); }
  .account-header { flex-wrap: wrap; gap: 9px 14px; padding: 10px 0; }
  .account-header nav { flex-wrap: wrap; justify-content: flex-end; gap: 9px 13px; margin-left: auto; }
  .account-intro { padding: 38px 0 28px; }
  .account-layout { grid-template-columns: 1fr; }
  .forms-panel { padding: 24px 0; }
  .connection-panel { padding: 24px 0 26px; border-top: 1px solid var(--line); border-left: 0; }
  .credential-panel { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .account-header { min-height: 68px; }
  .account-header nav { gap: 8px 10px; font-size: 11px; }
  .wordmark { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; }
  .account-shell footer { flex-direction: column; }
}

.account-page { --muted: #435e64; }
.account-page .account-intro { padding: 32px 0 28px; }
.account-page .account-intro h1 { font-size: clamp(28px,3.4vw,42px); line-height: 1.08; letter-spacing: -.035em; }
.account-page .account-intro > p { font-size: 14px; }
.account-form[hidden], #auth-forms[hidden], #signed-in-panel[hidden] { display: none; }
.auth-switch { display: flex; gap: 6px; margin-bottom: 24px; }
.auth-switch button, .auth-text-button { min-height: 42px; padding: 9px 14px; background: transparent; border: 1px solid var(--steel); border-radius: 3px; color: var(--steel); font: inherit; font-size: 13px; cursor: pointer; }
.auth-switch button[aria-pressed="true"] { color: var(--surface-bright); background: var(--steel); }
.auth-switch button:hover, .auth-text-button:hover { background: var(--surface); color: var(--ink); }
.auth-text-button { margin: 16px 0; display: block; }
.account-form button:disabled { opacity: .55; cursor: wait; }
.spectator-benefits { margin: 24px 0; }
.spectator-benefits dt { font-weight: 700; margin-top: 22px; }
.spectator-benefits dd { margin: 6px 0 0; max-width: 65ch; color: var(--muted); font-size: 14px; line-height: 1.65; }
.agent-access { border-top: 1px solid var(--line); padding-top: 20px; font-size: 13px; line-height: 1.65; }
.agent-access summary { cursor: pointer; font-weight: 700; text-underline-offset: 4px; }
.agent-access p { max-width: 65ch; color: var(--muted); }
.account-page .credential-panel { border-left: 0; }
