/* orch console. One accent, neutral surfaces, status as a dot plus a word. */
:root {
  --bg: #f7f7f5; --panel: #ffffff; --sunk: #f1f1ee; --line: #e4e3df; --line-strong: #d3d2cc;
  --text: #1c1c1a; --text-2: #5d5c57; --text-3: #8b8a84;
  --accent: #2563d4; --accent-text: #1d4fae; --accent-bg: #eaf1fd; --on-accent: #ffffff;
  --ok: #1f8a4c; --warn: #b7791f; --bad: #c2352b; --idle: #9a9993;
  --bad-bg: #fcefee; --warn-bg: #fdf5e6;
  --s1: #2a78d6; --s2: #eb6834; --grid: #e8e7e2; --axis: #c9c8c1;
  --radius: 6px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --panel: #1c1c1b; --sunk: #232321; --line: #2e2e2c; --line-strong: #3d3d3a;
    --text: #ececea; --text-2: #a9a8a2; --text-3: #7c7b76;
    --accent: #4b8bf0; --accent-text: #8cb4f7; --accent-bg: #1b2b46; --on-accent: #0b1220;
    --ok: #3fb26d; --warn: #d9a03a; --bad: #e5675d; --idle: #6f6e69;
    --bad-bg: #3a1e1c; --warn-bg: #3a2e17;
    --s1: #3987e5; --s2: #d95926; --grid: #2a2a28; --axis: #3a3a37;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 13px; font-weight: 600; margin: 0; }
p { margin: 0 0 8px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
[hidden] { display: none !important; }

/* layout: a sidebar with the sections, the page beside it */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px; }
.brand { font-weight: 650; letter-spacing: -0.02em; color: var(--text); font-size: 16px; padding: 0 10px 18px; display: block; }
.brand:hover { text-decoration: none; }
.navgroup { margin-bottom: 18px; }
.navgroup .label { font-size: 11.5px; color: var(--text-3); padding: 0 10px 6px; display: flex; align-items: center; gap: 6px; }
.nav { display: block; color: var(--text-2); padding: 6px 10px; border-radius: var(--radius); font-size: 13.5px; }
.nav:hover { color: var(--text); background: var(--sunk); text-decoration: none; }
.nav.on { color: var(--text); background: var(--sunk); font-weight: 550; }
.nav .count { float: right; font-size: 11.5px; color: var(--text-2); background: var(--warn-bg); border-radius: 9px; padding: 0 7px; }
.side .foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.side .me { font-size: 12.5px; color: var(--text-2); padding: 4px 10px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { display: none; }

/* page */
.main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 32px 72px; }
.shell .main { margin: 0; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.head .grow { flex: 1; }
.crumbs { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.crumbs a { color: var(--text-2); }
.section { margin-top: 28px; }
.section > h2 { display: flex; align-items: center; gap: 8px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.pad { padding: 16px 18px; }

/* buttons and fields */
button, .btn { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--text); cursor: pointer; line-height: 1.4; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
button:hover, .btn:hover { background: var(--sunk); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 550; }
button.primary:hover, .btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
button.danger { color: var(--bad); }
button.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
button.ghost { border-color: transparent; background: transparent; color: var(--text-2); padding: 4px 8px; }
button.ghost:hover { background: var(--sunk); color: var(--text); }
button:disabled { opacity: 0.55; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: inherit; font-size: 13.5px; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 7px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
input[type=checkbox] { width: auto; margin: 0; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12.5px; font-weight: 550; margin-bottom: 5px; }
.help { font-size: 12.5px; color: var(--text-2); margin-top: 5px; }
.err { font-size: 12.5px; color: var(--bad); margin-top: 6px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 14px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.formfoot { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 6px; }

/* status */
.st { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--idle); flex: none; }
.st.ok::before { background: var(--ok); } .st.warn::before { background: var(--warn); } .st.bad::before { background: var(--bad); }
.st.busy::before { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .st.busy::before { animation: none; } }
.tag { display: inline-block; font-size: 11.5px; color: var(--text-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; line-height: 18px; margin-right: 4px; white-space: nowrap; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 550; font-size: 12px; color: var(--text-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.link { cursor: pointer; }
.table tr.link:hover td { background: var(--sunk); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .nw { white-space: nowrap; }
.tablewrap { overflow-x: auto; }

/* numbers */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.stat .k { font-size: 12.5px; color: var(--text-2); }
.stat .v { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* tabs */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin: 0 0 22px; }
.tabs a { color: var(--text-2); padding: 0 0 10px; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--text); font-weight: 550; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: none; border-radius: 0; padding: 4px 10px; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--sunk); font-weight: 550; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: baseline; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.list li:last-child { border-bottom: none; }
.list .when { margin-left: auto; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.empty { padding: 40px 24px; text-align: center; }
.empty h2 { margin-bottom: 6px; }
.empty p { color: var(--text-2); max-width: 460px; margin: 0 auto 16px; }

/* notes */
.note { border: 1px solid var(--line); background: var(--sunk); border-radius: 8px; padding: 12px 14px; font-size: 13px; color: var(--text-2); }
.note.warn { background: var(--warn-bg); border-color: transparent; color: var(--text); }
.note.bad { background: var(--bad-bg); border-color: transparent; color: var(--text); }
.secret { display: flex; gap: 8px; align-items: center; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.secret code { font-family: var(--mono); font-size: 12.5px; word-break: break-all; flex: 1; }

/* logs */
.log { background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font: 12px/1.6 var(--mono);
  color: var(--text); white-space: pre-wrap; word-break: break-word; max-height: 560px; overflow: auto; margin: 0; }

/* meters in tables */
.meter { display: flex; align-items: center; gap: 8px; min-width: 120px; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.meter .track { flex: 1; height: 5px; background: var(--sunk); border-radius: 3px; overflow: hidden; max-width: 90px; }
.meter .track i { display: block; height: 100%; background: var(--text-3); }
.meter .track i.warn { background: var(--warn); } .meter .track i.bad { background: var(--bad); }

/* sign-in */
.auth { max-width: 380px; margin: 9vh auto 0; }
.auth .brand { display: block; font-size: 20px; margin: 0 0 22px; }
.auth h1 { font-size: 18px; margin-bottom: 4px; }
.auth .panel { padding: 22px 22px 8px; }
.auth button.primary { width: 100%; justify-content: center; padding: 8px; margin: 4px 0 16px; }

/* env editor */
.kv { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; margin-bottom: 8px; }

/* charts (follows the chart guidelines: thin lines, hairline grid, crosshair tooltip, table view) */
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.chart { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 8px; }
.ch-head { display: flex; align-items: baseline; justify-content: space-between; }
.ch-val { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-sub { font-size: 12px; color: var(--text-2); min-height: 18px; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart .grid { stroke: var(--grid); stroke-width: 1; } .chart .axisline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--text-3); font-size: 10.5px; font-family: var(--font); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { stroke: none; opacity: 0.1; }
.chart .s1 { stroke: var(--s1); fill: var(--s1); } .chart .s2 { stroke: var(--s2); fill: var(--s2); }
.chart .line.s1, .chart .line.s2 { fill: none; }
.chart .dot { stroke: var(--panel); stroke-width: 2; }
.chart .cross { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .bar { fill: var(--s1); } .chart .bar.err { fill: var(--s2); }
.chart .barhit { fill: transparent; } .chart .barhit:hover + .bar, .chart .bar.hl { opacity: 0.75; }
.tip { position: absolute; z-index: 2; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 9px; font-size: 12px; pointer-events: none; white-space: nowrap; }
.tip .tt { color: var(--text-2); margin-bottom: 2px; }
.tip .tr { display: flex; align-items: center; gap: 6px; }
.tip .key, .legend .key { width: 12px; height: 0; border-top: 2px solid; display: inline-block; }
.key.s1 { border-color: var(--s1); } .key.s2 { border-color: var(--s2); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin: 2px 0 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 6px; font-size: 13px; z-index: 20; }

/* deploy progress */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.step { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel); }
.step .t { font-size: 13px; font-weight: 550; display: flex; align-items: center; gap: 7px; }
.step .d { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.step.now { border-color: var(--accent); }
.step.bad { border-color: var(--bad); }
.step.wait .t { color: var(--text-3); }
.addr { display: inline-flex; align-items: center; gap: 6px; }
.copybtn { font-size: 11.5px; padding: 1px 7px; }
.getstart ol { margin: 0; padding-left: 20px; }
.getstart li { margin-bottom: 16px; }
.getstart li p { margin-bottom: 6px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; text-align: left; margin-top: 8px; }
.choice { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; color: var(--text); background: var(--panel); }
.choice:hover { border-color: var(--line-strong); text-decoration: none; background: var(--sunk); }
.choice h3 { margin-bottom: 4px; }
.choice p { color: var(--text-2); font-size: 12.5px; margin: 0; }
.dirty { font-size: 12.5px; color: var(--warn); }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-content: start; }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 2px;
    padding: 8px 10px; border-right: none; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .brand { padding: 0 10px 0 4px; }
  .navgroup { margin: 0; display: flex; flex-wrap: nowrap; gap: 2px; align-items: center; }
  .navgroup + .navgroup { border-left: 1px solid var(--line); padding-left: 4px; margin-left: 4px; }
  .navgroup .label { display: none; }
  .nav { white-space: nowrap; padding: 6px 8px; }
  .side .foot { margin: 0 0 0 auto; border: none; padding: 0; display: flex; gap: 2px; }
  .side .me { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .main { padding: 20px 16px 48px; }
  .hide-sm { display: none; }
  .table th, .table td { padding: 9px 10px; }
}
