.tool-page { padding: 26px 0 48px; }
.tool-shell { max-width: 980px; margin: 0 auto; }
.tool-hero { margin-bottom: 16px; padding: clamp(26px,5vw,44px); background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.tool-hero h1 { margin: 0 0 12px; max-width: none; font-size: clamp(34px,5vw,54px); }
.tool-hero p { max-width: 760px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.68; }
.tool-card { margin-bottom: 16px; padding: clamp(22px,4vw,34px); background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.tool-card h2 { margin: 0 0 16px; font-size: 22px; }
.tool-form { display: grid; gap: 15px; }
.tool-grid-2, .tool-grid-3, .tool-grid-4 { display: grid; gap: 12px; }
.tool-grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.tool-grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.tool-grid-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.tool-field { display: grid; gap: 7px; min-width: 0; }
.tool-field label, .tool-label { color: #455266; font-size: 13px; font-weight: 750; }
.tool-field input, .tool-field select, .tool-field textarea {
  width: 100%; min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--text); background: #fff;
}
.tool-field textarea { min-height: 150px; resize: vertical; font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size: 12px; line-height: 1.5; }
.tool-field input:focus, .tool-field select:focus, .tool-field textarea:focus { border-color: rgba(247,147,26,.68); box-shadow: 0 0 0 3px rgba(247,147,26,.10); }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 3px; }
.tool-note { color: var(--muted); font-size: 12px; line-height: 1.55; }
.tool-warning { padding: 12px 14px; border: 1px solid #f0d6a6; border-radius: 12px; background: #fff8ec; color: #745423; font-size: 12px; line-height: 1.55; }
.tool-result { margin-top: 18px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.tool-result.hidden { display: none; }
.tool-result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); background: #fff; }
.tool-result-head strong { font-size: 14px; }
.tool-result-head span { color: var(--muted); font-size: 11px; }
.tool-result-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.tool-stat { min-width: 0; padding: 14px 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tool-stat:nth-child(2n) { border-right: 0; }
.tool-stat small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.tool-stat strong, .tool-stat code { display: block; color: #263347; font-size: 14px; overflow-wrap: anywhere; }
.tool-stat code { font-size: 12px; }
.tool-stat.full { grid-column: 1 / -1; border-right: 0; }
.tool-status { min-height: 18px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.tool-status.error { color: #9b3427; }
.tool-status.success { color: var(--green); }
.tool-table-wrap { overflow-x: auto; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tool-table th, .tool-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tool-table th { color: var(--muted); font-size: 11px; background: #fff; }
.tool-table tr:last-child td { border-bottom: 0; }
.tool-table code { overflow-wrap: anywhere; }
.tool-positive { color: var(--green); }
.tool-negative { color: #9b3427; }
.qr-output { display: grid; justify-items: center; gap: 14px; padding: 20px; }
.qr-output img { width: min(320px,100%); aspect-ratio: 1; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: #fff; image-rendering: pixelated; }
.qr-uri { width: 100%; padding: 11px 12px; border-radius: 11px; background: #fff; border: 1px solid var(--line); overflow-wrap: anywhere; font: 12px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
.tool-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tool-tab { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; color: #526173; font-weight: 750; }
.tool-tab.active { border-color: rgba(247,147,26,.55); background: var(--accent-soft); color: #9a5d0d; }
.tool-panel.hidden { display: none; }
.tool-list { display: grid; gap: 8px; margin-top: 14px; }
.tool-list-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tool-list-row span { color: var(--muted); font-size: 12px; }
.tool-list-row strong { font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.tools-catalog { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 24px; }
.tool-link-card { display: block; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.tool-link-card:hover { transform: translateY(-2px); border-color: rgba(247,147,26,.42); background: #fff; }
.tool-link-card b { display: block; margin-bottom: 7px; font-size: 16px; }
.tool-link-card span { color: var(--muted); font-size: 13px; line-height: 1.55; }
.tool-link-card .tool-number { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-bottom: 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); font-size: 11px; font-weight: 850; }
.tool-code-box { margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: 12px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.tool-progress { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #edf1f5; }
.tool-progress > span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s ease; }
@media (max-width: 760px) {
  .tool-grid-3, .tool-grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tools-catalog { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tool-grid-2, .tool-grid-3, .tool-grid-4, .tool-result-grid { grid-template-columns: 1fr; }
  .tool-stat { border-right: 0; }
  .tool-stat.full { grid-column: auto; }
  .tool-list-row { grid-template-columns: 1fr; }
  .tool-list-row strong { text-align: left; }
}
