/* UI redesign 2 round 2: the part workspace's toolbar (js/ws_toolbar.js), browser (js/ws_browser.js)
   and bottom bar (js/ws_bottom.js). Colours and sizes come from the tokens in app.css. The frame
   itself (part bar, columns, right panel) is styled in app.css. */

/* ---------------------------------------------------------------- toolbar -- */
.ws-toolbar { display: flex; align-items: stretch; flex: 0 0 auto; min-height: 84px; box-sizing: border-box; padding: 0 8px;
  background: var(--panel-2); border-bottom: 1px solid var(--line); color: var(--text); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.ws-toolbar:empty { display: none; }
.ws-tb-panel { display: flex; flex-direction: column; justify-content: space-between; gap: 3px; padding: 6px 6px 5px;
  border-right: 1px solid var(--line); flex: 0 0 auto; }
.ws-tb-tools { display: flex; gap: 2px; }
.ws-tb-btn { min-width: 50px; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 0 2px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text);
  font: inherit; font-size: 10.5px; line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; cursor: pointer; }
.ws-tb-btn svg { flex: 0 0 auto; }
.ws-tb-btn:hover:not(:disabled) { background: var(--panel); border-color: var(--line); }
.ws-tb-btn.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent-hover); }
.ws-tb-btn:disabled { color: var(--disabled); cursor: default; }
.ws-tb-btn.soon:disabled { opacity: .7; }
.ws-tb-btn:focus-visible, .ws-tb-more:focus-visible, .ws-tb-menu button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ws-tb-more, .ws-tb-name { font: inherit; font-size: 10.5px; letter-spacing: .06em; font-weight: 600; color: var(--muted);
  background: transparent; border: 0; padding: 0; text-align: center; white-space: nowrap; }
.ws-tb-more { cursor: pointer; }
.ws-tb-more:hover, .ws-tb-more[aria-expanded=true] { color: var(--accent); }
.ws-tb-more.on { color: var(--accent-hover); background: var(--accent-weak); border-radius: 4px; }   /* a tool of its menu is running */
.ws-tb-grow { flex: 1 1 auto; min-width: 0; }
/* the read-only reason: up to three short lines at the right end, the whole text in its tooltip */
.ws-tb-lock { align-self: center; flex: 0 1 230px; min-width: 120px; box-sizing: border-box; overflow: hidden; font-size: 11px; line-height: 1.3;
  color: var(--muted); padding: 0 8px 0 10px; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.ws-tb-fmt { align-self: center; font: inherit; font-size: var(--fs-xs); color: var(--accent); background: transparent;
  border: 1px dashed var(--accent); border-radius: var(--radius-sm); padding: 4px 8px; margin: 0 6px; cursor: pointer; white-space: nowrap; }
.ws-tb-note { align-self: center; font-size: 11px; color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the menu under a panel name, and the sheet tab's menu (opens upwards) */
.ws-tb-menu { position: fixed; z-index: 60; min-width: 200px; max-width: 320px; padding: 4px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); }
.ws-tb-menu button { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; width: 100%; text-align: left;
  font: inherit; font-size: var(--fs-sm); color: var(--text); background: transparent; border: 0; border-radius: var(--radius-sm);
  padding: 6px 10px; cursor: pointer; }
.ws-tb-menu button:hover:not(:disabled) { background: var(--accent-weak); color: var(--accent-hover); }
.ws-tb-menu button.on { background: var(--accent-weak); color: var(--accent-hover); font-weight: 600; }
.ws-tb-menu button:disabled { color: var(--disabled); cursor: default; }
.ws-tb-menu .ws-why { font-size: 11px; color: var(--faint); white-space: nowrap; }

/* the old tool row, hint line and status row are gone from index.html (their actions are in the toolbar,
   the part bar and the bottom bar); a pop-out drawing window shows one view, so no view switch there */
body.popout .ws-bb-views, body.popout #ws-switch-fallback { display: none !important; }

/* ---------------------------------------------------------------- browser -- */
.ws-browser { flex: 0 0 228px; width: 228px; min-width: 0; box-sizing: border-box; display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text); overflow: hidden; }
.ws-browser.collapsed { flex-basis: 28px; width: 28px; align-items: center; padding-top: 6px; }
.ws-br-head { display: flex; align-items: center; padding: 8px 8px 6px 12px; flex: 0 0 auto; }
.ws-br-title { flex: 1 1 auto; font-size: 11px; letter-spacing: .06em; font-weight: 600; color: var(--muted); }
.ws-br-hide, .ws-br-show { width: 24px; height: 24px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  border-radius: var(--radius-sm); font-size: 16px; line-height: 1; }
.ws-br-hide:hover, .ws-br-show:hover { background: var(--panel-2); color: var(--text); }
.ws-br-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding-bottom: 8px; }
.ws-br-row { display: flex; align-items: center; gap: 6px; width: 100%; box-sizing: border-box; min-height: 28px; flex: 0 0 auto;
  border: 0; border-radius: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
  padding: 3px 10px 3px 12px; }
.ws-br-row.top { font-weight: 500; }
.ws-br-row:hover { background: var(--panel-2); }
.ws-br-row.on { background: var(--accent-weak); color: var(--accent-hover); font-weight: 600; }
.ws-br-row.muted { color: var(--muted); cursor: default; }
.ws-br-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ws-br-caret { width: 12px; flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.ws-br-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-br-right { flex: 0 0 auto; font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
.ws-br-right.mark { color: #8A4B08; font-weight: 600; }
.ws-br-empty { padding: 8px 12px; color: var(--muted); }

/* ------------------------------------------------------------- bottom bar -- */
.ws-bottom { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; min-height: 38px; box-sizing: border-box; padding: 0 10px;
  background: var(--panel); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text); }
.ws-bottom:empty { display: none; }
.ws-bb-tabs { display: flex; align-items: center; gap: 2px; flex: 0 1 auto; min-width: 0; overflow-x: auto; }
.ws-bb-none { color: var(--muted); white-space: nowrap; }
.ws-tab { font: inherit; font-size: var(--fs-sm); padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--muted); cursor: pointer; white-space: nowrap; flex: 0 0 auto; }
.ws-tab:hover:not(:disabled) { color: var(--text); border-color: #C9CFDA; }
.ws-tab.on { color: var(--accent-hover); font-weight: 600; border-color: var(--accent); background: var(--accent-weak); }
.ws-tab:disabled { color: var(--disabled); cursor: default; }
.ws-tab-t { margin-left: 6px; font-size: 11px; font-weight: 400; color: var(--faint); }
.ws-tab-add { padding: 5px 10px; }
.ws-bb-prompt { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 26px; }
.ws-bb-prompt.warn { color: var(--warn); font-weight: 600; }
/* while a tool runs its prompt (with its buttons) needs the whole width: a strip over the sheet's lower edge, so the sheet does not jump */
.ws-bottom { position: relative; }
.ws-bb-views { margin-left: auto; }
.ws-bottom.tooling .ws-bb-prompt { position: absolute; left: 0; right: 0; bottom: 100%; z-index: 3; box-sizing: border-box; padding: 4px 10px;
  white-space: normal; background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -2px 6px rgba(16,24,40,.06); }
.ws-bb-prompt[hidden] { display: none; }
.ws-bb-prompt button.small { margin: 0 2px; padding: 1px 7px; }
.ws-bb-prompt input, .ws-bb-prompt select { height: 24px; }
.ws-bb-views { display: flex; flex: 0 0 auto; border: 1px solid #C9CFDA; border-radius: var(--radius-sm); overflow: hidden; }
.ws-bb-views button { font: inherit; font-size: var(--fs-sm); padding: 5px 10px; border: 0; border-radius: 0; background: var(--panel);
  color: var(--text); cursor: pointer; }
.ws-bb-views button + button { border-left: 1px solid var(--line); }
.ws-bb-views button.on { background: var(--accent); color: #fff; font-weight: 600; }
.ws-bb-zoom { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.ws-zb { font: inherit; font-size: var(--fs-sm); padding: 5px 10px; border-radius: var(--radius-sm); border: 1px solid #C9CFDA;
  background: var(--panel); color: var(--text); cursor: pointer; }
.ws-zb:disabled { color: var(--disabled); cursor: default; }
.ws-bb-pct { width: 44px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.ws-tab:focus-visible, .ws-zb:focus-visible, .ws-bb-views button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* ==== B1, issue 90: click the drawing to comment there (js/review_editor.js openBox) ==== */
/* the cursor over the sheet in a review: a crosshair with a small speech bubble; a pin is a pointer */
#dwg-view .sheet-svg.rv-commenting:not(.panning),
#dwg-view .sheet-svg.rv-commenting:not(.panning) .scene *,
#dwg-view .sheet-svg.rv-commenting:not(.panning) .marks * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cpath d='M8 1v14M1 8h14' stroke='%23fff' stroke-width='3'/%3E%3Cpath d='M8 1v14M1 8h14' stroke='%23111' stroke-width='1.2'/%3E%3Crect x='13' y='12' width='14' height='10' rx='2.5' fill='%232563eb' stroke='%23fff'/%3E%3Cpath d='M16 22l-2 4 5-4z' fill='%232563eb'/%3E%3Cpath d='M16 15.5h8M16 18.5h5' stroke='%23fff' stroke-width='1.2'/%3E%3C/svg%3E") 8 8, crosshair;
}
#dwg-view .sheet-svg.rv-commenting .rv-pin[data-n] { cursor: pointer; }
.rv-layer .rv-pin.new circle { fill: var(--accent); }
.rv-cbox { position: absolute; z-index: 5; width: 290px; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px;
  padding: 8px; background: var(--panel, #fff); border: 1px solid var(--line, #d0d5dd); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(16, 24, 40, .22); font-size: var(--fs-sm, 12px); cursor: default; }
.rv-cbox[hidden] { display: none; }
.rv-cbox-head { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.rv-cbox-n { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; box-sizing: border-box; }
.rv-cbox textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 56px; font: inherit; }
.rv-cbox-row { display: flex; align-items: center; gap: 6px; }
.rv-cbox-row .grow { flex: 1 1 auto; }
.rv-click-hint { font-weight: 600; color: var(--text); }
.rv-comments .rcomment.rv-hl { outline: 2px solid #B4540A; outline-offset: 1px; transition: outline-color .3s; }
/* the author's side: the line over the sheet of a part whose review was sent back (review_editor.js partBanner) */
.rv-part-banner { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 4; max-width: 80%;
  font: inherit; font-size: var(--fs-sm, 12px); text-align: left; cursor: pointer; padding: 6px 12px; border-radius: 6px;
  background: #eef3fe; color: #1d3a7a; border: 1px solid #a9c1f5; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.rv-part-banner.sent-back { background: #fff1f0; color: #7a1d14; border-color: #f2a69c; }
.rv-part-banner:hover { filter: brightness(.97); }
.rv-part-banner:focus-visible { outline: 2px solid var(--focus, #2563eb); outline-offset: 1px; }
#rv-dwg-banner ~ .rv-part-banner, .rv-part-banner ~ #rv-dwg-banner { top: 44px; }
.rv-part-head .row a { font-weight: 600; }
.rv-comments .rcomment .hint { margin-top: 2px; }
/* ==== end B1 issue 90 ==== */

/* ==== B2 issue 91: sync conflicts (conflicts.js, project_page.js, part_shell.js) ==== */
.cf-bar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--danger, #b3261e); color: #fff; font-weight: 600; }
.cf-bar[hidden] { display: none; }
.cf-bar .cf-bar-text { flex: 1 1 auto; min-width: 0; }
.cf-bar .button { background: #fff; color: var(--danger, #b3261e); border-color: #fff; font-weight: 600; text-decoration: none; }
.cf-stg .pp-stg { border-color: var(--danger, #b3261e); color: var(--danger, #b3261e); }
.cf-stg .pp-stg.on { background: var(--danger, #b3261e); color: #fff; }
.cf-mark { margin-left: 6px; text-decoration: none; cursor: pointer; }
.cf-mark:hover { text-decoration: underline; }
.sb-syncbtn { position: relative; }
.sb-syncbtn .cf-sync { position: absolute; top: -6px; right: -6px; min-width: 16px; line-height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--danger, #b3261e); color: #fff; font-size: 10.5px; font-weight: 700; cursor: pointer; box-shadow: 0 0 0 2px var(--sb-bg, #1e2433); }
.sb-syncbtn .cf-sync[hidden] { display: none; }
#ph-conflict { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 6px 24px; background: #fdecea; color: var(--danger, #b3261e);
  border-bottom: 1px solid #f3b8b2; font-size: var(--fs-sm, 13px); }
#ph-conflict[hidden], body.team-mode #ph-conflict, body.popout #ph-conflict { display: none; }
.cf-route { padding: 16px 24px; overflow: auto; height: 100%; box-sizing: border-box; }
.cf-card.cf-focus { outline: 2px solid var(--danger, #b3261e); outline-offset: 2px; }
/* ==== end B2 issue 91 ==== */

/* ==== B2 walk: nothing in the part bar moves under the cursor, and no button is clipped ====
   One line at every width: the left side (back, name, chips, owner) gives way and is cut with "…";
   the buttons on the right never shrink. The primary button and the Saved word keep one width
   whatever they say, so a late change ("Make drawing", "Saving…", "Read-only") moves nothing. */
#part-head > .pb-row:first-child { flex-wrap: nowrap; }
#part-head > .pb-row:first-child > button, #part-head > .pb-row:first-child > .menu-wrap,
#part-head > .pb-row:first-child > a.button:not(.pb-back) { flex-shrink: 0; white-space: nowrap; }
#part-head #ph-chips { flex-wrap: nowrap; overflow: hidden; }
#part-head #btn-release { min-width: 10.5em; }
#part-head #ph-saved { min-width: 5.5em; text-align: right; }
/* ==== end B2 walk ==== */

/* ==== B2 walk 7: a step waiting for the team server is not an error: amber ==== */
.toast.warn { border-left-color: #e0a100; }
/* ==== end B2 walk 7 ==== */

/* ==== G1 (26 Nov, #92/#94): the feature control frame box is the frame itself; the datum box at the pick ==== */
.fcfx { display: flex; flex-direction: column; gap: 8px; }
.fcfx-starts { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.fcfx-starts .hint { margin-right: 2px; }
.fcfx-starts button.on, .fcfx-mods button.on { background: var(--accent-soft, #e3ecfa); border-color: var(--accent, #1f5fbf); }
.fcfx-frame { box-sizing: border-box; display: inline-flex; align-self: flex-start; border: 2px solid var(--text, #1d2430); background: #fff; font-family: var(--mono, monospace); font-size: 17px; max-width: 100%; }
.fcfx-cell { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-height: 40px; min-width: 36px; padding: 0 6px; flex: none;
  border: 0; border-right: 2px solid var(--text, #1d2430); background: #fff; color: var(--text, #1d2430); font: inherit; border-radius: 0; cursor: pointer; }
.fcfx-cell:last-child { border-right: 0; }
button.fcfx-cell:hover, .fcfx-cell.open { background: var(--accent-soft, #e3ecfa); }
.fcfx-cell:focus-visible { outline: 2px solid var(--accent, #1f5fbf); outline-offset: -3px; }
.fcfx-symcell { min-width: 48px; }
.fcfx-sym svg { width: 34px; height: 23px; display: block; }
.fcfx-valcell { cursor: default; padding: 0 4px; }
.fcfx .fcfx-frame input.fcfx-value { flex: none; min-width: 0; max-width: 54px; width: 54px; border: 1px solid var(--line, #c9ced8); border-radius: 3px; font: inherit; font-size: 16px; padding: 3px 4px; text-align: center; }
.fcfx-tog { border: 1px solid transparent; background: none; font: inherit; font-size: 16px; color: #9aa1ad; padding: 1px 3px; border-radius: 3px; cursor: pointer; }
.fcfx-tog.on { color: var(--text, #1d2430); border-color: var(--accent, #1f5fbf); background: var(--accent-soft, #e3ecfa); }
.fcfx-tog:disabled { color: #d3d6dc; cursor: not-allowed; }
.fcfx-dcell { min-width: 40px; font-weight: 600; }
.fcfx-ph { font-family: var(--sans, "Segoe UI", Arial, sans-serif); font-size: 11.5px; color: #8a92a0; font-weight: 400; }
.fcfx-cell.need { background: #fff4dc; box-shadow: inset 0 0 0 2px #e0a100; }
.fcfx-cell.err { box-shadow: inset 0 0 0 2px #cf3a30; }
.fcfx-pop { border: 1px solid var(--line, #c9ced8); border-radius: 6px; padding: 8px; background: var(--panel, #fff); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); display: flex; flex-direction: column; gap: 8px; }
.fcfx-pop-h { font-weight: 600; }
.fcfx-gname { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #5b6577); margin-bottom: 3px; }
.fcfx-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px; }
.fcfx-tile { white-space: normal; overflow-wrap: anywhere; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--line, #c9ced8); border-radius: 5px; background: #fff; cursor: pointer; text-align: center; font-size: 11.5px; line-height: 1.2; }
.fcfx-tile:hover, .fcfx-tile:focus-visible { border-color: var(--accent, #1f5fbf); background: var(--accent-soft, #e3ecfa); }
.fcfx-tile.on { border-color: var(--accent, #1f5fbf); box-shadow: inset 0 0 0 1px var(--accent, #1f5fbf); }
.fcfx-tile .fcfx-sym svg { width: 30px; height: 20px; }
.fcfx-tile b { font-size: 12px; }
.fcfx-tile span:last-child { color: var(--muted, #5b6577); }
.fcfx-dlist { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fcfx-dbtn { background: none; border: 1px solid transparent; border-radius: 4px; padding: 3px; cursor: pointer; }
.fcfx-dbtn:hover, .fcfx-dbtn.on { border-color: var(--accent, #1f5fbf); }
.fcfx-dnew { border: 1px dashed var(--accent, #1f5fbf); background: var(--accent-soft, #e3ecfa); color: var(--accent, #1f5fbf); border-radius: 4px; padding: 6px 9px; cursor: pointer; font-weight: 600; }
.fcfx-mods { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.fcfx-say { font-size: 13.5px; line-height: 1.4; }
.fcfx-err { font-size: 12.5px; padding: 5px 8px; border-radius: 4px; }
.fcfx-err.need { background: #fff4dc; color: #7a4f00; }
.fcfx-err.bad { background: #fbe9e7; color: #a12a20; }
.fcfx-err.info { background: var(--accent-soft, #e3ecfa); color: var(--accent, #1f5fbf); }
.fcfx.picking .fcfx-frame { opacity: .55; }
.fcfx-notice { background: #fff4dc; border: 1px solid #f0d58a; border-radius: 5px; padding: 6px 8px; font-size: 12.5px; color: #6b4600; display: flex; flex-direction: column; gap: 6px; }
.dpop { position: fixed; z-index: 60; background: var(--panel, #fff); border: 1px solid var(--line, #c9ced8); border-radius: 7px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; max-width: 280px; font-size: 13px; }
.dpop-row { display: flex; align-items: center; gap: 6px; }
.dpop input { width: 44px; text-align: center; font-weight: 600; font-size: 15px; }
.dpop .dpop-x { border: 0; background: none; font-size: 16px; cursor: pointer; color: var(--muted, #5b6577); margin-left: auto; }
.dpop-msg { font-size: 12.5px; }
.dpop-msg.bad { color: #a12a20; }
.dpop-msg.warn { background: #fff4dc; color: #6b4600; padding: 4px 6px; border-radius: 4px; }
/* 27 Nov (G1 follow-up): what a click on the sheet would take, while a pick tool waits */
.ws-pick-hover .hv-dim { fill: rgba(31, 95, 191, .08); stroke: #1f5fbf; stroke-width: 0.5; }
.ws-pick-hover .hv-edge { fill: none; stroke: rgba(31, 95, 191, .75); stroke-linecap: round; }
.ws-pick-hover .hv-face { fill: rgba(31, 95, 191, .28); stroke: none; }
.ws-pick-tip { position: fixed; z-index: 70; pointer-events: none; background: #1d2430; color: #fff; font-size: 11.5px; padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.ws-pick-tip[hidden] { display: none; }
/* ==== end G1 (26 Nov) ==== */

/* ==== 0.5 4c: History, Kept versions, newer version bar (docs/sync-0-5.md C.3, C.4, C.6) ==== */
.hist { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; min-width: 0; }
.hist-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hist-head .muted { flex: 1 1 18em; min-width: 0; }
.hist-quiet { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.hist-note { padding: 6px 10px; border-radius: 4px; background: var(--info-weak); color: var(--info); border: 1px solid var(--info-line); }
.hist-note.warn { background: var(--warn-weak); color: var(--warn); border-color: #ecd9a0; }
.hist-note.bad { background: var(--danger-weak); color: var(--danger); border-color: #f0c2bd; }
.hist-list { display: flex; flex-direction: column; border-top: 1px solid var(--line, #dde2ea); }
.hist-row { padding: 6px 2px; border-bottom: 1px solid var(--line, #dde2ea); }
.hist-row.hist-now { background: #f3f8f4; }
.hist-row.hist-kept { background: var(--warn-weak); }
.hist-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.hist-v { min-width: 2.6em; }
.hist-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.hist-who { color: var(--muted); }
.hist-what { flex: 1 1 10em; min-width: 0; }
.hist-acts { display: inline-flex; gap: 6px; margin-left: auto; }
.hist-kepttext { margin: 2px 0 0 3.2em; color: var(--warn); font-weight: 600; }
.hist-why { margin: 2px 0 0 3.2em; }
.hist-detail { margin: 6px 0 2px 3.2em; }
.hist-detail[hidden] { display: none; }
.hist-changes { margin: 4px 0; padding-left: 18px; }
.hist-files ul { margin: 4px 0; padding-left: 18px; }
.badge.info { color: var(--info); background: var(--info-weak); border-color: var(--info-line); }
.kept-page { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; max-width: 980px; }
.kept-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kept-head .muted { flex: 1 1 20em; }
.kept-list, .kept-legacy { display: flex; flex-direction: column; gap: 8px; }
.kept-card { border: 1px solid var(--line, #dde2ea); border-left: 3px solid var(--warn); border-radius: 4px; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; background: #fff; }
.kept-card.kept-done { opacity: .7; border-left-color: var(--line, #dde2ea); }
.kept-card.kept-old { border-left-color: var(--muted); }
.kept-card.cf-focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.kept-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.kept-toggle { font-size: 12px; }
/* the Projects bar and the part bar are information now, not an alarm (C.6) */
.cf-bar { background: var(--info-weak); color: var(--info); font-weight: 500; border-bottom: 1px solid var(--info-line); }
.cf-bar .button { background: #fff; color: var(--info); border-color: var(--info-line); }
#ph-conflict.kept-partbar { background: var(--info-weak); color: var(--info); }
/* R5 pages: an overlay, never in the flow: its arrival must not move a field under the pointer */
.newer-bar { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 50; max-width: min(720px, calc(100vw - 32px)); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 16px; background: var(--accent-weak); color: var(--accent-hover); border: 1px solid #c6d6f3; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.newer-bar .newer-note { color: var(--muted); font-size: 12px; }
body.popout .newer-bar { display: none; }
/* R6 pages: the lines that arrive late under the part bar (who else is editing, a kept save, not kept
   on this PC, a clash) are overlays too: none of them moves a field under the pointer */
#ph-editing, #ph-conflict { position: fixed; left: 50%; transform: translateX(-50%); z-index: 49; max-width: min(720px, calc(100vw - 32px)); border: 1px solid var(--line, #d0d4da); border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
#ph-editing { top: 104px; }
#ph-conflict { top: 146px; }
#ph-editing[hidden], #ph-conflict[hidden] { display: none !important; }
body.popout #ph-editing, body.popout #ph-conflict { position: static; transform: none; }
/* R6 pages: the part bar's lower row keeps one line whatever its reason says ("Drawing out of date.
   Update drawing" arriving after a save wrapped it to two and moved the panel down) */
#part-head .pb-under { height: 22px; min-height: 22px; flex-wrap: nowrap; overflow: hidden; }
#part-head .pb-under .ph-why { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* Restore asks in the app's dialog (#modal, z-index 40): the History side panel stays under it, and
   over the workspace; menus (60+), toasts (50) and the sync pop-up stay above it.
   0.5 F2: the one place its z-index is set (part_shell.js sets none) */
#ws-versions { z-index: 39; }
/* the kept count is information (amber), not a red alarm; it is on the Kept versions entries only */
.cf-badge { background: var(--warn); }
/* ==== end 0.5 4c ==== */
