/* "Input → result" tools (templates/_xform.html, static/js/xform.js) */
.xf { display: flex; flex-direction: column; gap: 12px; }
.xf .field { margin: 0; }
.xf-ins { display: grid; gap: 12px; }
.xf-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.xf textarea { width: 100%; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, var(--font); font-size: .9rem; line-height: 1.55; tab-size: 2; }
.xf-opts { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.xf-opt { min-width: 140px; }
.xf-opt input[type=number] { width: 120px; }
.xf-opt input[type=text] { min-width: 180px; }
.xf-check { padding-bottom: 8px; }
.xf-acts { gap: 8px; }
.xf-err { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--bad); font-size: .9rem; }
.xf-note { margin: 0; }
.xf-outbtns { gap: 6px; margin-top: 6px; }
.xf-html:empty { display: none; }
.xf-html { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.xf-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60; margin: 0; padding: 10px 16px;
  border-radius: 999px; background: var(--text); color: var(--surface); box-shadow: 0 6px 20px rgb(0 0 0 / .25); }
/* result building blocks used by the tool scripts */
.xf-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.xf-table th, .xf-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.xf-table th { width: 32%; color: var(--muted); font-weight: 500; }
.xf-table td code, .xf-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.xf-copyrow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.xf-copyrow > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.xf-copyrow small { display: block; color: var(--muted); font-size: .75rem; }
.xf-copyrow:hover { border-color: var(--accent); }
.xf-pre { margin: 0; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); overflow: auto;
  font: .85rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-height: 520px; }
.xf-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.xf-ok { background: var(--ok-soft); color: var(--ok); }
.xf-bad { background: var(--bad-soft); color: var(--bad); }
.xf-warn { background: var(--gold-soft); color: #8a5a00; }
[data-theme="dark"] .xf-warn { color: var(--gold); }
.xf-stat { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.xf-stat div { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.xf-stat b { display: block; font-size: 1.25rem; }
.xf-stat span { font-size: .78rem; color: var(--muted); }
mark.xf-hit { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 1px; }
[data-theme="dark"] mark.xf-hit { background: #6b5500; }
.xf-diff { font: .86rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: auto; max-height: 600px; }
.xf-diff div { display: grid; grid-template-columns: 44px 44px 18px minmax(0, 1fr); white-space: pre-wrap; word-break: break-word; }
.xf-diff i { font-style: normal; color: var(--muted); text-align: right; padding-right: 6px; user-select: none; }
.xf-diff .add { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.xf-diff .del { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.xf-diff ins { text-decoration: none; background: color-mix(in srgb, var(--ok) 35%, transparent); }
.xf-diff del { text-decoration: none; background: color-mix(in srgb, var(--bad) 35%, transparent); }
.xf-swatch { width: 100%; height: 90px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.xf-md { padding: 4px 2px; }
.xf-md img { max-width: 100%; }
.xf-md pre { padding: 10px; background: var(--surface-2); border-radius: var(--radius-sm); overflow: auto; }
.xf-md table { border-collapse: collapse; }
.xf-md th, .xf-md td { border: 1px solid var(--line); padding: 4px 8px; }
.xf-md blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.xf-kao { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.xf-kao .xf-copyrow { justify-content: center; font-size: 1.05rem; background: var(--surface); color: var(--text); cursor: pointer; font-family: inherit; }
.xf-swrow { display: flex; flex-wrap: wrap; gap: 6px; }
.xf-sw { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 66px; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; font: inherit; }
.xf-sw i { width: 100%; height: 44px; border-radius: 8px; border: 1px solid var(--line); }
.xf-sw small { font-size: .7rem; color: var(--muted); }
.xf-tw { display: flex; flex-direction: column; gap: 4px; overflow-x: auto; }
.xf-tw-row { display: grid; grid-template-columns: 70px repeat(11, minmax(40px, 1fr)); gap: 3px; align-items: center; min-width: 560px; }
.xf-tw-row b { font-size: .8rem; font-weight: 500; }
.xf-tw-row button { height: 34px; border: 0; border-radius: 6px; font: 600 .66rem var(--font); cursor: pointer; }
.xf-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 6px 0; }
.xf-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.xf-totp { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.xf-totp > div:first-child { flex: 1; min-width: 220px; }
.xf-totp-code { margin: 0; font: 700 2.6rem/1 ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.xf-totp-qr svg { width: 170px; height: 170px; background: #fff; border-radius: 8px; }
@media (max-width: 720px) { .xf-cols { grid-template-columns: minmax(0, 1fr); } }
