/* ═══ THE TWO BARS — laptop only ══════════════════════════════════════════
   ⚠ LAPTOP ONLY: one min-width query around everything, so the phone keeps
   the header it has.
   ⚠ ADDITIVE: the only existing things hidden are the ones the bar now
   carries — a masthead's title, the branch strip, and the crumb on the two
   screens the bar fully covers.
   ══════════════════════════════════════════════════════════════════════════ */
@media (min-width:761px){

  /* ⚠ NOT sticky any more — it sits OUTSIDE the scrolling column, so it stays
     put by being in the layout rather than by being pinned to it. */
  /* ⚠ THE BAR IS ON THE GROUND, not a band of its own. It had a white fill, a
     shadow and a hairline under it, which made a third horizontal surface above two
     floating panels. The ground runs behind it now, so the whole window is one
     surface with things laid on it.
     ⚠ The z-index stays: the menus that drop out of the bar must land over the rail. */
  #appbars{position:relative;z-index:300;background:transparent;color:var(--band-txt);
    flex-shrink:0;box-shadow:none}
  /* the band is the front plane, the rail sits behind it, the page furthest back.
     ⚠ The stacking has to match the shadow or the band's shadow lands UNDER the
     rail instead of falling across it, which reads as a bug rather than depth:
     bars 300, rail 200, page default. */

  /* ── row 1: global ── */
  .tb1{height:48px;display:flex;align-items:center;gap:14px;padding:0 20px 0 18px;border-bottom:0}
  /* ── THE MARK ────────────────────────────────────────────────────────────
     ⚠⚠ IT HAS ITS OWN FILE NOW, logo-mark.png — and that is the fix, not the
     numbers. This used to be a 26px window with logo.png slid under it and the
     wordmark clipped off the right. That only ever lined up while logo.png kept
     the proportions somebody measured once: the note here said 1280x247 with a
     247-square hexagon, and the file is 622x120 with a 104x115 one. So the mark
     ended up 22.5px wide in a 26px tile with NOTHING on its left and 3.5px on its
     right, and there was nothing on screen to say why. His words, 21 Sep 2026:
     "this logo is off centered and its killing me".
     logo-mark.png is the mark alone, squared with even margins, so object-fit
     centres it at any size and changing the wordmark can never move it again.
     ⚠ logo.png IS STILL THE WORDMARK and is still what the sign-in page and the
     sidebar draw. This did not replace it. */
  /* ⚠ AND IT LINES UP WITH THE COLUMN UNDER IT. Being centred in its own box was only
     half of it: the box itself sat 2px left of the app rail below, because the bar pads
     18px on the left and a rail tile starts at 14 and is 38 wide. So the mark is given a
     rail tile's width and pulled out to a rail tile's left edge — both centres land on
     33, measured. Two numbers, and they are the two the rail already uses; a bare
     "nudge it 2px" is how this drifts again. */
  .tb-brand{width:38px;height:26px;margin-left:-4px;flex-shrink:0;display:block}
  .tb-brand img{width:100%;height:100%;object-fit:contain;display:block}
  /* ⚠ THE MIDDLE, AND SHORTER. It used to be flex:1 beside the mark, which pinned it
     left and let it run to 620px. A spacer each side holds it in the centre of the bar,
     and it takes the width it needs rather than all that is going. */
  .tb-gap{flex:1 1 0;min-width:8px}
  /* ⚠ THE MIDDLE OF THE BAR, not the middle of what is left over. Two equal spacers
     centre it between the mark and the profile — but the mark is 26px and the profile
     cluster is 271, so that put it 124px off. It is pinned to the centre of the bar
     itself instead, with the spacers still there to hold the space open. */
  .tb1{position:relative}
  .tb-search{position:absolute;left:50%;transform:translateX(-50%);width:420px}
  /* ⚠ and back into the flow before it can reach the profile. 420 + the two ends +
     breathing room is about 1040; under that it takes what is going instead. */
  @media (max-width:1060px){
    .tb-search{position:relative;left:auto;transform:none;width:auto;flex:1 1 auto;min-width:140px}
    .tb-gap{display:none}
  }
  /* the picker sits with the bell and the profile, not floating on its own */
  .tb-scope:empty{display:none}
  /* the offices button — the same quiet chip the profile sits in */
  .tb-brwrap{position:relative;flex-shrink:0}
  .tb-br{display:inline-flex;align-items:center;gap:6px;background:none;border:0;border-radius:8px;
    padding:6px 8px;font-family:'Inter',sans-serif;font-size:13px;color:var(--band-dim);cursor:pointer;
    white-space:nowrap}
  .tb-br:hover{background:var(--band-fill);color:var(--band-txt)}
  /* ⚠ the menu hangs off THIS button, not off the bar — right:0 on the account menu
     is right of the account button, which is a different place. */
  /* ⚠ SMALLER. "i feel like this dropdown is too big" — five offices in a 186px
     column of 35px rows is a panel where a short list would do. The rows are the
     height of a line of text plus air, and the menu is only as wide as the longest
     office name needs. */
  .tb-brmenu{min-width:150px;padding:4px}
  .tb-brmenu > button{display:flex;align-items:center;padding:5px 9px;border-radius:var(--r-control)}
  .tb-brmenu > button.on{font-weight:600;background:var(--accent-soft)}
  .tb-brmenu > button.on:hover{background:var(--accent-soft)}
  .tb-search svg{position:absolute;left:11px;top:50%;transform:translateY(-50%);
    width:14px;height:14px;stroke:var(--band-dim);stroke-width:2;fill:none;pointer-events:none}
  /* ⚠ NO SEE-THROUGH TEXT OR FILLS ON THE BAND. Half-transparent white mixes
     with whatever is underneath instead of staying a colour — on the red band it
     produced a dusty pink, and on a white band it is simply invisible. Every
     value here is a solid token. */
  .tb-search input{width:100%;border:1px solid var(--band-line);background:var(--band-fill);
    border-radius:19px;padding:8px 74px 8px 34px;font-family:'Inter',sans-serif;font-size:13px;
    color:var(--band-txt)}
  .tb-search input::placeholder{color:var(--band-dim)}
  .tb-search input:focus{outline:none;border-color:var(--accent);background:var(--surface)}
  /* the results of the GLOBAL search — every row is a way in, not a filter */
  #tbResults{position:absolute;top:calc(100% + 7px);left:0;right:0;z-index:70;
    background:var(--surface);border:1px solid var(--rule);border-radius:10px;
    box-shadow:0 12px 34px -12px rgba(var(--shade-rgb),.35);padding:5px;
    max-height:min(420px,60vh);overflow-y:auto}
  .tb-hit{display:flex;align-items:baseline;gap:10px;width:100%;text-align:left;
    background:none;border:0;border-radius:7px;padding:8px 10px;cursor:pointer}
  .tb-hit:hover,.tb-hit.on{background:var(--wash,var(--field))}
  .tb-hit .k{font-family:'Inter',sans-serif;font-size:13px;color:var(--ink-faint);
    width:66px;flex-shrink:0}
  .tb-hit .t{font-family:'Inter',sans-serif;font-size:13px;font-weight:600;color:var(--ink);
    flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .tb-hit .s{font-family:'Inter',sans-serif;font-size:13px;color:var(--ink-faint);
    flex-shrink:0;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  /* ⚠ NO margin-left:auto ANY MORE. It shoved this half to the right and ate the
     spacer beside it, so the search sat 124px left of centre however wide the bar was.
     The two spacers do the work now. */
  .tb-right{display:flex;align-items:center;gap:9px;flex-shrink:0}
  /* ⚠ ATTACHED: the picture, the name and the caret are one object with a
     ground behind them, not three things floating next to each other. */
  .tb-mewrap{position:relative;flex-shrink:0}
  /* ── the chat button ──────────────────────────────────────────────────────
     A quiet round mark beside the account, the same height as it. The number on it
     is the only loud thing, and only when there is one. */
  .tb-icon{position:relative;display:inline-flex;align-items:center;justify-content:center;
    width:32px;height:32px;border:1px solid transparent;border-radius:50%;
    background:none;color:var(--band-txt);cursor:pointer;flex-shrink:0;padding:0}
  .tb-icon:hover{background:var(--band-fill);border-color:var(--band-line)}
  .tb-icon svg{display:block;fill:none;stroke:currentColor}
  /* Belajar: the name shows only in break time and after work */
  .tb-learn{gap:6px;transition:width .2s ease,padding .2s ease}
  .tb-learn-t{display:none;font-size:13px;font-weight:600}
  .tb-learn.on{width:auto;padding:0 12px 0 9px;border-radius:16px;background:var(--band-fill);border-color:var(--band-line)}
  .tb-learn.on .tb-learn-t{display:inline}
  .tb-chatn{position:absolute;top:1px;right:0;min-width:15px;height:15px;padding:0 4px;
    border-radius:8px;background:var(--accent);color:var(--on-accent);
    font-family:var(--num),ui-monospace,monospace;font-size:10px;font-weight:600;
    line-height:15px;text-align:center;pointer-events:none}
  .tb-chatn[hidden]{display:none}
  .tb-me{display:inline-flex;align-items:center;gap:8px;background:var(--band-fill);
    border:1px solid transparent;border-radius:20px;padding:3px 11px 3px 3px;
    font-family:'Inter',sans-serif;font-size:13px;color:var(--band-txt);cursor:pointer}
  .tb-me:hover{border-color:var(--band-line);background:var(--surface)}
  /* ⚠ the placeholder colour lives HERE, not inline on the span: an inline
     background beats any class rule, so .has-av could never clear it and the
     purple sat behind the picture. */
  .tb-me .av{background-color:var(--me);width:26px;height:26px;border-radius:50%;color:var(--on-dark);display:inline-flex;
    align-items:center;justify-content:center;font-size:11px;font-weight:600;flex-shrink:0;
    overflow:hidden;background-size:cover;background-position:center}
  .tb-caret{color:var(--band-dim);flex-shrink:0}
  /* ⚠ once avatar.js paints the chip it adds .has-av — the initial has to get
     out of the way, and the placeholder colour with it, or the letter sits on
     top of the face. */
  .tb-me .av.has-av{color:transparent;background-color:transparent}
  /* the account menu */
  .tb-menu{position:absolute;top:calc(100% + 8px);right:0;z-index:70;min-width:236px;
    background:var(--surface);border:1px solid var(--rule);border-radius:10px;padding:6px;
    box-shadow:0 14px 36px -14px rgba(var(--shade-rgb),.4)}
  .tb-menu.hidden{display:none}
  /* ⚠ DIRECT children only. The avatar picker brings its own "Remove" button,
     and a blanket rule turned that into a full-width menu row of its own. */
  .tb-menu > button{display:block;width:100%;text-align:left;background:none;border:0;
    border-radius:7px;padding:9px 11px;font-family:'Inter',sans-serif;font-size:13px;
    color:var(--ink);cursor:pointer}
  .tb-menu > button:hover{background:var(--wash,var(--field))}
  .tb-menu > button.danger:hover{background:var(--accent-soft);color:var(--accent)}
  .tb-menu .sep{height:1px;background:var(--rule-soft);margin:6px 4px}
  /* ── the rows, ClickUp-shaped: an icon, a name, and sometimes a mark at the end ──
     ⚠ .tbm BEATS the bare "> button" rule above by one class, so display:flex wins
     without an !important. */
  .tb-menu{min-width:252px}
  .tb-menu > .tbm{display:flex;align-items:center;gap:11px;width:100%;text-align:left;
    background:none;border:0;border-radius:var(--r-control);padding:8px 10px;
    font-family:'Inter',sans-serif;font-size:13px;color:var(--ink);cursor:pointer}
  .tb-menu > .tbm:hover{background:var(--band-fill)}
  .tb-menu > .tbm.danger:hover{background:var(--accent-soft);color:var(--accent)}
  .tbm-ic{width:17px;height:17px;flex-shrink:0;display:flex;align-items:center;
    justify-content:center;color:var(--ink-faint)}
  .tbm-ic svg{width:17px;height:17px;display:block;fill:none;stroke:currentColor;
    stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
  .tb-menu > .tbm:hover .tbm-ic{color:var(--ink-soft)}
  .tb-menu > .tbm.danger:hover .tbm-ic{color:var(--accent)}
  .tbm-t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  /* a small label over a group — the only words in here that are not a thing you can press */
  .tbm-lbl{font-family:'Inter',sans-serif;font-size:12px;color:var(--ink-faint);
    padding:7px 10px 3px}
  /* a count, and a light. ⚠ The light is the only round thing in the menu, because
     round IS the meaning there — see the corner scale. */
  .tbm-cnt{flex-shrink:0;font-family:var(--num);font-variant-numeric:tabular-nums;
    font-size:12px;color:var(--accent)}
  .tbm-dot{flex-shrink:0;width:7px;height:7px;border-radius:50%}
  /* a light is a state, not a command — it must not look pressable when it is not */
  .tb-menu > .tbm-stat{cursor:default}
  .tb-menu > button.tbm-stat{cursor:pointer}
  .tb-whoami{display:flex;align-items:center;gap:12px;padding:10px 11px 4px}
  .tb-whoami .n{font-family:'Inter',sans-serif;font-size:15px;font-weight:600;color:var(--ink)}
  .tb-whoami .r{font-family:'Inter',sans-serif;font-size:13px;color:var(--ink-faint)}
  .tb-pic{flex-shrink:0}

  /* ⚠ ROW 2 IS GONE — 2026-09-14, his call: "its ugly. so every single app
     deserves a side panel now." Its rules went with it: the module name, the
     trail as a line, the pill strip and its overflow arrow, the borrowed
     control cluster and the ink overrides that let a module's grey text survive
     on a dark band. All of it is in css/apppanel.css now, on a light panel.
     ⚠ What did NOT go: .tb1 and everything in it, and the four rules below that
     stop the PAGE drawing what the panel now carries. */

  /* ⚠ THE TRAIL, ONCE. The bar now shows "Apps / Customers / …" itself, so the
     view it is naming stops drawing its own copy. Only that view — the class is
     set and cleared by renderTopbar — so any screen the bar does NOT carry keeps
     its own trail and its way back. Hiding it blindly is what took the way back
     off two screens once before. */
  .crumb-in-bar .detail-backbar{display:none}

  /* ── what the bar carries, the page stops carrying ── */
  main .masthead > div:first-child{display:none}
  main .masthead{padding-top:0;margin-bottom:14px;min-height:0}
  /* ⚠ THE STRAY LINE. On the two views the bar fully carries, the masthead has
     nothing left in it — the title is hidden and the Manage cluster has moved
     into row 2 — but it still drew its own border-bottom: a 1px rule floating
     under the bar with nothing above it. `:empty` never matched, because the
     hidden title div is still a child. Hidden outright instead.
     ⚠ It still HOLDS the Manage cluster when you leave the module, which is
     fine: the whole view is hidden then too. */
  #view-dashboard > .masthead,
  #view-customers > .masthead,
  #view-meetings > .masthead,
  #view-boards > .masthead,
  #view-review > .masthead,
  #view-maintenance > .masthead,
  #view-shipment > .masthead,
  /* ⚠ HOME TOO. Its heading is hidden like the rest, but the row it sat in still
     drew its own bottom rule — a hairline floating above the wall with nothing over
     it. Same stray line the note beside this list warns about. */
  #view-home > .masthead,
  #view-files > .masthead,
  #view-visits > .masthead{display:none}
  /* the Customers filter, once it is standing above its own list */
  #view-customers > .m3s.tb-lent{display:flex;width:280px!important;margin:0 0 12px}
  /* ⚠ Meetings keeps its toolbar because its SEARCH stays on the page — only
     the chip and the grouping went up. Alone in a space-between row the box
     stretched the full width; it gets a declared one. */
  #view-meetings .mtg-toolbar{margin-bottom:20px}
  #view-meetings .mtg-toolbar > .m3s{width:340px;flex:0 0 auto}
  /* same call on Files: alone in a space-between row the box stretched the width of
     the screen, which reads as a page-wide field rather than a filter on a list */
  #view-files .fl-tools > .m3s{width:340px;flex:0 0 auto}
  /* the switch sits in the bar now, so the row it came from must not keep its gap */
  #view-files .fl-tools{margin-bottom:16px}
  /* ⚠ THIS USED TO HIDE THE TRAIL. The back bar is not a back bar once the
     page is drawn — paintCrumbs() replaces its contents with "Apps / …", so
     hiding it on these two took away the only way back to the wall of apps and
     left them the only screens in the app with no trail at all. Every module
     keeps it. */
  /* branch is a picker in the bar now. The VIEW row stays: it is a level below
     the module pills, and hiding it leaves no way to change view at all. */
  #maintBranchBar,#shipBranchBar{display:none!important}
  /* ⚠ The SECOND stray line. This row's border-top separated it from the pill
     row that used to sit above it — and those have moved into the bar, so the
     rule was left drawing under nothing. */
  #maintViewRow{border-top:0!important;padding-top:0!important}
}
