/* Fitness Tracker v3.14.2: real mobile form reflow + evergreen theme. */
:root{--fd-positive:#168568!important;--fd-positive-soft:#E4F7EC!important;--fd-focus:0 0 0 3px rgba(22,133,104,.19)!important;--brand-glow:rgba(22,133,104,.16)!important}
html[data-theme="dark"]{--fd-positive:#6CE0B5!important;--fd-positive-soft:#1B4937!important;--fd-focus:0 0 0 3px rgba(108,224,181,.22)!important;--brand-glow:rgba(108,224,181,.17)!important}
body{background:radial-gradient(circle at 14% 0%,rgba(88,166,115,.09),transparent 440px),radial-gradient(circle at 100% 16%,rgba(154,214,169,.08),transparent 420px),var(--bg)!important}
/* Keep primary CTA, floating quick-entry and dock strongly green. */
.primary-btn,.home-primary-cta,body[data-page="/mobile-train"] .mobile-live-save{background:var(--brand)!important;border-color:var(--brand)!important;color:#fff!important}
.primary-btn:hover,.home-primary-cta:hover{background:var(--brand-deep)!important;border-color:var(--brand-deep)!important}
.bottom-nav.bottom-nav-v3 .bottom-nav-add b,body .mobile-live-entry,body[data-page="/mobile-train"] .mobile-live-dock a.main b{background:#168568!important;border-color:#168568!important;color:#fff!important}
html[data-theme="dark"] .bottom-nav.bottom-nav-v3 .bottom-nav-add b,html[data-theme="dark"] body .mobile-live-entry,html[data-theme="dark"] body[data-page="/mobile-train"] .mobile-live-dock a.main b{background:#39B98F!important;border-color:#39B98F!important;color:#10261F!important}
/* Correct awkward narrow panel introduced by a grid child left in column 3 when opened. */
body[data-page="/templates"] .plan-item-row{min-width:0!important;grid-auto-columns:minmax(0,1fr)!important;overflow:visible!important}
body[data-page="/templates"] .plan-item-row > .template-item-edit,
body[data-page="/templates"] .plan-item-row > .progression-panel{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
body[data-page="/templates"] .plan-item-row > .template-item-edit[open] {grid-column:1 / -1!important;display:block!important;width:100%!important;justify-self:stretch!important;}
body[data-page="/templates"] .plan-item-row > .template-item-edit[open] > summary{display:flex!important;align-items:center!important;justify-content:flex-start!important;min-height:38px!important;padding:8px 12px!important;width:100%!important;text-align:left!important;background:var(--brand-soft)!important;color:var(--brand-deep)!important}
body[data-page="/templates"] .plan-item-row > .template-item-edit[open] .template-item-edit-form {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;min-width:0!important;width:100%!important;box-sizing:border-box!important;padding:12px 0 0!important}
body[data-page="/templates"] .plan-item-row .template-item-edit-form label{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;font-size:13px!important;line-height:1.4!important;overflow-wrap:anywhere!important}
body[data-page="/templates"] .plan-item-row .template-item-edit-form label.wide {grid-column:1 / -1!important}
body[data-page="/templates"] .plan-item-row .template-item-edit-form input,
body[data-page="/templates"] .plan-item-row .template-item-edit-form select {display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important;font-size:16px!important;min-height:43px!important;padding:8px 10px!important}
body[data-page="/templates"] .plan-item-row .template-item-edit-form button[type=submit]{grid-column:1 / -1!important;min-height:44px!important;width:100%!important}
body[data-page="/templates"] .plan-item-row > .progression-panel {grid-column:1 / -1!important;width:100%!important;justify-self:stretch!important;min-width:0!important}
body[data-page="/templates"] .plan-item-row .progression-panel > summary{overflow-wrap:anywhere!important}
body[data-page="/templates"] .plan-item-row .progression-panel .rule-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;width:100%!important;min-width:0!important}
body[data-page="/templates"] .plan-item-row .progression-panel .rule-grid label{min-width:0!important;overflow-wrap:anywhere!important}
body[data-page="/templates"] .plan-item-row .progression-panel .rule-grid label[hidden]{display:none!important}
body[data-page="/templates"] .plan-item-row .progression-panel .rule-grid input,body[data-page="/templates"] .plan-item-row .progression-panel .rule-grid select{width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important;font-size:16px!important;min-height:43px!important}
body[data-page="/templates"] .plan-item-row .progression-panel .rule-hint,body[data-page="/templates"] .plan-item-row .progression-panel .rule-grid button[type=submit]{grid-column:1 / -1!important;width:100%!important}
@media(max-width:760px){
 body[data-page="/templates"] .plan-item-row{grid-template-columns:30px 42px minmax(0,1fr) 36px!important;column-gap:8px!important;row-gap:8px!important;padding:11px!important;align-items:start!important}
 body[data-page="/templates"] .plan-item-row > .plan-order-badge{grid-area:1 / 1!important}
 body[data-page="/templates"] .plan-item-row > .mini-icon{grid-area:1 / 2!important}
 body[data-page="/templates"] .plan-item-row > .template-item-main{grid-area:1 / 3 / 2 / 5!important}
 body[data-page="/templates"] .plan-item-row > .plan-item-order-actions{grid-area:2 / 1 / 3 / 3!important}
 body[data-page="/templates"] .plan-item-row > .template-item-edit:not([open]){grid-area:2 / 3 / 3 / 4!important}
 body[data-page="/templates"] .plan-item-row > .template-item-edit[open]{grid-area:3 / 1 / 4 / -1!important;border:1px solid var(--line)!important;background:var(--card)!important;border-radius:14px!important;padding:11px!important;margin:0!important;min-width:0!important}
 body[data-page="/templates"] .plan-item-row > form:last-child{grid-area:2 / 4 / 3 / 5!important}
 body[data-page="/templates"] .plan-item-row > .progression-panel{grid-area:4 / 1 / 5 / -1!important;margin-top:0!important}
 body[data-page="/templates"] .plan-item-row > .template-item-edit:not([open]) > summary{display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important;height:38px!important;min-height:38px!important;padding:7px!important;box-sizing:border-box!important}
 body[data-page="/templates"] .plan-item-row .plan-item-order-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body[data-page="/templates"] .plan-item-row .plan-move-btn{height:38px!important;min-height:38px!important;width:100%!important}
 body[data-page="/templates"] .plan-item-row > form:last-child .icon-btn{height:38px!important;min-height:38px!important;width:36px!important;min-width:36px!important}
}
@media(max-width:360px){
 body[data-page="/templates"] .plan-item-row{grid-template-columns:26px 38px minmax(0,1fr) 34px!important;column-gap:6px!important;padding:9px!important}
 body[data-page="/templates"] .plan-item-row .template-item-edit-form{gap:8px!important}
 body[data-page="/templates"] .plan-item-row > .template-item-edit[open]{padding:9px!important}
 body[data-page="/templates"] .plan-item-row > form:last-child .icon-btn{width:34px!important;min-width:34px!important}
}
/* Keep start + reduction editor buttons readable on narrow screens. */
@media(max-width:760px){
 body[data-page="/mobile-train"] .drop-stage-head strong{color:var(--text)!important}
 body[data-page="/mobile-train"] .drop-stage-row input{font-size:16px!important}
 body[data-page="/mobile-train"] .drop-stage-add{border-color:var(--brand)!important;color:var(--brand-deep)!important;background:var(--card)!important}
}

/* Fine alignment: extra guidance under sort-order must not vertically center its neighbor. */
body[data-page="/templates"] .plan-item-row > .template-item-edit[open] .template-item-edit-form{align-items:start!important;}
body[data-page="/templates"] .plan-item-row .template-item-edit-form label{align-self:start!important;justify-content:flex-start!important;margin:0!important;}
body[data-page="/templates"] .plan-item-row .template-item-edit-form label small{font-size:11px!important;line-height:1.4!important;color:var(--muted)!important;}
@media(max-width:360px){
 body[data-page="/templates"] .plan-item-row > .template-item-edit[open] .template-item-edit-form{grid-template-columns:minmax(0,1fr)!important;}
 body[data-page="/templates"] .plan-item-row .template-item-edit-form label{grid-column:1/-1!important;}
 body[data-page="/templates"] .plan-item-row .progression-panel .rule-grid{grid-template-columns:minmax(0,1fr)!important;}
}
/* Contrast: dark-mode CTA keeps white on deep green; mint is for outlines and labels. */
html[data-theme="dark"] .primary-btn,
html[data-theme="dark"] .home-primary-cta,
html[data-theme="dark"] body[data-page="/mobile-train"] .mobile-live-save {
  background:#168568!important;border-color:#168568!important;color:#fff!important;
}
