.wp-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 170px;
    padding: 20px;
    border: 2px dashed #7fc6d6;
    border-radius: 5px;
    background: #f8fafc;
    color: #151d39;
    text-align: center;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease;
  }
  .wp-drop:hover,
  .wp-drop.is-over {
    border-color: #151d39;
    background: #eef6f8;
  }
  .wp-drop input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }
  .wp-drop:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
  }
  /* Without this, dragging over the text fires dragleave on the box and the highlight flickers */
  .wp-drop > span {
    pointer-events: none;
  }
  .wp-drop-title {
    font-size: 18px;
    font-weight: 700;
  }
  .wp-drop-sub {
    font-size: 14px;
  }
  .wp-drop-limit {
    font-size: 12px;
    color: #475569;
    margin-top: 4px;
  }

  .wp-options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
  }
  .wp-option {
    display: flex;
    flex-direction: column;
    min-width: 160px;
  }
  .wp-option.is-hidden {
    display: none;
  }
  .wp-option .input {
    width: 220px;
    max-width: 100%;
    padding: 8px 10px;
  }

  /* Image Resizer */
  .rs-size {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .wp-option .rs-size .input {
    width: 110px;
  }
  .rs-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
  }
  .rs-preset {
    padding: 4px 10px;
    border: 1px solid #7fc6d6;
    border-radius: 5px;
    background: #f8fafc;
    color: #151d39;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
  .rs-preset:hover {
    border-color: #151d39;
  }
  .rs-check {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 14px;
    color: #151d39;
    cursor: pointer;
  }
  .rs-check input {
    -webkit-appearance: auto;
    appearance: auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #151d39;
  }
  .wp-format {
    display: flex;
    gap: 8px;
  }
  .wp-format label {
    cursor: pointer;
  }
  .wp-format input {
    position: absolute;
    opacity: 0;
  }
  .wp-format span {
    display: inline-block;
    padding: 8px 18px;
    border: 2px solid #151d39;
    border-radius: 5px;
    font-weight: 600;
    color: #151d39;
  }
  .wp-format input:checked + span {
    background-color: #151d39;
    color: #F7D720;
  }
  .wp-format input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(59,130,246,.35);
  }
  .wp-option input[type="range"] {
    -webkit-appearance: auto;
    appearance: auto;
    width: 200px;
    max-width: 100%;
    accent-color: #151d39;
    margin-top: 8px;
  }
  .wp-option input[type="color"] {
    -webkit-appearance: auto;
    appearance: auto;
    width: 60px;
    height: 36px;
    padding: 2px;
    border: 1px solid #7fc6d6;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
  }

  .wp-progress {
    margin-top: 15px;
  }
  .wp-progress[hidden] {
    display: none;
  }
  .wp-progress-info {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #151d39;
    margin-bottom: 6px;
  }
  .wp-progress-track {
    height: 10px;
    border-radius: 5px;
    background: #e5e7eb;
    overflow: hidden;
  }
  .wp-progress-fill {
    width: 0;
    height: 100%;
    background: #151d39;
    transition: width .3s ease;
  }
  .wp-progress.is-done .wp-progress-fill {
    background: #16a34a;
  }

  .wp-hint {
    font-size: 13px;
    color: #475569;
    margin: 10px 0 0;
  }

  .wp-list {
    list-style: none;
    margin: 15px 0 0;
    padding: 0;
  }
  .wp-list:empty {
    display: none;
  }
  .wp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid #7fc6d6;
    border-radius: 5px;
    background: #fff;
  }
  .wp-item + .wp-item {
    margin-top: 10px;
  }
  .wp-thumb {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 12px 12px;
  }
  .wp-info {
    flex: 1;
    min-width: 0;
  }
  .wp-name {
    display: block;
    font-weight: 600;
    color: #151d39;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .wp-meta {
    display: block;
    font-size: 13px;
    color: #475569;
    margin-top: 2px;
  }
  .wp-meta.is-error {
    color: #dc2626;
  }
  .wp-meta.is-warning {
    color: #b45309;
    font-weight: 600;
  }
  .wp-item .submit {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 8px 14px;
    text-decoration: none;
  }

  .wp-item-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
  }
  .wp-icon-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 2px solid #151d39;
    border-radius: 5px;
    background: transparent;
    color: #151d39;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
  }
  .wp-icon-btn:hover {
    background: #eef6f8;
  }
  .wp-icon-btn[disabled] {
    opacity: .35;
    cursor: not-allowed;
  }

  .wp-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
    padding: 15px;
    border: 2px solid #16a34a;
    border-radius: 5px;
    background: #f0fdf4;
    color: #151d39;
  }
  .wp-result[hidden] {
    display: none;
  }
  .wp-result .submit {
    text-decoration: none;
  }

  /* Video to GIF */
  .wp-drop.is-disabled {
    opacity: .6;
    cursor: not-allowed;
  }
  .vg-editor {
    margin-top: 15px;
  }
  .vg-editor[hidden] {
    display: none;
  }
  .vg-video {
    display: block;
    width: 100%;
    max-height: 420px;
    border-radius: 5px;
    background: #000;
  }
  .vg-info {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #151d39;
    overflow-wrap: anywhere;
  }
  .vg-info.is-error,
  .wp-hint.is-error {
    color: #dc2626;
  }
  .vg-time {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .wp-option .vg-time .input {
    width: 90px;
  }
  .vg-plays {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 14px;
    color: #151d39;
  }
  .wp-option .vg-plays .input {
    width: 70px;
    padding: 6px 8px;
  }
  .wp-option .vg-plays .input[disabled] {
    opacity: .5;
  }
  /* Typing 0 plays switches to Loop forever; the flash shows what happened */
  .rs-check.is-flash,
  .vg-time .input.is-flash {
    animation: vg-flash 1.6s ease-out;
    border-radius: 4px;
  }
  @keyframes vg-flash {
    0%, 40% { background: #F7D720; box-shadow: 0 0 0 4px #F7D720; }
    100% { background: transparent; box-shadow: 0 0 0 4px transparent; }
  }
  .vg-result {
    display: block;
    text-align: center;
  }
  /* Shown at its real size (up to the box width), so a change of width is visible */
  .vg-preview {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 12px;
    border-radius: 4px;
    background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 12px 12px;
  }
  .vg-result-info {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
  }

  /* GIF Maker: image cards in a grid, 4 per row on desktop and tablet, 3 on phones */
  .gm-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
    margin: 15px 0 0;
    padding: 0;
  }
  .gm-grid:empty,
  .gm-grid[hidden] {
    display: none;
  }
  .gm-add {
    display: flex;
  }
  .gm-add[hidden] {
    display: none;
  }
  .gm-add-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 150px;
    padding: 6px;
    border: 2px dashed #7fc6d6;
    border-radius: 5px;
    background: #f8fafc;
    color: #151d39;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease;
  }
  .gm-add-btn:hover,
  .gm-add.is-over .gm-add-btn {
    border-color: #151d39;
    background: #eef6f8;
  }
  .gm-add-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,130,246,.35);
  }
  .gm-add-btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
  }
  .gm-add-plus {
    font-size: 34px;
    font-weight: 400;
    line-height: 1;
  }
  .gm-add-btn small {
    font-size: 11px;
    font-weight: 400;
    color: #475569;
  }
  .gm-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 6px;
    border: 1px solid #7fc6d6;
    border-radius: 5px;
    background: #fff;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    transition: opacity .15s ease, box-shadow .15s ease;
  }
  .gm-card.is-dragging {
    opacity: .45;
    box-shadow: 0 0 0 2px #151d39;
  }
  .gm-grid.is-sorting,
  .gm-grid.is-sorting * {
    cursor: grabbing;
  }
  .gm-card.is-error {
    border-color: #dc2626;
  }
  .gm-media {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    overflow: hidden;
    background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 12px 12px;
  }
  .gm-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    transition: opacity .15s ease, filter .15s ease;
  }
  .gm-card.is-off .gm-img {
    opacity: .3;
    filter: grayscale(1);
  }
  .gm-toggle {
    position: absolute;
    top: 4px;
    left: 4px;
    display: flex;
    padding: 3px;
    border-radius: 4px;
    background: rgba(255,255,255,.9);
    cursor: pointer;
  }
  .gm-toggle input {
    -webkit-appearance: auto;
    appearance: auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #151d39;
    cursor: pointer;
  }
  .gm-media .gm-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-width: 1px;
    background: rgba(255,255,255,.9);
    font-size: 14px;
  }
  .gm-badge {
    position: absolute;
    left: 4px;
    bottom: 4px;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 10px;
    background: #151d39;
    color: #F7D720;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
  }
  .gm-card.is-off .gm-badge {
    background: #64748b;
    color: #fff;
  }
  .gm-card.is-error .gm-badge {
    background: #dc2626;
    color: #fff;
  }
  /* Settings panel shared by the image tools: boxes in two columns (one on phones), each with a heading and value chip */
  .tool-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
    border: 1px solid #dbe7ee;
    border-radius: 8px;
    background: #f1f5f9;
  }
  .tool-panel .tool-field {
    min-width: 0;
    gap: 10px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
  }
  .tool-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 24px;
    font-size: 14px;
    font-weight: 700;
    color: #151d39;
  }
  .tool-field-head label {
    cursor: pointer;
  }
  .tool-chip {
    flex: 0 0 auto;
    padding: 2px 10px;
    border-radius: 999px;
    background: #151d39;
    color: #F7D720;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    white-space: nowrap;
  }
  .tool-chip small {
    color: #cbd5e1;
    font-weight: 400;
  }
  .tool-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #64748b;
  }
  /* Joined (segmented) buttons that fill the box */
  .tool-panel .wp-format {
    gap: 0;
    border: 2px solid #151d39;
    border-radius: 6px;
    overflow: hidden;
  }
  .tool-panel .wp-format label {
    flex: 1;
    min-width: 0;
  }
  .tool-panel .wp-format span {
    display: block;
    padding: 7px 4px;
    border: 0;
    border-radius: 0;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
  }
  .tool-panel .wp-format label + label span {
    border-left: 1px solid #151d39;
  }
  .tool-panel .wp-format label:hover input:not(:checked):not(:disabled) + span {
    background: #eef6f8;
  }
  .tool-panel .wp-format input:focus-visible + span {
    box-shadow: inset 0 0 0 3px rgba(59,130,246,.45);
  }
  .tool-panel .wp-format input:disabled + span {
    opacity: .55;
    cursor: not-allowed;
  }
  .tool-panel .wp-option input[type="range"] {
    width: 100%;
    margin: 0;
  }
  .tool-panel .wp-option select.input {
    width: 100%;
  }
  .tool-panel .rs-check {
    margin-top: 0;
  }
  .tool-panel .vg-plays {
    margin-top: 0;
  }
  .gm-bg {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .tool-panel .wp-option .gm-bg input[type="color"] {
    width: 56px;
    height: 36px;
  }
  .tool-panel {
    margin-top: 15px;
  }
  .gm-settings .tool-panel {
    margin-top: 0;
  }
  .tool-panel .wp-option .input {
    width: 100%;
  }
  /* Number boxes share the row: width × height, or a size with its unit */
  .tool-panel .wp-option .rs-size .input {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .tool-panel .rs-size span {
    flex: 0 0 auto;
    font-weight: 600;
    color: #475569;
  }
  .tool-panel .rs-presets {
    margin-top: 0;
  }
  .tool-panel .rs-preset {
    padding: 4px 12px;
    border-color: #cbd5e1;
    border-radius: 999px;
    background: #fff;
    font-size: 12px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  }
  .tool-panel .rs-preset:hover {
    border-color: #151d39;
    background: #151d39;
    color: #F7D720;
  }
  .tool-panel .wp-option input[type="color"] {
    width: 56px;
    height: 36px;
  }
  .tool-panel .wp-option .vg-time .input {
    width: 100%;
  }
  .tool-panel .wp-option .vg-plays .input {
    width: 70px;
  }
  .tool-field-head small {
    font-weight: 400;
    color: #64748b;
  }
  /* Explanation under the settings panel */
  .tool-panel + .wp-hint {
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 13px;
    line-height: 1.5;
  }

  /* GIF Resizer: the original GIF shown above its settings */
  .gr-original {
    margin-bottom: 8px;
  }
  .gr-editor .vg-info {
    text-align: center;
  }

  /* Summary line under the settings */
  .tool-summary {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-left: 4px solid #151d39;
    border-radius: 6px;
    background: #eef6f8;
    font-size: 13px;
    color: #151d39;
  }
  .tool-summary:empty {
    display: none;
  }
  /* Keep the summary look even right after the panel, where plain hints get a grey box */
  .tool-panel + .wp-hint.tool-summary {
    border: 0;
    border-left: 4px solid #151d39;
    background: #eef6f8;
  }
  .tool-summary.is-error,
  .tool-panel + .wp-hint.tool-summary.is-error {
    border-left-color: #dc2626;
    background: #fef2f2;
  }
  @media (max-width: 600px) {
    .tool-panel {
      grid-template-columns: 1fr;
      padding: 8px;
      gap: 8px;
    }
  }
  .gm-name {
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    color: #151d39;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gm-meta {
    font-size: 11px;
    line-height: 1.3;
    color: #475569;
    overflow-wrap: anywhere;
  }
  .gm-meta.is-error {
    color: #dc2626;
  }
  .gm-split {
    margin-top: 2px;
    padding: 4px;
    border: 1px solid #151d39;
    border-radius: 4px;
    background: #F7D720;
    color: #151d39;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
  }
  .gm-split[hidden] {
    display: none;
  }
  .gm-split[disabled] {
    opacity: .6;
    cursor: wait;
  }
  .gm-move {
    display: flex;
    gap: 4px;
    margin-top: auto;
  }
  .gm-move .wp-icon-btn {
    flex: 1;
    width: auto;
    height: 26px;
    border-width: 1px;
    font-size: 14px;
  }
  @media (max-width: 520px) {
    .gm-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }
  }

  @media (max-width: 520px) {
    .wp-item {
      flex-wrap: wrap;
    }
    .wp-item .submit {
      width: 100%;
      text-align: center;
    }
  }
