/* Knowledge Core. Quiet, monochrome, built for people who read numbers all day.
   One ink colour, thin lines, small spaced labels. Colour is kept for meaning only
   (good / needs attention / problem) and for chart series. */
:root {
  --bg: #ffffff;
  --side: #fafafa;
  --soft: #f5f5f5;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --line: #e5e5e5;
  --line-strong: #cfcfcf;
  --good: #1f7a4d;
  --good-soft: #edf6f1;
  --warn: #9a5b00;
  --warn-soft: #fbf3e4;
  --bad: #b3261e;
  --bad-soft: #fbeeed;
  --radius: 8px;
  --font: "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
button { font: inherit; cursor: pointer; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.boot { padding: 40px; color: var(--muted); }
svg.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* the small spaced label used for every section heading */
.label { font-family: var(--mono); font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.wordmark { font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); flex: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  padding: 8px 14px; border-radius: var(--radius); font-size: 14px; line-height: 1.3; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--line-strong); background: var(--soft); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; border-color: #000; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--soft); color: var(--ink); }
.btn.small { padding: 4px 11px; font-size: 13px; border-radius: 999px; }
.btn.icon-only { padding: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #991f18; border-color: #991f18; }

/* dialogs */
.dlg { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(480px, calc(100vw - 32px)); color: var(--ink); background: var(--bg); box-shadow: 0 24px 60px -20px rgba(0,0,0,.35); }
.dlg::backdrop { background: rgba(0,0,0,.32); }
.dlg-in { padding: 24px; }
.dlg h2 { margin: 0 0 6px; font-size: 18px; font-weight: 500; }
.dlg p { margin: 0 0 16px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.dlg .field { margin-bottom: 14px; }
.dlg .field textarea { resize: vertical; line-height: 1.5; }
.dlg .error:empty { display: none; }
.dlg .error { margin-bottom: 4px; }
.dlg .checks { flex-direction: column; gap: 8px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* notices and empty states */
.notice { border: 1px solid var(--line); background: var(--side); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; color: var(--muted); }
.notice.warn { border-color: #ecd9b4; background: var(--warn-soft); color: #6b4300; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); text-decoration: none; margin-bottom: 14px; }
.back:hover { color: var(--ink); }

/* form fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.field input, .field textarea, .field select { border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px; background: var(--bg); min-width: 0; }
.field input, .field select { height: 40px; }
.row > .btn { height: 40px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--ink); }
.field input::placeholder, .toolbar input::placeholder, .composer textarea::placeholder, .correction input::placeholder { color: var(--faint); }
.field textarea { height: auto; }
.error { color: var(--bad); font-size: 14px; min-height: 20px; }

/* login */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-side { background-color: #0d0d0d; color: #f5f5f5; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 56px 56px; }
.login-side .label { color: #7d7d7d; }
.login-side .wordmark { font-size: 15px; color: #fff; }
.login-side h1 { margin: 14px 0 0; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.12; font-weight: 400; letter-spacing: -.02em; color: #fff; max-width: 14em; }
.login-side h1 span { color: #8f8f8f; }
.caps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; max-width: 560px; }
.caps li { border-top: 1px solid rgba(255,255,255,.16); padding-top: 12px; font-size: 14px; color: #c9c9c9; line-height: 1.45; }
.caps li b { display: block; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .12em; color: #7d7d7d; margin-bottom: 6px; }
.login-main { display: grid; place-items: center; padding: 40px 24px; }
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login-form h2 { margin: 6px 0 6px; font-size: 26px; font-weight: 400; letter-spacing: -.01em; }
.login-form .btn.primary { padding: 11px 14px; margin-top: 2px; }
.login-help { margin: 18px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.demo-users { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.demo-users .label { display: block; margin-bottom: 10px; }
.demo-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.demo-user { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  background: var(--bg); padding: 10px 12px; font-size: 14px; }
.demo-user:last-child { border-bottom: 0; }
.demo-user:hover { background: var(--soft); }
.demo-user b { font-weight: 500; }
.demo-user small { color: var(--muted); font-size: 12.5px; }
.demo-user svg { color: var(--faint); }

/* shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 0 10px; }
.brand { padding: 18px 8px 14px; font-size: 13.5px; }
.brand a { color: var(--ink); text-decoration: none; }
.new-btn { width: 100%; background: var(--bg); border-radius: 10px; padding: 9px 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius); color: var(--muted); font-size: 14.5px; text-decoration: none; }
.nav a svg { width: 17px; height: 17px; }
.nav a:hover { background: #f0f0f0; color: var(--ink); }
.nav a.active { background: #efefef; color: var(--ink); font-weight: 500; }
.nav .badge { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 1px 7px; font-weight: 400; }
.recent { flex: 1; overflow: auto; min-height: 0; margin-top: 12px; padding: 14px 0 10px; border-top: 1px solid var(--line); }
.recent .label { display: block; margin: 0 10px 8px; }
.rc { display: flex; align-items: center; border-radius: 7px; }
.rc a { flex: 1; min-width: 0; padding: 6px 4px 6px 10px; color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.rc button { border: 0; background: none; padding: 5px; margin-right: 4px; border-radius: 6px; color: var(--faint); display: grid; opacity: 0; }
.rc button svg { width: 13px; height: 13px; }
.rc:hover, .rc.active { background: #efefef; }
.rc:hover a, .rc.active a { color: var(--ink); }
.rc:hover button, .rc button:focus-visible { opacity: 1; }
.rc button:hover { background: #e2e2e2; color: var(--ink); }
.rc-none { margin: 0 10px; font-size: 13px; color: var(--faint); }
@media (hover: none) { .rc button { opacity: 1; } }
.me { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; padding: 12px 10px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.me > svg { color: var(--faint); }
.me:hover .me-who b, .me.active .me-who b { text-decoration: underline; text-underline-offset: 3px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 500; font-size: 12px; letter-spacing: .03em; flex: none; }
.me-who { min-width: 0; flex: 1; line-height: 1.3; }
.me-who b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-who small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar.big { width: 52px; height: 52px; font-size: 17px; }
.account-id { display: flex; align-items: center; gap: 16px; }
.account-id h1 { margin-bottom: 0; }
.page.narrow { max-width: 820px; }
.access { border: 1px solid var(--line); border-radius: var(--radius); }
.access > div { display: flex; gap: 16px; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.access > div:last-child { border-bottom: 0; }
.access .code { font-family: var(--mono); font-size: 12.5px; color: var(--muted); min-width: 44px; }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 28px; height: 54px; flex: none; }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.topbar .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 16px; flex: none; }
#topActions:empty { display: none; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.status .label { color: var(--muted); }
.view { flex: 1; min-height: 0; overflow: auto; }
.page { max-width: 1080px; width: 100%; margin: 0 auto; padding: 22px 28px 72px; }
.page h1 { font-size: 30px; line-height: 1.2; font-weight: 400; letter-spacing: -.02em; margin: 6px 0 8px; }
.page .sub { color: var(--muted); margin: 0 0 26px; max-width: 46em; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.head-actions { display: flex; gap: 8px; flex: none; padding-top: 26px; }
.empty.rich { padding: 56px 24px; }
.empty.rich b { display: block; font-size: 16px; font-weight: 500; color: var(--ink); margin-top: 14px; }
.empty.rich p { margin: 6px auto 0; max-width: 34em; }
.empty.rich .btn { margin-top: 18px; }
.empty-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--side); color: var(--muted); }
.empty-icon svg { width: 19px; height: 19px; }
.menu-toggle { display: none; }

/* chat */
.chat { display: flex; flex-direction: column; height: 100%; }
.thread { flex: 1; overflow: auto; min-height: 0; }
.thread-inner { max-width: 840px; margin: 0 auto; padding: 12px 28px 24px; }
.thread-inner.blank { min-height: 100%; display: flex; align-items: center; justify-content: center; }
.hello { text-align: center; padding: 24px 0 48px; }
.hello .wordmark { font-size: 19px; }
.hello h1 { font-size: 15px; font-weight: 400; color: var(--muted); margin: 14px 0 2px; }
.hello p { color: var(--muted); margin: 0 0 22px; }
.suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 720px; margin: 0 auto; }
.suggest button { text-align: left; border: 1px solid var(--line); background: var(--side); border-radius: 18px; padding: 6px 14px; color: var(--ink); font-size: 13.5px; line-height: 1.4; transition: background .15s, border-color .15s; }
.suggest button:hover { border-color: var(--ink); background: var(--bg); }
.msg { margin: 22px 0; }
.msg.user .bubble { margin-left: auto; max-width: 75%; background: var(--soft); color: var(--ink); padding: 10px 16px; border-radius: 18px 18px 4px 18px; width: fit-content; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant .card { padding: 0; }
.msg.assistant .who { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.md { overflow-wrap: anywhere; }
.md p { margin: 0 0 10px; }
.md h1, .md h2, .md h3 { font-size: 15.5px; font-weight: 600; margin: 18px 0 6px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md table { border-collapse: collapse; margin: 8px 0 12px; font-size: 13.5px; display: block; overflow-x: auto; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 6px 12px 6px 0; text-align: left; }
.md th { font-weight: 500; color: var(--muted); border-bottom-color: var(--line-strong); }
.md code { font-family: var(--mono); font-size: 12.5px; background: var(--soft); padding: 1px 5px; border-radius: 4px; }
.md > :last-child { margin-bottom: 0; }
.steps { margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.steps > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; user-select: none; list-style: none; font-size: 13px;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 8px; }
.steps > summary::-webkit-details-marker { display: none; }
.steps > summary:hover { border-color: var(--line-strong); color: var(--ink); }
.steps > summary svg { width: 13px; height: 13px; transition: transform .15s; }
.steps[open] > summary svg { transform: rotate(90deg); }
.steps-body { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; background: var(--side); }
.steps-body > p { margin: 0 0 14px; color: var(--muted); }
.steps ol { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 14px 34px; color: var(--ink); line-height: 1.5; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: 11px; display: grid; place-items: center; color: var(--muted); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 26px; bottom: 4px; width: 1px; background: var(--line-strong); }
.steps li b { font-weight: 500; }
.steps li > span:first-child { color: var(--muted); }
.steps li > span:first-child b { color: var(--ink); }
.steps li.err > span:first-child b { color: var(--muted); }
.steps li .tag { margin-left: 6px; }
.st-tech { margin-top: 4px; font-size: 12.5px; }
.st-tech summary { cursor: pointer; color: var(--faint); width: fit-content; }
.st-tech summary:hover { color: var(--ink); }
.st-tech pre { font-family: var(--mono); font-size: 11.5px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 6px 0 0; white-space: pre-wrap; max-height: 200px; overflow: auto; color: var(--muted); }
.live-steps { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.live-steps div { display: flex; gap: 8px; align-items: center; }
.live-steps span { display: inline-flex; }
.spinner { width: 13px; height: 13px; border: 1.5px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } * { transition: none !important; } }
.chart-box { border: 1px solid var(--line); border-radius: 10px; padding: 16px 16px 8px; margin: 14px 0; background: var(--bg); }
.chart-box h4 { margin: 0 0 2px; font-size: 14px; font-weight: 500; }
.chart-box .y-label { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--faint); }
.chart { width: 100%; height: 300px; margin-top: 6px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chart-head h4 { margin: 0; }
.chart-head .xl { flex: none; padding: 4px 10px; font-size: 12.5px; color: var(--muted); }
.chart-head .xl:hover { color: var(--ink); }
@media print { .chart-head .xl { display: none; } }
.chart-table { overflow: auto; max-height: 320px; margin: 8px 0; }
.chart-table table { border-collapse: collapse; font-size: 13px; width: 100%; }
.chart-table th, .chart-table td { border-bottom: 1px solid var(--line); padding: 6px 10px 6px 0; text-align: left; white-space: nowrap; }
.chart-table th { font-family: var(--mono); font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); position: sticky; top: 0; background: var(--bg); }
.chart-table th { white-space: normal; vertical-align: bottom; line-height: 1.35; min-width: 74px; }
.chart-table th:first-child { min-width: 0; }
.chart-table td:not(:first-child):not(.num) { white-space: normal; }
.chart-table th.num { text-align: right; }
.chart-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.chart-error { color: var(--bad); font-size: 13px; padding: 8px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; align-items: center; }
.actions .note { font-size: 13px; color: var(--good); margin-left: 4px; }
.composer { border-top: 1px solid var(--line); background: var(--bg); flex: none; }
.composer-inner { max-width: 840px; margin: 0 auto; padding: 14px 28px 8px; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 22px; padding: 10px 18px; min-height: 44px; max-height: 180px; background: var(--side); line-height: 1.45; }
.composer textarea:focus { outline: none; border-color: var(--ink); background: var(--bg); }
.composer .btn { border-radius: 999px; padding: 11px 20px; }
.composer .hint { max-width: 840px; margin: 0 auto; padding: 0 28px 12px 46px; font-size: 12px; color: var(--faint); }
.correction { display: flex; gap: 6px; margin-top: 8px; width: 100%; }
.correction input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; min-width: 0; }
.correction input:focus { outline: none; border-color: var(--ink); }

/* brain */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 30px; overflow: hidden; }
.stat { display: flex; flex-direction: column; justify-content: flex-start; padding: 16px 16px 14px; border: 0; border-right: 1px solid var(--line); min-width: 0; background: var(--bg); text-align: left; transition: background .15s; }
.stat:hover { background: var(--side); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-size: 28px; line-height: 1.1; font-weight: 400; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 8px; font-family: var(--mono); font-size: 10.5px; line-height: 1.4; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat.warn b { color: var(--warn); }

.sectabs-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.sectabs { flex: 1; min-width: 0; display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.sectabs::-webkit-scrollbar { display: none; }
.sectabs button { border: 0; background: none; padding: 10px 0 11px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14.5px; white-space: nowrap; }
.sectabs button:hover { color: var(--ink); }
.sectabs button.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.sectabs button span { font-family: var(--mono); font-size: 11px; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--soft); color: var(--muted); font-weight: 400; }
.sectabs button span.warn { background: var(--warn-soft); color: var(--warn); }
.search { position: relative; flex: none; width: 240px; margin-bottom: 8px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 15px; height: 15px; pointer-events: none; }
.search input { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px 0 34px; background: var(--side); font-size: 14px; }
.search input:focus { outline: none; border-color: var(--ink); background: var(--bg); }
.search input::placeholder { color: var(--faint); }
.sec-intro { color: var(--muted); margin: 0 0 18px; max-width: 48em; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tabs button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); }
.tabs button span { font-family: var(--mono); font-size: 11px; margin-left: 3px; opacity: .7; }
.tabs button:hover { border-color: var(--line-strong); color: var(--ink); }
.tabs button.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.k-group { margin-bottom: 30px; }
.k-group-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.k-group-head h2 { font-size: 17px; font-weight: 500; margin: 0; }
.k-group-head span { color: var(--muted); font-size: 13.5px; }
.k-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.k-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.k-row:last-child { border-bottom: 0; }
.k-main { min-width: 0; flex: 1; }
.k-main .label { margin-bottom: 3px; }
.k-main b { font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; }
.k-main p { margin: 4px 0 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.k-row.open .k-main p { display: block; }
.k-more { display: none; border: 0; background: none; padding: 0; margin-top: 4px; font-size: 13px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.k-row.clamped .k-more { display: inline; }
.k-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; flex: none; max-width: 42%; padding-top: 1px; }
.tag { font-size: 11.5px; line-height: 1.5; border-radius: 999px; padding: 1px 9px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.tag.review { background: var(--warn-soft); color: var(--warn); }
.tag.learned { background: var(--good-soft); color: var(--good); }
.tag.conf-hunch { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); }
.tag.conf-observed { background: transparent; border: 1px solid var(--line-strong); color: var(--ink); }
.tag.conf-established { background: var(--good-soft); color: var(--good); }
.code { font-family: var(--mono); font-size: 12.5px; }

.rev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 16px; }
.rev { border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; min-width: 0; }
.rev h3 { margin: 6px 0 14px; font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
.rev h3.code { font-size: 16px; }
.facts { margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.facts > div { display: flex; gap: 14px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); width: 118px; flex: none; padding-top: 3px; }
.facts dd { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.facts code, .md code { font-family: var(--mono); font-size: 12.5px; background: var(--soft); padding: 1px 6px; border-radius: 4px; }
.rev-note, .rev-body { margin: 0 0 14px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.rev-q { font-size: 14px; font-weight: 500; margin: auto 0 6px; padding-top: 2px; }
.rev textarea { border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px; resize: vertical; min-height: 62px; line-height: 1.5; }
.rev textarea:focus { outline: none; border-color: var(--ink); }
.rev textarea::placeholder { color: var(--faint); }
.rev-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.rev-actions .hint { flex: 1; font-size: 12.5px; color: var(--faint); }

.tbl-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tbl { border-bottom: 1px solid var(--line); }
.tbl:last-child { border-bottom: 0; }
.tbl summary { display: flex; align-items: center; gap: 16px; padding: 13px 16px; cursor: pointer; list-style: none; }
.tbl summary::-webkit-details-marker { display: none; }
.tbl summary:hover { background: var(--side); }
.tbl summary > .code { width: 104px; flex: none; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.t-name { flex: 1; min-width: 0; line-height: 1.35; }
.t-name b { display: block; font-size: 14.5px; font-weight: 500; }
.t-name small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.t-count { font-family: var(--mono); font-size: 11.5px; color: var(--muted); width: 70px; text-align: right; }
.tbl summary > svg { color: var(--faint); transition: transform .15s; }
.tbl[open] summary > svg { transform: rotate(90deg); }
.tbl[open] summary { background: var(--side); border-bottom: 1px solid var(--line); }
.tbl-body { padding: 6px 16px 18px 136px; }
.tbl-desc { margin: 12px 0 4px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
table.dict { width: 100%; border-collapse: collapse; font-size: 14px; }
table.dict th { font-family: var(--mono); font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); text-align: left; padding: 12px 12px 8px 0; border-bottom: 1px solid var(--line); }
table.dict td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
table.dict td:first-child { width: 190px; white-space: nowrap; }
table.dict tr:last-child td { border-bottom: 0; }
.joins-h { margin: 18px 0 8px; }
.joins > div { display: flex; gap: 16px; padding: 5px 0; font-size: 14px; flex-wrap: wrap; }
.joins .code { min-width: 250px; }
.joins span:last-child { color: var(--muted); }

.setting { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.setting .sub { margin-bottom: 16px; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; flex: none; padding-top: 2px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle span { width: 40px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + span { background: var(--ink); }
.toggle input:checked + span::after { transform: translateX(18px); }
.toggle input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.toggle b { font-size: 13.5px; font-weight: 500; width: 24px; }
ol.ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); }
ol.ladder li { padding: 14px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 13.5px; color: var(--muted); }
ol.ladder li:last-child { border-right: 0; }
ol.ladder li b { font-size: 15px; font-weight: 500; color: var(--ink); }
.count { font-family: var(--mono); font-size: 11.5px; font-weight: 400; background: var(--soft); color: var(--muted); border-radius: 999px; padding: 2px 8px; margin-left: 4px; vertical-align: 2px; }
.raw { margin-top: 12px; font-size: 13.5px; }
.k-main .raw { margin-top: 8px; font-size: 13px; }
.k-main .raw pre { max-height: 220px; }
.raw summary { cursor: pointer; color: var(--muted); }
.raw pre { margin-top: 10px; }
.panel { border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin-bottom: 22px; background: var(--bg); }
.panel h2 { font-size: 17px; font-weight: 500; margin: 0 0 4px; }
.panel h3 { font-family: var(--mono); font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 18px 0 8px; }
.panel .sub { margin-bottom: 16px; font-size: 14px; }
.panel dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0 0 16px; font-size: 14px; }
.panel dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding-top: 3px; }
.panel dd { margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row .field { flex: 1; min-width: 160px; }
pre.payload { font-family: var(--mono); font-size: 12px; background: var(--side); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; max-height: 260px; overflow: auto; white-space: pre-wrap; margin: 0; }
input[type="checkbox"] { accent-color: var(--ink); width: 15px; height: 15px; margin: 0; }

/* reports */
.r-group { margin-bottom: 34px; }
.tag.new, .nav .badge.new { background: var(--ink); color: #fff; }
.report-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.report-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 12px 4px 0; border-bottom: 1px solid var(--line); }
.report-row:last-child { border-bottom: 0; }
.report-row:hover { background: var(--side); }
.r-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; padding: 12px 0 12px 16px; text-decoration: none; }
.r-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); flex: none; }
.r-main > span:last-child { min-width: 0; line-height: 1.4; }
.r-main b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-main small { color: var(--muted); font-size: 13px; }
.r-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.report-head .sub { margin: 0; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--good); white-space: nowrap; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.report-head .head-actions { padding-top: 22px; }
.page.report { max-width: 960px; }
.rp-summary { border-left: 2px solid var(--ink); padding: 4px 0 4px 20px; margin: 4px 0 34px; }
.rp-summary .label { margin-bottom: 8px; }
.rp-summary .md { font-size: 18px; line-height: 1.5; }
.rp-section { padding: 30px 0 8px; border-top: 1px solid var(--line); }
.rp-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.rp-head h2 { font-size: 22px; font-weight: 400; letter-spacing: -.01em; margin: 0; line-height: 1.25; }
.rp-num { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: .08em; flex: none; }
.rp-section .md { max-width: 50em; }
.rp-section .chart-box { margin: 18px 0; }
.rp-foot { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); }

/* report builder */
.page.builder { max-width: 900px; padding-bottom: 120px; }
.b-top { display: flex; flex-direction: column; gap: 16px; }
.b-top textarea { resize: vertical; line-height: 1.5; }
.field label .opt { color: var(--faint); margin-left: 6px; text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 12px; }
#bTitle { font-size: 17px; height: 46px; }
.b-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 30px 0 12px; }
.b-hint { font-size: 13px; color: var(--muted); }
.b-part { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; background: var(--bg); }
.b-part > header { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.b-q { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.b-qt { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-move { display: flex; flex: none; }
.b-move button:disabled { opacity: .25; }
.b-body { border-top: 1px solid var(--line); padding: 18px 16px 18px; display: flex; flex-direction: column; gap: 18px; }
.b-part.off { background: var(--side); }
.b-part.off .b-body { display: none; }
.b-part.off .b-qt { color: var(--muted); font-weight: 400; }
.b-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.b-tools [data-reset] { margin-left: auto; }
.b-edit { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-height: 120px; max-height: 460px; overflow: auto; background: var(--bg); cursor: text; }
.b-edit:focus { outline: none; border-color: var(--ink); }
.b-charts { display: grid; grid-template-columns: 1fr; gap: 12px; }
.b-chart { border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.b-chart-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.b-chart-head input:not([type]) , .b-chart-head input[data-chart-title] { flex: 1; min-width: 0; height: 34px; border: 1px solid transparent; border-radius: 6px; padding: 0 8px; font-weight: 500; font-size: 14px; background: transparent; }
.b-chart-head input[data-chart-title]:hover { border-color: var(--line); }
.b-chart-head input[data-chart-title]:focus { outline: none; border-color: var(--ink); background: var(--bg); }
.b-preview { padding: 4px 12px 8px; pointer-events: none; }
.b-preview .chart-box { border: 0; padding: 0; margin: 0; }
.b-preview h4 { display: none; }
.b-preview .chart { height: 190px; }
.b-preview .chart-table { max-height: 170px; overflow: hidden; font-size: 12px; }
.b-chart.off { background: var(--side); }
.b-chart.off .b-preview { opacity: .3; }
.b-chart.off input[data-chart-title] { color: var(--muted); text-decoration: line-through; }
.b-bar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); z-index: 5; }
.b-bar-in { max-width: 900px; margin: 0 auto; padding: 12px 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.b-bar-in > span:first-child { font-size: 13.5px; color: var(--muted); }
.b-actions { display: flex; gap: 8px; }
.empty { color: var(--muted); padding: 36px 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 14px; }

/* admin */
.table-wrap { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
table.users { width: 100%; border-collapse: collapse; }
table.users th, table.users td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: middle; }
table.users tr:last-child td { border-bottom: 0; }
table.users th { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; background: var(--side); white-space: nowrap; }
table.users td b { font-weight: 500; }
table.users td small { color: var(--muted); }
.person { display: flex; align-items: center; gap: 12px; }
.person > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.person small { font-size: 12.5px; }
table.users .toggle { padding: 0; }
table.users .checks { flex-wrap: wrap; gap: 6px 14px; }
table.users .checks label { white-space: nowrap; }
table.users th:nth-child(4), table.users th:nth-child(5), table.users td:nth-child(4), table.users td:nth-child(5) { padding-left: 8px; padding-right: 8px; }
table.users td:nth-child(2) { white-space: nowrap; }
table.users .row-act { text-align: right; width: 1%; }
.checks { display: flex; gap: 12px; flex-wrap: wrap; }
.checks label { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; font-family: var(--font); text-transform: none; letter-spacing: 0; color: var(--ink); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 18px; border-radius: 999px; font-size: 13.5px; z-index: 50; max-width: calc(100vw - 32px); }

@media (max-width: 1320px) {
  .search { width: 190px; }
  .sectabs { gap: 18px; }
  table.users .checks { flex-wrap: wrap; white-space: normal; gap: 6px 12px; }
}
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(3n) { border-right: 0; }
  .stat:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .report-head .head-actions { padding: 0; flex-wrap: wrap; }
  .rp-summary .md { font-size: 16.5px; }
  .rp-head h2 { font-size: 19px; }
  .b-charts { grid-template-columns: 1fr; }
  .b-bar-in { padding: 10px 16px; }
  .b-bar-in > span:first-child { display: none; }
  .b-actions { width: 100%; }
  .b-actions .btn { flex: 1; }
  .b-tools [data-reset] { margin-left: 0; }
  #topActions .btn { padding: 4px 10px; }
  #topActions:not(:empty) + .status { display: none; }
  .page-head { flex-direction: column; gap: 0; }
  .head-actions { padding: 0 0 22px; flex-wrap: wrap; }
  .page-head .sub { margin-bottom: 18px; }
  .sectabs-row { flex-direction: column-reverse; align-items: stretch; gap: 14px; border-bottom: 0; }
  .sectabs { border-bottom: 1px solid var(--line); }
  .search { width: 100%; margin: 0; }
  .rev-grid { grid-template-columns: 1fr; }
  .k-row { flex-direction: column; gap: 10px; }
  .k-meta { max-width: none; justify-content: flex-start; }
  .tbl summary { flex-wrap: wrap; gap: 4px 12px; }
  .tbl summary > .code { width: auto; }
  .t-name { flex-basis: 100%; order: 3; }
  .t-meta { margin-left: auto; }
  .t-count { width: auto; }
  .tbl-body { padding: 4px 16px 16px; }
  table.dict td:first-child { width: 40%; white-space: normal; }
  .joins .code { min-width: 0; }
  .setting { flex-direction: column; gap: 4px; }
  .setting .toggle { margin-bottom: 16px; }
  ol.ladder { grid-template-columns: 1fr; }
  ol.ladder li { border-right: 0; border-bottom: 1px solid var(--line); }
  ol.ladder li:last-child { border-bottom: 0; }
  .rev-actions { flex-wrap: wrap; }
  .rev-actions .hint { flex-basis: 100%; }
  .login { grid-template-columns: 1fr; }
  .login-side { padding: 28px 24px; gap: 24px; }
  .caps { display: none; }
  .login-main { padding: 28px 20px 40px; place-items: start center; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 84vw); z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .shell.menu-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.28); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .status .long { display: none; }
  .page { padding: 12px 16px 48px; }
  .page h1 { font-size: 25px; }
  .thread-inner { padding: 8px 16px 16px; }
  .composer-inner { padding: 12px 16px 8px; }
  .composer .hint { padding: 0 16px 10px; }
  .msg.user .bubble { max-width: 90%; }
  .panel { padding: 16px; }
  .table-wrap { border: 0; overflow: visible; }
  table.users, table.users tbody, table.users tr, table.users td { display: block; }
  table.users thead { display: none; }
  table.users tr { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
  table.users td { border: 0; padding: 0; }
  table.users td[data-label] { margin-top: 14px; }
  table.users td[data-label]::before { content: attr(data-label); display: block; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
  table.users .checks { flex-direction: column; gap: 8px; }
  table.users .row-act { width: auto; text-align: left; margin-top: 16px; }
  .panel dl { grid-template-columns: 1fr; gap: 2px; }
  .panel dd { margin-bottom: 8px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--line); }
  .stat:nth-child(3n) { border-right: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-last-child(-n+2) { border-bottom: 0; }
  .composer .btn span { display: none; }
  .composer .btn { padding: 12px; }
}

/* sign-up and the extra lines on the sign-in form */
.login-alt { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.login-lede { margin: -4px 0 4px; color: var(--muted); font-size: 14px; }
.field .help, small.help { font-family: var(--font); font-size: 12.5px; line-height: 1.45; color: var(--muted); text-transform: none; letter-spacing: 0; }
.demo-user .tag { margin-left: 4px; vertical-align: 1px; }
.muted { color: var(--muted); font-size: 13.5px; }
.linkish { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; font-size: inherit; }

/* a company with no data yet */
.composer .hint b { font-weight: 500; color: var(--muted); }
.demo-over { max-width: 840px; margin: 0 auto; padding: 18px 28px 20px; display: flex; gap: 24px; align-items: center; justify-content: space-between; }
.demo-over-text b { display: block; font-size: 16px; font-weight: 500; color: var(--ink); }
.demo-over-text p { margin: 4px 0 0; font-size: 14px; color: var(--muted); max-width: 520px; }
.demo-over-actions { display: flex; gap: 10px; flex: none; }
.composer .demo-over .btn { padding: 10px 18px; white-space: nowrap; }
@media (max-width: 720px) {
  .demo-over { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px 16px 18px; }
  .demo-over-actions { flex-wrap: wrap; }
  .demo-over-actions .btn { flex: 1; justify-content: center; text-align: center; }
}
.no-data { max-width: 440px; margin: 18px auto 0; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 24px 24px 22px; }
.no-data b { display: block; font-size: 16px; font-weight: 500; color: var(--ink); }
.no-data p { margin: 6px 0 0; }
.no-data .btn { margin-top: 16px; }

/* people: what the three kinds of people are */
.lockbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.lockbar svg { flex: none; }
.roles-key { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; margin-top: 22px; }
.roles-key > div { padding: 14px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.roles-key > div:last-child { border-right: 0; }
.roles-key b { font-size: 14.5px; font-weight: 500; }
.roles-key span { font-size: 13.5px; color: var(--muted); }

/* developer: connections */
.stats.four { grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; }
.stats.four .stat { cursor: default; }
.stats.four .stat:hover { background: var(--bg); }
.stat b.small { font-size: 19px; line-height: 1.5; letter-spacing: -.01em; }
.notice.warn { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; overflow-wrap: anywhere; }
.notice.warn svg { margin-top: 3px; }
.conn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.conn { border: 1px solid var(--line); border-radius: 10px; padding: 18px 18px 14px; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.conn.is-off { background: var(--side); }
.conn.is-off .conn-main b { color: var(--muted); }
.conn-top { display: flex; align-items: flex-start; gap: 14px; }
.conn-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--side); color: var(--ink); flex: none; }
.conn-icon svg { width: 18px; height: 18px; }
.conn-main { flex: 1; min-width: 0; line-height: 1.35; }
.conn-main b { display: block; font-size: 15.5px; font-weight: 500; overflow-wrap: anywhere; }
.conn-main small { color: var(--muted); font-size: 13px; }
.conn-state { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: none; max-width: 46%; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.5; border-radius: 999px; padding: 1px 10px 1px 8px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.off { background: transparent; border: 1px dashed var(--line-strong); padding-top: 0; padding-bottom: 0; }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.conn-line { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; flex: 1; }
.bad-text { color: var(--bad); }
.conn-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.conn-actions .toggle { margin-left: auto; padding: 0; }
.files { margin-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.file-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 4px 4px 12px; font-size: 13.5px; }
.file-row > svg { color: var(--muted); }
.file-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row small { color: var(--faint); font-family: var(--mono); font-size: 11.5px; }
.file-row .btn svg { width: 13px; height: 13px; }
.upload { position: relative; overflow: hidden; margin-top: 4px; cursor: pointer; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.upload.disabled, .upload.busy { opacity: .5; pointer-events: none; }
.files .hint { font-size: 12.5px; color: var(--faint); }
.refresh-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--side); padding: 14px 18px; }
.refresh-bar b { display: block; font-size: 14.5px; font-weight: 500; }
.refresh-bar span { font-size: 13.5px; color: var(--muted); }
.refresh-bar .btn { flex: none; background: var(--bg); }
.btn .spinner { width: 12px; height: 12px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* developer: choosing and filling in a connection */
.dlg.wide { width: min(720px, calc(100vw - 32px)); }
.dlg .label { display: block; margin-bottom: 6px; }
.dlg h2 .tag { vertical-align: 3px; margin-left: 6px; font-weight: 400; }
.dlg .notice { margin-bottom: 18px; font-size: 13.5px; }
.cat-h { margin: 18px 0 8px !important; }
.cat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-item { display: flex; align-items: flex-start; gap: 12px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 12px; min-width: 0; transition: background .15s, border-color .15s; }
.cat-item:hover:not(:disabled) { border-color: var(--ink); background: var(--side); }
.cat-item:disabled { cursor: not-allowed; background: var(--side); }
.cat-item:disabled .conn-icon, .cat-item:disabled b { color: var(--faint); }
.cat-item .conn-icon { width: 34px; height: 34px; }
.cat-text { flex: 1; min-width: 0; line-height: 1.35; }
.cat-text b { display: block; font-size: 14px; font-weight: 500; }
.cat-text small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.cat-item .tag { flex: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .field { margin: 0; min-width: 0; }
.form-grid .field.wide, .form-grid .field.check { grid-column: 1 / -1; }
.form-grid textarea { font-family: var(--mono); font-size: 12.5px; resize: vertical; }
.field label .opt { color: var(--faint); margin-left: 6px; text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 12px; }
.tick, .field label.tick { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font); font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--ink); cursor: pointer; }
.form-foot { display: flex; justify-content: flex-end; margin-top: 18px; }
.with-check { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.with-check input[type="time"] { width: 130px; }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: var(--side); color: var(--muted); cursor: not-allowed; }

/* developer: data copy and logs */
.gaps { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.gaps li { margin: 3px 0; }
.table-wrap.plain { max-height: 440px; overflow: auto; }
table.grid th.num, table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td { padding-top: 9px; padding-bottom: 9px; }
table.grid td small { color: var(--muted); font-size: 13px; margin-left: 6px; }
table.grid thead th { position: sticky; top: 0; }
table.logs td:first-child { white-space: nowrap; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
table.logs td:nth-child(3) { overflow-wrap: anywhere; }
table.logs td:nth-child(2), table.logs td:nth-child(4) { white-space: nowrap; }
table.logs tr.is-bad td:nth-child(3) { color: var(--bad); }
.tabs button span { white-space: nowrap; }

@media (max-width: 860px) {
  .roles-key { grid-template-columns: 1fr; }
  .roles-key > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .roles-key > div:last-child { border-bottom: 0; }
  .stats.four { grid-template-columns: repeat(2, 1fr); }
  .stats.four .stat:nth-child(2n) { border-right: 0; }
  .stats.four .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stats.four .stat:nth-child(3n) { border-right: 1px solid var(--line); }
  .stats.four .stat:nth-child(4) { border-right: 0; }
  .conn-list { grid-template-columns: 1fr; }
  .conn-top { flex-wrap: wrap; }
  .conn-state { max-width: none; width: 100%; justify-content: flex-start; padding-left: 52px; }
  .conn-actions .toggle { margin-left: 0; width: 100%; padding-top: 6px; }
  .refresh-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .cat, .form-grid { grid-template-columns: 1fr; }
  .form-grid .field.gap { display: none; }
  .dlg-in { padding: 20px; }
  table.grid:not(.logs), table.grid:not(.logs) tbody { display: table; }
  table.grid:not(.logs) thead { display: table-header-group; }
  table.grid:not(.logs) tbody { display: table-row-group; }
  table.grid:not(.logs) tr { display: table-row; border: 0; padding: 0; margin: 0; }
  table.grid:not(.logs) td { display: table-cell; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); }
  table.grid:not(.logs) td small { display: block; margin: 2px 0 0; }
  .table-wrap.plain { border: 0; }
  table.logs td:first-child { font-size: 12.5px; }
}
