/* Launchpad Databases: the same quiet, monochrome look as Launchpad's dashboard. Colour is for status. */

@font-face { font-family: "Geist"; src: url("/vendor/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/vendor/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #fafafa; --panel: #fff; --panel-2: #f5f5f5; --hover: #f2f2f2; --border: #eaeaea; --border-strong: #d4d4d4;
  --text: #171717; --muted: #666; --subtle: #8f8f8f; --primary: #171717; --primary-text: #fff; --link: #0068d6; --focus: #0068d6;
  --ok: #18a058; --ok-text: #107a42; --ok-soft: #e9f8ef; --warn: #f5a623; --warn-text: #a35c00; --warn-soft: #fff6e6;
  --bad: #e5484d; --bad-text: #c4292e; --bad-soft: #fdeced; --info-text: #0058b4; --info-soft: #ebf3ff;
  --code-bg: #0a0a0a; --code-text: #d4d4d4; --radius: 8px; --radius-lg: 12px; --shadow: 0 1px 2px rgba(0,0,0,.04);
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a; --panel: #0a0a0a; --panel-2: #111; --hover: #171717; --border: #1f1f1f; --border-strong: #2e2e2e;
    --text: #ededed; --muted: #a1a1a1; --subtle: #707070; --primary: #ededed; --primary-text: #0a0a0a; --link: #52a8ff; --focus: #52a8ff;
    --ok: #3dd68c; --ok-text: #4ade80; --ok-soft: #0d2a1b; --warn-text: #fbbf24; --warn-soft: #2b1f08; --bad: #ff6166; --bad-text: #ff8085; --bad-soft: #2d1012;
    --info-text: #52a8ff; --info-soft: #0b1d33; --code-bg: #111; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 13px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--border); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--primary); color: var(--primary-text); display: grid; place-items: center; }
nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
nav a:hover { color: var(--text); background: var(--hover); text-decoration: none; }
nav a.on { color: var(--text); font-weight: 500; }
.who { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; white-space: nowrap; }

main { max-width: 1120px; margin: 0 auto; padding: 32px 24px 80px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.head .sub { color: var(--muted); margin-top: 4px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 16px; }
.muted { color: var(--muted); }
.xs { font-size: 12px; }
.sm { font-size: 13px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.grid + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: var(--panel); color: var(--text); font: 500 13px var(--sans); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--bad-text); }
.btn.small { height: 26px; padding: 0 8px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; }
.field > small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
input, select, textarea { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel); color: var(--text); font: 14px var(--sans); }
textarea { height: auto; padding: 8px 10px; }
input[type=checkbox], input[type=radio] { width: auto; height: auto; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.choice { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; display: block; }
.choice input { display: none; }
.choice:has(input:checked) { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.choice.off { opacity: .5; cursor: default; }
.choice b { display: block; font-weight: 600; }
.choice span { color: var(--muted); font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok-text); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad-text); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info-text); border-color: transparent; }

.list { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); overflow: hidden; }
.list > .item { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--border); color: var(--text); }
.list > .item:first-child { border-top: 0; }
a.item:hover { background: var(--hover); text-decoration: none; }
.item .name { font-weight: 600; }
.item .meta { color: var(--muted); font-size: 13px; }
.group-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 28px 0 10px; }
.group-title:first-child { margin-top: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-color: var(--text); font-weight: 500; }

.copy { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 6px 6px 10px; }
.copy code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
pre.log { background: var(--code-bg); color: var(--code-text); border-radius: var(--radius); padding: 12px 14px; font: 12px/1.6 var(--mono); max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }
.callout { border: 1px solid var(--border); border-left: 3px solid var(--warn); background: var(--warn-soft); color: var(--text); border-radius: var(--radius); padding: 12px 14px; }
.callout.info { border-left-color: var(--link); background: var(--info-soft); }
.callout.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty h2 { color: var(--text); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; }
.bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--text); border-radius: 3px; }
.bar > i.warn { background: var(--warn); }
.bar > i.bad { background: var(--bad); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--primary); color: var(--primary-text); padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 20; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); color: #fff; }
dialog { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); color: var(--text); padding: 24px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 8px 30px rgba(0,0,0,.12); }
dialog::backdrop { background: rgba(0,0,0,.4); }

@media (max-width: 720px) {
  .top-in { padding: 10px 16px 0; gap: 4px 12px; height: auto; flex-wrap: wrap; }
  .top-in .who { margin-left: auto; }
  nav { order: 3; flex-basis: 100%; margin: 0 -10px; }
  .who .name { display: none; }
  main { padding: 20px 16px 64px; }
  .fields-2 { grid-template-columns: 1fr; }
  .list > .item { flex-wrap: wrap; gap: 8px 12px; }
}
