/* AsMade.AI — High Level Dashboard
 * Layout, spacing, shape and component anatomy: Figma handoff v3.
 * Colour and type: asmadeai.com's own custom properties.
 *
 * Every colour below was contrast-checked; the measured ratios are in README.md.
 * Two deliberate departures from the published brand tokens, both forced by WCAG:
 *   --warn-fill  .730 -> .675  (was 2.46:1 on white, below the 3:1 non-text floor)
 *   --stone      is hairlines only; the third TEXT tier is --stone-text (4.84:1)
 */

/* ============================================================== tokens */
:root {
  /* brand — read off asmadeai.com's :root, not sampled from a screenshot */
  --canvas:        oklch(1.000 0.000 90);
  --surface:       oklch(0.979 0.003 264);
  --ink:           oklch(0.227 0.004 286);
  --slate:         oklch(0.469 0.027 272);
  --stone:         oklch(0.659 0.022 277);   /* hairline/decoration ONLY */
  --stone-text:    oklch(0.552 0.024 275);   /* 4.84:1 — the third text tier */
  --hairline:      oklch(0.913 0.008 271);
  --hairline-soft: oklch(0.954 0.005 258);
  --brand-yellow:  oklch(0.874 0.168 91);

  --tint-coral:  oklch(0.877 0.065 19);
  --tint-teal:   oklch(0.946 0.056 189);
  --tint-orange: oklch(0.939 0.043 67);

  /* status — text tier (>=4.5:1 on canvas AND on its own tint) */
  --ok:   oklch(0.490 0.100 185);
  --warn: oklch(0.505 0.125 62);
  --late: oklch(0.487 0.180 25);
  /* status — fill tier (>=3:1 on canvas, HIG's non-text floor) */
  --ok-fill:   oklch(0.640 0.140 180);
  --warn-fill: oklch(0.675 0.165 72);
  --late-fill: oklch(0.615 0.225 25);

  /* handoff's semantic roles mapped onto the brand */
  --page:    var(--surface);        /* handoff bg      #F5F7FB */
  --card:    var(--canvas);         /* handoff surface #FFFFFF */
  --nav:     var(--ink);            /* handoff sidebar #0E223A */
  --on-nav:        oklch(1 0 0 / .72);
  --on-nav-strong: oklch(1 0 0);
  --nav-active:    oklch(1 0 0 / .10);
  --bar-track: var(--hairline);
  --planned:   var(--stone-text);   /* handoff "planned = slate grey" */

  /* shape + spacing — handoff v3 */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 9999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px;
  --rail-w: 180px;
  --pad: 24px;
  --max: 1600px;

  /* type — handoff scale, asmadeai face */
  --font: "Host Grotesk", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --t-h1: 34px; --t-h2: 20px; --t-body: 14px; --t-label: 12px; --t-metric: 24px;

  /* hero scrub — written by GSAP, never by CSS transition */
  --hero-k: 0;            /* 0 = full KPI band, 1 = collapsed figure row */
  --shadow: 0 1px 2px oklch(0.227 0.004 286 / .05), 0 8px 24px oklch(0.227 0.004 286 / .05);
}

/* ============================================================== reset */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }          /* beats a component's own display */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 var(--t-body)/1.45 var(--font);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
svg { display: block; }
.vh {                                            /* visually hidden, still read */
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px; border-radius: var(--r-sm);
}
.num { font-variant-numeric: tabular-nums; }

/* ============================================================== rail */
#rail {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--rail-w);
  background: var(--nav); color: var(--on-nav-strong);
  display: flex; flex-direction: column; z-index: 40;
  padding: var(--sp-5) 0;
}
#rail .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 var(--sp-4) var(--sp-6); font-weight: 700; font-size: 15px;
  letter-spacing: -0.02em;
}
#rail .brand .mark {
  width: 26px; height: 26px; border-radius: var(--r-sm); flex: none;
  background: var(--brand-yellow); color: var(--ink);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
#rail nav { display: flex; flex-direction: column; gap: 2px; padding-inline: var(--sp-2); }
#rail a {
  display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--on-nav); text-decoration: none; font-size: 13px; font-weight: 500;
  position: relative;
}
#rail a svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.7;
  fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#rail a:hover { color: var(--on-nav-strong); background: oklch(1 0 0 / .06); }
#rail a[aria-current] { color: var(--on-nav-strong); background: var(--nav-active); }
#rail a[aria-current]::before {
  content: ''; position: absolute; inset-inline-start: -8px; inset-block: 8px;
  width: 3px; border-radius: var(--r-pill); background: var(--brand-yellow);
}
#rail .spacer { flex: 1; }

/* ============================================================== scroll column */
/* ScrollSmoother writes position/inset INLINE onto the wrapper, so a rail offset
   declared here is silently overwritten and the table slides under the sidebar.
   The offset belongs on the content. */
#smooth-wrapper { position: fixed; inset: 0; overflow: hidden; z-index: 2; }
#smooth-content {
  padding: var(--sp-6) var(--pad) 96px;
  padding-inline-start: calc(var(--rail-w) + var(--pad));
}
.page { max-width: var(--max); margin: 0 auto; }

/* ============================================================== masthead */
.mast {
  display: flex; align-items: flex-start; gap: var(--sp-6);
  padding-bottom: var(--sp-5);
}
.mast h1 {
  margin: 0; font-size: var(--t-h1); font-weight: 700; line-height: 1.1;
  letter-spacing: -0.022em;
}
.mast .sub { margin: 6px 0 0; color: var(--slate); font-size: var(--t-body); }
.mast .grow { flex: 1; }
.search {
  display: flex; align-items: center; gap: var(--sp-2);
  min-height: 38px; padding: 0 14px; width: 300px;
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
}
.search svg { width: 15px; height: 15px; stroke: var(--stone-text); stroke-width: 1.8;
  fill: none; stroke-linecap: round; }
.search input { border: 0; outline: 0; background: none; width: 100%; font-size: 13px; }
.search input::placeholder { color: var(--stone-text); }
.who { display: flex; align-items: center; gap: 10px; min-height: 38px; }
.who .av {
  width: 34px; height: 34px; border-radius: var(--r-pill); background: var(--ink);
  color: var(--canvas); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: 0;
}
.who .nm { font-size: 13px; font-weight: 600; line-height: 1.2; }
.who .ro { font-size: var(--t-label); color: var(--stone-text); line-height: 1.2; }

/* ============================================================== hero (sticky + scrubbed) */
.hero {
  position: sticky; top: 0; z-index: 20;
  background: var(--page);
  padding-block: var(--sp-2);
  margin-inline-end: calc(var(--pad) * -1); padding-inline-end: var(--pad);
  margin-inline-start: calc((var(--rail-w) + var(--pad)) * -1);
  padding-inline-start: calc(var(--rail-w) + var(--pad));
}
.hero::after {                                   /* scroll edge effect, not a bar fill */
  content: ''; position: absolute; inset-inline: 0; top: 100%; height: 18px;
  background: linear-gradient(var(--page), oklch(0.979 0.003 264 / 0));
  opacity: var(--hero-k); pointer-events: none;
}

/* filters */
.filters { display: flex; align-items: flex-end; gap: var(--sp-3); flex-wrap: wrap;
  padding-bottom: var(--sp-4); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-size: var(--t-label); font-weight: 700; color: var(--slate);
  letter-spacing: 0.01em;
}
.field select {
  appearance: none; min-height: 38px; min-width: 150px;
  padding: 0 34px 0 12px; border-radius: var(--r-sm);
  background: var(--card) no-repeat right 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236E7181' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  border: 1px solid var(--hairline); font-size: 13px; cursor: pointer;
}
:dir(rtl) .field select { padding: 0 12px 0 34px; background-position: left 12px center; }
.filters .clear {
  min-height: 38px; padding: 0 4px; color: var(--slate);
  font-size: 13px; font-weight: 500; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--hairline);
}
.filters .clear:hover { color: var(--ink); }
.filters .grow { flex: 1; }
.seg {
  display: flex; gap: 2px; padding: 3px; background: var(--card);
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
}
.seg button {
  display: flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 13px;
  border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--slate);
}
.seg button svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8;
  fill: none; stroke-linecap: round; stroke-linejoin: round; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--canvas); }

/* KPI band — 5 cards at hero-k 0, one hairline row at hero-k 1 */
.kpis {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-3);
  padding-bottom: var(--sp-4);
}
.kpi {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: var(--sp-4);
  /* GSAP writes --kpi-pad / --kpi-icon via the hero scrub */
  padding: calc(var(--sp-4) - var(--hero-k) * 10px) var(--sp-4);
}
.kpi .ic {
  width: calc(44px - var(--hero-k) * 44px); height: 44px; flex: none;
  border-radius: var(--r-md); display: grid; place-items: center;
  opacity: calc(1 - var(--hero-k) * 1.6); overflow: hidden;
}
.kpi .ic svg { width: 21px; height: 21px; stroke-width: 1.9; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.kpi .k { font-size: var(--t-label); font-weight: 700; color: var(--slate); }
.kpi .n {
  font-size: calc(var(--t-metric) - var(--hero-k) * 6px); font-weight: 700;
  line-height: 1.1; letter-spacing: -0.02em;
}
.kpi .f { font-size: var(--t-label); color: var(--stone-text);
  opacity: calc(1 - var(--hero-k) * 1.6); }
.kpi .body { min-width: 0; display: flex; flex-direction: column;
  gap: calc(2px + (1 - var(--hero-k)) * 2px); }
.kpi.ok   .ic { background: var(--tint-teal);   color: var(--ok); }
.kpi.warn .ic { background: var(--tint-orange); color: var(--warn); }
.kpi.late .ic { background: var(--tint-coral);  color: var(--late); }
.kpi.info .ic { background: var(--hairline-soft); color: var(--slate); }
.kpi.crit .ic { background: var(--tint-coral);  color: var(--late); }
.kpi.crit .n  { color: var(--late); }

/* ============================================================== body grid */
.cols {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--sp-4); align-items: start;
}

/* ============================================================== table */
.panel {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); overflow: hidden;
}
.panel > header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-5) var(--sp-5) var(--sp-3);
}
.panel > header h2 { margin: 0; font-size: var(--t-h2); font-weight: 700;
  letter-spacing: -0.015em; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: start; padding: 10px var(--sp-3); font-size: var(--t-label);
  font-weight: 700; color: var(--slate); white-space: nowrap;
  border-bottom: 1px solid var(--hairline);
}
thead th:first-child { padding-inline-start: var(--sp-5); }
thead th:last-child  { padding-inline-end: var(--sp-5); }
thead th.r, td.r { text-align: end; }
th .hint {
  display: inline-grid; place-items: center; width: 16px; height: 16px;
  border-radius: var(--r-pill); border: 1px solid var(--stone);
  color: var(--stone-text); font-size: 11px; font-weight: 700; margin-inline-start: 5px;
  vertical-align: -3px; line-height: 1;
}
tbody tr {
  border-bottom: 1px solid var(--hairline-soft); cursor: pointer;
  position: relative;
}
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover, tbody tr.hot { background: var(--surface); }
tbody tr.sel { background: var(--hairline-soft); }
tbody tr.sel::after {
  content: ''; position: absolute; inset-block: 0; inset-inline-start: 0;
  width: 3px; background: var(--ink);
}
td { padding: var(--sp-3); vertical-align: middle; height: 56px; }
td:first-child { padding-inline-start: var(--sp-5); }
td:last-child  { padding-inline-end: var(--sp-5); }

.proj { display: flex; align-items: center; gap: 10px; }
.proj .dot { width: 9px; height: 9px; border-radius: var(--r-pill); flex: none; }
.proj .nm { font-weight: 600; font-size: 13px; line-height: 1.25; }
.proj .lo { font-size: var(--t-label); color: var(--stone-text); display: flex;
  align-items: center; gap: 4px; }
.proj .lo svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 1.7;
  fill: none; }
.live {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  padding: 1px 6px; border-radius: var(--r-pill);
  background: var(--brand-yellow); color: var(--ink); margin-inline-start: 6px;
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: var(--t-label); font-weight: 700; white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.chip.ok   { background: var(--tint-teal);   color: var(--ok); }
.chip.warn { background: var(--tint-orange); color: var(--warn); }
.chip.late { background: var(--tint-coral);  color: var(--late); }

.ms .a { font-size: 13px; font-weight: 500; }
.ms .b { font-size: var(--t-label); color: var(--stone-text); }

.pct { display: flex; flex-direction: column; gap: 6px; min-width: 96px; }
.pct .v { font-size: 13px; font-weight: 700; }
.track {
  height: 6px; border-radius: var(--r-pill); background: var(--bar-track);
  overflow: hidden;
}
.track > i { display: block; height: 100%; width: 0; border-radius: var(--r-pill); }
.pct.actual .track > i.ok   { background: var(--ok-fill); }
.pct.actual .track > i.warn { background: var(--warn-fill); }
.pct.actual .track > i.late { background: var(--late-fill); }
.pct.plan   .track > i      { background: var(--planned); }

.var { font-size: 13px; font-weight: 700; }
.var.ok { color: var(--ok); } .var.warn { color: var(--warn); } .var.late { color: var(--late); }
.iss { font-size: 13px; font-weight: 600; }
.iss.hot { color: var(--late); }
.cap .a { font-size: 13px; } .cap .b { font-size: var(--t-label); color: var(--stone-text); }

.kebab {
  width: 28px; height: 28px; border-radius: var(--r-sm); display: grid;
  place-items: center; color: var(--stone-text);
}
.kebab:hover { background: var(--hairline-soft); color: var(--ink); }
.kebab svg { width: 15px; height: 15px; }

/* sparkline of a project's milestones */
.endcell { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 22px; width: 54px; flex: none; }
.spark i { flex: 1; border-radius: 1px; background: var(--hairline); min-height: 2px; }
.spark i.ok { background: var(--ok-fill); }
.spark i.warn { background: var(--warn-fill); }
.spark i.late { background: var(--late-fill); }

/* ============================================================== cards view */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-4); padding: var(--sp-5); }
.card {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: var(--sp-4); cursor: pointer;
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.card:hover { border-color: var(--stone); }
.card .top { display: flex; align-items: flex-start; gap: var(--sp-3); }
.card .top .grow { flex: 1; min-width: 0; }
.card .ml { font-size: var(--t-label); font-weight: 700; color: var(--slate); }
.card .pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.card .foot {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2);
  padding-top: var(--sp-3); border-top: 1px solid var(--hairline-soft);
}
.card .foot .k { font-size: var(--t-label); color: var(--stone-text); }
.card .foot .v { font-size: 13px; font-weight: 600; }

/* ============================================================== right rail */
.side { display: flex; flex-direction: column; gap: var(--sp-4);
  position: sticky; top: 0; }

/* preview — the tier bridge, visible */
.preview { padding: var(--sp-4); }
.preview .shot {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-md);
  overflow: hidden; background: var(--hairline-soft);
}
.preview .shot img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.preview .shot .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--slate); font-size: var(--t-label); font-weight: 600;
  text-align: center; padding: var(--sp-4);
}
.preview .cap { display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-2); padding-top: var(--sp-3); }
.preview .cap .t { font-size: 13px; font-weight: 600; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview .cap .s { font-size: var(--t-label); color: var(--stone-text); }
.preview .views {
  display: flex; gap: 6px; padding-top: var(--sp-3); overflow: hidden;
}
.preview .views .v {
  position: relative; width: 44px; height: 34px; border-radius: 6px; flex: none;
  overflow: hidden; background: var(--hairline);
}
.preview .views .v img { width: 100%; height: 100%; object-fit: cover; }
.preview .views .v.locked img { filter: grayscale(1) brightness(.78); }
.preview .views .v.locked::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg,
    oklch(0.487 0.180 25 / .55) 0 5px, oklch(0.227 0.004 286 / .55) 5px 10px);
  opacity: .72;
}
.preview .go {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; min-height: 38px; margin-top: var(--sp-3);
  border-radius: var(--r-pill); background: var(--ink); color: var(--canvas);
  font-size: 13px; font-weight: 600;
}
.preview .go[disabled] {
  background: var(--card); color: var(--stone-text);
  border: 1px solid var(--hairline); cursor: default;
}
.preview .go svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round; }
:dir(rtl) .preview .go svg { transform: scaleX(-1); }

/* needs attention */
.attn > header { display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-4) var(--sp-3); }
.attn > header h2 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; }
.attn > header svg { width: 17px; height: 17px; stroke: var(--late); stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round; }
.attn ul { list-style: none; margin: 0; padding: 0 var(--sp-2) var(--sp-2); }
.attn li a {
  display: grid; grid-template-columns: 9px 1fr 14px; gap: 10px; align-items: start;
  padding: var(--sp-3); border-radius: var(--r-md); text-decoration: none;
  color: inherit; min-height: 44px;
}
.attn li a:hover { background: var(--surface); }
.attn .dot { width: 9px; height: 9px; border-radius: var(--r-pill); margin-top: 4px; }
.attn .t { font-size: 13px; font-weight: 600; }
.attn .d { font-size: var(--t-label); color: var(--slate); line-height: 1.4; }
.attn .w { font-size: var(--t-label); color: var(--stone-text); margin-top: 3px; }
.attn .ch { width: 14px; height: 14px; stroke: var(--stone); stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round; margin-top: 4px; }
:dir(rtl) .attn .ch { transform: scaleX(-1); }

.dot.ok { background: var(--ok-fill); } .dot.warn { background: var(--warn-fill); }
.dot.late { background: var(--late-fill); }

/* ============================================================== popover */
#pop { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.pop {
  position: absolute; width: 356px; background: var(--card);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  box-shadow: var(--shadow); padding: var(--sp-4); pointer-events: auto;
  opacity: 0;
}
.pop > header { display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-3); padding-bottom: var(--sp-3); }
.pop h3 { margin: 0; font-size: 13px; font-weight: 700; }
.pop .tot { font-size: 15px; font-weight: 700; }
.pop table { width: 100%; }
.pop th {
  font-size: 11px; font-weight: 700; color: var(--stone-text); text-align: start;
  padding: 0 0 6px; border-bottom: 1px solid var(--hairline-soft);
}
.pop th.r { text-align: end; }
.pop td { height: auto; padding: 7px 0; font-size: var(--t-label); }
.pop td.r { text-align: end; }
.pop td.nm { font-weight: 500; }
.pop td.w { color: var(--stone-text); }
.pop .track { width: 108px; margin-inline-start: auto; }

/* ============================================================== depth axis */
#depth {
  position: fixed; inset-inline: var(--rail-w) 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 0 14px; pointer-events: none; opacity: 0;
}
#depth .pill {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px;
  background: var(--ink); color: var(--canvas); border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; box-shadow: var(--shadow);
}
#depth .bar { width: 72px; height: 5px; border-radius: var(--r-pill);
  background: oklch(1 0 0 / .22); overflow: hidden; }
#depth .bar > i { display: block; height: 100%; width: 0; background: var(--brand-yellow); }

/* ============================================================== rtl */
/* 🔴 `direction: ltr` alone is not enough inside an RTL paragraph: the span is
   still part of the parent's bidi run, so "-9%" is reordered to "9%-" and a date
   comes apart. `unicode-bidi: isolate` closes the run. */
:dir(rtl) .num, :dir(rtl) .track, :dir(rtl) .spark,
:dir(rtl) .ms .a, :dir(rtl) .ms .b, :dir(rtl) .proj .nm, :dir(rtl) .preview .cap .t {
  direction: ltr; unicode-bidi: isolate;
}
:dir(rtl) .proj .nm, :dir(rtl) .ms .a, :dir(rtl) .ms .b { text-align: right; }
:dir(rtl) .proj, :dir(rtl) .chip { direction: rtl; }

/* ============================================================== responsive */
@media (max-width: 1360px) {
  .cols { grid-template-columns: minmax(0, 1fr) 280px; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(n+4) { display: none; }
  thead th.opt, td.opt { display: none; }
}
@media (max-width: 1080px) {
  :root { --rail-w: 64px; }
  #rail .brand span, #rail a span { display: none; }
  #rail .brand, #rail a { justify-content: center; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .search { width: 200px; }
}

/* ============================================================== reduce motion
 * GSAP timelines never see this query; app.js reads it directly and swaps every
 * transform reveal for a fade. This block only covers plain CSS. */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* attention title can be a long real name; it wraps rather than being chopped */
.attn .t { display: block; }

/* ---- column widths -------------------------------------------------------
 * Without these the project name wraps to three lines and every row grows to a
 * different height, which destroys the scannability the handoff is built on.
 * "Dense enough for comparison; generous enough for scanning." */
#tbl { table-layout: fixed; }
#tbl th:nth-child(1), #tbl td:nth-child(1) { width: 23%; min-width: 210px; }
#tbl th:nth-child(2), #tbl td:nth-child(2) { width: 112px; }
#tbl th:nth-child(3), #tbl td:nth-child(3) { width: 17%; }
#tbl th:nth-child(4), #tbl td:nth-child(4),
#tbl th:nth-child(5), #tbl td:nth-child(5) { width: 118px; }
#tbl th:nth-child(6), #tbl td:nth-child(6) { width: 86px; }
#tbl th:nth-child(7), #tbl td:nth-child(7) { width: 76px; }
#tbl th:nth-child(8), #tbl td:nth-child(8) { width: 116px; }
#tbl th:nth-child(9), #tbl td:nth-child(9) { width: 96px; }

.proj .nm { display: block; }
.proj .lo, .ms .a, .ms .b, .cap .a, .cap .b {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.proj > span:last-child { min-width: 0; }
thead th { white-space: nowrap; }

/* The status fill rules are scoped to .pct.actual, which the popover is not —
 * its bars rendered as empty tracks. Give the popover its own scope. */
.pop .track { background: var(--bar-track); }
.pop .track > i      { background: var(--planned); }
.pop .track > i.ok   { background: var(--ok-fill); }
.pop .track > i.warn { background: var(--warn-fill); }
.pop .track > i.late { background: var(--late-fill); }

/* card anatomy: the status dot and the two progress labels */
.card .top .dot { flex: none; }
.card .pct { gap: 4px; min-width: 0; }
.card .pct .ml { font-size: var(--t-label); font-weight: 700; color: var(--slate); }
.card .pct .v { font-size: 15px; }
