/* SuperToolZone Compact Calculator UI v3.1
   Balanced density inspired by established calculator layouts while retaining STZ accessibility. */

:root{
  --stz-compact-control:40px;
  --stz-compact-gap:10px;
}

/* Keep the main calculator useful without oversized cards. */
.stz-advanced-calculator{margin-top:12px!important}
.stz-calc-workspace{grid-template-columns:minmax(0,1.12fr) minmax(300px,.88fr);gap:12px}
.stz-input-panel,.stz-output-panel{padding:14px}
.stz-panel-head{margin-bottom:11px;align-items:center}
.stz-panel-head h3{font-size:1.13rem;margin-top:1px}
.stz-kicker{font-size:.66rem}
.stz-print-link{min-height:36px!important;padding:6px 11px!important;font-size:.82rem}

/* Compact two-column form on wider screens. */
.stz-calc-grid{gap:9px 12px}
.stz-input-panel .stz-calc-grid>label{gap:4px!important;font-size:.82rem!important;line-height:1.25}
.stz-input-panel .stz-calc-grid>label>span{min-height:0!important;line-height:1.25!important}
.stz-input-panel .stz-calc-grid>label>input,
.stz-input-panel .stz-calc-grid>label>select{
  height:var(--stz-compact-control)!important;
  min-height:var(--stz-compact-control)!important;
  padding:0 10px!important;
  border-radius:7px!important;
  font-size:.9rem!important;
}
.stz-calc-actions{margin-top:12px;gap:7px}
.stz-calc-actions button,.stz-utility-bar button,.stz-v2-action{
  min-height:38px!important;padding:7px 12px!important;border-radius:8px!important;font-size:.82rem
}
.stz-calc-actions button:first-child{min-width:120px}

/* Global preferences should not dominate the calculator. */
.stz-global-preferences{padding:10px;border-radius:9px;margin-bottom:0}
.stz-global-preferences-head{margin-bottom:8px}
.stz-global-preferences-head strong{font-size:.86rem}
.stz-global-preferences-head small{font-size:.7rem}
.stz-global-preferences-grid{gap:8px}
.stz-global-preferences-grid label{gap:4px!important;font-size:.76rem!important}
.stz-global-preferences-grid select{height:38px!important;min-height:38px!important;border-radius:7px!important;padding:0 9px!important;font-size:.82rem!important}
.stz-currency-note{font-size:.68rem;line-height:1.35}

/* Compact but readable results. */
.stz-output-panel{top:72px}
.stz-primary-result{padding:13px 14px;border-radius:10px;margin-bottom:5px}
.stz-primary-result span{font-size:.78rem}
.stz-primary-result strong{font-size:clamp(1.7rem,3vw,2.2rem)}
.stz-calc-result{padding:8px 1px;gap:9px}
.stz-calc-result span{font-size:.79rem;line-height:1.3}
.stz-calc-result strong{font-size:.86rem;max-width:165px}
.stz-result-note{font-size:.69rem;margin-top:8px}

/* Analysis and utility controls should stay secondary. */
.stz-analysis{margin-top:12px;padding:12px}
.stz-tabs{gap:5px;padding-bottom:7px;margin-bottom:9px}
.stz-tabs button{padding:6px 9px;font-size:.74rem}
.stz-chart-grid{gap:10px}
.stz-chart-grid article{padding:10px}
.stz-chart-grid h3{font-size:.88rem;margin-bottom:7px}
.stz-chart-grid canvas{min-height:170px}
.stz-steps,.stz-formula{padding:11px;margin-bottom:9px;font-size:.82rem}
.stz-data-table{font-size:.76rem}
.stz-data-table th,.stz-data-table td{padding:7px 9px}
.stz-utility-bar{margin-top:9px;padding:8px;gap:5px}
.stz-utility-bar button{flex:1 1 105px}
.stz-v2-status{margin-bottom:9px;gap:5px}
.stz-v2-badge{padding:4px 7px;font-size:.68rem}
.stz-v2-quick-actions{padding:8px;margin-bottom:9px;gap:5px}
.stz-v2-action{padding:6px 8px!important;font-size:.72rem!important}

/* Reduce outer page bulk around the working interface. */
.stz-tool-main .section>.wrap>.content-card{padding:16px}
.stz-tool-main .content-card>h2{font-size:1.24rem;margin-bottom:6px}
.stz-tool-main .content-card>.small-note{font-size:.78rem;line-height:1.45;margin-top:0}

@container (max-width:760px){
  .stz-calc-workspace{grid-template-columns:1fr}
  .stz-output-panel{order:0}
  .stz-input-panel{order:-1}
  .stz-calc-grid{grid-template-columns:1fr 1fr}
  .stz-chart-grid{grid-template-columns:1fr 1fr}
}

/* Mobile compact rows: readable labels plus useful input width. */
@media(max-width:700px){
  .stz-tool-main .section>.wrap>.content-card{padding:10px}
  .stz-input-panel,.stz-output-panel,.stz-analysis{padding:10px}
  .stz-calc-workspace{gap:9px}
  .stz-panel-head{margin-bottom:9px}
  .stz-panel-head h3{font-size:1rem}
  .stz-calc-grid{display:grid!important;grid-template-columns:1fr!important;gap:6px!important}
  .stz-input-panel .stz-calc-grid>label{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(118px,44%)!important;
    align-items:center!important;
    gap:8px!important;
    min-height:40px;
  }
  .stz-input-panel .stz-calc-grid>label>span{font-size:.75rem!important;line-height:1.2!important}
  .stz-input-panel .stz-calc-grid>label>input,
  .stz-input-panel .stz-calc-grid>label>select{
    height:38px!important;min-height:38px!important;font-size:16px!important;padding:0 8px!important
  }
  .stz-global-preferences-grid{grid-template-columns:1fr!important;gap:5px}
  .stz-global-preferences-grid label{
    display:grid!important;grid-template-columns:minmax(0,1fr) minmax(118px,55%)!important;
    align-items:center!important;gap:8px!important
  }
  .stz-global-preferences-grid label:last-of-type{grid-column:auto!important}
  .stz-global-preferences-head{display:none}
  .stz-currency-note{margin-top:3px}
  .stz-calc-actions{margin-top:9px}
  .stz-calc-actions button{flex:0 1 auto!important;min-width:0!important;padding-inline:13px!important}
  .stz-output-panel{position:static}
  .stz-primary-result{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px}
  .stz-primary-result strong{font-size:1.55rem;text-align:right}
  .stz-calc-result{padding:7px 0}
  .stz-calc-result span{font-size:.75rem}
  .stz-calc-result strong{font-size:.82rem}
  .stz-chart-grid{grid-template-columns:1fr}
  .stz-chart-grid canvas{min-height:150px}
  .stz-v2-quick-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
  .stz-v2-action{min-height:34px!important}
  .stz-utility-bar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
  .stz-utility-bar button{min-width:0!important;font-size:.7rem!important;padding:6px 5px!important}
}

@media(max-width:390px){
  .stz-input-panel .stz-calc-grid>label{grid-template-columns:minmax(0,1fr) minmax(105px,43%)!important}
  .stz-global-preferences-grid label{grid-template-columns:minmax(0,1fr) minmax(110px,53%)!important}
  .stz-v2-quick-actions,.stz-utility-bar{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media print{
  .stz-calc-workspace{grid-template-columns:1fr 1fr!important}
  .stz-input-panel,.stz-output-panel{padding:10px}
}
