@import url('https://fonts.googleapis.com/css2?family=Anton&family=Roboto+Condensed:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

/* ============================================
   Statohm App — Neubrutalism Design System
   Post-login SaaS surfaces only (not landing)
   Inspired by hard borders, chunky type,
   hard offset shadows, flat color blocks
   ============================================ */

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

:root {
  /* Substrate — pale butter yellow (user swatch) */
  --paper: #FEF3B1;
  --paper-deep: #e8d47a;
  --surface: #fdf8e8;
  --surface-2: #fffdf3;
  --ink: #111111;
  --ink-soft: #2a2a2a;
  --muted: #5a5a5a;
  --line: #111111;

  /* Flat neubrutal color blocks (reference palette) */
  --block-green: #7ec45a;
  --block-green-deep: #5ea640;
  --block-red: #e07a6a;
  --block-red-deep: #c45a4a;
  --block-yellow: #f5c542;
  --block-yellow-deep: #e0a820;
  --block-blue: #6ba3d9;
  --block-blue-deep: #4a88c4;
  --block-gold: #e8b84a;
  --block-coral: #e88a7a;
  --block-sky: #7eb3e8;
  --block-pink: #e85a9a;
  --block-cream: #f7efd0;

  /* Semantic */
  --ok: var(--block-green);
  --warn: var(--block-yellow);
  --danger: var(--block-red);
  --info: var(--block-blue);
  --accent: var(--block-yellow);

  /* Hard shadows — pure offset, no blur */
  --shadow-1: 3px 3px 0 0 var(--ink);
  --shadow-2: 5px 5px 0 0 var(--ink);
  --shadow-3: 8px 8px 0 0 var(--ink);
  --shadow-press: 1px 1px 0 0 var(--ink);

  /* Borders */
  --b: 3px;
  --b-thick: 4px;
  --b-fat: 5px;

  /* Radius — slight only */
  --r: 10px;
  --r-sm: 6px;
  --r-pill: 999px;

  /* Type */
  --font-display: 'Anton', 'Roboto Condensed', system-ui, sans-serif;
  --font-cond: 'Roboto Condensed', system-ui, sans-serif;
  --font-sans: 'Roboto Condensed', system-ui, sans-serif;
  --font-body: 'Roboto Condensed', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --font-stamp: 'Roboto Condensed', system-ui, sans-serif;

  /* Layout */
  --sidebar-w: 260px;
  --topbar-h: 0px;
  --space-1: 0.35rem;
  --space-2: 0.65rem;
  --space-3: 1rem;
  --space-4: 1.35rem;
  --space-5: 1.75rem;
  --space-6: 2.5rem;
  --space-7: 3.5rem;
  --max: 1280px;

  /* Compat aliases for older page styles */
  --cream-50: var(--surface-2);
  --cream-100: var(--surface);
  --cream-200: var(--block-cream);
  --cream-300: #efe4bc;
  --cream-400: #e2d39a;
  --cream-500: #d4c27e;
  --cream-600: #bba85e;
  --red-100: #f8d4d0;
  --red-200: #f0b8b0;
  --red-300: #e59388;
  --red-400: var(--block-red);
  --red-500: var(--block-red-deep);
  --red-600: #a3382c;
  --mustard-100: #fff4d8;
  --mustard-200: #ffe6b3;
  --mustard-300: #ffd485;
  --mustard-400: var(--block-yellow);
  --mustard-500: var(--block-yellow-deep);
  --mustard-600: #c48410;
  --olive-100: #eef6e4;
  --olive-200: #d8ebc0;
  --olive-300: #b9d98e;
  --olive-400: var(--block-green);
  --olive-500: var(--block-green-deep);
  --olive-600: #3f7a2a;
  --blue-100: #e4f0fa;
  --blue-200: #c8dff3;
  --blue-300: #9fc6e8;
  --blue-400: var(--block-blue);
  --blue-500: var(--block-blue-deep);
  --blue-600: #2f6aa0;
  --brown-100: #f0e8e0;
  --brown-200: #e0d0c8;
  --brown-300: #c8b4a8;
  --brown-400: #ac9580;
  --brown-500: #8a7358;
  --brown-600: #685240;
  --black: var(--ink);
  --dark-gray: var(--ink-soft);
  --gray: var(--muted);
  --light-gray: #8a8a8a;
  --white: #fffef8;
  --shadow-sm: var(--shadow-1);
  --shadow-md: var(--shadow-2);
  --shadow-lg: var(--shadow-3);
  --shadow-xl: 10px 10px 0 0 var(--ink);
  --border-thin: 2px;
  --border-md: var(--b);
  --border-thick: var(--b-thick);
  --font-sans-legacy: var(--font-sans);
  --space-xs: var(--space-1);
  --space-sm: var(--space-2);
  --space-md: var(--space-3);
  --space-lg: var(--space-4);
  --space-xl: var(--space-5);
  --space-2xl: var(--space-6);
  --radius-sm: var(--r-sm);
  --radius-md: var(--r);
  --radius-lg: 14px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body, var(--font-sans));
  color: var(--ink);
  line-height: 1.5;
  min-height: 100dvh;
  /* User canvas — pale butter #FEF3B1 + soft dark grid */
  background-color: #FEF3B1;
  background-image:
    linear-gradient(rgba(17, 17, 17, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.055) 1px, transparent 1px);
  background-size: 24px 24px;
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }

/* Kill accidental horizontal scroll from mis-sized grids/tables */
html {
  overflow-x: clip;
}
body {
  overflow-x: clip;
}
.main, .main-inner {
  min-width: 0;
  max-width: 100%;
}
.app-shell {
  max-width: 100vw;
  overflow-x: clip;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* ============================================
   TYPE
   ============================================ */
h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ink);
  text-wrap: balance;
}

h1, .display-xl { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2, .display-lg { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.65rem); }
h4 { font-size: 1.1rem; font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.01em; }

p { color: var(--ink-soft); font-size: 0.98rem; }
.lead { font-size: 1.05rem; max-width: 56ch; color: var(--muted); }

.mono, .num, code, kbd, samp {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-1);
}

/* ============================================
   APP SHELL
   ============================================ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: var(--b-thick) solid var(--ink);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  z-index: 40;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  padding-bottom: var(--space-3);
  border-bottom: var(--b) solid var(--ink);
}

.sidebar-brand .mark {
  width: 42px;
  height: 42px;
  border: var(--b) solid var(--ink);
  background: var(--block-yellow);
  box-shadow: var(--shadow-1);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
  padding: 4px;
}
.sidebar-brand .mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.mobile-bar .brand-lock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mobile-bar .brand-lock .mark {
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  background: var(--block-yellow);
  box-shadow: 2px 2px 0 0 var(--ink);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 3px;
  flex-shrink: 0;
}
.mobile-bar .brand-lock .mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-brand .word {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.sidebar-brand .sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: var(--b) solid transparent;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

.sidebar-link .nav-ico {
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-link .nav-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-link:hover {
  background: var(--block-cream);
  border-color: var(--ink);
  color: var(--ink);
}

.sidebar-link.active {
  background: var(--block-yellow);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: var(--shadow-1);
  font-weight: 700;
}

.sidebar-foot {
  border-top: var(--b) solid var(--ink);
  padding-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.user-chip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--surface-2);
  border: var(--b) solid var(--ink);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-1);
}

.user-chip .email {
  font-size: 0.78rem;
  font-weight: 600;
  word-break: break-all;
  line-height: 1.3;
}

.main {
  padding: var(--space-5) var(--space-5) var(--space-7);
  min-width: 0;
  max-width: 100%;
}

.main-inner {
  max-width: var(--max);
  margin: 0 auto;
}

/* Mobile top bar */
.mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: var(--b-thick) solid var(--ink);
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-1);
}

.mobile-bar .word {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

/* ============================================
   COMPONENTS
   ============================================ */

.card {
  background: var(--surface);
  border: var(--b) solid var(--ink);
  border-radius: var(--r);
  padding: var(--space-4);
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: visible;

}

.card-flat {
  box-shadow: none;
}

.card-sm { padding: var(--space-3); }
.card-lg { padding: var(--space-5); }

.card-green { background: var(--block-green); }
.card-red { background: var(--block-red); color: var(--ink); }
.card-yellow { background: var(--block-yellow); }
.card-blue { background: var(--block-blue); }
.card-gold { background: var(--block-gold); }
.card-coral { background: var(--block-coral); }
.card-sky { background: var(--block-sky); }
.card-cream { background: var(--block-cream); }

.card-green p, .card-red p, .card-yellow p,
.card-blue p, .card-gold p, .card-coral p, .card-sky p {
  color: var(--ink-soft);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title .spark {
  width: 10px;
  height: 10px;
  background: var(--ink);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  border: var(--b) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
  white-space: nowrap;
  line-height: 1;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-2);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-press);
}

.btn-primary { background: var(--block-yellow); }
.btn-primary:hover { background: var(--block-yellow-deep); }

.btn-secondary { background: var(--surface-2); }
.btn-secondary:hover { background: var(--block-cream); }

.btn-danger { background: var(--block-red); }
.btn-danger:hover { background: var(--block-red-deep); }

.btn-success { background: var(--block-green); }
.btn-success:hover { background: var(--block-green-deep); }

.btn-info { background: var(--block-blue); }

.btn-ghost {
  background: transparent;
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--block-cream);
  box-shadow: var(--shadow-1);
}

.btn-sm { padding: 8px 12px; font-size: 0.75rem; }
.btn-lg { padding: 16px 24px; font-size: 0.95rem; }
.btn-block { width: 100%; }

/* Inputs */
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.92rem;
  border: var(--b) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.08s ease, transform 0.08s ease;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-2);
  background: #fff;
}

.input::placeholder { color: #9a9a9a; }
.textarea { min-height: 110px; resize: vertical; }
.select { cursor: pointer; appearance: auto; }

.input-error { border-color: var(--block-red-deep); background: #fff0ee; }

/* Badges / pills */
.badge, .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  line-height: 1;
  white-space: nowrap;
}

.badge-green, .role-ops, .status-active { background: var(--block-green); }
.badge-yellow, .role-finance, .status-completed { background: var(--block-yellow); }
.badge-red, .status-danger { background: var(--block-red); }
.badge-blue, .status-planned { background: var(--block-blue); }
.badge-cream { background: var(--block-cream); }
.badge-pink { background: var(--block-pink); color: #fff; border-color: var(--ink); }

.role-badge {
  display: inline-flex;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
}

/* Starburst (hiring-style callout) */
.burst {
  display: inline-grid;
  place-items: center;
  width: 110px;
  height: 110px;
  background: var(--block-pink);
  color: #fff;
  border: var(--b) solid var(--ink);
  clip-path: polygon(
    50% 0%, 61% 18%, 80% 10%, 76% 30%, 98% 35%, 82% 50%,
    98% 65%, 76% 70%, 80% 90%, 61% 82%, 50% 100%, 39% 82%,
    20% 90%, 24% 70%, 2% 65%, 18% 50%, 2% 35%, 24% 30%,
    20% 10%, 39% 18%
  );
  font-family: var(--font-display);
  font-size: 0.78rem;
  line-height: 1.1;
  text-align: center;
  box-shadow: none;
  transform: rotate(-8deg);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: var(--b) solid var(--ink);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.table th, .table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 2px solid var(--ink);
}

.table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--block-cream);
}

.table tr:last-child td { border-bottom: none; }
.table-striped tr:nth-child(even) td { background: rgba(255,255,255,0.45); }
.table-hover tr:hover td { background: var(--block-yellow); }

.table .num { font-weight: 600; }

/* Alerts */
.alert {
  padding: var(--space-3);
  border: var(--b) solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  margin-bottom: var(--space-3);
  font-weight: 500;
}
.alert-info { background: var(--block-sky); }
.alert-success { background: var(--block-green); }
.alert-warning { background: var(--block-yellow); }
.alert-danger { background: var(--block-red); }

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.stat-card {
  background: var(--surface);
  border: var(--b) solid var(--ink);
  border-radius: var(--r);
  padding: var(--space-4);
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 10px;
  height: 10px;
  background: var(--ink);
  transform: rotate(45deg);
}

.stat-card.tint-green { background: var(--block-green); }
.stat-card.tint-yellow { background: var(--block-yellow); }
.stat-card.tint-blue { background: var(--block-blue); }
.stat-card.tint-red { background: var(--block-red); }
.stat-card.tint-cream { background: var(--block-cream); }

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 10px;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}
.stat-trend-up { color: #1f5a12; }
.stat-trend-down { color: #7a1f14; }

/* Page header */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.page-head .titles h1 {
  margin-top: 4px;
}

.page-head .actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

/* Welcome / hero band inside app */
.welcome-banner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-4);
  background: var(--surface);
  border: var(--b-thick) solid var(--ink);
  border-radius: var(--r);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-3);
  position: relative;
  overflow: visible;
}

.welcome-banner .welcome-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: center;
  overflow: visible;
  min-width: 0;
}

.welcome-banner .welcome-art {
  position: relative;
  z-index: 1;
  border: var(--b) solid var(--ink);
  border-radius: var(--r-sm);
  overflow: hidden;
  box-shadow: var(--shadow-2);
  background: var(--block-cream);
  min-height: 160px;
}

.welcome-banner .welcome-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 160px;
}

.welcome-banner h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

/* Browser chrome mock (packs) */
.browser-frame {
  background: var(--surface);
  border: var(--b-thick) solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}

.browser-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--block-green);
  border-bottom: var(--b) solid var(--ink);
}

.browser-chrome .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--surface);
}
.browser-chrome .dot.r { background: var(--block-red); }
.browser-chrome .dot.y { background: var(--block-yellow); }
.browser-chrome .dot.g { background: var(--block-green-deep); }

.browser-chrome .title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.browser-body { padding: var(--space-5); background: var(--surface-2); }

/* Quick action tiles */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.action-card {
  text-align: left;
  padding: var(--space-4);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 180px;
}

.action-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-3);
}

.action-card:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-press);
}

.action-icon {
  width: 64px;
  height: 64px;
  border: var(--b) solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.action-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.action-card h3 {
  font-size: 1.15rem;
}

.action-card p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: auto;
}

/* Well list / cards */
.well-list { display: grid; gap: var(--space-3); }

.well-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

.well-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-3);
  background: var(--block-cream);
}

.well-info h3 { margin-bottom: 6px; font-size: 1.15rem; }
.well-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.well-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--block-green);
  flex-shrink: 0;
}
.status-dot.warning { background: var(--block-yellow); }
.status-dot.danger { background: var(--block-red); }
.status-dot.planned, .status-dot.completed { background: var(--block-blue); }
.status-dot.active { background: var(--block-green); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-6);
  background: var(--surface);
  border: var(--b) dashed var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow-2);
}

.empty-state-icon {
  width: min(280px, 70%);
  margin: 0 auto var(--space-4);
  border: var(--b) solid var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-2);
  background: var(--block-cream);
}

.empty-state-icon img {
  width: 100%;
  height: auto;
}

/* Charts */
.chart-container {
  background: var(--surface);
  border: var(--b) solid var(--ink);
  border-radius: var(--r);
  padding: var(--space-4);
  box-shadow: var(--shadow-2);
  margin-bottom: 0;
  min-height: 280px;
}

.chart-container canvas { max-height: 260px; }

.chart-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: var(--space-3);
}

/* Filters / chips row */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: var(--space-3) 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  box-shadow: 2px 2px 0 0 var(--ink);
}

/* Progress */
.progress {
  height: 14px;
  background: var(--surface-2);
  border: 2px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--block-green);
  border-right: 2px solid var(--ink);
}
.progress.warn > span { background: var(--block-yellow); }
.progress.danger > span { background: var(--block-red); }

/* Forms */
.form-group { margin-bottom: var(--space-4); }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}
.fieldset {
  border: var(--b) solid var(--ink);
  border-radius: var(--r);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.fieldset legend {
  padding: 0 8px;
  font-family: var(--font-display);
  font-size: 0.95rem;
}

/* Divider */
.divider {
  height: var(--b);
  background: var(--ink);
  width: 100%;
  margin: var(--space-4) 0;
}

/* Section block */
.section-block { margin-bottom: var(--space-5); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

/* Grid helpers */
.grid { display: grid; gap: var(--space-3); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  border-bottom: var(--b) solid var(--ink);
  padding-bottom: 0;
}

.tab {
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: var(--b) solid transparent;
  border-bottom: none;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  position: relative;
  top: var(--b);
}

.tab.active {
  background: var(--surface);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: none;
}

.tab:hover:not(.active) {
  background: var(--block-cream);
  color: var(--ink);
}

/* Activity feed */
.activity-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--space-3);
  padding: 12px 0;
  border-bottom: 2px solid rgba(17,17,17,0.12);
}
.activity-row:last-child { border-bottom: none; }
.activity-row .when {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.activity-row .what strong {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}
.activity-row .what span {
  font-size: 0.88rem;
  color: var(--muted);
}

/* Utility */
.mb-xs { margin-bottom: var(--space-1); }
.mb-sm { margin-bottom: var(--space-2); }
.mb-md { margin-bottom: var(--space-3); }
.mb-lg { margin-bottom: var(--space-4); }
.mb-xl { margin-bottom: var(--space-5); }
.mt-xs { margin-top: var(--space-1); }
.mt-sm { margin-top: var(--space-2); }
.mt-md { margin-top: var(--space-3); }
.mt-lg { margin-top: var(--space-4); }
.mt-xl { margin-top: var(--space-5); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-red { color: var(--block-red-deep); }
.text-mustard { color: #9a6a00; }
.text-olive { color: #2f6a1c; }
.text-blue { color: #1f5a8a; }
.text-gray { color: var(--muted); }

.bg-cream { background: var(--block-cream); }
.bg-mustard { background: var(--block-yellow); }
.bg-olive { background: var(--block-green); }
.bg-red { background: var(--block-red); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-1); }
.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-3); }
.gap-lg { gap: var(--space-4); }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* User badge legacy */
.user-badge {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--surface-2);
  border: var(--b) solid var(--ink);
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-1);
}

/* Header legacy (if used) */
.header {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: var(--b-thick) solid var(--ink);
  z-index: 100;
  box-shadow: var(--shadow-1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.nav { display: flex; align-items: center; gap: var(--space-3); }
.user-menu { display: flex; align-items: center; gap: var(--space-3); }

.hero {
  background: var(--surface);
  border: var(--b-thick) solid var(--ink);
  border-radius: var(--r);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-3);
  position: relative;
  overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper-deep); border-left: 2px solid var(--ink); }
::-webkit-scrollbar-thumb {
  background: var(--block-yellow);
  border: 2px solid var(--ink);
}
::-webkit-scrollbar-thumb:hover { background: var(--block-yellow-deep); }

:focus-visible {
  outline: 3px solid var(--block-blue);
  outline-offset: 2px;
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--block-cream) 25%, var(--surface) 50%, var(--block-cream) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border: 2px solid var(--ink);
  border-radius: var(--r-sm);
  min-height: 1rem;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Responsive */
@media (max-width: 1100px) {
  .stats-row, .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .welcome-banner { grid-template-columns: 1fr; }
  .welcome-banner .welcome-art { min-height: 140px; max-height: 180px; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-3);
    z-index: 60;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-bar { display: flex; }
  .main { padding: var(--space-4); min-width: 0; }
  .main-inner { padding: 0; max-width: 100%; min-width: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .page-head .titles { min-width: 0; max-width: 100%; }
  .lead { max-width: 100%; }
  /* Tables always scroll inside a box instead of blowing the page */
  .table-wrap, .table-scroll, .rp-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.data-table, table.afe-table, .rp-table {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  /* Keep 2×2 density — never full-bleed 1-col stacks for these */
  .stats-row, .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { align-items: flex-start; }
  .well-card { flex-direction: column; align-items: flex-start; }
  .btn { max-width: 100%; }
  .chip-row { flex-wrap: wrap; }
  h1, .display-xl { font-size: clamp(1.6rem, 8vw, 2.2rem); }
  .welcome-banner { padding: 0.85rem; }
}

@media print {
  .sidebar, .mobile-bar, .no-print { display: none !important; }
  .app-shell { display: block; }
  .main { padding: 0; }
  body { background: white; }
  .card, .stat-card, .chart-container { box-shadow: none; }
}


/* ===== Performance: modern image source without visual/layout changes ===== */
.speed-picture {
  display: block;
  width: 100%;
  height: 100%;
}
.speed-picture > img {
  display: block;
  max-width: 100%;
}

/* ===== Performance (safe) ===== */
/* NOTE: content-visibility + contain-intrinsic-size caused blank card shells
   on reports/dashboard (empty 240px boxes). Keep only for inactive tabs. */
.tab-content:not(.active) {
  content-visibility: hidden;
  contain-intrinsic-size: 0 0;
}
/* Faster tap response on interactive controls */
a, button, .btn, .sidebar-link, .tab-button, .well-tile, .report-card {
  touch-action: manipulation;
}
/* Avoid layout thrash on images */
img {
  max-width: 100%;
  height: auto;
  /* cv off */
}
/* GPU-friendly hovers already present; keep scroll smooth on chat/main */
.main, .chat-thread, .sidebar-nav {
  -webkit-overflow-scrolling: touch;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: auto; } /* instant > smooth for app chrome */
}

html.rig-nav-pending body {
  cursor: progress;
}
html.rig-nav-pending .main {
  opacity: 0.92;
  transition: opacity 0.08s linear;
}


/* ui-clean-2026 — shared overflow / pack / tab guards */
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 3px solid var(--ink);
  background: var(--surface);
}
.table-scroll > table {
  margin: 0;
  width: max-content;
  min-width: 100%;
}
.tab-nav, .report-tabs, .rp-seg {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
}
.pack-page .section {
  overflow-x: auto;
}
.pack-page .data-table {
  display: block;
  width: 100%;
  overflow-x: auto;
}
/* Actually keep table layout; wrap parent instead — fix below in pack CSS */
body.pack-page {
  overflow-x: clip;
  max-width: 100vw;
}
body.pack-page .report-container,
body.pack-page .export-container {
  max-width: min(1100px, 100%);
  box-sizing: border-box;
}
body.pack-page .action-bar {
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  padding: 0.75rem;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
body.pack-page .action-bar .btn {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.78rem;
  padding: 0.5rem 0.75rem;
}
@media (max-width: 640px) {
  body.pack-page { padding: 0.75rem 0.75rem 5.5rem; }
  body.pack-page .section { padding: 1rem; }
  body.pack-page .action-bar .btn { flex: 1 1 calc(50% - 0.5rem); text-align: center; }
}


/* ui-clean-boxfix */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}
.app-shell {
  width: 100%;
  max-width: 100%;
}
.main {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.main-inner {
  width: 100%;
  max-width: min(var(--max), 100%);
  box-sizing: border-box;
}
.mobile-bar {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
canvas {
  max-width: 100% !important;
}
.chart-container-wrapper,
.chart-container,
.chart-box {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}
/* Chart.js parent must shrink */
.chart-card, .chart-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
@media (max-width: 900px) {
  .app-shell {
    width: 100%;
    max-width: 100vw;
  }
  /* Sidebar is overlay — don't let it create a layout track width */
  .sidebar {
    width: min(var(--sidebar-w), 86vw);
    max-width: 86vw;
  }
  .main {
    width: 100vw;
    max-width: 100vw;
    grid-column: 1 / -1;
  }
}

/* === FONTS LIVE v23 — literal families so it always paints === */
html, body {
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif !important;
}
h1, h2, h3,
.display, .display-xl, .display-lg,
.page-head h1, .page-head h2,
.titles h1, .titles h2,
.set-hero h1, .set-card-h h2,
.welcome-banner h2, .welcome-banner h1,
.section-title, .report-title,
.chat-top h1, .chat-empty h2,
#reportsTitle, #reportsLead + h1,
.well-tile h3, .well-info h3,
.action-card h3, .card h2, .card h3,
.chart-section h2, .chart-card h3, .chart-card h4,
.insight-card h4,
.sidebar-brand .word, .mobile-bar .word {
  font-family: "Anton", "Impact", "Arial Black", sans-serif !important;
  font-weight: 400 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.12 !important;
}
.lead, p, li, label, td, th, .pref-copy, .pref-copy strong, .pref-copy span,
.action-card p, .well-tile p, .welcome-banner p, .set-hero .lead,
.chat-top .lead, .meta-value, .well-meta, input, select, textarea {
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif !important;
}
.eyebrow, .stamp, .label, .field-label, .meta-label, .stat-label, .k,
.chip, .tag, .role-badge, .report-tab, .tab-button,
.btn, button.btn, a.btn,
.sidebar-link, .sidebar-brand .sub, .mobile-bar .btn {
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.stat-value, .num, .money, .insight-value, .mono, code, kbd {
  font-family: "IBM Plex Mono", ui-monospace, monospace !important;
  font-variant-numeric: tabular-nums;
}

/* === LAYOUT CONSISTENCY v24 ===
   Fix clipped thick titles, uneven section spacing, overflow traps.
   ============================================================ */

/* Thick Anton needs room — never clip headings */
h1, h2, h3, h4, .display, .display-xl, .display-lg,
.page-head h1, .titles h1, .section-title, .report-title,
.chart-section h2, .chart-card h3, .set-hero h1, .set-card-h h2,
.welcome-banner h2, .well-tile h3, .action-card h3, .chat-top h1 {
  line-height: 1.12 !important;
  overflow: visible !important;
  text-overflow: unset !important;
  white-space: normal !important;
  padding-top: 0.12em;   /* optical room for Anton caps */
  padding-bottom: 0.14em;
  max-width: 100%;
  word-break: normal;
  overflow-wrap: anywhere; /* long titles wrap instead of clip */
  hyphens: manual;
}

/* Section rhythm — same spacing language everywhere */
.section-block,
.chart-section,
.set-card,
.reports-header + *,
.page-head {
  margin-bottom: 1.15rem;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  min-width: 0;
}
.section-head h2,
.chart-section > h2,
.section-block > h2 {
  margin: 0 0 0.15rem 0;
  min-width: 0;
  flex: 1 1 auto;
}

/* Cards / panels: don't clip type; still contain children width */
.card,
.chart-section,
.chart-card,
.insight-card,
.report-card,
.set-card,
.well-tile,
.action-card,
.stat-card,
.welcome-banner,
.set-hero,
.rp-gen-cta {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}
/* Media-only overflow (images/charts), not text containers */
.welcome-art,
.action-icon,
.chart-container,
.chart-container-wrapper,
.chart-box,
.browser-frame,
.progress-bar,
.nav-ico {
  overflow: hidden;
}

/* Nested grids always able to shrink inside phone shells */
.insights-grid,
.report-grid,
.stats-row,
.quick-actions,
.grid,
.grid-2,
.grid-3,
.grid-4,
.well-grid,
.wells-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.insight-card,
.report-card,
.stat-card,
.action-card,
.well-tile {
  min-width: 0;
}

/* Page head stack spacing */
.page-head .titles {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.page-head .titles h1 {
  margin: 0;
}
.page-head .lead,
.titles .lead {
  margin: 0;
  max-width: 42rem;
}

/* Reports: chart section title was the clipped example */
.chart-section {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 0;
  overflow: visible !important;
}
.chart-section > h2 {
  display: block;
  width: 100%;
  margin: 0 0 0.85rem 0 !important;
  padding: 0.1em 0.15rem 0.15em 0 !important;
  line-height: 1.1 !important;
  overflow: visible !important;
}
.insights-grid {
  gap: 0.75rem !important;
}
.insight-card {
  padding: 0.9rem 1rem !important;
  overflow: visible !important;
}
.insight-card h4 {
  line-height: 1.15 !important;
  margin: 0 0 0.5rem 0 !important;
  overflow: visible !important;
}

/* Dashboard section heads */
.section-block .section-head h2 {
  line-height: 1.1 !important;
  overflow: visible !important;
  padding-bottom: 0.1em;
}

/* Tabs / chips don't collide with titles */
.report-tabs,
.tab-nav {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}

/* Main column padding consistency */
.main-inner {
  padding-bottom: 2rem;
}
@media (max-width: 900px) {
  .main-inner {
    padding-bottom: 1.5rem;
  }
  .chart-section > h2,
  .section-head h2,
  .page-head h1 {
    font-size: clamp(1.35rem, 6.5vw, 1.85rem) !important;
    line-height: 1.12 !important;
  }
}
@media (max-width: 640px) {
  .chart-section > h2 {
    font-size: clamp(1.25rem, 7vw, 1.55rem) !important;
    letter-spacing: -0.01em !important;
  }
  .insights-grid {
    gap: 0.55rem !important;
  }
  .section-block,
  .chart-section {
    margin-bottom: 1rem !important;
  }
}

/* Soft-wrap mega titles instead of bleeding under rounded frames */
.page-head h1,
.chart-section h2,
.section-head h2 {
  text-wrap: balance;
}

/* v24b — welcome + section title glyph room */
.welcome-banner {
  overflow: visible !important;
}
.welcome-banner .welcome-copy {
  overflow: visible !important;
  min-width: 0;
}
.welcome-banner h2,
#welcomeTitle {
  line-height: 1.12 !important;
  overflow: visible !important;
  padding: 0.12em 0.05em 0.16em 0 !important;
  margin: 0 !important;
}
.welcome-art {
  overflow: hidden !important; /* image only */
}
.section-head h2,
.chart-section > h2,
.section-title {
  line-height: 1.2 !important;
  padding: 0.18em 0.15rem 0.22em 0 !important;
  overflow: visible !important;
  min-height: 1.35em;
}
/* action cards: title room */
.action-card h3 {
  line-height: 1.15 !important;
  overflow: visible !important;
  padding-bottom: 0.1em;
}

/* === BUTTER CANVAS v30 — user swatch #FEF3B1 ===
   HEX #FEF3B1 · RGB 254/243/177 (sampled from user image)
   Pale butter yellow → dark ink on bare titles. */
:root {
  --paper: #FEF3B1;
  --paper-deep: #e8d47a;
  --canvas: #FEF3B1;
  --on-canvas: #111111;
}

html, body,
body.role-ops,
body.role-finance {
  background-color: #FEF3B1 !important;
  background-image:
    linear-gradient(rgba(17, 17, 17, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.06) 1px, transparent 1px) !important;
  background-size: 24px 24px !important;
  background-attachment: fixed !important;
}

.app-shell,
.main,
.main-inner {
  background: transparent !important;
}

/* Chrome stays cream on butter canvas */
.sidebar {
  background: #fffcf2 !important;
}
.mobile-bar {
  background: #fffcf2 !important;
  border-bottom: 3px solid var(--ink);
}

/* Type on bare butter canvas — dark ink for contrast */
.page-head h1,
.page-head h2,
.titles h1,
.titles h2,
.section-head h2,
.section-block > h2,
.chart-section > h2,
.section-title,
.chat-top h1,
.set-hero h1,
#reportsTitle,
#welcomeTitle {
  color: #111111 !important;
}
.page-head .lead,
.titles .lead,
.section-head .lead,
.chat-top .lead,
.set-hero .lead,
#reportsLead,
.eyebrow,
.page-head .eyebrow,
.titles .eyebrow,
.chat-top .eyebrow {
  color: rgba(17, 17, 17, 0.72) !important;
}

/* Cream panels keep dark ink */
.card,
.card h1, .card h2, .card h3, .card h4,
.card p, .card .lead, .card .eyebrow,
.welcome-banner,
.welcome-banner h1, .welcome-banner h2, .welcome-banner h3,
.welcome-banner p, .welcome-banner .lead, .welcome-banner .eyebrow,
.action-card, .action-card h3, .action-card p,
.stat-card, .stat-card .stat-value, .stat-card .stat-label,
.report-card, .report-card h3, .report-card p, .report-card-title,
.insight-card, .insight-card h4, .insight-card p,
.set-card, .set-card h2, .set-card h3, .set-card p, .set-card .lead,
.set-hero,
.well-tile, .well-tile h3, .well-tile p,
.well-card, .well-card h3,
.rp-gen-cta, .rp-gen-cta h3, .rp-gen-cta p,
.chart-card, .chart-card h3, .chart-card h4,
.empty-state, .empty-state h3,
.chat-shell, .chat-empty, .chat-empty h2, .chat-empty p {
  color: var(--ink);
}
.set-hero h1,
.set-hero .lead,
.set-hero .eyebrow,
.welcome-banner h2,
.welcome-banner .lead,
.welcome-banner .eyebrow,
#welcomeTitle {
  color: var(--ink) !important;
}

/* Filters / bare labels on butter canvas */
.filters .field-label,
.filters label,
.main-inner > .lead {
  color: rgba(17, 17, 17, 0.72);
}

/* Scrollbar track — deeper butter */
::-webkit-scrollbar-track {
  background: #e8d47a !important;
}

/* === MOBILE BREATHE v32 — less clump, less repetition ===
   Keep art hidden on phone; drop duplicate hero CTAs;
   real gutters; stats slightly flatter than action tiles. */
@media (max-width: 900px) {
  .welcome-banner .welcome-art { display: none !important; }
  .welcome-hero-ctas { display: none !important; }

  .welcome-banner {
    grid-template-columns: 1fr !important;
    gap: 0.55rem !important;
    padding: 1rem 1.05rem !important;
    margin-bottom: 1rem !important;
  }
  .welcome-banner .welcome-copy { gap: 0.5rem !important; }
  .welcome-banner h2,
  #welcomeTitle {
    font-size: clamp(1.45rem, 5.8vw, 1.85rem) !important;
    line-height: 1.12 !important;
    margin: 0 !important;
    padding: 0.08em 0 0.1em !important;
  }
  .welcome-banner .lead,
  #welcomeMessage {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    max-width: 36ch;
    display: block !important;
    overflow: visible !important;
  }
  .welcome-banner .chip-row {
    margin: 0.15rem 0 0 !important;
    gap: 8px !important;
  }

  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
    margin-bottom: 1.15rem !important;
  }
  .action-card {
    min-height: 0 !important;
    padding: 0.9rem 0.95rem !important;
    gap: 0.55rem !important;
  }
  .action-icon { width: 44px !important; height: 44px !important; }
  .action-card h3 {
    font-size: 1.02rem !important;
    line-height: 1.15 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .action-card p {
    font-size: 0.78rem !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
    margin-bottom: 1.15rem !important;
  }
  .stat-card {
    padding: 0.75rem 0.85rem !important;
    box-shadow: 3px 3px 0 0 var(--ink) !important;
  }
  .stat-value {
    font-size: clamp(1.4rem, 5.2vw, 1.75rem) !important;
    line-height: 1 !important;
  }
  .stat-label {
    font-size: 0.64rem !important;
    margin-top: 8px !important;
  }

  .main { padding: 0.9rem 0.9rem 1.75rem !important; }
  .section-block { margin-bottom: 1.1rem !important; }
  .chart-container {
    min-height: 210px !important;
    padding: 0.9rem !important;
  }
}

@media (max-width: 640px) {
  .welcome-banner .welcome-art { display: none !important; }
  .welcome-hero-ctas { display: none !important; }
}
