/* Fifteen design tokens (fifteen-design-system-vue): neutrals, primary, success, danger. */
:root {
  --text: #2a3039;
  --muted: #546171;
  --line: #e5ebed;
  --soft: #f8f9fa;
  --bg: #ffffff;
  --primary: #ff0062;
  --primary-text: #b7006b;
  --ok-bg: #e8fdf0;
  --ok-text: #195e6a;
  --warn-bg: #fff9e9;
  --warn-text: #7a431c;
  --bad-bg: #feecdd;
  --bad-text: #710f1f;
  --off-bg: #e5ebed;
  --off-text: #546171;
  --info-bg: #e3f1fd;
  --info-text: #0b4a7a;
  --accent-bg: #ffe6f0;
  --accent-text: #b7006b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #e5ebed;
    --muted: #a9b9c0;
    --line: #2a3039;
    --soft: #11151a;
    --bg: #0a0b0d;
    --primary-text: #ff6682;
    --ok-bg: #12332f;
    --ok-text: #b8f5db;
    --warn-bg: #3a2c12;
    --warn-text: #ffe9be;
    --bad-bg: #3d1a14;
    --bad-text: #f9b598;
    --off-bg: #2a3039;
    --off-text: #a9b9c0;
    --info-bg: #11304a;
    --info-text: #bfe0fb;
    --accent-bg: #4a1530;
    --accent-text: #ffc2d8;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
}
body > * { padding-inline: 16px; }
a, button, input, select, summary { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-block: 12px; border-bottom: 1px solid var(--line); }
header img { height: 28px; }
@media (prefers-color-scheme: dark) { header img { filter: invert(1); } }
header h1 { font-size: 1rem; font-weight: 600; margin: 0; }
header label { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); }
nav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
nav a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; }
nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
main { padding-block: 16px 48px; }
form.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
input, select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); min-height: 38px; }
input[type="search"] { flex: 1 1 200px; max-width: 320px; }
.nowrap { white-space: nowrap; }
button { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); cursor: pointer; min-height: 38px; }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.link { border: 0; background: none; padding: 0; min-height: 0; text-align: left; border-radius: 4px; color: var(--primary-text); font-weight: 500; cursor: pointer; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; color: var(--muted); padding-bottom: 8px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .85rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td small { display: block; color: var(--muted); }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .8rem; font-weight: 500; white-space: nowrap; }
.ok { background: var(--ok-bg); color: var(--ok-text); }
.warn { background: var(--warn-bg); color: var(--warn-text); }
.bad { background: var(--bad-bg); color: var(--bad-text); }
.off { background: var(--off-bg); color: var(--off-text); }
.msg { margin: 12px 0; padding: 10px 14px; border-radius: 8px; background: var(--soft); white-space: pre-wrap; }
.msg.error { background: var(--bad-bg); color: var(--bad-text); }
details.request { margin: 12px 0; color: var(--muted); }
details.request code, pre { background: var(--soft); border-radius: 8px; padding: 10px 12px; display: block; overflow-x: auto; white-space: pre-wrap; word-break: break-all; font-size: .8rem; color: var(--text); }
dialog { width: min(900px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); padding: 20px; }
dialog::backdrop { background: rgb(10 11 13 / .5); }
dialog h2 { margin: 0 0 4px; font-size: 1.1rem; }
dialog table { min-width: 0; table-layout: auto; }
dialog dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0; }
dialog dt { color: var(--muted); }
dialog dd { margin: 0; }
dialog h3 { font-size: .9rem; margin: 16px 0 6px; color: var(--muted); }
.more { margin-top: 12px; }
/* Columns: the short facts get a fixed narrow width, the name a share, and the texts
   (description, conditions) the rest; under the minimum width the table scrolls in its frame. */
table { table-layout: fixed; min-width: 980px; }
th.col-name { width: 15%; }
th.col-category { width: 6.5rem; }
th.col-trigger { width: 10.5rem; }
th.col-targets { width: 7rem; }
th.col-actions { width: 10rem; }
th.col-status { width: 8.5rem; }
th.col-when { width: 9.5rem; }
th.col-action { width: 11rem; }
th.col-result { width: 7.5rem; }
td.fit small { margin-top: 4px; }
td { overflow-wrap: break-word; }
.compact { font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-block; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); font-size: .75rem; line-height: 1.6; }
.chip.ok, .chip.warn, .chip.bad, .chip.off, .chip.info, .chip.accent { border-color: transparent; }
.chip.ok { background: var(--ok-bg); color: var(--ok-text); }
.chip.warn { background: var(--warn-bg); color: var(--warn-text); }
.chip.bad { background: var(--bad-bg); color: var(--bad-text); }
.chip.off { background: var(--off-bg); color: var(--off-text); }
.chip.info { background: var(--info-bg); color: var(--info-text); }
.chip.accent { background: var(--accent-bg); color: var(--accent-text); }
.info { background: var(--info-bg); color: var(--info-text); }
.accent { background: var(--accent-bg); color: var(--accent-text); }
.long p + ul.clauses { margin-top: .5em; }
/* Description and conditions: 3 lines, then "Show more". */
.long-body { max-height: calc(1.45em * 3); overflow: hidden; font-size: .88rem; line-height: 1.45; }
.long-body p { margin: 0; }
.long.clipped:not(.open) .long-body { -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.long.open .long-body { max-height: none; }
button.toggle { border: 0; background: none; padding: 2px 0 0; min-height: 0; font-size: .8rem; color: var(--primary-text); }
ul.clauses { margin: 0; padding-left: 1.1em; }
ul.clauses li { margin: 0; }
.long code, dialog ul.clauses code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--soft); border-radius: 4px; padding: 0 3px; overflow-wrap: anywhere; }
dialog ul.clauses { font-size: .9rem; }
@media (max-width: 640px) { header label { margin-left: 0; width: 100%; } header label input { flex: 1; } input[type="search"] { max-width: none; flex-basis: 100%; } }

a.link { color: var(--primary-text); font-weight: 500; text-decoration: none; }
a.link:hover, .crumb:hover { text-decoration: underline; }
#message { padding-block: 0; }
/* The page of one automation: a title, tabs, the content, a column on the right. */
.automation .title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.automation h1 { font-size: 1.25rem; margin: 0; }
.crumb { color: var(--muted); text-decoration: none; }
.banner { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); font-size: .85rem; }
nav.tabs { padding: 0; margin: 12px 0 16px; }
nav.tabs a { padding: 8px 14px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.layout aside { position: sticky; top: 12px; display: grid; gap: 16px; }
.main { display: grid; gap: 16px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--bg); min-width: 0; }
.panel > header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 0; margin-bottom: 10px; }
.panel h2 { font-size: .95rem; margin: 0; }
.panel h3 { font-size: .8rem; color: var(--muted); margin: 12px 0 4px; }
.proposed { font: .7rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 0 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text); overflow-wrap: anywhere; }
.panel details.shape { margin-top: 10px; color: var(--muted); font-size: .8rem; }
.panel details.shape pre { max-height: 240px; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: .9rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.note { color: var(--muted); font-size: .85rem; margin: 0 0 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; background: var(--soft); }
.kpi strong { font-size: 1.05rem; font-weight: 600; }
.kpi span { color: var(--muted); font-size: .8rem; }
.kpi small { color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
figure { margin: 0; }
figcaption { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.chart { width: 100%; height: auto; }
.bar.ok, .swatch.ok { fill: var(--ok-text); background: var(--ok-text); }
.bar.off, .swatch.off { fill: var(--muted); background: var(--muted); opacity: .55; }
.bar.bad, .swatch.bad { fill: var(--bad-text); background: var(--bad-text); }
.bar.target, .swatch.target { fill: var(--primary); background: var(--primary); opacity: .5; }
.axis { fill: var(--muted); font-size: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; font-size: .75rem; color: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.strip { display: flex; flex-wrap: wrap; gap: 5px; }
.dot { width: 14px; height: 14px; border-radius: 50%; }
.dot.ok { background: var(--ok-text); }
.dot.off { background: var(--muted); opacity: .5; }
.dot.bad { background: var(--bad-text); }
.chipbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chipbar button { border-radius: 10px; padding: 4px 14px; }
.chipbar button[aria-pressed="true"] { border-color: var(--primary); background: var(--soft); font-weight: 600; }
.chipbar b { margin-left: 4px; color: var(--muted); font-weight: 500; }
.buttons { display: grid; gap: 8px; }
.buttons .act { text-align: center; border-color: var(--primary); color: var(--primary-text); }
table.stages tr.stage th { background: var(--soft); color: var(--text); font-size: .85rem; }
button.edit { padding: 0 10px; min-height: 28px; font-size: .8rem; }
.bad-text { color: var(--bad-text); }
.block h3 { margin-top: 14px; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } .layout aside { position: static; } }
.compact .chip { display: inline-block; max-width: 100%; border-radius: 8px; white-space: normal; overflow-wrap: anywhere; }
