/* Your account: the SQL panel. Extends ../styles.css (tokens, nav, .btn, .field, .err); nothing here
   is loaded from anywhere but this origin. No inline styles in index.html: the site's CSP can drop
   'unsafe-inline' for styles without touching this page. */

body.app { font-size: 15px; }
.app .wrap { max-width: 1536px; padding-bottom: 40px; }
.app nav.top { margin-bottom: 28px; }
.app nav.top ul { gap: 28px; }
.app .brand { font-size: 28px; }
.app .brand svg { width: 38px; height: 30px; }

.app h1 { font-size: 40px; margin: 0 0 6px; }
.app h2 { font-size: 22px; margin: 0 0 14px; max-width: none; }
.app h3 { font-size: 17px; margin: 0 0 10px; }
.app .lede { font-size: 17px; margin: 0 0 22px; max-width: 70ch; }

.hidden { display: none !important; }

/* sign-in */
.signin { max-width: 560px; }
.signin .field input { font-family: var(--mono); font-size: 14px; }
.signin details { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.signin summary { cursor: pointer; }

/* account bar */
.acct { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: 10px; background: #fff; padding: 10px 16px; margin: 0 0 20px; font-size: 14px; }
.acct .who { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); }
.acct .spacer { flex: 1; }
.acct .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); display: inline-block; margin-right: 6px; vertical-align: -1px; }
.acct .dot.ok { background: var(--ok); }
.acct .dot.warn { background: var(--accent); }

/* layout */
.panel-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.side { border: 1px solid var(--rule); border-radius: 10px; background: #fff; padding: 16px 18px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.side h3 { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 14px 0 8px; }
.side h3:first-child { margin-top: 0; }
.tree { list-style: none; margin: 0; padding: 0; }
.tree li { margin: 0; }
.tree .ns { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); margin: 8px 0 3px; }
.tree button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 5px 8px; border-radius: 6px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.tree button:hover { background: var(--bg-soft); }
.tree button.on { background: var(--tint); color: var(--accent-deep); }
.tree button small { color: var(--muted); font-family: var(--mono); font-size: 11px; margin-left: 6px; }
.side .empty { color: var(--muted); font-size: 13.5px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin: 0 0 18px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 14px; font: inherit; font-size: 15px; color: var(--ink-soft); cursor: pointer; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tab { display: none; }
.tab.on { display: block; }

.box { border: 1px solid var(--rule); border-radius: 10px; background: #fff; padding: 18px 20px; margin: 0 0 18px; }
.box.tight { padding: 12px 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }
.right { margin-left: auto; }

/* SQL */
.status { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.status b { color: var(--ink); font-weight: 500; }
textarea.sql { width: 100%; min-height: 150px; resize: vertical; font-family: var(--mono); font-size: 13.5px; line-height: 1.5; color: var(--code); background: var(--dark); border: 1px solid var(--dark-2); border-radius: 8px; padding: 14px 16px; }
textarea.sql:focus { outline: 2px solid var(--accent); }
.btn.sm { font-size: 17px; padding: 8px 18px; }
.btn.xs { font-family: var(--sans); font-size: 13.5px; padding: 6px 12px; border-radius: 6px; }
.btn.ghost.xs { border-color: var(--rule); color: var(--ink-soft); }
.btn.ghost.xs:hover { background: var(--bg-soft); }
.btn.danger { background: transparent; color: var(--accent-deep); border: 1px solid var(--accent); }
.btn.danger:hover { background: var(--tint); }
input.num { width: 90px; padding: 7px 10px; font: inherit; font-size: 14px; border: 1px solid var(--rule); border-radius: 6px; }
label.inl { font-size: 13.5px; color: var(--ink-soft); display: inline-flex; gap: 8px; align-items: center; }

.results { overflow: auto; max-height: 60vh; border: 1px solid var(--rule); border-radius: 8px; }
.results table { border-collapse: separate; border-spacing: 0; font-size: 13px; font-family: var(--mono); min-width: 100%; }
.results th, .results td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.results th { position: sticky; top: 0; background: var(--bg-soft); font-weight: 500; color: var(--ink-soft); }
.results th small { display: block; color: var(--muted); font-weight: 400; font-size: 10.5px; }
.results td.num { text-align: right; }
.results td.null { color: var(--muted); font-style: italic; }
.results tr:last-child td { border-bottom: 0; }

.err { display: none; }
.err.on { display: block; }
.err pre { margin: 8px 0 0; font-size: 12px; white-space: pre-wrap; word-break: break-word; color: var(--ink-soft); }
.note { border-left: 3px solid var(--ok); background: #eef8f1; color: var(--ok-text); padding: 10px 14px; border-radius: 4px; font-size: 14px; margin: 0 0 14px; }
.note.warn { border-left-color: var(--accent); background: var(--tint); color: var(--accent-deep); }

pre.code { font-size: 12.5px; }
pre.code.wrap { white-space: pre-wrap; word-break: break-all; }
.once { border: 1px dashed var(--accent); background: var(--tint); border-radius: 8px; padding: 12px 14px; margin: 12px 0 0; }
.once b { display: block; margin-bottom: 6px; color: var(--accent-deep); }

/* forms */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; margin: 0 0 12px; }
.field { margin: 0; }
.field input, .field select { width: 100%; padding: 9px 12px; font: inherit; font-size: 14px; color: var(--ink); background: #fff; border: 1px solid var(--rule); border-radius: 7px; }
.field select[multiple] { min-height: 74px; }
.cols { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 14px; }
.cols td { padding: 4px 6px 4px 0; }
.cols input, .cols select { width: 100%; padding: 7px 10px; font: inherit; font-size: 13.5px; border: 1px solid var(--rule); border-radius: 6px; }
.cols td.req { text-align: center; width: 80px; }
.cols td.rm { width: 36px; }
.cols button.rm { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }

table.plain.small { font-size: 14px; }
table.plain.small th, table.plain.small td { padding: 8px 12px 8px 0; }
table.plain.small td:first-child { font-family: var(--mono); font-size: 13px; }
table.plain .mono { font-family: var(--mono); font-size: 12.5px; }
table.plain td .btn.xs { margin-left: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; margin: 0 0 14px; }
.kv dt { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; align-self: center; }
.kv dd { margin: 0; font-family: var(--mono); font-size: 13px; word-break: break-all; }

footer.app-foot { margin-top: 40px; border-top: 1px solid var(--rule); padding-top: 18px; font-size: 13px; color: var(--muted); }

@media (max-width: 1000px) {
  .panel-grid { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .app .wrap { padding-left: 20px; padding-right: 20px; }
}

/* the shortcut hint inside the orange Run button */
.btn .muted { color: rgba(255, 255, 255, .78); }

/* sign-in and first-login screens (2026-09-20: OpenID Connect first, the API key a fold-out) */
.signin .row { margin: 0 0 14px; }
.signin .btn.ghost { color: var(--ink); border-color: var(--ink); }
.signin-note { margin: 0 0 22px; }
.signin details form { margin-top: 12px; }
.handle { display: flex; align-items: center; border: 1px solid var(--rule); border-radius: 7px; background: #fff; overflow: hidden; }
.handle .pre { font-family: var(--mono); font-size: 13px; color: var(--muted); padding: 0 0 0 12px; white-space: nowrap; }
.handle input { border: 0 !important; border-radius: 0 !important; font-family: var(--mono); font-size: 14px; padding-left: 4px !important; }
.handle input:focus { outline: none !important; }
.handle.taken { border-color: var(--accent); }
.handle.free { border-color: var(--ok); }

/* sidebar organisation picker */
.orgpick { font-size: 14px; margin: 0 0 6px; }
.orgpick select { width: 100%; padding: 6px 8px; font: inherit; font-size: 14px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
.orgpick .h { font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; }

/* levels, roles, bars */
.lvl { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; border: 1px solid var(--rule); color: var(--ink-soft); }
.lvl.write { border-color: var(--ok); color: var(--ok-text); }
.lvl.read { border-color: var(--rule); }
.lvl.none, .lvl.unknown { color: var(--muted); border-style: dashed; }
.lvl.admin { border-color: var(--accent); color: var(--accent-deep); }
.bar { height: 10px; background: var(--bg-soft); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; margin: 6px 0 4px; }
.bar i { display: block; height: 100%; background: var(--ok); }
.bar.warn i { background: var(--accent); }
.bar.over i { background: var(--accent-deep); }
.meter { margin: 0 0 16px; }
.meter .row { font-size: 14px; }
.meter .row b { font-weight: 500; }
table.plain.small select { padding: 4px 8px; font: inherit; font-size: 13.5px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
table.grants td, table.grants th { text-align: center; }
table.grants td:first-child, table.grants th:first-child { text-align: left; }

/* danger zone */
.danger-zone { border-color: var(--accent); }
.danger-zone h2 { color: var(--accent-deep); }
.danger-zone p { font-size: 14.5px; }
.btn.danger.sm { font-family: var(--sans); font-size: 15px; padding: 9px 16px; }
.btn.danger[disabled] { opacity: .45; }

/* "this deployment does not serve that route yet" */
.notyet { border-left: 3px solid var(--rule); background: var(--bg-soft); color: var(--ink-soft); padding: 10px 14px; border-radius: 4px; font-size: 14px; margin: 0 0 14px; }
.notyet code { font-size: 12.5px; }

/* the login flow pages served by this file (docs/login.md): /app/welcome, /app/reset, /app/forgot, /app/device */
.signin form .field input[type=email], .signin form .field input[type=password], .signin form .field input[type=text] { font-family: var(--sans); font-size: 15px; }
.signin .field .hint a { color: var(--ink-soft); }
.signin .check { margin: 0 0 16px; font-size: 14px; }
.signin .terms { margin: 0 0 16px; }
.signin #idp-row { margin: 0 0 18px; }
.signin .sub { font-size: 17px; color: var(--ink-soft); max-width: 60ch; }
.signin .notyet { max-width: 60ch; }
input.usercode { font-family: var(--mono) !important; font-size: 22px !important; letter-spacing: .18em; text-transform: uppercase; max-width: 260px; }

/* the device consent screen (docs/agent-setup.md): what approving connects, and the level the person may lower */
.consent { margin: 0 0 16px; }
.consent .kv dd { font-family: var(--sans); font-size: 15px; }
.consent .kv dd b { font-weight: 600; }
.levels, .choices { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px 4px; margin: 0 0 14px; }
.levels legend, .choices legend { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; padding: 0 6px; }
.levels .check, .choices .check { margin: 0 0 10px; font-size: 14.5px; }
.levels .hint { margin: 0 0 8px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-deep); text-decoration: underline; cursor: pointer; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#signup-inline .sub { margin: 0 0 14px; font-size: 15px; }
/* "Continue in your agent": the prompt a person pastes; no credential in it */
.continue { border-color: var(--accent); background: var(--tint); }
.continue h2 { color: var(--accent-deep); }
.continue .prompt { background: #fff; color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; margin: 0 0 12px; white-space: pre-wrap; word-break: normal; }
.continue .form-row { max-width: 320px; }
