/* SOURCE: clearpoint-build/code/graphite.css, copied verbatim below this comment
   (2026-09-28). Edit the pack and re-copy; never hand-edit it here. */

/* ============================================================
   Clearpoint Graphite — Dark (Clearpoint HQ)
   Extracted from the same kit that drew all 29 design boards,
   so the stylesheet and the pictures are the same values by
   construction rather than by interpretation.

   Pair with graphite-light.css for the portal. Identical
   variable NAMES, different values — that is what lets one
   component library serve both apps.
   ============================================================ */

:root {
  /* -- grounds ------------------------------------------------ */
  --bg:        #0E0F11;   /* the page */
  --surf:      #16181C;   /* cards, panels, the rail */
  --raise:     #1C1F24;   /* inset fields, table headers */
  --over:      #22262C;   /* overlays: menus, modals, toasts */

  /* -- ink ---------------------------------------------------- */
  --ink:       #F2F4F7;   /* 17.40 on --bg */
  --ink-2:     #9BA3AF;   /*  7.54 */
  --ink-3:     #6B7280;   /*  3.97 — meta only, never body copy */

  /* -- rules (decorative only: 1.20 and 1.53, never load-bearing) */
  --rule:      #24282E;
  --rule-2:    #333941;

  /* -- accent ------------------------------------------------- */
  --accent:    #29ABE2;   /*  7.32 */
  --accent-h:  #4FBEEA;
  --accent-t:  rgba(41,171,226,0.14);   /* tint fill */
  --accent-b:  rgba(41,171,226,0.34);   /* tint border */

  /* -- status ------------------------------------------------- */
  --ok:        #34C77B;   /*  8.77 */
  --warn:      #E8A33C;   /*  8.89 */
  --bad:       #F0616D;   /*  6.06 */
  --ok-t:      rgba(52,199,123,0.13);
  --warn-t:    rgba(232,163,60,0.13);
  --bad-t:     rgba(240,97,109,0.13);

  /* -- THE RULE THAT IS EASY TO GET WRONG --------------------- *
   * Text on a filled accent / ok / warn / bad swatch is
   * NEAR-BLACK, not white. White on #29ABE2 is 2.62:1 and fails.
   * Near-black on it is 7.32:1. In the portal this flips.        */
  --on-fill:   #0E0F11;

  /* -- placeholder imagery ------------------------------------ *
   * Only for design boards and empty media slots. Never chrome. */
  --ph-from:   #2A3542;
  --ph-to:     #1A222C;

  /* -- type --------------------------------------------------- */
  --font-head: 'Montserrat', system-ui, sans-serif;
  --font-body: 'Open Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --t-display:  21px;  --t-display-lh:  26px;
  --t-title:    15px;  --t-title-lh:    21px;
  --t-body:     13px;  --t-body-lh:     19px;
  --t-small:    12px;  --t-small-lh:    17px;
  --t-meta:     11px;  --t-meta-lh:     16px;
  --t-eyebrow:  10px;  --t-eyebrow-ls: .10em;

  /* -- radius ------------------------------------------------- */
  --r-control:  4px;
  --r-card:     6px;
  --r-modal:    8px;
  --r-badge:    3px;
  --r-pill:     999px;

  /* -- spacing: a 4px scale. No other values. ----------------- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;

  /* -- density: HQ is COMPACT (the portal is comfortable) ----- */
  --h-row:      32px;   /* table row */
  --h-head:     30px;   /* table header */
  --h-control:  32px;   /* button, field, select */
  --h-control-s:28px;
  --h-topbar:   52px;
  --w-rail:     200px;

  /* -- elevation ---------------------------------------------- */
  --shadow-over: 0 18px 44px rgba(0,0,0,.62), 0 2px 8px rgba(0,0,0,.45);

  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

/* ============================================================ base */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--t-body-lh);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }

/* Every interactive element gets the same visible focus ring.
   Rules are 1.2:1 and decorative, so focus can never rely on them. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r-control);
}

.h    { font-family: var(--font-head); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.eyebrow {
  font-family: var(--font-head); font-weight: 700;
  font-size: var(--t-eyebrow); letter-spacing: var(--t-eyebrow-ls);
  text-transform: uppercase; color: var(--ink-2); margin: 0;
}

/* ============================================================ surfaces */
.card  { background: var(--surf);  border: 1px solid var(--rule); border-radius: var(--r-card); }
.inset { background: var(--raise); border: 1px solid var(--rule); border-radius: var(--r-control); }

.section { display: flex; align-items: center; gap: var(--s-3); margin: 0 0 var(--s-3); }
.section > .eyebrow { color: var(--ink); }
.section::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* ============================================================ button */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; height: var(--h-control); padding: 0 13px;
  border-radius: var(--r-control);
  font-family: var(--font-head); font-weight: 700; font-size: 12.5px;
  letter-spacing: .01em; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; background: none; color: inherit;
}
.btn--sm { height: var(--h-control-s); padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.btn--primary   { background: var(--accent); border-color: var(--accent); color: var(--on-fill); }
.btn--primary:hover:not([disabled]) { background: var(--accent-h); border-color: var(--accent-h); }
.btn--secondary { background: var(--raise);  border-color: var(--rule-2); color: var(--ink); }
.btn--secondary:hover:not([disabled]) { border-color: var(--ink-3); }
.btn--ghost     { background: transparent; color: var(--ink-2); }
.btn--ghost:hover:not([disabled]) { color: var(--ink); background: var(--raise); }
.btn--tint      { background: var(--accent-t); border-color: var(--accent-b); color: var(--accent-h); }
.btn--ok        { background: var(--ok); border-color: var(--ok); color: var(--on-fill); }
.btn--danger    { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn--danger:hover:not([disabled]) { background: var(--bad-t); }

/* ============================================================ badge */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 7px; border-radius: var(--r-badge);
  font-family: var(--font-mono); font-weight: 600;
  font-size: 10.5px; letter-spacing: .05em; white-space: nowrap;
  background: var(--raise); color: var(--ink-2);
}
.badge__dot { width: 5px; height: 5px; border-radius: 3px; background: currentColor; flex-shrink: 0; }
.badge--ok   { background: var(--ok-t);   color: var(--ok); }
.badge--warn { background: var(--warn-t); color: var(--warn); }
.badge--bad  { background: var(--bad-t);  color: var(--bad); }
.badge--info { background: var(--accent-t); color: var(--accent-h); }

/* ============================================================ field */
.field { display: block; min-width: 0; }
.field > .eyebrow { margin: 0 0 5px; }
.field__box {
  height: var(--h-control); display: flex; align-items: center;
  background: var(--raise); border: 1px solid var(--rule);
  border-radius: var(--r-control);
}
.field__box:focus-within { border-color: var(--accent-b); box-shadow: var(--focus); }
.field__input {
  flex: 1; min-width: 0; padding: 0 10px; background: none; border: 0;
  color: var(--ink); font: inherit; outline: none;
}
.field__input::placeholder { color: var(--ink-3); }
.field__suffix { padding-right: 10px; color: var(--ink-2); font-size: var(--t-small); }
.field--sm .field__box { height: 30px; }
.field--mono .field__input { font-family: var(--font-mono); }
.field--invalid .field__box { border-color: var(--bad); }
.field__error { color: var(--bad); font-size: var(--t-meta); margin: 5px 0 0; }

.toggle { width: 30px; height: 17px; border-radius: 9px; background: var(--raise);
  border: 1px solid var(--rule-2); padding: 0 2px; display: inline-flex;
  align-items: center; cursor: pointer; flex-shrink: 0; }
.toggle__knob { width: 13px; height: 13px; border-radius: 7px; background: var(--ink-3); }
.toggle[aria-checked="true"] { background: var(--accent); border-color: var(--accent);
  justify-content: flex-end; }
.toggle[aria-checked="true"] .toggle__knob { background: var(--on-fill); }

/* ============================================================ table */
.dt { width: 100%; border-collapse: collapse; }
.dt th {
  text-align: left; font-family: var(--font-head); font-weight: 700;
  font-size: var(--t-eyebrow); letter-spacing: var(--t-eyebrow-ls);
  text-transform: uppercase; color: var(--ink-2);
  padding: 0 12px; height: var(--h-head);
  background: var(--raise); border-bottom: 1px solid var(--rule);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.dt td {
  padding: 0 12px; height: var(--h-row);
  border-bottom: 1px solid var(--rule);
  font-size: var(--t-body); vertical-align: middle;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0;
}
.dt tr:last-child td { border-bottom: 0; }
.dt tr[aria-selected="true"] td { background: var(--accent-t); }
.dt tr[data-focused="true"] td { box-shadow: inset 0 0 0 1px var(--accent-b); }

.dt__num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================================================ overlays
   Ten kinds. Widths are fixed — a screen does not choose its own. */
.ov { background: var(--over); border: 1px solid var(--rule-2);
      box-shadow: var(--shadow-over); overflow: hidden; }
.ov--menu    { width: auto; max-width: 280px; border-radius: var(--r-card); padding: 5px 0; }
.ov--popover { width: auto; max-width: 360px; border-radius: var(--r-card); }
.ov--confirm { width: 380px; border-radius: var(--r-modal); }
.ov--modal-s { width: 460px; border-radius: var(--r-modal); }
.ov--modal-m { width: 640px; border-radius: var(--r-modal); }
.ov--modal-l { width: 920px; border-radius: var(--r-modal); }
.ov--drawer  { width: 460px; height: 100%; border-radius: 0;
               border: 0; border-left: 1px solid var(--rule); background: var(--surf); }
.ov--sheet   { width: 720px; border-radius: var(--r-modal); }
.ov--palette { width: 640px; border-radius: var(--r-modal); }
.ov--toast   { width: 360px; border-radius: var(--r-card); border-left-width: 3px; }

.ov__head { display: flex; align-items: center; gap: var(--s-3);
  padding: 14px 16px 12px; border-bottom: 1px solid var(--rule); }
.ov__title { font-family: var(--font-head); font-weight: 700; font-size: 13.5px;
  color: var(--ink); margin: 0; }
.ov__body { padding: 16px; }
.ov__foot { display: flex; align-items: center; gap: var(--s-2);
  padding: 12px 16px; border-top: 1px solid var(--rule); background: rgba(0,0,0,.14); }
.ov__foot .btn:first-of-type { margin-left: auto; }

.backdrop { position: fixed; inset: 0; background: rgba(5,6,7,.60); }

.menu__item { display: flex; align-items: center; gap: 9px; height: 30px;
  padding: 0 11px; font-size: 12.5px; color: var(--ink); white-space: nowrap; cursor: pointer; }
.menu__item:hover, .menu__item[data-active="true"] { background: var(--accent-t); }
.menu__item--danger { color: var(--bad); }
.menu__item[aria-disabled="true"] { color: var(--ink-3); cursor: default; height: 38px; }
.menu__item[aria-disabled="true"]:hover { background: none; }
.menu__reason { display: block; font-size: var(--t-meta); color: var(--ink-3); margin-top: 1px; }
.menu__key { margin-left: auto; padding-left: 18px; font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-3); }
.menu__sep { height: 1px; background: var(--rule); margin: 5px 0; }

.kbd { display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-badge);
  background: var(--raise); border: 1px solid var(--rule-2); color: var(--ink);
  font-family: var(--font-mono); font-size: 10.5px; }

/* ============================================================ states */
.skeleton { background: var(--raise); border-radius: var(--r-badge); }
.skeleton--row { height: var(--h-row); }   /* the REAL row height, so nothing reflows */

.empty { padding: 40px; text-align: center; }
.empty__title { font-family: var(--font-head); font-weight: 700; font-size: 13.5px;
  color: var(--ink); margin: 0; }
.empty__body  { font-size: var(--t-small); color: var(--ink-3);
  margin: 6px auto 14px; max-width: 380px; line-height: var(--t-small-lh); }

.banner { display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border-radius: var(--r-control);
  border: 1px solid rgba(255,255,255,.07); font-size: var(--t-small);
  line-height: var(--t-small-lh); color: var(--ink-2); }
.banner--info { background: var(--accent-t); }
.banner--ok   { background: var(--ok-t); }
.banner--warn { background: var(--warn-t); }
.banner--bad  { background: var(--bad-t); }

/* ============================================================ shell */
.rail { width: var(--w-rail); flex-shrink: 0; background: var(--surf);
  border-right: 1px solid var(--rule); display: flex; flex-direction: column;
  padding: 14px 0; }
.rail__item { display: flex; align-items: center; gap: 10px; height: var(--h-control);
  padding: 0 12px; margin: 0 var(--s-2); border-radius: var(--r-control);
  font-family: var(--font-head); font-weight: 600; font-size: 12.5px;
  color: var(--ink-2); text-decoration: none; }
.rail__item:hover { background: var(--raise); color: var(--ink); }
.rail__item[aria-current="page"] { background: var(--accent-t); color: var(--ink); font-weight: 700; }

.topbar { height: var(--h-topbar); flex-shrink: 0; display: flex; align-items: center;
  gap: 14px; padding: 0 var(--s-5); background: var(--surf);
  border-bottom: 1px solid var(--rule); }

.tabs { display: flex; align-items: flex-end; gap: 2px;
  border-bottom: 1px solid var(--rule); margin: 0 0 14px; }
.tab { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border-bottom: 2px solid transparent; font-family: var(--font-head);
  font-weight: 600; font-size: 12.5px; color: var(--ink-2);
  white-space: nowrap; cursor: pointer; }
.tab[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 700; }

/* ============================================================ print */
@media print {
  body { background: #fff; color: #000; }
  .rail, .topbar, .ov, .backdrop { display: none !important; }
}

/* Respect the OS. Every transition in the app is decorative. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
