.tools-heading { max-width: 840px; margin: 36px 0 30px; }
.tools-heading h1 { margin: 12px 0 16px; font-size: clamp(30px, 4.3vw, 48px); }
.tools-deck { font-size: 18px; max-width: 750px; }
.tools-local { display: flex; align-items: flex-start; gap: 8px; margin-top: 18px; font-size: 13px; color: #187044; }
.tools-privacy-icon { flex: 0 0 20px; width: 20px; height: 20px; background: currentColor; mask: url('/assets/icons/shield-check-line.svg') center / contain no-repeat; -webkit-mask: url('/assets/icons/shield-check-line.svg') center / contain no-repeat; }
.tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 34px 0 22px; }
.tool-card { display: flex; flex-direction: column; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 6px 20px #28223808; }
.tool-card:hover { border-color: var(--accent); }
.tool-card strong { margin-top: auto; color: var(--accent-strong); }
.tool-mark { width: 52px; height: 52px; display: grid; place-items: center; font-size: 32px; background: #f1e9ff; color: var(--accent-strong); border-radius: 14px; }
.tools-small { font-size: 12px; line-height: 1.6; margin: 16px 0 32px; max-width: 820px; }
.tools-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0; }
.tools-tabs a { padding: 9px 17px; border: 1px solid var(--line); border-radius: 30px; background: #fff; font-weight: 600; font-size: 14px; }
.tools-tabs a[aria-current] { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
#image-tool [hidden] { display: none !important; }
.tool-upload { display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 12px; padding: 36px 20px; min-height: 285px; border: 2px dashed #c7b7e2; border-radius: 16px; background: #f7f2ff; }
.tool-upload.drag-over, .tool-upload:focus-within { border-color: var(--accent); background: #efe4ff; }
.tool-upload-symbol { font-size: 32px; line-height: 1; color: var(--accent-strong); }
.tool-upload small { color: var(--muted); text-align: center; }
.tool-button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid #d5c8e5; background: #fff; padding: 10px 18px; border-radius: 8px; min-height: 44px; font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; }
.tool-button.primary { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
.tool-button:hover { filter: brightness(.95); }
.tool-button:disabled, .tool-button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.tool-status { min-height: 24px; margin: 12px 0; font-size: 14px; }
.tool-status.is-error { color: #a52336; }
.tool-editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.tool-preview-panel { padding: 22px; min-width: 0; }
.tool-file-bar { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 18px; font-size: 12px; }
.tool-file-bar strong { display: block; overflow-wrap: anywhere; max-width: 330px; }
.tool-text-button { color: var(--accent-strong); text-decoration: underline; min-height: 36px; font-size: 12px; white-space: nowrap; }
.tool-preview-bed { display: flex; align-items: center; justify-content: center; min-height: 250px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: repeating-conic-gradient(#e9e5ee 0% 25%, #f6f4f9 0% 50%) 0 0 / 20px 20px; }
.tool-stage { position: relative; max-width: 100%; width: fit-content; line-height: 0; }
.tool-stage canvas, .tool-stage img { display: block; width: auto; height: auto; max-width: 100%; max-height: 540px; object-fit: contain; }
.tool-stage[data-selectable] { cursor: crosshair; touch-action: none; user-select: none; }
.tool-selection { position: absolute; pointer-events: none; border: 2px dashed #fff; outline: 2px solid var(--accent-strong); background: #7c3aed22; }
.tool-result { padding-top: 18px; font-size: 13px; overflow-wrap: anywhere; }
.tool-result strong { display: block; }
.tool-compare { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 14px; cursor: pointer; }
.tool-controls { padding: 24px; border-left: 1px solid var(--line); background: #fcfaff; min-width: 0; }
.tool-controls fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.tool-controls h2 { font-size: 16px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; margin-bottom: 12px; }
.tool-controls label { display: block; font-size: 13px; font-weight: 600; margin-top: 12px; }
.tool-controls input:not([type="range"]), .tool-controls select { display: block; width: 100%; min-width: 0; min-height: 40px; border: 1px solid #d5cddd; border-radius: 6px; padding: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; margin-top: 5px; }
.tool-controls input[type="color"] { padding: 3px; }
.tool-controls input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 30px; margin: 4px 0 0; }
.tool-controls output { float: right; font-weight: 400; }
.tool-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.tool-help { font-size: 12px; line-height: 1.55; margin: 9px 0 12px; }
.tool-area-fields { margin: 14px 0; }
.tool-area-fields summary { cursor: pointer; font-size: 14px; }
.tool-adjustments { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.tool-adjustments summary { cursor: pointer; font-size: 16px; font-weight: 600; }
.tool-adjustments .tool-text-button { margin-top: 6px; padding-left: 0; }
.tool-adjustments .tool-text-button:disabled { opacity: .45; cursor: default; }
.tool-actions { display: flex; gap: 8px; margin-top: 18px; }
.tool-actions .tool-button { flex: 1; }
.tool-download { width: 100%; margin-top: 18px; gap: 8px; }
.tool-button.primary.tool-download { background: #187044; border-color: #187044; }
.tool-download-icon { flex: 0 0 20px; width: 20px; height: 20px; background: currentColor; mask: url('/assets/icons/download-2-line.svg') center / contain no-repeat; -webkit-mask: url('/assets/icons/download-2-line.svg') center / contain no-repeat; }
.tool-instructions { max-width: 760px; margin: 40px 0; }
.tool-instructions h2 { margin: 28px 0 16px; }
.tool-instructions ol { padding-left: 24px; color: var(--muted); }
.tool-instructions li { padding-left: 6px; margin: 10px 0; }
.tool-instructions details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.tool-instructions summary { cursor: pointer; font-weight: 600; }
.tool-instructions details p { margin-top: 12px; }
.tool-related { margin: 32px 0 44px; }
.tool-related a { display: block; color: var(--accent-strong); margin-top: 12px; text-decoration: underline; }
.tool-notice { background: #fff4da; padding: 18px; margin: 12px 0; }
@media (max-width: 800px) {
  .tools-grid { grid-template-columns: 1fr; }
  .tool-editor { grid-template-columns: 1fr; }
  .tool-controls { border-left: 0; border-top: 1px solid var(--line); padding: 20px; }
  .tool-preview-panel { padding: 16px; }
  .tool-preview-bed { padding: 8px; min-height: 160px; }
  .tool-stage canvas, .tool-stage img { max-height: 420px; }
  .tools-tabs a { font-size: 12px; padding: 9px 12px; }
  .tools-heading { margin-top: 24px; }
  .tool-controls input:not([type="range"]), .tool-controls select { font-size: 16px; }
}
