:root {
  --bg: #f6f4f1;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --text: #1c1917;
  --text-muted: #78716c;
  --border: #e7e5e4;
  --primary: #0d5c4b;
  --primary-light: #e8f3f0;
  --primary-hover: #094539;
  --accent: #c17f3e;
  --accent-light: #fdf6ee;
  --danger: #b91c1c;
  --danger-light: #fef2f2;
  --warning: #b45309;
  --warning-light: #fffbeb;
  --success: #15803d;
  --success-light: #f0fdf4;
  --info: #1d4ed8;
  --sidebar-w: 260px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(28, 25, 23, 0.06), 0 4px 12px rgba(28, 25, 23, 0.04);
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--text);
  color: #fafaf9;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.sidebar-brand p {
  font-size: 0.75rem;
  color: #a8a29e;
  margin-top: 0.25rem;
}

.nav-section {
  padding: 1rem 0.75rem 0.5rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #78716c;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  margin: 0.1rem 0.5rem;
  border-radius: var(--radius-sm);
  color: #d6d3d1;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; }

.nav-icon { width: 1.25rem; text-align: center; opacity: 0.9; }

.premier-strip {
  margin: auto 0.75rem 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #1a3a32 0%, #0d5c4b 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(193, 127, 62, 0.35);
}

.premier-strip .partner-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
}

.premier-strip h3 {
  font-size: 0.85rem;
  color: #fff;
  margin: 0.35rem 0 0.25rem;
  font-weight: 600;
}

.premier-strip p {
  font-size: 0.7rem;
  color: #a8c4bc;
  line-height: 1.4;
}

.premier-strip a {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 2rem 2.5rem 3rem;
  max-width: 1400px;
}

.page-header {
  margin-bottom: 1.75rem;
}

.page-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-header p {
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-size: 0.95rem;
}

/* Cards & grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-card .value {
  font-size: 1.65rem;
  font-weight: 700;
  margin-top: 0.25rem;
  letter-spacing: -0.02em;
}

.stat-card .sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.stat-card.highlight { border-color: var(--primary); background: var(--primary-light); }
.stat-card.warn { border-color: #fcd34d; background: var(--warning-light); }
.stat-card.danger { border-color: #fca5a5; background: var(--danger-light); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }

@media (max-width: 1024px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.panel-body { padding: 0; }

.panel-body.padded { padding: 1.25rem; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.data-table th {
  text-align: left;
  padding: 0.75rem 1.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: #eff6ff; color: var(--info); }
.badge-neutral { background: #f5f5f4; color: var(--text-muted); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  position: relative;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(28,25,23,0.10); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(28,25,23,0.08); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(193,127,62,0.18); transform: none; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-primary:focus-visible { outline-color: var(--accent); box-shadow: 0 0 0 4px rgba(193,127,62,0.24); }

.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface); border-color: var(--text-muted); color: var(--text); }
.btn-secondary:focus-visible { outline-color: var(--primary); box-shadow: 0 0 0 4px rgba(13,92,75,0.18); }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

/* Loading state — JS sets data-loading=true on submit; CSS handles look + lock */
.btn[data-loading="true"],
.btn[disabled],
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.85;
  pointer-events: none;
}
.btn[data-loading="true"] { color: transparent; }
.btn[data-loading="true"]::after {
  content: attr(data-loading-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  color: currentColor;
  font-weight: 600;
}
.btn-primary[data-loading="true"]::after { color: #fff; }
.btn-secondary[data-loading="true"]::after { color: var(--text); }
.btn[data-loading="true"]::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 0.85rem;
  height: 0.85rem;
  margin-top: -0.45rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: 0.7;
  animation: btn-spin 0.7s linear infinite;
}
.btn-primary[data-loading="true"]::before { color: #fff; }
.btn-secondary[data-loading="true"]::before { color: var(--text); }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: background 0.01ms; }
  .btn:hover { transform: none; box-shadow: none; }
  .btn[data-loading="true"]::before { animation: none; opacity: 0.5; }
}

/* List items */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.list-item:last-child { border-bottom: none; }

.list-item h4 { font-size: 0.9rem; font-weight: 600; }
.list-item .meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }

.empty-state {
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
}

.task-checklist {
  list-style: none;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.task-checklist li { padding: 0.15rem 0; }
.task-checklist li.done { text-decoration: line-through; color: var(--success); }

/* Premier hero */
.premier-hero {
  background: linear-gradient(120deg, #0d5c4b 0%, #1a4d42 50%, #2d1f14 100%);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  color: #fff;
  margin-bottom: 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.premier-hero h2 { font-size: 1.5rem; font-weight: 700; }
.premier-hero p { opacity: 0.9; margin-top: 0.5rem; max-width: 520px; font-size: 0.95rem; }

.premier-hero .discount-pill {
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.product-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.product-chip {
  background: rgba(255,255,255,0.12);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

/* Filters */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.filter-bar a {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
}

.filter-bar a:hover, .filter-bar a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Forms */
.quick-form {
  display: grid;
  gap: 0.75rem;
  max-width: 400px;
}

.quick-form label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.quick-form input, .quick-form select, .quick-form textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
}

.quick-form textarea { min-height: 80px; resize: vertical; }

/* Mobile */
.menu-toggle { display: none; }

/* Flooring catalog */
.lowes-ref-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: #004990;
  color: #fff;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.lowes-ref-bar a { color: #ffd700; font-weight: 600; }
.lowes-badge {
  background: #fff;
  color: #004990;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.flooring-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .flooring-layout { grid-template-columns: 1fr; }
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}

.product-card:hover, .product-card.selected {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(13, 92, 75, 0.15);
}

.product-swatch {
  height: 120px;
  position: relative;
}

.product-category-tag {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.product-card-body { padding: 1rem 1.1rem 1.15rem; }

.product-brand {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.product-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0.25rem 0 0.35rem;
  line-height: 1.3;
}

.product-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}

.price-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.price-premier {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.price-premier small { font-size: 0.75rem; font-weight: 500; }

.strikethrough {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.product-meta { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.product-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.estimator-panel { position: sticky; top: 1rem; }

.est-preview {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.est-preview.hidden { display: none; }

.est-preview-swatch {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.quote-breakdown {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin: 0.5rem 0;
}

.quote-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.3rem 0;
}

.quote-line.savings { color: var(--primary); font-weight: 500; }
.quote-line.total {
  border-top: 1px solid var(--border);
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
}

.quote-savings-pill {
  text-align: center;
  font-size: 0.8rem;
  color: var(--success);
  margin-top: 0.5rem;
  padding: 0.4rem;
  background: var(--success-light);
  border-radius: var(--radius-sm);
}

.mini-product {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.mini-product:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
}

.mini-product .swatch {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
}

.mini-product .price {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.help-text { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.task-checklist {
  list-style: none;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.task-checklist li::before { content: "○ "; }
.task-checklist li.done { color: var(--success); }
.task-checklist li.done::before { content: "✓ "; }

.featured-mini { display: flex; flex-direction: column; gap: 0.5rem; }

.meta { font-size: 0.8rem; color: var(--text-muted); }

/* Project accordion & stages (Loby) */
.project-accordion { display: flex; flex-direction: column; gap: 0.75rem; }

.project-row-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.project-row-header:hover { background: var(--surface-2); }

.project-row-header .caret {
  color: var(--primary);
  font-size: 0.75rem;
  width: 1rem;
  flex-shrink: 0;
}

.project-row-title { flex: 1; min-width: 0; }
.project-row-title h3 { font-size: 1rem; margin: 0; }
.project-row-title a { color: inherit; text-decoration: none; }
.project-row-title a:hover { color: var(--primary); }

.project-stages-panel {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

.project-stages-panel.hidden { display: none; }

.stages-track {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding-top: 1rem;
}

.stage-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 100px;
}

.stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.stage-active .stage-dot,
.stage-step.stage-active .stage-dot { background: var(--primary); }
.stage-step.stage-complete .stage-dot { background: var(--success); }

.stage-name { font-size: 0.85rem; font-weight: 600; }

.subprojects-list { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.subprojects-list h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.5rem; }

/* Visualizations */
.viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.viz-panel .viz-body { min-height: 140px; }

.chart-svg { width: 100%; max-width: 280px; height: auto; display: block; margin: 0 auto; }

.chart-label { fill: var(--text-muted); }

.chart-caption, .chart-insight {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.needs-attention-callout {
  font-size: 0.8rem;
  color: var(--danger);
  font-weight: 600;
  margin-top: 0.5rem;
}

.delta-warn { font-size: 0.75rem; color: var(--warning); display: block; margin-top: 0.25rem; }

.health-banner {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.health-banner.attention { border-color: var(--warning); background: var(--warning-light); }

.health-score-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--score, 75) * 3.6deg), var(--border) 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.health-score-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  background: var(--surface);
  border-radius: 50%;
}

.health-value, .health-label {
  position: relative;
  z-index: 1;
  font-weight: 700;
}

.health-value { font-size: 1.5rem; color: var(--primary); }

.health-label { font-size: 0.55rem; text-transform: uppercase; color: var(--text-muted); }

.health-detail .attention-list { margin: 0.5rem 0 0 1rem; font-size: 0.85rem; }

.audit-panel .audit-event {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.audit-type { font-weight: 600; font-size: 0.85rem; }

.audit-meta { font-size: 0.75rem; color: var(--text-muted); margin-left: 0.5rem; }

.stage-progress-mini { max-width: 200px; margin: 0.35rem 0; }

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 1.25rem; }
  .menu-toggle {
    display: block;
    position: fixed;
    top: 1rem; left: 1rem;
    z-index: 101;
    background: var(--text);
    color: #fff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
  }
}

/* a11y + flash + reduced-motion — added by loby/ux-polish 2026-05-25 */
.skip-link { position: absolute; left: -9999px; top: 0.5rem; padding: 0.55rem 0.85rem; background: var(--text); color: #fff; border-radius: var(--radius-sm); font-weight: 600; z-index: 200; }
.skip-link:focus { left: 0.5rem; outline: 2px solid var(--accent); outline-offset: 2px; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.nav-link:focus-visible { outline-color: #fff; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: var(--primary); outline-offset: 0; border-color: var(--primary); }
main:focus { outline: none; }
.flash-stack { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.flash { padding: 0.65rem 0.85rem; border-radius: var(--radius-sm); font-size: 0.9rem; border: 1px solid var(--border); background: var(--surface); }
.flash-success { background: var(--success-light); border-color: #bbf7d0; color: var(--success); }
.flash-warning { background: var(--warning-light); border-color: #fcd34d; color: var(--warning); }
.flash-danger  { background: var(--danger-light);  border-color: #fca5a5; color: var(--danger); }
.flash-info    { background: #eff6ff;              border-color: #bfdbfe; color: var(--info); }
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)),
    linear-gradient(to right, rgba(255,255,255,0), var(--surface) 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(28,25,23,0.08), rgba(28,25,23,0)),
    radial-gradient(farthest-side at 100% 50%, rgba(28,25,23,0.08), rgba(28,25,23,0)) 100% 0;
  background-repeat: no-repeat;
  background-size: 32px 100%, 32px 100%, 12px 100%, 12px 100%;
  background-attachment: local, local, scroll, scroll;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Item 4 — data-as-of stamp under page headers */
.data-as-of {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.data-as-of strong { color: var(--text); font-weight: 600; }

/* Item 8 — KPI tile action hint */
.stat-card .stat-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border);
  line-height: 1.4;
}
.stat-card .stat-hint a { color: var(--primary); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(13,92,75,0.35); text-underline-offset: 2px; }
.stat-card .stat-hint a:hover { text-decoration-color: var(--primary); }
.stat-card.danger .stat-hint { color: var(--danger); }
.stat-card.danger .stat-hint a { color: var(--danger); text-decoration-color: rgba(185,28,28,0.4); }
.stat-card.warn .stat-hint { color: var(--warning); }
.stat-card.warn .stat-hint a { color: var(--warning); text-decoration-color: rgba(180,83,9,0.4); }

/* Item 1 — pinned "needs your attention" strip on the dashboard */
.attention-strip {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.attention-strip-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.attention-strip-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
}
.attention-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
@media (max-width: 900px) {
  .attention-grid { grid-template-columns: 1fr; }
}
.attention-tile {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem 1rem 0.95rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.attention-tile:hover {
  background: var(--surface);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(28,25,23,0.08);
}
.attention-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.attention-tone-danger { border-left-color: var(--danger); background: var(--danger-light); }
.attention-tone-warning { border-left-color: var(--warning); background: var(--warning-light); }
.attention-tone-info { border-left-color: var(--info); background: #eff6ff; }
.attention-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.attention-tone-danger .attention-eyebrow { color: var(--danger); }
.attention-tone-warning .attention-eyebrow { color: var(--warning); }
.attention-tone-info .attention-eyebrow { color: var(--info); }
.attention-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
.attention-why {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.attention-cta {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.2rem;
  color: var(--primary);
}
.attention-tone-danger .attention-cta { color: var(--danger); }
.attention-tone-warning .attention-cta { color: var(--warning); }
.attention-tone-info .attention-cta { color: var(--info); }
@media (prefers-reduced-motion: reduce) {
  .attention-tile { transition: background 0.01ms; }
  .attention-tile:hover { transform: none; box-shadow: none; }
}

/* Item 5 — self-hosted DM Sans subset (Latin, 400 + 600).
   Binary files land at static/fonts/ per docs/PERF/FONT-SELF-HOST.md.
   Until placed, base.html keeps the Google Fonts <link> AFTER style.css so
   Google's @font-face wins the cascade and the page renders DM Sans normally.
   Once binaries land and the Google link is removed, these rules take over and
   drop the third-party blocking request from first paint. */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/dm-sans-600.woff2") format("woff2");
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* UX-SIMPLIFICATION 2026-05-25 — loby + ux-polish. CSS-only tooltip + inline
   help affordances. See docs/UX-SIMPLIFICATION.md §3 (tooltip policy) and
   docs/UX-MICROCOPY.md for the canonical strings. Pattern A is native
   title=; Pattern B is the visible info-tip below. */
.info-tip { display: inline-flex; align-items: center; justify-content: center; width: 1.05rem; height: 1.05rem; margin-left: 0.3rem; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); border-radius: 50%; font-size: 0.65rem; font-weight: 700; cursor: help; vertical-align: middle; position: relative; line-height: 1; }
.info-tip:hover, .info-tip:focus { color: var(--primary); border-color: var(--primary); outline: none; }
.info-tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--text); color: #fafaf9; padding: 0.5rem 0.7rem; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 500; line-height: 1.4; letter-spacing: 0; width: max-content; max-width: 240px; text-align: left; text-transform: none; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.12s ease; z-index: 50; box-shadow: 0 6px 20px rgba(28,25,23,0.18); white-space: normal; }
.info-tip:hover::after, .info-tip:focus::after { opacity: 1; visibility: visible; }
.field-help { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; line-height: 1.35; }
.cta-subtitle { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.4rem; font-weight: 400; line-height: 1.4; }
.disclosure { display: block; font-size: 0.72rem; color: var(--text-muted); font-style: italic; margin-top: 0.5rem; line-height: 1.4; }
.chart-caption { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.35rem; text-align: left; line-height: 1.45; }
/* UX-SIMPLIFICATION 2026-05-25 §8 — one-line today callout under the dashboard
   <h2>. Plain operator voice; matches the existing token palette. */
.today-callout { font-size: 1.05rem; color: var(--text); margin: 0.25rem 0 0.75rem; font-weight: 500; line-height: 1.4; }
[title] { cursor: help; }
button[title], a[title], .btn[title] { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .info-tip::after { transition: none; } }
