.main[data-page="image-tools"] .main_1 {
  padding-top: clamp(0.5rem, 1vw, 1rem);
}

.image_tools_shell {
  width: 100%;
  max-width: 1120px;
  min-width: 0;
  margin: 0 auto;
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  font-family: "Inter", sans-serif;
}

.image_tools_trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(68, 117, 28, 0.2);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(235, 247, 221, 0.95), rgba(255, 255, 255, 0.92));
  color: #1e3c12;
}

.dark-mode .image_tools_trust {
  background: linear-gradient(135deg, rgba(34, 74, 21, 0.86), rgba(23, 31, 24, 0.92));
  color: #e4f7d8;
  border-color: rgba(185, 230, 151, 0.3);
}

.image_tools_drop {
  min-width: 0;
  min-height: 150px;
  border: 2px dashed rgba(76, 116, 42, 0.42);
  border-radius: 24px;
  background: rgba(247, 250, 242, 0.86);
  display: grid;
  place-items: center;
  text-align: center;
  padding: clamp(1.1rem, 3vw, 2rem);
  position: relative;
  cursor: pointer;
}

.image_tools_drop.is-dragover {
  border-color: #4f6df5;
  background: rgba(232, 237, 255, 0.92);
}

.image_tools_drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.image_tools_drop strong {
  display: block;
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
  color: #122033;
}

.image_tools_drop p {
  margin: 0.45rem 0 0;
  color: #657082;
}

.image_tools_drop .image_tools_limit {
  font-size: 0.86rem;
  font-weight: 800;
  color: #3146c8;
}

.dark-mode .image_tools_drop {
  background: rgba(25, 31, 40, 0.8);
  border-color: rgba(181, 220, 141, 0.36);
}

.dark-mode .image_tools_drop strong {
  color: #edf5ff;
}

.dark-mode .image_tools_drop p {
  color: #afbac8;
}

.dark-mode .image_tools_drop .image_tools_limit {
  color: #c9d3ff;
}

.image_tools_workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: start;
  min-width: 0;
}

.image_tools_preview,
.image_tools_controls,
.image_tools_status,
.image_tools_file_list {
  min-width: 0;
  border: 1px solid rgba(128, 139, 154, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 45px rgba(31, 44, 65, 0.08);
}

.dark-mode .image_tools_preview,
.dark-mode .image_tools_controls,
.dark-mode .image_tools_status,
.dark-mode .image_tools_file_list {
  background: rgba(24, 29, 38, 0.92);
  border-color: rgba(194, 207, 224, 0.16);
}

.image_tools_preview {
  min-height: 420px;
  height: clamp(360px, 58vh, 640px);
  position: relative;
  display: grid;
  gap: 1rem;
  place-items: center;
  padding: clamp(1rem, 2vw, 1.5rem);
  overflow: hidden;
  overscroll-behavior: contain;
}

.image_empty_preview {
  grid-area: 1 / 1;
  box-sizing: border-box;
  width: min(100%, 640px);
  min-height: min(340px, 52vw);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.45rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  color: #2f3e4f;
  border: 2px solid rgba(31, 44, 65, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.76)),
    linear-gradient(45deg, #e8edf3 25%, transparent 25%),
    linear-gradient(-45deg, #e8edf3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8edf3 75%),
    linear-gradient(-45deg, transparent 75%, #e8edf3 75%);
  background-color: #f7fafc;
  background-size: auto, 24px 24px, 24px 24px, 24px 24px, 24px 24px;
  background-position: 0 0, 0 0, 0 12px, 12px -12px, -12px 0;
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.86),
    0 14px 30px rgba(20, 32, 51, 0.12);
}

.image_empty_preview[hidden] {
  display: none;
}

.image_empty_preview strong {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.image_empty_preview span {
  color: #6b7685;
  font-size: 0.95rem;
}

.dark-mode .image_empty_preview {
  color: #e5edf8;
  border-color: rgba(226, 237, 251, 0.28);
  background:
    linear-gradient(rgba(18, 24, 34, 0.78), rgba(18, 24, 34, 0.78)),
    linear-gradient(45deg, rgba(226, 237, 251, 0.1) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(226, 237, 251, 0.1) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(226, 237, 251, 0.1) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(226, 237, 251, 0.1) 75%);
  background-color: #101722;
  background-size: auto, 24px 24px, 24px 24px, 24px 24px, 24px 24px;
  background-position: 0 0, 0 0, 0 12px, 12px -12px, -12px 0;
  box-shadow:
    0 0 0 6px rgba(13, 18, 26, 0.86),
    0 14px 30px rgba(0, 0, 0, 0.34);
}

.dark-mode .image_empty_preview span {
  color: #b6c4d6;
}

.dark-mode .image_preview_badge {
  border-color: rgba(142, 162, 255, 0.34);
  background: rgba(18, 24, 34, 0.92);
  color: #e5edf8;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
}

.image_preview_stage {
  grid-area: 1 / 1;
  display: inline-block;
  position: relative;
  max-width: none;
  line-height: 0;
  touch-action: none;
  border-radius: 14px;
  will-change: transform;
}

.image_tools_preview.is-pannable .image_preview_stage {
  cursor: grab;
}

.image_tools_preview.is-panning .image_preview_stage {
  cursor: grabbing;
}

.image_preview_badge {
  grid-area: 1 / 1;
  align-self: start;
  justify-self: start;
  position: sticky;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 8;
  max-width: min(92%, 520px);
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(79, 109, 245, 0.22);
  border-radius: 999px;
  background: rgba(248, 255, 244, 0.92);
  color: #1e3920;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 12px 26px rgba(20, 32, 51, 0.14);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.image_preview_badge[hidden] {
  display: none;
}

.image_preview_stage[hidden] {
  display: none;
}

.image_preview_stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 2px solid rgba(31, 44, 65, 0.34);
  border-radius: 14px;
  pointer-events: none;
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.9),
    0 16px 36px rgba(20, 32, 51, 0.22);
}

.image_preview_stage.is-resize-mode::after {
  content: "";
  position: absolute;
  right: -13px;
  bottom: -13px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 0 41%, rgba(255, 255, 255, 0.78) 41% 48%, transparent 48%),
    linear-gradient(135deg, transparent 0 56%, rgba(255, 255, 255, 0.78) 56% 63%, transparent 63%),
    linear-gradient(135deg, #9bd97e, #4f6df5);
  box-shadow:
    0 0 0 5px rgba(79, 109, 245, 0.2),
    0 12px 24px rgba(31, 44, 65, 0.28);
}

.image_preview_stage.is-resize-mode::before {
  border-color: rgba(79, 109, 245, 0.72);
  box-shadow:
    0 0 0 5px rgba(79, 109, 245, 0.14),
    0 0 0 10px rgba(178, 228, 153, 0.2),
    0 16px 36px rgba(20, 32, 51, 0.22);
}

.image_tools_preview canvas {
  display: block;
  max-width: none;
  border-radius: 12px;
  background:
    linear-gradient(45deg, #e8edf3 25%, transparent 25%),
    linear-gradient(-45deg, #e8edf3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8edf3 75%),
    linear-gradient(-45deg, transparent 75%, #e8edf3 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.dark-mode .image_preview_stage::before {
  border-color: rgba(226, 237, 251, 0.48);
  box-shadow:
    0 0 0 6px rgba(13, 18, 26, 0.92),
    0 16px 36px rgba(0, 0, 0, 0.42);
}

.dark-mode .image_preview_stage.is-resize-mode::before {
  border-color: rgba(142, 162, 255, 0.82);
  box-shadow:
    0 0 0 5px rgba(142, 162, 255, 0.2),
    0 0 0 10px rgba(178, 228, 153, 0.12),
    0 16px 36px rgba(0, 0, 0, 0.42);
}

.dark-mode .image_preview_stage.is-resize-mode::after {
  border-color: rgba(237, 245, 255, 0.92);
  background:
    linear-gradient(135deg, transparent 0 41%, rgba(13, 18, 26, 0.82) 41% 48%, transparent 48%),
    linear-gradient(135deg, transparent 0 56%, rgba(13, 18, 26, 0.82) 56% 63%, transparent 63%),
    linear-gradient(135deg, #b2e499, #8ea2ff);
  box-shadow:
    0 0 0 5px rgba(142, 162, 255, 0.22),
    0 12px 24px rgba(0, 0, 0, 0.38);
}

.image_crop_overlay {
  position: absolute;
  box-sizing: border-box;
  z-index: 1;
  border: 2px solid #8fca55;
  border-radius: 10px;
  background: rgba(143, 202, 85, 0.18);
  box-shadow: 0 0 0 9999px rgba(10, 18, 30, 0.36);
  pointer-events: none;
}

.image_tools_controls {
  position: relative;
  overflow: hidden;
  padding: clamp(1rem, 2vw, 1.35rem);
  background:
    radial-gradient(circle at 12% 0%, rgba(79, 109, 245, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 255, 0.92));
}

.image_tools_controls::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.dark-mode .image_tools_controls {
  background:
    radial-gradient(circle at 12% 0%, rgba(99, 126, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(28, 35, 46, 0.98), rgba(18, 24, 33, 0.94));
}

.image_tool_tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.95rem;
  padding: 0.35rem;
  border: 1px solid rgba(117, 132, 151, 0.16);
  border-radius: 20px;
  background: rgba(245, 248, 241, 0.76);
  box-shadow: inset 0 1px 6px rgba(31, 44, 65, 0.05);
}

.image_tool_tabs button,
.image_tools_actions button {
  appearance: none;
  border: 1px solid transparent;
  font: inherit;
  cursor: pointer;
}

.image_tool_tabs button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  min-height: 44px;
  border-radius: 15px;
  background: transparent;
  color: #4c5a6b;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 0.62rem 0.72rem;
  transition:
    transform 0.16s ease,
    color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.image_tool_tabs button::before {
  content: "";
  flex: 0 0 auto;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: #9aa8b8;
  box-shadow: 0 0 0 4px rgba(154, 168, 184, 0.13);
}

.image_tool_tabs button:hover,
.image_tool_tabs button:focus-visible {
  transform: translateY(-1px);
  color: #203045;
  background: rgba(255, 255, 255, 0.82);
  outline: none;
}

.image_tool_tabs button.is-active {
  background:
    linear-gradient(145deg, #f8fff4, #b2e499);
  color: #234d16;
  border-color: rgba(92, 148, 62, 0.3);
  box-shadow:
    0 12px 24px rgba(76, 132, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.image_tool_tabs button.is-active::before {
  background: #4f6df5;
  box-shadow: 0 0 0 4px rgba(79, 109, 245, 0.18);
}

.dark-mode .image_tool_tabs {
  background: rgba(13, 18, 26, 0.42);
  border-color: rgba(214, 225, 239, 0.13);
  box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.18);
}

.dark-mode .image_tool_tabs button {
  color: #b9c5d4;
}

.dark-mode .image_tool_tabs button:hover,
.dark-mode .image_tool_tabs button:focus-visible {
  color: #edf5ff;
  background: rgba(255, 255, 255, 0.07);
}

.dark-mode .image_tool_tabs button.is-active {
  background:
    linear-gradient(145deg, rgba(178, 228, 153, 0.24), rgba(45, 72, 35, 0.78));
  color: #edfce6;
  border-color: rgba(178, 228, 153, 0.38);
  box-shadow:
    0 14px 26px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.image_tool_panel {
  display: block;
  padding: clamp(0.95rem, 2vw, 1.15rem);
  border: 1px solid rgba(117, 132, 151, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 12px 30px rgba(31, 44, 65, 0.06);
}

.dark-mode .image_tool_panel {
  background: rgba(13, 18, 26, 0.38);
  border-color: rgba(214, 225, 239, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 30px rgba(0, 0, 0, 0.18);
}

.image_panel_section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.image_panel_section[hidden] {
  display: none;
}

.image_panel_section p {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  color: #677386;
  line-height: 1.45;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(117, 132, 151, 0.12);
  border-radius: 14px;
  background: rgba(245, 248, 252, 0.72);
}

.image_preset_row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.image_preset_row button {
  min-width: 0;
  border: 1px solid rgba(79, 109, 245, 0.18);
  border-radius: 13px;
  background: rgba(248, 250, 255, 0.92);
  color: #243b64;
  font-weight: 800;
  padding: 0.58rem 0.88rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(49, 70, 200, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.image_preset_row button:hover,
.image_preset_row button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(49, 70, 200, 0.12);
  outline: none;
}

.image_preset_row button.is-active {
  background: linear-gradient(135deg, #4f6df5, #3146c8);
  border-color: rgba(79, 109, 245, 0.42);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(49, 70, 200, 0.2);
}

.dark-mode .image_preset_row button {
  background: rgba(237, 241, 255, 0.1);
  color: #dfe6ff;
  border-color: rgba(214, 225, 239, 0.16);
}

.dark-mode .image_preset_row button.is-active {
  background: linear-gradient(135deg, #8ea2ff, #596de8);
  border-color: rgba(148, 163, 255, 0.38);
  color: #10172f;
}

.dark-mode .image_panel_section p {
  color: #b6c2d1;
  background: rgba(239, 244, 248, 0.06);
  border-color: rgba(214, 225, 239, 0.12);
}

.image_panel_note {
  grid-template-columns: 1fr;
}

.image_transform_grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.image_transform_grid button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.12rem;
  min-width: 0;
  min-height: 96px;
  border: 1px solid rgba(48, 126, 165, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 22% 18%, rgba(94, 178, 210, 0.24), transparent 34%),
    linear-gradient(145deg, #f7fcff, #e6f2f8);
  color: #17495f;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(34, 91, 117, 0.12);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.image_transform_grid button:hover,
.image_transform_grid button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(34, 91, 117, 0.18);
  outline: none;
}

#image_rotate_left {
  border-color: rgba(48, 126, 165, 0.24);
  background:
    radial-gradient(circle at 22% 18%, rgba(94, 178, 210, 0.24), transparent 34%),
    linear-gradient(145deg, #f7fcff, #e6f2f8);
  color: #17495f;
}

#image_rotate_right {
  border-color: rgba(201, 132, 36, 0.24);
  background:
    radial-gradient(circle at 22% 18%, rgba(246, 178, 82, 0.24), transparent 34%),
    linear-gradient(145deg, #fffaf0, #f7ead6);
  color: #74470c;
}

#image_flip_horizontal {
  border-color: rgba(181, 77, 122, 0.24);
  background:
    radial-gradient(circle at 22% 18%, rgba(230, 124, 168, 0.22), transparent 34%),
    linear-gradient(145deg, #fff7fb, #f7e4ed);
  color: #6f2447;
}

#image_flip_vertical {
  border-color: rgba(105, 90, 190, 0.24);
  background:
    radial-gradient(circle at 22% 18%, rgba(143, 130, 224, 0.22), transparent 34%),
    linear-gradient(145deg, #faf8ff, #eae6fb);
  color: #40307a;
}

.image_transform_grid button.is-active,
.image_transform_grid button:active {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(145deg, #2d8eb6, #17617f);
  color: #fff;
}

#image_rotate_left:active {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(145deg, #2d8eb6, #17617f);
}

#image_rotate_right:active {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(145deg, #c77a17, #8a4f08);
}

#image_flip_horizontal.is-active,
#image_flip_horizontal:active {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(145deg, #c55284, #873157);
}

#image_flip_vertical.is-active,
#image_flip_vertical:active {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(145deg, #7666d4, #493a99);
}

.image_transform_grid svg {
  width: 34px;
  height: 34px;
  display: block;
  margin-bottom: -0.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.image_transform_grid span {
  display: block;
  font-size: 0.9rem;
  line-height: 1.05;
}

.dark-mode .image_transform_grid button {
  background:
    radial-gradient(circle at 22% 18%, rgba(94, 178, 210, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(31, 53, 66, 0.94), rgba(14, 25, 34, 0.96));
  color: #d6f2ff;
  border-color: rgba(124, 202, 232, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.dark-mode #image_rotate_left {
  border-color: rgba(124, 202, 232, 0.24);
  background:
    radial-gradient(circle at 22% 18%, rgba(94, 178, 210, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(31, 53, 66, 0.94), rgba(14, 25, 34, 0.96));
  color: #d6f2ff;
}

.dark-mode #image_rotate_right {
  border-color: rgba(246, 178, 82, 0.24);
  background:
    radial-gradient(circle at 22% 18%, rgba(246, 178, 82, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(65, 47, 25, 0.94), rgba(31, 23, 14, 0.96));
  color: #ffe2ac;
}

.dark-mode #image_flip_horizontal {
  border-color: rgba(230, 124, 168, 0.24);
  background:
    radial-gradient(circle at 22% 18%, rgba(230, 124, 168, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(62, 33, 48, 0.94), rgba(30, 16, 25, 0.96));
  color: #ffd4e6;
}

.dark-mode #image_flip_vertical {
  border-color: rgba(143, 130, 224, 0.26);
  background:
    radial-gradient(circle at 22% 18%, rgba(143, 130, 224, 0.17), transparent 34%),
    linear-gradient(145deg, rgba(44, 39, 74, 0.94), rgba(22, 19, 38, 0.96));
  color: #dfd9ff;
}

.dark-mode .image_transform_grid button.is-active,
.dark-mode .image_transform_grid button:active {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(145deg, #5bbfe5, #21799d);
  color: #071923;
}

.dark-mode #image_rotate_left:active {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(145deg, #5bbfe5, #21799d);
}

.dark-mode #image_rotate_right:active {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(145deg, #f1ad55, #a96918);
}

.dark-mode #image_flip_horizontal.is-active,
.dark-mode #image_flip_horizontal:active {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(145deg, #e57aa7, #a3406c);
}

.dark-mode #image_flip_vertical.is-active,
.dark-mode #image_flip_vertical:active {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(145deg, #9c8df0, #6252bd);
}

.image_tool_panel label,
.image_panel_section label {
  display: grid;
  min-width: 0;
  gap: 0.5rem;
  color: #445066;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.78rem;
  border: 1px solid rgba(117, 132, 151, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.dark-mode .image_tool_panel label {
  color: #c9d4e2;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(214, 225, 239, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.image_tool_panel input:not([type="hidden"]),
.image_tool_panel select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(105, 118, 135, 0.2);
  border-radius: 13px;
  padding: 0 0.82rem;
  background: rgba(255, 255, 255, 0.94);
  color: #142033;
  font: inherit;
  font-weight: 700;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 20px rgba(31, 44, 65, 0.05);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.image_tool_panel input:not([type="hidden"]):focus,
.image_tool_panel select:focus {
  border-color: rgba(79, 109, 245, 0.55);
  box-shadow:
    0 0 0 4px rgba(79, 109, 245, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.dark-mode .image_tool_panel input,
.dark-mode .image_tool_panel select {
  background: #111822;
  color: #edf5ff;
  border-color: rgba(214, 225, 239, 0.22);
}

.image_tool_panel input[type="range"] {
  padding: 0;
  box-shadow: none;
  accent-color: #4f6df5;
}

.image_checkbox {
  display: flex !important;
  align-items: center;
  grid-template-columns: auto 1fr !important;
  gap: 0.65rem !important;
}

.image_tool_panel .image_checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border-radius: 5px;
  accent-color: #4f6df5;
  box-shadow: none;
}

.image_tools_actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(117, 132, 151, 0.14);
}

.image_tools_actions button {
  min-width: 0;
  min-height: 46px;
  border-radius: 15px;
  color: #344257;
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(117, 132, 151, 0.17);
  font-weight: 900;
  letter-spacing: -0.01em;
  box-shadow:
    0 10px 22px rgba(31, 44, 65, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.image_tools_actions button:hover:not(:disabled),
.image_tools_actions button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(31, 44, 65, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  outline: none;
}

.image_tools_actions #image_process {
  grid-column: 1 / -1;
  color: #ffffff;
  background:
    linear-gradient(135deg, #4f6df5, #3146c8);
  border-color: rgba(79, 109, 245, 0.45);
  box-shadow:
    0 16px 32px rgba(49, 70, 200, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.image_tools_actions #image_process_all {
  grid-column: 1 / -1;
  color: #fff;
  background:
    linear-gradient(135deg, #2d8eb6, #17617f);
  border-color: rgba(48, 126, 165, 0.34);
  box-shadow:
    0 16px 32px rgba(34, 91, 117, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.image_tools_actions #image_download {
  color: #243b64;
  background:
    linear-gradient(135deg, #f1f4ff, #e3e8ff);
  border-color: rgba(79, 109, 245, 0.24);
}

.image_tools_actions #image_reset {
  color: #6b4118;
  background:
    linear-gradient(135deg, #fff7eb, #f7ead8);
  border-color: rgba(195, 131, 46, 0.2);
}

.image_tools_actions #image_clean {
  color: #15535d;
  background:
    linear-gradient(135deg, #edf9fb, #dceff3);
  border-color: rgba(71, 153, 168, 0.2);
}

.image_tools_actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.dark-mode .image_tools_actions {
  border-top-color: rgba(214, 225, 239, 0.12);
}

.dark-mode .image_tools_actions button {
  color: #dce7f5;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(214, 225, 239, 0.13);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dark-mode .image_tools_actions #image_process {
  color: #10172f;
  background:
    linear-gradient(135deg, #8ea2ff, #596de8);
  border-color: rgba(148, 163, 255, 0.44);
}

.dark-mode .image_tools_actions #image_process_all {
  color: #071923;
  background:
    linear-gradient(135deg, #5bbfe5, #21799d);
  border-color: rgba(124, 202, 232, 0.34);
}

.dark-mode .image_tools_actions #image_download {
  color: #edf1ff;
  background:
    linear-gradient(135deg, rgba(79, 109, 245, 0.32), rgba(49, 70, 200, 0.42));
}

.dark-mode .image_tools_actions #image_reset {
  color: #ffd9a5;
  background: rgba(242, 191, 119, 0.16);
}

.dark-mode .image_tools_actions #image_clean {
  color: #bceff6;
  background: rgba(95, 204, 220, 0.14);
}

.image_tools_status {
  padding: 0.9rem 1rem;
  color: #536074;
  line-height: 1.5;
}

.dark-mode .image_tools_status {
  color: #c4cedb;
}

.image_batch_progress {
  display: grid;
  gap: 0.65rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(48, 126, 165, 0.18);
  border-radius: 18px;
  background: rgba(235, 247, 251, 0.86);
  box-shadow: 0 14px 32px rgba(31, 44, 65, 0.07);
}

.image_batch_progress[hidden] {
  display: none;
}

.image_batch_progress_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #17495f;
  font-weight: 800;
}

.image_batch_progress_head button {
  border: 1px solid rgba(159, 39, 39, 0.18);
  border-radius: 999px;
  background: #fff4f4;
  color: #8a2424;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0.48rem 0.8rem;
}

.image_batch_progress_track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(48, 126, 165, 0.15);
}

.image_batch_progress_track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2d8eb6, #5bbfe5);
  transition: width 0.2s ease;
}

.dark-mode .image_batch_progress {
  background: rgba(24, 39, 49, 0.82);
  border-color: rgba(124, 202, 232, 0.18);
}

.dark-mode .image_batch_progress_head {
  color: #d6f2ff;
}

.dark-mode .image_batch_progress_head button {
  background: rgba(159, 39, 39, 0.16);
  border-color: rgba(255, 179, 179, 0.18);
  color: #ffd2d2;
}

.dark-mode .image_batch_progress_track {
  background: rgba(124, 202, 232, 0.14);
}

.image_tools_file_list {
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem;
}

.image_file_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 48px;
  padding: 0.75rem 0.85rem;
  border: 0;
  border-radius: 14px;
  background: rgba(239, 244, 248, 0.9);
  color: #273449;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
}

.image_file_item span {
  display: flex;
  align-items: center;
  min-height: 1.4em;
}

.image_file_item span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image_file_item span:last-child {
  flex: 0 0 auto;
  color: #6a7687;
  font-size: 0.88rem;
  font-weight: 700;
}

.dark-mode .image_file_item {
  background: rgba(239, 244, 248, 0.08);
  color: #e5edf8;
}

.dark-mode .image_file_item span:last-child {
  color: #b6c2d1;
}

.image_batch_results {
  display: grid;
  min-width: 0;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(128, 139, 154, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 45px rgba(31, 44, 65, 0.08);
}

.image_batch_results[hidden] {
  display: none;
}

.image_batch_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.image_batch_header div {
  display: grid;
  gap: 0.15rem;
}

.image_batch_header strong {
  color: #203045;
  font-size: 1rem;
}

.image_batch_header span,
.image_batch_item small {
  color: #667386;
}

.image_batch_header button {
  border: 1px solid rgba(48, 126, 165, 0.22);
  border-radius: 999px;
  background: #e8f4f8;
  color: #17495f;
  cursor: pointer;
  font-weight: 900;
  padding: 0.6rem 0.9rem;
}

.image_batch_header button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.image_batch_list {
  display: grid;
  gap: 0.5rem;
}

.image_batch_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(117, 132, 151, 0.12);
  border-radius: 16px;
  background: rgba(245, 248, 252, 0.82);
  color: #273449;
  text-decoration: none;
}

.image_batch_item span {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.image_batch_item strong,
.image_batch_item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image_batch_item.is-ready small:not(.image_batch_size) {
  display: none;
}

.image_batch_item b {
  flex: 0 0 auto;
  color: #1c4b22;
  font-size: 0.88rem;
}

.image_batch_item.is-error {
  background: #fff4f4;
  color: #7a2020;
}

.image_batch_item.is-error b {
  color: #9f2727;
}

.dark-mode .image_batch_results {
  background: rgba(24, 29, 38, 0.92);
  border-color: rgba(194, 207, 224, 0.16);
}

.dark-mode .image_batch_header strong {
  color: #edf5ff;
}

.dark-mode .image_batch_header span,
.dark-mode .image_batch_item small {
  color: #b6c2d1;
}

.dark-mode .image_batch_header button {
  background: rgba(95, 204, 220, 0.14);
  border-color: rgba(124, 202, 232, 0.22);
  color: #bceff6;
}

.dark-mode .image_batch_item {
  background: rgba(239, 244, 248, 0.08);
  border-color: rgba(214, 225, 239, 0.12);
  color: #e5edf8;
}

.dark-mode .image_batch_item b {
  color: #bff2bd;
}

.dark-mode .image_batch_item.is-error {
  background: rgba(159, 39, 39, 0.16);
  color: #ffd2d2;
}

.dark-mode .image_batch_item.is-error b {
  color: #ffb3b3;
}

@media screen and (max-width: 980px) {
  .image_tools_workspace {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 640px) {
  .image_panel_section {
    grid-template-columns: 1fr;
  }

  .image_tools_preview {
    min-height: 280px;
    height: clamp(280px, 48vh, 460px);
  }
}

@media screen and (max-width: 360px) {
  .main[data-page="image-tools"] .main_1 {
    padding: 18px 10px;
  }

  .image_tools_shell,
  .image_tools_workspace {
    gap: 0.75rem;
  }

  .image_tools_trust,
  .image_tools_drop,
  .image_tools_preview,
  .image_tools_controls,
  .image_tools_status,
  .image_tools_file_list,
  .image_batch_results {
    border-radius: 16px;
  }

  .image_tools_trust,
  .image_tools_status,
  .image_tools_file_list {
    padding: 0.75rem;
  }

  .image_tools_drop,
  .image_tools_preview,
  .image_tools_controls,
  .image_tool_panel {
    padding: 0.75rem;
  }

  .image_preview_badge {
    max-width: calc(100% - 1rem);
    padding: 0.38rem 0.55rem;
    font-size: 0.72rem;
  }

  .image_empty_preview {
    min-height: 220px;
    padding: 1rem;
  }

  .image_tool_tabs,
  .image_transform_grid,
  .image_tools_actions {
    grid-template-columns: 1fr;
  }

  .image_tool_tabs button {
    min-height: 38px;
    padding: 0.5rem 0.58rem;
  }

  .image_transform_grid button {
    min-height: 74px;
  }

  .image_transform_grid svg {
    width: 28px;
    height: 28px;
  }

  .image_transform_grid span,
  .image_tool_panel label,
  .image_panel_section label {
    font-size: 0.82rem;
  }

  .image_tools_actions {
    gap: 0.5rem;
  }

  .image_batch_header,
  .image_batch_item,
  .image_file_item {
    gap: 0.5rem;
  }
}
