@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600&display=swap');

/* Light default — also applies before theme.js sets data-theme */
:root {
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;

  --bg-primary: #faf9f7;
  --bg-secondary: #f1efe8;
  --shadow: rgba(44, 44, 42, 0.08);
  --shadow-nav: rgba(0, 0, 0, 0.12);
  --overlay-backdrop: rgba(0, 0, 0, 0.35);

  --purple: #534ab7;
  --purple-light: #7f77dd;
  --purple-pale: #f5f4fe;
  --purple-border: #afa9ec;
  --purple-text: #3c3489;
  --teal: #0f6e56;
  --teal-light: #1d9e75;
  --teal-pale: #e1f5ee;
  --teal-border: #9fe1cb;
  --coral: #993c1d;
  --coral-light: #d85a30;
  --coral-pale: #faece7;
  --coral-border: #f0997b;
  --amber: #854f0b;
  --amber-light: #ba7517;
  --amber-pale: #faeeda;
  --red: #a32d2d;
  --red-light: #e24b4a;
  --red-pale: #fcebeb;
  --green: #0f6e56;
  --green-light: #1d9e75;
  --green-pale: #e1f5ee;

  --gray-bg: #f1efe8;
  --card-bg: #ffffff;
  --border: rgba(44, 44, 42, 0.12);
  --border-medium: rgba(44, 44, 42, 0.2);
  --border-strong: rgba(44, 44, 42, 0.35);
  --text-primary: #2c2c2a;
  --text-secondary: #5f5e5a;
  --text-tertiary: #888780;
  --text-on-dark: #ffffff;
  --text-on-dark-muted: #afa9ec;

  --btn-primary-fg: #ffffff;
  --btn-primary-hover-bg: #3c3489;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 20px;
}

[data-theme='dark'] {
  --bg-primary: #0d0c0b;
  --bg-secondary: #141312;
  --shadow: rgba(0, 0, 0, 0.35);
  --shadow-nav: rgba(0, 0, 0, 0.5);
  --overlay-backdrop: rgba(0, 0, 0, 0.55);

  --purple: #7f77dd;
  --purple-light: #9b94f0;
  --purple-pale: #1e1a4a;
  --purple-border: #534ab7;
  --purple-text: #d8d4f8;
  --teal: #1d9e75;
  --teal-light: #3ecf9c;
  --teal-pale: #032820;
  --teal-border: #0f6e56;
  --coral: #e07a52;
  --coral-light: #f0997b;
  --coral-pale: #3a1508;
  --coral-border: #993c1d;
  --amber: #e8a94d;
  --amber-light: #f0be6a;
  --amber-pale: #412402;
  --red: #f07171;
  --red-light: #ff9494;
  --red-pale: #501313;
  --green: #1d9e75;
  --green-light: #3ecf9c;
  --green-pale: #04342c;

  --gray-bg: #1a1917;
  --card-bg: #1f1e1c;
  --border: rgba(245, 242, 238, 0.1);
  --border-medium: rgba(245, 242, 238, 0.18);
  --border-strong: rgba(245, 242, 238, 0.3);
  --text-primary: #f5f2ee;
  --text-secondary: #9e9890;
  --text-tertiary: #7a756d;
  --text-on-dark: #ffffff;
  --text-on-dark-muted: #afa9ec;

  --btn-primary-fg: #ffffff;
  --btn-primary-hover-bg: #534ab7;
}

[data-theme='warm'] {
  --bg-primary: #1a1208;
  --bg-secondary: #221808;
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-nav: rgba(0, 0, 0, 0.45);
  --overlay-backdrop: rgba(0, 0, 0, 0.5);

  --purple: #7f77dd;
  --purple-light: #9b94f0;
  --purple-pale: #201c50;
  --purple-border: #534ab7;
  --purple-text: #e4e0fc;
  --teal: #1d9e75;
  --teal-light: #3ecf9c;
  --teal-pale: #032820;
  --teal-border: #0f6e56;
  --coral: #e07a52;
  --coral-light: #f0997b;
  --coral-pale: #3a1508;
  --coral-border: #993c1d;
  --amber: #e8a94d;
  --amber-light: #f0be6a;
  --amber-pale: #3a2a08;
  --red: #f07171;
  --red-light: #ff9494;
  --red-pale: #501313;
  --green: #1d9e75;
  --green-light: #3ecf9c;
  --green-pale: #04342c;

  --gray-bg: #1f160c;
  --card-bg: #231a0a;
  --border: rgba(240, 230, 208, 0.12);
  --border-medium: rgba(240, 230, 208, 0.2);
  --border-strong: rgba(240, 230, 208, 0.35);
  --text-primary: #f0e6d0;
  --text-secondary: #b8a882;
  --text-tertiary: #8a7d62;
  --text-on-dark: #ffffff;
  --text-on-dark-muted: #afa9ec;

  --btn-primary-fg: #ffffff;
  --btn-primary-hover-bg: #534ab7;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}
.logo span { color: var(--purple); }

.nav-pills { display: flex; gap: 6px; }

/* Global app nav — legacy pill row (unused by menu nav); see js/craft-global-nav.js */
.craft-app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  row-gap: 8px;
}

/* ── Menu-based global nav (role-aware) ───────────────────────── */
.craft-nav-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.craft-nav-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--border-medium);
  background: var(--card-bg);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.craft-nav-menu-btn:hover {
  border-color: var(--purple);
  color: var(--purple-text);
}

.craft-nav-burger {
  display: inline-block;
  width: 14px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

body.craft-nav-open {
  overflow: hidden;
}

.craft-nav-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-backdrop);
  z-index: 1000;
}

/* `hidden` must win over layout rules below (otherwise the drawer never visually closes). */
.craft-nav-panel[hidden],
.craft-nav-backdrop[hidden] {
  display: none !important;
}

.craft-nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100vw, 400px);
  height: 100vh;
  height: 100dvh;
  max-width: 100%;
  background: var(--card-bg);
  border-left: 0.5px solid var(--border);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px var(--shadow-nav);
}

.craft-nav-panel-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--border);
}

.craft-nav-panel-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.craft-nav-close {
  font-size: 1.5rem;
  line-height: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-md);
}
.craft-nav-close:hover {
  background: var(--gray-bg);
  color: var(--text-primary);
}

.craft-nav-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 28px;
  -webkit-overflow-scrolling: touch;
}

.craft-nav-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple-text);
  margin: 18px 0 8px;
}
.craft-nav-section-title:first-child {
  margin-top: 0;
}

.craft-nav-a {
  display: block;
  padding: 10px 10px;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  box-sizing: border-box;
}
.craft-nav-a:hover {
  background: var(--purple-pale);
  color: var(--purple-text);
}
.craft-nav-a.is-active {
  background: var(--purple-pale);
  font-weight: 500;
  color: var(--purple-text);
}

.craft-nav-a-muted {
  opacity: 0.88;
  border: 0.5px dashed var(--border-medium);
}

.craft-nav-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

.craft-nav-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--coral-light);
}
.craft-nav-a.is-active .craft-nav-count {
  color: var(--coral);
}

.top-bar-craft-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  width: 100%;
}
.top-bar-craft-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}
.top-bar-craft-logo-only {
  justify-content: flex-start;
  margin-bottom: 1rem;
}
.top-bar-craft-logo-only .top-bar-craft-left {
  min-width: auto;
  flex-shrink: 0;
}
.top-bar-craft-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}
.top-bar-craft-main .logo {
  flex-shrink: 0;
  margin-top: 0;
  padding: 2px 0;
  display: inline-block;
}
.craft-header-home {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--border-medium);
  color: var(--text-secondary);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.craft-header-home:hover {
  border-color: var(--purple);
  color: var(--purple-text);
}
.craft-header-home.is-active {
  background: var(--purple-pale);
  border-color: var(--purple-border);
  color: var(--purple-text);
}
.craft-header-add-co {
  white-space: nowrap;
  text-decoration: none;
  font-size: 12px;
}

.craft-theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.craft-theme-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-body);
  line-height: 1;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border-medium);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.craft-theme-btn:hover {
  border-color: var(--purple-border);
  color: var(--purple-text);
}
.craft-theme-btn.is-active {
  background: var(--purple-pale);
  border-color: var(--purple-border);
  color: var(--purple-text);
}

.top-bar-craft-main .top-bar-craft-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
}

.pill {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--border-medium);
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--card-bg);
  text-decoration: none;
  transition: border-color 0.15s;
}
.pill:hover { border-color: var(--purple); color: var(--purple); }
.pill.active { background: var(--purple-pale); border-color: var(--purple-border); color: var(--purple-text); }

/* Global nav — roadmap / not built yet (still clickable → coming-soon) */
.pill.pill-roadmap {
  opacity: 0.82;
  border-style: dashed;
  color: var(--text-tertiary);
}
.pill.pill-roadmap:hover {
  border-color: var(--border-medium);
  color: var(--text-secondary);
}

/* Nav — roadmap open count (updated after fetch) */
.pill .pill-count {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--coral-light);
  margin-left: 2px;
}
.pill#craft-nav-roadmap.active .pill-count {
  color: var(--coral);
}

.back-btn {
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 0.5px solid var(--border-medium);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--card-bg);
  text-decoration: none;
  transition: border-color 0.15s;
}
.back-btn:hover { border-color: var(--purple); color: var(--purple); }

/* Breadcrumb trail (problem / goal / initiative) */
.page-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 2px;
  font-size: 12px;
  line-height: 1.45;
  flex: 1;
  min-width: 0;
  max-width: min(100%, 52rem);
}
.page-nav-sep {
  color: var(--text-tertiary);
  user-select: none;
  padding: 0 3px;
}
.page-nav-a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 0.5px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.page-nav-a:hover {
  color: var(--purple-text);
  border-bottom-color: var(--purple-border);
}
.page-nav-here {
  color: var(--text-primary);
  font-weight: 500;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px var(--shadow);
}
.card:hover { border-color: var(--border-medium); }

/* Section labels */
.section-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* Status badges */
.badge {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
  display: inline-block;
}
.badge-stable  { background: var(--green-pale);  color: var(--green); }
.badge-shifting{ background: var(--amber-pale);  color: var(--amber); }
.badge-volatile{ background: var(--red-pale);    color: var(--red); }
.badge-done    { background: var(--green-pale);  color: var(--green); }
.badge-active  { background: var(--purple-pale); color: var(--purple-text); }
.badge-pending { background: var(--gray-bg);     color: var(--text-tertiary); }
.badge-attention{ background: var(--amber-pale); color: var(--amber); }
.badge-live    { background: var(--green-pale);  color: var(--green); }
.badge-ready   { background: var(--green-pale);  color: var(--green); }

/* Harvey balls */
.hb {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--text-tertiary);
  display: inline-block;
  position: relative;
  overflow: hidden;
  vertical-align: middle;
  flex-shrink: 0;
}
.hb-0  { background: transparent; }
.hb-25::after { content:''; position:absolute; top:0; left:0; width:50%; height:50%; background:var(--purple); }
.hb-50::after { content:''; position:absolute; top:0; left:0; width:100%; height:50%; background:var(--purple); }
.hb-75::after { content:''; position:absolute; top:0; left:0; width:100%; height:100%; background:var(--purple); clip-path:polygon(0 0,100% 0,100% 75%,50% 100%,0 100%); }
.hb-100 { background: var(--purple); border-color: var(--purple); }
.hb-teal.hb-100 { background: var(--teal-light); border-color: var(--teal-light); }
.hb-coral.hb-100 { background: var(--coral-light); border-color: var(--coral-light); }
.hb-coral.hb-50::after { background: var(--coral-light); }
.hb-amber.hb-100 { background: var(--amber-light); border-color: var(--amber-light); }

/* Signal dots */
.sig-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.dot-red    { background: var(--red-light); }
.dot-amber  { background: var(--amber-light); }
.dot-teal   { background: var(--teal-light); }

/* Metric cards */
.metric-card {
  background: var(--gray-bg);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  text-align: center;
}
.metric-num  { font-size: 22px; font-weight: 500; color: var(--text-primary); display: block; }
.metric-label{ font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }

/* Buttons */
.btn {
  font-size: 12px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--border-medium);
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--card-bg);
  text-decoration: none;
  display: inline-block;
  transition: border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--purple); color: var(--purple); }
.btn-primary {
  border: none;
  border-radius: var(--radius-md);
  background: var(--purple);
  color: var(--btn-primary-fg);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
}
.btn.btn-primary:hover {
  background: var(--btn-primary-hover-bg);
  color: var(--btn-primary-fg);
  border-color: transparent;
  opacity: 1;
}

/* Native fields — scoped to Craft shell (avoid editor chrome) */
.wrap input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='hidden']):not([type='range']):not([type='image']):not([type='button']):not([type='submit']):not([type='reset']),
.wrap textarea,
.wrap select {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--card-bg);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
}
.wrap input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='hidden']):not([type='range']):not([type='image']):not([type='button']):not([type='submit']):not([type='reset']):focus,
.wrap textarea:focus,
.wrap select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-pale);
}

/* Track tags */
.track-tag {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
  display: inline-block;
}
.tag-purple { background: var(--purple-pale); color: var(--purple); border: 0.5px solid var(--purple-border); }
.tag-teal   { background: var(--teal-pale);   color: var(--teal);   border: 0.5px solid var(--teal-border); }
.tag-coral  { background: var(--coral-pale);  color: var(--coral);  border: 0.5px solid var(--coral-border); }

/* Avatar */
.avatar {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  flex-shrink: 0;
}
.avatar-purple { background: var(--purple-pale); color: var(--purple-text); }
.avatar-teal   { background: var(--teal-pale);   color: var(--teal); }
.avatar-coral  { background: var(--coral-pale);  color: var(--coral); }

/* Timeline */
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item:hover .tl-title { color: var(--purple); }
.tl-dot-wrap { display: flex; flex-direction: column; align-items: center; padding-top: 3px; }
.tl-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tl-line { width: 1px; flex: 1; background: var(--border); margin-top: 3px; }
.tl-date  { font-size: 10px; color: var(--text-tertiary); margin-bottom: 2px; }
.tl-title { font-size: 12px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; transition: color 0.15s; }
.tl-desc  { font-size: 11px; color: var(--text-secondary); line-height: 1.5; }
.tl-findings { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tl-finding {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 5px;
  font-weight: 500;
}
.f-foundation { background: var(--green-pale);  color: var(--green); }
.f-perspective{ background: var(--purple-pale); color: var(--purple-text); }
.f-evidence   { background: var(--amber-pale);  color: var(--amber); }
.f-path       { background: var(--teal-pale);   color: var(--teal); }

/* Temporal banner */
.temporal-banner {
  background: var(--purple-pale);
  border: 0.5px solid var(--purple-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.temporal-label { font-size: 10px; font-weight: 500; color: var(--coral-light); letter-spacing: 0.05em; margin-bottom: 6px; }
.temporal-text  { font-size: 13px; color: var(--text-primary); line-height: 1.6; margin-bottom: 10px; }
.temporal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Engagement alert */
.engagement-alert {
  background: var(--purple-pale);
  border: 0.5px solid var(--purple-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.alert-title { font-size: 12px; font-weight: 500; color: var(--purple-text); margin-bottom: 6px; }
.alert-body  { font-size: 11px; color: var(--purple); line-height: 1.5; margin-bottom: 8px; }

/* Benchmark bars */
.bench-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border);
}
.bench-row:last-child { border-bottom: none; }
.bench-label { font-size: 11px; color: var(--text-secondary); flex: 1; }
.bench-bar-wrap { width: 120px; height: 6px; background: var(--gray-bg); border-radius: 3px; overflow: hidden; }
.bench-bar { height: 100%; border-radius: 3px; }
.bar-teal  { background: var(--teal-light); }
.bar-amber { background: var(--amber-light); }
.bar-red   { background: var(--red-light); }
.bench-val { font-size: 11px; font-weight: 500; color: var(--text-primary); width: 32px; text-align: right; }
.bench-vs  { font-size: 9px; width: 80px; text-align: right; }
.vs-red    { color: var(--red-light); }
.vs-amber  { color: var(--amber-light); }
.vs-teal   { color: var(--teal-light); }

/* Window items */
.window-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 0.5px solid var(--border);
}
.window-item:last-child { border-bottom: none; }
.urgency-pill {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
  flex-shrink: 0;
  margin-top: 1px;
}
.urg-now  { background: var(--red-pale);   color: var(--red); }
.urg-soon { background: var(--amber-pale); color: var(--amber); }
.urg-open { background: var(--green-pale); color: var(--green); }
.window-text { font-size: 12px; color: var(--text-secondary); line-height: 1.5; flex: 1; }

/* Annotation */
.annotation-card { background: var(--gray-bg); border-radius: var(--radius-lg); padding: 1rem 1.25rem; }
.ann-item { padding: 8px 0; border-bottom: 0.5px solid var(--border); }
.ann-item:last-child { border-bottom: none; }
.ann-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ann-author { font-size: 11px; font-weight: 500; }
.ann-date   { font-size: 10px; color: var(--text-tertiary); }
.ann-text   { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* Risk cards */
.risk-card { background: var(--card-bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 8px; }
.risk-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.risk-title  { font-size: 12px; font-weight: 500; }
.risk-level  { font-size: 10px; padding: 2px 8px; border-radius: 8px; font-weight: 500; }
.risk-high   { background: var(--red-pale);   color: var(--red); }
.risk-medium { background: var(--amber-pale); color: var(--amber); }
.risk-body   { font-size: 11px; color: var(--text-secondary); line-height: 1.5; }

/* Phase table */
.phase-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.phase-table th { font-size: 10px; font-weight: 500; color: var(--text-tertiary); padding: 6px 8px; text-align: left; border-bottom: 0.5px solid var(--border); letter-spacing: 0.04em; }
.phase-table td { font-size: 12px; color: var(--text-secondary); padding: 7px 8px; border-bottom: 0.5px solid var(--border); vertical-align: middle; }
.phase-table tr:last-child td { border-bottom: none; }
.phase-table tr.engine-group td { font-size: 10px; font-weight: 500; color: var(--text-tertiary); padding: 10px 8px 4px; letter-spacing: 0.04em; border-bottom: none; }
.phase-table tr:hover td { background: var(--gray-bg); cursor: pointer; }
.phase-table tr.engine-group:hover td { background: transparent; cursor: default; }
.phase-name { font-size: 12px; font-weight: 500; color: var(--text-primary); }
.phase-sub  { font-size: 10px; color: var(--text-tertiary); }

/* Signal items */
.signal-list { list-style: none; }
.signal-item { display: flex; align-items: flex-start; gap: 8px; padding: 9px 0; border-bottom: 0.5px solid var(--border); }
.signal-item:last-child { border-bottom: none; }
.sig-content  { flex: 1; }
.sig-title    { font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.sig-detail   { font-size: 11px; color: var(--text-secondary); line-height: 1.5; }
.sig-age      { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }
.engagement-tag { font-size: 9px; padding: 1px 6px; border-radius: 5px; background: var(--purple-pale); color: var(--purple-text); font-weight: 500; margin-left: 5px; }

/* Cascade phase cards */
.cascade-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 1.5rem; }
.cascade-card { background: var(--card-bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 0.875rem 1rem; cursor: pointer; transition: border-color 0.15s; text-decoration: none; color: inherit; display: block; position: relative; }
.cascade-card:hover { border-color: var(--purple); }
.cascade-card-soon {
  opacity: 0.88;
  border-style: dashed;
  cursor: pointer;
}
.cascade-card-soon:hover { border-color: var(--border-medium); }
.cascade-soon-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border: 0.5px solid var(--border-medium);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--gray-bg);
  pointer-events: none;
}
.cascade-phase { font-size: 10px; font-weight: 500; color: var(--purple); letter-spacing: 0.04em; margin-bottom: 4px; }
.cascade-title { font-size: 12px; font-weight: 500; margin-bottom: 4px; }
.cascade-body  { font-size: 11px; color: var(--text-secondary); line-height: 1.5; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 16px; margin-bottom: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 1.5rem; }
.metrics-row { display: flex; gap: 10px; margin-bottom: 1rem; }
.metrics-row .metric-card { flex: 1; }

/* Refresh row */
.refresh-row { display: flex; align-items: center; justify-content: space-between; padding-top: 1rem; border-top: 0.5px solid var(--border); }
.refresh-text { font-size: 11px; color: var(--text-tertiary); }

/* Loading */
.loading { text-align: center; padding: 4rem; color: var(--text-tertiary); font-size: 13px; }

/* Evidence — document drop zone (shared) */
.ev-doc-limits {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1.45;
}
.ev-doc-limits li { margin-bottom: 3px; }
.ev-doc-input-hidden {
  position: fixed;
  left: 0;
  top: 0;
  width: 0.01px;
  height: 0.01px;
  opacity: 0;
  overflow: hidden;
}
.ev-doc-drop {
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--gray-bg);
  transition: border-color 0.15s, background 0.15s;
}
.ev-doc-drop:hover,
.ev-doc-drop:focus {
  outline: none;
  border-color: var(--amber-light);
  background: var(--amber-pale);
}
.ev-doc-drop--active {
  border-color: var(--amber);
  background: var(--amber-pale);
}
.ev-doc-drop__main {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.ev-doc-drop__sub {
  display: block;
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1.4;
}
.ev-doc-msg {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  min-height: 1.2em;
}
.ev-doc-msg--err { color: var(--coral-light); }

/* Craft principles lens accordions — chevron follows .lens-acc.open (read mode) */
.lens-acc-head .lens-chev {
  display: inline-block;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1;
  transition: transform 0.15s ease;
}
.lens-acc-head .lens-chev::before {
  content: '▶';
  display: inline-block;
  transform: rotate(0deg);
}
.lens-acc.open > .lens-acc-head .lens-chev::before {
  transform: rotate(90deg);
}

/* Demo seed companies — full-width notice under nav / header */
.craft-demo-strip {
  max-width: 56rem;
  margin: 0 auto 12px;
  padding: 8px 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--amber-pale);
  border: 0.5px solid var(--amber-light);
  border-radius: var(--radius-md);
}
.craft-demo-strip strong {
  color: var(--text-primary);
  font-weight: 600;
}
.craft-demo-chip {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-pale);
  border: 0.5px solid var(--amber-light);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Responsive */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .cascade-cards { grid-template-columns: 1fr; }
  /* Legacy: hide old nav-pills only; .craft-app-nav stays visible (wraps) */
  .nav-pills { display: none; }
}
