/* 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); }

/* small screens (tester 2026-09-21, item 4: horizontal overflow at 390 px, the onboarding card and the sidebar
   clipped). A grid child may shrink below its content (min-width: 0; `1fr` alone means minmax(auto, 1fr), whose
   minimum is the content), a table wider than its box scrolls inside the box, long identifiers wrap. */
.panel-grid > * { min-width: 0; }
.box, .side { min-width: 0; overflow-x: auto; }
.acct .who { overflow-wrap: anywhere; }
.handle input { min-width: 0; }
.kv { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
.once-row { align-items: flex-start; gap: 8px; }
.once-row pre.code { margin: 0; flex: 1; min-width: 0; }
@media (max-width: 1000px) {
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; }
  .app .wrap { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 640px) {
  .app .wrap { padding-left: 14px; padding-right: 14px; }
  .app h1 { font-size: 32px; }
  .app nav.top ul { gap: 8px 16px; }
  .tabs button { padding: 8px 10px; font-size: 14px; }
  .newcat input { width: 100%; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .results th, .results td { max-width: 240px; }
  .cathead h2 { font-size: 22px; }
}

/* 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; }

/* the Catalogs tab, 2026-09-20 night: a list view and a catalog view (Connect · Tables · Access · Settings) */
.newcat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--rule); }
.newcat label { font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.newcat input { width: 220px; padding: 7px 10px; font: inherit; font-family: var(--mono); font-size: 13.5px; border: 1px solid var(--rule); border-radius: 6px; }
.newcat .hint { flex-basis: 100%; font-size: 13px; color: var(--muted); margin: 0; }
.newcat .hint code { font-size: 12px; }
table.catalogs a.catname { color: var(--ink); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--rule); }
table.catalogs a.catname:hover { color: var(--accent-deep); border-bottom-color: var(--accent); }
.crumbs { margin: 0 0 8px; font-size: 14px; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--accent-deep); }
.cathead { margin: 0 0 12px; }
.cathead h2 { margin: 0; font-size: 26px; }
.cathead .lvl { vertical-align: middle; }
.tabs.sub { margin: 0 0 16px; }
.tabs.sub button { font-size: 14px; padding: 6px 12px; }
.cvsec[role=tabpanel] { display: none; }
.cvsec[role=tabpanel].on { display: block; }
.recipe { margin: 0 0 12px; }
.recipe .row { margin: 0 0 4px; }
.recipe pre.code { margin: 0; }
details.fold { margin: 12px 0 0; border-top: 1px solid var(--rule); padding-top: 10px; font-size: 14px; }
details.fold summary { cursor: pointer; color: var(--ink-soft); font-weight: 500; }
details.fold[open] summary { margin-bottom: 10px; }
details.fold .kv dd { font-family: var(--mono); font-size: 12.5px; }

/* The login card (2026-09-22, the LakehouseBox mockup): slim header, one centred white card, slim footer.
   Every view carrying .signin (welcome, reset, forgot, device, authorize, onboard) inherits the card; only the
   login view has the centred head (.lg-head). The ids app.js looks up are unchanged; #key-details is now the
   "Advanced connection options" fold (the API address and the API key), which the script opens when the login
   route is missing. .lg-* classes are the login redesign's own. */
.lg-top { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; min-height: 72px; margin-bottom: 56px; flex-wrap: wrap; }
.lg-new { margin: 0; font-size: 16px; color: var(--ink-soft); }
.lg-new a { display: inline-block; padding: 10px 0; color: var(--accent); font-weight: 500; border-bottom: 0; }
.lg-new a:hover { color: var(--accent-deep); }
/* signed in (the panel, or the first-login step): the invitation to create an account goes, the header tightens */
body:has(#panel:not(.hidden)) .lg-new, body:has(#onboard:not(.hidden)) .lg-new { display: none; }
body:has(#panel:not(.hidden)) .lg-top { margin-bottom: 28px; }

.signin { max-width: 560px; margin: 0 auto; background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 36px 40px 30px; box-shadow: 0 18px 50px rgba(26, 25, 23, .06), 0 1px 3px rgba(26, 25, 23, .05); }
.lg-head { text-align: center; margin: 0 0 28px; }
.lg-head .lg-mark { display: block; width: 40px; height: 40px; margin: 0 auto 18px; }
.app .lg-head h1 { font-size: 44px; font-weight: 500; letter-spacing: -.03em; line-height: 1.05; margin: 0 0 10px; }
.lg-head .sub { font-family: var(--sans); font-size: 17.5px; line-height: 1.45; color: var(--ink-soft); margin: 0; max-width: none; }

.signin .field { margin: 0 0 20px; }
.signin .field label { font-size: 15.5px; font-weight: 500; color: var(--ink); margin-bottom: 8px; }
.signin .field input { min-height: 48px; border-radius: 8px; border-color: #d9d2c8; }
.signin .field input::placeholder { color: #a39b93; }
.lg-labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.lg-labelrow label { margin: 0; }
.lg-labelrow a { font-size: 14.5px; font-weight: 500; color: var(--accent); padding: 10px 0; margin: -10px 0; }
.lg-labelrow a:hover { color: var(--accent-deep); }
/* the eye: a 44px button inside the field that flips the input between password and text (app.js, eyeToggle) */
.lg-pw { position: relative; }
.lg-pw input { padding-right: 54px; }
.lg-eye { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 7px; color: var(--ink-soft); cursor: pointer; padding: 0; }
.lg-eye:hover { color: var(--ink); background: var(--bg-soft); }
.lg-eye .eye-off { display: none; }
.lg-eye[aria-pressed="true"] .eye-on { display: none; }
.lg-eye[aria-pressed="true"] .eye-off { display: inline; }
.signin .btn.lg-submit { width: 100%; justify-content: center; background: var(--accent); font-family: var(--sans); font-size: 17.5px; font-weight: 600; min-height: 56px; border-radius: 9px; margin: 4px 0 0; }
.signin .btn.lg-submit:hover { background: var(--accent-deep); }
.lg-stay { text-align: center; font-size: 13.5px; color: var(--muted); margin: 14px 0 0; }
.signin #idp-row { margin: 18px 0 0; flex-direction: column; align-items: stretch; }
.signin #idp-row .btn { justify-content: center; }
.signin #idp-row .small { text-align: center; }
/* the fold: the API address (self-hosted deployments) and the API key */
.signin details.lg-adv { margin: 24px 0 0; padding-top: 6px; border-top: 1px solid var(--rule); font-size: 14.5px; color: var(--ink-soft); }
.lg-adv summary { display: flex; align-items: center; gap: 12px; min-height: 44px; list-style: none; cursor: pointer; font-size: 15.5px; font-weight: 500; color: var(--ink); }
.lg-adv summary::-webkit-details-marker { display: none; }
.lg-adv summary::before { content: ""; flex: none; width: 8px; height: 8px; margin: -4px 4px 0; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); transition: transform .15s; }
.lg-adv[open] summary::before { transform: rotate(-135deg); margin-top: 4px; }
.lg-adv-body { padding: 8px 0 0; }
.lg-adv-body .field label { font-size: 14.5px; }
.lg-adv-body .field label .muted { font-weight: 400; }
.lg-adv-body form { margin: 0; }
.lg-adv-body .btn.sm.ghost { font-family: var(--sans); font-size: 15px; min-height: 44px; }
.lg-help { text-align: center; margin: 24px 0 0; font-size: 16px; color: var(--ink-soft); }
.lg-help a { display: inline-block; padding: 10px 0; color: var(--accent); font-weight: 500; border-bottom: 0; }
.lg-help a:hover { color: var(--accent-deep); }
/* the other views keep their own head: an eyebrow, a heading, a lede, inside the same card */
.signin .eyebrow { margin-bottom: 14px; }
.signin > h1 { font-size: 34px; margin: 0 0 10px; }
.signin .lede { font-size: 16px; margin: 0 0 20px; }

footer.lg-foot { margin-top: 72px; border-top: 1px solid var(--rule); padding: 24px 0 36px; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
footer.lg-foot p { margin: 0; max-width: none; }
.lg-foot-brand { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -.02em; color: var(--ink); border-bottom: 0; }
.lg-op { display: block; font-size: 12.5px; margin-top: 2px; }
footer.lg-foot ul { gap: 6px 24px; }
footer.lg-foot ul a { padding: 12px 0; }
footer.lg-foot ul a:hover { color: var(--ink); }

@media (max-width: 640px) {
  .lg-top { min-height: 60px; margin-bottom: 24px; }
  .lg-new { font-size: 15px; }
  .signin { padding: 26px 18px 20px; border-radius: 12px; }
  .app .lg-head h1 { font-size: 34px; }
  .lg-head .sub { font-size: 16.5px; }
  .signin > h1 { font-size: 30px; }
  footer.lg-foot { margin-top: 48px; justify-content: center; text-align: center; }
  footer.lg-foot ul { justify-content: center; }
}
