/* Noetics Cloud. Colors, type and shapes follow noeticerp.com and the Noetics logo:
   green #0B7944 (primary), near-black #201C20, the logo's yellow and red as small
   accents; Poppins for text, Work Sans for headings (fonts/OFL-*.txt). */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/poppins-400.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/poppins-500.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/poppins-600.woff2) format("woff2"); }
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 500 700; font-display: swap; src: url(fonts/work-sans-variable.woff2) format("woff2"); }

:root {
  --brand-green: #0B7944; --brand-ink: #201C20; --brand-yellow: #FFDE59; --brand-red: #AB1E0A;
  --bg: #F5F6F4; --panel: #FFFFFF; --ink: #201C20; --muted: #5C625E; --line: #E0E4E0;
  --accent: #0B7944; --accent-hover: #08603A; --accent-ink: #FFFFFF; --accent-soft: #E4F2EA;
  --ok: #0B7944; --ok-bg: #E4F2EA;
  --bad: #AB1E0A; --bad-bg: #FBEAE6;
  --reverted: #8A5300; --reverted-bg: #FFF3CF;
  --running: #1D5FA6; --running-bg: #E5EEF9;
  --muted-bg: #EDEFEC;
  --code-bg: #EDEFEC;
  --log-bg: #201C20; --log-ink: #E8E6E3;
  --shadow: 0 1px 2px rgba(32, 28, 32, 0.06), 0 6px 18px rgba(32, 28, 32, 0.06);
  --radius: 12px; --radius-sm: 8px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Work Sans", "Poppins", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151315; --panel: #201C20; --ink: #F0EFEC; --muted: #A9AEAA; --line: #37323A;
    --accent: #3FBF80; --accent-hover: #5ED196; --accent-ink: #0D1F15; --accent-soft: #15301F;
    --ok: #5ED196; --ok-bg: #15301F;
    --bad: #FF8E7E; --bad-bg: #3B1812;
    --reverted: #FFD166; --reverted-bg: #3A2E0C;
    --running: #8AB8FF; --running-bg: #14284D;
    --muted-bg: #2A252C; --code-bg: #2A252C;
    --log-bg: #0F0D0F; --log-ink: #E8E6E3;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 1.7rem; margin: 0.4rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.6rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 0.4rem; }
h2 a { color: var(--ink); text-decoration: none; }
h2 a:hover { color: var(--accent); }
code, pre { font: 0.88em var(--font-mono); }
code { background: var(--code-bg); padding: 0.1em 0.4em; border-radius: 5px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.muted { color: var(--muted); }
.wrapcode { word-break: break-all; }

/* Header: white bar, logo, a thin stripe in the logo's three line colors. */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: relative; }
.top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, var(--brand-green) 0 72%, var(--brand-yellow) 72% 88%, var(--brand-red) 88% 100%);
}
.top-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 10px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand img { display: block; height: 36px; width: auto; }
.brand-ops {
  font: 600 0.78rem/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent); padding: 5px 8px; border-radius: 6px;
}
.brand.big { margin: 0 0 1.2rem; }
.brand.big img { height: 44px; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
nav a, button.link {
  color: var(--ink); text-decoration: none; font-weight: 500; padding: 7px 10px; border-radius: var(--radius-sm);
}
nav a:hover, button.link:hover { background: var(--muted-bg); color: var(--ink); }
form.inline, .inline-form { display: inline; }
.inline-form { margin-left: 8px; }
button.link { background: none; border: 0; font: inherit; font-weight: 500; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  padding: 9px 18px; min-height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.danger:hover { filter: brightness(0.92); color: #fff; }
.btn.small { padding: 5px 12px; min-height: 36px; font-size: 0.88rem; }
.btn.wide { display: flex; width: 100%; text-align: center; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.panel, .block { padding: 4px 0 18px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.panel:last-child, .block:last-child { border-bottom: 0; }
.auth-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 0 0 16px; box-shadow: var(--shadow);
}
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.crumbs { color: var(--muted); font-size: 0.88rem; margin: 4px 0; }
.crumbs a { color: var(--muted); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.9rem; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 0;
  font-size: 0.88rem; font-weight: 500; color: var(--muted); max-width: 100%;
}
.pill .dot, .envnav .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; display: inline-block; }
.pill.ok, .dot.ok { color: var(--ok); }
.pill.bad, .dot.bad { color: var(--bad); }
.pill.reverted, .dot.reverted { color: var(--reverted); }
.pill.running, .pill.queued, .dot.running { color: var(--running); }
.dot.muted { color: var(--muted); opacity: 0.6; }
.pill.running .dot, .dot.running { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .pill.running .dot, .dot.running { animation: none; } .btn { transition: none; } }

.banner {
  border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; border: 1px solid var(--line);
  border-left-width: 4px; background: var(--muted-bg);
}
.banner p { margin: 6px 0 0; }
.banner.warn, .banner.amber { background: var(--reverted-bg); border-color: var(--reverted); }
.banner.red { background: var(--bad-bg); border-color: var(--bad); }
.banner.ok { background: var(--ok-bg); border-color: var(--ok); }
.flash { border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 14px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }
#flash:empty { display: none; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
td.btns { white-space: nowrap; }
td.btns form { display: inline-block; margin: 0 4px 4px 0; }

.actions { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.action { padding: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.action h3 { margin: 0; }
.action.danger { border-color: var(--bad); border-left-width: 4px; }
.action p { margin: 0; }

label { display: block; font-weight: 500; }
label input, label select { display: block; margin-top: 5px; font-weight: 400; }
input, select {
  font: inherit; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); max-width: 100%;
}
input:hover, select:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); vertical-align: -3px; margin: 0 6px 0 0; display: inline-block; }
.stack { display: grid; gap: 14px; }
.stack input { width: 100%; }
.row-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.copy-row { display: flex; gap: 8px; margin: 8px 0; }
.copy-row input { flex: 1; min-width: 0; font-family: var(--font-mono); }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 4px 0; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }

.log {
  background: var(--log-bg); color: var(--log-ink); padding: 14px; border-radius: var(--radius-sm); overflow: auto;
  max-height: 420px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 8px; font-size: 0.85rem;
}
.log.small { max-height: 220px; font-size: 0.8rem; }
.qr { margin: 8px 0 12px; }
.qr svg { display: block; border-radius: 6px; }
.logs-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.logs-bar select, .logs-bar input { font: inherit; padding: 4px 8px; }
.logs-bar input[type=search] { flex: 1; min-width: 160px; }
.logs-bar .muted { margin-left: auto; font-size: 0.85rem; }
.log.logs-pane { height: 60vh; max-height: none; font-size: 0.8rem; line-height: 1.45; white-space: pre; overflow-wrap: normal; }
.logs-pane span { display: block; }
.logs-pane .warning { color: #d9a400; }
.logs-pane .error { color: #ff6b6b; font-weight: 600; }
.logs-pane .debug { opacity: 0.65; }
.logs-pane time { opacity: 0.6; }
.mini-steps { margin: 0 0 10px; padding-left: 20px; }
.mini-steps li.now { font-weight: 600; color: var(--running); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 9px 0 9px 26px; position: relative; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline .mark { position: absolute; left: -8px; top: 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); }
.timeline li.now .mark { background: var(--running); }
.timeline li.bad .mark { background: var(--bad); }
.timeline li.bad .what { color: var(--bad); font-weight: 600; }
.timeline li.now .what { font-weight: 600; }
.commits { margin: 0; padding-left: 20px; }
.errline { overflow-wrap: anywhere; }
.codes { columns: 2; padding-left: 20px; font-family: var(--font-mono); }
.big-q { font-size: 1.15rem; }

/* Sign-in and consent pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; padding: 28px 26px; border-top: 4px solid var(--accent); }
.auth-card h1 { font-size: 1.45rem; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 16px 0; font-size: 0.9rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.consent-host { margin: 4px 0 12px; }
.consent-host code { display: inline-block; font-size: 1.15em; font-weight: 600; padding: 6px 10px; background: var(--accent-soft); color: var(--ink); }

@media (max-width: 560px) {
  body { font-size: 15px; }
  h1 { font-size: 1.4rem; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dt { margin-top: 8px; font-size: 0.82rem; }
  .btn { width: 100%; text-align: center; }
  .btn.small { width: auto; }
  .row-form > label, .row-form > label input, .row-form > label select, .row-form .btn { width: 100%; }
  .copy-row .btn { width: auto; }
  .brand img { height: 30px; }
  nav { gap: 2px; }
  nav a, button.link { padding: 6px 8px; }
  .auth-card { padding: 22px 18px; }
}
.logs-form { margin: 0 0 12px; }

/* In-page confirmation (ui.js) */
.confirm-dialog {
  max-width: min(440px, calc(100vw - 32px)); padding: 20px 22px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel); color: var(--ink); box-shadow: var(--shadow);
}
.confirm-dialog p { margin: 0 0 16px; font-weight: 500; }
.confirm-dialog .btns { justify-content: flex-end; }
.confirm-dialog::backdrop { background: rgba(32, 28, 32, 0.45); }

/* Shell: environment column on the left, the chosen environment on the right. */
.shell { padding-top: 20px; padding-bottom: 56px; display: block; }
.shell main { min-width: 0; }
.side-phone { display: block; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.side-phone > summary { cursor: pointer; padding: 10px 0; font-weight: 600; }
.side-desktop { display: none; }
@media (min-width: 800px) {
  .shell.has-side { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 0 32px; align-items: start; }
  .side-phone { display: none; }
  .side-desktop { display: block; position: sticky; top: 12px; }
}
.envnav { display: block; }
.envnav h3 { font: 600 0.72rem/1 var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 22px 0 6px; padding: 0 10px; }
.envnav h3:first-child, .envnav-inst + h3 { margin-top: 0; }
.envnav-inst { font-size: 1rem; margin: 14px 0 6px; padding: 0 10px; }
.envnav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.envnav li { margin: 0; padding: 0; }
.envnav a {
  display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; grid-template-areas: "dot name when" ". branch branch";
  align-items: center; gap: 1px 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-weight: 500; line-height: 1.3;
}
.envnav a:hover { background: var(--muted-bg); }
.envnav li.current a { background: var(--accent-soft); }
.envnav .dot { grid-area: dot; }
.envnav .env-name { grid-area: name; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.envnav .env-when { grid-area: when; font-size: 0.78rem; font-weight: 400; }
.envnav .env-branch { grid-area: branch; font-size: 0.8rem; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Settings sections: same column, plain links without the status dot. */
.envnav.sections a { display: block; }

.env-head { margin: 0 0 6px; }
.env-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.env-title h1 { margin: 0 0 4px; }
.env-facts { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 4px 0 12px; color: var(--muted); font-size: 0.92rem; }
.env-facts strong { color: var(--ink); font-weight: 500; }
.env-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn.quiet { border-color: transparent; background: none; color: var(--muted); font-weight: 500; }
.btn.quiet:hover { color: var(--ink); border-color: var(--line); }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 18px; }
.tabs a { padding: 9px 14px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0; }
.tabs a:hover { color: var(--ink); background: none; }
.tabs a.current { color: var(--ink); border-bottom-color: var(--accent); }
.tab-body h2 { margin-top: 22px; }
.tab-body h2:first-child, .right-now h2 { margin-top: 0; }
.right-now { margin: 0 0 18px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows li { padding: 12px 0; border-bottom: 1px solid var(--line); }
ul.rows .row-form { justify-content: space-between; align-items: center; }
.row-text { flex: 1 1 260px; }
.people select { min-height: 36px; padding: 4px 8px; }
.role-form { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.add-row td { background: var(--muted-bg); }
.add-row input { width: 100%; min-width: 150px; margin: 2px 0; }
.js .no-js-only { display: none; }
.filters { margin-bottom: 12px; }
.pager { display: flex; gap: 14px; align-items: center; }
