/* ── THE ANALYSIS MODULE'S OWN LOOK, SHARED BY BOTH APPS ─────────────────────
   analysis.js renders one module into two very different-looking places: the
   CRM's dark-and-gold, and the employer workspace's MyIApro navy-and-crimson.

   What is shared is STRUCTURE — which card lifts on hover, which row wears the
   picked blue, how big the star is. What is not shared is the SKIN: every value
   below is a token, and each app supplies its own palette for those tokens. So
   Ken gets "the coloring theme of the workspace, not the CRM look" without a
   second copy of the rules that decide what a picked card means.

   ⚠ THE TOKENS THIS FILE REQUIRES, which every host page must define:
       --border --border-picked --border-accent
       --surface-1 --surface-2 --surface-3
       --bg-picked --bg-hover
       --text-muted --text-primary
   A host that omits one gets an invisible border, not an error, so they are
   listed here to be checked rather than discovered. */

/* ⚠ A QUOTE CARD ANSWERS THE MOUSE THE WAY A STRIP ROW DOES. Ken, 2026-08-18:
       "The current plan cards open a details dialog when you click on them. these
       do nothing!" They do now, and they have to LOOK like they will before the
       click — an identical card that only sometimes responds is worse than one
       that never did. Tokens, never hardcoded colours: this page has two themes. */
    /* ⚠ ORDER IS THE RULE HERE, NOT SPECIFICITY. `.an-quote-card.is-current` and
       `.an-quote-card.is-picked` weigh exactly the same, so the one that wins is
       the one written last — which is why picked and hover come after current.
       Get this backwards and a current plan can never show either state. */
    .an-quote-card { border: 1px solid var(--border); }

/* ⚠ A TOKEN PER STATUS, DEFAULTING TO WHAT THIS FILE ALREADY DID. Ken asked
   for green current cards, darker green renewals and light yellow alternatives
   — on the WORKSPACE side only, and this stylesheet is shared. So each status
   names its own token and falls back: --card-current to the raised surface both
   apps use today, the other two to no background at all, which is what they have
   now. The CRM defines none of them and is therefore unchanged; my-analysis.html
   defines all three.

   ⚠ THESE STAY ABOVE :hover AND .is-picked. Same weight, so the last one written
   wins — see the note above. Ken: "DO NOT change any of the current mouse over
   or Selected for compare functionality." Move these below and a current plan
   could never show either. */
.an-quote-card.is-current     { background: var(--card-current, var(--surface-2)); }
.an-quote-card.is-renewal     { background: var(--card-renewal, transparent); }
.an-quote-card.is-alternative { background: var(--card-alternative, transparent); }

/* Ken, 2026-08-19: "when a user hovers over a quoted plan card, could we make
       the background a light blue, and when a plan is selected to compare, (using
       the checkbox), we keep the light blue background for that selected card
       until it is Unchecked". One colour for both, because they are one idea —
       this is the card you are pointing at, or the one you have kept. */
    .an-quote-card:hover, .an-quote-card.is-picked {
      background: var(--bg-picked); border-color: var(--border-picked); }

/* ⚠ THE SELECTED BENEFIT LINE WEARS THE SAME BLUE, because it means the same
       thing: this is the one you have chosen. Ken, 2026-08-19: "I want to also
       have, in the Benefit tree navigation, the Benefit that is currently
       selected to have that light blue highlight until it is no longer
       selected!"

       It was var(--surface-2) inline — the colour of a raised panel, which says
       "this row is a surface" rather than "this row is your choice", and on the
       light theme var(--surface-2) is plain white, so the selection was carried
       by the bold weight alone. */
    .an-tree-line { background: transparent; border: 1px solid transparent; }

.an-tree-line:hover { background: var(--bg-hover, rgba(127,127,127,.06)); }

.an-tree-line.is-on { background: var(--bg-picked); border-color: var(--border-picked); }

/* ⚠ THE RECOMMENDED STAR IS THE AGENT'S OWN OPINION, and the employer sees
       it — so it is the one mark on this page allowed to be loud. Ken,
       2026-08-18: "lets make that star a bit Bigger and lets make it stand out!
       What would be a good color???"

       ⚠ NOT var(--text-accent), which is what it wore. That is the CRM's muted
       antique gold (#c8a84b) and it is ALSO the colour of the status pill the
       star now sits beside — two golds touching, and the star lost. This is a
       brighter amber, warm enough to read as a star rather than as another
       label, and it carries a soft halo so it holds against the pill's tinted
       background in both themes.

       Stated rather than tokenised on purpose: no existing token means "this is
       the one we are recommending", and borrowing one that means something else
       is how the pill and the star came to be the same colour. */
    .an-star { color: #f5b301; font-size: 20px; line-height: 1; flex: none;
      text-shadow: 0 0 6px rgba(245,179,1,.55); }

html.light-theme .an-star { color: #d98f00;
      text-shadow: 0 0 5px rgba(217,143,0,.35); }

/* ⚠ RESET TO LIVE DATA THROWS AWAY EVERYTHING MODELLED, so it must not look
       like the outline buttons around it. Ken, 2026-08-18: "I want to make sure
       users don't just go and click on it. it needs to be a Warning type of
       button!" Amber fill in both themes, and visibly dead when there is
       nothing to discard rather than merely faded. */
    /* ⚠ NOT var(--fill-warning). That token is #f59e0b in BOTH themes — it is
       never overridden for light — and white text on it lands near 2:1, which is
       unreadable. A warning nobody can read is decoration. amber-700 carries
       white at ~4.9:1 and stays unmistakably amber against the dark surface and
       the light one alike, which is why this one figure is stated rather than
       taken from a token. */
    /* ⚠ CRIMSON, NOT AMBER — Ken, 2026-08-20. var(--crimson) is defined on the
       workspace side as the IA brand red; the CRM has no such token, so the
       fallback carries the identical value rather than leaving the button
       unstyled there. One renderer, one colour, both skins. */
    .an-reset { background: var(--crimson, #6e3335); color: #fff;
      border: 1px solid var(--crimson, #6e3335); font-weight: 700; }

.an-reset:hover:not(:disabled) { filter: brightness(1.12); }

.an-reset:disabled { background: transparent; color: var(--text-muted);
      border-color: var(--border); font-weight: 400; opacity: .5; cursor: not-allowed; }

/* ⚠ NAVY BESIDE THE CRIMSON, AND THE CONTRAST IS THE MESSAGE. Ken, 2026-08-20:
   "(with our Navy Blue Color) we can put a button that says Re-Check For
   Compliance". Reset throws work away; Re-Check only brings questions back.
   Two buttons an inch apart in the same warning colour would flatten that
   difference — the harmless one would read as dangerous and, worse, the
   dangerous one would stop reading as dangerous.

   Same fallback discipline as .an-reset: --ia is the workspace's navy and the
   CRM has no such token, so the literal carries the identical value rather than
   leaving the button unstyled on one of the two skins. */
.an-recheck { background: var(--ia, #1d3557); color: #fff;
      border: 1px solid var(--ia, #1d3557); font-weight: 700; }
.an-recheck:hover { filter: brightness(1.15); }

/* ═══ THE ASK MyIAPro DRAWER ════════════════════════════════════════════════
   ⚠ MOVED OUT OF index.html 2026-08-20. It only ever existed in the CRM's own
   <style>, so the employer's workspace loaded none of it and the drawer
   rendered as two plain blocks stacked in the page — Ken: "it should be a
   DRAWER that slides down over the top of everything... But right now its looks
   like an expandable/Collapsible... WTF!?!?"

   The renderer was shared; the STYLE was not, which is the same split that
   caused every other thing that went wrong on that page this week. Both apps
   load analysis.css, so this is now one copy. */
/* It has to LOOK like a drawer, not just behave like one. Ken: "I was just
   expecting a Drawer look." So: inset from the edges so it reads as a panel
   that came down rather than a screen takeover, rounded at the bottom where
   it emerged, and a real pull-handle hanging off the bottom edge that closes
   it when clicked. The handle is the affordance — without it this is just a
   box that appeared. */
.askia-drawer { align-self: stretch; margin: 0 14px; border-radius: 0 0 16px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-accent); border-top: none;
  box-shadow: 0 18px 44px rgba(0,0,0,0.5), 0 2px 0 rgba(255,255,255,0.04) inset;
  transform: translateY(0);
  animation: askiaPullDown 0.3s cubic-bezier(.2,.85,.3,1); }
@keyframes askiaPullDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .askia-drawer { animation: none; } }
.askia-drawer .askia-head { display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; background: var(--bg-accent);
  border-bottom: 1px solid var(--border); border-radius: 0 0 0 0; }
.askia-drawer .askia-body { padding: 13px 18px 20px; max-height: 62vh; overflow: auto; }

/* ⚠ THE ASK BOX BELONGED TO NEITHER HOST. Ken, 2026-08-29: "The 'Optional'
   input box is just a square and looks horrible."

   It was a bare <textarea> wearing whatever the host page happened to give it,
   AND THE TWO HOSTS DO NOT AGREE. index.html sets `width:100%` and
   `min-height:80px` on every textarea; my-analysis.html sets neither — so on the
   employer's side it rendered at the browser's default twenty columns, an actual
   small square, sitting BESIDE its label because that page's `label` is not
   display:block either. Two pages, two answers, and the drawer had no opinion of
   its own.

   The drawer dresses its own composer now, in tokens both hosts declare, so it
   reads the same whether it comes down over the dark CRM or the employer's white
   workspace. Same lesson as the two-hosts token trap: what the shared renderer
   draws, the shared stylesheet styles. */
/* ═══ THE ANSWER AS A DOCUMENT ══════════════════════════════════════════════
   Ken, 2026-08-30: "I want that Last Answer, to show as a well structured
   outlined document that actually helps the user and is easy to read and
   follow!"

   Read top to bottom, with the outline first. Tokens only — this drawer comes
   down over the dark CRM and over the employer's white workspace, and both
   declare every name used here. */
.an-doc-toc { border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; margin: 14px 0 4px; background: var(--surface-2); }
.an-doc-toc-t { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.an-doc-toc ol { margin: 0; padding-left: 20px; }
.an-doc-toc li { font-size: 12.5px; line-height: 1.85; }
.an-doc-toc a { color: var(--text-accent); text-decoration: none; font-weight: 600; }
.an-doc-toc a:hover { text-decoration: underline; }
.an-doc-toc li span { color: var(--text-muted); font-size: 11px; margin-left: 6px; }

.an-doc-sec { margin-top: 22px; padding-top: 4px;
  border-top: 1px solid var(--border); scroll-margin-top: 8px; }
.an-doc-sec h4 { display: flex; align-items: baseline; gap: 9px;
  margin: 10px 0 6px; font-size: 15px; font-weight: 700; color: var(--text-primary); }
/* The number IS the outline — it says where you are in the document. */
.an-doc-num { display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; border-radius: 6px; font-size: 11.5px;
  background: var(--bg-accent); color: var(--text-accent); font-weight: 700; }
.an-doc-lead { margin: 0 0 6px; font-size: 13.5px; font-weight: 700;
  line-height: 1.5; color: var(--text-primary); }
.an-doc-body { margin: 0; font-size: 12.5px; line-height: 1.65;
  color: var(--text-secondary); }
.an-doc-none { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); font-style: italic; }

.an-doc-bench { display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 20px; padding-top: 13px; border-top: 1px solid var(--border); }
.an-doc-bench span { font-size: 11.5px; color: var(--text-muted); line-height: 1.55;
  flex: 1; min-width: 230px; }
.an-doc-nothing { margin: 14px 0 0; font-size: 12.5px; line-height: 1.6;
  color: var(--text-warning); }
.an-doc-plans { list-style: none; margin: 10px 0 0; padding: 0; }
.an-doc-plan { border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; margin-top: 8px; background: var(--surface-1); }
.an-doc-plan-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.an-doc-plan-h strong { font-size: 13px; }
.an-doc-plan-name { color: var(--text-muted); font-size: 12px; }
.an-doc-rank { display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 5px; font-size: 10.5px; font-weight: 700;
  background: var(--surface-3); color: var(--text-secondary); }
.an-doc-chip { font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-accent); border: 1px solid var(--border); border-radius: 4px;
  padding: 0 5px; }
.an-doc-facts { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.an-doc-why { margin: 5px 0 0; font-size: 12.5px; line-height: 1.55; }
.an-doc-act { margin-top: 7px; }

.askia-ask { margin-top: 14px; }
.askia-ask > label { display: block; margin: 0 0 6px; font-size: 12px;
  font-weight: 600; color: var(--text-secondary); }
.askia-ask textarea { display: block; width: 100%; box-sizing: border-box;
  min-height: 74px; resize: vertical;
  font-family: inherit; font-size: 13px; line-height: 1.6;
  color: var(--text-primary); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  transition: border-color .15s ease, box-shadow .15s ease; }
/* The example is a hint, not an instruction — it must not shout over the answer
   somebody is about to type into it. */
.askia-ask textarea::placeholder { color: var(--text-muted); opacity: .9; }
.askia-ask textarea:focus { outline: none; border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--bg-accent); }
.askia-ask .askia-ask-row { display: flex; gap: 10px; align-items: center;
  margin-top: 10px; flex-wrap: wrap; }
.askia-ask .askia-ask-note { font-size: 10.5px; color: var(--text-muted);
  line-height: 1.5; margin-left: auto; max-width: 430px; text-align: right; }
@media (max-width: 640px) {
  .askia-ask .askia-ask-note { margin-left: 0; text-align: left; max-width: none; }
}

/* ⚠ THE HANDLE IS THE BUTTON. Ken: "the HANDLE should be the button and say
   Ask MyIApro." Right — a drawer you open with a button somewhere else is
   not a drawer, it is a panel with a remote control. One element, always on
   screen, that pulls the drawer down and pushes it back up.

   It rides at the bottom of the dock, so when the drawer is closed it hangs
   just under the topbar and when the drawer is open it sits at the drawer's
   bottom edge — the handle moves with the thing it opens, which is what
   makes the metaphor read. */
/* ⚠ THE TWO OFFSETS ARE TOKENS, because they are the only part of this that
   is about the HOST rather than the drawer. The CRM has a 48px topbar and a
   210px sidebar; the employer's workspace has neither, and Ken asked there for
   "a DRAWER that slides down over the top of everything" — so it sets both to
   0 and the drawer comes down over the masthead. */
.askia-dock { position: fixed; top: var(--askia-top, 48px); left: var(--askia-left, 210px);
  right: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none; }          /* the page stays clickable around it */
.askia-dock > * { pointer-events: auto; }

.askia-pull { display: flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 5px 20px 6px; border: 1px solid var(--border-accent); border-top: none;
  border-radius: 0 0 13px 13px; background: var(--surface-1);
  color: var(--text-accent); font-size: 12px; font-weight: 700;
  font-family: inherit; line-height: 1.3;
  box-shadow: 0 8px 18px rgba(0,0,0,0.36);
  transition: padding-bottom .15s, box-shadow .15s; }
.askia-pull:hover { padding-bottom: 10px; box-shadow: 0 10px 24px rgba(0,0,0,0.5); }
.askia-pull .askia-chev { font-size: 9px; opacity: .85; }
/* The grab-bar, so it reads as something you pull rather than press. */
.askia-pull::after { content: ''; width: 26px; height: 3px; border-radius: 2px;
  background: var(--border-accent); opacity: .55; margin-left: 4px; }


/* ═══ THE TWO FACT BUTTONS, AND THE CLASS CHIPS ═════════════════════════════
   Ken, 2026-08-20. Both were inline styles reaching for --text-warning and
   --text-success; on a crimson button those are unreadable, and on a navy chip
   so is --text-primary. They are classes now so each skin can carry its own
   brand, and so the two buttons cannot drift apart — they sit side by side and
   reading as a pair is the whole point of them. */

/* "Employer Contributions" and "Employee Wages". Crimson because they state a
   FACT that may need attention — how many groups still have no rule, how many
   wages are missing — rather than because pressing them is dangerous. */
.an-fact { background: var(--crimson, #6e3335); color: #fff;
  border: 1px solid var(--crimson, #6e3335); font-weight: 600; }
.an-fact:hover:not(:disabled) { filter: brightness(1.14); }
/* ⚠ THE COUNT AND THE ICON, in the light blue Ken asked for. It has to clear
   4.5:1 on the crimson to be read at 11px, which #a8c8f0 does and the gold
   does not. */
.an-fact .an-fact-mark { color: #a8c8f0; font-weight: 700; }

/* The class chips: navy, white text, and the chosen one wears the same light
   blue that a ticked plan card and the selected benefit already wear. */
.an-chip { cursor: pointer; border-radius: 99px; padding: 3px 11px; font-size: 12px;
  white-space: nowrap; border: 1px solid var(--fill-accent, #1d3557);
  background: var(--fill-accent, #1d3557); color: #fff; }
.an-chip:hover { filter: brightness(1.15); }
.an-chip .an-chip-n { font-size: 11px; opacity: .78; }
/* ⚠ SELECTED IS THE LIGHT BLUE, NOT A DARKER NAVY. Against a row of navy chips
   the eye finds the pale one instantly; a darker navy reads as disabled. */
.an-chip.is-on { background: var(--bg-picked, rgba(29,53,87,.14));
  border-color: var(--border-picked, rgba(29,53,87,.62));
  color: var(--text-accent, #1d3557); font-weight: 700; }
.an-chip.is-on .an-chip-n { opacity: 1; }

/* The way out. Ken, 2026-08-20: crimson with contrasting text, on both sides —
   it is the one control on the page that LEAVES it, and an outline button among
   outline buttons is the one nobody finds when they want to go. */
.an-back { background: var(--crimson, #6e3335); color: #fff;
  border: 1px solid var(--crimson, #6e3335); font-weight: 600; }
.an-back:hover:not(:disabled) { filter: brightness(1.14); }

/* ⚠ THE BUY-DOWN IN THE COMPARISON HEADER IS A QUESTION UNTIL IT IS ANSWERED.
   Ken, 2026-08-20: "COLOR that DROP down with our CRIMSON color with
   contrasting text IF nothing has been selected. Once something IS selected,
   change the Color to our Light blue and contrasting text color."

   A colour that means "this still needs you" and then stops meaning it. Same
   fallback discipline as the rest: the workspace token first, the CRM's second,
   a literal last, so one stylesheet dresses both skins. */
.an-cmp-buydown select { font-size:10.5px; padding:2px 6px; border-radius:6px;
  background: var(--bg-accent, rgba(29,53,87,.12));
  color: var(--text-accent, #1d3557);
  border: 1px solid var(--border-accent, rgba(29,53,87,.4)); font-weight: 600; }
.an-cmp-buydown.is-unset select {
  background: var(--crimson, #6e3335); color: #fff;
  border-color: var(--crimson, #6e3335); }
.an-cmp-buydown.is-unset label { color: var(--crimson, #6e3335); font-weight: 700; }
