.sf-tool { margin-block: 32px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.article .sf-tool h2 { margin-top: 0; }
.sf-tool label { display: block; font-weight: 600; margin-top: 20px; }
.sf-tool textarea, .sf-tool select { width: 100%; min-height: 44px; padding: 10px; border: 1px solid var(--sec); border-radius: 8px; background: var(--bg); color: var(--ink); }
.sf-tool textarea { resize: vertical; }
.sf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.sf-actions button, .sf-entry button { min-height: 44px; }
.sf-tool button:disabled { opacity: .55; cursor: default; }
.sf-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.sf-flag { width: 76px; margin: 0; break-inside: avoid; text-align: center; }
.sf-flag svg { width: 100%; height: auto; }
.sf-flag figcaption { color: var(--ink); font-weight: 700; }
.sf-gap { width: 24px; height: 60px; }
.sf-unknown { padding: 16px; border: 1px dashed var(--ink); }
.sf-result output { white-space: pre-wrap; overflow-wrap: anywhere; }
.sf-chart { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 24px 16px; margin-top: 24px; }
.sf-entry { min-width: 0; padding-block: 12px; border-bottom: 1px solid var(--line); break-inside: avoid; }
.sf-entry svg { width: 120px; height: 82px; margin-bottom: 8px; }
.article .sf-entry p { margin-top: 8px; font-size: 16px; }
.sf-entry button { margin-top: 12px; }
@media print {
  body:has([data-sf-app]:not([hidden])) { background: white; color: black; }
  body:has([data-sf-app]:not([hidden])) > :not(main),
  body:has([data-sf-app]:not([hidden])) main > :not(article),
  body:has([data-sf-app]:not([hidden])) article > :not(.sf-tool),
  .sf-tool:has([data-sf-app]:not([hidden])) > :not([data-sf-app]),
  [data-sf-app]:not([hidden]) > :not(.sf-result) { display: none !important; }
  body:has([data-sf-app]:not([hidden])) .article { width: 100%; margin: 0; }
  .sf-tool { margin: 0; padding: 0; border: 0; background: white; }
  .sf-result { color: black; }
  .sf-result figcaption { color: black; }
  .sf-result svg { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
