.training-load-calculator-button {
  display: grid; place-items: center; flex: 0 0 44px;
  width: 44px; min-width: 44px; height: 50px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--text);
  box-shadow: none;
}
.training-load-calculator-button svg { width: 22px; height: 22px; }
.training-load-calculator-button:hover { background: var(--panel); }
.load-calculator-dialog {
  box-sizing: border-box; width: min(440px, calc(100% - 24px)); max-width: none;
  max-height: calc(100dvh - 32px); padding: 0; margin: auto;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--panel); color: var(--text); letter-spacing: 0;
  z-index: 10000; overflow: hidden; font-family: inherit;
}
.load-calculator-dialog[open] { display: flex; flex-direction: column; }
.load-calculator-dialog { perspective: 1200px; }
.load-calc-flip { position: relative; width: 100%; min-height: 0; transform-style: preserve-3d; transition: transform .42s cubic-bezier(.22,1,.36,1); }
.load-calc-flip.is-flipped { transform: rotateY(180deg); }
.load-calc-face { display: flex; flex-direction: column; background: var(--panel); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.load-calc-front { max-height: calc(100dvh - 34px); }
.load-calc-back { position: absolute; inset: 0; transform: rotateY(180deg); }
.load-calc-face .load-calc-content { min-height: 0; flex: 1 1 auto; }
.load-calc-back .load-calc-back-head { grid-template-columns: minmax(0,1fr) 44px; }
.load-calc-back .load-calc-help { margin: 0; padding: 0; border: 0; }
.load-calc-back-footer { flex: none; padding: 12px 18px; border-top: 1px solid var(--border); }
.load-calc-back-footer button { width: 100%; min-height: 44px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; }
.load-calc-back-footer button:hover { background: var(--panel-3); }
@media (prefers-reduced-motion: reduce) { .load-calc-flip { transition: none; } }
.load-calculator-dialog::backdrop { background: rgb(0 0 0 / 70%); backdrop-filter: blur(7px); }
.load-calculator-dialog *, .load-calculator-dialog *::before, .load-calculator-dialog *::after { box-sizing: border-box; }
.load-calculator-dialog [hidden] { display: none !important; }
.load-calc-head {
  display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px;
  align-items: center; gap: 2px; padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.load-calc-head h2 { font-size: 17px; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.load-calc-head button {
  width: 44px; height: 44px; min-width: 0; padding: 0; display: grid; place-items: center;
  background: transparent; color: var(--muted); border: 0; box-shadow: none; border-radius: 6px;
}
.load-calc-head button:hover, .load-calc-head button[aria-expanded="true"] { color: var(--text); background: var(--panel-3); }
.load-calc-head svg { width: 20px; height: 20px; }
.load-calc-content { padding: 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--muted) transparent; }
.load-calc-form { display: block; margin: 0; }
.load-calc-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.load-calc-form legend { padding: 0; margin-bottom: 12px; font-size: 14px; font-weight: 700; }
.load-calc-inputs { display: grid; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); gap: 8px; align-items: end; }
.load-calc-field { display: grid; gap: 6px; min-width: 0; margin: 0; }
.load-calc-field span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.load-calc-field input {
  width: 100%; height: 46px; min-width: 0; margin: 0; padding: 8px 12px;
  border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel-2);
  color: var(--text); font: inherit; font-size: 17px; font-variant-numeric: tabular-nums;
  text-align: center; box-shadow: none; caret-color: var(--cyan);
}
.load-calc-field input::placeholder { color: var(--muted); opacity: 1; }
.load-calc-field input[aria-invalid="true"] { border-color: var(--red-strong); }
.load-calc-times, .load-calc-or { display: grid; place-items: center; height: 46px; color: var(--muted); font-size: 14px; }
.load-calc-volume { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin: 12px 0 22px; font-size: 13px; color: var(--muted); }
.load-calc-volume output { color: var(--cyan); font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.load-calc-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.load-calc-modes button { min-height: 44px; min-width: 0; padding: 8px 4px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 13px; box-shadow: none; }
.load-calc-modes button[aria-pressed="true"] { border-bottom-color: var(--red); color: var(--text); }
.load-calc-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; font-variant-numeric: tabular-nums; }
.load-calc-table th, .load-calc-table td { padding: 9px 4px; text-align: right; border: 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.load-calc-table th:first-child { text-align: left; }
.load-calc-table thead th { font-size: 12px; color: var(--muted); font-weight: 400; padding-top: 4px; }
.load-calc-table tbody th { color: var(--muted); font-weight: 400; }
.load-calc-table td:last-child { font-weight: 700; color: var(--text); }
.load-calc-table tr:last-child > * { border-bottom: 0; }
.load-calc-result { display: grid; gap: 8px; margin-top: 20px; padding: 18px 0; border-top: 1px solid var(--border); }
.load-calc-result > span, .load-calc-result small { color: var(--muted); font-size: 12px; }
.load-calc-result output { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.load-calc-status { color: var(--yellow); font-size: 12px; line-height: 1.5; margin: 12px 0 0; }
.load-calc-status:empty { display: none; }
.load-calc-help { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.load-calc-help h3 { font-size: 15px; margin: 0 0 10px; }
.load-calc-help p { font-size: 13px; line-height: 1.6; color: var(--muted); margin: 0 0 12px; }
.load-calc-help a { color: var(--cyan); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.load-calculator-dialog :is(button, input, a):focus-visible, .training-load-calculator-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.load-calculator-dialog ::selection { background: var(--cyan); color: var(--bg); }
@media (max-width: 360px) {
  .load-calc-head { padding-left: 12px; padding-right: 6px; }
  .load-calc-head h2 { font-size: 16px; }
  .load-calc-content { padding: 14px 12px; }
  .load-calc-inputs { gap: 4px; }
}
