/* base reset */
:root{color-scheme:light;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}html{scroll-padding-top:env(safe-area-inset-top,0px)}body{margin:0;padding:0;font:14px -apple-system,BlinkMacSystemFont,sans-serif;background:#fff;color:#000}img{max-width:100%}[hidden]:not([hidden=until-found i]){display:none!important}

/* BENVIC BPM portal */

:root {
  --brand-blue: #0f5c9a;
  --brand-grey: #6c757d;
  --teal-dark: #0e5a73;
  --teal-darker: #0a4459;
  --accent: #1C86C4;
  --accent-dark: #0A3B60;
  --panel-bg: #d3ecf7;
  --panel-border: #bcdcec;
  --text-navy: #123b57;
  --page-bg: #ffffff;
  --surface: #ffffff;
  --border: #dde6ec;
  --muted: #6b7c87;
  --disabled-bg: #eef1f3;
  --disabled-border: #dbe1e5;
  --disabled-text: #98a3aa;
}

* { box-sizing: border-box; }

html {
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text-navy);
}

a { color: inherit; }

/* ---------- Header ---------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-logo {
  height: 39px;
  width: auto;
  display: block;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-navy);
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.topnav {
  display: flex;
  gap: 22px;
}

.topnav a {
  text-decoration: none;
  color: var(--text-navy);
  font-size: 0.95rem;
}
.topnav a:hover { color: var(--brand-blue); }

.prototype-banner {
  background: #fff4d6;
  color: #6b5300;
  text-align: center;
  font-size: 0.85rem;
  padding: 6px 12px;
}

/* ---------- Layout ---------- */

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 20px;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 18px;
}
.breadcrumb a { text-decoration: none; color: var(--brand-blue); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 6px; color: var(--disabled-text); }

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--text-navy);
}

/* ---------- Home / cycle ---------- */

.cycle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0 10px;
}

.cycle-canvas {
  position: relative;
  width: 816px;
  max-width: 100%;
  background: var(--page-bg);
}

.cycle-image {
  display: block;
  width: 100%;
  height: auto;
}

.enter-hotspot {
  position: absolute;
  display: block;
  border-radius: 3px;
  outline: none;
}
.enter-hotspot:hover,
.enter-hotspot:focus-visible {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.85), 0 0 0 4px #2A9FD6;
}

/* ---------- L0 map ---------- */

/* One medium logo sitting in the left margin of the Level-0 map,
   centred in that margin and vertically aligned with the "Business
   Departments" title (its top offset is computed in app.js once the
   title has laid out, and kept in sync on resize). Clear of the
   centered content column so it never overlaps the boxes; hidden
   below the width where the margin isn't wide enough to fit it
   without crowding the content. */
.side-logo-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: calc((100vw - 1200px) / 2);
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity .2s ease;
}
body.show-watermark .side-logo-wrap {
  opacity: 0.9;
}
.side-logo {
  width: 220px;
  height: auto;
  display: block;
}

@media (max-width: 1750px) {
  .side-logo-wrap { display: none; }
}

.app { position: relative; z-index: 1; }

/* Main map: Master data spans the full width on top, Finance &
   Controlling spans the full width on the bottom, and the nine process
   families form a 3x3 grid in between. Business Intelligence sits below
   this grid as its own full-width bar (see .l0-bottom-rows). */
.l0-mainmap {
  display: grid;
  grid-template-columns: repeat(6, 1fr) 1.2fr;
  grid-template-areas:
    "MD  MD  MD  MD  MD  MD  MD"
    "MKG MKG ETO ETO L2Q L2Q FC"
    "D2S D2S O2C O2C P2P P2P FC"
    "OPE OPE QLM QLM PMA PMA FC";
  gap: 10px;
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .l0-mainmap {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "MD  FC"
      "MKG ETO"
      "L2Q D2S"
      "O2C P2P"
      "OPE QLM"
      "PMA PMA";
  }
}

.l0-card {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  min-height: 72px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 11px 18px;
  text-align: left;
  text-decoration: none;
  color: var(--text-navy);
  box-shadow: 0 1px 3px rgba(10,46,71,0.06);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.l0-card-main {
  flex: 1 1 140px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.l0-card.active {
  cursor: pointer;
  background: linear-gradient(160deg, #2ea3e8 0%, #0d6fb8 55%, #0a5a94 100%);
  border: 1px solid #084a7a;
  color: #ffffff;
  box-shadow:
    0 10px 22px rgba(9, 66, 107, 0.35),
    0 2px 4px rgba(9, 66, 107, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -10px 16px rgba(6,44,71,0.25);
}
.l0-card.active:hover {
  transform: translateY(-6px);
  box-shadow:
    0 16px 30px rgba(9, 66, 107, 0.4),
    0 3px 6px rgba(9, 66, 107, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -10px 16px rgba(6,44,71,0.22);
}
.l0-card.disabled {
  background: #f4f2ec;
  border: 1.5px dashed #c9c2b3;
  color: #9a9385;
  box-shadow: none;
  cursor: default;
}

.l0-card-code {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
}
.l0-card.active .l0-card-code, .l0-bar.active .l0-card-code { color: #d6ecfb; }
.l0-card.disabled .l0-card-code, .l0-bar.disabled .l0-card-code { color: #b3ab9a; }

.l0-card-label {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.32;
}
.l0-card.active .l0-card-label, .l0-bar.active .l0-bar-label { color: #ffffff; }

.l0-card-sublist {
  margin: 0;
  padding-left: 16px;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted);
}
.l0-card-sublist li { margin: 0; }
.l0-card.active .l0-card-sublist,
.l0-bar.active .l0-card-sublist { color: #e3f2fc; }
.l0-card.disabled .l0-card-sublist,
.l0-bar.disabled .l0-card-sublist { color: #a9a190; }

/* Master data: lower-level titles laid out in a horizontal sequence
   instead of a vertical list. Flex items don't render the normal list
   marker, so the bullet is added back with ::before. */
.l0-card-sublist-inline {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  gap: 4px 10px;
}
.l0-card-sublist-inline li {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.l0-card-sublist-inline li::before {
  content: "•";
  color: var(--accent);
}
.l0-card.active .l0-card-sublist-inline li::before { color: #d6ecfb; }
.l0-card.disabled .l0-card-sublist-inline li::before { color: #b3ab9a; }

.owner-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.owner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 22px;
  flex: 0 0 auto;
  box-sizing: border-box;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--teal-darker);
  border: 1px solid var(--panel-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.l0-card.active .owner-badge,
.l0-bar.active .owner-badge {
  background: #ffffff;
  color: #0a5a94;
  border-color: #cfe6f4;
  box-shadow: 0 2px 4px rgba(9,66,107,0.2);
}
.l0-card.disabled .owner-badge,
.l0-bar.disabled .owner-badge {
  background: #ffffff;
  color: #a9a190;
  border-color: #e2ddd0;
}

/* Full-width bars: Information Technology, Human Resources,
   Health/Safety/Environment and Legal span the whole map width in the
   original slide instead of sitting in the card grid above. */

.l0-bottom-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}

.l0-bottom-split {
  display: flex;
  gap: 10px;
}
.l0-bottom-split .l0-bar { flex: 1; min-width: 0; }

@media (max-width: 760px) {
  .l0-bottom-split { flex-direction: column; }
}

.l0-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 11px 20px;
  text-decoration: none;
  color: var(--text-navy);
  box-shadow: 0 1px 3px rgba(10,46,71,0.06);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.l0-bar.active {
  cursor: pointer;
  background: linear-gradient(160deg, #2ea3e8 0%, #0d6fb8 55%, #0a5a94 100%);
  border: 1px solid #084a7a;
  color: #ffffff;
  box-shadow:
    0 10px 22px rgba(9, 66, 107, 0.35),
    0 2px 4px rgba(9, 66, 107, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -10px 16px rgba(6,44,71,0.25);
}
.l0-bar.active:hover {
  transform: translateY(-5px);
  box-shadow:
    0 15px 28px rgba(9, 66, 107, 0.4),
    0 3px 6px rgba(9, 66, 107, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -10px 16px rgba(6,44,71,0.22);
}
.l0-bar.disabled {
  background: #f4f2ec;
  border: 1.5px dashed #c9c2b3;
  color: #9a9385;
  box-shadow: none;
  cursor: default;
}

.l0-bar-head {
  flex: 0 0 auto;
  min-width: 170px;
}

.l0-bar-label {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.32;
}

.l0-bar-items {
  flex: 1 1 auto;
}

/* Same plain bullet + title treatment as the card sublist above, just
   flowed into columns so it reads well across a wide bar instead of
   framed chips. */
.l0-bar-sublist {
  flex: 1 1 auto;
  min-width: 0;
  columns: 3 170px;
  column-gap: 24px;
}
.l0-bar-sublist li {
  break-inside: avoid;
}

.l0-bar .owner-badges { margin-top: 0; flex: 0 0 auto; }

/* On the 3x3 process grid, owners sit in a single narrow column on the
   right of the box, vertically centered. */
.l0-card .owner-badges {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  align-self: center;
  margin-top: 0;
  max-width: 92px;
}
.l0-card .owner-badges .owner-badge { white-space: nowrap; }

/* Master data, Finance & Controlling, Business Intelligence, Information
   Technology and Human Resources span the full width of the map; their
   owners flow into columns of at most two badges each instead of one
   long single column. */
.l0-card-wide .owner-badges {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  gap: 5px 8px;
  max-width: none;
}

/* Area-owner legend, replicating the name list at the bottom of the
   original Level-0 slide. */

.owner-legend {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.owner-legend-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 14px;
}

.owner-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.legend-name { color: var(--text-navy); }

/* ---------- Family / process pages (styled) ---------- */

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px;
}

.hero-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-navy);
  margin: 0 0 30px;
  letter-spacing: -0.3px;
}

/* Mini-stepper: quick links between sibling stages */

.mini-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -14px 0 28px;
}

.mini-step {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
}
.mini-step:hover { border-color: var(--accent); color: var(--accent); }
.mini-step.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Family page: connected flow of sequential steps */

.flow-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.flow-step {
  position: relative;
  width: 190px;
  min-height: 130px;
  background: linear-gradient(160deg, #2ea3e8 0%, #0d6fb8 55%, #0a5a94 100%);
  border: 1px solid #084a7a;
  border-radius: 16px;
  padding: 24px 18px;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  box-shadow:
    0 10px 22px rgba(9, 66, 107, 0.35),
    0 2px 4px rgba(9, 66, 107, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -10px 16px rgba(6,44,71,0.25);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.flow-step:not(.is-empty):not(.flow-static):hover {
  transform: translateY(-6px);
  box-shadow:
    0 16px 30px rgba(9, 66, 107, 0.4),
    0 3px 6px rgba(9, 66, 107, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -10px 16px rgba(6,44,71,0.22);
}
/* Blue level box that is not (yet) a link: same look as level 1, no hover lift */
.flow-step.flow-static { cursor: default; }

.flow-step.is-empty {
  background: #f4f2ec;
  border: 1.5px dashed #c9c2b3;
  color: #9a9385;
  box-shadow: none;
  cursor: default;
}

.flow-badge {
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #ffffff;
  color: #0a5a94;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(9,66,107,0.2);
}
.flow-step.is-empty .flow-badge {
  background: #ffffff;
  color: #a9a190;
  box-shadow: none;
}

.flow-label {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
}

.flow-arrow {
  flex: 0 0 auto;
  color: var(--disabled-text);
  padding: 0 4px;
  display: flex;
  align-items: center;
}

@media (max-width: 760px) {
  .flow-row { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); padding: 4px 0; }
}

/* Small tag on a level-1 box (e.g. "OTC & FI" = process shared with Finance) */
.flow-tag {
  position: absolute;
  top: -11px;
  right: 10px;
  background: #6b7785;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 3px 9px;
  border-radius: 11px;
  border: 2px solid #fff;
}

/* Family page with connected flows (Master Data above, Finance below).
   Same 9-track grid as the level-1 row: box, arrow, box, arrow ... */
.cf-grid {
  display: grid;
  justify-content: center;
  row-gap: 0;
}
.cf-mid { display: flex; justify-content: center; }
.cf-grid .flow-arrow { justify-content: center; }
.cf-grid .flow-arrow.two-way { flex-direction: column; gap: 2px; }
.cf-grid .flow-arrow .back { display: flex; transform: rotate(180deg); }

/* Connected flows: very light grey header (--c), medium grey text (#6b7785) */
.cf-box {
  --c: #d3d9e0;
  border: 1.5px solid #aab4c0;
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
}
.cf-head {
  background: var(--c);
  color: #6b7785;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.cf-lnk { cursor: pointer; text-decoration: none; color: inherit; }
.cf-head .cf-name { min-width: 0; }
.cf-head .cf-name::after { content: " \203A"; opacity: .55; }
.cf-head .cf-name:hover { text-decoration: underline; color: #0a3b60; }
a.cf-pill { display: block; text-align: center; }
.cf-pill.cf-lnk:hover { border-color: #1C86C4; color: #0a3b60; box-shadow: 0 0 0 2px #d6ecfa; }
.cf-chip {
  background: #fff;
  color: #6b7785;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 9px;
  border-radius: 9px;
}
.cf-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding: 10px;
}
.cf-pill {
  background: #fff;
  border: 1px solid #d3d9e0;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 8px;
  text-align: center;
  color: #6b7785;
}

/* Stack of groups with a side group on the right, joined by horizontal
   double arrows (e.g. D2S + P2P  <->  OPE) */
.cf-cluster {
  display: grid;
  grid-template-columns: 190px 40px 190px;
}
.cf-cl-g, .cf-cl-conn { grid-column: 1; }
.cf-cl-h { grid-column: 2; position: relative; min-height: 14px; }
.cf-cl-side { grid-column: 3; display: flex; }
.cf-cl-side .cf-box { flex: 1; }
.cf-cl-h::before {
  content: "";
  position: absolute;
  left: 6px; right: 6px; top: 50%;
  border-top: 2px dashed #5b6b7a;
  transform: translateY(-1px);
}
.cf-cl-h::after {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  margin-top: -6px;
  border: 6px solid transparent;
  border-left: 8px solid #5b6b7a;
  border-right: 0;
}
.cf-cl-h i {
  position: absolute;
  left: 0; top: 50%;
  margin-top: -6px;
  border: 6px solid transparent;
  border-right: 8px solid #5b6b7a;
  border-left: 0;
}

/* Short double-headed link between two stacked groups (e.g. D2S <-> P2P) */
.cf-conn.cf-short { height: 30px; }

/* Dashed vertical link with arrowhead(s) and a short caption */
.cf-conn { position: relative; height: 64px; }
.cf-conn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 7px;
  border-left: 2px dashed #5b6b7a;
  transform: translateX(-1px);
}
.cf-conn::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top: 8px solid #5b6b7a;
  border-bottom: 0;
}
.cf-conn.both::before { top: 7px; }
.cf-conn.lab-left span { left: auto; right: calc(50% + 12px); }
.cf-elbow-wrap { pointer-events: none; }
.cf-elbow { display: block; overflow: visible; }
.cf-elbow path { fill: none; stroke: #5b6b7a; stroke-width: 2; stroke-dasharray: 4 3; }
.cf-elbow polygon { fill: #5b6b7a; }
.cf-elbow text { font-size: 12px; font-style: italic; fill: #44525f; }
/* one-way link whose arrowhead points up, at the box above */
.cf-conn.up::before { top: 7px; bottom: 0; }
.cf-conn.up::after { display: none; }
.cf-up {
  position: absolute;
  left: 50%;
  top: 0;
  margin-left: -6px;
  border: 6px solid transparent;
  border-bottom: 8px solid #5b6b7a;
  border-top: 0;
}
.cf-conn span {
  position: absolute;
  left: calc(50% + 12px);
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-style: italic;
  color: #44525f;
  white-space: nowrap;
}

/* Compact connected boxes: items in two columns (opt-in with connected.twoCol) */
.cf-wide.cf-two .cf-pills { grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px; }
.cf-wide.cf-two .cf-pill { font-size: 0.66rem; padding: 4px 3px; line-height: 1.15; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.cf-wide.cf-two .cf-pills .cf-pill:only-child { grid-column: 1 / -1; }
.cf-wide.cf-two .cf-head { min-height: 0; padding: 5px 8px; font-size: 0.78rem; }
@media (max-width: 900px) { .cf-wide.cf-two .cf-pills { grid-template-columns: 1fr; } .cf-wide.cf-two .cf-pill { font-size: 0.82rem; } }

/* Wide variant: a level box spans several slots; connected groups sit side by side */
.cf-wide .flow-step { width: 100%; }
.cf-wide .cf-box { margin: 0 4px; }
.cf-wide .cf-pills { grid-template-columns: 1fr; }
/* connected boxes of one row all get the same height (header sized for two lines) */
.cf-wide .cf-top { align-self: stretch !important; display: flex; }
.cf-wide .cf-top .cf-box { flex: 1; }
.cf-wide .cf-head { min-height: 48px; }
.cf-head span:first-child { min-width: 0; }

.cf-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 28px;
  font-size: 0.82rem;
  color: #52606d;
}
.cf-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cf-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.cf-legend .flow-tag { position: static; }

@media (max-width: 760px) {
  .cf-grid { display: flex; flex-direction: column; align-items: center; gap: 10px; }
  .cf-top { order: 1; }
  .cf-mid { order: 2; }
  .cf-bottom { order: 3; }
  .cf-top, .cf-bottom { align-self: center !important; width: min(100%, 420px); }
  .cf-box { width: 100%; }
  .cf-wide .flow-step { width: 190px; }
  .cf-wide .cf-box { margin: 0; }
  .cf-wide .cf-top { display: block; align-self: center !important; }
  .cf-wide .cf-head { min-height: 0; }
  .cf-conn, .cf-elbow-wrap { display: none; }
  .cf-conn.cf-short { display: block; }
  .cf-cluster { display: flex; flex-direction: column; width: 100%; }
  .cf-cl-h { display: none; }
  .cf-cl-side { margin-top: 10px; }
}

/* Process page: category card grid */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(160deg, #2ea3e8 0%, #0d6fb8 55%, #0a5a94 100%);
  border: 1px solid #084a7a;
  border-radius: 16px;
  padding: 22px 20px;
  text-decoration: none;
  color: #ffffff;
  box-shadow:
    0 10px 22px rgba(9, 66, 107, 0.35),
    0 2px 4px rgba(9, 66, 107, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -10px 16px rgba(6,44,71,0.25);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cat-card.linked:hover {
  transform: translateY(-6px);
  box-shadow:
    0 16px 30px rgba(9, 66, 107, 0.4),
    0 3px 6px rgba(9, 66, 107, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -10px 16px rgba(6,44,71,0.22);
}
.cat-card.empty {
  background: #f4f2ec;
  border: 1.5px dashed #c9c2b3;
  color: #9a9385;
  box-shadow: none;
  opacity: 1;
  cursor: default;
}

.cat-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #ffffff;
  color: #0a5a94;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(9,66,107,0.2);
}
.cat-card.empty .cat-icon { background: #ffffff; color: #a9a190; box-shadow: none; }

.cat-label {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.3;
  color: #ffffff;
}
.cat-card.empty .cat-label { color: #9a9385; }

.cat-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: #e3f2fc;
}
.cat-card.empty .cat-hint { color: #a9a190; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal-dark);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.back-link:hover { text-decoration: underline; }

/* ==========================================================================
   Alternative visual "skins" for the Business Departments rectangles.
   Each is toggled with a body class (theme-elevation / theme-accent /
   theme-tinted / theme-outline) for side-by-side comparison. None of them
   touch layout, sizing, spacing or the grid disposition — only colour,
   border and shadow treatment of .l0-card / .l0-bar.
   ========================================================================== */

/* --- Theme 1: Elevation — no border, soft shadow, plain white surface --- */
body.theme-elevation .l0-card,
body.theme-elevation .l0-bar {
  border: none;
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(10,46,71,0.10);
  background: var(--surface);
}
body.theme-elevation .l0-card.disabled,
body.theme-elevation .l0-bar.disabled {
  background: var(--disabled-bg);
  box-shadow: 0 3px 10px rgba(10,46,71,0.05);
}
body.theme-elevation .l0-card.active:hover,
body.theme-elevation .l0-bar.active:hover {
  box-shadow: 0 14px 28px rgba(10,46,71,0.16);
}

/* --- Theme 2: Accent stripe — thin coloured bar on the left edge --- */
body.theme-accent .l0-card,
body.theme-accent .l0-bar {
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
}
body.theme-accent .l0-card.disabled,
body.theme-accent .l0-bar.disabled {
  border-left-color: var(--disabled-border);
  background: var(--disabled-bg);
}
body.theme-accent .l0-card-wide.active,
body.theme-accent .l0-bar.active {
  border-left-color: var(--teal-dark);
}

/* --- Theme 3: Tinted — soft colour wash behind active rectangles --- */
body.theme-tinted .l0-card.active,
body.theme-tinted .l0-bar.active {
  background: linear-gradient(180deg, #eaf6ff 0%, #ffffff 100%);
  border-color: var(--accent);
}
body.theme-tinted .l0-card.disabled,
body.theme-tinted .l0-bar.disabled {
  background: var(--disabled-bg);
}
body.theme-tinted .l0-card-code { color: var(--accent-dark); }

/* --- Theme 4: Outline — transparent fill, crisp border, pill-shaped code tag --- */
body.theme-outline .l0-card,
body.theme-outline .l0-bar {
  background: transparent;
  border: 1.5px solid var(--muted);
  box-shadow: none;
  border-radius: 10px;
}
body.theme-outline .l0-card.disabled,
body.theme-outline .l0-bar.disabled {
  border-color: var(--disabled-border);
}
body.theme-outline .l0-card-code,
body.theme-outline .l0-bar-label + .l0-card-code {
  display: inline-block;
  background: var(--panel-bg);
  color: var(--teal-darker);
  padding: 2px 9px;
  border-radius: 999px;
}
body.theme-outline .l0-card.disabled .l0-card-code {
  background: var(--surface);
}

/* ==========================================================================
   Per-department colour coding. Each box carries data-code="MD"/"ETO"/...
   (set in app.js). This mapping just exposes that colour as --fam-color;
   it has no visual effect until one of the theme-dept-* classes below
   consumes it, so it is safe to keep global. Boxes not yet migrated
   (disabled) fall back to the neutral grey used elsewhere for "not
   available" content, regardless of their department colour.
   ========================================================================== */
[data-code="MD"]  { --fam-color: #607d8b; }
[data-code="ETO"] { --fam-color: #e67e22; }
[data-code="P2P"] { --fam-color: #8e44ad; }
[data-code="OPE"] { --fam-color: #c0392b; }
[data-code="L2Q"] { --fam-color: #16a085; }
[data-code="O2C"] { --fam-color: #2980b9; }
[data-code="MKG"] { --fam-color: #d81b60; }
[data-code="D2S"] { --fam-color: #f39c12; }
[data-code="QLM"] { --fam-color: #00acc1; }
[data-code="PMA"] { --fam-color: #6d4c41; }
[data-code="FC"]  { --fam-color: #2e7d32; }
[data-code="BIN"] { --fam-color: #5c6bc0; }
[data-code="INT"] { --fam-color: #34495e; }
[data-code="HRF"] { --fam-color: #ff7043; }
[data-code="HSE"] { --fam-color: #7cb342; }
[data-code="LEG"] { --fam-color: #4a4a4a; }

/* --- Theme 5: Department stripe — accent-stripe theme, one colour per box --- */
body.theme-dept-stripe .l0-card,
body.theme-dept-stripe .l0-bar {
  border: 1px solid var(--border);
  border-left: 5px solid var(--fam-color, var(--accent));
  border-radius: 10px;
  background: var(--surface);
}
body.theme-dept-stripe .l0-card.disabled,
body.theme-dept-stripe .l0-bar.disabled {
  border: 1px dashed #c9d1d6;
  background: #eef1f4;
}
body.theme-dept-stripe .l0-card-code { color: var(--fam-color, var(--accent)); }
body.theme-dept-stripe .l0-card.disabled .l0-card-code,
body.theme-dept-stripe .l0-bar.disabled .l0-card-code { color: var(--disabled-text); }

/* --- Theme 6: Department tint — soft colour wash, one hue per box --- */
body.theme-dept-tint .l0-card.active,
body.theme-dept-tint .l0-bar.active {
  background: color-mix(in srgb, var(--fam-color, var(--accent)) 10%, white);
  border-color: color-mix(in srgb, var(--fam-color, var(--accent)) 45%, white);
}
body.theme-dept-tint .l0-card.disabled,
body.theme-dept-tint .l0-bar.disabled {
  background: var(--disabled-bg);
}
body.theme-dept-tint .l0-card-code { color: var(--fam-color, var(--accent-dark)); }
body.theme-dept-tint .l0-card.disabled .l0-card-code,
body.theme-dept-tint .l0-bar.disabled .l0-card-code { color: var(--disabled-text); }
body.theme-dept-tint .l0-card.active .owner-badge,
body.theme-dept-tint .l0-bar.active .owner-badge {
  border-color: color-mix(in srgb, var(--fam-color, var(--accent)) 40%, var(--panel-border));
}



/* Symbol on every box that opens a lower level: round white badge with a chevron */
a.has-sub { position: relative; }
.has-sub::after {
  content: "\203A";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: #0a5a94;
  font-weight: 800;
  font-size: 20px;
  line-height: 23px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(9, 66, 107, 0.3);
  pointer-events: none;
  z-index: 2;
}
.flow-step.has-sub { padding-bottom: 40px; }
.cat-card.has-sub { padding-bottom: 44px; }
.l0-bar.has-sub, .l0-card-wide.has-sub { padding-right: 54px; }
.l0-bar.has-sub::after, .l0-card-wide.has-sub::after { top: 50%; bottom: auto; transform: translateY(-50%); }

/* ====== Document Explorer / Catalogue (prototype) ====== */
.topnav { flex-wrap: wrap; gap: 8px 18px; }
.topnav .dx-nav-tag { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: #fff3cd; color: #7a5a00; border-radius: 8px; padding: 1px 6px; margin-left: 4px; vertical-align: 2px; }
.dx-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; padding: 12px 16px; border: 1px dashed #1C86C4; border-radius: 12px; background: #eef7fd; color: #0a3b60; text-decoration: none; font-size: 0.92rem; }
.dx-banner:hover { background: #e1f1fb; }
.dx-rolebar { margin: 6px 0 18px; padding: 14px 16px; border: 1px solid #bcdcec; border-radius: 12px; background: #f4fafe; }
.dx-rb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.dx-rb-label { font-weight: 700; color: #123b57; font-size: 0.9rem; }
.dx-select { font: inherit; font-size: 0.9rem; padding: 7px 10px; border: 1px solid #bcdcec; border-radius: 8px; background: #fff; color: #123b57; max-width: 100%; }
.dx-select-sm { font-size: 0.85rem; padding: 6px 8px; }
.dx-rights { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.dx-right { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #e6eaee; color: #8995a1; text-decoration: line-through; }
.dx-right.on { background: #dff3e6; color: #1f7a45; text-decoration: none; }
.dx-rb-note { margin: 10px 0 0; font-size: 0.84rem; color: #3f5b72; line-height: 1.45; }
.dx-rb-note code, .dx-intro code, .dx-foot code, .dx-table code { background: #e9f1f7; padding: 1px 5px; border-radius: 4px; font-size: 0.82em; color: #123b57; }
.dx-rb-demo { display: block; margin-top: 4px; font-style: italic; color: #6b7785; }
.dx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.dx-chip { font: inherit; font-size: 0.84rem; font-weight: 600; padding: 6px 12px; border: 1px solid #bcdcec; border-radius: 999px; background: #fff; color: #0a5a94; cursor: pointer; }
.dx-chip span { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #e6f1f9; font-size: 0.76rem; text-align: center; }
.dx-chip:hover { background: #eef7fd; }
.dx-chip.on { background: #1C86C4; border-color: #1C86C4; color: #fff; }
.dx-chip.on span { background: rgba(255,255,255,.25); color: #fff; }
.dx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.dx-search { flex: 1 1 260px; font: inherit; font-size: 0.9rem; padding: 8px 12px; border: 1px solid #bcdcec; border-radius: 8px; min-width: 0; }
.dx-check { font-size: 0.84rem; color: #3f5b72; display: inline-flex; align-items: center; gap: 6px; }
.dx-hidden { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; background: #fff6e0; color: #6b4e00; font-size: 0.86rem; }
.dx-tablewrap { overflow-x: auto; border: 1px solid #d5e5f0; border-radius: 12px; background: #fff; }
.dx-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; color: #1f3a4f; }
.dx-table th { text-align: left; padding: 10px 12px; background: #eef5fa; color: #3f5b72; font-size: 0.76rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; border-bottom: 1px solid #d5e5f0; }
.dx-table td { padding: 10px 12px; border-bottom: 1px solid #edf2f6; vertical-align: middle; }
.dx-table tbody tr:last-child td { border-bottom: 0; }
.dx-table tbody tr:hover { background: #f8fbfd; }
.dx-num { white-space: nowrap; color: #51667a; }
.dx-c-title { display: flex; align-items: center; gap: 10px; min-width: 280px; }
.dx-title { font-weight: 600; color: #123b57; }
.dx-sub { font-size: 0.76rem; color: #7a8a99; font-weight: 400; }
.dx-ficon { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #e6f1f9; color: #0a5a94; }
.dx-ext-xlsx { background: #e3f4ea; color: #1f7a45; }
.dx-ext-docx { background: #e6edfb; color: #2a52b8; }
.dx-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.dx-st-published { background: #dff3e6; color: #1f7a45; }
.dx-st-in-review { background: #fff0cf; color: #8a5a00; }
.dx-st-draft { background: #e6edf3; color: #51667a; }
.dx-st-obsolete { background: #eceff1; color: #8995a1; text-decoration: line-through; }
.dx-conf-public { background: #e3f1fb; color: #0a5a94; }
.dx-conf-internal { background: #e9eef2; color: #51667a; }
.dx-conf-restricted { background: #fff0cf; color: #8a5a00; }
.dx-conf-confidential { background: #fde4e4; color: #a12a2a; }
.dx-c-act { text-align: right; white-space: nowrap; }
.dx-open { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: #0a5a94; text-decoration: none; font-size: 0.82rem; }
.dx-open:hover { text-decoration: underline; }
.dx-req { font: inherit; font-size: 0.78rem; font-weight: 700; padding: 5px 10px; border: 1px solid #c9d3dc; border-radius: 8px; background: #fff; color: #51667a; cursor: pointer; }
.dx-req:disabled { background: #eef2f5; color: #8995a1; cursor: default; }
.dx-locked td { color: #98a5b1; background: #fafbfc; }
.dx-locked .dx-title { color: #8995a1; }
.dx-locked .dx-ficon { background: #eef1f4; color: #98a5b1; }
.dx-empty { text-align: center; color: #7a8a99; padding: 28px 12px !important; }
.dx-tech { margin: 16px 0 6px; font-size: 0.85rem; color: #3f5b72; }
.dx-tech summary { cursor: pointer; font-weight: 600; }
.dx-tech pre { margin: 8px 0 0; padding: 12px 14px; background: #0f2a3d; color: #cfe6f5; border-radius: 10px; font-size: 0.78rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.dx-foot { margin: 12px 0 0; font-size: 0.8rem; color: #7a8a99; }
.dx-intro { max-width: 860px; font-size: 0.92rem; line-height: 1.55; color: #3f5b72; margin: 0 0 14px; }
.dx-cat .dx-lvl0 td { background: #eaf4fb; font-weight: 800; }
.dx-cat .dx-lvl1 td { background: #f5fafd; font-weight: 700; }
.dx-cat .dx-c-lbl a { color: #0a3b60; text-decoration: none; }
.dx-cat .dx-c-lbl a:hover { text-decoration: underline; }
@media (max-width: 700px) {
  .dx-rights { margin-left: 0; }
  .dx-c-title { min-width: 220px; }
}

/* ---------- Cockpit (BPM administrators) ---------- */
.topnav .ck-profile { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: #5d7385; margin-left: 6px; }
.topnav .ck-profile select { font: inherit; font-size: 0.78rem; padding: 3px 6px; border: 1px solid #bcdcec; border-radius: 6px; background: #fff; color: #123b57; }
.topnav .dx-nav-tag.ck-admin { background: #fde2e2; color: #8a1c1c; }
.ck-denied { max-width: 640px; padding: 22px 24px; border: 1px solid #e6c9c9; border-radius: 14px; background: #fff7f7; color: #4a2323; }
.ck-denied h2 { margin: 0 0 8px; font-size: 1.15rem; }
.ck-denied p { line-height: 1.5; }
.ck-small { font-size: 0.8rem; color: #6b7c87; line-height: 1.45; margin: 6px 0; }
.ck-small code, .ck-panel code, .ck-denied code, .ck-table code { background: #e9f1f7; padding: 1px 5px; border-radius: 4px; font-size: 0.82em; color: #123b57; }
.ck-notice { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: #fff8e1; border: 1px solid #f0d98a; color: #6b5200; font-size: 0.88rem; }
.ck-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; border-bottom: 1px solid #d5e5f0; }
.ck-tab { font: inherit; font-size: 0.9rem; font-weight: 600; color: #3f5b72; background: transparent; border: 0; border-bottom: 3px solid transparent; padding: 9px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.ck-tab:hover { color: #0a3b60; }
.ck-tab.on { color: #0a3b60; border-bottom-color: #1C86C4; }
.ck-badge { font-size: 0.68rem; font-weight: 800; min-width: 18px; text-align: center; padding: 1px 6px; border-radius: 9px; }
.ck-badge.err { background: #fbd5d5; color: #8a1c1c; }
.ck-badge.warn { background: #fff0c2; color: #7a5a00; }
.ck-badge.pend { background: #d6ecfa; color: #0a3b60; }
.ck-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.ck-split.flows { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .ck-split, .ck-split.flows { grid-template-columns: 1fr; } }
.ck-right { position: sticky; top: 12px; }
@media (max-width: 1000px) { .ck-right { position: static; } }
.ck-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; flex-wrap: wrap; }
.ck-in { font: inherit; font-size: 0.88rem; padding: 7px 10px; border: 1px solid #bcdcec; border-radius: 8px; background: #fff; color: #123b57; min-width: 0; width: 100%; }
.ck-in.sm { width: auto; max-width: 100%; }
.ck-in.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem; }
textarea.ck-in { resize: vertical; }
.ck-bar .ck-in { width: 260px; max-width: 100%; }
.ck-table td, .ck-table th { white-space: normal; }
.ck-r { cursor: pointer; }
.ck-r.sel td { background: #dff0fb !important; }
.ck-l0 td { background: #eaf4fb; font-weight: 800; }
.ck-l1 td { background: #f5fafd; font-weight: 700; }
.ck-acts { white-space: nowrap; text-align: right; }
.ck-ico { font: inherit; font-size: 0.72rem; width: 26px; height: 26px; border: 1px solid #cfe0ec; background: #fff; border-radius: 6px; cursor: pointer; color: #3f5b72; }
.ck-ico:hover:not(:disabled) { background: #eef5fa; }
.ck-ico:disabled { opacity: .35; cursor: default; }
.ck-type { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: #eef1f3; color: #5d6b75; }
.ck-type.t-page { background: #d6ecfa; color: #0a3b60; }
.ck-type.t-folder { background: #dff3e4; color: #1d5c2e; }
.ck-type.t-none { background: #fff0c2; color: #7a5a00; }
.ck-btn { font: inherit; font-size: 0.85rem; font-weight: 600; padding: 7px 14px; border-radius: 8px; border: 1px solid #bcdcec; background: #fff; color: #0a3b60; cursor: pointer; }
.ck-btn:hover:not(:disabled) { background: #eef5fa; }
.ck-btn:disabled { opacity: .45; cursor: default; }
.ck-btn.sm { padding: 4px 10px; font-size: 0.78rem; }
.ck-btn.primary { background: #1C86C4; border-color: #1C86C4; color: #fff; }
.ck-btn.primary:hover:not(:disabled) { background: #0f6ea6; }
.ck-btn.danger { background: #b3261e; border-color: #b3261e; color: #fff; }
.ck-btn.danger-o { color: #b3261e; border-color: #e6b8b4; }
.ck-btn.danger-o:hover:not(:disabled) { background: #fdf0ef; }
.ck-newfam { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; padding: 12px 14px; border: 1px dashed #bcdcec; border-radius: 12px; font-size: 0.85rem; }
.ck-newfam .ck-in { width: 180px; }
.ck-newfam .ck-in.sm { width: 120px; }
.ck-panel { border: 1px solid #d5e5f0; border-radius: 12px; background: #fff; padding: 14px 16px; margin: 0 0 14px; }
.ck-panel h3 { margin: 0 0 8px; font-size: 1rem; color: #0a3b60; }
.ck-panel h4 { margin: 16px 0 6px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: .04em; color: #3f5b72; }
.ck-h3 { margin: 18px 0 8px; font-size: 1rem; color: #0a3b60; }
.ck-f { display: block; margin: 10px 0; font-size: 0.78rem; font-weight: 700; color: #3f5b72; }
.ck-f .ck-in, .ck-f .ck-owners, .ck-f .ck-links { margin-top: 4px; font-weight: 400; }
.ck-f.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.ck-f.inline .ck-in { margin: 0; width: auto; max-width: 520px; }
.ck-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.ck-inline.between { justify-content: space-between; }
.ck-inline .ck-in { flex: 1 1 140px; }
.ck-inline .ck-in.sm { flex: 0 1 auto; }
.ck-owners { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ck-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 0.82rem; font-weight: 500; color: #3f5b72; }
.ck-add { margin-top: 14px; padding-top: 12px; border-top: 1px solid #edf2f6; font-size: 0.82rem; }
.ck-danger { margin-top: 14px; padding-top: 12px; border-top: 1px solid #edf2f6; }
.ck-grp { border: 1px solid #d5e5f0; border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; background: #f8fbfd; }
.ck-grp-h { display: flex; gap: 6px; align-items: center; }
.ck-grp-h .ck-in { flex: 1 1 120px; }
.ck-grp-h .ck-in.sm { flex: 0 0 auto; }
.ck-link, .ck-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 6px; }
.ck-sub { padding: 8px; border: 1px dashed #cfe0ec; border-radius: 8px; background: #fff; }
.ck-sub textarea { flex: 1 1 100%; }
.ck-link .ck-in { flex: 1 1 110px; }
.ck-json { margin-top: 14px; font-size: 0.82rem; }
.ck-json summary { cursor: pointer; font-weight: 600; color: #3f5b72; }
.ck-json textarea { margin: 8px 0; }
@media (min-width: 1001px) { .ck-split.flows { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } .ck-split.flows.wide { grid-template-columns: minmax(0, 1fr); } }
.ck-split.flows.wide .ck-right { position: static; order: -1; }
.ck-split.flows.wide .ck-prevcol .ck-panel { max-height: none; }
.ck-prev .cf-grid { justify-content: safe center; }
.ck-prevcol .ck-panel { max-height: calc(100vh - 28px); overflow: auto; }
.ck-prevcol .ck-panel h3 { margin: 0; }
.ck-lnks { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; font-weight: 400; }
.ck-lk { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-weight: 500; }
.ck-lk span { flex: 1 1 auto; min-width: 0; }
.ck-lk select { flex: 0 0 210px; width: 210px; max-width: 210px; margin: 0; }
.ck-zoom { font-size: 0.78rem; color: #3f5b72; white-space: nowrap; }
.ck-prev { overflow-x: auto; padding: 10px 56px 10px 56px; min-height: 420px; }
.ck-prev .cf-legend { display: none; }
.ck-err { color: #b3261e; font-size: 0.82rem; }
.ck-ok { padding: 14px 16px; border-radius: 10px; background: #e8f6ec; color: #1d5c2e; font-weight: 600; }
.ck-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.ck-sev { font-size: 0.74rem; font-weight: 800; padding: 3px 10px; border-radius: 9px; white-space: nowrap; }
.ck-sev.error { background: #fbd5d5; color: #8a1c1c; }
.ck-sev.warn { background: #fff0c2; color: #7a5a00; }
.ck-sev.info { background: #e3ecf3; color: #3f5b72; }
.ck-pend { margin: 8px 0 12px; padding-left: 18px; font-size: 0.85rem; color: #1f3a4f; line-height: 1.5; max-height: 260px; overflow: auto; }
.ck-det { font-size: 0.78rem; margin-top: 4px; color: #5d7385; }
.ck-det ul { margin: 4px 0 0; padding-left: 18px; }

.ck-scroll { max-height: 640px; overflow: auto; }
.ck-scroll thead th { position: sticky; top: 0; z-index: 1; }
.ck-twisty { font: inherit; font-size: 0.8rem; border: 0; background: transparent; cursor: pointer; color: #3f5b72; width: 20px; padding: 0; margin-right: 4px; }
.ck-pub { margin: 0 0 14px; padding: 12px 16px; border-radius: 10px; font-size: 0.9rem; line-height: 1.45; }
.ck-pub.ok { background: #e8f6ec; border: 1px solid #b9dfc3; color: #1d5c2e; }
.ck-pub.ko { background: #fdeceb; border: 1px solid #efbdb9; color: #8a1c1c; }
.ck-pub ul { margin: 6px 0 8px; padding-left: 18px; }
.ck-pub .ck-inline { margin-top: 8px; }
a.ck-btn { text-decoration: none; display: inline-block; }
.ck-link .ck-in.lbl { flex: 1 1 100%; order: 5; }
.ck-bar .ck-btn { white-space: nowrap; }

/* ---------- Document Hub ---------- */
.dh-herorow { width: 100%; display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 28px; row-gap: 6px; }
.dh-pbtns { align-self: flex-end; margin-left: auto; margin-bottom: 24px !important; justify-content: flex-end; }
.dh-pbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.dh-docbtn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; font-weight: 700; border: 0; }
.dh-docbtn.dh-browse { background: #0f8b8d; }
.dh-docbtn.dh-browse:hover { background: #0b7072; }
.dh-docbtn.dh-add { background: #e07b00; }
.dh-docbtn.dh-add:hover { background: #bf6800; }
.dh-docbtn.dh-add.disabled { background: #d9dde1; color: #7b8a96; cursor: not-allowed; }
.dh-docbtn svg { width: 16px; height: 16px; }
.dh-pcount { background: #fff; color: #0a3b60; font-size: 0.74rem; font-weight: 800; padding: 1px 8px; border-radius: 9px; }
.dh-who { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin: 0 0 12px; padding: 9px 14px; border: 1px solid #d5e5f0; border-radius: 10px; background: #f5fafd; font-size: 0.84rem; color: #1f3a4f; }
.dh-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 12px; }
.dh-crumb { font: inherit; font-size: 0.85rem; font-weight: 600; color: #1C86C4; background: transparent; border: 0; padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.dh-crumb:hover { background: #eef5fa; }
.dh-crumb.on { color: #0a3b60; cursor: default; background: #e3f0f9; }
.dh-sep { color: #8aa0b0; }
.dh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 0 0 14px; }
.dh-card { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 5px; padding: 11px 13px; border: 1.5px solid #bcdcec; border-radius: 12px; background: #fff; cursor: pointer; color: #0a3b60; }
.dh-card:hover:not(:disabled) { border-color: #1C86C4; box-shadow: 0 0 0 3px #d6ecfa; }
.dh-card.empty { opacity: .6; }
.dh-card.locked, .dh-card:disabled { background: #f3f5f7; border-color: #d5dde4; color: #7b8a96; cursor: not-allowed; }
.dh-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dh-card-top .cf-chip { background: #e9f1f7; color: #3f5b72; }
.dh-count { font-size: 0.78rem; font-weight: 800; color: #1C86C4; }
.dh-card-l { font-weight: 700; font-size: 0.92rem; line-height: 1.25; }
.dh-card-s { font-size: 0.74rem; color: #6b7c87; }
.dh-filters { align-items: flex-end; }
.dh-filters .ck-f.inline { flex-direction: column; align-items: flex-start; gap: 2px; font-size: 0.72rem; }
.dh-filters .ck-in { width: 260px; }
.dh-filters .ck-in.sm { width: auto; }
.dh-split { display: block; }
.dh-split.two { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .dh-split.two { grid-template-columns: 1fr; } }
.dh-detail { position: sticky; top: 12px; border: 1px solid #d5e5f0; border-radius: 12px; background: #fff; padding: 14px 16px; max-height: calc(100vh - 28px); overflow: auto; }
.dh-detail h3 { margin: 0; font-size: 1rem; color: #0a3b60; }
.dh-detail h4 { margin: 14px 0 6px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; color: #3f5b72; }
.dh-row { cursor: pointer; }
.dh-row:hover td { background: #f1f7fb; }
.dh-row.sel td { background: #dff0fb !important; }
.dh-table td { vertical-align: top; }
.dh-table td:last-child, .dh-table td:nth-child(4) { white-space: nowrap; }
.dh-ext { display: inline-block; min-width: 34px; text-align: center; font-size: 0.64rem; font-weight: 800; text-transform: uppercase; padding: 2px 5px; border-radius: 5px; background: #e3ecf3; color: #3f5b72; vertical-align: middle; }
.dh-ext-pdf { background: #fbd5d5; color: #8a1c1c; }
.dh-ext-docx { background: #d6e6fb; color: #1f4e8c; }
.dh-ext-xlsx { background: #d7f0dc; color: #1d5c2e; }
.dh-ext-pptx { background: #fde7c9; color: #8a4a05; }
.dh-lock { color: #8a6d00; vertical-align: middle; }
.dh-dl { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 5px 10px; margin: 0; font-size: 0.84rem; }
.dh-dl dt { color: #5d7385; font-weight: 600; }
.dh-dl dd { margin: 0; color: #123b57; word-break: break-word; }
.dh-miss { color: #b3261e; font-weight: 700; font-size: 0.8rem; }
.dh-ul { margin: 4px 0; padding-left: 18px; font-size: 0.85rem; line-height: 1.5; }
.dh-vt td { padding: 4px 6px; font-size: 0.78rem; }
.dh-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.dh-step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 20px; background: #eef1f3; color: #5d6b75; font-size: 0.85rem; font-weight: 600; }
.dh-step b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; font-size: 0.78rem; }
.dh-step.on { background: #1C86C4; color: #fff; }
.dh-step.on b { color: #1C86C4; }
.dh-step.done { background: #dff3e4; color: #1d5c2e; }
.dh-pick { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.dh-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 14px; }
.dh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dh-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 14px; background: #e3f0f9; color: #0a3b60; font-size: 0.8rem; }
.dh-chip button { border: 0; background: transparent; cursor: pointer; color: #3f5b72; }
.dh-code { margin: 8px 0; padding: 12px 14px; border-radius: 10px; background: #12202c; color: #dbe8f1; font-size: 0.76rem; line-height: 1.5; overflow: auto; white-space: pre-wrap; }
.dh-matrix { overflow: auto; max-height: 560px; border: 1px solid #d5e5f0; border-radius: 12px; margin: 0 0 16px; }
.dh-matrix table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.dh-matrix th, .dh-matrix td { white-space: nowrap; }
.dh-matrix thead th { position: sticky; top: 0; z-index: 2; background: #eaf4fb; }
.dh-matrix .dh-fh { position: sticky; left: 0; z-index: 1; background: #f8fbfd; min-width: 220px; white-space: normal; text-align: left; }
.dh-matrix thead .dh-fh { z-index: 3; background: #eaf4fb; }
.dh-cell { text-align: center; }
.dh-sel { width: 118px; font-size: 0.78rem; padding: 4px 6px; }
.dh-sel.required { background: #fde7e7; border-color: #e6b8b4; font-weight: 700; }
.dh-sel.optional { background: #eaf4fb; }
.dh-warn { font-size: 0.7rem; color: #b3261e; font-weight: 700; margin-top: 2px; }
.dh-badge { font-size: 0.72rem; font-weight: 800; padding: 2px 9px; border-radius: 9px; }
.dh-badge.req { background: #dff3e4; color: #1d5c2e; }
.dh-badge.off { background: #eef1f3; color: #7b8a96; }
.dh-arch { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 0 0 16px; }
.dh-a { flex: 1 1 170px; padding: 12px 14px; border: 1.5px solid #1C86C4; border-radius: 12px; background: #f0f8fd; font-weight: 700; color: #0a3b60; text-align: center; font-size: 0.9rem; }
.dh-a span { display: block; margin-top: 3px; font-weight: 400; font-size: 0.76rem; color: #3f5b72; }
.dh-ar { align-self: center; font-size: 0.72rem; color: #5d7385; text-align: center; padding: 0 2px; }
.dh-back { display: inline-flex; align-items: center; gap: 8px; align-self: flex-end; margin: 0 0 24px auto; background: #fff; color: #0a3b60; border: 1px solid #b9d3e6; text-decoration: none; }
.dh-back:hover { background: #eef7fd; }
.dh-backwhere { font-weight: 600; padding-left: 8px; border-left: 1px solid #b9d3e6; }

.dh-empty { background:#f3f6f9; color:#3f5b72; }

/* ---- Document Hub: batch upload (several files, metadata per file) ---- */
.dh-drop { border:2px dashed #b9d3e6; border-radius:10px; padding:14px; background:#f7fafd; display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.dh-drop.over { border-color:#0a5a94; background:#e6f1fa; }
.dh-multi .dh-wide { grid-column:1 / -1; }
.dh-mtable { min-width:100%; }
.dh-mtable th, .dh-mtable td { vertical-align:top; }
.dh-mtable .ck-in.sm { min-width:130px; max-width:200px; }
.dh-mtable .dh-fcell { min-width:240px; max-width:340px; }
.dh-fname { word-break:break-word; }
.dh-mtable .dh-conf { margin-top:8px; font-size:12.5px; }
.dh-mtable .dh-conf .ck-in { margin-top:6px; width:100%; max-width:none; }
.dh-allrow td { background:#eef5fb; border-bottom:2px solid #b9d3e6; }
.dh-lcell { min-width:190px; }
.dh-ldet summary { cursor:pointer; color:#0a5a94; font-size:13px; }
.dh-linkin { flex-wrap:nowrap; }
.dh-linkin .ck-in { min-width:120px; }

/* ---------- process status (Published / In Progress / To start) ---------- */
.st-badge { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin: 6px 0 0; padding: 2px 9px; border-radius: 999px; font-size: 0.68rem; font-weight: 800; letter-spacing: .2px; line-height: 1.5; border: 1px solid transparent; white-space: nowrap; }
.st-badge svg { width: 11px; height: 11px; }
.st-published { background: #e1f4e7; color: #17612f; border-color: #a9dbb9; }
.st-inprogress { background: #fff0cf; color: #7a4d00; border-color: #efce8a; }
.st-tostart { background: #e8ecf0; color: #46535f; border-color: #c3ccd5; }
.st-unknown { background: #fde6e4; color: #8c1d18; border-color: #f0b4b0; }
.flow-step .st-badge, .cat-card .st-badge { align-self: center; margin: 8px auto 0; }
.cat-card .st-badge { margin: 8px 0 0; align-self: flex-start; }
.l0-bar-head .st-badge { margin: 0 0 0 8px; }
.locked { cursor: not-allowed !important; }
.l0-card.locked, .l0-bar.locked, .flow-step.locked, .cat-card.locked { opacity: .92; }
.l0-card.locked:hover, .flow-step.locked:hover { transform: none; }
.mini-step.locked { display: inline-flex; align-items: center; gap: 5px; opacity: .6; border-style: dashed; }
.mini-step.locked:hover { border-color: var(--border); color: var(--muted); }
.cf-lnk.locked { opacity: .6; }
.cf-lnk.locked:hover { border-color: inherit; box-shadow: none; }
.st-legend { margin: 18px 0 0; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.st-legend-grid { display: grid; gap: 8px; margin: 8px 0 6px; font-size: .86rem; color: var(--muted); }
.st-legend-grid .st-badge { margin: 0 8px 0 0; }
.st-locked { max-width: 640px; margin: 24px 0; padding: 22px 26px; border: 1.5px dashed #c9c2b3; border-radius: 14px; background: #f8f6f1; }
.st-locked h2 { margin: 0 0 10px; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.st-locked h2 svg { width: 18px; height: 18px; }
.st-locked .st-badge { margin: 0 8px 0 0; }
.dh-card .st-badge { margin: 0; }
