/* The project bar on a computer as Eddy approved it (bar-layout.js; 2026-11-21): the two wrappers step aside so every control is placed by
   its order in the one bar; thin lines part the groups; edit, look and play sit in one pill; plain line symbols; names on hover in the
   DAVINCI glass. Phones keep phone-layout.css. */
@media (min-width: 701px) {
  /* hidden until the bar has been arranged (bar-layout.js adds v8-bar-ready); a CSS failsafe shows it after 3 s even if the script never runs */
  body:not(.v8-bar-ready) :is(#workspace > header, .v7-home-bar) > * { visibility: hidden; animation: v8-bar-failsafe 0s 3s forwards; }
  @keyframes v8-bar-failsafe { to { visibility: visible; } }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) { display: flex; align-items: center; gap: var(--bar-gap, 10px); }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) > .brand,
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) > .header-right,
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) > .header-right > .v8-home-right,
  body.v8-bar-groups .v7-home-bar > .v8-home-right { display: contents; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-bar-sep.sep { width: .5px; height: 16px; background: rgba(255, 255, 255, .3); flex: none; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .brand > .divider { width: .5px; opacity: .7; }
  /* smaller words (Eddy 2026-11-21: "make inner lines thinner and text smaller") */
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-home-link, body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-home-link em { font-size: 10px; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(#project-name, .v7-project-switch) { font-size: 11px; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-bar-sep.gap { flex: 1 1 auto; min-width: 8px; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-bar-icon { position: relative; width: 34px; height: 34px; min-width: 34px; padding: 0; margin: 0;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: transparent; border: 0;
    box-shadow: none; color: #fff; font-size: 0; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-bar-icon:hover { background: rgba(255, 255, 255, .14); }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-bar-icon > svg.v8i { width: 20px; height: 20px; flex: none; }
  /* the counts: a small gold disc on the symbol's corner */
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-bar-icon > b,
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-bar-icon > .v8-report-badge { position: absolute; top: -2px; right: -4px; min-width: 14px; height: 14px;
    padding: 0 3px; border-radius: 999px; background: #f3d58c; color: #3b2a05; font: 600 9px/14px Inter, system-ui, sans-serif; text-align: center; }
  /* the record mark in the set's hairline weight (its red and its size stay; recorder.css keeps the bold mark outside this bar) */
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(#v8-record, [data-ghost=record]) .v8-rec-led .f { stroke-width: .78; }
  /* DAVINCI, edit, look and play: one pill, the view you are in is lit */
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(#v8-davinci-mode, #v8-mode-toggle, #v8-look-open, #v8-play, [data-ghost=davinci], [data-ghost=edit], [data-ghost=look], [data-ghost=play]) { background: rgba(255, 255, 255, .14); border-radius: 0; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(#v8-davinci-mode, [data-ghost=davinci]) { border-radius: 999px 0 0 999px; padding-left: 4px; width: 38px; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(#v8-play, [data-ghost=play]) { border-radius: 0 999px 999px 0; padding-right: 4px; width: 38px; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(#v8-mode-toggle, #v8-look-open, #v8-play, [data-ghost=edit], [data-ghost=look], [data-ghost=play]) { margin-left: calc(-1 * var(--bar-gap, 10px)); }   /* the pill's parts touch whatever the bar's gap is */
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(#v8-davinci-mode, #v8-mode-toggle, #v8-look-open, #v8-play, [data-ghost=davinci], [data-ghost=edit], [data-ghost=look], [data-ghost=play]).on > svg.v8i {
    background: rgba(255, 255, 255, .3); border-radius: 999px; padding: 4px; width: 28px; height: 28px; box-sizing: border-box; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(#v8-davinci-mode, #v8-mode-toggle, #v8-look-open, #v8-play, [data-ghost=davinci], [data-ghost=edit], [data-ghost=look], [data-ghost=play]):hover { background: rgba(255, 255, 255, .24); }
  /* the project page opens under the bar and the chat (tools-sheet.js): both stay on top, and its symbol is lit like a view */
  body.v8-page-open #workspace > header { z-index: 9002 !important; }
  body.v8-page-open :is(#davinci-dock, #v8-work-pill) { z-index: 9001 !important; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) [data-icon="page"].on > svg.v8i { background: rgba(255, 255, 255, .3); border-radius: 999px; padding: 4px; width: 28px; height: 28px; box-sizing: border-box; }
  /* the profile: its letters in a thin ring */
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) [data-bar-name^="Profile"] { width: 34px; height: 34px; border-radius: 999px; border: .5px solid rgba(255, 255, 255, .7); font-size: 10px; }
  /* said elsewhere: the reports count is on the flag, today's cost on the AI symbol's hover name */
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-home-live { flex: none; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-home-live:is(:hover, :focus-visible) {
    outline: 1px solid currentColor; outline-offset: 2px;
  }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-home-cost { display: none !important; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) [data-tip]:hover::after,
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) [data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 60;
    white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
    font: 400 11px/1.2 Inter, system-ui, sans-serif; color: #fff; padding: 5px 10px; border-radius: 999px;
    background: rgba(40, 52, 68, .55); border: .5px solid rgba(255, 255, 255, .28);
    -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) [data-tip] { position: relative; }
  /* The same buttons in the same slots in every view (Eddy 2026-11-21: "the only rule the top menu buttons are always same place and
     same shape, you can change colors and tones only"). Before: Pictures left the bar outside DAVINCI mode (v7-shell.css, look-view.css),
     Record left it in Look (recorder.css), a second AI button joined it outside DAVINCI mode (reports.js draws it, v7-shell.css hid it
     in DAVINCI mode only), and Editable mode's Undo, Redo and Fit pushed every button to the right (now after the pill, bar-layout.js). */
  body.v8-bar-groups #v8-gallery.in-bar:not([hidden]) { display: inline-flex !important; visibility: visible !important; top: auto !important; bottom: auto !important; }   /* bottom: v7-shell.css lifts the floating chip 110px outside DAVINCI mode, which threw the button in the bar off the screen */
  body.v8-bar-groups #workspace > header #v8-record:not([hidden]) { visibility: visible !important; }
  body.v8-bar-groups #workspace > header .header-right > .bar-glyph[data-name="AI"] { display: none !important; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-home-model { display: inline-flex !important; }   /* v7-shell.css folds it away under 800px */
  body.v8-bar-groups #workspace > header .rv-quick { flex: none; }
  /* Undo, Redo and Fit as symbols (their names on hover): with their words they needed 203px of the 205px the bar has free at its full
     width, and the bar squeezed its own buttons to make room (the pill's ends 38 to 34px, the profile 34 to 26px) */
  body.v8-bar-groups #workspace > header .rv-quick .rv-small > span { display: none; }
  body.v8-bar-groups #workspace > header .rv-quick .rv-small { width: 28px; height: 28px; padding: 0; justify-content: center; border-radius: 999px; }
  /* no button of the bar gives up its shape when the bar is full */
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(.v8-bar-icon, .v8-bar-ghost, #v8-record, [data-bar-name^="Profile"], .v8-bar-sep.sep) { flex: none; }
  /* the project's name has one width, so a long or a short name moves nothing after it; it is cut with three dots and read in full in its list */
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(#project-name, .v7-project-switch) { flex: none !important; box-sizing: border-box;
    width: clamp(64px, 11vw, 150px) !important; max-width: none !important; min-width: 0 !important; margin: 0 !important; padding: 6px 22px 6px 10px !important;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
  body.v8-bar-groups .v7-home-bar .v8-bar-me { margin-left: 0; }
  /* the start screen: what needs an open project keeps its place and shape, toned down */
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-bar-ghost[aria-disabled="true"] { cursor: default; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-bar-ghost[aria-disabled="true"] > svg { opacity: .38; }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is([data-ghost=pictures], [data-ghost=videos], [data-ghost=page]):hover { background: transparent; }
  body.v8-bar-groups .v7-home-bar :is([data-ghost=edit], [data-ghost=look], [data-ghost=play]):hover { background: rgba(255, 255, 255, .14); }
  body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-bar-ghost[hidden] { display: none; }
  /* the record mark's own box, as recorder.css gives the real one */
  body.v8-bar-groups .v7-home-bar [data-ghost=record] { position: relative; display: inline-flex; align-items: center; flex: none; height: 26px; margin: 0 2px 0 6px; padding: 0 8px;
    border: 0; background: none; }
  /* the bar stays on top in every view (Eddy 2026-11-21: "this pill should be permanent in all views") */
  body.v8-bar-groups.v8-looking #workspace > header { z-index: 45 !important; }
  /* a page or Play opened from Look: Look's own layer (45) used to win over the open page's (9002) and the pill went under the page */
  body.v8-bar-groups.v8-looking.v8-page-open #workspace > header { z-index: 9002 !important; }
  body.v8-bar-groups.v8-looking #v8-look .lv-pick { top: 128px; }
  body.v8-bar-groups.v8-looking #v8-look .lv-tour-label { top: 128px; }
  /* Editable mode keeps the DAVINCI pill (Eddy 2026-11-21: "even in editable mode conserve davinci look"; "built around the same top
     pill menu bar ... the same experience on every page ... all should feel the same"): the same glass pill in the same place and size as
     DAVINCI mode, so nothing moves when the view changes. The ribbon and the panels start 32px lower (--rv-y, read by revit-workspace.css
     and the panels that dock under the ribbon). The glass carries a slate tint here: the page behind it is light, and the words stay white. */
  body.v8-bar-groups.v8-revit { --rv-y: 32px; }
  body.v8-bar-groups.v8-revit #workspace > header { left: 50% !important; right: auto !important; top: 10px !important; transform: translateX(-50%) !important;
    width: min(1120px, calc(100% - 32px)) !important; height: 48px !important; padding: 0 18px !important;
    border: 1px solid var(--v7-edge) !important; border-radius: 999px !important; color: #fff !important;
    background: var(--v7-pane) !important; -webkit-backdrop-filter: blur(30px) saturate(1.6) !important; backdrop-filter: blur(30px) saturate(1.6) !important;
    box-shadow: var(--v7-shadow) !important; }
  body.v8-bar-groups.v8-revit #workspace > header .v8-home-right { display: contents !important; }
  body.v8-bar-groups.v8-revit #workspace > header :is(button, strong, em, span, .bar-glyph) { color: #fff !important; }
  body.v8-bar-groups.v8-revit #workspace > header .brand em { color: #e5c97e !important; }
  /* and the same chat pill, always there (before: hidden behind a Conversation button). In Editable mode itself it sits over the model,
     above the command line; its tone comes from editable-glass.css. In Look, Play and the project page it is where and what it is in
     DAVINCI mode: nothing here touches it. */
  body.v8-bar-groups.v8-revit #davinci-dock { display: flex !important; }
  body.v8-bar-groups.v8-revit:not(.v8-looking, .v8-page-open) #davinci-dock { left: max(50%, calc(var(--rv-left) + 60px + min(560px, 100vw - var(--rv-left) - 76px) / 2)) !important; right: auto !important;
    transform: translateX(-50%) !important; bottom: 100px !important; width: min(560px, calc(100vw - var(--rv-left) - 76px)) !important; }   /* the window's centre, as in every view, unless the panels and the view tools on the left are in the way */
  /* the scenes over Editable mode: DAVINCI mode's own place, written out because revit-workspace.css moves the chat for all of Editable mode */
  body.v8-bar-groups.v8-revit:is(.v8-looking, .v8-page-open) #davinci-dock { left: 50% !important; right: auto !important; bottom: 72px !important;   /* 72px is DAVINCI mode's own (v7-shell.css); 44px here until r1080 left the chat 28px low in these scenes */
    transform: translateX(-50%) !important; width: min(560px, calc(100vw - 32px)) !important; }
  body.v8-bar-groups.v8-revit .rv-status > button { display: none; }
  body.v8-bar-groups.v8-revit:not(.v8-looking, .v8-page-open) #v8-work-pill { left: max(50%, calc(var(--rv-left) + 60px + min(560px, 100vw - var(--rv-left) - 76px) / 2)); z-index: 32; }
  /* Undo, Redo and Fit belong to Editable mode: they step aside in the scenes opened over it */
  body.v8-bar-groups.v8-revit:is(.v8-looking, .v8-page-open) #workspace > header .rv-quick { visibility: hidden; }
  /* The page strip (Eddy 2026-11-21, "Yes, build it" on the drawing of five pages): every page keeps the top pill and the chat pill, and
     what belongs to one page sits in one strip under the top pill, the pill's width (--pill-w) and the page's glass. Look's strip is its
     own bar (look-view.css puts it at 68px); Game mode and Back to editing leave it, both are in the top pill (Play; DAVINCI and Edit).
     The project page's and Play's strips are in their own pages (project-page.css body.pp-in, game.css body.g-in), Editable mode's in
     editable-glass.css. */
  body.v8-bar-groups { --pill-w: min(1120px, calc(100vw - 32px)); }
  body.v8-bar-groups #v8-look .lv-dock { left: 50%; right: auto; top: 68px; transform: translateX(-50%); width: var(--pill-w); max-width: none; align-items: stretch; }   /* also from 701 to 760px, where look-view.css has the phone's box */
  body.v8-bar-groups #v8-look .lv-dock .lv-bar:not(:has(.lv-drawer:not([hidden]))) { border-radius: 999px; }
  body.v8-bar-groups #v8-look .lv-dock .lv-bar { width: auto; max-width: none; box-sizing: border-box; min-height: 48px; display: flex; flex-direction: column; justify-content: center; }
  body.v8-bar-groups #v8-look .lv-dock .lv-main { justify-content: center; }
  body.v8-bar-groups #v8-look .lv-dock :is(.lv-note, .lv-photo) { text-align: center; }
  body.v8-bar-groups #v8-look .lv-main :is([data-a="game"], [data-a="close"]) { display: none; }
  /* The pill's box is the same in every view at every width. Up to 800px wide v7-shell.css gives the bar the window's width less 12px a
     side; Editable mode's own box above (written for the wide bar) used to put it back to 16px, so the buttons shifted between views. */
  @media (max-width: 800px) {
    body.v8-bar-groups { --pill-w: calc(100vw - 24px); }
    body.v8-bar-groups.v8-revit #workspace > header { left: 12px !important; right: 12px !important; transform: none !important; width: auto !important; padding: 0 12px !important; }
    body.v8-bar-groups :is(#workspace > header, .v7-home-bar) { padding: 0 12px !important; }
  }
  /* A narrow window: the same buttons stay, closer together, and the word DAVINCI V8 leaves room for them (its gold dot stays). Before:
     the bar ran past the window's right edge and the profile was cut off. */
  @media (max-width: 980px) {
    body.v8-bar-groups :is(#workspace > header, .v7-home-bar) { --bar-gap: 4px; }
    body.v8-bar-groups #workspace > header .rv-quick { display: none !important; }
  }
  @media (max-width: 860px) {
    body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-home-link { font-size: 0 !important; letter-spacing: 0 !important; }
    body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-home-link em { font-size: 0 !important; }
    body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .brand > .divider { display: none !important; }
    body.v8-bar-groups :is(#workspace > header, .v7-home-bar) { --bar-gap: 2px; }
    body.v8-bar-groups :is(#workspace > header, .v7-home-bar) .v8-bar-icon { width: 30px; height: 30px; min-width: 30px; }
    body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(#v8-davinci-mode, #v8-play, [data-ghost=davinci], [data-ghost=play]) { width: 34px; }
    body.v8-bar-groups :is(#workspace > header, .v7-home-bar) [data-bar-name^="Profile"] { width: 30px; height: 30px; }
    body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(#project-name, .v7-project-switch) { width: 60px !important; padding: 6px 18px 6px 6px !important; }
    body.v8-bar-groups :is(#workspace > header, .v7-home-bar) :is(#v8-record, [data-ghost=record]) { margin: 0 !important; padding: 0 4px !important; }
  }
}
