/* @foundation/ui design tokens — CSS custom-property mirror of tokens.js.
   COMBINATION B "Ivory Study" — The Study's ceremonial structure in the
   Broadsheet's warm cream + gold palette; Playfair Display type. */

:root {
  /* --- Viewport insets ----------------------------------------------------
     ONE owner for the iPhone home-indicator allowance. It used to be applied
     in two places at once (the chat wrapper AND the composer), so the phone
     double-counted it and left ~86px of dead cream under the message box.
     Anything that needs the allowance reads this, and nothing adds env() itself.

     --cc-kb is how much of the layout viewport an on-screen keyboard is
     covering, published by useKeyboardInset(). Zero on desktop and whenever the
     keyboard is down. */
  --cc-kb: 0px;
  --cc-safe-bottom: env(safe-area-inset-bottom, 0px);

  --cc-bg:         #f4f1e9;
  --cc-bg-soft:    #ece7d9;
  --cc-bg-deep:    #e3dcc9;
  --cc-bg-thread: #f1ead7;
  --cc-card:       #fbfaf4;

  --cc-navy:        #171410;
  --cc-navy-soft:   #272219;
  --cc-navy-medium: #332c20;
  --cc-navy-deep:   #0d0b07;

  /* A real navy blue for the "you" chat bubble — the --cc-navy role is a dark
     neutral in this palette (near-black), so the sender bubble needs its own
     genuinely-blue fill that carries white text on both grounds. */
  --cc-chat-mine:   #33466b;

  /* Meeting scratchpad "pens" — the two members write in one shared pad, so
     authorship has to read at a glance without a label: Alice in a dark
     neutral grey, Bob in a dark navy. Both must clear text contrast on
     the cream card, and lighten (never invert) on the dark ground. */
  --cc-pen-member-a:      #4a4a4a;
  --cc-pen-member-b:    #1e3a5f;
  --cc-pen-member-a-bg:   rgba(74, 74, 74, 0.05);
  --cc-pen-member-b-bg: rgba(30, 58, 95, 0.05);

  --cc-gold:       #b07a24;
  --cc-gold-bold:  #8f5f14;
  --cc-gold-soft:  #a67c2e;
  --cc-gold-tint:  #f1e7d3;
  --cc-gold-pale:  #f1e7d3;
  --cc-gold-faint: rgba(176, 122, 36, 0.32);
  /* RGB triplet form of the accent, for rgba(var(--cc-gold-rgb), a) literals
     (masthead rules, borders) that need theme-aware alpha. Light = brass. */
  --cc-gold-rgb:   176, 122, 36;

  /* Interaction-layer accents (hover text, hover borders, hover tints) — kept
     as their own vars so interactions.css hovers turn orange in dark alongside
     the base accent. Light values = the original brass hover palette. */
  --cc-accent-hi:       #d8bf85;
  --cc-accent-line:     #c2a35d;
  --cc-accent-line-2:   #a98b4f;
  --cc-accent-tint-rgb: 169, 139, 79;

  --cc-ink:   #171410;
  --cc-ink-2: #57534a;
  --cc-ink-3: #8a867a;
  --cc-ink-4: #b0ab9b;

  --cc-line:   #e2dccb;
  --cc-line-2: #ece7d9;

  --cc-green: #4d7c54;
  --cc-amber: #b5791f;
  --cc-red:   #b0483e;

  --cc-font-sans:         'Public Sans', system-ui, sans-serif;
  --cc-font-display:      'Playfair Display', Georgia, serif;
  --cc-font-display-soft: 'Playfair Display', Georgia, serif;
  --cc-font-mono:         'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  --cc-shadow-card: 0 1px 2px rgba(23, 20, 16, 0.05), 0 10px 30px rgba(23, 20, 16, 0.05);
  --cc-radius:    6px;
  --cc-radius-sm: 4px;

  /* Semantic chrome surfaces — the masthead band and the header button/pill
     "face". Broken out as their own tokens so dark mode can retune them
     without touching the components that consume them. */
  --cc-masthead: #f1ece0;
  --cc-btn-face: rgba(23, 20, 16, 0.03);

  /* Scrollbar + text selection — retuned per theme below. */
  --cc-scrollbar:       #d4cdbc;
  --cc-scrollbar-hover:  #c3bba6;
  --cc-selection: rgba(176, 122, 36, 0.20);

  /* Legacy-compat aliases — federation-remote agents (e.g. Oracle) reference
     these older var names; defined here so they resolve to Ivory values when
     an agent renders IN-SHELL (the agent's own :root only applies standalone). */
  --cc-cloud: var(--cc-bg);
  --cc-white: var(--cc-card);
  --cc-cream: var(--cc-gold-tint);
  --cc-muted: var(--cc-ink-2);
  --cc-serif: var(--cc-font-display);

  /* Native controls (time picker, checkbox, default scrollbar) follow this. */
  color-scheme: light;
}

/* ---------------------------------------------------------------------------
   DARK MODE — "Ivory Study, after hours".
   The same warm cream + brass system relit on a warm near-black ground
   (browns, not cold grays) so the palette still reads as ivory paper turned
   down for the evening. Activated by data-theme="dark" on <html> (set pre-paint
   from localStorage in index.html; toggled at runtime by shell/theme.js).

   The saturated brass accents (--cc-gold / --cc-gold-soft) are deliberately
   NOT overridden — they read on both grounds and back the SVG icon strokes that
   consume the literal token values. Only --cc-gold-bold (text/links) brightens.
   ------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --cc-bg:         #14120d;
  --cc-bg-soft:    #1b1811;
  --cc-bg-deep:    #201c14;
  --cc-bg-thread: #1d1912;
  --cc-card:       #1e1a13;

  /* "navy" is the raised-fill role (buttons, pills, icon squares, stat bands),
     always paired with light content — so in dark mode it inverts to a warm
     surface that sits ABOVE the card, not below it. Navy-as-text was migrated
     to --cc-ink so this inversion is safe. */
  --cc-navy:        #423a29;
  --cc-navy-soft:   #4d4432;
  --cc-navy-medium: #574d39;
  --cc-navy-deep:   #383021;

  /* Dark ground: lift the chat navy so it still reads blue over the warm-brown
     surface (not a muddy near-black). */
  --cc-chat-mine:   #3d5382;

  /* Scratchpad pens on the dark ground: the light-mode values are near-black
     here and would vanish, so both lift to legible tints that KEEP the
     grey-vs-navy distinction — the whole point of the two colours. */
  --cc-pen-member-a:      #b6b2aa;
  --cc-pen-member-b:    #7fa8d4;
  --cc-pen-member-a-bg:   rgba(182, 178, 170, 0.07);
  --cc-pen-member-b-bg: rgba(127, 168, 212, 0.09);

  /* Dark mode trades the ivory brass for a warm ORANGE accent — it contrasts
     harder against the warm-brown ground and reads more vividly than gold did.
     The base drives the agent-medallion rings/glyphs (via currentColor) and
     every gold fill/border; -bold is the brighter text/link/active tone. */
  --cc-gold:       #e07d33;
  --cc-gold-bold:  #f39a4d;
  --cc-gold-soft:  #cf7330;
  --cc-gold-tint:  #2c1c0f;
  --cc-gold-pale:  #2c1c0f;
  --cc-gold-faint: rgba(224, 125, 51, 0.30);
  --cc-gold-rgb:   224, 125, 51;

  --cc-accent-hi:       #f6a860;
  --cc-accent-line:     #e5893f;
  --cc-accent-line-2:   #cf7734;
  --cc-accent-tint-rgb: 224, 125, 51;

  --cc-ink:   #f2ede1;
  --cc-ink-2: #c4bca9;
  --cc-ink-3: #948c7b;
  --cc-ink-4: #6c6555;

  --cc-line:   #322c20;
  --cc-line-2: #2a251b;

  --cc-green: #6bb07a;
  --cc-amber: #d4972f;
  --cc-red:   #d9695f;

  --cc-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.5);

  --cc-masthead: #1a1610;
  --cc-btn-face: rgba(255, 255, 255, 0.05);

  --cc-scrollbar:       #3a3428;
  --cc-scrollbar-hover:  #4a4334;
  --cc-selection: rgba(215, 165, 63, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  background: var(--cc-bg);
  color: var(--cc-ink);
  font-family: var(--cc-font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--cc-selection); }
* { scrollbar-color: var(--cc-scrollbar) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--cc-scrollbar); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--cc-scrollbar-hover); border: 3px solid transparent; background-clip: content-box; }

/* Keyboard up: the keyboard COVERS the home indicator, so the safe-area
   allowance is no longer protecting anything — it just becomes dead space
   between the message box and the top of the keys. Zero it while the keyboard
   is open; useKeyboardInset() puts this class on <html>. */
:root.cc-kb-open {
  --cc-safe-bottom: 0px;
}
/* Command Center — interaction layer.
 *
 * DESIGN SAMPLE 3 — "The Study" (executive briefing-room dark theme).
 * Hover/motion retuned to the dark charcoal + brass palette; structure and
 * class names unchanged.
 *
 * Scoped TIGHTLY to what inline styles cannot express: :hover states,
 * transitions, and @keyframes. Imported once from src/main.jsx.
 */

/* --------------------------------------------------------------------------
 * Keyframes — live status dots
 * ------------------------------------------------------------------------ */
@keyframes cc-pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(95, 158, 125, 0.22); }
  50%      { box-shadow: 0 0 0 5px rgba(95, 158, 125, 0.1); }
}

.cc-live-dot {
  animation: cc-pulse-dot 2s ease-in-out infinite;
}
.cc-live-pulse {
  animation: cc-pulse-dot 1.8s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
 * Masthead nav links + roster medallions
 * ------------------------------------------------------------------------ */
.cc-masthead-link {
  transition: color 0.15s, border-color 0.15s;
}
.cc-masthead-link:hover {
  color: var(--cc-accent-hi);
}

.cc-medallion {
  transition: transform 0.18s, filter 0.18s;
}
.cc-medallion:hover {
  transform: translateY(-3px);
  filter: drop-shadow(0 6px 14px rgba(var(--cc-accent-tint-rgb), 0.25));
}
.cc-medallion:hover span:first-of-type {
  color: var(--cc-accent-hi);
}

/* --------------------------------------------------------------------------
 * Top bar buttons + member pill
 * ------------------------------------------------------------------------ */
.cc-top-btn,
.cc-member-pill {
  transition: background 0.15s, border-color 0.15s;
}
.cc-top-btn:hover,
.cc-member-pill:hover {
  border-color: var(--cc-accent-line);
  background: rgba(var(--cc-accent-tint-rgb), 0.14);
}

/* Sticky agent ribbon removed 2026-07-23 (it leaked across page
   navigations). Its classes (.cc-sticky-ribbon / .cc-ribbon-*) are
   intentionally gone; the roster grid is the sole agent-nav surface. */

/* --------------------------------------------------------------------------
 * Agents grid — tile hover lift + brass top-border scaleX reveal
 * ------------------------------------------------------------------------ */
.cc-agent-tile {
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s, color 0.18s;
}
.cc-agent-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cc-accent-line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s;
}
.cc-agent-item:hover .cc-agent-tile {
  border-color: var(--cc-accent-line-2);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
  color: var(--cc-accent-hi);
}
.cc-agent-item:hover .cc-agent-tile::before {
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
 * Quick Actions — primary + secondary button hovers
 * ------------------------------------------------------------------------ */
.cc-qa-primary {
  transition: background 0.15s, border-color 0.15s;
}
.cc-qa-primary:hover {
  background: #33466a;
  border-color: var(--cc-accent-line);
}
.cc-qa-btn {
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.cc-qa-btn:hover {
  background: #33466a;
  border-color: var(--cc-accent-line);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
.cc-qa-arrow {
  transition: transform 0.15s, color 0.15s;
}
.cc-qa-btn:hover .cc-qa-arrow {
  color: var(--cc-accent-hi);
  transform: translateX(2px);
}


/* --------------------------------------------------------------------------
 * Sign-offs — approve / reject buttons
 * ------------------------------------------------------------------------ */
.cc-signoff-btn {
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cc-signoff-btn-approve:hover { background: #4c8467; }
.cc-signoff-btn-reject:hover  { border-color: #b0413e; color: #cd6a63; }

/* --------------------------------------------------------------------------
 * Needs Attention — item row hover
 * ------------------------------------------------------------------------ */
.cc-attn-item {
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.cc-attn-item:hover {
  transform: translateX(2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  border-color: var(--cc-accent-line-2);
}

/* --------------------------------------------------------------------------
 * Live Activity — event row hover
 * ------------------------------------------------------------------------ */
.cc-activity-row {
  transition: background 0.12s;
}
.cc-activity-row:hover {
  background: rgba(var(--cc-accent-tint-rgb), 0.06);
}

/* Messages panel search — placeholder + clear button on the dark title bar. */
[data-testid="messages-search"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
[data-testid="messages-search"]::-webkit-search-cancel-button {
  filter: invert(1);
  opacity: 0.5;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
 * Week Calendar — day cell hover (today cell keeps its slate fill)
 * ------------------------------------------------------------------------ */
.cc-week-day {
  transition: border-color 0.15s, background 0.15s;
}
.cc-week-day:hover {
  border-color: var(--cc-accent-line);
}
/* Today's cell is a soft gold wash set inline per cell (2026-07-23), no longer
   a navy fill; this only carries its gold hover border. */
.cc-week-day.is-today:hover {
  border-color: var(--cc-gold, var(--cc-accent-line));
}

/* --------------------------------------------------------------------------
 * Generic agent-tile / cost-row / signoff-item — subtle shared hovers
 * ------------------------------------------------------------------------ */
.cc-hoverable {
  transition: background 0.15s, border-color 0.15s;
}

/* --------------------------------------------------------------------------
 * Masthead BB monogram — the asset is a black-on-transparent PNG, invisible on
 * the dark masthead. In dark mode recolor it to white (brightness(0) forces the
 * silhouette solid black preserving alpha, invert(1) flips black -> white).
 * Light mode leaves the original black lockup on the cream masthead untouched.
 * ------------------------------------------------------------------------ */
:root[data-theme="dark"] [data-testid="header-home-logo"] img {
  filter: brightness(0) invert(1);
}

/* --------------------------------------------------------------------------
 * Header focus rings — dark surfaces take a brass ring
 * ------------------------------------------------------------------------ */
[data-testid="header-home-logo"]:focus-visible,
[data-testid="header-home-title"]:focus-visible,
[data-testid="feedback-button"]:focus-visible,
[data-testid="header-notif-btn"]:focus-visible,
[data-testid="mobile-nav-toggle"]:focus-visible,
[data-testid="member-switcher"]:focus-visible {
  outline: 2px solid var(--cc-gold-bold, var(--cc-accent-line));
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
 * Stat band — clickable figure cells (tickets → Feedback, tasks → Tasks,
 * spend → Costs). Subtle tint + focus ring; the repo cell is static.
 * ------------------------------------------------------------------------ */
.cc-stat-cell {
  transition: background 0.15s;
}
.cc-stat-cell:hover {
  background: rgba(var(--cc-gold-rgb), 0.07);
}
.cc-stat-cell:focus-visible {
  outline: 2px solid var(--cc-gold-bold, var(--cc-accent-line));
  outline-offset: -2px;
}

/* --------------------------------------------------------------------------
 * Mobile masthead / drawer BB mark — same black-on-transparent PNG as the
 * desktop lockup, so recolor it to white in dark mode.
 * ------------------------------------------------------------------------ */
:root[data-theme="dark"] .cc-mobile-mark {
  filter: brightness(0) invert(1);
}

/* --------------------------------------------------------------------------
 * Mobile nav drawer — scrim fade + panel slide-in
 * ------------------------------------------------------------------------ */
@keyframes cc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes cc-drawer-in {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  [data-testid="mobile-nav-drawer"],
  [data-testid="mobile-nav-scrim"] {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
 * Skip-link + surface focus rings
 * ------------------------------------------------------------------------ */
.cc-skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  padding: 8px 16px;
  background: var(--cc-navy, #2a3a58);
  color: #ece7dc;
  border-radius: 4px;
  z-index: 10000;
  text-decoration: none;
  font-family: var(--cc-font-sans, system-ui);
  font-size: 13px;
}
.cc-skip-link:focus,
.cc-skip-link:focus-visible {
  top: 8px;
  outline: 2px solid var(--cc-gold-bold, var(--cc-accent-line));
  outline-offset: 2px;
}

[data-testid^="goal-row-"]:focus-visible,
[data-testid^="feedback-row-"]:focus-visible,
[data-testid^="feedback-bucket-header-"]:focus-visible,
[role="menuitem"]:focus-visible {
  outline: 2px solid var(--cc-gold-bold, var(--cc-accent-line));
  outline-offset: 2px;
}
/*$vite$:1*/