.resize-intro { padding-block: clamp(30px, 4vw, 48px) 27px; }
.resize-intro h1 { font-size: clamp(2.5rem, 5.6vw, 4.35rem); }
.resize-intro p { margin-top: 12px; }
.resize-workspace { grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr); }
.crop-panel { padding: 20px; }
.crop-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 405px;
  height: clamp(340px, 39vw, 470px);
  overflow: hidden;
  border: 1px solid #d8dce3;
  border-radius: 11px;
  background: #e7eaf0;
  isolation: isolate;
}
.crop-stage.drag { outline: 2px solid var(--accent); outline-offset: -3px; background: #e7eeff; }
.resize-empty { padding: 28px 16px; text-align: center; color: var(--ink); }
.resize-empty-icon { width: 62px; height: 62px; margin-bottom: 15px; color: #7385a5; }
.resize-empty .drop-title { font-size: 1.2rem; }
.resize-empty-formats { margin-top: 7px; color: var(--muted); font-size: .875rem; }
.resize-empty .secondary { margin: 23px auto 0; background: #fafbfc; min-height: 44px; padding-inline: 18px; font-size: .875rem; }
.image-surface { position: relative; flex: none; touch-action: none; cursor: crosshair; user-select: none; background: repeating-conic-gradient(#f3f4f7 0 25%, #fff 0 50%) 50% / 16px 16px; }
#source-preview { display: block; width: 100%; height: 100%; pointer-events: none; }
.crop-box {
  position: absolute;
  border: 1.5px solid #fff;
  outline: 1px solid #2855d9;
  box-shadow: 0 0 0 2000px #101a2c6b;
  cursor: move;
  touch-action: none;
}
.crop-box:focus-visible { outline: 3px solid #adc3ff; outline-offset: 3px; }
.crop-guides { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.crop-guides i { position: absolute; display: block; background: #ffffff63; }
.crop-guides i:nth-child(1), .crop-guides i:nth-child(2) { top: 0; bottom: 0; width: 1px; }
.crop-guides i:nth-child(1) { left: 33.333%; }
.crop-guides i:nth-child(2) { left: 66.666%; }
.crop-guides i:nth-child(3), .crop-guides i:nth-child(4) { left: 0; right: 0; height: 1px; }
.crop-guides i:nth-child(3) { top: 33.333%; }
.crop-guides i:nth-child(4) { top: 66.666%; }
.crop-handle { position: absolute; width: 44px; height: 44px; padding: 0; border: 0; background: none; transform: translate(-50%, -50%); touch-action: none; }
.crop-handle::after { content: ''; position: absolute; inset: 16px; border: 2px solid white; border-radius: 2px; background: var(--accent); box-shadow: 0 1px 3px #16243980; }
.crop-handle:focus-visible { outline: 2px solid #adc3ff; outline-offset: -1px; border-radius: 5px; }
.crop-handle[data-edge="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.crop-handle[data-edge="n"] { left: 50%; top: 0; cursor: ns-resize; }
.crop-handle[data-edge="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.crop-handle[data-edge="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.crop-handle[data-edge="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.crop-handle[data-edge="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.crop-handle[data-edge="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.crop-handle[data-edge="w"] { left: 0; top: 50%; cursor: ew-resize; }
.crop-source-info { display: flex; justify-content: space-between; gap: 16px; margin-top: 13px; color: var(--muted); font-size: .8125rem; line-height: 1.4; }
#source-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#source-dimensions { flex: none; font-variant-numeric: tabular-nums; }
.crop-controls, .resize-output-controls { min-width: 0; padding: 0; margin: 19px 0 0; border: 0; }
.crop-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.crop-label-row #crop-label, .resize-dimensions-heading p { font-size: .875rem; font-weight: 640; }
.crop-label-row .subtle { min-height: 30px; font-size: .8125rem; }
.crop-ratios { display: flex; flex-wrap: wrap; gap: 6px; }
.crop-ratios button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: transparent; font-size: .8125rem; }
.crop-ratios button:hover:not(:disabled) { background: #edf0f6; }
.crop-ratios button[aria-pressed="true"] { border-color: #a8bced; background: #e7eeff; color: #2145b1; }
.ratio-symbol { display: inline-block; width: 13px; height: 13px; border: 1px solid currentColor; border-radius: 1px; }
.ratio-landscape { width: 15px; height: 11px; }
.ratio-wide { width: 17px; height: 10px; }
.ratio-portrait { width: 9px; height: 16px; }
.crop-readout-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
#crop-readout { font-variant-numeric: tabular-nums; }
.crop-precise { margin-top: 15px; border-top: 1px solid var(--line); }
.crop-precise > summary { width: fit-content; padding: 15px 0 8px; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.crop-keyboard-hint { margin-block: 4px 12px; font-size: .8125rem; color: var(--muted); line-height: 1.5; }
.crop-numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.crop-numbers .field label { font-size: .8125rem; }
.crop-numbers .unit-field input { padding-inline: 8px; font-size: .8125rem; }
.crop-numbers .unit-field span { padding-inline: 0 7px; }
.resize-settings { padding: 20px; }
.resize-live-label { font-size: .75rem; color: var(--muted); }
.resize-result-preview { display: grid; place-items: center; min-height: 160px; padding: 12px; border: 1px solid #dde1e8; border-radius: 9px; overflow: hidden; background: repeating-conic-gradient(#eceef2 0 25%, #f8f9fb 0 50%) 50% / 16px 16px; }
.resize-result-preview canvas { display: block; max-width: 100%; height: auto; max-height: 150px; object-fit: contain; box-shadow: 0 2px 8px #20242b12; }
.resize-result-preview p { padding: 5px 9px; border-radius: 6px; background: #f6f7f9e8; color: #646d7a; font-size: .8125rem; }
.resize-dimensions-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 13px; }
.resize-lock { display: flex; align-items: center; gap: 4px; min-height: 30px; padding: 2px 0; border: 0; color: #2145b1; background: none; font-size: .75rem; }
.resize-lock svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.4; }
.resize-lock[aria-pressed="false"] { color: var(--muted); }
.resize-lock[aria-pressed="false"] .lock-shackle { transform: translateY(-2px) rotate(-10deg); transform-origin: 13px 8px; }
.resize-dimensions { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: end; }
.resize-dimensions .field label { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.resize-dimensions .unit-field input { padding-left: 9px; font-variant-numeric: tabular-nums; }
.resize-dimensions .unit-field span { padding-inline: 0 9px; }
.dimension-times { align-self: end; min-height: 43px; display: grid; place-items: center; color: var(--muted); }
.resize-scale-presets { display: flex; gap: 6px; margin-top: 10px; }
.resize-scale-presets button { flex: 1; min-height: 32px; border: 1px solid var(--line); border-radius: 6px; background: none; font-size: .75rem; }
.resize-scale-presets button:hover:not(:disabled) { background: #e7eeff; }
.resize-scale-presets button[aria-pressed="true"] { color: #2145b1; border-color: #a8bced; background: #e7eeff; }
.resize-hint { color: var(--muted); font-size: .8125rem; line-height: 1.45; margin-top: 9px; }
.resize-format-fields { display: grid; gap: 15px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.resize-format-fields .field label { font-size: .875rem; }
.resize-format-fields .unit-field span { font-size: .75rem; }
.resize-export-actions { padding-top: 18px; }
.resize-page fieldset:disabled { opacity: .55; }
.resize-page .primary .action-label { font: inherit; }

@media (max-width: 900px) {
  .resize-workspace { grid-template-columns: minmax(0, 1.5fr) minmax(290px, 1fr); gap: 14px; }
  .crop-panel, .resize-settings { padding: 16px; }
  .crop-stage { min-height: 350px; }
  .crop-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .resize-workspace { grid-template-columns: minmax(0, 1fr); }
  .resize-intro { padding-block: 29px 23px; }
  .crop-stage { min-height: 320px; height: clamp(320px, 80vw, 430px); }
  .crop-handle { width: 38px; height: 38px; }
  .crop-handle::after { inset: 13px; }
  .resize-result-preview { min-height: 140px; }
}
@media (max-width: 420px) {
  .crop-ratios { gap: 5px; }
  .crop-ratios button { flex: 1 0 28%; min-height: 40px; }
  .crop-stage { min-height: 290px; height: 320px; }
  .crop-source-info { gap: 10px; font-size: .75rem; }
}
