:root {
  color-scheme: dark;
  --bg: #101318;
  --surface: #181d25;
  --input: #11161e;
  --hover: #252e3b;
  --text: #e8edf5;
  --muted: #a6b3c5;
  --line: #344052;
  --control: #71829b;
  --accent: #88b7ff;
  --blue: #2864da;
  --success: #94d7b1;
  --error: #ffb1b1;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.5rem; }
body { margin: 0; color: var(--text); background: var(--bg); line-height: 1.55; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { max-width: 100%; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:active:not(:disabled) { filter: brightness(.88); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.2; font-weight: 650; letter-spacing: -.035em; margin-bottom: .6rem; }
h2 { font-size: 1.16rem; line-height: 1.4; font-weight: 650; margin-bottom: .6rem; }
h3 { font-size: .94rem; font-weight: 600; margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
p { margin-bottom: 1rem; }
code, .secret-text, #token, #api-key, #cookie-name { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .84rem; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .82rem; line-height: 1.55; margin: .45rem 0 1.1rem; }
.button { min-height: 44px; border: 1px solid var(--control); padding: .6rem 1rem; border-radius: 7px; font-size: .875rem; font-weight: 600; color: var(--text); background: transparent; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; text-decoration: none; }
.button:hover:not(:disabled) { background: var(--hover); }
.button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button.primary:hover:not(:disabled) { background: #2c6ae0; border-color: #2c6ae0; }
.button.quiet { border-color: transparent; color: var(--muted); }
.button.danger { color: var(--error); }
.full { width: 100%; }
.text-button { min-height: 44px; padding: .4rem .3rem; border: 0; background: transparent; color: var(--accent); font-size: .82rem; font-weight: 600; }
.text-button:hover { text-decoration: underline; }
.boot { padding: 4rem 1.5rem; text-align: center; color: var(--muted); }
.skip-link { position: absolute; top: .5rem; left: .5rem; z-index: 10; padding: .8rem; background: var(--surface); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.wordmark { display: inline-flex; min-height: 44px; align-items: center; gap: .55rem; font-size: 1.3rem; font-weight: 700; letter-spacing: -.04em; color: var(--text); text-decoration: none; }
.wordmark span { color: var(--muted); font-size: .8rem; letter-spacing: 0; font-weight: 500; }
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.login-panel { width: min(100%, 420px); }
.login-panel .wordmark { margin-bottom: 2.8rem; }
.login-panel h1 { font-size: 1.8rem; }
.login-panel form { margin-top: 2rem; }
.login-panel input { margin-bottom: 1.2rem; }
.login-panel .full { margin-top: .7rem; }
.login-foot { font-size: .8rem; color: var(--muted); margin-top: 1.5rem; }
.app-shell { display: block; }
.sidebar { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.sidebar-caption { color: var(--muted); font-size: .78rem; margin: 1.2rem 0 .6rem; }
nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .3rem; }
.nav-link { min-height: 44px; display: flex; align-items: center; padding: .65rem .8rem; color: var(--muted); text-decoration: none; font-size: .86rem; border-radius: 6px; }
.nav-link:hover { background: var(--hover); color: var(--text); }
.nav-link.active { background: #25334a; color: var(--accent); }
.sidebar-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.subtle-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .8rem; color: var(--muted); }
.account-row { display: flex; gap: .8rem; align-items: center; font-size: .8rem; color: var(--muted); }
.workspace { min-width: 0; padding: 1.6rem 1.25rem 2rem; width: 100%; max-width: 1270px; margin: 0 auto; }
.page-header { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header > div { min-width: 0; max-width: 100%; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; }
.breadcrumb { color: var(--muted); font-size: .8rem; margin-bottom: 1.5rem; }
.page-header .muted { font-size: .9rem; margin: 0; }
.header-status { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; font-size: .8rem; }
.header-status .muted { font-size: .8rem; }
.status-label { display: inline-flex; align-items: center; gap: .45rem; }
.status-dot { width: 7px; height: 7px; background: var(--success); border-radius: 50%; }
.endpoint-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .9rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 1.6rem; color: var(--muted); font-size: .8rem; }
.endpoint-bar code { color: var(--text); overflow-wrap: anywhere; flex: 1 1 200px; min-width: 0; }
.notice { padding: .9rem 1rem; border: 1px solid var(--control); background: var(--surface); border-radius: 7px; font-size: .86rem; margin-bottom: 1.2rem; overflow-wrap: anywhere; }
.notice.error, .form-error { color: var(--error); }
.notice.success { color: var(--success); }
.form-error { font-size: .86rem; }
.settings-section { padding: 1.8rem 0; display: grid; gap: 1rem; border-top: 1px solid var(--line); scroll-margin-top: 1.25rem; }
.section-number { color: var(--muted); font-size: .76rem; margin-bottom: .6rem; }
.section-intro > p:not(.section-number):not(.hint):not(.test-result) { color: var(--muted); font-size: .86rem; max-width: 34rem; }
.section-fields { min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 1.2rem; }
label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .5rem; }
input:not([type=checkbox]), textarea, select { display: block; width: 100%; min-height: 44px; border: 1px solid var(--control); border-radius: 6px; background: var(--input); color: var(--text); padding: .7rem .8rem; line-height: 1.45; margin-bottom: 1.15rem; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:disabled, textarea:disabled, select:disabled { color: var(--muted); background: #222a35; cursor: not-allowed; }
textarea { resize: vertical; min-height: 95px; overflow-wrap: anywhere; }
input + .hint, textarea + .hint { margin-top: -.7rem; }
.field-heading { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.field-heading label { margin-bottom: .3rem; }
.field-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin: -.25rem 0 1rem; }
.field-pair { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.toggle-row label { margin-bottom: .2rem; }
.toggle-row .hint { margin: 0; }
input[type=checkbox] { accent-color: var(--blue); width: 22px; height: 22px; flex-shrink: 0; cursor: pointer; }
input[role=switch] { appearance: none; position: relative; width: 52px; height: 44px; border: 0; border-radius: 0; background: transparent; padding: 0; }
input[role=switch]::before { display: block; content: ""; position: absolute; left: 4px; top: 9px; width: 44px; height: 26px; border: 1px solid var(--control); border-radius: 20px; background: var(--input); }
input[role=switch]::after { display: block; content: ""; position: absolute; left: 9px; top: 14px; width: 16px; height: 16px; background: var(--muted); border-radius: 50%; }
input[role=switch]:checked::before { background: var(--blue); border-color: var(--accent); }
input[role=switch]:checked::after { background: white; transform: translateX(18px); }
.toggle-row:has(input[role=switch]) { min-height: 76px; }
.state-block { margin: 1.1rem 0; border-left: 2px solid var(--control); padding-left: .8rem; color: var(--muted); font-size: .82rem; }
.state-block.ready { border-color: var(--success); }
.test-result { font-size: .82rem; margin: .7rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
.test-result.error { color: var(--error); }
.save-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .8rem 1.2rem; padding: 1rem 0 1.8rem; }
.save-bar p { margin: 0; font-size: .82rem; color: var(--muted); flex: 1; }
.inline-checks { display: flex; flex-wrap: wrap; gap: .8rem 1.6rem; margin-bottom: 1rem; }
.inline-checks label { min-height: 44px; display: inline-flex; align-items: center; gap: .65rem; margin: 0; cursor: pointer; }
.answer-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--line); margin-top: 1.5rem; }
.answer-box { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1rem; background: var(--input); border-radius: 6px; min-height: 115px; color: var(--muted); font-size: .9rem; margin: .7rem 0; }
.answer-box.has-answer { color: var(--text); }
.compact-facts { margin: 1.5rem 0; font-size: .8rem; }
.compact-facts > div { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: .5rem; }
.compact-facts dt { color: var(--muted); min-width: 105px; }
.compact-facts dd { margin: 0; overflow-wrap: anywhere; }
#password-form .button { margin-top: .5rem; }
.page-footer { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .6rem 1rem; justify-content: space-between; padding: 1.2rem 0; color: var(--muted); font-size: .75rem; }
@media (min-width: 650px) {
  .workspace { padding: 2rem 2rem 2.5rem; }
  .sidebar { padding: 1.2rem 2rem; }
  nav { display: flex; flex-wrap: wrap; gap: .3rem; }
  .sidebar-caption { margin-top: .7rem; }
  .section-fields { padding: 1.6rem; }
  .settings-section { grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: 2rem; padding: 2.2rem 0; }
  .header-status { align-self: flex-end; padding-bottom: .25rem; }
}
@media (min-width: 1100px) {
  .app-shell { display: grid; grid-template-columns: 225px minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; height: 100dvh; padding: 2rem 1.25rem; border-right: 1px solid var(--line); border-bottom: 0; display: flex; flex-direction: column; }
  .sidebar-caption { margin-top: 2.8rem; }
  nav { display: grid; grid-template-columns: 1fr; }
  .sidebar-bottom { margin-top: auto; display: block; }
  .account-row { justify-content: space-between; margin-top: .5rem; }
  .workspace { padding: 2.5rem clamp(2rem, 4vw, 4rem) 2rem; }
  .settings-section { grid-template-columns: minmax(190px, .85fr) minmax(0, 1.5fr); gap: 2.5rem; }
  .page-header { margin-bottom: 2rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
