/* the hidden attribute always hides, also on components that set a display */
[hidden] { display: none !important; }

/* views.css: the content screens of 07 §6.2–6.8 (All, Files, Flows, Runs list, Secrets, Settings, Account). Tokens only. */

/* shared bits */
.filter-name { width: 240px; }
.filter-name .input { height: var(--h-sm); }
.filter-combo { min-width: 180px; max-width: 280px; }
.filter-combo .combo-box.multi { min-height: var(--h-sm); }
.filter-combo .input { height: var(--h-sm); }
.filter-row .select .select-trigger { height: var(--h-sm); }
.filter-chips[hidden] { display: none; }
.name-cell { display: flex; flex-direction: column; min-width: 0; }
.name-cell.row { flex-direction: row; align-items: center; gap: var(--s-2); }
.row-link { color: var(--ink); text-decoration: none; }
.row-link:hover { color: var(--accent); text-decoration: underline; }
.last-run { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--ink); text-decoration: none; }
.last-run:hover { text-decoration: underline; }
.last-run.ok .glyph { color: var(--ok); }
.last-run.fail .glyph { color: var(--fail); }
.last-run.warn .glyph { color: var(--warn); }
.last-run.accent .glyph { color: var(--accent); }
.last-run.idle .glyph { color: var(--ink-2); }
.warn-text { color: var(--ink); }
.warn-text .glyph { color: var(--warn); }
.howto { line-height: 20px; }
.group-title { font: var(--t-h3); margin: var(--s-2) 0 0; }
.stage-chip { font: var(--t-mono-small); color: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-1); padding: 0 var(--s-1); margin-left: auto; }
.kv-row { display: flex; gap: var(--s-2); align-items: flex-start; }
.kv-row > .field { flex: 1; }
.narrow { width: 96px; }
.table-wrap { max-height: calc(100vh - 220px); }
@media (max-width: 1279px) { .table .hide-m, .table th:has(+ th .hide-m) { } .view-all .table td.hide-m, .view-runs .table td.hide-m { display: none; } }

/* 6.2 All */
.view-all .view-head, .view-runs .view-head, .view-secrets .view-head { margin-bottom: var(--s-3); }

/* 6.3 Files */
.view-files { display: flex; flex-direction: column; height: 100%; max-width: none; }
.files-body { display: flex; min-height: 420px; height: calc(100vh - 200px); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); overflow: hidden; }
.files-tree { flex: none; overflow: auto; padding: var(--s-2); background: var(--surface); }
.files-tree .tree-up .tree-label { color: var(--ink-2); }
.pane-divider { width: 8px; flex: none; cursor: col-resize; position: relative; }
.pane-divider::after { content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.pane-divider:hover::after, .pane-divider:focus-visible::after { background: var(--accent); width: 2px; }
.files-contents { flex: 1; min-width: 0; overflow: auto; }
.files-contents .table-wrap { border: none; border-radius: 0; max-height: none; height: 100%; }
.top-crumb { min-width: 0; font: var(--t-h1); }
.top-crumb li { font: var(--t-h1); }
.inline-name { flex-direction: row; }
.inline-name .input { height: var(--h-sm); width: 240px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, 160px); gap: var(--s-4); padding: var(--s-4); }
.tile { width: 160px; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2); padding: var(--s-2);
        border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); cursor: pointer; color: var(--ink); }
.tile:hover { background: var(--surface-2); }
.tile .glyph { width: 32px; height: 32px; color: var(--ink-2); }
.tile.drop-target { outline: 2px solid var(--accent); }
.tile-name { font: var(--t-label); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-tree { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-1); padding: var(--s-1); }
.tree-row.blocked { color: var(--ink-3); cursor: not-allowed; }
@media (max-width: 1279px) { .files-tree { width: 200px !important; } }

/* 6.4 Flows */
.flows { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.flows-bar { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-4); background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.flows-stage { flex: 1; min-height: 0; position: relative; overflow: auto; }
.map { position: absolute; inset: 0; overflow: hidden; background-color: var(--bg);
       background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; cursor: grab; touch-action: none; }
.map.panning { cursor: grabbing; }
.map-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.map-lines { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.map-line path { fill: none; }
.map-line .line-main { stroke: var(--kind-link); stroke-width: 1.5; }
.map-line.wait .line-outer { stroke: var(--kind-link); stroke-width: 5; }
.map-line.wait .line-inner { stroke: var(--bg); stroke-width: 2; }
.map-line.refused .line-main, .map-line.refused .line-outer { stroke: var(--fail); stroke-dasharray: 6 4; }
.map-line.dim { opacity: .25; }
.map-line .line-hit { stroke: transparent; stroke-width: 14; cursor: pointer; pointer-events: stroke; }
.map-line:hover .line-main { stroke-width: 2.5; }
.map-arrowhead { fill: var(--kind-link); }
.line-marker rect { fill: var(--fail); }
.line-marker text { fill: var(--danger-ink); font: 600 12px/1 var(--font-sans); }
.line-pulse { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 16 2000; animation: pulse-dash .7s linear forwards; fill: none; }
@keyframes pulse-dash { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -800; } }
@media (prefers-reduced-motion: reduce) { .line-pulse { animation: none; stroke-dasharray: none; opacity: .6; } }
.map-ghost { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.map-blocks { position: absolute; left: 0; top: 0; }
.map-block { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-1); border-left: 4px solid var(--kind-link);
             display: flex; flex-direction: column; cursor: default; user-select: none; }
.map-block:hover { border-color: var(--line-strong); border-left-color: var(--kind-link); }
.map-block:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.map-block.dragging { box-shadow: var(--e-2); cursor: grabbing; }
.map-block.dim { opacity: .25; }
.map-block.drop-ok { outline: 2px solid var(--accent); }
.map-block.external { border-left-color: var(--kind-external); }
.map-block.rule { border-left-width: 8px; }
.block-head { height: 44px; display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-3); flex: none; cursor: grab; }
.block-name { font: 600 14px/20px var(--font-sans); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.external .block-head { height: 28px; padding-top: var(--s-2); }
.ext-address { padding: 0 var(--s-3); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--t-mono-small); }
.ext-note { padding: 0 var(--s-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-ports { display: flex; flex: 1; min-height: 0; }
.port-list { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.port-row { height: 24px; display: flex; align-items: center; gap: 6px; font: var(--t-small); color: var(--ink-2); position: relative; white-space: nowrap; overflow: visible; }
.port-list.in .port-row { padding-left: var(--s-2); }
.port-list.out .port-row { justify-content: flex-end; padding-right: var(--s-2); }
.port-text { overflow: hidden; text-overflow: ellipsis; }
.port-kind { color: var(--ink); }
.port-square { position: absolute; left: -11px; width: 10px; height: 10px; border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 2px; }
.port-circle { position: absolute; right: -6px; width: 10px; height: 10px; border: 1.5px solid var(--kind-link); background: var(--surface); border-radius: var(--r-round); }
.port-row.refused .port-circle { border-color: var(--fail); }
.block-foot { height: 30px; display: flex; align-items: center; padding: 0 var(--s-3); border-top: 1px solid var(--line); font: var(--t-small); flex: none; }
.link-handle { position: absolute; right: -9px; top: 13px; width: 18px; height: 18px; border-radius: var(--r-round); border: 1.5px solid var(--kind-link); background: var(--surface);
               color: var(--kind-link); display: none; align-items: center; justify-content: center; padding: 0; cursor: crosshair; }
.external .link-handle { top: 33px; border-color: var(--kind-external); color: var(--kind-external); }
.map-block:hover .link-handle, .map-block:focus-within .link-handle { display: inline-flex; }
.link-handle:hover { background: var(--accent-soft); }
.rule-chip { height: 20px; }
.flows-list { overflow: auto; height: 100%; }
.flow-outline { list-style: none; padding: 0; margin: 0 0 var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.flow-outline ul { margin: var(--s-1) 0 0 var(--s-5); padding: 0; color: var(--ink-2); font: var(--t-small); }
.target-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-1); padding: var(--s-2); }
.target-row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-1) 0; }
.target-row.refused { color: var(--ink-3); }
.rule-request { align-items: flex-start; }
.rule-request .field:last-child { flex: 1; }
.path-prefix { position: absolute; left: var(--s-2); color: var(--ink-2); pointer-events: none; }
.rule-request .input-box .input { padding-left: 40px; }
.rule-schedule { align-items: flex-end; }

/* 6.5 Runs */
.runs-table-wrap { position: relative; }
.new-runs-pill { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); z-index: 2; display: inline-flex; align-items: center; gap: var(--s-1);
                 height: 28px; padding: 0 var(--s-3); border-radius: 14px; border: none; background: var(--accent); color: var(--accent-ink); font: var(--t-label); cursor: pointer; box-shadow: var(--e-2); }
.new-runs-pill[hidden] { display: none; }

/* 6.6 Secrets */
.secret-form .group-title { margin-top: var(--s-3); }

/* 6.7 Settings */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 800px); gap: var(--s-6); align-items: start; }
.settings-nav ul { gap: 2px; }
.settings-nav a { display: flex; align-items: center; gap: var(--s-2); height: 36px; padding: 0 var(--s-3); border-radius: var(--r-1); color: var(--ink-2); text-decoration: none; font: var(--t-label); }
.settings-nav a:hover { background: var(--surface-2); color: var(--ink); }
.settings-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.settings-nav-select { display: none; }
.page-title { font: var(--t-h1); margin: 0 0 var(--s-1); }
.settings-body { margin-top: var(--s-4); max-width: 800px; }
.settings-body .table-wrap { max-height: none; }
.saved-mark.fail { color: var(--fail); }
.command-row code { word-break: break-all; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-5); margin: 0; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
.feature-row { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.method-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); }
.mono-list li { padding: 2px 0; }
@media (max-width: 1279px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
  .settings-nav { display: none; }
  .settings-nav-select { display: flex; max-width: 280px; }
}

/* 6.8 Account */
.account-view { max-width: 640px; }
.account-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--s-5); }
.account-section + .account-section { margin-top: var(--s-4); }

/* density (Account > Appearance) */
.density-compact .table td { height: 32px; }
.density-compact .tree-row { height: 24px; }

/* Folders are green and stand out from choreographies wherever they appear:
   Files tree, Files list and tiles, folder tags in All, folder parts of the canvas path. */
.tree-row.is-folder > .glyph,
.name-cell.is-folder > .glyph,
.tile.is-folder > .glyph { color: var(--ok); }
.tree-row.is-folder .tree-label { font-weight: 500; }
.tree-row.is-folder.selected { box-shadow: inset 3px 0 0 var(--ok); }
tr.row-folder > td { background: var(--ok-soft); }
tr.row-folder > td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
tr.row-folder[aria-selected="true"] > td { background: var(--accent-soft); }
tr.row-folder:hover > td { background: color-mix(in srgb, var(--ok-soft) 70%, var(--ok) 12%); }
.name-cell.is-folder .cell-main { font-weight: 600; color: var(--ink); }
.tile.is-folder { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.tile.is-folder:hover { border-color: var(--ok); }
.chip.is-folder { background: var(--ok-soft); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 40%, transparent); }
button.chip.is-folder:hover { background: color-mix(in srgb, var(--ok-soft) 70%, var(--ok) 15%); }
.chip.is-folder::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none; }
.canvas-crumbs li.is-folder > a { color: var(--ok); font-weight: 500; }

/* Runs: folder › choreography (folders green, each a link to the folder in Files) */
.run-chor { display: inline-flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; }
.run-folder { display: inline-flex; align-items: center; gap: 3px; color: var(--ok); text-decoration: none; font: var(--t-small); font-weight: 500; white-space: nowrap; }
a.run-folder:hover { text-decoration: underline; }
.run-folder > .glyph { color: var(--ok); }
.run-sep { color: var(--ink-3); font: var(--t-small); }

/* Archive */
.view-archive .archive-intro { display: flex; align-items: center; gap: 6px; margin: 0; }
.archive-path { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* Szenarios (2026-10-08): two kinds, two icons, two colours: weave Szenario (violet), outside app (teal) */
.tree-row.tree-area .tree-label { font-weight: 600; }
.tree-row.tree-area.is-sz > .glyph { color: var(--sz); }
.name-cell .glyph-scenario-weave, .tile .glyph-scenario-weave, .browser-entry .glyph-scenario-weave { color: var(--sz); }
.name-cell .glyph-scenario-app, .tile .glyph-scenario-app, .browser-entry .glyph-scenario-app { color: var(--app); }
tr.row-scenario > td:first-child { box-shadow: inset 3px 0 0 var(--sz); }
tr.row-scenario:has(.glyph-scenario-app) > td:first-child { box-shadow: inset 3px 0 0 var(--app); }
.tile.is-scenario { border-color: color-mix(in srgb, var(--sz) 40%, var(--line)); }
.tile.is-scenario:has(.glyph-scenario-app) { border-color: color-mix(in srgb, var(--app) 40%, var(--line)); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: var(--s-2); align-items: baseline; }
.kv-k { color: var(--ink-2, var(--muted)); font-size: 0.9em; }
.kv-v { overflow-wrap: anywhere; }
.sz-filter { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin: var(--s-2) 0; }
.browser-entry.is-sz .browser-name::after { content: attr(data-badge); margin-left: 6px; font-size: 11px; padding: 0 5px; border-radius: 4px; background: var(--sz-soft); color: var(--sz); }
.browser-entry.is-app .browser-name::after { content: attr(data-badge); margin-left: 6px; font-size: 11px; padding: 0 5px; border-radius: 4px; background: var(--app-soft); color: var(--app); }

/* Szenarios on the canvas (2026-10-08): taller, framed and labelled, so a choreography reads as "made of Szenarios" */
.rail.is-szenario { box-shadow: 0 0 0 2px var(--sz), 0 4px 14px color-mix(in srgb, var(--sz) 22%, transparent); background: color-mix(in srgb, var(--sz-soft) 55%, var(--surface, #fff)); }
.rail.is-szenario.is-app { box-shadow: 0 0 0 2px var(--app), 0 4px 14px color-mix(in srgb, var(--app) 22%, transparent); background: color-mix(in srgb, var(--app-soft) 55%, var(--surface, #fff)); }
.rail.is-szenario .card-label { font-size: 15px; font-weight: 650; }
.rail.is-szenario.selected { box-shadow: 0 0 0 3px var(--accent), 0 4px 14px color-mix(in srgb, var(--sz) 30%, transparent); }
.sz-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--sz); background: var(--sz-soft); border-radius: 4px; padding: 1px 6px; margin-bottom: 3px; width: max-content; }
.rail.is-app .sz-badge { color: var(--app); background: var(--app-soft); }

/* Pulse (spec 13): four bands; health in the Szenario colours, never colour alone (text in tooltip and label) */
.pulse { display: flex; flex-direction: column; gap: var(--s-4); }
.pulse-controls { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.pulse-band { display: flex; flex-direction: column; gap: var(--s-2); }
.pulse-calm { display: flex; align-items: center; gap: 6px; color: var(--ok); }
.pulse-needs li { display: flex; align-items: center; gap: var(--s-2); padding: 6px 0; border-bottom: 1px solid var(--line); }
.pulse-rows .pulse-row { display: flex; align-items: center; gap: var(--s-2); padding: 6px 0; border-bottom: 1px solid var(--line); }
.pulse-name { font-weight: 600; text-align: left; }
.pulse-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pulse-num { min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }
.sz-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface, transparent); }
.health-fine { border-color: var(--ok); } .health-some { border-color: var(--warn); } .health-poor { border-color: var(--fail); background: var(--fail-soft); }
.health-idle { opacity: 0.7; } .health-offline { border-style: dashed; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.health-dot.health-fine { background: var(--ok); } .health-dot.health-some { background: var(--warn); } .health-dot.health-poor { background: var(--fail); }
.rhythm { display: grid; gap: 2px; }
.rhythm-row { display: grid; grid-template-columns: 3.5em repeat(24, 1fr); gap: 2px; align-items: center; }
.rhythm-day { font-size: 12px; color: var(--muted, inherit); }
.rhythm-cell { height: 16px; border-radius: 3px; position: relative; background: color-mix(in srgb, var(--accent) calc(var(--level) * 100%), var(--line)); }
.rhythm-cell.has-failed::after { content: ""; position: absolute; top: 0; right: 0; border-top: 6px solid var(--fail); border-left: 6px solid transparent; }
.pulse-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-3); }
.pulse-figure { display: flex; flex-direction: column; }
.pulse-figure-value { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pulse-head { display: flex; align-items: center; gap: var(--s-2); font-size: 12px; }
.pulse-head .pulse-num, .pulse-rows .pulse-num { min-width: 6ch; font-size: 14px; }
.pulse-head .pulse-num { font-size: 12px; }
