/*
 * ProcessHub base stylesheet: layout and components only.
 * Colours, fonts and radii come from the active theme (themes/<name>/theme.css),
 * which only defines the CSS custom properties below.
 */
:root {
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, Consolas, monospace;
    --bg: #f5f6f8; --surface: #fff; --surface-2: #f0f2f5; --text: #1d2330; --muted: #677085;
    --border: #dde1e8; --primary: #2457c5; --primary-contrast: #fff; --danger: #c23434;
    --success: #1f8a4c; --warning: #b7791f; --topbar-bg: #1d2330; --topbar-text: #fff;
    --sidebar-bg: #fff; --sidebar-active: #e8eefb; --radius: 8px; --gap: 16px;
    --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
    --sidebar-width: 240px; --topbar-height: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 var(--gap); }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
img { max-width: 100%; height: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.inline { display: inline; }
.hidden { display: none !important; }

/* ---------- Shell ---------- */
.topbar {
    position: sticky; top: 0; z-index: 20; height: var(--topbar-height);
    display: flex; align-items: center; gap: var(--gap); padding: 0 var(--gap);
    background: var(--topbar-bg); color: var(--topbar-text);
}
.topbar a, .topbar .link-button { color: var(--topbar-text); }
.brand { font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; }
.brand-logo { height: 30px; width: auto; max-width: 140px; object-fit: contain; }
.topbar-search { flex: 1; max-width: 520px; }
.topbar .topbar-search input[type=search] { width: 100%; border: 0; border-radius: var(--radius); padding: 8px 12px; background: rgba(255,255,255,.14); color: var(--topbar-text); }
.topbar .topbar-search input[type=search]::placeholder { color: rgba(255,255,255,.7); }
.topbar-user { margin-left: auto; display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.nav-toggle { display: none; }
.hamburger { display: none; cursor: pointer; width: 28px; }
.hamburger span { display: block; height: 2px; margin: 5px 0; background: var(--topbar-text); }

.shell { display: flex; min-height: calc(100vh - var(--topbar-height)); }
.sidebar {
    width: var(--sidebar-width); flex-shrink: 0; background: var(--sidebar-bg);
    border-right: 1px solid var(--border); padding: 12px 0; display: flex; flex-direction: column;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: block; padding: 8px 20px; color: var(--text); }
.sidebar a:hover { background: var(--surface-2); text-decoration: none; }
.sidebar a.active { background: var(--sidebar-active); color: var(--primary); font-weight: 600; border-right: 3px solid var(--primary); }
.sidebar-section { padding: 16px 20px 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sidebar-footer { margin-top: auto; padding: 12px 20px; font-size: .75rem; color: var(--muted); }
.content { flex: 1; min-width: 0; padding: 24px; max-width: 1400px; }

.center-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--gap); }

@media (max-width: 860px) {
    .hamburger { display: block; }
    .sidebar {
        position: fixed; top: var(--topbar-height); bottom: 0; left: 0; z-index: 15;
        transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow);
    }
    .nav-toggle:checked ~ .shell .sidebar { transform: translateX(0); }
    .content { padding: var(--gap); }
    .topbar-user a { display: none; }
}
@media (max-width: 520px) {
    .brand { display: none; }
}

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: var(--gap); }
.card.narrow { width: 100%; max-width: 420px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-header h2 { margin: 0; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: var(--gap); flex-wrap: wrap; }
.page-header h1 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-header .actions input, .page-header .actions select, .card-header .actions input, .card-header .actions select { width: auto; min-width: 160px; }
@media (max-width: 600px) { .page-header .actions, .page-header .actions form { width: 100%; } .page-header .actions input, .page-header .actions select { flex: 1; } }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; }
@media (max-width: 1100px) { .layout-main-side { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.btn {
    display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
    color: var(--text); padding: 7px 14px; border-radius: var(--radius); cursor: pointer; font: inherit; line-height: 1.3;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-small { padding: 3px 9px; font-size: .85rem; }
.link-button { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; }

.form-row { margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .9rem; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input[type=url], select, textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.field-error { color: var(--danger); font-size: .85rem; margin-top: 2px; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: var(--gap); border: 1px solid; width: 100%; max-width: 1400px; }
.alert-success { background: color-mix(in srgb, var(--success) 10%, var(--surface)); border-color: var(--success); }
.alert-error { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border-color: var(--danger); }
.alert-info { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border-color: var(--primary); }
.center-page .alert { max-width: 420px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:hover td { background: var(--surface-2); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.badge-success { color: var(--success); border-color: var(--success); }
.badge-warning { color: var(--warning); border-color: var(--warning); }
.badge-danger { color: var(--danger); border-color: var(--danger); }
.badge-primary { color: var(--primary); border-color: var(--primary); }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 6px 0; border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.list-plain li:last-child { border-bottom: 0; }
.empty { color: var(--muted); font-style: italic; padding: 8px 0; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: .9rem; margin-bottom: 8px; color: var(--muted); }
.breadcrumb a::after { content: "›"; margin-left: 6px; color: var(--muted); }

/* ---------- Tree view ---------- */
.tree, .tree ul { list-style: none; margin: 0; padding-left: 18px; }
.tree { padding-left: 0; }
.tree li { margin: 2px 0; }
.tree li.company-hidden { display: none !important; }
.tree details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.tree details > summary::-webkit-details-marker { display: none; }
.tree details > summary::before { content: "▸"; width: 14px; display: inline-block; color: var(--muted); transition: transform .15s; }
.tree details[open] > summary::before { transform: rotate(90deg); }
.tree .leaf { display: flex; align-items: center; gap: 6px; padding-left: 20px; }
.tree .node-meta { font-size: .8rem; color: var(--muted); }

/* ---------- Content blocks ---------- */
.block { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; background: var(--surface); }
.block-toolbar { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 8px; flex-wrap: wrap; }
.block-type { margin-right: auto; align-self: center; }
.block-text { overflow-wrap: anywhere; }
.block-image figure, .block-diagram figure { margin: 0; text-align: center; }
.block-image figcaption, .block-diagram figcaption { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.diagram-frame { width: 100%; height: 75vh; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.editor-area { min-height: 300px; background: var(--surface); }

/* ---------- Search ---------- */
.search-result { padding: 12px 0; border-bottom: 1px solid var(--border); }
.search-result h3 { margin: 0 0 4px; }
.search-result .snippet { color: var(--muted); font-size: .9rem; }
.search-result mark { background: color-mix(in srgb, var(--warning) 30%, transparent); color: inherit; padding: 0 2px; }

.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); }
code, pre { font-family: var(--font-mono); }
pre.token { background: var(--surface-2); padding: 12px; border-radius: var(--radius); overflow-wrap: anywhere; white-space: pre-wrap; }

/* ---------- Public section ---------- */
.topbar-label { color: var(--topbar-text); opacity: .75; font-size: .9rem; }
.public-content { margin: 0 auto; width: 100%; }
.ask-answer { white-space: pre-wrap; margin-top: 4px; }
.ask-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.ask-item:last-child { border-bottom: 0; }

/* ---------- Video / audio blocks ---------- */
.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder { aspect-ratio: 16 / 9; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); padding: 16px; text-align: center; overflow-wrap: anywhere; }
.block-video figure, .block-audio figure { margin: 0; text-align: center; }
.block-video figcaption, .block-audio figcaption { color: var(--muted); font-size: .9rem; margin-top: 6px; }

/* Key/value list (process review card) */
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0 0 12px; }
.meta-list dt { color: var(--muted); font-size: .9em; }
.meta-list dd { margin: 0; }
.badge-danger, a.badge-danger { color: var(--danger); border-color: var(--danger); }

/* Reports */
.report-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.report-filters .form-row { margin: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.overdue-high { color: var(--danger); font-weight: 600; }

/* Grouped form fields */
.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 4px; margin: 0 0 14px; }
.fieldset legend { font-weight: 600; font-size: .9rem; padding: 0 6px; }

/* Approval workflow */
.card-attention { border-left: 4px solid var(--primary); }
.wf-status { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.wf-steps { display: flex; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: wf; }
.wf-steps li { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); padding-top: 22px; position: relative; counter-increment: wf; }
.wf-steps li::before { content: counter(wf); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; line-height: 18px;
    border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: .7rem; z-index: 1; }
.wf-steps li:not(:first-child)::after { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 1px; background: var(--border); }
.wf-steps li.done { color: var(--text); }
.wf-steps li.done::before { content: "✓"; background: var(--success, #2f855a); border-color: var(--success, #2f855a); color: #fff; }
.wf-steps li.current { color: var(--primary); font-weight: 600; }
.wf-steps li.current::before { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
.wf-actions { margin: 12px 0 6px; }
.wf-reject summary, .wf-versions summary, .wf-log summary { cursor: pointer; }
.wf-reject summary { display: inline-flex; list-style: none; margin: 4px 0 8px; }
.wf-reject summary::-webkit-details-marker { display: none; }
.wf-versions, .wf-log { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.wf-versions summary, .wf-log summary { font-weight: 600; font-size: .9rem; }
.wf-comment { background: var(--surface-2); border-radius: var(--radius); padding: 6px 8px; margin-top: 4px; }
a[aria-current="true"] { font-weight: 700; }
.version-banner a { margin-left: 6px; font-weight: 600; }
.alert-warning { background: color-mix(in srgb, var(--warning) 12%, var(--surface)); border-color: var(--warning); }

/* Diagram with clickable links (sandboxed frame) */
iframe.diagram-view { display: block; width: 100%; height: auto; border: 0; margin: 0 auto; background: transparent; }
.diagram-editor-wrap { display: flex; gap: 12px; align-items: stretch; }
.diagram-editor-wrap .diagram-frame { flex: 1; min-width: 0; }
.diagram-links { width: 280px; flex: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 80vh; }
.diagram-links h3 { margin: 0; font-size: 1rem; }
.diagram-links ul { overflow-y: auto; margin: 0; }
.diagram-links li { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.diagram-links li.diagram-links-group { font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; margin-top: 6px; }
.diagram-links .hidden, .diagram-links.hidden { display: none; }
@media (max-width: 900px) { .diagram-editor-wrap { flex-direction: column; } .diagram-links { width: auto; max-height: 40vh; } }

/* Questionnaires */
.qn-form .qn-question { padding: 10px 0 12px; border-bottom: 1px solid var(--border); margin: 0; }
.qn-form .qn-question:last-of-type { border-bottom: 0; }
.qn-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.qn-fieldset legend { font-weight: 600; font-size: .9rem; margin-bottom: 4px; padding: 0; }
.qn-choices { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.qn-choices.qn-inline { flex-direction: row; gap: 18px; }
.qn-required { color: var(--danger); }
.qn-id { margin-top: 2px; font-size: .72rem; opacity: .7; }
.qn-question.has-error input, .qn-question.has-error select, .qn-question.has-error textarea { border-color: var(--danger); }
.qn-answers { display: grid; grid-template-columns: minmax(180px, 40%) 1fr; gap: 8px 16px; margin: 0; }
.qn-answers dt { font-weight: 600; }
.qn-answers dd { margin: 0; }
@media (max-width: 640px) { .qn-answers { grid-template-columns: 1fr; } .qn-answers dd { margin-bottom: 8px; } }
.qn-builder { list-style: none; padding: 0; margin: 0; counter-reset: qn; }
.qn-builder li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.qn-builder li::before { counter-increment: qn; content: counter(qn) "."; color: var(--muted); min-width: 1.8em; font-weight: 600; padding-top: 1px; }
.qn-builder-main { flex: 1; min-width: 0; }
.qn-condition { color: var(--primary); margin-top: 2px; }
.qn-cond-row { display: grid; grid-template-columns: 2fr 1.3fr 1fr; gap: 8px; margin-bottom: 8px; }
@media (max-width: 640px) { .qn-cond-row { grid-template-columns: 1fr; } }

/* Application modeling */
.app-domain { padding: 10px 0; border-bottom: 1px solid var(--border); }
.app-domain:last-child { border-bottom: 0; }
.app-domain-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.app-fields { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.app-error { white-space: pre-wrap; background: var(--surface-2); padding: 6px 8px; border-radius: var(--radius); font-size: .8rem; margin: 4px 0 0; max-height: 180px; overflow: auto; }

/* Word templates */
.mono, .wt-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.wt-code { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px; overflow: auto; max-height: 60vh; white-space: pre; }
.wt-fields { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; margin-top: 8px; }
.wt-field-group-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.wt-field { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; margin-bottom: 4px; cursor: copy; color: var(--text); font: inherit; }
.wt-field:hover, .wt-field:focus-visible { border-color: var(--primary); }
.wt-field code { word-break: break-all; }
.wt-field[hidden], .wt-field-group[hidden] { display: none; }
.wt-field-filter { width: 100%; }
.wt-copied { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: var(--surface); padding: 8px 14px; border-radius: 6px; z-index: 50; }
.wt-source { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.wt-result { border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; background: var(--bg); }
.wt-warnings { margin: 4px 0 0; padding-left: 18px; color: var(--warning); }
.wt-warn { color: var(--warning); cursor: pointer; }
.wt-generate { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.wt-help summary { cursor: pointer; }
.wt-syntax code { white-space: nowrap; }
.wt-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
.wt-editor-frame { height: calc(100vh - 210px); min-height: 520px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.wt-editor-fields { margin: 0; max-height: calc(100vh - 210px); overflow: auto; }
@media (max-width: 900px) { .wt-editor-layout { grid-template-columns: 1fr; } .wt-editor-fields { max-height: none; } }

/* Questionnaire wizard and public questionnaires */
.qn-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.qn-page + .qn-page { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.qn-wizard .qn-page + .qn-page { border-top: 0; margin-top: 0; padding-top: 0; }
.qn-page[hidden] { display: none; }
.qn-page-title { font-size: 1.15rem; margin: 4px 0 6px; }
.qn-page-help { color: var(--muted); margin: 0 0 10px; }
.qn-steps { margin-bottom: 6px; }
.qn-actions { flex-wrap: wrap; }
.qn-actions [hidden] { display: none; }
.qn-builder-page { background: color-mix(in srgb, var(--primary) 6%, var(--surface)); border-left: 3px solid var(--primary); }
.qn-answers-page { grid-column: 1 / -1; font-weight: 700; margin-top: 8px; border-bottom: 1px solid var(--border); }
.qn-thanks h2 { margin-top: 0; }
@media (max-width: 600px) { .qn-actions .btn { flex: 1 1 auto; } }

/* Process reading view: navigator, process map, tabs (public section and app) */
.pr-root { --pr-accent: #0e9f86; --pm-primary: #1f9d2f; --pm-other: #7b7b7b; }
.pr-crumbs { margin-bottom: 14px; }
.pr-crumbs span[aria-current] { color: var(--muted); }
.pr-layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.pr-nav { position: sticky; top: 12px; }
.pr-nav-box { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
.pr-nav-head { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--pr-accent); color: #fff; padding: 12px 14px; cursor: pointer; font-weight: 600; }
.pr-nav-head::-webkit-details-marker { display: none; }
.pr-nav-head a { color: #fff; text-decoration: none; }
.pr-nav-head a:hover, .pr-nav-head a:focus-visible { text-decoration: underline; }
.pr-nav-toggle::after { content: '⌃'; display: inline-block; font-size: 1.1rem; line-height: 1; }
.pr-nav-box:not([open]) .pr-nav-toggle::after { transform: rotate(180deg); }
.pr-nav-up { display: block; padding: 8px 14px; border-bottom: 1px solid var(--border); color: var(--muted); }
.pr-nav-list { list-style: none; margin: 0; padding: 4px 0; }
.pr-nav-list a { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; color: var(--text); text-decoration: none; border-left: 3px solid transparent; }
.pr-nav-list a:hover, .pr-nav-list a:focus-visible { background: color-mix(in srgb, var(--pr-accent) 8%, var(--surface)); }
.pr-nav-list a[aria-current] { border-left-color: var(--pr-accent); font-weight: 600; background: color-mix(in srgb, var(--pr-accent) 10%, var(--surface)); }
.pr-more { color: var(--muted); }
.pr-nav-empty { padding: 10px 14px; margin: 0; }
.pr-main { margin: 0; min-width: 0; }
.pr-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pr-title h1 { margin: 0 0 12px; font-weight: 400; font-size: 2rem; }
.pr-overview { margin: 6px 0 18px; }
.pr-overview figure { margin: 0; }
/* Process map */
.pm { display: flex; flex-direction: column; gap: 12px; }
.pm-tile { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 10px 14px; border-radius: 2px;
    color: #fff; font-weight: 600; font-size: .9rem; text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.2); line-height: 1.25; }
.pm-tile:hover, .pm-tile:focus-visible { filter: brightness(1.1); outline: 2px solid var(--text); outline-offset: 2px; }
.pm-management, .pm-support { background: var(--pm-other); }
.pm-primary { background: var(--pm-primary); }
.pm-wide { width: 100%; }
.pm-flow { display: flex; flex-direction: column; }
.pm-row3 { display: grid; grid-template-columns: minmax(0,1fr) 34px minmax(0,1fr) 34px minmax(0,1fr); align-items: stretch; }
.pm-row3 .pm-tile { min-height: 52px; }
.pm-arrow, .pm-gap { align-self: center; height: 2px; position: relative; margin: 0 3px; }
.pm-arrow { background: var(--text); }
.pm-arrow::after { content: ''; position: absolute; right: -1px; top: -5px; border: 6px solid transparent; border-left: 8px solid var(--text); border-right: 0; }
.pm-loose .pm-row3 + .pm-row3 { margin-top: 12px; }
/* Line from the end of a row back to the start of the next row */
.pm-turn { position: relative; height: 22px; margin: 0 calc((100% - 68px) / 6); }
.pm-turn-a { position: absolute; left: 0; right: 0; top: 0; height: 11px; border-right: 2px solid var(--text); border-bottom: 2px solid var(--text); }
.pm-turn-b { position: absolute; left: 0; top: 11px; height: 11px; border-left: 2px solid var(--text); }
.pm-turn-b::after { content: ''; position: absolute; left: -7px; bottom: -2px; border: 6px solid transparent; border-top: 8px solid var(--text); border-bottom: 0; }
.pm-support-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
/* Tabs */
.pr-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 8px 0 14px; overflow-x: auto; scrollbar-width: thin; }
.pr-tabs [role=tab] { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; font: inherit; font-size: .9rem; color: var(--text); cursor: pointer; white-space: nowrap; }
.pr-tabs [role=tab][aria-selected=true] { border-bottom-color: var(--text); font-weight: 600; }
.pr-tabs [role=tab]:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.pr-tab-icon { opacity: .75; }
.pr-count { font-size: .75rem; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 0 6px; }
.pr-tabs:not(:has([role=tab]:nth-child(2))) { display: none; }
.pr-tabbed .pr-panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pr-panel { margin-bottom: 18px; }
.pr-panel[hidden] { display: none; }
.pr-props { display: grid; grid-template-columns: minmax(140px, 30%) 1fr; gap: 8px 16px; margin: 0; }
.pr-props dt { font-weight: 600; }
.pr-props dd { margin: 0; }
.pr-done { text-decoration: line-through; color: var(--muted); }
.public-content .pr-root { max-width: 1280px; margin: 0 auto; }
@media (max-width: 800px) {
    .pr-layout { grid-template-columns: 1fr; }
    .pr-nav { position: static; }
    .pr-title h1 { font-size: 1.5rem; }
    .pm-row3 { grid-template-columns: 1fr; }
    .pm-arrow, .pm-gap { width: 2px; height: 22px; justify-self: center; margin: 0; }
    .pm-gap { height: 8px; }
    .pm-arrow::after { right: auto; left: -5px; top: auto; bottom: -1px; border: 6px solid transparent; border-top: 8px solid var(--text); border-bottom: 0; }
    .pm-turn { margin: 0; height: 22px; }
    .pm-turn-a { display: none; }
    .pm-turn-b { left: 50%; top: 0; height: 22px; }
    .pr-props { grid-template-columns: 1fr; gap: 2px; }
    .pr-props dd { margin-bottom: 8px; }
}

/* Wizard step bar (breadcrumb text per step) */
.qn-crumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 4px; margin: 0 0 12px; padding: 0; counter-reset: none; }
.qn-crumbs li { display: flex; align-items: center; }
.qn-crumbs li[hidden] { display: none; }
.qn-crumbs li + li::before { content: '›'; color: var(--muted); margin: 0 6px 0 2px; }
.qn-crumb { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px 4px 4px; font: inherit; font-size: .85rem; color: var(--muted); cursor: default; }
.qn-crumb-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); font-size: .75rem; }
.qn-crumbs .is-current .qn-crumb { border-color: var(--primary); color: var(--text); font-weight: 600; }
.qn-crumbs .is-current .qn-crumb-n { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast, #fff); }
.qn-crumbs .is-done .qn-crumb { color: var(--text); cursor: pointer; }
.qn-crumbs .is-done .qn-crumb:hover { border-color: var(--primary); }
.qn-crumbs .is-done .qn-crumb-n::after { content: ''; }
.qn-builder-step { margin-top: 6px; color: var(--primary); font-weight: 600; }
.qn-has-pages .qn-steps { display: none; }
@media (max-width: 600px) { .qn-crumb-t { display: none; } .qn-crumbs .is-current .qn-crumb-t { display: inline; } }

/* Questions: media above, More info */
.qn-media { margin: 0 0 8px; }
.qn-media img, .qn-media video { max-width: 100%; max-height: 420px; border-radius: 6px; display: block; }
.qn-media .video-embed, .qn-media video { max-width: 640px; }
.qn-media figcaption { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.qn-more-info { margin-top: 6px; font-size: .9rem; }
.qn-more-info summary { cursor: pointer; color: var(--primary); }
.qn-more-info-text { margin-top: 6px; padding: 8px 12px; border-left: 3px solid var(--border); background: var(--bg); border-radius: 0 6px 6px 0; }
.qn-more-info-text p, .qn-more-info-text ul { margin: 0 0 6px; }
.qn-media-kinds { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
.qn-media-fields [hidden] { display: none; }

/* ---------- Answers list: My / All, filters, exports ---------- */
.card-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-header-row h2 { margin: 0; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.segmented a { padding: 5px 12px; font-size: .9rem; color: var(--text); }
.segmented a + a { border-left: 1px solid var(--border); }
.segmented a:hover { background: var(--surface-2); text-decoration: none; }
.segmented a.active { background: var(--primary); color: var(--primary-contrast); }
.qn-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 10px 12px; margin-bottom: 10px;
    background: var(--surface-2); border-radius: var(--radius); }
.qn-filters .form-row { margin: 0; min-width: 160px; flex: 1 1 160px; }
.qn-filters .form-row label { font-size: .8rem; }
.qn-filters select, .qn-filters input { width: 100%; }
.qn-filters .form-actions { margin: 0; display: flex; gap: 6px; }
.qn-export { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.qn-export .small { margin-right: auto; }
.qn-choose td { vertical-align: middle; }

/* ---------- Word template: linked questionnaires ---------- */
.wt-questionnaires { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px 10px; }
.wt-questionnaires legend { font-weight: 600; padding: 0 4px; }
.wt-q-table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.wt-q-table th { text-align: right; font-weight: 500; padding: 0 0 2px; }
.wt-q-table td { padding: 3px 0; border-top: 1px solid var(--surface-2); }
.wt-q-table .wt-auto { text-align: right; width: 1%; padding-left: 12px; white-space: nowrap; }

/* ---------- Tasks: type and status labels, filters ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.task-type { display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 999px;
    color: var(--tc, #64748b); background: color-mix(in srgb, var(--tc, #64748b) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tc, #64748b) 35%, transparent); white-space: nowrap; }
.task-status { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.task-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sc, #64748b); }
.task-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.task-filters input[type=search] { flex: 1 1 200px; min-width: 160px; }
.task-filters .check { font-weight: 400; }
.page-header .actions .segmented { margin-left: 4px; }
.wf-waiting { margin: 8px 0; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius); }
.wf-waiting li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }

/* ---------- Task board (kanban) ---------- */
.kanban { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; }
.kanban-col { flex: 0 0 280px; max-width: 320px; background: var(--surface-2); border-radius: var(--radius); border-top: 4px solid var(--sc, #64748b);
    display: flex; flex-direction: column; max-height: calc(100vh - 230px); scroll-snap-align: start; transition: box-shadow .15s; }
.kanban-col.is-over { box-shadow: 0 0 0 2px var(--primary) inset; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 6px; }
.kanban-col-head h2 { font-size: .95rem; margin: 0; display: flex; align-items: center; gap: 6px; }
.kanban-col-head .dot, .status-order .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sc, #64748b); display: inline-block; }
.kanban-count { font-size: .8rem; background: var(--surface); border-radius: 999px; padding: 0 8px; color: var(--muted); }
.kanban-cards { list-style: none; margin: 0; padding: 4px 8px 10px; overflow-y: auto; min-height: 60px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--tc, #64748b); border-radius: 6px; padding: 8px 10px;
    box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.kanban-card[draggable=true] { cursor: grab; }
.kanban-card.is-dragging { opacity: .45; }
.kanban-card.is-saving { opacity: .7; }
.kanban-card.is-overdue .kanban-due { color: var(--danger); font-weight: 600; }
.kanban-col.is-done .kanban-title { color: var(--muted); }
.kanban-card-top, .kanban-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.kanban-due { font-size: .78rem; color: var(--muted); }
.kanban-title { font-weight: 600; color: var(--text); line-height: 1.3; overflow-wrap: anywhere; }
.kanban-process { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-who { font-size: .8rem; }
.kanban-move-form select { width: 100%; font-size: .8rem; padding: 2px 4px; }
.kanban-empty { padding: 0 12px 10px; margin: 0; }
.kanban-more { padding: 0 12px 10px; }
.kanban-toast { position: fixed; right: 16px; bottom: 16px; z-index: 50; max-width: 360px; padding: 10px 14px; border-radius: var(--radius);
    background: var(--text); color: var(--surface); box-shadow: var(--shadow); font-size: .9rem; }
.kanban-toast.is-error { background: var(--danger); color: #fff; }
@media (max-width: 700px) {
    .kanban-col { flex-basis: 85vw; max-height: none; }
}

/* ---------- Task statuses: column order ---------- */
.status-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: row; gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
.status-order li { flex: 0 0 auto; min-width: 170px; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--border);
    border-top: 4px solid var(--sc, #64748b); border-radius: var(--radius); background: var(--surface); cursor: grab; }
.status-order li.is-dragging { opacity: .45; }
.status-order .status-grip { color: var(--muted); font-size: .9rem; }
.status-order .status-name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.status-order .status-move { display: flex; gap: 4px; }
@media (max-width: 700px) {
    .status-order { flex-direction: column; }
}
.task-filters select, .task-filters input[type=search] { width: auto; margin: 0; }
.task-filters select { flex: 1 1 170px; max-width: 280px; }
.kanban-col { flex: 1 0 260px; max-width: 360px; }
.layout-main-side > * { min-width: 0; }
.kanban { max-width: 100%; }
@media (max-width: 700px) { .kanban-col { flex: 0 0 85vw; } }
.kanban-card { position: relative; }
.tasks-done { margin-top: 8px; } .tasks-done summary { cursor: pointer; color: var(--muted); }

/* ---------- Document templates: "Create template" dialog ---------- */
.wt-dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; max-width: 560px; width: calc(100% - 32px);
    background: var(--surface); color: var(--text); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.wt-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.wt-dialog h2 { margin-top: 0; }
.form-row > .label { display: block; font-weight: 600; margin-bottom: 4px; }

/* Sidebar: icons (shown when minimised), collapse button and the minimised icon strip (0.13). */
.sidebar a { position: relative; }
.sidebar .nav-icon { display: none; width: 24px; text-align: center; flex-shrink: 0; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; }
.nav-collapse { margin-left: auto; border: 1px solid var(--border); background: var(--surface, #fff); color: var(--muted); border-radius: 6px;
    width: 28px; height: 28px; line-height: 1; cursor: pointer; font-size: 1rem; padding: 0; }
.nav-collapse:hover, .nav-collapse:focus-visible { color: var(--primary); border-color: var(--primary); }
.sidebar { transition: width .15s ease; }
@media (min-width: 861px) {
    .nav-min .sidebar { width: 56px; }
    .nav-min .sidebar .nav-label { display: none; }
    .nav-min .sidebar a { display: flex; justify-content: center; padding: 8px 0; }
    .nav-min .sidebar .nav-icon { display: inline-block; font-size: 1.15rem; }
    .nav-min .sidebar-section { padding: 0; margin: 8px 10px; border-top: 1px solid var(--border); }
    .nav-min .sidebar-footer { padding: 12px 0; justify-content: center; }
    .nav-min .nav-collapse { margin: 0; transform: rotate(180deg); }
    .nav-min .sidebar a:hover::after, .nav-min .sidebar a:focus-visible::after {
        content: attr(data-tip); position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%);
        background: var(--text); color: var(--bg, #fff); padding: 4px 8px; border-radius: 6px; font-size: .8rem; font-weight: 500;
        white-space: nowrap; z-index: 40; pointer-events: none; box-shadow: var(--shadow);
    }
}
@media (max-width: 860px) { .nav-collapse { display: none; } }

/* Exams (0.13) */
.exam-result { display: flex; gap: 24px; align-items: center; border-left: 4px solid var(--border); }
.exam-result.exam-pass { border-left-color: var(--success); }
.exam-result.exam-fail { border-left-color: var(--danger); }
.exam-result-grade { text-align: center; min-width: 96px; }
.exam-grade { font-size: 2.6rem; font-weight: 700; line-height: 1.1; }
.exam-pass .exam-grade { color: var(--success); }
.exam-fail .exam-grade { color: var(--danger); }
.exam-result-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.exam-result-info p { margin: 0; }
.exam-q { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; }
.exam-q-correct, .exam-q-ai, .exam-q > .muted { flex-basis: 100%; }
.exam-q-ai { background: var(--surface-2); border-radius: 6px; padding: 6px 8px; }
.exam-mark { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; border: 1px solid var(--border); }
.exam-right { color: var(--success); border-color: var(--success); }
.exam-wrong { color: var(--danger); border-color: var(--danger); }
.exam-partly, .exam-wait { color: var(--warning); border-color: var(--warning); }
.exam-q-points { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.exam-q-points input { width: 4.5em; padding: 2px 6px; text-align: right; }
.exam-approve { margin: 0; }
.qn-builder-exam { margin-top: 4px; }
.qn-exam-choices .check { margin-right: 14px; }
.qn-exam-number { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qn-exam-number label { margin: 0; font-weight: 400; }
.qn-exam-fields [hidden] { display: none !important; }
@media (max-width: 520px) { .exam-result { flex-direction: column; align-items: flex-start; gap: 8px; } .exam-result-grade { text-align: left; } }

/* Administration → AI (0.14) */
.ai-engines { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: var(--gap); align-items: start; }
.ai-engines > * { min-width: 0; }
@media (max-width: 600px) { .ai-engines { grid-template-columns: 1fr; } }
.ai-engine { border-top: 4px solid var(--border); }
.ai-engine.is-enabled { border-top-color: var(--success); }
.ai-engine-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.ai-engine-head h2 { margin: 0; }
.ai-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.ai-form .grid { margin-top: 8px; }
.ai-form .ai-wide { grid-column: 1 / -1; }
.ai-tools { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.ai-test-form { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-test-form input[type=text] { flex: 1 1 200px; min-width: 0; }
.ai-test { margin-top: 10px; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); font-size: .9rem; overflow-wrap: anywhere; }
.ai-test-failed { color: var(--danger); }
.ai-answer { margin-top: 4px; white-space: normal; }
/* Exams: AI response (0.16) */
.exam-q-ai-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 2px; }
.exam-right-text { color: var(--success); }
.exam-wrong-text { color: var(--danger); }
.exam-q-ai-raw summary { cursor: pointer; color: var(--muted); }
.exam-q-ai-raw pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; font-size: .8rem; margin: 4px 0 0; }
.exam-verdict { width: auto; padding: 2px 6px; font-size: .85rem; }
.ai-warning { margin-top: 4px; color: var(--warning); font-size: .85rem; }
[data-model-other] { margin-top: 6px; }

/* AI generation of processes and templates (0.17) */
.ai-section summary { cursor: pointer; list-style: none; }
.ai-section summary::-webkit-details-marker { display: none; }
.ai-section summary h2 { display: inline; }
.ai-section summary::after { content: ' ▸'; color: var(--muted); }
.ai-section details[open] summary::after { content: ' ▾'; }
.ai-section textarea { font-family: inherit; }
.ai-sources li { align-items: flex-start; }
.ai-sources a { overflow-wrap: anywhere; }
.ai-proc-head { font-size: 1.05rem; flex-wrap: wrap; gap: 6px; }
.ai-steps { margin: 8px 0 0; padding-left: 22px; }
.ai-steps li { margin-bottom: 8px; }
.ai-step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-step-head select { width: auto; padding: 2px 6px; font-size: .85rem; }
.ai-pending { border-left: 4px solid var(--warning); }

/* Reporting → AI requests */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-4 { grid-template-columns: 1fr; } .grid-4 > [style*="span"] { grid-column: auto !important; } }
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 700px) { .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stats-row .card { margin: 0; }
.stat-value { font-size: 1.6rem; font-weight: 600; }
.dl-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.dl-grid dt { color: var(--muted); }
.dl-grid dd { margin: 0; overflow-wrap: anywhere; }
.ai-log-pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh; overflow: auto; font-family: var(--font-mono); font-size: .82rem;
    background: var(--surface-2); padding: 10px; border-radius: 6px; margin: 0; }
.nowrap { white-space: nowrap; }

/* Administration → Style */
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.style-grid .card { margin: 0; }
.style-card.style-off { opacity: .65; }
.style-card-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.style-swatch { display: block; height: 70px; border-radius: 6px; overflow: hidden; background: var(--sw-bg); border: 1px solid var(--border); position: relative; }
.style-swatch .sw-top { display: block; height: 16px; background: var(--sw-top); }
.style-swatch .sw-card { position: absolute; left: 12px; right: 40%; top: 26px; bottom: 10px; background: var(--sw-surface); border-radius: var(--sw-radius); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.style-swatch .sw-line { position: absolute; left: 8px; right: 30%; top: 8px; height: 5px; border-radius: 3px; background: var(--sw-text); opacity: .6; }
.style-swatch .sw-btn { position: absolute; left: 8px; bottom: 7px; width: 34px; height: 9px; border-radius: var(--sw-radius); background: var(--sw-primary); }
.style-vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; }
.style-var label { font-size: .85rem; }
.style-var-input { display: flex; gap: 6px; align-items: center; }
.style-var-input input[type=color] { width: 40px; height: 34px; padding: 2px; flex: none; }
.style-var-input input[type=text] { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: .85rem; }
textarea.code { font-family: var(--font-mono); font-size: .85rem; width: 100%; }
.style-preview-card { position: sticky; top: calc(var(--topbar-height) + 12px); }
.style-preview { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 13px; }
.style-preview.sp-dark { color-scheme: dark; }
.sp-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--topbar-bg); color: var(--topbar-text); }
.sp-logo { height: 20px; width: auto; }
.sp-search { flex: 1; height: 14px; border-radius: var(--radius); background: rgba(255,255,255,.18); }
.sp-body { display: flex; min-height: 160px; }
.sp-side { width: 34%; background: var(--sidebar-bg); border-right: 1px solid var(--border); padding: 8px 0; }
.sp-item { padding: 4px 10px; }
.sp-item.sp-active { background: var(--sidebar-active); color: var(--primary); font-weight: 600; }
.sp-main { flex: 1; padding: 10px; }
.sp-h { font-family: var(--font-heading, var(--font)); margin: 0 0 6px; }
.sp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; }
.sp-card p { margin: 0 0 8px; }
.sp-card a { color: var(--primary); }
.sp-btn { display: inline-block; padding: 3px 10px; border-radius: var(--radius); background: var(--primary); color: var(--primary-contrast); }
.sp-btn.sp-btn-plain { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.sp-badges { margin-top: 8px; display: flex; gap: 6px; }
.sp-badge { padding: 0 8px; border-radius: 99px; border: 1px solid var(--c); color: var(--c); font-size: 11px; }
.sp-muted { color: var(--muted); font-size: 12px; margin-top: 8px !important; }

/* Administration → Shape/Image Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.gallery-grid .card { margin: 0; }
.gallery-item { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none !important; padding: 10px; }
.gallery-item:hover { border-color: var(--primary); }
.gallery-thumb { display: flex; align-items: center; justify-content: center; height: 110px; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 50% / 16px 16px; border-radius: 6px; }
.gallery-thumb img { max-height: 100px; max-width: 100%; object-fit: contain; }
.gallery-uses { display: flex; flex-wrap: wrap; gap: 4px; }
.gallery-uses .badge { font-size: .7rem; }
.gallery-preview { display: flex; justify-content: center; padding: 12px; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 50% / 16px 16px; border-radius: 6px; }
.gallery-preview img { max-height: 320px; object-fit: contain; }
.proc-icon { width: 20px; height: 20px; object-fit: contain; vertical-align: -4px; margin-right: 4px; }
.pm-tile .proc-icon { width: 22px; height: 22px; display: block; margin: 0 auto 4px; }
.color-chip { display: inline-block; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--border); vertical-align: -4px; margin: 0 2px; }

/* AI requests (0.20) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.prompt-pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; max-height: 420px; overflow: auto; }
.prompt-fixed { color: var(--muted); }
.prompt-placeholders li { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.prompt-placeholders .btn { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; flex-shrink: 0; }
#prompt-text { min-height: 260px; }
.ai-sources .ai-source-sub { padding-left: calc(var(--level, 1) * 18px); }
.ai-crawl input[type=number] { padding: 4px 6px; }
/* Clickable process diagrams (0.20) */
.diagram-gen-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.diagram-template-preview { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 8px; min-height: 80px; display: flex; align-items: center; justify-content: center; }
.diagram-template-preview img { max-width: 100%; max-height: 220px; }
.diagram-ai { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.diagram-ai summary { cursor: pointer; font-weight: 600; }
.diagram-ai-preview { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 10px; overflow: auto; }
.diagram-ai-preview img { max-width: 100%; height: auto; }
fieldset.form-row { border: 0; padding: 0; margin-left: 0; margin-right: 0; }
@media (max-width: 720px) { .diagram-gen-grid { grid-template-columns: 1fr; } }
/* AI – Generate questionnaire (0.20) */
.qa-types { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.qa-question .qa-q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.qa-question .qa-points { margin-left: auto; }
.qa-question .qa-points input { width: 60px; }
.qa-page { margin: 18px 0 8px; font-size: 1.05rem; }
.exam-q-why { margin-top: 4px; }

/* Administration menu in groups (0.21) */
.sidebar-group { padding: 18px 20px 0; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text); border-top: 1px solid var(--border); margin-top: 8px; }
.sidebar-section.is-admin { padding-top: 8px; text-transform: none; letter-spacing: 0; font-size: .78rem; font-weight: 600; }
.nav-min .sidebar-group { display: none; }
.img-missing { display: inline-block; padding: 14px 16px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-size: .9rem; }
/* Start page, Manage menu, foldable cards (0.21) */
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.start-grid .card { margin-bottom: 0; }
.btn-icon { border: 0; background: none; cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--warning, #d97706); padding: 2px 6px; }
.fav-form { display: inline; margin: 0; }
.fav-btn { font-size: 1.05rem; }
.fav-btn.is-on { color: #d97706; }
.menu-button { position: relative; display: inline-block; }
.menu-button > summary { list-style: none; cursor: pointer; }
.menu-button > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; min-width: 230px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0,0,0,.16); padding: 6px; display: flex; flex-direction: column; }
.menu-list form { margin: 0; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; color: var(--text);
    font: inherit; border-radius: 6px; text-decoration: none; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover, .menu-list a:focus-visible, .menu-list button:focus-visible { background: var(--surface-2); }
.fold-toggle { all: unset; cursor: pointer; display: flex; align-items: baseline; gap: 8px; width: 100%; box-sizing: border-box; }
.fold-toggle::before { content: '▾'; font-size: .8em; color: var(--muted); transition: transform .15s; }
.is-folded .fold-toggle::before { transform: rotate(-90deg); }
.fold-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.fold-summary { margin-left: auto; font-size: .78rem; font-weight: 400; color: var(--muted); }
.card.is-folded > h2, .card.is-folded > .card-header-row { margin-bottom: 0; }
@media (max-width: 720px) { .menu-list { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; min-width: 0; max-height: 70vh; overflow-y: auto; box-shadow: 0 8px 30px rgba(0,0,0,.25); } }
/* Help on every page (0.21) */
.help-btn { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; width: 30px; height: 30px; margin-left: 4px; padding: 0;
    border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.help-btn:hover, .help-btn:focus-visible { color: var(--primary); background: var(--surface-2); outline: none; }
.help-btn:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.help-dialog { border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); padding: 0; width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 64px);
    background: var(--surface); color: var(--text); box-shadow: 0 16px 48px rgba(0,0,0,.25); }
.help-dialog::backdrop { background: rgba(15, 23, 42, .4); }
.help-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 8px; border-bottom: 1px solid var(--border); }
.help-dialog-head h2 { margin: 0; font-size: 1.1rem; }
.help-close { border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.help-close:hover, .help-close:focus-visible { background: var(--surface-2); color: var(--text); }
.help-dialog-body { padding: 8px 20px 4px; overflow: auto; max-height: calc(100vh - 220px); line-height: 1.55; }
.help-dialog-body h3 { font-size: .9rem; margin: 14px 0 4px; }
.help-dialog-body ul { padding-left: 20px; margin: 6px 0; }
.help-dialog-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 20px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.help-page .help-topic { scroll-margin-top: 16px; }
.help-page .help-topic h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.help-toc { columns: 2 220px; padding-left: 18px; }
.layout-side-main { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .layout-side-main { grid-template-columns: 1fr; } }
.help-text-list ul { max-height: 60vh; overflow: auto; }
.help-text-list a.is-current { font-weight: 700; }
@media (max-width: 640px) { .topbar-help { display: none; } }
.settings-search { max-width: 320px; }
.settings-save { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; z-index: 5; }

/* 0.22: AI instruction variants */
.variant-table tr.is-current td { background: var(--primary-soft, rgba(15, 118, 110, .07)); }
.variant-table tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.variant-table .inline-form { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin: 0; }
.ai-variant-row select { max-width: 100%; }
.ai-variant-desc { margin-top: 4px; }
@media (max-width: 720px) { .variant-table .inline-form { justify-content: flex-start; } }

/* 0.22: sign in, registration, providers */
.login-card { max-width: 440px; }
.login-alt { margin-top: 18px; }
.login-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 14px 0; }
.login-sep::before, .login-sep::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.login-providers { display: grid; gap: 8px; }
.btn-provider { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: var(--surface); }
.login-register { margin: 14px 0 6px; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.copy-row { display: flex; gap: 6px; } .copy-row input { flex: 1; font-family: var(--mono, monospace); font-size: .85rem; }
.approve-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.identity-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.identity-row .muted { display: block; }
.card-danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }

/* 0.23: sub processes along (Publish directly, Make public) */
.sub-choice { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; }
.sub-choice legend { font-weight: 600; padding: 0 4px; }
.sub-choice-list { max-height: 260px; overflow-y: auto; margin: 6px 0 0; }
.sub-choice-list li { padding-top: 3px; padding-bottom: 3px; }

/* Page tabs (links), e.g. Style: Web | Documents (0.23) */
.page-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 16px; overflow-x: auto; }
.page-tabs > a, .page-tabs > span { padding: 10px 14px; border-bottom: 3px solid transparent; color: var(--text); text-decoration: none; white-space: nowrap; font-size: .95rem; }
.page-tabs > a:hover { background: var(--surface-2); }
.page-tabs > a[aria-current=page] { border-bottom-color: var(--primary); font-weight: 600; }
.page-tabs > .is-disabled { color: var(--muted); cursor: not-allowed; }

/* Document style (0.23) */
.doc-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
.doc-fields .form-row { margin: 0; }
.doc-color { display: flex; gap: 6px; align-items: center; }
.doc-color input[type=color] { width: 38px; height: 34px; padding: 2px; flex: none; }
.doc-color input[type=text] { min-width: 0; }
.doc-preview-wrap { background: var(--surface-2); border-radius: var(--radius); padding: 14px; display: flex; justify-content: center; }
.doc-page { background: #fff; color: #1d2330; box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 6px 18px rgba(0,0,0,.08); position: relative; width: 100%; max-width: 360px; overflow: hidden; }
.doc-page-inner { position: absolute; display: flex; flex-direction: column; }
.doc-page-head, .doc-page-foot { position: absolute; left: 0; right: 0; font-size: 6px; color: #666; display: flex; align-items: center; gap: 6px; }
.doc-page-head img { display: block; }
.doc-page-body { overflow: hidden; flex: 1; }
.doc-page-body h1 { margin: 0 0 4px; line-height: 1.15; }
.doc-page-body h2 { margin: 8px 0 3px; line-height: 1.15; }
.doc-page-body p { margin: 0; }
.doc-page-body table { border-collapse: collapse; width: 100%; margin-top: 4px; }
.doc-page-body th, .doc-page-body td { padding: 1px 3px; text-align: left; }
.doc-hint code { font-size: .8rem; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 700px) { .doc-fields { grid-template-columns: 1fr 1fr; } }
.actions > .inline-form { display: inline-flex; margin: 0; }
.pdf-action { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; } .pdf-action .is-disabled { opacity: .7; cursor: default; }

/* Change log on the System page (0.24) */
.changelog-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.changelog-head h2 { margin: 0; }
.changelog-search { max-width: 280px; width: 100%; }
.changelog { max-height: 560px; overflow-y: auto; border-top: 1px solid var(--border); }
.changelog-version { border-bottom: 1px solid var(--border); padding: 8px 2px; }
.changelog-version > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; list-style-position: inside; }
.changelog-version.is-pending { background: color-mix(in srgb, var(--warning, #f0ad4e) 8%, transparent); }
.changelog-version ul { margin: 8px 0 4px 18px; padding: 0; }
.changelog-version li { margin: 4px 0; line-height: 1.45; overflow-wrap: anywhere; }
.changelog-version li ul { margin: 4px 0 4px 18px; }
.changelog-version code { font-size: .85em; }

/* Diagram examples (0.24): chooser in the diagram block, template packs in the gallery */
.examples-dialog { max-width: 1100px; width: calc(100% - 32px); max-height: calc(100vh - 40px); overflow-y: auto; }
.examples-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.examples-head h2 { margin: 0; }
.examples-filter { flex-wrap: wrap; margin: 8px 0 12px; }
.examples-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.example-card { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; cursor: pointer; color: var(--text); font: inherit; }
.example-card:hover, .example-card:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.example-card[disabled] { opacity: .6; cursor: progress; }
.example-thumb { display: flex; align-items: center; justify-content: center; height: 120px; background: #fff; border-radius: calc(var(--radius) - 2px); overflow: hidden; }
.example-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.example-name { font-weight: 600; font-size: .9rem; line-height: 1.25; }
.pack-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 10px 0; }
.pack-cat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.pack-cat.is-imported { background: color-mix(in srgb, var(--success) 6%, var(--surface)); }
.pack-cat .check { flex: 1 1 100%; margin: 0; }
.pager { justify-content: center; margin: 14px 0; }
@media (max-width: 600px) { .examples-grid { grid-template-columns: repeat(2, 1fr); } .example-thumb { height: 90px; } }
.text-success { color: var(--success); } .text-danger { color: var(--danger); }
.example-card[hidden] { display: none; }

/* ---------- Data conversion and connections (0.27) ---------- */
.cn-ops { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.cn-ops li { padding: 5px 0; border-bottom: 1px solid var(--border); }
.cn-method { display: inline-block; min-width: 54px; text-align: center; font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); }
.cn-get { color: var(--success); } .cn-post { color: var(--primary); } .cn-put, .cn-patch { color: var(--warning); } .cn-delete { color: var(--danger); }
.cn-json { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; font: .8rem/1.4 var(--font-mono); max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.dm-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--gap); align-items: start; margin-bottom: var(--gap); }
.dm-sides > .card { margin: 0; min-width: 0; }
.dm-arrow { align-self: center; font-size: 2rem; color: var(--muted); }
.dm-type-choice { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.dm-type { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; cursor: pointer; background: var(--surface-2); }
.dm-type:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.dm-type input { margin: 0 4px 0 0; }
.dm-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.dm-filter { max-width: 180px; }
.dm-unsaved { color: var(--warning); font-weight: 600; }
.dm-editor { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1.3fr); gap: 0; margin-top: 10px; }
.dm-col h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dm-col-source { grid-column: 1; } .dm-col-target { grid-column: 3; }
.dm-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; grid-column: 1 / -1; }
.dm-line { fill: none; stroke: var(--primary); stroke-width: 1.6; opacity: .65; }
.dm-line.dm-by-auto { stroke-dasharray: 5 3; }
.dm-line.dm-by-ai { stroke: var(--success); stroke-dasharray: 2 3; }
.dm-line.has-steps { stroke-width: 2.4; }
.dm-row { display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 6px; border: 1px solid transparent; border-radius: 6px; font-size: .88rem; }
.dm-row + .dm-row { margin-top: 2px; }
.dm-src { cursor: grab; background: var(--surface-2); }
.dm-src.is-used { border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.dm-src.is-picked { outline: 2px solid var(--primary); }
.dm-src.is-dragging { opacity: .5; }
.dm-group { background: transparent; cursor: default; font-weight: 600; color: var(--muted); }
.dm-tgt { background: var(--surface-2); flex-wrap: wrap; }
.dm-tgt.is-linked { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.dm-tgt.is-missing { border-color: var(--warning); }
.dm-tgt.is-drop { outline: 2px dashed var(--primary); }
.dm-picking .dm-tgt:not(.dm-group) { cursor: copy; }
.dm-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.dm-kind { font-size: .68rem; padding: 0 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.dm-row .dm-kind { cursor: inherit; }
.dm-t-list { color: var(--primary); border-color: var(--primary); }
.dm-sample { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.dm-pick { flex: 1; min-width: 120px; max-width: 100%; font-size: .82rem; padding: 2px 4px; }
.dm-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 4px; padding: 0 7px; line-height: 1.6; cursor: pointer; font-size: .8rem; color: var(--text); }
.dm-btn.has-steps { border-color: var(--primary); color: var(--primary); font-weight: 700; }
.dm-x { color: var(--danger); }
.dm-score { font-size: .7rem; padding: 0 6px; border-radius: 999px; border: 1px solid; }
.dm-high { color: var(--success); } .dm-medium { color: var(--warning); } .dm-low { color: var(--danger); }
.dm-panel { margin: 2px 0 8px 20px; padding: 8px 10px; border: 1px solid var(--primary); border-radius: 6px; background: var(--surface); }
.dm-step { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.dm-step input { width: 130px; font-size: .82rem; padding: 2px 6px; }
.dm-step select { font-size: .82rem; }
.dm-step-n { color: var(--muted); font-size: .8rem; }
.dm-add-field { display: flex; gap: 6px; margin-top: 8px; }
.dm-add-field input { flex: 1; }
.dm-ai { border: 1px solid var(--success); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; }
.dm-ai-row { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.dm-ai-actions { float: right; display: inline-flex; gap: 4px; }
.dm-ai-form { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; }
.dm-preview details { border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; margin-bottom: 6px; }
.dm-preview details.has-errors { border-color: var(--warning); }
.dm-preview summary { cursor: pointer; font-size: .88rem; }
.dm-prev-errors { color: var(--danger); font-size: .82rem; margin: 6px 0; }
.dm-max { width: 90px; }
@media (max-width: 900px) {
    .dm-sides { grid-template-columns: 1fr; }
    .dm-arrow { transform: rotate(90deg); justify-self: center; }
    .dm-editor { grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); }
    .dm-name { max-width: 130px; }
}
.dm-add-field[hidden], [data-dm-for][hidden] { display: none; }
.dm-ai-row::after { content: ""; display: block; clear: both; }
