/* advisor.css — Projctr Advisor panel (uses your CSS vars) */
.advisor-panel {
	position: fixed;
	top: 5%;
	right: 0px;
	width: min(720px, 100%);
	height: 90%;
	transform: translateX(100%);
	background: var(--panel);
	color: var(--ink);
	border-left: 1px solid var(--line);
	display: grid;
	grid-template-rows: auto 1fr;
	z-index: 9999;
	transition: transform 0.28s;
	border-radius: 16px;
	backdrop-filter: blur(8px);
}
.advisor-panel.open {
	transform: translateX(-16px);
	box-shadow: rgba(0, 0, 0, 0.2) -12px 0px 32px;
}
.ap-header {
	display: flex;
	align-items: center;
	gap: 10px;
	border-bottom: 1px solid var(--line);
	background: #eeff00;
	padding: 12px 24px;
	border-radius: 12px 12px 0 0;
}
.ap-title{ font: 500 20px var(--font-ui); color: var(--brand1)}
.ap-body {
	overflow: auto;
	padding: 12px 24px;
	display: grid;
	gap: 12px;
}
.ap-section{ background: transparent; border-radius: var(--round); }
.ap-head{ font: 600 12px var(--font-ui); letter-spacing:.08em; text-transform: uppercase; opacity:.9; margin: 6px 4px 8px; color:var(--brand2)}
.ap-metrics{ display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.ap-chip {
	background: var(--btnbg);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 10px;
	display: grid;
	gap: 6px;
	background: var(--brand1);
	color: #f3f5f2;
}
.ap-chip .k{ font:600 24px var(--font-ui); }
.ap-chip .l{ color: #f3f5f2; font: 500 11px var(--font-ui); }
.ap-card{ background: var(--panel); border:1px solid var(--line); border-radius:14px; padding: 10px; margin-bottom:8px;}
.ap-card-title{ font: 600 14px var(--font-ui); margin-bottom: 6px; }
.ap-card-body{ color: var(--ink); font-size: 13px; }
.ap-actions{ display:grid; gap:8px; }
.ap-action{ display:flex; align-items:center; justify-content:space-between; gap: 10px; border:1px solid var(--line); border-radius: 12px; padding: 8px; }
.ap-action-tags{ color: var(--muted); font-size: 12px; }
.ap-plan{ display:grid; gap:8px; }
.toast{ position: fixed; left:50%; transform: translateX(-50%); bottom: 16px; background: var(--panel); color: var(--ink); border:1px solid var(--line); border-radius: 999px; padding: 8px 14px; opacity:0; pointer-events:none; transition: opacity .2s ease; z-index:10000; }
.toast.show{ opacity:1; }
@media (min-width: 980px){ .ap-metrics{ grid-template-columns: repeat(3,minmax(0,1fr)); } }

.btn.small.outline {
  color: #f3f5f2;
  margin: 0 4px;
  border: none;
  width: 32px;
  height: 32px;
}
.btn.small {
  color: #f3f5f2;
  border: none;
  width: 32px;
  height: 32px;
}


/* In-pane overlay */
.advisor-panel .ap-body {
  position: relative;
}
.advisor-panel .ap-body.busy .ap-section { filter: blur(0.5px); transition: filter .15s ease; }

.ap-loading {
  position: absolute;
  inset: 0;
  display: none;             /* toggled by JS */
  align-items: center;
  justify-content: center;
  gap: .75rem;
  background: color-mix(in srgb, var(--panelBg, #fff) 70%, transparent);
  z-index: 2;
  pointer-events: none;      /* allow clicks through when visible */
  backdrop-filter: blur(2px);
  border-top-right-radius:0px;
border-top-left-radius:0px;
border-bottom-right-radius:16px;
border-bottom-left-radius:16px;
}
.ap-spinner {
  width: 32px; height: 32px;
  border: 2px solid color-mix(in srgb, var(--brand1) 35%, transparent);
  border-top-color: var(--brand1);
  border-radius: 50%;
  animation: ap-spin 0.9s linear infinite;
}
.ap-loading-msg { font-size: 16px; opacity: .8; font-family: var(--font-ui); font-weight: 400;}
@keyframes ap-spin { to { transform: rotate(360deg); } }

/* Footer + badge */
.advisor-panel .ap-footer {
  display: flex; align-items: center; justify-content: flex-end;
  padding: .5rem .75rem .75rem; border-top: 1px solid var(--hairline,#e9e9e9);
}
.ap-source .ap-badge {
  display:inline-flex; align-items:center; gap:.4rem;
  font-size: 11px; line-height: 1; padding: .35rem .55rem;
  border-radius: 999px; background: color-mix(in srgb, var(--brand1) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand1) 22%, #0000);
  color: color-mix(in srgb, var(--brand1) 80%, #333);
}

/* Advisor plan root */
.ap-plan {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

/* Sections are structural only (no card look) */
.ap-plan > section {
  background: transparent;
  border: none;
  padding: 4px 2px 8px;
  box-shadow: none;
}

/* Section labels (e.g. "Quick summary", "Proposal win-rate") */
.ap-plan h3 {
	margin: 16px 0 12px;
	font: 600 18px var(--font-ui);
	letter-spacing: -0.02rem;
	color: var(--brand1);
	border-bottom: 2px solid var(--brand2);
	padding-bottom: 4px;
}

/* --- H4 + following block = one "card" ---------------------------------- */

/* Heading part of the card */
.ap-plan h4 {
  margin: 10px 0 0;
  padding: 8px 10px 4px;
  font: 500 16px var(--font-ui);
  color: var(--brand1);
}

/* First content block after the h4 (ol / ul / p) – body of the card */
.ap-plan h4 + ol,
.ap-plan h4 + ul,
.ap-plan h4 + p {
  margin-top: 0;
  margin-bottom: 8px;
  padding: 4px 10px 8px;
}

/* If a second block follows (e.g. p then ul), keep it visually within the same card */
.ap-plan h4 + p + ol,
.ap-plan h4 + p + ul {
  margin-top: 0;
  padding-top: 0;
}

/* Base text inside plan */
.ap-plan p {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

/* Lists inside advisor plan */
.ap-plan ul,
.ap-plan ol {
  margin: 4px 0 8px;
  padding: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}

/* Strip default markers and create space for custom ones */
.ap-plan ul li,
.ap-plan ol li {
  position: relative;
  list-style: none;
  padding-left: 1.3rem;
  margin: 2px 0;
Font-size: 14px;
}

/* Unordered bullets – solid dot in brand colour */
.ap-plan ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0.1rem;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--brand1);
  font-weight: 700;
}

/* Top-level step lists: numbered circles aligned with heading baseline */
.ap-plan section > ol {
  counter-reset: advisor-step;
  margin: 4px 0 10px;
  padding: 0;
}

/* Each step item */
.ap-plan section > ol > li {
  position: relative;
  list-style: none;
  margin: 6px 0 10px;
  padding-left: 2.6rem; /* space for the circle */
}

/* Number badge */
.ap-plan section > ol > li::before {
  counter-increment: advisor-step;
  content: counter(advisor-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 400;
  color: #f3f5f2;
  background: var(--brand2);
}

/* Nested ordered lists (e.g. sub-steps under Fast revenue offers…) */
.ap-plan li > ol {
  counter-reset: advisor-sub;
  margin: 4px 0 8px 1.4rem;
  padding: 0;
}

.ap-plan li > ol > li {
  position: relative;
  list-style: none;
  margin: 2px 0;
  padding-left: 1.1rem;
  font-size: 14px;
}

/* Simple inline numbers for nested lists, no big circle */
.ap-plan li > ol > li::before {
  counter-increment: advisor-sub;
  content: counter(advisor-sub) '.';
  position: absolute;
  left: 0;
  top: 0.05em;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand1);
}

/* Nested lists: slight extra indent, reuse same markers */
.ap-plan li > ul,
.ap-plan li > ol {
  margin-top: 4px;
}

.ap-plan li > ul li,
.ap-plan li > ol li {
  padding-left: 1.1rem;
}

/* SVG sizing / colour */
.ap-header .btn svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: #f3f5f2;
}

/* Close button variant */
#advisorCloseBtn {
  color: var(--brand1);
  background: none;
  border: 1px solid var(--brand1);
}

#advisorCloseBtn svg {
  fill: var(--brand1);
}

/* Advisor header icon buttons */
.ap-header .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
}

ol {
	padding-bottom: 16px !important;
}

strong {
	font-weight: 700;
	color: var(--brand2);
}