:root {
  --bg: #f6f7f9; --panel: #fff; --line: #e3e6eb; --text: #1f2430; --muted: #6b7280;
  --accent: #4f46e5; --accent-soft: #eef2ff; --sel: #3b82f6; --danger: #dc2626;
  --field-line: #858e9c;   /* border of form fields: 3:1 on the page and panel (WCAG 1.4.11) */
  /* Status category colours (status-core.js); admins can override them */
  --st-todo: #64748b; --st-doing: #2563eb; --st-done: #16a34a;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; font-size: 13px; color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
html:has(> body.m-on), body.m-on { background: var(--th-surface, #fff); }   /* iOS home-screen apps paint the area below the page with the page background; keep it white to match the bottom menu */
#app { height: 100%; display: flex; flex-direction: column; }
a { color: var(--th-accent-text, var(--accent)); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { border: 1px solid var(--field-line); border-radius: 6px; padding: 6px 8px; background: var(--th-surface, #fff); width: 100%; }
input[type="checkbox"], input[type="radio"], input[type="color"], input[type="range"], input[type="file"], input[type="image"] { width: auto; padding: 0; border-radius: 0; flex: none; }
.perms select { width: auto; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--th-surface, #fff); border-radius: 6px; padding: 6px 10px; }
button:hover { background: var(--th-hover, #f3f4f6); }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #4338ca; }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: var(--th-hover, #eef0f3); }
button.sm, .sm { font-size: 12px; padding: 3px 7px; }
button.danger, .danger { color: var(--th-red-text, var(--danger)); }
.btn { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; background: var(--th-surface, #fff); color: var(--text); display: inline-block; }
.muted { color: var(--muted); } .small { font-size: 12px; } .pad { padding: 12px; } .grow { flex: 1; } .hidden { display: none !important; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 10px; background: var(--accent-soft); color: var(--th-accent-text, var(--accent)); margin-left: 6px; }
.pill.sm { font-size: 10px; padding: 0 5px; } .pill.old { background: var(--th-hover, #f1f5f9); color: var(--th-text-2, #475569); text-decoration: line-through; }
.row { display: flex; gap: 8px; align-items: center; } .row input, .row select { width: auto; flex: 1; }
.row input[type=radio], .row input[type=checkbox] { flex: none; }
.np-wrap { max-width: 1040px; margin: 0 auto; }
.new-project .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .new-project .cards { grid-template-columns: 1fr; } }
.col { display: flex; flex-direction: column; gap: 10px; }
/* Project access options: one left-aligned column, radio + title, the description under the title */
.project-access { gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.project-access legend { padding: 0; margin-bottom: 4px; }
.modal label.pa-opt, label.pa-opt { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 2px; align-items: baseline; text-align: left; color: inherit; }
.pa-opt input[type=radio] { width: auto; margin: 0; grid-row: 1 / span 2; align-self: start; margin-top: 2px; }
.pa-opt > b, .pa-opt > .muted { grid-column: 2; }

/* auth */
.auth-wrap { flex: 1; display: grid; place-items: center; background: radial-gradient(circle at 70% 20%, var(--th-violet-bg, #e0e7ff), transparent 50%), var(--bg); }
.auth-card { background: var(--th-surface, #fff); padding: 32px; border-radius: 14px; box-shadow: 0 10px 40px rgba(31, 36, 48, .1); width: 360px; display: flex; flex-direction: column; gap: 12px; }
.auth-card h2 { margin: 8px 0 0; font-weight: 600; }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form-err { color: var(--th-red-text, var(--danger)); min-height: 16px; font-size: 12px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); }
.logo.big { font-size: 22px; } .logo b { color: var(--th-accent-text, var(--accent)); }
.logo .logo-by { display: block; font-size: 10px; line-height: 1.1; font-weight: 400; color: var(--muted); letter-spacing: .02em; }   /* ORIGO_BRAND: optional tagline under the name */
.logo.big .logo-by { font-size: 13px; margin-top: 2px; }
.logo .logo-img { flex-shrink: 0; width: auto; border-radius: 4px; display: block; }   /* ORIGO_BRAND_LOGO */

/* topbar */
.topbar { height: 48px; white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 0 12px; background: var(--th-surface, #fff); border-bottom: 1px solid var(--line); flex-shrink: 0; }
/* Module switcher: main modules as logo + name, the rest in the Tools menu; notification bell */
.apps { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.apps a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.apps a:hover { background: var(--th-hover, #f3f4f6); color: var(--text); }
.apps a.on { background: var(--accent-soft); color: var(--th-accent-text, var(--accent)); }
.apps a.off { opacity: .45; cursor: default; }
.apps a.off:hover { background: transparent; color: var(--muted); }
.app-ic, .tile-ic, .head-ic { display: inline-flex; flex-shrink: 0; line-height: 0; }
.app-ic svg { border-radius: 5px; }
.apps a:not(.on) .app-ic { filter: saturate(.75); opacity: .9; }
.apps a.cur-tool { border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; margin-left: 4px; }
.head-ic { margin-right: 10px; vertical-align: -4px; }
.tm { position: relative; margin-left: 4px; }
.apm-btn { display: inline-flex; align-items: center; gap: 6px; border-color: transparent; background: transparent; color: var(--muted); font-weight: 500; padding: 6px 9px; border-radius: 8px; }
.apm-btn:hover, .apm-btn[aria-expanded="true"] { background: var(--th-hover, #f3f4f6); color: var(--text); }
.apm-btn.on { color: var(--th-accent-text, var(--accent)); }
.apm-panel { position: fixed; z-index: 1000; width: 360px; max-height: calc(100vh - 70px); overflow: auto; background: var(--th-surface, #fff); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 12px; white-space: normal; }
.apm-panel[hidden], .apm-group[hidden], .apm-panel .tile[hidden] { display: none; }
.apm-search { margin-bottom: 10px; }
.apm-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 6px 4px; }
.apm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 6px; }
.apm-panel .tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 10px; color: var(--text); font-size: 12px; text-align: center; }
.apm-panel .tile:hover, .apm-panel .tile:focus { background: var(--th-hover, #f3f4f6); }
.apm-panel .tile.on { background: var(--accent-soft); color: var(--th-accent-text, var(--accent)); }
.tile-ic svg { border-radius: 9px; box-shadow: 0 2px 6px rgba(15, 23, 42, .15); }
.bell-nav { margin-left: 0; }
.tb-bell { position: relative; padding: 6px !important; }
.tb-bell .cl-unread { position: absolute; top: 0; right: -2px; margin: 0; min-width: 16px; text-align: center; }
.logo svg { flex-shrink: 0; filter: drop-shadow(0 1px 2px rgba(79, 70, 229, .3)); }
@media (max-width: 1280px) { .apps a .lbl, .apm-btn .lbl { display: none; } .apps a { padding: 6px; } .apps a.cur-tool .lbl { display: inline; } }
@media (max-width: 900px) { .apps a.cur-tool .lbl, .logo-link .logo span { display: none; } .crumbs { display: none; } }
.crumbs a { color: var(--muted); }
.key-search { width: 190px; flex-shrink: 1; min-width: 110px; }
@media (max-width: 1100px) { .user .muted { display: none; } }
.org-sel { width: auto; }
.user { display: flex; align-items: center; gap: 6px; }

/* pages */
.page { padding: 24px 32px; overflow: auto; flex: 1; }
.page-head { display: flex; align-items: center; gap: 16px; } .page-head h1 { font-weight: 600; margin: 0 0 8px; flex: 1; }
.page section { background: var(--th-surface, #fff); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 16px 0; }
.cards { display: flex; flex-wrap: wrap; gap: 12px; }
.card { width: 220px; min-height: 100px; border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--th-surface, #fff); color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(79, 70, 229, .12); }
.card .pill { margin: 0; align-self: flex-start; } .card-title { font-weight: 600; font-size: 15px; }
.card.add { align-items: center; justify-content: center; color: var(--muted); border-style: dashed; }
.tbl { border-collapse: collapse; width: 100%; margin: 8px 0; } .tbl td, .tbl th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl select { width: auto; }

/* workbench */
.workbench { flex: 1; display: grid; grid-template-columns: var(--ll-left-w, clamp(200px, 20vw, 280px)) minmax(0, 1fr) var(--ll-right-w, clamp(240px, 24vw, 330px)); min-height: 0; }   /* LL.resizable */
.left, .right { background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.left { border-right: 1px solid var(--line); } .right { border-left: 1px solid var(--line); min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tree-filter { margin: 8px; width: calc(100% - 16px); }
.tree { flex: 1; overflow: auto; padding-bottom: 8px; user-select: none; }
.trow { display: flex; align-items: center; gap: 5px; padding: 3px 8px; cursor: pointer; white-space: nowrap; border-left: 2px solid transparent; }
.trow:hover { background: var(--th-hover, #f3f4f6); }
.trow.cur { border-left-color: var(--accent); }
.trow.sel { background: var(--th-blue-bg, #bfdbfe); border-left-color: var(--sel); box-shadow: inset 2px 0 0 var(--sel); font-weight: 600; }
.trow.sel .tkey { color: var(--th-blue-text, #1e40af); }
.trow.open { background: var(--accent-soft); font-weight: 600; }
.trow.root { padding-left: 6px; }
.trow .twist { width: 10px; color: var(--muted); font-size: 10px; flex-shrink: 0; }
.trow .ticon { width: 18px; display: inline-flex; justify-content: center; flex-shrink: 0; }
.trow .tname { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.trow .tkey { color: var(--muted); font-size: 11px; font-family: Consolas, monospace; }
.trow.el:not(.ondiag) .tname { color: var(--th-text-2, #4b5563); }
.trow.ondiag .tname { font-weight: 500; }
.ticon.nota { font-size: 9px; font-weight: 700; border-radius: 4px; color: #fff; height: 16px; align-items: center; }
.nota.bpmn { background: #0f766e; } .nota.uml { background: #a16207; } .nota.c4 { background: #1d4ed8; }
span.nota { color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.left-foot { border-top: 1px solid var(--line); padding: 6px; display: flex; gap: 2px; flex-wrap: wrap; }

.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.toolbar { height: 42px; white-space: nowrap; overflow-x: auto; overflow-y: hidden; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--th-surface, #fff); border-bottom: 1px solid var(--line); }
.toolbar .dname { width: 220px; min-width: 120px; flex-shrink: 1; border-color: transparent; font-weight: 600; font-size: 14px; }
.toolbar .dname:hover { border-color: var(--line); }
.editor-wrap { flex: 1; position: relative; min-height: 0; display: flex; }
.palette { position: absolute; left: 10px; top: 10px; max-height: calc(100% - 20px); z-index: 5; width: var(--ll-pal-w, 122px); container: pal / inline-size; overflow-y: auto; overflow-x: hidden; background: var(--th-surface, #fff); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); padding: 4px; }
.palette:empty { display: none; }
.pgroup { padding: 4px 0; border-bottom: 1px solid var(--th-line, #f0f1f3); }
.pgroup.tools { display: grid; grid-template-columns: repeat(3, 36px); gap: 2px; }
.ptitle { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 2px 4px 4px; }
.pgrid { display: grid; grid-template-columns: repeat(3, 36px); gap: 2px; }
.pitem, .tool { border: 1px solid transparent; background: transparent; padding: 3px; display: grid; place-items: center; height: 32px; border-radius: 5px; color: var(--th-text-2, #374151); }
.pitem:hover, .tool:hover { background: var(--accent-soft); border-color: var(--th-violet-line, #c7d2fe); }
.tool.on { background: var(--accent); color: #fff; }
/* a palette preset (requirement with an EA stereotype) carries a short badge over its icon */
.pitem-preset { position: relative; }
.pitem-preset .pbadge { position: absolute; left: 2px; bottom: 1px; font: bold 8.5px/1 "Segoe UI", Arial, sans-serif; color: #fff; background: rgba(15, 23, 42, .78); border-radius: 3px; padding: 1px 2px; pointer-events: none; }
/* Resizable palette: narrow = 2 columns, wider = more columns, widest = icons with labels */
@container pal (max-width: 111px) { .pgrid, .pgroup.tools { grid-template-columns: repeat(2, 36px); } }
@container pal (min-width: 150px) { .pgrid, .pgroup.tools { grid-template-columns: repeat(auto-fill, 36px); } }
@container pal (min-width: 200px) {
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .pgrid .pitem { display: flex; justify-content: flex-start; gap: 6px; padding: 3px 6px; min-width: 0; }
  .pgrid .pitem::after { content: attr(title); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .pgrid .pitem > svg { flex: none; }
}
.editor-host { flex: 1; position: relative; overflow: hidden; background: var(--th-surface, #fff); }
.canvas { width: 100%; height: 100%; display: block; outline: none; cursor: default; touch-action: none; font-family: "Segoe UI", Arial, sans-serif; }
.canvas, .canvas * { -webkit-user-select: none; user-select: none; }   /* Dragging or panning the canvas must not select labels as text */
.canvas input, .canvas textarea, .canvas [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
.editor-host[data-tool="hand"] .canvas, .editor-host.panning .canvas { cursor: grab; }
.editor-host.panning-active .canvas { cursor: grabbing; }
.editor-host[data-tool="lasso"] .canvas { cursor: crosshair; }
.editor-host[data-tool="space"] .canvas { cursor: col-resize; }
.editor-host[data-tool="connect"] .canvas, .editor-host.armed .canvas { cursor: crosshair; }
body.placing { cursor: copy; user-select: none; }

.node { cursor: move; }
.readonly .node { cursor: pointer; }
.node.hover > :first-child { filter: drop-shadow(0 0 3px var(--sel)); }
.node text { user-select: none; pointer-events: none; }
.lbl, .elbl { fill: #22242a; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.edge .elbl[data-elbl] { pointer-events: auto; cursor: move; }
.edge .line { fill: none; stroke: #22242a; stroke-width: 1.5; stroke-linejoin: round; }
.edge .hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
.edge:hover .line { stroke: #1d4ed8; }
.edge.selected .line { stroke: var(--sel); stroke-width: 2; }
.sel-box { fill: var(--sel); fill-opacity: .06; stroke: var(--sel); stroke-width: 2px; pointer-events: none; }
.edge.selected .line { filter: drop-shadow(0 0 2px var(--sel)); }
.handle { fill: var(--sel); stroke: #fff; cursor: nwse-resize; }
.handle[data-handle="ne"], .handle[data-handle="sw"] { cursor: nesw-resize; }
.handle.bend { cursor: move; fill: var(--sel); fill-opacity: .25; }
.handle.vtx { cursor: move; fill: #fff; stroke: var(--sel); }
.guide { stroke: #ec4899; stroke-dasharray: 4 3; pointer-events: none; }
.lasso { fill: rgba(59, 130, 246, .08); stroke: var(--sel); stroke-dasharray: 4 3; pointer-events: none; }
svg .ghost { fill: rgba(79, 70, 229, .08); stroke: var(--accent); stroke-dasharray: 5 3; pointer-events: none; }
.connect-preview { stroke: var(--sel); stroke-dasharray: 5 4; pointer-events: none; }
/* Sequence message drag: insertion line and preview */
.msg-slot { stroke: #2563eb; pointer-events: none; }
.msg-ghost { stroke: var(--th-muted, #6b7280); stroke-dasharray: 6 4; pointer-events: none; }
.msg-slot.bad { stroke: #dc2626; }
.seq-target { fill: var(--sel); fill-opacity: 0.08; stroke: var(--sel); pointer-events: none; }
.connect-lost { fill: var(--sel); pointer-events: none; }
/* Short in-place canvas hint (ed.hintAt); fades by itself, never blocks */
.ed-hint { position: absolute; z-index: 9; transform: translateX(-50%); max-width: 320px; padding: 4px 10px; border-radius: 6px; background: #1f2937; color: #fff; font-size: 12px; line-height: 1.35; pointer-events: none; opacity: 0; transition: opacity .15s; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.ed-hint.on { opacity: 1; }
.editor-host.msg-dragging .canvas { cursor: ns-resize; }
/* Pinned lifeline name bar (part of the canvas, not a window) */
.seq-heads { position: absolute; left: 0; right: 0; top: 0; height: 30px; z-index: 3; overflow: hidden; pointer-events: none;
  background: linear-gradient(var(--th-glass, rgba(255, 255, 255, .96)), var(--th-glass, rgba(255, 255, 255, .88))); border-bottom: 1px solid var(--line, #e3e6eb); box-shadow: 0 2px 6px rgba(15, 23, 42, .06); }
.seq-heads.hidden { display: none; }
/* Space reserved for the bar so it never covers lifeline headers */
.editor-host.has-heads .canvas { margin-top: 30px; height: calc(100% - 30px); }
/* Name bar stays clear of the palette and its handle (--ll-canvas-l from editor.js) */
.editor-host > .seq-heads { clip-path: inset(0 0 0 var(--ll-canvas-l, 0px)); }
.seq-heads .sh-item { position: absolute; top: 3px; height: 24px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 6px; pointer-events: auto;
  border: 1px solid var(--th-amber-line, #d6b26a); border-radius: 6px; background: var(--th-amber-bg, #fef3c7); color: var(--th-text, #1f2937); font: 600 12px/1 inherit; white-space: nowrap; cursor: pointer; overflow: hidden; }
.seq-heads .sh-item span { overflow: hidden; text-overflow: ellipsis; }
.seq-heads .sh-item.actor { background: var(--th-amber-bg, #ffedd5); border-color: var(--th-amber-line, #f0a46b); }
.seq-heads .sh-item.on { outline: 2px solid var(--sel, #2563eb); outline-offset: 1px; }
.seq-heads .sh-item.ended { opacity: .45; }
.seq-heads .sh-item:hover { filter: brightness(.97); }
.space-line { stroke: #ec4899; pointer-events: none; } .space-area { fill: rgba(236, 72, 153, .05); pointer-events: none; }

.ctxpad { position: absolute; display: none; grid-template-columns: repeat(3, 26px); gap: 2px; z-index: 6; background: var(--th-glass, rgba(255, 255, 255, .95)); border: 1px solid var(--line); border-radius: 6px; padding: 3px; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.ctxpad button { width: 26px; height: 26px; padding: 2px; display: grid; place-items: center; border: none; background: transparent; color: var(--th-text-2, #374151); border-radius: 4px; }
.ctxpad button:hover { background: var(--accent-soft); color: var(--th-accent-text, var(--accent)); }
.popup { position: absolute; z-index: 8; background: var(--th-surface, #fff); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); padding: 4px; width: 250px; max-height: 420px; overflow: auto; }
.popup button { display: flex; align-items: center; gap: 8px; width: 100%; border: none; text-align: left; padding: 4px 8px; background: transparent; }
.popup button:hover { background: var(--accent-soft); } .popup button.cur { font-weight: 600; color: var(--th-accent-text, var(--accent)); }
.popup .relpick-q { width: 100%; box-sizing: border-box; margin: 2px 0 4px; padding: 4px 6px; }
.popup .relpick-pal { display: flex; gap: 4px; margin-bottom: 4px; }
.popup .relpick-pal button { justify-content: center; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 12px; }
.popup .relpick-pal button.on { background: var(--accent-soft); color: var(--th-accent-text, var(--accent)); font-weight: 600; }
.popup .relpick-g { font-size: 11px; text-transform: uppercase; color: var(--muted, #6b7280); padding: 6px 8px 2px; }
.popup .relpick-list button.sel { background: var(--accent-soft); outline: 1px solid var(--accent); }
.popup .relpick-list button.def span { font-weight: 600; }
.popup .relpick-tag { margin-left: auto; padding-left: 8px; font-size: 11px; color: var(--muted, #6b7280); }
.popup .relpick-sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.popup .relpick-none { padding: 6px 8px; }
.zoombar { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 2px; align-items: center; background: var(--th-surface, #fff); border: 1px solid var(--line); border-radius: 8px; padding: 2px; box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.zoombar button { border: none; width: 28px; height: 28px; padding: 0; font-size: 16px; }
.zoombar .zl { font-size: 11px; color: var(--muted); width: 42px; text-align: center; }
.diagram-nav { position: absolute; right: 12px; top: 12px; z-index: 5; max-width: 60%; display: flex; gap: 6px; pointer-events: none; }
.diagram-nav > button { pointer-events: auto; min-width: 0; }
.diagram-back, .nav-source { max-width: 100%; height: 30px; padding: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; background: var(--th-surface, #fff); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, .06); cursor: pointer; }
.diagram-back:hover, .nav-source:hover, .nav-source:focus-visible { border-color: var(--sel, #2563eb); color: var(--th-blue-text, #2563eb); }
.diagram-back.hidden, .nav-source.hidden { display: none; }
.nav-source { flex-shrink: 1; }
.ft-source, .dl-source { max-width: 320px; flex-shrink: 0; }
.dl-crumb .dl-source { margin: 4px 8px 4px 0; vertical-align: middle; }
.editor-host.has-heads .diagram-nav { top: 42px; }
.nav-return { outline: 2px solid var(--sel, #2563eb); outline-offset: 2px; border-radius: 4px; transition: outline-color 1.2s; }
.inline-edit { position: absolute; z-index: 9; resize: none; text-align: center; border: 2px solid var(--sel); border-radius: 4px; padding: 4px; background: var(--th-glass, rgba(255, 255, 255, .97)); line-height: 1.25; }
.inline-edit.left { text-align: left; }
/* Combined fragment (operand) and activation bar handles */
.seq-ovl .sq-btn rect { fill: #fff; stroke: var(--sel); } .seq-ovl .sq-btn text { fill: var(--sel); font-weight: 700; pointer-events: none; user-select: none; }
.seq-ovl .sq-btn { cursor: pointer; } .seq-ovl .sq-btn:hover rect { fill: var(--sel); } .seq-ovl .sq-btn:hover text { fill: #fff; }
.seq-ovl .sq-btn.del rect { stroke: #dc2626; } .seq-ovl .sq-btn.del text { fill: #dc2626; } .seq-ovl .sq-btn.del:hover rect { fill: #dc2626; }
.seq-ovl .sq-sep { cursor: ns-resize; stroke: transparent; } .seq-ovl .sq-sep:hover { stroke: var(--sel); stroke-opacity: .25; }
.seq-ovl .sq-grip { fill: var(--sel); stroke: #fff; cursor: ns-resize; }
.sq-preview { stroke: var(--sel); stroke-dasharray: 6 4; pointer-events: none; } .sq-preview-bar { fill: var(--sel); fill-opacity: .15; stroke: var(--sel); stroke-dasharray: 4 3; pointer-events: none; }

/* right panel */
/* One row, no wrapping; overflowing tabs scroll horizontally instead of overlapping the next panel */
.tabs { display: flex; flex: none; min-width: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; overscroll-behavior-x: contain; }
.tabs button { flex: 1 0 auto; white-space: nowrap; border: none; border-radius: 0; background: transparent; padding: 10px 12px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--th-accent-text, var(--accent)); border-bottom-color: var(--accent); font-weight: 600; }
.props, .hist { flex: 1; overflow: auto; }
.ptype { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.keyline { display: flex; align-items: center; gap: 4px; margin: 6px 0 2px; }
.bigkey { font-family: Consolas, monospace; font-size: 20px; font-weight: 700; color: var(--th-accent-text, var(--accent)); }
.uuid code { font-size: 10.5px; user-select: all; }
.aliases { margin: 4px 0; }
.field { display: flex; flex-direction: column; gap: 3px; margin: 10px 0; }
.field > span { font-size: 11px; color: var(--muted); font-weight: 600; }
.check { display: flex; align-items: center; gap: 6px; font-size: 12px; } .check input { width: auto; }
.section { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; display: flex; flex-direction: column; gap: 3px; }
.section.soon { opacity: .6; }
.hint { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; margin-top: 12px; } .hint ul { margin: 6px 0 0; padding-left: 18px; } .hint li { margin: 3px 0; }
.hrow { padding: 8px 12px; border-bottom: 1px solid var(--th-line, #f0f1f3); }

.modal { background: var(--th-surface, #fff); border-radius: 12px; width: min(720px, 92vw); max-height: 85vh; overflow: auto; padding: 16px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin: -16px -20px 10px; padding: 12px 20px 10px; font-size: 15px; position: sticky; top: -16px; z-index: 5; background: var(--th-surface, #fff); border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.modal-head button { flex: none; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 100; }
.toast { background: #1f2937; color: #fff; padding: 8px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); max-width: 560px; }
.toast.err { background: var(--danger); }
/* Chunked import run (core/import-run.js): progress panel shown among the toasts */
.import-run { width: 340px; padding: 12px 14px; border-radius: 10px; background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.import-run-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.import-run-bar > div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.import-run-bar > div.back { background: var(--danger); }
.import-run-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Layout fixes */
.panel-head { white-space: nowrap; }
.panel-head button { padding: 3px 5px; }
.toolbar { scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.left-foot button { padding: 3px 5px; }
.split-hint { fill: none; stroke: #22c55e; stroke-opacity: .55; pointer-events: none; }
svg .ghost.bad { fill: rgba(220, 38, 38, .08); stroke: var(--danger); }
.new-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px 8px 0; }
.new-bar .nb { padding: 5px 2px; font-size: 12px; font-weight: 600; border-radius: 6px; white-space: nowrap; }
.nb.bpmn { color: var(--th-teal-text, #0f766e); border-color: var(--th-teal-line, #99f6e4); background: var(--th-teal-bg, #f0fdfa); }
.nb.uml { color: var(--th-amber-text, #a16207); border-color: var(--th-amber-line, #fde68a); background: var(--th-amber-bg, #fefce8); }
.nb.c4 { color: var(--th-blue-text, #1d4ed8); border-color: var(--th-blue-line, #bfdbfe); background: var(--th-blue-bg, #eff6ff); }
.nb.pkg { color: var(--th-text-2, #374151); }
.left .where { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmenu { position: fixed; z-index: 60; background: var(--th-surface, #fff); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 4px; min-width: 200px; display: flex; flex-direction: column; }
.tmenu button { border: none; text-align: left; padding: 6px 10px; background: transparent; }
.tmenu button:hover { background: var(--accent-soft); }
.pal-head { display: flex; align-items: center; gap: 4px; padding: 2px 2px 4px; border-bottom: 1px solid var(--th-line, #f0f1f3); }
.pal-head .kind { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-head button { border: none; padding: 2px 6px; font-size: 14px; background: transparent; }
.nota-btn { border: none; color: #fff; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 10px; white-space: nowrap; }
.nota-btn:hover { filter: brightness(1.1); background-color: inherit; }
.nota-btn.bpmn { background: #0f766e; } .nota-btn.uml { background: #a16207; } .nota-btn.c4 { background: #1d4ed8; }
.trow.drop { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.trow.diag .tkey { font-family: inherit; font-size: 10.5px; }
.trow .star { color: var(--th-amber-text, #d97706); font-size: 12px; }
/* Diagram elements listed under a diagram in the tree link to the same elements */
.trow.diag .twist { cursor: pointer; }
.trow.dkid .tname { font-style: italic; color: var(--th-text-2, #4b5563); }
.trow.dkid .ticon { opacity: .8; }
.trow.dkid.locked .tname { color: var(--muted); }
.trow.dkid.sel .tname { color: inherit; }
.trow.dkid.home .tname { font-style: normal; color: inherit; }
.trow.dkid.home .ticon { opacity: 1; }
.trow.group .tname { color: var(--th-amber-text, #92400e); font-weight: 500; }
.trow.group .tkey { font-family: inherit; }
.tree-hint { padding: 2px 8px 4px; white-space: normal; line-height: 1.35; }
.usage-list { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.usage-item { padding: 6px 0; border-bottom: 1px solid var(--th-line, #f0f1f3); } .usage-item:last-child { border-bottom: none; }
.usage-item ul { margin: 4px 0 0; padding-left: 20px; font-size: 12px; color: var(--th-text-2, #374151); }
.usage-count { margin-left: 8px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: var(--th-hover-2, #e5e7eb); }
.usage-count.many { background: var(--th-amber-bg, #fef3c7); color: var(--th-amber-text, #92400e); }
button.danger-btn { background: var(--danger); border-color: var(--danger); }
button.danger-btn:hover { background: #b91c1c; }
.linked-badge { cursor: pointer; }
.nota-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.nota-dot.bpmn { background: #0f766e; } .nota-dot.uml { background: #b45309; } .nota-dot.c4 { background: #1d4ed8; }
.ea-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.ea-grid .field { margin: 6px 0; }
.tags-tbl { width: 100%; border-collapse: collapse; font-size: 12px; margin: 4px 0; }
.tags-tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; }
.tags-tbl td { padding: 2px 2px; } .tags-tbl input { padding: 3px 5px; font-size: 12px; }
.color-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; margin-right: 10px; }
.color-field input { width: 34px; height: 26px; padding: 1px; }
.trace { list-style: none; margin: 4px 0 0; padding-left: 16px; border-left: 1px dashed var(--th-line-strong, #d1d5db); }
.trace li { margin: 3px 0; font-size: 12.5px; }
.trace-rel { color: var(--muted); font-size: 11px; }
.trace-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trace-impact { background: var(--th-amber-bg, #fef3c7); border-radius: 8px; padding: 8px 12px; }
.modal.wide { width: min(1100px, 96vw); }
.search-filters { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.search-res { max-height: 58vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.search-res .tbl { margin: 0; } .search-res th { position: sticky; top: 0; background: var(--th-surface-2, #f9fafb); }
.search-row { cursor: pointer; } .search-row:hover { background: var(--accent-soft); }
.search-row.cur, .search-row.cur:hover { background: var(--th-violet-bg, #e0e7ff); box-shadow: inset 3px 0 0 var(--accent, #4f46e5); } .search-row:focus { outline: none; }
.st-chip { color: #fff; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; }

.handle.endh { fill: #fff; stroke: var(--accent); cursor: crosshair; }
.ctxpad.multi { grid-template-columns: repeat(9, 26px); }
.minimap { position: absolute; right: 12px; bottom: 54px; background: var(--th-glass, rgba(255,255,255,.95)); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.08); padding: 4px; cursor: pointer; z-index: 5; }
.minimap .mm-view { fill: rgba(79,70,229,.08); stroke: var(--accent); stroke-width: 1.5; }

.node text.lbl.movable { pointer-events: auto; cursor: move; }
.node text.lbl.movable:hover { fill: var(--accent); }

/* Relation matrix like the EA Relationship Matrix: fixed layout, every column exactly one cell wide
   under its rotated header, the corner as wide as the row header column, headers stuck while the grid scrolls.
   Classes are mx-* because the generic .row / .col are flex boxes and broke the table cells. */
.matrix-wrap { max-height: 62vh; max-width: 100%; width: max-content; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.matrix { --mx-row: 260px; --mx-cell: 26px; --mx-head: 240px; border-collapse: separate; border-spacing: 0; table-layout: fixed; width: calc(var(--mx-row) + var(--mx-n, 1) * var(--mx-cell)); font-size: 12px; }
.matrix th, .matrix td { box-sizing: border-box; padding: 0; border: 0; border-right: 1px solid var(--th-line, #e5e7eb); border-bottom: 1px solid var(--th-line, #e5e7eb); background: var(--panel); }
.matrix th.mx-corner, .matrix th.mx-rowh { width: var(--mx-row); max-width: var(--mx-row); }
.matrix th.mx-colh, .matrix td { width: var(--mx-cell); max-width: var(--mx-cell); }
.matrix th.mx-corner { position: sticky; left: 0; top: 0; z-index: 3; height: 60px; vertical-align: bottom; text-align: left; padding: 6px 8px; background: var(--th-surface-2, #f9fafb); font-weight: 600; color: var(--muted); border-bottom-color: var(--th-line-strong, #cbd5e1); border-right-color: var(--th-line-strong, #cbd5e1); }
/* source / target package bar of the relation matrix */
.mx-pkgbar select.mx-pkg { max-width: 400px; }
/* the bars wrap and their lists shrink, so the profile field and its buttons stay in the window */
.mx-bar { flex-wrap: wrap; row-gap: 6px; } .mx-bar select { flex: 0 1 auto; min-width: 0; max-width: 320px; }
.mx-bar .mx-profile { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.mx-pkgbar select.mx-pkg { flex: 1 1 260px; }
.mx-pkgbar label.check { flex-direction: row; align-items: center; white-space: nowrap; color: inherit; }
/* insert related elements panel */
.ins-rel label.check { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; text-align: left; color: inherit; }
.ins-rel .ir-types { display: flex; flex-wrap: wrap; gap: 4px 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; padding: 6px 10px; }
.ins-rel .ir-list { gap: 4px; max-height: 50vh; overflow: auto; }
.ins-rel .ir-list .row { gap: 6px; }
.ir-actions { justify-content: flex-end; gap: 8px; margin-top: 12px; }
.matrix th.mx-colh { position: sticky; top: 0; z-index: 2; height: 60px; vertical-align: bottom; padding: 6px 0; font-weight: normal; border-bottom-color: var(--th-line-strong, #cbd5e1); }
.matrix .mx-vert { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: calc(var(--mx-head) - 12px); width: var(--mx-cell); line-height: var(--mx-cell); text-align: left; }
.matrix th.mx-rowh { position: sticky; left: 0; z-index: 1; height: 24px; padding: 0 8px; text-align: left; font-weight: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right-color: var(--th-line-strong, #cbd5e1); }
.matrix .mx-key { font-weight: 600; margin-inline-end: 5px; }
.matrix td { height: 24px; text-align: center; vertical-align: middle; line-height: 1; cursor: pointer; color: #fff; font-weight: bold; }
.matrix td:hover { background: var(--accent-soft); }
.matrix td.on { background: #0369a1; } .matrix td.back { background: #7dd3fc; }
/* overlay of a relation field: the value in the colour of the value */
.matrix td.mx-ov { color: var(--th-text, #0f172a); font-size: 10.5px; } .matrix td.mx-ov.on-ov { background: var(--mx-ov, #bae6fd); color: var(--mx-ov-ink, #0f172a); } .matrix td.mx-ov.back { color: var(--mx-ov-ink, #0f172a); }

.new-bar { grid-template-columns: repeat(3, 1fr); }
.nb.more { color: var(--th-accent-text, var(--accent)); border-color: var(--th-violet-line, #c7d2fe); background: var(--accent-soft); grid-column: span 2; }

.twofa-setup { background: var(--th-surface-2, #f8fafc); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-top: 8px; }
.twofa-setup .secret { font-size: 16px; letter-spacing: 1px; font-weight: 700; display: inline-block; padding: 6px 10px; background: var(--th-surface, #fff); border: 1px dashed var(--accent); border-radius: 6px; user-select: all; }
.twofa-setup .uri { font-size: 11px; word-break: break-all; user-select: all; }
.audit-wrap { max-height: 420px; overflow: auto; margin-top: 8px; }
.audit-bad td { background: var(--th-red-bg, #fef2f2); }
.tok-win { background: var(--th-amber-bg, #fffbeb); border-left: 3px solid #f59e0b; padding: 6px 10px; border-radius: 4px; margin: 4px 0 10px; }

/* Project Browser: drag handle, manual order, breadcrumb */
.trow .tgrip { color: #cbd5e1; cursor: grab; font-size: 10px; letter-spacing: -2px; width: 8px; flex: none; opacity: 0; }
.trow:hover .tgrip { opacity: 1; color: var(--th-violet-text, #6366f1); }
.trow.drop-before { box-shadow: inset 0 2px 0 #6366f1; }
.trow.drop-after { box-shadow: inset 0 -2px 0 #6366f1; }
.crumbs { display: flex; align-items: center; gap: 2px; padding: 3px 10px; font-size: 12px; background: linear-gradient(90deg, var(--th-violet-bg, #eef2ff), var(--th-pink-bg, #fdf2f8)); border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; min-height: 26px; }
.crumbs:empty { display: none; }
.crumbs .crumb { border: 1px solid transparent; background: none; border-radius: 6px; padding: 1px 7px; color: var(--th-violet-text, #3730a3); font-weight: 600; cursor: pointer; }
.crumbs .crumb:hover { background: var(--th-surface, #fff); border-color: var(--th-violet-line, #c7d2fe); }
.crumbs .crumb.cur { cursor: default; background: var(--th-surface, #fff); border-color: var(--th-violet-line, #a5b4fc); color: var(--th-text, #1f2937); }
.crumbs .crumb, .crumbs .csep { flex-shrink: 0; }
.crumbs .crumb { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.crumbs .crumb.cur { flex-shrink: 1; min-width: 80px; max-width: none; }
.crumbs .crumb.more { font-weight: 700; letter-spacing: 1px; }
.crumbs .csep { border: none; background: none; color: var(--th-muted, #6b7280); padding: 0 3px; cursor: pointer; font-size: 14px; border-radius: 4px; }
.crumbs .csep:hover { background: var(--th-violet-bg, #e0e7ff); color: var(--th-violet-text, #4338ca); }

/* Language switcher */
.lang-select{font-size:12px;padding:2px 4px;margin:0 6px;border-radius:6px}
.auth-lang{text-align:center;margin-top:10px}

/* Language switcher */
.lang-select{font-size:12px;padding:2px 4px;margin:0 6px;border-radius:6px}
.auth-lang{text-align:center;margin-top:10px}

/* Resizable panels (public/resize.js): handle on the inner panel edge */
.ll-rz { position: absolute; z-index: 30; width: 8px; cursor: col-resize; touch-action: none; user-select: none; outline: none; }
.ll-rz[hidden] { display: none; }
.ll-rz::before { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: var(--th-hover-2, #e2e8f0); transition: background .12s; }
/* Handle always visible: dots in the middle of the edge */
.ll-rz::after { content: ''; position: absolute; left: 2px; top: calc(50% + 22px); width: 4px; height: 22px; background: radial-gradient(circle, #94a3b8 1.2px, transparent 1.6px) 0 0 / 4px 5.5px repeat-y; pointer-events: none; }
.ll-rz.collapsed::after { display: none; }
.ll-rz:hover::before, .ll-rz.on::before, .ll-rz:focus-visible::before { background: var(--accent); }
.ll-rz-btn { position: absolute; top: 50%; left: -4px; width: 16px; height: 28px; margin-top: -14px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--th-surface, #fff); color: var(--muted);
  font-size: 13px; line-height: 24px; text-align: center; cursor: pointer; opacity: .55; transition: opacity .12s; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.ll-rz:hover .ll-rz-btn, .ll-rz:focus-visible .ll-rz-btn, .ll-rz.collapsed .ll-rz-btn { opacity: 1; }
.ll-rz-btn:hover { color: var(--th-accent-text, var(--accent)); border-color: var(--accent); }
.ll-rz.collapsed { min-height: 48px; width: 12px; background: var(--th-hover, #f3f4f6); border-left: 1px solid var(--line); border-right: 1px solid var(--line); cursor: e-resize; }
.ll-rz-right.collapsed { cursor: w-resize; }
.ll-rz.collapsed::before { display: none; }
/* collapsed: the button stays within the 12px handle — 2px past it made the container overflow at the edge (Docs text jitter) */
.ll-rz.collapsed .ll-rz-btn { left: -1px; width: 12px; }
@media (hover: none) { .ll-rz-btn { opacity: 1; } .ll-rz { width: 14px; } .ll-rz::before { left: 6px; } .ll-rz-btn { left: -1px; } }
.ll-rz-panel { min-width: 0; }
.ll-rz-collapsed { width: 0 !important; min-width: 0 !important; flex: 0 0 0 !important; padding: 0 !important; border-width: 0 !important; overflow: hidden !important; }
.ll-rz-collapsed > * { display: none !important; }
body.ll-rz-dragging, body.ll-rz-dragging * { cursor: col-resize !important; user-select: none !important; }
body.ll-rz-dragging iframe { pointer-events: none; }

/* Status categories: one colour per category across Origo; the dark shades are in theme-dark.css */
:root { --st-verify: color-mix(in srgb, var(--st-doing) 45%, #fff); }
.st-todo { --st-cat: var(--st-todo); --st-c: var(--st-cat); } .st-doing { --st-cat: var(--st-doing); --st-c: var(--st-cat); } .st-done { --st-cat: var(--st-done); --st-c: var(--st-cat); }
.st-badge, .st-dot, .st-fill, .st-picker { --st-c: var(--st-cat, var(--st-todo)); }
.st-light { --st-c: color-mix(in srgb, var(--st-cat) 55%, #fff); } .st-dark { --st-c: color-mix(in srgb, var(--st-cat) 75%, #000); }
.st-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; line-height: 16px; padding: 1px 8px; border-radius: 10px; white-space: nowrap;
  background: color-mix(in srgb, var(--st-c) 16%, transparent); color: color-mix(in srgb, var(--st-c) 82%, var(--text)); border: 1px solid color-mix(in srgb, var(--st-c) 30%, transparent); }
button.st-badge { cursor: pointer; font-family: inherit; } button.st-badge:hover { background: color-mix(in srgb, var(--st-c) 26%, transparent); }
.st-badge.solid, .st-fill { background: var(--st-c); color: #fff; border-color: transparent; }
.st-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--st-c); flex: none; }
.st-picker { border-left: 4px solid var(--st-c); font-weight: 600; color: color-mix(in srgb, var(--st-c) 82%, var(--text)); }
.st-picker option { color: var(--text); font-weight: 400; } .st-picker .st-opt-todo { color: var(--st-todo); } .st-picker .st-opt-doing { color: var(--st-doing); } .st-picker .st-opt-done { color: var(--th-green-text, #15803d); }
.st-colours { display: grid; grid-template-columns: auto 60px 1fr; gap: 8px 10px; align-items: center; }

/* Top bar: app switcher, project, account menu */
.tb-pop { position: relative; display: inline-flex; }
.as-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--th-surface, #fff); padding: 4px 10px 4px 6px; border-radius: 10px; font-weight: 600; color: var(--text); }
.as-btn:hover, .as-btn[aria-expanded="true"] { background: var(--th-hover, #f3f4f6); }
.as-cur { font-size: 15px; }
.as-caret { color: var(--muted); font-size: 11px; }
.as-panel { width: 430px; }
.as-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.as-prod { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; color: var(--text); text-decoration: none; }
.as-prod:hover, .as-prod:focus { background: var(--th-hover, #f3f4f6); }
.as-prod.on { background: var(--accent-soft); }
.as-prod.off { opacity: .45; cursor: default; }
.as-prod[hidden] { display: none; }
.as-txt { display: flex; flex-direction: column; min-width: 0; white-space: normal; line-height: 1.25; }
.as-txt b { font-size: 14px; }
.pj-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 5px 8px; border-radius: 8px; color: var(--text); max-width: 260px; }
.pj-btn:hover, .pj-btn[aria-expanded="true"] { background: var(--th-hover, #f3f4f6); }
.pj-name { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.pj-panel { width: 300px; }
.pj-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.pj-item:hover { background: var(--th-hover, #f3f4f6); } .pj-item.on { background: var(--accent-soft); }
.um-btn { border: 0; background: transparent; padding: 2px; border-radius: 50%; }
/* Person avatar (LL.avatar): initials in the person colour, photo on top; person field (LL.personField) */
.ll-av { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 10px; line-height: 1; flex: none; overflow: hidden; vertical-align: middle; user-select: none; }
.ll-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ll-av.has-img { background: var(--th-hover-2, #e5e7eb) !important; }
.ll-av.has-img .ll-av-i { visibility: hidden; }
.ll-av-xs { width: 18px; height: 18px; font-size: 8px; }
.ll-av-sm { width: 22px; height: 22px; font-size: 10px; }
.ll-av-md { width: 28px; height: 28px; font-size: 11px; }
.ll-av-lg { width: 72px; height: 72px; font-size: 26px; }
.ll-av-none { background: var(--th-hover-2, #e5e7eb); color: var(--th-text-2, #4b5563); }
.ll-pf { display: inline-flex; align-items: center; min-width: 0; }
.ll-pf-cur { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px 2px 2px; cursor: pointer; color: inherit; font: inherit; min-width: 0; }
.ll-pf-cur:hover, .ll-pf-cur:focus-visible { border-color: var(--line, #d1d5db); background: var(--hover, #f3f4f6); }
.ll-pf.ro .ll-pf-cur { cursor: default; }
.ll-pf-cur[hidden] { display: none; }
.ll-pf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-av { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; }
.um-av.big { width: 40px; height: 40px; font-size: 15px; flex: none; }
.um-panel { width: 290px; display: flex; flex-direction: column; gap: 4px; }
.um-head { display: flex; gap: 10px; align-items: center; padding: 4px 4px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; white-space: normal; }
.um-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px; font-size: 13px; }
.um-item { display: block; text-align: left; width: 100%; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; cursor: pointer; }
.um-item:hover { background: var(--th-hover, #f3f4f6); }
.topbar .key-search { width: 240px; }
@media (max-width: 1100px) { .pj-name { display: none; } .topbar .key-search { width: 160px; } }

/* No system dialogs or overlays: inline confirmations, views and side panel in the layout (public/ui-inline.js) */
.ll-inline-hidden, .ll-view-hidden { display: none !important; }
.ll-inline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; background: var(--th-amber-bg, #fffbeb); border: 1px solid var(--th-amber-line, #fcd34d); border-radius: 8px; padding: 6px 10px; color: var(--text); }
.ll-inline.danger { background: var(--th-red-bg, #fef2f2); border-color: var(--th-red-line, #fca5a5); }
.ll-inline-strip { display: inline-flex; max-width: 100%; min-width: 0; vertical-align: middle; margin: 2px 0; }
/* In a narrow flex row the strip takes its own row and wraps text and buttons */
.ll-inline-strip { flex: 1 1 16em; white-space: normal; text-align: start; font-weight: normal; }
:has(> .ll-inline-strip) { flex-wrap: wrap; max-width: 100%; }   /* The parent row or chip wraps so the strip never overflows its container */
:not(.ll-inline-text) > .ll-inline-strip { box-sizing: border-box; }
.ll-inline-bar { flex: none; margin: 8px 12px; }
.ll-inline-text { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
.ll-inline-details { margin-top: 4px; }
.ll-inline-btns { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 1 auto; max-width: 100%; }
.ll-inline button { min-height: 32px; }
@media (hover: none) { .ll-inline button { min-height: 40px; } }
.ll-inline button { padding: 4px 10px; }
.ll-inline.ask { background: var(--th-surface, #fff); border-color: var(--line); }
.ll-inline-ask { display: flex; align-items: center; gap: 6px; flex: 1 1 320px; flex-wrap: wrap; }
.ll-inline-label { font-size: 12px; color: var(--muted); }
.ll-inline-input { flex: 1 1 200px; min-width: 120px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; }
.ll-inline-err { flex-basis: 100%; color: var(--th-red-text, var(--danger)); font-size: 12px; }
.ll-inline-err:empty { display: none; }
.ll-view { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.ll-view-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--th-surface, #fff); border-bottom: 1px solid var(--line); }
.ll-view-title { flex: 1; margin: 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll-view-actions { display: flex; gap: 6px; }
.ll-view-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 24px; }
.ll-view-body > .modal, .ll-side-body > .modal { width: auto; max-width: 860px; max-height: none; overflow: visible; box-shadow: none; border-radius: 10px; border: 1px solid var(--line); margin: 0 auto; }
.ll-view-body > .modal.wide, .ll-view-body.wide > .modal { max-width: none; }
.ll-side-body > .modal { border: 0; padding: 0; max-width: none; }
.ll-dlg > .modal-head { position: static; margin: 0 0 10px; border-radius: 0; }
#app.ll-side-open { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto minmax(0, 1fr); }
#app.ll-side-open > .topbar { grid-column: 1 / -1; grid-row: 1; }
#app.ll-side-open > .ll-inline-bar { grid-column: 1 / -1; grid-row: 2; }
#app.ll-side-open > :not(.topbar):not(.ll-inline-bar):not(.ll-side):not(.ll-rz) { grid-column: 1; grid-row: 3; min-height: 0; }
.ll-side { grid-column: 2; grid-row: 3; width: var(--ll-side-w, 420px); min-height: 0; min-width: 0; position: relative; z-index: 3; display: flex; flex-direction: column; background: var(--th-surface, #fff); border-left: 1px solid var(--line); }
.ll-side-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.ll-side-title { flex: 1; margin: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll-side-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px; }
/* Side panel next to a multi-panel workbench: side columns shrink proportionally (left <= 24%, right <= 36%), the canvas gets the rest */
#app.ll-side-open .workbench { grid-template-columns: min(var(--ll-left-w, clamp(200px, 20vw, 280px)), 24%) minmax(0, 1fr) min(var(--ll-right-w, clamp(240px, 24vw, 330px)), 36%); min-width: 0; }
#app.ll-side-open .workbench > * { min-width: 0; }
/* Project nav bar (public/project-nav.js) on the far left; collapsed = icons only (48 px) */
.ll-pshell { position: relative; flex: 1; display: flex; min-height: 0; min-width: 0; }
.ll-pshell > .workbench, .ll-pshell > .plugin-app { flex: 1; min-width: 0; min-height: 0; }
.ll-pshell > .plugin-app { overflow: auto; display: flex; flex-direction: column; }
/* an app without the project bar (directly in #app) scrolls in its own box as it does inside .ll-pshell, never the page: a side panel (#app.ll-side-open) stays in the window */
#app > .plugin-app { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; }
.ll-pnav { width: var(--ll-pnav-w, 232px); flex: 0 0 auto; display: flex; flex-direction: column; background: var(--th-surface-2, #fafbfc); border-right: 1px solid var(--line); min-height: 0; overflow: hidden; font-size: 13px; }
.ll-pnav.ll-rz-collapsed { width: 48px !important; min-width: 48px !important; flex: 0 0 48px !important; border-width: 0 1px 0 0 !important; }
.ll-pnav.ll-rz-collapsed > * { display: flex !important; }
.ll-pnav.ll-rz-collapsed > .pn-groups { display: block !important; }
.ll-rz[data-panel="project.nav"] .ll-rz-btn, .ll-rz[data-panel="project.nav"].collapsed { display: none; }
.pn-head { display: flex; gap: 8px; align-items: center; padding: 10px 10px 8px; border-bottom: 1px solid var(--line); }
.pn-pic { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 7px; background: var(--accent-soft); display: grid; place-items: center; font-size: 16px; }
.pn-pt { min-width: 0; } .pn-pname { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-pmeta { display: flex; gap: 4px; align-items: center; margin-top: 2px; } .pn-pmeta .pill { margin: 0; }
.pn-sw { position: relative; padding: 6px 8px 0; }
.pn-switch { display: flex; align-items: center; gap: 6px; width: 100%; border: 1px solid var(--line); background: var(--th-surface, #fff); border-radius: 8px; padding: 5px 8px; cursor: pointer; text-align: left; }
.pn-switch .pn-lb { flex: 1; } .pn-caret { color: var(--muted); }
.pn-menu { position: absolute; left: 8px; right: 8px; top: calc(100% + 2px); z-index: 40; background: var(--th-surface, #fff); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.12); padding: 4px; max-height: 320px; overflow: auto; }
.pn-menu[hidden] { display: none; }
.pn-mi { display: block; padding: 6px 8px; border-radius: 6px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pn-mi:hover, .pn-mi.on { background: var(--accent-soft); color: var(--th-accent-text, var(--accent)); }
.pn-groups { flex: 1; overflow: auto; padding: 4px 6px 8px; }
.pn-group { margin-top: 8px; }
.pn-gh { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 4px 6px; }
.pn-toggle { border: 0; background: none; width: 100%; cursor: pointer; text-align: left; } .pn-gbody[hidden] { display: none; }
.pn-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; border: 0; background: none; width: 100%; font: inherit; cursor: pointer; text-align: left; }
.pn-item:hover { background: #eef1f5; } .pn-item.on { background: var(--accent-soft); color: var(--th-accent-text, var(--accent)); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.pn-ic { width: 20px; flex: 0 0 20px; text-align: center; } .pn-lb { overflow: hidden; text-overflow: ellipsis; }
.pn-srow { display: flex; align-items: center; } .pn-srow .pn-item { flex: 1; min-width: 0; }
.pn-sact { display: none; } .pn-srow:hover .pn-sact { display: flex; } .pn-sact button { padding: 0 4px; }
.pn-lock { color: var(--muted); cursor: default; }
.pn-hint { color: var(--muted); font-size: 12px; margin: 2px 8px 4px; }
.pn-add { color: var(--th-accent-text, var(--accent)); }
.pn-form { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; } .pn-in { padding: 4px 6px; } .pn-err { color: var(--th-red-text, var(--danger)); font-size: 12px; } .pn-frow { display: flex; gap: 4px; }
.pn-foot { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); padding: 6px; }
.pn-foot .pn-settings { flex: 1; min-width: 0; }
.pn-collapse { border: 1px solid var(--line); background: var(--th-surface, #fff); border-radius: 6px; width: 28px; height: 28px; flex: 0 0 28px; cursor: pointer; color: var(--muted); }
.pn-collapse:hover { color: var(--th-accent-text, var(--accent)); border-color: var(--accent); }
.ll-pnav.pn-mini .pn-lb, .ll-pnav.pn-mini .pn-pt, .ll-pnav.pn-mini .pn-caret, .ll-pnav.pn-mini .pn-hint, .ll-pnav.pn-mini .pn-sact, .ll-pnav.pn-mini .pn-gh .pn-tw { display: none !important; }
.ll-pnav.pn-mini .pn-head { justify-content: center; padding: 8px 0; } .ll-pnav.pn-mini .pn-item, .ll-pnav.pn-mini .pn-switch { justify-content: center; padding: 6px 0; }
.ll-pnav.pn-mini .pn-gh { height: 1px; padding: 0; margin: 6px 4px; background: var(--line); overflow: hidden; }
.ll-pnav.pn-mini .pn-foot { flex-direction: column; } .ll-pnav.pn-mini .pn-groups { padding: 4px; }
.ll-pnav.pn-mini .pn-sw { padding: 6px 4px 0; } .ll-pnav.pn-mini .pn-menu { left: 4px; right: auto; min-width: 200px; }
@media (max-width: 760px) { .ll-pnav:not(.pn-mini) { width: 48px; } .ll-pnav .pn-lb, .ll-pnav .pn-pt { display: none; } }
/* People picker (LL.peoplePicker): chip field with a popover list below (not a modal) */
.llpp { display: inline-block; vertical-align: middle; }
.llpp-box { display: inline-flex; flex-wrap: wrap; gap: 3px; align-items: center; min-width: 200px; max-width: 460px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--th-surface, #fff); cursor: text; box-sizing: border-box; }
.llpp-box:focus-within { border-color: var(--th-blue-line, #93c5fd); }
.llpp .llpp-box input { border: 0; outline: 0; min-width: 110px; max-width: none; width: auto; flex: 1; padding: 3px 2px; background: transparent; box-shadow: none; }
.llpp-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 2px 1px 1px; border-radius: 12px; background: var(--th-blue-bg, #e0f2fe); font-size: 12px; white-space: nowrap; }
.llpp-chip button { border: 0; background: transparent; cursor: pointer; padding: 0 3px; color: var(--muted); font-size: 12px; }
.llpp-av { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 9px; font-weight: 700; flex: none; }
.llpp-list { position: fixed; z-index: 60; max-width: min(420px, 96vw); max-height: 280px; overflow: auto; background: var(--th-surface, #fff); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 12px rgba(15,23,42,.12); text-align: left; }
.llpp-opt { display: flex; gap: 6px; align-items: center; padding: 4px 8px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.llpp-opt.act, .llpp-opt:hover { background: var(--th-blue-bg, #eff6ff); }
.llpp-opt .muted { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.llpp-note { padding: 4px 8px; font-size: 12px; color: var(--muted); }

/* WCAG 2.1 AA: visible keyboard focus, skip link, screen-reader-only text, reduced motion */
:where(a, button, [role="button"], [tabindex], summary, select, input, textarea):focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.skip-link { position: absolute; left: 8px; top: -40px; z-index: 10000; background: var(--th-surface, #fff); color: var(--th-blue-text, #1e3a8a); padding: 6px 12px; border-radius: 6px; border: 2px solid var(--accent, #2563eb); font-weight: 600; }
.skip-link:focus { top: 8px; }
#main-content:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
/* Person mention @[Name] in Flow and Docs comments */
.ll-mention { background: var(--accent-soft, #eef2ff); color: var(--th-accent-text, var(--accent)); border-radius: 4px; padding: 0 3px; font-weight: 600; white-space: nowrap; }

/* Row actions once shown only on hover: always visible on touch screens, on focus from the keyboard; unpin x also on desktop (dimmed) */
body .hz-rows .x, body .ft-rows .x { visibility: visible; opacity: .4; }
body .hz-rows > div:hover .x, body .ft-rows > div:hover .x, body .hz-rows .x:focus-visible, body .ft-rows .x:focus-visible { opacity: 1; }
body .dl-row:focus-within .more, body .ld-row:focus-within .ta { visibility: visible; }
@media (hover: none) {
  body .hz-rows .x, body .ft-rows .x { opacity: 1; min-width: 32px; min-height: 32px; }
  body .dl-row .more, body .ld-row .ta { visibility: visible; min-width: 32px; min-height: 32px; }
}

/* UML diagram from Mermaid / PlantUML code (public/plugins/uml-code.js) */
.umlc-panel .ll-side-body { display: flex; flex-direction: column; gap: 8px; }
.umlc-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.umlc-row .spacer { flex: 1; }
.umlc-row input.umlc-name { flex: 1; min-width: 160px; }
.umlc-editor { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--th-surface, #fff); min-height: 260px; height: 42vh; resize: vertical; }
.umlc-gutter { white-space: pre; text-align: right; padding: 8px 6px; background: var(--th-surface-2, #f8fafc); color: var(--th-muted, #6b7280); font: 12.5px/18px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: hidden; user-select: none; min-width: 34px; border-right: 1px solid var(--line); }
.umlc-text { flex: 1; border: 0; outline: none; resize: none; padding: 8px; font: 12.5px/18px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; tab-size: 2; background: transparent; }
.umlc-issues { display: flex; flex-direction: column; gap: 2px; max-height: 160px; overflow: auto; }
.umlc-issue { text-align: left; border: 0; background: none; padding: 2px 4px; font-size: 12.5px; cursor: pointer; border-radius: 4px; }
.umlc-issue.err { color: var(--th-red-text, #b91c1c); }
.umlc-issue.warn { color: var(--th-amber-text, #92400e); }
.umlc-issue:hover { background: var(--th-hover, #f1f5f9); }
.umlc-ok { color: var(--th-green-text, #15803d); font-size: 12.5px; }
.umlc-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.umlc-status { font-size: 12.5px; color: var(--th-text-2, #475569); }
.umlc-status.ok { color: var(--th-green-text, #15803d); }
.umlc-status.warn { color: var(--th-amber-text, #92400e); }
.umlc-status.err { color: var(--th-red-text, #b91c1c); }
.umlc-conflict { border: 1px solid #f59e0b; background: var(--th-amber-bg, #fffbeb); border-radius: 6px; padding: 8px; font-size: 13px; }
.umlc-sum { font-size: 13px; }
.umlc-list { font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; }
.umlc-type { margin-top: 4px; }
.umlc-el code { background: var(--th-hover, #f1f5f9); padding: 0 4px; border-radius: 3px; }
.umlc-el select { font-size: 12px; padding: 1px 4px; }
.umlc-schema { width: 100%; max-height: 280px; border: 1px solid var(--line); border-radius: 6px; background: var(--th-surface, #fff); margin-top: 6px; }
.umlc-diff h4 { margin: 6px 0 2px; }
.umlc-dsec { font-size: 12.5px; }
.umlc-dsec ul { margin: 2px 0 6px 18px; padding: 0; }
.umlc-dsec.add b { color: var(--th-green-text, #15803d); }
.umlc-dsec.chg b { color: var(--th-blue-text, #1d4ed8); }
.umlc-dsec.del b { color: var(--th-red-text, #b91c1c); }

/* Highlighted "Project card" entry of a change project, first under the project name */
.pn-top { padding: 4px 6px 2px; } .pn-item.pn-primary { background: var(--th-teal-bg, #f0fdfa); border: 1px solid var(--th-teal-line, #99f6e4); color: var(--th-teal-text, #0f766e); font-weight: 600; } .pn-item.pn-primary.on { background: var(--accent-soft); color: var(--th-accent-text, var(--accent)); }
/* Impact analysis on delete (public/impact.js): inline confirmation, package as a scrollable card list */
.impact-details { margin-top: 6px; display: grid; gap: 4px; max-width: 100%; min-width: 0; }
.impact-summary { font-weight: 600; }
.impact-more-list summary { cursor: pointer; color: var(--th-accent-text, var(--accent)); }
.impact-list { display: grid; gap: 6px; margin: 6px 0; max-height: 260px; overflow: auto; }
.impact-group ul { margin: 2px 0 0 16px; padding: 0; }
.impact-group-t { font-weight: 600; }
.impact-pkg { display: grid; gap: 6px; min-width: 0; }
.impact-totals { display: flex; gap: 6px; flex-wrap: wrap; }
.impact-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; max-width: 100%; }
.impact-card { flex: 0 0 220px; scroll-snap-align: start; border: 1px solid var(--border, #ddd); border-radius: 8px; padding: 6px 8px; background: var(--panel, #fff); font-size: 12px; }
.impact-card ul { margin: 4px 0 0 14px; padding: 0; }
.impact-card-h { display: flex; gap: 4px; align-items: baseline; }
.impact-card-h b { white-space: nowrap; }
.impact-count { margin-left: auto; background: var(--th-amber-bg, #fde68a); color: var(--th-amber-text, #92400e); border-radius: 10px; padding: 0 7px; font-weight: 700; }
.dge-deleted { color: var(--th-amber-text, #92400e); }

/* Organization page: equal project tiles */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; align-items: stretch; }
.cards > .card { width: auto; min-height: 138px; padding: 14px 16px; gap: 8px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.cards > .card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(15, 23, 42, .08); transform: translateY(-1px); }
/* card header: key, kind badge and status / phase chip; what does not fit wraps to the next line, the chip is never cut */
.cards > .card > .row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.cards > .card > .row > * { flex: 0 0 auto; white-space: nowrap; margin: 0; line-height: 20px; display: inline-flex; align-items: center; gap: 4px; }
.cards > .card > .row > .pill:first-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.cards > .card > .row > :nth-child(3) { max-width: 100%; white-space: normal; }
.cards > .card .card-title { font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cards > .card > .muted.small { margin-top: auto; }
/* "+ New project": spacing from groups, same size as the tiles */
.cards:has(> .card.add) { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.cards > .card.add { min-height: 138px; align-items: center; justify-content: center; border-style: dashed; color: var(--muted, #64748b); font-weight: 500; }
.cards > .card.add:hover { color: var(--th-accent-text, var(--accent)); }
/* No horizontal scrolling of the whole window (wide content scrolls in its block); stable scrollbar gutter so the view does not jitter */
html { overflow-x: hidden; scrollbar-gutter: stable; }
body { overflow-x: hidden; max-width: 100vw; }
html { overflow-y: scroll; }

/* Build number in the screen corner */
.ll-build { position: fixed; right: 8px; bottom: 4px; z-index: 5; font: 10px/1.2 ui-monospace, Consolas, monospace; color: var(--th-muted, #6b7280); background: var(--th-glass, rgba(255,255,255,.8)); padding: 1px 5px; border-radius: 4px; pointer-events: auto; }

/* View loading indicator (public/load-indicator.js) */
.ll-loadpill { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 8px; border-radius: 16px; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0,0,0,.12); font-size: 13px; overflow: hidden; pointer-events: none; }
.ll-loadpill[hidden] { display: none; }
.ll-loadpill-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: ll-spin .8s linear infinite; }
.ll-loadpill-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 40%; background: var(--accent); animation: ll-loadbar 1.2s ease-in-out infinite; }
.ll-loadpill.done .ll-loadpill-spin, .ll-loadpill.done .ll-loadpill-bar { display: none; }
.ll-loadpill.done::before { content: '✓'; color: var(--th-accent-text, var(--accent)); font-weight: 700; }
@keyframes ll-spin { to { transform: rotate(360deg); } }
@keyframes ll-loadbar { 0% { left: -40%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .ll-loadpill-spin, .ll-loadpill-bar { animation: none; } }
/* Roles in project modules (Access tab) */
.perm-caps details summary { cursor: pointer; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.perm-caps-grid { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 4px 12px; padding: 6px 0; }
.perm-caps-grid label { display: flex; justify-content: space-between; gap: 6px; align-items: center; }

.perm-cap-sel { display: block; margin-top: 2px; font-size: 11px; max-width: 110px; }
/* Project role badge next to the avatar */
.role-badge { display: inline-flex; align-items: center; font-size: 11px; line-height: 18px; padding: 0 8px; border-radius: 10px; margin-right: 6px; white-space: nowrap; background: var(--th-hover-2, #e2e8f0); color: var(--th-text-2, #334155); cursor: default; }
.role-badge.rb-owner { background: var(--th-violet-bg, #ede9fe); color: var(--th-violet-text, #5b21b6); }
.role-badge.rb-admin { background: var(--th-blue-bg, #dbeafe); color: var(--th-blue-text, #1e40af); }
.role-badge.rb-editor { background: var(--th-green-bg, #dcfce7); color: var(--th-green-text, #166534); }
.role-badge.rb-viewer { background: var(--th-hover, #f1f5f9); color: var(--th-text-2, #475569); }
.role-badge.rb-member { background: var(--th-hover, #f1f5f9); color: var(--th-text-2, #475569); }
.role-badge.rb-org { background: var(--th-amber-bg, #fef3c7); color: var(--th-amber-text, #92400e); }
.role-badge .rb-mod { opacity: .8; }
/* Origo Code */
.code-app { flex: 1; min-height: 0; overflow: auto; padding: 16px 24px; }
.code-head { flex-wrap: wrap; }
.code-tabs { display: flex; gap: 4px; }
.code-tab { padding: 6px 12px; border-radius: 6px; color: var(--text); }
.code-tab.on, .code-tab:hover { background: var(--accent-soft); color: var(--th-accent-text, var(--accent)); }
.code-page { display: flex; flex-direction: column; gap: 16px; max-width: 1400px; }
.code-notice { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--th-amber-line, #fcd34d); background: var(--th-amber-bg, #fffbeb); border-radius: 8px; }
.code-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.code-tile { position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); }
.code-tile-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 30px 12px 14px; height: 100%; box-sizing: border-box; color: var(--text); text-decoration: none; }
.code-tile:has(a.code-tile-body:hover) { border-color: var(--accent); }
.code-tile.code-small .code-tile-note { color: var(--th-amber-text, #b45309); }
.code-info-btn { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--muted); font: italic 600 11px/16px Georgia, serif; cursor: help; }
.code-tip { display: none; position: absolute; z-index: 30; top: calc(100% - 4px); left: -16px; right: -16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); box-shadow: 0 6px 24px rgba(0,0,0,.15); font-size: 12px; line-height: 1.45; }
.code-info:hover .code-tip, .code-info:focus-within .code-tip, .code-info.open .code-tip { display: block; }
.code-tip p { margin: 6px 0 0; }
.code-tip-scale { margin-top: 6px; } .code-tip-scale table { border-collapse: collapse; margin-top: 2px; }
.code-tip-scale td { padding: 1px 8px 1px 0; }
.code-scale-row.on td { font-weight: 700; background: var(--accent-soft); }
.code-scale-dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; margin-right: 6px; }
.code-tip-sample.small-sample { color: var(--th-amber-text, #b45309); }
.code-tile.code-small .code-tile-value { opacity: .7; }
.code-tile-label { font-size: 12px; color: var(--muted); }
.code-tile-value { font-size: 22px; font-weight: 600; }
.code-tier { align-self: flex-start; color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 10px; }
.code-goal { align-self: flex-start; font-size: 11px; padding: 1px 8px; border-radius: 10px; border: 1px solid currentColor; }
.code-goal-met { color: var(--th-green-text, #047857); }
.code-goal-missed { color: var(--th-red-text, #b91c1c); }
.code-goal-none { color: var(--muted); }
.code-goal-form { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.code-goal-form input { width: 80px; }
.code-goals { margin: 4px 0; }
.code-direct-list td { vertical-align: top; }
.code-login-slot { margin-left: 6px; }
.code-section { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 12px 16px; }
.code-section h3 { margin: 0 0 8px; font-size: 15px; }
.code-phasebar { display: flex; height: 34px; border-radius: 6px; overflow: hidden; }
.code-phase { display: flex; align-items: center; padding: 0 8px; color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; }
.code-phase-coding { background: #6366f1; } .code-phase-pickup { background: #f59e0b; }
.code-phase-review { background: #0ea5e9; } .code-phase-deploy { background: #10b981; }
.code-subphases { margin: 6px 0 0; } .code-subphase { white-space: nowrap; }
.code-cmp > summary { cursor: pointer; font-weight: 600; } .code-cmp .code-cmp-note { margin: 8px 0; }
.code-cmp-arrow { font-weight: 700; } .code-cmp-arrow.better { color: var(--th-green-text, #15803d); } .code-cmp-arrow.worse { color: var(--th-red-text, #dc2626); } .code-cmp-arrow.flat { color: var(--muted, #64748b); }
.code-compare .code-scale-dot { margin-right: 4px; }
.code-trend { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.code-week { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.code-week-bar { width: 100%; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; }
.code-phase-trend { display: flex; flex-direction: column; gap: 6px; }
.code-chart { width: 100%; max-height: 340px; }
.code-phase-trend .code-filters select { width: auto; }
.code-chart-tick line { stroke: var(--line); stroke-width: 1; }
.code-chart text { fill: var(--muted); font-size: 11px; }
.code-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.code-legend-item { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 2px 10px; background: var(--panel); color: var(--text); font-size: 12px; cursor: pointer; }
.code-legend-item.off { opacity: .45; }
.code-legend-swatch { width: 10px; height: 10px; border-radius: 5px; }
.code-team-trend summary { cursor: pointer; margin: 8px 0; color: var(--muted); }
.code-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.code-chip { border: 1px solid var(--line); border-radius: 12px; padding: 2px 10px; font-size: 12px; background: var(--bg); }
.code-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.code-profile-row { display: grid; grid-template-columns: 220px 1fr 40px; gap: 8px; align-items: center; font-size: 13px; }
.code-profile-bar { height: 10px; background: var(--accent); border-radius: 5px; }
.code-team-head { display: flex; align-items: center; gap: 12px; } .code-team-head h3 { flex: 1; margin: 0; }
.code-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.code-prs td { font-size: 13px; } .code-prs tr.code-release td { color: var(--muted); }
.code-issue { margin-right: 6px; }
.code-field { display: grid; grid-template-columns: 220px 1fr; gap: 4px 12px; align-items: start; margin: 8px 0; }
.code-field .muted { grid-column: 2; }
.code-actions { display: flex; gap: 8px; }
.code-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.code-check { display: flex; gap: 8px; align-items: flex-start; }
.code-check-mark { width: 18px; height: 18px; border-radius: 9px; color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.code-check.ok .code-check-mark { background: #16a34a; }
.code-check.missing .code-check-mark { background: #d97706; }
.code-inline { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.code-template { display: flex; flex-direction: column; gap: 12px; }
.ss-field { width: 100%; max-width: 640px; padding: 8px 10px; font-size: 15px; margin: 4px 0 10px; }
.ss-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ss-filters .chip { border: 1px solid var(--line, #ddd); border-radius: 14px; padding: 3px 10px; background: transparent; cursor: pointer; }
.ss-filters .chip.on { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb); color: #fff; }
.ss-group { margin-bottom: 18px; }
.ss-group-t { font-size: 15px; margin: 0 0 6px; }
.ss-list { list-style: none; margin: 0; padding: 0; }
.ss-item { padding: 5px 4px; border-bottom: 1px solid var(--line, #eee); }
.ss-link { display: flex; gap: 8px; align-items: baseline; text-decoration: none; color: inherit; }
.ss-key { min-width: 76px; }
.ss-title { flex: 1; }
.ss-snippet { margin: 2px 0 0 26px; }
.key-search-box { position: relative; display: inline-flex; }
.ss-suggest { position: absolute; top: calc(100% + 4px); right: 0; z-index: 50; width: 420px; max-height: 70vh; overflow: auto; background: var(--bg, #fff); color: var(--text); border: 1px solid var(--line, #ddd); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.15); padding: 4px 0; }
.ss-sug-group { padding: 6px 10px 2px; }
.ss-sug-row { display: block; padding: 4px 10px; text-decoration: none; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-sug-row.on, .ss-sug-row:hover { background: var(--hover, #eef2ff); }
.ss-sug-none { padding: 4px 10px; }
/* with a relation field overlay on, the matrix columns are wider and a value stays in its cell
   (cut with an ellipsis, the whole value in the tooltip), so the next cell can be clicked in its own area */
.matrix.mx-ovon { --mx-cell: 76px; }
.matrix td.mx-ov { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 3px; }
