/* Preserve the original service backgrounds, palette, and font families. */
body[class*="theme-"] { padding:16px 20px; }
html[data-color-mode="light"] { color-scheme:light; }
html[data-color-mode="dark"] body[class*="theme-"] {
  color-scheme:dark; --surface:#20231d; --surface-subtle:#292d25;
  --ink:#f0f1e9; --muted:#bdc2b4; --line:#484e40; --line-strong:#7d866e;
  --olive:#c4d2a8; --link:#a8d3ed; --pass:#b9e3b1; --warn:#f0d391; --fail:#ffb2a8;
}
html[data-color-mode="dark"] body:is(.theme-dow,.theme-army) { background:#171a14; }
html[data-color-mode="dark"] body.theme-coast-guard {
  background:linear-gradient(116deg,transparent 0 73%,#0076a8 73% 75.5%,#ffffff 75.5% 77%,#e3523b 77% 84%,transparent 84%),#171a14;
  background-attachment:fixed;
}
html[data-color-mode="dark"] :is(label,#status-text,.share-title,.measure-title) { color:var(--ink); }
html[data-color-mode="dark"] :is(input,select,textarea,.mobile-edit,.measure-box) { background:var(--surface-subtle); color:var(--ink); border-color:var(--line-strong); }
html[data-color-mode="dark"] :is(.pass,.near,.fail) { background:var(--surface-subtle); }
html[data-color-mode="dark"] :is(.subtitle,.site-footer,.footer-note,.muted,.share-status) { color:var(--muted); }
body:is(.theme-navy,.theme-air-force,.theme-marine-corps,.theme-space-force) .app-tools label { color:#f0f4f6; }
.feedback-dialog textarea { background:var(--surface); color:var(--ink); }
h1 { font-size:clamp(1.6rem,3vw,2.45rem); line-height:1.1; }
.top { padding-bottom:10px; }
.top .subtitle { display:none; }
.service-nav { margin-top:10px; }
.app-tools { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-bottom:10px; }
.app-tools label { margin:0; font-size:.8rem; }
.app-tools select { width:auto; min-height:40px; padding:6px; font-size:.85rem; }
.app-tools button { width:auto; min-height:40px; margin:0; padding:8px 14px; }
.body { gap:14px; padding-top:12px; }
.panel { padding:14px; }
.input-panel > .panel-title { margin-bottom:12px; }
.form-grid { gap:10px; }
#unit-help,#sex-wrap .muted { display:none; }
.measure-box { margin:0; padding:8px; }
.measure-box summary { cursor:pointer; color:var(--link); font-size:.85rem; font-weight:700; }
.measure-box:not([open]) > :not(summary) { display:none; }
.result-resources > summary { display:list-item; }
.result-resources:not([open]) > :not(summary) { display:none; }
.value-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-top:10px; }
.kpi { padding:8px; }
.kpi strong { font-variant-numeric:tabular-nums; }
#status-text { font-size:.9rem; line-height:1.35; }
.share-box { margin-top:10px; padding:8px; }
.helpfulness { display:flex; align-items:center; gap:8px; margin-top:10px; font-size:.85rem; flex-wrap:wrap; }
.helpfulness button { width:auto; min-height:40px; padding:7px 12px; margin:0; }
.feedback-dialog { color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:12px; width:min(460px,calc(100% - 24px)); max-height:calc(100dvh - 24px); padding:20px; }
.feedback-dialog::backdrop { background:#0009; }
.feedback-dialog header { display:flex; justify-content:space-between; align-items:center; gap:15px; }
.feedback-dialog h2 { margin:0; }
.feedback-dialog header button { width:auto; min-height:44px; margin:0; }
.feedback-dialog label { margin-top:12px; }
.feedback-dialog textarea { width:100%; min-height:100px; font:inherit; padding:10px; border:1px solid var(--line-strong); border-radius:6px; }
.feedback-dialog p { font-size:.85rem; line-height:1.4; }
.feedback-dialog a { color:var(--link); }
.feedback-dialog :is(input,select) { font-size:16px; }
:focus-visible { outline:3px solid var(--link); outline-offset:3px; }
#feedback-status { min-height:1.4em; }
@media (min-width:981px) { .body { grid-template-columns:minmax(340px,.9fr) minmax(430px,1.1fr); } }
@media (max-width:980px), (max-height:740px) {
  .body { grid-template-columns:1fr; }
  body:not(.result-ready) #result-panel { display:none; }
  body.result-ready .input-panel { display:none; }
  .mobile-edit { display:inline-flex; width:auto; min-height:40px; padding:7px 10px; }
  .desktop-service-nav { display:none; }
  .mobile-service-nav { display:block; margin-top:8px; }
}
@media (max-width:700px) {
  body[class*="theme-"] { padding:8px; }
  h1 { font-size:1.55rem; line-height:1.12; }
  .app-tools { margin-bottom:7px; gap:8px; }
  .top { padding-bottom:7px; }
  .panel { padding:10px; }
  .form-grid { gap:7px; }
  input,select { font-size:16px; min-height:42px; padding:6px 8px; }
  .measure-box { display:block; padding:5px 0; border:0; }
  #waist-help { font-size:.75rem; line-height:1.2; margin:5px 0; }
  .average-preview { padding:5px 8px; margin-top:4px; }
  .value-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .kpi { min-height:56px; font-size:.66rem; letter-spacing:0; }
  .kpi strong { font-size:1.12rem; }
  .share-status { font-size:.74rem; }
  .panel-heading { margin-bottom:6px; }
  .waist-grid { gap:6px; }
  .input-panel > .panel-title { margin-bottom:8px; }
  .footer-note { font-size:.72rem; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; transition:none !important; } }
.result-guidance { margin-top:12px; font-size:.85rem; }
.result-guidance summary { color:var(--link); cursor:pointer; font-weight:700; }
.result-guidance p { line-height:1.4; }
@media (max-width:700px) {
  .share-box .share-title { font-size:.8rem; }
  .share-box .share-status { font-size:.72rem; line-height:1.25; }
  .helpfulness { gap:6px; font-size:.78rem; }
}
@media (max-width:400px) {
  body[class*="theme-"] h1 { font-size:1.3rem; }
  .app-tools label { font-size:.72rem; }
  .panel-heading { gap:6px; }
  .panel-heading .badge { font-size:.65rem; }
  #status-text { font-size:.82rem; }
  .share-box { grid-template-columns:minmax(0,1fr) auto; gap:6px; }
  .share-box button { min-width:100px; padding:10px 8px; }
  .share-title { display:none; }
  .kpi { padding:6px; }
  .kpi strong { font-size:1rem; }
  .helpfulness { flex-wrap:nowrap; }
  .helpfulness button { padding:6px 9px; }
}
@media (max-width:700px) {
  .feedback-dialog { padding:12px; }
  .feedback-dialog label { margin-top:8px; }
  .feedback-dialog textarea { min-height:70px; }
  .feedback-dialog p { font-size:.75rem; margin:8px 0; }
}
/* Review refinements preserve the original fonts and service palette. */
html[data-color-mode] .service-nav a[aria-current="page"] { color:#1c1d18; }
.app-purpose { margin:5px 0 0; font-size:.78rem; color:var(--muted); }
body:is(.theme-navy,.theme-air-force,.theme-marine-corps,.theme-space-force) .app-purpose { color:#f0f4f6; }
.calculate-actions,.result-actions { display:flex; gap:8px; align-items:center; }
.calculate-actions button:first-child { flex:1; }
button.secondary-button { width:auto; min-height:40px; background:var(--surface-subtle); color:var(--link); border-color:var(--line-strong); padding:8px 12px; }
.result-actions { margin:8px 0; }
.result-actions .mobile-edit { margin:0; }
.next-step { font-size:.82rem; line-height:1.3; margin:6px 0; }
.share-details { margin-top:10px; font-size:.82rem; }
.share-details > summary { cursor:pointer; color:var(--link); font-weight:700; }
.developer-links { font-size:.8rem; text-align:left; }
.developer-links > summary { cursor:pointer; }
@media(max-width:700px) {
  .app-purpose { font-size:.7rem; }
  .next-step { font-size:.76rem; }
  .share-details { margin-top:8px; }
}
@media(max-width:400px) {
  .body { padding-top:8px; }
  .form-grid { gap:6px; }
  .app-tools { margin-bottom:4px; }
  .waist-grid:has(#waist-4-wrap:not([hidden])) { grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; }
}
.scope-note { margin:0 0 8px; font-size:.76rem; line-height:1.3; color:var(--muted); }
body.standards-page { padding:0; }
.standards-page main { padding-top:16px; }
.standards-page .app-tools { margin-bottom:12px; }
.standards-page .app-tools label { color:var(--ink); }
.standards-page :is(input,select,textarea) { border:1px solid var(--line-strong); border-radius:6px; padding:8px; font:inherit; }
.standards-page button { border:1px solid var(--accent-dark); border-radius:6px; background:var(--accent); color:#18140a; padding:10px 14px; font-weight:750; cursor:pointer; }
.standards-page .feedback-dialog label { display:block; font-weight:700; margin-bottom:4px; }
.standards-page .feedback-dialog :is(input,select) { width:100%; }
.standards-page .feedback-dialog #feedback-submit { width:100%; margin-top:10px; }
