/* Каталог инструментов и формы используют существующие темы Мертивы. */
.tools-directory { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.tool-feature { display:flex; flex-direction:column; align-items:flex-start; padding:28px; gap:14px; min-width:0; }
.tool-feature .tool-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:var(--radius); margin-bottom:4px; }
.tool-feature h2 { font-size:22px; line-height:1.3; }
.tool-feature p { color:var(--muted); line-height:1.65; max-width:48ch; margin-bottom:10px; }
.tool-feature .button { margin-top:auto; gap:14px; min-height:44px; }
.tool-feature:hover { border-color:var(--accent); }
.calc-form>p { color:var(--muted); font-size:13px; }
.calc-close { display:grid; place-items:center; border-radius:var(--radius); }
.calc-output { background:var(--paper); padding:22px; border:1px solid var(--line); border-radius:var(--radius); }
.calc-results>div:last-child { border-bottom:0; }
:root[data-theme="dark"] .calc-submit { background:#b94f08; color:#fff; }
@media(max-width:700px) {
  .tools-directory { grid-template-columns:minmax(0,1fr); gap:16px; }
  .tool-feature { padding:22px; }
  .tool-feature h2 { font-size:21px; }
}
#tool-dialog { padding: 0; }
.calculator-dialog { color: var(--ink, #171b20); padding: 28px; }
.calc-header { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.calc-header > div { flex: 1; }
.calc-header h1, .calc-header h2 { margin: 0 0 8px; font-size: 25px; line-height: 1.15; letter-spacing: -.5px; }
.calc-header p { color: var(--muted, #626b74); margin: 0; font-size: 14px; line-height: 1.5; }
.calc-close { border: 1px solid var(--line, #dce0e3); background: transparent; color: inherit; width: 44px; height: 44px; flex: 0 0 auto; font-size: 24px; cursor: pointer; line-height: 1; }
.calc-close:hover { background: var(--paper, #f4f5f5); }
.calc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.calc-field { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 600; }
.calc-field span { line-height: 1.45; }
.calc-field input { min-width: 0; width: 100%; box-sizing: border-box; border: 1px solid var(--line, #dce0e3); border-radius: var(--radius); background: var(--surface, #fff); color: inherit; padding: 12px; font: inherit; font-size: 15px; font-weight: 400; font-variant-numeric: tabular-nums; }
.calc-field input:focus { outline: 2px solid var(--accent, #e96816); outline-offset: 2px; }
.calc-field input[aria-invalid="true"] { border-color: var(--negative, #a72929); }
.calc-error { margin: 16px 0 0; padding: 12px; background: #fff2f0; color: #962727; font-size: 13px; line-height: 1.5; }
.calc-submit { display: inline-flex; gap: 28px; justify-content: space-between; align-items: center; margin-top: 22px; padding: 12px 18px; border: 0; border-radius: var(--radius); background: var(--accent, #e96816); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; min-height: 44px; }
.calc-submit:hover { filter: brightness(.92); }
.calc-close:focus-visible, .calc-submit:focus-visible, .calc-assumptions a:focus-visible { outline: 2px solid var(--accent, #e96816); outline-offset: 3px; }
.calc-output { border-top: 1px solid var(--line, #dce0e3); margin-top: 24px; padding-top: 20px; }
.calc-output h3 { font-size: 15px; margin: 0 0 14px; }
.calc-results { margin: 0; }
.calc-results > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line, #dce0e3); }
.calc-results dt { font-size: 13px; color: var(--muted, #626b74); line-height: 1.4; }
.calc-results dd { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
.calc-results .calc-loss { color: var(--negative, #a72929); }
.calc-assumptions { color: var(--muted, #626b74); font-size: 12px; line-height: 1.6; margin-top: 24px; }
.calc-assumptions p { margin: 0; }
.calc-assumptions a { display: inline-block; margin-top: 10px; color: var(--ink, #171b20); text-underline-offset: 3px; }
.calculator-dialog [hidden] { display: none !important; }
@media (max-width: 560px) {
  .calculator-dialog { padding: 20px; }
  .calc-header { gap: 12px; }
  .calc-header h1, .calc-header h2 { font-size: 22px; }
  .calc-fields { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .calc-submit { width: 100%; }
  .calc-results > div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .calc-results dd { text-align: left; }
}
