/* Calculator result screen (specs/031-calc-result-priority): the number, the counter and ONE button first,
   the explanation under them. Shared by the seven quota calculators; the pages keep their own inline CSS for
   the rest. Selectors start at .tool-app so they win over the pages' own .panel rules without !important. */

/* Panel: input and batch on the left, result on the right; on a phone input → result → batch (FR-008). */
.tool-app .panel{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
  grid-template-areas:"form res" "batch res" "rest res";grid-template-rows:auto auto 1fr;gap:18px;align-items:start}
.tool-app .panel>*{min-width:0}
.tool-app .panel>.card-form{grid-area:form}
.tool-app .panel>.card-batch{grid-area:batch}
.tool-app .panel>.res--light{grid-area:res}
@media(max-width:760px){
  .tool-app .panel{grid-template-columns:minmax(0,1fr);grid-template-areas:"form" "res" "batch";gap:14px}
}

/* The counter, the gate line and the messages live in the result card, under the rule line. */
.res--light #quotaBox,.res--light .q-in-card{margin:14px 26px 0}
.res--light #quotaBox:empty{display:none}

/* One button row: the main button, and (desktop, gate saved) the QR. */
.res--light .cta-row{display:flex;flex-direction:column;align-items:stretch;gap:16px;margin:18px 26px 0}
.res--light .cta-row .cta-primary{min-width:0;width:auto;margin:0}
.res--light .cta-row .cta-primary.is-saving{opacity:.7;cursor:progress}
.res--light #ctaQr:empty{display:none}
.res--light #ctaQr .q-qr,.res .q-cta .q-qr{flex-direction:row;align-items:center;gap:20px;text-align:left;padding:16px;border:1px solid var(--line,rgba(3,31,24,.12));border-radius:16px;background:#fff}
.res--light #ctaQr .q-qr img,.res .q-cta .q-qr img{width:176px;height:176px;padding:6px;border:0}
.res--light #ctaQr .q-qr span,.res .q-cta .q-qr span{font:500 15px/1.45 var(--font-sans,Inter,system-ui,sans-serif);color:var(--ink,#031f18);max-width:none;text-align:left}
@media(max-width:760px){.res--light #ctaQr{display:none}}

/* PDF and Copy link: actions on the result, visibly quieter than the button. */
.res--light .res-secondary{margin:12px 26px 0}

/* Second block, under the main screen: PDF / Copy link, where the number comes from, other methods, the disclaimer. */
.tool-app .res-more{margin:18px 0 0;padding:26px;display:grid;gap:22px}
.res-more .more-grid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:30px;align-items:start}
.res-more .more-actions{display:flex;flex-direction:column;gap:10px}
.res--light.res-more .res-secondary{margin:0}
.res--light.res-more .share-card{margin:0}
.res--light.res-more .more-origin>h3{margin:0 0 6px;font-family:var(--mono);font-size:11.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--mut);font-weight:600}
.res--light.res-more .source-link,.res--light.res-more .calc-basis,.res--light.res-more .compare-h,.res--light.res-more .compare-grid,.res--light.res-more #warnBox{margin-left:0;margin-right:0}
.res--light.res-more .source-link{margin-top:8px}
.res--light.res-more .compare-h{margin-top:0}
.res--light.res-more #warnBox:empty{display:none}
@media(max-width:760px){.res-more .more-grid{grid-template-columns:1fr;gap:20px}.tool-app .res-more{padding:20px 18px}}

/* Touch targets and no sideways scroll on a phone (FR-017). */
@media(max-width:760px){
  .res--light .cta-row .cta-primary,.res--light .res-secondary .mini{min-height:44px}
  .res--light .cta-row .cta-primary{white-space:normal;line-height:1.25;padding:12px 24px;justify-content:center;text-align:center}
  .res--light #quotaBox .q-btn,.res--light #quotaBox .q-acts button,.res #quotaBox .q-btn,.res #quotaBox .q-acts button{min-height:44px}
  .res .exportrow button{min-height:44px}
  .res--light.res-more .source-link{min-height:44px}
}

/* The old dark result card of moisture and timber weight (family C): the same order inside it. */
.tool-app .panel>.res{grid-area:res;align-self:start}
.tool-app .panel>.card-batch:has(>#quotaList:empty){display:none}
.res #quotaBox{margin:16px 0 0}
.res #quotaBox:empty{display:none}
.res .sws-quota,.res .q-counter,.res .q-cta .q-hint{color:#e6efdd}
.res .q-counter .q-rest,.res .q-note{color:rgba(230,239,221,.78)}
.res .q-last{color:#2fce65}
.res .q-bar{background:rgba(255,255,255,.16)}
.res .q-bar i{background:#2fce65}
.res .q-btn{background:#2fce65;color:#031f18}
.res .q-gateline{background:rgba(255,255,255,.08)}
.res .q-cta .q-qr{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.2)}
.res .q-cta .q-qr span{color:#e6efdd}
.res .q-cta{margin-top:14px}

/* Phone: the three tiles stay in ONE row (the old rule stacked them into 3 rows ≈ 480 px, pushing the button off the first screens). */
@media(max-width:480px){
  .res--light .res-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .res--light .res-metrics .m{padding:10px 8px;min-width:0}
  .res--light .res-metrics .m-l{font-size:10px;overflow-wrap:anywhere;hyphens:auto}
  .res--light .res-metrics .m-v{font-size:15px;overflow-wrap:anywhere}
}
