/* ============================================================================
   CHIEF — Command-center shell for the DNA tools
   Adopted from Al's "AI Chief of Staff" design: near-black surfaces, gold
   accent, Playfair Display + Inter, 280px dock with colored status dots,
   priority cards with ghosted serif numbers, registry rows, altar card.
   Loaded LAST on stewardship-map.html and project-map.html (html.chief).
   ========================================================================== */

html.chief {
  --gold: #C8A96E; --gold-light: #f0deb0; --gold-dark: #8a6d3b;
  --green: #2D5A27; --green-dark: #1A3A16;
  --near-black: #0a0a0e; --dark1: #111118; --dark2: #1a1a24; --dark3: #22222e;
  --dark-border: rgba(255, 255, 255, 0.08);
  --text-light: rgba(255, 255, 255, 0.85);
  --text-mid: rgba(255, 255, 255, 0.55);
  --text-muted: rgba(255, 255, 255, 0.3);
  --red: #e74c3c; --amber: #e67e22; --emerald: #27ae60; --blue: #2980b9; --purple: #8e44ad;

  /* Repoint the legacy tokens every existing rule uses, so the whole page
     (dialogs, generated markup, hidden sections) lands on this palette. */
  --paper: var(--near-black);
  --bg: var(--near-black);
  --bg-deep: var(--near-black);
  --surface: var(--dark2);
  --surface-2: var(--dark3);
  --surface-3: #2a2a36;
  --ink: var(--text-light);
  --muted: var(--text-mid);
  --muted-2: var(--text-muted);
  --line: var(--dark-border);
  --line-bright: rgba(255, 255, 255, 0.16);
  --sage: var(--gold);
  --sage-dark: var(--gold);
  --clay: var(--gold);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --tool-serif: "Playfair Display", Georgia, serif;
  --tool-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --radius-xs: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: none; --shadow-xs: none; --shadow-sm: none;
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --focus-ring: 0 0 0 3px rgba(200, 169, 110, 0.3);
}

html.chief { background: var(--near-black); }
html.chief body {
  background: var(--near-black) !important;
  color: var(--text-light);
  font-family: "Inter", sans-serif;
  margin: 0;
  min-height: 100vh;
}

/* ---------------------------------------------------------------- HEADER */
.cos-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 20px 32px;
  background: linear-gradient(135deg, #0a0a0e 0%, #1a1a24 100%);
  border-bottom: 1px solid var(--dark-border);
}
.cos-header-left { display: flex; flex-direction: column; }
.cos-brand {
  font-size: 10px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 3px; text-decoration: none;
}
.cos-title { font-family: "Playfair Display", serif; font-size: 20px; font-weight: 600; color: #fff; margin: 0; }
.cos-header-right { display: flex; align-items: center; gap: 16px; }
.cos-date { text-align: right; }
.cos-date-day { font-size: 11px; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.cos-date-full { font-size: 14px; font-weight: 500; color: var(--text-light); }
.cos-tabs { display: flex; gap: 2px; background: rgba(255,255,255,0.04); border-radius: 8px; padding: 3px; }
.cos-tab {
  display: inline-block; padding: 6px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-mid);
  text-decoration: none; border: none; background: none; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.cos-tab:hover { color: var(--text-light); }
.cos-tab.active { background: rgba(200,169,110,0.15); color: var(--gold); }

/* ------------------------------------------------------------------ MAIN */
.cos-main { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 65px); }

/* --------------------------------------------------------------- SIDEBAR */
.cos-sidebar {
  background: var(--dark1); border-right: 1px solid var(--dark-border);
  padding: 24px 0; overflow-y: auto;
  position: sticky; top: 65px; height: calc(100vh - 65px);
}
.cos-side-section { margin-bottom: 28px; }
.cos-side-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-muted); padding: 0 20px; margin-bottom: 10px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 20px; cursor: pointer; transition: all 0.15s;
  border: 0; border-left: 2px solid transparent; background: none;
  color: var(--text-light); font: inherit; text-align: left; text-decoration: none;
}
.sidebar-item:hover { background: rgba(255,255,255,0.04); }
.sidebar-item.active { background: rgba(200,169,110,0.08); border-left-color: var(--gold); }
.sidebar-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--gold); }
.sidebar-name { font-size: 13px; color: var(--text-light); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-badge { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 3px; background: rgba(200,169,110,0.15); color: var(--gold); flex-shrink: 0; }
.badge-red { background: rgba(192,57,43,0.2); color: #e74c3c; }
.badge-amber { background: rgba(230,126,34,0.2); color: #f39c12; }
.badge-green { background: rgba(39,174,96,0.2); color: #2ecc71; }
.badge-blue { background: rgba(41,128,185,0.2); color: #5dade2; }
.cos-side-quote {
  margin: 8px 20px 0; padding-top: 16px; border-top: 1px solid var(--dark-border);
  font-size: 10px; color: var(--text-muted); font-style: italic;
  font-family: "Playfair Display", serif; line-height: 1.6;
}
/* Small controls that live in the dock */
.cos-sidebar .week-pill {
  display: block; margin: 0 20px 8px; padding: 8px 12px;
  background: rgba(200,169,110,0.1); border: 1px solid rgba(200,169,110,0.25);
  border-radius: 6px; color: var(--gold); font-size: 12px; font-weight: 600; text-align: center;
}
.cos-sidebar .secondary-button,
.cos-sidebar .text-button {
  display: flex; align-items: center; gap: 10px; width: calc(100% - 40px);
  margin: 0 20px 6px; padding: 8px 12px;
  background: none; border: 1px solid var(--dark-border); border-radius: 6px;
  color: var(--text-mid); font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s;
  text-align: left;
}
.cos-sidebar .secondary-button:hover,
.cos-sidebar .text-button:hover { color: var(--text-light); border-color: rgba(255,255,255,0.2); background: none; }

/* --------------------------------------------------------------- CONTENT */
.cos-content { overflow-y: auto; padding: 28px 32px; min-width: 0; }
.cos-content > .topbar { margin-bottom: 22px; }

html.chief .topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
html.chief .topbar .eyebrow,
html.chief .cos-content .eyebrow {
  font-family: "Inter", sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); opacity: 0.85; margin: 0 0 6px;
}
html.chief .topbar h1 {
  font-family: "Playfair Display", serif; font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 600; color: #fff; margin: 0 0 6px; letter-spacing: 0; line-height: 1.15;
}
html.chief .workspace-intro { color: var(--text-mid); font-size: 13px; margin: 0; max-width: 60ch; line-height: 1.6; }

/* Section headers (the gold dash + small caps) */
html.chief .map-workspace .section-heading h2,
html.chief .section-heading h2 {
  display: flex; align-items: center; gap: 8px;
  font-family: "Inter", sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin: 0;
}
html.chief .section-heading h2::before { content: ""; display: block; width: 24px; height: 1px; background: var(--gold); opacity: 0.4; }
html.chief .section-heading .eyebrow { display: none; }
html.chief .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }

/* ------------------------------------------------------------- ALTAR CARD
   The mission strip becomes the green altar card. */
html.chief .mission-strip {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start;
  background: linear-gradient(135deg, var(--green-dark) 0%, #0d2810 100%);
  border: 1px solid rgba(45,90,39,0.4); border-radius: 12px;
  padding: 28px 32px; margin-bottom: 24px; box-shadow: none;
}
html.chief .mission-strip::before {
  content: ""; position: absolute; top: -40px; right: -40px; width: 200px; height: 200px;
  border-radius: 50%; background: rgba(45,90,39,0.15); pointer-events: none;
}
html.chief .mission-strip .eyebrow {
  font-size: 9px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(160,220,144,0.7); margin-bottom: 12px; display: block; opacity: 1;
}
html.chief .mission-strip h2 {
  font-family: "Inter", sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: rgba(160,220,144,0.6); margin: 0 0 10px;
}
html.chief .mission-strip #missionPreview {
  font-family: "Playfair Display", serif; font-size: 17px; font-style: italic;
  color: rgba(255,255,255,0.9); line-height: 1.65; margin: 0; max-width: 70ch;
}
html.chief .mission-strip .secondary-button {
  position: relative; z-index: 1;
  background: rgba(0,0,0,0.25); border: 1px solid rgba(160,220,144,0.3);
  color: rgba(200,240,190,0.9); font-size: 12px; font-weight: 600;
  padding: 8px 16px; border-radius: 6px; cursor: pointer; transition: all 0.15s;
}
html.chief .mission-strip .secondary-button:hover { border-color: rgba(160,220,144,0.6); }

/* ----------------------------------------------------------- BRANCHES
   Each stewardship branch = uppercase gold group label + card list. */
html.chief .map-sheet { display: flex; flex-direction: column; gap: 26px; padding: 0; border: 0; background: transparent; }
html.chief .map-branch {
  display: block; padding: 0; border: 0; background: transparent; border-radius: 0;
}
html.chief .map-branch:not(:last-child) { border-bottom: 0; }
html.chief .map-branch-title { margin-bottom: 10px; }
html.chief .map-branch-heading { display: flex; align-items: center; gap: 10px; }
html.chief .map-branch-heading::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--gold)); flex-shrink: 0;
}
html.chief .map-branch-heading h3 {
  font-family: "Inter", sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); opacity: 0.85; margin: 0;
}
html.chief .map-branch-heading .badge { margin-left: 2px; }
html.chief .map-branch-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
html.chief .map-branch-meta .badge { font-size: 10px; color: var(--text-muted); background: none; border: 0; padding: 0; }
html.chief .progress.map-branch-progress {
  width: 60px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden;
}
html.chief .progress-fill { display: block; height: 100%; border-radius: 2px; background: var(--dot, var(--gold)); }

/* Branch dot colors — deterministic cycle, mirrored by the dock (same order) */
html.chief .map-branch:nth-of-type(6n + 1) { --dot: #C8A96E; }
html.chief .map-branch:nth-of-type(6n + 2) { --dot: #27ae60; }
html.chief .map-branch:nth-of-type(6n + 3) { --dot: #e67e22; }
html.chief .map-branch:nth-of-type(6n + 4) { --dot: #2980b9; }
html.chief .map-branch:nth-of-type(6n + 5) { --dot: #8e44ad; }
html.chief .map-branch:nth-of-type(6n + 6) { --dot: #e74c3c; }

/* ----------------------------------------------------------- STONE CARDS
   Each stepping stone = a priority card with a ghosted serif number. */
html.chief .map-stone-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
  counter-reset: stone;
}
html.chief .map-stone {
  counter-increment: stone;
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 4px 14px; align-items: start;
  background: var(--dark2); border: 1px solid var(--dark-border); border-radius: 8px;
  padding: 16px 18px; min-height: 0; transition: border-color 0.15s;
}
html.chief .map-stone:hover { border-color: rgba(200,169,110,0.2); }
html.chief .map-stone::before {
  content: counter(stone);
  grid-row: 1 / span 3; grid-column: 1;
  font-family: "Playfair Display", serif; font-size: 28px; font-weight: 700;
  color: rgba(200,169,110,0.2); line-height: 1; padding-top: 2px;
}
html.chief .map-stone.complete { opacity: 0.6; }
html.chief .map-stone-check { grid-column: 2; display: flex; align-items: flex-start; gap: 10px; margin: 0; }
html.chief .map-stone-check input {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0;
  border: 1px solid var(--dark-border); border-radius: 4px; background: none;
  cursor: pointer; transition: all 0.15s; display: grid; place-items: center;
}
html.chief .map-stone-check input:hover { border-color: var(--gold); }
html.chief .map-stone-check input:checked { background: var(--green); border-color: var(--green); }
html.chief .map-stone-check input:checked::after { content: "✓"; font-size: 11px; color: #fff; line-height: 1; }
html.chief .map-stone-check span { font-size: 14px; color: var(--text-light); line-height: 1.5; }
html.chief .map-stone.complete .map-stone-check span { text-decoration: line-through; color: var(--text-mid); }

html.chief .map-stone-date {
  grid-column: 3; grid-row: 1;
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
  font-size: 11px; color: var(--text-muted); background: none; border: 0; padding: 0;
}
html.chief .map-stone-date strong { font-weight: 500; color: var(--text-mid); font-size: 11px; }
html.chief .map-stone-date small { font-size: 10px; color: var(--text-muted); }
html.chief .map-stone-status { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 3px; border: 0; }
html.chief .badge--done { background: rgba(39,174,96,0.15); color: #2ecc71; }
html.chief .badge--scheduled { background: rgba(41,128,185,0.12); color: #5dade2; }
html.chief .badge--overdue { background: rgba(192,57,43,0.15); color: #e74c3c; }
html.chief .badge--todo,
html.chief .badge--unscheduled { background: rgba(230,126,34,0.12); color: #f39c12; }
html.chief .badge--neutral { background: rgba(255,255,255,0.06); color: var(--text-mid); }

html.chief .map-stone-actions {
  grid-column: 2 / span 2; grid-row: 2;
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
  opacity: 0.65; transition: opacity 0.15s;
}
html.chief .map-stone:hover .map-stone-actions { opacity: 1; }
html.chief .map-stone-actions button {
  font-size: 11px; font-weight: 600; padding: 5px 11px; border-radius: 5px;
  border: 1px solid var(--dark-border); background: none; color: var(--text-mid);
  cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; gap: 5px;
}
html.chief .map-stone-actions button:hover { color: var(--text-light); border-color: rgba(255,255,255,0.2); }
html.chief .map-stone-actions .map-action-schedule,
html.chief .map-stone-actions .map-action-schedule:hover {
  background: var(--gold) !important; border-color: var(--gold) !important; color: #0a0a0e !important;
}
html.chief .map-stone-actions .map-action-explain { color: var(--gold) !important; background: none !important; border-color: rgba(200,169,110,0.35) !important; }
html.chief .map-stone-actions .map-action-google { background: none !important; border-color: var(--dark-border) !important; color: var(--text-mid) !important; }
html.chief .map-stone-actions .map-action-google:hover { color: var(--text-light) !important; }
html.chief .map-stone-actions .map-action-delete { border-color: transparent !important; color: var(--text-muted) !important; background: none !important; }
html.chief .map-stone-actions .map-action-delete:hover { color: #e74c3c !important; }

html.chief .map-stone-notes {
  grid-column: 2 / span 2; grid-row: 3; margin-top: 10px; padding: 10px 14px;
  background: rgba(0,0,0,0.22); border: 0; border-left: 2px solid rgba(200,169,110,0.35);
  border-radius: 6px; font-size: 12px; color: var(--text-mid); line-height: 1.6;
}
html.chief .map-stone-notes p { margin: 0 0 4px; color: var(--text-mid); font-size: 12px; }
html.chief .map-stone-notes strong { color: var(--text-light); font-weight: 600; }

html.chief .map-empty { list-style: none; }
html.chief .map-add-link,
html.chief .map-branch-actions .map-add-link {
  font-size: 11px; font-weight: 600; color: var(--gold); background: none !important;
  border: 0 !important; padding: 4px 0; margin-right: 14px; cursor: pointer; opacity: 0.8;
}
html.chief .map-add-link:hover { opacity: 1; }
html.chief .map-branch-actions { margin-top: 8px; }

/* ------------------------------------------------------- GUIDED DUMP PANEL */
html.chief .map-guided {
  background: var(--dark1); border: 1px solid var(--dark-border); border-radius: 12px;
  padding: 22px 26px; margin-bottom: 24px;
}
html.chief .map-guided-head .eyebrow { display: block; }
html.chief .map-guided-head h3 {
  font-family: "Playfair Display", serif; font-size: 18px; font-weight: 600; color: #fff; margin: 0 0 6px;
}
html.chief .map-guided-head p { font-size: 13px; color: var(--text-mid); line-height: 1.6; margin: 0 0 4px; }
html.chief .map-guided-head p:not(.eyebrow):not(.map-guided-lede) { display: none; }
html.chief .map-dump-form { margin-top: 14px; }
html.chief .dump-dictate-button {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(200,169,110,0.12) !important; border: 1px solid rgba(200,169,110,0.4) !important;
  color: var(--gold) !important; border-radius: 8px; padding: 10px 18px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
html.chief .dump-dictate-button:hover { background: rgba(200,169,110,0.2) !important; }
html.chief .dump-dictate-button.recording { background: var(--gold) !important; color: #0a0a0e !important; }
html.chief .map-dump-hint { font-size: 12px; color: var(--text-muted); }
html.chief .map-dump-writing textarea { margin-top: 6px; }
html.chief .map-dump-submit { margin-top: 10px; }

/* ------------------------------------------------------------ PROJECT PAGE */
html.chief .project-map-panel { background: transparent; border: 0; padding: 0; box-shadow: none; }
html.chief .project-map-intro {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center;
  background: linear-gradient(135deg, var(--green-dark) 0%, #0d2810 100%);
  border: 1px solid rgba(45,90,39,0.4); border-radius: 12px;
  padding: 24px 28px; margin-bottom: 18px;
}
html.chief .project-map-intro::before {
  content: ""; position: absolute; top: -40px; right: -40px; width: 180px; height: 180px;
  border-radius: 50%; background: rgba(45,90,39,0.15); pointer-events: none;
}
html.chief #projectMapMission {
  font-family: "Playfair Display", serif; font-size: 16px; font-style: italic;
  color: rgba(255,255,255,0.9); line-height: 1.6; margin: 0 0 8px;
}
html.chief .project-map-meta { display: flex; gap: 14px; flex-wrap: wrap; }
html.chief .project-map-meta span { font-size: 11px; color: rgba(200,240,190,0.65); background: none; border: 0; padding: 0; }
html.chief .project-map-stat { text-align: right; position: relative; z-index: 1; }
html.chief .project-map-stat strong { font-family: "Playfair Display", serif; font-size: 30px; font-weight: 700; color: #fff; display: block; }
html.chief .project-map-stat span { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(200,240,190,0.6); font-weight: 600; }

html.chief .project-people { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
html.chief .person-chip {
  background: var(--dark2) !important; border: 1px solid var(--dark-border) !important;
  border-radius: 6px; padding: 6px 12px; font-size: 12px; color: var(--text-mid) !important;
}

html.chief .project-template-strip {
  background: var(--dark1); border: 1px solid var(--dark-border); border-radius: 10px;
  padding: 14px 18px; margin-bottom: 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
html.chief .project-template-strip .eyebrow { margin-bottom: 3px; }
html.chief .project-template-strip h3 { font-family: "Playfair Display", serif; font-size: 15px; font-weight: 600; color: #fff; margin: 0 0 3px; }
html.chief .project-template-strip p { font-size: 12px; color: var(--text-mid); margin: 0; }
html.chief .project-template-actions span {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 3px;
  background: rgba(200,169,110,0.15); color: var(--gold);
}

/* View toggle looks like the header tab pill */
html.chief .project-view-toggle {
  display: inline-flex; gap: 2px; background: rgba(255,255,255,0.04);
  border: 0; border-radius: 8px; padding: 3px; margin-bottom: 16px;
}
html.chief .project-view-btn {
  padding: 6px 14px; border-radius: 6px; border: 0; font-size: 12px; font-weight: 500;
  background: none !important; color: var(--text-mid) !important; cursor: pointer; transition: all 0.15s;
}
html.chief .project-view-btn:hover { color: var(--text-light) !important; }
html.chief .project-view-btn.is-active { background: rgba(200,169,110,0.15) !important; color: var(--gold) !important; }

/* List view = registry rows */
html.chief .project-section {
  background: transparent; border: 0; padding: 0; margin-bottom: 22px; border-radius: 0;
}
html.chief .project-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
html.chief .project-section-head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--gold)); flex-shrink: 0; }
html.chief .project-section-head h3,
html.chief .project-section-head h4 {
  font-family: "Inter", sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); opacity: 0.85; margin: 0;
}
html.chief .project-section:nth-of-type(6n + 1) { --dot: #C8A96E; }
html.chief .project-section:nth-of-type(6n + 2) { --dot: #27ae60; }
html.chief .project-section:nth-of-type(6n + 3) { --dot: #e67e22; }
html.chief .project-section:nth-of-type(6n + 4) { --dot: #2980b9; }
html.chief .project-section:nth-of-type(6n + 5) { --dot: #8e44ad; }
html.chief .project-section:nth-of-type(6n + 6) { --dot: #e74c3c; }
html.chief .project-section-lead-name { font-size: 11px; color: var(--text-muted); }

html.chief .project-task {
  background: var(--dark2) !important; border: 1px solid var(--dark-border) !important;
  border-radius: 8px; padding: 13px 16px; margin-bottom: 6px;
  transition: border-color 0.15s;
}
html.chief .project-task:hover { border-color: rgba(200,169,110,0.2) !important; }
html.chief .project-task.is-done { opacity: 0.55; }

html.chief .project-section-add { background: transparent; border: 0; }

/* Tree view: keep structure, recolor chrome */
html.chief .project-map-board.is-tree .tree-branch,
html.chief .project-map-board.is-tree .tree-leaf,
html.chief .project-map-board.is-tree .tree-trunk-card {
  background: var(--dark2) !important; border-color: var(--dark-border) !important; color: var(--text-light) !important;
}

/* ---------------------------------------------------------- FORM CONTROLS */
html.chief input,
html.chief textarea,
html.chief select {
  background: rgba(0,0,0,0.3) !important; color: var(--text-light) !important;
  border: 1px solid var(--dark-border) !important; border-radius: 6px;
  font-family: "Inter", sans-serif; font-size: 13px;
}
html.chief input::placeholder,
html.chief textarea::placeholder { color: var(--text-muted) !important; }
html.chief input:focus,
html.chief textarea:focus,
html.chief select:focus {
  border-color: rgba(200,169,110,0.5) !important;
  box-shadow: 0 0 0 3px rgba(200,169,110,0.15) !important; outline: none;
}

/* ---------------------------------------------------------------- BUTTONS */
html.chief .primary-button {
  background: var(--gold) !important; color: #0a0a0e !important;
  font-weight: 700; font-size: 12px; padding: 9px 18px; border-radius: 6px;
  border: 0 !important; cursor: pointer; transition: all 0.15s; min-height: 0;
}
html.chief .primary-button:hover { background: #d4b87a !important; }
html.chief .cos-content .secondary-button,
html.chief dialog .secondary-button,
html.chief .cos-content .text-button,
html.chief dialog .text-button {
  background: none !important; color: var(--text-mid) !important;
  font-size: 12px; font-weight: 500; padding: 8px 14px; border-radius: 6px;
  border: 1px solid var(--dark-border) !important; cursor: pointer; transition: all 0.15s; min-height: 0;
}
html.chief .cos-content .secondary-button:hover,
html.chief dialog .secondary-button:hover,
html.chief .cos-content .text-button:hover,
html.chief dialog .text-button:hover { color: var(--text-light) !important; border-color: rgba(255,255,255,0.2) !important; }
html.chief .cos-content .text-button,
html.chief dialog .text-button { border-color: transparent !important; }
html.chief .icon-button {
  background: rgba(200,169,110,0.12) !important; color: var(--gold) !important;
  border: 1px solid rgba(200,169,110,0.35) !important; border-radius: 6px;
}

/* ----------------------------------------------------------------- PANELS */
html.chief .panel,
html.chief .hero-panel {
  background: var(--dark1); border: 1px solid var(--dark-border);
  border-radius: 12px; padding: 22px 26px; box-shadow: none;
}
html.chief .map-workspace { background: transparent; border: 0; padding: 0; }
html.chief .empty-state {
  background: var(--dark2); border: 1px dashed var(--dark-border); border-radius: 8px;
  color: var(--text-mid); font-size: 13px; padding: 18px;
}

/* ---------------------------------------------------------------- DIALOGS */
html.chief dialog {
  background: var(--dark1) !important; color: var(--text-light) !important;
  border: 1px solid var(--dark-border) !important; border-radius: 12px !important;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
html.chief dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
html.chief dialog h2 { font-family: "Playfair Display", serif; font-size: 18px; font-weight: 600; color: #fff; }
html.chief .google-card,
html.chief .explain-card { background: transparent !important; color: var(--text-light) !important; }
html.chief .integration-card {
  background: var(--dark2) !important; border: 1px solid var(--dark-border) !important; border-radius: 8px;
}
html.chief .integration-card h3 { font-family: "Playfair Display", serif; color: #fff; }
html.chief .integration-tag { background: rgba(200,169,110,0.15); color: var(--gold); font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 3px; }
html.chief .integration-note {
  background: rgba(0,0,0,0.22) !important; border-left: 2px solid rgba(200,169,110,0.35) !important;
  border-radius: 6px; color: var(--text-mid) !important; font-size: 12px; line-height: 1.6;
}
html.chief .dictation-panel { background: var(--dark2) !important; border: 1px solid var(--dark-border) !important; border-radius: 8px; }
html.chief .dictate-button {
  background: rgba(200,169,110,0.12) !important; border: 1px solid rgba(200,169,110,0.4) !important;
  color: var(--gold) !important; border-radius: 8px;
}
html.chief .dictate-button.recording { background: var(--gold) !important; color: #0a0a0e !important; }

/* Badges / tags reused across generated markup */
html.chief .tag,
html.chief .pill {
  background: rgba(255,255,255,0.06) !important; color: var(--text-mid) !important;
  border: 0 !important; font-size: 10px; font-weight: 600; border-radius: 3px; padding: 2px 7px;
}

/* -------------------------------------------------------------- RESPONSIVE */
@media (max-width: 980px) {
  .cos-main { grid-template-columns: 1fr; }
  /* Sidebar STACKS above the map on phones instead of vanishing — its
     stewardships list and quick actions (Add stewardship, Prayer points,
     Send to apps) must stay reachable on mobile. */
  .cos-sidebar {
    display: block; position: static; width: auto;
    border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.08);
    margin: 0 0 18px; padding-bottom: 14px;
  }
  .cos-header { flex-wrap: wrap; padding: 14px 18px; }
  .cos-content { padding: 20px 16px; }
  html.chief .map-stone { grid-template-columns: 24px minmax(0, 1fr); }
  html.chief .map-stone-date { grid-column: 2; grid-row: auto; justify-content: flex-start; margin-top: 6px; }
  html.chief .map-stone-actions { grid-column: 2; }
  html.chief .map-stone-notes { grid-column: 2; }
}

/* Kill the legacy fixed-attachment gradient + fixed overlay on chief pages —
   solid paint scrolls cleanly (fixed backgrounds force full repaints). */
html.chief body { background-attachment: scroll !important; }
html.chief body.journey-tool::before { display: none; }

/* Ghost serif numbers: give the glyph its full column and a touch more presence */
html.chief .map-stone::before {
  width: 32px; min-width: 32px; overflow: visible;
  color: rgba(200, 169, 110, 0.24);
}

/* Audit fixes: header must not clip on phones (#9); advisor buttons join the
   chief button language instead of legacy pills (#17). */
@media (max-width: 980px) {
  .cos-header-right { flex-wrap: wrap; justify-content: flex-end; }
  .cos-tabs { overflow-x: auto; max-width: 100%; }
}
html.chief .advisor-actions button {
  border-radius: 6px !important;
  background: none !important; color: var(--text-mid) !important;
  border: 1px solid var(--dark-border) !important; font-size: 12px;
}
html.chief .advisor-actions button:hover { color: var(--text-light) !important; }

/* Touch devices only: the Stewardship / Project Map task list is the daily-use
   surface for a pastor on a phone, but its core controls were the smallest in the
   app (18px check, ~22px action buttons). Enlarge the tap targets on touch screens
   to a comfortable size without changing the calm desktop sizing (this block never
   matches a mouse pointer, so the premium desktop look is untouched). */
@media (hover: none) and (pointer: coarse) {
  html.chief .map-stone-check { align-items: center; gap: 12px; }
  html.chief .map-stone-check input { width: 28px; height: 28px; border-width: 1.5px; }
  html.chief .map-stone-check input:checked::after { font-size: 16px; }
  /* No hover on touch, so the hover-reveal never fires — keep actions visible. */
  html.chief .map-stone-actions { gap: 10px; opacity: 1; }
  html.chief .map-stone-actions button { min-height: 44px; padding: 10px 16px; font-size: 13px; }
  /* Section tabs and per-project view toggles share the same too-small sizing. */
  html.chief .cos-tab,
  html.chief .project-view-btn { min-height: 44px; padding: 10px 16px; font-size: 13px; }
  html.chief .advisor-actions button { min-height: 44px; }
}
