/* tebb — reference UI classes (v0.1). Depends on tebb-tokens.css.
   This file is the pixel source of truth extracted from the design references.
   Rules: logical properties only · no raw colours (tokens only) · Arabic first.
   Maps onto the existing kit (docs/sales/mockups/assets/ui.css) class names where they exist. */

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); font-variant-numeric: tabular-nums; color: var(--label);
       background: var(--bg-canvas); -webkit-font-smoothing: antialiased; line-height: var(--lh-latin); }
:lang(ar) { line-height: var(--lh-arabic); letter-spacing: 0 !important; text-transform: none !important; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.ltr, bdi.ltr { direction: ltr; unicode-bidi: isolate; }
.code { direction: ltr; unicode-bidi: isolate; font-family: var(--font-mono); font-size: 11.5px; }

/* ---------- Type (HIG styles → rem; Arabic sizes via :lang(ar)) ---------- */
.t-large-title { font-size: 34px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.t-title-1 { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.015em; }
.t-title-2 { font-size: 22px; line-height: 28px; font-weight: 600; }
.t-title-3 { font-size: 20px; line-height: 25px; font-weight: 600; letter-spacing: -0.01em; }
.t-headline { font-size: 17px; line-height: 22px; font-weight: 600; }
.t-body { font-size: 16px; line-height: 23px; }
.t-callout { font-size: 15px; line-height: 21px; }
.t-subhead { font-size: 14px; line-height: 20px; }
.t-footnote { font-size: 13px; line-height: 18px; }
.t-caption-1 { font-size: 12px; line-height: 16px; font-weight: 500; }
.t-caption-2 { font-size: 11px; line-height: 13px; font-weight: 500; }
:lang(ar) .t-large-title, .t-large-title:lang(ar) { font-size: 36px; line-height: 1.45; }
:lang(ar) .t-title-1 { font-size: 30px; line-height: 46px; }
:lang(ar) .t-title-2 { font-size: 24px; line-height: 38px; }
:lang(ar) .t-title-3 { font-size: 21px; line-height: 34px; }
:lang(ar) .t-headline { font-size: 18px; line-height: 29px; }
:lang(ar) .t-body { font-size: 17px; line-height: 28px; }
:lang(ar) .t-callout { font-size: 16px; line-height: 26px; }
:lang(ar) .t-subhead { font-size: 15px; line-height: 24px; }
:lang(ar) .t-footnote { font-size: 14px; line-height: 22px; }
:lang(ar) .t-caption-1 { font-size: 13px; line-height: 20px; }
:lang(ar) .t-caption-2 { font-size: 12px; line-height: 19px; }

/* ---------- Icons (inline sprite, Lucide geometry) ---------- */
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5;
        stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.icon.sm { width: .9em; height: .9em; } .icon.lg { width: 1.6em; height: 1.6em; }
.w-500 .icon, .icon.w-500 { stroke-width: 1.75; } .w-600 .icon, .icon.w-600 { stroke-width: 2.1; }
[dir="rtl"] .icon[data-mirror] { transform: scaleX(-1); }

/* ---------- Materials ---------- */
.glass { background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
         border: 1px solid var(--glass-hairline); box-shadow: inset 0 1px 0 var(--glass-specular), var(--shadow-glass); }
.glass-tint { background: var(--glass-fill-tint); color: var(--on-accent); border-color: oklch(1 0 0 / 0.18);
              box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.3), var(--shadow-glass); }
.glass .on-glass-2, .glass-label-2 { color: var(--label-2-on-glass); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: var(--bg-elevated); } }
.card { background: var(--bg-surface); border-radius: var(--r-xl); box-shadow: var(--shadow-card); padding: 18px 20px; }
.card-title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.card-title:lang(ar), :lang(ar) .card-title { letter-spacing: 0; }
.card-meta { font-size: 13px; color: var(--label-3); }
.inset { background: var(--bg-surface-2); border-radius: 16px; }

/* ---------- App shell (floating chrome over scrolling content) ---------- */
.app-canvas { position: relative; min-height: 100vh; overflow: hidden;
  background: radial-gradient(1100px 760px at 0% -10%, oklch(0.725 0.135 12 / 0.2), transparent 62%),
              radial-gradient(900px 700px at 100% 100%, oklch(0.86 0.06 60 / 0.42), transparent 60%), var(--bg-canvas); }
[dir="rtl"] .app-canvas { background: radial-gradient(1100px 760px at 100% -10%, oklch(0.725 0.135 12 / 0.2), transparent 62%),
              radial-gradient(900px 700px at 0% 100%, oklch(0.86 0.06 60 / 0.42), transparent 60%), var(--bg-canvas); }
[data-theme="dark"] .app-canvas { background: radial-gradient(1100px 760px at 0% -10%, oklch(0.42 0.148 11 / 0.42), transparent 62%),
              radial-gradient(900px 700px at 100% 100%, oklch(0.35 0.04 50 / 0.3), transparent 60%), var(--bg-canvas); }
[data-theme="dark"][dir="rtl"] .app-canvas, [dir="rtl"] [data-theme="dark"] .app-canvas { background: radial-gradient(1100px 760px at 100% -10%, oklch(0.42 0.148 11 / 0.42), transparent 62%),
              radial-gradient(900px 700px at 0% 100%, oklch(0.35 0.04 50 / 0.3), transparent 60%), var(--bg-canvas); }
.app-content { position: absolute; inset: 0; overflow: auto; padding-block-start: 84px; padding-inline: 284px 24px; }
.app-content > .stack { display: flex; flex-direction: column; gap: 16px; max-width: 1180px; }

.sidebar { position: absolute; inset-block: 12px; inset-inline-start: 12px; width: 256px; z-index: 3; border-radius: 28px;
           padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar .org { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; }
.sidebar .org-avatar { width: 36px; height: 36px; border-radius: 11px; background: var(--fill-2); display: grid; place-items: center; font-weight: 600; font-size: 15px; }
.sidebar .org-name { font-size: 15px; font-weight: 600; } .sidebar .org-sub { font-size: 12.5px; color: var(--label-2-on-glass); }
.sidebar .search { height: 38px; border-radius: 999px; background: var(--fill-2); display: flex; align-items: center; gap: 8px; padding: 0 12px; margin: 0 2px 10px; font-size: 14.5px; color: var(--label-2-on-glass); }
.sidebar .section { font-size: 12.5px; color: var(--label-2-on-glass); padding: 4px 12px; }
.nav-item { height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 14px; font-size: 15px; color: var(--label);
            text-decoration: none; transition: background-color var(--dur-1) var(--ease-out); }
.nav-item .icon { width: 18px; height: 18px; stroke-width: 1.6; }
.nav-item:hover { background: var(--fill-3); }
.nav-item[aria-current="page"] { background: var(--nav-selected); color: var(--accent); font-weight: 600; }
.nav-item[aria-current="page"] .icon { stroke-width: 2; }
.nav-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus-ring); }
.nav-item[aria-disabled="true"] { color: var(--label-4); pointer-events: none; }
.nav-item .count { margin-inline-start: auto; min-width: 22px; height: 20px; border-radius: 999px; background: var(--fill-1); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.sidebar .account { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; background: var(--fill-3); }
.sidebar .account-avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--accent-subtle-2); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 14px; }

.toolbar { position: absolute; top: 12px; height: 56px; inset-inline: 280px 12px; z-index: 3; border-radius: 999px; display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; border: 0; background: transparent; color: inherit; cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--fill-3); } .icon-btn .icon { width: 19px; height: 19px; stroke-width: 1.7; }
.icon-btn .dot-count { position: absolute; top: 5px; inset-inline-end: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; }

.tabbar { position: absolute; inset-block-end: 22px; inset-inline: 12px; height: 66px; z-index: 4; border-radius: 999px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 0 5px; }
.tab { height: 54px; border-radius: 999px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 500; color: var(--label-2-on-glass); text-decoration: none; }
.tab .icon { width: 22px; height: 22px; stroke-width: 1.6; }
.tab[aria-current="page"] { background: var(--nav-selected); color: var(--accent); font-weight: 600; } .tab[aria-current="page"] .icon { stroke-width: 2; }

/* Breakpoints: the app applies these to the viewport. The reference boards are fixed-size, so the rules stay as comments here:
   @media (max-width: 1180px) { .sidebar { width: 232px; } .toolbar { inset-inline-start: 256px; } .app-content { padding-inline-start: 260px; } }
   @media (max-width: 700px)  { .sidebar, .toolbar { display: none; } .app-content { padding: 110px 16px 110px; } } */
/* .tabbar/.phone-only are shown only in phone layouts: the app hides them above 700px with @media (min-width: 701px) { .tabbar, .phone-only { display: none; } } */

/* ---------- Buttons (.btn in the kit) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 0; border-radius: 999px;
       font: inherit; font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer; text-decoration: none;
       transition: background-color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-spring), color var(--dur-1) var(--ease-out); }
.btn:active { transform: scale(.97); }
.btn.sm { height: 28px; padding: 0 12px; font-size: 13px; } .btn.lg { height: 48px; padding: 0 22px; font-size: 16px; }
.btn.filled { background: var(--accent-fill); color: var(--on-accent); }
.btn.filled:hover { background: var(--accent-hover); } .btn.filled:active { background: var(--accent-pressed); }
.btn.tinted { background: var(--tinted-bg); color: var(--accent); }
.btn.tinted:hover { background: var(--tinted-bg-hover); } .btn.tinted:active { background: var(--tinted-bg-pressed); }
.btn.gray { background: var(--fill-2); color: var(--label); }
.btn.gray:hover { background: var(--fill-1); } .btn.gray:active { background: var(--fill-pressed); }
.btn.plain { background: transparent; color: var(--accent); padding: 0 14px; }
.btn.plain:hover { background: var(--fill-3); } .btn.plain:active { background: var(--fill-2); }
.btn.glass { color: var(--label); } .btn.glass:hover { background: oklch(1 0 0 / 0.9); }
[data-theme="dark"] .btn.glass:hover { background: oklch(0.3 0.008 30 / 0.9); }
.btn.destructive { background: var(--red); color: #fff; }
.btn.btn:disabled, .btn.btn[aria-disabled="true"] { background: var(--fill-2); color: var(--label-4); cursor: not-allowed; transform: none; }
.btn.tinted:disabled, .btn.gray:disabled { background: var(--fill-3); } .btn.plain:disabled { background: transparent; }
.btn[aria-busy="true"] { opacity: .88; pointer-events: none; }
.spinner { width: 16px; height: 16px; border-radius: 999px; border: 2.5px solid currentColor; border-inline-end-color: transparent; animation: tebb-spin .8s linear infinite; }
@keyframes tebb-spin { to { transform: rotate(360deg); } }

/* ---------- Fields (.field / .input / .select) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 14px; font-weight: 500; color: var(--label-2); }
.field-label .optional { color: var(--label-3); font-weight: 400; }
.input, .select { height: 44px; width: 100%; border: 0; border-radius: 12px; background: var(--fill-3); box-shadow: inset 0 0 0 1px var(--separator);
                  padding: 0 14px; font: inherit; font-size: 16px; color: var(--label); display: flex; align-items: center; gap: 8px;
                  transition: box-shadow var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out); }
.input::placeholder { color: var(--label-3); }
.input:hover { background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--separator-opaque); }
.input:focus, .input:focus-visible { outline: none; background: var(--bg-elevated); box-shadow: inset 0 0 0 1px var(--anabi-600), 0 0 0 4px oklch(0.54 0.172 12 / 0.22); }
.input[aria-invalid="true"] { background: var(--red-bg); box-shadow: inset 0 0 0 1.5px var(--red); }
.input:disabled { background: var(--fill-3); color: var(--label-4); box-shadow: none; }
.field-error { font-size: 14px; line-height: 1.5; color: var(--red); }
.field-hint { font-size: 13px; color: var(--label-3); }

/* ---------- Segmented (.segmented) ---------- */
.segmented { position: relative; display: inline-flex; height: 36px; padding: 3px; border-radius: 999px; background: var(--fill-2); font-size: 14px; font-weight: 600; }
.toolbar .segmented { height: 40px; }
.segmented > button { position: relative; z-index: 1; border: 0; background: none; font: inherit; padding: 0 14px; border-radius: 999px; color: var(--label-2); cursor: pointer; }
.glass .segmented > button { color: var(--label-2-on-glass); }
.segmented > button[aria-selected="true"] { color: var(--label); }
.segmented > button:not([aria-selected="true"]):hover { background: var(--fill-3); color: var(--label); }
.segmented .thumb { position: absolute; inset-block: 3px; border-radius: 999px; background: var(--bg-elevated);
                    box-shadow: 0 1px 2px oklch(0.2 0.02 20 / 0.12), 0 3px 8px oklch(0.2 0.02 20 / 0.06); transition: transform var(--dur-3) var(--ease-spring), width var(--dur-3) var(--ease-spring); }

/* ---------- Toggle (.toggle) ---------- */
.toggle { position: relative; width: 52px; height: 32px; flex: none; border: 0; padding: 0; border-radius: 999px; background: var(--fill-1); cursor: pointer; transition: background-color var(--dur-2) var(--ease-out); }
.toggle::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 28px; height: 28px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px oklch(0 0 0 / 0.2); transition: inset-inline-start var(--dur-2) var(--ease-spring); }
.toggle[aria-checked="true"] { background: var(--accent-fill); } .toggle[aria-checked="true"]::after { inset-inline-start: 22px; }
.toggle[aria-checked="true"]::before { content: ""; position: absolute; top: 10px; inset-inline-start: 11px; width: 1.5px; height: 12px; border-radius: 1px; background: #fff; }
.toggle:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Menu / popover / sheet / alert / toast ---------- */
.menu { border-radius: 18px; padding: 6px; min-width: 240px; font-size: 15px; }
.menu-item { height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 12px; cursor: default; }
.menu-item .icon { width: 17px; height: 17px; stroke-width: 1.75; }
.menu-item:hover, .menu-item:focus-visible { outline: none; background: var(--nav-selected); color: var(--anabi-800); }
[data-theme="dark"] .menu-item:hover { color: var(--accent); }
.menu-item.destructive { color: var(--red); font-weight: 500; }
.menu-item[aria-disabled="true"] { color: var(--label-4); pointer-events: none; }
.menu-item .shortcut { margin-inline-start: auto; font-size: 13px; color: var(--label-2-on-glass); direction: ltr; }
.menu-sep { height: 1px; background: var(--separator); margin: 5px 10px; }
.popover { position: relative; border-radius: 16px; padding: 14px 16px; background: var(--bg-elevated); box-shadow: 0 0 0 1px var(--separator), var(--shadow-glass); font-size: 14.5px; line-height: 1.6; color: var(--label-2); }
.popover-title { display: block; color: var(--label); font-weight: 600; margin-bottom: 2px; }
.scrim { position: fixed; inset: 0; background: oklch(0.2 0.02 20 / 0.24); }
.sheet { border-radius: 28px; background: var(--bg-surface); box-shadow: 0 24px 70px oklch(0.2 0.02 20 / 0.28); overflow: hidden; display: flex; flex-direction: column; width: min(500px, 100%); }
.sheet-header { height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--glass-hairline); }
.sheet-header .title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.sheet-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.alert { width: 300px; border-radius: 24px; padding: 20px 20px 14px; background: var(--bg-elevated); box-shadow: 0 20px 60px oklch(0.2 0.02 20 / 0.3); display: flex; flex-direction: column; gap: 8px; text-align: center; }
.alert-title { font-size: 17px; font-weight: 600; } .alert-body { font-size: 14.5px; line-height: 1.55; color: var(--label-2); }
.alert-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; } .alert-actions .btn { height: 44px; }
.toast { height: 52px; border-radius: 999px; display: inline-flex; align-items: center; gap: 14px; padding-inline: 18px 8px; font-size: 15px; }
.toast .undo { height: 38px; padding: 0 16px; border-radius: 999px; background: var(--nav-selected); color: var(--anabi-800); font-weight: 600; border: 0; font: inherit; font-weight: 600; }
.sheet, .popover, .menu, .toast { transform-origin: var(--origin, top); }
.is-entering { animation: tebb-rise var(--dur-4) var(--ease-spring) both; }
@keyframes tebb-rise { from { opacity: 0; transform: translateY(16px) scale(.98); } }

/* ---------- Lists (inset grouped) ---------- */
.list-inset { border-radius: 20px; background: var(--bg-surface); box-shadow: var(--shadow-card); overflow: hidden; font-size: 16px; }
.list-section { font-size: 13px; font-weight: 500; color: var(--label-3); padding-inline-start: 16px; margin-bottom: 8px; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; }
.list-row + .list-row { box-shadow: inset 0 1px 0 var(--separator); }
.list-row .tile { width: 30px; height: 30px; border-radius: 8px; background: var(--fill-2); display: grid; place-items: center; flex: none; }
.list-row .value { color: var(--label-3); } .list-row .chev { color: var(--label-4); width: 15px; height: 15px; }
[dir="rtl"] .list-row .chev { transform: scaleX(-1); }
.list-footer { font-size: 13px; line-height: 1.5; color: var(--label-3); padding-inline: 16px; margin-top: 8px; }

/* ---------- Table (.table + density) ---------- */
.table { width: 100%; font-size: 14.5px; }
.table .tr { display: grid; align-items: center; min-height: var(--row-h); padding: 0 20px; border-top: 1px solid var(--separator); }
.table .th { min-height: 36px; background: var(--bg-surface-2); font-size: 13px; font-weight: 600; color: var(--label-3); position: sticky; top: 0; }
.table .tr:not(.th):hover { background: var(--fill-3); }
.table .tr[aria-selected="true"] { background: var(--accent-subtle); }
.table .tr.total { background: var(--bg-surface-2); font-weight: 600; border-top-color: var(--separator-opaque); }
.table .num { text-align: end; }
.check { width: 18px; height: 18px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--separator-opaque); display: grid; place-items: center; }
.check[aria-checked="true"] { background: var(--accent-fill); box-shadow: none; }
.skeleton { height: 12px; border-radius: 6px; background: var(--fill-2); }
@media (prefers-reduced-motion: no-preference) { .skeleton { background: linear-gradient(90deg, var(--fill-2), var(--fill-3), var(--fill-2)); background-size: 200% 100%; animation: tebb-shimmer 1.4s linear infinite; } }
@keyframes tebb-shimmer { to { background-position: -200% 0; } }

/* ---------- Status (.badge) — icon + label always ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.badge .icon { width: 15px; height: 15px; stroke-width: 2.2; } .badge.sm { height: 24px; padding: 0 10px; font-size: 13px; }
.badge.ready { background: var(--green-bg); color: var(--green); } .badge.incomplete { background: var(--amber-bg); color: var(--amber); }
.badge.rejected { background: var(--red-bg); color: var(--red); } .badge.pending { background: var(--gray-bg); color: var(--gray); }
.badge.info { background: var(--blue-bg); color: var(--blue); } .badge.neutral { background: var(--fill-3); color: var(--label-3); font-weight: 500; }
.clinical-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--red-bg); color: var(--red); font-size: 15px; line-height: 1.55; }
.clinical-alert .icon { width: 20px; height: 20px; stroke-width: 2; margin-top: 2px; }

/* ---------- Claim readiness (.readiness) ---------- */
.readiness-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding-inline: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.readiness-pill .ring { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; }
.readiness-pill.is-ready { background: var(--green-bg); color: var(--green); } .readiness-pill.is-ready .ring { background: var(--green); }
.readiness-pill.is-missing { background: var(--amber-bg); color: var(--amber); }
.readiness-pill.is-missing .ring { background: conic-gradient(var(--amber) 0 var(--pct, 66%), oklch(0.525 0.122 62 / 0.18) var(--pct, 66%) 100%); }
.readiness-pill.is-blocked { background: var(--red-bg); color: var(--red); } .readiness-pill.is-blocked .ring { background: var(--red); }
.readiness-pill.is-overridden { background: var(--gray-bg); color: var(--gray); } .readiness-pill.is-overridden .ring { background: var(--gray); }
.readiness-list { border-radius: 16px; background: var(--bg-surface-2); overflow: hidden; font-size: 14.5px; }
.readiness-list .item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.readiness-list .item + .item { box-shadow: inset 0 1px 0 var(--separator); }

/* ---------- Dashboard pieces ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 4px 4px 2px; }
.page-sub { font-size: 14.5px; color: var(--label-2); }
.concept-chip { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--fill-3); color: var(--label-3); font-size: 12.5px; font-weight: 500; }
.kpi-band { background: var(--bg-surface); border-radius: var(--r-xl); box-shadow: var(--shadow-card); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi + .kpi { box-shadow: inset 1px 0 0 var(--separator); } [dir="rtl"] .kpi + .kpi { box-shadow: inset -1px 0 0 var(--separator); }
.kpi-label { font-size: 14px; color: var(--label-2); display: flex; align-items: center; gap: 6px; } .kpi-label .icon { width: 16px; height: 16px; stroke-width: 1.6; }
.kpi-value { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; } :lang(ar) .kpi-value { letter-spacing: 0; }
.kpi-unit { font-size: 15px; font-weight: 500; color: var(--label-3); letter-spacing: 0; }
.kpi-sub { font-size: 13px; color: var(--label-3); }
.meter { position: relative; display: block; height: 6px; border-radius: 999px; background: var(--fill-2); margin: 6px 0 4px; }
.meter > .fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: var(--label-3); }
.meter > .target { position: absolute; inset-block: -4px; width: 2px; border-radius: 1px; background: var(--label); }
.metric { border-radius: 16px; background: var(--bg-surface-2); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.metric .meter { height: 8px; margin: 8px 0 2px; } .metric .meter > .fill { background: var(--series-1); } .metric .meter > .target { inset-block: -5px; }
.bars { display: flex; gap: 14px; padding-bottom: 34px; background: repeating-linear-gradient(to top, var(--separator) 0 1px, transparent 1px 25%);
        background-size: 100% calc(100% - 34px); background-repeat: no-repeat; }
.bars .group { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.bars .cols { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bars .col { flex: 1; max-width: 22px; border-radius: 6px 6px 2px 2px; }
.bars .s1 { background: var(--series-1); } .bars .s2 { background: var(--series-2); } .bars .s3 { background: var(--series-3); }
.bars .today .s1 { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 3.5px var(--label); }
.bars .x { height: 34px; padding-top: 6px; text-align: center; font-size: 12px; line-height: 1.3; color: var(--label-2); white-space: nowrap; }
.legend-mark { width: 10px; height: 10px; display: inline-block; } .legend-mark.sq { border-radius: 3px; } .legend-mark.ci { border-radius: 999px; } .legend-mark.di { transform: rotate(45deg) scale(.85); }
.hbar { display: grid; grid-template-columns: 62px minmax(0, 1fr) 28px; align-items: center; gap: 10px; }
.hbar .code { text-align: center; padding: 3px 0; border-radius: 7px; background: var(--fill-3); color: var(--label-2); }
.hbar .track { display: block; height: 6px; border-radius: 999px; background: var(--fill-3); } .hbar .track > span { display: block; height: 100%; border-radius: 999px; background: var(--label-3); }
.hbar .n { font-size: 15px; font-weight: 600; text-align: end; }

/* ---------- Screen reference helpers ---------- */
.board { position: relative; overflow: hidden; border-radius: 18px; box-shadow: 0 30px 80px oklch(0.2 0.02 20 / 0.18), 0 0 0 1px oklch(0.2 0.02 20 / 0.06); font-family: var(--font); color: var(--label); }
.board > .app-canvas { position: absolute; inset: 0; min-height: 0; }
.board-cap { display: flex; align-items: center; gap: 10px; font-family: var(--font); font-size: 15px; color: var(--label-2); margin-bottom: 12px; }
.board-cap b { color: var(--label); font-weight: 600; }
.board-id { font-size: 13px; font-weight: 600; color: #fff; background: #8B1939; border-radius: 9px; padding: 3px 9px; }
.row { display: flex; align-items: center; gap: 8px; } .col { display: flex; flex-direction: column; gap: 8px; } .grow { flex: 1; min-width: 0; }
.muted { color: var(--label-2); } .faint { color: var(--label-3); } .small { font-size: 13px; } .strong { font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--fill-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.chip.on { background: var(--nav-selected); color: var(--accent); font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--fill-2); display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; }
.kbd { direction: ltr; font-size: 11.5px; border: 1px solid var(--separator); border-radius: 6px; padding: 0 5px; color: var(--label-3); }
.placeholder { display: grid; place-items: center; color: var(--label-3); font-family: var(--font-mono); font-size: 12px; border-radius: 14px; background: repeating-linear-gradient(135deg, var(--fill-3) 0 8px, transparent 8px 16px); box-shadow: inset 0 0 0 1px var(--separator); }
.inspector { position: absolute; top: 80px; bottom: 12px; inset-inline-end: 12px; width: 340px; border-radius: 24px; background: var(--bg-surface); box-shadow: var(--shadow-glass); overflow: auto; z-index: 2; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.has-inspector .app-content { padding-inline-end: 368px; }
.has-inspector .toolbar { inset-inline-end: 12px; }
.shortcut-bar { position: absolute; inset-block-end: 12px; inset-inline: 280px 12px; height: 40px; border-radius: 999px; display: flex; align-items: center; gap: 18px; padding: 0 16px; font-size: 13px; color: var(--label-2-on-glass); z-index: 3; }
.print-sheet { background: #fff; color: #000; font-family: var(--font); box-shadow: 0 20px 60px oklch(0.2 0.02 20 / 0.2); }

/* ---------- Density (F1) ---------- */
.density-comfy { --row-h: 48px; } .density-std { --row-h: 40px; } .density-compact { --row-h: 34px; } .density-dense { --row-h: 30px; }
