.tool-main { padding-block: 30px 72px; }
.tool-page-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.tool-page-top .breadcrumbs { flex: 1; min-width: 0; padding-block: 7px; gap: 8px 12px; }
.tool-presence { display: inline-flex; flex-shrink: 0; align-items: center; gap: 6px; min-height: 36px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-family: var(--font-body); font-size: var(--text-sm); line-height: 1.55; }
.tool-presence i { width: 6px; height: 6px; margin-right: 2px; border-radius: 50%; background: var(--muted); }
.tool-presence[data-status="live"] i { background: var(--green); }
.tool-presence strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.tool-usage-summary { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; color: var(--muted); font-family: var(--font-body); font-size: var(--text-sm); line-height: 1.55; }
.tool-usage-summary svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.tool-usage-summary strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: var(--muted); font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400; line-height: 1.55; letter-spacing: 0; }
.breadcrumbs a:hover { color: var(--primary); }
.tool-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 34px 0 30px; }
.tool-page-heading .eyebrow { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 600; line-height: 1; letter-spacing: .04em; }
.tool-page-heading h1 { margin: 5px 0 12px; font-family: var(--font-heading); font-size: var(--heading-1); font-weight: 700; line-height: 1.1; letter-spacing: -.025em; overflow-wrap: anywhere; }
.tool-page-heading p { margin: 0; color: var(--muted); max-width: 720px; font-family: var(--font-body); font-size: var(--text-lg); font-weight: 400; line-height: 1.65; letter-spacing: 0; }
.workspace-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); gap: 24px; align-items: start; }
.work-panel { min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 34px rgba(11,23,48,.035); }
.panel-heading { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.panel-heading > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-soft); color: var(--primary); font-family: var(--font-body); font-size: var(--text-xs); font-weight: 600; line-height: 1; letter-spacing: .04em; flex-shrink: 0; }
.panel-heading h2 { margin: 0; font-family: var(--font-heading); font-size: var(--card-title); font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.panel-heading small { margin-left: auto; color: var(--muted); font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400; line-height: 1.55; letter-spacing: 0; }
#toolForm { width: 100%; min-width: 0; max-width: 100%; }
#toolControls { border: 0; padding: 0; margin: 0; width: 100%; min-width: 0; max-width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
#toolControls > * { min-width: 0; max-width: 100%; }
.work-field { display: grid; gap: 8px; min-width: 0; font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500; line-height: 1.4; letter-spacing: 0; }
.work-field small, .field-note { color: var(--muted); font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400; line-height: 1.55; letter-spacing: 0; }
.field-note { margin: 0; overflow-wrap: anywhere; }
.work-field input, .work-field select, .work-field textarea, .output-text { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); padding: 12px 13px; outline: none; font-family: var(--font-body); font-size: var(--text-base); font-weight: 400; line-height: 1.4; letter-spacing: 0; }
.work-field textarea, .output-text { resize: vertical; min-height: 210px; tab-size: 2; font-family: var(--font-body); font-size: var(--text-base); font-weight: 400; line-height: 1.4; letter-spacing: 0; }
.work-field input:focus, .work-field textarea:focus, .work-field select:focus, .output-text:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(212,175,114,.12); }
.work-field input:disabled { opacity: .55; }
.work-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; }
.work-check { display: flex; align-items: start; gap: 10px; cursor: pointer; font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500; line-height: 1.4; letter-spacing: 0; }
.work-check input { accent-color: var(--primary); width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.primary-action, .secondary-action, .download-action { border: 1px solid var(--line); border-radius: 9px; padding: 11px 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-body); font-size: .9375rem; font-weight: 600; line-height: 1; letter-spacing: .01em; min-height: 48px; }
.primary-action { width: 100%; justify-content: space-between; border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.primary-action:hover { background: var(--button-hover); border-color: var(--button-hover); color: var(--on-hover); }
.secondary-action { background: var(--surface); white-space: nowrap; }
.secondary-action:hover, .download-action:hover { border-color: var(--primary); color: var(--primary); }
.secondary-action[aria-pressed="true"] { color: var(--primary); background: var(--surface-soft); border-color: var(--primary); }
.download-action { background: var(--surface-soft); color: var(--text); }
button:disabled { cursor: wait; opacity: .6; }
.primary-action:focus-visible, .secondary-action:focus-visible, .download-action:focus-visible, .file-actions button:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.privacy-inline { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 22px 0 0; font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400; line-height: 1.55; letter-spacing: 0; }
.privacy-inline svg { width: 17px; height: 17px; fill: none; stroke: var(--green); stroke-width: 1.7; }
.drop-zone { width: 100%; min-width: 0; max-width: 100%; border: 1px dashed #8c9ebb; border-radius: 12px; background: var(--bg); transition: border-color .2s, background .2s; }
.drop-zone.is-dragging { border-color: var(--primary); background: var(--surface-soft); }
.drop-zone > label { display: flex; align-items: center; flex-direction: column; gap: 9px; width: 100%; min-width: 0; padding: 25px 14px; text-align: center; overflow-wrap: anywhere; cursor: pointer; }
.drop-zone > label > * { min-width: 0; max-width: 100%; }
.drop-zone svg { width: 28px; height: 28px; margin-bottom: 5px; fill: none; stroke: var(--primary); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone strong { font-family: var(--font-body); font-size: var(--text-base); font-weight: 600; line-height: 1.65; letter-spacing: 0; }
.drop-zone span { color: var(--muted); font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400; line-height: 1.55; letter-spacing: 0; }
.drop-zone input { display: block; width: 100%; min-width: 0; max-width: 100%; margin-top: 10px; font-family: var(--font-body); font-size: var(--text-base); font-weight: 400; line-height: 1.4; letter-spacing: 0; }
.drop-zone input::file-selector-button { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 12px; margin-right: 10px; border-radius: 7px; cursor: pointer; }
.file-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.file-list:empty { display: none; }
.file-list li { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); padding: 10px; border-radius: 8px; }
.file-name { min-width: 0; flex: 1; overflow-wrap: anywhere; font-family: var(--font-body); font-size: var(--text-base); font-weight: 400; line-height: 1.65; letter-spacing: 0; }
.file-name small { display: block; color: var(--muted); font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400; line-height: 1.55; letter-spacing: 0; }
.file-actions { display: flex; gap: 4px; }
.file-actions button { width: 32px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); cursor: pointer; }
.result-panel { min-height: 380px; }
#toolStatus { margin: 0 0 20px; color: var(--muted); overflow-wrap: anywhere; font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400; line-height: 1.55; letter-spacing: 0; }
#toolStatus.is-error { color: #ce3535; border-left: 3px solid #ce3535; padding-left: 12px; }
html[data-theme="dark"] #toolStatus.is-error { color: #ff9393; }
.tool-results { display: grid; gap: 18px; min-width: 0; }
.result-placeholder { min-height: 225px; display: grid; place-items: center; }
.result-placeholder svg { width: 64px; height: 64px; fill: none; stroke: var(--line); stroke-width: 1.5; }
.result-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.output-text { min-height: 230px; font-family: var(--font-body); font-size: var(--text-base); font-weight: 400; line-height: 1.4; letter-spacing: 0; }
.result-metrics { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.result-metric { padding: 18px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; min-width: 0; }
.result-metric span { display: block; color: var(--muted); font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400; line-height: 1.55; letter-spacing: 0; }
.result-metric strong { display: block; margin-top: 8px; overflow-wrap: anywhere; font-family: var(--font-heading); font-size: var(--counter-small); font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.result-metric:last-child:nth-child(odd) { grid-column: 1/-1; border-color: var(--primary); }
.result-metric:last-child strong { color: var(--primary); }
.result-artifact { display: grid; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.result-artifact h3 { margin: 0; overflow-wrap: anywhere; font-family: var(--font-heading); font-size: var(--card-title); font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.result-artifact p { margin: 0; color: var(--muted); font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400; line-height: 1.55; letter-spacing: 0; }
.result-image { display: block; max-width: 100%; max-height: 320px; width: auto; height: auto; object-fit: contain; margin: auto; background: #fff; border-radius: 6px; }
.result-artifact .download-action { justify-self: start; }
.tool-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 36px; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tool-guide h2, .tool-guide h3, .related-tools h2 { margin: 0 0 14px; font-family: var(--font-heading); font-size: var(--heading-4); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.tool-guide ol { padding-left: 20px; margin: 0; }
.tool-guide li { padding: 5px 0; color: var(--muted); font-family: var(--font-body); font-size: var(--text-base); font-weight: 400; line-height: 1.65; letter-spacing: 0; }
.tool-guide p { color: var(--muted); margin: 0; font-family: var(--font-body); font-size: var(--text-base); font-weight: 400; line-height: 1.65; letter-spacing: 0; }
.related-tools { margin-top: 34px; }
.related-tools > div { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.related-tools a { display: grid; grid-template-columns: 1fr auto; padding: 18px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; }
.related-tools a:hover { border-color: var(--primary); }
.related-tools span { color: var(--muted); font-family: var(--font-body); font-size: var(--text-xs); font-weight: 600; line-height: 1; letter-spacing: .04em; }
.related-tools strong { grid-column: 1; margin-top: 5px; font-family: var(--font-heading); font-size: var(--card-title); font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.related-tools b { grid-column: 2; grid-row: 1/3; align-self: center; color: var(--primary); }
[hidden] { display: none !important; }
@media (max-width: 800px) {
  .workspace-grid { grid-template-columns: minmax(0,1fr); }
  .tool-page-heading { align-items: start; flex-direction: column; }
  .tool-guide { grid-template-columns: 1fr; gap: 24px; }
  .related-tools > div { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .work-panel { padding: 20px 16px; }
  .work-row { grid-template-columns: 1fr; }
  .tool-main { padding-top: 22px; }
  .file-list li { flex-wrap: wrap; }
  .file-name { flex-basis: 100%; }
}
@media print {
  body * { visibility: hidden; }
  #toolResults, #toolResults * { visibility: visible; }
  #toolResults { position: absolute; inset: 0 auto auto 0; width: 100%; }
  #toolResults .result-actions, #toolResults .download-action { display: none; }
  .result-image { max-height: none; }
}
