/* Ga-PLM web app. R1 (docs/ui-redesign.md): one set of design tokens, a calm neutral palette, one
   accent and clear status colours (all text colours pass WCAG AA, 4.5:1, on their backgrounds). */
:root {
  /* spacing scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  /* type scale */
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px;
  /* radius and elevation */
  --radius-sm: 6px; --radius: 8px; --radius-lg: 10px;
  --shadow-1: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-2: 0 8px 24px rgba(16,24,40,.16);
  /* neutrals */
  --bg: #F4F5F7;
  --panel: #ffffff;
  --panel-2: #f6f7f9;
  --line: #E1E4EA;
  --line-2: #EEF0F4;
  --text: #1B2230;          /* 15:1 on white */
  --muted: #5B6577;         /* 6.0:1 on white, 5.6:1 on --bg */
  --faint: #6B7486;         /* the light grey: 4.8:1 on white */
  --disabled: #8a929b;
  /* one accent */
  --accent: #2457C5;        /* 6.0:1 on white */
  --accent-hover: #1A3F91;
  --accent-weak: #E6EEFB;   /* accent text on it: 5.2:1 */
  /* status (text on its -weak background passes AA) */
  --ok: #1a7f37;  --ok-weak: #e7f5ec;   --ok-line: #b9dfc4;
  --warn: #7a4f00; --warn-weak: #fff4d6; --warn-line: #ecd9a0;
  --danger: #b3261e; --danger-weak: #fbe9e7; --danger-line: #f0c2bd;
  --info: #0b5f7a; --info-weak: #e3f2f7; --info-line: #b5dbe8;
  /* the sidebar (dark) */
  --sb-bg: #1B2230; --sb-text: #D3D8E1; --sb-muted: #A3ACBC; --sb-hover: #252E3E; --sb-raised: #2B3445; --sb-line: #4A5A78;
  /* 3D revision colours */
  --st-unchanged: #b9bec5;
  --st-changed: #e09b13;
  --st-ambiguous: #8a56d8;
  --st-orphaned: #cf3a30;
  --st-new: #2f9e55;
  --focus: #2457C5;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sb-w: 232px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: var(--fs-md)/1.45 Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--text); background: var(--bg);
  display: flex; flex-direction: row; overflow: hidden; min-width: 0;
}
h2, h3, h4 { margin: 0; font-weight: 600; }
h2 { font-size: var(--fs-xl); line-height: 1.3; }
h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
a { color: var(--accent); }
[hidden] { display: none !important; }

/* controls */
button, input, select, textarea { font: inherit; color: inherit; }
button, a.button {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 4px 10px; cursor: pointer; white-space: nowrap; line-height: 1.35; color: var(--text);
}
a.button { display: inline-block; text-decoration: none; }
button:hover:not(:disabled), a.button:hover { background: var(--panel-2); border-color: #b4bac2; }
button:disabled { color: var(--disabled); cursor: not-allowed; background: var(--panel-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.primary:disabled { background: #a9bcd9; border-color: #a9bcd9; color: #fff; }
button.danger { color: var(--danger); }
button.danger:disabled { color: var(--disabled); }
button.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
button.small { padding: 1px 7px; font-size: var(--fs-xs); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
button.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }
input[type=text], input[type=number], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 7px; background: #fff;
  min-width: 0; width: 100%;
}
input[type=color] { width: 30px; height: 24px; padding: 0 1px; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
/* visible focus everywhere (keyboard); fields show it on any focus */
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible, summary:focus-visible, input[type=checkbox]:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; }
input:disabled, select:disabled, textarea:disabled { background: var(--panel-2); color: #6f7780; }
textarea { resize: vertical; min-height: 26px; line-height: 1.3; }
label { color: var(--muted); font-size: var(--fs-xs); }
label.chk { color: var(--text); }
.row { display: flex; gap: 6px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.right { margin-left: auto; }
.nowrap { white-space: nowrap; }

/* ---- app shell: sidebar, page bar, part header (js/shell.js, js/part_shell.js; mockup Sidebar,
   PartHeader). Colours from the mockup: sidebar #1B2230, accent #2457C5. ---- */
#sidebar { flex: 0 0 var(--sb-w); width: var(--sb-w); background: var(--sb-bg); color: var(--sb-text); display: flex; flex-direction: column;
  min-height: 0; overflow-y: auto; overflow-x: hidden; z-index: 20; padding: 16px 12px 12px; gap: 4px; font-size: var(--fs-md); }
#sidebar .sb-top { display: flex; align-items: center; gap: 10px; padding: 4px 4px 14px 8px; }
#sidebar .sb-logo { height: 30px; width: auto; display: block; }
#sidebar .brand { color: #fff; font-weight: 600; font-size: 15px; letter-spacing: .04em; padding-left: 10px; border-left: 1px solid var(--sb-line); }
.sb-iconbtn, #sb-search { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--sb-line); background: var(--sb-raised); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none; }
#sb-search:hover:not(:disabled) { background: #36415a; border-color: #5d6f92; }
#sb-search-box { margin: 0 4px 8px; display: flex; flex-direction: column; gap: 6px; }
.sb-search-field { display: flex; align-items: center; gap: 8px; background: var(--sb-raised); border: 1px solid var(--sb-line); border-radius: 8px; padding: 0 10px; height: 36px; color: var(--sb-text); }
.sb-search-field input { border: 0; background: transparent; color: #fff; font-size: var(--fs-md); outline: none; padding: 0; width: 100%; }
.sb-search-field:focus-within { outline: 2px solid #8fb8f5; outline-offset: 1px; }
.sb-search-res { background: #fff; color: var(--text); border-radius: 8px; overflow: hidden; }
.sb-search-res:empty { display: none; }
#team-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-group { display: flex; flex-direction: column; gap: 2px; }
.sb-head { font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--sb-muted); padding: 12px 8px 4px; }
#team-nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px; border-radius: 6px; text-decoration: none; color: var(--sb-text); }
#team-nav a:hover { background: var(--sb-hover); color: #fff; }
#team-nav a.on { background: var(--sb-raised); color: #fff; font-weight: 500; }
.sb-count { background: var(--accent); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: var(--fs-xs); line-height: 18px; }
.sb-count.warn { background: #B4540A; }
#sidebar :focus-visible { outline-color: #8fb8f5; }
#sb-foot { position: relative; }
.sb-foot-in { position: relative; }
.sb-acct-row { display: flex; gap: 6px; margin-top: 8px; }
.sb-acct { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; border: 1px solid var(--sb-line); background: var(--sb-raised); border-radius: 8px;
  padding: 8px; color: #fff; text-align: left; }
.sb-acct:hover:not(:disabled) { background: #36415a; border-color: #5d6f92; }
.sb-acct .avatar { width: 30px; height: 30px; border-radius: 50%; background: #DCE6FA; color: #1A3F91; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--fs-sm); flex: none; }
.sb-acct .acct-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.sb-acct .acct-name { font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-acct .acct-org { font-size: var(--fs-xs); color: var(--sb-muted); }
.sb-syncbtn { width: 40px; border: 1px solid var(--sb-line); background: var(--sb-raised); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; color: #3CCB7F; padding: 0; }
.sb-syncbtn.bad { color: #FF6B5E; }
.sb-syncbtn:hover:not(:disabled) { background: #36415a; border-color: #5d6f92; }
.sb-pop { position: absolute; left: 0; bottom: 58px; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-2); padding: 6px; z-index: 30; font-size: var(--fs-md); }
.sb-menu { right: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-menu .who { padding: 8px 10px 6px; font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.sb-menu a, .sb-menu > button { padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; border: 0; background: transparent; text-align: left; display: block; width: 100%; font-size: var(--fs-md); }
.sb-menu a.spread { display: flex; justify-content: space-between; align-items: center; }
.sb-menu a:hover, .sb-menu > button:hover:not(:disabled) { background: var(--accent-weak); }
.sb-menu .sep { border-top: 1px solid var(--line-2); margin: 4px 0; }
.sb-sync { width: 340px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sync-head { display: flex; gap: 8px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--muted); }
.dot.ok { background: #1E9E57; } .dot.bad { background: #C8372D; }
.sync-prob { border: 1px solid #F0D2B4; background: #FDF6EE; border-radius: 8px; padding: 10px; font-size: var(--fs-sm); }
.sync-prob.bad { border-color: #E0B3AD; background: #FCF1EF; }
.sync-prob .fix { margin-top: 6px; }
/* UI2 item 8: the sidebar clips what sticks out of it, so the sync pop-up is fixed next to it
   (shell.js placeSyncPop sets left / bottom) and scrolls inside itself when it is tall */
#sb-foot .sb-pop.sb-sync { position: fixed; z-index: 90; box-sizing: border-box; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto; }
.sync-ny { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); }
.sync-ny-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.sync-ny-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.sync-ny-err { color: #B3261E; }
.small { font-size: var(--fs-xs); }
/* ☰ hides the whole sidebar (remembered per person); below 1100 px it opens over the page */
body.sb-hidden #sidebar { display: none; }
@media (max-width: 1100px) {
  #sidebar { display: none; }
  body.sb-open #sidebar { display: flex; position: fixed; left: 0; top: 0; bottom: 0; z-index: 80; box-shadow: var(--shadow-2); }
}
body.signed-out #sidebar, body.signed-out #topbar { display: none; }

#appcol { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* page bar: menu button, title or breadcrumb, busy text, bell */
#topbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 20px;
  background: var(--panel); color: var(--text); border-bottom: 1px solid var(--line); min-width: 0; position: relative; z-index: 15;
}
#sb-toggle, #notify-bell .bell, .icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text); flex: none; }
.icon-btn { border-color: #C9CFDA; }
#crumbs { min-width: 0; overflow: hidden; }
#page-title { display: flex; align-items: center; gap: 10px; white-space: nowrap; overflow: hidden; font-size: var(--fs-md); color: var(--muted); }
#page-title .cur { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
#page-title .back { text-decoration: none; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; flex: none; }
#page-title .crumb { overflow: hidden; text-overflow: ellipsis; }
#page-title .crumb a { color: var(--muted); text-decoration: none; }
#page-title .crumb a:hover { color: var(--accent); text-decoration: underline; }
#page-title .sep { color: var(--muted); margin: 0 4px; }
#busy { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
#busy:empty { display: none; }
.menu-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-2); min-width: 230px; padding: 6px; }
.menu > button, .menu .gs-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; font-size: var(--fs-md); }
.menu > button:hover:not(:disabled) { background: var(--accent-weak); }
.menu > button.danger { color: var(--danger); }
/* A main action inside a menu (Download N files) keeps its solid blue, not the menu's transparent rows. */
.menu > button.primary { background: var(--accent); color: #fff; text-align: center; font-weight: 600; margin-top: 6px; }
.menu > button.primary:hover:not(:disabled) { background: var(--accent-hover); }
.menu > button.primary:disabled { background: #a9bcd9; color: #fff; }
.menu .sep { height: 1px; background: var(--line-2); margin: 4px 0; }
.menu.pop { padding: 12px; display: flex; flex-direction: column; gap: 8px; width: 240px; }
.pop-title { font-weight: 600; }
/* search results (sidebar box and Ctrl K) */
.gs-group { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px 4px; }
.gs-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; border: 0; border-radius: 0; background: transparent; padding: 8px 12px; white-space: normal; color: var(--text); }
.gs-item.on, .gs-item:hover:not(:disabled) { background: var(--accent-weak); }
.gs-name { font-weight: 500; }
.gs-sub { font-size: var(--fs-sm); color: var(--muted); }
.gs-empty { padding: 12px; color: var(--muted); font-size: var(--fs-sm); }
#ck-wrap { position: fixed; inset: 0; z-index: 85; background: rgba(27,34,48,.35); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.ck { width: min(620px, calc(100vw - 32px)); background: #fff; border-radius: 12px; box-shadow: var(--shadow-2); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.ck-field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.ck-field input { border: 0; outline: none; font-size: var(--fs-lg); padding: 0; color: var(--text); }
.ck-field kbd { font: 12px var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.ck-res { overflow: auto; }
.ck-foot { padding: 8px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-xs); }

/* part bar (UI redesign 2 round 2, mockup PartBar.dc.html; js/part_shell.js): one row with back,
   name, number, Rev menu, stage chip, saved state, undo / redo, Export, "..." and the next step;
   under it the five-step path and the reason line */
#part-head { flex: 0 0 auto; background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 16px; display: flex; flex-direction: column; gap: 6px; }
.pb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.pb-row > .grow { flex: 1 1 0; min-width: 0; }
a.button.pb-back { padding: 4px 10px; border-radius: 6px; font-size: var(--fs-sm); text-decoration: none; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; }
#ph-name { margin: 0; font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 44ch; }
#ph-owner { font-size: var(--fs-sm); color: var(--faint); }
#ph-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ph-num { font-family: var(--mono); font-size: var(--fs-sm); color: #5B6577; }
.pb-rev, .pb-export { font-size: var(--fs-sm); padding: 4px 9px; border-radius: 6px; border-color: #C9CFDA; }
.pb-saved { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
#part-head .icon-btn { width: 30px; height: 30px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
#part-head .icon-btn:disabled { color: var(--faint); }
/* UI redesign 2: the part workspace has no top bar (mockup Workspace); what it carried that is still
   needed there sits in the part bar: the menu's show / hide button (first) and the bell (part_shell.js setRail) */
body.ws-rail #topbar { display: none; }
#part-head #sb-toggle, #part-head #notify-bell .bell { width: 30px; height: 30px; border-radius: 6px; }
/* with them the first row stays one line: when it is crowded the back link, the name, the owner and
   the chips give way (ellipsis; the chips may take two lines), the buttons on the right never wrap */
#part-head > .pb-row:first-child { flex-wrap: nowrap; gap: 8px; }
#part-head > .pb-row:first-child > * { flex: none; }
#part-head > .pb-row:first-child > .grow { flex: 1 1 0; min-width: 0; }
#part-head a.button.pb-back { flex: 0 6 auto; min-width: 48px; max-width: none; white-space: nowrap; }   /* no cap: it gives way first when the row is full */
#part-head #ph-name { flex: 0 3 auto; min-width: 60px; }
#part-head #ph-owner { flex: 0 8 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* W1 (C): the action buttons never leave the first line or the window: the name gives way with an
   ellipsis and the chips may take two lines in their own box (the row itself never wraps) */
#part-head #ph-chips { flex: 0 1 auto; min-width: 0; }
#part-head #ph-number { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Y2 (tester, 1440 px): the part number is never cut; when the row is full the back link gives way
   first (down to its arrow), then the owner, then the chips (the tiny shrink
   factors make each give way only once the one before is at its minimum); the name is not cut */
#part-head #ph-number { flex: 0 0 auto; overflow: visible; }
#part-head a.button.pb-back { flex-shrink: 40; }
#part-head #ph-owner { flex-shrink: 0.01; }
#part-head #ph-chips { flex-shrink: 0.001; }
@media (min-width: 1367px) { #part-head #ph-chips { flex-wrap: nowrap; } }   /* wide: one line (wrapped, the box kept its one-line width) */
/* Z2 (rehearsal item 7): on a released, taken part the chips stacked out of the bar ("Locked" sat on
   the bell, "Give back" fell under them). One line at every width: the stage chip and the buttons
   keep their size, the other chips give way with an ellipsis (their full text is the tooltip) */
#part-head #ph-chips { flex-wrap: nowrap; overflow: hidden; }
#part-head #ph-chips > *, #part-head #ph-chips .take-bar > * { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#part-head #ph-chips > :first-child, #part-head #ph-chips .take-bar > button { flex-shrink: 0; overflow: visible; }
#part-head #ph-chips .take-bar { flex-wrap: nowrap; min-width: 84px; flex-shrink: 1; }   /* its Give back button always shows */
@media (max-width: 1366px) {
  #part-head .pb-row #ph-name { flex-shrink: 1; min-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #part-head .pb-row #ph-chips { flex-shrink: 1; min-width: 206px; }   /* the stage chip and Give back */
  #part-head #ph-chips .take-bar > .chip.accent { display: none; }   /* narrow: "Taken by you" goes; its Give back stays */
  #part-head #ph-chips .take-bar { min-width: 0; flex-shrink: 0; }
}
#part-head #ph-saved { white-space: nowrap; }
#part-head #ph-name { flex-shrink: 0; min-width: 120px; }
@media (max-width: 1200px) { #part-head #ph-name { flex-shrink: 1; } }   /* very narrow: the name gives way too */
@media (max-width: 1366px) { #part-head #ph-owner { display: none; } }   /* narrow: the owner name goes (the Projects list shows it) */
#ph-more { font-size: 18px; line-height: 1; }
#ph-rev-menu { right: auto; left: 0; min-width: 300px; }
#btn-release, #ph-second, #btn-review-this { height: 32px; padding: 0 14px; border-radius: 6px; font-size: var(--fs-sm); font-weight: 600; }
#ph-second { font-weight: 500; }
#btn-release.primary:disabled { background: #A9BCD9; border-color: #A9BCD9; color: #fff; cursor: not-allowed; }
.pb-under { gap: 14px; min-height: 22px; }
.pb-path { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.pb-step { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.pb-step:not(:last-child)::after { content: ''; width: 28px; height: 2px; margin: 0 4px; background: #C9CFDA; }
.pb-step.done:not(:last-child)::after { background: #1A7F37; }
.pb-dot { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none;
  border: 1.5px solid #8A929B; background: #fff; color: #5B6577; }
.pb-step.done .pb-dot { background: #1A7F37; border-color: #1A7F37; color: #fff; }
.pb-step.now .pb-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.pb-step.done .pb-label { color: var(--text); }
.pb-step.now .pb-label { color: var(--text); font-weight: 600; }
.ph-line2 { font-size: var(--fs-sm); color: var(--muted); }
.ph-why { font-size: var(--fs-sm); color: var(--muted); text-align: right; max-width: 70ch; }
.ph-why.warn { color: #7A4F00; }
.ph-why.ok { color: #1A7F37; }
.ph-why .err { color: var(--danger); }
@media (max-width: 1300px) { .pb-path .pb-step:not(.now) .pb-label { display: none; } .pb-step:not(:last-child)::after { width: 14px; } }
/* status pills: one status set with icons and hover text */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 500; padding: 2px 10px 2px 8px; border-radius: 12px; white-space: nowrap; }
.pill.st-draft { background: #EEF0F4; color: #3D4656; }
.pill.st-review { background: #E6EEFB; color: #1A3F91; }
.pill.st-approved { background: #E3F4EA; color: #146C3B; }
.pill.st-released { background: #E3F4EA; color: #146C3B; }
.pill.st-revising { background: #FDF0E1; color: #8A3F06; }
.chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 12px; font-size: var(--fs-sm); font-weight: 500; border: 1px solid var(--line); color: var(--muted); background: var(--panel-2); white-space: nowrap; }
.chip.ok { color: var(--ok); background: var(--ok-weak); border-color: var(--ok-line); }
.chip.warn { color: var(--warn); background: var(--warn-weak); border-color: var(--warn-line); }
.chip.bad { color: var(--danger); background: var(--danger-weak); border-color: var(--danger-line); }
.chip.accent { color: var(--accent); background: var(--accent-weak); border-color: #b9cdea; }
#blocked { flex: 0 0 auto; padding: 6px 24px; background: var(--warn-weak); color: var(--warn); border-bottom: 1px solid var(--warn-line); font-size: var(--fs-sm); }
#review-note { flex: 0 0 auto; padding: 6px 24px; background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
#review-note .warn { color: var(--warn); }
.review-step { margin-top: 4px; font-size: var(--fs-sm); }
.review-step .warn { color: var(--warn); }
/* activity: a panel of the right panel */
#activity { padding: 14px; }
#activity h2 { font-size: var(--fs-lg); margin-bottom: 10px; }
.act-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: var(--fs-sm); }
.act-when { font-size: var(--fs-xs); color: var(--faint); }

/* layout of the part workspace (mockup Workspace.dc.html): browser | centre (sheet, 3D or both,
   the bottom bar under them) | the right panel with tabs. The three mount points are filled by
   ws_toolbar.js, ws_browser.js, ws_bottom.js and styled in css/workspace.css; empty, they take no room. */
main { flex: 1 1 auto; display: flex; min-height: 0; min-width: 0; }
aside { flex: 0 0 auto; background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
#ws-toolbar { flex: 0 0 auto; }
#ws-bottom { flex: 0 0 auto; }
#ws-toolbar:empty, #ws-browser:empty, #ws-bottom:empty { display: none; }
#ws-switch-fallback { padding: 4px 10px; gap: 4px; background: var(--panel); border-top: 1px solid var(--line); }
#ws-switch-fallback button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
#side { width: 360px; border-left: 1px solid var(--line); }
@media (max-width: 1500px) { #side { width: 320px; } }
#side.collapsed { width: 34px; }
#side.collapsed #side-body, #side.collapsed #side-tabs button[data-panel] { display: none; }
#side.collapsed .side-tabs { border-bottom: 0; padding: 4px 0; justify-content: center; }
.side-tabs { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; gap: 0 2px; padding: 0 2px 0 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
.side-tabs .count { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 4px; border-radius: 8px; background: #B4540A; color: #fff; font-size: 10.5px; font-weight: 600; text-align: center; }
.side-tabs #changes-count { background: var(--st-changed); }
.side-tabs > .grow { flex: 1 1 0; }
.side-fold { border: 0; background: transparent; font-size: 18px; line-height: 1; padding: 4px 8px; color: var(--muted); }
.side-fold:hover { color: var(--text); background: var(--panel-2); }
#side-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
#side .pane-group { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
#pane-dwg { flex: 0 0 auto; }
#pane-dwg:empty { display: none; }
.ws-note { flex: 0 0 auto; margin: 10px 10px 0; padding: 10px; border-radius: 8px; font-size: var(--fs-sm); }
.ws-note.info { background: #E3F2F7; border: 1px solid #B5DBE8; color: #0B4A5F; }
/* in the workspace the main menu is a rail of icons (mockup Sidebar, rail); it widens on other pages */
body.ws-rail { --sb-w: 56px; }
body.ws-rail #sidebar { padding: 14px 8px 10px; align-items: stretch; }
body.ws-rail #sidebar .brand, body.ws-rail #sidebar .sb-label, body.ws-rail #sidebar .sb-head, body.ws-rail #sidebar .acct-text,
body.ws-rail #sidebar .sb-logo, body.ws-rail #sb-search-box { display: none; }
body.ws-rail #sidebar .sb-top { padding: 0 0 10px; justify-content: center; }
body.ws-rail #sidebar .sb-top .grow { display: none; }
body.ws-rail #team-nav a { justify-content: center; padding: 10px 0; position: relative; }
body.ws-rail #team-nav .sb-count { position: absolute; top: 2px; right: 0; padding: 0 5px; font-size: 10px; line-height: 15px; }
body.ws-rail .sb-acct-row { flex-direction: column; align-items: center; }
body.ws-rail .sb-acct { padding: 4px; justify-content: center; flex: none; }
body.ws-rail .sb-syncbtn { width: 40px; height: 32px; }
body.ws-rail .sb-pop { left: 0; right: auto; }
#pane-mfg #sm-panel, #pane-mfg #lc-panel { margin: var(--sp-2) 10px; background: var(--panel); max-width: none; }
#v-lc.hint-chip { background: var(--info-weak); border-color: var(--info-line); color: var(--info); font-weight: 600; }
#view-empty .state { pointer-events: auto; max-width: 440px; }
.tabs .count { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 3px; border-radius: 8px; background: var(--st-changed); color: #fff; font-size: 10.5px; font-weight: 600; }
.pane { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.sec { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); }
.sec > h3 { margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.sec > h3 .right { text-transform: none; letter-spacing: 0; font-weight: 400; }
details.sec > summary { cursor: pointer; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 0; }
details.sec[open] > summary { margin-bottom: 6px; }
.empty { color: var(--muted); padding: 4px 0; }
.form-grid { display: grid; grid-template-columns: 78px 1fr; gap: 4px 6px; align-items: center; }
.form-grid.wide { grid-template-columns: 96px 1fr; }
.hint { font-size: 11.5px; color: var(--muted); }
.err { color: var(--danger); font-size: 11.5px; }
.badge { display: inline-block; padding: 0 5px; border-radius: 3px; font-size: 10.5px; font-weight: 600; border: 1px solid var(--line); color: var(--muted); background: var(--panel-2); text-transform: uppercase; letter-spacing: .03em; }
.badge.warn { color: var(--warn); background: var(--warn-weak); border-color: #ecd9a0; }
.badge.bad { color: var(--danger); background: var(--danger-weak); border-color: #f0c2bd; }
.badge.ok { color: var(--ok); background: #e6f4ea; border-color: #b9dfc4; }
.badge.accent { color: var(--accent); background: var(--accent-weak); border-color: #b9cdea; }

/* lists */
.list { display: flex; flex-direction: column; }
.item { padding: 5px 6px; border: 1px solid var(--line-2); border-radius: 3px; margin-bottom: 4px; background: #fff; }
.item.click { cursor: pointer; }
.item.click:hover { border-color: #b4bac2; }
.item.active { border-color: var(--accent); background: var(--accent-weak); }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.item .sub { color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.item .actions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
table.grid { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.grid th, table.grid td { text-align: left; padding: 2px 4px; border-bottom: 1px solid var(--line-2); vertical-align: top; overflow-wrap: anywhere; }
table.grid th { color: var(--muted); font-weight: 600; }

/* notes editor */
.note-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 4px; align-items: start; margin-bottom: 4px; }
.note-row .n { color: var(--muted); text-align: right; padding-top: 4px; font-size: 11.5px; }
.note-row .btns { display: flex; flex-direction: column; gap: 2px; }
.note-row .btns button { padding: 0 5px; font-size: 10.5px; line-height: 1.3; }
.swatch { display: inline-block; width: 12px; height: 12px; border: 1px solid rgba(0,0,0,.35); border-radius: 2px; vertical-align: -2px; flex: 0 0 auto; }
.swatch.none { background: #fff !important; border-style: dashed; border-color: #8b929a; }

/* centre */
#centre { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #dfe2e6; }
#ws-views { flex: 1 1 auto; display: flex; min-width: 0; min-height: 0; }
#view3d { position: relative; flex: 1 1 0; min-width: 120px; overflow: hidden; background: #e9ebee; }
#view3d canvas { display: block; width: 100%; height: 100%; outline: none; }
#divider { flex: 0 0 6px; cursor: col-resize; background: var(--line); border-left: 1px solid #bfc5cc; border-right: 1px solid #bfc5cc; }
#divider:hover, #divider.drag { background: var(--accent); }
#drawing { flex: 1 1 0; min-width: 120px; display: flex; flex-direction: column; background: #cfd3d8; overflow: hidden; }
.toolbar { display: flex; gap: 4px; align-items: center; padding: 4px 6px; flex-wrap: wrap; }
#view-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; pointer-events: none; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
#view-top > * { pointer-events: auto; }
#view3d .toolbar { pointer-events: none; align-self: stretch; }
#view3d .toolbar > * { pointer-events: auto; }
#view3d .toolbar label.chk { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 3px; padding: 2px 7px; color: var(--text); font-size: 12.5px; display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
#view-bottom { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2; display: flex; flex-wrap: wrap-reverse; gap: 6px; align-items: flex-end; justify-content: space-between; pointer-events: none; }
#sel-label {
  max-width: 100%;
  background: rgba(255,255,255,.93); border: 1px solid var(--line); border-radius: 3px; padding: 4px 8px;
  pointer-events: none;
}
#sel-label .hov { color: var(--muted); }
#sel-label .nav { color: #747c86; font-size: 11px; }
#legend {
  margin-left: auto; background: rgba(255,255,255,.93);
  border: 1px solid var(--line); border-radius: 3px; padding: 5px 8px; font-size: 11.5px; max-width: 240px;
}
#legend .lg { display: flex; align-items: center; gap: 6px; }
#legend h4 { font-size: 10.5px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; margin-bottom: 2px; }
#pick-banner {
  margin: 0 8px;
  background: var(--accent); color: #fff; border-radius: 3px; padding: 5px 8px; display: flex; gap: 8px; align-items: center;
  max-width: calc(100% - 16px); flex-wrap: wrap;
}
#pick-banner button { border-color: #fff; color: var(--text); }
#pick-banner button:disabled { color: #8b929a; }
#view-note { margin: 0 8px; background: var(--warn-weak); color: var(--warn); border: 1px solid #ecd9a0; border-radius: 3px; padding: 3px 8px; }
#view-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 40px; pointer-events: none; }
#dwg-view { position: relative; flex: 1 1 auto; overflow: hidden; min-height: 0; background: #c7ccd2; }
#dwg-view .sheet-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; user-select: none; }
#dwg-view .sheet-svg.panning { cursor: grabbing; }
#dwg-view .sheet-svg text { user-select: none; }
.marks rect { fill: none; vector-effect: non-scaling-stroke; }
.marks .f-hover { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 4 3; }
.marks .f-sel { stroke: var(--accent); stroke-width: 2; fill: rgba(31,95,191,.05); }
.marks .f-warn { stroke: #c98a00; stroke-width: 1.5; stroke-dasharray: 3 2; fill: rgba(201,138,0,.06); }
.marks .f-bad { stroke: var(--danger); stroke-width: 2; fill: rgba(179,38,30,.07); }
.marks .f-dim { stroke: #c2408f; stroke-width: 1.2; fill: rgba(194,64,143,.10); }
.marks .f-parent { stroke: #d9541e; stroke-width: 1.5; stroke-dasharray: 6 3; }
.marks .f-tag { fill: var(--accent); font-family: "Segoe UI", Arial, sans-serif; }
.over * { vector-effect: non-scaling-stroke; }
.over .ghost { fill: rgba(31,95,191,.08); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 6 4; }
.over .g-line { fill: none; stroke: #d9541e; stroke-width: 1.5; }
.over .g-cut path { fill: none; stroke: #d9541e; stroke-width: 2; stroke-dasharray: 10 3 2 3; }
.over .g-cut .arrow-stem { stroke-dasharray: none; stroke-width: 1.5; }
.over .g-cut .arrow-head { fill: #d9541e; stroke: none; }
.over .pt { fill: #fff; stroke: #d9541e; stroke-width: 1.5; }
.over .g-break { stroke: #d9541e; stroke-width: 1.5; fill: none; stroke-dasharray: 5 3; }
.over .band { fill: rgba(217,84,30,.16); stroke: none; }
.over .h-handle { fill: #fff; stroke: var(--accent); stroke-width: 1.5; cursor: move; }
.over .snap * { fill: none; stroke: #0f8f8a; stroke-width: 1.6; }
.over .readout rect { fill: rgba(43,48,55,.9); stroke: none; }
.over .readout text { fill: #fff; font-family: "Segoe UI", Arial, sans-serif; }
.callout.bad { background: var(--danger-weak); border-color: #f0c2bd; color: var(--danger); }
#dwg-info { flex: 0 0 auto; max-height: 34%; overflow: auto; background: var(--panel); border-top: 1px solid var(--line); padding: 4px 8px; font-size: 11.5px; }
#dwg-info ul { margin: 2px 0 4px 16px; padding: 0; }

/* tolerances */
/* W1 (L): in the narrow right panel a row of choices (Size Thread Finish Note Datum Frame) wraps
   onto a second line instead of being cut off */
.sel-face { display: flex; gap: 6px; align-items: baseline; padding: 1px 0; }
.sel-face .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.tol-text { font-family: var(--mono); font-size: 12.5px; }
.tol-id { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.fcf { display: inline-flex; border: 1.3px solid var(--text); vertical-align: middle; background: #fff; font-family: var(--mono); font-size: 12.5px; line-height: 1; }
.fcf .cell { display: inline-flex; align-items: center; gap: 2px; padding: 3px 5px; border-right: 1.3px solid var(--text); min-height: 22px; }
.fcf .cell:last-child { border-right: 0; }
.fcf svg { width: 24px; height: 16px; display: block; }
.circ { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border: 1.1px solid currentColor; border-radius: 50%; font-size: 9.5px; font-weight: 600; margin-left: 2px; }
.datum-sym { display: inline-flex; align-items: center; vertical-align: middle; gap: 0; }
.datum-sym .box { border: 1.3px solid var(--text); padding: 3px 6px; font-family: var(--mono); font-size: 12.5px; line-height: 1; min-height: 22px; display: inline-flex; align-items: center; background: #fff; }
.datum-sym svg { width: 20px; height: 14px; }
.st-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.chips button { padding: 1px 7px; font-size: 11.5px; border-radius: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; font-size: 11.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* toasts */
#toasts { position: fixed; right: 12px; bottom: 12px; z-index: 50; display: flex; flex-direction: column; gap: 6px; max-width: 460px; }
.toast { background: #2b3037; color: #fff; border-radius: 3px; padding: 7px 10px; display: flex; gap: 10px; align-items: flex-start; box-shadow: 0 2px 8px rgba(0,0,0,.25); border-left: 4px solid #7f8b9a; }
.toast.error { border-left-color: #f0564a; }
.toast.ok { border-left-color: #4cc274; }
.toast .msg { flex: 1; overflow-wrap: anywhere; white-space: pre-wrap; }
.toast button { background: transparent; border: 0; color: #c8ced6; padding: 0 2px; }
.toast button:hover:not(:disabled) { background: transparent; color: #fff; }

/* dialog */
#modal { position: fixed; inset: 0; z-index: 40; background: rgba(20,24,28,.45); display: flex; align-items: center; justify-content: center; }
#modal .dlg { background: var(--panel); border-radius: 4px; border: 1px solid #9aa1a9; width: 440px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
#modal .dlg h2 { font-size: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
#modal .dlg .body { padding: 10px 14px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
#modal .dlg .body p { margin: 0; }
#modal .dlg .body .fld { display: flex; flex-direction: column; gap: 2px; }
#modal .dlg .foot { padding: 8px 14px; border-top: 1px solid var(--line-2); display: flex; gap: 6px; justify-content: flex-end; background: var(--panel-2); border-radius: 0 0 4px 4px; }
.callout { background: var(--warn-weak); border: 1px solid #ecd9a0; color: var(--warn); padding: 6px 8px; border-radius: 3px; }


/* drafting symbols (symbols.js): inline SVG in text, a font stack that has the glyphs in fields */
svg.sym { width: .82em; height: .82em; vertical-align: -.06em; margin: 0 .06em; fill: none; stroke: currentColor; stroke-width: 1.05; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.symtext { white-space: pre-wrap; }
.symfont, textarea, input[type=text] { font-family: "Segoe UI", "Segoe UI Symbol", "Cambria Math", Arial, sans-serif; }

/* sheet editor, step 2: dimensions edited by hand (dims.js) */
#face-menu { position: absolute; z-index: 5; background: var(--panel); border: 1px solid #9aa1a9; border-radius: 4px;
  padding: 4px 6px; box-shadow: 0 2px 8px rgba(0,0,0,.18); max-width: 330px; display: flex; flex-direction: column; gap: 4px; }
#face-menu .db-row { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
#face-menu .db-grid { display: grid; grid-template-columns: 58px 240px; gap: 3px 4px; align-items: center; }
#face-menu .db-sub { display: flex; flex-direction: column; gap: 4px; }
#face-menu .tf { padding: 1px 4px; }
#face-menu textarea { width: 100%; }
#dim-bar { position: absolute; z-index: 4; background: var(--panel); border: 1px solid #9aa1a9; border-radius: 4px;
  box-shadow: 0 3px 12px rgba(0,0,0,.2); padding: 3px 4px; font-size: 12px; max-width: calc(100% - 8px); }
#dim-bar .db-row { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
#dim-bar .db-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0 4px 0 2px; }
#dim-bar .small-sel { width: auto; padding: 0 2px; font-size: 11.5px; height: 20px; }
#dim-bar .db-sub, #note-box { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; }
#dim-bar .db-grid { display: grid; grid-template-columns: 58px 240px; gap: 3px 4px; align-items: center; }
#dim-bar .db-grid label { color: var(--text); }
#dim-bar .tf { padding: 1px 4px; }
#dim-bar .callout { padding: 3px 6px; font-size: 11.5px; max-width: 420px; }
/* 0.3.2 R3: tolerance per value, GD&T forms on the sheet */
#dim-bar .db-grid.vt-grid, #dim-bar .db-grid.gdt-grid, #face-menu .db-grid.gdt-grid { grid-template-columns: max-content minmax(200px, 300px); }
#dim-bar .vt-grid label { white-space: nowrap; }
#dim-bar .vt-grid .tf, #dim-bar .gdt-grid .tf { width: 64px; }
#dim-bar .hint, #face-menu .hint { max-width: 420px; }
.gdt-row { display: flex; gap: 4px; align-items: center; }
.gdt-preview { margin: 2px 0; }
.hint.err { color: var(--bad, #b3261e); }
.db-actions { display: flex; gap: 4px; align-items: center; }
.palette { display: flex; gap: 2px; flex-wrap: wrap; }
.palette .sym-btn { min-width: 22px; padding: 0 4px; font-family: "Segoe UI", "Segoe UI Symbol", "Cambria Math", Arial, sans-serif; }
#note-box { position: absolute; z-index: 5; width: 300px; max-width: calc(100% - 8px); background: var(--panel); border: 1px solid var(--accent);
  border-radius: 4px; box-shadow: 0 3px 12px rgba(0,0,0,.22); padding: 6px; margin: 0; }
#note-box textarea { min-height: 58px; }
#dwg-ann { flex: 0 0 auto; max-height: 24%; overflow: auto; background: var(--panel); border-top: 1px solid var(--line); padding: 2px 8px; font-size: 11.5px; }
#dwg-ann .ann-sec > summary { cursor: pointer; font-weight: 600; padding: 2px 0; }
#dwg-ann .ann-sec.bad > summary { color: var(--danger); }
#dwg-ann .ann-sec.warn > summary { color: var(--warn); }
#dwg-ann .ann-row { display: flex; gap: 4px; align-items: center; padding: 1px 0 1px 12px; }
.marks .f-dimsel { stroke: #c2408f; stroke-width: 2; fill: rgba(194,64,143,.07); }
.over .pv-line { fill: none; stroke: #d9541e; stroke-width: 1.6; }
.over .pv-ext { fill: none; stroke: #d9541e; stroke-width: 1; stroke-dasharray: 4 3; }
.over .pv-head { fill: #d9541e; stroke: none; }
.over .pv-text rect { fill: rgba(217,84,30,.94); stroke: none; }
.over .pv-text text { fill: #fff; font-family: "Segoe UI", "Segoe UI Symbol", "Cambria Math", Arial, sans-serif; }
.over .picked * { fill: none; stroke: #c2408f; stroke-width: 2.4; }
.over .snap .snap-line { stroke-width: 3; stroke: rgba(15,143,138,.55); }
#dim-bar .db-name .symtext { white-space: nowrap; }


/* Stage 3: stack-up and completeness panels (js/stackup.js, js/completeness.js) */
.su-link .su-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-link.unconf { border-left: 3px solid var(--st-changed); }
.su-sign { min-width: 22px; font-weight: 700; }
.su-bars { gap: 4px; margin-top: 3px; }
.su-bar { position: relative; flex: 1 1 0; height: 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--panel-2); }
.su-bar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); opacity: .8; }
.su-bar.rss span { background: #6b8fd0; }
.su-bar em { position: absolute; right: 3px; top: -1px; font-size: 9.5px; font-style: normal; color: var(--text); }
.su-assume { background: var(--warn-weak); border: 1px solid #ecd9a0; border-radius: 3px; padding: 4px 6px; margin: 4px 0 6px; font-size: 11.5px; }
.su-assume ul { margin: 2px 0 0; padding-left: 16px; }
#su-tighten ul { margin: 2px 0; padding-left: 16px; font-size: 11.5px; }
.ck-rule { margin-bottom: 6px; }
.ck-rule .ck-finding { margin: 3px 0 0 8px; font-size: 11.5px; }
.ck-finding.block { border-left: 3px solid var(--st-changed); }   /* "would block (off for now)": a warning (S1) */
.ck-finding.warn { border-left: 3px solid var(--st-changed); }

/* loading indicator for slow actions (js/busy.js) */
#busy-bar { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 90; overflow: hidden; background: rgba(32,107,196,.18); }
#busy-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; background: var(--accent, #206bc4); animation: busy-slide 1.1s ease-in-out infinite; }
@keyframes busy-slide { from { left: -30%; } to { left: 100%; } }
/* progress panel, bottom right of every page (js/busy.js; mockup docs/mockup-v2/SyncStates.dc.html) */
#progress-panel { position: fixed; right: 12px; bottom: 12px; z-index: 90; width: 420px; max-width: calc(100vw - 24px);
  background: var(--panel, #fff); border: 1px solid var(--line, #c9cfda); border-radius: 10px; box-shadow: 0 8px 24px rgba(27,34,48,.16);
  font-size: 13px; display: flex; flex-direction: column; }
#progress-panel .pp-details { padding: 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line-2, #e1e4ea); max-height: 50vh; overflow: auto; }
#progress-panel .pp-item { display: flex; flex-direction: column; gap: 3px; }
#progress-panel .pp-title { font-weight: 600; }
#progress-panel .pp-sub, #progress-panel .pp-hint { color: var(--muted, #5b6577); }
#progress-panel .pp-hint { font-size: 12px; }
#progress-panel .pp-track { height: 6px; background: #eef0f4; border-radius: 3px; overflow: hidden; position: relative; }
#progress-panel .pp-fill { height: 6px; background: var(--accent, #2457c5); border-radius: 3px; }
#progress-panel .pp-fill.pp-indet { width: 30%; position: absolute; animation: busy-slide 1.4s ease-in-out infinite; }
#progress-panel .pp-row { padding: 8px 10px; display: flex; gap: 10px; align-items: center; }
#progress-panel .pp-lines { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#progress-panel .pp-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#progress-panel .pp-wait { color: var(--muted, #5b6577); }
#progress-panel .pp-done { color: var(--ok, #0f6b3a); }
#progress-panel .pp-done.pp-fail { color: var(--danger, #b3261e); }
#progress-panel .pp-arrow { font: inherit; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line, #c9cfda); border-radius: 6px;
  background: var(--panel, #fff); cursor: pointer; flex: none; font-size: 15px; line-height: 1; }
body:has(#progress-panel:not([hidden])) #toasts { bottom: calc(24px + var(--pp-h, 64px)); }
/* Z2 item 4: close (x) and the small chip it leaves while something runs */
#progress-panel .pp-close { font: inherit; width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; flex: none; font-size: 17px; line-height: 1; color: var(--muted, #5b6577); }
#progress-panel .pp-close:hover { color: var(--text, #1b2230); }
#progress-panel.pp-chip-mode { width: auto; border-radius: 999px; }
#progress-panel .pp-chip { font: inherit; font-size: 12px; padding: 4px 12px; border: 0; background: none; cursor: pointer; white-space: nowrap; }
.busy-spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid rgba(32,107,196,.25); border-top-color: var(--accent, #206bc4); animation: busy-rot .8s linear infinite; }
@keyframes busy-rot { to { transform: rotate(360deg); } }
button.is-loading { position: relative; color: transparent !important; pointer-events: none; }
button.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -7px 0 0 -7px; border-radius: 50%;
  border: 2px solid rgba(127,127,127,.35); border-top-color: currentColor; border-top-color: var(--accent, #206bc4); animation: busy-rot .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { #busy-bar::after, .busy-spin, button.is-loading::after, #progress-panel .pp-fill.pp-indet { animation-duration: 3s; } }

/* library page (js/library.js, docs/library.md) */
.lib-wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr) 290px; flex: 1; min-height: 0; width: 100%; }
.lib-tree { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.lib-tree-head { display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.lib-nodes { overflow: auto; flex: 1; padding: 4px 0; }
.lib-node { display: flex; align-items: center; gap: 4px; padding: 3px 6px; cursor: pointer; user-select: none; }
.lib-node:hover { background: var(--panel-2); }
.lib-node.on { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.lib-node.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.lib-node.archived .nm { color: var(--muted); text-decoration: line-through; }
.lib-node .tw { width: 12px; color: var(--muted); flex: none; text-align: center; }
.lib-node .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-node .cnt { color: var(--muted); font-size: 11px; }
.lib-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: auto; padding: 8px 10px; gap: 6px; }
.lib-head-row, .lib-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lib-head-row .crumbs { font-size: 14px; font-weight: 600; }
.lib-filters .lib-q { flex: 1 1 260px; min-width: 180px; width: auto; }
.lib-filters select, .lib-filters input[type=checkbox] { width: auto; }
.lib-node-info, .lib-owners { background: var(--panel); border: 1px solid var(--line-2); border-radius: 4px; padding: 5px 8px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.lib-card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; min-width: 0; display: flex; flex-direction: column; }
.lib-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lib-card .thumb { height: 110px; background: #e9ebee; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line-2); }
.lib-card .thumb img { max-width: 100%; max-height: 100%; }
.lib-card .cbody { padding: 5px 7px; display: flex; flex-direction: column; gap: 2px; }
.lib-card .row { display: flex; gap: 4px; align-items: center; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.small { font-size: 11px; }
button.ghost { border-color: transparent; background: transparent; }
.tags { display: flex; gap: 3px; flex-wrap: wrap; }
.tag { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 0 6px; font-size: 11px; }
.lib-list { overflow: auto; }
.lib-list img.mini { width: 48px; height: 36px; object-fit: contain; display: block; }
.lib-list tr { cursor: pointer; }
.lib-list tr.on td { background: var(--accent-weak); }
.lib-side { border-left: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 8px 10px; min-width: 0; }
.lib-side h3 { margin: 10px 0 4px; }
.lib-side img.big { width: 100%; border: 1px solid var(--line-2); border-radius: 3px; margin: 6px 0; }
.lib-side-head { display: flex; flex-direction: column; gap: 4px; }
.lib-dl { display: grid; grid-template-columns: 72px 1fr; gap: 3px 6px; margin: 0; }
.lib-dl dt { color: var(--muted); }
.lib-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.lib-files { margin: 0; padding-left: 16px; }
.lib-hist .timeline li { font-size: 11.5px; }
.lib-menu { position: fixed; z-index: 80; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.15); padding: 3px; min-width: 210px; }
.lib-menu button { display: block; width: 100%; text-align: left; border: 0; }
.lib-head { color: var(--muted); }
@media (max-width: 1400px) { .lib-wrap { grid-template-columns: 210px minmax(0, 1fr) 250px; } }

/* read-only roles (procurement, technician): every part opens, write controls are hidden; the server refuses writes anyway */
body.readonly #review-note, body.readonly #btn-drawing,
body.readonly #pane-projects > .sec:first-child, body.readonly #pane-projects button.danger, body.readonly #lib-asm-open,
body.readonly #tol-add, body.readonly #side button.danger { display: none !important; }

/* sheet metal panel (js/sheetmetal.js) */
#sm-panel { margin: 0 8px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 3px; padding: 6px 9px; display: flex; flex-direction: column; gap: 5px; max-width: min(460px, calc(100% - 16px)); font-size: 12.5px; }
#sm-panel .sm-head { display: flex; align-items: baseline; gap: 4px; }
#sm-panel .sm-x { margin-left: auto; }
#sm-panel .sm-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#sm-panel .sm-why { font-size: 11.5px; }
#sm-panel .sm-ok { font-weight: 600; }
#sm-panel .sm-warn { background: var(--warn-weak); color: var(--warn); border: 1px solid #ecd9a0; border-radius: 3px; padding: 3px 7px; }
#sm-panel .sm-bends { display: flex; gap: 4px; flex-wrap: wrap; }
#sm-panel .sm-b { border-radius: 3px; padding: 1px 6px; font-size: 11.5px; color: #fff; }
#sm-panel .sm-b.up { background: #1f8f3a; }
#sm-panel .sm-b.down { background: #c8322b; }
#sm-panel a.button { display: inline-block; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 1px 8px; text-decoration: none; color: var(--text); }
#view3d .toolbar #v-sm.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* feature A2: notification bell in the top bar (js/notify.js) */
#notify-bell { position: relative; }
:is(#topbar, #part-head) #notify-bell .bell { display: inline-flex; align-items: center; gap: 4px; padding: 0; position: relative; }
#notify-bell .bell .bell-count { position: absolute; top: -5px; right: -5px; background: #B4540A; }
:is(#topbar, #part-head) #notify-bell .bell:hover { background: var(--panel-2); border-color: var(--line); color: var(--text); }
:is(#topbar, #part-head) #notify-bell .bell svg { display: block; }
:is(#topbar, #part-head) #notify-bell .bell.has-unread { color: var(--text); }
#notify-bell .bell-count { background: var(--danger); color: #fff; border-radius: 9px; min-width: 16px; padding: 0 4px;
  font-size: 11px; line-height: 16px; font-weight: 600; text-align: center; }
#notify-bell .bell-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; width: 360px; max-width: calc(100vw - 20px);
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
#notify-bell .bell-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
:is(#topbar, #part-head) #notify-bell .bell-head button { background: var(--panel-2); border-color: var(--line); color: var(--text); }
:is(#topbar, #part-head) #notify-bell .bell-head button:disabled { color: var(--muted); }
#notify-bell .bell-list { max-height: 60vh; overflow-y: auto; overflow-x: hidden; }
/* W1 (L): long notification texts wrap instead of a sideways scrollbar */
#notify-bell .bell-item, #notify-bell .bell-item * { white-space: normal; overflow-wrap: anywhere; min-width: 0; max-width: 100%; box-sizing: border-box; }
/* R2 (0.5.0 rehearsal): the panel keeps its own width (max-width 100% made it as narrow as the 30 px bell on the part bar) */
#notify-bell .bell-panel { white-space: normal; overflow-wrap: anywhere; box-sizing: border-box; }
:is(#topbar, #part-head) #notify-bell .bell-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; padding: 6px 8px; color: var(--text); font-weight: 400; }
:is(#topbar, #part-head) #notify-bell .bell-item:hover { background: var(--accent-weak); }
:is(#topbar, #part-head) #notify-bell .bell-item.unread { font-weight: 600; }
#notify-bell .bell-when { font-size: 11px; color: var(--muted); font-weight: 400; }
#notify-bell .bell-empty { padding: 10px; color: var(--muted); }

/* feature A2: "Ask for review" person picker and the asked line (js/team_review.js) */
.person-picker { border: 1px solid var(--line); border-radius: 3px; max-height: 220px; overflow-y: auto; background: var(--panel); }
.person-picker .pp-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.person-picker .pp-row:last-child { border-bottom: 0; }
.person-picker .pp-row.off { color: var(--muted); cursor: default; opacity: .65; }
.person-picker .pp-name { flex: 1 1 auto; }
.person-picker .pp-role { font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; }
.person-picker .pp-note { font-size: 11px; font-style: italic; }
.person-picker .empty { padding: 8px; }
.review-asked { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 4px 12px; border-bottom: 1px solid var(--line-2); background: var(--panel); font-size: 12.5px; }

/* laser cut */
#lc-panel { margin: 0 8px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 3px; padding: 6px 9px; display: flex; flex-direction: column; gap: 5px; max-width: min(380px, calc(100% - 16px)); font-size: 12.5px; }
#lc-panel .lc-head { display: flex; align-items: baseline; gap: 4px; }
#lc-panel .lc-x { margin-left: auto; }
#lc-panel .lc-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#lc-panel .lc-ok { font-weight: 600; }
#lc-panel .lc-sub { font-size: 11.5px; }
#lc-panel .lc-warn { background: var(--warn-weak); color: var(--warn); border: 1px solid #ecd9a0; border-radius: 3px; padding: 3px 7px; }
#lc-panel .lc-note { font-size: 11.5px; color: var(--warn); }
#lc-panel .lc-svg { width: 100%; max-height: 180px; background: #fff; border: 1px solid var(--line); border-radius: 3px; }
#lc-panel .lc-out { fill: #e8ecf1; stroke: #1b3a6b; stroke-width: 1.4; }
#lc-panel .lc-in { fill: #fff; stroke: #1b3a6b; stroke-width: 1; }
#lc-panel a.button { display: inline-block; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 1px 8px; text-decoration: none; color: var(--text); }

/* conflicts (js/conflicts.js, docs/sync.md 5) */
.cf-entry { white-space: nowrap; }
.cf-badge { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; text-align: center; }
.cf-badge[hidden] { display: none; }
.cf-page { flex: 1; min-width: 0; overflow: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.cf-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cf-list { display: flex; flex-direction: column; gap: 14px; }
.cf-card { border: 1px solid var(--line); border-left: 3px solid var(--danger); border-radius: 4px; background: var(--panel); padding: 10px 12px; }
.cf-title { margin-bottom: 8px; }
.cf-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cf-pane { border: 1px solid var(--line-2); border-radius: 4px; padding: 8px; min-width: 0; }
.cf-pane h4, .cf-card > h4 { margin: 0 0 6px; font-size: 12px; }
.cf-thumb { display: block; max-width: 100%; max-height: 180px; margin: 0 auto 8px; background: #fff; border: 1px solid var(--line-2); }
.cf-files { margin-bottom: 8px; }
.cf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 800px) { .cf-sides { grid-template-columns: 1fr; } }
.lib-tree-head { flex-wrap: wrap; }

/* material presets */
.mp-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.mp-head .grow { flex: 1; min-width: 0; }
.mp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, 46%) 1fr; gap: 0; }
.mp-list { overflow: auto; padding: 10px 14px; border-right: 1px solid var(--line); background: var(--panel); }
.mp-table tbody tr { cursor: pointer; }
.mp-table tbody tr:hover { background: var(--panel-2); }
.mp-table tbody tr.on { background: var(--accent-weak); }
.mp-table tr.mp-retired td { color: var(--muted); text-decoration: line-through; }
.mp-table tr.mp-retired td:last-child { text-decoration: none; }
.mp-table td.num { text-align: right; }
.mp-table .badge { text-transform: none; white-space: normal; }
.mp-edit { overflow: auto; padding: 12px 16px; }
.mp-edit h2 { font-size: 15px; }
.mp-form { grid-template-columns: 140px 1fr; align-items: start; }
.mp-form textarea, .mp-form input[type=text] { width: 100%; }
.mp-notes textarea { width: 100%; resize: vertical; font-family: var(--mono); font-size: 11.5px; }
.mp-actions { gap: 6px; margin: 8px 0; padding-top: 8px; border-top: 1px solid var(--line-2); }
.mp-actions .grow { flex: 1; }
.mp-hist .row { gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line-2); align-items: baseline; }
.mp-hist .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mat-nomatch { color: var(--warn); }
@media (max-width: 900px) { .mp-body { grid-template-columns: 1fr; } .mp-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; } }
.mp-table th { white-space: nowrap; }

/* home */
.home { max-width: 1500px; }
.home-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.home-top .grow, .home .tsec-head .grow { flex: 1; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; align-items: start; }
.home-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.home-card { border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; background: var(--panel); cursor: pointer; }
.home-card:hover, .home-card:focus { border-color: var(--accent); outline: none; background: var(--accent-weak); }
.home-card.child { margin-left: 16px; border-style: dashed; }
.home-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.home-card-head .grow { flex: 1; }
.home-card-facts { display: flex; flex-direction: column; gap: 1px; font-size: 11.5px; }
.home-group { margin: 8px 0 12px; }
.home-group h4 { margin: 0 0 4px; font-size: 12px; }
.home-orders tr.late td { background: var(--danger-weak); }
.home-act { white-space: nowrap; }
.home-act select { margin-left: 4px; width: auto; max-width: 130px; }
.home-suggest { margin-top: 6px; padding-top: 4px; border-top: 1px dashed var(--line); }
.home-rels { display: flex; flex-direction: column; gap: 4px; }
.home-rel { display: flex; gap: 8px; align-items: center; padding: 4px; border: 1px solid var(--line-2); border-radius: 4px; cursor: pointer; }
.home-rel:hover, .home-rel:focus { border-color: var(--accent); outline: none; }
.home-rel.new { border-left: 3px solid var(--accent); }
.home-rel img, .home-thumb-none { width: 48px; height: 48px; object-fit: contain; flex: none; background: var(--panel-2); border-radius: 3px; }
.home-rel-text { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1000px) { .home-grid { grid-template-columns: 1fr; } }

/* releases */
.rel-page { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.rel-head, .rel-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.rel-head .rel-title { font-size: 14px; }
.rel-head .grow, .rel-bar .grow, .rel-card .grow { flex: 1; min-width: 0; }
.rel-filters .rel-q { flex: 1 1 260px; min-width: 180px; width: auto; }
.rel-filters select { width: auto; max-width: 280px; }
.rel-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; align-content: start; }
.rel-card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; min-width: 0; display: flex; flex-direction: column; }
.rel-card:hover, .rel-card:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent); }
.rel-card .thumb { height: 140px; background: #e9ebee; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line-2); overflow: hidden; }
.rel-card .thumb img { max-width: 100%; max-height: 100%; }
.rel-ph { color: var(--muted); font-size: 11.5px; border: 1px dashed var(--line); border-radius: 3px; padding: 18px 22px; }
.rel-card .cbody { padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.rel-card .row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.rel-card .ell, .rel-side .ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-rev { font-weight: 600; white-space: nowrap; }
.rel-large { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 6px; }
.rel-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rel-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 10px; flex: 1; min-height: 420px; }
.rel-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.rel-stage { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.rel-3d { flex: 1; min-height: 0; position: relative; background: #e9ebee; }
.rel-3d canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.rel-3d-bar { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; padding: 4px 6px; border-top: 1px solid var(--line-2); background: var(--panel-2); }
.rel-3d-msg { position: absolute; top: 40%; left: 0; right: 0; text-align: center; color: var(--muted); pointer-events: none; padding: 0 16px; }
.rel-pdf { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; }
.rel-side { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; overflow: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.rel-side h3 { margin-top: 6px; }
.rel-side .lib-dl { grid-template-columns: 82px 1fr; }
.rel-side-head { font-size: 14px; }
.rel-name { font-weight: 600; overflow-wrap: anywhere; }
.rel-qty { padding: 2px 0; border-bottom: 1px solid var(--line-2); }
.rel-qty .row, .rel-qty-total { display: flex; gap: 6px; }
.rel-qty-total .grow, .rel-qty .grow { flex: 1; }
.rel-hist .timeline li.on { font-weight: 600; }
@media (max-width: 1000px) { .rel-split { grid-template-columns: 1fr; } .rel-left { min-height: 360px; } }

/* read-only roles: editor controls hidden or disabled by js/readonly.js */
body.readonly .ro-hidden { display: none !important; }
body.readonly #pane-part input:disabled, body.readonly #pane-part textarea:disabled, body.readonly #pane-part select:disabled,
body.readonly #pane-stackup input:disabled, body.readonly #pane-stackup select:disabled { color: var(--text); cursor: default; }

/* experimental features (stack-up) */
.badge.exp { color: #6b3fa0; background: #f2ebfa; border-color: #d6c4ee; }
.tabs .badge.exp { margin-left: 3px; padding: 0 3px; font-size: 9px; vertical-align: 1px; }
.su-exp { margin: 2px 0 4px; }

/* completeness: rules editor */
#modal .dlg.ck-rules-dlg { width: 820px; }
.ck-rules-table { margin-bottom: 8px; }
.ck-rules-table td select { width: auto; min-width: 150px; }
.ck-rules-table td.lvl-block, .ck-rules-table select.lvl-block { color: var(--warn); }
.ck-rules-table td.lvl-off, .ck-rules-table select.lvl-off { color: var(--muted); }
.ck-rules-hist { font-size: 11.5px; max-height: 160px; overflow: auto; }

/* library: conflict copies in red */
.lib-card.conflict { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); background: var(--danger-weak); }
.lib-card.conflict .thumb { border-bottom-color: #f0c2bd; }
.lib-conflict { white-space: nowrap; flex-shrink: 0; }
.lib-list tr.conflict td { background: var(--danger-weak); }
.lib-list tr.conflict td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

/* ---- pages: frame, cards, states, admin panel, settings, help (js/admin_pages.js, js/account_pages.js) ---- */
#team-page { flex: 1 1 auto; overflow: auto; min-height: 0; padding: 24px 32px; }
#team-page.full { padding: 0; overflow: hidden; display: flex; }
#team-page.col { flex-direction: column; }
.page { max-width: 1180px; margin: 0 auto; padding: 0 0 var(--sp-6); }
.page.wide { max-width: 1500px; }
.page-head { display: flex; align-items: flex-start; gap: var(--sp-3); margin: 0 0 var(--sp-4); }
.page-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-title h1 { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.25; }
.page-intro { margin: 0; color: var(--muted); max-width: 80ch; }
.admins-only { font-size: var(--fs-sm); color: var(--faint); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: var(--sp-4); min-width: 0; }
.card > h2, .card > h3 { margin-bottom: 8px; }
.card h2 { font-size: var(--fs-lg); }
.card.attention { border-left: 4px solid #B4540A; }
.sec-head { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.sec-head h2 { font-size: var(--fs-xl); }
.sec-head p { margin: 4px 0 0; }
.table-wrap { overflow-x: auto; }
.table-wrap > table { min-width: 720px; }
.settings-form { max-width: 860px; }
.set-row { display: grid; grid-template-columns: 200px 1fr; gap: var(--sp-3); padding: 12px 0; border-bottom: 1px solid var(--line-2); align-items: start; }
.set-row:last-of-type { border-bottom: 0; }
.set-label { font-weight: 500; }
.set-val { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chk-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-foot { display: flex; align-items: center; gap: var(--sp-3); padding-top: 12px; }
.tab-count { background: #B4540A; color: #fff; border-radius: 10px; padding: 0 7px; font-size: var(--fs-xs); }
.invite-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.invite-row label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); color: var(--muted); }
.invite-row select { width: auto; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-4); }
.fact-label { font-size: var(--fs-sm); color: var(--muted); }
.fact-val { font-size: var(--fs-lg); font-weight: 600; margin: 2px 0; }
dl.kv.wide { grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: var(--fs-md); }
.gmail { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.device-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.matrix th.c, .matrix td.c { text-align: center; width: 120px; }
.download { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.download .big { font-size: 28px; font-weight: 600; }
ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.guide { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); }
.guide:hover { border-color: var(--accent); background: var(--accent-weak); }
.flow { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 8px 0 12px; }
.flow-step { flex: 1 0 150px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--panel-2); font-size: var(--fs-sm); display: flex; flex-direction: column; gap: 4px; }
.flow-who { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.flow-arrow { align-self: center; color: var(--muted); }
.flow-routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin: 8px 0; }
dl.keys { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0; }
dl.keys dd { margin: 0; }
kbd { font: 12px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; background: var(--panel-2); }
.help-search input { width: 280px; }
.state { padding: var(--sp-5) var(--sp-4); text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.state b, .state h2 { color: var(--text); }
.state.big { padding: 64px 24px; }
.state.error { color: var(--danger); background: var(--danger-weak); border: 1px solid var(--danger-line); border-radius: var(--radius); }
.state.error b { color: var(--danger); }
.state.loading { flex-direction: row; justify-content: center; }
.spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }
.lib-page { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; }
.lib-host { flex: 1 1 auto; min-height: 0; min-width: 0; display: flex; }
.lib-host.scroll { overflow: auto; display: block; padding: var(--sp-4) var(--sp-5); }
.lib-host.full > .lib-wrap, .lib-host.full > .cf-page { flex: 1 1 auto; }
.lib-open .card { padding: 0; }
.lib-open .card .sec:last-child { border-bottom: 0; }
.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: var(--sp-4); align-items: start; }
.people-table td { vertical-align: top; }
.people-table select { width: auto; min-width: 140px; }
.people-table .device { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 1px 0; }
.people-table .device.off { color: var(--muted); }
.roles-dl { display: grid; grid-template-columns: 140px 1fr; gap: var(--sp-2) var(--sp-3); margin: 0; }
.roles-dl dt { font-weight: 600; }
.roles-dl dd { margin: 0; color: var(--muted); }
.grant-list { max-height: 50vh; overflow: auto; }
.send-card .send-foot { margin-top: 4px; font-size: var(--fs-xs); }
#team-page .mp-head h2 { font-size: var(--fs-xl); }
#team-page .tpage { max-width: 1500px; }
#team-page .tcol { border-radius: 10px; }
/* sign-in (mockup SignOut.dc.html, the signed-out screen) */
body.signed-out { background: var(--sb-bg); }
body.signed-out #appcol { background: var(--sb-bg); }
.signin { margin: 12vh auto 0; max-width: 420px; background: var(--sb-bg); border: 0; color: var(--sb-text); padding: 24px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.signin-brand { display: flex; align-items: center; gap: 12px; }
.signin-brand img { height: 40px; }
.signin-brand span { color: #fff; font-weight: 600; font-size: 20px; letter-spacing: .04em; padding-left: 12px; border-left: 1px solid var(--sb-line); }
.signin .signin-state { color: #fff; font-size: var(--fs-lg); margin: 8px 0 0; }
.signin .hint, .signin .muted { color: var(--sb-muted); }
.signin a.google { padding: 10px 18px; font-size: var(--fs-md); }
.signin .ulist { width: 100%; }
.signin .ulist button { display: flex; width: 100%; justify-content: space-between; margin: 4px 0; padding: 8px 12px; }
.signin h3 { color: var(--sb-muted); }
/* the bell panel footer */
.bell-foot { padding: 8px 10px; border-top: 1px solid var(--line-2); font-size: var(--fs-sm); color: var(--muted); }
#notify-bell .bell-item { text-decoration: none; }
/* readability (second round): wide tables keep a minimum width and scroll sideways in their box */
#team-page .team-table { min-width: 640px; }
#team-page .tcol { overflow-x: auto; }
#view3d .toolbar label.chk.sel select { width: auto; padding: 1px 4px; margin-left: 4px; }
/* Q4-7: the 3D toolbar stays on one line at the desktop's default window width (the lists are as wide as their longest entry otherwise) */
#view3d .toolbar #v-section { width: 66px; }
#view3d .toolbar #v-display { width: 118px; }
.folders select { width: auto; min-width: 150px; }
.folders input[type=text] { max-width: 220px; }
.invited { font-size: var(--fs-sm); color: var(--muted); margin-top: 10px; }
.rsince { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.rsince:empty { display: none; }
.rbox { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: var(--fs-sm); background: var(--panel-2); }
.rbox.warn { border-color: var(--warn-line); background: var(--warn-weak); }
.rbox ul { margin: 4px 0 0 16px; padding: 0; }
/* Home per role (home_pages.js) */
.home-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.home-grid2 .home-wide { grid-column: 1 / -1; }
.home-card2 { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.needs { display: flex; flex-direction: column; gap: 6px; }
.need { display: flex; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); }
.need:hover { border-color: var(--accent); background: var(--accent-weak); }
.need-n { font-weight: 600; color: var(--accent); }
.stage-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.count-box { flex: 1 1 90px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; text-decoration: none; color: var(--muted); font-size: var(--fs-sm); }
.count-box .big, .stage-n .big { font-size: 22px; font-weight: 600; color: var(--text); }
.stage-row { display: flex; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.stage-n { width: 170px; display: flex; justify-content: space-between; align-items: baseline; }
.stage-names { display: flex; gap: 10px; flex-wrap: wrap; }
.recent { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.recent-card { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-decoration: none; color: var(--text); font-size: var(--fs-sm); }
.recent-card img { height: 70px; object-fit: contain; background: var(--panel-2); border-radius: 6px; }
tr.late td { background: var(--danger-weak); }
#modal .dlg.wide { width: 720px; } .sv-mail textarea { width: 100%; margin: 6px 0; } .sv-att li { font-size: var(--fs-sm); }
.rel-selbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.rel-card .thumb { position: relative; }
.rel-tick { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; }
.rel-card.ticked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rel-card .sent { color: var(--ok); font-size: var(--fs-sm); }
.rel-picture { flex: 1; display: flex; align-items: center; justify-content: center; background: #fff; min-height: 300px; } .rel-picture img { max-width: 100%; max-height: 100%; object-fit: contain; }
.orders-board .board { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 10px; overflow-x: auto; }
.bcol { background: var(--panel-2); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 170px; }
.bcol-head { font-weight: 600; }
.ocard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: var(--fs-sm); }
.ocard.late { border-color: var(--danger-line); }
.ocard-acts { margin-top: 6px; gap: 4px; }
.issues-box { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); } .issues-box h2 { font-size: var(--fs-md); }
.pin-wrap { position: relative; }
.pin-wrap img { width: 100%; display: block; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%; background: #B4540A; color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; pointer-events: none; }
.pin.new { background: var(--accent); }
.pin-n { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; background: #B4540A; color: #fff; font-size: 11px; align-items: center; justify-content: center; margin-right: 6px; }
.pane-title .sec-sel { width: auto; font-size: 12px; padding: 0 4px; text-transform: none; }
/* pop-out windows (popout.js) */
.pop-btn { width: 30px; height: 30px; margin-left: 4px; }
#dwg-view .dwg-pop { position: absolute; top: 8px; left: 8px; z-index: 2; margin: 0; background: rgba(255,255,255,.93); }
body.popout #sidebar, body.popout #topbar, body.popout #part-head, body.popout #side, body.popout #activity, body.popout #blocked, body.popout #review-note,
body.popout #ws-browser { display: none !important; }
body.popout #appcol { padding-top: 40px; }
body.popout-drawing #view3d, body.popout-drawing #divider { display: none !important; }
body.popout-drawing #drawing { flex: 1 1 0 !important; }
body.popout-model #drawing, body.popout-model #divider { display: none !important; }
body.popout-model #ws-toolbar, body.popout-model #ws-bottom { display: none !important; }   /* the 3D window has no sheet tools */
.popout-bar { position: fixed; top: 0; left: 0; right: 0; height: 40px; z-index: 50; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.home-wide .row select { width: auto; } .home-wide .row h2 { margin: 0; }
.lib-list { overflow-x: auto; } .lib-list th, .lib-list td { white-space: nowrap; } .lib-list .pill { white-space: nowrap; }
.rel-open { display: flex; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.vendors-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.vlist-card { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.vitem { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 0; background: transparent; padding: 10px; border-radius: 8px; white-space: normal; }
.vitem.on { background: var(--accent-weak); }
.vdetail { display: flex; flex-direction: column; gap: 10px; }
.vdetail .kv dd > div { margin-bottom: 2px; }
.asm-host { flex: 1; position: relative; min-height: 0; display: flex; }
.asm-host .asm3 { flex: 1; }
.asm-tree { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-height: 70%; overflow: auto; font-size: var(--fs-sm); display: flex; flex-direction: column; gap: 2px; }
.asm-tree-head { font-weight: 600; }
.pane-title button.small.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }
.sheet-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; } .issue-sheets .pin-wrap { max-height: 300px; overflow: auto; } #modal .dlg:has(.issue-sheets .pin-wrap) { width: 720px; }

/* RV: review inside the read-only part editor (js/review_editor.js). The change highlights are a
   view layer of the sheet (SheetView.review), never in the PDF. */
:root { --rv-chg: #C2189B; --rv-chg-fill: rgba(194, 24, 155, .10); --rv-rem: #6b7280; }
#review-panel { width: 340px; flex: 0 0 340px; border-left: 1px solid var(--line); background: var(--panel); overflow: auto; display: flex; flex-direction: column; font-size: var(--fs-sm); }
#review-panel[hidden] { display: none; }
/* (the Activity panel shows in a review too: it is a tab of the right panel now) */
.rv-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.rv-head .row { display: flex; align-items: center; gap: 8px; }
.rv-sec { padding: 10px 14px; border-bottom: 1px solid var(--line-2, var(--line)); display: flex; flex-direction: column; gap: 6px; }
.rv-sec.warn { background: var(--warn-weak); }
.rv-title { display: flex; align-items: center; gap: 8px; }
.rv-toggle { font-weight: normal; }
.rv-sub { font-weight: 600; margin-top: 4px; }
.rv-legend { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.rv-sw { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-left: 4px; }
.rv-sw.chg { border: 2px solid var(--rv-chg); background: var(--rv-chg-fill); }
.rv-sw.rem { border: 1.5px dashed var(--rv-rem); }
.rv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rv-item { display: flex; gap: 8px; align-items: flex-start; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.rv-item:hover, .rv-item:focus-visible { background: var(--panel-2, #f4f5f7); outline: none; }
.rv-item.auto { opacity: .75; }
.rv-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; }
.rv-dot.chg { background: var(--rv-chg); }
.rv-dot.rem { border: 1.5px dashed var(--rv-rem); }
.rv-on { color: var(--muted); font-family: var(--mono, ui-monospace, monospace); font-size: 11.5px; word-break: break-word; }
.rv-where { flex: 0 0 auto; font-size: 11px; white-space: nowrap; }
.rv-auto summary, .rv-log summary { cursor: pointer; color: var(--muted); }
.rv-log ul { margin: 4px 0 0 16px; padding: 0; }
.rv-check { padding: 2px 0; }
.rv-check.block b { color: var(--danger); }
.rv-comments .rcomment.pinned { cursor: pointer; }
.rv-comments .rcomment.pinned:hover { border-color: #B4540A; }
.rv-compose textarea { width: 100%; box-sizing: border-box; }
.rv-compose .row { display: flex; align-items: center; gap: 6px; }
.rv-compose button.on { background: var(--accent-weak, #e8eefb); border-color: var(--accent); color: var(--accent); }
/* the sheet layer */
.rv-layer .rv-box { vector-effect: non-scaling-stroke; pointer-events: all; cursor: help; }
.rv-layer .rv-chg { fill: var(--rv-chg-fill); stroke: var(--rv-chg); stroke-width: 2; }
.rv-layer .rv-ghost { fill: rgba(107, 114, 128, .06); stroke: var(--rv-rem); stroke-width: 1.5; stroke-dasharray: 5 4; }
.rv-layer .rv-flash { stroke-width: 4; animation: rv-flash .4s ease-in-out 3 alternate; }
@keyframes rv-flash { from { stroke-opacity: 1; } to { stroke-opacity: .25; } }
.rv-layer .rv-pin circle { fill: #B4540A; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.rv-layer .rv-pin.new circle { fill: var(--accent); }
.rv-layer .rv-pin text { fill: #fff; font-weight: 600; pointer-events: none; }
.rv-layer .rv-pin { pointer-events: all; }
.rv-tip { position: fixed; z-index: 1000; max-width: 320px; background: #1f2430; color: #fff; padding: 6px 9px; border-radius: 6px; font-size: 12px; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.rv-tip .rv-on { color: #d9dbe2; }
.rv-tip[hidden] { display: none; }
/* 3D: the part in its assembly, over the 3D view */
#v-asm.on { background: var(--accent-weak, #e8eefb); border-color: var(--accent); color: var(--accent); }
.rv-asm { position: absolute; inset: 44px 0 0 0; display: flex; background: #e9ebee; z-index: 3; }
.rv-asm[hidden] { display: none; }
.rv-asm .asm3 { flex: 1; }
body.popout #review-panel { display: none !important; }
/* RV: the drawing on screen is not the current one (review_editor.js dwgBanner) */
.rv-dwg-banner { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 4; max-width: 80%; background: #fff4e5; color: #6b3d00; border: 1px solid #f0b46a; border-radius: 6px; padding: 6px 10px; font-size: var(--fs-sm, 12px); box-shadow: 0 2px 8px rgba(0,0,0,.15); pointer-events: none; }

/* Phase 2B: threads from Fusion and the hole groups (js/thread_proposals.js) */
#pane-threads { border-top: 1px solid var(--line-2); padding: 0 8px 4px; max-height: 42vh; overflow: auto; font-size: 13px; background: var(--panel); }
#pane-threads summary { cursor: pointer; padding: 4px 0 2px; position: sticky; top: 0; z-index: 1; background: var(--panel); }
/* #59: open, the block never takes the sheet's height. Wide: a side column next to the sheet;
   narrow: a low drawer under it. Each scrolls on its own (js/thread_proposals.js placeBlock). */
#drawing.tp-drawer #pane-threads { max-height: min(24vh, 200px); }
#drawing.tp-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas: "view side" "ann side" "info info"; }
#drawing.tp-side > #dwg-view { grid-area: view; }
#drawing.tp-side > #dwg-ann { grid-area: ann; }
#drawing.tp-side > #pane-threads { grid-area: side; max-height: none; min-height: 0; border-top: 0; border-left: 1px solid var(--line); }
#drawing.tp-side > #dwg-info { grid-area: info; }
#drawing.tp-side #pane-threads .tp-body > .sec { flex-basis: 100%; }
#pane-threads .tp-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
#pane-threads .tp-body > .sec { flex: 1 1 320px; min-width: 0; padding: 8px; }
#pane-threads .tp-list { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#pane-threads .tp-list li { border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
#pane-threads .tp-list li.on { border-color: var(--accent, #2457C5); }
#pane-threads .tp-list li.tp-rejected { opacity: .7; }
#pane-threads .tp-fusion { background: #FDF6E7; border: 1px solid #E7C57A; border-radius: 8px; }
#pane-threads .linkish { background: none; border: 0; padding: 0; text-align: left; font: inherit; font-weight: 600; cursor: pointer; color: inherit; }
#pane-threads .db-sub { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
#pane-threads .db-grid { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 3px 4px; align-items: center; }
.tp-badge { font-family: 'IBM Plex Mono', monospace; font-size: 12px; background: #FDF6E7; border: 1px dashed #B4540A; color: #8A3F06; padding: 1px 6px; border-radius: 4px; }

/* Phase 4 (docs/sync.md 13): Take part in the part header, the sync box's on-this-PC lines, the clash view */
.take-bar { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.sync-line { border-top: 1px solid var(--line, #ddd); padding: 6px 0; display: grid; gap: 4px; }
.sync-line button { justify-self: start; }
.cf-changes { margin: 6px 0; padding-left: 18px; }
.cf-changes li { margin: 2px 0; }

/* ---- Two tab styles (UI redesign 2, round 5 S1). Every tab-like control is one of these two; no
   other rule in the app styles tabs (tests/app/test_ui2_s1_first_day_tabs.py reads this block).
   PAGE TABS (underline): switch a whole page, a whole panel or a whole list: the Admin panel's
   sections, Orders | Vendors, the Library page, the right panel's tabs (Properties, Checks, ...),
   the Reviews list (For me, Mine, Done).
   PANEL TABS (pill): switch a part inside a panel or a page section: Properties' and Checks'
   sub-tabs, the face form's kinds (Size, Thread, ...), views (List, Cards, BOM; Grid, List), the
   BOM kinds, the Fusion inbox's sections, sheets of an issue. The workspace's sheet tabs
   (.ws-tab, css/workspace.css) already have this look.
   (The stage buttons with counts on Projects are filters, not tabs: .pp-stg in project_page.js.) */
/* page tabs */
.page-tabs, .review-list .sub-tabs { display: flex; flex: 0 0 auto; gap: 2px; border-bottom: 1px solid var(--line); background: var(--panel); }
.page-tabs { padding: 0 var(--sp-4); }
.page-tabs.inline { gap: 4px; padding: 0; background: transparent; margin-bottom: 20px; }
.page-tabs > button, .page-tabs > a, .review-list .sub-tabs > button, .side-tabs button[data-panel] {
  flex: none; display: inline-flex; gap: 6px; align-items: center; justify-content: center; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; padding: 9px 12px 8px; color: var(--muted); font-weight: 400; text-decoration: none; }
.review-list .sub-tabs > button { flex: 1 1 0; padding: 8px 4px; }
.side-tabs button[data-panel] { padding: 8px 7px 7px; font-size: var(--fs-sm); }
.page-tabs > button:hover:not(:disabled), .page-tabs > a:hover, .review-list .sub-tabs > button:hover:not(:disabled), .side-tabs button[data-panel]:hover:not(:disabled) {
  color: var(--text); background: transparent; border-color: transparent; }
.page-tabs > button.on, .page-tabs > a.on, .review-list .sub-tabs > button.on, .side-tabs button[data-panel].on,
.page-tabs > button.on:hover:not(:disabled), .page-tabs > a.on:hover, .review-list .sub-tabs > button.on:hover:not(:disabled), .side-tabs button[data-panel].on:hover:not(:disabled) {
  color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; background: transparent; }
/* panel tabs */
.tabs[data-tabs], .seg, .bomtabs, .pp-views, .sheet-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tabs[data-tabs], .seg { margin-bottom: 6px; }
.tabs[data-tabs] { padding: 6px 8px 0; }
.tabs[data-tabs] > button, .seg > button, .bomtabs > button, .pp-views > button, .sheet-tabs > button {
  flex: 0 1 auto; min-width: 0; margin: 0; font-size: var(--fs-sm); padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm, 6px);
  background: var(--panel); color: var(--muted); font-weight: 400; }
.tabs[data-tabs] > button, .seg > button { flex: 1 0 auto; }
.tabs[data-tabs] > button:hover:not(:disabled), .seg > button:hover:not(:disabled), .bomtabs > button:hover:not(:disabled), .pp-views > button:hover:not(:disabled), .sheet-tabs > button:hover:not(:disabled) {
  color: var(--text); border-color: #C9CFDA; background: var(--panel); }
.tabs[data-tabs] > button.on, .seg > button.on, .bomtabs > button.on, .pp-views > button.on, .sheet-tabs > button.on,
.tabs[data-tabs] > button.on:hover:not(:disabled), .seg > button.on:hover:not(:disabled), .bomtabs > button.on:hover:not(:disabled), .pp-views > button.on:hover:not(:disabled), .sheet-tabs > button.on:hover:not(:disabled) {
  color: var(--accent-hover); font-weight: 600; border-color: var(--accent); background: var(--accent-weak); }
/* ---- end of the two tab styles ---- */

/* ---- Reviews list: a review set folds open into its parts (27 Nov) ---- */
.review-list .review-set .set-caret { width: 14px; flex: none; color: var(--muted, #6b7280); }
.review-list .review-set.open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.review-list .review-set-parts { margin: 0 0 6px 14px; border-left: 2px solid var(--line, #d9dde3); padding-left: 6px; }
.review-list .review-set-parts .set-part { padding-top: 6px; padding-bottom: 6px; }
