/* Rating/stage UX only. Deliberately separate from the in-progress avatar kit. */
.weight-card p, .subparameter-row small, .detail-question p,
.stage-manager-heading p, .stage-preview-help, .rating-heading p,
.analysis-inputs .check-label, .eve-guide p { font-size: 14px; line-height: 1.55; color: #5e574e; }
.weight-card h3, .subparameter-row strong { font-size: 15px; line-height: 1.4; }
.weight-detail-toggle, .rating-detail-toggle, .weight-picker small,
.rating-label small, .analysis-inputs > label:first-child { font-size: 14px; line-height: 1.45; }
.weight-picker { grid-template-columns: 43px minmax(0,1fr); }
.weight-picker output { width: 40px; height: 40px; }
.weight-picker input, .subparameter-control input, .analysis-inputs input[type="range"] { min-height: 44px; touch-action: pan-y; }
.subparameter-control { grid-template-columns: minmax(0,1fr) 42px; }
.subparameter-control.has-eve { grid-template-columns: minmax(0,1fr) 48px 64px; }
.subparameter-control output { font-size: 15px; }
.sub-eve-button { min-height: 44px; padding: 5px; border: 1px solid #cbbfa7; border-radius: 12px; background: #eee7d9; color: #645747; font-size: 14px; font-weight: 900; cursor: pointer; }
.sub-eve-button.is-active { color: #614600; background: #ffdf6b; border-color: #bb8800; }
.sub-eve-button:focus-visible, .stage-secondary:focus-visible, .stage-remove:focus-visible { outline: 3px solid #4776e6; outline-offset: 3px; }
.eve-guide { margin: 0 0 16px; padding: 12px 15px; border: 1px solid #dfcda2; border-radius: 15px; background: #fff7dd; }
.eve-guide summary { min-height: 32px; display: list-item; font-size: 14px; font-weight: 800; cursor: pointer; }
.eve-guide p { margin: 10px 0 0; }
.stage-controls { flex-wrap: wrap; align-items: end; }
.stage-controls label { min-width: 110px; font-size: 14px; }
.stage-controls .stage-secondary { min-height: 46px; padding: 9px 13px; border: 1px solid #ef9daf; border-radius: 13px; color: #9a2440; background: #ffe4e9; font-size: 14px; font-weight: 800; }
.stage-controls select.stage-secondary { width: 100%; cursor: pointer; }
.stage-controls .button { gap: 7px; box-shadow: none; }
.stage-controls button img { width: 25px; height: 25px; flex-shrink: 0; }
.stage-remove { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; margin-inline-start: auto; padding: 8px 11px; border-radius: 13px; color: #8a2940; background: #fff0f3; font-size: 14px; text-decoration: none; }
.stage-remove[hidden] { display: none; }
.stage-preview-help { margin: 10px 0 0; }
.age-track { overflow-x: auto; }
.age-segment { min-width: 0; flex-basis: 0; flex-shrink: 1; transition: flex-grow .25s ease; }
.age-segment span { font-size: 14px; }
.age-segment small, .age-timeline-labels { font-size: 14px; }
.stage-preview { min-width: 38px; border: 2px dashed #d95374; color: #9a2440; background: #ffe4e9; animation: stage-grow .35s ease-out, stage-heartbeat 1.5s .35s ease-in-out infinite; }
@keyframes stage-grow { from { opacity: 0; transform: scaleX(.1); } to { opacity: 1; transform: scaleX(1); } }
@keyframes stage-heartbeat { 0%,100% { box-shadow: inset 0 0 0 0 #f6afbf; } 50% { box-shadow: inset 0 0 0 4px #f6afbf; } }
.expanded-rating { box-sizing: border-box; width: min(520px,calc(100% - 20px)); max-height: calc(100dvh - 24px); padding: 24px; overflow-y: auto; border: 2px solid #302a26; border-radius: 24px; background: #fffdf7; box-shadow: 0 16px 60px #0005; text-align: center; }
.expanded-rating::backdrop { background: #241e23a6; }
.expanded-rating[open] { animation: rating-expand .18s ease-out; }
.expanded-rating-context { margin: 0 0 6px; color: #9a2440; font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.expanded-rating h2 { margin: 0; font-size: 24px; overflow-wrap: anywhere; }
.expanded-rating > output { display: block; margin: 12px 0; color: #9a2440; font-size: 44px; font-weight: 900; }
.expanded-rating-slider { display: grid; grid-template-columns: 48px minmax(0,1fr) 48px; align-items: center; gap: 12px; }
.expanded-rating-slider button { min-height: 48px; padding: 0; border: 1px solid #ef9daf; border-radius: 14px; color: #9a2440; background: #ffe4e9; font-size: 28px; cursor: pointer; }
.expanded-rating-slider input { width: 100%; min-width: 0; height: 64px; margin: 0; accent-color: #da3b63; touch-action: none; }
.expanded-rating-scale { display: flex; justify-content: space-between; margin: 0 60px; font-size: 14px; font-weight: 800; }
.expanded-rating > p:not(.expanded-rating-context) { color: #5e574e; font-size: 14px; line-height: 1.5; }
@keyframes rating-expand { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu-options { position: absolute; z-index: 40; inset-inline-end: 0; top: calc(100% + 8px); min-width: 180px; display: grid; padding: 8px; border: 1px solid #ded5c9; border-radius: 16px; background: white; box-shadow: 0 8px 25px #0002; }
.user-menu-options a, .user-menu-options button { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; color: #302a26; background: none; text-align: start; font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
.user-menu-options a:hover, .user-menu-options button:hover { background: #ffe4e9; }
.user-menu-options form { margin: 0; }
@media (max-width: 1100px) {
    .rating-rows { grid-template-columns: minmax(0,1fr); }
    .rating-row { min-width: 0; }
    .weight-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 700px) {
    .subparameter-row, .rating-subpanel .subparameter-row { grid-template-columns: minmax(0,1fr); }
    .stage-controls label { flex: 1 1 100px; }
    .stage-controls [data-add-stage] { flex: 1 1 140px; }
    .stage-remove { width: 100%; margin-inline-start: 0; }
    .stage-preview span { display: none; }
    .age-track .age-segment { flex-basis: 0; flex-shrink: 1; }
    .age-segment small { font-size: 14px; white-space: nowrap; }
    .expanded-rating { padding: 20px 16px; }
    .expanded-rating-slider { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .stage-preview, .expanded-rating[open] { animation: none; }
    .age-segment { transition: none; }
}

.open-rating-stars { position: absolute; inset: 0 44px 0 0; z-index: 5; background: transparent; border: 0; cursor: pointer; }
.relationship-stage-label { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }

.stage-age-editor:not([hidden]) { display:flex; flex-wrap:wrap; align-items:end; gap:8px; }
.stage-age-field > div { display:flex; align-items:center; gap:6px; }
.stage-age-field output { min-width: 2em; text-align:center; }
