/* Quick Business Health Check — one-page layout
   Root fix: global styles.css styles ALL `input` with appearance:none,
   width:100%, min-height:46px. Radios/checkboxes must opt out inside .qhc-module. */

.qhc-module {
  /* QHC color shell — distinct from warm beige Detailed 01/02/03.
     No overflow-x clip/hide hack — constrain children with min-width:0 / wrap. */
  --qhc-shell-bg: #eef6f4;
  --qhc-shell-border: #c5dbd5;
  --qhc-card-bg: #ffffff;
  --qhc-card-border: rgba(15, 118, 110, 0.1);
  --qhc-results-bg: #e4f0ec;
  --qhc-results-border: rgba(15, 118, 110, 0.14);
  --qhc-divider: rgba(15, 118, 110, 0.12);
  --qhc-soft-fill: rgba(15, 118, 110, 0.06);
  background: var(--qhc-shell-bg);
  color-scheme: light;
  border: 1px solid var(--qhc-shell-border);
  border-radius: 10px;
  box-sizing: border-box;
  margin: 0;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.qhc-panel {
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px 12px;
}

.qhc-header {
  margin: 0 0 8px;
}

.qhc-header h1 {
  color: var(--ink, #17211d);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

.qhc-title-with-unit {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.65rem;
  min-width: 0;
}

.qhc-currency-unit {
  color: var(--muted, #64716b);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
}

.qhc-pair-heading {
  display: flex;
  min-width: 0;
  width: 100%;
}

.qhc-disclosure-heading {
  align-items: baseline;
  display: inline-flex;
  flex: 1 1 auto;
  min-width: 0;
}

.qhc-display-period {
  display: grid;
  gap: 5px;
  margin: 0 0 10px;
  max-width: 22rem;
  min-width: 0;
  position: relative;
  width: 100%;
}

.qhc-display-period-label {
  color: #4d6b63;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.qhc-display-period-options {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  width: 100%;
}

.qhc-display-period-btn {
  appearance: none;
  background: #fff;
  border: 1px solid var(--qhc-card-border);
  border-radius: 6px;
  color: #17211d;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
  min-width: 0;
  padding: 7px 4px;
  text-align: center;
  white-space: nowrap;
}

.qhc-display-period-btn.is-selected,
.qhc-display-period-btn[aria-pressed="true"] {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.35);
  color: #0f766e;
  font-weight: 780;
}

.qhc-display-period-btn:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.55);
  outline-offset: 1px;
}

.qhc-display-period-note {
  color: var(--muted, #64716b);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.qhc-detail-table-title {
  margin: 0 0 6px;
}

.qhc-detail-table-caption {
  color: #4d6b63;
  font-size: 0.78rem;
  font-weight: 700;
}

/* Results-area folds (detail table / BE-ref / efficiency) — display only. */
.qhc-result-fold {
  margin: 0;
  min-width: 0;
}

.qhc-result-fold > .qhc-result-fold-body {
  margin: 0;
  min-width: 0;
  padding: 0;
}

.qhc-result-fold:not([open]) > .qhc-result-fold-body {
  display: none;
}

.qhc-result-fold-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  list-style: none;
  margin: 0;
  min-height: 0;
  padding: 2px 0;
}

.qhc-result-fold-summary::-webkit-details-marker {
  display: none;
}

.qhc-result-fold-summary > .qhc-region-title,
.qhc-result-fold-summary > .qhc-detail-table-caption,
.qhc-result-fold-summary > .qhc-results-overall-title {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
}

.qhc-results-overall > .qhc-results-overall-summary-row {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 4px 0 8px;
}

.qhc-results-overall > .qhc-results-overall-summary-row > .qhc-results-overall-title {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

.qhc-results-overall > .qhc-results-overall-summary-row > .qhc-result-fold-toggle {
  margin-left: auto;
}

.qhc-results-overall-summary {
  align-items: baseline;
  display: flex;
  flex: 1 1 12rem;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.qhc-results-overall-summary-label {
  color: #3d5f55;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.qhc-results-overall-summary-value {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.qhc-results-overall-body {
  padding-top: 4px;
}

.qhc-result-fold-toggle {
  align-items: center;
  color: #5a6b63;
  display: inline-flex;
  flex: 0 0 auto;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.qhc-result-fold-toggle svg {
  display: block;
  fill: none;
  height: 14px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  transition: transform 0.14s ease;
  width: 14px;
}

/* Section-level result region folds only (not .qhc-result-helper inline rows). */
.qhc-result-fold > .qhc-result-fold-summary > .qhc-result-fold-toggle {
  background: #edf4ef;
  border: 1px solid #b4c8bd;
  border-radius: 999px;
  box-sizing: border-box;
  color: #214f3e;
  height: 36px;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  width: 36px;
}

.qhc-result-fold > .qhc-result-fold-summary > .qhc-result-fold-toggle::before {
  content: "";
  height: 44px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
}

.qhc-result-fold > .qhc-result-fold-summary > .qhc-result-fold-toggle svg {
  height: 19px;
  stroke-width: 2.75;
  width: 19px;
}

.qhc-result-fold > .qhc-result-fold-summary:hover > .qhc-result-fold-toggle {
  background: #e0eee6;
  border-color: #9bb5a8;
  box-shadow: 0 0 0 2px rgba(33, 79, 62, 0.08);
}

.qhc-result-fold > .qhc-result-fold-summary:focus-visible > .qhc-result-fold-toggle {
  background: #d8eae0;
  border-color: #7fa093;
  box-shadow: 0 0 0 2px rgba(33, 79, 62, 0.16);
}

.qhc-result-fold[open] > .qhc-result-fold-summary .qhc-result-fold-toggle svg,
.qhc-result-helper[open] > .qhc-result-helper-summary .qhc-result-fold-toggle svg {
  transform: rotate(180deg);
}

.qhc-result-fold-summary:focus-visible,
.qhc-result-helper-summary:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.55);
  outline-offset: 2px;
}

.qhc-region-be-adj > .qhc-result-fold > .qhc-result-fold-summary > .qhc-region-title,
.qhc-region-efficiency > .qhc-result-fold > .qhc-result-fold-summary > .qhc-region-title {
  margin: 0;
}

.qhc-region-efficiency > .qhc-result-fold[open] > .qhc-result-fold-body {
  display: grid;
  gap: inherit;
}

.qhc-detail-table-wrap > .qhc-result-fold > .qhc-result-fold-summary {
  padding: 6px 8px;
}

.qhc-detail-table-wrap > .qhc-result-fold[open] > .qhc-result-fold-body {
  border-top: 1px solid var(--qhc-divider);
}

/* Secondary long-explanation helpers inside results (localized titles). */
.qhc-result-helper {
  margin: 4px 0 0;
  min-width: 0;
}

.qhc-result-helper:not([open]) > .qhc-result-helper-body {
  display: none;
}

.qhc-result-helper-summary {
  align-items: center;
  color: #7a9088;
  cursor: pointer;
  display: inline-flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  max-width: 100%;
  min-height: 0;
  padding: 0;
}

.qhc-result-helper-summary::-webkit-details-marker {
  display: none;
}

.qhc-result-helper-title {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-color: rgba(122, 144, 136, 0.45);
  text-underline-offset: 2px;
}

.qhc-result-helper .qhc-result-fold-toggle {
  height: 16px;
  width: 16px;
}

.qhc-result-helper .qhc-result-fold-toggle svg {
  height: 12px;
  width: 12px;
}

.qhc-result-helper-body {
  margin: 4px 0 0;
  min-width: 0;
}

.qhc-result-helper-body .qhc-disclaimer,
.qhc-result-helper-body .qhc-be-adj-explainer,
.qhc-result-helper-body .qhc-payback-scope-note {
  margin: 0;
}

.qhc-detail-table--single-period {
  table-layout: fixed;
  width: 100%;
}

@media print {
  .qhc-display-period-options {
    display: none !important;
  }

  .qhc-display-period-note {
    clip: auto !important;
    display: block !important;
    font-size: 0.85rem;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    position: static !important;
    width: auto !important;
    white-space: normal !important;
  }

  /* Print must still include folded result content (data stays in DOM). */
  .qhc-results .qhc-result-fold > .qhc-result-fold-body,
  .qhc-results .qhc-result-helper > .qhc-result-helper-body {
    display: block !important;
  }

  .qhc-results .qhc-result-fold-toggle,
  .qhc-results .qhc-result-helper .qhc-result-fold-toggle {
    display: none !important;
  }
}

@media screen {
  .qhc-display-period-note {
    /* Screen relies on selected buttons; keep note for a11y/print sync text. */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

.qhc-purpose {
  color: var(--ink, #17211d);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0 0 4px;
}

.qhc-isolation {
  color: var(--muted, #64716b);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 2px 0 0;
  opacity: 0.78;
}

/* One-time input-area guidance (after intro, before first fields). Low-key; no alert chrome. */
.qhc-form > .qhc-business-data-guidance,
.qhc-trading-notes > .qhc-closed-hint,
.qhc-trading-notes > .qhc-operating-day-guidance {
  margin: 0;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

/* Closed-hint + operating-day guidance + field error: compact stack (no invented gaps). */
.qhc-trading-notes {
  align-content: start;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.qhc-onepage {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.qhc-card {
  background: var(--qhc-card-bg);
  border: 1px solid var(--qhc-card-border);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
}

.qhc-gm-card,
.qhc-ops-revenue,
.qhc-ops-trading {
  align-content: start;
  gap: 6px;
}

.qhc-ops-card {
  align-content: start;
}

/* Closed days: label → input → estimate → helper (stacked in card) */
.qhc-closed-days-row {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.qhc-closed-days-row > input {
  min-width: 0;
}

.qhc-trading-summary {
  align-items: baseline;
  background: var(--qhc-soft-fill);
  border-radius: 6px;
  color: var(--ink, #17211d);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  font-size: 0.76rem;
  font-weight: 650;
  gap: 0.35em;
  justify-content: flex-start;
  line-height: 1.3;
  margin: 0;
  max-width: 100%;
  padding: 6px 10px;
  white-space: normal;
}

.qhc-trading-summary-label,
.qhc-trading-summary-body {
  display: inline;
  max-width: 100%;
}

.qhc-trading-summary-label {
  white-space: nowrap;
}

/* Shared field-label metrics for GM | revenue | trading card titles.
   All top labels use span.qhc-pair-label so global h3 rules cannot skew GM. */
.qhc-pair-label {
  color: var(--ink, #17211d);
  display: block;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.25;
  margin: 0;
  min-width: 0;
}

.qhc-ops-revenue > .qhc-pair-label,
.qhc-ops-revenue > .qhc-pair-heading,
.qhc-ops-revenue > .qhc-pair-control {
  min-width: 0;
}

/* Period stacks under revenue amount inside the revenue card. */
.qhc-period-pair {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.qhc-ops-grid {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.qhc-closed-days-field {
  gap: 3px;
}

.qhc-section-title {
  color: var(--ink, #17211d);
  font-size: 0.92rem;
  font-weight: 800;
  margin: 0;
}

.qhc-form {
  min-width: 0;
}

.qhc-field {
  display: grid;
  gap: 3px;
  margin-bottom: 0;
  min-width: 0;
}

.qhc-field > span {
  color: var(--ink, #17211d);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
}

/* Period label inherits .qhc-pair-label metrics (same as GM / revenue). */

.qhc-field--gm {
  gap: 0;
}

.qhc-sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* <legend> ignores absolute positioning in many engines and can widen the page
   when paired with white-space:nowrap. Prefer aria-label on fieldset; keep this
   guard for any remaining sr-only legends. */
.qhc-module legend.qhc-sr-only {
  display: block;
  float: left;
  height: 0;
  margin: 0;
  max-width: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 0;
  white-space: normal;
}

.qhc-input-affix {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  position: relative;
}

.qhc-input-affix input {
  padding-right: 2rem;
}

.qhc-affix {
  color: var(--muted, #64716b);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.qhc-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

/* Text / select / number inputs only — never radio/checkbox */
.qhc-module input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
.qhc-module select {
  appearance: none;
  background: #fffaf5;
  border: 1px solid var(--line, #e2d8c8);
  border-radius: 8px;
  box-sizing: border-box;
  color: var(--ink, #17211d);
  font: inherit;
  max-width: 100%;
  min-height: 40px;
  min-width: 0;
  outline: none;
  padding: 8px 10px;
  width: 100%;
}

.qhc-module select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted, #64716b) 50%),
    linear-gradient(135deg, var(--muted, #64716b) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 10px) 50%;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  height: 40px;
  line-height: 1.25;
  padding-right: 30px;
}

.qhc-module input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]) {
  height: 40px;
  line-height: 1.25;
}

.qhc-module input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]):focus,
.qhc-module select:focus {
  border-color: var(--accent, #0f766e);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

/* —— Native radio / checkbox restore —— */
.qhc-module input[type="radio"],
.qhc-module input[type="checkbox"] {
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: var(--accent, #0f766e);
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  flex: 0 0 auto;
  height: 1.05rem;
  margin: 0;
  max-width: none;
  min-height: 0;
  min-width: 0;
  padding: 0;
  width: 1.05rem;
}

.qhc-module input[type="radio"]:focus-visible,
.qhc-module input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent, #0f766e);
  outline-offset: 2px;
}

.qhc-choice-option:focus-within {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.qhc-choice,
.qhc-inline-choice {
  align-items: stretch;
  border: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  min-width: 0;
  padding: 0;
  width: 100%;
}

.qhc-choice legend,
.qhc-inline-choice legend {
  color: var(--ink, #17211d);
  float: none;
  font-size: 0.84rem;
  font-weight: 700;
  margin: 0 0 4px;
  padding: 0;
  width: 100%;
}

.qhc-choice-option {
  align-items: center;
  background: #fffaf5;
  border: 1px solid var(--line, #e2d8c8);
  border-radius: 8px;
  box-sizing: border-box;
  color: var(--ink, #17211d);
  cursor: pointer;
  display: inline-flex;
  flex: 1 1 0;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  justify-content: center;
  line-height: 1.25;
  max-width: none;
  min-height: 36px;
  min-width: 0;
  padding: 6px 10px;
  text-align: center;
  white-space: nowrap;
}

.qhc-choice-option:has(input:checked),
.qhc-choice-option.is-selected {
  background: rgba(15, 118, 110, 0.1);
  border-color: rgba(15, 118, 110, 0.45);
  color: var(--accent, #0f766e);
  font-weight: 800;
}

.qhc-choice-option--compact {
  flex: 0 1 auto;
  min-height: 32px;
  min-width: 64px;
  padding: 4px 10px;
}

.qhc-hint,
.qhc-disclaimer {
  color: var(--muted, #64716b);
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0;
}

.qhc-hint--compact {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0.9;
}

/* QHC GM field explain hierarchy (scoped; does not alter other hints). */
.qhc-gm-explain-block {
  display: flex;
  flex-direction: column;
  gap: 0.22em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.qhc-gm-explain-block > .qhc-gm-explain-formula {
  margin: 0;
  color: var(--text, #1f2933);
  font-weight: 600;
  opacity: 1;
}

.qhc-gm-explain-block > .qhc-gm-explain-main {
  margin: 0;
}

/* Top input: desktop = three equal cards; mobile (≤900) = two-row ratios via media query. */
.qhc-row-pair {
  align-items: start;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.qhc-row-pair--always {
  align-items: stretch;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
}

.qhc-row-pair--always > .qhc-gm-card,
.qhc-row-pair--always > .qhc-ops-revenue,
.qhc-row-pair--always > .qhc-ops-trading {
  align-content: start;
  align-self: stretch;
  min-width: 0;
}

.qhc-row-pair--always > .qhc-gm-card > .qhc-pair-label,
.qhc-row-pair--always > .qhc-ops-revenue > .qhc-pair-heading,
.qhc-row-pair--always > .qhc-ops-revenue > #qhc-revenue-label,
.qhc-row-pair--always > .qhc-ops-trading > .qhc-pair-label {
  align-items: flex-end;
  box-sizing: border-box;
  display: flex;
  min-height: calc(2 * 1.25em);
}

.qhc-row-pair--desktop {
  grid-template-columns: minmax(0, 1fr);
}

.qhc-row-2 {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  min-width: 0;
}

.qhc-field-error {
  color: #b42318;
  font-size: 0.76rem;
  line-height: 1.35;
  margin: 0;
}

.qhc-field-error[hidden] {
  display: none;
}

.qhc-fixed-list {
  display: grid;
  gap: 0;
  min-width: 0;
}

/* Mobile / ≤900: name above; amount + period one row (amount wide, period narrow). */
.qhc-fixed-row {
  border-top: 1px solid var(--qhc-divider);
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px 0;
}

.qhc-fixed-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.qhc-fixed-row:last-child {
  padding-bottom: 0;
}

.qhc-fixed-label {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
}

.qhc-fixed-controls {
  align-items: stretch;
  display: grid;
  gap: 8px;
  /* Mobile default; ≤900 overrides period to ~Per month width (desktop: display:contents). */
  grid-template-columns: minmax(0, 1fr) minmax(7.25rem, 7.875rem);
  min-width: 0;
}

.qhc-fixed-amount,
.qhc-fixed-period {
  display: grid;
  margin: 0;
  min-width: 0;
}

.qhc-fixed-amount input,
.qhc-fixed-period select {
  height: 40px;
  min-height: 40px;
  width: 100%;
}

.qhc-invest-grid {
  display: grid;
  gap: 8px;
}

.qhc-invest-entry-row {
  align-items: end;
  display: grid;
  gap: 8px;
  /* Desktop default: Type | Amount | Add on one row */
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) auto;
  min-width: 0;
}

.qhc-invest-entry-row .qhc-field {
  margin: 0;
  min-width: 0;
}

.qhc-invest-entry-row .qhc-field > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qhc-invest-type-field,
.qhc-invest-amount-field {
  min-width: 0;
}

.qhc-invest-type-field select,
.qhc-invest-amount-field input {
  min-width: 0;
  width: 100%;
}

.qhc-invest-add {
  box-sizing: border-box;
  flex-shrink: 0;
  font-size: 0.8rem;
  min-height: 40px;
  padding: 6px 14px;
  white-space: nowrap;
  width: auto;
}

.qhc-invest-other-name-row {
  margin-top: 8px;
  min-width: 0;
}

.qhc-invest-other-name-field {
  display: block;
  margin: 0;
  max-width: 22rem;
  min-width: 0;
}

.qhc-invest-other-name-field input {
  width: 100%;
}

.qhc-invest-total .qhc-input-affix input {
  padding-right: 3.4rem;
}

.qhc-invest-total .qhc-field {
  margin-top: 0.65rem;
}

.qhc-invest-total .qhc-field:first-child {
  margin-top: 0;
}

.qhc-invest-treatment {
  border: 0;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.qhc-invest-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}

.qhc-invest-tag--include {
  color: #1f6b3a;
  background: rgba(46, 160, 84, 0.12);
}

.qhc-invest-tag--exclude {
  color: #6b5b1f;
  background: rgba(196, 160, 48, 0.14);
}

.qhc-invest-legacy-prompt,
.qhc-hint--warn {
  color: #8a5a00;
}

.qhc-invest-autosum--split {
  display: grid;
  gap: 0.28rem;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 6px 0 0;
  margin-top: 6px;
  border-top: 1px solid var(--qhc-divider);
}

.qhc-invest-autosum-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  min-width: 0;
}

.qhc-invest-autosum-row span {
  color: var(--muted, #64716b);
  font-size: 0.78rem;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.qhc-invest-autosum-row strong {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.qhc-invest-autosum-row--payback strong {
  color: #334155;
  font-size: 0.84rem;
  font-weight: 650;
}

.qhc-invest-autosum-row--total strong {
  color: #12352e;
  font-size: 0.92rem;
  font-weight: 800;
}

.qhc-invest-split-note {
  margin: 4px 0 0;
}

.qhc-money-nowrap {
  box-sizing: border-box;
  display: inline-block;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: right;
  text-overflow: clip;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.qhc-invest-add:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.qhc-invest-empty {
  color: var(--muted, #64716b);
  font-size: 0.78rem;
  margin: 8px 0 0;
}

.qhc-invest-list {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 10px 0 0;
  min-width: 0;
  padding: 0;
}

.qhc-invest-line {
  align-items: center;
  border: 1px solid var(--qhc-divider);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  padding: 8px 10px;
}

.qhc-invest-line-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.qhc-invest-line-name {
  color: #17211d;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.qhc-invest-line-amount {
  color: #17211d;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.qhc-invest-line-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.qhc-invest-action {
  background: transparent;
  border: 1px solid rgba(100, 113, 107, 0.28);
  border-radius: 6px;
  color: var(--muted, #64716b);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  min-height: 28px;
  padding: 2px 8px;
}

/* Compact Tertiary Danger — light text/border; never solid red (qhc-button-hierarchy-batch-001). */
.qhc-invest-action--danger {
  background: transparent;
  border-color: rgba(185, 28, 28, 0.26);
  box-shadow: none;
  color: #c24141;
}

.qhc-invest-action--danger:hover,
.qhc-invest-action--danger:focus-visible {
  background: rgba(185, 28, 28, 0.05);
  border-color: rgba(185, 28, 28, 0.4);
  color: #b91c1c;
}

.qhc-invest-action--danger:active {
  background: rgba(185, 28, 28, 0.08);
}

/* People | Area under investment panel: shared .smp-resource-* (businessResourceFields.css).
   Top divider separates capital entry from 经营资料.
   UI-QHC-MOBILE-PEOPLE-AREA-50-001: mobile keeps 人员资料｜场地资料 at 50%｜50%
   (overrides shared .smp-resource-grid--stack-narrow single-column stack).
   UI-QHC-PEOPLE-AREA-REVIEW-001: nested subgrid so heading / label / input / hint
   share row tracks — left wrap vs right short label no longer misaligns inputs. */
.qhc-module [data-qhc-resource-grid] {
  align-items: stretch;
  border-top: 1px solid var(--qhc-divider);
  grid-template-rows: auto auto auto auto;
  margin-top: 10px;
  padding-top: 10px;
  row-gap: 4px;
}

.qhc-module [data-qhc-resource-grid] > .smp-resource-block {
  display: grid;
  gap: 0;
  grid-row: span 4;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: subgrid;
  min-width: 0;
}

/* Field spans label + input tracks inside the block subgrid. */
.qhc-module [data-qhc-resource-grid] .smp-field {
  display: grid;
  gap: 0;
  grid-row: span 2;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: subgrid;
  min-width: 0;
}

@media (max-width: 699px) {
  .qhc-module [data-qhc-resource-grid].smp-resource-grid--stack-narrow {
    column-gap: 10px;
    gap: 4px 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto auto;
  }

  .qhc-module [data-qhc-resource-grid].smp-resource-grid--stack-narrow .smp-resource-block + .smp-resource-block {
    border-top: none;
    padding-top: 0;
  }
}

.qhc-invest-autosum {
  align-items: baseline;
  background: var(--qhc-card-bg);
  border: 1px solid var(--qhc-card-border);
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: space-between;
  margin-top: 8px;
  min-width: 0;
  padding: 8px 10px;
}

.qhc-invest-autosum span {
  color: var(--muted, #64716b);
  font-size: 0.82rem;
  font-weight: 700;
}

.qhc-invest-autosum strong {
  color: var(--ink, #17211d);
  font-size: 0.95rem;
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Author display rules must not un-hide mode panels */
.qhc-module [hidden] {
  display: none !important;
}

/* Disclosure panels — collapsed = summary row only */
.qhc-disclosure {
  gap: 0;
  padding: 0;
}

.qhc-disclosure:not([open]) {
  gap: 0;
}

.qhc-disclosure:not([open]) > .qhc-disclosure-body {
  display: none;
}

.qhc-disclosure-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 8px 10px;
  justify-content: space-between;
  list-style: none;
  min-height: 44px;
  padding: 8px 10px;
}

.qhc-disclosure-summary::-webkit-details-marker {
  display: none;
}

.qhc-disclosure-title {
  color: var(--ink, #17211d);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  min-width: 0;
}

/* UI-MOBILE-RESULTS-001: title/status/toggle are direct flex children of
   .qhc-disclosure-summary (no wrapping ".qhc-disclosure-end" group) so mobile
   can reorder the collapse button onto row 1 and drop the total onto its own
   full-width row without truncating the amount. */
.qhc-disclosure-status {
  flex: 0 1 auto;
  line-height: 1.2;
  max-width: 100%;
  min-width: 0;
  text-align: right;
}

.qhc-disclosure-status--waiting,
.qhc-disclosure-status--empty[hidden] {
  display: none;
}

.qhc-disclosure-status--empty:not([hidden]) {
  display: none;
}

.qhc-disclosure-status--total {
  align-items: baseline;
  color: #5a6b63;
  display: inline-flex;
  flex-wrap: wrap;
  font-size: 0.78rem;
  font-weight: 600;
  gap: 4px;
  justify-content: flex-end;
  max-width: 100%;
}

.qhc-disclosure-status-label {
  color: #5a6b63;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.qhc-disclosure-amount {
  color: #17352b;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

/* section-expand-collapse-control-visibility-001: QHC panel-level disclosure only.
   Does not enlarge .qhc-result-helper / More details / How this is calculated. */
.qhc-disclosure-toggle {
  align-items: center;
  background: #edf4ef;
  border: 1px solid #b4c8bd;
  border-radius: 999px;
  box-sizing: border-box;
  color: #214f3e;
  display: inline-flex;
  flex: 0 0 auto;
  height: 36px;
  justify-content: center;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  width: 36px;
}

.qhc-disclosure-toggle::before {
  content: "";
  height: 44px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
}

.qhc-disclosure-toggle svg {
  display: block;
  fill: none;
  height: 19px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.75;
  transition: transform 0.16s ease;
  width: 19px;
}

.qhc-disclosure-summary:hover .qhc-disclosure-toggle {
  background: #e0eee6;
  border-color: #9bb5a8;
  box-shadow: 0 0 0 2px rgba(33, 79, 62, 0.08);
}

.qhc-disclosure-summary:focus-visible {
  outline: 2px solid #214f3e;
  outline-offset: 2px;
}

.qhc-disclosure-summary:focus-visible .qhc-disclosure-toggle {
  background: #d8eae0;
  border-color: #7fa093;
  box-shadow: 0 0 0 2px rgba(33, 79, 62, 0.16);
}

.qhc-disclosure-summary:active .qhc-disclosure-toggle {
  background: #d2e6da;
  transform: scale(0.96);
}

.qhc-disclosure[open] > .qhc-disclosure-summary .qhc-disclosure-toggle svg {
  transform: rotate(180deg);
}

.qhc-disclosure-body {
  border-top: 1px solid var(--qhc-divider);
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

/* Results */
.qhc-results {
  background: var(--qhc-results-bg);
  border-color: var(--qhc-results-border);
  display: grid;
  gap: 12px;
  min-width: 0;
}

.qhc-result-region {
  background: var(--qhc-card-bg);
  border: 1px solid var(--qhc-card-border);
  border-left: 3px solid rgba(15, 118, 110, 0.45);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
}

.qhc-region-title {
  background: rgba(15, 118, 110, 0.08);
  border-radius: 4px;
  color: #0f3d36;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin: 0;
  padding: 6px 8px;
}

.qhc-region-profit {
  border-left-color: #15803d;
}

.qhc-region-profit .qhc-region-title {
  background: rgba(21, 128, 61, 0.1);
  color: #14532d;
}

/* QHC main operating-profit P/L: region title + left accent track final status.
   Scoped modifiers only — other result regions / ordinary metric cards unchanged. */
.qhc-region-profit.qhc-region-profit--pl-profit {
  border-left-color: #15803d;
}

.qhc-region-profit.qhc-region-profit--pl-profit .qhc-region-title {
  background: rgba(21, 128, 61, 0.1);
  color: #14532d;
}

.qhc-region-profit.qhc-region-profit--pl-loss {
  border-left-color: #9a3412;
}

.qhc-region-profit.qhc-region-profit--pl-loss .qhc-region-title {
  background: rgba(154, 52, 18, 0.1);
  color: #9a3412;
}

.qhc-region-profit.qhc-region-profit--pl-breakeven {
  border-left-color: #94a3b8;
}

.qhc-region-profit.qhc-region-profit--pl-breakeven .qhc-region-title {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.qhc-region-be-adj {
  border-left-color: #b45309;
}

.qhc-region-be-adj .qhc-region-title {
  background: rgba(180, 83, 9, 0.1);
  color: #9a3412;
}

.qhc-be-adj-explainer {
  color: #3f3f46;
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0 0 10px;
}

.qhc-be-adj-footer {
  color: #57534e;
  font-size: 0.86rem;
  line-height: 1.4;
  margin: 10px 0 0;
}

.qhc-be-adj-status,
.qhc-be-adj-incomplete-lead {
  color: #3f3f46;
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0 0 10px;
}

.qhc-be-adj-missing-list {
  color: #57534e;
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0 0 12px;
  padding-left: 1.25rem;
}

.qhc-be-adj-missing-list li {
  margin: 0 0 4px;
}

.qhc-be-adj-results {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.qhc-be-adj-row {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(180, 83, 9, 0.16);
  border-radius: 6px;
  box-sizing: border-box;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
}

/* Incomplete pending: one naming system — label left, status right. */
.qhc-be-adj-row--pending {
  align-items: center;
  column-gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 44px;
  row-gap: 0;
}

.qhc-be-adj-row--pending .qhc-be-adj-card-title {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.qhc-be-adj-row--pending .qhc-be-adj-result-note,
.qhc-be-adj-row--pending .qhc-be-adj-result--pending {
  justify-self: end;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.qhc-be-adj-card-title {
  color: #57534e;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.qhc-be-adj-result {
  color: #1c1917;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.4;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Tip / lead / secondary lines share daily-card note typography (not amount style). */
.qhc-be-adj-result-note,
.qhc-be-adj-result-secondary {
  color: #57534e;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.qhc-be-adj-result--reason {
  color: #78716c;
  font-weight: 500;
}

.qhc-be-adj-result--pending {
  color: #78716c;
  font-weight: 500;
}

.qhc-region-be-payback {
  border-left-color: #0f766e;
}

.qhc-be-payback-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.qhc-be-side,
.qhc-payback-side {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
}

.qhc-be-period-rows {
  display: grid;
  gap: 0;
  min-width: 0;
}

.qhc-be-period-row {
  align-items: baseline;
  border-bottom: 1px solid rgba(15, 118, 110, 0.1);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
  padding: 6px 0;
}

.qhc-be-period-row:last-child {
  border-bottom: none;
}

.qhc-be-period-label {
  color: #4d6b63;
  flex: 1 1 auto;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  min-width: 0;
}

.qhc-be-period-value {
  color: #0f766e;
  flex: 0 0 auto;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.qhc-be-period-row.qhc-status-waiting .qhc-be-period-value {
  color: #94a3b8;
  font-weight: 600;
}

.qhc-region-efficiency {
  border-left-color: #0f766e;
}

.qhc-efficiency-subtitle {
  color: #4d6b63;
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 0;
}

.qhc-efficiency-fields {
  display: grid;
  gap: 4px;
}

.qhc-efficiency-grid {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.qhc-eff-group {
  align-content: start;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--qhc-card-border);
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-rows: auto 1fr;
  min-width: 0;
  padding: 8px 10px;
}

.qhc-eff-block {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.qhc-eff-title {
  align-content: start;
  display: grid;
  gap: 1px;
  min-width: 0;
}

.qhc-eff-block--secondary-row .qhc-eff-lead {
  color: #4d6b63;
  font-size: 0.76rem;
  font-weight: 600;
}

.qhc-eff-lead {
  color: #0f3d36;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

/* Funds column通俗解释 under professional main title — compact, no extra card. */
.qhc-eff-sub {
  color: #6b857c;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
  overflow-wrap: anywhere;
}

/* Vertical metric rows: name left, amount right — not 9–12 mini-cards. */
.qhc-eff-amounts {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.qhc-eff-amount {
  align-items: baseline;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(15, 118, 110, 0.1);
  border-radius: 0;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
  padding: 6px 0;
}

.qhc-eff-amount:last-child {
  border-bottom: none;
}

.qhc-eff-amount--secondary {
  opacity: 0.94;
}

.qhc-eff-amount--focus {
  background: transparent;
  border-color: transparent;
  border-bottom-color: rgba(15, 118, 110, 0.16);
}

.qhc-eff-amount-label {
  color: #4d6b63;
  flex: 1 1 auto;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
  min-width: 0;
}

.qhc-eff-amount-value {
  color: #12352e;
  flex: 0 0 auto;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.qhc-eff-amount--focus .qhc-eff-amount-label {
  color: #0f3d36;
  font-weight: 700;
}

.qhc-eff-amount--focus .qhc-eff-amount-value {
  font-size: 0.96rem;
  font-weight: 800;
}

.qhc-eff-amount--secondary .qhc-eff-amount-value {
  font-size: 0.82rem;
  font-weight: 650;
}

.qhc-eff-amount.qhc-status-profit .qhc-eff-amount-value {
  color: #15803d;
}

.qhc-eff-amount.qhc-status-loss .qhc-eff-amount-value {
  color: #9a3412;
}

.qhc-eff-amount.qhc-status-waiting .qhc-eff-amount-value {
  color: #64748b;
  font-weight: 600;
}

.qhc-metrics {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

/* Operating profit: primary full-width; supporting start 2-col (mobile overrides
   make 年营业额 + 年毛利润 full-width rows before the remaining 2-col pair). */
.qhc-metrics-profit {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qhc-metrics-profit > .qhc-metric-primary {
  grid-column: 1 / -1;
}

.qhc-metric {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--qhc-card-border);
  border-radius: 6px;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 8px;
}

.qhc-metric-name,
.qhc-metric span.qhc-metric-name,
.qhc-be-outcome .qhc-metric-name,
.qhc-payback-block .qhc-metric-name,
.qhc-payback-side .qhc-metric-name {
  color: #4d6b63;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  /* Allow intentional two-line EN labels (e.g. operating expenses + including labour). */
  white-space: pre-line;
}

.qhc-region-title,
.qhc-eff-lead,
.qhc-eff-sub,
.qhc-eff-title,
.qhc-detail-table-caption,
.qhc-detail-table th,
.qhc-be-period-label,
.qhc-payback-side .qhc-region-guide--prompt,
.qhc-payback-phrase {
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.qhc-metric-value,
.qhc-metric strong.qhc-metric-value,
.qhc-be-outcome .qhc-metric-value,
.qhc-payback-block .qhc-metric-value,
.qhc-payback-side .qhc-metric-value {
  color: #17211d;
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
}

.qhc-metric-note,
.qhc-be-outcome .qhc-metric-note,
.qhc-payback-block .qhc-metric-note,
.qhc-payback-side .qhc-metric-note {
  color: #7a9088;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 2px 0 0;
}

.qhc-metric.qhc-metric-primary {
  background: linear-gradient(180deg, rgba(21, 128, 61, 0.1) 0%, rgba(21, 128, 61, 0.04) 100%);
  border-color: rgba(21, 128, 61, 0.28);
  padding: 10px 12px;
}

.qhc-metric.qhc-metric-primary .qhc-metric-value {
  font-size: 1.2rem;
}

/* Primary operating-profit metric: name + amount (+ card tint) share final P/L status.
   Limited to .qhc-metrics-profit > .qhc-metric-primary so ordinary cards stay neutral. */
.qhc-metrics-profit > .qhc-metric-primary.qhc-status-profit {
  background: linear-gradient(180deg, rgba(21, 128, 61, 0.1) 0%, rgba(21, 128, 61, 0.04) 100%);
  border-color: rgba(21, 128, 61, 0.28);
}

.qhc-metrics-profit > .qhc-metric-primary.qhc-status-profit .qhc-metric-name {
  color: #166534;
}

.qhc-metrics-profit > .qhc-metric-primary.qhc-status-loss {
  background: linear-gradient(180deg, rgba(154, 52, 18, 0.1) 0%, rgba(154, 52, 18, 0.04) 100%);
  border-color: rgba(154, 52, 18, 0.28);
}

.qhc-metrics-profit > .qhc-metric-primary.qhc-status-loss .qhc-metric-name {
  color: #9a3412;
}

.qhc-metrics-profit > .qhc-metric-primary.qhc-status-breakeven {
  background: linear-gradient(180deg, rgba(100, 116, 139, 0.12) 0%, rgba(100, 116, 139, 0.04) 100%);
  border-color: rgba(100, 116, 139, 0.28);
}

.qhc-metrics-profit > .qhc-metric-primary.qhc-status-breakeven .qhc-metric-name,
.qhc-metrics-profit > .qhc-metric-primary.qhc-status-breakeven .qhc-metric-value {
  color: #64748b;
}

.qhc-status-profit .qhc-metric-value,
.qhc-metric.qhc-status-profit .qhc-metric-value {
  color: #166534;
}

.qhc-status-loss .qhc-metric-value,
.qhc-metric.qhc-status-loss .qhc-metric-value {
  color: #9a3412;
}

.qhc-status-amber .qhc-metric-value,
.qhc-status-long .qhc-metric-value,
.qhc-metric.qhc-status-amber .qhc-metric-value {
  color: #b45309;
}

.qhc-status-breakeven .qhc-metric-value,
.qhc-metric.qhc-status-breakeven .qhc-metric-value {
  color: #0f766e;
}

.qhc-status-waiting .qhc-metric-value,
.qhc-metric.qhc-status-waiting .qhc-metric-value,
.qhc-status-waiting .qhc-metric-name {
  color: #94a3b8;
}

.qhc-status-equal .qhc-metric-value {
  color: #0f766e;
}

.qhc-be-outcome {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-top: 1px solid rgba(15, 118, 110, 0.1);
  display: grid;
  gap: 2px;
  margin-top: 2px;
  padding: 8px 0 0;
}

.qhc-be-outcome.qhc-status-above .qhc-metric-value {
  color: #15803d;
}

.qhc-be-outcome.qhc-status-below .qhc-metric-value {
  color: #9a3412;
}

.qhc-be-outcome.qhc-status-equal .qhc-metric-value {
  color: #0f766e;
}

.qhc-payback-block {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 0;
}

.qhc-payback-title {
  color: #4d6b63;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.qhc-payback-phrase {
  font-size: 1.22rem !important;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.35;
  min-width: 0;
}

/*
 * Payback duration phrase ("About 2 years…") must wrap inside the card.
 * Do not inherit mobile money nowrap / right-align used for numeric amounts.
 */
.qhc-payback-phrase,
.qhc-payback-block .qhc-metric-value.qhc-payback-phrase,
.qhc-payback-side .qhc-metric-value.qhc-payback-phrase {
  display: block;
  height: auto;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  overflow-wrap: break-word;
  text-align: left;
  text-overflow: clip;
  white-space: normal;
  width: 100%;
  word-break: normal;
}

/* Empty / prompt payback copy must wrap inside the card (not inherit money nowrap). */
.qhc-payback-side.qhc-status-waiting .qhc-payback-phrase,
.qhc-payback-side .qhc-region-guide--prompt {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
  text-align: left;
  white-space: normal;
  width: auto;
}

.qhc-payback-lines {
  display: grid;
  gap: 4px;
  margin: 2px 0 0;
  min-width: 0;
}

.qhc-payback-line {
  color: #4d6b63;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
}

.qhc-payback-line-label {
  color: #4d6b63;
  font-weight: 600;
}

.qhc-payback-line-value {
  color: #64748b;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.qhc-payback-principal-line {
  color: #3d5a52;
}

/*
 * Principal line keeps label + amount on one line (desktop).
 * .qhc-money-nowrap / .smp-money are inline-block with overflow ≠ visible,
 * so their used baseline becomes the bottom margin edge and the amount
 * sits above the Chinese/Latin label. Restore text baseline for this inline pair.
 */
.qhc-payback-principal-line > .qhc-money-nowrap {
  overflow: visible;
  vertical-align: baseline;
}

.qhc-payback-scope-note,
.qhc-payback-principal-helper {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 4px 0 0;
  max-width: 42rem;
}

.qhc-detail-table-wrap {
  background: transparent;
  border: 1px solid var(--qhc-divider);
  border-radius: 6px;
  margin: 0;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.qhc-detail-waiting {
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed var(--qhc-divider);
  border-radius: 6px;
  color: var(--muted, #64716b);
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 0;
  padding: 12px 10px;
}

.qhc-region-guide {
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
  pointer-events: none;
}

/* Empty tips sit in existing card blank bottoms — not extra flow rows.
 * Risk Reminders empty tip stays in normal flow (see override below). */
.qhc-region--empty,
.qhc-eff-group--empty {
  position: relative;
}

.qhc-region--empty > .qhc-region-guide,
.qhc-eff-group--empty > .qhc-region-guide {
  bottom: 8px;
  left: 10px;
  position: absolute;
  right: 10px;
  z-index: 1;
}

.qhc-region-guide--prompt {
  margin-top: 2px;
  pointer-events: auto;
  position: static;
}

.qhc-region--empty .qhc-metric-value,
.qhc-detail-table-wrap--empty td,
.qhc-eff-group--empty .qhc-eff-amount-value {
  color: #94a3b8;
  font-weight: 500;
}

.qhc-eff-group--empty {
  opacity: 0.92;
  padding-bottom: 26px;
}

.qhc-region--empty {
  padding-bottom: 26px;
}

.qhc-payback-helper-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: baseline;
}

.qhc-payback-helper-row .qhc-payback-line-label {
  font-size: 0.8rem;
}

.qhc-payback-helper-row .qhc-payback-line-value {
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

/*
 * mobile-three-layout-breakages-fix-001:
 * Empty Risk Reminders only has title + guide. Absolute bottom overlay
 * vertically overlaps the title on narrow cards. Keep region／efficiency
 * empty tips absolute (they sit in spare card space); risks tip stays in flow.
 */
.qhc-risks--empty {
  display: grid;
  gap: 4px;
  margin-bottom: 0.35rem;
  min-height: 0;
  padding-bottom: 0;
}

.qhc-risks--empty > .qhc-region-guide {
  bottom: auto;
  left: auto;
  margin-top: 0;
  position: static;
  right: auto;
  z-index: auto;
}

.qhc-detail-table {
  border-collapse: collapse;
  font-size: 0.78rem;
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.qhc-detail-table th,
.qhc-detail-table td {
  border-bottom: 1px solid rgba(15, 118, 110, 0.12);
  border-right: 1px solid rgba(15, 118, 110, 0.1);
  overflow-wrap: anywhere;
  padding: 6px 6px;
  text-align: right;
  vertical-align: top;
  word-break: break-word;
}

.qhc-detail-table th:last-child,
.qhc-detail-table td:last-child {
  border-right: 0;
}

.qhc-detail-table tr:last-child th,
.qhc-detail-table tr:last-child td {
  border-bottom: 0;
}

.qhc-fixed-reselect {
  margin-top: 2px;
}

.qhc-fixed-row--reselect {
  background: rgba(180, 35, 24, 0.04);
  border-radius: 6px;
  padding: 8px 6px 6px;
}

.qhc-detail-table thead th {
  background: rgba(15, 118, 110, 0.07);
  color: #4d6b63;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.qhc-detail-table tbody th {
  background: rgba(15, 118, 110, 0.04);
  color: #17211d;
  font-weight: 700;
  text-align: left;
}

.qhc-detail-table tbody td {
  color: #17211d;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.qhc-risks,
.qhc-tier-block {
  min-width: 0;
}

.qhc-risks strong,
.qhc-completeness strong,
.qhc-tier-block > strong {
  align-items: center;
  color: var(--muted, #64716b);
  display: inline-flex;
  flex-wrap: wrap;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 4px;
}

.qhc-risks {
  opacity: 0.88;
}

.qhc-risks ul,
.qhc-completeness-list {
  margin: 4px 0 0;
  padding-left: 1.1rem;
}

.qhc-risks li,
.qhc-completeness-list li {
  color: var(--muted, #64716b);
  font-size: 0.76rem;
  line-height: 1.35;
  margin: 0 0 3px;
}

.qhc-completeness--incomplete {
  background: var(--qhc-soft-fill);
  border-radius: 6px;
  padding: 6px 8px;
}

.qhc-pill {
  background: rgba(199, 161, 90, 0.2);
  border-radius: 999px;
  color: var(--gold-strong, #b88735);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
}

.qhc-disclaimer {
  color: #7a9088;
  font-size: 0.72rem;
  margin: 0;
}

/* Actions — two-button footer: Save (primary) | Clear (tertiary danger)
   qhc-button-hierarchy-batch-001: color/border/shadow/state only — no size/layout changes. */
.qhc-toolbar {
  border-top: 1px solid var(--qhc-divider);
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  align-items: stretch;
}

.qhc-toolbar .primary-action,
.qhc-toolbar .secondary-action {
  flex: 1 1 0;
  font-size: 0.86rem;
  justify-content: center;
  min-height: 40px;
  min-width: 0;
  padding: 8px 12px;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}

/* Save — sole solid Primary in QHC toolbar (layout tokens above unchanged). */
.qhc-toolbar .primary-action {
  background: linear-gradient(180deg, #17352b 0%, #10231d 100%);
  border-color: rgba(199, 161, 90, 0.62);
  color: #fffdf8;
  box-shadow: 0 2px 8px rgba(16, 35, 29, 0.22);
}

.qhc-toolbar .primary-action:hover:not(:disabled):not([aria-disabled="true"]),
.qhc-toolbar .primary-action:focus-visible:not(:disabled):not([aria-disabled="true"]) {
  box-shadow: 0 3px 10px rgba(16, 35, 29, 0.3);
}

.qhc-toolbar .primary-action:active:not(:disabled):not([aria-disabled="true"]) {
  box-shadow: 0 1px 4px rgba(16, 35, 29, 0.18);
}

.qhc-toolbar .primary-action:disabled,
.qhc-toolbar .primary-action[aria-disabled="true"] {
  background: #d9dfdc;
  border-color: #c4ccc8;
  box-shadow: none;
  color: #68736e;
}

/* Clear entry — Tertiary Danger: light/transparent, weaker than Save; not solid red. */
.qhc-toolbar .qhc-danger-action {
  background: #ffffff;
  border: 1px solid rgba(185, 28, 28, 0.38);
  box-shadow: none;
  color: #b91c1c;
  font-weight: 600;
}

.qhc-toolbar .qhc-danger-action:hover,
.qhc-toolbar .qhc-danger-action:focus-visible {
  background: rgba(185, 28, 28, 0.06);
  border-color: rgba(185, 28, 28, 0.5);
  box-shadow: none;
}

.qhc-toolbar .qhc-danger-action:active {
  background: rgba(185, 28, 28, 0.1);
  box-shadow: none;
}

.qhc-toolbar .qhc-danger-action:disabled,
.qhc-toolbar .qhc-danger-action[aria-disabled="true"] {
  background: #ffffff;
  border-color: rgba(185, 28, 28, 0.22);
  color: rgba(185, 28, 28, 0.45);
  box-shadow: none;
}

.qhc-message {
  font-size: 0.8rem;
  margin: 8px 0 0;
  min-height: 0;
}

.qhc-message[hidden] {
  display: none;
}

.qhc-message-error {
  color: #9b2c2c;
}

.qhc-confirm {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 28, 26, 0.42);
}

.qhc-confirm-card {
  width: min(100%, 420px);
  background: #fff;
  border: 1px solid rgba(120, 100, 70, 0.22);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(20, 28, 26, 0.18);
  padding: 16px 16px 14px;
}

.qhc-confirm-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2a26;
}

.qhc-confirm-body {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #3a4a44;
}

.qhc-confirm-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.qhc-confirm-actions .secondary-action {
  flex: 1 1 0;
  justify-content: center;
  min-height: 38px;
}

/* QHC clear-confirm only — do not restyle currency confirm (also uses .qhc-confirm).
   Cancel = Secondary neutral; Confirm Clear = solid Danger. Layout flex/min-height unchanged. */
[data-qhc-clear-confirm] .qhc-confirm-actions [data-qhc-action="cancel-clear"] {
  background: var(--surface-soft, #f3eee3);
  border: 1px solid rgba(23, 33, 29, 0.14);
  box-shadow: none;
  color: var(--ink, #17211d);
}

[data-qhc-clear-confirm] .qhc-confirm-actions [data-qhc-action="cancel-clear"]:hover,
[data-qhc-clear-confirm] .qhc-confirm-actions [data-qhc-action="cancel-clear"]:focus-visible {
  background: #ebe4d6;
  border-color: rgba(23, 33, 29, 0.22);
  box-shadow: none;
}

[data-qhc-clear-confirm] .qhc-confirm-actions [data-qhc-action="confirm-clear"] {
  background: #b91c1c;
  border: 1px solid #991b1b;
  box-shadow: 0 1px 3px rgba(127, 29, 29, 0.22);
  color: #fffdf8;
  font-weight: 700;
}

[data-qhc-clear-confirm] .qhc-confirm-actions [data-qhc-action="confirm-clear"]:hover,
[data-qhc-clear-confirm] .qhc-confirm-actions [data-qhc-action="confirm-clear"]:focus-visible {
  background: #991b1b;
  border-color: #7f1d1d;
  box-shadow: 0 2px 6px rgba(127, 29, 29, 0.28);
  color: #fffdf8;
}

[data-qhc-clear-confirm] .qhc-confirm-actions [data-qhc-action="confirm-clear"]:active {
  background: #7f1d1d;
  box-shadow: none;
}

/* Transition intro between QHC card and S01 — not a card; spacing only. */
.qhc-detailed-group {
  border-top: 0;
  margin-top: 32px; /* mobile: ~28–36px after QHC actions */
  min-width: 0;
  padding-top: 0;
}

/*
 * homepage-industry-nav-compact-gap-fix-001
 * + homepage-industry-nav-gap-real-fix-001
 * + homepage-industry-nav-size-matches-eight-001
 * When the fixed industry-card nav sits immediately above 01, it owns the
 * tip-of-card →「详细利润测算」gap (24–32px). QHC's default 32/48px top
 * margin must not stack: grid/block margins here do not reliably collapse,
 * so 28+32≈60px holes appear if this override loses the cascade.
 * Keep this rule in THIS file, after the base margin-top above.
 * !important + .workspace/.detailed-calculator-group beats stale partial CSS.
 */
.homepage-industry-nav + .qhc-detailed-group,
.homepage-industry-nav + .qhc-detailed-group.detailed-calculator-group,
.workspace > .homepage-industry-nav + .qhc-detailed-group.detailed-calculator-group {
  margin-top: 0 !important;
}

.qhc-detailed-header {
  box-sizing: border-box;
  margin: 0 0 14px;
}

/*
 * general-mobile-intro-left-align-to-s01-border-001
 * Mobile/tablet: detailed-calculator title + intro share --smp-module-content-inset
 * (QHC title / Services Colaboradores body text). Must not sit left of S01 panel
 * border. Desktop (≥901) stays flush with panel outer edge.
 */
@media (max-width: 900px) {
  .qhc-detailed-header {
    padding-left: var(--smp-module-content-inset, 10px);
    padding-right: var(--smp-module-content-inset, 10px);
  }
}

/* Local detailed-group title: keep prior look after platform H1 moves to homepage lead. */
.qhc-detailed-header h1,
.qhc-detailed-header h2,
.qhc-detailed-header #detailed-calculator-title {
  color: var(--ink, #17211d);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0 0 4px;
}

.qhc-detailed-header p {
  color: var(--muted, #64716b);
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.45;
  margin: 0;
  max-width: 42rem;
}

@media (min-width: 700px) {
  /* Efficiency: 3 cols from 700 / 900 / 1280 (mobile ≤699 stacks). */
  .qhc-efficiency-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (min-width: 900px) {
  /* Results display: desktop BE|recovery side-by-side from 900 / 1280. */
  .qhc-be-payback-grid {
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qhc-be-adj-results {
    align-items: start;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 901px) {
  .qhc-detailed-group {
    margin-top: 48px; /* desktop: ~40–56px after QHC actions */
  }

  /* homepage-industry-nav-gap-real-fix-001 — re-assert after desktop 48px. */
  .homepage-industry-nav + .qhc-detailed-group,
  .homepage-industry-nav + .qhc-detailed-group.detailed-calculator-group,
  .workspace > .homepage-industry-nav + .qhc-detailed-group.detailed-calculator-group {
    margin-top: 0 !important;
  }

  .qhc-detailed-header {
    margin-bottom: 18px;
  }

  .qhc-detailed-header h1,
  .qhc-detailed-header h2,
  .qhc-detailed-header #detailed-calculator-title {
    font-size: 1.14rem;
  }

  .qhc-panel {
    padding: 12px 14px 14px;
  }

  /* Desktop: three equal-width top cards; stretch heights; content top-aligned. */
  .qhc-row-pair--always {
    align-items: stretch;
    column-gap: 12px;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 12px;
  }

  .qhc-row-pair--always > .qhc-gm-card,
  .qhc-row-pair--always > .qhc-ops-revenue,
  .qhc-row-pair--always > .qhc-ops-trading {
    align-content: start;
    align-self: stretch;
    gap: 6px;
    min-height: 100%;
  }

  /* Desktop: operating-days helper stays ONE line for every language (en/es/pt/zh). */
  .qhc-row-pair--always > .qhc-ops-trading .qhc-trading-summary {
    align-items: baseline;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    white-space: nowrap;
  }

  .qhc-row-pair--always > .qhc-ops-trading .qhc-trading-summary-label,
  .qhc-row-pair--always > .qhc-ops-trading .qhc-trading-summary-body {
    display: inline;
    flex: 0 0 auto;
    max-width: none;
    white-space: nowrap;
  }

  .qhc-row-pair--always > .qhc-gm-card > .qhc-pair-extra {
    margin-top: 0;
  }

  /* Desktop triple-column: identical label metrics on each card title */
  .qhc-row-pair--always > .qhc-gm-card > .qhc-pair-label,
  .qhc-row-pair--always > .qhc-ops-revenue > .qhc-pair-heading,
  .qhc-row-pair--always > .qhc-ops-revenue > .qhc-pair-label,
  .qhc-row-pair--always > .qhc-ops-trading > .qhc-pair-label,
  .qhc-row-pair--always .qhc-period-pair > .qhc-pair-label {
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.25;
    margin: 0;
  }

  .qhc-row-pair--desktop {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  /*
   * Desktop disclosure titles: left title consumes remaining width; status +
   * toggle stay content-sized (unshrinkable) so long en/es/pt titles keep one
   * line when the card is wide enough. Mobile ≤700 keeps its own reflow.
   */
  .qhc-disclosure-heading {
    flex: 1 1 0;
    max-width: none;
    min-width: 0;
  }

  .qhc-disclosure-title {
    max-width: none;
  }

  .qhc-disclosure-status {
    flex: 0 0 auto;
    max-width: none;
    min-width: auto;
  }

  .qhc-disclosure-status--total {
    flex-wrap: nowrap;
  }

  .qhc-disclosure-toggle {
    flex: 0 0 auto;
  }

  .qhc-row-2 {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  }

  .qhc-metrics-profit {
    /* primary full-width + 6 metrics in 3+3 */
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .qhc-metrics-profit > .qhc-metric-primary {
    grid-column: 1 / -1;
  }

  .qhc-metrics-be {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Desktop: name | amount | period on one compact row. */
  .qhc-fixed-row {
    align-items: center;
    gap: 8px 10px;
    grid-template-columns: minmax(5.5rem, 0.85fr) minmax(0, 1.8fr) minmax(88px, 6.5rem);
    padding: 6px 0;
  }

  .qhc-fixed-label {
    align-self: center;
    font-size: 0.88rem;
    line-height: 1.25;
  }

  .qhc-fixed-controls {
    display: contents;
  }

  .qhc-fixed-amount {
    min-width: 0;
  }

  .qhc-fixed-reselect {
    grid-column: 1 / -1;
  }

  .qhc-invest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qhc-invest-entry-row {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.85fr) auto;
  }

  .qhc-toolbar {
    flex-wrap: nowrap;
  }

  .qhc-toolbar .primary-action,
  .qhc-toolbar .secondary-action {
    flex: 1 1 0;
  }

  .qhc-detail-table {
    font-size: 0.82rem;
  }

  .qhc-detail-table th,
  .qhc-detail-table td {
    padding: 7px 8px;
  }
}

@media (max-width: 699px) {
  /* Efficiency groups stack at 390 / 430 (and other ≤699). */
  .qhc-efficiency-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  /* BE|recovery stacks at ≤700 / 430 / 390. */
  .qhc-be-payback-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .qhc-payback-phrase {
    font-size: 1.1rem !important;
  }

  /* Beat mobile money nowrap — payback phrase + empty/prompt must wrap in-card. */
  .qhc-payback-phrase,
  .qhc-payback-block .qhc-metric-value.qhc-payback-phrase,
  .qhc-payback-side .qhc-metric-value.qhc-payback-phrase,
  .qhc-payback-side.qhc-status-waiting .qhc-payback-phrase,
  .qhc-payback-side .qhc-region-guide--prompt {
    display: block;
    height: auto;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
    overflow-wrap: break-word;
    text-align: left;
    text-overflow: clip;
    white-space: normal !important;
    width: 100%;
    word-break: normal;
  }

  .qhc-eff-title {
    min-height: 0;
  }

  /* Keep efficiency metrics as vertical name|amount rows (no mid-number wrap / H-scroll). */
  .qhc-eff-amounts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  /* UI-MOBILE-RESULTS-001: label row above, full-width right-aligned amount row below —
     prevents the flex row from squeezing the label into a character-by-character wrap. */
  .qhc-eff-amount {
    align-items: stretch;
    flex-direction: column;
    gap: 2px;
    justify-content: flex-start;
    padding: 6px 0;
  }

  .qhc-eff-amount-label {
    flex: none;
    overflow-wrap: normal;
    white-space: normal;
    width: 100%;
  }

  .qhc-eff-amount--focus {
    padding: 6px 0;
  }

  .qhc-eff-amount--secondary .qhc-eff-amount-value {
    font-size: 0.8rem;
  }

  .qhc-eff-amount--focus .qhc-eff-amount-value {
    font-size: 0.9rem;
  }

  .qhc-eff-amount-value {
    font-size: 0.84rem;
  }

  /* Metric / BE amounts: keep value nowrap + right-aligned (row layout set below). */
  .qhc-metric-value,
  .qhc-be-period-value,
  .qhc-eff-amount-value,
  .qhc-payback-line-value,
  .qhc-invest-autosum-row strong,
  .qhc-invest-autosum strong {
    display: block;
    flex: none;
    font-variant-numeric: tabular-nums;
    max-width: none;
    overflow: visible;
    overflow-wrap: normal;
    text-align: right;
    white-space: nowrap;
  }

  .qhc-eff-amount-value,
  .qhc-invest-autosum-row strong,
  .qhc-invest-autosum strong {
    width: 100%;
  }

  .qhc-metric-value {
    font-size: 0.95rem;
    justify-self: end;
    width: auto;
  }

  .qhc-metric.qhc-metric-primary .qhc-metric-value {
    font-size: 1.15rem;
  }

  .qhc-be-period-value {
    width: auto;
  }

  /* mobile-long-content-layout-normalization-001: metric cards → full-width label|value rows. */
  .qhc-metrics,
  .qhc-metrics-profit,
  .qhc-metrics-be {
    grid-template-columns: minmax(0, 1fr);
  }

  .qhc-metrics-profit > .qhc-metric-primary,
  .qhc-metrics-profit > .qhc-metric:nth-child(2),
  .qhc-metrics-profit > .qhc-metric:nth-child(3) {
    grid-column: auto;
  }

  .qhc-metric,
  .qhc-be-outcome {
    align-items: start;
    column-gap: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 44px;
    row-gap: 2px;
  }

  .qhc-metric-name,
  .qhc-be-outcome .qhc-metric-name {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .qhc-metric-note,
  .qhc-be-outcome .qhc-metric-note {
    grid-column: 1 / -1;
  }

  /* BE period rows stay horizontal label|value (do not stack). */
  .qhc-be-period-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .qhc-be-period-label {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .qhc-payback-line,
  .qhc-invest-autosum-row,
  .qhc-invest-autosum {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: flex-start;
  }

  .qhc-payback-helper-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .qhc-payback-helper-row .qhc-payback-line-label {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .qhc-payback-helper-row .qhc-payback-line-value {
    justify-self: end;
    width: auto;
  }

  /* Region titles may wrap — never shrink to force one line. */
  .qhc-region-title {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .qhc-money-nowrap {
    display: block;
    max-width: none;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: right;
    text-overflow: clip;
    width: 100%;
  }

  /* Stacked principal amount: keep local overflow scroll for extreme money. */
  .qhc-payback-principal-line > .qhc-money-nowrap {
    overflow-x: auto;
    overflow-y: hidden;
  }

  /* Phone / narrow: Type full-width alone; Amount | Add on next row. */
  .qhc-invest-entry-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .qhc-invest-type-field {
    grid-column: 1 / -1;
  }

  .qhc-invest-amount-field {
    min-width: 0;
  }

  .qhc-invest-add {
    justify-self: end;
    min-height: 40px;
    width: auto;
  }

  .qhc-invest-other-name-field {
    max-width: none;
  }

  .qhc-invest-line {
    grid-template-columns: minmax(0, 1fr);
  }

  .qhc-invest-line-actions {
    justify-content: flex-start;
  }
  /* Cardify the 5-col detail table — no horizontal scroll. */
  .qhc-detail-table,
  .qhc-detail-table thead,
  .qhc-detail-table tbody,
  .qhc-detail-table tr,
  .qhc-detail-table th,
  .qhc-detail-table td {
    display: block;
    width: 100%;
  }

  .qhc-detail-table thead {
    clip: rect(0 0 0 0);
    height: 1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
  }

  .qhc-detail-table tbody tr {
    background: var(--qhc-soft-fill);
    border: 1px solid var(--qhc-divider);
    border-radius: 6px;
    margin: 0 0 8px;
    padding: 8px;
  }

  .qhc-detail-table tbody th {
    border-bottom: 1px solid var(--qhc-divider);
    font-size: 0.8rem;
    margin: 0 0 6px;
    padding: 0 0 6px;
    text-align: left;
  }

  .qhc-detail-table tbody td {
    align-items: baseline;
    border-bottom: 0;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding: 3px 0;
    text-align: right;
  }

  .qhc-detail-table tbody td::before {
    color: var(--muted, #64716b);
    content: attr(data-label);
    flex: 0 1 auto;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: left;
  }

  /* mobile-long-content-layout-normalization-001: single-column metric rows (see ≤700 block). */
  .qhc-metrics-profit {
    grid-template-columns: minmax(0, 1fr);
  }

  .qhc-metrics-profit > .qhc-metric:nth-child(2),
  .qhc-metrics-profit > .qhc-metric:nth-child(3) {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  /* Compress shared pair-label metrics on narrow; keep weight/line-height identical */
  .qhc-row-pair--always .qhc-pair-label,
  .qhc-row-pair--always .qhc-field > span {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.25;
    margin: 0;
  }

  /*
   * Mobile top input (≤900):
   *   Parent row 1: revenue full width (amount | period 63/37)
   *   Parent rows 2–5: Gross Margin | Closed Days — equal 50% / 50%
   *     Nested CSS subgrid so label / input / formula (/ notes) share row tracks —
   *     left and right stay horizontally aligned.
 * Closed Days: input above two-line operating-days formula (full card width).
 * Middle gutter between 毛利率 | 每年不营业天数: column-gap 8px → 4.4px (−45%).
   * Keep revenue | period internal gap at the same 4.4px (do not widen again).
   * Facing padding on GM / Closed Days tightened so formulas get usable width.
   * Desktop (≥901) three equal cards remain unchanged.
   */
  .qhc-row-pair--always {
    align-items: stretch;
    /* This is the green strip between 毛利率 and 每年不营业天数. */
    column-gap: 4.4px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    row-gap: 4px;
  }

  .qhc-row-pair--always > .qhc-gm-card,
  .qhc-row-pair--always > .qhc-ops-revenue,
  .qhc-row-pair--always > .qhc-ops-trading {
    min-width: 0;
  }

  /* Parent row 1: revenue card spans all columns; amount | period at 63 / 37 */
  .qhc-row-pair--always > .qhc-ops-revenue {
    column-gap: 4.4px;
    display: grid;
    grid-column: 1 / -1;
    grid-row: 1;
    grid-template-columns: minmax(0, 63fr) minmax(0, 37fr);
    grid-template-rows: auto auto;
    row-gap: 3px;
  }

  .qhc-row-pair--always > .qhc-ops-revenue > .qhc-period-pair {
    display: contents;
  }

  .qhc-row-pair--always > .qhc-ops-revenue > #qhc-revenue-label {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
  }

  .qhc-row-pair--always > .qhc-ops-revenue > input[name="revenueAmount"] {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }

  .qhc-row-pair--always > .qhc-ops-revenue #qhc-period-label {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
  }

  .qhc-row-pair--always > .qhc-ops-revenue select[name="revenuePeriod"] {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }

  /* Parent rows 2–5 col 1: GM — subgrid shares tracks with Closed Days */
  .qhc-row-pair--always > .qhc-gm-card {
    align-self: stretch;
    display: grid;
    /* Match Closed Days gap (2.4px) so subgrid row tracks stay aligned. */
    gap: 2.4px;
    grid-column: 1;
    grid-row: 2 / span 4;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: subgrid;
    min-width: 0;
    /* Outer 8 / facing 4 — shrink visual middle toward Closed Days; more formula width. */
    padding-inline: 8px 4px;
  }

  .qhc-row-pair--always > .qhc-gm-card > .qhc-pair-label {
    align-self: end;
    grid-row: 1;
    min-height: 0;
    min-width: 0;
  }

  .qhc-row-pair--always > .qhc-gm-card > .qhc-pair-control {
    grid-row: 2;
    min-width: 0;
  }

  .qhc-row-pair--always > .qhc-gm-card > .qhc-pair-extra {
    align-self: start;
    grid-row: 3;
    min-width: 0;
  }

  .qhc-row-pair--always > .qhc-gm-card .qhc-input-affix {
    min-width: 0;
  }

  .qhc-row-pair--always > .qhc-gm-card .qhc-input-affix input {
    min-width: 0;
  }

  /* Parent rows 2–5 col 2: Closed Days — subgrid with GM */
  .qhc-row-pair--always > .qhc-ops-trading {
    align-self: stretch;
    display: grid;
    /* Vertical tracks −40% vs prior 4px (input ↔ operating-days bar). */
    gap: 2.4px;
    grid-column: 2;
    grid-row: 2 / span 4;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: subgrid;
    min-width: 0;
    /* Facing 4 / outer 8 — pair with GM facing padding. */
    padding-inline: 4px 8px;
  }

  .qhc-row-pair--always > .qhc-ops-trading > .qhc-closed-days-row {
    display: contents;
  }

  .qhc-row-pair--always > .qhc-ops-trading > #qhc-closed-days-label {
    align-self: end;
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    min-width: 0;
  }

  .qhc-row-pair--always > .qhc-ops-trading input[name="closedDaysPerYear"] {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    width: 100%;
  }

  /*
   * Mobile ≤900: operating-days helper is ALWAYS two lines for every language
   * (en / zh-CN / zh-TW / es / pt and future locales).
   * Line 1 = localized title; Line 2 = formula.
   * Do not language-branch (Chinese short text used to stay one-line and overflow at 10/100/365).
   * Do not shrink font to fit. Desktop (≥901) stays one line — see min-width:901 block.
   */
  .qhc-row-pair--always > .qhc-ops-trading .qhc-trading-summary {
    align-items: flex-start;
    align-self: start;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.1em;
    grid-column: 1;
    grid-row: 3;
    justify-content: flex-start;
    max-width: 100%;
    min-width: 0;
    padding-inline: 4px 8px;
    text-align: left;
    white-space: normal;
    width: 100%;
  }

  .qhc-row-pair--always > .qhc-ops-trading .qhc-trading-summary-label,
  .qhc-row-pair--always > .qhc-ops-trading .qhc-trading-summary-body {
    display: block;
    flex: 0 0 auto;
    max-width: 100%;
    text-align: left;
    white-space: normal;
  }

  .qhc-row-pair--always > .qhc-ops-trading > .qhc-trading-notes {
    align-content: start;
    align-self: start;
    display: grid;
    gap: 6px;
    grid-column: 1;
    grid-row: 4;
    min-width: 0;
  }

  .qhc-row-pair--always .qhc-pair-label,
  .qhc-row-pair--always .qhc-pair-control,
  .qhc-row-pair--always .qhc-pair-extra {
    align-self: start;
    min-width: 0;
  }

  .qhc-row-pair--always .qhc-gm-card > .qhc-pair-extra {
    overflow-wrap: anywhere;
  }

  /*
   * qhc-fixed-period-mobile-width-001 (≤900 / ≤700 / ≤430):
   * ALL period selects share one fixed width sized for EN “Per month” (+ arrow).
   * Longer selected labels (e.g. One-off Project) stay that width (ellipsis OK).
   * Amount column gets remaining space. Native <option> list still full labels.
   * Desktop (≥900) fee-row uses display:contents + unchanged 6.5rem period track.
   * No grow-when-project-selected rule.
   */
  .qhc-fixed-controls {
    grid-template-columns: minmax(0, 1fr) minmax(7.25rem, 7.875rem);
  }

  .qhc-fixed-period select {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
  }
}

@media (max-width: 480px) {
  /*
   * fixed-expense-mobile-amount-period-ratio-60-40-001
   * Phone-only (≤480): amount | period ≈ 60:40 via 3fr / 2fr.
   * Period floor 118px so Quarterly / Trimestral stay readable; remaining
   * width goes to the amount field. Gap / heights / labels unchanged.
   * Does not touch desktop (≥901 display:contents) or other dual-column grids.
   */
  .qhc-fixed-controls {
    grid-template-columns: minmax(0, 3fr) minmax(118px, 2fr);
  }

  .qhc-fixed-period select {
    /* Prefer full period labels at phone widths; arrow padding stays 30px. */
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
  }

  /*
   * qhc-mobile-period-select-cjk-font-step-down-001
   * + qhc-mobile-all-select-font-match-period-001
   * Phone-only: ALL QHC dropdowns (period, investment type, any future select)
   * share one font step with the period control (0.8125rem). Closed-field text
   * and native option lists clip slightly in every language — not CJK-only.
   * Display-period chips stay one step smaller. Desktop / calc widths unchanged.
   * Inputs remain untouched here (iOS 16px zoom rule lives under ≤430).
   */
  #quick-health-check.qhc-module select,
  #quick-health-check.qhc-module select option {
    font-size: 0.8125rem;
    line-height: 1.2;
  }

  #quick-health-check.qhc-module select {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .qhc-display-period-btn {
    font-size: 0.72rem;
    padding: 7px 3px;
  }

  /*
   * qhc-mobile-fixed-expense-spacing-compact-001
   * Phone-only (≤480), #quick-health-check scoped (not S02/S03 .qhc-module):
   * 1) amount↔period gap locked at 8px; keep 6:4 + minmax(118px,2fr); no height change
   * 2) fixed-row vertical padding 8→6.5 (−18.75%); label↔controls gap stays 6px
   * 3) L1 peer card outer inset → 12px from screen (shell 2 + module border 1 + panel 9)
   *    with safe-area floor; card INTERNAL padding untouched; desktop untouched.
   */
  #quick-health-check .qhc-fixed-controls {
    gap: 8px;
  }

  #quick-health-check .qhc-fixed-row {
    padding-bottom: 6.5px;
    padding-top: 6.5px;
  }

  #quick-health-check .qhc-fixed-row:first-child {
    padding-top: 0;
  }

  #quick-health-check .qhc-fixed-row:last-child {
    padding-bottom: 0;
  }

  /* Higher specificity than ≤430 `.qhc-panel { padding: 8px }` so L/R stay at 12px inset. */
  #quick-health-check.qhc-module > .qhc-panel {
    padding-left: max(9px, calc(env(safe-area-inset-left, 0px) - 3px));
    padding-right: max(9px, calc(env(safe-area-inset-right, 0px) - 3px));
  }

  /*
   * qhc-mobile-content-width-and-profit-result-fix-001 — Part A
   * (baseline: collapse ≤430 card+body stack so disclosure owns one L/R pad)
   *
   * qhc-mobile-fixed-expense-inner-pad-match-margin-001 — Bo FE follow-up:
   * Phone-only (≤480), #quick-health-check full-width disclosure cards
   * (fixed + opening). Target = content ↔ white L1 INNER border (not card↔screen).
   * BEFORE @390: fixed amount/period inset 16/16 vs margin/days outer content
   * inset 8/8 (two-up gm padding-inline 8 4 / days 4 8 — do NOT touch those).
   * AFTER: disclosure card L/R → 8px (match peer outer inset; cut prior 16 by
   * half ≈ Bo “~1/3 of oversized gutter”). summary/body L/R stay 0 so pad is
   * not re-stacked. Freed width → amount|period (keep 6:4, gap 8, heights).
   * Outer L1 screen inset stays ~12px. Desktop unchanged.
   */
  #quick-health-check [data-qhc-disclosure="fixed"].qhc-disclosure.qhc-card,
  #quick-health-check [data-qhc-disclosure="opening"].qhc-disclosure.qhc-card {
    padding-left: 8px;
    padding-right: 8px;
  }

  #quick-health-check [data-qhc-disclosure="fixed"] > .qhc-disclosure-summary,
  #quick-health-check [data-qhc-disclosure="opening"] > .qhc-disclosure-summary {
    padding-left: 0;
    padding-right: 0;
  }

  #quick-health-check [data-qhc-disclosure="fixed"] > .qhc-disclosure-body,
  #quick-health-check [data-qhc-disclosure="opening"] > .qhc-disclosure-body {
    padding-left: 0;
    padding-right: 0;
  }

  #quick-health-check [data-qhc-disclosure="fixed"] .qhc-fixed-controls {
    box-sizing: border-box;
    gap: 8px;
    grid-template-columns: minmax(0, 3fr) minmax(118px, 2fr);
    justify-content: stretch;
    max-width: none;
    width: 100%;
  }

  #quick-health-check [data-qhc-disclosure="fixed"] .qhc-fixed-amount,
  #quick-health-check [data-qhc-disclosure="fixed"] .qhc-fixed-period {
    box-sizing: border-box;
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  #quick-health-check [data-qhc-disclosure="fixed"] .qhc-fixed-amount input,
  #quick-health-check [data-qhc-disclosure="fixed"] .qhc-fixed-period select {
    box-sizing: border-box;
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  /*
   * qhc-mobile-content-width-and-profit-result-fix-001 — Part B
   * Root cause: ≤700 `.qhc-metric { grid-template-columns: 1fr auto }` keeps the
   * primary operating-profit card as label|amount side-by-side. Wide nowrap money
   * squeezes `.qhc-metric-name` (overflow-wrap: anywhere) into per-character wrap.
   * Fix: ≤480 stack ONLY `.qhc-metrics-profit > .qhc-metric-primary` (title /
   * amount / note each full-width row). Other QHC metrics / regions / desktop
   * keep the existing 2-col row layout. No font-size / color / calc changes.
   */
  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary {
    align-items: stretch;
    column-gap: 0;
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: auto; /* override ≤700 min-height:44px; grow with stacked rows */
    overflow: visible;
    row-gap: 4px;
  }

  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary > .qhc-metric-name,
  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary > .qhc-metric-value,
  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary > .qhc-metric-note {
    grid-column: 1 / -1;
    max-width: 100%;
    min-width: 0;
    width: 100%;
    writing-mode: horizontal-tb;
    word-break: normal;
  }

  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary > .qhc-metric-name {
    justify-self: stretch;
    overflow-wrap: break-word;
    white-space: normal;
  }

  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary > .qhc-metric-value {
    justify-self: stretch;
    overflow: visible;
    overflow-wrap: normal;
    text-align: left;
    text-overflow: clip;
    white-space: nowrap;
  }

  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary > .qhc-metric-note {
    justify-self: stretch;
    overflow-wrap: break-word;
    white-space: normal;
  }

  /* Profit-region calculation note (when expanded): full inner width, horizontal. */
  #quick-health-check .qhc-region-profit .qhc-disclaimer {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
    white-space: normal;
    width: 100%;
    writing-mode: horizontal-tb;
    word-break: normal;
  }
}

@media (max-width: 430px) {
  /*
   * qhc-restore-original-closed-days-layout-001:
   * Do NOT stack Gross Margin | Closed Days at ≤430 — keep the ≤900
   * equal 50/50 dual-col layout with subgrid horizontal align
   * (input above two-line operating-days formula).
   *
   * Keep batch-003 Step 1b: People | Operating area stack full width ≤430
   * (plus opening-mode / fixed-period overflow fixes below).
   */
  .qhc-module [data-qhc-resource-grid].smp-resource-grid--stack-narrow {
    column-gap: 0;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .qhc-module [data-qhc-resource-grid].smp-resource-grid--stack-narrow > .smp-resource-block {
    grid-row: auto;
    grid-template-rows: none;
  }

  .qhc-module [data-qhc-resource-grid].smp-resource-grid--stack-narrow .smp-field {
    grid-row: auto;
    grid-template-rows: none;
  }

  .qhc-module [data-qhc-resource-grid].smp-resource-grid--stack-narrow .smp-resource-block + .smp-resource-block {
    border-top: 1px solid var(--qhc-divider, #d7e3da);
    padding-top: 8px;
  }

  /* Opening investment mode: keep dual hit targets, allow label wrap (no truncate). */
  .qhc-choice--opening-mode {
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
  }

  .qhc-choice--opening-mode .qhc-choice-option {
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 6px;
    white-space: normal;
  }

  .qhc-choice--opening-mode .qhc-choice-option > span {
    min-width: 0;
    overflow-wrap: break-word;
    text-align: center;
    white-space: normal;
  }

  /* Fixed-period width: inherit ≤900 “Per month” cap (not prior 9.75rem / 0.95fr). */

  .qhc-panel {
    padding: 8px;
  }

  .qhc-header h1 {
    font-size: 1.08rem;
  }

  .qhc-purpose {
    font-size: 0.86rem;
  }

  .qhc-card {
    padding: 8px;
  }

  .qhc-closed-days-row {
    gap: 6px;
  }

  .qhc-trading-summary {
    font-size: 0.7rem;
    padding: 5px 8px;
    padding-inline: 4px 8px;
  }

  /* ≤430: keep two-line operating-days helper for ALL languages (do not re-force nowrap row). */
  .qhc-row-pair--always > .qhc-ops-trading .qhc-trading-summary {
    align-items: flex-start;
    flex-direction: column;
    white-space: normal;
  }

  .qhc-row-pair--always > .qhc-ops-trading .qhc-trading-summary-label,
  .qhc-row-pair--always > .qhc-ops-trading .qhc-trading-summary-body {
    display: block;
    max-width: 100%;
    white-space: normal;
  }

  /* UI-MOBILE-RESULTS-001: row 1 = title + collapse button; row 2 = total
     label + full-width right-aligned amount (never squeezed/ellipsized). */
  .qhc-disclosure-summary {
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    min-height: 44px;
    padding: 8px;
  }

  .qhc-disclosure-title {
    flex: 1 1 auto;
    font-size: 0.88rem;
    order: 1;
  }

  .qhc-disclosure-toggle {
    height: 36px;
    order: 2;
    width: 36px;
  }

  .qhc-disclosure-status {
    flex: 1 1 100%;
    max-width: 100%;
    order: 3;
  }

  .qhc-disclosure-status--total {
    align-items: flex-end;
    flex-direction: column;
    font-size: 0.74rem;
    gap: 2px;
    width: 100%;
  }

  .qhc-disclosure-status-label {
    font-size: 0.72rem;
  }

  .qhc-disclosure-amount {
    display: block;
    font-size: 0.92rem;
    text-align: right;
    white-space: nowrap;
    width: 100%;
  }

  .qhc-disclosure-toggle svg {
    height: 19px;
    width: 19px;
  }

  .qhc-metrics-profit {
    align-items: stretch;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr);
  }

  .qhc-metrics-profit > .qhc-metric {
    height: auto;
    min-width: 0;
  }

  .qhc-metrics-profit > .qhc-metric:nth-child(2),
  .qhc-metrics-profit > .qhc-metric:nth-child(3) {
    grid-column: auto;
  }

  .qhc-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .qhc-detail-table {
    font-size: 0.7rem;
  }

  .qhc-detail-table th,
  .qhc-detail-table td {
    padding: 5px 3px;
  }

  .qhc-module input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
  .qhc-module select {
    font-size: 16px;
    height: 40px;
    min-height: 40px;
  }

  /*
   * qhc-mobile-all-select-font-match-period-001
   * ≤430 also forces .qhc-module select to 16px (iOS zoom). Re-assert the
   * shared phone dropdown size so period + investment type stay matched.
   */
  #quick-health-check.qhc-module select,
  #quick-health-check.qhc-module select option {
    font-size: 0.8125rem;
    line-height: 1.2;
  }

  #quick-health-check.qhc-module select {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .qhc-choice-option {
    flex: 1 1 0;
    font-size: 0.78rem;
    min-height: 40px;
    padding: 6px 8px;
  }

  .qhc-choice-option--compact {
    flex: 1 1 0;
    min-height: 36px;
  }
}

@media (max-width: 390px) {
  .qhc-metrics-profit {
    align-items: stretch;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr);
  }

  .qhc-metrics-profit > .qhc-metric {
    height: auto;
    min-width: 0;
  }

  .qhc-metrics-profit > .qhc-metric:nth-child(2),
  .qhc-metrics-profit > .qhc-metric:nth-child(3) {
    grid-column: auto;
  }

  /* Other choice groups stay single-row; opening-mode wraps labels via ≤430 rules. */
  .qhc-choice:not(.qhc-choice--opening-mode) {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .qhc-choice-option {
    flex: 1 1 0;
    font-size: 0.74rem;
    gap: 4px;
    padding: 6px 6px;
  }

  .qhc-choice--opening-mode .qhc-choice-option {
    font-size: 0.78rem;
    padding: 8px 6px;
    white-space: normal;
  }

  .qhc-toolbar {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .qhc-toolbar .primary-action,
  .qhc-toolbar .secondary-action {
    flex: 0 0 auto;
    width: 100%;
  }
}

/*
 * qhc-multicurrency-long-amount-responsive-guard-001
 * Scoped to #quick-health-check (General QHC) so restaurant / 01–03 are unaffected.
 *
 * Desktop profit/BE metric cards stay stacked (label above amount) — unchanged.
 * Horizontal money rows (.qhc-eff-amount, .qhc-be-period-row): keep side-by-side
 * when both fit; flex-wrap stacks to label-above / full amount-below when not.
 * Labels never use overflow-wrap:anywhere under a shrinking column (prevents
 * CJK one-character-per-line). Amounts stay nowrap for intrinsic width; soft
 * &lt;wbr&gt; is applied only after layout when the full row still overflows
 * (see applyQhcMoneySoftWrapIfNeeded).
 */
#quick-health-check .qhc-eff-amount,
#quick-health-check .qhc-be-period-row {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  justify-content: space-between;
  min-width: 0;
}

#quick-health-check .qhc-eff-amount-label,
#quick-health-check .qhc-be-period-label {
  flex: 1 1 auto;
  max-width: 100%;
  /* Prefer wrapping the amount rather than crushing the label into a 1-char column. */
  min-width: min(100%, max-content);
  overflow-wrap: break-word;
  word-break: normal;
  writing-mode: horizontal-tb;
}

#quick-health-check .qhc-eff-amount-value,
#quick-health-check .qhc-be-period-value,
#quick-health-check .qhc-metric--money-pair > .qhc-metric-value,
#quick-health-check .qhc-be-outcome .qhc-metric-value {
  /* flex-shrink: 0 so the whole amount moves to the next line instead of
     compressing mid-number; margin-inline-start keeps right alignment.
     min-width:min(100%,max-content) forces a full-row wrap when the amount
     cannot share the label row — then flex-grow fills that row. */
  flex: 1 0 auto;
  margin-inline-start: auto;
  max-width: 100%;
  min-width: min(100%, max-content);
  overflow-wrap: normal;
  text-align: right;
  white-space: normal;
  width: auto;
}

#quick-health-check .qhc-money-nowrap {
  box-sizing: border-box;
  /* Block + 100% so measurement and soft-wrap both use the full value row,
     not a shrink-wrapped inline-block sitting on the right with empty left space. */
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: normal;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: right;
  text-overflow: clip;
  white-space: nowrap;
  width: 100%;
  word-break: normal;
}

#quick-health-check .qhc-money-nowrap.qhc-money-fit-scale {
  /* font-size is set inline to the largest size that still fits one line. */
  max-width: 100%;
  white-space: nowrap;
}

#quick-health-check .qhc-money-nowrap.qhc-money-soft-wrap {
  min-width: 0;
  overflow-x: visible;
  white-space: normal;
  width: 100%;
}

/* Desktop stacked metrics: only stop character-column wrap; keep label-above layout. */
#quick-health-check .qhc-metric > .qhc-metric-name,
#quick-health-check .qhc-be-outcome > .qhc-metric-name {
  overflow-wrap: break-word;
  word-break: normal;
  writing-mode: horizontal-tb;
}

#quick-health-check .qhc-invest-autosum-row {
  flex-wrap: wrap;
}

#quick-health-check .qhc-invest-autosum-row span {
  flex: 1 1 auto;
  max-width: 100%;
  min-width: min(100%, max-content);
  overflow-wrap: break-word;
  word-break: normal;
}

#quick-health-check .qhc-invest-autosum-row strong {
  flex: 0 0 auto;
  margin-inline-start: auto;
  max-width: 100%;
}

/* Mobile: keep existing stacked efficiency rows; reinforce label/amount adaptive
   rules with higher specificity so older "anywhere" / nowrap squeezes do not win. */
@media (max-width: 700px) {
  #quick-health-check .qhc-eff-amount {
    align-items: stretch;
    flex-direction: column;
    gap: 2px;
    justify-content: flex-start;
  }

  #quick-health-check .qhc-eff-amount-label {
    flex: none;
    min-width: 0;
    overflow-wrap: break-word;
    white-space: normal;
    width: 100%;
    word-break: normal;
  }

  #quick-health-check .qhc-eff-amount-value {
    flex: none;
    margin-inline-start: 0;
    max-width: 100%;
    text-align: right;
    white-space: normal;
    width: 100%;
  }

  #quick-health-check .qhc-metric,
  #quick-health-check .qhc-be-outcome,
  #quick-health-check .qhc-be-period-row {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    grid-template-columns: none;
    justify-content: space-between;
  }

  #quick-health-check .qhc-metric-name,
  #quick-health-check .qhc-be-outcome .qhc-metric-name,
  #quick-health-check .qhc-be-period-label {
    flex: 1 1 auto;
    max-width: 100%;
    min-width: min(100%, max-content);
    overflow-wrap: break-word;
    white-space: normal;
    word-break: normal;
  }

  #quick-health-check .qhc-metric-value,
  #quick-health-check .qhc-be-outcome .qhc-metric-value,
  #quick-health-check .qhc-be-period-value {
    flex: 1 0 auto;
    margin-inline-start: auto;
    max-width: 100%;
    min-width: min(100%, max-content);
    overflow: visible;
    overflow-wrap: normal;
    text-align: right;
    white-space: normal;
  }

  #quick-health-check .qhc-money-nowrap {
    box-sizing: border-box;
    display: block;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-wrap: normal;
    text-align: right;
    white-space: nowrap;
    width: 100%;
  }

  #quick-health-check .qhc-money-nowrap.qhc-money-fit-scale {
    white-space: nowrap;
  }

  #quick-health-check .qhc-money-nowrap.qhc-money-soft-wrap {
    min-width: 0;
    overflow-x: visible;
    white-space: normal;
    width: 100%;
  }

  #quick-health-check .qhc-metric-note,
  #quick-health-check .qhc-be-outcome .qhc-metric-note {
    flex: 1 1 100%;
  }

  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary > .qhc-metric-value {
    text-align: right;
    white-space: normal;
  }
}

@media (max-width: 480px) {
  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
  }

  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary > .qhc-metric-name,
  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary > .qhc-metric-value,
  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary > .qhc-metric-note {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary > .qhc-metric-name {
    overflow-wrap: break-word;
    word-break: normal;
  }

  #quick-health-check .qhc-metrics-profit > .qhc-metric-primary > .qhc-metric-value {
    margin-inline-start: 0;
    text-align: right;
    white-space: normal;
  }
}

/*
 * qhc-long-amount-full-row-wrap-correction-001
 * When a money value wraps below its label, claim the full flex line so the
 * amount can stay on one line whenever the card width is enough. Soft wrap
 * (qhc-money-soft-wrap) is reserved for amounts that still overflow that width.
 */
#quick-health-check .qhc-eff-amount > .qhc-eff-amount-value,
#quick-health-check .qhc-be-period-row > .qhc-be-period-value,
#quick-health-check .qhc-metric--money-pair > .qhc-metric-value,
#quick-health-check .qhc-be-outcome > .qhc-metric-value {
  box-sizing: border-box;
  flex-grow: 1;
  flex-shrink: 0;
  flex-basis: auto;
}

/* Kill inherited overflow-wrap:anywhere on money hosts (base .qhc-metric-value). */
#quick-health-check .qhc-metric-value,
#quick-health-check .qhc-be-outcome .qhc-metric-value,
#quick-health-check .qhc-be-period-value,
#quick-health-check .qhc-eff-amount-value {
  overflow-wrap: normal;
  word-break: normal;
}
