/* ============================================================
   app.css — the Robotack OS shell and its shared components.
   Loads after base-tokens.css on every signed-in page.

   Prefix: os- (shell + shared components). Pages add their own
   <page>.css with their own prefix. Bootstrap is present on DataTable
   pages, so nothing here reuses a Bootstrap class name (.modal,
   .dropdown-menu, .nav, .badge...).
   Tokens only; dark mode = html.dark token overrides; RTL via logical
   properties. One motion budget: things move when you act on them.
   ============================================================ */

html{ -webkit-text-size-adjust:100%; }
/* Arabic surfaces use Tajawal (house rule); Latin names and emails keep falling back to Figtree. */
html[lang="ar"]{ --font-text:'Tajawal', 'Figtree', system-ui, sans-serif; --font-disp:'Tajawal', 'Figtree', system-ui, sans-serif; }
body{ font-size:14px; line-height:1.5; background:var(--canvas); color:var(--text-main); }
/* body-qualified so Bootstrap's reboot (loaded later on DataTable pages) can't re-add margins */
body h1, body h2, body h3, body h4{ margin:0; font-weight:inherit; line-height:inherit; font-size:inherit; }
body p{ margin:0; }
body ul, body ol{ margin-bottom:0; }
a{ color:var(--primary-text); }
:focus-visible{ outline:3px solid var(--focus-ring); outline-offset:2px; }
[hidden]{ display:none !important; }
.os-sr{ position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.os-num{ font-variant-numeric:tabular-nums; }
/* Every icon gets a sane size by default; components override it (zero specificity via :where). */
:where(svg.ic){ width:1.15em; height:1.15em; flex:none; vertical-align:-.2em; }

/* ------------------------------------------------------------
   Shell: global bar / (workspace sidebar | panel)
   The app owns the viewport; only the panel's page scrolls (.os-scroll).
   ------------------------------------------------------------ */
.os-app{ height:100vh; height:100dvh; min-height:480px; display:flex; flex-direction:column; overflow:hidden; background:var(--canvas); }

/* Accent palettes. A workspace names one (WorkspaceDefinition.accent); anything inside
   [data-accent] reads --acc / --acc-soft / --acc-tint. Add a palette here, nowhere else. */
:root, [data-accent="violet"]{ --acc:#5A3DF0; --acc-soft:#EBE9FF; --acc-tint:#F7F6FF; }
[data-accent="green"]{ --acc:#13875A; --acc-soft:#E0F3EA; --acc-tint:#F3FAF6; }
[data-accent="blue"]{ --acc:#2A6BD1; --acc-soft:#E0EBFB; --acc-tint:#F3F7FD; }
[data-accent="pink"]{ --acc:#B8368F; --acc-soft:#FAE3F2; --acc-tint:#FDF4FA; }
[data-accent="amber"]{ --acc:#9A6608; --acc-soft:#FBEFD0; --acc-tint:#FEF9EE; }
[data-accent="slate"]{ --acc:#5B5A7A; --acc-soft:#ECECF4; --acc-tint:#F7F7FA; }
[data-accent="teal"]{ --acc:#0B7A80; --acc-soft:#DCF1F1; --acc-tint:#F1F9F9; }
html.dark, html.dark [data-accent="violet"]{ --acc:#B8ACFF; --acc-soft:rgba(90,61,240,.24); --acc-tint:rgba(90,61,240,.08); }
html.dark [data-accent="green"]{ --acc:#5FD3A4; --acc-soft:rgba(19,135,90,.26); --acc-tint:rgba(19,135,90,.08); }
html.dark [data-accent="blue"]{ --acc:#8DB4FF; --acc-soft:rgba(42,107,209,.26); --acc-tint:rgba(42,107,209,.08); }
html.dark [data-accent="pink"]{ --acc:#F08ACF; --acc-soft:rgba(184,54,143,.26); --acc-tint:rgba(184,54,143,.08); }
html.dark [data-accent="amber"]{ --acc:#F0C26A; --acc-soft:rgba(181,121,10,.26); --acc-tint:rgba(181,121,10,.08); }
html.dark [data-accent="slate"]{ --acc:#C3C1DA; --acc-soft:rgba(140,138,170,.22); --acc-tint:rgba(140,138,170,.07); }
html.dark [data-accent="teal"]{ --acc:#5ED0D4; --acc-soft:rgba(11,122,128,.28); --acc-tint:rgba(11,122,128,.09); }

/* The Robotack logo (icons.html :: mark). Shared by shell, sign-in and error pages. */
.os-mark{ width:28px; height:28px; flex:none; display:block; object-fit:contain; user-select:none; }
/* Its outline is dark ink, so on dark surfaces a thin light halo keeps the silhouette readable. */
html.dark .os-mark{ filter:drop-shadow(0 0 .75px rgba(255,255,255,.8)) drop-shadow(0 0 .75px rgba(255,255,255,.8)); }

/* Module identities (portal/fragments/module-icons.html, RCIcons.module). The tile IS the chip: no host
   fill, radius or shadow around it; each context below only sets its size. Variants are the identity
   board's: a faint edge on dark grounds; .mono swaps tile and glyph. */
.os-mod-sprite{ position:absolute; width:0; height:0; overflow:hidden; }
.os-mod{ display:block; flex:none; width:24px; height:24px; }
html.dark .os-mod{ --os-mod-edge:rgba(255,255,255,.18); }
.os-mod.mono{ --os-mod-tile:#1A1A33; --os-mod-glyph:#fff; --os-mod-edge:none; }
html.dark .os-mod.mono{ --os-mod-tile:#fff; --os-mod-glyph:#1A1A33; }
.os-wtab .os-mod{ width:20px; height:20px; }
.os-ws-mark{ width:32px; height:32px; }
.os-pop-item .os-mod{ width:34px; height:34px; }
.os-pop-item.compact .os-mod{ width:24px; height:24px; }
.os-cmdk-item .os-mod{ width:28px; height:28px; }
.os-ntf-main .os-mod, .os-toast.rich .os-mod{ width:34px; height:34px; margin:0; }

/* ----- Global bar ----- */
.os-bar{
  height:var(--bar-h); flex:none; position:relative; z-index:1000; display:flex; align-items:flex-end; gap:6px;
  padding-inline:10px 12px; background:var(--shell-bar); color:var(--bar-fg);
}
.os-bar > *{ flex:none; }
.os-bar .os-spacer{ flex:1 1 0; min-width:8px; }
.os-bar-mark{ align-self:center; width:34px; height:34px; border-radius:9px; display:grid; place-items:center; margin-inline-end:4px; transition:background .14s ease; }
.os-bar-mark:hover{ background:rgba(var(--bar-overlay-rgb),.1); }
.os-bar-mark .os-mark{ width:30px; height:30px; }
.os-bar-sep{ width:1px; height:18px; align-self:center; background:rgba(var(--bar-overlay-rgb),.18); }

.os-hometab, .os-wtab{
  position:relative; display:flex; align-items:center; gap:8px; height:36px; border-radius:10px 10px 0 0;
  color:var(--bar-fg); text-decoration:none; font-size:13px; font-weight:600; white-space:nowrap;
  transition:background .14s ease, color .14s ease;
}
.os-hometab{ padding:0 14px 0 12px; font-weight:700; }
.os-hometab svg{ width:15px; height:15px; }
.os-hometab:hover, .os-wtab:hover{ background:rgba(var(--bar-overlay-rgb),.09); color:var(--bar-fg-strong); }
.os-hometab[aria-current="page"], .os-wtab[aria-current="page"]{ background:var(--canvas); color:var(--text-main); }
.os-hometab:focus-visible, .os-wtab:focus-visible{ outline:2px solid var(--bar-fg-strong); outline-offset:-4px; }

.os-wtabs{ display:flex; align-items:flex-end; gap:2px; min-width:0; flex:0 1 auto !important; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
.os-wtabs::-webkit-scrollbar{ display:none; }
/* Tabs size to their content: the full module name and its counter always show. When they
   outgrow the bar, .os-wtabs scrolls sideways (shell.js keeps the active tab in view). */
.os-wtab-wrap{ position:relative; flex:none; }
.os-wtab{ padding-inline:10px 32px; }
.os-wtab::before{
  content:""; position:absolute; inset-inline:8px; top:0; height:3px; border-radius:0 0 3px 3px; background:transparent;
  transition:background .14s ease;
}
.os-wtab[aria-current="page"]::before{ background:var(--acc); }
.os-wtab-chip{ width:20px; height:20px; border-radius:6px; flex:none; display:grid; place-items:center; background:rgba(var(--bar-overlay-rgb),.12); color:var(--bar-fg); }
.os-wtab-chip svg{ width:13px; height:13px; }
.os-wtab[aria-current="page"] .os-wtab-chip{ background:var(--acc-soft); color:var(--acc); }
.os-wtab-label{ flex:none; white-space:nowrap; }
.os-wtab-x{
  position:absolute; top:8px; inset-inline-end:6px; width:20px; height:20px; border-radius:6px; padding:0; border:0;
  display:grid; place-items:center; background:none; color:var(--bar-fg); cursor:pointer; opacity:0; transition:opacity .12s ease, background .12s ease;
}
.os-wtab-x svg{ width:11px; height:11px; stroke-width:2.6; }
.os-wtab-wrap:hover .os-wtab-x, .os-wtab-wrap.on .os-wtab-x, .os-wtab-x:focus-visible{ opacity:.6; }
.os-wtab-wrap.on .os-wtab-x{ color:var(--text-main); }
.os-wtab-x:hover{ opacity:1 !important; background:rgba(var(--bar-overlay-rgb),.14); }
.os-wtab-x:focus-visible{ outline:2px solid currentColor; outline-offset:-2px; }

.os-bar-btn{
  align-self:center; width:30px; height:30px; border-radius:9px; border:0; padding:0; display:grid; place-items:center;
  background:rgba(var(--bar-overlay-rgb),.07); color:var(--bar-fg); cursor:pointer; transition:background .14s ease;
}
.os-bar-btn:hover, .os-bar-btn[aria-expanded="true"]{ background:rgba(var(--bar-overlay-rgb),.16); }
.os-bar-btn svg{ width:16px; height:16px; stroke-width:2.2; }
.os-plus{ margin-inline-start:2px; }
.os-bar-btn.os-menu-toggle{ display:none; background:none; }
.os-bar-count{
  align-self:center; height:30px; padding:0 8px; border-radius:9px; border:0; display:flex; align-items:center; gap:4px;
  background:none; color:var(--bar-muted); font:inherit; font-size:12px; font-weight:700; cursor:pointer;
}
.os-bar-count:hover, .os-bar-count[aria-expanded="true"]{ background:rgba(var(--bar-overlay-rgb),.1); color:var(--bar-fg-strong); }
.os-bar-count svg{ width:13px; height:13px; }
.os-bar-search{
  align-self:center; flex:0 1 300px !important; min-width:40px; height:32px; border-radius:9px; border:0;
  display:flex; align-items:center; gap:8px; padding-inline:10px 6px; background:var(--bar-field);
  color:var(--bar-muted); font:inherit; font-size:13px; cursor:text; text-align:start; transition:background .14s ease;
}
.os-bar-search:hover{ background:var(--bar-field-hover); }
.os-bar-search svg{ width:15px; height:15px; flex:none; }
.os-bar-search .t{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.os-bar-search .os-kbd{ background:rgba(var(--bar-overlay-rgb),.1); color:var(--bar-fg); border:0; padding:2px 6px; font-size:11px; font-weight:700; flex:none; }
.os-bar-avatar{
  align-self:center; width:30px; height:30px; padding:0; border:0; border-radius:50%; background:none; cursor:pointer;
  box-shadow:0 0 0 2px var(--shell-bar), 0 0 0 3px rgba(var(--bar-overlay-rgb),.25); transition:box-shadow .14s ease; margin-inline-start:6px;
}
.os-bar-avatar:hover, .os-bar-avatar[aria-expanded="true"]{ box-shadow:0 0 0 2px var(--shell-bar), 0 0 0 3px var(--bar-ring-hover); }
.os-bar-avatar .os-avatar{ --size:30px; font-size:11px; font-weight:800; }

/* ----- Body: sidebar + panel ----- */
.os-body{ flex:1; min-height:0; display:flex; padding-block:0 12px; padding-inline:0 12px; }
.os-app.no-sidebar .os-body{ padding-inline-start:12px; }

.os-sidebar{ width:var(--sidebar-w); flex:none; display:flex; flex-direction:column; gap:12px; padding-block:14px 10px; padding-inline:12px 10px; overflow-y:auto; }
.os-ws-head{ display:flex; align-items:center; gap:10px; padding:0 6px; }
.os-ws-chip{ width:32px; height:32px; border-radius:10px; flex:none; display:grid; place-items:center; background:var(--acc-soft); color:var(--acc); }
.os-ws-chip svg{ width:17px; height:17px; stroke-width:2; }
.os-ws-name{ min-width:0; }
.os-ws-name strong{ display:block; font-weight:800; font-size:15px; letter-spacing:-.01em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.os-ws-name span{ display:block; font-size:11.5px; color:var(--text-subtle); font-weight:500; }
.os-nav{ display:flex; flex-direction:column; gap:2px; }
.os-nav-link{
  display:flex; align-items:center; gap:10px; height:34px; padding:0 10px; border-radius:9px;
  color:var(--text-muted); text-decoration:none; font-weight:600; font-size:13.5px; transition:background .12s ease, color .12s ease;
}
.os-nav-link svg{ width:16px; height:16px; flex:none; stroke-width:1.9; }
.os-nav-link:hover{ background:var(--nav-hover); color:var(--text-main); }
.os-nav-link[aria-current="page"]{ background:var(--acc-soft); color:var(--acc); font-weight:700; }
.os-nav-section{ margin:12px 10px 4px; font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--text-subtle); }
html[lang="ar"] .os-nav-section{ letter-spacing:0; }
.os-sidebar-foot{ margin-top:auto !important; padding:0 8px; font-size:11.5px; color:var(--text-subtle); line-height:1.5; }

.os-panel{
  flex:1; min-width:0; display:flex; flex-direction:column; overflow:hidden;
  background:var(--card-bg); border:1px solid var(--border); border-radius:var(--r-panel); box-shadow:0 1px 2px rgba(21,19,58,.04);
}
.os-context{ height:42px; flex:none; display:flex; align-items:center; gap:6px; padding:0 12px; border-bottom:1px solid var(--border-soft); }
.os-context .os-spacer{ flex:1; }
.os-ctx-btn{ width:28px; height:28px; border-radius:8px; border:0; padding:0; display:grid; place-items:center; background:none; color:var(--text-muted); cursor:pointer; flex:none; }
.os-ctx-btn svg{ width:15px; height:15px; stroke-width:2.2; }
.os-ctx-btn:hover:not(:disabled){ background:var(--paper-2); color:var(--text-main); }
.os-ctx-btn:disabled{ opacity:.3; cursor:default; }
[dir="rtl"] .os-ctx-btn svg{ transform:scaleX(-1); }
.os-trail{ display:flex; align-items:center; gap:6px; min-width:0; margin-inline-start:4px; overflow:hidden; white-space:nowrap; font-size:13px; color:var(--text-subtle); }
.os-trail-sep{ color:var(--text-faint); }
[dir="rtl"] .os-trail-sep{ transform:scaleX(-1); }
.os-trail-item{ color:var(--text-subtle); text-decoration:none; }
.os-trail-item:hover{ color:var(--text-main); text-decoration:underline; }
.os-trail-item[aria-current="page"]{ color:var(--text-main); font-weight:700; text-decoration:none; }
.os-trail-tail{ color:var(--text-main); font-weight:700; overflow:hidden; text-overflow:ellipsis; }
.os-saved{ display:flex; align-items:center; gap:6px; flex:none; font-size:12px; color:var(--text-subtle); font-weight:500; white-space:nowrap; }
.os-saved .dot{ width:6px; height:6px; border-radius:50%; background:var(--acc); }
.os-scroll{ flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; }
.os-scroll:focus{ outline:none; }

/* Small shared controls (used by pages and the shell alike) */
.os-spacer{ flex:1; }
.os-kbd{
  font-family:var(--font-text); font-size:11.5px; font-weight:700; color:var(--text-subtle);
  border:1px solid var(--border); border-bottom-width:2px; border-radius:5px; padding:1px 5px; background:var(--paper);
}
.os-iconbtn{
  display:inline-grid; place-items:center; width:32px; height:32px; border-radius:var(--r-sm); padding:0;
  border:1px solid transparent; background:transparent; color:var(--text-subtle); cursor:pointer; transition:background .12s ease, color .12s ease;
}
.os-iconbtn:hover, .os-iconbtn[aria-expanded="true"]{ background:var(--paper-2); color:var(--text-main); }
.os-iconbtn svg{ width:18px; height:18px; }

.os-page{ padding:22px 28px 40px; display:flex; flex-direction:column; gap:18px; }
.os-page.narrow{ max-width:900px; }

/* ------------------------------------------------------------
   Page header: where am I, what is this, what can I do here
   ------------------------------------------------------------ */
.os-pagehead{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px 24px; flex-wrap:wrap; }
.os-pagehead .os-titles{ min-width:0; flex:1 1 360px; }
.os-title{ font-family:var(--font-disp); font-weight:800; font-size:24px; line-height:1.2; letter-spacing:-.02em; }
.os-sub{ margin-top:3px !important; color:var(--text-subtle); font-size:14px; line-height:1.5; max-width:64ch; }
.os-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

.os-identity{ display:flex; align-items:center; gap:16px; min-width:0; }
.os-identity .os-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; margin-top:6px; color:var(--text-muted); font-size:13.5px; }

/* ------------------------------------------------------------
   Surfaces, sections, key-value lists
   ------------------------------------------------------------ */
.os-card{ background:var(--card-bg); border:1px solid var(--border); border-radius:var(--r-lg); }
.os-card-pad{ padding:18px 20px; }
.os-card-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 18px; border-bottom:1px solid var(--border-soft); }
.os-card-head h2, .os-card-head h3{ font-size:14.5px; font-weight:800; }
.os-card-head .os-hint{ margin-top:2px; }
.os-card-body{ padding:16px 18px; }
.os-hint{ color:var(--text-subtle); font-size:12.5px; }
.os-grid-2{ display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:18px; align-items:start; }
.os-stack{ display:flex; flex-direction:column; gap:18px; }

.os-kv{ display:grid; grid-template-columns:max-content minmax(0,1fr); gap:10px 24px; margin:0; font-size:13.5px; }
.os-kv dt{ color:var(--text-subtle); }
.os-kv dd{ margin:0; color:var(--text-main); min-width:0; overflow-wrap:anywhere; }

/* ------------------------------------------------------------
   Avatars, badges, chips, status
   ------------------------------------------------------------ */
.os-avatar{
  --size:30px; width:var(--size); height:var(--size); border-radius:50%; flex:none;
  position:relative; overflow:hidden; aspect-ratio:1;
  display:inline-grid; place-items:center; font-weight:700; font-size:calc(var(--size) * .38);
  letter-spacing:.01em; color:#fff; background:var(--av, #5840EF); user-select:none;
}
.os-avatar.sm{ --size:24px; }
.os-avatar.lg{ --size:56px; font-family:var(--font-disp); }
.os-avatar.xl{ --size:72px; font-family:var(--font-disp); }
.os-avatar.muted{ filter:grayscale(.85); opacity:.75; }
.os-avatar img{ position:absolute; inset:0; width:100%; height:100%; max-width:none; border-radius:inherit; object-fit:cover; display:block; }

.os-badge{
  display:inline-flex; align-items:center; gap:5px; height:22px; padding:0 8px; border-radius:999px;
  font-size:12px; font-weight:650; line-height:1; white-space:nowrap;
  background:var(--paper-2); color:var(--text-muted);
}
.os-badge svg{ width:12px; height:12px; }
.os-badge.dot::before{ content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.os-badge.success{ background:var(--success-soft); color:var(--success); }
.os-badge.danger{ background:var(--danger-soft); color:var(--danger); }
.os-badge.warning{ background:var(--warning-soft); color:var(--warning); }
.os-badge.info{ background:var(--info-soft); color:var(--info); }
.os-badge.accent{ background:var(--primary-soft); color:var(--primary-text); }
.os-badge.outline{ background:transparent; border:1px solid var(--border); }

.os-chip{
  display:inline-flex; align-items:center; gap:6px; height:24px; padding:0 9px; border-radius:var(--r-xs);
  background:var(--card-bg); border:1px solid var(--border); font-size:12.5px; font-weight:600; color:var(--text-main);
  white-space:nowrap; max-width:220px; overflow:hidden; text-overflow:ellipsis;
}
.os-chip.system{ border-color:rgba(var(--primary-rgb),.35); color:var(--primary-text); background:var(--primary-soft); }
.os-chip svg{ width:12px; height:12px; flex:none; }
.os-chips{ display:flex; flex-wrap:wrap; gap:6px; }

/* ------------------------------------------------------------
   Tabs (role=tablist). RCUI.tabs wires keys + hash.
   ------------------------------------------------------------ */
.os-tabs{ display:flex; gap:4px; border-bottom:1px solid var(--border); overflow-x:auto; scrollbar-width:none; }
.os-tab{
  position:relative; height:40px; padding:0 12px; border:0; background:none; cursor:pointer; white-space:nowrap;
  color:var(--text-muted); font:inherit; font-weight:600; font-size:13.5px; display:flex; align-items:center; gap:8px;
}
.os-tab:hover{ color:var(--text-main); }
.os-tab[aria-selected="true"]{ color:var(--text-main); }
.os-tab[aria-selected="true"]::after{
  content:""; position:absolute; inset-inline:8px; bottom:-1px; height:2px; border-radius:2px; background:var(--primary);
}
.os-tab .count{ font-size:11.5px; color:var(--text-subtle); background:var(--paper-2); border-radius:999px; padding:1px 7px; }
.os-tabpanel{ padding-top:18px; }
.os-tabpanel:focus{ outline:none; }

/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */
.os-form{ display:flex; flex-direction:column; gap:16px; }
.os-row{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.os-field{ display:flex; flex-direction:column; gap:6px; min-width:0; }
.os-field > label, .os-label{ font-weight:700; font-size:13px; color:var(--text-main); }
.os-field .opt{ font-weight:500; color:var(--text-subtle); }
.os-input, .os-select, .os-textarea{
  width:100%; height:36px; padding:0 10px; border:1px solid var(--input-border); border-radius:var(--r-sm);
  background:var(--input-bg); color:var(--text-main); font:inherit; font-size:14px;
  transition:border-color .12s ease, box-shadow .12s ease;
}
.os-textarea{ height:auto; min-height:84px; padding:9px 11px; resize:vertical; line-height:1.45; }
.os-select{ appearance:none; padding-inline-end:32px; background-image:linear-gradient(45deg, transparent 50%, var(--text-subtle) 50%), linear-gradient(135deg, var(--text-subtle) 50%, transparent 50%); background-position:calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size:5px 5px; background-repeat:no-repeat; }
[dir="rtl"] .os-select{ background-position:16px 15px, 11px 15px; }
.os-input:hover, .os-select:hover, .os-textarea:hover{ border-color:var(--border-strong); }
.os-input:focus, .os-select:focus, .os-textarea:focus{ outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--focus-ring); }
.os-input[readonly]{ background:#F7F7FC; border-color:var(--border); color:var(--text-subtle); }
html.dark .os-input[readonly]{ background:var(--paper-2); }
.os-field.invalid .os-input, .os-field.invalid .os-select, .os-field.invalid .os-textarea{ border-color:var(--danger); }
.os-field .os-error{ color:var(--danger); font-size:12.5px; font-weight:550; }
.os-field .os-hint{ margin-top:-2px; }
html.dark .os-input:hover, html.dark .os-select:hover{ border-color:#45435E; }

.os-check{ display:flex; align-items:flex-start; gap:10px; cursor:pointer; }
.os-check input{ width:16px; height:16px; margin:2px 0 0; accent-color:var(--primary); flex:none; cursor:pointer; }
.os-check .t{ font-weight:600; font-size:13.5px; }
.os-check .d{ display:block; color:var(--text-subtle); font-size:12.5px; margin-top:1px; }
.os-check.disabled{ cursor:not-allowed; opacity:.6; }

/* Switch: a checkbox with role=switch */
.os-switch{ position:relative; width:34px; height:20px; flex:none; appearance:none; margin:0; cursor:pointer;
  border-radius:999px; background:#CFCFDE; transition:background .16s var(--ease); }
.os-switch::after{ content:""; position:absolute; top:2px; inset-inline-start:2px; width:16px; height:16px; border-radius:50%;
  background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.2); transition:transform .16s var(--ease); }
.os-switch:checked{ background:var(--primary); }
.os-switch:checked::after{ transform:translateX(14px); }
[dir="rtl"] .os-switch:checked::after{ transform:translateX(-14px); }
.os-switch:disabled{ cursor:not-allowed; opacity:.55; }
.os-switch:focus-visible{ outline:3px solid var(--focus-ring); outline-offset:2px; }
html.dark .os-switch{ background:#3A3853; }

/* ------------------------------------------------------------
   Callouts and banners
   ------------------------------------------------------------ */
.os-callout{ display:flex; gap:12px; align-items:flex-start; padding:12px 14px; border-radius:var(--r-md);
  background:var(--info-soft); color:var(--text-main); font-size:13.5px; border:1px solid transparent; }
.os-callout svg{ width:18px; height:18px; flex:none; margin-top:1px; color:var(--info); }
.os-callout strong{ display:block; font-weight:650; }
.os-callout.accent{ background:var(--primary-soft); }
.os-callout.accent svg{ color:var(--primary-text); }
.os-callout.warning{ background:var(--warning-soft); }
.os-callout.warning svg{ color:var(--warning); }
.os-callout.danger{ background:var(--danger-soft); }
.os-callout.danger svg{ color:var(--danger); }
.os-callout.success{ background:var(--success-soft); }
.os-callout.success svg{ color:var(--success); }

/* ------------------------------------------------------------
   Popover menu (RCUI.menu). Row actions, account menu, "More".
   ------------------------------------------------------------ */
.os-menu{
  position:fixed; z-index:1300; min-width:200px; max-width:300px; padding:6px; border-radius:var(--r-xl);
  background:var(--card-bg); border:1px solid var(--border); box-shadow:var(--shadow-pop);
  transform-origin:top; animation:os-pop .12s var(--ease);
}
.os-menu-item{
  display:flex; align-items:center; gap:10px; width:100%; min-height:36px; padding:0 10px; border-radius:var(--r-sm); font-weight:600;
  border:0; background:none; color:var(--text-main); font:inherit; font-size:13.5px; text-align:start; cursor:pointer; text-decoration:none;
}
.os-menu-item svg{ width:16px; height:16px; color:var(--text-subtle); flex:none; }
.os-menu-item:hover, .os-menu-item:focus{ background:var(--paper-2); outline:none; }
.os-menu-item.danger{ color:var(--danger); }
.os-menu-item.danger:hover, .os-menu-item.danger:focus{ background:var(--danger-soft); }
.os-menu-item.danger svg{ color:var(--danger); }
.os-menu-sep{ height:1px; background:var(--border-soft); margin:6px 4px; }
.os-menu-head{ padding:8px 10px 10px; border-bottom:1px solid var(--border-soft); margin-bottom:6px; }
.os-menu-head .n{ font-weight:650; }
.os-menu-head .e{ color:var(--text-subtle); font-size:12.5px; overflow-wrap:anywhere; }
.os-menu-head.rich{ display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:0 12px; min-width:250px; padding:10px 10px 12px; }
.os-menu-head.rich .n{ font-weight:800; }
.os-menu-head.rich .os-avatar{ --size:42px; font-size:15px; }
.os-menu-head.rich .os-chips{ grid-column:1 / -1; margin-top:10px; }
@keyframes os-pop{ from{ opacity:0; transform:translateY(-4px) scale(.98); } to{ opacity:1; transform:none; } }

/* ------------------------------------------------------------
   Drawer (side panel) + dialog. RCUI.drawer / RCUI.dialog.
   ------------------------------------------------------------ */
.os-scrim{ position:fixed; inset:0; z-index:1490; background:rgba(27,24,56,.38); animation:os-fade .16s ease; }
.os-drawer{
  position:fixed; z-index:1500; top:0; bottom:0; inset-inline-end:0; width:min(520px, 100vw);
  display:flex; flex-direction:column; background:var(--card-bg); box-shadow:var(--shadow-3);
  animation:os-slide .22s var(--ease);
}
[dir="rtl"] .os-drawer{ animation-name:os-slide-rtl; }
.os-drawer-head{ display:flex; align-items:flex-start; gap:12px; padding:18px 22px; border-bottom:1px solid var(--border-soft); }
.os-drawer-head h2{ font-family:var(--font-disp); font-size:19px; font-weight:650; letter-spacing:-.015em; }
.os-drawer-head .os-hint{ margin-top:3px; font-size:13px; }
.os-drawer-head .os-iconbtn{ margin-inline-start:auto; margin-top:-4px; }
.os-drawer-body{ flex:1; overflow-y:auto; padding:20px 22px; }
.os-drawer-foot{ display:flex; justify-content:flex-end; gap:8px; padding:14px 22px; border-top:1px solid var(--border-soft); background:var(--paper); }
.os-drawer-foot .os-spacer{ flex:1; }
@keyframes os-slide{ from{ transform:translateX(24px); opacity:.4; } to{ transform:none; opacity:1; } }
@keyframes os-slide-rtl{ from{ transform:translateX(-24px); opacity:.4; } to{ transform:none; opacity:1; } }
@keyframes os-fade{ from{ opacity:0; } to{ opacity:1; } }

/* ------------------------------------------------------------
   Lists and rows (roles list, members, sign-ins, activity)
   ------------------------------------------------------------ */
.os-list{ list-style:none; margin:0; padding:0; }
.os-list > li{ display:flex; align-items:center; gap:12px; padding:12px 20px; border-top:1px solid var(--border-soft); }
.os-list > li:first-child{ border-top:0; }
.os-list .grow{ flex:1; min-width:0; }
.os-list .t{ font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.os-list .s{ color:var(--text-subtle); font-size:12.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.os-list a.t{ color:var(--text-main); text-decoration:none; }
.os-list a.t:hover{ color:var(--primary-text); text-decoration:underline; }

/* Activity timeline */
.os-timeline{ list-style:none; margin:0; padding:4px 20px 8px; }
.os-timeline li{ position:relative; display:grid; grid-template-columns:28px minmax(0,1fr) auto; gap:12px; padding:10px 0; }
.os-timeline li::before{ content:""; position:absolute; inset-inline-start:13px; top:34px; bottom:-10px; width:1px; background:var(--border); }
.os-timeline li:last-child::before{ display:none; }
.os-timeline .ic{ width:28px; height:28px; border-radius:50%; display:grid; place-items:center; background:var(--paper-2); color:var(--text-muted); }
.os-timeline .ic svg{ width:14px; height:14px; }
.os-timeline .ic.success{ background:var(--success-soft); color:var(--success); }
.os-timeline .ic.danger{ background:var(--danger-soft); color:var(--danger); }
.os-timeline .ic.accent{ background:var(--primary-soft); color:var(--primary-text); }
.os-timeline .ic.warning{ background:var(--warning-soft); color:var(--warning); }
.os-timeline .what{ font-size:13.5px; }
.os-timeline .what b{ font-weight:650; }
.os-timeline .detail{ color:var(--text-subtle); font-size:12.5px; margin-top:2px; overflow-wrap:anywhere; }
.os-timeline time{ color:var(--text-subtle); font-size:12.5px; white-space:nowrap; }

/* ------------------------------------------------------------
   States: loading / empty / denied / failed (RCUI.setState)
   ------------------------------------------------------------ */
.rc-state{ display:flex; flex-direction:column; align-items:center; gap:10px; padding:44px 20px; text-align:center; color:var(--text-muted); }
.rc-state .rc-state-copy strong{ display:block; color:var(--text-main); font-size:15px; font-weight:650; margin-bottom:4px; }
.rc-state .rc-state-copy p{ max-width:46ch; margin:0 auto; font-size:13.5px; }
.rc-state-spinner{ width:22px; height:22px; border-radius:50%; border:2.5px solid var(--border); border-top-color:var(--primary); animation:os-spin .8s linear infinite; }
@keyframes os-spin{ to{ transform:rotate(360deg); } }
.os-empty{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px; padding:36px 20px; }
.os-empty .art{ width:56px; height:56px; border-radius:16px; display:grid; place-items:center; background:var(--primary-soft); color:var(--primary-text); }
.os-empty .art svg{ width:26px; height:26px; }
.os-empty strong{ font-size:15px; font-weight:650; }
.os-empty p{ color:var(--text-muted); max-width:44ch; font-size:13.5px; }
.os-skel{ display:block; border-radius:6px; background:linear-gradient(90deg, var(--paper-2), var(--paper-3), var(--paper-2)); background-size:200% 100%; animation:rc-shimmer 1.4s ease-in-out infinite; }

/* ------------------------------------------------------------
   Toasts (RCUI.toast) and the confirm dialog (RCUI.confirm)
   ------------------------------------------------------------ */
.os-toasts{ position:fixed; z-index:9999; inset-inline-end:20px; bottom:20px; display:flex; flex-direction:column; gap:8px; align-items:flex-end; pointer-events:none; }
.os-toast{
  pointer-events:auto; display:flex; align-items:flex-start; gap:10px; max-width:380px; padding:11px 14px;
  border-radius:var(--r-md); background:var(--ink-strong); color:#fff; box-shadow:var(--shadow-3);
  font-size:13.5px; font-weight:550; cursor:pointer; animation:os-toast-in .2s var(--ease);
}
html.dark .os-toast{ background:#2B2944; }
.os-toast svg{ width:17px; height:17px; flex:none; margin-top:1px; }
.os-toast.success svg{ color:#6EE7B7; }
.os-toast.error{ background:#7A1F33; }
.os-toast.info svg{ color:#C4B8FF; }
.os-toast.leaving{ opacity:0; transform:translateY(6px); transition:opacity .2s ease, transform .2s ease; }
@keyframes os-toast-in{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }

.rc-confirm-overlay{ background:rgba(27,24,56,.42) !important; backdrop-filter:none !important; }
.rc-confirm{ border-radius:var(--r-lg) !important; }
.rc-confirm h2{ font-family:var(--font-disp) !important; font-weight:650 !important; font-size:18px !important; }
.rc-confirm button{ height:34px; padding:0 14px !important; border-radius:var(--r-sm) !important; font-weight:650 !important; font-family:var(--font-text) !important; }

/* ------------------------------------------------------------
   Sticky save bar (dirty-snapshot forms, §8.3)
   ------------------------------------------------------------ */
.os-savebar{
  position:sticky; bottom:16px; z-index:900; display:flex; align-items:center; gap:12px; padding:10px 12px 10px 16px;
  border-radius:var(--r-md); background:var(--ink-strong); color:#fff; box-shadow:var(--shadow-3);
  animation:os-toast-in .2s var(--ease);
}
.os-savebar[data-state="clean"]{ display:none; }
.os-savebar .msg{ flex:1; font-size:13.5px; min-width:0; }
.os-savebar .msg b{ font-weight:650; }
.os-savebar .btn.ghost{ color:#D6D3EC; }
.os-savebar .btn.ghost:hover{ background:rgba(255,255,255,.08); color:#fff; }
html.dark .os-savebar{ background:#2B2944; }

/* ------------------------------------------------------------
   Command palette (Ctrl/⌘ K)
   ------------------------------------------------------------ */
.os-cmdk-scrim{ z-index:1540; background:rgba(21,19,58,.55); }
.os-cmdk{ position:fixed; z-index:1550; inset-inline:0; top:12vh; margin:0 auto; width:min(620px, calc(100vw - 32px));
  background:var(--card-bg); border:1px solid var(--border); border-radius:var(--r-xl); box-shadow:0 24px 64px rgba(10,8,40,.45); overflow:hidden;
  animation:os-pop .14s var(--ease); }
.os-cmdk-input{ display:flex; align-items:center; gap:10px; padding:0 16px; border-bottom:1px solid var(--border-soft); }
.os-cmdk-input svg{ width:18px; height:18px; color:var(--text-subtle); flex:none; }
.os-cmdk-input input{ flex:1; min-width:0; height:54px; border:0; background:transparent; color:var(--text-main); font:inherit; font-size:16px; outline:none; }
.os-cmdk-input .os-kbd{ border:0; background:var(--paper-2); }
.os-cmdk-results{ max-height:min(400px, 56vh); overflow-y:auto; padding:6px; }
.os-cmdk-group{ padding:10px 10px 4px; font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--text-subtle); }
.os-cmdk-item{ display:flex; align-items:center; gap:12px; padding:7px 10px; border-radius:var(--r-md); color:var(--text-main); text-decoration:none; cursor:pointer; }
.os-cmdk-item .os-chip-ic{ width:28px; height:28px; border-radius:8px; }
.os-cmdk-item .os-chip-ic svg{ width:15px; height:15px; }
.os-cmdk-item .os-avatar{ --size:28px; }
.os-cmdk-item .l{ flex:1; min-width:0; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.os-cmdk-item .s{ color:var(--text-subtle); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:55%; }
.os-cmdk-item[aria-selected="true"]{ background:var(--primary-soft); }
.os-cmdk-empty{ padding:24px 16px; text-align:center; color:var(--text-subtle); font-size:13.5px; }
.os-cmdk-foot{ display:flex; gap:14px; padding:9px 14px; border-top:1px solid var(--border-soft); background:var(--paper-soft); color:var(--text-subtle); font-size:12px; }

/* ------------------------------------------------------------
   Shell popovers: workspace launcher, open workspaces, tab hover card
   ------------------------------------------------------------ */
.os-chip-ic{ width:34px; height:34px; border-radius:10px; flex:none; display:grid; place-items:center; background:var(--acc-soft); color:var(--acc); }
.os-chip-ic svg{ width:18px; height:18px; stroke-width:1.9; }
.os-pop{
  position:fixed; z-index:1300; width:380px; max-width:calc(100vw - 16px); padding:8px; border-radius:var(--r-panel);
  background:var(--card-bg); border:1px solid var(--border); box-shadow:var(--shadow-pop); animation:os-pop .14s var(--ease);
}
.os-pop-overflow{ width:300px; }
.os-pop-title{ padding:8px 10px 6px; font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--text-subtle); }
.os-pop-item{ display:flex; align-items:center; gap:12px; padding:8px 10px; border-radius:var(--r-md); color:var(--text-main); text-decoration:none; outline:none; transition:background .1s ease; }
.os-pop-item:hover, .os-pop-item:focus-visible{ background:var(--acc-tint); }
.os-pop-item:focus-visible{ box-shadow:inset 0 0 0 2px var(--focus-ring); }
.os-pop-item[aria-current="page"]{ background:var(--paper-2); }
.os-pop-item.compact{ gap:10px; padding:7px 10px; }
.os-pop-item.compact .os-chip-ic{ width:24px; height:24px; border-radius:7px; }
.os-pop-item.compact .os-chip-ic svg{ width:14px; height:14px; }
.os-pop-text{ flex:1; min-width:0; display:flex; flex-direction:column; }
.os-pop-text .n{ font-weight:700; }
.os-pop-item.compact .n{ font-size:13.5px; }
.os-pop-text .d{ font-size:12px; color:var(--text-subtle); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.os-pop-tag{ flex:none; font-size:11.5px; font-weight:700; padding:2px 8px; border-radius:999px; background:var(--paper-2); color:var(--text-subtle); }
.os-pop-tag.open{ background:var(--success-soft); color:var(--success); }
.os-pop-foot{ margin:6px 4px 2px !important; padding:8px 10px 4px; border-top:1px solid var(--border-soft); font-size:12px; color:var(--text-subtle); line-height:1.45; }
.os-pop-empty{ padding:4px 10px 10px; font-size:13px; color:var(--text-muted); line-height:1.5; }
.os-tabcard{
  position:fixed; z-index:1300; width:250px; padding:10px 12px; border-radius:var(--r-lg); pointer-events:none;
  background:var(--card-bg); border:1px solid var(--border); box-shadow:var(--shadow-pop); animation:os-pop .12s var(--ease);
}
.os-tabcard .k{ font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--text-subtle); }
.os-tabcard .v{ font-weight:700; margin-top:3px; line-height:1.4; overflow-wrap:anywhere; }
html[lang="ar"] .os-pop-title, html[lang="ar"] .os-tabcard .k, html[lang="ar"] .os-cmdk-group{ letter-spacing:0; }

/* ------------------------------------------------------------
   Data tables inside the shell (Robotack DataTable on top)
   ------------------------------------------------------------ */
.os-table-card{ padding:6px 4px 4px; }
.os-person{ display:flex; align-items:center; gap:10px; min-width:0; }
.os-person .n{ font-weight:600; color:var(--text-main); text-decoration:none; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.os-person a.n:hover{ color:var(--primary-text); text-decoration:underline; }
.os-person .s{ color:var(--text-subtle); font-size:12.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.os-rowmenu{ width:30px; height:30px; }

/* Segmented filter (Users: All / Active / Deactivated) */
.os-segmented{ display:inline-flex; align-self:flex-start; padding:3px; gap:2px; border-radius:var(--r-md); background:var(--paper-2); }
.os-segmented button{ height:28px; padding:0 12px; border:0; border-radius:8px; background:none; color:var(--text-subtle); font:inherit; font-size:13px; font-weight:700; cursor:pointer; transition:background .12s ease, color .12s ease; }
.os-segmented button:hover{ color:var(--text-main); }
html.dark .os-segmented{ background:var(--paper); }
html.dark .os-segmented button[aria-pressed="true"]{ background:var(--paper-3); }
.os-segmented button[aria-pressed="true"]{ background:var(--card-bg); color:var(--text-main); box-shadow:0 1px 2px rgba(21,19,58,.12); }

/* ------------------------------------------------------------
   Notifications (notify.js): tab badges, Home dot, a workspace's
   inbox button, the shared notification list, rich toasts.
   Module identity = the module's accent, used sparingly (a chip, a
   stripe), so a mixed list never turns into rainbow soup.
   ------------------------------------------------------------ */
.os-wtab-badge{
  flex:none; min-width:18px; height:18px; padding:0 5px; border-radius:999px; margin-inline-start:-2px;
  display:grid; place-items:center; font-size:10.5px; font-weight:800; line-height:1; font-variant-numeric:tabular-nums;
  background:#FF5C7A; color:#fff; pointer-events:none;
}
.os-wtab-badge.bump{ animation:os-bump .32s var(--ease); }
.os-hometab{ position:relative; }
.os-home-dot{ position:absolute; top:9px; inset-inline-start:24px; width:8px; height:8px; border-radius:50%; background:#FF5C7A; box-shadow:0 0 0 2px var(--shell-bar); }
.os-hometab[aria-current="page"] .os-home-dot{ box-shadow:0 0 0 2px var(--canvas); }
@keyframes os-bump{ 0%{ transform:scale(.6); } 60%{ transform:scale(1.18); } 100%{ transform:scale(1); } }
.os-pop-item .os-pop-count{ flex:none; min-width:20px; height:20px; padding:0 6px; border-radius:999px; display:grid; place-items:center;
  font-size:11px; font-weight:800; background:#FF5C7A; color:#fff; }

.os-ws-head{ position:relative; }
.os-ws-inbox{
  margin-inline-start:auto; position:relative; width:32px; height:32px; flex:none; border-radius:9px; border:0; padding:0;
  display:grid; place-items:center; background:none; color:var(--text-subtle); cursor:pointer; transition:background .12s ease, color .12s ease;
}
.os-ws-inbox svg{ width:17px; height:17px; }
.os-ws-inbox:hover, .os-ws-inbox[aria-expanded="true"]{ background:var(--nav-hover); color:var(--text-main); }
.os-ws-inbox.has-unread{ color:var(--acc); }
.os-ws-inbox-count{ position:absolute; top:2px; inset-inline-end:1px; min-width:16px; height:16px; padding:0 4px; border-radius:999px;
  display:grid; place-items:center; font-size:10px; font-weight:800; background:#FF5C7A; color:#fff; box-shadow:0 0 0 2px var(--canvas); }

/* The shared list (Home's center, a workspace inbox, Connect's Inbox) */
.os-ntf-list{ list-style:none; margin:0; padding:0; }
.os-ntf{ position:relative; display:flex; align-items:stretch; border-radius:var(--r-md); transition:background .12s ease; }
.os-ntf:hover{ background:var(--paper-soft); }
html.dark .os-ntf:hover{ background:var(--paper-2); }
.os-ntf.fresh{ animation:os-ntf-in .36s var(--ease); }
@keyframes os-ntf-in{ from{ opacity:0; transform:translateY(-4px); background:var(--primary-soft); } to{ opacity:1; transform:none; } }
.os-ntf-main{ flex:1; min-width:0; display:flex; gap:12px; align-items:flex-start; padding:10px 8px 10px 12px; color:inherit; text-decoration:none; border-radius:var(--r-md); }
.os-ntf-main:focus-visible{ outline:none; box-shadow:inset 0 0 0 2px var(--focus-ring); }
.os-ntf-main .os-avatar{ --size:34px; margin-top:1px; }
.os-ntf-ic{ width:34px; height:34px; flex:none; border-radius:10px; display:grid; place-items:center; background:var(--acc-soft); color:var(--acc); }
.os-ntf-ic svg{ width:17px; height:17px; }
.os-ntf-text{ flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
.os-ntf-title{ font-size:13.5px; color:var(--text-muted); overflow-wrap:anywhere; }
.os-ntf.unread .os-ntf-title{ color:var(--text-main); font-weight:650; }
.os-ntf-body{ font-size:13px; color:var(--text-subtle); overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow-wrap:anywhere; }
.os-ntf-meta{ display:flex; align-items:center; gap:8px; margin-top:3px; font-size:11.5px; color:var(--text-subtle); }
.os-ntf-mod{ display:inline-flex; align-items:center; gap:5px; font-weight:700; color:var(--text-muted); }
.os-ntf-mod::before{ content:""; width:6px; height:6px; border-radius:50%; background:var(--acc); }
.os-ntf-toggle{ flex:none; width:34px; border:0; background:none; cursor:pointer; display:grid; place-items:center; border-radius:var(--r-md); }
.os-ntf-toggle .dot{ width:9px; height:9px; border-radius:50%; border:1.5px solid var(--border-strong); transition:background .12s ease, border-color .12s ease, transform .12s ease; }
.os-ntf.unread .os-ntf-toggle .dot{ background:var(--primary); border-color:var(--primary); }
.os-ntf-toggle:hover .dot{ transform:scale(1.2); border-color:var(--primary); }
.os-ntf-later{ color:var(--text-subtle); opacity:0; transition:opacity .12s ease; }
.os-ntf-later svg{ width:15px; height:15px; }
.os-ntf:hover .os-ntf-later, .os-ntf-later:focus-visible, .os-ntf-later[aria-expanded="true"]{ opacity:1; }
.os-ntf-later:hover{ color:var(--text-main); }
@media (hover: none){ .os-ntf-later{ opacity:1; } }
.os-ntf-day{ padding:14px 12px 4px; font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--text-subtle); }
html[lang="ar"] .os-ntf-day{ letter-spacing:0; }
.os-ntf-empty{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:6px; padding:32px 16px; color:var(--text-muted); }
.os-ntf-empty .art{ width:44px; height:44px; border-radius:14px; display:grid; place-items:center; background:var(--success-soft); color:var(--success); margin-bottom:4px; }
.os-ntf-empty .art svg{ width:22px; height:22px; }
.os-ntf-empty strong{ color:var(--text-main); font-size:14px; }
.os-ntf-empty p{ font-size:13px; max-width:36ch; }
.os-ntf-skel{ display:flex; flex-direction:column; gap:10px; padding:12px; }
.os-ntf-skel .os-skel{ height:42px; }
.os-ntf-more{ display:flex; margin:6px auto 4px; }

/* A workspace's inbox popover */
.os-ntf-pop{ width:400px; padding:0; display:flex; flex-direction:column; max-height:min(560px, calc(100dvh - var(--bar-h) - 24px)); overflow:hidden; }
.os-ntf-pop-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:14px 14px 10px 16px; border-bottom:1px solid var(--border-soft); }
.os-ntf-pop-head strong{ display:block; font-size:14.5px; font-weight:800; }
.os-ntf-pop-head .os-hint{ display:block; margin-top:2px; }
.os-ntf-pop-body{ flex:1; overflow-y:auto; padding:6px; }
.os-ntf-pop-foot{ display:flex; align-items:center; justify-content:center; gap:6px; padding:10px; border-top:1px solid var(--border-soft);
  font-size:12.5px; font-weight:700; color:var(--primary-text); text-decoration:none; background:var(--paper-soft); }
.os-ntf-pop-foot svg{ width:14px; height:14px; }
[dir="rtl"] .os-ntf-pop-foot svg{ transform:scaleX(-1); }

/* Home's master center */
.os-ntf-center{ display:flex; flex-direction:column; }
.os-ntf-center-head{ display:flex; align-items:center; justify-content:space-between; gap:10px 16px; flex-wrap:wrap; padding:12px 14px 10px; border-bottom:1px solid var(--border-soft); }
.os-ntf-pills{ display:flex; flex-wrap:wrap; gap:6px; }
.os-ntf-pill{ display:inline-flex; align-items:center; gap:7px; height:30px; padding:0 11px; border-radius:999px; border:1px solid var(--border);
  background:var(--card-bg); color:var(--text-muted); font:inherit; font-size:13px; font-weight:650; cursor:pointer; transition:background .12s ease, border-color .12s ease, color .12s ease; }
.os-ntf-pill:hover{ border-color:var(--border-strong); color:var(--text-main); }
.os-ntf-pill .dot{ width:7px; height:7px; border-radius:50%; background:var(--acc); }
.os-ntf-pill .c{ min-width:18px; height:18px; padding:0 5px; border-radius:999px; display:grid; place-items:center; font-size:11px; font-weight:800; background:var(--paper-2); color:var(--text-main); }
.os-ntf-pill[aria-pressed="true"]{ background:var(--ink-strong); border-color:var(--ink-strong); color:#fff; }
.os-ntf-pill[aria-pressed="true"] .c{ background:rgba(255,255,255,.18); color:#fff; }
html.dark .os-ntf-pill[aria-pressed="true"]{ background:var(--primary); border-color:var(--primary); }
.os-ntf-tools{ display:flex; align-items:center; gap:6px; }
.os-ntf-unread{ display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:600; color:var(--text-muted); cursor:pointer; margin-inline-end:4px; }
.os-ntf-center-list{ padding:4px 6px 8px; }
.os-ntf-settings{ width:340px; }
.os-ntf-set-body{ padding:0 4px 4px; }
.os-ntf-set{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:9px 8px; border-radius:var(--r-md); cursor:pointer; }
.os-ntf-set:hover{ background:var(--paper-soft); }
.os-ntf-set .n{ display:block; font-weight:650; font-size:13.5px; }
.os-ntf-set .d{ display:block; font-size:12px; color:var(--text-subtle); margin-top:1px; }
.os-ntf-set-sep{ margin:8px 8px 2px; padding-top:8px; border-top:1px solid var(--border-soft); font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--text-subtle); }
html[lang="ar"] .os-ntf-set-sep{ letter-spacing:0; }
.os-ntf-set-note{ margin:6px 8px 4px !important; font-size:12px; color:var(--text-subtle); line-height:1.45; }

/* Rich toasts share the one bottom-end stack with feedback toasts (RCUI.toast) */
.os-toasts{ gap:10px; }
.os-toast.rich{
  position:relative; width:360px; max-width:calc(100vw - 32px); padding:12px 12px 12px 14px; gap:12px; align-items:flex-start;
  background:var(--card-bg); color:var(--text-main); border:1px solid var(--border); border-radius:var(--r-lg);
  box-shadow:var(--shadow-pop); font-weight:500; cursor:default; overflow:hidden; animation:os-toast-drop .24s var(--ease);
}
html.dark .os-toast.rich{ background:#211F33; border-color:#34324C; }
.os-toast.rich::before{ content:""; position:absolute; inset-block:0; inset-inline-start:0; width:3px; background:var(--acc); }
.os-toast.rich.actionable{ cursor:pointer; }
.os-toast.rich.actionable:hover{ border-color:var(--border-strong); }
.os-toast.rich:focus-visible{ outline:3px solid var(--focus-ring); outline-offset:1px; }
.os-toast.rich .os-avatar{ --size:34px; }
.os-toast-ic{ width:34px; height:34px; flex:none; border-radius:10px; display:grid; place-items:center; background:var(--acc-soft); color:var(--acc); }
.os-toast.rich .os-toast-ic svg{ width:17px; height:17px; margin:0; color:inherit; }
.os-toast.rich.error .os-toast-ic{ background:var(--danger-soft); color:var(--danger); }
.os-toast.rich.warning .os-toast-ic{ background:var(--warning-soft); color:var(--warning); }
.os-toast.rich.success .os-toast-ic, .os-toast.rich.approval .os-toast-ic{ background:var(--success-soft); color:var(--success); }
.os-toast-body{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; padding-top:1px; }
.os-toast-title{ font-size:13.5px; font-weight:700; line-height:1.35; overflow-wrap:anywhere; }
.os-toast-text{ font-size:13px; color:var(--text-muted); line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.os-toast-meta{ font-size:11.5px; color:var(--text-subtle); margin-top:2px; }
.os-toast-action{ font-size:12.5px; font-weight:700; color:var(--primary-text); margin-top:4px; }
.os-toast-x{ flex:none; width:24px; height:24px; margin:-2px -2px 0 0; border:0; border-radius:7px; padding:0; display:grid; place-items:center;
  background:none; color:var(--text-subtle); cursor:pointer; opacity:.7; }
.os-toast.rich .os-toast-x svg{ width:13px; height:13px; margin:0; color:inherit; }
.os-toast-x:hover{ opacity:1; background:var(--paper-2); color:var(--text-main); }
.os-toast.rich.leaving{ opacity:0; transform:translateX(12px); }
[dir="rtl"] .os-toast.rich.leaving{ transform:translateX(-12px); }
@keyframes os-toast-drop{ from{ opacity:0; transform:translateY(-8px) scale(.98); } to{ opacity:1; transform:none; } }

/* Presence: a dot on an avatar (Connect, profile cards). Away = hollow, offline = none. */
.os-presence{ position:relative; display:inline-flex; flex:none; }
.os-presence::after{ content:""; position:absolute; inset-inline-end:-1px; bottom:-1px; width:30%; height:30%; min-width:8px; min-height:8px;
  border-radius:50%; box-shadow:0 0 0 2px var(--presence-ring, var(--card-bg)); }
.os-presence[data-presence="ACTIVE"]::after{ background:#1DB37A; }
.os-presence[data-presence="AWAY"]::after{ background:var(--presence-ring, var(--card-bg)); box-shadow:inset 0 0 0 2px #9C9AB8, 0 0 0 2px var(--presence-ring, var(--card-bg)); }
.os-presence[data-presence="OFFLINE"]::after{ display:none; }

/* App-layout workspaces (Connect) own their interior: the panel doesn't scroll, their regions do. */
.os-app[data-layout="app"] .os-scroll{ overflow:hidden; display:flex; flex-direction:column; }

/* ------------------------------------------------------------
   Responsive: tablet-first (1180×820) down to phones
   ------------------------------------------------------------ */
@media (max-width: 1100px){
  .os-grid-2{ grid-template-columns:1fr; }
  .os-saved{ display:none; }
}
@media (max-width: 900px){
  .os-body, .os-app.no-sidebar .os-body{ padding:0 8px 8px; }
  .os-sidebar{
    position:fixed; z-index:1400; top:var(--bar-h); bottom:0; inset-inline-start:0; width:min(280px, 84vw);
    background:var(--canvas); box-shadow:var(--shadow-3); transform:translateX(-102%); transition:transform .22s var(--ease);
  }
  [dir="rtl"] .os-sidebar{ transform:translateX(102%); }
  .os-app.nav-open .os-sidebar{ transform:none; }
  .os-app.nav-open::after{ content:""; position:fixed; inset:var(--bar-h) 0 0; background:rgba(21,19,58,.38); z-index:1300; }
  .os-bar-btn.os-menu-toggle{ display:grid; }
  .os-bar-mark{ display:none; }
  .os-hometab{ padding:0 10px; }
  .os-hometab span{ display:none; }
  .os-bar-search{ flex:0 0 34px !important; padding:0; justify-content:center; }
  .os-bar-search .t, .os-bar-search .os-kbd{ display:none; }
  .os-page{ padding:18px 16px 48px; }
}
@media (max-width: 640px){
  .os-row{ grid-template-columns:1fr; }
  .os-title{ font-size:21px; }
  .os-bar-count{ display:none; }
  .os-trail-ws, .os-trail-ws + .os-trail-sep{ display:none; }
  .os-list > li{ padding:12px 16px; }
  .os-kv{ grid-template-columns:1fr; gap:2px 0; }
  .os-kv dd{ margin-bottom:8px; }
}

@media (max-width: 640px){
  .os-toasts{ inset-inline:8px; align-items:stretch; }
  .os-toast.rich{ width:auto; }
  .os-ntf-pop{ width:calc(100vw - 16px); }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
}
