.tool-layout { display: grid; gap: var(--space-6); padding-bottom: var(--space-7); }
@media (min-width: 1000px) { .tool-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }

.tool-hero { padding: var(--space-5) 0 var(--space-2); }
.tool-hero h1 { margin-bottom: var(--space-2); }
.tool-hero p { color: var(--text-muted); max-width: 62ch; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); margin-bottom: var(--space-5); }
.panel h2 { font-size: 1.1rem; margin-bottom: var(--space-3); }

.file-list { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: grid; gap: 8px; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius); font-size: .9rem; }
.file-list__meta { color: var(--text-muted); font-size: .8rem; }

.field { margin-bottom: var(--space-4); }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.field input[type=number], .field input[type=text], .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--surface); min-height: 44px;
}
.field input[type=range] { width: 100%; accent-color: var(--accent); }
.field__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.field__hint { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.field--check { display: flex; align-items: center; gap: 10px; }
.field--check label { margin: 0; font-weight: 500; }

.preview-wrap { display: grid; gap: var(--space-4); }
@media (min-width: 700px) { .preview-wrap--compare { grid-template-columns: 1fr 1fr; } }
.preview-box { background: var(--surface-2); border-radius: var(--radius); padding: var(--space-4);
  display: grid; place-items: center; min-height: 200px; }
.preview-box img { max-height: 380px; width: auto; border-radius: var(--radius-sm); }
.preview-box figcaption { font-size: .8rem; color: var(--text-muted); margin-top: 8px; }

.crop-stage { position: relative; display: inline-block; max-width: 100%; user-select: none; touch-action: none; }
.crop-stage img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.crop-box { position: absolute; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(16,19,26,.45);
  cursor: move; }
.crop-handle { position: absolute; width: 14px; height: 14px; background: var(--accent); border: 2px solid #fff; border-radius: 3px; }
.crop-handle[data-h="nw"] { left: -7px; top: -7px; cursor: nwse-resize; }
.crop-handle[data-h="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
.crop-handle[data-h="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; }
.crop-handle[data-h="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }

/* Content sections */
.prose { max-width: 72ch; }
.prose h2 { margin-top: var(--space-6); }
.prose h3 { margin-top: var(--space-5); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 6px; }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-family: var(--mono); font-size: .88em; }
.prose pre { background: var(--surface-2); padding: var(--space-4); border-radius: var(--radius); overflow-x: auto; }

.faq details { border-bottom: 1px solid var(--border); padding: var(--space-4) 0; }
.faq summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--text-muted); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: var(--space-3) 0 0; color: var(--text-muted); }

.sidebar { display: grid; gap: var(--space-5); }
.sidebar .card h2 { font-size: 1rem; }
.related-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.related-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius);
  color: var(--text); font-size: .92rem; }
.related-list a:hover { background: var(--accent-soft); text-decoration: none; }
.related-list .icon { color: var(--accent); }

/* Home */
.hero { padding: var(--space-8) 0 var(--space-6); text-align: center; }
.hero h1 { max-width: 20ch; margin: 0 auto var(--space-4); }
.hero p.lead { max-width: 60ch; margin: 0 auto var(--space-5); color: var(--text-muted); font-size: 1.05rem; }
.hero__actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }
.hero__note { margin-top: var(--space-4); color: var(--text-muted); font-size: .85rem;
  display: flex; align-items: center; gap: 6px; justify-content: center; }

.section { padding: var(--space-7) 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.section__head p { color: var(--text-muted); margin: 0; max-width: 60ch; }

.grid { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.steps { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); }
.step__num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; margin-bottom: var(--space-3); }
.step h3 { font-size: 1rem; }
.step p { color: var(--text-muted); font-size: .9rem; margin: 0; }

.unsupported { background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius-lg); padding: var(--space-5); }
.unsupported h2 { color: var(--warning); font-size: 1.05rem; }