.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: var(--side-bg); border-top: 5px solid var(--scarlet); color: var(--side-ink); padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.sidebar .brand { color: var(--side-ink-strong); border-left: 4px solid var(--scarlet); margin-left: 6px; padding-left: 8px !important; padding: 4px 10px 2px; font-size: 18px; }
.sidebar .sub { color: var(--side-ink-2); font-size: 12px; padding: 0 10px 14px; }
.sidebar .grp { color: var(--side-ink-2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; padding: 14px 10px 4px; }
.sidebar a { color: var(--side-ink); text-decoration: none; padding: 6px 10px; border-radius: 6px; display: flex; align-items: center; gap: 8px; }
.sidebar a:hover { background: var(--side-hover); }
.sidebar a.active { background: var(--scarlet); color: var(--on-dark); font-weight: 600; }
.sidebar a .count { margin-left: auto; background: var(--on-dark); color: #ba0c2f !important; border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.sidebar .me { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--side-line); font-size: 13px; }
.main { min-width: 0; }
.main-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 18px 20px 0; min-height: 50px; }
.admin-toolbar { justify-content: flex-start; padding-top: 12px; }
.main-head h1 { font-family: var(--serif); font-size: 24px; margin-right: 8px; color: var(--grey-dark); }
.ws-table td input[type=text] { width: 100%; }
.proj { margin-bottom: 16px; }
.proj-head { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.proj-head h3 { font-size: 17px; }
.sub-row td { background: var(--surface-3); }
.approval { padding: 14px 16px; display: grid; gap: 8px; }
.approval + .approval { border-top: 1px solid var(--line); }
.diff { font-size: 12px; color: var(--ink-2); margin-top: 4px; display: grid; gap: 2px; }
.diff del { color: var(--diff-del); }
.diff ins { color: var(--diff-add); text-decoration: none; }
.menu-toggle { display: none; }
pre.csv { background: var(--surface-2); padding: 10px; border-radius: 6px; overflow: auto; font-size: 12px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 240px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .menu-toggle { display: inline-flex; }
}

/* ================= LRS Portal additions ================= */
.sidebar .brand { text-decoration: none; display: block; }
.sidebar a .ico { width: 18px; text-align: center; opacity: .8; }
.sidebar .me a { padding: 6px 0; }
.login-logo { height: 44px; align-self: flex-start; }
.login-links { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-top: 4px; }
.login .multi { max-height: 140px; overflow: auto; }
.main-head { padding: 18px 20px 6px; }
.main-head > div > h1 { font-family: var(--serif); font-size: 24px; color: var(--grey-dark); }
.page { padding: 12px 20px 40px; }
.page > * + * { margin-top: 14px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--grey-dark); margin: 4px 0 8px; }
.card.pad { padding: 16px; }
.empty { padding: 24px; text-align: center; color: var(--ink-3); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.stack > * + * { margin-top: 8px; }
.grow { flex: 1; min-width: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 8px 12px; border-bottom: 3px solid transparent; cursor: pointer; color: var(--ink-2); }
.tabs button.active { border-bottom-color: var(--scarlet); color: var(--ink); font-weight: 600; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.crumbs .sep { color: var(--ink-3); }
.files-top input[type=search] { min-width: 260px; }
.fname { display: inline-flex; gap: 8px; align-items: center; }
.fname a { color: var(--ink); text-decoration: none; font-weight: 500; }
.fname a:hover { text-decoration: underline; }
td.acts { white-space: nowrap; text-align: right; }
.dropzone { position: relative; }
.dropzone.over { outline: 3px dashed var(--scarlet); outline-offset: -3px; background: var(--scarlet-tint); }
.drophint { text-align: center; padding: 8px; border-top: 1px dashed var(--line); }
tr.inactive td { opacity: .55; }
.acl-row { display: grid; grid-template-columns: 110px 1fr 110px auto; gap: 6px; margin-bottom: 6px; }
.secret { background: var(--surface-2); padding: 10px; border-radius: 6px; font-size: 15px; user-select: all; white-space: pre-wrap; word-break: break-all; }
pre.log { background: var(--surface-2); padding: 8px; border-radius: 6px; font-size: 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; margin: 0; }
pre.log:empty { display: none; }
.thumb { max-width: 220px; max-height: 120px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.thumb.sm { max-width: 80px; max-height: 40px; }
.pdfview { width: 100%; height: 70vh; border: 1px solid var(--line); margin-top: 10px; }
.busy { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--side-bg); color: var(--on-dark); padding: 10px 16px; border-radius: 8px; z-index: 200; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stats .stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }

/* ---------- review ---------- */
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.review-side { position: sticky; top: 12px; display: grid; gap: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.comment { border-left: 3px solid var(--line-2); padding: 4px 8px; margin-bottom: 8px; }
.diffsum > div { margin: 4px 0; }
.diffsum a { color: var(--blue); }
.legend { display: flex; gap: 12px; margin-bottom: 8px; }
.lg { padding-left: 8px; border-left: 4px solid; }
.lg.added { border-color: var(--diff-add); }
.lg.changed { border-color: var(--amber); }
.removed-list { background: var(--red-tint); border-left: 4px solid var(--diff-del); padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }

/* ---------- document preview (looks like the Word output) ---------- */
.preview-wrap { background: var(--paper-desk); padding: 16px; border-radius: var(--radius); overflow: auto; }
.docpreview { display: grid; gap: 16px; justify-items: center; }
.docpage { background: var(--paper); width: 100%; max-width: 816px; min-height: 400px; padding: 28px 52px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.15); font: 13.3px/1.4 Arial, Helvetica, sans-serif; color: #1f1f1f; display: flex; flex-direction: column; }
.docpreview.is-draft .docpage { background-image: repeating-linear-gradient(-30deg, transparent 0 140px, rgba(186,12,47,.035) 140px 190px); }
.docsheet { flex: 1; }
.dochead { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #ba0c2f; padding-bottom: 6px; margin-bottom: 12px; }
.dochead img { height: 34px; }
.docfoot { display: flex; justify-content: space-between; border-top: 1px solid #bfbfbf; margin-top: 16px; padding-top: 4px; font-size: 10.6px; color: #666; }
.doc-title { color: #ba0c2f; font-weight: 700; font-size: 26px; margin-top: 6px; }
.doc-subtitle { color: #666; font-size: 14.6px; margin-bottom: 12px; }
.dh { font-weight: 700; margin: 16px 0 6px; display: flex; gap: 10px; }
.dh .num { min-width: 34px; }
.dh1 { color: #ba0c2f; font-size: 18.6px; }
.dh2 { color: #666; font-size: 14.6px; }
.dh3 { color: #1f1f1f; font-size: 13.3px; }
.section-title.dh { display: block; }
.docpage p { margin: 0 0 8px; }
.docpage .ph { color: #8c8c8c; font-style: italic; }
.docpage .label { margin: 10px 0 4px; }
.docpage .checks span { margin-right: 26px; }
table.dt { width: 100%; border-collapse: collapse; margin: 4px 0 10px; font-size: 12px; table-layout: fixed; }
table.dt th { background: #ba0c2f; color: #fff; text-align: left; padding: 4px 6px; border: 1px solid #bfbfbf; font-weight: 700; }
table.dt td { border: 1px solid #bfbfbf; padding: 4px 6px; vertical-align: middle; word-wrap: break-word; }
table.dt td.lbl { background: #f2f2f2; }
table.dt td.c { text-align: center; }
table.dt tr.write td { height: 48px; }
.notice { background: #f2f2f2; border: 1px solid #bfbfbf; border-left: 5px solid #666; padding: 6px 10px; margin: 6px 0 8px; }
.notice.warning { border-left-color: #ba0c2f; } .notice.warning > strong { color: #ba0c2f; }
.notice.caution { border-left-color: #1f1f1f; }
.notice.note > strong { color: #666; }
.figbox { border: 1px solid #bfbfbf; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; }
.figimg { text-align: center; } .figimg img { max-width: 100%; }
.caption { text-align: center; color: #666; font-size: 12px; margin: 4px 0 10px; }
.caption.above { margin: 10px 0 4px; }
.toc > div { display: flex; gap: 10px; padding: 1px 0; }
.toc .toc1 { font-weight: 700; margin-top: 4px; }
.toc .toc2 { padding-left: 24px; } .toc .toc3 { padding-left: 48px; }
.toc .num { min-width: 40px; }
.docsec { border-left: 4px solid transparent; margin-left: -12px; padding-left: 8px; }
.docsec.mark-added { border-left-color: var(--green); background: rgba(22,163,74,.05); }
.docsec.mark-changed { border-left-color: var(--amber); background: rgba(217,119,6,.06); }

/* ---------- slides preview ---------- */
.deckpreview { display: grid; gap: 14px; justify-items: center; }
.slide { position: relative; width: 100%; max-width: 760px; aspect-ratio: 16 / 9; background: var(--paper); box-shadow: 0 1px 4px rgba(0,0,0,.15); padding: 9% 3.5% 6%; font: 13px/1.35 Arial, sans-serif; color: #1f1f1f; overflow: hidden; }
.slide .shead { position: absolute; top: 2.5%; left: 2.6%; right: 2.6%; display: flex; justify-content: space-between; border-bottom: 2px solid #ba0c2f; padding-bottom: 1%; }
.slide .shead img { height: 26px; }
.slide .sfoot { position: absolute; bottom: 1.5%; left: 2.6%; right: 2.6%; border-top: 1px solid #bfbfbf; display: flex; justify-content: space-between; font-size: 9px; color: #666; padding-top: 2px; }
.slide .stitle { color: #ba0c2f; font-weight: 700; font-size: 20px; margin: 1% 0 2%; }
.slide .sbody { font-size: 13px; }
.slide ul { margin: 0; padding-left: 20px; } .slide li { margin: 3px 0; } .slide li.sub { margin-left: 22px; font-size: 12px; }
.slide table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.slide th { background: #ba0c2f; color: #fff; text-align: left; padding: 3px 5px; } .slide td { border: 1px solid #bfbfbf; padding: 3px 5px; }
.slide.title .tblock { position: absolute; top: 32%; left: 6%; right: 6%; }
.slide .big { color: #ba0c2f; font-size: 30px; font-weight: 700; }
.slide .sub { color: #666; font-size: 16px; margin: 4px 0 14px; }
.slide .meta { font-size: 12px; }
.slide.section .tblock { position: absolute; top: 35%; left: 0; right: 0; background: #ba0c2f; padding: 3% 6%; }
.slide.section .big, .slide.section .sub { color: #fff; }
.slide .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; } .slide h4 { margin: 0 0 4px; color: #666; }
.slide .imgrow { display: flex; gap: 14px; } .slide figure { margin: 0; flex: 1; text-align: center; } .slide figure img { max-width: 100%; max-height: 220px; }
.slide figcaption { color: #666; font-style: italic; font-size: 11px; } .slide .imgph { background: #f2f2f2; border: 1px solid #bfbfbf; height: 200px; display: flex; align-items: center; justify-content: center; color: #8c8c8c; }
.slide .risk { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: start; }
.slide .rgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; } .slide .rgrid div { aspect-ratio: 1; color: #fff; font-weight: 700; font-size: 10px; display: flex; align-items: center; justify-content: center; }

/* ---------- editor ---------- */
.ed-top { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.ed-title { min-width: 260px; flex: 1; }
.title-input { font: 600 18px var(--serif); border: 1px solid transparent !important; padding: 2px 4px !important; width: 100%; background: transparent; }
.title-input:hover, .title-input:focus { border-color: var(--line) !important; background: var(--surface); }
.ed-body { display: grid; grid-template-columns: 240px minmax(360px, 1fr) minmax(360px, 1fr); height: calc(100vh - 66px); }
.ed-body.no-preview { grid-template-columns: 240px 1fr 0; } .ed-body.no-preview .ed-preview { display: none; }
.ed-tree { border-right: 1px solid var(--line); overflow: auto; padding: 10px 6px; background: var(--surface); }
.ed-panel { overflow: auto; padding: 14px 16px 60px; }
.ed-preview { overflow: auto; background: var(--paper-desk); padding: 14px; border-left: 1px solid var(--line); }
.tree-head { padding: 10px 8px 4px; text-transform: uppercase; letter-spacing: .05em; }
.tnode { display: flex; gap: 6px; align-items: center; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.tnode:hover { background: var(--surface-2); }
.tnode.sel { background: var(--scarlet-tint); color: var(--scarlet-ink); font-weight: 600; }
.tnode .num { color: var(--ink-3); min-width: 24px; font-variant-numeric: tabular-nums; }
.tnode .tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tnode .tacts { display: none; } .tnode:hover .tacts, .tnode.sel .tacts { display: inline-flex; }
.tnode .tacts .btn { padding: 0 5px; min-height: 0; }
.ed-tree > .btn, .ed-tree > select { margin: 8px; }
.ed-panel label.field { margin-bottom: 8px; }
fieldset.el { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 12px; margin: 12px 0; background: var(--surface); }
fieldset.el legend { font-weight: 600; font-size: 13px; padding: 0 6px; display: flex; gap: 6px; align-items: center; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; background: var(--surface-2); border-radius: var(--radius); margin: 10px 0; }
.nrow { align-items: flex-start; margin-bottom: 6px; }
.steps-ed td { vertical-align: top; } .steps-ed textarea { width: 100%; min-width: 220px; }
.cols-ed { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 8px; }
.cols-ed .colhead { display: grid; gap: 4px; min-width: 120px; flex: 1; }
.grid-ed td input { width: 100%; min-width: 80px; }
.grid-ed td { padding: 2px; }
.save-status { min-width: 100px; text-align: right; }
.tabs.wrap { margin-bottom: 4px; }

@media (max-width: 1100px) {
  .ed-body { grid-template-columns: 200px 1fr; height: auto; }
  .ed-preview { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .review-layout { grid-template-columns: 1fr; }
  .review-side { position: static; max-height: none; }
}
@media (max-width: 700px) {
  .ed-body { grid-template-columns: 1fr; }
  .ed-tree { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; }
  .docpage { padding: 16px 14px; }
  .acl-row { grid-template-columns: 1fr 1fr; }
  .files-top input[type=search] { min-width: 0; width: 100%; }
  table.data { display: block; overflow-x: auto; }
}
.align-group { display: inline-flex; gap: 2px; }
.align-group .btn { min-width: 30px; padding: 0 6px; }
.align-group .btn.on { background: var(--scarlet-tint); border-color: var(--scarlet); color: var(--scarlet-ink); }
.para-row { align-items: flex-start; margin-bottom: 8px; }
/* ---------- tracker tab ---------- */
.main.framed { display: flex; flex-direction: column; height: calc(100vh - var(--banner-h, 0px)); }
.frame-head { display: flex; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.frame-head h1 { font-family: var(--serif); font-size: 20px; color: var(--grey-dark); }
.tracker-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }
.back-btn { white-space: nowrap; }
/* ---------- icons ---------- */
.icon { display: inline-flex; align-items: center; justify-content: center; line-height: 0; flex-shrink: 0; }
.icon svg { display: block; }
.btn .icon + * , .btn .icon { vertical-align: middle; }
.btn { gap: 5px; }
.sidebar a .ico { width: 18px; display: inline-flex; justify-content: center; opacity: .85; }
.fname .ico { color: var(--grey-dark); display: inline-flex; }
.palette .btn { display: inline-flex; align-items: center; gap: 5px; }
.tnode .icon { color: var(--ink-3); }
/* Wide tables scroll inside their card instead of widening the page */
.page .card { overflow-x: auto; }
.main { overflow-x: hidden; }
.main-head { flex-wrap: wrap; }
td.acts .row { flex-wrap: nowrap; gap: 2px; }
/* ---------- visibility ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.mode { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px; display: grid; gap: 4px; cursor: pointer; background: var(--surface); }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode.on { border-color: var(--scarlet); background: var(--scarlet-tint); }
.mode:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 1px; }
.mode-title { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.acl-row { grid-template-columns: 100px 1fr 190px auto; align-items: center; }
.acl-row select.lvl-deny { color: var(--red); }
.acl-row select.lvl-list { color: var(--amber); }
.badge .icon { margin-right: 3px; }
.badge { display: inline-flex; align-items: center; }
tr.locked-row td { color: var(--ink-3); cursor: not-allowed; }
/* ---------- people & teams ---------- */
.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.team-card { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font: inherit; }
.team-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.team-card .dot, .chip .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.team-card .tname { font-weight: 600; }
.team-card .muted { grid-column: 2; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); border-radius: 999px; padding: 1px 8px; font-size: 12px; white-space: nowrap; }
.team-card .tdesc, .team-card .tpeople { grid-column: 1 / -1; color: var(--ink-2); }
.team-card .tpeople { color: var(--ink-3); }
.team-cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.chip.lead { background: var(--scarlet-tint); color: var(--scarlet-ink); }

/* ---------- leadership whiteboard ---------- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.board-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; }
.board-card.archived { opacity: .7; }
.board-open { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.board-open span:last-child { display: grid; gap: 2px; }
.board-thumb { width: 56px; height: 44px; border-radius: 6px; background: repeating-linear-gradient(0deg, transparent 0 7px, var(--line) 7px 8px), repeating-linear-gradient(90deg, transparent 0 7px, var(--line) 7px 8px), var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--scarlet); }
.archived-boards summary { cursor: pointer; color: var(--ink-2); margin: 10px 0; }
.wb-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.wb-title { font: 600 16px var(--serif); border: 1px solid transparent !important; background: transparent; padding: 3px 6px !important; min-width: 160px; max-width: 280px; }
.wb-title:hover, .wb-title:focus { border-color: var(--line) !important; background: var(--surface); }
.wb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.wb-swatches { display: flex; gap: 3px; }
.wb-swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid; padding: 0; cursor: pointer; }
.wb-swatch:hover { transform: scale(1.15); }
.wb-zoom { min-width: 40px; text-align: center; }
.wb-status { min-width: 120px; text-align: right; }
.wb-help { padding: 4px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.wb-viewport { position: relative; flex: 1; overflow: hidden; background-color: var(--canvas); background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1px); touch-action: none; outline: none; cursor: grab; user-select: none; }
.wb-viewport:active { cursor: grabbing; }
.wb-viewport.tool-arrow, .wb-viewport.tool-arrow .wb-item { cursor: crosshair; }
.wb-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.wb-layer { position: absolute; left: 0; top: 0; }
.wb-arrows { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.wb-arrow .line { fill: none; stroke-width: 2.2; }
.wb-arrow .hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; pointer-events: stroke; }
.wb-arrow.selected .line { stroke-width: 3.5; filter: drop-shadow(0 0 3px rgba(37, 99, 235, .6)); }
.wb-arrow text { font: 600 12px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--canvas); stroke-width: 4px; pointer-events: none; }
.wb-temp { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 6 4; }
.wb-item { position: absolute; border: 1.5px solid; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.12); cursor: move; }
.wb-item.selected { outline: 2px solid var(--blue); outline-offset: 2px; }
.wb-item.arrow-from { outline: 2px dashed var(--blue); outline-offset: 3px; }
.wb-note { padding: 10px 12px 18px; }
.wb-note .wb-text, .wb-text-item .wb-text { white-space: pre-wrap; word-wrap: break-word; height: 100%; overflow: auto; outline: none; font-size: 14px; line-height: 1.4; }
.wb-text.empty { color: var(--ink-3); font-style: italic; }
.wb-text[contenteditable="true"], .wb-text[contenteditable="plaintext-only"] { cursor: text; user-select: text; }
.wb-by { position: absolute; right: 8px; bottom: 3px; font-size: 10px; color: rgba(0,0,0,.45); }
.wb-text { box-shadow: none; }
.wb-item.wb-text { border-color: transparent !important; box-shadow: none; padding: 4px 6px; }
.wb-item.wb-text .wb-text { font-weight: 600; color: var(--grey-darker); white-space: pre-wrap; outline: none; height: 100%; overflow: hidden; }
.wb-item.wb-text.selected { border-color: var(--line-2) !important; }
.wb-frame { border-style: dashed; border-width: 2px; box-shadow: none; border-radius: 10px; }
.wb-frame-title { position: absolute; left: 10px; top: 6px; font: 700 14px var(--sans); background: transparent; border: 0 !important; padding: 2px 4px !important; width: calc(100% - 30px); text-transform: uppercase; letter-spacing: .04em; }
.wb-checklist { padding: 8px 10px; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); }
.wb-check-head { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 5px; margin-bottom: 4px; }
.wb-check-title { flex: 1; font-weight: 700; border: 0 !important; background: transparent; padding: 2px !important; min-width: 0; }
.wb-check-count { font-size: 11px; color: var(--ink-3); background: var(--surface-2); border-radius: 999px; padding: 0 7px; }
.wb-check-list { overflow: auto; flex: 1; }
.wb-check-row { display: flex; align-items: center; gap: 6px; }
.wb-check-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--scarlet); flex-shrink: 0; }
.wb-check-text { flex: 1; min-width: 0; border: 0 !important; background: transparent; padding: 3px 2px !important; font-size: 13px; }
.wb-check-row.done .wb-check-text { text-decoration: line-through; color: var(--ink-3); }
.wb-x { border: 0; background: transparent; color: var(--ink-3); opacity: 0; cursor: pointer; padding: 2px; }
.wb-check-row:hover .wb-x, .wb-x:focus { opacity: 1; }
.wb-add-row { border: 0; background: transparent; color: var(--ink-2); font-size: 12px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; padding: 3px 0; align-self: flex-start; }
.wb-resize { position: absolute; right: -5px; bottom: -5px; width: 12px; height: 12px; background: var(--surface); border: 1.5px solid var(--blue); border-radius: 3px; cursor: nwse-resize; display: none; }
.wb-dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--blue); cursor: crosshair; display: none; }
.wb-dot-n { top: -7px; left: calc(50% - 6px); } .wb-dot-s { bottom: -7px; left: calc(50% - 6px); }
.wb-dot-e { right: -7px; top: calc(50% - 6px); } .wb-dot-w { left: -7px; top: calc(50% - 6px); }
.wb-item.selected .wb-resize, .wb-item.selected .wb-dot, .wb-item:hover .wb-dot { display: block; }
.wb-marquee { position: absolute; border: 1.5px dashed var(--blue); background: rgba(37, 99, 235, .08); pointer-events: none; }
@media (max-width: 900px) { .wb-btn-label { display: none; } .wb-help { display: none; } }

/* ---------- P&ID editor ---------- */
.pid-body { display: grid; grid-template-columns: 250px minmax(0, 1fr) 270px; flex: 1; min-height: 0; }
.pid-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pid-tools { display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.pid-stage { position: relative; flex: 1; overflow: hidden; background: var(--paper); touch-action: none; outline: none; cursor: grab; user-select: none; }
.pid-stage.grid { background-image: linear-gradient(#eef0f2 1px, transparent 1px), linear-gradient(90deg, #eef0f2 1px, transparent 1px); }
.pid-stage:active { cursor: grabbing; }
.pid-canvas { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pid-node { cursor: move; }
.pid-edge .hit { cursor: pointer; pointer-events: stroke; }
.pid-node .hit { pointer-events: all; }
.pid-label { cursor: grab; }
.pid-port { fill: #fff; stroke: #2563eb; stroke-width: 2; cursor: crosshair; }
.pid-port:hover { fill: #2563eb; }
.pid-temp { fill: none; stroke: #2563eb; stroke-width: 2; stroke-dasharray: 6 4; pointer-events: none; }
.pid-guide { stroke: #ba0c2f; stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; pointer-events: none; vector-effect: non-scaling-stroke; }
.pid-marquee { fill: rgba(37, 99, 235, .08); stroke: #2563eb; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.pid-palette { border-right: 1px solid var(--line); overflow: auto; padding: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.pid-palette details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.pid-palette summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 4px 2px; }
.pid-sym-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px 0; }
.pid-sym { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); padding: 4px 2px; cursor: grab; font: inherit; }
.pid-sym:hover { border-color: var(--blue); }
.pid-sym-img { width: 44px; height: 44px; display: block; }
.pid-sym-img svg { width: 100%; height: 100%; }
.pid-sym-name { font-size: 9.5px; line-height: 1.15; text-align: center; color: var(--ink-2); max-height: 2.3em; overflow: hidden; }
.pid-legend { display: flex; align-items: center; gap: 6px; }
.pid-inspector { border-left: 1px solid var(--line); overflow: auto; padding: 12px; background: var(--surface); }
.pid-inspector .field { margin-bottom: 8px; }
.pid-inspector .row { margin: 6px 0; }
.pid-help { padding-left: 16px; }
.pid-colors { display: flex; gap: 4px; flex-wrap: wrap; }
.pid-color { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.pid-color.on { box-shadow: 0 0 0 2px var(--blue); }
.pid-preview { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; overflow: auto; }
.pid-preview svg { width: 100%; height: auto; max-height: 80vh; }
@media (max-width: 1100px) { .pid-body { grid-template-columns: 200px minmax(0, 1fr); } .pid-inspector { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); max-height: 260px; } }
.pid-stage.tool-area, .pid-stage.tool-area .pid-node { cursor: crosshair; }
.pid-resize { cursor: nwse-resize; }
.pid-colors input[type=color] { width: 26px; height: 24px; padding: 0; border: 1px solid var(--line-2); border-radius: 4px; background: none; }
.legend-row input { flex: 1; min-width: 0; }
.legend-swatch { width: 26px; height: 6px; border-radius: 3px; flex-shrink: 0; }
.legend-sym { width: 26px; height: 26px; flex-shrink: 0; } .legend-sym svg { width: 26px; height: 26px; }
.pid-node.junction .hit { cursor: move; }
.pid-edge.selected .hit { cursor: move; }
.pid-tags summary { cursor: pointer; font-weight: 600; margin: 6px 0; }
.pid-tag-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; }
.pid-tag-list li { padding: 2px 0; }
.pid-tag-list .linklike { background: none; border: 0; padding: 0; color: var(--scarlet-ink); font-weight: 600; cursor: pointer; }
.pid-tag-list .linklike.dupe { color: var(--amber-ink); text-decoration: underline wavy; }
.pid-stage.lock-key .pid-node, .pid-stage.lock-key .pid-port { cursor: crosshair; }
.label-box { resize: vertical; min-height: 0; line-height: 1.35; font: inherit; }
.pid-quick { position: absolute; z-index: 20; width: 280px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; cursor: default; }
.pid-quick-input { width: 100%; box-sizing: border-box; }
.pid-quick-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 280px; overflow: auto; }
.pid-quick-list li { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.pid-quick-list li.on { background: var(--scarlet-tint); }
.pid-quick-list li.empty { display: block; cursor: default; }
.pid-quick-img { grid-row: 1 / 3; width: 30px; height: 30px; } .pid-quick-img svg { width: 30px; height: 30px; }
.pid-quick-name { font-size: 13px; line-height: 1.2; }
.pid-quick-cat { font-size: 11px; color: var(--ink-3); }
.pid-taglist.movable { cursor: move; } .pid-taglist.movable:hover > rect { stroke: #2563eb; }
.pid-filemenu { position: relative; }
.pid-filemenu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.pid-filemenu > summary::-webkit-details-marker { display: none; }
.pid-filemenu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: flex; flex-direction: column; align-items: stretch; min-width: 260px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 4px; }
.pid-filemenu-list .btn { justify-content: flex-start; text-align: left; }
.pid-stage.alt-key, .pid-stage.alt-key .pid-node, .pid-stage.alt-key .hit { cursor: crosshair; }

/* Banner notifications */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.banner-bar:empty { display: none; }
.portal-banner { display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px 9px 16px; border-bottom: 1px solid rgba(0,0,0,.08); font-size: 14px; }
.portal-banner .ico { flex-shrink: 0; margin-top: 1px; display: inline-flex; }
.portal-banner .ico svg, .portal-banner .close svg { width: 18px; height: 18px; }
.portal-banner .msg { flex: 1; min-width: 0; line-height: 1.45; }
.portal-banner .msg a { font-weight: 600; color: inherit; text-decoration: underline; }
.portal-banner .from { display: block; font-size: 12px; opacity: .75; }
.portal-banner .close { background: none; border: 0; color: inherit; cursor: pointer; padding: 2px; border-radius: 4px; opacity: .75; display: inline-flex; }
.portal-banner .close:hover { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); }
.portal-banner.info { background: var(--banner-info-bg); color: var(--banner-info-ink); }
.portal-banner.success { background: var(--banner-success-bg); color: var(--banner-success-ink); }
.portal-banner.warning { background: var(--banner-warning-bg); color: var(--banner-warning-ink); }
.portal-banner.urgent { background: var(--banner-urgent-bg); color: var(--banner-urgent-ink); }
.banner-preview { margin: 6px 0 2px; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.banner-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: start; }
.banner-row .meta { font-size: 12px; color: var(--ink-3); }
.chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); margin-right: 4px; }
.chip.live { background: var(--green-tint); color: var(--green-ink); }
.chip.off { background: var(--grey-tint); color: var(--grey-ink); }
.chip.scheduled { background: var(--indigo-tint); color: var(--indigo-ink); }
.thumb.pid-thumb { width: 180px; height: auto; max-height: 140px; object-fit: contain; background: var(--paper); border: 1px solid var(--line-2); border-radius: 4px; }
.figimg img.loading { min-height: 160px; background: repeating-linear-gradient(45deg, #f3f4f6 0 10px, #fff 10px 20px); }

/* Permissions (account page, people editor, presets) */
.perm-grid { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.perm-grid .grp { grid-column: 1 / -1; font-weight: 700; margin-top: 8px; font-size: 13px; }
.perm-grid label { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; }
.perm-grid label .muted { display: block; font-size: 12px; }
.perm-grid input:disabled + span { opacity: .75; }
.req-reviewers { font-size: 12px; }
.req-reviewers .badge { margin-right: 4px; }

/* Personal checklist (Home) and its read-only view for owners */
.checklist { list-style: none; margin: 8px 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.checklist li:last-child { border-bottom: 0; }
.checklist li.done .item-text { text-decoration: line-through; color: var(--ink-3); }
.checklist .overdue { color: var(--red); font-weight: 600; }
.checklist-card .list-add { display: flex; gap: 6px; flex-wrap: wrap; }
.checklist-card .list-add input[type=text] { flex: 1 1 180px; min-width: 0; }

/* Working notebook on a document page, and the release picker */
.notebook .small-title { font-size: 13px; margin: 14px 0 6px; }
.nb-picks { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; display: flex; flex-direction: column; gap: 4px; }
.nb-picks legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.notebook-release { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
