:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1d2330; --muted: #667085; --line: #e3e6eb;
  --accent: #1f6feb; --ok: #1a7f37; --warn: #9a6700; --bad: #cf222e; --chip: #eef2f7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218; --panel: #171b23; --text: #e6e9ef; --muted: #9aa4b2; --line: #2a303b;
    --accent: #4c8dff; --ok: #3fb950; --warn: #d29922; --bad: #f85149; --chip: #222835;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 28px 0 10px; }
.muted { color: var(--muted); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.grid > *, .places > * { min-width: 0; }       /* a wide table scrolls inside its card instead of widening the grid */
.table-wrap { overflow-x: auto; }
.events li, .msg { overflow-wrap: anywhere; }   /* long log lines / JSON in a message wrap on phones */
td .badge { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
td.center, th.center { text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.chip.add { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.chip.del { background: color-mix(in srgb, var(--bad) 18%, transparent); text-decoration: line-through; }

.badge { display: inline-block; border-radius: 4px; padding: 0 6px; font-size: 12px; font-weight: 600; }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--bad); }
.yes { color: var(--ok); font-weight: 700; } .no { color: var(--muted); }

.msg { border-radius: 6px; padding: 8px 12px; margin: 8px 0; }
.msg.error { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.msg.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.msg.info { background: color-mix(in srgb, var(--accent) 12%, transparent); }

form.release { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
form.release .wide { grid-column: 1 / -1; }
label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
input, select, button { font: inherit; padding: 7px 10px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); }
button { cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }
.inline { display: inline; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; }
.tabs a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
ul.commits { margin: 0; padding-left: 18px; }
ul.commits li.feat { font-weight: 600; }

/* --- NexusFresh dashboard ------------------------------------------------- */
:root { --run: #0969da; }
@media (prefers-color-scheme: dark) { :root { --run: #58a6ff; } }
.badge.run { color: var(--run); } .badge.muted { color: var(--muted); }
.badge.fill { color: #fff; padding: 1px 8px; }
.badge.fill.ok { background: var(--ok); } .badge.fill.bad { background: var(--bad); }
.badge.fill.warn { background: var(--warn); } .badge.fill.run { background: var(--run); }
.badge.fill.muted { background: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.links a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 600; }
.links a:hover { border-color: var(--accent); text-decoration: none; }
.links a small { color: var(--muted); font-weight: 400; }
.cell-tag { font-size: 18px; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card h3 { font-size: 14px; margin: 0 0 8px; display: flex; justify-content: space-between; gap: 8px; }
.card table { border: 0; }
.card td, .card th { padding: 5px 6px; }
.status-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.big-state { font-size: 15px; font-weight: 700; padding: 6px 12px; border-radius: 8px; }
.big-state.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.big-state.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
ul.events { list-style: none; margin: 0; padding: 0; }
ul.events li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.events li:last-child { border-bottom: 0; }

/* --- landing tiles + area pages ------------------------------------------- */
h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-weight: 600; }
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.small { padding: 3px 10px; font-size: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--muted);
  border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-height: 230px; }
.tile.ok { border-left-color: var(--ok); } .tile.warn { border-left-color: var(--warn); }
.tile.bad { border-left-color: var(--bad); }
.tile h2 { margin: 0 0 6px; font-size: 19px; }
.tile p { margin: 0; }
.tile .headline { font-size: 16px; font-weight: 700; }
.tile-row { display: grid; grid-template-columns: 90px 1fr; gap: 2px 10px; padding: 6px 0;
  border-bottom: 1px solid var(--line); }
.tile-row > :nth-child(n+3) { grid-column: 2; font-size: 12.5px; }
.tile .actions { margin-top: auto; padding-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; } .stat span { color: var(--muted); font-size: 12px; }
.stat.wide { grid-column: span 2; } .stat.ok b { color: var(--ok); } .stat.bad b { color: var(--bad); } .stat.warn b { color: var(--warn); }
.bar { height: 7px; background: var(--chip); border-radius: 4px; overflow: hidden; min-width: 70px; margin-top: 3px; }
.bar span { display: block; height: 100%; }
.bar span.ok { background: var(--ok); } .bar span.warn { background: var(--warn); } .bar span.bad { background: var(--bad); }
td.bad, .sub.bad { color: var(--bad); }
@media (max-width: 600px) { .stat.wide { grid-column: span 1; } }

/* --- clickable landing panels --------------------------------------------- */
a.tile { color: var(--text); text-decoration: none; transition: transform .08s, box-shadow .08s; min-height: 190px; }
a.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); border-color: var(--accent); }
a.tile .go { margin-top: auto; padding-top: 10px; color: var(--accent); font-weight: 600; font-size: 13px; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.overview { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 8px; }
.overview .stats { margin-bottom: 10px; }
.overview .open { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 8px; }
.daybars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 8px 0; }
.daybars div { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.daybars div:hover { opacity: 1; }
.daylabels { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }

/* --- app launcher (landing page, Odoo-style) ------------------------------- */
.launcher { display: grid; grid-template-columns: repeat(auto-fill, 120px); justify-content: center;
  gap: 36px 28px; max-width: 760px; margin: 9vh auto 0; }
.app { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.app:hover { text-decoration: none; }
.app .icon { position: relative; width: 84px; height: 84px; display: grid; place-items: center;
  font-size: 52px; transition: transform .12s; }
.app:hover .icon { transform: translateY(-3px) scale(1.06); }
.app .label { font-size: 14px; font-weight: 500; }
.app:hover .label { color: var(--accent); }
.dot { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--bg); }
.dot { top: 4px; right: 4px; }
.dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
.failure pre { margin: 8px 0 0; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; }
.app .icon img { width: 64px; height: 64px; object-fit: contain; }
.app .icon img[src$=".png"] { border-radius: 14px; }

/* --- login ---------------------------------------------------------------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(100%, 360px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px 24px; display: grid; gap: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.login-card h1 { font-size: 18px; margin: 0; justify-content: center; }
.login-logo { width: 56px; height: 56px; border-radius: 14px; justify-self: center; }
.login-card input { width: 100%; }

/* Logs page: pod log loaded on click */
.log-view { margin-top: 16px; }
.log-view h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.log-view pre { margin: 8px 0 0; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; max-height: 520px; overflow: auto; }
.err-line { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bad); }

/* DevOps Assistant (ChatGPT-style): one centred column, input in the middle while empty, at the bottom after */
.assistant { display: flex; flex-direction: column; height: calc(100dvh - 60px - 52px); min-height: 460px;
  margin: -10px 0 -40px; }
.assistant-bar { display: flex; align-items: center; gap: 12px; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.assistant-back { color: var(--muted); text-decoration: none; font-size: 14px; }
.assistant-back:hover { color: var(--accent); }
.assistant-name { flex: 1; text-align: center; font-weight: 600; }
.assistant-pick { display: flex; gap: 6px; }
.assistant-pick select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px; }
.assistant-scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.assistant-col { max-width: 760px; margin: 0 auto; padding: 0 8px; }
.assistant-hello { display: none; text-align: center; padding: 14vh 0 18px; }
.assistant-hello h2 { margin: 12px 0 0; font-size: 26px; font-weight: 600; }
.assistant.empty .assistant-hello { display: block; }
.assistant.empty .assistant-scroll { flex: 0 0 auto; }
.assistant.empty .assistant-input { flex: 1; }
.assistant:not(.empty) .suggestions { display: none; }
.bot-avatar { flex: 0 0 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 50%;
  background: var(--chip); border: 1px solid var(--line); font-size: 16px; }
.bot-avatar.big { width: 52px; height: 52px; font-size: 28px; }

.chat-turn, .turn-pending { padding: 18px 0 4px; }
.chat-q { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.chat-q .bubble { max-width: 75%; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); padding: 10px 16px; border-radius: 20px;
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.chat-a { display: flex; gap: 14px; align-items: flex-start; }
.answer-wrap { flex: 1; min-width: 0; }
.answer { line-height: 1.6; overflow-wrap: anywhere; }
.answer > :first-child { margin-top: 4px; }
.answer > :last-child { margin-bottom: 0; }
.answer p, .answer ul, .answer ol { margin: 0 0 10px; }
.answer ul, .answer ol { padding-left: 22px; }
.answer h1, .answer h2, .answer h3 { font-size: 16px; margin: 14px 0 6px; }
.answer code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--chip); padding: 1px 5px; border-radius: 4px; }
.answer pre { background: var(--chip); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.answer pre code { background: none; padding: 0; white-space: pre; }
.answer table { width: auto; max-width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 14px; display: block; overflow-x: auto;
  border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.answer th, .answer td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; }
.answer th { background: var(--chip); }
.answer a { color: var(--accent); }
.chat-a.error .answer { color: var(--bad); white-space: pre-wrap; }
.answer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; }
.answer-meta .copy { font: inherit; color: var(--muted); background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; cursor: pointer; }
.answer-meta .copy:hover { border-color: var(--line); color: var(--text); }
.answer-meta .tool { background: var(--chip); color: var(--muted); border-radius: 10px; padding: 1px 8px; }
.typing { display: flex; gap: 5px; padding: 11px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; opacity: .6; } }

.assistant-input { padding: 10px 0 0; }
.composer { display: flex; align-items: flex-end; gap: 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 26px; padding: 8px 8px 8px 18px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.composer:focus-within { border-color: var(--accent); }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; color: var(--text);
  font: inherit; line-height: 1.5; padding: 6px 0; max-height: 200px; }
.composer .send { flex: 0 0 36px; height: 36px; border-radius: 50%; border: 0; background: var(--text); color: var(--panel);
  font-size: 18px; font-weight: 700; cursor: pointer; }
.composer .send:disabled, .composer.htmx-request .send { opacity: .35; cursor: default; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.suggestion { font: inherit; font-size: 13px; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 6px 14px; cursor: pointer; }
.suggestion:hover { border-color: var(--accent); color: var(--accent); }
.assistant .chat-meta { font-size: 12px; text-align: center; margin: 8px 0 0; }
@media (max-width: 600px) { .assistant { height: calc(100dvh - 60px - 32px); } .chat-q .bubble { max-width: 88%; } .assistant-name { display: none; } }

/* Charts (Storage page). Environment colours: validated colour-blind-safe set
   (dataviz reference slots 1-3), own steps for dark mode. Text never wears them. */
:root { --env-prod: #2a78d6; --env-stage: #eb6834; --env-shared: #1baf7a; --viz-base: #d0d5dd; --viz-grid: #eceef2; --viz-tint: #ffffff;
  --part-capacity: #6250d6; --part-operations: #e87ba4; --part-bandwidth: #eda100; --part-other: #a3a9b4; }
@media (prefers-color-scheme: dark) { :root { --env-prod: #3987e5; --env-stage: #d95926; --env-shared: #199e70; --viz-base: #3a414d; --viz-grid: #232934; --viz-tint: #ffffff;
  --part-capacity: #9085e9; --part-operations: #d55181; --part-bandwidth: #c98500; --part-other: #5d6573; } }
.env-prod { --c: var(--env-prod); } .env-stage { --c: var(--env-stage); } .env-shared { --c: var(--env-shared); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c, var(--muted)); margin-right: 6px; vertical-align: -1px; }
.key.solid { background: var(--muted); } .key.light { background: color-mix(in oklab, var(--muted) 40%, var(--viz-tint)); margin-left: 10px; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; margin-bottom: 10px; }
.viz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.viz-card { padding: 14px 16px; min-width: 0; }
.viz-card h3 { font-size: 14px; margin: 0 0 12px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.viz-card h3 .muted { font-weight: 400; font-size: 12px; }
.viz-wide { grid-column: 1 / -1; }
.viz-empty { margin: 8px 0; }

/* horizontal bars: label | bar from one baseline | value outside the tip */
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 160px) 1fr auto; align-items: center; gap: 10px; border-radius: 4px; outline: none; }
.hbar-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-label small { display: block; font-size: 11px; }
.hbar-track { display: block; height: 18px; border-left: 1px solid var(--viz-base); }
.hbar-fill { display: block; height: 100%; background: var(--c); border-radius: 0 4px 4px 0; transition: filter .12s; }
.hbar-fill.light { background: color-mix(in oklab, var(--c) 45%, var(--viz-tint)); }   /* second shade of the same hue */
.hbar-value { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 64px; text-align: right; }
.hbar:hover .hbar-fill, .hbar:focus-visible .hbar-fill { filter: brightness(1.12) saturate(1.1); }
.hbar:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.traffic-row { display: grid; grid-template-columns: minmax(110px, 160px) 1fr; gap: 10px; align-items: center; }
.traffic-row .hbar { grid-template-columns: 1fr auto; gap: 10px; margin: 2px 0; }
.traffic-row .hbar-track { height: 10px; }

/* small multiples: one sparkline per account, own scale */
.sparks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 18px; }
.spark-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.spark-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark-head b { font-weight: 600; font-variant-numeric: tabular-nums; }
.spark-svg { display: block; width: 100%; height: auto; margin: 4px 0 2px; overflow: visible; outline: none; cursor: crosshair; }
.spark-svg:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 4px; }
.spark-base { stroke: var(--viz-base); stroke-width: 1; }
.spark-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--c); stroke: var(--panel); stroke-width: 2; }
.spark-cross { stroke: var(--muted); stroke-width: 1; visibility: hidden; }
.spark-svg.hovering .spark-cross { visibility: visible; }
.spark-foot { display: flex; justify-content: space-between; font-size: 11px; font-variant-numeric: tabular-nums; }

/* one shared tooltip (static/charts.js): value first, label second */
.viz-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.14); max-width: 300px; }
.viz-tip b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.viz-tip span { display: block; } .viz-tip small { display: block; color: var(--muted); }
@media (forced-colors: active) { .hbar-fill, .key { forced-color-adjust: none; } }

/* --- charts, round 2: hero stacked area, cost segments, KPI sparklines, motion --- */
.viz-defs { position: absolute; width: 0; height: 0; }
.stop { stop-color: var(--c); }
.env-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 7px; vertical-align: 1px; flex: none; }
.part-capacity { --c: var(--part-capacity); } .part-operations { --c: var(--part-operations); }
.part-bandwidth { --c: var(--part-bandwidth); } .part-other { --c: var(--part-other); }
.viz-card { border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06); }
.viz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.viz-head h3 { margin: 0; font-size: 15px; }
.viz-head p { margin: 3px 0 0; font-size: 12px; }
.viz-head p .key { margin-left: 8px; } .viz-head p .key:first-child { margin-left: 0; }
.viz-figure { text-align: right; }
.viz-figure b { display: block; font-size: 30px; font-weight: 650; line-height: 1.1; letter-spacing: -.01em; }
.viz-figure span { font-size: 12px; }
.viz-hero { padding: 18px 20px 14px; }
.stack-plot { display: grid; grid-template-columns: 58px 1fr; }
.stack-y { position: relative; height: 220px; }
.stack-y span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stack-area { position: relative; min-width: 0; }
.stack-svg { display: block; width: 100%; height: 220px; overflow: visible; outline: none; cursor: crosshair; }
.stack-svg:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 4px; }
.stack-svg .grid { stroke: var(--viz-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.stack-svg .band { fill: var(--c); opacity: .88; }
.stack-svg .band-gap { fill: none; stroke: var(--panel); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.stack-cross { stroke: var(--text); stroke-width: 1; opacity: .5; vector-effect: non-scaling-stroke; visibility: hidden; }
.stack-svg.hovering .stack-cross { visibility: visible; }
.stack-x { position: relative; height: 20px; }
.stack-x span { position: absolute; top: 5px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.stack-keys { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; margin-top: 8px; }
.stack-keys b { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 4px; }
.seg-wrap { display: flex; gap: 2px; height: 100%; border-radius: 0 4px 4px 0; overflow: hidden; min-width: 3px; }
.seg { display: block; height: 100%; background: var(--c); min-width: 1px; }
.hbar:hover .seg, .hbar:focus-visible .seg { filter: brightness(1.12) saturate(1.1); }
.spark-head b { display: flex; align-items: center; gap: 6px; }
.spark-head em.chip { font-style: normal; font-weight: 500; font-size: 11px; color: var(--muted); padding: 1px 7px; }
.kpi-spark { display: block; width: 100%; max-width: 140px; height: 26px; margin-top: 6px; overflow: visible; }
.kpi-line { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; opacity: .7; }
.kpi-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 1.5; }
.viz-tip .row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.viz-tip .row i { width: 12px; height: 3px; border-radius: 2px; background: var(--c); flex: none; }
.viz-tip .row em { font-style: normal; margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
/* grow-in on the first load only (the 30 s refresh does not replay it) */
@keyframes viz-grow { from { transform: scaleX(0); } }
@keyframes viz-rise { from { opacity: 0; transform: translateY(6px); } }
html:not(.viz-seen) .hbar-fill, html:not(.viz-seen) .seg-wrap { transform-origin: left; animation: viz-grow .7s cubic-bezier(.2,.7,.2,1) both; }
html:not(.viz-seen) .stack-svg, html:not(.viz-seen) .spark-svg { animation: viz-rise .6s ease-out both; }
@media (prefers-reduced-motion: reduce) { html:not(.viz-seen) * { animation: none !important; } }
@media (max-width: 600px) { .viz-figure { text-align: left; } .stack-plot { grid-template-columns: 50px 1fr; } .stack-x span:nth-child(even) { display: none; } }

/* --- Azure cost page --- */
:root { --viz-mag: #6250d6; }                         /* magnitude-only bars: one hue, not an environment */
@media (prefers-color-scheme: dark) { :root { --viz-mag: #9085e9; } }
.hbar-fill.mag, .col-total { background: var(--viz-mag); }
.col-total { flex: 1; }
.hbar-value small { color: var(--muted); margin-left: 4px; }
.cost-summary { margin: 4px 0 12px; font-size: 14px; }
.stat small { display: block; font-size: 11px; margin-top: 4px; }
.meter { position: relative; height: 8px; border-radius: 4px; margin-top: 8px; background: color-mix(in oklab, var(--accent) 18%, var(--panel)); }
.meter-fill { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.meter-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.cols-plot { display: grid; grid-template-columns: 52px 1fr; }
.cols-y { position: relative; height: 220px; }
.cols-y span { position: absolute; right: 8px; transform: translateY(50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cols-area { min-width: 0; }
.cols { position: relative; height: 220px; display: flex; align-items: stretch; border-bottom: 1px solid var(--viz-base); }
.cols-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--viz-grid); pointer-events: none; }
.cols-avg { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid color-mix(in oklab, var(--text) 45%, transparent); pointer-events: none; z-index: 1; }
.cols-avg span { position: absolute; right: 0; bottom: 2px; font-size: 11px; color: var(--muted); background: var(--panel); padding: 0 4px; border-radius: 3px; }
.col { flex: 1; display: flex; align-items: flex-end; justify-content: center; min-width: 0; outline: none; position: relative; z-index: 2; }
.col-stack { width: min(24px, 72%); display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 2px; transition: filter .12s; }
.col-stack span { display: block; background: var(--c, var(--viz-mag)); min-height: 1px; }
.col.partial .col-stack { opacity: .5; }
.col:hover .col-stack, .col:focus-visible .col-stack { filter: brightness(1.12) saturate(1.1); }
.col:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 4px; }
.cols-x { display: flex; height: 20px; }
/* cost page: month filter + the 6-month trend (bars are links to that month) */
.month-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.trend-cols .col { text-decoration: none; color: inherit; cursor: pointer; }
.trend-cols .col-stack { width: min(56px, 60%); }
.trend-cols .col.selected .col-stack { box-shadow: 0 0 0 2px var(--accent); }
.trend-value { position: absolute; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend-cols .col.selected .trend-value { color: var(--text); font-weight: 600; }
.cols-x span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); padding-top: 4px; min-width: 0; }
.split-bar { display: flex; gap: 2px; height: 22px; border-radius: 5px; overflow: hidden; }
.split-bar span { background: var(--c); outline: none; transition: filter .12s; }
.split-bar span:hover, .split-bar span:focus-visible { filter: brightness(1.12) saturate(1.1); }
.split-keys { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; margin-top: 8px; }
.split-keys b { font-variant-numeric: tabular-nums; }
.top-res .hbar { grid-template-columns: minmax(140px, 240px) 1fr auto; }
html:not(.viz-seen) .col-stack { transform-origin: bottom; animation: viz-up .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes viz-up { from { transform: scaleY(0); } }
@media (max-width: 600px) { .cols-plot { grid-template-columns: 40px 1fr; } .cols-avg span { display: none; } .cols-x span:not(.d10) { visibility: hidden; } .top-res .hbar { grid-template-columns: minmax(110px, 160px) 1fr auto; } }

/* --- Portal look: navy sidebar, top bar, soft white cards ------------------ */
:root {
  --bg: #f3f6fb; --panel: #ffffff; --text: #15233d; --muted: #66748b; --line: #e4e9f1;
  --accent: #2563eb; --ok: #15803d; --warn: #b45309; --bad: #dc2626; --chip: #eef3fa; --run: #2563eb;
  --side: #0f1d38; --side-text: #c4cee0; --side-hover: #1a2b4d; --side-line: #22355a;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 2px 8px rgba(16,24,40,.06);
  --shadow-hi: 0 8px 24px rgba(16,24,40,.10);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --panel: #131c2e; --text: #e6ebf4; --muted: #94a1b8; --line: #243149;
    --accent: #5b8cff; --ok: #34c06a; --warn: #e0a030; --bad: #f2645a; --chip: #1c2740; --run: #5b8cff;
    --side: #08101f; --side-text: #a9b5cb; --side-hover: #15213a; --side-line: #1c2a45;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.25); --shadow-hi: 0 8px 24px rgba(0,0,0,.4);
  }
}
body { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; }
.ico { width: 20px; height: 20px; flex: none; }

/* layout */
.shell { display: flex; min-height: 100vh; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.sidebar { position: sticky; top: 0; height: 100vh; width: 248px; flex: none; display: flex; flex-direction: column;
  background: var(--side); color: var(--side-text); padding: 18px 12px; overflow-y: auto; z-index: 30; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; color: #fff;
  font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.sidebar .brand:hover { text-decoration: none; }
.sidebar .brand img { width: 34px; height: 34px; border-radius: 9px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  color: var(--side-text); font-weight: 500; transition: background .12s, color .12s; }
.sidebar nav a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.sidebar nav a.on { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.sidebar nav .side-sub { display: flex; flex-direction: column; gap: 2px; margin-left: 18px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.15); }
.sidebar nav .side-sub a { padding: 7px 10px; font-size: 13px; }
.side-foot { margin-top: auto; padding: 18px 10px 4px; border-top: 1px solid var(--side-line);
  display: flex; align-items: center; gap: 10px; font-size: 12px; }
.side-foot img { width: 24px; height: 24px; border-radius: 6px; }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 10px 24px; min-height: 60px; background: var(--side); color: #fff; border-bottom: 1px solid var(--side-line); }
.topbar-title { font-size: 17px; font-weight: 500; flex: 1; }
.topbar .meta { display: flex; gap: 6px; align-items: center; }
.icon-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 8px;
  background: transparent; border: 1px solid transparent; color: var(--side-text); font-size: 13px; font-weight: 500; cursor: pointer; }
.icon-btn:hover { background: var(--side-hover); color: #fff; }
.icon-btn .ico { width: 18px; height: 18px; }
.menu-btn { display: none; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px 0 10px; color: #fff; font-weight: 600; font-size: 13px; }
.user-chip i { font-style: normal; width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  display: grid; place-items: center; font-size: 12px; }
/* top-bar menus: company switcher + account (<details>, sidebar.js closes them) */
.top-menu { position: relative; }
.top-menu > summary { list-style: none; cursor: pointer; }
.top-menu > summary::-webkit-details-marker { display: none; }
.top-menu > summary .ico { width: 16px; height: 16px; color: var(--side-text); }
.top-chip { display: inline-flex; align-items: center; gap: 9px; padding: 5px 10px 5px 6px; border-radius: 10px;
  border: 1px solid var(--side-line); color: #fff; }
.top-chip .project-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }
.top-chip-text b { display: block; font-size: 13px; line-height: 1.2; }
.top-chip-text small { display: block; color: var(--side-text); font-size: 11px; line-height: 1.2; }
.user-menu > summary { padding: 4px 8px 4px 4px; border-radius: 10px; border: 1px solid transparent; }
.top-menu > summary:hover, .top-menu[open] > summary { background: var(--side-hover); border-color: var(--accent); }
.top-menu .co-menu { left: auto; right: 0; width: 290px; max-height: 75vh; overflow-y: auto; }
.user-pop { width: 240px !important; }
.user-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-head b { font-size: 14px; }
.user-head small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--chip); }
.menu-item .ico { width: 18px; height: 18px; color: var(--muted); }
.menu-sep { display: block; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.user-pop form.inline { display: block; }
main { max-width: 1320px; width: 100%; margin: 0; padding: 26px 28px 64px; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 18px; }
h2 { font-size: 16px; font-weight: 600; }

/* cards */
.panel, .stat, .overview, .tile, table, .viz-card, .login-card {
  border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 18px 20px; }
.card h3, .viz-head h3 { font-size: 16px; font-weight: 600; }
.overview { padding: 20px; }
.stat { padding: 14px 16px; gap: 4px; }
.stat b { font-size: 24px; font-weight: 700; }
.section-title { font-size: 12px; font-weight: 600; letter-spacing: .07em; }
.tile { border-left-width: 1px; border-top: 4px solid var(--muted); }
.tile.ok { border-top-color: var(--ok); } .tile.warn { border-top-color: var(--warn); } .tile.bad { border-top-color: var(--bad); }
a.tile:hover { box-shadow: var(--shadow-hi); }

/* tables */
table { border-collapse: separate; border-spacing: 0; }
th { background: color-mix(in srgb, var(--chip) 70%, var(--panel)); font-size: 12px; font-weight: 600; color: var(--muted); }
th, td { padding: 11px 14px; }
.card th { background: transparent; }
tbody tr:hover td, table tr:hover td { background: color-mix(in srgb, var(--chip) 45%, transparent); }

/* status pills */
.badge { border-radius: 999px; padding: 2px 10px; font-weight: 600; font-size: 12px; }
.badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.badge.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.badge.run { color: var(--run); background: color-mix(in srgb, var(--run) 12%, transparent); }
.badge.muted { color: var(--muted); background: var(--chip); }
.badge.fill { padding: 2px 10px; }
.badge.fill.ok, .badge.fill.bad, .badge.fill.warn, .badge.fill.run, .badge.fill.muted { color: #fff; }
.msg { border-radius: 10px; padding: 10px 14px; }

/* controls */
input, select, button, .btn { border-radius: 8px; }
.btn, button.primary { padding: 8px 16px; font-weight: 600; }
.btn.primary, button.primary { box-shadow: 0 2px 6px rgba(37,99,235,.25); }
.btn.small { padding: 4px 12px; }
.tabs a { padding: 6px 14px; font-weight: 500; }
.links a { border-radius: 10px; box-shadow: var(--shadow); }

/* landing: same apps, as cards */
.launcher { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; max-width: 920px; margin: 4vh auto 0; }
.app { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  padding: 24px 12px 18px; transition: transform .12s, box-shadow .12s, border-color .12s; }
.app:hover { transform: translateY(-3px); box-shadow: var(--shadow-hi); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.app:hover .icon { transform: none; }
.app .icon { width: 64px; height: 64px; font-size: 44px; }
.app .icon img { width: 52px; height: 52px; }
.app .label { font-weight: 600; }
.dot { top: -6px; right: -6px; border-color: var(--panel); }

/* projects: landing cards + the project chip in the sidebar */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-bottom: 24px; }
.project { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); transition: box-shadow .12s, border-color .12s; }
a.project:hover { text-decoration: none; box-shadow: var(--shadow-hi); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.project.soon { border-style: dashed; box-shadow: none; }
.project-head { display: flex; align-items: center; gap: 12px; }
.project-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.project-name b { font-size: 17px; }
.project-name span, .project-foot { color: var(--muted); font-size: 13px; }
.project-mark { width: 44px; height: 44px; flex: none; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.project-mark.nf { background: #e7f0ea; color: #204030; }
.project-mark.xt { background: #e6edfc; color: #1e3a8a; }
.project-mark.n4e { background: #f3e8fd; color: #5b21b6; }
.project-mark.b2b { background: #fbeee6; color: #9a3412; font-size: 12px; }
.project-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.project-facts div { display: flex; flex-direction: column; background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.project-facts span { color: var(--muted); }
.project-facts div:nth-child(3):last-child { grid-column: 1 / -1; }
.project-foot { display: flex; justify-content: space-between; gap: 12px; }
.project-foot .go { color: var(--accent); font-weight: 600; }
.side-back { display: flex; align-items: center; gap: 8px; padding: 0 10px 12px; color: var(--side-text); font-size: 13px; }
.side-back:hover { color: #fff; text-decoration: none; }
.side-back .ico { width: 16px; height: 16px; }
.project-chip { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px; border-radius: 10px; background: var(--side-hover); }
.project-chip .project-mark { width: 34px; height: 34px; border-radius: 9px; font-size: 12px; }
.project-chip b { display: block; color: #fff; font-size: 15px; }
.project-chip small { color: var(--side-text); font-size: 12px; }

/* sidebar: company switcher + collapsible sections (<details>; sidebar.js remembers open ones) */
.co-switch { position: relative; margin: 0 0 14px; }
.co-switch > summary { list-style: none; cursor: pointer; margin: 0; border: 1px solid var(--side-line); }
.co-switch > summary::-webkit-details-marker, .side-row::-webkit-details-marker { display: none; }
.co-switch > summary > span:nth-child(2) { flex: 1; min-width: 0; }
.co-switch > summary:hover, .co-switch[open] > summary { border-color: var(--accent); }
.co-switch > summary .ico { width: 18px; height: 18px; color: var(--side-text); }
.co-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; display: flex; flex-direction: column; gap: 2px;
  padding: 6px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-hi); }
.co-menu-title { padding: 6px 8px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.co-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: var(--text); }
.co-item > span:nth-child(2) { flex: 1; min-width: 0; }
.co-item b { display: block; font-size: 14px; }
.co-item small { color: var(--muted); font-size: 12px; }
.co-item .project-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }
.co-item .ico { width: 18px; height: 18px; color: var(--accent); }
.co-item:hover, .co-item.on, .co-cust:hover, .co-all:hover { background: var(--chip); text-decoration: none; }
.co-cust { display: flex; align-items: center; gap: 8px; margin-left: 40px; padding: 6px 8px; border-radius: 8px; color: var(--text); font-size: 13px; }
.co-cust::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.co-cust.on { font-weight: 600; }
.co-all { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 10px 8px; border-top: 1px solid var(--line); color: var(--text); }
.co-all .ico { width: 18px; height: 18px; color: var(--muted); }
.side-label { padding: 14px 12px 4px; color: var(--side-text); opacity: .7; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.side-row { display: flex; align-items: center; border-radius: 9px; list-style: none; cursor: pointer; color: var(--side-text); }
.sidebar nav .side-row > a { flex: 1; min-width: 0; }
.sidebar nav .side-row > a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-row .count { padding: 0 2px; font-size: 12px; opacity: .75; }
.side-group[open] > .side-row .count { display: none; }
.side-row .chev { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 8px; }
.side-row .chev .ico { width: 16px; height: 16px; transition: transform .15s; }
.side-group[open] > .side-row .chev .ico { transform: rotate(90deg); }
.side-row:hover .chev { background: var(--side-hover); color: #fff; }
.sidebar nav .side-row.here > a { color: #fff; font-weight: 600; }
.side-row.on { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.sidebar nav .side-row.on > a:hover { background: transparent; }
.side-row.on:hover .chev { background: rgba(255,255,255,.15); }
.side-group > .side-sub { margin: 2px 0 6px 21px; }
.side-group .side-group > .side-row > a { padding: 7px 10px; font-size: 13px; }
.side-group .side-group > .side-sub { margin-left: 16px; }
.side-bottom { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--side-line); }
.side-bottom + .side-foot { margin-top: 0; }

/* home: projects at a glance */
.glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 8px; }
.glance-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
a.glance-item:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.glance-item.soon { border-style: dashed; box-shadow: none; }
.glance-item > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.glance-item small { color: var(--muted); font-size: 12px; }
.glance-item .project-mark { width: 38px; height: 38px; border-radius: 10px; font-size: 12px; }

/* Xantory: customer cards (Local / Cloud) and the place / environment switches */
.project.customer { margin-bottom: 18px; }
.project .go { color: var(--accent); font-weight: 600; }
.places { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.place { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.place table { border: 0; box-shadow: none; }
.place th, .place td { padding: 6px 8px; }
.switches { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.pick { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--chip); }
.pick a { padding: 8px 16px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.pick a:hover { color: var(--text); text-decoration: none; }
.pick a.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

/* login */
.login-body { background: linear-gradient(135deg, var(--side) 0 42%, var(--bg) 42%); }
.login-card { padding: 32px 28px; box-shadow: var(--shadow-hi); }
.login-card h1 { font-size: 20px; }

/* phones: sidebar slides in from the ☰ button */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-scrim { display: none; }
  .nav-toggle:checked ~ .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 8px 16px; gap: 8px; }
  .icon-btn span, .user-chip > span, .top-chip-text { display: none; }
  .top-chip { padding: 4px; }
  .topbar-title { min-width: 0; }
  .topbar .meta { flex-shrink: 0; }
  .top-menu > summary .ico { display: none; }
  .user-menu > summary { padding: 2px; }
  .top-menu .co-menu, .user-pop { position: fixed; top: 56px; right: 8px; left: auto; width: min(300px, calc(100vw - 16px)) !important; }
  .icon-btn { padding: 7px; }
  .topbar-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .meta { gap: 0; }
  .launcher { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 0; }
  main { padding: 18px 16px 48px; }
}
/* portal mark (sidebar, footer, login) */
.mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--accent); color: #fff; }
.mark .ico { width: 20px; height: 20px; }
.mark.small { width: 24px; height: 24px; border-radius: 6px; } .mark.small .ico { width: 14px; height: 14px; }
.mark.login-logo { width: 56px; height: 56px; border-radius: 14px; } .mark.login-logo .ico { width: 30px; height: 30px; }
.project-mark.login-logo { font-size: 18px; }
.login-sub { margin: -6px 0 0; text-align: center; color: var(--muted, #64748b); font-size: 13px; }

/* --- inner pages (reference: DevOps Portal mock-ups) ----------------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.page-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.page-status .status-bar { margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); background: var(--chip); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.refresh-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted); box-shadow: var(--shadow); }
.refresh-btn:hover { color: var(--accent); border-color: var(--accent); }
.refresh-btn .ico { width: 16px; height: 16px; }

/* summary tiles: tinted icon circle, label above the number */
.overview { background: none; border: 0; box-shadow: none; padding: 0; margin-bottom: 18px; }
.overview > .table-wrap, .overview > table { margin-bottom: 12px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; align-content: center; padding: 16px 18px; }
.stat::before { content: ""; grid-column: 1; grid-row: 1 / span 6; align-self: center; width: 44px; height: 44px; border-radius: 50%;
  background-color: color-mix(in srgb, #2563eb 11%, transparent); background-repeat: no-repeat; background-position: center; background-size: 22px; }
.stat.ok::before { background-color: color-mix(in srgb, #16a34a 12%, transparent); }
.stat.warn::before { background-color: color-mix(in srgb, #d97706 14%, transparent); }
.stat.bad::before { background-color: color-mix(in srgb, #dc2626 12%, transparent); }
.stat > * { grid-column: 2; min-width: 0; }
.stat > span:only-of-type { order: -1; }
.stat > span { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.stat b { font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.stat.ok b { color: var(--ok); } .stat.bad b { color: var(--bad); } .stat.warn b { color: var(--warn); }
.overview .open { margin-top: 2px; }

/* section headings and cards */
.section-title { margin: 30px 0 10px; }
h2 { font-size: 17px; margin: 30px 0 12px; }
h2 .muted { font-weight: 400; font-size: 13px; }
.panel.card h3 { align-items: center; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.card table { box-shadow: none; }
.table-wrap { border-radius: var(--radius); }

/* underline tabs */
.tabs { gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 14px; margin-bottom: -1px; color: var(--muted); }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { background: none; color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a small { font-weight: 400; color: var(--muted); }

/* usage bars */
.bar { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--chip) 80%, var(--line)); }
.bar span { border-radius: 999px; }

/* Report page (Xantory) and printing: only the content, full width */
.report td { vertical-align: top; }
.report td .badge { margin-left: 4px; }
.report .num, .report .nowrap { text-align: right; white-space: nowrap; }
.report .nowrap { text-align: left; }
@media print {
  .sidebar, .topbar, .nav-scrim, .no-print, .refresh-btn, .nav-toggle { display: none !important; }
  .shell, .workspace { display: block; }
  main { padding: 0; max-width: none; }
  body { background: #fff; }
  .table-wrap { overflow: visible; }
  a { color: inherit; text-decoration: none; }
}
.login-sso { text-align: center; }

/* --- Landing look (matches developer landing page / Penpot S3) -------------
   Inter Tight, deep navy sidebar, blue→violet gradient accent, light top bar,
   16px cards with soft shadows. Overrides the "Portal look" above. */
:root {
  --bg: #f6f8fc; --panel: #ffffff; --text: #0f172a; --ink: #0a1330; --muted: #64748b; --line: #e2e8f0;
  --accent: #4f6bff; --accent-2: #8b5cf6; --accent-3: #7c5cff; --chip: #eef2ff; --run: #4f6bff;
  --ok: #059669; --warn: #d97706; --bad: #e11d48;
  --side: #0a1330; --side-text: #9aa6c8; --side-hover: #16214a; --side-line: #1d2852;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --grad-btn: linear-gradient(135deg, var(--accent), var(--accent-3));
  --top-bg: rgba(255,255,255,.78);
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 20px -12px rgba(15,23,42,.12);
  --shadow-hi: 0 24px 48px -24px rgba(15,23,42,.22);
  --glow: 0 10px 24px -8px rgba(79,107,255,.5);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020; --panel: #131a30; --text: #e6ebf5; --ink: #f1f4ff; --muted: #8c97b0; --line: #232c45;
    --accent: #7088ff; --accent-2: #9d7bff; --accent-3: #8f74ff; --chip: #1b2340; --run: #7088ff;
    --ok: #34d399; --warn: #fbbf24; --bad: #fb7185;
    --side: #070d1f; --side-text: #8f9bbd; --side-hover: #121b3a; --side-line: #18213f;
    --top-bg: rgba(11,16,32,.78);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 20px -12px rgba(0,0,0,.5);
    --shadow-hi: 0 24px 48px -24px rgba(0,0,0,.7);
    --glow: 0 10px 24px -8px rgba(112,136,255,.45);
  }
}
body, input, select, button { font-family: "Inter Tight", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { font-size: 14.5px; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -.6px; color: var(--ink); }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -.2px; color: var(--ink); }
.page-head h1 { font-size: 28px; }
.section-title { color: var(--accent); font-weight: 700; letter-spacing: 1.2px; }

/* gradient marks: portal logo, user avatar, active menu item */
.mark, .user-chip i { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.sidebar { background: var(--side); }
.sidebar .brand { font-weight: 800; letter-spacing: -.3px; }
.sidebar nav a.on, .side-row.on { background: var(--grad); box-shadow: var(--glow); }
.sidebar nav a:hover, .side-row:hover .chev { background: var(--side-hover); }
.project-chip { background: var(--side-hover); border: 1px solid var(--side-line); }

/* light top bar, like the landing nav */
.topbar { background: var(--top-bg); color: var(--text); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.topbar-title { color: var(--ink); font-weight: 700; letter-spacing: -.2px; }
.icon-btn { color: var(--muted); }
.icon-btn:hover { background: var(--chip); color: var(--accent); }
.top-chip { border-color: var(--line); color: var(--text); background: var(--panel); }
.top-chip-text small, .top-menu > summary .ico { color: var(--muted); }
.user-chip { color: var(--text); }
.top-menu > summary:hover, .top-menu[open] > summary { background: var(--chip); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* buttons */
.btn.primary, button.primary { background: var(--grad-btn); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.btn.primary:hover, button.primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.btn, button.primary { border-radius: 10px; transition: transform .15s, filter .15s, border-color .15s; }
.btn:not(.primary):hover { border-color: var(--accent); color: var(--accent); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* cards and tiles */
.panel, .stat, .tile, table, .viz-card, .project, .glance-item, .app, .place { border-radius: var(--radius); }
a.tile:hover, a.project:hover, a.glance-item:hover, .app:hover { transform: translateY(-3px); box-shadow: var(--shadow-hi);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
a.tile, a.project, a.glance-item { transition: transform .18s, box-shadow .18s, border-color .18s; }
.tile { border-top-width: 3px; }
a.tile .go, .project-foot .go, .project .go { color: var(--accent); font-weight: 700; }
.project-mark { border-radius: 14px; }
.project-name b { font-size: 18px; font-weight: 800; letter-spacing: -.3px; color: var(--ink); }
.project-facts div { background: color-mix(in srgb, var(--chip) 55%, var(--panel)); border-radius: 12px; }

/* number tiles: bolder figures, tinted icon circle in the accent */
.stat b { font-size: 24px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat::before { background-color: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 12px; }
.stat.ok::before { background-color: color-mix(in srgb, var(--ok) 13%, transparent); }
.stat.warn::before { background-color: color-mix(in srgb, var(--warn) 14%, transparent); }
.stat.bad::before { background-color: color-mix(in srgb, var(--bad) 13%, transparent); }

/* tables, tabs, pills, switches */
th { background: color-mix(in srgb, var(--chip) 50%, var(--panel)); }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.pick a.on { color: var(--accent); }
.daybars div { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.bar span:not(.ok):not(.warn):not(.bad) { background: var(--grad); }

/* login: soft gradient background with glows, like the landing hero */
.login-body { position: relative; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--bg)), var(--bg)); }
.login-body::before, .login-body::after { content: ""; position: absolute; border-radius: 50%; filter: blur(110px); pointer-events: none; }
.login-body::before { width: 560px; height: 480px; right: -120px; top: -140px; background: color-mix(in srgb, var(--accent-2) 24%, transparent); }
.login-body::after { width: 520px; height: 440px; left: -160px; bottom: -160px; background: color-mix(in srgb, var(--accent) 20%, transparent); }
.login-card { position: relative; z-index: 1; width: min(100%, 400px); padding: 36px 32px; border-radius: 20px; box-shadow: var(--shadow-hi); }
.login-card h1 { font-size: 24px; font-weight: 800; }
.mark.login-logo { border-radius: 16px; }
.login-sso { height: 48px; display: grid; place-items: center; font-size: 15px; }

/* --- Home: Overview (landing look) ------------------------------------------ */
.ov-env a { padding: 7px 16px; }
.ov-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.ov-kpi { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.ov-ico { grid-row: 1 / span 3; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.ov-ico .ico { width: 22px; height: 22px; }
.ov-label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.ov-kpi b { font-size: 30px; font-weight: 800; letter-spacing: -.8px; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.ov-kpi small { font-size: 12px; font-weight: 600; }
.ov-kpi .up { color: var(--ok); } .ov-kpi .down { color: var(--bad); } .ov-kpi .warn { color: var(--warn); }
.ov-glance { margin-bottom: 16px; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, .9fr); gap: 16px; align-items: start; }
.ov-grid h2 { margin: 0; font-size: 17px; }
.ov-grid .page-sub { margin: 2px 0 0; }
.ov-bars { display: flex; align-items: stretch; gap: 10px; height: 220px; margin-top: 18px; }
.ov-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.ov-bar i { display: block; width: 100%; max-width: 30px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
.ov-bar.today i { background: linear-gradient(180deg, var(--accent), var(--accent-2)); box-shadow: var(--glow); }
.ov-n { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ov-bar.today .ov-n { color: var(--accent); }
.ov-d { font-size: 11.5px; color: var(--muted); }
.ov-bar.today .ov-d { color: var(--ink); font-weight: 700; }
.ov-releases { display: flex; flex-direction: column; }
.ov-releases h2 { margin-bottom: 8px; }
.ov-rel { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--line); color: var(--text); }
.ov-rel:first-of-type { border-top: 0; }
.ov-rel:hover { text-decoration: none; background: color-mix(in srgb, var(--chip) 45%, transparent); border-radius: 10px; }
.ov-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.ov-dot.ok { background: var(--ok); } .ov-dot.warn { background: var(--warn); } .ov-dot.bad { background: var(--bad); }
.ov-rel-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ov-rel-name b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-rel-name code { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-side { display: flex; flex-direction: column; gap: 16px; }
.ov-build { display: flex; align-items: center; gap: 14px; color: var(--text); transition: transform .18s, box-shadow .18s; }
.ov-build:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-hi); }
.ov-build b { display: block; font-size: 15px; color: var(--ink); }
.ov-build small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ov-build-ico { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--muted); background: var(--chip); }
.ov-build-ico.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.ov-build-ico.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.ov-build-ico.run { color: var(--run); background: color-mix(in srgb, var(--run) 13%, transparent); }
.ov-build-ico.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.ov-assist { display: flex; flex-direction: column; gap: 10px; }
.ov-assist-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.ov-assist-head b { display: block; font-size: 15px; color: var(--ink); }
.ov-assist-head small { display: block; font-size: 12px; font-weight: 600; color: var(--ok); }
.ov-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: var(--glow); }
.ov-avatar .ico { width: 19px; height: 19px; }
.ov-q { align-self: flex-end; max-width: 100%; padding: 8px 14px; border-radius: 14px; background: var(--grad-btn); color: #fff; font-size: 13px; font-weight: 500; }
.ov-q:hover { text-decoration: none; filter: brightness(1.07); }
.ov-open { margin-top: 4px; font-weight: 700; font-size: 13.5px; }
@media (max-width: 1200px) { .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ov-side { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ov-kpis, .ov-grid, .ov-side { grid-template-columns: 1fr; } .ov-kpi b { font-size: 26px; } .ov-bars { height: 180px; gap: 6px; } }
.ov-grid { align-items: stretch; }
.ov-chart { display: flex; flex-direction: column; }
.ov-chart .ov-bars { flex: 1; min-height: 220px; height: auto; }
.ov-side { align-self: start; }
