/* Shared 2026 readability and completed-evaluation polish. */
:root {
  --jymni-text-body: 1rem;
  --jymni-text-secondary: 0.9375rem;
  --jymni-text-label: 0.875rem;
  --jymni-leading-body: 1.58;
  --jymni-leading-compact: 1.4;
  --jymni-result-width: 66.25rem;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-size: var(--jymni-text-body);
}

body :where(h1, h2, h3) {
  text-wrap: balance;
}

body :where(p, li, dd, figcaption) {
  text-wrap: pretty;
}

/* Controls stay comfortably readable and avoid mobile-browser input zoom. */
:is(.layout-classic, .layout-studio) :where(button, input, textarea, select),
.admin-shell :where(input, textarea, select),
.manual-shell button,
.logo-page-header button,
.concept-controls button,
.concept-grid button,
.shortlist-tray button,
.concept-dialog button {
  font-size: var(--jymni-text-body) !important;
}

/* Advisor home: 16px reading copy and a 14px floor for compact labels. */
.layout-classic .app-shell.is-input-only :where(
  .home-primary-nav a,
  .home-hero-kicker,
  .home-value-list li,
  .home-value-list li > span,
  .home-question-heading p,
  .home-question-number,
  .home-section-heading > p,
  .home-method-index,
  .sample-gallery-kicker,
  .sample-gallery-axis,
  .sample-gallery-quadrant small,
  .sample-gallery-results-header p,
  #sampleGroupCount,
  .sample-case-card-action,
  .home-footer .legal-links
) {
  font-size: var(--jymni-text-label) !important;
  line-height: var(--jymni-leading-compact);
}

.layout-classic .app-shell.is-input-only :where(
  .composer-input-help,
  .home-question-panel > .composer-input-label,
  .home-question-meta p,
  .first-evaluation-consent label,
  .home-section-heading > span,
  .home-method-steps p,
  .home-method-note p,
  .sample-gallery-intro > p:last-child,
  .sample-gallery-quadrant span,
  .sample-case-card strong,
  .sample-case-card-copy,
  .home-footer-brand p
) {
  font-size: var(--jymni-text-secondary) !important;
  line-height: var(--jymni-leading-body);
}

.layout-classic .app-shell.is-input-only :where(
  .home-question-panel > .composer-input-label,
  .home-method-steps p,
  .home-method-note p,
  .sample-case-card-copy
) {
  font-size: var(--jymni-text-body) !important;
}

.layout-classic .app-shell.is-input-only .home-footer-brand strong {
  font-size: var(--jymni-text-secondary) !important;
}

.layout-classic .app-shell.is-input-only :where(.home-hero-kicker, .home-section-heading > p, .sample-gallery-kicker) {
  letter-spacing: 0.08em;
}

/* Shared app microcopy, dialogs, and result controls. */
:is(.layout-classic, .layout-studio) :where(
  .status-row,
  .composer-notice,
  .composer-guidance-notice,
  .public-verification p,
  .legal-dialog-body,
  .save-dialog-body,
  .share-dialog-body,
  .auth-field-hint,
  .auth-trust-note,
  .auth-consent,
  .pdf-export-status
) {
  font-size: var(--jymni-text-secondary) !important;
  line-height: var(--jymni-leading-body);
}

:is(.layout-classic, .layout-studio) :where(
  .auth-brand-name,
  .auth-field > span,
  .auth-field > label span,
  .signup-notice-header span,
  .signup-welcome-header span,
  .save-name-field > span,
  .share-dialog-header > span,
  .share-dialog-assurances span,
  .share-url-field > span,
  .legal-links
) {
  font-size: var(--jymni-text-label) !important;
  line-height: var(--jymni-leading-compact);
}

/* Studio: favor legibility over dense, dashboard-like microtype. */
.layout-studio :where(p, li, dd) {
  font-size: var(--jymni-text-body) !important;
  line-height: var(--jymni-leading-body);
}

.layout-studio :where(a, label, summary) {
  font-size: var(--jymni-text-body) !important;
}

.layout-studio :where(th, td, small, time) {
  font-size: var(--jymni-text-label) !important;
  line-height: var(--jymni-leading-compact);
}

.layout-studio :where(button, label) > :where(span, strong, small, em) {
  font-size: inherit !important;
}

.layout-studio :where(
  [class*="kicker"],
  [class*="-label"],
  [class*="status"],
  [class*="-hint"],
  [class*="-meta"],
  [class*="cost"],
  [class*="charge"],
  [class*="-date"],
  [class*="-count"],
  [class*="caption"]
) {
  font-size: var(--jymni-text-label) !important;
  line-height: var(--jymni-leading-compact);
}

.layout-studio :where([class*="description"], [class*="-copy"], [class*="-note"]) {
  font-size: var(--jymni-text-secondary) !important;
  line-height: var(--jymni-leading-body);
}

/* Result receipt and report share one alignment edge. */
:is(.layout-classic, .layout-studio) .app-shell.is-result-visible {
  --jymni-result-width: 66.25rem;
}

:is(.layout-classic, .layout-studio) .question-context.is-complete .question-pill.question-receipt {
  width: 100%;
  max-width: var(--jymni-result-width);
}

.layout-studio .studio-shell.is-result-visible .studio-grid {
  width: 100%;
  max-width: calc(var(--jymni-result-width) + 2.25rem);
  grid-template-columns: minmax(0, var(--jymni-result-width));
}

.layout-classic .app-shell.is-result-visible :where(.question-context, .chat-stage) {
  width: min(100%, var(--jymni-result-width));
  margin-inline: auto;
  padding-inline: 0;
}

.layout-classic .app-shell.is-result-visible .retry-panel {
  width: 100%;
  max-width: var(--jymni-result-width);
}

:is(.layout-classic, .layout-studio) .question-context.is-complete :where(
  .question-status,
  .question-component-label,
  .question-context-chip
) {
  font-size: var(--jymni-text-label) !important;
  line-height: var(--jymni-leading-compact);
  letter-spacing: 0.045em;
}

:is(.layout-classic, .layout-studio) .question-context.is-complete :where(
  .question-text,
  .question-component-value
) {
  font-size: var(--jymni-text-secondary) !important;
  line-height: 1.5;
}

:is(.layout-classic, .layout-studio) .question-context.is-complete :where(
  .question-receipt-toggle,
  .top-retry-button
) {
  font-size: var(--jymni-text-label) !important;
}

/* Let receipt actions wrap from their content size at high text zoom. */
:is(.layout-classic, .layout-studio) .question-context.is-complete .question-receipt .question-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

:is(.layout-classic, .layout-studio) .question-context.is-complete .question-receipt .question-status {
  flex: 1 1 9rem;
}

:is(.layout-classic, .layout-studio) .question-context.is-complete .question-receipt .question-heading > .top-retry-button {
  margin-inline-start: auto;
}

/* Evaluation hierarchy and the four-quadrant result map. */
.evaluation-report {
  font-size: var(--jymni-text-body);
  line-height: var(--jymni-leading-body);
}

.evaluation-report > .classification-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13.25rem, auto);
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: start;
}

.evaluation-report > .classification-hero .classification-copy {
  min-width: 0;
}

.evaluation-report > .classification-hero .matrix-thumb {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  float: none;
  width: min(13.25rem, 100%);
  height: 9.5rem;
  margin: 0;
  padding: 0.625rem 0.5rem;
  grid-template-columns: 12% repeat(2, minmax(0, 1fr));
  grid-template-rows: 1.125rem repeat(2, 3.25rem);
  gap: 0.3rem;
  border-radius: 1rem;
}

.evaluation-report :where(.matrix-axis, .matrix-cell) {
  font-size: var(--jymni-text-label) !important;
  line-height: 1.15;
  letter-spacing: 0;
}

.evaluation-report .matrix-axis-y {
  width: 7rem;
}

.evaluation-report .matrix-cell {
  place-items: center;
  padding: 0.35rem;
  border-radius: 0.65rem;
}

.evaluation-report .matrix-cell .quadrant-icon {
  width: 2rem;
  height: 2rem;
  flex-basis: 2rem;
  stroke-width: 1.65;
}

.evaluation-report .matrix-thumb-labels .matrix-cell {
  padding-inline: 0.45rem;
  overflow-wrap: normal;
  text-wrap: balance;
}

.matrix-cell-label {
  display: block;
  min-width: 0;
  font-size: var(--jymni-text-label);
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.evaluation-report .matrix-cell.active {
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.34), 0 0.65rem 1.25rem rgba(0, 0, 0, 0.22);
}

.evaluation-report .matrix-cell.aligned.active {
  background: #f8dc59;
  color: #282714;
}

.evaluation-report .matrix-cell.selfserving.active {
  background: #eea06f;
  color: #351b10;
}

.evaluation-report .matrix-cell.wellmeant.active {
  background: #91d8cf;
  color: #103a39;
}

.evaluation-report .matrix-cell.reckless.active {
  background: #f58f7f;
  color: #3f1713;
}

.quadrant-icon {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 1.125rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quadrant-icon .quadrant-icon-fill {
  fill: currentColor;
  stroke: none;
}

.decision-aid-quadrant {
  gap: 0.35rem;
}

.evaluation-report :where(
  .classification-kicker,
  .outline-index,
  .ethics-label,
  .decision-aid-summary-hint,
  .decision-aid-quadrant,
  .decision-aid-summary-metric-label,
  .decision-aid-summary-metric-value,
  .decision-aid-overview-kicker,
  .classification-score-label,
  .classification-score-value,
  .evidence-confidence-kicker,
  .evidence-badge
) {
  font-size: var(--jymni-text-label) !important;
  line-height: var(--jymni-leading-compact);
}

.evaluation-report .decision-aid-summary-title {
  font-size: var(--jymni-text-body) !important;
}

.evaluation-report .decision-aid-overview-text {
  font-size: var(--jymni-text-body) !important;
  line-height: var(--jymni-leading-body);
}

.evaluation-report .decision-aid-overview .matrix-thumb {
  width: min(15.5rem, 100%);
  height: 9.5rem;
  padding: 0.625rem 0.5rem;
  grid-template-columns: 12% repeat(2, minmax(0, 1fr));
  grid-template-rows: 1.125rem repeat(2, 3.25rem);
  gap: 0.3rem;
}

/* An open Decision Aid reads as one tinted inset, separate from the report below. */
.evaluation-report .decision-aid-panel[open] {
  margin-bottom: 0.5rem;
  border-color: rgba(13, 119, 115, 0.3);
  background: linear-gradient(180deg, #f2faf8 0%, #e8f4f2 100%);
  box-shadow: 0 1.1rem 2.5rem rgba(9, 68, 76, 0.12), inset 0 1px 0 #fff;
}

.evaluation-report .decision-aid-panel[open] .decision-aid-summary {
  border-bottom-color: rgba(13, 119, 115, 0.18);
  background: rgba(218, 241, 236, 0.72);
}

.evaluation-report .decision-aid-panel[open] .decision-aid-body {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  background: linear-gradient(180deg, rgba(237, 248, 245, 0.9), rgba(225, 241, 238, 0.78));
  cursor: pointer;
}

.evaluation-report .decision-aid-panel.is-animating .decision-aid-body {
  will-change: height, opacity, transform;
}

.evaluation-report .decision-aid-panel.is-collapsing .decision-aid-chevron::after {
  transform: rotate(90deg);
}

.evaluation-report .decision-aid-panel :where(a, button) {
  cursor: pointer;
}

/* Admin retains density, but never below a readable 14px data floor. */
.admin-shell :where(p, li, label) {
  font-size: var(--jymni-text-body) !important;
  line-height: var(--jymni-leading-body);
}

.admin-shell :where(button, a) {
  font-size: var(--jymni-text-secondary) !important;
  line-height: var(--jymni-leading-compact);
}

.admin-shell :where(button, label) > :where(span, strong, small, em) {
  font-size: inherit !important;
}

.admin-shell :where(th, td, dt, dd, small, time, caption),
.admin-shell :where(
  [class*="kicker"],
  [class*="status"],
  [class*="-meta"],
  [class*="-label"],
  [class*="-hint"],
  [class*="-count"],
  [class*="pill"]
) {
  font-size: var(--jymni-text-label) !important;
  line-height: var(--jymni-leading-compact);
}

/* Manuals and the logo review page use the same compact-text floor. */
.manual-shell :where(.manual-brand span, .manual-kicker, .manual-meta span, .manual-sidebar > strong, th, small, figcaption) {
  font-size: var(--jymni-text-label) !important;
  line-height: var(--jymni-leading-compact);
}

.logo-page-header :where(a, button),
.logo-hero-kicker,
.concept-controls-kicker,
.logo-hero-chips span,
.concept-copy > span,
.concept-filters button,
.concept-shortlist,
.concept-dialog-shortlist,
.shortlist-tray button,
#conceptDialogKicker,
.logo-page-footer :where(p, a) {
  font-size: var(--jymni-text-label) !important;
  line-height: var(--jymni-leading-compact);
}

.concept-copy p {
  font-size: var(--jymni-text-body) !important;
  line-height: var(--jymni-leading-body);
}

@media (max-width: 43.75rem) {
  .evaluation-report > .classification-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .evaluation-report > .classification-hero .matrix-thumb {
    grid-column: 1;
    grid-row: 2;
    justify-self: end;
  }

  .decision-aid-overview {
    grid-template-columns: minmax(0, 1fr);
  }

  .evaluation-report .decision-aid-overview .matrix-thumb {
    justify-self: end;
  }
}

@media (forced-colors: active) {
  .evaluation-report .decision-aid-panel[open],
  .evaluation-report .decision-aid-panel[open] .decision-aid-summary,
  .evaluation-report .decision-aid-panel[open] .decision-aid-body,
  .evaluation-report .matrix-cell.active {
    border-color: CanvasText;
    background: Canvas;
    box-shadow: none;
    color: CanvasText;
  }
}
