/* ══ SETTINGS, ONE APP (js/settings-app.js) ═══════════════════════════════════════════════════════════════
   Ported from the prototype he approved on 14 Oct 2026 (Work/_from-claude/settings-team-proto: st.css,
   st-panels.css, st-refine.css; Direction A only, st- renamed sg-).
   ONLY WHAT IS NEW. Projects' list rows (tbl-*), its sheet (sheet-*), its side list (tl-*), the tick box
   (.msbox), the search box (.m3s), the inline question (.icf), the toast and the three buttons are the app's own.
   ⚠ EVERY RULE IS FENCED to Settings' own roots: #view-settings, #sgPanel, #sgSheetHost, #sgDD, #sgDDveil, or the
   main area while #view-settings is the open view. The old settings.css (.st-*) was the old sheet's, and is gone.
   ⚠ READABLE, NOT FAINT (his words 13 Oct 2026: "hair line of small texts ... no dividers nothing"): bounded
   panels on a darker page, a real heading per panel, a visible line between rows, 14 to 15px text, and nothing a
   person must read in the faint grey (ink-faint fails AA on white); ink or ink-soft instead.
   Sizes: 28 title · 17 panel heading · 15 body · 14 secondary · 13 labels. ══ */

/* the page sits back on a darker ground, the panels come forward */
#view-settings,#sgSheetHost,#sgPanel{--sg-page:#f0f0ee;--sg-pnline:#d9d8d2;--sg-hover:color-mix(in srgb,var(--ink) 6%,var(--surface));--sg-press:color-mix(in srgb,var(--ink) 11%,var(--surface))}
:root[data-theme="dark"] #view-settings,:root[data-theme="dark"] #sgSheetHost,:root[data-theme="dark"] #sgPanel{--sg-page:#141311;--sg-pnline:#3b3732;--sg-hover:color-mix(in srgb,var(--ink) 7%,var(--surface));--sg-press:color-mix(in srgb,var(--ink) 12%,var(--surface))}
body > .app > main:has(> #view-settings:not(.hidden)),body > .app > main:has(#view-settings:not(.hidden)){background:#f0f0ee}
:root[data-theme="dark"] body > .app > main:has(#view-settings:not(.hidden)){background:#141311}
#view-settings{padding-bottom:120px}
#view-settings > #sgPanel{display:none}
#appside .as-body > #sgPanel{display:block;padding:0;background:none}
#view-settings .sg-i{width:16px;height:16px;display:block;flex-shrink:0}
#view-settings .sg,#sgSheetHost,#sgDD{-webkit-tap-highlight-color:transparent}
#sgSheetHost .sg-vh{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ── the side list: 15px in ink, taller rows, a clear chosen row, group names readable ── */
#sgPanel .sg-tree .tl-b{min-height:38px;padding:0 12px;border-radius:8px;background:transparent}
#sgPanel .sg-tree .tl-b:hover{background:transparent}
#sgPanel .sg-tree .tl-t{font-size:15px;color:var(--ink)}
#sgPanel .sg-tree .tl-leaf{border-radius:8px;transition:background-color .12s ease}
#sgPanel .sg-tree .tl-leaf:hover:not(.on){background:var(--sg-hover)}
#sgPanel .sg-tree .tl-leaf:active:not(.on){background:var(--sg-press)}
#sgPanel .sg-tree .tl-leaf.on{background:var(--accent-soft)}
#sgPanel .sg-tree .tl-leaf.on .tl-t{font-weight:600;color:var(--ink)}
#sgPanel .sg-tree .tl-sec{margin-top:18px}
#sgPanel .sg-tree .tl-shead{padding:0 12px 4px}
#sgPanel .sg-tree .tl-shead:hover{background:none}
#sgPanel .sg-tree .tl-h{font:600 13px/1.3 'Inter',sans-serif;color:var(--ink-soft);letter-spacing:0;text-transform:none}
#sgPanel .sg-tree .tl-b:focus-visible{outline:none}
#sgPanel .sg-tree .tl-leaf:has(.tl-b:focus-visible){outline:2px solid var(--ink);outline-offset:-2px}

/* ── page heads: one grey line, then the title at 28 ── */
#view-settings .sg{max-width:880px}
#view-settings .sg.sg-wide{max-width:1120px}
#view-settings .sg.sg-aov{max-width:1180px}
#view-settings .sg-ahd{display:flex;align-items:flex-end;gap:16px;margin:16px 0 24px;min-height:52px}
#view-settings .sg-ahl{flex:1;min-width:0}
#view-settings .sg-dt{font:400 14px/1.2 'Inter',sans-serif;color:var(--ink-soft);margin:0 0 2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#view-settings .sg-h1{font:600 28px/1.15 'Inter',sans-serif;letter-spacing:-.02em;margin:0;color:var(--ink)}
#view-settings .sg-headr{margin-left:auto;display:flex;align-items:center;gap:10px;padding-bottom:2px}
#view-settings .sg-add{width:auto}
#view-settings .sg-back{display:none}
#view-settings .sg-empty{font:400 15px 'Inter',sans-serif;color:var(--ink-soft);padding:24px 0;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
@media (min-width:761px){#view-settings .sg-ovhead{display:none}#view-settings .sg-aov{padding-top:4px}}

/* ── panels ── */
#view-settings .sg-pns,#view-settings .sg-blk{display:flex;flex-direction:column;gap:20px}
#view-settings .sg-pn,#sgSheetHost .sg-pn{background:var(--surface);border:1px solid var(--sg-pnline);border-radius:12px;box-shadow:0 1px 2px rgba(20,18,16,.05);min-width:0;overflow:hidden}
:root[data-theme="dark"] #view-settings .sg-pn,:root[data-theme="dark"] #sgSheetHost .sg-pn{box-shadow:0 1px 0 rgba(255,255,255,.03) inset,0 2px 6px rgba(0,0,0,.28)}
#view-settings .sg-pnh,#sgSheetHost .sg-pnh{padding:16px 20px 13px;border-bottom:1px solid var(--rule)}
#view-settings .sg-pnh.sg-pnhs,#sgSheetHost .sg-pnh.sg-pnhs{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:12px 16px 10px}
#view-settings .sg-pn .sg-pnt,#sgSheetHost .sg-pn .sg-pnt{font:600 17px/1.3 'Inter',sans-serif;letter-spacing:-.01em;color:var(--ink);margin:0}
#sgSheetHost .sg-pnhs .sg-pnt{font-size:15px}
#sgSheetHost .sg-pnr{font:400 14px 'Inter',sans-serif;color:var(--ink-soft);white-space:nowrap}
#view-settings .sg-pnd{font:400 14px/1.45 'Inter',sans-serif;color:var(--ink-soft);margin:4px 0 0}
#view-settings .sg-pnb,#sgSheetHost .sg-pnb{padding:16px 20px}
#sgSheetHost .sg-pnhs + .sg-pnb{padding:8px 16px 12px}

/* rows inside a panel: edge to edge, a visible line between them */
#view-settings .sg-list{border-top:0;margin:-16px -20px}
#view-settings .sg-list:not(:last-child){margin-bottom:16px;border-bottom:1px solid var(--rule)}
#view-settings .sg-list:empty{padding:22px 20px}
/* a list followed only by its (empty) error line ends the panel: no gap under it */
#view-settings .sg-list:has(+ .sg-err:empty:last-child){margin-bottom:-16px;border-bottom:0}
#view-settings .sg-list:empty::before{content:'Nothing here yet';font:400 15px 'Inter',sans-serif;color:var(--ink-soft)}
#view-settings .sg-li{display:flex;align-items:center;gap:14px;min-height:54px;padding:12px 20px;border-bottom:1px solid var(--rule);box-sizing:border-box;font:400 15px 'Inter',sans-serif;color:var(--ink)}
#view-settings .sg-list > :last-child{border-bottom:0}
#view-settings .sg-liempty{color:var(--ink-soft)}
#view-settings .sg-lin{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
#view-settings .sg-lin b{font-weight:500;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#view-settings .sg-sub{font-size:14px;color:var(--ink-soft);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#view-settings .sg-lir{flex-shrink:0;font-size:14px;color:var(--ink-soft);text-align:right;max-width:46%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#view-settings .sg-lir.sg-lirdd{max-width:none;flex:0 0 220px}
#view-settings .sg-lir.sg-lirdd .sg-dd{width:100%;min-width:0}
#view-settings .sg-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0}
#view-settings .sg-row + .sg-row,#view-settings .sg-row + .sg-note{margin-top:10px}
#view-settings .sg-folded{margin-top:10px}
/* a hidden attribute wins over the panel rows' own display (the folded row, a file input) */
#view-settings [hidden],#sgSheetHost [hidden]{display:none!important}
/* THE FAMILY HERE (restyle, 21 Oct 2026). Settings sits inside class="pj" (#sgPanel, the sheet host), and the
   generated projects.css paints every `.pj .btn-line` white with grey words, later and as strong as family.css.
   So the main red and the grey are said again here at the id's strength. (The plain outline is pj-family.css's.) */
:where(body:not(.role-tech):not(.role-driver)) :is(#view-settings,#sgSheetHost,#sgDD) .btn-line.strong{background:var(--accent);border-color:transparent;color:var(--on-accent);border-radius:999px}
:where(body:not(.role-tech):not(.role-driver)) :is(#view-settings,#sgSheetHost,#sgDD) .btn-line.bt-neu{background:var(--bt-neu);border-color:transparent;color:var(--ink);border-radius:999px}
/* delete off a list: the red edge (doubled class: the older .btn-line.sg-red further down is as strong) */
:where(body:not(.role-tech):not(.role-driver)) :is(#view-settings,#sgSheetHost,#sgDD) .btn-line.bt-del.bt-del{background:transparent;border:1.5px solid var(--accent);color:var(--bt-del-ink);border-radius:999px}
@media (hover:hover) and (pointer:fine){
  :where(body:not(.role-tech):not(.role-driver)) :is(#view-settings,#sgSheetHost,#sgDD) .btn-line.bt-del.bt-del:hover{background:var(--bt-del-wash);border-color:var(--accent);color:var(--bt-del-ink)}
  :where(body:not(.role-tech):not(.role-driver)) :is(#view-settings,#sgSheetHost,#sgDD) .btn-line.strong:hover{background:var(--bt-main-h);color:var(--on-accent)}
  :where(body:not(.role-tech):not(.role-driver)) :is(#view-settings,#sgSheetHost,#sgDD) .btn-line.bt-neu:hover{background:var(--bt-neu-h);color:var(--ink)}
}
:where(body:not(.role-tech):not(.role-driver)) :is(#view-settings,#sgSheetHost,#sgDD) .btn-line.strong:active{background:var(--bt-main-p)}
:where(body:not(.role-tech):not(.role-driver)) :is(#view-settings,#sgSheetHost,#sgDD) .btn-line.bt-neu:active{background:var(--bt-neu-p)}
:where(body:not(.role-tech):not(.role-driver)) :is(#view-settings,#sgSheetHost,#sgDD) .btn-line.bt-del.bt-del:active{background:var(--bt-del-wash-p)}
:where(body:not(.role-tech):not(.role-driver)) :is(#view-settings,#sgSheetHost,#sgDD) .btn-line:is(.strong,.bt-neu):disabled{background:var(--bt-off-bg);color:var(--bt-off-ink);border-color:transparent;cursor:not-allowed}
#view-settings .sg-addrow{margin-top:0}
#view-settings .sg-inl,#sgSheetHost .sg-inl{display:inline-flex;align-items:center;gap:8px;flex-wrap:nowrap;max-width:100%}
#view-settings .inp.sg-inp,#sgSheetHost .inp.sg-inp{height:40px;min-height:40px;box-sizing:border-box;padding:0 12px;font:400 15px 'Inter',sans-serif;width:240px;max-width:100%;border-radius:var(--r-control,8px)}
#view-settings .inp.sg-inp.sg-full{width:100%}
#view-settings textarea.inp.sg-inp.sg-ta{height:auto;min-height:84px;padding:9px 12px;line-height:1.5;resize:vertical}
#view-settings .inp.sg-inp.bad,#sgSheetHost .inp.sg-inp.bad,#view-settings .sg-dd.bad,#sgSheetHost .sg-dd.bad,#sgSheetHost .sg-newname.bad{border-color:var(--accent)!important}
#view-settings .sg-err,#sgSheetHost .sg-err{font:400 14px 'Inter',sans-serif;color:var(--accent);margin-top:6px}
#view-settings .sg-err:empty,#sgSheetHost .sg-err:empty{display:none}
#view-settings .sg-ok,#sgSheetHost .sg-okline{display:inline-flex;align-items:center;gap:6px;font:400 14px 'Inter',sans-serif;color:var(--good)}
#view-settings .sg-ok svg,#sgSheetHost .sg-okline svg{width:14px;height:14px}
#view-settings .sg-note{font:400 14px/1.45 'Inter',sans-serif;color:var(--ink-soft)}
#view-settings .sg-to,#view-settings .sg-pre{font:400 14px 'Inter',sans-serif;color:var(--ink-soft)}
#view-settings .sg-money{display:inline-flex;align-items:center;position:relative}
#view-settings .sg-rp{position:absolute;left:12px;font:400 15px 'Inter',sans-serif;color:var(--ink-soft);pointer-events:none}
#view-settings .inp.sg-inp.sg-numin{padding-left:38px;width:160px;font-variant-numeric:tabular-nums}
#view-settings .sg-file{display:inline-flex;align-items:center;gap:10px;min-width:0}
#view-settings .sg-num{width:22px;height:22px;border-radius:11px;background:var(--field);display:inline-grid;place-items:center;font:500 13px 'Inter',sans-serif;color:var(--ink-soft);flex-shrink:0}
#view-settings .sg-fname{font:400 14px 'Inter',sans-serif;color:var(--ink-soft);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
#view-settings .sg-fname.has{color:var(--ink)}
#view-settings .sg-path{font:400 14px 'Inter',sans-serif;color:var(--ink-soft);margin:0 0 10px;overflow-wrap:anywhere}
#view-settings .sg-fold{background:none;border:0;padding:0 4px;min-height:32px;font:400 14px 'Inter',sans-serif;color:var(--ink-soft);cursor:pointer;text-decoration:underline;text-underline-offset:3px}
#view-settings .sg-fold:hover{color:var(--ink)}
#view-settings .btn-line.sg-red,#view-settings .sg-txtbtn.sg-red{color:var(--accent);border-color:var(--accent)}
#view-settings .sg-txtbtn{flex-shrink:0;background:none;border:0;min-height:34px;padding:0 10px;border-radius:8px;font:500 14px 'Inter',sans-serif;color:var(--ink-soft);cursor:pointer}
#view-settings .sg-txtbtn:hover{background:var(--sg-hover);color:var(--ink)}
#view-settings .sg-txtbtn.sg-red:hover{color:var(--accent)}
#view-settings .sg-chiprow{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#view-settings .sg-grp{display:inline-flex;align-items:center;min-height:34px;padding:0 12px;border:1px solid var(--sg-pnline);border-radius:6px;font:400 14px 'Inter',sans-serif;color:var(--ink);background:var(--surface)}
#view-settings .sg-facts{display:flex;flex-direction:column;gap:16px}
#view-settings .sg-two2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px 20px}
#view-settings .sg-lab,#sgSheetHost .sg-lab{display:block;font:500 13px/1.4 'Inter',sans-serif;color:var(--ink-soft);margin:0 0 6px}
#view-settings .sg-fact .sg-dd,#view-settings .sg-datewrap{width:100%}
#view-settings .sg-datewrap .inp{width:100%}

/* ── the overview: one panel per group, two columns where there is room ── */
#view-settings .sg-ov{border-top:0}
#view-settings .sg-ovr{display:flex;align-items:center;gap:18px;width:100%;min-height:56px;padding:12px 16px 12px 20px;background:none;border:0;border-bottom:1px solid var(--rule);
  text-align:left;cursor:pointer;color:var(--ink);font-family:'Inter',sans-serif;border-radius:0;transition:background-color .12s ease}
#view-settings .sg-ov > .sg-ovr:last-child{border-bottom:0}
#view-settings .sg-ovn{min-width:200px;font-size:15px;font-weight:500;color:var(--ink)}
#view-settings .sg-ovs{flex:1;min-width:0;padding-right:6px;font-size:14px;color:var(--ink-soft);white-space:normal}
#view-settings .sg-ovc{width:18px;height:18px;color:var(--ink-soft);flex-shrink:0;transition:transform .14s cubic-bezier(.23,1,.32,1)}
@media (hover:hover) and (pointer:fine){#view-settings .sg-ovr:hover{background:var(--sg-hover)}#view-settings .sg-ovr:hover .sg-ovc{transform:translateX(2px)}}
#view-settings .sg-ovr:active{background:var(--sg-press)}
#view-settings .sg-ovr:focus-visible{outline:2px solid var(--ink);outline-offset:-3px;border-radius:8px}
@media (min-width:1280px){
  #view-settings .sg-ovcols{display:block;columns:2;column-gap:20px}
  #view-settings .sg-ovcols > .sg-pn{break-inside:avoid;margin:0 0 20px;display:block}
  #view-settings .sg-ovcols .sg-ovr{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"n c" "v c";gap:2px 12px;align-items:center}
  #view-settings .sg-ovcols .sg-ovn{grid-area:n;min-width:0}
  #view-settings .sg-ovcols .sg-ovs{grid-area:v}
  #view-settings .sg-ovcols .sg-ovc{grid-area:c}
}

/* ── Team: Projects' table rows in a panel ── */
#view-settings .sg-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 14px}
#view-settings .sg-find .m3s{width:340px;max-width:100%}
#view-settings .sg-xls{margin-left:auto}
#view-settings .sg-r{--tblcols:minmax(0,1fr) 200px 160px 120px}
#view-settings .sg-pntbl{padding:0 0 4px}
#view-settings .sg-pntbl .tbl-h.sg-r{padding:12px 20px 10px;font:500 13px 'Inter',sans-serif;color:var(--ink-soft);background:transparent;border-bottom:1px solid var(--rule);cursor:default}
#view-settings .sg-pntbl .tbl-h .sg-hr{text-align:right}
#view-settings .sg-pntbl .tbl-r.sg-r{padding:8px 20px;min-height:54px;border-top:0;border-bottom:1px solid var(--rule);transition:background-color .12s ease}
@media (hover:hover) and (pointer:fine){#view-settings .sg-pntbl .tbl-r.sg-r:hover{background:var(--sg-hover)}}
#view-settings .sg-pntbl .tbl-r.sg-r:active{background:var(--sg-press)}
#view-settings .sg-pntbl .tbl-r.sg-r:focus-visible,#view-settings .sg-pntbl .tbl-gh:focus-visible{outline:2px solid var(--ink);outline-offset:-3px;border-radius:8px}
#view-settings .sg-pntbl .tbl-g .tbl-gh{margin:0;padding:12px 20px 8px;width:100%;box-sizing:border-box}
#view-settings .sg-pntbl .tbl-g + .tbl-g .tbl-gh{border-top:1px solid var(--sg-pnline)}
#view-settings .sg-pntbl .tbl-gh .t{font-size:15px;font-weight:600;color:var(--ink)}
#view-settings .sg-r .tbl-n{gap:10px;align-items:center}
#view-settings .sg-r .tbl-name{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#view-settings .sg-c{font:400 14px 'Inter',sans-serif;color:var(--ink-soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#view-settings .sg-pntbl .tbl-due{font-size:14px;color:var(--ink-soft);font-variant-numeric:tabular-nums}
#view-settings .sg-you{font:400 13px 'Inter',sans-serif;color:var(--ink-soft)}
#view-settings .sg-av{width:26px;height:26px;border-radius:13px;display:inline-flex;align-items:center;justify-content:center;color:#fff;font:600 12px 'Inter',sans-serif;flex-shrink:0;background-size:cover;background-position:center}
#view-settings .sg-av.has-av{color:transparent}

/* ── our dropdown: a closed field that opens a list ── */
#view-settings .sg-dd,#sgSheetHost .sg-dd{display:inline-flex;align-items:center;gap:9px;min-height:40px;box-sizing:border-box;padding:0 10px 0 12px;border:1px solid var(--rule-strong);border-radius:var(--r-control,8px);
  background:var(--surface);color:var(--ink);font:400 15px 'Inter',sans-serif;cursor:pointer;text-align:left;max-width:100%;min-width:180px;transition:border-color .12s ease,transform .1s ease-out}
@media (hover:hover) and (pointer:fine){#view-settings .sg-dd:hover,#sgSheetHost .sg-dd:hover{border-color:var(--ink-soft)}}
#view-settings .sg-dd[aria-expanded="true"],#sgSheetHost .sg-dd[aria-expanded="true"]{border-color:var(--ink)}
#view-settings .sg-dd:focus-visible,#sgSheetHost .sg-dd:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
#view-settings .sg-dd:active,#sgSheetHost .sg-dd:active{transform:scale(.99)}
#view-settings .sg-ddv,#sgSheetHost .sg-ddv{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#view-settings .sg-ddv.ph,#sgSheetHost .sg-ddv.ph{color:var(--ink-soft)}
#view-settings .sg-ddc,#sgSheetHost .sg-ddc{width:16px;height:16px;color:var(--ink-soft);flex-shrink:0;transition:transform .16s cubic-bezier(.23,1,.32,1)}
#view-settings .sg-dd[aria-expanded="true"] .sg-ddc,#sgSheetHost .sg-dd[aria-expanded="true"] .sg-ddc{transform:rotate(180deg)}
#view-settings .sg-dd.sg-time{min-width:110px;font-variant-numeric:tabular-nums}
#view-settings .sg-dd.sg-of{min-width:170px}
#view-settings .sg-dd.sg-cdd{min-width:150px}
#view-settings .sg-dd.sg-warn .sg-ddv{color:var(--accent)}
#view-settings .sg-ovs.warn{color:var(--accent)}
#view-settings .sg-lir.sg-lirdd.sg-lirsm{flex:0 0 160px}
#view-settings .sg-sw,#sgDD .sg-sw{width:14px;height:14px;border-radius:3px;flex-shrink:0}
#sgDD.sg-ddp{position:fixed;z-index:1100;background:var(--surface);border:1px solid var(--rule);border-radius:10px;box-shadow:0 14px 36px -14px rgba(var(--shade-rgb),.4);
  display:flex;flex-direction:column;overflow:hidden;transform-origin:top left;animation:sg-pop .14s cubic-bezier(.23,1,.32,1)}
#sgDD.sg-ddp.up{transform-origin:bottom left}
#sgDD.sg-ddp.kb{animation:none}
#sgDD[hidden],#sgDDveil[hidden]{display:none}
#sgDD .sg-ddhd{display:none}
#sgDD .sg-ddq{padding:8px 8px 4px;flex-shrink:0}
#sgDD .sg-ddq .m3s{width:100%}
#sgDD .sg-ddl{overflow-y:auto;padding:4px 6px 6px;overscroll-behavior:contain;min-height:0}
#sgDD .sg-ddg{font:500 13px 'Inter',sans-serif;color:var(--ink-soft);padding:10px 8px 4px}
#sgDD .sg-ddo{display:flex;align-items:center;gap:10px;min-height:38px;padding:4px 8px;border-radius:var(--r-control,8px);font:400 15px 'Inter',sans-serif;color:var(--ink);cursor:pointer;outline:none;transition:background-color .1s ease}
#sgDD .sg-ddo:focus-visible,#sgDD .sg-ddo:focus{background:var(--field)}
@media (hover:hover) and (pointer:fine){#sgDD .sg-ddo:hover{background:var(--field)}}
#sgDD .sg-ddo:active{background:var(--field-h)}
#sgDD .sg-ddn{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#sgDD .sg-ddo.on .sg-ddn{font-weight:500}
#sgDD .sg-ddr{font-size:13px;color:var(--ink-soft);white-space:nowrap}
#sgDD .sg-ddt{width:16px;height:16px;color:var(--ink);flex-shrink:0}
#sgDD .sg-ddt svg{width:16px;height:16px;stroke-width:2}
#sgDD .sg-tk{width:16px;height:16px;border-radius:4px;border:1.5px solid var(--rule-strong);box-sizing:border-box;display:grid;place-items:center;flex-shrink:0;background:var(--surface);color:var(--on-ink,#fff)}
#sgDD .sg-tk svg{width:12px;height:12px;stroke-width:2.4}
#sgDD .sg-ddo.on .sg-tk{background:var(--ink);border-color:var(--ink)}
#sgDD .sg-ddsep{height:1px;background:var(--rule-soft);margin:5px 8px}
#sgDD .sg-ddadd{color:var(--ink-soft)}
#sgDD .sg-ddnone{padding:14px 8px;font:400 14px 'Inter',sans-serif;color:var(--ink-soft)}
/* #sgDD Done: the family red */
#sgDDveil.sg-ddveil{position:fixed;inset:0;z-index:1090;background:rgba(var(--veil-rgb),.34);animation:sg-fade .16s ease-out}
@keyframes sg-pop{from{opacity:0;transform:scale(.97) translateY(-4px)}}
@keyframes sg-fade{from{opacity:0}}
@keyframes sg-up{from{transform:translateY(100%)}}

/* ── the saved mark ── */
#view-settings .sg-saved,#sgSheetHost .sg-saved{display:inline-flex;align-items:center;gap:5px;font:400 14px 'Inter',sans-serif;color:var(--good);opacity:0;transition:opacity .16s ease}
#view-settings .sg-saved.sg-on,#sgSheetHost .sg-saved.sg-on,#view-settings .sg-ok.sg-on{opacity:1}
#view-settings .sg-saved svg,#sgSheetHost .sg-saved svg,#view-settings .sg-ok svg{width:14px;height:14px}

/* ── one person: Projects' sheet, the name at 28, then the ticks beside the details ── */
#sgSheetHost{position:fixed;inset:0;z-index:600;pointer-events:none}
#sgSheetHost.on{pointer-events:auto}
#sgSheetHost:empty{display:none}
#sgSheetHost .sg-sheet:focus{outline:none}
.pj#sgSheetHost .sg-sheet{height:auto;max-height:100%}
.pj#sgSheetHost .sg-sheet .sheet-body{padding:30px 40px 40px;background:var(--sg-page);overscroll-behavior:contain}
#sgSheetHost .sg-sheet .sheet-where,#sgSheetHost .sg-sheet .r2-txt{color:var(--ink-soft)}
#sgSheetHost .sg-sheet .sheet-where{font-size:14px}
@media (hover:hover) and (pointer:fine){#sgSheetHost .sg-sheet .r2-txt.sg-rm:hover{color:var(--accent)}}
#sgSheetHost .sg-create{height:34px;min-height:0;padding:0 16px;font-size:13px}
/* the sheet's Create: the family red */
/* no bar on top of the sheet (16 Oct 2026): the ✕ stands alone at the top right (projects.css .sheet > .sheet-x),
   so the title row keeps clear of it; Discard / Create / Remove are the last row (Projects' .doc-del line) */
#sgSheetHost .sg-phead{display:flex;align-items:center;gap:16px;padding-right:44px}
#sgSheetHost .sg-phl{flex:1;min-width:0}
.pj#sgSheetHost .sg-foot{display:flex;align-items:center;gap:10px}
.pj#sgSheetHost .sg-foot .sg-create{margin-left:auto}
/* the page here is grey, not white: the ✕ takes the page's grey (no white tile), and the last
   row's line is the panel line, not the hairline that vanishes on grey (no faint hairlines) */
.pj#sgSheetHost .sheet > .sheet-x{background:var(--sg-page)}
.pj#sgSheetHost .sheet > .sheet-x:hover{background:var(--sg-hover)}
.pj#sgSheetHost .sg-foot{border-top-color:var(--sg-pnline)}
#sgSheetHost .sg-pic{width:56px;height:56px;border-radius:28px;border:0;padding:0;display:inline-grid;place-items:center;color:#fff;font:600 22px 'Inter',sans-serif;cursor:pointer;flex-shrink:0;background-size:cover;background-position:center;transition:transform .1s ease-out}
#sgSheetHost .sg-pic:disabled{cursor:default}
#sgSheetHost .sg-pic.has-av .ini{opacity:0}
#sgSheetHost .sg-pic:not(:disabled):active{transform:scale(.96)}
#sgSheetHost .sg-pic:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
.pj#sgSheetHost .sg-doc .doc-title{font-size:28px;font-weight:600;line-height:1.2;letter-spacing:-.02em;margin:0 0 6px}
.pj#sgSheetHost .sg-doc .doc-sub{font-size:14px;color:var(--ink-soft);margin:0 0 6px}
#sgSheetHost .sg-psum{display:block;font:400 14px/1.4 'Inter',sans-serif;color:var(--ink-soft);margin:6px 0 22px}
#sgSheetHost .sg-psum b{font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums}
#sgSheetHost .sg-psep{display:inline-block;vertical-align:-2px;width:1px;height:14px;background:var(--sg-pnline);margin:0 12px}
#sgSheetHost .sg-doc > .sg-err{margin:0 0 16px}
#sgSheetHost .sg-pcols{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:stretch}
#sgSheetHost .sg-pcols > div{min-width:0}
#sgSheetHost .sg-pcols > .sg-pnf{align-self:stretch}
#sgSheetHost .sg-pnf .sg-pnb{padding:14px 16px 16px}
#sgSheetHost .sg-facts{display:flex;flex-direction:column;gap:16px}
#sgSheetHost .sg-fact .sg-dd,#sgSheetHost .sg-fact .inp.sg-inp{width:100%}
#sgSheetHost .sg-fact .sg-inl{width:100%}
#sgSheetHost .sg-fact .sg-inl .inp.sg-inp{flex:1;width:auto;min-width:0}
#sgSheetHost .sg-factv{font:400 15px 'Inter',sans-serif;color:var(--ink)}
#sgSheetHost .sg-sig{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
#sgSheetHost .sg-small{min-height:32px;padding:0 12px;font-size:14px}
#sgSheetHost .btn-line.m3-text.sg-small{color:var(--ink-soft)!important}
@media (hover:hover) and (pointer:fine){#sgSheetHost .btn-line.m3-text.sg-small:hover{color:var(--ink)!important;background:var(--field)!important}}
#sgSheetHost .sg-tokind{margin:6px 0 0 -12px}
#sgSheetHost .sg-hid2,#sgSheetHost .sg-hint{font:400 14px/1.4 'Inter',sans-serif;color:var(--ink-soft);margin-top:6px}
#sgSheetHost .sg-plain{font:400 15px/1.6 'Inter',sans-serif;color:var(--ink)}
#sgSheetHost .sg-lab2{margin-top:14px}
#sgSheetHost .sg-none{border:1px dashed var(--sg-pnline);border-radius:12px;padding:32px 20px;text-align:center;font:400 15px 'Inter',sans-serif;color:var(--ink-soft);background:var(--surface)}
#sgSheetHost .sg-newname{display:block;width:100%;box-sizing:border-box;font:600 28px/1.15 'Inter',sans-serif;letter-spacing:-.02em;color:var(--ink);background:none;
  border:0;border-bottom:1px solid var(--rule-strong);border-radius:0;padding:2px 0 8px;outline:none;transition:border-color .15s ease}
#sgSheetHost .sg-newname::placeholder{color:var(--ink-ghost,var(--ink-soft))}
#sgSheetHost .sg-newname:focus{border-bottom-color:var(--ink)}
#sgSheetHost .sg-pnsign{margin:16px 0 20px}
#sgSheetHost .sg-signin{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px 24px}

/* the ticks: the app's own tick box, a whole row is the target */
#sgSheetHost .sg-tick{display:flex;align-items:center;gap:10px;min-height:36px;padding:2px 6px;margin:0 -6px;border-radius:var(--r-control,8px);font:400 15px 'Inter',sans-serif;color:var(--ink);cursor:pointer;transition:background-color .1s ease}
@media (hover:hover) and (pointer:fine){#sgSheetHost .sg-tick:hover{background:var(--sg-hover)}}
#sgSheetHost .sg-tick .msbox{margin:0;transition:transform .1s ease-out,background-color .12s ease,border-color .12s ease}
#sgSheetHost .sg-tick:active .msbox{transform:scale(.92)}
#sgSheetHost .sg-tick.sm{min-height:32px;font-size:14px;color:var(--ink-soft);align-items:flex-start;padding-top:7px;padding-bottom:7px}
#sgSheetHost .sg-tick.sm .msbox{width:16px;height:16px;margin-top:1px;border-radius:4px}
/* the fine tick (manage.css .msbox, 18 Oct 2026) is a mask: a smaller box only needs a smaller mask */
#sgSheetHost .sg-tick.sm .msbox::after{-webkit-mask-size:11px 11px;mask-size:11px 11px}
#sgSheetHost .sg-app{min-width:0}
#sgSheetHost .sg-acts{margin:0 0 6px 29px;border-left:1px solid var(--sg-pnline);padding-left:12px}
#sgSheetHost .sg-agrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:stretch}
#sgSheetHost .sg-agrid > .sg-pn{display:flex;flex-direction:column}
#sgSheetHost .sg-agrid > .sg-pn > .sg-pnb{flex:1}
#sgSheetHost .sg-agrp .sg-pnb{padding:6px 16px 10px}
#sgSheetHost .sg-aevery{margin-top:16px}
#sgSheetHost .sg-acols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 40px}

/* press feedback on the app's buttons used here */
#view-settings .btn-line,#sgSheetHost .btn-line,#view-settings .btn-primary{transition:transform .1s ease,background-color .12s ease,border-color .12s ease}
#view-settings .btn-line:active,#sgSheetHost .btn-line:active,#view-settings .btn-primary:active{transform:scale(.97)}

/* ── Work (Phase 6): rows that open a sheet, category rows with their colour, machine sizes typed in place ── */
#view-settings .sg-lirow{width:100%;background:none;border:0;border-bottom:1px solid var(--rule);text-align:left;cursor:pointer;font:inherit;color:var(--ink);border-radius:0;transition:background-color .12s ease}
@media (hover:hover) and (pointer:fine){#view-settings .sg-lirow:hover,#view-settings .sg-linbtn:hover{background:var(--sg-hover)}}
#view-settings .sg-lirow:active,#view-settings .sg-linbtn:active{background:var(--sg-press)}
#view-settings .sg-lirow:focus-visible,#view-settings .sg-linbtn:focus-visible{outline:2px solid var(--ink);outline-offset:-3px;border-radius:8px}
#view-settings .sg-lirow.dim b{color:var(--ink-soft)}
#view-settings .sg-cat{gap:12px;padding-left:0}
#view-settings .sg-edge{width:4px;align-self:stretch;flex-shrink:0;border-radius:0 2px 2px 0}
#view-settings .sg-linbtn{flex:1;min-width:0;display:flex;background:none;border:0;padding:4px 6px;margin:-4px 0;text-align:left;cursor:pointer;font:inherit;color:var(--ink);border-radius:8px}
#view-settings .sg-grp .sg-chipx{display:inline-grid;place-items:center;width:24px;height:24px;margin:0 -6px 0 6px;padding:0;border:0;border-radius:6px;background:none;color:var(--ink-soft);cursor:pointer}
#view-settings .sg-grp .sg-chipx:hover{background:var(--sg-hover);color:var(--ink)}
#view-settings .sg-i12,#sgSheetHost .sg-i12{width:12px;height:12px;display:block}
#view-settings .inp.sg-inp.sg-sm{width:180px}
#view-settings .sg-sz{margin:-16px -20px 16px}
#view-settings .sg-szr{display:grid;grid-template-columns:minmax(160px,1fr) repeat(6,84px) 70px;gap:8px 10px;align-items:end;padding:12px 20px;border-bottom:1px solid var(--rule)}
#view-settings .sg-szn{display:flex;flex-direction:column;gap:2px;min-width:0;align-self:center;font:400 15px 'Inter',sans-serif}
#view-settings .sg-szn b{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#view-settings .sg-szr.none .sg-szn b{color:var(--ink-soft)}
#view-settings .sg-szc{display:flex;flex-direction:column;gap:3px}
#view-settings .sg-szl{font:500 13px 'Inter',sans-serif;color:var(--ink-soft)}
#view-settings .inp.sg-inp.sg-szi{width:100%;padding:0 8px;text-align:right;font-variant-numeric:tabular-nums}
#view-settings .sg-szx{align-self:center;text-align:right}
#view-settings .sg-szerr{grid-column:1 / -1}
#view-settings .sg-szr.sg-szh{padding:10px 20px;font:500 13px 'Inter',sans-serif;color:var(--ink-soft);background:transparent;border-bottom:1px solid var(--rule);align-items:center}
#view-settings .sg-szr.sg-szh > span:not(:first-child){text-align:right;padding-right:8px}
#view-settings .sg-szr:not(.sg-szh){align-items:center}
@media (min-width:761px){#view-settings .sg-szl{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}}
@media (max-width:760px){#view-settings .sg-szr.sg-szh{display:none}}
#sgSheetHost .sg-pcols.sg-pcols1{grid-template-columns:minmax(0,560px)}
#sgSheetHost .sg-mt{margin-top:16px}
#sgSheetHost .sg-hint0{margin:0 0 8px}
#sgSheetHost .sg-two2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px 20px}
#sgSheetHost .sg-catdot{width:20px;height:20px;border-radius:5px;flex-shrink:0}
#sgSheetHost .sg-skills .msskrow{padding:10px 0}
#sgSheetHost .sg-skills .msskrow:last-child{border-bottom:0}
#sgSheetHost .sg-skills .lv{color:var(--ink-soft)}
#sgSheetHost .sg-skills .mslvls button{transition:transform .1s ease-out,background-color .12s ease,color .12s ease}
#sgSheetHost .sg-skills .mslvls button:active{transform:scale(.92)}
#sgSheetHost .sg-skills .mslvls button:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
#sgSheetHost .sg-skills .mslvls button svg{display:block;margin:auto}
@media (max-width:760px){
  #view-settings .sg-sz{margin:-14px -16px 14px}
  #view-settings .sg-szr{grid-template-columns:repeat(3,minmax(0,1fr));padding:12px 16px}
  #view-settings .sg-szn{grid-column:1 / -1}
  #view-settings .sg-szx{grid-column:1 / -1;text-align:left}
  #view-settings .sg-lirow{min-height:56px}
  #sgSheetHost .sg-skills .msskrow{flex-wrap:wrap;gap:8px}
  #sgSheetHost .sg-skills .mslvls button{width:40px;height:40px}
  #sgSheetHost .sg-two2{grid-template-columns:minmax(0,1fr)}
  #sgSheetHost .sg-pcols.sg-pcols1{grid-template-columns:minmax(0,1fr)}
}

/* Sign-ins inside Settings: the page keeps its own list and Refresh; the section names itself already */
#view-settings .sg-si .si-title-page{display:none}
#view-settings .sg-pn.sg-si{overflow-x:auto}
/* inside the Settings panel the table is narrower than its own page was: long heads, role and device wrap, so nothing is cut */
#view-settings .sg-si .si-table th{white-space:normal;text-wrap:balance}
#view-settings .sg-si .si-table .c-r,#view-settings .sg-si .si-table .c-d{white-space:normal}
#view-settings .sg-si .si-table .c-p{white-space:normal}
#view-settings .sg-si .si-table .c-p b{white-space:nowrap}
#view-settings .sg-si .si-head{justify-content:flex-end;margin-top:0}

/* ── the phone: no panel beside the rail, so the page carries its own head and a way back ── */
@media (max-width:760px){
  #view-settings .sg-back{display:inline-flex;align-items:center;gap:4px;min-height:44px;margin:-8px 0 2px -6px;padding:0 6px;background:none;border:0;font:500 15px 'Inter',sans-serif;color:var(--ink-soft);cursor:pointer}
  #view-settings .sg-back svg{width:18px;height:18px}
  #view-settings .sg-back:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
  #view-settings .sg-ahd{margin:4px 0 16px;align-items:center;min-height:0}
  #view-settings .sg-headr{padding-bottom:0}
  #view-settings .sg-pns,#view-settings .sg-blk{gap:14px}
  #view-settings .sg-pnh{padding:14px 16px 11px}
  #view-settings .sg-pnb{padding:14px 16px}
  #view-settings .sg-list{margin:-14px -16px}
  #view-settings .sg-list:not(:last-child){margin-bottom:14px}
  #view-settings .sg-li{padding:12px 16px}
  #view-settings .sg-li:has(.sg-lirdd){flex-wrap:wrap;gap:8px}
  #view-settings .sg-li .sg-lir.sg-lirdd{flex:1 1 100%;max-width:none}
  #view-settings .sg-lir{max-width:40%}
  #view-settings .sg-ovr{padding:12px 12px 12px 16px;min-height:60px;flex-wrap:wrap;gap:2px 12px}
  #view-settings .sg-ovn{min-width:0;max-width:none;flex:1 1 auto}
  #view-settings .sg-ovs{order:3;flex:1 1 100%}
  #view-settings .sg-ovc{order:2}
  #view-settings .sg-find,#view-settings .sg-find .m3s{width:100%}
  #view-settings .sg-tools .sg-find{flex:1 1 100%}
  #view-settings .sg-xls{margin-left:0}
  #view-settings .sg-find input,#view-settings .inp.sg-inp,#sgSheetHost .inp.sg-inp{font-size:16px!important}
  #sgSheetHost .sg-newname{font-size:23px!important}
  #view-settings .sg-pntbl .tbl-h.sg-r{display:none}
  #view-settings .sg-pntbl .tbl-r.sg-r{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"n d" "c c";gap:4px 12px;padding:10px 16px;min-height:0}
  #view-settings .sg-pntbl .tbl-r.sg-r > .tbl-n{grid-area:n}
  #view-settings .sg-pntbl .tbl-r.sg-r > .tbl-due{grid-area:d;align-self:center}
  #view-settings .sg-pntbl .tbl-r.sg-r > .sg-c{display:none}
  #view-settings .sg-pntbl .tbl-r.sg-r > .sg-c:nth-child(2){display:block;grid-area:c;padding-left:36px}
  #view-settings .sg-pntbl .tbl-g .tbl-gh{padding:12px 16px 8px}
  #view-settings .sg-two2{grid-template-columns:minmax(0,1fr)}
  #view-settings .sg-dd,#sgSheetHost .sg-dd{min-height:44px}
  .pj#sgSheetHost .sg-sheet{height:100%}
  .pj#sgSheetHost .sg-sheet .sheet-body{padding:18px 16px 120px}
  .pj#sgSheetHost .sg-sheet .sheet-right .r2-txt,.pj#sgSheetHost .sg-foot .r2-txt{display:inline-flex;min-height:44px;padding:0 8px;align-items:center}
  #sgSheetHost .sg-sheet .sheet-x{width:44px;height:44px}
  #sgSheetHost .sg-create{height:44px}
  #sgSheetHost .sg-pcols{grid-template-columns:minmax(0,1fr);gap:16px}
  #sgSheetHost .sg-pcols > .sg-pnf{order:-1}
  #sgSheetHost .sg-agrid,#sgSheetHost .sg-acols{grid-template-columns:minmax(0,1fr)}
  #sgSheetHost .sg-signin{grid-template-columns:minmax(0,1fr)}
  #sgSheetHost .sg-tick{min-height:44px}
  #sgSheetHost .sg-tick.sm{min-height:40px}
  #sgDD.sg-ddp.sheet{left:0;right:0;bottom:0;top:auto;width:auto;max-height:82vh;border-radius:14px 14px 0 0;border-bottom:0;padding-bottom:env(safe-area-inset-bottom);animation:sg-up .24s cubic-bezier(.32,.72,0,1)}
  #sgDD.sg-ddp.sheet .sg-ddhd{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 12px 4px 18px;font:600 19px 'Inter',sans-serif;color:var(--ink)}
  #sgDD.sg-ddp.sheet .sg-ddhd .btn-line{min-height:44px;padding:0 18px}
  #sgDD.sg-ddp.sheet .sg-ddq input{font-size:16px}
  #sgDD.sg-ddp.sheet .sg-ddo{min-height:50px}
  #sgDD.sg-ddp.sheet .sg-ddl{padding-bottom:14px}
}
@media (prefers-reduced-motion:reduce){#sgDD,#sgDDveil{animation:none}#view-settings .sg-dd,#view-settings .sg-ovr,#sgSheetHost .msbox{transition:none}}

/* ── Money: the one company rate and the login's own rates (one dollar rate, 9 Nov 2026) ── */
#view-settings .sg-fxrate{font:600 22px/1.2 'Inter',sans-serif;color:var(--ink);font-variant-numeric:tabular-nums;transition:opacity .18s ease}
#view-settings .sg-fxrate.sg-fxbusy{opacity:.45}
#view-settings .sg-fxwhen.late{color:var(--accent)}
#view-settings .sg-fxmine{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#view-settings .sg-fxmine + .sg-fxmine{margin-top:10px}
#view-settings .sg-fxmine .sg-fxapp{font:400 14px 'Inter',sans-serif;color:var(--ink-soft);min-width:120px}
#view-settings .sg-fxmine b{font:600 16px 'Inter',sans-serif;color:var(--ink);font-variant-numeric:tabular-nums}
#view-settings .sg-fxtag{display:inline-flex;align-items:center;height:24px;padding:0 10px;border-radius:999px;font:500 14px 'Inter',sans-serif;background:color-mix(in srgb,var(--accent) 12%,transparent);color:var(--accent)}
@media (prefers-reduced-motion:reduce){#view-settings .sg-fxrate{transition:none}}
