/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --ey-bg: #f4f6fb;
  --ey-yellow: #111827;
  --ey-text: #0f172a;
  --ey-muted: #475569;
  --ey-border: rgba(15, 23, 42, 0.16);
  --ey-surface: #ffffff;
  --ey-on-accent: #111827;
}

html,
body {
  font-family: "Roboto", system-ui, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ey-bg);
  color: var(--ey-text);
}

body.devise-layout {
  background: linear-gradient(180deg, #f8fafc 0%, #eef6eb 100%);
  color: var(--ey-text);
}

/* Tailwind accent overrides */
.bg-indigo-600 {
  background-color: #67BF53 !important;
}

.hover\:bg-indigo-500:hover {
  background-color: #58a847 !important;
}

.text-indigo-600 {
  color: #67BF53 !important;
}

.border-indigo-200 {
  border-color: #b7dfae !important;
}

.bg-indigo-50 {
  background-color: #f2faef !important;
}

.text-indigo-900 {
  color: #245e1b !important;
}

.text-indigo-700 {
  color: #2f7a24 !important;
}

.focus\:border-indigo-500:focus {
  border-color: #67BF53 !important;
}

.focus\:ring-indigo-500:focus {
  --tw-ring-color: #67BF53 !important;
}

.focus\:ring-indigo-200:focus {
  --tw-ring-color: rgba(103, 191, 83, 0.28) !important;
}

/* Flash messages */
.notice {
  padding: 12px 16px;
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 6px;
  margin: 16px;
}

.alert {
  padding: 12px 16px;
  background: rgba(248, 113, 113, 0.12);
  color: #991b1b;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 6px;
  margin: 16px;
}

.report-chat-rules-panel__row-text{
  padding-bottom: 20px;
}
/* Admin dashboard (AIRA board) */
.admin-dashboard {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  min-height: 100vh;
  box-sizing: border-box;
}
.mb-20{
  margin-bottom: 30px;
}

.admin-dashboard header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--ey-border);
}

.admin-dashboard header p {
  margin: 0;
  color: var(--ey-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.admin-dashboard h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ey-yellow);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.admin-dashboard h2 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ey-yellow);
  letter-spacing: 0.01em;
}

.admin-dashboard h3 {
  margin: 1.5rem 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ey-yellow);
}

.admin-dashboard main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-dashboard main > p {
  margin: 0;
}

.admin-dashboard .dataset-show-header-actions a {
  color: var(--ey-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.admin-dashboard .dataset-show-header-actions a:hover {
  color: var(--ey-yellow);
  border-bottom-color: var(--ey-yellow);
}

.admin-dashboard .btn-primary {
  border-bottom: none;
}

.admin-dashboard .btn-primary:hover {
  border-bottom: none;
}

.board-back {
  font-size: 0.9375rem;
}

.board-muted {
  color: var(--ey-muted);
  margin: 0;
}

.board-stats {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ey-muted);
}

.board-section {
  padding: 0;
}

.board-section--compact {
  margin-top: -0.25rem;
}

.board-section--form {
  padding: 1.25rem 1.25rem 1.5rem;
  background: var(--ey-surface);
  border: 1px solid var(--ey-border);
  border-radius: 10px;
}

.admin-dashboard .btn-sign-out {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--ey-text);
  border: 1px solid var(--ey-border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
}

.admin-dashboard .btn-sign-out:hover {
  border-color: var(--ey-yellow);
  color: var(--ey-yellow);
}

/* Devise panels - boxed and centered */
.devise-panel {
  max-width: 400px;
  margin: 60px auto;
  padding: 32px;
  background: #ffffff;
  border: 1px solid #dbe3ea;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.devise-panel h2 {
  margin: 0 0 24px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.devise-panel .field {
  margin-bottom: 16px;
}

.devise-panel .field p {
  margin: 0 0 4px 0;
}

.devise-panel label {
  color: var(--ey-text);
  font-size: 0.9375rem;
}

.devise-panel .field input[type="email"],
.devise-panel .field input[type="password"],
.devise-panel .field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 1rem;
  color: var(--ey-text);
  box-sizing: border-box;
}

.devise-panel .field input::placeholder {
  color: var(--ey-muted);
}

.devise-panel .field input:focus {
  outline: none;
  border-color: #67BF53;
  box-shadow: 0 0 0 2px rgba(103, 191, 83, 0.2);
}

.devise-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9375rem;
  color: var(--ey-text);
  margin: 0;
}

.devise-checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #67BF53;
  margin: 0;
  flex-shrink: 0;
}

.devise-panel .actions {
  margin-top: 24px;
}

.devise-panel .actions input[type="submit"] {
  display: inline-block;
  width: 100%;
  padding: 0.625rem 1.25rem;
  background: #67BF53;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.devise-panel .actions input[type="submit"]:hover {
  filter: brightness(1.06);
}

.devise-panel .field + .field {
  margin-top: 4px;
}

.devise-panel a {
  color: var(--ey-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.devise-panel a:hover {
  color: #2f7a24;
  border-bottom-color: #2f7a24;
}

.devise-panel > p {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--ey-muted);
}

.devise-panel button[type="submit"] {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--ey-surface);
  color: var(--ey-text);
  border: 1px solid var(--ey-border);
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
}

.devise-panel button[type="submit"]:hover {
  border-color: #67BF53;
  color: #2f7a24;
}

.devise-panel #error_explanation {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 8px;
  color: #991b1b;
  font-size: 0.875rem;
}

.devise-panel #error_explanation h2 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #991b1b;
}

.devise-panel #error_explanation ul {
  margin: 0;
  padding-left: 1.25rem;
}

/* Center flash messages on devise pages (same colors as global .notice / .alert) */
.devise-layout .notice,
.devise-layout .alert {
  max-width: 464px;
  margin-left: auto;
  margin-right: auto;
}

/* Datasets */
.dataset-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.dataset-list li {
  padding: 0.875rem 1rem;
  border: 1px solid var(--ey-border);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem 1rem;
  background: var(--ey-surface);
}

.dataset-list li form {
  margin: 0;
  display: inline;
}

.dataset-list a {
  font-weight: 500;
  color: var(--ey-text);
  border-bottom: none;
}

.dataset-list a:hover {
  color: var(--ey-yellow);
}

.status {
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.status-ready {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.status-pending {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
}

.status-processing {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.status-error {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

.btn-primary {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  color: var(--ey-on-accent);
  border-radius: 6px;
  text-decoration: none;
  margin: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
  filter: brightness(1.05);
  color: var(--ey-on-accent);
}

.btn-danger {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(220, 38, 38, 0.85);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-danger:hover {
  background: #b91c1c;
  color: white;
}

.btn-danger--compact {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
}

.dataset-show-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dataset-show-delete {
  margin-top: 0.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ey-border);
}

.dataset-show-delete form {
  margin: 0;
}

.dataset-show-header-actions form {
  margin: 0;
  display: inline;
}

.dataset-nav {
  display: flex;
  gap: 0.75rem;
  margin: 0 0 0.75rem 0;
  flex-wrap: wrap;
}

.chat-rules-intro {
  margin: 0 0 1.25rem;
  line-height: 1.5;
  color: var(--ey-text);
}

.admin-dashboard .report-chat-rules-panel--standalone {
  border: 1px solid var(--ey-border);
  border-radius: 10px;
  padding: 1rem 1.25rem 1.25rem;
  margin: 0;
}

.admin-dashboard .report-chat-rules-panel__legend {
  padding: 0 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ey-text);
}

.admin-dashboard .report-chat-rules-panel--standalone .report-chat-rules-panel__body {
  margin-top: 0.75rem;
}

.admin-dashboard .report-chat-rules-panel--standalone .report-chat-rules-panel__row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.admin-dashboard .report-chat-rules-panel--standalone .report-chat-rules-panel__desc {
  display: block;
  margin-top: 0.2rem;
}

.chat-rules-button-only-hint {
  margin-top: 1rem;
}

.chat-rules-button-only-hint ul {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
}

.chat-rules-actions {
  margin: 1.25rem 0 0;
}

.chat-rules-test-config {
  padding: 1rem 1.25rem 1.25rem;
  margin-top: 1rem;
  border: 1px solid var(--ey-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.chat-rules-test-config h3 {
  margin: 0 0 0.75rem 0;
}

.chat-rules-test-config .chat-rules-intro {
  margin-bottom: 0.9rem;
}

.test-rule-entries {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.test-rule-entry {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--ey-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.test-rule-entry__fields {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.6rem 0.8rem;
  width: 100%;
  overflow-x: auto;
}

.test-rule-entry__fields label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  min-width: auto;
  color: var(--ey-muted);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.test-rule-entry__label {
  display: inline-block;
  min-width: 62px;
}

.test-rule-entry__select,
.test-rule-entry__type,
.test-rule-entry__threshold {
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--ey-border);
  background: rgba(0, 0, 0, 0.24);
  color: var(--ey-text);
  padding: 0 0.65rem;
  font-size: 0.9rem;
  width: 200px;
}

.test-rule-entry__type {
  width: 170px;
}

.test-rule-entry__threshold {
  width: 90px;
}

.test-rule-entry__select:focus,
.test-rule-entry__type:focus,
.test-rule-entry__threshold:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.test-rule-entry__threshold-fields {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.test-rule-entry__threshold-fields[hidden] {
  display: none !important;
}

.test-rule-entry__add-wrap {
  margin-top: 0.65rem;
}

.dataset-upload-form {
  margin: 0;
}

.dataset-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0;
}

.dataset-upload-row input[type="file"] {
  max-width: min(100%, 28rem);
  color: var(--ey-muted);
}

.dataset-upload-row label {
  color: var(--ey-muted);
  font-size: 0.9375rem;
}

.dataset-upload-row--profile {
  width: 100%;
  align-items: stretch;
}

.dataset-upload-profile-panel {
  /* width: min(100%, 42rem);
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--ey-border);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); */
  padding-bottom: 20px;
}

.dataset-upload-profile-panel__label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ey-text);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.dataset-data-profile-select {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.5rem 2.2rem 0.5rem 0.75rem;
  color: var(--ey-text);
  font-size: 0.9375rem;
  line-height: 1.35;
  background-color: rgba(0, 0, 0, 0.3);
  background-image: linear-gradient(45deg, transparent 50%, var(--ey-muted) 50%), linear-gradient(135deg, var(--ey-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 1px), calc(100% - 9px) calc(50% - 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border: 1px solid var(--ey-border);
  border-radius: 7px;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.dataset-data-profile-select:hover {
  border-color: rgba(255, 255, 255, 0.26);
}

.dataset-data-profile-select:focus {
  outline: none;
  border-color: var(--ey-yellow);
  box-shadow: 0 0 0 2px rgba(255, 230, 140, 0.25);
  background-color: rgba(0, 0, 0, 0.42);
}

.dataset-upload-profile-panel__hint {
  margin: 0.55rem 0 0;
  color: var(--ey-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .dataset-upload-profile-panel {
    width: 100%;
    padding: 0.85rem;
  }
}

.dataset-upload-form--importing {
  pointer-events: none;
}

.dataset-upload-form--importing .dataset-upload-row {
  opacity: 0.55;
}

.dataset-import-progress {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ey-border);
}

.dataset-import-progress__label {
  margin: 0 0 0.35rem 0;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ey-text);
}

.dataset-import-progress__hint {
  margin: 0 0 0.85rem 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ey-muted);
}

.dataset-import-progress__track {
  overflow: hidden;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.dataset-import-progress__fill {
  height: 100%;
  width: 35%;
  border-radius: 4px;
  background: var(--ey-yellow);
  animation: dataset-import-indeterminate 1.15s ease-in-out infinite;
}

@keyframes dataset-import-indeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(400%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dataset-import-progress__fill {
    animation: none;
    width: 100%;
    opacity: 0.85;
  }
}

.dataset-create-form {
  margin: 0;
}

.dataset-create-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.dataset-name-input {
  flex: 1;
  min-width: 12rem;
  padding: 0.625rem 0.875rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--ey-border);
  border-radius: 6px;
  color: var(--ey-text);
  font-size: 1rem;
  box-sizing: border-box;
}

.dataset-name-input::placeholder {
  color: var(--ey-muted);
}

.btn-nav {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--ey-yellow);
  border: 1px solid var(--ey-yellow);
  border-radius: 6px;
  background-color: var(--ey-bg);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-nav:hover {
  background: var(--ey-yellow);
  color: var(--ey-bg);
  border-bottom: none;
}

.btn-regenerate {
  display: inline-block;
  padding: 0.5rem 0.875rem;
  background: rgba(5, 150, 105, 0.35);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}

.btn-regenerate:hover {
  background: rgba(5, 150, 105, 0.5);
  color: #ecfdf5;
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.report-actions a {
  margin: 0;
}

.report-actions form {
  margin: 0;
  display: inline;
}

.report-page > header {
  margin-bottom: 0;
  padding-bottom: 0.75rem;
  border-bottom: none;
}

.report-subheader {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ey-border);
}

.report-subheader .report-actions {
  justify-content: flex-end;
}

.report-subheader--split {
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.report-edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

body.report-request-overlay-open {
  overflow: hidden;
}

.report-request-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-request-overlay[hidden] {
  display: none !important;
}

.report-request-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(2px);
}

.report-request-overlay__dialog {
  position: relative;
  width: min(32rem, calc(100% - 2rem));
  background: #0f172a;
  border: 1px solid var(--ey-border);
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  padding: 1.5rem 1.25rem;
  text-align: center;
  z-index: 1;
}

.report-request-overlay__title {
  margin: 0;
  font-size: 1.4rem;
  color: var(--ey-yellow);
}

.report-request-overlay__message {
  margin: 0.75rem 0 1.25rem;
  color: var(--ey-text);
  line-height: 1.5;
}

.report-request-overlay__close {
  cursor: pointer;
}

.report-edit-unavailable {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ey-muted);
  max-width: 22rem;
  text-align: right;
}

.chat-report-edit-banner {
  margin: 0 0 1rem 0;
  padding: 0.75rem 1rem;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--ey-text);
}

.chat-report-edit-banner code {
  font-size: 0.85em;
  padding: 0.1rem 0.35rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

/* Report — chat as right sidebar */
.report-page--has-report-chat.admin-dashboard {
  max-width: min(90rem, 100%);
}

.report-page__with-chat {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1.5rem;
  min-width: 0;
  width: 100%;
}

.report-page__with-chat > main {
  flex: 1 1 auto;
  min-width: 0;
}

.report-chat-sidebar {
  flex: 0 0 clamp(280px, 26vw, 400px);
  width: clamp(280px, 26vw, 400px);
  max-width: 100%;
  min-height: min(70vh, 640px);
  max-height: calc(100vh - 8rem);
  position: sticky;
  top: 1rem;
  align-self: flex-start;
  z-index: 30;
  box-sizing: border-box;
}

.report-chat-sidebar__inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  max-height: inherit;
  min-height: 0;
  padding: 1rem 1.125rem;
  background: var(--ey-bg);
  border: 1px solid var(--ey-border);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
}

/* Form wraps chat head (incl. rule toggles) + body so checkboxes submit with the message */
.report-chat-sidebar__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

/* PVNBP one-shot: hidden sibling form + button[form=...] inside Funzioni personalizzate */
.report-chat-pvnbp-apply-form--hidden {
  display: none;
}

.report-chat-rules-panel .report-chat-pvnbp-apply-wrap {
  /* margin-top: 0.75rem; */
  padding-top: 0.75rem;
  /* border-top: 1px solid var(--ey-border); */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.report-chat-pvnbp-apply-hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ey-muted, #6b7280);
}

.report-chat-pvnbp-apply-wrap .report-chat-pvnbp-apply {
  width: 100%;
}

.report-chat-sidebar__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0.75rem;
}

.report-chat-sidebar--collapsed {
  flex: 0 0 3.25rem;
  width: 3.25rem;
  min-width: 3.25rem;
  min-height: 0;
  max-height: none;
}

.report-chat-sidebar--collapsed .report-chat-sidebar__inner {
  padding: 0.5rem;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
}

.report-chat-sidebar--collapsed .report-chat-sidebar__body {
  display: none;
}

.report-chat-sidebar--collapsed .report-chat-sidebar__hint {
  display: none;
}

.report-chat-sidebar--collapsed .report-chat-sidebar__head {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.report-chat-sidebar--collapsed .report-chat-sidebar__head-main {
  align-items: center;
}

.report-chat-sidebar--collapsed .report-chat-sidebar__title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.75rem;
  margin: 0;
  letter-spacing: 0.05em;
}

.report-chat-sidebar__head {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.report-chat-sidebar__head-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
}

/* Rules panel — collapsible <details>, closed by default; checkboxes in form */
.report-chat-sidebar .report-chat-rules-panel {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(254, 202, 202, 0.35);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: 0.8125rem;
  overflow: hidden;
}

.report-chat-sidebar .report-chat-rules-panel__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid transparent;
}

.report-chat-sidebar .report-chat-rules-panel[open] > .report-chat-rules-panel__summary {
  border-bottom-color: rgba(254, 202, 202, 0.2);
}

.report-chat-sidebar .report-chat-rules-panel__summary::-webkit-details-marker {
  display: none;
}

.report-chat-sidebar .report-chat-rules-panel__summary-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  text-align: left;
}

.report-chat-sidebar .report-chat-rules-panel__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ey-yellow);
}

.report-chat-sidebar .report-chat-rules-panel__summary-cue {
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--ey-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.report-chat-sidebar .report-chat-rules-panel__summary-icon {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid rgba(254, 202, 202, 0.75);
  border-bottom: 2px solid rgba(254, 202, 202, 0.75);
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-top: 0.15rem;
  transition: transform 0.15s ease;
}

.report-chat-sidebar .report-chat-rules-panel[open] > .report-chat-rules-panel__summary .report-chat-rules-panel__summary-icon {
  transform: rotate(225deg);
}

.report-chat-sidebar .report-chat-rules-panel__content {
  padding: 0;
  border-top: 1px solid rgba(254, 202, 202, 0.15);
}

.report-chat-sidebar .report-chat-rules-panel__head-hint {
  margin: 0;
  padding: 0.45rem 0.65rem 0.35rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--ey-muted);
}

.report-chat-sidebar .report-chat-rules-panel__body {
  padding: 0.35rem 0.65rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.report-chat-sidebar .report-chat-rules-panel__row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  cursor: pointer;
  color: var(--ey-text);
}

.report-chat-sidebar .report-chat-rules-panel__row input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.report-chat-sidebar .report-chat-rules-panel__row-text {
  display: block;
  min-width: 0;
}

.report-chat-sidebar .report-chat-rules-panel__label {
  font-weight: 600;
  font-size: 0.78rem;
  display: block;
}

.report-chat-sidebar .report-chat-rules-panel__desc {
  display: block;
  opacity: 0.88;
  font-size: 0.68rem;
  margin-top: 0.12rem;
  line-height: 1.35;
  color: var(--ey-muted);
}

.report-chat-sidebar .report-chat-rules-panel__empty {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--ey-muted);
}

.report-chat-sidebar .report-chat-rules-panel__empty code {
  font-size: 0.65rem;
  word-break: break-all;
}

.chat-page .report-chat-rules-panel {
  margin-bottom: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  font-size: 0.875rem;
  overflow: hidden;
}

.chat-page .report-chat-rules-panel__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
  background: #f9fafb;
  border-bottom: 1px solid transparent;
}

.chat-page .report-chat-rules-panel[open] > .report-chat-rules-panel__summary {
  border-bottom-color: #e5e7eb;
}

.chat-page .report-chat-rules-panel__summary::-webkit-details-marker {
  display: none;
}

.chat-page .report-chat-rules-panel__summary-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  text-align: left;
}

.chat-page .report-chat-rules-panel__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #374151;
}

.chat-page .report-chat-rules-panel__summary-cue {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.chat-page .report-chat-rules-panel__summary-icon {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #9ca3af;
  border-bottom: 2px solid #9ca3af;
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-top: 0.15rem;
  transition: transform 0.15s ease;
}

.chat-page .report-chat-rules-panel[open] > .report-chat-rules-panel__summary .report-chat-rules-panel__summary-icon {
  transform: rotate(225deg);
}

.chat-page .report-chat-rules-panel__content {
  border-top: 1px solid #e5e7eb;
}

.chat-page .report-chat-rules-panel__head-hint {
  margin: 0;
  padding: 0.45rem 0.75rem 0.35rem;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.4;
}

.chat-page .report-chat-rules-panel__body {
  padding: 0.35rem 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.chat-page .report-chat-rules-panel__row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  cursor: pointer;
}

.chat-page .report-chat-rules-panel__desc {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.12rem;
  line-height: 1.35;
}

.chat-page .report-chat-rules-panel__empty {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.4;
}

.chat-page .report-chat-rules-panel__empty code {
  font-size: 0.7rem;
}

.report-chat-toggle {
  flex-shrink: 0;
}

.report-chat-sidebar__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ey-yellow);
}

.report-chat-sidebar__title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.report-chat-sidebar__title-action {
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 1.1;
}

.report-chat-sidebar__hint {
  font-size: 0.8125rem;
  color: var(--ey-muted);
  line-height: 1.35;
}

.report-chat-sidebar .chat-form {
  flex-shrink: 0;
}

.report-chat-selection-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--ey-border-subtle, rgba(0, 0, 0, 0.08));
  font-size: 0.8125rem;
  color: var(--ey-muted);
}

.report-chat-selection-footer__count {
  flex: 1 1 auto;
  min-width: 0;
}

.report-chat-selection-footer__clear {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--ey-accent, #1a5f7a);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.report-chat-selection-footer__clear:hover:not(:disabled) {
  color: var(--ey-text, #111);
}

.report-chat-selection-footer__clear:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: none;
}

.report-chat-sidebar .chat-messages {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: min(50vh, 360px);
  overflow-y: auto;
  margin-bottom: 0;
}

.report-chat-sidebar .chat-report-edit-banner {
  margin-bottom: 0;
}

@media (max-width: 960px) {
  .report-page__with-chat {
    flex-direction: column;
  }

  .report-chat-sidebar {
    position: relative;
    top: 0;
    flex: 1 1 auto;
    width: 100%;
    max-height: none;
    min-height: 320px;
  }

  .report-chat-sidebar--collapsed {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }

  .report-chat-sidebar--collapsed .report-chat-sidebar__title {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .report-chat-sidebar--collapsed .report-chat-sidebar__head {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
}

/* Chat */
.chat-page .chat-messages {
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  padding: 1rem 1.125rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--ey-border);
  border-radius: 10px;
}

.chat-placeholder {
  color: var(--ey-muted);
  font-style: italic;
  margin: 0;
}

.chat-message {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 8px;
}

.chat-message-user {
  background: rgba(255, 230, 0, 0.12);
  border: 1px solid rgba(255, 230, 0, 0.25);
  margin-left: 1.5rem;
  color: var(--ey-text);
}

.chat-message-assistant {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ey-border);
  margin-right: 1.5rem;
  color: var(--ey-text);
}

.assistant-content {
  margin-top: 8px;
}

.report-chat-sidebar .assistant-content--md .report-md-root {
  overflow-x: auto;
  max-width: 100%;
}

.report-chat-sidebar .assistant-content--md strong {
  color: #fecaca;
  font-weight: 700;
}

.report-chat-sidebar .assistant-content--md .report-table-wrap--integrated {
  border-top: 2px solid rgba(254, 202, 202, 0.45);
  border-bottom: 1px solid var(--ey-border);
  margin: 0.5rem 0 0.75rem;
}

.report-chat-sidebar .assistant-content--md .report-table--from-markdown {
  font-size: 0.8125rem;
}

.report-chat-sidebar .assistant-content--md .report-table--from-markdown thead th {
  border-bottom-color: rgba(254, 202, 202, 0.55);
  color: #fecaca;
}

.report-chat-sidebar .assistant-content--md .report-table--from-markdown tbody td {
  color: var(--ey-text);
}

.report-chat-sidebar .assistant-content--md .report-md-heading {
  color: #fecaca;
}

.report-chat-sidebar .assistant-content--md .report-alert-toast {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.8125rem;
  border-color: rgba(254, 202, 202, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  color: var(--ey-text);
}

.report-chat-sidebar .assistant-content--md .report-alert-toast--info {
  border-left-color: #60a5fa;
  background: rgba(30, 58, 138, 0.35);
}

.report-chat-sidebar .assistant-content--md .report-alert-toast--success {
  border-left-color: #34d399;
  background: rgba(6, 78, 59, 0.35);
}

.report-chat-sidebar .assistant-content--md .report-alert-toast--warning {
  border-left-color: #fbbf24;
  background: rgba(120, 53, 15, 0.35);
}

.report-chat-sidebar .assistant-content--md .report-alert-toast--danger {
  border-left-color: #f87171;
  background: rgba(127, 29, 29, 0.4);
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chat-input {
  flex: 1;
  min-width: 12rem;
  padding: 0.625rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--ey-border);
  border-radius: 6px;
  color: var(--ey-text);
  font-size: 1rem;
}

.btn-send {
  padding: 0.625rem 1.25rem;
  background: var(--ey-yellow);
  color: var(--ey-on-accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.btn-send:hover {
  filter: brightness(1.05);
}

@keyframes chat-form-send-spin {
  to {
    transform: rotate(360deg);
  }
}

.chat-form.chat-form--loading {
  position: relative;
}

.chat-form.chat-form--loading .btn-send {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  min-width: 5.5rem;
}

/* Spinner on <button> only — ::after does not render on <input type="submit"> */
.chat-form.chat-form--loading .btn-send::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.125rem;
  height: 1.125rem;
  margin: -0.5625rem 0 0 -0.5625rem;
  box-sizing: border-box;
  border: 2px solid rgba(0, 0, 0, 0.35);
  border-top-color: #000000;
  border-radius: 50%;
  animation: chat-form-send-spin 0.65s linear infinite;
}

.report-chat-sidebar:has(.chat-form--loading) #report-chat-messages {
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.chat-page:has(.chat-form--loading) .chat-messages {
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

/* Report — light “paper” body inside dark shell (classic blue / gray accents) */
.report-page article.report {
  background: #ffffff;
  color: #111827;
  padding: 1.5rem 1.75rem 2rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.08);
}

.report-page article.report.report-pert {
  border: 1px solid rgba(0, 0, 98, 0.22);
  box-shadow: 0 2px 8px rgba(0, 0, 98, 0.08);
}

.report-page article.report a {
  color: #b91c1c;
  border-bottom: none;
}

.report-page article.report a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.report-page article.report h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e3a8a;
  letter-spacing: normal;
}

/* Integrated report theme (full page) */
.report-page article.report.report-integrated h2.report-section-title {
  color: #7f1d1d;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-left: 0;
}

.report-page article.report.report-integrated h2.report-cover-title {
  font-size: 1.65rem;
  color: #7f1d1d;
  padding-left: 0;
}

.report-page article.report.report-integrated .report-section-subheading {
  margin: 1.25rem 0 0.75rem 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #7f1d1d;
  letter-spacing: normal;
  padding-left: 0;
}

.report-page article.report.report-integrated .chart-container {
  margin: 0.75rem 0 1.25rem;
}

.report-page article.report h2:first-child {
  margin-top: 0;
}

.report-page article.report .report-cover-title {
  font-size: 1.65rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.report-page article.report .report-section {
  scroll-margin-top: 1rem;
}

.report-page article.report .report-toc {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f8fafc;
}

.report-page article.report .report-toc__title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 700;
  color: #1e3a8a;
}

.report-page article.report .report-toc__list {
  margin: 0;
  padding-left: 1.1rem;
  columns: 2;
  column-gap: 1.5rem;
}

.report-page article.report .report-toc__item {
  margin: 0.2rem 0;
  break-inside: avoid;
}

.report-page article.report a.report-toc__link {
  color: #1d4ed8;
  text-decoration: none;
}

.report-page article.report a.report-toc__link:hover {
  color: #1e3a8a;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .report-page article.report .report-toc__list {
    columns: 1;
  }
}

.report-page article.report .report-section-subtitle {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.report-page article.report.report-integrated .report-section-subtitle,
.report-page article.report.report-integrated .report-section-integrated__subtitle {
  color: #7f1d1d;
  font-weight: 700;
}

.report-page article.report > .report-section:first-child h2 {
  margin-top: 0;
}

/* "Suggested by AI" — inside :::alert or before AI-edited prose (see AnnualReportMarkdownRenderer) */
.report-ai-suggested-badge--inline {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1e3a8a;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #93c5fd;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  line-height: 1.2;
}

.report-alert-toast__ai-badge {
  margin: 0 0 0.5rem 0;
}

.report-ai-meta-line {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #1f2937;
}

.report-ai-meta-line--context {
  color: #334155;
}

.report-ai-meta-line--credibility {
  font-weight: 600;
  color: #0f172a;
}

.report-page .report-alert-toast .report-alert-toast__ai-badge + * {
  margin-top: 0;
}

.report-ai-suggested-stamp {
  margin: 0 0 0.65rem 0;
}

.report-section__toolbar {
  display: none;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.report-edit-active .report-section__toolbar {
  display: flex;
}

.report-section__hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin-right: auto;
}

.report-section__restore {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #9ca3af;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
}

.report-section__restore:hover {
  background: #f3f4f6;
}

.report-section__output-btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #b91c1c;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  font-weight: 600;
}

.report-section__output-btn:hover {
  background: #dbeafe;
}

.report-edit-active .report-section--context {
  outline: 3px solid #dc2626;
  outline-offset: 2px;
  border-radius: 8px;
}

.report-edit-active .report-section--output {
  outline: 3px solid #b91c1c;
  outline-offset: 2px;
  border-radius: 8px;
}

.report-page article.report:not(.report-integrated) h3 {
  margin: 1.5rem 0 0.75rem 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #1d4ed8;
  letter-spacing: normal;
}

.report-page article.report p {
  color: #374151;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9375rem;
}

.report-table th,
.report-table td {
  padding: 0.625rem 0.875rem;
  text-align: left;
  border: 1px solid #e5e7eb;
}

.report-table th {
  background: #f3f4f6;
  font-weight: 600;
  color: #1e3a8a;
}

.report-table td {
  color: #111827;
}

.report-meta {
  margin-top: 2rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.report-narrative {
  margin: 0.75rem 0 1.5rem 0!important;
  padding: 1rem 1.125rem;
  background: #f8fafc;
  border-radius: 0 6px 6px 0;
  color: #374151;
}

.report-page article.report.report-integrated .report-narrative:not(.report-narrative--integrated) {
  border-left-color: #7f1d1d;
  background: #fafafa;
}

/* Narrative blocks aligned with section titles / tables (flush left, no border-left indent) */
.report-page article.report.report-integrated .report-narrative.report-narrative--integrated {
  padding: 0.75rem 0 0 0;
  margin: 0.75rem 0 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

/* PERT report — brand accent #000062 (navy) */
.report-page article.report.report-pert .report-narrative:not(.report-narrative--integrated) {
  border-left-color: #000062;
  background: #f8fafc;
}

.report-page article.report.report-pert .report-narrative.report-narrative--integrated {
  padding: 0;
  margin: 0.5rem 0 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.report-page article.report.report-pert .report-md-root .report-narrative.report-narrative--integrated:first-of-type {
  margin-top: 0;
}

.report-page article.report.report-pert .report-md-root .report-narrative.report-narrative--integrated + .report-narrative.report-narrative--integrated {
  margin-top: 0.35rem;
}

.report-page article.report.report-pert .report-md-root strong,
.report-page article.report.report-pert .report-narrative--integrated strong {
  color: #000062;
  font-weight: 700;
}

/* First section (cover): single visual block */
.report-page article.report.report-pert .report-pert-cover-card {
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 98, 0.04);
  border: 1px solid rgba(0, 0, 98, 0.18);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 98, 0.06);
}

.report-page article.report.report-pert .report-pert-cover-card .report-md-root > .report-md-heading:first-child {
  margin-top: 0;
}

.report-page article.report.report-pert .report-pert-glossary-note {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0 0 0.75rem 0;
}

/* PERT — section headings (h2 glossario + markdown h1–h6 classes shared with integrated layout) */
.report-page article.report.report-pert h2.report-section-title {
  color: #000062;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-left: 0;
  border-bottom: 2px solid rgba(0, 0, 98, 0.35);
  padding-bottom: 0.35rem;
}

.report-page article.report.report-pert .report-section-integrated__title {
  color: #000062;
}

.report-page article.report.report-pert .report-section-integrated__subtitle {
  color: #000062;
}

.report-page article.report.report-pert .report-section-integrated__unit {
  color: #000062;
}

.report-page article.report.report-pert .report-md-root .report-md-heading--2 {
  color: #000062;
}

.report-page article.report.report-pert .report-md-root .report-md-heading--3 {
  color: #000062;
}

/* PERT — pipe markdown tables */
.report-page article.report.report-pert .report-table-wrap--integrated {
  border-top: 2px solid #000062;
  border-bottom: 1px solid #cbd5e1;
}

.report-page article.report.report-pert .report-table--integrated thead th {
  border-bottom: 2px solid #000062;
}

.report-page article.report.report-pert .report-md-root .report-table-wrap--integrated {
  margin: 0.75rem 0 1.25rem;
}

.report-page article.report.report-pert .report-table-wrap--integrated .report-table--from-markdown {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
  margin: 0;
  border-style: hidden;
}

.report-page article.report.report-pert .report-table--from-markdown thead th,
.report-page article.report.report-pert .report-table--from-markdown tbody td {
  border: none;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  color: #374151;
}

.report-page article.report.report-pert .report-table--from-markdown thead th:first-child,
.report-page article.report.report-pert .report-table--from-markdown tbody td:first-child {
  padding-left: 0;
}

.report-page article.report.report-pert .report-table--from-markdown thead th {
  border-bottom: 2px solid #000062;
  background: transparent;
  font-weight: 700;
}

.report-page article.report.report-pert .report-table--from-markdown tbody tr:nth-child(even) td {
  background: rgba(0, 0, 98, 0.03);
}

.report-page article.report.report-pert .report-table--from-markdown td strong,
.report-page article.report.report-pert .report-table--from-markdown th strong {
  color: #000062;
  font-weight: 700;
}

.report-page article.report.report-pert .report-md-list__item::marker {
  color: #000062;
}

/* PERT — edit mode selection outlines */
.report-page article.report.report-pert.report-edit-active .report-section--context {
  outline: 3px solid rgba(0, 0, 98, 0.45);
  outline-offset: 2px;
  border-radius: 8px;
}

.report-page article.report.report-pert.report-edit-active .report-section--output {
  outline: 3px solid #000062;
  outline-offset: 2px;
  border-radius: 8px;
}

.report-page article.report.report-pert .report-section__output-btn {
  border-color: #000062;
  color: #000062;
  background: rgba(0, 0, 98, 0.06);
}

.report-page article.report.report-pert .report-section__output-btn:hover {
  background: rgba(0, 0, 98, 0.11);
}

/* PERT — markdown alert callouts: info stripe */
.report-page article.report.report-pert .report-md-root .report-alert-toast--info {
  border-left-color: #000062;
  background: linear-gradient(135deg, rgba(0, 0, 98, 0.06) 0%, #ffffff 55%);
}

/* PERT report page chrome (header on dark shell: lighter tint for contrast) */
.report-page.report-page--pert > header h1 {
  color: #b8b8dc;
}

.report-page.report-page--pert .report-subheader {
  border-bottom-color: rgba(0, 0, 98, 0.35);
}

.report-page.report-page--pert .btn-regenerate {
  background: rgba(0, 0, 98, 0.35);
  color: #e8e8f4;
  border: 1px solid rgba(0, 0, 98, 0.55);
}

.report-page.report-page--pert .btn-regenerate:hover {
  background: rgba(0, 0, 98, 0.5);
  color: #ffffff;
  border-color: rgba(0, 0, 98, 0.7);
}

.report-page article.report.report-pert a {
  color: #000062;
}

.report-page article.report.report-pert a:hover {
  color: #00004a;
  text-decoration-color: rgba(0, 0, 98, 0.5);
}

/* PERT section 5.1 — stress horizontal bar chart (table 15) */
.report-page article.report.report-pert .pert-stress-chart {
  margin-top: 1.75rem;
  padding: 1rem 0 0.5rem;
  border-top: 1px solid rgba(0, 0, 98, 0.2);
}

.report-page article.report.report-pert .pert-stress-chart__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #000062;
  letter-spacing: 0.02em;
}

.report-page article.report.report-pert .pert-stress-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: rgba(0, 0, 40, 0.85);
}

.report-page article.report.report-pert .pert-stress-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.report-page article.report.report-pert .pert-stress-chart__legend-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.report-page article.report.report-pert .pert-stress-chart__legend-item--tvog .pert-stress-chart__legend-swatch {
  background: rgba(0, 0, 98, 0.42);
  border: 1px solid rgba(0, 0, 98, 0.35);
}

.report-page article.report.report-pert .pert-stress-chart__legend-item--bel .pert-stress-chart__legend-swatch {
  background: #000062;
  border: 1px solid #00004a;
}

.report-page article.report.report-pert .pert-stress-chart__axis {
  position: relative;
  height: 1.25rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(0, 0, 40, 0.2);
}

.report-page article.report.report-pert .pert-stress-chart__tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 0.68rem;
  color: rgba(0, 0, 40, 0.65);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.report-page article.report.report-pert .pert-stress-chart__category {
  display: grid;
  grid-template-columns: minmax(7.5rem, 10rem) 1fr;
  gap: 0.35rem 0.75rem;
  align-items: start;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(0, 0, 98, 0.08);
}

.report-page article.report.report-pert .pert-stress-chart__category:last-of-type {
  border-bottom: none;
}

.report-page article.report.report-pert .pert-stress-chart__cat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #101030;
  line-height: 1.35;
  padding-top: 0.15rem;
}

.report-page article.report.report-pert .pert-stress-chart__cat-bars {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.report-page article.report.report-pert .pert-stress-chart__series-row {
  display: grid;
  grid-template-columns: 1fr minmax(3.25rem, 4rem);
  gap: 0.5rem;
  align-items: center;
}

.report-page article.report.report-pert .pert-stress-chart__track {
  position: relative;
  height: 11px;
  min-width: 0;
}

.report-page article.report.report-pert .pert-stress-chart__track-bg {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 98, 0.06) 0%,
    rgba(0, 0, 98, 0.04) 50%,
    rgba(0, 0, 98, 0.06) 100%
  );
  border: 1px solid rgba(0, 0, 98, 0.12);
}

.report-page article.report.report-pert .pert-stress-chart__zero {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  margin-left: -0.5px;
  background: rgba(0, 0, 40, 0.45);
  z-index: 1;
  pointer-events: none;
}

.report-page article.report.report-pert .pert-stress-chart__bar {
  position: absolute;
  top: 1px;
  bottom: 1px;
  border-radius: 2px;
  z-index: 2;
  min-width: 2px;
  box-sizing: border-box;
}

.report-page article.report.report-pert .pert-stress-chart__bar--tvog {
  background: rgba(0, 0, 98, 0.48);
}

.report-page article.report.report-pert .pert-stress-chart__bar--bel {
  background: #000062;
}

.report-page article.report.report-pert .pert-stress-chart__bar--negative.pert-stress-chart__bar--tvog {
  background: rgba(0, 0, 98, 0.55);
}

.report-page article.report.report-pert .pert-stress-chart__value {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: rgba(0, 0, 40, 0.85);
}

/* PERT section 6.1.1A — standalone claims chart (reference style) */
.report-page article.report.report-pert .pert-claims-chart {
  margin: 1rem 0 0.5rem 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.9rem 0.9rem 0.75rem 0.9rem;
  background: #f9fafb;
}

.report-page article.report.report-pert .pert-claims-chart__title {
  margin: 0 0 0.65rem 0;
  text-align: center;
  font-size: 1.02rem;
  font-weight: 700;
  color: #111827;
}

.report-page article.report.report-pert .pert-claims-chart__plot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 230px;
  padding: 0 0.25rem;
}

.report-page article.report.report-pert .pert-claims-chart__group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.report-page article.report.report-pert .pert-claims-chart__delta {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
}

.report-page article.report.report-pert .pert-claims-chart__delta--neg {
  color: #dc2626;
}

.report-page article.report.report-pert .pert-claims-chart__delta--pos {
  color: #059669;
}

.report-page article.report.report-pert .pert-claims-chart__bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.22rem;
  width: 100%;
  max-width: 64px;
  height: 170px;
}

.report-page article.report.report-pert .pert-claims-chart__bar {
  position: relative;
  flex: 1;
  min-width: 20px;
  border-radius: 4px 4px 0 0;
  box-shadow: inset -4px 0 0 rgba(0, 0, 0, 0.12);
}

.report-page article.report.report-pert .pert-claims-chart__bar--actual {
  background: linear-gradient(180deg, #1d4ed8 0%, #2563eb 100%);
}

.report-page article.report.report-pert .pert-claims-chart__bar--expected {
  background: linear-gradient(180deg, #9ca3af 0%, #d1d5db 100%);
}

.report-page article.report.report-pert .pert-claims-chart__value {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.report-page article.report.report-pert .pert-claims-chart__year {
  font-size: 0.81rem;
  font-weight: 600;
  color: #111827;
}

.report-page article.report.report-pert .pert-claims-chart__legend {
  margin-top: 0.6rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.report-page article.report.report-pert .pert-claims-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.02em;
}

.report-page article.report.report-pert .pert-claims-chart__swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.report-page article.report.report-pert .pert-claims-chart__swatch--actual {
  background: #2563eb;
}

.report-page article.report.report-pert .pert-claims-chart__swatch--expected {
  background: #d1d5db;
  border: 1px solid #9ca3af;
}

@media (max-width: 640px) {
  .report-page article.report.report-pert .pert-stress-chart__category {
    grid-template-columns: 1fr;
  }

  .report-page article.report.report-pert .pert-stress-chart__cat-label {
    padding-bottom: 0.15rem;
  }
}

.report-page.report-page--pert .report-chat-sidebar .assistant-content--md strong {
  color: #b8b8dc;
}

.report-page.report-page--pert .report-chat-sidebar .assistant-content--md .report-md-heading {
  color: #b8b8dc;
}

.report-page.report-page--pert .report-chat-sidebar .assistant-content--md .report-table-wrap--integrated {
  border-top-color: rgba(0, 0, 98, 0.4);
}

.report-page.report-page--pert .report-chat-sidebar .assistant-content--md .report-table--from-markdown thead th {
  border-bottom-color: rgba(0, 0, 98, 0.45);
  color: #d4d4ea;
}

.report-page.report-page--pert .chat-report-edit-banner {
  background: rgba(0, 0, 98, 0.18);
  border: 1px solid rgba(0, 0, 98, 0.4);
}

.report-narrative p {
  margin: 0 0 8px 0;
}

.report-narrative p:last-child {
  margin-bottom: 0;
}

/* Highlight / toaster callouts — markdown: :::alert info|success|warning|danger ... ::: */
.report-md-root .report-alert-toast {
  margin: 0.75rem 0 1rem;
  padding: 0.875rem 1rem 0.875rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left-width: 4px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #1f2937;
}

.report-md-root .report-alert-toast .report-narrative--integrated {
  margin: 0;
}

.report-md-root .report-alert-toast .report-md-heading {
  margin-top: 0;
}

.report-md-root .report-alert-toast--info {
  border-left-color: #b91c1c;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 55%);
}

.report-md-root .report-alert-toast--success {
  border-left-color: #059669;
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 55%);
}

.report-md-root .report-alert-toast--warning {
  border-left-color: #d97706;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 55%);
}

.report-md-root .report-alert-toast--danger {
  border-left-color: #dc2626;
  background: linear-gradient(135deg, #fef2f2 0%, #ffffff 55%);
}

/* Bar chart (CSS-only) — light context inside report */
.report-page article.report .bar-chart {
  margin: 1rem 0;
}

.report-page article.report .bar-chart-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 12px;
}

.report-page article.report .bar-chart-label {
  min-width: 120px;
  font-size: 0.875rem;
  color: #4b5563;
}

.report-page article.report .bar-chart-bar-wrap {
  flex: 1;
  position: relative;
  height: 26px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.report-page article.report .bar-chart-bar {
  height: 100%;
  background: linear-gradient(90deg, #b91c1c, #3b82f6);
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.3s ease;
}

.report-page article.report .bar-chart-bar--integrated {
  background: linear-gradient(90deg, #7f1d1d, #991b1b);
}

.report-page article.report .bar-chart-bar-negative {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.report-page article.report .bar-chart-bar-negative.bar-chart-bar--integrated {
  background: linear-gradient(90deg, #9f1239, #be123c);
}

.report-page article.report .bar-chart-value {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  z-index: 1;
  text-shadow: none;
}

/* Group’s Performance — vertical KPI bars (integrated report style) */
.group-performance-kpis {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-top: 1rem;
}

.kpi-vchart {
  border: 1px solid #e5e7eb;
  border-radius: 0 10px 10px 10px;
  overflow: hidden;
  background: #fff;
}

.kpi-vchart__head {
  background: linear-gradient(180deg, #b91c1c 0%, #991b1b 100%);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 10px 0 0;
}

.kpi-vchart__head-text {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.kpi-vchart__unit {
  font-weight: 600;
  letter-spacing: normal;
  opacity: 0.95;
}

.kpi-vchart__body {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1rem 1.125rem 1.125rem;
}

.kpi-vchart__plot {
  flex: 0 0 42%;
  max-width: 320px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-end;
  gap: 1.25rem;
  padding-bottom: 0.25rem;
}

.kpi-vchart__plot--dual {
  flex: 0 0 48%;
  max-width: 400px;
  align-items: flex-end;
}

.kpi-vchart__dual-year {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.kpi-vchart__dual-pair {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
}

.kpi-vchart__dual-metric {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.kpi-vchart__bar-stack--dual-slot {
  max-width: 80px;
}

.kpi-vchart__value--secondary {
  color: #6b7280;
  font-size: 0.8125rem;
  font-weight: 600;
}

.kpi-vchart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.kpi-vchart__value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #b91c1c;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.kpi-vchart__value--accent {
  color: #b91c1c;
}

.kpi-vchart__tick {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: #d1d5db;
  margin-bottom: 0.35rem;
}

.kpi-vchart__bar-stack {
  width: 100%;
  height: 148px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid #9ca3af;
}

.kpi-vchart__bar {
  width: 72%;
  min-height: 6px;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.08);
}

.kpi-vchart__bar--current {
  background: linear-gradient(180deg, #7f1d1d 0%, #991b1b 100%);
}

.kpi-vchart__bar--prior {
  background: linear-gradient(180deg, #fecaca 0%, #fca5a5 55%, #fdba74 100%);
}

.kpi-vchart__bar--secondary {
  background: linear-gradient(180deg, #d1d5db 0%, #9ca3af 100%);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.06);
}

.kpi-vchart__axis {
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  color: #6b7280;
  text-align: center;
  line-height: 1.25;
}

.kpi-vchart__narrative {
  flex: 1;
  min-width: 0;
  align-self: flex-start;
  padding-top: 0;
}

.kpi-vchart__narrative p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #374151;
}

@media (max-width: 720px) {
  .kpi-vchart__body {
    flex-direction: column;
  }

  .kpi-vchart__plot {
    flex: 1 1 auto;
    max-width: none;
  }

  .kpi-vchart__plot--dual {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Life segment — stacked direct premiums (two periods, legend) */
.report-stacked-chart {
  margin: 1rem 0 1.25rem;
}

.report-stacked-chart__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #7f1d1d;
  margin: 0 0 0.65rem 0;
  letter-spacing: 0.02em;
}

.report-stacked-chart__unit {
  font-weight: 600;
  margin-left: 0.35rem;
}

.report-stacked-chart__panel {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 1.25rem 1.5rem;
  padding: 1rem 1.125rem 1.125rem;
  border: 1px solid #e5e7eb;
  border-radius: 0 10px 10px 10px;
  background: #fff;
}

.report-stacked-chart__bars {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-end;
  gap: 2rem;
  flex: 1;
  min-width: 0;
}

.report-stacked-chart__col-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.report-stacked-chart__col {
  width: 92px;
  min-height: 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.report-stacked-chart__stack {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  height: 100%;
  width: 100%;
}

.report-stacked-chart__seg {
  position: relative;
  min-height: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.report-stacked-chart__stack > .report-stacked-chart__seg:first-child {
  border-radius: 0 0 8px 8px;
}

.report-stacked-chart__stack > .report-stacked-chart__seg:last-child {
  border-radius: 8px 8px 0 0;
}

.report-stacked-chart__seg--savings {
  background: linear-gradient(180deg, #991b1b 0%, #7f1d1d 100%);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.08);
}

.report-stacked-chart__seg--protection {
  background: linear-gradient(180deg, #4b5563 0%, #374151 100%);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.08);
}

.report-stacked-chart__seg--unit_linked {
  background: linear-gradient(180deg, #fecaca 0%, #fdba74 100%);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.06);
}

.report-stacked-chart__seg-value {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
  padding: 0 2px;
  text-align: center;
  line-height: 1.25;
}

.report-stacked-chart__seg--unit_linked .report-stacked-chart__seg-value {
  color: #1f2937;
  text-shadow: none;
}

.report-stacked-chart__axis {
  font-size: 0.6875rem;
  color: #6b7280;
  text-align: center;
  line-height: 1.25;
}

.report-stacked-chart__legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  max-width: 12rem;
  font-size: 0.8125rem;
  color: #374151;
  line-height: 1.45;
}

.report-stacked-chart__legend li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.report-stacked-chart__legend li:last-child {
  margin-bottom: 0;
}

.report-stacked-chart__swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.report-stacked-chart__swatch--savings {
  background: #991b1b;
}

.report-stacked-chart__swatch--protection {
  background: #4b5563;
}

.report-stacked-chart__swatch--unit_linked {
  background: linear-gradient(180deg, #fecaca 0%, #fdba74 100%);
}

@media (max-width: 720px) {
  .report-stacked-chart__panel {
    flex-direction: column;
    align-items: stretch;
  }

  .report-stacked-chart__legend {
    max-width: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
  }

  .report-stacked-chart__legend li {
    margin-bottom: 0;
  }
}

/* Integrated report — Operating result by segment (table + narrative) */
.report-page article.report .report-section-integrated {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.report-page article.report .report-section-integrated__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #7f1d1d;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.02em;
  padding-left: 0;
  padding-top: 20px;
}

.report-page article.report .report-section-integrated__subtitle {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #7f1d1d;
  margin: 0 0 0.35rem 0;
  letter-spacing: normal;
  padding-left: 0;
}

.report-page article.report .report-section-integrated__unit {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #7f1d1d;
  margin: 0 0 0.75rem 0;
  padding-left: 0;
}

.report-page article.report .report-table-wrap--integrated {
  border-top: 2px solid #7f1d1d;
  border-bottom: 1px solid #9ca3af;
}

.report-page article.report .report-table--integrated {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.875rem;
  border: none;
}

.report-page article.report .report-table--integrated thead th {
  border: none;
  border-bottom: 2px solid #7f1d1d;
  background: transparent;
  color: #374151;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
}

.report-page article.report .report-table--integrated thead th:first-child,
.report-page article.report .report-table--integrated tbody th:first-child,
.report-page article.report .report-table--integrated tbody td:first-child {
  padding-left: 0;
}

.report-page article.report .report-table--integrated tbody th,
.report-page article.report .report-table--integrated tbody td {
  border: none;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  color: #374151;
}

.report-page article.report .report-table--integrated tbody th {
  font-weight: 400;
  text-align: left;
}

.report-page article.report .report-table--integrated .report-table__row--total th,
.report-page article.report .report-table--integrated .report-table__row--total td {
  font-weight: 700;
}

.report-page article.report .report-table--integrated {
  border-style: hidden;
}

.report-page article.report .report-table--integrated tbody tr:nth-child(even) th,
.report-page article.report .report-table--integrated tbody tr:nth-child(even) td {
  background: #f9fafb;
}

.report-page article.report .report-table--integrated .report-table__col--highlight {
  background: #f3f4f6 !important;
}

.report-page article.report .report-table--integrated tbody tr:nth-child(even) td.report-table__col--highlight,
.report-page article.report .report-table--integrated tbody tr:nth-child(even) th.report-table__col--highlight {
  background: #e8eaed !important;
}

.report-page article.report .report-table__cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-page article.report .report-section-integrated__analysis {
  margin-top: 0;
  padding-top: 0;
}

/* Narrative after comparative table: separator line only, same horizontal alignment as title */
.report-page article.report .report-section-integrated .report-section-integrated__analysis .report-narrative--integrated {
  margin-top: 0;
  padding: 1rem 0 0 0;
  border-top: 1px solid #e5e7eb;
}

.report-page article.report .report-narrative--integrated p {
  margin: 0 0 0.65rem 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #4b5563;
}

.report-page article.report .report-narrative--integrated p:last-child {
  margin-bottom: 0;
}

/* Bold emphasis: same red accent as static .report-accent / KPI tone */
.report-page article.report.report-integrated .report-md-root strong,
.report-page article.report.report-integrated .report-narrative--integrated strong,
.report-page article.report.report-integrated .kpi-vchart__narrative--md strong {
  color: #7f1d1d;
  font-weight: 700;
}

/* Markdown renderer: headings + lists (aligned with integrated palette) */
.report-page article.report .report-md-root .report-md-heading {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.report-page article.report .report-md-root .report-md-heading:first-child {
  margin-top: 0;
}

.report-page article.report .report-md-root h1.report-md-heading,
.report-page article.report .report-md-root h2.report-md-heading {
  letter-spacing: -0.02em;
}

.report-page article.report .report-md-list-wrap .report-md-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #4b5563;
}

.report-page article.report .report-md-list__item {
  margin-bottom: 0.35rem;
}

.report-page article.report .report-md-list__item::marker {
  color: #7f1d1d;
}

.report-page article.report .report-md-list__item:last-child {
  margin-bottom: 0;
}

.report-page article.report .life-nbv-narrative {
  margin-top: 0;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.report-page article.report .report-accent {
  color: #7f1d1d;
  font-weight: 600;
}

/* Markdown-derived tables: same shell + typography as static integrated tables */
.report-page article.report.report-integrated .report-table-wrap--integrated .report-table--from-markdown {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
  margin: 0;
  border-style: hidden;
}

.report-page article.report.report-integrated .report-md-root .report-table-wrap--integrated {
  margin: 0.75rem 0 1.25rem;
}

.report-page article.report.report-integrated .report-table--from-markdown thead th,
.report-page article.report.report-integrated .report-table--from-markdown tbody td {
  border: none;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  color: #374151;
}

.report-page article.report.report-integrated .report-table--from-markdown thead th:first-child,
.report-page article.report.report-integrated .report-table--from-markdown tbody td:first-child {
  padding-left: 0;
}

.report-page article.report.report-integrated .report-table--from-markdown thead th {
  border-bottom: 2px solid #7f1d1d;
  background: transparent;
  font-weight: 700;
}

.report-page article.report.report-integrated .report-table--from-markdown tbody tr:nth-child(even) td {
  background: #f9fafb;
}

.report-page article.report.report-integrated .report-table--from-markdown td strong,
.report-page article.report.report-integrated .report-table--from-markdown th strong {
  color: #7f1d1d;
  font-weight: 700;
}

.report-page article.report .report-table--lob thead th {
  text-align: left;
  font-size: 0.8125rem;
}

.report-page article.report .report-table--lob thead th.report-table__cell-num {
  text-align: right;
}

.report-page article.report .report-table--lob tbody td:not(.report-table__cell-num) {
  font-size: 0.8125rem;
  color: #374151;
}

/* NHOA dashboard */
.noah-page .noah-warnings {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.12);
}

.noah-page .noah-warnings ul {
  margin: 0.5rem 0 0 1.25rem;
}

.noah-inline-form,
.noah-table-wrap {
  margin-top: 0.75rem;
  overflow: scroll;
}

.noah-table-wrap {
  width: 100%;
  max-width: 100%;
}

.noah-table-wrap .noah-table {
  width: 100%;
  max-width: 100%;
}

.noah-settings-form {
  margin-top: 0.75rem;
}

.noah-entry-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.noah-entry-grid--single-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.noah-entry-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 150px;
}

.noah-entry-field label {
  font-size: 0.75rem;
  color: var(--ey-muted);
}

.noah-entry-grid input[type="text"],
.noah-entry-grid input[type="number"] {
  min-height: 2.1rem;
  border-radius: 6px;
  border: 1px solid var(--ey-border);
  color: var(--ey-text);
  padding: 0 0.6rem;
}

.noah-entry-field--checkbox {
  min-width: 95px;
}

.noah-entry-field--submit {
  min-width: 120px;
}

.noah-entry-field__spacer {
  height: 1rem;
}

.noah-active-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ey-muted);
  font-size: 0.8125rem;
}

.noah-row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 120px;
}

.noah-row-actions__form {
  margin: 0;
}

.noah-row-actions-dropdown {
  position: relative;
  display: inline-block;
}

.noah-row-actions-dropdown__summary {
  list-style: none;
  cursor: pointer;
}

.noah-row-actions-dropdown__summary::-webkit-details-marker {
  display: none;
}

.noah-row-actions-dropdown[open] .noah-row-actions {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 15;
  background: var(--ey-bg);
  border: 1px solid var(--ey-border);
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.noah-page .report-table {
  background: #ffffff;
  color: #111827;
}

.noah-page .report-table thead th {
  background: #f3f4f6;
  color: #111827;
  border-color: #d1d5db;
}

.noah-page .report-table tbody td {
  background: #ffffff;
  color: #111827;
  border-color: #e5e7eb;
}

.noah-page .noah-table .noah-active-field {
  color: #374151;
}

.noah-page .noah-table .noah-cell-input {
  background: #ffffff;
  color: #111827;
  border-color: #cbd5e1;
}

.noah-page .noah-table .noah-cell-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.noah-readonly-cell {
  display: inline-block;
  min-width: 72px;
  padding: 0.2rem 0.35rem;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #111827;
}

.noah-alert-triangle {
  display: inline-block;
  margin-left: 0.25rem;
  color: #d97706;
  font-size: 0.8rem;
  line-height: 1;
  vertical-align: middle;
}

.noah-entry-readonly {
  min-height: 2.1rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f3f4f6;
  color: #374151;
  padding: 0 0.6rem;
}

.noah-row-inline {
  margin: 0;
}

.noah-cell-input {
  width: 100%;
  min-width: 88px;
  box-sizing: border-box;
  border: 1px solid var(--ey-border);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--ey-text);
  padding: 0.25rem 0.4rem;
}

.noah-cell-input--num {
  text-align: right;
}

.noah-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.noah-run-simulation-cta {
  display: flex;
  justify-content: center;
  width: 100%;
}

.noah-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.noah-accordion-header h2 {
  margin: 0;
}

.btn-nav--compact {
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}

.noah-accordion-body[hidden] {
  display: none;
}

.noah-accordion-section.is-collapsed {
  padding-bottom: 1.1rem;
}

.noah-accordion-section .noah-accordion-body > .board-muted:first-child {
  margin-top: 0.45rem;
}

.noah-import-tools {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
}

.noah-import-tools--catalog {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--ey-border);
}

.noah-input-tool-card {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--ey-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  min-width: 250px;
  display: flex;
  align-items: center;
}

.noah-input-tool-card--action {
  min-width: auto;
}

.noah-risk-eval-row {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.noah-input-tool-card--nsim {
  min-width: 0;
}

.noah-input-tool-card--add-row {
  min-width: 0;
}

.noah-input-tool-card--catalog-entry {
  margin-top: 0.75rem;
  min-width: 0;
}

.noah-input-tool-card--catalog-entry .noah-entry-field {
  min-width: 210px;
}

.noah-input-tool-card--add-row h3 {
  margin: 0 0 0.55rem 0;
}

.noah-paste-import {
  border: 1px solid var(--ey-border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem 0.5rem;
  background: rgba(255, 255, 255, 0.02);
}

.noah-paste-import > summary {
  list-style: none;
}

.noah-paste-import > summary::-webkit-details-marker {
  display: none;
}

.noah-paste-form {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.noah-paste-form label {
  font-size: 0.8rem;
  color: var(--ey-muted);
}

.noah-paste-form textarea {
  min-width: min(62vw, 640px);
  min-height: 170px;
  border-radius: 8px;
  border: 1px solid var(--ey-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--ey-text);
  padding: 0.65rem;
  font-family: "Roboto Mono", Menlo, monospace;
  font-size: 0.82rem;
}

.noah-csv-import-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.noah-csv-import-form label {
  font-size: 0.8rem;
  color: var(--ey-muted);
}

.noah-csv-import-form--stacked {
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.noah-csv-import-form__controls {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.noah-csv-import-form--stacked input[type="number"],
.noah-csv-import-form--stacked input[type="file"] {
  min-height: 2.15rem;
  border-radius: 7px;
  border: 1px solid var(--ey-border);
  color: var(--ey-text);
  padding: 0 0.6rem;
  line-height: 34px;
}

.noah-csv-import-form--stacked input[type="number"] {
  width: 130px;
}

.noah-catalog-meta {
  margin: 0.1rem 0 0;
  width: 100%;
}

.noah-row-actions--inline {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}

.noah-catalog-table .noah-cell-input {
  min-width: 150px;
}

.noah-catalog-pagination {
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.noah-catalog-pagination__actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.noah-correlation-section {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.noah-correlation-section__header h3 {
  margin: 0;
}

.noah-correlation-section__header p {
  margin: 0.35rem 0 0;
}

.noah-correlation-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.noah-correlation-table-card {
  border: 1px solid var(--ey-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.7rem 0.8rem;
}

.noah-correlation-table-card h4 {
  margin: 0 0 0.55rem;
}

.noah-correlation-table-card__meta {
  margin: -0.15rem 0 0.6rem;
}

.noah-correlation-table th,
.noah-correlation-table td {
  min-width: 90px;
}

.noah-correlation-table th:first-child {
  min-width: 160px;
}

.noah-correlation-table .noah-cell-input {
  width: 100%;
}

.noah-correlation-form__actions {
  display: flex;
  justify-content: flex-start;
}

.noah-output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.75rem;
}

.noah-visual-output {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.noah-visual-output__level h4 {
  margin: 0 0 0.45rem;
}

.noah-visual-card {
  border: 1px solid var(--ey-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 0.6rem;
}

.noah-visual-card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
}

.noah-visual-card > summary::-webkit-details-marker {
  display: none;
}

.noah-visual-card > summary small {
  color: var(--ey-muted);
  font-weight: 400;
}

.noah-visual-card__content {
  padding: 0 0.75rem 0.75rem;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1fr);
  gap: 0.75rem;
}

.noah-visual-metrics-table th,
.noah-visual-metrics-table td {
  font-size: 0.78rem;
  padding-top: 0.22rem;
  padding-bottom: 0.22rem;
}

.noah-visual-card__charts {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.noah-loss-curve h5 {
  margin: 0 0 0.25rem;
}

.noah-loss-curve {
  display: flex;
  flex-direction: column;
}

.noah-loss-chart-canvas {
  display: block;
  width: 100%;
  height: 220px !important;
  min-height: 220px;
  max-height: 220px;
  flex: 0 0 220px;
  border: 1px solid var(--ey-border);
  border-radius: 8px;
  background: #fff;
  padding: 0.25rem;
}

.noah-loss-chart-legend {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  color: var(--ey-muted);
  font-size: 0.75rem;
}

.noah-loss-chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.noah-loss-chart-legend__line {
  width: 14px;
  height: 0;
  border-top: 2px solid #0f172a;
}

.noah-loss-chart-legend__line--expected {
  border-top-color: #67bf53;
  border-top-style: dashed;
}

.noah-loss-chart-legend__line--var {
  border-top-color: #0f172a;
  border-top-style: dashed;
}

.noah-summary-tree {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.noah-summary-node {
  border: 1px solid var(--ey-border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  background: rgba(255, 255, 255, 0.03);
}

.noah-summary-node summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  cursor: pointer;
}

.noah-summary-node--level-2 {
  margin-top: 0.35rem;
  margin-left: 0.85rem;
}

.noah-summary-node--level-3 {
  margin-top: 0.35rem;
  margin-left: 1.7rem;
}

.noah-summary-metric {
  color: var(--ey-muted);
  font-size: 0.8125rem;
}

@media (max-width: 900px) {
  .noah-visual-card__content {
    grid-template-columns: 1fr;
  }
}
