:root {
  color-scheme: dark;
  --bg: #101114;
  --surface: #17181d;
  --input: #121318;
  --hover: #22232b;
  --ink: #eeeef3;
  --muted: #a0a2b1;
  --subtle: #858897;
  --line: #2b2d36;
  --accent: #74b0ff;
  --accent-fill: #2869c7;
  --accent-soft: #192a41;
  --success: #85cba4;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
a { color: var(--accent); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #74b0ff20; }
input[readonly] { color: var(--muted); background: #1a1b22; }
.access details, #login details { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.access summary, #login summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.access summary:focus-visible, #login summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.access details form, #login details form { margin-top: 18px; }
::selection { background: #2869c770; color: #fff; }

/* Workspace chrome */
.topbar { height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 32px; border-bottom: 1px solid var(--line); background: #14151a; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 650; letter-spacing: -.5px; }
.mark { display: block; flex: 0 0 32px; width: 32px; height: 32px; object-fit: contain; }
.brand-note { margin-left: 16px; padding-left: 24px; border-left: 1px solid var(--line); font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.local-badge { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.dot { height: 6px; width: 6px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 3px #85cba410; }
main { display: grid; grid-template-columns: 210px minmax(0, 720px); gap: 24px 40px; max-width: 1074px; margin: 0 auto; padding: 36px 32px 24px; }
main > .intro, main > .panel, #message, footer { grid-column: 2; min-width: 0; }
.intro { margin: 0; }
.eyebrow { color: var(--subtle); font-size: 10px; letter-spacing: 1px; font-weight: 600; margin: 0 0 10px; }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -.9px; line-height: 1.25; margin: 0 0 10px; }
.intro > p:last-child { color: var(--muted); font-size: 13px; line-height: 1.65; max-width: 600px; margin: 0; }
h2 { font-size: 21px; font-weight: 600; letter-spacing: -.45px; line-height: 1.3; margin: 0 0 9px; }
h2:focus { outline: none; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 16px; }
.description { color: var(--muted); margin: 0 0 26px; max-width: 580px; line-height: 1.65; }

/* Setup navigation */
.workspace { display: contents; }
.workspace aside { grid-column: 1; grid-row: 1 / span 2; min-width: 0; position: sticky; top: 28px; align-self: start; padding-top: 6px; }
.workspace aside > .eyebrow { padding-left: 12px; margin-bottom: 16px; }
nav { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
nav button { display: flex; align-items: center; gap: 11px; padding: 10px 12px; width: 100%; border: 1px solid transparent; background: transparent; color: var(--muted); text-align: left; border-radius: 6px; font-size: 12px; white-space: nowrap; }
nav button:hover { background: var(--hover); color: var(--ink); }
.step-number { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid #454754; color: var(--muted); font-size: 10px; line-height: 1; }
nav button.active { color: var(--ink); background: #24252e; border-color: #333540; font-weight: 550; }
nav button.active .step-number { color: #b8d8ff; background: #74b0ff20; border-color: #74b0ff70; }
nav button.done .step-number { font-size: 0; border-color: #85cba455; background: #85cba410; color: var(--success); }
nav button.done .step-number::after { content: "✓"; font-size: 11px; }
.aside-note { display: flex; align-items: flex-start; gap: 10px; border-top: 1px solid var(--line); margin: 26px 12px 0; padding-top: 18px; color: var(--subtle); font-size: 11px; line-height: 1.7; }
.aside-note > span { font-size: 17px; color: var(--muted); }
.aside-note p { margin: 0; }
#view-status { margin: 20px 12px 0; }

/* Form surfaces and controls */
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; box-shadow: 0 2px 6px #00000015; padding: 28px; min-width: 0; }
.form-panel { grid-column: 2; padding: 26px 28px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.section-header .eyebrow { margin: 0; }
.badge { font-size: 9px; font-weight: 500; letter-spacing: .65px; padding: 4px 7px; background: #21222a; border: 1px solid #32343f; border-radius: 4px; color: #b1b3c3; }
label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 19px; color: #d5d6e1; }
input, select, textarea { display: block; width: 100%; min-width: 0; border: 1px solid #363844; background: var(--input); border-radius: 5px; padding: 10px 11px; margin-top: 7px; color: var(--ink); font-size: 13px; line-height: 1.4; }
/* Popup options need opaque colors even when the closed property control is transparent. */
select { color-scheme: dark; accent-color: var(--accent-fill); }
select option, select optgroup { background: var(--surface); color: var(--ink); }
select option:disabled { color: var(--subtle); }
select.themed-select { display: none; }
.select-trigger { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; margin-top: 7px; padding: 10px 11px; border: 1px solid #363844; border-radius: 5px; background: var(--input); color: var(--ink); font-size: 13px; line-height: 1.4; text-align: left; }
.select-trigger:hover { border-color: #484b59; }
.select-trigger:focus-visible, .select-trigger[aria-expanded=true] { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.select-trigger:disabled { cursor: not-allowed; }
.select-trigger[aria-invalid=true] { border-color: #e59090; }
.select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-chevron { flex: none; width: 6px; height: 6px; margin: 0 3px 3px 0; border-right: 1.5px solid var(--subtle); border-bottom: 1.5px solid var(--subtle); transform: rotate(45deg); }
.select-menu { position: fixed; z-index: 100; overflow: auto; overscroll-behavior: contain; padding: 5px; border: 1px solid #3a3d49; border-radius: 8px; background: #191b22; color: var(--ink); box-shadow: 0 12px 36px #0008; color-scheme: dark; }
.select-option { display: flex; align-items: center; gap: 12px; padding: 9px 10px; min-height: 34px; border-radius: 4px; font-size: 12px; line-height: 1.5; cursor: pointer; }
.select-option>span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.select-option.active { background: var(--accent-soft); color: var(--ink); }
.select-option[aria-selected=true] { color: #b8d8ff; }
.select-option[aria-disabled=true] { color: var(--subtle); cursor: not-allowed; }
.select-check { flex: none; width: 14px; color: var(--accent); }
.select-empty { padding: 8px 10px; margin: 0; color: var(--subtle); font-size: 12px; }
input:hover, select:hover, textarea:hover { border-color: #484b59; }
input::placeholder, textarea::placeholder { color: #7f8292; opacity: 1; }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
input[type=file] { font-size: 12px; padding: 8px; }
input[type=file]::file-selector-button { font: inherit; color: var(--ink); background: #292b35; border: 1px solid #424452; border-radius: 4px; padding: 5px 9px; margin-right: 10px; cursor: pointer; }
small { display: block; font-size: 11px; font-weight: 400; color: var(--subtle); margin-top: 7px; line-height: 1.6; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.states { gap: 0 14px; }
.states input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.workflow-help { margin: -5px 0 18px; }
.state-row { padding: 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.state-row > label { margin: 0; }
.state-row > small { margin: 6px 0 12px; }
.state-control { min-height: 24px; display: flex; align-items: center; }
.state-required { color: var(--muted); font-size: 10px; }
.state-toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 11px; cursor: pointer; }
.states .state-toggle input { display: inline-block; width: 14px; height: 14px; margin: 0; padding: 0; accent-color: var(--accent-fill); }
.state-toggle input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.state-disabled > input { color: var(--muted); opacity: .65; cursor: not-allowed; }
.divider { height: 1px; background: var(--line); margin: 8px 0 23px; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 14px; border-radius: 5px; font-size: 12px; font-weight: 500; padding: 9px 14px; min-height: 36px; line-height: 1.4; }
.primary { background: var(--accent-fill); color: #fff; border: 1px solid #6ba6f080; box-shadow: inset 0 1px 0 #ffffff15, 0 1px 2px #00000030; }
.primary:hover { background: #2b70d0; border-color: #93c3ff; }
.primary:active { background: #205bad; }
.secondary { background: #21222a; border: 1px solid #383a46; color: #c3c5d1; }
.secondary:hover { background: #2a2c36; border-color: #505361; color: var(--ink); }
.secondary:active { background: #1b1c23; }
.compact { padding: 6px 9px; min-height: 30px; font-size: 11px; gap: 0; }
.form-footer { margin-top: 26px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 16px; }
.form-footer #progress-text { color: var(--subtle); font-size: 11px; margin-right: auto; font-variant-numeric: tabular-nums; }
.callout { display: flex; gap: 12px; background: #172638; border: 1px solid #2a425f; border-radius: 6px; padding: 16px; margin: 22px 0 8px; }
.callout > span { font-size: 20px; color: #92c2ff; }
.callout strong { font-size: 12px; font-weight: 550; color: #d9e8fa; }
.callout p { font-size: 12px; color: #9fb5cf; margin: 4px 0 0; line-height: 1.65; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 18px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; color: #add0fa; }
.token-controls { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.token-controls input { margin: 0; flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.role-row { border-bottom: 1px solid var(--line); padding: 0 0 1px; margin-bottom: 18px; }
.role-row small { margin-top: 3px; }
dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px 20px; font-size: 12px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.narrow { max-width: 540px; }
.narrow p, #complete-message { color: var(--muted); }
.narrow form { margin-top: 24px; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 26px 0; }
.service { border: 1px solid var(--line); background: var(--input); border-radius: 6px; padding: 16px; min-width: 0; }
.service h3 { margin-bottom: 10px; }
.service p { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.service.ready h3 { color: var(--success); }
.service.pending h3 { color: #e5bc78; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
#message { padding: 14px 16px; border: 1px solid #633340; background: #2c1c23; color: #ffb8c0; border-radius: 6px; margin: 0; font-size: 12px; overflow-wrap: anywhere; }
#message.success { border-color: #335546; background: #1a2a23; color: #a0dfba; }
footer { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 9px; font-weight: 500; letter-spacing: .8px; color: var(--subtle); padding: 0 2px; }
footer span { font-size: 11px; font-weight: 400; letter-spacing: 0; }

@media (max-width: 900px) {
  main { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; padding: 30px 24px 24px; }
  .topbar { padding: 0 24px; }
  .brand-note { margin-left: 8px; padding-left: 18px; }
  .form-panel { padding: 24px 24px 0; }
  .service-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  main { display: block; padding: 28px 20px 24px; }
  .intro { margin-bottom: 24px; }
  h1 { font-size: 25px; }
  .brand-note { display: none; }
  .workspace { display: block; }
  .workspace aside { position: static; padding: 0; margin-bottom: 20px; }
  .workspace aside > .eyebrow, .aside-note { display: none; }
  nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: #41434f transparent; }
  nav button { width: auto; padding: 8px 10px; flex-shrink: 0; gap: 8px; }
  #view-status { margin: 8px 0 0; }
  #message { margin-top: 20px; }
  footer { margin-top: 24px; }
}
@media (max-width: 480px) {
  .topbar { height: 54px; padding: 0 16px; }
  .topbar-actions { gap: 10px; }
  .topbar-actions .local-badge { display: none; }
  main { padding: 24px 14px; }
  .grid { grid-template-columns: 1fr; }
  .panel { padding: 22px 18px; }
  .form-panel { padding-bottom: 0; }
  .form-footer { gap: 10px; }
  input, select, textarea { font-size: 16px; }
  .states input, .token-controls input { font-size: 13px; }
  .token-controls { gap: 5px; }
  .compact { padding: 6px 8px; }
  dl { grid-template-columns: 1fr; gap: 5px; }
  dd { margin-bottom: 14px; }
  .description { font-size: 13px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, input, select, textarea { transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
}
