/* Legal-penalty tool surface: responsive, locally scrollable ledger, no body clipping. */
.penalties-calculator { min-width:0; max-width:100%; }
.penalties-mode-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:0 0 20px; min-width:0; }
.penalties-mode-tabs [role="tab"] { min-width:0; min-height:48px; border:1px solid var(--line); border-radius:12px; padding:10px 12px; background:#fff; color:var(--ink); font:inherit; font-size:14px; font-weight:750; line-height:1.25; cursor:pointer; }
.penalties-mode-tabs [role="tab"][aria-selected="true"] { border-color:var(--violet); color:#fff; background:var(--violet); box-shadow:0 5px 16px rgba(99,62,229,.16); }
.penalties-mode-tabs [role="tab"]:focus-visible { outline:3px solid rgba(99,62,229,.28); outline-offset:2px; }
.penalties-form { min-width:0; }
.penalties-panel { min-width:0; margin:0 0 20px; padding:18px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.penalties-panel legend { max-width:100%; padding:0 7px; color:var(--ink); font-weight:800; }
.penalties-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; min-width:0; }
.penalties-fields > .field { min-width:0; }
.penalties-calculator :is(input[type="text"],input[type="date"],select) { width:100%; max-width:100%; min-width:0; min-height:46px; box-sizing:border-box; }
.penalties-calculator input[type="date"] { font-variant-numeric:tabular-nums; }
.penalties-calculator [data-contract-field][hidden],
.penalties-calculator [data-mode-panel][hidden],
.penalties-calculator [hidden] { display:none!important; }
.penalties-confirm { display:flex; align-items:flex-start; gap:10px; margin:16px 0 4px; color:var(--ink); line-height:1.5; cursor:pointer; }
.penalties-confirm input { flex:0 0 18px; width:18px; height:18px; margin-top:2px; accent-color:var(--violet); }
.penalties-payment-list { display:grid; gap:10px; margin-top:14px; min-width:0; }
.penalties-payment-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) auto; align-items:end; gap:10px; min-width:0; padding:12px; border:1px solid var(--line); border-radius:12px; background:#faf9ff; }
.penalties-payment-row .field { min-width:0; }
.penalties-payment-row .secondary-button { min-width:0; min-height:44px; padding-inline:12px; }
.penalties-form > .calculate-button { width:100%; }
.penalties-result { min-width:0; max-width:100%; margin-top:24px; padding-top:22px; border-top:1px solid var(--line); }
.penalties-result h2 { margin-top:0; }
.penalties-result-total { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:8px 16px; padding:18px; border:1px solid #d8d1ef; border-radius:14px; background:#f8f5ff; }
.penalties-result-total span { color:var(--muted); font-size:14px; }
.penalties-result-total strong { min-width:0; color:var(--violet); font-size:clamp(24px,4vw,36px); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.penalties-result-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 20px; margin:16px 0; }
.penalties-result-summary > div { display:flex; justify-content:space-between; gap:12px; min-width:0; padding:12px 0; border-bottom:1px solid var(--line); }
.penalties-result-summary dt { min-width:0; color:var(--muted); }
.penalties-result-summary dd { min-width:0; margin:0; font-weight:750; font-variant-numeric:tabular-nums; text-align:right; overflow-wrap:anywhere; }
.penalties-result-note,.penalties-result-warning { line-height:1.6; overflow-wrap:anywhere; }
.penalties-result-warning { margin:12px 0; padding:12px 14px; border:1px solid #e0c581; border-radius:10px; color:#614b16; background:#fff8e9; }
.penalties-export-actions { display:flex; flex-wrap:wrap; gap:10px; margin:16px 0; }
.penalties-table-wrap { width:100%; max-width:100%; min-width:0; overflow-x:auto; overscroll-behavior-inline:contain; border:1px solid var(--line); border-radius:12px; }
.penalties-table-wrap:focus-visible { outline:3px solid rgba(99,62,229,.25); outline-offset:2px; }
.penalties-scroll-hint { margin:8px 12px 0; color:var(--muted); font-size:12px; }
.penalties-table { width:100%; min-width:830px; border-collapse:collapse; font-size:13px; }
.penalties-table th,.penalties-table td { padding:11px 12px; border-bottom:1px solid var(--line); vertical-align:top; text-align:left; }
.penalties-table th { color:var(--muted); font-weight:750; background:#f8f7fb; }
.penalties-table td { font-variant-numeric:tabular-nums; }
.penalties-table td:nth-child(2),.penalties-table td:nth-child(3),.penalties-table td:nth-child(4),.penalties-table td:nth-child(6) { white-space:nowrap; }
.penalties-table td.penalties-formula-cell { min-width:250px; max-width:440px; white-space:normal; line-height:1.5; font-variant-numeric:normal; }
.penalties-method { margin:18px 0; }
.penalties-method summary { cursor:pointer; font-weight:750; }
.penalties-calculator [data-stale="true"] { opacity:.66; }
.penalties-calculator [data-stale="true"]::before { content:"Результат устарел — пересчитайте после изменения формы."; display:block; margin:0 0 12px; padding:10px 12px; border-radius:8px; background:#fff8e9; color:#614b16; }
.penalties-calculator :is([data-penalties-status],.widget-note) { overflow-wrap:anywhere; }
@media (max-width:850px) {
  .penalties-mode-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .penalties-payment-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .penalties-payment-row .secondary-button { justify-self:start; }
}
@media (max-width:560px) {
  .penalties-panel { padding:14px; }
  .penalties-fields { grid-template-columns:minmax(0,1fr); gap:13px; }
  .penalties-result-summary { grid-template-columns:minmax(0,1fr); }
  .penalties-result-summary dt { padding-bottom:0; border-bottom:0; }
  .penalties-result-summary dd { padding-top:0; }
  .penalties-result-summary > div { align-items:baseline; }
  .penalties-export-actions .secondary-button { flex:1 1 150px; }
}
@media (max-width:360px) {
  .penalties-mode-tabs { gap:6px; }
  .penalties-mode-tabs [role="tab"] { padding-inline:7px; font-size:13px; }
  .penalties-payment-row { grid-template-columns:minmax(0,1fr); padding:10px; }
  .penalties-result-total { padding:14px; }
}
