/* The shell's own rules, and the shared page composition. Tokens only; everything else is Selective V2
   (/ds2/). The composition part is page heads, rows, empty frames, forms, dialogs, tables and the reading column. A screen's own layout (the agenda's grids, the chat, the home board, projects)
   stays in that screen's stylesheet. */

/* ===================================================================== the shell */

html{background:var(--paper)}
.sel-shell{min-height:100vh}
/* React draws hidden="" on menus and panels; V2 classes set display, so hidden must win (kit.css does the same) */
[hidden]{display:none !important}
.sel-toasts{z-index:80}
.sel-scrim{z-index:70}
/* the page takes the focus after a keyboard navigation (core/focus.js): no browser outline, never a ring */
.sel-page:focus{outline:none}
/* the quiet "can't reach the site" line above the screen */
.app-status{color:var(--ink-muted)}
/* the one sentence under a shell page's title (Not found) */
.app-lead{max-width:var(--measure,65ch);color:var(--ink-muted)}
.app-gap{margin-top:var(--space-5)}
/* the login (shell/login.js) */
.sel-frame-body.login-form{padding-top:var(--space-5);display:flex;flex-direction:column;gap:var(--space-5)}
.login-more{display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px}
.sel-toast>.sel-action{flex:none}

/* ===================================================================== shared composition (kit.css section 1) */

@media (max-width:1023px){.sel-page-head{align-items:flex-start}}

/* page heads: back link, tile, name and state, actions at the end */
.back{display:inline-flex;align-items:center;gap:6px;flex:none}
.sel-page-head-thing>.sel-page-actions{margin-left:auto}
.sel-page-head-thing .sel-who h1{flex-wrap:wrap}

/* rows */
.sel-rows li>.sel-action{flex:none;align-self:center}
.sel-rows li>.sel-iconbtn{align-self:center}
.sel-rows li>.sel-switch{flex:none}
.sel-rows .sel-check{flex:none;min-height:40px}
.sel-rows .sel-check .sel-box{margin:0}
.sel-row-text>a{align-self:flex-start;max-width:100%}
.sel-row-text>b,.sel-row-text>span{min-width:0}
.sel-row-text>.sel-data{white-space:normal}
.sel-row-text .cat{display:inline-flex;align-items:center;gap:6px}
.sel-rows .sel-time{width:60px}
.sel-rows .sel-time.sel-time-wide{width:80px}
.h12 .sel-rows .sel-time{width:76px}
.rows-tight li{min-height:44px}
.sel-grow{flex:1 1 auto;min-width:0}
.more-link{margin-top:4px;align-self:flex-start}
.qlinks{display:flex;flex-wrap:wrap;gap:8px 20px;align-items:flex-start}
.qlinks .sel-action{text-align:left}
.sel-bad-text{color:var(--danger)}
.kbd{display:inline-block;min-width:24px;padding:0 6px;text-align:center;border:1px solid var(--line-strong);font:var(--text-data)}

/* forms */
.form-grid{display:flex;flex-direction:column;gap:28px}
.form-row{display:flex;flex-wrap:wrap;gap:28px 12px;align-items:flex-start}
.form-row>.sel-field{flex:1 1 180px;width:auto;max-width:none}
.form-row>.sel-switch{align-self:center}
.controls-row{display:flex;flex-wrap:wrap;gap:16px 12px;margin-bottom:8px}
.controls-row>.sel-field{flex:1 1 220px;max-width:none}
.perm-list{display:flex;flex-direction:column}
.perm-list .sel-switch{min-height:56px;border-bottom:1px solid var(--line)}
.perm-list .sel-switch:last-child{border-bottom:0}
.perm-list .sel-switch>span{display:flex;flex-direction:column}
.perm-list small{font:var(--text-body-small);color:var(--ink-muted)}

/* dialogs */
.dlg-body,.dl-col{display:flex;flex-direction:column;gap:20px}
.dl-col{padding-top:6px}
.dlg-body .sel-field,.dl-col .sel-field{max-width:none}
.dl-colours{display:flex;gap:10px;flex-wrap:wrap}
.dl-dot{position:relative;display:inline-flex;width:28px;height:28px;align-items:center;justify-content:center;cursor:pointer}
.dl-dot input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer}
.dl-dot i{width:14px;height:14px;border-radius:var(--radius-dot,50%);background:var(--dot)}
.dl-dot input:checked+i,.dl-dot input:focus-visible+i{box-shadow:0 0 0 3px var(--paper-raised),0 0 0 4px var(--ink)}

/* tables: the first column takes the room and cuts with an ellipsis; a row that opens something is clickable */
.tbl-bot{display:flex;align-items:center;gap:14px;min-width:0}
.tbl-bot .sel-avatar{flex:none}
.tbl-bot>div{display:flex;flex-direction:column;min-width:0}
.tbl-bot a{align-self:flex-start}
.tbl-bot small{font:var(--text-body-small);color:var(--ink-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tbl-bot .st{display:none}
.sel-table th,.sel-table td{white-space:nowrap}
.sel-table th:first-child,.sel-table td:first-child{width:100%;max-width:0;overflow:hidden}
.sel-table td.act{width:1%;white-space:nowrap}
.sel-table td.act>*{vertical-align:middle}
.tbl-act{display:flex;align-items:center;justify-content:flex-end;gap:16px}
.sel-table tr[data-href]{cursor:pointer}
.sel-table tr[data-href]:hover td{background:var(--hover)}
.sel-table tr[data-href] td:first-child,.sel-table th:first-child{padding-left:8px}
@media (max-width:760px){.hide-sm{display:none}.tbl-bot small.d{display:none}}
@media (max-width:640px){.hide-xs{display:none}.tbl-bot .st{display:block;font:var(--text-body-small)}}

/* a reading column for notes, documents and legal text */
.k-prose{max-width:var(--measure,65ch);display:flex;flex-direction:column;gap:16px}
.k-prose h2{font:var(--text-heading);letter-spacing:-.01em;margin-top:16px}
.k-prose h3{font:var(--text-label);margin-top:8px}
.k-prose ul{display:flex;flex-direction:column;gap:6px;padding-left:20px;list-style:square}
.k-prose code{font:var(--text-code)}
