/* ============================================================
   CMC tools kit (FEAT-104) — the ONE shared stylesheet every CMC tool loads.
   Served by common/ui/kit.py at <app>/_kit/kit.css; fonts and brand imagery
   come from cmc-design/assets through the same route (/_kit/assets/...).
   Ported from the approved l5 mockup (scratch/design-revamp/l5-color); the
   contract is cmc-design/TOOLS_KIT.md + scratch/design-revamp/RULES.md:
   every rule is a .k- class; every colour is a --k- custom property declared
   on .k-app (the <html> element, so rem follows its size); weights 400/600/700;
   no text under 13px; no one-edge stripes. Breakpoints 768px (the full sidebar beside the page),
   1100px (wider gutters), 1920px (the whole UI scales up); short = max-height 800px.
   ============================================================ */

/* ---------- self-hosted brand fonts (cmc-design/assets/fonts) ---------- */

/* Nunito 400 latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/nunito-latin-ext-XRXV3I6Li01BKofIO-aBXso.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Nunito 400 latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/nunito-latin-XRXV3I6Li01BKofINeaB.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Nunito 600 latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(assets/fonts/nunito-latin-ext-XRXV3I6Li01BKofIO-aBXso.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Nunito 600 latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(assets/fonts/nunito-latin-XRXV3I6Li01BKofINeaB.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Nunito 700 latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(assets/fonts/nunito-latin-ext-XRXV3I6Li01BKofIO-aBXso.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Nunito 700 latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(assets/fonts/nunito-latin-XRXV3I6Li01BKofINeaB.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Orbitron 700 latin */
@font-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(assets/fonts/orbitron-latin-yMJMMIlzdpvBhQQL_SC3X9yhF25-T1ny_CmBoWgz.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.k-app {
  --k-charcoal: #3f3f3f;
  --k-leaf: #7fb050;
  --k-lime: #99ca3c;
  --k-orange: #f68e1e;
  --k-mist: #e5e6e5;
  --k-cream: #faf7f2;
  --k-ink: #1f1f1f;
  --k-white: #ffffff;
  --k-orange-700: #b8651a;                    /* focus ring: 3.9:1 on white */
  --k-orange-hover: #f79b39;
  --k-orange-100: #fdebd6;
  --k-orange-900: #8a5210;
  --k-leaf-100: #e3eed8;
  --k-leaf-hover: #8cbb5f;
  --k-leaf-900: #4c6a30;
  --k-lime-100: #edf5da;
  --k-lime-hover: #a6d152;
  --k-charcoal-80: #5f5f5f;
  --k-charcoal-60: #8c8c8c;
  --k-mist-50: #eef0ec;
  --k-mist-25: #f5f6f4;
  --k-white-75: rgba(255, 255, 255, 0.75);
  --k-white-12: rgba(255, 255, 255, 0.12);

  --k-bg: var(--k-mist-50);
  --k-surface: var(--k-white);
  --k-row-bg: var(--k-mist-25);
  --k-fg-1: var(--k-charcoal);
  --k-fg-2: var(--k-charcoal-80);
  --k-fg-3: var(--k-charcoal-60);
  --k-on-accent: var(--k-ink);               /* text on orange/leaf/lime: ink in every theme */
  --k-fg-strong: var(--k-ink);               /* headings + strong text: light in dark mode */
  --k-on-dark: var(--k-white);
  --k-focus: var(--k-orange-700);
  --k-border: rgba(63, 63, 63, 0.10);
  --k-border-strong: rgba(63, 63, 63, 0.22);
  --k-scrim: rgba(31, 31, 31, 0.66);          /* proven floor: white text 4.5:1 over a white pixel */
  --k-photo-fallback: var(--k-leaf);

  --k-r-card: 1.25rem; --k-r-inner: 0.875rem; --k-r-pill: 625rem;
  --k-shadow: 0 0.375rem 1.25rem rgba(63, 63, 63, .07), 0 0.0625rem 0.1875rem rgba(63, 63, 63, .05);

  --k-font-display: 'Orbitron', 'Arial Black', system-ui, sans-serif;
  --k-font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --k-side-w: 16.5rem;
  --k-gap-edge: 1rem;
  --k-bar-h: 4.25rem;
  --k-topbar-h: 3.75rem;      /* phone top bar, notch inset excluded; the review cockpit's sticky offset reads it */
  --k-content-max: 110rem;
  --k-section-gap: 1.75rem;
  --k-shadow-pop: 0 0.75rem 2.5rem rgba(31, 31, 31, .18), 0 0.125rem 0.375rem rgba(31, 31, 31, .08);
  --k-dur: .28s;
  --k-ease: var(--k-dur) cubic-bezier(.2, .7, .2, 1);

  /* sidebar surface (the charcoal theme swaps these; see the end of this file) */
  --k-side-bg: var(--k-surface);
  --k-side-fg: var(--k-fg-1);
  --k-side-fg-2: var(--k-fg-2);
  --k-side-hover: var(--k-bg);
  --k-side-ink: var(--k-fg-strong);
}

/* ---------- base (opt-in root on <html>) ---------- */
.k-app, .k-app * { box-sizing: border-box; }
.k-app {
  font-family: var(--k-font-body); font-size: 100%; line-height: 1.5; font-weight: 400;
  color: var(--k-fg-1); background: var(--k-bg);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
/* big screens: the whole UI grows from 16px at 1920 to 25.6px at 3840 (1.6x), capped at 26px */
@media (min-width: 1920px) { .k-app { font-size: clamp(16px, 0.5vw + 6.4px, 26px); } }
.k-body { margin: 0; }
.k-app :focus-visible { outline: 0.1875rem solid var(--k-focus); outline-offset: 0.125rem; }
.k-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.k-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.k-ico {
  width: 1.25rem; height: 1.25rem; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.k-ico-sm { width: 1rem; height: 1rem; }
.k-summary { list-style: none; cursor: pointer; }
.k-summary::-webkit-details-marker { display: none; }

/* solid accent fills (icon chips, count badges) and soft tints */
.k-fill-orange { background: var(--k-orange); color: var(--k-on-accent); }
.k-fill-leaf { background: var(--k-leaf); color: var(--k-on-accent); }
.k-fill-lime { background: var(--k-lime); color: var(--k-on-accent); }
.k-fill-charcoal { background: var(--k-charcoal); color: var(--k-on-dark); }
.k-tint-orange { background: var(--k-orange-100); }
.k-tint-leaf { background: var(--k-leaf-100); }
.k-tint-lime { background: var(--k-lime-100); }
.k-tint-charcoal { background: var(--k-mist); }

/* ---------- shell ---------- */
.k-shell { padding: 1rem 1rem calc(var(--k-bar-h) + env(safe-area-inset-bottom) + 1.5rem); }
.k-main { min-width: 0; width: 100%; max-width: var(--k-content-max); margin: 0 auto; }
.k-side { display: none; }

/* phone top bar: clears the notch and the landscape side insets */
.k-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: calc(0.5rem + env(safe-area-inset-top)) calc(0.625rem + env(safe-area-inset-right)) 0.5rem calc(0.875rem + env(safe-area-inset-left));
  min-height: calc(var(--k-topbar-h) + env(safe-area-inset-top));
  background: var(--k-surface);
  border-radius: 0 0 var(--k-r-card) var(--k-r-card); box-shadow: var(--k-shadow);
}
.k-topbar-brand {
  display: flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; min-width: 0;
  color: var(--k-fg-strong); text-decoration: none; border-radius: var(--k-r-pill); padding-right: 0.5rem;
}
.k-logo { display: block; height: 2.25rem; width: auto; flex: none; }   /* 257x336: sized by height only */
.k-topbar .k-logo { height: 2rem; }
.k-wordmark { font-family: var(--k-font-display); font-weight: 700; font-size: 0.9375rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.k-menu-btn {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border-radius: var(--k-r-pill); background: var(--k-bg); color: var(--k-fg-1);
}
.k-menu[open] .k-menu-btn { background: var(--k-orange); color: var(--k-on-accent); }
.k-menu-panel {
  position: absolute; right: calc(0.625rem + env(safe-area-inset-right)); top: calc(4rem + env(safe-area-inset-top));
  width: min(21.25rem, calc(100vw - 1.25rem));
  max-height: calc(100vh - 4rem - env(safe-area-inset-top) - var(--k-bar-h) - env(safe-area-inset-bottom) - 1rem); overflow-y: auto;
  background: var(--k-surface); border-radius: var(--k-r-card); box-shadow: var(--k-shadow); padding: 0.625rem;
}

/* phone bottom tab bar: equal columns, clears the home indicator and side insets */
.k-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--k-bar-h) + env(safe-area-inset-bottom));
  padding: 0.5rem calc(0.625rem + env(safe-area-inset-right)) calc(0.5rem + env(safe-area-inset-bottom)) calc(0.625rem + env(safe-area-inset-left));
  background: var(--k-surface); border-radius: var(--k-r-card) var(--k-r-card) 0 0; box-shadow: var(--k-shadow);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.25rem;
}
.k-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem;
  min-height: 2.75rem; min-width: 0; border-radius: 1rem; color: var(--k-fg-2); text-decoration: none;
  font-size: 0.8125rem; font-weight: 600; line-height: 1.15; text-align: center;
}
.k-tab-text { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-tab[aria-current="page"] { background: var(--k-orange); color: var(--k-on-accent); font-weight: 700; }

/* ---------- navigation (sidebar + phone menu share the same item markup) ---------- */
.k-nav { flex: none; }
.k-nav-heading { margin: 0.75rem 0.875rem 0.25rem; font-size: 0.8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--k-side-fg-2); }
.k-nav-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.125rem; }
.k-nav-item {
  display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; padding: 0.5625rem 0.875rem;
  border-radius: var(--k-r-pill); color: var(--k-side-fg); text-decoration: none; font-size: 0.9375rem; font-weight: 600; line-height: 1.25;
}
.k-nav-item .k-ico { color: var(--k-side-fg-2); }
.k-nav-item:hover { background: var(--k-side-hover); }
.k-nav-item[aria-current="page"] { background: var(--k-orange); color: var(--k-on-accent); font-weight: 700; }
.k-nav-item[aria-current="page"] .k-ico { color: var(--k-on-accent); }
.k-nav-item[aria-current="page"]:hover { background: var(--k-orange-hover); }
.k-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-nav-pill {
  flex: none; padding: 0.0625rem 0.5rem; border-radius: var(--k-r-pill); background: var(--k-orange);
  color: var(--k-on-accent); font-size: 0.8125rem; font-weight: 700; line-height: 1.4;
}
.k-nav-item[aria-current="page"] .k-nav-pill { background: var(--k-ink); color: var(--k-on-dark); }
/* the current tool's own pages (install_shell(subnav=...)): indented under its entry; the
   tool keeps the solid pill, the page you are on gets a lighter orange-edged chip */
.k-subnav { list-style: none; margin: 0.125rem 0 0.25rem 2.25rem; padding: 0 0 0 0.5rem; display: grid; gap: 0.0625rem; border-left: 0.0625rem solid var(--k-side-hover); }
.k-subnav-item {
  display: block; padding: 0.375rem 0.75rem; border-radius: var(--k-r-pill); color: var(--k-side-fg-2); text-decoration: none;
  font-size: 0.875rem; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.k-subnav-item:hover { background: var(--k-side-hover); color: var(--k-side-fg); }
.k-subnav-item[aria-current="page"] { background: var(--k-side-hover); color: var(--k-side-ink); font-weight: 700; box-shadow: inset 0.1875rem 0 0 var(--k-orange); }
/* collapsible REPORTS group */
.k-navgroup-sum {
  display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; margin-top: 0.5rem; padding: 0.5625rem 0.875rem;
  border-radius: var(--k-r-pill); font-size: 0.8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--k-side-fg-2);
}
.k-navgroup-sum:hover { background: var(--k-side-hover); }
.k-navgroup-sum .k-nav-label { flex: 1; }
.k-navgroup-ico { display: none; }
.k-navgroup-chev { display: flex; transition: transform .15s; }
.k-navgroup[open] .k-navgroup-chev { transform: rotate(180deg); }
.k-navgroup-count { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0; color: var(--k-side-fg-2); }

/* the phone menu adds an account block at the bottom */
.k-menu-account { margin-top: 0.5rem; padding-top: 0.5rem; display: grid; gap: 0.125rem; background: var(--k-surface); }
.k-menu-who { display: flex; align-items: center; gap: 0.625rem; margin: 0; padding: 0.5rem 0.875rem; border-radius: var(--k-r-inner); background: var(--k-bg); font-weight: 700; }

/* ---------- sidebar (>=768: the full sidebar beside the page) ---------- */
@media (min-width: 768px) {
  .k-topbar, .k-tabbar { display: none; }
  .k-shell {
    display: grid; grid-template-columns: var(--k-side-cur) minmax(0, 1fr); align-items: start;
    gap: 1.5rem; padding: var(--k-gap-edge) 1.5rem 3rem var(--k-gap-edge);
  }
  .k-side {
    display: flex; flex-direction: column; gap: 0.375rem;
    position: sticky; top: var(--k-gap-edge);
    height: calc(100vh - 2 * var(--k-gap-edge));
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
    padding: 0.75rem; background: var(--k-side-bg); color: var(--k-side-fg); border-radius: var(--k-r-card); box-shadow: var(--k-shadow);
  }
  .k-side .k-nav-item, .k-side .k-navgroup-sum { min-height: 2.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
}
@media (min-width: 1100px) {
  .k-shell { grid-template-columns: var(--k-side-cur) minmax(0, 1fr); gap: 2rem; padding-right: 2.5rem; }
}

.k-brand {
  display: flex; align-items: center; gap: 0.75rem; min-height: 3.25rem; padding: 0.5rem 0.75rem; flex: none;
  border-radius: var(--k-r-inner); color: var(--k-side-ink); text-decoration: none;
}

.k-user { margin-top: auto; flex: none; position: relative; padding-top: 0.5rem; }
.k-user-btn {
  display: flex; align-items: center; gap: 0.625rem; min-height: 3.25rem;
  padding: 0.375rem 0.75rem 0.375rem 0.375rem; border-radius: var(--k-r-pill); background: var(--k-side-hover); color: var(--k-side-fg); font-weight: 700;
}
.k-user[open] .k-user-btn { background: var(--k-orange-100); color: var(--k-fg-strong); }
.k-avatar {
  width: 2.5rem; height: 2.5rem; flex: none; display: grid; place-items: center; border-radius: var(--k-r-pill);
  background: var(--k-charcoal); color: var(--k-on-dark); font-size: 0.875rem; font-weight: 700; letter-spacing: .02em;
}
.k-user-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }
.k-user-role { font-size: 0.8125rem; font-weight: 600; color: var(--k-side-fg-2); }
.k-user[open] .k-user-role { color: var(--k-fg-2); }
.k-user-chev { display: flex; color: var(--k-side-fg-2); }
/* fixed, so the sidebar's own scroll box never clips it; scrolls itself on a short screen */
.k-user-panel {
  position: fixed; z-index: 40; bottom: calc(var(--k-gap-edge) + 4rem); left: calc(var(--k-gap-edge) + 0.75rem);
  width: 14rem; max-height: calc(100vh - 2 * var(--k-gap-edge) - 4rem); overflow: auto;
  padding: 0.5rem; background: var(--k-surface); border-radius: var(--k-r-card);
  box-shadow: var(--k-shadow), 0 0 0 1px var(--k-border);
}

/* ---------- page header ---------- */
.k-pagehead {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 0.75rem 1.5rem; margin: 0 0 1.25rem;
}
.k-pagehead-text { min-width: 0; flex: 1 1 20rem; }
.k-crumbs-list { list-style: none; margin: 0 0 0.125rem -0.5rem; padding: 0; display: flex; flex-wrap: wrap; align-items: center; font-size: 0.875rem; }
.k-crumb { display: flex; align-items: center; }
.k-crumb-sep { display: flex; color: var(--k-fg-3); }
.k-crumb-link {
  display: inline-flex; align-items: center; min-height: 2.75rem; min-width: 2.75rem; padding: 0 0.5rem;
  border-radius: var(--k-r-pill); color: var(--k-fg-2); font-weight: 600; text-decoration: none;
}
.k-crumb-link:hover { background: var(--k-surface); color: var(--k-fg-1); }
.k-crumb-current { padding: 0 0.5rem; font-weight: 700; color: var(--k-fg-1); }
.k-title {
  margin: 0; font-family: var(--k-font-display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; font-size: 1.375rem; line-height: 1.25; color: var(--k-fg-strong); overflow-wrap: anywhere;
}
.k-sub { margin: 0.375rem 0 0; color: var(--k-fg-2); font-size: 0.9375rem; }
.k-pagehead-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem 1rem; }
@media (min-width: 768px) {
  .k-title { font-size: 1.75rem; }
  .k-pagehead { margin-bottom: 1.5rem; }
  .k-crumb-link { min-height: 2.125rem; }
}

/* ---------- buttons, inputs, chips, badges ---------- */
.k-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem;
  padding: 0.625rem 1.25rem; border-radius: var(--k-r-pill); border: 1px solid var(--k-border-strong);
  background: var(--k-surface); color: var(--k-fg-1); font: inherit; font-size: 0.9375rem; font-weight: 700;
  line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.k-btn:hover { background: var(--k-bg); }
.k-btn-primary { background: var(--k-orange); border-color: var(--k-orange); color: var(--k-on-accent); }
.k-btn-primary:hover { background: var(--k-orange-hover); }
.k-btn-quiet { border-color: transparent; background: var(--k-bg); }
.k-btn-quiet:hover { background: var(--k-mist); }
.k-file-input:focus-visible + .k-btn { outline: 0.1875rem solid var(--k-focus); outline-offset: 0.125rem; }
@media (min-width: 1100px) { .k-btn { min-height: 2.5rem; } }

.k-input {
  width: 100%; min-height: 3rem; padding: 0.625rem 1rem; border-radius: var(--k-r-pill);
  border: 1px solid transparent; background: var(--k-surface); color: var(--k-fg-1);
  font: inherit; font-size: 1rem; line-height: 1.3; box-shadow: var(--k-shadow);   /* 16px: no iOS zoom */
}
.k-input:hover { border-color: var(--k-border-strong); }
@media (min-width: 768px) { .k-input { font-size: 0.9375rem; min-height: 2.75rem; } }

.k-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.k-chip {
  min-height: 2.75rem; min-width: 2.75rem; padding: 0.5rem 1rem; border-radius: var(--k-r-pill);
  border: 1px solid transparent; background: var(--k-surface); color: var(--k-fg-1);
  font: inherit; font-size: 0.875rem; font-weight: 700; cursor: pointer;
}
.k-chip:hover { border-color: var(--k-border-strong); }
.k-chip[aria-pressed="true"] { background: var(--k-charcoal); color: var(--k-on-dark); }
@media (min-width: 1100px) { .k-chip { min-height: 2.375rem; } }

.k-badge {
  display: inline-flex; align-items: center; gap: 0.3125rem; padding: 0.125rem 0.625rem; border-radius: var(--k-r-pill);
  font-size: 0.8125rem; font-weight: 700; line-height: 1.4; white-space: nowrap; letter-spacing: .02em;
}
.k-badge-dev { background: var(--k-lime-100); color: var(--k-leaf-900); }
.k-badge-pinned { background: var(--k-orange); color: var(--k-on-accent); }
.k-badge-new { background: var(--k-lime); color: var(--k-on-accent); }
.k-aud-everyone { background: var(--k-charcoal); color: var(--k-on-dark); }
.k-aud-team { background: var(--k-leaf-100); color: var(--k-leaf-900); }

/* ---------- cards + sections ---------- */
.k-card { background: var(--k-surface); border-radius: var(--k-r-card); box-shadow: var(--k-shadow); padding: 1.25rem; }
.k-block { margin-top: var(--k-section-gap); }
.k-block-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.625rem; margin: 0 0 0.75rem; }
.k-h2 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--k-fg-strong); }
.k-count { font-size: 0.875rem; font-weight: 700; color: var(--k-fg-2); }
.k-more {
  margin-left: auto; display: inline-flex; align-items: center; gap: 0.25rem; min-height: 2.75rem; padding: 0 0.75rem;
  border-radius: var(--k-r-pill); color: var(--k-orange-900); font-size: 0.9375rem; font-weight: 700; text-decoration: none;
}
.k-more:hover { background: var(--k-orange-100); }
.k-hint { margin: 0; font-size: 0.875rem; color: var(--k-fg-2); line-height: 1.4; }
@media (min-width: 768px) { .k-card { padding: 1.5rem; } .k-more { min-height: 2.25rem; } }

/* ---------- home: banner variant ---------- */
.k-banner { position: relative; height: 11rem; border-radius: var(--k-r-card); overflow: hidden; box-shadow: var(--k-shadow); }
.k-banner-photo {
  position: absolute; inset: 0;
  background-color: var(--k-photo-fallback); background-size: cover; background-position: center 45%;
}
/* one class per brand photo (no inline styles under the CSP); the portal picks one per month */
.k-photo-blood-oranges { background-image: url("assets/imagery/blood-oranges.webp"); }
.k-photo-grapefruit { background-image: url("assets/imagery/grapefruit.webp"); }
.k-photo-lemons { background-image: url("assets/imagery/lemons.webp"); }
/* mandarins: the query names this photo so a browser holding an older file under the same name
   fetches it again; the fruit hangs low in the frame, so its band sits lower than the shared 45% */
.k-photo-mandarins { background-image: url("assets/imagery/mandarins.webp?v=sumo"); background-position: center 65%; }
.k-photo-navel-oranges { background-image: url("assets/imagery/navel-oranges.webp"); }
.k-photo-tangerines { background-image: url("assets/imagery/tangerines.webp"); }
.k-photo-the-fishers { background-image: url("assets/imagery/the-fishers.webp"); }
.k-banner-scrim {
  position: absolute; left: 0.75rem; bottom: 0.75rem; max-width: calc(100% - 1.5rem);
  padding: 0.75rem 1.25rem; border-radius: var(--k-r-inner); background: var(--k-scrim); color: var(--k-on-dark);
}
.k-banner-date { margin: 0; font-size: 0.9375rem; font-weight: 600; }
.k-banner-title { margin: 0; font-size: 1.625rem; font-weight: 700; line-height: 1.2; }
@media (min-width: 768px) {
  .k-banner { height: 13rem; }
  .k-banner-scrim { left: 1.25rem; bottom: 1.25rem; padding: 1rem 1.75rem; }
  .k-banner-title { font-size: 2.125rem; }
}

/* ---------- home: news variant ---------- */
.k-hello { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; margin: 0 0 1rem; }
.k-hello-title { margin: 0; font-size: 1.625rem; font-weight: 700; line-height: 1.2; color: var(--k-fg-strong); }
.k-hello-date { margin: 0; font-size: 1rem; font-weight: 600; color: var(--k-fg-2); }
@media (min-width: 768px) { .k-hello-title { font-size: 2rem; } }

/* ---------- needs you ---------- */
.k-needs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.k-need {
  display: flex; align-items: center; gap: 0.875rem; height: 100%; padding: 1rem 1.125rem;
  background: var(--k-surface); border-radius: var(--k-r-card); box-shadow: var(--k-shadow);
  color: var(--k-fg-1); text-decoration: none;
}
.k-need:hover { background: var(--k-row-bg); }
.k-need-count {
  flex: none; min-width: 3rem; height: 3rem; padding: 0 0.5rem; display: grid; place-items: center;
  border-radius: var(--k-r-inner); font-size: 1.5rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.k-need-body { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.k-need-text { font-weight: 700; color: var(--k-fg-strong); }
.k-need-tool { font-size: 0.875rem; font-weight: 600; color: var(--k-fg-2); margin-top: 0.125rem; }
.k-need-go { display: flex; color: var(--k-fg-3); }
@media (min-width: 768px) { .k-needs { grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr)); } }

/* ---------- icon chips (solid fills come from .k-fill-*) ---------- */
.k-chipico { width: 3rem; height: 3rem; flex: none; display: grid; place-items: center; border-radius: var(--k-r-inner); }
.k-chipico-sm { width: 2.25rem; height: 2.25rem; border-radius: 0.6875rem; }
.k-chipico-sm .k-ico { width: 1.125rem; height: 1.125rem; }

/* ---------- latest announcements (home rows) ---------- */
.k-annrows { list-style: none; margin: 0; padding: 0.5rem; display: grid; gap: 0.25rem; }
.k-annrow {
  display: flex; align-items: center; gap: 0.875rem; min-height: 3.75rem; padding: 0.625rem 0.75rem;
  border-radius: var(--k-r-inner); color: var(--k-fg-1); text-decoration: none;
}
.k-annrow:hover { background: var(--k-row-bg); }
.k-annrow-body { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.k-annrow-title { font-weight: 700; color: var(--k-fg-strong); }
.k-annrow-meta { font-size: 0.875rem; color: var(--k-fg-2); }
.k-annrow-go { display: flex; color: var(--k-fg-3); }

/* ---------- tools ---------- */
.k-tools { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.k-tool {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 0.875rem; align-items: center;
  height: 100%; padding: 1rem 1.125rem; background: var(--k-surface); border-radius: var(--k-r-card); box-shadow: var(--k-shadow);
  color: var(--k-fg-1); text-decoration: none;
}
.k-tool:hover { background: var(--k-row-bg); }
.k-tool .k-chipico { grid-row: span 2; }
.k-tool-name { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-weight: 700; color: var(--k-fg-strong); align-self: end; line-height: 1.3; }
.k-tool-desc { font-size: 0.875rem; color: var(--k-fg-2); align-self: start; line-height: 1.4; }
@media (min-width: 768px) { .k-tools { grid-template-columns: repeat(auto-fill, minmax(16.25rem, 1fr)); } }
@media (min-width: 1100px) {
  .k-tools { grid-template-columns: repeat(auto-fill, minmax(13.75rem, 1fr)); gap: 1rem; }
  .k-tool { grid-template-columns: 1fr; grid-template-rows: auto; row-gap: 0.25rem; align-items: start; padding: 1.25rem; }
  .k-tool .k-chipico { grid-row: auto; margin-bottom: 0.625rem; }
  .k-tool-name { align-self: start; }
}

/* ---------- grouped report rows (home): accent = group chip + tinted header ---------- */
.k-rlist { padding: 0.5rem; }
.k-rgroups { display: grid; gap: 0.5rem 1.5rem; }
.k-rgroup { padding: 0.5rem; }
.k-rgroup-h {
  display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.375rem; padding: 0.375rem 0.875rem 0.375rem 0.375rem;
  border-radius: var(--k-r-inner); font-size: 0.9375rem; font-weight: 700; color: var(--k-fg-strong);
}
.k-rgroup-n { margin-left: auto; font-size: 0.875rem; color: var(--k-fg-2); }
.k-rrows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.k-rrow {
  display: flex; align-items: center; gap: 0.75rem; min-height: 3.5rem; padding: 0.5rem 0.75rem;
  border-radius: var(--k-r-inner); background: var(--k-row-bg); color: var(--k-fg-1); text-decoration: none;
}
.k-rrow:hover { background: var(--k-mist); }
.k-rrow-body { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.k-rrow-name { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-weight: 700; color: var(--k-fg-strong); }
.k-rrow-desc { font-size: 0.875rem; color: var(--k-fg-2); }
.k-rrow-open { display: flex; align-items: center; gap: 0.125rem; flex: none; font-size: 0.875rem; font-weight: 700; color: var(--k-fg-2); }
@media (min-width: 1100px) { .k-rgroups { grid-template-columns: repeat(auto-fill, minmax(23.75rem, 1fr)); } }

/* ---------- announcement cards (home pinned, Announcements, preview) ---------- */
.k-ann {
  display: flex; flex-direction: column; background: var(--k-surface); border-radius: var(--k-r-card);
  box-shadow: var(--k-shadow); overflow: hidden;
}
.k-ann-media { position: relative; flex: none; aspect-ratio: 16 / 7; background: var(--k-photo-fallback); }
.k-ann-img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.k-ann-body { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; padding: 1.125rem 1.25rem 1.25rem; min-width: 0; }
.k-ann-badges { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0; }
.k-ann-title { margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.25; color: var(--k-fg-strong); }
.k-ann-text { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--k-fg-1); max-width: 42em; }
.k-ann-meta { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--k-fg-2); }
.k-attach {
  display: inline-flex; align-items: center; gap: 0.5rem; max-width: 100%; min-height: 2.75rem; margin: 0.25rem 0 0; padding: 0.375rem 1rem;
  border-radius: var(--k-r-pill); background: var(--k-orange-100); color: var(--k-orange-900);
  font-size: 0.875rem; font-weight: 700; text-decoration: none;
}
.k-attach-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.k-attach:hover { background: var(--k-orange); color: var(--k-on-accent); }
@media (min-width: 768px) {
  .k-ann-pin { display: grid; grid-template-columns: 2fr 3fr; }
  .k-ann-pin .k-ann-media { aspect-ratio: auto; min-height: 15rem; }
  .k-ann-pin .k-ann-body { justify-content: center; padding: 1.75rem 2rem; gap: 0.625rem; }
  .k-ann-pin .k-ann-title { font-size: 1.625rem; }
  .k-ann-pin .k-ann-text { font-size: 1.0625rem; }
  .k-attach { min-height: 2.25rem; }
}
.k-pinned { margin: 0; }

/* Announcements page: the rest in a two-column grid from 1100px */
.k-anns { display: grid; gap: 1rem; align-items: stretch; }
/* a posted image on a grid card sits as a square thumbnail beside the text, not a full-width strip */
.k-anns .k-ann-has-img { display: grid; grid-template-columns: minmax(0, 1fr) 5rem; align-items: start; }
@media (min-width: 768px) { .k-anns .k-ann-has-img { grid-template-columns: minmax(0, 1fr) 7.5rem; } }
.k-anns .k-ann-has-img .k-ann-media { order: 2; aspect-ratio: 1; margin: 1.125rem 1.125rem 0 0; border-radius: var(--k-r-inner); overflow: hidden; }
@media (min-width: 1100px) { .k-anns { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; } }

/* ---------- new announcement form ---------- */
.k-compose { display: grid; gap: 1.5rem; align-items: start; }
.k-form { display: grid; gap: 1.375rem; }
.k-field { display: grid; gap: 0.5rem; min-width: 0; margin: 0; }
.k-fieldset { border: 0; padding: 0; }
.k-flabel { margin: 0; padding: 0; font-size: 0.9375rem; font-weight: 700; color: var(--k-fg-strong); }
.k-optional { font-weight: 600; color: var(--k-fg-2); font-size: 0.875rem; }
.k-input-box { border-radius: 0.75rem; box-shadow: none; border-color: var(--k-border-strong); background: var(--k-surface); }
.k-input-box:hover { border-color: var(--k-charcoal-60); }
.k-textarea { min-height: 7.5rem; resize: vertical; line-height: 1.5; }
.k-date { max-width: 14rem; }
.k-upload {
  display: grid; gap: 1rem; padding: 0.75rem; border-radius: var(--k-r-inner);
  border: 1px dashed var(--k-charcoal-60); background: var(--k-row-bg);
}
.k-upload-media { position: relative; aspect-ratio: 16 / 9; border-radius: 0.625rem; overflow: hidden; background: var(--k-photo-fallback); }
.k-upload-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.k-upload-side { display: grid; gap: 0.5rem; align-content: center; }
.k-upload-name { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-weight: 700; color: var(--k-fg-strong); }
.k-upload-size { font-weight: 600; font-size: 0.875rem; color: var(--k-fg-2); }
.k-upload-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (min-width: 768px) { .k-upload { grid-template-columns: 13rem 1fr; } }
.k-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.k-file {
  display: flex; align-items: center; gap: 0.625rem; padding: 0.25rem 0.25rem 0.25rem 1rem; min-width: 0;
  border-radius: var(--k-r-pill); background: var(--k-orange-100); color: var(--k-orange-900); font-weight: 700;
}
.k-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9375rem; }
.k-file-size { flex: none; font-size: 0.875rem; font-weight: 600; color: var(--k-orange-900); }
.k-iconbtn {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: none; padding: 0;
  border: 0; border-radius: var(--k-r-pill); background: transparent; color: var(--k-orange-900); cursor: pointer;
}
.k-iconbtn:hover { background: var(--k-orange); color: var(--k-on-accent); }
.k-addfile { justify-self: start; }

/* segmented radio + team chips + switch + checkbox: native inputs are visually hidden, labels draw the control */
.k-seg { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.25rem; border-radius: var(--k-r-pill); background: var(--k-bg); justify-self: start; }
.k-seg-opt {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.5rem 1.125rem;
  border-radius: var(--k-r-pill); font-size: 0.9375rem; font-weight: 700; color: var(--k-fg-1); cursor: pointer;
}
.k-check-input:checked + .k-seg-opt { background: var(--k-charcoal); color: var(--k-on-dark); }
.k-tchips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.k-tchip {
  display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.75rem; padding: 0.5rem 1rem;
  border-radius: var(--k-r-pill); border: 1px solid var(--k-border-strong); background: var(--k-surface);
  font-size: 0.875rem; font-weight: 700; color: var(--k-fg-1); cursor: pointer;
}
.k-tchip:hover { border-color: var(--k-charcoal-60); }
.k-tchip-tick { display: none; }
.k-check-input:checked + .k-tchip { background: var(--k-leaf); border-color: var(--k-leaf); color: var(--k-on-accent); }
.k-check-input:checked + .k-tchip .k-tchip-tick { display: block; }
.k-check-input:focus-visible + .k-seg-opt, .k-check-input:focus-visible + .k-tchip,
.k-check-input:focus-visible + .k-switch .k-switch-track, .k-check-input:focus-visible + .k-checkrow .k-checkbox {
  outline: 0.1875rem solid var(--k-focus); outline-offset: 0.125rem;
}
@media (min-width: 1100px) { .k-tchip, .k-seg-opt { min-height: 2.375rem; } }

.k-row2 { display: grid; gap: 1.25rem; }
@media (min-width: 768px) { .k-row2 { grid-template-columns: 1fr auto; align-items: end; } }
.k-switch, .k-checkrow { display: flex; align-items: center; gap: 0.875rem; min-height: 2.75rem; cursor: pointer; }
.k-switch-track {
  position: relative; flex: none; width: 3.25rem; height: 1.875rem; border-radius: var(--k-r-pill);
  background: var(--k-charcoal-60); transition: background .15s;
}
.k-switch-knob {
  position: absolute; top: 0.1875rem; left: 0.1875rem; width: 1.5rem; height: 1.5rem; border-radius: var(--k-r-pill);
  background: var(--k-surface); box-shadow: var(--k-shadow); transition: transform .15s;
}
.k-check-input:checked + .k-switch .k-switch-track { background: var(--k-leaf-900); }
.k-check-input:checked + .k-switch .k-switch-knob { transform: translateX(1.375rem); }
.k-switch-text { display: flex; flex-direction: column; line-height: 1.3; }
.k-switch-label { font-weight: 700; color: var(--k-fg-strong); }
.k-checkbox {
  display: grid; place-items: center; flex: none; width: 1.625rem; height: 1.625rem; border-radius: 0.4375rem;
  border: 1px solid var(--k-charcoal-60); background: var(--k-surface); color: transparent;
}
.k-check-input:checked + .k-checkrow .k-checkbox { background: var(--k-leaf-900); border-color: var(--k-leaf-900); color: var(--k-on-dark); }
.k-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.75rem; padding-top: 0.5rem; }
.k-compose-preview { display: grid; gap: 0.5rem; }
.k-compose-preview .k-hint { margin-bottom: 0.5rem; }
@media (min-width: 1100px) {
  .k-compose { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2rem; }
  .k-compose-preview { position: sticky; top: var(--k-gap-edge); }
  .k-compose-preview .k-ann-pin { display: flex; }
  .k-compose-preview .k-ann-pin .k-ann-media { aspect-ratio: 16 / 9; min-height: 0; }
  .k-compose-preview .k-ann-pin .k-ann-body { padding: 1.25rem 1.5rem; }
  .k-compose-preview .k-ann-pin .k-ann-title { font-size: 1.375rem; }
}

/* ---------- display page (shop TVs): its own scale, 20px at 1920 wide, 40px at 3840 ---------- */
.k-app.k-display { font-size: clamp(14px, 1.0417vw, 48px); background: var(--k-bg); }
.k-dshell { max-width: 120rem; margin: 0 auto; padding: 1.25rem 2rem 1rem; display: flex; flex-direction: column; gap: 1.25rem; }
.k-dhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; }
.k-dbrand { display: flex; align-items: center; gap: 1rem; }
.k-dbrand .k-logo { height: 3rem; }
.k-dtitle { margin: 0; font-family: var(--k-font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 1.75rem; line-height: 1.2; color: var(--k-fg-strong); }
.k-dclock { margin: 0; padding: 0.375rem 1.25rem; border-radius: var(--k-r-pill); background: var(--k-charcoal); color: var(--k-on-dark); font-size: 1.25rem; font-weight: 700; }
.k-dmain { display: grid; gap: 1.25rem; }
.k-dpin .k-ann-media { min-height: 21rem; }
.k-dpin .k-ann-body { padding: 2rem 2.5rem; gap: 0.75rem; }
.k-dpin .k-ann-title { font-size: 2.25rem; line-height: 1.15; }
.k-dpin .k-ann-text { font-size: 1.375rem; max-width: 36em; }
.k-display .k-badge { font-size: 1rem; padding: 0.1875rem 0.875rem; }
.k-display .k-ann-meta { font-size: 1rem; }
.k-display .k-attach { font-size: 1rem; min-height: 2.5rem; background: var(--k-orange-100); }
.k-dgrid { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.k-dcard { display: grid; grid-template-columns: minmax(0, 1fr); }
.k-dcard .k-ann-body { padding: 1.375rem 1.5rem; }
.k-dcard .k-ann-title { font-size: 1.375rem; }
.k-dcard .k-ann-text { font-size: 1.0625rem; }
.k-dcard.k-ann-has-img { grid-template-columns: minmax(0, 1fr) 7rem; }
.k-dcard.k-ann-has-img .k-ann-media { order: 2; aspect-ratio: auto; margin: 1.375rem 1.375rem 0 0; height: 7rem; border-radius: var(--k-r-inner); overflow: hidden; }
.k-dfoot { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; font-weight: 600; color: var(--k-fg-2); }
@media (max-width: 900px) { .k-dgrid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- short screens (laptops at <=800px tall) ---------- */
@media (max-height: 800px) and (min-width: 768px) {
  .k-app { --k-section-gap: 1.125rem; }
  .k-shell { padding-top: 0.75rem; padding-bottom: 1.5rem; }
  .k-side { top: 0.75rem; height: calc(100vh - 1.5rem); padding: 0.625rem; }
  .k-side .k-nav-item, .k-side .k-navgroup-sum { min-height: 2.25rem; padding-top: 0.375rem; padding-bottom: 0.375rem; }
  .k-brand { min-height: 2.75rem; padding: 0.25rem 0.625rem; }
  .k-logo { height: 2rem; }
  .k-pagehead { margin-bottom: 0.75rem; gap: 0.5rem 1.25rem; align-items: center; }
  .k-crumb-link { min-height: 1.75rem; }
  .k-title { font-size: 1.5rem; }
  .k-sub { margin-top: 0.125rem; }
  .k-chips { margin-bottom: 0.625rem; }
  .k-card { padding: 1rem 1.25rem; }
  .k-banner { height: 10rem; }
  .k-banner-scrim { padding: 0.75rem 1.5rem; }
  .k-banner-title { font-size: 1.875rem; }
  .k-ann-pin .k-ann-media { min-height: 12rem; }
  .k-ann-pin .k-ann-body { padding: 1.25rem 1.75rem; }
  .k-form { gap: 1rem; }
}

/* ============================================================
   FEAT-104 additions: sidebar hide/show + edge reveal, sidebar theme,
   preview chip, toasts, alerts, auth pages, search, tables-to-cards,
   KPI strip, empty states, reduced motion.
   ============================================================ */
.k-app [hidden] { display: none; }
.k-skip {
  position: absolute; left: 0.75rem; top: -4rem; z-index: 70; padding: 0.625rem 1rem;
  border-radius: var(--k-r-pill); background: var(--k-ink); color: var(--k-on-dark); font-weight: 700; text-decoration: none;
}
.k-skip:focus { top: 0.75rem; }

/* sidebar header row: logo + hide toggle */
.k-brandrow { display: flex; align-items: center; gap: 0.25rem; flex: none; }
.k-brandrow .k-brand { flex: 1; min-width: 0; }
.k-side-toggle, .k-side-show {
  display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; padding: 0;
  border: 0; border-radius: var(--k-r-pill); background: transparent; color: var(--k-side-fg-2); cursor: pointer;
}
.k-side-toggle:hover { background: var(--k-side-hover); color: var(--k-side-fg); }
.k-side-show { display: none; }
.k-edge { display: none; }

/* preview chip: a preview tab can never be mistaken for the live portal */
.k-preview-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; align-self: flex-start;
  margin: 0 0.25rem 0.25rem 0.75rem; padding: 0.125rem 0.75rem; border-radius: var(--k-r-pill);
  background: var(--k-lime); color: var(--k-on-accent); font-size: 0.8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.k-topbar .k-preview-chip { margin: 0; }
/* common/preview.py's strip on a tool page in the preview lane (no inline style under KIT_CSP) */
.k-preview-banner {
  position: sticky; top: 0; z-index: 2147483647; padding: 0.375rem 0.75rem; text-align: center;
  background: #7a1f1f; color: #fff; font-size: 0.8125rem; font-weight: 600; letter-spacing: .02em;
}

/* sub-headings inside the collapsible Reports group */
.k-nav-sub { margin: 0.5rem 0.875rem 0.125rem; font-size: 0.8125rem; font-weight: 700; color: var(--k-side-fg-2); }

/* account panel: theme picker */
.k-themepick { display: grid; gap: 0.375rem; margin-top: 0.375rem; padding: 0.625rem 0.5rem 0.25rem; }
.k-themepick-label { margin: 0 0.375rem; font-size: 0.8125rem; font-weight: 700; color: var(--k-fg-2); }
.k-themepick-opts { display: flex; gap: 0.25rem; padding: 0.25rem; border-radius: var(--k-r-pill); background: var(--k-bg); }
.k-themeopt {
  flex: 1; min-height: 2.75rem; padding: 0.375rem 0.75rem; border: 0; border-radius: var(--k-r-pill);
  background: transparent; color: var(--k-fg-1); font: inherit; font-size: 0.875rem; font-weight: 700; cursor: pointer;
}
.k-themeopt[aria-pressed="true"] { background: var(--k-charcoal); color: var(--k-on-dark); }
@media (min-width: 1100px) { .k-themeopt { min-height: 2.25rem; } }

/* ---------- sidebar: hide / show / edge reveal (>=768 only; phones use the tab bar) ---------- */
@media (min-width: 768px) {
  .k-app { --k-side-cur: var(--k-side-w); }
  .k-shell { transition: grid-template-columns var(--k-ease), column-gap var(--k-ease), padding var(--k-ease); }
  .k-main { grid-column: 2; }
  .k-side { width: var(--k-side-cur); transition: transform var(--k-ease), box-shadow var(--k-ease); }
  .k-app[data-k-side="hidden"] .k-shell { grid-template-columns: 0 minmax(0, 1fr); column-gap: 0; padding-left: 4.5rem; }
  .k-app[data-k-side="hidden"] .k-side {
    position: fixed; left: var(--k-gap-edge); top: var(--k-gap-edge); z-index: 50;
    transform: translateX(calc(-100% - 2 * var(--k-gap-edge))); visibility: hidden;
    transition: transform var(--k-ease), visibility 0s linear var(--k-dur);
  }
  .k-app[data-k-side="hidden"].k-side-peek .k-side {
    transform: none; visibility: visible; box-shadow: var(--k-shadow-pop);
    transition: transform var(--k-ease), visibility 0s;
  }
  .k-app[data-k-side="hidden"] .k-side-show {
    display: grid; position: fixed; left: var(--k-gap-edge); top: var(--k-gap-edge); z-index: 40;
    background: var(--k-surface); color: var(--k-fg-1); box-shadow: var(--k-shadow);
  }
  .k-app[data-k-side="hidden"] .k-side-show:hover { background: var(--k-orange); color: var(--k-on-accent); }
}
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .k-app[data-k-side="hidden"] .k-edge { display: block; position: fixed; left: 0; top: 0; bottom: 0; width: 8px; z-index: 45; }
}

/* ---------- charcoal sidebar theme (a per-person preference) ---------- */
/* only in light mode: explicit Light, or System while the OS is light; dark mode keeps the dark surface */
.k-app[data-k-theme="charcoal"][data-theme="light"] {
  --k-side-bg: var(--k-charcoal); --k-side-fg: var(--k-white); --k-side-fg-2: var(--k-white-75);
  --k-side-hover: var(--k-white-12); --k-side-ink: var(--k-white);
}
.k-app[data-k-theme="charcoal"][data-theme="light"] .k-avatar { background: var(--k-orange); color: var(--k-on-accent); }
@media (prefers-color-scheme: light) {
  .k-app[data-k-theme="charcoal"]:not([data-theme]) {
  --k-side-bg: var(--k-charcoal); --k-side-fg: var(--k-white); --k-side-fg-2: var(--k-white-75);
  --k-side-hover: var(--k-white-12); --k-side-ink: var(--k-white);
}
  .k-app[data-k-theme="charcoal"]:not([data-theme]) .k-avatar { background: var(--k-orange); color: var(--k-on-accent); }
}
/* popups inside or beside the sidebar stay light whatever the theme */
.k-menu-panel, .k-user-panel {
  --k-side-fg: var(--k-fg-1); --k-side-fg-2: var(--k-fg-2); --k-side-hover: var(--k-bg); --k-side-ink: var(--k-ink);
  color: var(--k-fg-1);
}

/* ---------- toasts + alerts ---------- */
.k-toasts {
  position: fixed; z-index: 60; right: calc(1rem + env(safe-area-inset-right)); top: calc(4.75rem + env(safe-area-inset-top));
  display: grid; gap: 0.5rem; max-width: min(26rem, calc(100vw - 2rem));
}
@media (min-width: 768px) { .k-toasts { top: 1rem; } }
.k-toast {
  margin: 0; padding: 0.75rem 1.25rem; border-radius: var(--k-r-inner); background: var(--k-charcoal); color: var(--k-on-dark);
  font-weight: 600; box-shadow: var(--k-shadow-pop); cursor: pointer; transition: opacity .3s, transform .3s;
}
.k-toast-out { opacity: 0; transform: translateY(-0.5rem); }
.k-alert { margin: 0; padding: 0.75rem 1rem; border-radius: var(--k-r-inner); background: var(--k-orange-100); color: var(--k-orange-900); font-weight: 600; }
.k-alert-ok { background: var(--k-leaf-100); color: var(--k-leaf-900); }

/* ---------- standalone pages (sign-in, password, 403): no sidebar ---------- */
.k-authwrap { padding: calc(clamp(1.5rem, 10vh, 6rem) + env(safe-area-inset-top)) 1rem calc(2rem + env(safe-area-inset-bottom)); }
.k-authcard { width: 100%; max-width: 27rem; margin: 0 auto; display: grid; gap: 1.125rem; }
.k-authhead { display: flex; align-items: center; gap: 0.875rem; }
.k-authhead .k-logo { height: 3.25rem; }
.k-authhead .k-title { font-size: 1.375rem; }
.k-authcard .k-sub { margin: 0; }
.k-authcard .k-form { gap: 1rem; }
.k-btn-block { width: 100%; }
.k-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; font-size: 0.9375rem; }
.k-link {
  display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--k-orange-900); font-weight: 700; text-decoration: none;
}
.k-link:hover { text-decoration: underline; }
@media (min-width: 768px) { .k-link { min-height: 2rem; } }

/* ---------- search ---------- */
.k-search { position: relative; width: 100%; max-width: 26rem; }
.k-search .k-ico { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--k-fg-3); pointer-events: none; }
.k-search .k-input { padding-left: 2.875rem; }

/* ---------- empty state ---------- */
.k-empty { padding: 1.5rem; border-radius: var(--k-r-card); background: var(--k-surface); box-shadow: var(--k-shadow); color: var(--k-fg-2); }
.k-empty-title { margin: 0 0 0.25rem; font-weight: 700; color: var(--k-fg-strong); }

/* ---------- KPI strip (a slim strip on short screens) ---------- */
.k-kpis { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
.k-kpi { display: flex; flex-direction: column; gap: 0.125rem; padding: 1rem 1.25rem; background: var(--k-surface); border-radius: var(--k-r-card); box-shadow: var(--k-shadow); }
.k-kpi-n { font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: var(--k-fg-strong); font-variant-numeric: tabular-nums; }
.k-kpi-l { font-size: 0.875rem; font-weight: 600; color: var(--k-fg-2); }

/* ---------- tables that become cards on phones ----------
   Field names are REAL text: one <span class="k-label"> per cell, visually hidden at
   table widths and shown in card mode (never ::before / attr()). */
.k-tablewrap { background: var(--k-surface); border-radius: var(--k-r-card); box-shadow: var(--k-shadow); padding: 0.5rem; }
.k-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9375rem; }
.k-table .k-th { padding: 0.625rem 0.875rem; text-align: left; font-size: 0.8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--k-fg-2); }
.k-table .k-td { padding: 0.75rem 0.875rem; vertical-align: middle; }
.k-table .k-tr:hover .k-td { background: var(--k-row-bg); }
.k-table .k-num { text-align: right; font-variant-numeric: tabular-nums; }
.k-label { font-size: 0.8125rem; font-weight: 700; color: var(--k-fg-2); }
@media (max-width: 767.98px) {
  .k-tablewrap { background: transparent; box-shadow: none; padding: 0; }
  .k-table, .k-table .k-tbody, .k-table .k-tr, .k-table .k-td { display: block; }
  .k-table .k-thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .k-table .k-tr { margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; background: var(--k-surface); border-radius: var(--k-r-card); box-shadow: var(--k-shadow); }
  .k-table .k-td { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.25rem; text-align: right; }
  .k-table .k-td .k-label { text-align: left; }
}
@media (min-width: 768px) {
  .k-table .k-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}

/* ---------- short screens: the KPI strip goes slim ---------- */
@media (max-height: 800px) and (min-width: 768px) {
  .k-kpi { flex-direction: row; align-items: baseline; gap: 0.5rem; padding: 0.5rem 1rem; }
  .k-kpi-n { font-size: 1.25rem; }
  .k-authwrap { padding-top: 1.5rem; }
}

/* ---------- motion: respect the OS setting ---------- */
@media (prefers-reduced-motion: reduce) {
  .k-app { --k-dur: 0s; }   /* every sidebar transition reads --k-dur: instant toggle */
  .k-app .k-shell, .k-app .k-side, .k-app .k-navgroup-chev, .k-app .k-switch-track,
  .k-app .k-switch-knob, .k-app .k-toast { transition: none; }
}

/* ---------- colour theme: System (default, follows the OS) / Light / Dark ----------
   kit-boot.js sets data-theme on <html> from the account-menu choice; no attribute = System.
   Brand accents keep their roles (ink text on orange/leaf/lime chips); tints darken. */
.k-app[data-theme="light"] { color-scheme: light; }
.k-app[data-theme="dark"] {
  color-scheme: dark;
  --k-bg: #161616;
  --k-surface: #222222;
  --k-row-bg: #2a2a2a;
  --k-mist: #333333;
  --k-charcoal: #4a4a4a;
  --k-charcoal-60: #6e6e6e;
  --k-fg-1: #ececec;
  --k-fg-2: #b9b9b9;
  --k-fg-3: #909090;
  --k-fg-strong: #f5f5f5;
  --k-focus: var(--k-orange);                /* 7:1 on the dark surfaces */
  --k-border: rgba(255, 255, 255, 0.10);
  --k-border-strong: rgba(255, 255, 255, 0.24);
  --k-orange-100: #3d2a15;
  --k-orange-900: #f7b46e;
  --k-orange-hover: #f79b39;
  --k-leaf-100: #243220;
  --k-leaf-900: #a8d07e;
  --k-lime-100: #2c351b;
  --k-shadow: 0 0.375rem 1.25rem rgba(0, 0, 0, .35), 0 0.0625rem 0.1875rem rgba(0, 0, 0, .3);
  --k-shadow-pop: 0 0.75rem 2.5rem rgba(0, 0, 0, .55), 0 0.125rem 0.375rem rgba(0, 0, 0, .4);
}
@media (prefers-color-scheme: dark) {
  .k-app:not([data-theme]) {
    color-scheme: dark;
    --k-bg: #161616;
    --k-surface: #222222;
    --k-row-bg: #2a2a2a;
    --k-mist: #333333;
    --k-charcoal: #4a4a4a;
    --k-charcoal-60: #6e6e6e;
    --k-fg-1: #ececec;
    --k-fg-2: #b9b9b9;
    --k-fg-3: #909090;
    --k-fg-strong: #f5f5f5;
    --k-focus: var(--k-orange);                /* 7:1 on the dark surfaces */
    --k-border: rgba(255, 255, 255, 0.10);
    --k-border-strong: rgba(255, 255, 255, 0.24);
    --k-orange-100: #3d2a15;
    --k-orange-900: #f7b46e;
    --k-orange-hover: #f79b39;
    --k-leaf-100: #243220;
    --k-leaf-900: #a8d07e;
    --k-lime-100: #2c351b;
    --k-shadow: 0 0.375rem 1.25rem rgba(0, 0, 0, .35), 0 0.0625rem 0.1875rem rgba(0, 0, 0, .3);
    --k-shadow-pop: 0 0.75rem 2.5rem rgba(0, 0, 0, .55), 0 0.125rem 0.375rem rgba(0, 0, 0, .4);
  }
}

/* theme radio group (account menu) */
.k-modepick { margin: 0; padding: 0.625rem 0.5rem 0.25rem; border: 0; display: grid; gap: 0.375rem; }
.k-modepick-label { margin: 0 0.375rem; padding: 0; font-size: 0.8125rem; font-weight: 700; color: var(--k-fg-2); }
.k-mode-input:checked + .k-themeopt { background: var(--k-charcoal); color: var(--k-on-dark); }
.k-mode-input:focus-visible + .k-themeopt { outline: 0.1875rem solid var(--k-focus); outline-offset: 0.125rem; }
.k-themeopt { display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Announcements pages (FEAT-104 leg 2) ---------- */
.k-ann-text { white-space: pre-line; overflow-wrap: anywhere; }
.k-ann-link { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 0.15em; }
.k-ann-titlelink { color: inherit; text-decoration: none; }
.k-ann-titlelink:hover { text-decoration: underline; }
.k-ann-titlelink:focus-visible, .k-ann-link:focus-visible { outline: 0.1875rem solid var(--k-focus); outline-offset: 0.125rem; border-radius: 0.25rem; }
a.k-chip { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.k-chip[aria-current="true"] { background: var(--k-charcoal); color: var(--k-on-dark); }
.k-badge-expired { background: var(--k-mist); color: var(--k-fg-2); }
.k-attach-static { cursor: default; }
.k-ann-warn { margin: 0 0 1rem; }
.k-ann-errors { margin: 0 0 1rem; }
.k-ann-errors-h { margin: 0 0 0.25rem; }
.k-ann-errors ul { margin: 0; padding-left: 1.25rem; }
.k-ann-detail { max-width: 56rem; }
.k-ann-detail .k-ann-media { aspect-ratio: 16 / 8; }
.k-ann-detail .k-ann-title { font-size: 1.75rem; }
.k-ann-detail .k-ann-text { font-size: 1.0625rem; }
.k-ann-facts { margin-top: 0.75rem; max-width: 56rem; }
.k-checkrow-sm { min-height: 2.75rem; }
.k-btn-danger { background: var(--k-charcoal); border-color: var(--k-charcoal); color: var(--k-on-dark); }
.k-btn-danger:hover { background: var(--k-orange-700); border-color: var(--k-orange-700); color: var(--k-on-dark); }
.k-confirm { position: relative; }
.k-confirm > summary { list-style: none; }
.k-confirm > summary::-webkit-details-marker { display: none; }
.k-confirm-panel { position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 20; width: min(20rem, 80vw); display: grid; gap: 0.75rem; box-shadow: var(--k-shadow-pop); }
.k-confirm-text { margin: 0; font-size: 0.9375rem; color: var(--k-fg-1); }
.k-copyrow { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; }
.k-copyrow .k-input { flex: 1 1 16rem; min-width: 0; }
.k-copyinput { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875rem; }
.k-newlink, .k-dlink-new { display: grid; gap: 0.75rem; margin-bottom: var(--k-section-gap, 1.5rem); max-width: 56rem; }
.k-dlinks { list-style: none; margin: 0; padding-top: 0.25rem; padding-bottom: 0.25rem; max-width: 56rem; }
.k-dlink { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.75rem 0; border-top: 1px solid var(--k-border); }
.k-dlink:first-child { border-top: 0; }
.k-dlink-body { display: flex; flex-direction: column; flex: 1 1 14rem; min-width: 0; line-height: 1.35; }
.k-dlink-name { font-weight: 700; color: var(--k-fg-strong); }
.k-dlink-meta { font-size: 0.875rem; color: var(--k-fg-2); }
.k-dlink-off .k-dlink-name { color: var(--k-fg-2); }
.k-dstale { margin-left: 0.25rem; color: var(--k-orange-900); }
.k-dempty { font-size: 1.25rem; }
@media (max-width: 767px) { .k-ann-titlelink { display: block; padding: 0.625rem 0; margin: -0.625rem 0; } }
@media (max-width: 767px) {
  .k-confirm[open] { flex-basis: 100%; }
  .k-confirm-panel { position: static; width: auto; margin-top: 0.75rem; }
}

/* ---------- admin pages (portal FEAT-104 leg 3): filters, access tables, reason chips ---------- */
.k-h3 { margin: 1.25rem 0 0.625rem; font-size: 1.0625rem; font-weight: 700; color: var(--k-fg-strong); }
.k-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem 0.75rem; margin: 0 0 0.75rem; }
.k-filters > .k-search { flex: 1 1 16rem; }
.k-select { width: auto; max-width: 100%; padding-right: 2rem; cursor: pointer; }
.k-select-sm { min-width: 10rem; }
.k-filters > .k-select { flex: 0 1 auto; }
.k-rowlink { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--k-fg-strong); font-weight: 700; text-decoration: underline; text-decoration-color: var(--k-border-strong); text-underline-offset: 0.2em; overflow-wrap: anywhere; }
.k-rowlink:hover { text-decoration-color: currentColor; }
.k-td-wrap { overflow-wrap: anywhere; }
.k-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875rem; }
.k-badge-yes { background: var(--k-leaf-100); color: var(--k-leaf-900); }
.k-badge-no, .k-badge-off { background: var(--k-mist); color: var(--k-fg-2); }
.k-badge-test { background: var(--k-orange-100); color: var(--k-orange-900); }
.k-badge-restricted { background: var(--k-charcoal); color: var(--k-on-dark); }
.k-badge-retired { background: var(--k-mist); color: var(--k-fg-2); text-decoration: line-through; }
.k-badge-grant-only { background: var(--k-orange-100); color: var(--k-orange-900); }
.k-badge-role { background: var(--k-bg); color: var(--k-fg-1); border: 1px solid var(--k-border-strong); }
.k-role-superadmin, .k-role-admin { background: var(--k-charcoal); color: var(--k-on-dark); border-color: var(--k-charcoal); }
.k-reasons { display: inline-flex; flex-wrap: wrap; gap: 0.375rem; }
.k-reason { display: inline-block; padding: 0.125rem 0.625rem; border-radius: var(--k-r-pill); background: var(--k-leaf-100); color: var(--k-leaf-900); font-size: 0.8125rem; font-weight: 700; line-height: 1.5; }
.k-reason-note { background: var(--k-mist); color: var(--k-fg-2); font-weight: 600; }
.k-adm-gap { margin: 0 0 1rem; }
.k-adm-why { display: inline-block; max-width: 18rem; }
.k-adm-grid { display: grid; gap: 0 1.25rem; align-items: start; }
.k-adm-cols, .k-adm-cols3 { display: grid; gap: 1.25rem; align-items: start; }
.k-adm-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.k-adm-fs .k-field, .k-adm-form .k-field { margin-bottom: 1rem; }
.k-adm-roles { margin: 0.5rem 0 0; padding-left: 1.125rem; }
.k-adm-facts { display: grid; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.k-adm-facts div { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; }
.k-adm-facts dt { font-weight: 700; color: var(--k-fg-2); min-width: 7rem; }
.k-adm-facts dd { margin: 0; }
.k-adm-legend dd { flex: 1 1 20rem; color: var(--k-fg-2); }
.k-adm-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.k-adm-notes { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.5rem; color: var(--k-fg-2); }
.k-adm-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.k-adm-link { display: flex; gap: 0.875rem; align-items: flex-start; min-height: 2.75rem; padding: 1rem 1.25rem; border-radius: var(--k-r-card); background: var(--k-surface); box-shadow: var(--k-shadow); color: var(--k-fg-1); text-decoration: none; }
.k-adm-link:hover { box-shadow: var(--k-shadow), 0 0 0 1px var(--k-border-strong); }
.k-adm-link > span { display: flex; flex-direction: column; }
.k-kpi-link { display: flex; flex-direction: column; gap: 0.125rem; color: inherit; text-decoration: none; min-height: 2.75rem; }
.k-adm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.625rem; }
.k-adm-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 0.75rem; }
.k-adm-members { flex-basis: 100%; }
.k-adm-addform .k-actions { justify-content: flex-start; }
.k-inline { display: inline; margin: 0; }
.k-btn-sm { min-height: 2.75rem; padding: 0.375rem 0.875rem; font-size: 0.875rem; }
.k-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }
@media (min-width: 768px) {
  .k-adm-grid { grid-template-columns: 1fr 1fr; }
  .k-table .k-rowlink { min-height: 2rem; }
}
@media (min-width: 1100px) {
  .k-adm-cols { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .k-adm-cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .k-btn-sm { min-height: 2.25rem; }
}
@media (max-width: 767.98px) {
  .k-filters > .k-select { flex: 1 1 9rem; }
  .k-table .k-td .k-reasons { justify-content: flex-end; }
  .k-adm-why { max-width: 60%; text-align: right; }
}
.k-access .k-checkrow-sm { min-width: 2.75rem; justify-content: center; }
.k-adm-cols .k-card > .k-h2, .k-adm-cols3 .k-card > .k-h3 { margin: 0 0 0.875rem; }

/* ---------- portal feedback + sync status (FEAT-104 leg 3b) ---------- */
.k-fb { display: grid; gap: var(--k-section-gap, 1.5rem); max-width: 48rem; }
.k-fb-p { margin: 0; line-height: 1.5; }
.k-fb-start { justify-content: flex-start; }
.k-fb-list { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.k-fb-item { display: grid; gap: 0.25rem; padding: 0.75rem 0; border-top: 1px solid var(--k-border); }
.k-fb-item:first-child { border-top: 0; }
.k-fb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.625rem; margin: 0 0 0.75rem; }
.k-fb-item .k-fb-head { margin: 0; }
.k-fb-note { margin: 0; padding: 0.5rem 0.75rem; border-radius: var(--k-r-inner); background: var(--k-bg); color: var(--k-fg-1); white-space: pre-wrap; }
.k-fb-quote { margin: 0.75rem 0 0; padding: 0.875rem 1rem; border-radius: var(--k-r-inner); background: var(--k-bg); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.k-fb-facts dd { overflow-wrap: anywhere; min-width: 0; flex: 1 1 14rem; }
.k-fb-brief { display: block; }
.k-fb-block { display: block; }
.k-fb-cols { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 1100px) { .k-fb-cols { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.k-fb-actions { display: grid; gap: 1.25rem; }
.k-fb-shots { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.k-fb-shot { display: block; border-radius: var(--k-r-inner); overflow: hidden; }
.k-fb-shot-img { display: block; max-width: 14rem; max-height: 10rem; }
.k-fb-st-new { background: var(--k-lime); color: var(--k-on-accent); }
.k-fb-st-investigating { background: var(--k-orange-100); color: var(--k-orange-900); }
.k-fb-st-resolved { background: var(--k-leaf-100); color: var(--k-leaf-900); }
.k-fb-st-wontfix { background: var(--k-mist); color: var(--k-fg-2); }
.k-sync-ok { background: var(--k-leaf-100); color: var(--k-leaf-900); }
.k-sync-warn { background: var(--k-orange-100); color: var(--k-orange-900); }
.k-sync-error { background: var(--k-orange); color: var(--k-on-accent); }
.k-sync-unknown { background: var(--k-mist); color: var(--k-fg-2); }
.k-fb-id { display: inline-flex; align-items: center; min-height: 2.75rem; min-width: 2.75rem; }

/* ---------- print: the page content only, full width ---------- */
@media print {
  .k-side, .k-topbar, .k-tabbar, .k-edge, .k-side-show, .k-skip, .k-toasts { display: none !important; }
  .k-shell { display: block !important; padding: 0 !important; }
  .k-main { max-width: none !important; width: 100% !important; margin: 0 !important; }
}

/* ── Wide data tables: .k-scroll-x ──────────────────────────────────────────
   Wrap any table wider than a phone in .k-scroll-x. It scrolls sideways INSIDE its
   card (never the page); kit.js sets data-k-more while columns are hidden to the
   right, which fades the right edge. On a phone every cell stays one line high (the
   table grows wider instead of growing tall rows), and the first column stays
   pinned on the card surface with a thin divider. A genuine free-text column opts
   out with .k-wrap on its th/td; a full-width td[colspan] row is left alone. */
.k-scroll-x { position: relative; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.k-scroll-x[data-k-more] {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.75rem), rgba(0, 0, 0, .25));
          mask-image: linear-gradient(to right, #000 calc(100% - 1.75rem), rgba(0, 0, 0, .25));
}
@media (max-width: 640px) {
  .k-scroll-x table :is(th, td):not([colspan]) { white-space: nowrap; }
  .k-scroll-x table :is(th, td).k-wrap { white-space: normal; min-width: 10rem; max-width: 16rem; }
  .k-scroll-x table tr > :is(th, td):first-child:not([colspan]) {
    position: sticky; left: 0; z-index: 1;
    box-shadow: inset -1px 0 0 var(--k-border), 6px 0 6px -6px rgba(0, 0, 0, .22);
  }
  /* Pinned cells sit on the card surface at zero specificity, so an app's own header,
     striped or hover background on the cell still wins. */
  :where(.k-scroll-x table tr > :is(th, td):first-child) { background-color: var(--k-surface); }
  .k-scroll-x table thead tr > :is(th, td):first-child { z-index: 3; }
}


/* ---------- review cockpit inside the kit shell ----------
   The shared review cockpit (common/ui/review.css + templates/review/cockpit.html)
   is also run LIVE by Equipment Service under its own site header, so nothing there
   changes. Its sticky offsets read --hdr-h, which review.js measures from the old
   `.site-header` -- absent in the kit shell, so the CSS fallback (8.5rem) would float
   the bar and the panes far below the top. Every rule here is scoped under .k-main,
   the kit shell's content wrapper, which Equipment Service never renders.
   - desktop/tablet (>=768px): no top bar, the page itself scrolls, so the bar sticks
     to the viewport top;
   - phone: the kit's sticky .k-topbar (--k-topbar-h + the notch inset) sits above.
   The bar drops under the kit's top bar, tab bar and phone menu (z 30) so an open
   menu is never painted over. */
.k-main { --hdr-h: 0px; }
@media (max-width: 767.98px) {
  .k-main { --hdr-h: calc(var(--k-topbar-h) + env(safe-area-inset-top)); }
}
.k-main .review-bar { z-index: 20; border-radius: var(--k-r-inner); }
.k-main .review-shell { min-width: 0; }
/* the panes sit on the kit card surface, not straight on the page background */
@media (min-width: 64rem) {
  .k-main .review-panes { background: var(--k-surface); border-radius: var(--k-r-inner); margin-top: 0.5rem; }
  .k-main .review-panes > :first-child { border-radius: var(--k-r-inner) 0 0 var(--k-r-inner); }
}
@media (max-width: 63.99rem) {
  .k-main .review-detail { padding-left: 0; padding-right: 0; }
}
