/* The risk analysis card in the conversation (the classification streamed from the surveillance
   gateway). Its tokens are scoped to the analysis message so the copilot styling around it is
   unchanged. Built from the former styles.css (sections 11 and 25) and analysis.css. */
.message-group--risk, .analysis-definition {
        /* Sage Green Brand Palette - derived from rgb(215, 230, 198) */
        --brand-50: #f6f9f2;
        --brand-100: #eaf0e2;
        --brand-200: #e0ebd4;
        --brand-300: #d7e6c6;
        --brand-400: #c2d9ab;
        --brand-500: #a8c98e;
        --brand-600: #8eb872;
        --brand-700: #74a557;
        --brand-800: #5c8a43;
        --brand-900: #466a33;

        /* Primary Brand Colors */
        --brand-primary: #a8c98e;
        --brand-primary-light: #c2d9ab;
        --brand-primary-dark: #74a557;
        --brand-accent: #5c8a43;
        --brand-glow: rgba(215, 230, 198, 0.5);
        --brand-glow-subtle: rgba(215, 230, 198, 0.2);

        /* Glassmorphism Tokens */
        --glass-bg: rgba(255, 255, 255, 0.72);
        --glass-bg-hover: rgba(255, 255, 255, 0.88);
        --glass-bg-solid: rgba(255, 255, 255, 0.95);
        --glass-border: rgba(255, 255, 255, 0.22);
        --glass-border-subtle: rgba(255, 255, 255, 0.08);
        --glass-border-emphasized: rgba(215, 230, 198, 0.5);
        --glass-blur-sm: blur(8px);
        --glass-blur-md: blur(16px);
        --glass-blur-lg: blur(24px);
        --glass-blur-xl: blur(40px);

        /* Glass Shadows */
        --glass-shadow:
          0 4px 20px rgba(0, 0, 0, 0.04),
          inset 0 1px 0 rgba(255, 255, 255, 0.5),
          inset 0 -1px 0 rgba(0, 0, 0, 0.01);
        --glass-shadow-elevated:
          0 12px 32px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.03),
          inset 0 1px 0 rgba(255, 255, 255, 0.6);
        --glass-shadow-glow:
          0 0 40px rgba(215, 230, 198, 0.2), 0 4px 20px rgba(0, 0, 0, 0.04);

        /* Surface Colors */
        --surface-primary: #ffffff;
        --surface-secondary: #f8faf5;
        --surface-tertiary: #f1f5ec;
        --surface-elevated: #ffffff;
        --surface-overlay: rgba(15, 23, 42, 0.6);

        /* Text Colors */
        --text-primary: #1e2d16;
        --text-secondary: #3e5a30;
        --text-tertiary: #6e8e60;
        --text-muted: #9ab48c;
        --text-inverse: #ffffff;
        --text-brand: #5c8a43;

        /* Border Colors */
        --border-default: rgba(0, 0, 0, 0.06);
        --border-subtle: rgba(0, 0, 0, 0.03);
        --border-emphasized: rgba(0, 0, 0, 0.1);
        --border-brand: rgba(215, 230, 198, 0.5);

        /* Spacing */
        --space-1: 0.25rem;
        --space-2: 0.5rem;
        --space-3: 0.75rem;
        --space-4: 1rem;
        --space-5: 1.25rem;
        --space-6: 1.5rem;
        --space-8: 2rem;
        --space-10: 2.5rem;
        --space-12: 3rem;
        --space-16: 4rem;

        /* Typography */
        --font-sans:
          "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
          sans-serif;
        --font-mono:
          "Fira Code", "JetBrains Mono", "SF Mono", Monaco, monospace;

        --text-xs: 0.75rem;
        --text-sm: 0.875rem;
        --text-base: 1rem;
        --text-lg: 1.125rem;
        --text-xl: 1.25rem;
        --text-2xl: 1.5rem;
        --text-3xl: 1.875rem;
        --text-4xl: 2.25rem;

        /* Border Radius */
        --radius-sm: 0.375rem;
        --radius-md: 0.5rem;
        --radius-lg: 0.75rem;
        --radius-xl: 1rem;
        --radius-2xl: 1.5rem;
        --radius-full: 9999px;

        /* Animations */
        --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
        --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
        --ease-in-out-smooth: cubic-bezier(0.4, 0, 0.2, 1);
        --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
        --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
        --ease-smooth-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
        --ease-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.4);
        --duration-fast: 150ms;
        --duration-normal: 250ms;
        --duration-slow: 400ms;
        --duration-entrance: 600ms;
        --duration-dramatic: 800ms;

        /* Motion primitives: one spring-ish ease-out for UI, one strong
           in-out for on-screen movement, explicit press/quick/base/slow
           budgets. UI motion stays under 320ms. */
        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
        --ease-in-out-strong: cubic-bezier(0.77, 0, 0.175, 1);
        --ease-settle: cubic-bezier(0.2, 0.9, 0.25, 1.06);
        --t-press: 120ms;
        --t-quick: 160ms;
        --t-base: 220ms;
        --t-slow: 320ms;

        /* Instrument palette - the mono voice and semantic risk colors */
        --ink: #16240f;
        --ink-2: #35502a;
        --text-label: #4f6c43;
        --line: rgba(24, 44, 15, 0.1);
        --line-strong: rgba(24, 44, 15, 0.16);
        --paper: #f5f9f0;
        --card: #ffffff;
        --sage-600: #5f8f45;
        --sage-700: #456b31;
        --risk-high: #a2621d;
        --risk-high-soft: rgba(162, 98, 29, 0.1);
        --risk-clean: #3f7d4e;
        --risk-clean-soft: rgba(63, 125, 78, 0.1);
        --shadow-card: 0 1px 2px rgba(20, 40, 12, 0.04),
          0 12px 28px -12px rgba(20, 40, 12, 0.16);
        --shadow-float: 0 2px 6px rgba(20, 40, 12, 0.06),
          0 24px 48px -24px rgba(20, 40, 12, 0.28);

        /* Z-Index */
        --z-base: 0;
        --z-elevated: 10;
        --z-sticky: 100;
        --z-overlay: 200;
        --z-modal: 300;
        --z-toast: 400;
  --ink: #18332d;
  --ink-2: #4b625a;
  --text-label: #647870;
  --paper: #f2f5f5;
  --line: #e1e8e5;
  --line-strong: #c5d2cc;
  --risk-clean: #397449;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow-card: 0 2px 4px rgb(24 51 45 / 2%), 0 18px 50px -28px rgb(24 51 45 / 20%);
}

      /* ============================================
         11. RISK VERDICT PLATE (ticket mode)
         One card, one verdict. The left rail is the risk meter: quiet
         sage while the outcome is unknown, semantic once it settles.
         ============================================ */
      .classification-message {
        position: relative;
        width: 100%;
        padding: var(--space-4) var(--space-4) var(--space-3)
          calc(var(--space-4) + 6px);
        border: 1px solid var(--line);
        border-radius: 20px;
        background: var(--card);
        box-shadow: var(--shadow-card);
        overflow: hidden;
        animation: verdictArrive var(--t-slow) var(--ease-out) both;
      }
      .classification-message::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 4px;
        background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
        opacity: 0.45;
        transition:
          opacity var(--t-slow) var(--ease-out),
          background var(--t-slow) var(--ease-out);
      }
      .classification-message.is-settled::before {
        opacity: 1;
      }
      .classification-message[data-risk="high"]::before {
        background: linear-gradient(180deg, #d3a05a, var(--risk-high));
      }
      .classification-message[data-risk="review"]::before {
        background: linear-gradient(180deg, #d3a05a, var(--risk-high));
      }
      .classification-message[data-risk="unknown"]::before {
        background: var(--line);
      }
      .classification-message[data-risk="clean"]::before {
        background: linear-gradient(180deg, var(--brand-500), var(--risk-clean));
      }

      .classification-message__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3);
        margin-bottom: var(--space-3);
      }
      .classification-message__eyebrow {
        color: var(--text-label);
        font-family: var(--font-mono);
        font-size: 0.6875rem;
        font-weight: 500;
        letter-spacing: 0.09em;
        text-transform: uppercase;
        white-space: nowrap;
      }
      .classification-message__login {
        display: inline-flex;
        align-items: center;
        padding: 2px 8px;
        border: 1px solid var(--line);
        border-radius: var(--radius-full);
        background: var(--paper);
        color: var(--ink-2);
        font-family: var(--font-mono);
        font-size: 0.6875rem;
        letter-spacing: 0.02em;
        white-space: nowrap;
        animation: chipIn var(--t-base) var(--ease-out) both;
      }

      .classification-message__label {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        color: var(--ink);
        font-size: var(--text-xl);
        font-weight: 600;
        line-height: 1.25;
        letter-spacing: -0.015em;
        overflow-wrap: anywhere;
        animation: verdictIn var(--t-slow) var(--ease-out) both;
      }
      .classification-message__dot {
        width: 9px;
        height: 9px;
        flex: 0 0 9px;
        border-radius: 50%;
        background: var(--sage-600);
        box-shadow: 0 0 0 4px var(--risk-clean-soft);
        animation: dotPop var(--t-slow) var(--ease-settle) both;
      }
      .classification-message__dot[data-risk="high"] {
        background: var(--risk-high);
        box-shadow: 0 0 0 4px var(--risk-high-soft);
      }
      .classification-message__dot[data-risk="review"] {
        background: var(--risk-high);
        box-shadow: 0 0 0 4px var(--risk-high-soft);
      }
      .classification-message__dot[data-risk="unknown"] {
        background: var(--text-label);
        box-shadow: 0 0 0 4px var(--paper);
      }

      /* Three dots, one jump each, in sequence — the only motion that
         runs while the classifier works. */
      .classification-message__thinking {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        min-height: 28px;
        color: var(--ink-2);
        font-size: var(--text-sm);
      }
      .classification-message__thinking-dots {
        display: inline-flex;
        align-items: flex-end;
        gap: 4px;
        height: 10px;
      }
      .classification-message__thinking-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--sage-600);
        opacity: 0.5;
        animation: dotJump 1.2s var(--ease-out) infinite;
      }
      .classification-message__thinking-dot:nth-child(2) {
        animation-delay: 0.11s;
      }
      .classification-message__thinking-dot:nth-child(3) {
        animation-delay: 0.22s;
      }
      .classification-message.is-settled .classification-message__thinking-dot {
        animation: none;
      }
      .classification-message__thinking-timer {
        color: var(--text-label);
        font-family: var(--font-mono);
        font-size: 0.6875rem;
        font-variant-numeric: tabular-nums;
      }

      .classification-message__toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-2);
        width: 100%;
        min-height: 44px;
        margin-top: var(--space-3);
        padding: var(--space-2) 0 0;
        border: 0;
        background: transparent;
        color: var(--sage-700);
        font: inherit;
        font-size: var(--text-sm);
        font-weight: 600;
        text-align: left;
        cursor: pointer;
        transition:
          color var(--t-quick) ease,
          transform var(--t-press) var(--ease-out);
      }
      .classification-message__toggle:hover {
        color: var(--ink);
        text-decoration: none;
      }
      .classification-message__toggle:active {
        transform: scale(0.99);
      }
      .classification-message__toggle-icon {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
        transition: transform var(--t-base) var(--ease-out);
      }
      .classification-message__toggle-icon svg {
        display: block;
        width: 100%;
        height: 100%;
        stroke-linecap: round;
        stroke-linejoin: round;
      }
      .classification-message__toggle[aria-expanded="true"]
        .classification-message__toggle-icon {
        transform: rotate(180deg);
      }

      .classification-message__details[hidden] {
        display: none;
      }
      .classification-message__details {
        display: grid;
        grid-template-rows: 0fr;
        overflow: hidden;
        transition: grid-template-rows var(--t-slow) var(--ease-out);
      }
      .classification-message__details.is-open {
        grid-template-rows: 1fr;
      }
      .classification-message__details-inner {
        min-height: 0;
        overflow: hidden;
        margin-top: var(--space-3);
        padding-top: var(--space-3);
        border-top: 1px solid var(--line);
        color: var(--ink-2);
        font-size: var(--text-sm);
        line-height: 1.7;
        overflow-wrap: anywhere;
      }
      .classification-message__details h4 {
        margin: var(--space-3) 0 var(--space-1);
        color: var(--text-label);
        font-family: var(--font-mono);
        font-size: 0.6875rem;
        font-weight: 500;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .classification-message__details-inner > h4:first-child,
      .classification-message__details-inner > p:first-child + h4 {
        margin-top: 0;
      }
      .classification-message__details p {
        margin: 0 0 var(--space-2);
        white-space: pre-line;
      }
      .classification-message__details ul {
        margin: var(--space-1) 0 var(--space-3);
        padding: 0;
        list-style: none;
      }
      .classification-message__details li {
        position: relative;
        padding-left: var(--space-4);
        color: var(--ink-2);
        font-family: var(--font-mono);
        font-size: 0.75rem;
        line-height: 1.6;
      }
      .classification-message__details li::before {
        content: "";
        position: absolute;
        left: 1px;
        top: 0.72em;
        width: 6px;
        height: 1px;
        background: var(--brand-500);
      }
      .classification-message__details li + li {
        margin-top: 2px;
      }
      .classification-message__explanation {
        white-space: pre-line;
      }
      .classification-message__explanation--report {
        white-space: normal;
      }

      .classification-message__score-head {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: var(--space-3);
      }
      .classification-message__score-head h4 {
        margin: 0;
      }
      .classification-message__score-compact {
        display: inline-flex;
        align-items: baseline;
        gap: 2px;
        color: var(--ink);
        font-family: var(--font-mono);
        font-variant-numeric: tabular-nums;
      }
      .classification-message__score-value {
        font-size: var(--text-sm);
        font-weight: 600;
      }
      .classification-message__score-suffix {
        color: var(--text-label);
        font-size: 0.625rem;
      }
      .classification-message__meter {
        display: block;
        height: 4px;
        margin: var(--space-2) 0 var(--space-3);
        border-radius: var(--radius-full);
        background: rgba(24, 44, 15, 0.08);
        overflow: hidden;
      }
      .classification-message__meter-bar {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, var(--brand-500), var(--risk-high));
        transform: scaleX(var(--ratio, 0));
        transform-origin: left center;
      }
      .classification-message__meter-bar[data-risk="clean"] {
        background: linear-gradient(90deg, var(--brand-400), var(--risk-clean));
      }
      .classification-message__details.is-open .classification-message__meter-bar {
        animation: meterFill 900ms var(--ease-out) both;
      }
      @keyframes meterFill {
        from {
          transform: scaleX(0);
        }
        to {
          transform: scaleX(var(--ratio, 0));
        }
      }

      .classification-message__status {
        margin: var(--space-2) 0 0;
        color: var(--text-label);
        font-size: var(--text-sm);
      }
      .classification-message__error {
        margin-top: var(--space-3);
        padding: var(--space-3);
        border: 1px solid rgba(162, 98, 29, 0.28);
        border-radius: 14px;
        background: var(--risk-high-soft);
        animation: verdictIn var(--t-base) var(--ease-out) both;
      }
      .classification-message__error-text {
        margin: 0 0 var(--space-3);
        color: var(--ink-2);
        font-size: var(--text-sm);
      }
      .classification-message__retry {
        min-height: 36px;
        padding: 6px 16px;
        border: 1px solid rgba(162, 98, 29, 0.35);
        border-radius: var(--radius-full);
        background: var(--surface-primary);
        color: var(--risk-high);
        font-family: inherit;
        font-size: var(--text-sm);
        font-weight: 600;
        cursor: pointer;
        transition:
          background var(--t-quick) ease,
          transform var(--t-press) var(--ease-out);
      }
      .classification-message__retry:hover {
        background: rgba(162, 98, 29, 0.08);
      }
      .classification-message__retry:active:not(:disabled) {
        transform: scale(0.97);
      }
      .classification-message__retry:disabled {
        opacity: 0.6;
        cursor: default;
      }
      .classification-message__label[hidden],
      .classification-message__login[hidden],
      .classification-message__toggle[hidden],
      .classification-message__thinking[hidden],
      .classification-message__status[hidden],
      .classification-message__error[hidden],
      .classification-message__head[hidden] {
        display: none;
      }

      @keyframes verdictArrive {
        from {
          opacity: 0;
          transform: translateY(10px) scale(0.985);
          filter: blur(3px);
        }
        to {
          opacity: 1;
          transform: translateY(0) scale(1);
          filter: blur(0);
        }
      }
      @keyframes verdictIn {
        from {
          opacity: 0;
          transform: translateY(6px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }
      @keyframes dotPop {
        from {
          opacity: 0;
          transform: scale(0.4);
        }
        to {
          opacity: 1;
          transform: scale(1);
        }
      }
      @keyframes dotJump {
        0%,
        62%,
        100% {
          transform: translateY(0) scale(0.85);
          opacity: 0.5;
        }
        24% {
          transform: translateY(-6px) scale(1.05);
          opacity: 1;
        }
      }
      @keyframes chipIn {
        from {
          opacity: 0;
          transform: translateY(-2px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }

      @media (prefers-reduced-motion: reduce) {
        .classification-message,
        .classification-message__label,
        .classification-message__login,
        .classification-message__dot,
        .classification-message__error {
          animation: none;
        }
        .classification-message__thinking-dot {
          animation: none;
          opacity: 0.8;
        }
        .classification-message__thinking-dot:nth-child(2) {
          opacity: 0.6;
        }
        .classification-message__thinking-dot:nth-child(3) {
          opacity: 0.45;
        }
        .classification-message__details,
        .classification-message__meter-bar {
          transition: none;
        }
        .classification-message__details.is-open .classification-message__meter-bar {
          animation: none;
        }
      }

      /* Bot Message Typography */
      .message.bot-msg h1,
      .message.bot-msg h2,
      .message.bot-msg h3,
      .message.bot-msg h4 {
        margin-top: var(--space-4);
        margin-bottom: var(--space-2);
        font-weight: 600;
        color: var(--text-primary);
      }

      .message.bot-msg h1:first-child,
      .message.bot-msg h2:first-child,
      .message.bot-msg h3:first-child,
      .message.bot-msg h4:first-child {
        margin-top: 0;
      }

      .message.bot-msg h1 {
        font-size: var(--text-xl);
      }
      .message.bot-msg h2 {
        font-size: var(--text-lg);
      }
      .message.bot-msg h3 {
        font-size: var(--text-base);
      }

      .message.bot-msg p {
        margin-bottom: var(--space-3);
        line-height: 1.7;
      }

      .message.bot-msg p:last-child {
        margin-bottom: 0;
      }

      .message.bot-msg ul,
      .message.bot-msg ol {
        margin: var(--space-3) 0;
        padding-left: var(--space-6);
      }

      .message.bot-msg li {
        margin-bottom: var(--space-2);
      }

      .message.bot-msg strong {
        font-weight: 600;
        color: var(--text-primary);
      }

      .message.bot-msg em {
        font-style: italic;
        color: var(--text-secondary);
      }

      .message.bot-msg a {
        color: var(--brand-primary-dark);
        text-decoration: underline;
        text-underline-offset: 2px;
        transition: color var(--duration-fast);
      }

      .message.bot-msg a:hover {
        color: var(--brand-primary);
      }

      .message.bot-msg code {
        background: var(--surface-tertiary);
        padding: var(--space-1) var(--space-2);
        border-radius: var(--radius-sm);
        font-family: var(--font-mono);
        font-size: 0.88em;
        color: var(--brand-primary-dark);
      }

      .message.bot-msg pre {
        background: var(--surface-tertiary);
        padding: var(--space-3);
        border-radius: var(--radius-lg);
        overflow-x: auto;
        max-width: 100%;
        margin: var(--space-3) 0;
        border: 1px solid var(--border-default);
        font-size: var(--text-xs);
        -webkit-overflow-scrolling: touch;
      }

      .message.bot-msg pre code {
        background: transparent;
        padding: 0;
        color: var(--text-primary);
      }

      .message.bot-msg blockquote {
        border-left: 3px solid var(--brand-primary);
        padding-left: var(--space-4);
        margin: var(--space-4) 0;
        color: var(--text-secondary);
        font-style: italic;
      }

      .message.bot-msg table {
        display: block;
        width: max-content;
        max-width: 100%;
        overflow-x: auto;
        border-collapse: collapse;
        margin: var(--space-3) 0;
        font-size: var(--text-xs);
        -webkit-overflow-scrolling: touch;
      }

      .message.bot-msg th,
      .message.bot-msg td {
        border: 1px solid var(--border-default);
        padding: var(--space-1) var(--space-2);
        text-align: left;
        vertical-align: top;
        white-space: nowrap;
      }

      .message.bot-msg th {
        background: rgba(215, 230, 198, 0.28);
        color: var(--text-primary);
        font-weight: 600;
      }

      .message.bot-msg tbody tr:nth-child(even) {
        background: rgba(215, 230, 198, 0.08);
      }


      /* ============================================
         25. VERDICT RATING & MESSAGE FORMATTING
         ============================================ */
      .classification-message__label {
        flex-wrap: wrap;
      }
      .classification-message__label-text {
        min-width: 0;
      }
      .classification-message__plain-meaning {
        margin: var(--space-2) 0 0 17px;
        color: var(--ink-2);
        font-size: var(--text-sm);
        line-height: 1.5;
      }
      .classification-message__plain-meaning[hidden] {
        display: none;
      }
      /* Severity and score travel with the verdict, so the rating is readable
         before the details are opened. */
      .classification-message__rating {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-left: auto;
        padding: 3px 10px;
        border: 1px solid rgba(63, 125, 78, 0.28);
        border-radius: var(--radius-full);
        background: var(--risk-clean-soft);
        color: var(--risk-clean);
        font-family: var(--font-mono);
        font-size: 0.6875rem;
        font-weight: 500;
        letter-spacing: 0.02em;
        white-space: nowrap;
        animation: ratingIn var(--t-base) var(--ease-settle) both;
      }
      .classification-message__rating[hidden] {
        display: none;
      }
      .classification-message__rating[data-level="elevated"] {
        border-color: rgba(192, 138, 53, 0.34);
        background: rgba(192, 138, 53, 0.1);
        color: #8a6118;
      }
      .classification-message__rating[data-level="high"] {
        border-color: rgba(162, 98, 29, 0.34);
        background: var(--risk-high-soft);
        color: #8c5216;
      }
      .classification-message__rating[data-level="critical"] {
        border-color: rgba(162, 52, 52, 0.38);
        background: rgba(162, 52, 52, 0.1);
        color: #8d2525;
      }
      .classification-message__rating[data-level="clean"] {
        border-color: rgba(63, 125, 78, 0.28);
        background: var(--risk-clean-soft);
        color: var(--risk-clean);
      }
      .classification-message__rating-score {
        display: inline-flex;
        align-items: baseline;
        gap: 1px;
        font-variant-numeric: tabular-nums;
      }
      .classification-message__rating-score[hidden] {
        display: none;
      }
      .classification-message__rating-value {
        font-weight: 600;
      }
      .classification-message__rating-unit {
        font-size: 0.625rem;
        opacity: 0.75;
      }
      @keyframes ratingIn {
        from {
          opacity: 0;
          transform: translateY(-3px) scale(0.96);
        }
        to {
          opacity: 1;
          transform: translateY(0) scale(1);
        }
      }

      /* Formatted answers: paragraph rhythm, lists, quotes, code and tables
         produced by the markdown renderer. */
      .message.bot-msg {
        white-space: normal;
      }
      .message.user-msg {
        white-space: pre-wrap;
      }
      .message.bot-msg p {
        margin: 0 0 0.75em;
        line-height: 1.65;
      }
      .message.bot-msg p:last-child {
        margin-bottom: 0;
      }
      .message.bot-msg strong {
        color: var(--ink);
        font-weight: 600;
      }
      .message.bot-msg em {
        color: var(--ink-2);
        font-style: italic;
      }
      .message.bot-msg del {
        opacity: 0.7;
      }
      .message.bot-msg ul,
      .message.bot-msg ol {
        margin: 0 0 0.75em;
        padding-left: 1.15em;
      }
      .message.bot-msg li {
        margin-bottom: 0.35em;
        line-height: 1.6;
      }
      .message.bot-msg li::marker {
        color: var(--sage-600);
      }
      .message.bot-msg li:last-child {
        margin-bottom: 0;
      }
      .message.bot-msg h1,
      .message.bot-msg h2,
      .message.bot-msg h3,
      .message.bot-msg h4 {
        color: var(--ink);
        font-weight: 600;
        letter-spacing: -0.02em;
        line-height: 1.3;
        margin: 0 0 0.5em;
      }
      .message.bot-msg h1 {
        font-size: 1.1875rem;
      }
      .message.bot-msg h2 {
        font-size: 1.0625rem;
      }
      .message.bot-msg h3,
      .message.bot-msg h4 {
        font-size: 0.9375rem;
      }
      .message.bot-msg code {
        padding: 1px 5px;
        border: 1px solid var(--line);
        border-radius: 6px;
        background: var(--paper);
        color: var(--sage-700);
        font-family: var(--font-mono);
        font-size: 0.85em;
      }
      .message.bot-msg pre {
        margin: 0 0 0.75em;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #f3f7ee;
        font-size: 0.75rem;
        line-height: 1.6;
      }
      .message.bot-msg pre code {
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--ink);
      }
      .message.bot-msg blockquote {
        margin: 0 0 0.75em;
        padding: 8px 12px;
        border-left: 3px solid var(--brand-400);
        border-radius: 0 10px 10px 0;
        background: rgba(168, 201, 142, 0.1);
        color: var(--ink-2);
        font-style: italic;
      }
      .message.bot-msg blockquote p:last-child {
        margin-bottom: 0;
      }
      .message.bot-msg table {
        border: 1px solid var(--line);
        border-radius: 12px;
        background: var(--card);
      }
      .message.bot-msg th,
      .message.bot-msg td {
        padding: 6px 10px;
        border-color: var(--line);
      }
      .message.bot-msg th {
        background: var(--paper);
        color: var(--text-label);
        font-family: var(--font-mono);
        font-size: 0.6875rem;
        font-weight: 500;
        letter-spacing: 0.04em;
        text-transform: uppercase;
      }
      .message.bot-msg tbody tr:nth-child(even) {
        background: rgba(168, 201, 142, 0.07);
      }
      .message.bot-msg hr {
        margin: 12px 0;
        border: 0;
        border-top: 1px solid var(--line);
      }
      .message.bot-msg a {
        color: var(--sage-700);
      }

      /* Each formatted block settles in just after the bubble, so a long answer
         reads as a sequence instead of arriving as one slab. */
      .message.bot-msg > * {
        animation: blockIn 240ms var(--ease-out) both;
      }
      .message.bot-msg > *:nth-child(1) {
        animation-delay: 0ms;
      }
      .message.bot-msg > *:nth-child(2) {
        animation-delay: 36ms;
      }
      .message.bot-msg > *:nth-child(3) {
        animation-delay: 72ms;
      }
      .message.bot-msg > *:nth-child(4) {
        animation-delay: 108ms;
      }
      .message.bot-msg > *:nth-child(5) {
        animation-delay: 144ms;
      }
      .message.bot-msg > *:nth-child(6) {
        animation-delay: 180ms;
      }
      .message.bot-msg > *:nth-child(n + 7) {
        animation-delay: 210ms;
      }
      @keyframes blockIn {
        from {
          opacity: 0;
          transform: translateY(5px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }
      @media (prefers-reduced-motion: reduce) {
        .classification-message__rating,
        .message.bot-msg > * {
          animation: none;
        }
      }


/* Formerly analysis.css (the card's compact layout), now always on. */
.brand-logo__image { object-fit: contain; }
.copilot-shell .message-group--risk { width: 100%; max-width: 100%; animation: none; }
.copilot-shell .classification-message {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  background: #fff;
  animation: analysis-arrive 260ms cubic-bezier(.2,.8,.2,1) both;
}
.copilot-shell .classification-message::before { display: none; }
.copilot-shell .classification-message__head { display: flex; align-items: flex-end; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); gap: 16px; }
.copilot-shell .classification-message__eyebrow { font-family: inherit; font-size: .625rem; letter-spacing: .1em; font-weight: 600; white-space: normal; text-align: right; }
.copilot-shell .classification-message__login { display: flex; flex-direction: column; align-items: flex-start; padding: 0; background: none; border: 0; border-radius: 0; color: var(--ink); animation: none; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.classification-message__login-caption { font: 500 .75rem/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #647870; margin-bottom: 6px; }
.classification-message__login-value { font: 500 clamp(1.5rem, 2.8vw, 2.25rem)/1.2 "Fira Code", monospace; letter-spacing: -.07em; }
.copilot-shell .classification-message__label { display: flex; flex-direction: column; align-items: stretch; gap: 14px; font-size: inherit; font-weight: 400; letter-spacing: normal; animation: none; }
.copilot-shell .classification-message__dot { display: none; }
.copilot-shell .classification-message__rating { align-self: flex-start; margin: 0; padding: 6px 10px; font: 600 .6875rem/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .015em; animation: none; }
.copilot-shell .classification-message__rating-word::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.copilot-shell .classification-message__label-text { display: flex; flex-direction: column; width: 100%; }
.analysis-finding { display: grid; grid-template-columns: minmax(0, 1fr) 124px; align-items: center; gap: 20px; min-height: 96px; padding: 18px 0; border-bottom: 1px solid #e8eeea; }
.analysis-finding:last-child { border-bottom: 0; }
.analysis-finding__identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.analysis-finding__name { font: 600 clamp(1rem, 1.8vw, 1.25rem)/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.025em; overflow-wrap: anywhere; }
.analysis-finding__info { display: grid; place-items: center; padding: 0; width: 44px; height: 44px; flex: 0 0 44px; border: 0; border-radius: 50%; background: transparent; color: #647870; cursor: pointer; transition: background 140ms ease, color 140ms ease, transform 100ms ease; }
.analysis-finding__info svg { width: 19px; height: 19px; }
.analysis-finding__info:hover, .analysis-finding__info[aria-expanded="true"] { background: #eef4e8; color: #397449; }
.analysis-finding__info:active { transform: scale(.92); }
.analysis-finding__confidence { display: grid; grid-template-columns: 1fr; gap: 4px; text-align: right; min-width: 0; }
.analysis-finding__confidence-caption { color: #647870; font-size: .6875rem; line-height: 1.4; letter-spacing: .015em; }
.analysis-finding__confidence-value { color: #294b3e; font: 500 1.125rem/1.4 "Fira Code", monospace; letter-spacing: -.045em; }
.analysis-finding__confidence[data-available="false"] .analysis-finding__confidence-value { color: #647870; font: 400 .75rem/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; }
.analysis-finding__meter { width: 60px; height: 3px; margin-left: auto; margin-top: 3px; background: #e8eeea; border-radius: 4px; overflow: hidden; }
.analysis-finding__meter > span { display: block; width: 100%; height: 100%; background: #89b451; transform-origin: left; }
.analysis-finding__confidence[data-available="false"] .analysis-finding__meter { visibility: hidden; }
.copilot-shell .classification-message__plain-meaning { margin: 8px 0 18px; color: #647870; font-size: .8125rem; max-width: 60ch; }
.copilot-shell .classification-message__toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; margin-top: 20px; padding: 12px 16px; border: 1px solid #dce5df; border-radius: 12px; background: #f7faf7; color: #294b3e; font: 500 .8125rem/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; transition: background 140ms ease, transform 100ms ease; }
.copilot-shell .classification-message__toggle:hover { background: #edf3eb; }
.copilot-shell .classification-message__toggle:active { transform: scale(.99); }
.copilot-shell .classification-message__details { margin-top: 20px; }
.copilot-shell .classification-message__details-inner { padding: 8px 0 0; border: 0; background: transparent; color: var(--ink-2); font-size: .875rem; line-height: 1.75; }
.copilot-shell .classification-message__explanation--report h2 { font: 600 1.125rem/1.4 "Poppins", sans-serif; letter-spacing: -.03em; }
.copilot-shell .classification-message__thinking { min-height: 80px; color: var(--ink-2); font-size: .875rem; }
.analysis-definition { position: fixed; z-index: 1000; width: min(320px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 18px 20px; border: 1px solid #d5e0d8; border-radius: 16px; background: rgb(255 255 255 / 97%); color: #4b625a; box-shadow: 0 8px 16px -8px rgb(24 51 45 / 15%), 0 24px 56px -16px rgb(24 51 45 / 24%); backdrop-filter: blur(16px); font: 400 .8125rem/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; animation: definition-arrive 160ms cubic-bezier(.2,.8,.2,1) both; }
.analysis-definition__title { display: block; margin-bottom: 8px; color: #18332d; font-size: .875rem; font-weight: 600; }
.analysis-definition p { margin: 0; }
.analysis-definition { overflow-wrap: anywhere; }
@keyframes analysis-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes definition-arrive { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 640px) {
  .copilot-shell .classification-message { padding: 20px; border-radius: 18px; }
  .copilot-shell .classification-message__head { align-items: center; gap: 12px; }
  .copilot-shell .classification-message__eyebrow { max-width: 100px; font-size: .5625rem; line-height: 1.6; }
  .analysis-finding { grid-template-columns: minmax(0, 1fr) 86px; gap: 8px; min-height: 88px; padding: 14px 0; }
  .analysis-finding__identity { gap: 0; }
  .analysis-finding__name { font-size: 1rem; }
  .analysis-finding__info { width: 44px; min-height: 44px; flex-basis: 44px; }
  .analysis-finding__confidence-value { font-size: 1rem; }
  .analysis-finding__confidence-caption { font-size: .625rem; }
  .analysis-definition { padding: 16px 18px; }
}
@media (max-width: 360px) {
  .copilot-shell .classification-message { padding: 18px 16px; }
  .analysis-finding { grid-template-columns: minmax(0, 1fr) 72px; }
  .analysis-finding__name { font-size: .9375rem; }
}
@media (prefers-reduced-motion: reduce) {
  .analysis-definition { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .analysis-definition { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .copilot-shell .classification-message, .analysis-finding, .analysis-definition { border-color: #6a7e72; }
  .analysis-definition { background: #fff; }
  .analysis-finding__confidence-caption { color: #40554b; }
}
