/* ============================================================================
   CineScale CRM, the new look (25 Nov 2026)
   A layer over app.css, from the design agent's inspiration pack
   (Meridian, Linear, Attio, Raycast, Superhuman, translated to the brand kit).

   Everything here is scoped to html[data-look="new"]. Without that attribute
   this file does nothing, which is how "Classic look" in the avatar menu
   gives back the CRM exactly as it was. Elements the new look adds carry
   .lk-only and are hidden in the classic look.

   No new hues: Cream versus Stone, weight and size carry the hierarchy.
   ============================================================================ */

html:not([data-look="new"]) .lk-only { display: none !important; }

/* ------------------------------------------------------------------ tokens */
html[data-look="new"] {
  --lk-r-ctl: 4px;           /* buttons, inputs, chips */
  --lk-r-card: 6px;          /* cards, panels, tables */
  --lk-r-pop: 10px;          /* palette, popovers, toasts */
  --lk-sidebar: 232px;
  --lk-topbar: 52px;
  --lk-bg-pop: #201C19;
  --lk-bg-hover: rgba(239, 234, 224, 0.045);
  --lk-bg-selected: #302923;
  --lk-scrim: rgba(14, 14, 15, 0.62);
  --lk-key-border: var(--cs-stone-700);
  --lk-fast: 120ms;
  --lk-pop: 180ms;
  /* The cards you pick up were 10px; the pack's shape decision B is 6px. */
  --cs-radius-3: 6px;
  --cs-radius-1: 4px;
}
html[data-look="new"][data-theme="light"] {
  --lk-bg-pop: #F7F3EC;
  --lk-bg-hover: rgba(26, 26, 28, 0.04);
  --lk-bg-selected: #E6E0D5;
  --lk-scrim: rgba(26, 26, 28, 0.28);
  --lk-key-border: var(--cs-stone-300);
  /* Calm light mode (Folk): cream page, warm cream cards instead of white. */
  --cs-bg-elev: #F7F3EC;
  --cs-bg-elev-2: #F2EDE4;
  --cs-border-faint: #C9C0B6;   /* darker than the kit's, so rules show on Cream */
  /* Jay, 2026-11-25: in cream the accent is the brand's bordeaux (Rich Sabel),
     used where the ink look uses its warm brown. A line page (clinics, events,
     websites) still sets its own accent further down the tree. */
  --cs-accent: var(--cs-rich-sabel);
  --cs-accent-soft: var(--cs-sabel-900);
  --cs-accent-on: var(--cs-cream);
  --cs-on-accent: var(--cs-cream);
  --cs-focus-ring: var(--cs-rich-sabel);
}

/* Tabular figures wherever money is drawn. */
html[data-look="new"] :is(.kpi__value, .deal-card__value, .table .num, .totals, .lk-count) {
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------- focus */
html[data-look="new"] :is(a, button, [tabindex], summary):focus-visible {
  outline: 2px solid var(--cs-focus-ring);
  outline-offset: 2px;
  box-shadow: none;
}

/* ------------------------------------------------------------------ keycap */
.lk-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--lk-key-border, var(--cs-stone-700));
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 500 10px/1 var(--cs-font-mono);
  color: var(--cs-fg-subtle);
  letter-spacing: 0;
  text-transform: none;
  flex: none;
}
html[data-look="new"] .btn--primary .lk-key {
  border-color: rgba(26, 26, 28, 0.35);
  color: rgba(26, 26, 28, 0.72);
}
html[data-look="new"][data-theme="light"] .btn--primary .lk-key {
  border-color: rgba(239, 234, 224, 0.35);
  color: rgba(239, 234, 224, 0.8);
}
html[data-look="new"] .btn:has(.lk-key) .arrow { display: none; }

/* ------------------------------------------------------------------ layout */
/* Desktop only: on a phone the sidebar is a drawer and app.css lays it out. */
@media (min-width: 761px) {
  html[data-look="new"] .app { grid-template-columns: var(--lk-sidebar) 1fr; }
}
/* No keyboard, no keycaps. */
@media (hover: none) {
  html[data-look="new"] .btn .lk-key, .lk-k .lk-key { display: none; }
  html[data-look="new"] .btn:has(.lk-key) .arrow { display: inline-block; }
}

/* ----------------------------------------------------------------- sidebar */
html[data-look="new"] .sidebar {
  padding: 20px 12px 14px;
  border-right: 1px solid var(--cs-border-faint);
}
html[data-look="new"] .sidebar__brand {
  padding: 0 8px 14px;
  border-bottom: 0;
}
html[data-look="new"] .sidebar__brand img { width: 116px; }
html[data-look="new"] .sidebar__brand .cs-caption {
  margin-top: 6px;
  font-family: var(--cs-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--cs-stone-500);
}

/* The palette's door, where the tiny underlined search used to be. */
.lk-k {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  margin: 2px 0 6px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--cs-border);
  border-radius: var(--lk-r-card);
  color: var(--cs-fg-subtle);
  font-size: 13px;
  text-align: left;
  transition: border-color var(--lk-fast) var(--cs-ease-cine), color var(--lk-fast) var(--cs-ease-cine);
}
.lk-k:hover { border-color: var(--cs-stone-600); color: var(--cs-fg-muted); }
.lk-k span:first-of-type { flex: 1; }
.lk-k svg { width: 15px; height: 15px; flex: none; }

html[data-look="new"] .sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  /* Edge to edge, so the lit box is square against both sides. */
  margin: 0 -12px;
  padding: 4px 0 12px;
}
.lk-group {
  padding: 16px 22px 6px;
  font: 500 9.5px/1 var(--cs-font-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cs-stone-500);
}
html[data-look="new"] .nav-area {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 22px;
  border-radius: 0;
  font-family: var(--cs-font-body);
  font-size: var(--cs-fs-micro);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--cs-ls-caps);
  color: var(--cs-fg-muted);
  transition: background var(--lk-fast) var(--cs-ease-cine), color var(--lk-fast) var(--cs-ease-cine);
}
html[data-look="new"] .nav-area:hover { color: var(--cs-fg); background: var(--lk-bg-hover); }
/* Jay's pick (2026-11-25): the classic lit box with the Cream line on its left edge. */
html[data-look="new"] .nav-area.active {
  color: var(--cs-fg);
  background: var(--cs-bg-elev);
  box-shadow: inset 2px 0 0 var(--cs-accent);
}
html[data-look="new"] .nav-area.active::before { content: none; }
/* ------------------------------------------------- cream: sabel and paper
   Jay, 2026-11-25: cream keeps its light page, with Rich Sabel for the few
   things that anchor it (the sidebar, the number strip, the one signal in
   focus, the lead tile on Finance and Goals). Inside those the ink look's
   tokens come back, so they read as a dark surface. Every other box is
   paper: a lighter Cream card with a real edge, so sections separate
   without the page turning red. */
html[data-look="new"][data-theme="light"] :is(
  .sidebar, .kpi-row, .signal--focus, .sg-tile--star, .fin-tile--hero
) {
  --cs-bg: var(--cs-sabel-900);
  --cs-bg-elev: var(--cs-rich-sabel);
  --cs-bg-elev-2: #563B3A;
  --lk-bg-pop: var(--cs-sabel-900);
  --cs-fg: var(--cs-cream);
  --cs-fg-muted: #DDD0C9;
  --cs-fg-subtle: #BCA8A1;
  --cs-border: rgba(239, 234, 224, 0.26);
  --cs-border-faint: rgba(239, 234, 224, 0.13);
  --cs-accent: var(--cs-cream);
  --cs-accent-on: var(--cs-rich-sabel);
  --cs-on-accent: var(--cs-rich-sabel);
  --cs-accent-soft: var(--cs-stone-200);
  --cs-focus-ring: var(--cs-cream);
  --cs-stone-500: #B09C95;
  --cs-well: rgba(0, 0, 0, 0.16);
  --cs-edge: inset 0 1px 0 rgba(239, 234, 224, 0.07);
  --cs-edge-strong: inset 0 1px 0 rgba(239, 234, 224, 0.12);
  --lk-bg-hover: rgba(239, 234, 224, 0.07);
  --lk-key-border: rgba(239, 234, 224, 0.3);
  --sg-on: #C5B2A4;
  --sg-behind: #E0A999;
  --fin-bordeaux: #EBC3C3;
  --fin-good: #B9CDBE;
  background-color: var(--cs-bg-elev);
  color: var(--cs-fg);
}
html[data-look="new"][data-theme="light"] .signal--focus::before {
  background: radial-gradient(360px 200px at 0% 0%, rgba(239, 234, 224, 0.08), transparent 70%);
}
html[data-look="new"][data-theme="light"] :is(.kpi-row, .signal--focus, .sg-tile--star, .fin-tile--hero) {
  border-color: transparent;
}
/* ------------------------------------------------------ paper and depth
   Jay, 2026-11-30: every box lifts off the page, in both themes. One card
   rule for the working boxes, with each theme supplying its own paper,
   edges and shadows:
     Cream  a lighter paper card, lit top edge, a soft fall-off tinted Sabel
            rather than grey so the shadow belongs to the Cream;
     Ink    a Smoked Oak card, a faint Cream top edge, and black underneath:
            on a dark page the lit edge does most of the work and the shadow
            only seats the card.
   The big working boxes sit higher (--lk-lift) than the cards inside the
   boards (--lk-lift-sm). */
html[data-look="new"] {
  --lk-paper: var(--cs-smoked-oak);
  --lk-paper-edge: rgba(239, 234, 224, 0.08);
  --lk-paper-edge-low: rgba(0, 0, 0, 0.5);
  --lk-lift-sm:
    inset 0 1px 0 rgba(239, 234, 224, 0.07),
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 4px 10px -3px rgba(0, 0, 0, 0.35);
  --lk-lift:
    inset 0 1px 0 rgba(239, 234, 224, 0.09),
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 6px 14px -4px rgba(0, 0, 0, 0.4),
    0 22px 44px -16px rgba(0, 0, 0, 0.65);
}
html[data-look="new"][data-theme="light"] {
  --lk-paper: #F8F5EF;
  --lk-paper-edge: #D3CABF;
  --lk-paper-edge-low: #C2B7AA;
  --lk-lift-sm:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 1px 1px rgba(70, 46, 46, 0.08),
    0 3px 8px -2px rgba(70, 46, 46, 0.10);
  --lk-lift:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 1px rgba(70, 46, 46, 0.07),
    0 4px 10px -2px rgba(70, 46, 46, 0.09),
    0 16px 34px -14px rgba(70, 46, 46, 0.22);
}
/* The working boxes, in both themes: to dos, backlog, week goals, the week
   ahead, expenses, stats, settings groups, the calendar, the map's side. */
html[data-look="new"] :is(.todo__col, .wins, .panel > .panel__body, .panel.panel__body--flush,
  .stat, .settings__group, .cal, .conquest__side, .cq-region, .panel > .empty) {
  background-color: var(--lk-paper);
  border: 1px solid var(--lk-paper-edge);
  border-bottom-color: var(--lk-paper-edge-low);
  border-radius: var(--lk-r-card);
  box-shadow: var(--lk-box-lift, var(--lk-lift));
}
/* The cards, in both themes: paper like the boxes, a step lower. On Ink
   they are Smoked Oak sitting in the boards' dark wells. */
html[data-look="new"] :is(
  .signal:not(.signal--focus), .sg-tile:not(.sg-tile--star):not(.fin-tile--hero),
  .deal-card, .ed-card, .prod-card, .pipe-card, .fin-card
) {
  background-color: var(--lk-paper);
  border: 1px solid var(--lk-paper-edge);
  border-bottom-color: var(--lk-paper-edge-low);
  box-shadow: var(--lk-box-lift, var(--lk-lift-sm));
}
html[data-look="new"] .signal:not(.signal--focus) { --lk-box-lift: var(--lk-lift); }
/* A card under the pointer rises to the boxes' height. */
html[data-look="new"] :is(a.sg-tile, .deal-card, .ed-card, .prod-card, .pipe-card):hover { --lk-box-lift: var(--lk-lift); }
/* The accent blocks keep their colour (Sabel on Cream, their own surface on
   Ink) and lift with everything else: the number strip, the signal in
   focus, the lead tiles on Finance and Goals. */
html[data-look="new"] :is(.kpi-row, .signal--focus, .sg-tile--star, .fin-tile--hero) { box-shadow: var(--lk-lift); }
/* The thin strips that sit above a page's content: the board's money line,
   Google Calendar on Bookings, Monday's pick-your-signals prompt. */
html[data-look="new"] :is(.ed-money, .gstrip, .signals__monday) {
  background-color: var(--lk-paper);
  border: 1px solid var(--lk-paper-edge);
  border-bottom-color: var(--lk-paper-edge-low);
  border-radius: var(--lk-r-card);
  box-shadow: var(--lk-lift-sm);
}
/* The three pipeline cards were cells in one row; as cards they need air. */
html[data-look="new"] .pipe-grid { gap: 16px; }
html[data-look="new"] .pipe-card { border-radius: var(--lk-r-card); }
html[data-look="new"][data-theme="light"] .sidebar { border-right-color: transparent; }
/* Lists and tables run to the box's edge, so the box clips its corners. */
html[data-look="new"] :is(.todo__col, .wins, .panel__body--flush) { overflow: hidden; }
html[data-look="new"] .panel.panel__body--flush { padding-bottom: 0; }
html[data-look="new"] .panel > .panel__body--flush { padding-bottom: 6px; }
html[data-look="new"] .stat { padding: 16px 18px; }
html[data-look="new"] .settings__group { padding: 22px 24px; }
html[data-look="new"] .conquest__side { padding: 20px; }
html[data-look="new"] .cq-region { padding: 14px; }
html[data-look="new"] .wins { padding-top: 4px; }
html[data-look="new"] .panel > .panel__body:not(.panel__body--flush) { padding: 16px 18px; }
html[data-look="new"] .todo__col + .todo__col { margin-top: 16px; }
/* Dropping a week goal onto Today still lights the box, on top of its lift. */
html[data-look="new"] .todo__col.drag-over {
  --lk-box-lift: inset 0 0 0 1px var(--cs-accent), var(--lk-lift);
}
/* The box that holds the signal cards gets a real edge and a deeper Cream. */
html[data-look="new"][data-theme="light"] section.signals {
  background: #E4DDD2;
  border-color: var(--cs-stone-300);
}
/* The cream wordmark on Sabel. */
html[data-look="new"][data-theme="light"] .sidebar .brand-mark--dark { display: block; }
html[data-look="new"][data-theme="light"] .sidebar .brand-mark--light { display: none; }

/* The menu on Sabel: cream words, white under the pointer, and the open
   page a Cream box with Sabel words. */
html[data-look="new"][data-theme="light"] .nav-area { color: #DDD0C9; }
html[data-look="new"][data-theme="light"] .nav-area:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.08); }
html[data-look="new"][data-theme="light"] .nav-area.active {
  color: var(--cs-rich-sabel);
  background: var(--cs-cream);
  box-shadow: inset 3px 0 0 var(--cs-sabel-900);
}
html[data-look="new"][data-theme="light"] .nav-area.active .lk-count { color: var(--cs-rich-sabel); }
.lk-ico { width: 16px; height: 16px; flex: none; opacity: 0.85; }
html[data-look="new"] .nav-area > span:not(.lk-count) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-count {
  margin-left: auto;
  font: 400 10px/1 var(--cs-font-mono);
  color: var(--cs-stone-500);
}
.lk-count--hot { color: var(--cs-fg); }

html[data-look="new"] .sidebar__foot {
  border-top: 1px solid var(--cs-border-faint);
  padding: 12px 4px 0;
}
html[data-look="new"] .sidebar__foot > .cs-caption { display: none; }
.lk-me { display: flex; align-items: center; gap: 10px; }
.lk-me__av {
  width: 26px; height: 26px; flex: none;
  border-radius: 50%;
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--cs-bg-elev-2);
  font: 600 10px/1 var(--cs-font-mono);
  color: var(--cs-fg-muted);
}
.lk-me__av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lk-me__name { font-size: 13px; font-weight: 600; color: var(--cs-fg); line-height: 1.2; }
.lk-me__meta { font: 400 9.5px/1.3 var(--cs-font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--cs-stone-500); }
.lk-me__gear { margin-left: auto; color: var(--cs-fg-subtle); display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--lk-r-ctl); }
.lk-me__gear:hover { color: var(--cs-fg); background: var(--lk-bg-hover); }
.lk-me__gear svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------------ topbar */
html[data-look="new"] .topbar {
  min-height: var(--lk-topbar);
  padding: 0 24px;
  gap: 16px;
  align-items: stretch;
}
html[data-look="new"] .topbar > * { align-self: center; }
html[data-look="new"] .topbar__search input,
html[data-look="new"] .topbar__search .search-results { display: none; }
.lk-crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  color: var(--cs-fg-subtle);
  white-space: nowrap;
}
.lk-crumb a:hover { color: var(--cs-fg); }
.lk-crumb i { font-style: normal; color: var(--cs-stone-600); }
.lk-crumb b {
  font-weight: 600;
  color: var(--cs-fg);
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-look="new"] .topbar__meta { gap: 14px; }
html[data-look="new"] #clock {
  font-family: var(--cs-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--cs-fg-subtle);
}

/* The open area's contents. Jay, 30 Nov 2026: the thin underline tabs read
   as part of the header and got missed, so they are a segmented switch now:
   a framed track, every tab a real button, the open one filled in the
   accent like the active filter pills on the page. */
html[data-look="new"] .subnav {
  align-self: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--cs-border);
  border-radius: 999px;
  background: var(--cs-bg-elev-2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}
html[data-look="new"] .subnav__item {
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--cs-fg-muted);
  box-shadow: none;
}
html[data-look="new"] .subnav__item:hover { color: var(--cs-fg); background: var(--lk-bg-hover); }
html[data-look="new"] .subnav__item.active {
  background: var(--cs-accent);
  color: var(--cs-on-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
}
html[data-look="new"] .subnav__count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--cs-border-faint);
  font-size: 10px;
  line-height: 1;
  opacity: 1;
  color: var(--cs-fg-muted);
}
html[data-look="new"] .subnav__item.active .subnav__count {
  background: rgba(239, 234, 224, 0.2);
  color: inherit;
}
html[data-look="new"][data-theme="light"] .subnav__item.active .subnav__count { background: rgba(239, 234, 224, 0.22); }
html[data-look="new"]:not([data-theme="light"]) .subnav__item.active .subnav__count { background: rgba(26, 26, 28, 0.12); }

/* -------------------------------------------------------------------- view */
@media (min-width: 761px) { html[data-look="new"] .view { padding: 28px 32px 96px; } }
html[data-look="new"] .view-head { margin-bottom: 24px; }
html[data-look="new"] .view-head:not(.view-head--center) .view-head__title h1 {
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
html[data-look="new"] .view-head:not(.view-head--center) .view-head__title .cs-eyebrow {
  font-family: var(--cs-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--cs-fg-subtle);
  margin-bottom: 10px;
}
html[data-look="new"] .view-head:not(.view-head--center) .view-head__title .cs-eyebrow::before,
html[data-look="new"] .view-head:not(.view-head--center) .view-head__title .cs-eyebrow::after { display: none; }
html[data-look="new"] .view-head__title--below .cs-eyebrow { margin: 10px 0 0; }
html[data-look="new"] .view-head__actions { gap: 8px; }


/* Buttons: the classic ones stay (Jay, 2026-11-25). */

/* ------------------------------------------------------------ chips, pills */
html[data-look="new"] .chip { border-radius: var(--lk-r-ctl); letter-spacing: 0.06em; font-size: 10px; padding: 3px 8px; }
html[data-look="new"] .pill { border-radius: var(--lk-r-card); }

/* The pipeline's line tabs: underline tabs, the way Attio and Linear do views. */
html[data-look="new"] .toolbar .pills:has(.pill--lg) {
  gap: 20px;
  border-bottom: 1px solid var(--cs-border-faint);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
html[data-look="new"] .toolbar .pill--lg {
  padding: 10px 2px 11px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  font-size: 13px;
  color: var(--cs-fg-subtle);
  white-space: nowrap;
}
html[data-look="new"] .toolbar .pill--lg:hover { color: var(--cs-fg); background: none; }
html[data-look="new"] .toolbar .pill--lg.active {
  color: var(--cs-fg);
  background: none;
  border-bottom-color: var(--cs-accent);
}

/* The calculator's lines (Jay, 5 Dec 2026: "more nice"). A segmented switch
   like the area tabs at the top, a size up; the open line is the bordeaux,
   raised, in both themes. */
html[data-look="new"] .quote-tabs .pills:has(.pill--lg) {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--cs-border);
  border-radius: 999px;
  background: var(--cs-bg-elev-2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
  max-width: 100%;
}
html[data-look="new"] .quote-tabs .pill--lg {
  height: 36px;
  padding: 0 16px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cs-fg-muted);
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
html[data-look="new"] .quote-tabs .pill--lg:hover { color: var(--cs-fg); background: var(--lk-bg-hover); }
html[data-look="new"] .quote-tabs .pill--lg.active {
  color: var(--cs-cream);
  background: linear-gradient(160deg, #5a3535 0%, var(--cs-rich-sabel) 50%, var(--cs-sabel-900) 100%);
  box-shadow:
    inset 0 1px 0 rgba(239, 234, 224, 0.16),
    0 1px 2px rgba(54, 25, 26, 0.30),
    0 4px 10px -3px rgba(54, 25, 26, 0.40);
}

/* ------------------------------------------------------- KPI strip (D01) */
html[data-look="new"] .kpi-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  grid-template-columns: none;
  gap: 0;
  background: var(--cs-bg-elev);
  border: 1px solid var(--cs-border-faint);
  border-radius: var(--lk-r-card);
  overflow: hidden;
}
html[data-look="new"] .kpi {
  padding: 16px 20px 16px;
  min-height: 124px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--cs-border-faint);
  border-radius: 0;
  box-shadow: none;
  transition: background var(--lk-fast) var(--cs-ease-cine);
}
html[data-look="new"] .kpi:last-child { border-right: 0; }
html[data-look="new"] .kpi::before { display: none; }
html[data-look="new"] .kpi:hover { transform: none; box-shadow: none; background: var(--lk-bg-hover); }
html[data-look="new"] a.kpi:active { transform: none; box-shadow: none; }
html[data-look="new"] .kpi .cs-eyebrow {
  font-family: var(--cs-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--cs-stone-400);
  margin-bottom: 12px;
}
html[data-look="new"] .kpi__value { font-size: 40px; letter-spacing: -0.025em; }

/* Revenue against the year's goal: a ring at the cell's right. */
html[data-look="new"] .kpi--rev { position: relative; container-type: inline-size; min-width: 0; }
html[data-look="new"] .kpi--rev .kpi__value { white-space: nowrap; }
html[data-look="new"] .kpi--rev:has(.kpi__ring) :is(.kpi__value, .kpi__note) { margin-right: 124px; }
/* A narrow cell (a small laptop, a phone): the ring drops under the note
   instead of sitting on top of the amount. */
@container (max-width: 330px) {
  html[data-look="new"] .kpi--rev .kpi__ring { position: static; margin: 14px 0 0; }
  html[data-look="new"] .kpi--rev:has(.kpi__ring) :is(.kpi__value, .kpi__note) { margin-right: 0; }
}
.kpi__ring {
  position: absolute;
  right: 24px;
  top: 50%;
  width: 96px;
  height: 96px;
  margin-top: -48px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
}
button.kpi__ring { cursor: pointer; }
.kpi__ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.kpi__ring circle { fill: none; stroke-width: 5; }
.kpi__ring-track { stroke: var(--cs-border-faint); }
.kpi__ring--empty .kpi__ring-track { stroke: var(--cs-border); stroke-dasharray: 2 4; }
.kpi__ring-fill { stroke: var(--cs-accent); stroke-linecap: round; }
/* The label sits inside the ring's inner edge with room to spare. */
.kpi__ring b {
  position: absolute;
  inset: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: 500 19px/1 var(--cs-font-mono);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
}
.kpi__ring small {
  display: block;
  margin-top: 5px;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--cs-fg-subtle);
}
.kpi__ring--empty b { font-size: 9.5px; line-height: 1.35; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cs-fg-subtle); }
button.kpi__ring:hover .kpi__ring-track { stroke: var(--cs-stone-500); }
html[data-look="new"] .kpi__note { font-size: 11px; margin-top: 10px; }
@media (max-width: 760px) {
  html[data-look="new"] .kpi-row { grid-auto-flow: row; }
  html[data-look="new"] .kpi { border-right: 0; border-bottom: 1px solid var(--cs-border-faint); }
  html[data-look="new"] .kpi:last-child { border-bottom: 0; }
}

/* ------------------------------------------------------------------ panels
   Section heads read like the mockups: Times italic, sentence case. */
html[data-look="new"] .panel__head { padding: 24px 0 14px; }
html[data-look="new"] .panel__head > .cs-eyebrow {
  font-family: var(--cs-font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 27px;
  line-height: 1.15;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--cs-fg);
}
/* Jay, 26 Nov: the heads bigger and clearer. The small caps heads inside a
   panel (Today, Backlog) step up too, so they read as labels, not footnotes. */
html[data-look="new"] .todo__col-head > .cs-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--cs-fg);
}

/* ------------------------------------------------------------------ tables */
html[data-look="new"] .table th {
  height: 32px;
  padding: 0 16px 0 0;
  font: 500 10px/1 var(--cs-font-mono);
  letter-spacing: 0.12em;
  color: var(--cs-stone-500);
  border-bottom: 1px solid var(--cs-border-faint);
  vertical-align: middle;
}
html[data-look="new"] .table td {
  height: 40px;
  padding: 8px 16px 8px 0;
  font-size: 13.5px;
}
html[data-look="new"] .table tbody tr:hover { background: var(--lk-bg-hover); }
html[data-look="new"] .table td:first-child,
html[data-look="new"] .table th:first-child { padding-left: 8px; }

/* ------------------------------------------------------------------ boards */
html[data-look="new"] .kanban {
  gap: 10px;
  border: 0;
  grid-auto-columns: minmax(240px, 1fr);
}
/* Columns are quiet wells of their own with a gap between them (Linear),
   instead of one sunken box split by rules. */
html[data-look="new"] .kanban { background: none; box-shadow: none; }
html[data-look="new"] .kanban__col {
  border-right: 0;
  box-shadow: none;
  background: var(--lk-col-bg, rgba(0, 0, 0, 0.16));
  border-radius: var(--lk-r-card);
}
html[data-look="new"][data-theme="light"] .kanban__col { --lk-col-bg: rgba(26, 26, 28, 0.035); }
html[data-look="new"] .kanban__col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px 0 12px;
  border-bottom: 0;
  background: none;
  box-shadow: none;
}
html[data-look="new"] .kanban__col-head .cs-eyebrow {
  display: inline;
  margin: 0;
  font: 600 13px/1.2 var(--cs-font-body);
  text-transform: none;
  letter-spacing: 0;
  color: var(--cs-fg);
}
html[data-look="new"] .kanban__col-head .totals {
  margin-left: auto;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--cs-stone-400);
}
html[data-look="new"] .kanban__cards {
  padding: 2px 6px 10px;
  gap: 8px;
  border-radius: var(--lk-r-card);
  transition: background var(--lk-fast) var(--cs-ease-cine);
}
html[data-look="new"] .kanban__col.drag-over .kanban__cards {
  background: var(--lk-bg-hover);
  box-shadow: inset 0 0 0 1px var(--cs-border);
}
html[data-look="new"] .deal-card {
  padding: 12px 14px 10px;
  border-radius: var(--lk-r-card);
  border: 1px solid var(--cs-border-faint);
  transition: border-color var(--lk-fast) var(--cs-ease-cine), background var(--lk-fast) var(--cs-ease-cine);
}
html[data-look="new"] .deal-card:hover { border-color: var(--cs-stone-600); background: var(--cs-bg-elev); }
html[data-look="new"] .deal-card.dragging { opacity: 0.9; border-color: var(--cs-accent); }
html[data-look="new"] .deal-card__name { font-size: 14px; }
html[data-look="new"] .deal-card__value {
  font-family: var(--cs-font-display);
  font-size: 17px;
  letter-spacing: -0.02em;
}
html[data-look="new"] .card-edit { border-radius: var(--lk-r-ctl); background: var(--lk-bg-pop); border-color: var(--cs-border); }

/* Won and Lost fold into narrow rails, so the work that needs doing gets
   the room (D02, A06). A click on the rail opens it again. Desktop only:
   on a phone the board is one column at a time already. */
@media (min-width: 761px) {
  html[data-look="new"] .kanban:has(> .lk-rail) {
    display: flex;
    align-items: stretch;
  }
  html[data-look="new"] .kanban:has(> .lk-rail) > .kanban__col { flex: 1 1 0; min-width: 240px; }
  html[data-look="new"] .kanban > .kanban__col.lk-rail {
    flex: 0 0 44px;
    min-width: 44px;
    border: 1px solid var(--cs-border-faint);
    border-radius: var(--lk-r-card);
    cursor: pointer;
    transition: border-color var(--lk-fast) var(--cs-ease-cine), background var(--lk-fast) var(--cs-ease-cine);
  }
  html[data-look="new"] .kanban > .lk-rail:hover { border-color: var(--cs-stone-600); background: var(--lk-bg-hover); }
  html[data-look="new"] .kanban > .lk-rail.drag-over { border-color: var(--cs-accent); }
  html[data-look="new"] .lk-rail .kanban__cards { display: none; }
  html[data-look="new"] .lk-rail .kanban__col-head {
    writing-mode: vertical-rl;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px 0;
    width: 100%;
    align-items: center;
  }
  html[data-look="new"] .lk-rail .kanban__col-head .totals { margin-left: 0; }
  html[data-look="new"] .lk-fold {
    margin-left: 4px;
    width: 22px; height: 22px;
    display: grid; place-items: center;
    border-radius: var(--lk-r-ctl);
    color: var(--cs-fg-subtle);
    font: 500 12px/1 var(--cs-font-mono);
  }
  html[data-look="new"] .lk-fold:hover { color: var(--cs-fg); background: var(--lk-bg-hover); }
  html[data-look="new"] .lk-rail .lk-fold { display: none; }
}
@media (max-width: 760px) { .lk-fold { display: none !important; } }

/* ------------------------------------------------------------------ fields */
html[data-look="new"] .field label {
  font-family: var(--cs-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
html[data-look="new"] :is(.field input, .field select, .field textarea) {
  border-radius: var(--lk-r-ctl);
  border-color: var(--cs-border-faint);
  transition: border-color var(--lk-fast) var(--cs-ease-cine), box-shadow var(--lk-fast) var(--cs-ease-cine);
}
html[data-look="new"] :is(.field input, .field select, .field textarea):hover { border-color: var(--cs-border); }
html[data-look="new"] :is(.field input, .field select, .field textarea):focus {
  border-color: var(--cs-stone-500);
  box-shadow: 0 0 0 3px rgba(239, 234, 224, 0.07);
}
html[data-look="new"][data-theme="light"] :is(.field input, .field select, .field textarea):focus {
  box-shadow: 0 0 0 3px rgba(26, 26, 28, 0.06);
}

/* ------------------------------------------------------- modals and menus */
html[data-look="new"] .modal-backdrop {
  background: var(--lk-scrim);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
html[data-look="new"] .modal {
  background: var(--lk-bg-pop);
  border: 1px solid var(--cs-border);
  border-radius: var(--lk-r-pop);
  overflow: hidden;
}
html[data-look="new"] .modal__head { padding: 18px 22px; }
html[data-look="new"] .modal__head h2 { font-size: 26px; }
html[data-look="new"] .modal__body { padding: 20px 22px; }
html[data-look="new"] .modal__foot { padding: 14px 22px; }
html[data-look="new"] .user-menu {
  background: var(--lk-bg-pop);
  border: 1px solid var(--cs-border);
  border-radius: var(--lk-r-pop);
  overflow: hidden;
  padding: 4px;
}
html[data-look="new"] .user-menu__item { border-radius: var(--lk-r-card); }
html[data-look="new"] .user-menu__item:hover { background: var(--lk-bg-hover); }

/* -------------------------------------------------------------- toasts
   Bottom left of the content, Cream on Ink, 44px. */
html[data-look="new"] .toast {
  left: calc(var(--lk-sidebar) + 24px);
  bottom: 24px;
  transform: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 13px;
  border-radius: 8px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  animation: lk-toast-in var(--lk-pop) var(--cs-ease-cine);
}
html[data-look="new"] .toast.out { animation: lk-toast-out 200ms var(--cs-ease-in) forwards; }
@keyframes lk-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes lk-toast-out { to { opacity: 0; transform: translateY(6px); } }
@media (max-width: 760px) {
  html[data-look="new"] .toast { left: 16px; right: 16px; }
}

/* ===================================================== command palette */
.lk-scrim {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--lk-scrim);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 112px 16px 16px;
  animation: lk-fade var(--lk-pop) var(--cs-ease-cine);
}
.lk-scrim[hidden] { display: none; }
@keyframes lk-fade { from { opacity: 0; } to { opacity: 1; } }
.lk-pal {
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  background: var(--lk-bg-pop);
  border: 1px solid var(--cs-border);
  border-radius: var(--lk-r-pop);
  box-shadow: var(--cs-shadow-pop);
  overflow: hidden;
  animation: lk-rise var(--lk-pop) var(--cs-ease-cine);
}
@keyframes lk-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.lk-pal__in {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid var(--cs-border-faint);
}
.lk-pal__in svg { width: 17px; height: 17px; color: var(--cs-fg-subtle); flex: none; }
.lk-pal__in input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  font-size: 16px;
  color: var(--cs-fg);
}
.lk-pal__in input::placeholder { color: var(--cs-fg-subtle); }
.lk-scopes { display: flex; gap: 4px; flex: none; }
.lk-scope {
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--cs-border-faint);
  border-radius: var(--lk-r-ctl);
  font: 500 9.5px/1 var(--cs-font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cs-fg-subtle);
}
.lk-scope:hover { color: var(--cs-fg); border-color: var(--cs-border); }
.lk-scope.on { color: var(--cs-fg); border-color: var(--cs-fg-subtle); background: var(--lk-bg-hover); }
.lk-pal__list { overflow-y: auto; padding: 6px; flex: 1; min-height: 0; }
.lk-pal__group {
  padding: 12px 10px 6px;
  font: 500 9.5px/1 var(--cs-font-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cs-stone-500);
}
.lk-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: var(--lk-r-card);
  text-align: left;
  font-size: 14px;
  color: var(--cs-fg);
}
.lk-row__ico {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--lk-r-ctl);
  background: var(--lk-bg-hover);
  color: var(--cs-fg-muted);
}
.lk-row__ico svg { width: 14px; height: 14px; }
.lk-row__text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; overflow: hidden; }
.lk-row__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-row__sub { font-size: 12px; color: var(--cs-fg-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-row__end { display: flex; gap: 4px; align-items: center; flex: none; }
.lk-row__tag {
  font: 500 9.5px/1 var(--cs-font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cs-fg-subtle);
  border: 1px solid var(--cs-border-faint);
  border-radius: var(--lk-r-ctl);
  padding: 4px 6px;
}
.lk-row.on { background: var(--cs-bg-elev); }
.lk-row.on::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--cs-accent);
}
.lk-row mark {
  background: none;
  color: var(--cs-fg);
  font-weight: 700;
  border-bottom: 1px solid var(--cs-oyster-silk);
}
.lk-pal__none { padding: 22px 12px 8px; }
.lk-pal__none p {
  font-family: var(--cs-font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--cs-fg);
  margin-bottom: 8px;
}
.lk-pal__foot {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 38px;
  padding: 0 14px;
  border-top: 1px solid var(--cs-border-faint);
  font-size: 11.5px;
  color: var(--cs-fg-subtle);
  flex: none;
}
.lk-pal__foot span { display: inline-flex; align-items: center; gap: 6px; }
.lk-pal__foot span:last-child { margin-left: auto; }

/* ---------------------------------------------------------- shortcut sheet */
.lk-sheet {
  width: 100%;
  max-width: 520px;
  background: var(--lk-bg-pop);
  border: 1px solid var(--cs-border);
  border-radius: var(--lk-r-pop);
  box-shadow: var(--cs-shadow-pop);
  padding: 22px 24px 18px;
  animation: lk-rise var(--lk-pop) var(--cs-ease-cine);
}
.lk-sheet h2 {
  font-family: var(--cs-font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  margin-bottom: 14px;
}
.lk-sheet dl { display: grid; grid-template-columns: 1fr auto; row-gap: 2px; }
.lk-sheet dt, .lk-sheet dd {
  min-height: 32px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--cs-border-faint);
  font-size: 13.5px;
}
.lk-sheet dt { color: var(--cs-fg-muted); }
.lk-sheet dd { gap: 4px; justify-content: flex-end; color: var(--cs-fg-subtle); font-size: 11px; }
.lk-sheet p { margin-top: 14px; font-size: 12px; color: var(--cs-fg-subtle); }

/* ---------------------------------------------------------------- products
   Smaller cards with a 4:3 picture. The card is a flex column, so the media
   needs min-height:0 or a tall photo stretches it to its full height. */
html[data-look="new"] .prod-grid {
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 12px;
}
html[data-look="new"] .prod-card { border-radius: var(--lk-r-card); box-shadow: none; }
html[data-look="new"] .prod-card__media {
  aspect-ratio: 4 / 3;
  min-height: 0;
  flex: none;
  overflow: hidden;
}
html[data-look="new"] .prod-card__body { padding: 10px 12px 12px; gap: 3px; }
html[data-look="new"] .prod-card__name { font-size: 13.5px; }
html[data-look="new"] .prod-card__price { font-size: 11.5px; }
html[data-look="new"] .prod-card__sum { font-size: 12px; -webkit-line-clamp: 2; }
/* The clinic photo is a tall portrait: zoom in on her face. */
html[data-look="new"] .prod-card__media img[src*="cinescale-background"] {
  object-position: 62% 52%;
  transform: scale(1.6);
  transform-origin: 66% 50%;
}

@media (prefers-reduced-motion: reduce) {
  html[data-look="new"] *, .lk-scrim, .lk-pal, .lk-sheet { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* A phone keeps its drawer; the palette sits closer to the top. */
@media (max-width: 760px) {
  .lk-scrim { padding-top: 56px; }
  .lk-scopes { display: none; }
  .lk-pal__foot { display: none; }
}
