/* Deplane dashboard and sign-in pages. Fonts are served from this origin
   (fonts/OFL.txt); the CSP allows no inline styles, so every visual is a class. */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/static/fonts/geist.woff2) format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/static/fonts/geist-mono.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --bg: #fafafa; --surface: #fff; --subtle: #f5f5f5; --hover: #f2f2f2;
  --border: #ebebeb; --border-strong: #dcdcdc;
  --ink: #171717; --text: #3d3d3d; --muted: #6f6f6f; --faint: #a1a1a1;
  --green: #16a34a; --green-bg: #ecfdf3; --amber: #d97706; --amber-bg: #fffbeb;
  --red: #dc2626; --red-bg: #fef2f2; --blue: #2563eb; --blue-bg: #eff6ff;
  --violet: #7c3aed;
  --sans: "Geist", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --r: 8px; --r-lg: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --shadow-pop: 0 8px 30px rgba(0,0,0,.12);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--blue); }
a.link:hover, .prose a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { overflow-wrap: anywhere; background: var(--subtle); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: 24px; line-height: 1.25; }
h2 { font-size: 16px; }
h3 { font-size: 14px; letter-spacing: -.01em; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.error { color: var(--red); }
.warning { color: var(--amber); font-weight: 600; }
.m0 { margin: 0; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
[hidden] { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons and fields ---------- */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px; font: 500 13.5px var(--sans);
  color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); cursor: pointer; white-space: nowrap;
  text-decoration: none; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover, button:hover { background: var(--subtle); text-decoration: none; }
.btn.primary, button.primary { color: #fff; background: var(--ink); border-color: var(--ink); }
.btn.primary:hover, button.primary:hover { background: #333; }
button.danger, .btn.danger { color: #fff; background: var(--red); border-color: var(--red); }
button.danger:hover { background: #b91c1c; }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover, .btn.ghost:hover { background: var(--hover); color: var(--ink); }
button.sm, .btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
button.link { height: auto; padding: 0; border: 0; background: none; color: var(--muted); font-weight: 400; text-decoration: underline; }
button.secondary { background: var(--surface); }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: default; }
label { display: block; margin: 0 0 6px; font-weight: 500; font-size: 13px; color: var(--text); }
input, select, textarea { width: 100%; height: 36px; padding: 0 11px; font: 14px var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r); transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,23,23,.08); }
button:focus-visible, a:focus-visible, .btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input.mono { font-family: var(--mono); font-size: 13px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline .grow { flex: 1 1 200px; }
.w-s { width: 110px; } .w-m { width: 170px; } .w-l { width: 260px; }

/* ---------- sign-in pages ---------- */
main.card-page { max-width: 400px; margin: 10vh auto; padding: 0 20px; }
main.card-page .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow); }
main.card-page h1 { font-size: 20px; margin-bottom: 12px; }
main.card-page h2 { font-size: 15px; margin: 22px 0 8px; }
main.card-page label { margin-top: 14px; }
main.card-page button, main.card-page .button { width: 100%; margin-top: 14px; height: 38px; }
main.card-page .button { display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--ink); border-radius: var(--r); font-weight: 500; }
main.card-page button.primary { color: #fff; }
main.card-page button.link { width: auto; margin: 0; height: auto; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: -.03em; margin: 0 0 22px; color: var(--ink); }
.logo { width: 22px; height: 22px; flex: none; }
.or { text-align: center; color: var(--muted); margin: 16px 0 0; font-size: 13px; }
.codes { columns: 2; font-family: var(--mono); }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.qr { background: #fff; padding: 8px; border-radius: 6px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 14px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 4px 8px; margin-bottom: 14px; }
.team-switch { position: relative; margin-bottom: 14px; }
.team { display: flex; align-items: center; gap: 9px; width: 100%; height: auto; padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.team:hover, .team[aria-expanded="true"] { background: var(--hover); }
.team .tb { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.team > .i { width: 15px; height: 15px; color: var(--faint); flex: none; }
.team-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.tm-label { font-size: 11.5px; color: var(--muted); font-weight: 500; padding: 4px 8px 6px; }
.tm-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 6px; color: var(--ink); font-size: 13px; text-decoration: none; }
.tm-item:hover { background: var(--hover); text-decoration: none; }
.tm-item .i { width: 15px; height: 15px; color: var(--muted); flex: none; }
.tm-item .av { width: 20px; height: 20px; border-radius: 5px; background: var(--ink); color: #fff; font-size: 10.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; }
.tm-item .tm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tm-item.current .i { color: var(--ink); }
.tm-note { margin: 4px 8px 6px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.tm-sep { height: 1px; background: var(--border); margin: 6px 2px; }
.team .av { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; }
.team .t { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team .p { font-size: 11px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 6px; color: var(--muted); font-weight: 500; font-size: 13.5px; }
.nav a:hover { color: var(--ink); background: var(--hover); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--hover); }
.nav a .count { margin-left: auto; font-size: 11.5px; color: var(--faint); font-weight: 400; }
.nav a .count.alert:not(:empty) { color: #fff; background: var(--red); border-radius: 10px; padding: 0 7px; font-weight: 600; line-height: 18px; }
.tag.bad { color: var(--red); background: var(--red-bg); border-color: #fecaca; }
.check .w-s { display: inline-block; width: 80px; height: 28px; margin: 0 2px; }
.nav .soon { margin-left: auto; font-size: 10.5px; color: var(--faint); border: 1px solid var(--border); border-radius: 10px; padding: 0 6px; font-weight: 500; }
.nav-label { font-size: 11px; font-weight: 500; color: var(--faint); padding: 14px 8px 4px; text-transform: uppercase; letter-spacing: .04em; }
.usage-box { margin-top: auto; border: 1px solid var(--border); border-radius: var(--r); padding: 11px 12px; font-size: 12px; color: var(--muted); }
.usage-box .h { font-weight: 600; color: var(--ink); margin-bottom: 8px; display: flex; justify-content: space-between; }
.usage-box .row-u { display: flex; justify-content: space-between; margin-top: 6px; }
.bar { height: 5px; background: var(--subtle); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ink); border-radius: 3px; width: 0; transition: width .4s; }
.me { display: flex; align-items: center; gap: 8px; padding: 10px 6px 2px; font-size: 12.5px; color: var(--muted); overflow: hidden; }
.me .av { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #a5b4fc, #f0abfc); flex: none; }
.content { padding: 28px 36px 96px; max-width: 1240px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.crumb a:hover { color: var(--ink); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid > .card, .split > .card { margin-top: 0; }
.pad { padding: 18px 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: #fcfcfc; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
.spacer { height: 16px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.meta-grid .lbl { font-size: 12px; color: var(--muted); margin-bottom: 3px; }

/* ---------- KPIs and stats ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 16px 20px; border-left: 1px solid var(--border); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 600; letter-spacing: -.03em; margin-top: 4px; display: flex; align-items: baseline; gap: 8px; }
.kpi .v small { font-size: 13px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.delta { font-size: 12px; font-weight: 500; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }
.stat { padding: 14px 16px 10px; min-width: 0; }
.stat .lbl { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; }
.stat .v { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin: 2px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v small { font-size: 12px; color: var(--muted); font-weight: 400; }
.spark { width: 100%; height: 34px; display: block; }
.spark path.l { fill: none; stroke-width: 1.5; }
.spark path.a { stroke: none; opacity: .08; }
.meter { height: 6px; background: var(--subtle); border-radius: 3px; overflow: hidden; margin-top: 12px; }
.meter > span { display: block; height: 100%; background: var(--ink); width: 0; transition: width .4s; }
.c-ink { color: var(--ink); stroke: var(--ink); fill: var(--ink); }
.c-green { color: var(--green); stroke: var(--green); fill: var(--green); }
.c-red { color: var(--red); stroke: var(--red); fill: var(--red); }
.c-blue { color: var(--blue); stroke: var(--blue); fill: var(--blue); }
.c-amber { color: var(--amber); stroke: var(--amber); fill: var(--amber); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 20px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #fcfcfc; }
.table td.right, .table th.right { text-align: right; }
.empty-row td { color: var(--muted); text-align: center; padding: 28px; }
.app-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-cell .n { font-weight: 600; }
.addr { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- badges, status ---------- */
.stack { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font: 700 11px var(--sans);
  color: #fff; flex: none; letter-spacing: -.02em; background: #171717; }
.stack.lg { width: 40px; height: 40px; border-radius: 10px; font-size: 14px; }
.stack.s-next { background: #000; } .stack.s-node { background: #3c873a; } .stack.s-express { background: #4b5563; }
.stack.s-go { background: #00add8; } .stack.s-redis { background: #dc382d; } .stack.s-mysql { background: #52525b; } .stack.s-clickhouse { background: #57534e; } .stack.s-python { background: #3776ab; } .stack.s-flask { background: #1f2937; }
.stack.s-fastapi { background: #059669; } .stack.s-static { background: #a1a1aa; } .stack.s-docker { background: #1d63ed; }
.stack.s-ruby { background: #cc342d; } .stack.s-php { background: #777bb3; } .stack.s-java { background: #e76f00; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill.live { color: #15803d; background: var(--green-bg); border-color: #bbf7d0; } .pill.live .dot { background: var(--green); }
.pill.work { color: #b45309; background: var(--amber-bg); border-color: #fde68a; } .pill.work .dot { background: var(--amber); animation: pulse 1.4s infinite; }
.pill.bad { color: #b91c1c; background: var(--red-bg); border-color: #fecaca; } .pill.bad .dot { background: var(--red); }
.pill.info { color: #1d4ed8; background: var(--blue-bg); border-color: #bfdbfe; } .pill.info .dot { background: var(--blue); }
.pill.off .dot { background: var(--faint); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 500; padding: 1px 7px; border-radius: 5px; background: var(--subtle); color: var(--muted); border: 1px solid var(--border); }
@keyframes pulse { 50% { opacity: .35; } }
.problem { background: var(--red-bg); border: 1px solid #fecaca; border-radius: var(--r); padding: 12px 14px; color: #7f1d1d; }
.problem strong { color: var(--red); }
.note { background: var(--amber-bg); border: 1px solid #fde68a; border-radius: var(--r); padding: 12px 14px; color: #78350f; }
.good { background: var(--green-bg); border: 1px solid #bbf7d0; border-radius: var(--r); padding: 12px 14px; color: #14532d; }
.info-box { background: var(--blue-bg); border: 1px solid #bfdbfe; border-radius: var(--r); padding: 12px 14px; color: #1e3a8a; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 4px 0 22px; overflow-x: auto; }
.tabs a { color: var(--muted); padding: 8px 12px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; white-space: nowrap; font-size: 13.5px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs a .count.alert:not(:empty) { margin-left: 6px; font-size: 11.5px; color: #fff; background: var(--red); border-radius: 10px; padding: 0 7px; font-weight: 600; line-height: 18px; display: inline-block; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { border: 0; border-radius: 0; height: 30px; padding: 0 12px; font-size: 12.5px; color: var(--muted); background: transparent; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- app page ---------- */
.app-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.app-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prod { display: grid; grid-template-columns: 380px minmax(0, 1fr); }
.preview { margin: 16px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--subtle); height: 228px; position: relative; display: block; }
.preview .chrome { height: 24px; background: #f1f1f1; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 5px; padding: 0 9px; }
.preview .chrome i { width: 7px; height: 7px; border-radius: 50%; background: #d4d4d4; display: block; }
.preview .chrome span { margin-left: 8px; font: 10.5px var(--mono); color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.preview .frame-wrap { position: absolute; top: 24px; left: 0; right: 0; bottom: 0; overflow: hidden; background: #fff; }
.preview iframe { border: 0; width: 1280px; height: 800px; transform: scale(.272); transform-origin: 0 0; pointer-events: none; }
.preview .placeholder { position: absolute; inset: 24px 0 0; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 13px; }
.prod .meta-grid { padding: 22px 24px 22px 8px; align-content: start; }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: 190px; display: block; overflow: visible; }
.chart .gl { stroke: var(--border); stroke-width: 1; }
.chart .ax { font: 10.5px var(--sans); fill: var(--faint); }
.chart path.l { fill: none; stroke-width: 1.6; }
.chart path.a { stroke: none; opacity: .07; }
.chart .cross { stroke: var(--border-strong); stroke-dasharray: 3 3; }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px;
  white-space: nowrap; transform: translate(-50%, -110%); box-shadow: var(--shadow-pop); z-index: 3; }
.chart .tip .t { color: #bbb; font-size: 11px; }
.chart path.sa { stroke: none; opacity: .2; }
.chart .tip .tr { display: flex; align-items: center; gap: 6px; }
.chart .tip .tr .nm { flex: 1; margin-right: 14px; color: #ddd; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.chart .tip .tr.total { border-top: 1px solid rgba(255,255,255,.18); margin-top: 3px; padding-top: 3px; }
.chart .tip .sw { box-shadow: 0 0 0 1px rgba(255,255,255,.45); }
.sw { width: 8px; height: 8px; border-radius: 2px; background: currentColor; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 170px; }
.legend .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Series colours for stacked charts: the top six, then Other. */
.s-0 { color: var(--blue); stroke: var(--blue); fill: var(--blue); }
.s-1 { color: var(--green); stroke: var(--green); fill: var(--green); }
.s-2 { color: var(--amber); stroke: var(--amber); fill: var(--amber); }
.s-3 { color: var(--violet); stroke: var(--violet); fill: var(--violet); }
.s-4 { color: var(--ink); stroke: var(--ink); fill: var(--ink); }
.s-5 { color: var(--red); stroke: var(--red); fill: var(--red); }
.s-other { color: var(--faint); stroke: var(--faint); fill: var(--faint); }
.table td.trend .spark { width: 120px; height: 26px; }
@media (max-width: 560px) { .seg { max-width: 100%; overflow-x: auto; } .seg button { flex: none; } }

/* ---------- lists: deployments, activity ---------- */
.list-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 20px; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; }
.list-row .t1 { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .t2 { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); justify-self: center; }
.sdot.live { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); } .sdot.bad { background: var(--red); } .sdot.work { background: var(--amber); animation: pulse 1.4s infinite; }
.who { display: inline-flex; align-items: center; gap: 6px; }
.who .av { width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 9.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; background: #6366f1; }

/* ---------- logs ---------- */
.log { font: 12px/1.7 var(--mono); background: var(--surface); color: var(--text); padding: 10px 0; max-height: 560px; overflow: auto; }
.log.tall { height: calc(100vh - 300px); min-height: 360px; max-height: none; }
.log.short { max-height: 250px; }
.log .ln { display: grid; grid-template-columns: 70px 64px minmax(0, 1fr); gap: 12px; padding: 0 16px; white-space: pre-wrap; word-break: break-word; }
.log .ln:hover { background: var(--subtle); }
.log .ts { color: var(--faint); }
.log .inst { color: #7c3aed; }
.log .err { color: var(--red); }
.log .build { display: block; padding: 0 16px; white-space: pre-wrap; word-break: break-word; }
.log-empty { padding: 30px; text-align: center; color: var(--faint); font: 13px var(--sans); }
.toolbar { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar input { max-width: 280px; height: 30px; font-size: 13px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
.live-dot.off::before { background: var(--faint); animation: none; }

/* ---------- new app ---------- */
.choices { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 248px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface); padding: 24px; cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { border-color: var(--ink); background: #fcfcfc; }
.drop .ic { width: 42px; height: 42px; border-radius: 10px; background: var(--subtle); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.drop .big { font-weight: 600; font-size: 15px; }
.drop .or-pick { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.drop.compact { min-height: 120px; }
.confirm { margin-top: 20px; }
/* Template gallery (no logos: two-letter monograms on colored tiles). */
#tpl-search { width: 100%; margin: 4px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chips .chip { height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.chips .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .tpl-grid { grid-template-columns: minmax(0, 1fr); } }
.tpl-top { display: flex; gap: 12px; align-items: center; }
.tpl-top .grow { flex: 1; min-width: 0; }
.tpl-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.tpl-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.tpl-card .t { font-weight: 600; color: var(--ink); }
.tpl-card .d { color: var(--muted); font-size: 12.5px; }
.tpl-card .hint { margin: 0; font-size: 12px; color: var(--muted); }
.tpl-card .actions { margin-top: auto; display: flex; justify-content: flex-end; }
.tpl-card.grey { background: var(--subtle); }
.tpl-card.grey .t, .tpl-card.grey .d, .tpl-card.grey .mono-tile, .tpl-card.grey .logo-tile, .tpl-card.grey .badges { opacity: .55; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--subtle); border: 1px solid var(--border); color: var(--text); }
.mono-tile { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px;
  color: #fff; font: 600 13px/1 var(--sans); letter-spacing: -.02em; }
.logo-tile { flex: none; box-sizing: border-box; width: 32px; height: 32px; padding: 4px; border-radius: 8px; border: 1px solid var(--border); background: #fff; object-fit: contain; }
.logo-tile.lg { width: 40px; height: 40px; padding: 5px; border-radius: 10px; }
.tpl-card .warning, .tpl-panel .warning { margin: 0; }
.tpl-panel .warning { margin-top: 10px; }
.mono-tile.lg { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }
.mono-tile.c0 { background: #2563eb; } .mono-tile.c1 { background: #7c3aed; } .mono-tile.c2 { background: #059669; } .mono-tile.c3 { background: #d97706; }
.mono-tile.c4 { background: #dc2626; } .mono-tile.c5 { background: #0891b2; } .mono-tile.c6 { background: #4b5563; } .mono-tile.c7 { background: #db2777; }
.tpl-panel { margin-top: 20px; }
.tpl-panel .actions { display: flex; gap: 8px; margin-top: 12px; }
.cmp-lines { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 4px; }
#cmp-file { width: 100%; min-height: 160px; resize: vertical; }
.tpl-steps { list-style: none; margin: 14px 0 8px; padding: 0; display: grid; gap: 6px; }
.tpl-steps:empty { display: none; }
.tpl-step { display: flex; align-items: center; gap: 10px; }
.tpl-step .grow { flex: 1; }
.tpl-step .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.tpl-step.todo { color: var(--faint); }
.tpl-step.done .dot { background: var(--green); }
.tpl-step.running .dot { background: var(--blue); animation: pulse 1.2s ease-in-out infinite; }
.tpl-step.failed { color: var(--red); }
.tpl-step.failed .dot { background: var(--red); }
/* Import from Heroku: the report's lines, by section, and the switch-over list. */
.steps.three { grid-template-columns: repeat(3, 1fr); }
.hk-sec { margin-top: 16px; }
.hk-sec h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hk-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hk-lines li { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.hk-lines .mk { flex: none; width: 14px; text-align: center; font-weight: 700; }
.hk-lines .ok .mk { color: var(--green); }
.hk-lines .warn .mk { color: var(--amber); }
.hk-lines .refuse { color: var(--red); }
.hk-lines .refuse .mk { color: var(--red); }
.hk-switch { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text); overflow-wrap: anywhere; }

/* ---------- build steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.step { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); color: var(--faint); background: var(--surface); }
.step .s1 { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.step .s1::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; box-sizing: border-box; }
.step small { display: block; margin-top: 4px; font-size: 12px; color: var(--faint); }
.step.done { color: var(--ink); } .step.done .s1::before { background: var(--green); border-color: var(--green); }
.step.now { color: var(--ink); border-color: var(--ink); } .step.now .s1::before { border-color: var(--amber); border-top-color: transparent; animation: spin .8s linear infinite; }
.step.failed { color: var(--red); border-color: #fecaca; background: var(--red-bg); } .step.failed .s1::before { background: var(--red); border-color: var(--red); }
.step.done small, .step.now small { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- empty and coming soon ---------- */
.empty { text-align: center; padding: 56px 24px; }
.empty .ic { width: 48px; height: 48px; border-radius: 12px; background: var(--subtle); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty h2 { font-size: 18px; margin: 0 0 6px; }
.empty p { color: var(--muted); max-width: 460px; margin: 0 auto 18px; }
.empty .actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.soon-hero { padding: 36px 32px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.soon-hero ul { margin: 14px 0 0; padding: 0; list-style: none; }
.soon-hero li { padding: 6px 0 6px 26px; position: relative; color: var(--text); }
.soon-hero li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); opacity: .25; }
.soon-art { border: 1px solid var(--border); border-radius: var(--r-lg); background: linear-gradient(180deg, #fff, #f7f7f7); padding: 18px; }
.soon-art .r { height: 10px; border-radius: 5px; background: var(--subtle); margin: 10px 0; }
.soon-art .r.w60 { width: 60%; } .soon-art .r.w80 { width: 80%; } .soon-art .r.w40 { width: 40%; }

/* ---------- messages ---------- */
.toast { position: fixed; right: 20px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--r);
  font-size: 13.5px; box-shadow: var(--shadow-pop); z-index: 45; max-width: min(460px, calc(100vw - 32px)); }
.toast.bad { background: var(--red); }
dialog { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; background: var(--surface); color: var(--ink); max-width: 460px; width: calc(100vw - 32px); box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgba(0,0,0,.25); }
dialog h2 { margin: 0 0 8px; font-size: 17px; }
dialog .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.once { background: var(--subtle); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
pre.once { margin: 0; white-space: pre-wrap; }
pre.cmd-out { margin: 6px 0 0; padding: 8px 10px; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--subtle); border: 1px solid var(--border); border-radius: var(--r); font: 12px/1.6 var(--mono); color: var(--text); }
.records { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.records th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.records td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; word-break: break-all; }
@media (max-width: 560px) { .records th, .records td { padding: 6px; } }
.records tr:last-child td { border-bottom: 0; }
.copy { height: 24px; padding: 0 8px; font-size: 11.5px; }
.size-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.size-card { height: auto; display: block; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); white-space: normal; }
.size-card .t { font-weight: 600; display: block; } .size-card .d { font-size: 12.5px; color: var(--muted); display: block; }
.size-card[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; }
.stepper button { border: 0; border-radius: 0; width: 34px; padding: 0; }
.stepper input { border: 0; border-radius: 0; width: 56px; text-align: center; box-shadow: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.danger-zone { border-color: #fecaca; }

@media (max-width: 1100px) {
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prod { grid-template-columns: 1fr; }
  .prod .meta-grid { padding: 4px 20px 20px; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; border-right: 0; border-bottom: 1px solid var(--border); }
  .side .team-switch, .usage-box, .me, .nav-label { display: none; }
  .side .brand { margin: 0 8px 0 0; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav .soon { display: none; }
  .content { padding: 20px 16px 48px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .g2, .g3, .g5, .split, .choices, .meta-grid, .soon-hero, .size-cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps.three { grid-template-columns: 1fr; }
  .table .hide-m { display: none; }
  .log .ln { grid-template-columns: 54px minmax(0, 1fr); } .log .ln .inst { display: none; }
}
.spacer-after { margin-bottom: 16px; }

/* ---------- GitHub ---------- */
.card-head.flat { padding: 0; border: 0; margin-bottom: 14px; }
.gh-mark { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 8px; background: var(--ink); color: #fff; flex: none; }
.gh-mark .i { width: 18px; height: 18px; stroke: currentColor; }
.repo-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.repo-tools input { flex: 1; }
.repo-list { border: 1px solid var(--border); border-radius: var(--r); max-height: 320px; overflow-y: auto; background: var(--surface); }
.repo-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.repo-row:last-child { border-bottom: 0; }
.repo-row:hover { background: var(--hover); }
.repo-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ink); }
.repo-row .owner { color: var(--muted); font-weight: 400; }
.gh-linked { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 24px; margin: 4px 0 14px; }
.gh-linked .lbl { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.src { display: flex; flex-direction: column; min-width: 0; }
.src .msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: auto; height: auto; }

/* ---------- assistant ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card.assistant { display: flex; flex-direction: column; min-height: 520px; }
.as-log { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 62vh; }
.as-log:empty { display: none; }
.as-msg { max-width: 760px; line-height: 1.55; font-size: 14px; }
.as-msg p { margin: 0 0 8px; } .as-msg p:last-child { margin-bottom: 0; }
.as-msg ul { margin: 0 0 8px; padding-left: 20px; }
.as-msg.user { align-self: flex-end; background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 14px 14px 4px 14px; }
.as-msg.assistant { align-self: flex-start; background: var(--subtle); border: 1px solid var(--border); padding: 12px 16px; border-radius: 14px 14px 14px 4px; }
.as-msg.thinking { color: var(--muted); white-space: nowrap; }
.as-details { margin-top: 4px; color: var(--muted); font-family: var(--mono); font-size: 12px; word-break: break-word; }
.as-vars { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.as-vars input { width: 100%; }
.as-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); flex-wrap: wrap; }
.as-start { flex: 1; padding: 28px 20px 8px; }
.as-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { height: auto; padding: 7px 12px; border-radius: 999px; font-weight: 400; font-size: 13px; }
.as-form { display: flex; gap: 10px; align-items: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }
.as-form textarea { flex: 1; height: auto; min-height: 44px; padding: 10px 12px; resize: vertical; font: 14px/1.4 var(--sans); }
.pad-x { padding: 0 20px 16px; margin: 0; }

/* ---------- admin console ---------- */
.eyebrow-admin { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--red); margin-bottom: 4px; }
.grid.g4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
a.card.stat { color: inherit; text-decoration: none; }
a.card.stat:hover { border-color: var(--border-strong); }
.card.stat.warn .v { color: var(--red); }
.attn { list-style: none; margin: 8px 0 0; padding: 0; }
.attn li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.attn li:last-child { border-bottom: 0; }
.scroll-x { overflow-x: auto; }
.meter.hot span { background: var(--red); }
.limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 8px; }
.limits input { width: 100%; }

.viewing { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -8px 0 18px; padding: 10px 14px; border-radius: var(--r); background: var(--red); color: #fff; font-size: 13.5px; }
.viewing button { background: #fff; color: var(--red); border-color: #fff; }
.nowrap { white-space: nowrap; }

/* ---------- floating assistant ---------- */
.ask-fab { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 40; height: 42px; padding: 0 14px 0 12px; gap: 8px;
  border-radius: 999px; background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: var(--shadow-pop); font-weight: 500; }
.ask-fab:hover { background: #2a2a2a; }
.ask-fab .i { width: 16px; height: 16px; stroke: currentColor; }
.ask-fab kbd { font: 500 11px var(--mono); color: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.25); border-radius: 4px; padding: 0 4px; }
.ask-panel { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 41; width: min(420px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 100px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden; }
.ask-panel[hidden] { display: none !important; }
.ask-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--border); }
.ask-head .sp { flex: 1; }
.ask-head button { height: 28px; width: 28px; padding: 0; font-size: 18px; }
.ask-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ask-log .as-msg { max-width: 100%; font-size: 13.5px; }
.ask-chips { padding: 0 14px 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.ask-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); }
.ask-form textarea { flex: 1; height: auto; min-height: 40px; padding: 8px 10px; resize: none; font: 13.5px/1.4 var(--sans); }
.ask-note { margin: 0; padding: 0 12px 10px; font-size: 11.5px; color: var(--muted); }
@media (max-width: 760px) { .ask-fab kbd { display: none; } .ask-panel { right: 8px; left: 8px; width: auto; bottom: 8px; height: 75vh; } }
.as-msg.thinking::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--muted); animation: as-pulse 1s ease-in-out infinite; vertical-align: middle; }
@keyframes as-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .as-msg.thinking::after { animation: none; } }
fieldset.field { border: 0; padding: 0; margin: 12px 0 14px; min-width: 0; }
fieldset.field legend { padding: 0; margin: 0 0 6px; font-weight: 500; font-size: 13px; color: var(--text); }
fieldset.field .check { margin: 4px 0; }
#db-restore-at { margin-top: 6px; }
