/* CSV DocGen - minimalist, familiar office-style UI (URS 1.4.1/1.4.2); no web fonts (air-gapped, fast). */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --line: #d9dde3; --line2: #e9ecf0; --text: #1f2933; --muted: #66727f;
  --accent: #2f5d8a; --accent-2: #e7eff7; --warn: #b26b00; --warn-bg: #fff6e5; --danger: #b3261e; --ok: #217a3c;
  --dirty: #d98a00; --radius: 5px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13px/1.45 var(--font); color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.ico { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; flex: none; }
.mono { font-family: var(--mono); font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; }
.ok-text { color: var(--ok); font-weight: 600; } .warn-text { color: var(--danger); font-weight: 600; }
.empty, .empty-sec { color: var(--muted); font-style: italic; }
.loading { color: var(--muted); padding: 24px; }
.error-box { margin: 24px; padding: 16px; border: 1px solid #f0b4b0; background: #fdecea; color: var(--danger); border-radius: var(--radius); }
.tag { display: inline-block; padding: 0 6px; border-radius: 9px; background: var(--accent-2); color: var(--accent); font-size: 11px; }
.tag-red { background: #fdecea; color: var(--danger); font-weight: 600; }

/* buttons & form */
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f0f3f6; } .btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn-primary:hover { background: #264d73; }
.btn-accent { border-color: var(--ok); color: var(--ok); font-weight: 600; }
.btn-warn { border-color: #e2b766; color: var(--warn); }
.btn-danger { border-color: #e6a19c; color: var(--danger); } .btn-danger:hover { background: #fdecea; }
.btn-small { padding: 2px 7px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 8px; }
.btn-flat { background: none; border: none; color: inherit; cursor: pointer; padding: 4px 8px; border-radius: var(--radius); display: inline-flex; align-items: center; gap: 4px; }
.btn-flat:hover { background: rgba(255,255,255,.15); }
.btn-icon { background: none; border: none; cursor: pointer; padding: 2px 4px; border-radius: 3px; color: var(--muted); line-height: 1; }
.btn-icon:hover { background: var(--line2); color: var(--text); }
input[type=text], input[type=password], input[type=search], input[type=email], input[type=number], input[type=date], input[type=time], select, textarea {
  border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; background: #fff; max-width: 100%; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus, .rte-area:focus { outline: 2px solid #9cc0e5; outline-offset: 0; border-color: #6f9ccc; }
.field { display: flex; flex-direction: column; gap: 3px; margin: 0 0 10px; }
.field-label { font-weight: 600; font-size: 12px; color: #3e4c59; }
.field input[type=text], .field input[type=password], .field input[type=email], .field select { width: 100%; }
.check { display: inline-flex; align-items: center; gap: 4px; margin: 2px 12px 2px 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.doc-checks { display: flex; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 14px; padding: 10px 14px; background: #fff; }
legend { font-weight: 600; padding: 0 4px; }

/* login */
.login-page { display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #e9eef4, #f7f8fa); }
.login-box { width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 28px; box-shadow: 0 6px 30px rgba(20,40,60,.08); }
.login-brand { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--accent); }
.login-brand .ico { width: 26px; height: 26px; }
.login-sub { color: var(--muted); margin: 2px 0 18px; }
.login-error { color: var(--danger); min-height: 18px; margin-bottom: 8px; }

/* shell */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 42px; padding: 0 12px; background: #24384d; color: #e9eef3; flex: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.brand small { font-weight: 400; opacity: .6; font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.top-actions .btn { background: #35506b; border-color: #4a6684; color: #fff; }
.bell { position: relative; }
.badge { position: absolute; top: -2px; right: -2px; background: #e5484d; color: #fff; border-radius: 8px; font-size: 10px; padding: 0 4px; line-height: 14px; }
.badge:empty { display: none; }
.menu { position: relative; display: inline-block; }
.menu-pop { display: none; position: absolute; right: 0; top: 100%; z-index: 50; min-width: 220px; background: #fff; color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.12); padding: 4px; }
.menu.open .menu-pop { display: block; }
.menu-pop button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 6px 10px; cursor: pointer; border-radius: 3px; }
.menu-pop button:hover { background: var(--accent-2); } .menu-pop button.danger { color: var(--danger); }
.workspace { flex: 1; display: flex; min-height: 0; }
.side { width: 300px; flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 200px; }
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 4px; font-weight: 600; color: #3e4c59; }
.tree-filter { margin: 2px 8px 6px; }
.splitter { width: 4px; cursor: col-resize; background: transparent; flex: none; } .splitter:hover { background: #c9d4df; }
body.resizing { cursor: col-resize; user-select: none; }
.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main { flex: 1; overflow: auto; }
.view { min-height: 100%; }

/* tree */
.tree { flex: 1; overflow: auto; padding: 0 4px 20px; }
.tree ul { list-style: none; margin: 0; padding-left: 14px; } .tree .troot { padding-left: 0; }
.tnode { display: flex; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 3px; cursor: pointer; white-space: nowrap; }
.tnode:hover { background: #eef2f6; } .tnode.active { background: var(--accent-2); font-weight: 600; }
.tnode.subgroup { color: var(--muted); font-style: italic; }
.tlabel { overflow: hidden; text-overflow: ellipsis; }
.caret { width: 14px; display: inline-flex; justify-content: center; transition: transform .1s; color: var(--muted); }
.caret.open { transform: rotate(90deg); } .caret.none { visibility: hidden; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex: none; }
.tag-tpl { font-size: 10px; font-weight: 700; color: #fff; background: #8e44ad; border-radius: 3px; padding: 0 3px; }
.st { width: 13px; height: 13px; } .st-draft { color: #6b7785; } .st-review { color: #c47d00; } .st-approval { color: #8e44ad; }
.st-approved { color: var(--ok); stroke-width: 2.2; } .st-released { color: #1b5fa8; } .st-withdrawn { color: var(--danger); } .st-superseded { color: #9aa5b1; }

/* tabs (URS 1.4.5 - 1.4.7) */
.tabs { display: flex; gap: 2px; background: #e4e8ed; padding: 4px 6px 0; overflow-x: auto; flex: none; min-height: 33px; }
.tab { display: flex; align-items: center; gap: 5px; padding: 5px 8px 5px 10px; background: #d5dbe2; border-radius: 5px 5px 0 0; cursor: pointer; max-width: 240px;
  border-top: 3px solid transparent; white-space: nowrap; }
.tab-proj { border-top-color: var(--pc); background: color-mix(in srgb, var(--pc) 16%, #e8ecf0); }
.tab.active { background: #fff; } .tab-proj.active { background: color-mix(in srgb, var(--pc) 7%, #fff); }
.tab-title { overflow: hidden; text-overflow: ellipsis; }
.tab-x { background: none; border: none; cursor: pointer; color: var(--muted); padding: 0 2px; font-size: 14px; border-radius: 3px; }
.tab-x:hover { background: rgba(0,0,0,.08); }
.dirty-dot { color: var(--dirty); font-size: 10px; }

/* document view */
.docview { padding: 0 0 60px; }
.doc-head { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 10px 18px;
  background: #fff; border-bottom: 1px solid var(--line); border-top: 3px solid var(--pc); flex-wrap: wrap; }
.doc-code { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.doc-head h2 { margin: 2px 0; font-size: 18px; display: flex; align-items: center; gap: 6px; }
.doc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.state { padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #eef1f4; }
.state-draft { background: #eef1f4; color: #4a5866; } .state-review { background: #fff1d6; color: #8a5a00; } .state-approval { background: #f1e4f7; color: #6c2d8c; }
.state-approved { background: #dff3e5; color: var(--ok); } .state-released { background: #ddebfa; color: #1b5fa8; } .state-withdrawn { background: #fdecea; color: var(--danger); }
.state-superseded { background: #eceff2; color: #75818d; }
.ver-select { font-size: 12px; padding: 1px 4px; }
.save-status { color: var(--muted); font-size: 11px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.banners { padding: 8px 18px 0; }
.banner { padding: 7px 12px; border-radius: var(--radius); background: #f0f3f6; border: 1px solid var(--line); margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.banner-warn { background: var(--warn-bg); border-color: #f1d39b; } .banner-info { background: #eaf2fb; border-color: #c5daef; }
.sections { padding: 6px 18px; }
.sec { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; }
.subsecs .sec { margin: 6px 10px 6px 18px; border-color: var(--line2); }
.sec.deleted > .sec-head { text-decoration: line-through; opacity: .6; }
.sec-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; user-select: none; border-bottom: 1px solid var(--line2); }
.sec-head h3, .sec-head h4 { margin: 0; font-size: 14px; flex: 1; } .sec-head h4 { font-size: 13px; }
.sec-head .num { color: var(--accent); font-variant-numeric: tabular-nums; margin-right: 4px; }
.sec-caret { transform: rotate(90deg); color: var(--muted); }
.sec.collapsed > .sec-wrap, .sec.collapsed > .subsecs, .sec.collapsed > .add-sub { display: none; }
.sec.collapsed > .sec-head .sec-caret { transform: none; } .sec.collapsed > .sec-head { border-bottom: none; }
.kind { font-size: 11px; color: var(--accent); background: var(--accent-2); padding: 0 6px; border-radius: 9px; }
.sec-wrap { display: flex; gap: 12px; padding: 8px 10px; }
.sec-body { flex: 1; min-width: 0; }
.guidance { color: var(--muted); font-size: 12px; font-style: italic; margin: 0 0 6px; }
.add-sub { margin: 0 0 8px 28px; } .add-section { margin: 8px 0; }
.comments { width: 290px; flex: none; display: flex; flex-direction: column; gap: 6px; border-left: 2px solid #f1d39b; padding-left: 10px; }
.ccard { background: #fffaf0; border: 1px solid #f1e0bd; border-radius: var(--radius); padding: 6px 8px; font-size: 12px; }
.ccard.pending { border-style: dashed; background: #fffdf7; }
.ccard.res-addressed, .ccard.res-noted { background: #f2f8f3; border-color: #cfe6d4; } .ccard.res-rejected { background: #f7f3f2; }
.ccard blockquote { margin: 3px 0; padding-left: 6px; border-left: 2px solid #ddd; color: var(--muted); }
.suggest { background: #eef6ee; padding: 3px 5px; margin-top: 3px; border-radius: 3px; }
.cresp { margin-top: 3px; color: #2f4a2f; }
.caddr { display: flex; gap: 4px; margin-top: 4px; } .caddr input { flex: 1; min-width: 0; }

/* rich text */
.rte { border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 1px; padding: 3px; border-bottom: 1px solid var(--line2); background: #f8f9fb; position: sticky; top: 74px; z-index: 5; }
.rte-btn { min-width: 26px; height: 24px; border: 1px solid transparent; background: none; border-radius: 3px; cursor: pointer; padding: 0 5px; }
.rte-btn:hover { background: #e6ecf2; border-color: var(--line); }
.rte-sep { width: 1px; background: var(--line); margin: 2px 4px; }
.rte-area { min-height: 36px; padding: 6px 10px; }
.rte .rte-bar { display: none; } .rte:focus-within .rte-bar { display: flex; }
.rte:not(:focus-within) { border-color: var(--line2); } .rte:not(:focus-within):hover { border-color: var(--line); }
.rte-area:empty::before, .rte-area.is-empty::before { content: attr(data-placeholder); color: #a0aab4; white-space: pre-wrap; pointer-events: none; display: block; }
.rte-area.is-empty > br:only-child { display: none; }
.rte-area table, .rte-view table { border-collapse: collapse; margin: 6px 0; }
.rte-area td, .rte-area th, .rte-view td, .rte-view th { border: 1px solid #b9c2cc; padding: 3px 6px; min-width: 40px; vertical-align: top; }
.rte-area th, .rte-view th { background: #eef1f5; }
.rte-area p, .rte-view p { margin: 0 0 6px; }
.rte-view { padding: 2px 0; }

/* grids */
table.grid { border-collapse: collapse; width: 100%; background: #fff; margin: 4px 0 8px; }
.grid th { text-align: left; background: #eef1f5; font-weight: 600; font-size: 12px; padding: 5px 6px; border: 1px solid var(--line); position: sticky; top: 0; }
.grid td { border: 1px solid var(--line2); padding: 3px 6px; vertical-align: top; }
.grid td.c, .grid th.c { text-align: center; } .grid td.mono { white-space: nowrap; } .grid td.num { color: var(--accent); white-space: nowrap; } .grid td.wide { min-width: 280px; width: 45%; }
.grid tr.dirty td:first-child { box-shadow: inset 3px 0 0 var(--dirty); }
.grid tr.deleted td { text-decoration: line-through; opacity: .55; }
.grid tr.removed td { background: #fdf3f2; }
.items textarea { min-height: 26px; border-color: transparent; background: transparent; padding: 2px 4px; }
.items textarea:hover { border-color: var(--line); } .items select { max-width: 130px; }
.items input[type=text] { width: 100%; border-color: transparent; } .items input[type=text]:hover { border-color: var(--line); }
.tick input { transform: scale(1.25); }
.row-acts { display: inline-flex; gap: 2px; white-space: nowrap; }
.struct { margin-top: 6px; } .struct-acts { display: flex; gap: 6px; margin: 4px 0; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 3px; } .chip { background: var(--accent-2); color: var(--accent); border-radius: 9px; padding: 0 6px; font-family: var(--mono); font-size: 11px; }
.prio { padding: 0 6px; border-radius: 9px; font-weight: 600; font-size: 11px; }
.prio-High { background: #fdecea; color: var(--danger); } .prio-Medium { background: #fff1d6; color: #8a5a00; } .prio-Low { background: #e5f4e9; color: var(--ok); }
.yes { color: var(--danger); font-weight: 600; } .no { color: var(--muted); }
.risk td { min-width: 70px; }
.rtm-st { font-weight: 600; } .rtm-st.verified { color: var(--ok); } .rtm-st.gap, .rtm-st.failed { color: var(--danger); } .rtm-st.supplier { color: #1b5fa8; }
.script-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin: 6px 0; background: #fbfcfd; }
.script-card.dirty { border-left: 3px solid var(--dirty); } .script-card.deleted { opacity: .5; }
.script-head { display: flex; gap: 6px; align-items: center; } .script-head input { flex: 1; } .spacer { flex: 1; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; margin-top: 6px; }
.kv .field { margin-bottom: 6px; }
.pick-list { max-height: 50vh; overflow: auto; border: 1px solid var(--line2); border-radius: 4px; padding: 4px; margin: 6px 0; }
.pick { display: block; padding: 3px 4px; border-radius: 3px; cursor: pointer; } .pick:hover { background: #f1f4f7; } .pick.hl { background: #fff8e8; }
.kvt td:first-child { font-weight: 600; width: 55%; } .kvt thead { display: none; }

/* dashboard */
.dash { padding: 14px 18px 40px; }
.dash-head { display: flex; justify-content: space-between; gap: 16px; border-top: 3px solid var(--pc); background: #fff; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); border-top-width: 3px; border-top-color: var(--pc); flex-wrap: wrap; }
.dash-head h2 { margin: 2px 0 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 12px 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.card h4 { margin: 0 0 8px; }
.pbar { position: relative; height: 14px; background: #e9edf1; border-radius: 7px; overflow: hidden; min-width: 90px; }
.pbar-fill { height: 100%; background: linear-gradient(90deg, #4f84b8, #2f5d8a); }
.pbar span { position: absolute; inset: 0; font-size: 10px; text-align: center; line-height: 14px; color: #1f2933; }
.phases { margin-top: 10px; display: grid; gap: 4px; } .phase { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 8px; font-size: 12px; }

/* admin */
.admin { display: flex; min-height: 100%; }
.admin-nav { width: 210px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 10px 6px; }
.admin-nav button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 7px 10px; border-radius: 4px; cursor: pointer; }
.admin-nav button:hover { background: #eef2f6; } .admin-nav button.active { background: var(--accent-2); color: var(--accent); font-weight: 600; }
.admin-body { flex: 1; padding: 14px 18px 40px; min-width: 0; }
.admin-head { display: flex; align-items: center; gap: 8px; } .admin-head h3 { margin: 0 auto 0 0; }
.ustat { padding: 0 6px; border-radius: 9px; font-size: 11px; } .ustat-active { background: #e5f4e9; color: var(--ok); } .ustat-locked { background: #fff1d6; color: #8a5a00; } .ustat-removed { background: #eceff2; color: #75818d; }
.lvl { font-size: 11px; font-weight: 600; } .lvl-ERROR { color: var(--danger); } .lvl-WARNING { color: var(--warn); }
.audit td { font-size: 12px; } .changes { font-size: 11px; max-width: 520px; overflow-wrap: anywhere; } .changes .old { color: #a33; } .changes .new { color: #2a6b2a; }
.matrix td:first-child { min-width: 280px; }
.irr { margin: 6px 0; }
.tpl-list li.opt { color: var(--muted); } .tpl-list small { color: var(--muted); }
.lib-add { margin-top: 10px; padding: 10px; background: #f7f9fb; border: 1px solid var(--line2); border-radius: var(--radius); }
textarea.code { font-family: var(--mono); font-size: 12px; }
.about { padding: 18px; } .md-view pre.md { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); padding: 14px; border-radius: var(--radius); font-size: 12px; max-width: 1100px; }
.welcome { padding: 30px 40px; max-width: 760px; } .welcome h2 { margin-top: 0; }

/* diff */
.diff del { background: #fde2e1; color: #8c1d18; } .diff ins { background: #dcf3e0; color: #1d5e2b; text-decoration: none; }
.diff-sec, .diff-item { border-left: 3px solid var(--line); padding: 4px 10px; margin: 6px 0; }
.diff-added { border-color: #3fa65c; } .diff-removed { border-color: #d0453c; } .diff-modified { border-color: #d9a400; }
.diff-text { white-space: pre-wrap; font-size: 12px; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(20,30,40,.35); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 6vh 16px; overflow: auto; }
.modal { background: #fff; border-radius: 8px; width: 520px; max-width: 100%; box-shadow: 0 12px 40px rgba(0,0,0,.25); display: flex; flex-direction: column; max-height: 88vh; }
.modal-wide { width: 1000px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line2); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 14px 16px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line2); }
.sign-meaning { background: #f1f6fb; padding: 8px 10px; border-radius: var(--radius); }
.pdf-frame { width: 100%; height: 72vh; border: 1px solid var(--line); }
.notif { padding: 6px 0; border-bottom: 1px solid var(--line2); display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; } .notif.read { opacity: .65; }
.notif small { color: var(--muted); }
.form-grid .field { margin-bottom: 8px; }

/* toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 200; max-width: 460px; }
.toast { background: #24384d; color: #fff; padding: 9px 14px; border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.toast-ok { background: #1f6b37; } .toast-error { background: #a3241c; } .toast-warn { background: #8a5a00; }

@media print {
  .topbar, .side, .tabs, .actions, .rte-bar, .splitter, .comments button { display: none !important; }
  .app { height: auto; overflow: visible; } .main { overflow: visible; }
}

/* ------------------------------------------------------------------ Harbinger Helium (2.0) */
.el-tile { display: inline-grid; grid-template-rows: auto 1fr; width: 26px; height: 26px; border: 1.5px solid currentColor; border-radius: 3px;
  padding: 1px 2px; line-height: 1; font-family: var(--sans, inherit); color: #2a8c8c; background: #effafa; flex: none; }
.el-tile .el-z { font-size: 8px; font-weight: 600; } .el-tile .el-sym { font-size: 13px; font-weight: 700; text-align: center; }
.el-tile.big { width: 54px; height: 54px; border-width: 2px; } .el-tile.big .el-z { font-size: 13px; } .el-tile.big .el-sym { font-size: 26px; }
.topbar .el-tile { color: #bff0ef; background: transparent; border-color: #bff0ef; }
.welcome-brand { display: flex; gap: 14px; align-items: center; }
.rte-area { tab-size: 4; white-space: pre-wrap; }
.rte-area figure, .rte-view figure { margin: 8px auto; padding: 6px; border: 1px dashed #c6ced6; border-radius: 4px; text-align: center; cursor: default; }
.rte-area figure { cursor: pointer; } .rte-area figure:hover { border-color: var(--accent); }
figure[data-align="left"] { margin-left: 0 !important; } figure[data-align="right"] { margin-right: 0 !important; }
.rte-area figure img, .rte-view figure img { max-width: 100%; }
.rte-area img, .rte-view img { max-width: 100%; height: auto; }
figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
figcaption::before { content: "Figure: "; font-weight: 600; }
figure[data-label]::after { content: attr(data-label); display: block; font: 10px var(--mono); color: #8b98a5; }
.rte-area caption, .rte-view caption { caption-side: top; font-size: 12px; color: var(--muted); text-align: left; padding: 2px 0; }
.rte-area caption::before, .rte-view caption::before { content: "Table: "; font-weight: 600; }
table[data-label]::after { content: attr(data-label); }
span[data-ref] { background: #eef6ee; color: #1f6b33; border-radius: 3px; padding: 0 3px; font-size: 0.95em; white-space: nowrap; }
.rte-menu .menu-pop { min-width: 260px; max-height: 320px; overflow: auto; }
.menu-pop.chars { display: none; grid-template-columns: repeat(10, 1fr); min-width: 300px; padding: 4px; }
.menu.open .menu-pop.chars { display: grid; }
.menu-pop.chars button { text-align: center; font-size: 15px; padding: 4px 0; }
.menu-pop { z-index: 400; max-width: calc(100vw - 16px); overflow: auto; }
.purpose { display: none; margin: 0 0 6px; padding: 6px 8px; background: #f6f7f9; border-left: 3px solid #c3ccd5; color: #6b7785; font-size: 12px; }
.sec.show-purpose > .sec-wrap .purpose { display: block; }
.purpose-btn { color: #8b98a5; }
.co-badge { display: inline-flex; gap: 4px; align-items: center; margin-left: auto; }
.co-badge + .purpose-btn { margin-left: 4px; }
.tag-mine { background: #e7f3ea; color: #1f6b33; } .tag-held { background: #fdf0e1; color: #8a4b00; } .tag-round { background: #eef0fb; color: #3a46a0; }
.tag .ico { width: 10px; height: 10px; vertical-align: -1px; }
.btn-tiny { font-size: 11px; padding: 0 5px; border: 1px solid var(--line2, #d5dbe1); border-radius: 3px; background: #fff; cursor: pointer; color: var(--text); }
.btn-tiny:hover { background: var(--accent-2); }
.sec.in-round > .sec-head { background: #f5f6fd; }
.sec-wrap.bisect > .sec-body { flex: 1 1 50%; min-width: 0; background: #fafbfc; border: 1px solid #e3e7ec; border-radius: 4px; padding: 6px; }
.comment-box { flex: 1 1 45%; display: flex; flex-direction: column; gap: 6px; border-left: 3px solid #8f9be0; padding-left: 10px; }
.comment-box textarea { width: 100%; }
.ccard-tools { display: flex; gap: 4px; margin-top: 4px; }
.dirty-text { color: var(--warn); }
.st-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; max-height: 240px; overflow: auto; margin-top: 6px; }
.st-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 6px 8px; border: 1px solid #d5dbe1;
  border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; }
.st-item b { color: var(--accent); font-size: 13px; } .st-item small { color: #8b98a5; font-size: 10px; }
.st-item:hover { border-color: var(--accent); } .st-item.active { border-color: var(--accent); background: var(--accent-2); box-shadow: 0 0 0 1px var(--accent) inset; }
.tnode.ptool { color: #52606d; font-size: 12px; } .tnode.ptool .ico { color: #8b98a5; }
.popout { display: flex; flex-direction: column; gap: 6px; min-height: 60vh; }
.pop-grid { flex: 1; overflow: auto; max-height: 62vh; border: 1px solid #e3e7ec; border-radius: 4px; padding: 4px; }
.grid.sheet input, .grid.sheet textarea { width: 100%; border: 1px solid transparent; background: transparent; }
.grid.sheet input:focus, .grid.sheet textarea:focus { border-color: #9cc0e5; background: #fff; }
.sheet-tabs { display: flex; gap: 2px; border-top: 2px solid #c9d1d9; padding-top: 0; overflow-x: auto; }
.sheet-tab { border: 1px solid #c9d1d9; border-top: none; border-radius: 0 0 5px 5px; padding: 3px 12px; background: #eef1f4; cursor: pointer; font-size: 12px; }
.sheet-tab.active { background: #fff; font-weight: 600; color: var(--accent); margin-top: -2px; border-top: 2px solid #fff; }
.sheet-tab.add { font-weight: 700; }
.matrix-wrap { overflow: auto; max-height: 64vh; border: 1px solid #d5dbe1; border-radius: 4px; }
table.matrix { border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.matrix th, table.matrix td { border-right: 1px solid #e3e7ec; border-bottom: 1px solid #e3e7ec; padding: 3px 6px; background: #fff; }
table.matrix thead th { position: sticky; top: 0; z-index: 2; background: #eef1f5; vertical-align: bottom; }
table.matrix thead th.role { min-width: 64px; text-align: center; }
table.matrix th.corner { position: sticky; left: 0; z-index: 3; text-align: left; }
table.matrix th.perm { position: sticky; left: 0; z-index: 1; text-align: left; font-weight: 500; background: #f9fafb; min-width: 200px; }
table.matrix tr.grp th { background: #e7eff7; color: var(--accent); text-align: left; position: sticky; left: 0; }
table.matrix td.cell { text-align: center; min-width: 56px; user-select: none; }
table.matrix td.click { cursor: pointer; } table.matrix td.click:hover { outline: 2px solid #9cc0e5; outline-offset: -2px; }
table.matrix td.st-on { background: #e5f3e8; color: #1f6b33; font-weight: 700; }
table.matrix td.st-na { background: #eceff2; color: #9aa5b1; font-style: italic; }
.lib-local { margin-top: 8px; }
.paste-area { min-height: 70px; border: 2px dashed #b9c2cc; border-radius: 4px; padding: 10px; color: #52606d; }
.paste-area:empty::before { content: attr(data-placeholder); color: #a0aab4; }
.view.reloading { opacity: 0.6; transition: opacity .2s; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media print { .purpose, .co-badge, .purpose-btn, .comment-box { display: none !important; } }
.sign table.grid { width: 100%; table-layout: fixed; } .sign table.grid input { width: 100%; box-sizing: border-box; }
.sign table.grid th:last-child, .sign table.grid td:last-child { width: 36px; }
