/* ============================================================================
   ONE WAY FOR A RECORD TO OPEN (R-2142; the owner's pick, 4 Dec 2026, D-1028: "1 on wide screens, 2 on laptops").
   NEW PACE ONLY, inside the calm screens, and only while a lead, a candidate or a client is open: every rule starts with
   html[data-new-pace][data-calm][data-calm-open]. public/js/99zzzzb-calm-open.js sets data-calm-open ("beside" on a wide
   screen on the record's own list, "page" everywhere else) and data-calm-kind; without them this file changes nothing.
   What a record holds and what its buttons do is not changed. This is only WHERE its frame stands:
     1. the frame of each of the three (the lead's .overlay > .lr-drawn, the candidate's .cr-scrim > .cr-dwr, the client's
        .cr-scrim > .dwr.cr): from the page's left edge to the window's, under the top line; nothing dimmed, nothing blurred;
     2. the record's own first line (where you are, close, minimise): the words go (the top line or the list says where you
        are), the buttons stand at the right of the record's name;
     3. the whole page: the page behind is put away and the top line shows the way back (#calm-open-bar, drawn by the script);
     4. beside the list: the list keeps the columns it marked (co-keep) in a narrow column, and the open record's row is lit;
     5. while the record is the only window open (data-calm-alone; the tray of minimised windows is not a window), the menu
        and the top line stand in front of it, so what drops from them (the search's results, the bell, + New, a filter's
        menu) is not hidden behind the record.
   Guard: test/calm-open-smoke.mjs.
   ============================================================================ */
html[data-new-pace][data-calm][data-calm-open]{--co-left:calc(var(--rail-w) + var(--np-space-5));--co-list:clamp(380px,25vw,480px)}

/* ── 1. the frame ── */
html[data-new-pace][data-calm][data-calm-open] :is(.overlay:has(> .lr-drawn),.dwr-scrim.cr-scrim){inset:58px 0 0 var(--co-left);display:flex;align-items:stretch;justify-content:stretch;
  padding:var(--np-space-2) var(--np-space-2_5) var(--np-space-2_5) var(--np-space-6);background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;animation:none}
html[data-new-pace][data-calm][data-calm-open="beside"] :is(.overlay:has(> .lr-drawn),.dwr-scrim.cr-scrim){left:calc(var(--co-left) + var(--co-list));padding-left:0}
/* the lead */
html[data-new-pace][data-calm][data-calm-open] .overlay > .lead-detail.lr-drawn{position:relative;inset:auto;flex:1 1 auto;width:auto!important;max-width:none;height:auto;
  border:1px solid var(--glass-brd)!important;border-radius:var(--np-round-xl)!important;box-shadow:none;animation:none}
/* the candidate and the client */
html[data-new-pace][data-calm][data-calm-open] .cr-scrim > :is(.dwr.cr-dwr,.dwr.cr){flex:1 1 auto;width:auto!important;max-width:none;height:auto;padding:0;animation:none}
html[data-new-pace][data-calm][data-calm-open] .cr-scrim :is(.cr-drawn,.cr-pane){position:relative;border:1px solid var(--glass-brd);border-radius:var(--np-round-xl);box-shadow:none}

/* ── 2. the record's own first line: its buttons at the right of the name, its words gone ── */
html[data-new-pace][data-calm][data-calm-open] :is(.lr-crumb,.cr-crumb){display:none}
html[data-new-pace][data-calm][data-calm-open] .cr-navbtn:is([aria-label^="Previous"],[aria-label^="Next"]){display:none}   /* the top line's arrows are the three records' one way to the next */
html[data-new-pace][data-calm][data-calm-open] .lr-bar{position:absolute;top:var(--np-space-4);right:var(--np-space-5);z-index:5;min-height:0;padding:0;background:transparent;border:0;-webkit-backdrop-filter:none;backdrop-filter:none}
html[data-new-pace][data-calm][data-calm-open] .lr-drawn .jd-ph{padding-right:var(--np-space-10)}
html[data-new-pace][data-calm][data-calm-open] .cr-drawn .cr-bar{position:absolute;top:var(--np-space-4_5);right:var(--np-space-5);z-index:5;margin:0}
html[data-new-pace][data-calm][data-calm-open] .cr-drawn .cr-ph{padding-right:calc(var(--np-space-10) + var(--np-space-9))}
html[data-new-pace][data-calm][data-calm-open] .cr .cr-top > .cr-bar{position:absolute;top:var(--np-space-4);right:var(--np-space-5);z-index:5;flex:none;margin:0}
html[data-new-pace][data-calm][data-calm-open] .cr .cr-top{padding-top:var(--np-space-3)}
html[data-new-pace][data-calm][data-calm-open] .cr .cr-acts{margin-right:calc(var(--np-space-10) + var(--np-space-9))}

/* ── 3. the whole page: the page behind is put away, and the top line shows the way back ── */
html[data-new-pace][data-calm][data-calm-open="page"] body.ui-kit #content,
html[data-new-pace][data-calm][data-calm-open="page"] #topbar :is(.tb-head,.tb-chips,.tb-act){visibility:hidden}
#calm-open-bar{display:none}
html[data-new-pace][data-calm][data-calm-open="page"] #calm-open-bar{display:flex;align-items:center;gap:var(--np-space-1);position:fixed;z-index:1;left:calc(var(--co-left) + var(--np-space-2));top:10px;height:48px;
  font:400 var(--np-text-md)/1 var(--font);color:var(--text2)}
html[data-new-pace][data-calm] #calm-open-bar :is(.co-back,.co-step){display:inline-flex;align-items:center;justify-content:center;gap:var(--np-space-1);height:36px;padding:0 var(--np-space-2);border:0;border-radius:var(--np-round-md);
  background:transparent;color:var(--text);cursor:pointer;transition:none}
html[data-new-pace][data-calm] #calm-open-bar .co-back{padding-right:var(--np-space-3);font:700 var(--np-text-logo)/1.2 var(--font);letter-spacing:-.01em}
html[data-new-pace][data-calm] #calm-open-bar .co-step{width:36px;padding:0;color:var(--text2)}
html[data-new-pace][data-calm] #calm-open-bar :is(.co-back,.co-step) svg{width:18px;height:18px;flex:none}
html[data-new-pace][data-calm] #calm-open-bar .co-step:disabled{opacity:.35;cursor:default}
html[data-new-pace][data-calm] #calm-open-bar .co-pos{margin:0 var(--np-space-1) 0 var(--np-space-2);white-space:nowrap;font-variant-numeric:tabular-nums}
html[data-new-pace][data-calm] #calm-open-bar :is(.co-back,.co-step):focus-visible{outline:2px solid var(--accent);outline-offset:-2px}

/* ── 4. beside the list: the list in a narrow column, the open record's row lit ── */
html[data-new-pace][data-calm][data-calm-open="beside"] body.ui-kit #content{max-width:var(--co-list);padding-right:var(--np-space-2)}
html[data-new-pace][data-calm][data-calm-open="beside"] #content table.dt{table-layout:fixed;width:100%;min-width:0!important}
html[data-new-pace][data-calm][data-calm-open="beside"] #content table.dt :is(th,td):not(.co-keep):not([colspan]){display:none}
html[data-new-pace][data-calm][data-calm-open="beside"] #content table.dt th.co-keep:not(.co-tick) ~ th.co-keep{width:132px}
html[data-new-pace][data-calm][data-calm-open="beside"] #content table.dt th.co-tick{width:40px}
html[data-new-pace][data-calm][data-calm-open="beside"] #content table.dt td.co-keep{overflow:hidden;text-overflow:ellipsis}
html[data-new-pace][data-calm][data-calm-open="beside"] #content table.dt tr.co-on > td{background:var(--accent-l)}
html[data-new-pace][data-calm][data-calm-open="beside"] #content table.dt tr.co-on > td.co-keep:not(.co-keep ~ .co-keep){box-shadow:inset 3px 0 0 var(--accent)}

/* ── 5. while the record is the only window open, the menu and the top line stand in front of it ── */
html[data-new-pace][data-calm][data-calm-open][data-calm-alone] #main{z-index:95}
html[data-new-pace][data-calm][data-calm-open][data-calm-alone] :is(#sidebar,#calm-open-bar){z-index:96}   /* the menu in front of the page, as always: what drops from it (+ New) lies over the list */
html[data-new-pace][data-calm][data-calm-open] #main{pointer-events:none}
html[data-new-pace][data-calm][data-calm-open] #main > :is(#topbar,#content){pointer-events:auto}   /* #main is as large as the page: only its two parts take a press, the record takes the rest */

@media (hover:hover) and (pointer:fine){
  html[data-new-pace][data-calm] #calm-open-bar :is(.co-back,.co-step):not(:disabled):hover{background:var(--hover)}
}
