/* MELO Prozesse – Stylesheet (Stand 05.10.2026). Eine Datei, ein Farbschema. */
:root {
  --brand: #e7461c;        /* MELO-Orange (Akzente, Linien) */
  --brand-strong: #c23a15; /* Buttons/Links: ausreichender Kontrast für weiße Schrift */
  --brand-dark: #98300f;
  --brand-soft: #fff1ea;
  --ink: #2b2e31;
  --graphite: #383b3d;
  --muted: #62676b;
  --line: #e2e2df;
  --line-strong: #cfcfca;
  --bg: #f6f5f3;
  --card: #ffffff;
  --ok: #24663f;
  --ok-soft: #e7f3eb;
  --warn: #8a5300;
  --warn-soft: #fff3d9;
  --danger: #a3261f;
  --danger-soft: #fdeceb;
  --info-soft: #eef3f8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(30, 30, 30, .05), 0 4px 14px rgba(30, 30, 30, .04);
  --focus: 0 0 0 3px rgba(231, 70, 28, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand-strong); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { color: var(--graphite); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.85rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: 12px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }
.req { color: var(--brand-strong); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Layout */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.main { padding: 28px 20px 110px; min-height: 70vh; }
.site-header { background: #fff; border-bottom: 3px solid var(--brand); position: sticky; top: 0; z-index: 30; }
.topbar { display: flex; align-items: center; gap: 22px; min-height: 66px; }
.brand img { height: 46px; width: auto; display: block; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; white-space: nowrap; }
.nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.nav a.active { background: var(--brand-soft); color: var(--brand-dark); box-shadow: inset 0 -2px 0 var(--brand); }
.user-box { display: flex; flex-direction: column; align-items: flex-end; font-size: .85rem; line-height: 1.3; }
.user-name { font-weight: 700; color: var(--graphite); }
.user-role { color: var(--muted); }
.site-footer { color: var(--muted); font-size: .8rem; padding: 18px 20px 30px; }

.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.pagehead p { margin-bottom: .3em; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 26px 0 12px; }
.section-head h2, .section-head p { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.layout-main-aside { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.main-col > * + *, .aside-col > * + * { margin-top: 18px; }
.page-foot { margin-top: 24px; }

/* ---------- Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.grid > .card + .card { margin-top: 0; }
.card.narrow { max-width: 620px; margin: 40px auto; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card.empty { color: var(--muted); text-align: center; padding: 28px; }
.card.attention { border-top: 3px solid var(--brand); }
.message-card h1 { font-size: 1.5rem; }
.danger-zone { border-color: #ecc9c6; }

/* ---------- Buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand-strong); color: #fff; border: 1px solid var(--brand-strong);
  border-radius: 8px; padding: 9px 15px; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn.secondary { background: #fff; color: var(--graphite); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--brand-soft); color: var(--brand-dark); border-color: #e9b8a6; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: .86rem; }
.btn.icon { min-width: 32px; }
.btn.btn-lg { padding: 13px 22px; font-size: 1.05rem; }
.btn:disabled { opacity: .45; cursor: default; }
.danger-text { color: var(--danger) !important; }
.link-btn { background: none; border: 0; padding: 0 2px; color: var(--brand-strong); text-decoration: underline; cursor: pointer; font: inherit; font-size: .86rem; }
form.inline { display: inline; }

.field { margin-bottom: 14px; }
.field > label, fieldset.field > legend { display: block; font-weight: 650; font-size: .88rem; margin-bottom: 5px; color: var(--graphite); }
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; }
input, select, textarea { font: inherit; color: var(--ink); }
.field input, .field select, .field textarea, .row input, .row select, .filters input, .filters select, .list-filter, .copy-input, .edge-add input, .edge-add select, .edge-panel input, .edge-panel select, .feedback-form textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; min-height: 40px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(163, 38, 31, .2); }
.hint { font-size: .82rem; color: var(--muted); margin: 5px 0 0; }
.check, .radio { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 6px 0; cursor: pointer; }
.check input, .radio input { margin-top: 4px; accent-color: var(--brand-strong); width: 16px; height: 16px; flex: none; }
.check-list { display: grid; gap: 2px; }
.check-list.scroll { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.list-filter { margin-bottom: 10px; max-width: 360px; }
.mini { display: block; font-size: .75rem; color: var(--muted); }

.rows { display: grid; gap: 8px; margin-bottom: 10px; }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row > label { display: block; }
.row .grow { flex: 1 1 200px; }
.row .hint.full { flex-basis: 100%; margin-top: -2px; }
.date-row .check { align-self: center; margin: 0; }

/* ---------- Flash messages */
.flash { padding: 12px 15px; border-radius: 10px; margin-bottom: 14px; background: var(--info-soft); border: 1px solid #cbd9e8; }
.flash.success { background: var(--ok-soft); border-color: #bfdcc8; }
.flash.error { background: var(--danger-soft); border-color: #efc2be; }
.flash.warning { background: var(--warn-soft); border-color: #f0d29a; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- Badges & chips */
.badge { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: .76rem; font-weight: 700; background: #efefec; color: var(--graphite); vertical-align: middle; }
.badge.status-active { background: var(--ok-soft); color: var(--ok); }
.badge.status-draft { background: var(--warn-soft); color: var(--warn); }
.badge.status-archived { background: #ececea; color: #555; }
.badge.review-due { background: var(--danger-soft); color: var(--danger); }
.badge.review-soon { background: var(--warn-soft); color: var(--warn); }
.badge.private { background: #ece9f3; color: #4d3f6b; }
.badge.feedback { background: var(--brand-soft); color: var(--brand-dark); }
.badge.neutral { background: #efefec; color: var(--graphite); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 5px; border-radius: 8px; padding: 3px 9px; font-size: .84rem; background: #f2f2ef; border: 1px solid var(--line); }
.chip-role-name { font-weight: 700; color: var(--brand-dark); }
.chip-role-name::after { content: ""; }
.chip-person .chip-role-name::after { content: ":"; }
.chip-holders { color: var(--muted); }
.chip-holders::before { content: "("; } .chip-holders::after { content: ")"; }
.chip-inactive { opacity: .6; text-decoration: line-through; }

/* ---------- Dashboard */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.hero h1 { margin-bottom: 4px; }
.hero-search { display: flex; gap: 8px; flex: 1 1 420px; max-width: 560px; }
.hero-search input { flex: 1; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 1rem; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.stat:hover { border-color: #e9b8a6; color: var(--ink); }
.stat strong { display: block; font-size: 1.7rem; color: var(--graphite); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .88rem; }
.stat-warn strong { color: var(--danger); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.plain-list li:first-child { border-top: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border-top: 3px solid var(--line-strong); }
.tile:hover { border-top-color: var(--brand); color: var(--ink); }
.tile h2 { margin-bottom: 4px; } .tile p { margin: 0 0 4px; font-weight: 600; }
.tile-warn { border-top-color: var(--brand); }

/* ---------- Process list */
.process-list { display: grid; gap: 10px; }
.process-row { display: flex; gap: 18px; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); }
.process-row.status-draft { border-left-color: #e5b45a; }
.process-row.status-archived { border-left-color: #bbb; opacity: .85; }
.process-row h3 { margin: 4px 0 2px; font-size: 1.05rem; }
.process-row h3 a { color: var(--graphite); text-decoration: none; }
.process-row h3 a:hover { color: var(--brand-dark); text-decoration: underline; }
.process-row p { margin: 0; font-size: .9rem; }
.process-row-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .84rem; }
.process-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: .82rem; white-space: nowrap; }
.filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
.filters.compact { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters.compact label { font-size: .85rem; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.filter-actions { display: flex; gap: 8px; }
.sort-links .current { font-weight: 700; color: var(--graphite); text-decoration: none; }

/* ---------- Process view */
.process-head h1 { margin-bottom: 4px; }
.purpose { border-left: 4px solid var(--brand); }
.purpose p { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 9px 14px; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.tab:hover { color: var(--graphite); }
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.tabpane { display: none; }
.tabpane.active { display: block; }
.flow { list-style: none; margin: 0; padding: 0; position: relative; }
.flow-step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 14px; }
.flow-step:not(:last-child)::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--line-strong); }
.flow-num { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 2px solid var(--line-strong); display: grid; place-items: center; font-weight: 800; color: var(--graphite); position: relative; z-index: 1; }
.type-start .flow-num { background: var(--brand); border-color: var(--brand); color: #fff; }
.type-end .flow-num { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.type-decision .flow-num { border-color: #b9770e; border-style: dashed; color: #8a5300; }
.flow-body { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); scroll-margin-top: 90px; }
.flow-step:target .flow-body { border-color: var(--brand); box-shadow: var(--focus); }
.flow-type { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #8a3a26; }
.flow-body h3 { margin: 2px 0 8px; font-size: 1.08rem; }
.flow-text { margin-top: 10px; }
.link-list { list-style: none; padding: 0; margin: 10px 0 0; }
.link-list li { margin: 4px 0; }
.link-list a::before { content: "↗ "; }
.link-invalid { color: var(--muted); text-decoration: line-through; }
.next-steps { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line); font-size: .9rem; }
.next-steps li { margin: 3px 0; }
.next-label { font-weight: 700; color: var(--muted); }
.next-steps .kind-if .next-label { color: #c8401a; }
.next-steps .kind-else .next-label { color: #55706f; }
.diagram-card { padding: 12px; }
.diagram-scroll { overflow: auto; max-height: 75vh; }
.diagram-scroll svg { display: block; max-width: 100%; height: auto; min-width: 560px; margin: 0 auto; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.diagram .node-link:hover rect { stroke-width: 3; }
.facts { margin: 0; }
.facts dt { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 12px; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 3px 0 0; }
.date-list { list-style: none; margin: 0; padding: 0; }
.date-list li { padding: 7px 0; border-top: 1px solid var(--line); }
.date-list li:first-child { border-top: 0; }
.feedback-card { margin-top: 26px; }
.feedback-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.feedback-form textarea { flex: 1 1 380px; }
.feedback-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.feedback-list > li:not(.card) { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.feedback-list .fb-done { opacity: .65; }

/* Dropdown menu */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::after { content: " ▾"; }
.menu-items { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); min-width: 260px; padding: 6px; z-index: 40; }
.menu-items a, .menu-items button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: none; border-radius: 6px; cursor: pointer; }
.menu-items a:hover, .menu-items button:hover { background: var(--brand-soft); }
.menu-items form { margin: 0; }

/* Occurrences (calendar) */
.occurrences { list-style: none; margin: 0; padding: 0; }
.occurrence { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.occurrence:first-child { border-top: 0; }
.occ-date { flex: none; width: 48px; text-align: center; border-radius: 8px; background: var(--brand-soft); padding: 4px 0; line-height: 1.1; }
.occ-day { display: block; font-size: 1.25rem; font-weight: 800; color: var(--brand-dark); }
.occ-mon { display: block; font-size: .72rem; text-transform: uppercase; color: var(--brand-dark); font-weight: 700; }
.occ-body { display: flex; flex-direction: column; min-width: 0; }
.month h2 { border-bottom: 2px solid var(--brand); padding-bottom: 6px; display: inline-block; }
.copy-input { font-size: .8rem; margin: 6px 0 10px; }

/* My tasks */
.mine-steps { list-style: none; margin: 8px 0 0; padding: 0; }
.mine-steps li { padding: 8px 0; border-top: 1px solid var(--line); }
.mine-steps a { font-weight: 650; text-decoration: none; color: var(--graphite); }
.mine-steps a:hover { color: var(--brand-dark); }
.step-no { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; background: var(--graphite); color: #fff; font-size: .78rem; font-weight: 800; padding: 0 6px; }

/* History */
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.history .card { margin: 0; }
.history .current { border-color: var(--brand); }
.history-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.changes { margin: 0 0 10px; padding-left: 20px; font-size: .9rem; }
.mini-flow { padding-left: 22px; }
.mini-flow li { margin: 6px 0; }

/* Tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: #faf9f7; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { color: var(--muted); }
.table td select { min-width: 210px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; }

/* ---------- Editor */
.form-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 24px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.editor-card { padding-bottom: 12px; }
.editor-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.editor-head h2 { margin-bottom: 10px; }
.editor-head .tabs { border: 0; margin: 0; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar.bottom { margin: 12px 0 0; }
.toolbar .spacer { flex: 1; }
.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.step-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 10px; }
.step-card.type-start { border-left-color: var(--brand); }
.step-card.type-end { border-left-color: var(--graphite); }
.step-card.type-decision { border-left-color: #d29b2c; }
.step-card.dragging { opacity: .5; }
.step-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 1.1rem; padding: 0 4px; user-select: none; touch-action: none; }
.collapse-btn { background: none; border: 0; font-size: 1rem; cursor: pointer; color: var(--muted); width: 26px; }
.step-preview { font-weight: 700; color: var(--graphite); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-pill { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: #efefec; color: var(--graphite); }
.type-pill.type-start { background: var(--brand-soft); color: var(--brand-dark); }
.type-pill.type-decision { background: var(--warn-soft); color: var(--warn); }
.step-head-actions { display: flex; gap: 4px; }
.step-body { padding: 4px 14px 14px 14px; border-top: 1px solid var(--line); }
.step-card.collapsed .step-body { display: none; }
.step-grid { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 12px; margin-top: 10px; }
.step-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 8px; }
.step-cols .actors, .step-cols .links { display: grid; gap: 6px; margin: 6px 0 8px; }
.outgoing { background: #faf9f7; border-radius: 8px; padding: 10px 12px; font-size: .9rem; }
.outgoing ul { margin: 6px 0; padding-left: 0; list-style: none; }
.outgoing li { margin: 3px 0; }
.quick-connect select { max-width: 340px; min-height: 34px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; margin-top: 4px; }
.kind-badge { display: inline-block; font-size: .75rem; font-weight: 700; border-radius: 6px; padding: 1px 7px; background: #eeeeec; color: #555; }
.kind-badge.kind-if { background: #fde9e2; color: #a53512; }
.kind-badge.kind-else { background: #e5efee; color: #3f5a59; }
.kind-badge.kind-and { background: #efeaf4; color: #5a4a6a; }
.kind-badge.kind-or { background: #f6efdc; color: #6f540c; }
.empty-hint { padding: 16px; text-align: center; }

.graph-hint { margin: -4px 0 10px; }
.graph-viewport { position: relative; height: 600px; min-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; resize: vertical;
  background-color: #fff; background-image: radial-gradient(#dcdcd8 1px, transparent 1px); background-size: 20px 20px; touch-action: pan-x pan-y; }
.graph-sizer { position: relative; }
.graph-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.edge-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.edge-hit { stroke: transparent; stroke-width: 16; fill: none; pointer-events: stroke; cursor: pointer; }
.edge.selected .edge-line { filter: drop-shadow(0 0 3px rgba(231, 70, 28, .6)); }
.edge.related .edge-line { stroke-width: 3; }
.temp-edge { stroke: var(--brand); stroke-width: 2; stroke-dasharray: 5 4; fill: none; }
.node { position: absolute; background: #fff; border: 2px solid #6d7276; border-radius: 10px; padding: 8px 11px 12px; cursor: grab; user-select: none; touch-action: none; box-shadow: 0 3px 10px rgba(0, 0, 0, .08); z-index: 2; }
.node:active { cursor: grabbing; }
.node.type-start { border-color: var(--brand); background: #fff5f0; border-radius: 26px; }
.node.type-end { border-color: var(--graphite); background: #f2f2f0; border-radius: 26px; }
.node.type-decision { border-color: #b9770e; border-style: dashed; background: #fffaf2; }
.node.selected { box-shadow: 0 0 0 3px rgba(231, 70, 28, .45), 0 3px 10px rgba(0, 0, 0, .1); }
.node.drop-target { box-shadow: 0 0 0 4px rgba(36, 102, 63, .5); }
.node-type { font-size: .68rem; font-weight: 800; text-transform: uppercase; color: #8a3a26; letter-spacing: .04em; }
.node-title { font-weight: 700; color: var(--ink); line-height: 1.3; word-wrap: break-word; }
.node-who { font-size: .74rem; color: var(--muted); margin-top: 3px; }
.port { position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--brand); cursor: crosshair; opacity: .55; transition: opacity .15s, transform .15s; }
.node:hover .port, .node.selected .port { opacity: 1; transform: scale(1.15); }
.edge-panel { margin: 12px 0; border-color: var(--brand); }
.edge-panel-head { margin-bottom: 8px; }
.edge-panel-grid { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.edge-panel-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; }
.edge-panel-grid .grow { flex: 1 1 260px; }
.edge-list ul { list-style: none; margin: 0 0 10px; padding: 0; }
.edge-list li { padding: 6px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.edge-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; background: #faf9f7; border-radius: 10px; padding: 10px 12px; }
.edge-add label { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; font-weight: 600; flex: 1 1 150px; }
.zoom { display: flex; gap: 2px; }
.zoom-level { min-width: 62px; }
.planning { margin-top: 14px; background: #faf9f7; border-radius: 8px; padding: 10px 12px; }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0, 0, 0, .06);
  display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 10px max(20px, calc((100vw - 1200px) / 2)); }
.save-state { margin-right: auto; font-size: .9rem; }

/* Login */
.login-page .main { display: grid; place-items: center; }
.loginbox { max-width: 460px; margin: 60px auto; text-align: center; padding: 34px 30px; border-top: 4px solid var(--brand); }
.login-logo { height: 110px; margin-bottom: 14px; }

/* ---------- Responsive */
@media (max-width: 980px) {
  .layout-main-aside { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  h1 { font-size: 1.5rem; }
  .wrap, .main { padding-left: 14px; padding-right: 14px; }
  .topbar { flex-wrap: wrap; gap: 8px 14px; padding: 8px 0 0; min-height: 0; }
  .brand img { height: 38px; }
  .user-box { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 6px; }
  .process-row { flex-direction: column; gap: 6px; }
  .process-row-side { flex-direction: row; gap: 12px; align-items: flex-start; }
  .filters { grid-template-columns: 1fr; }
  .step-grid, .step-cols, .field-row { grid-template-columns: 1fr; }
  .step-head { flex-wrap: wrap; }
  .step-head-actions { width: 100%; justify-content: flex-end; }
  .graph-viewport { height: 460px; }
  .hero-search { flex-basis: 100%; }
  .savebar { padding: 10px 14px; }
  .menu-items { right: auto; left: 0; }
}

/* ---------- Print */
@media print {
  .site-header, .site-footer, .actions, .tabs, .no-print, .savebar, .skip-link { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .main { padding: 0; }
  .tabpane { display: block !important; }
  .card, .flow-body, .process-row { box-shadow: none; break-inside: avoid; }
  .layout-main-aside { grid-template-columns: 1fr; }
  a { color: inherit; text-decoration: none; }
  .diagram-scroll { max-height: none; overflow: visible; }
}
