/* ===== Image Compressor & Converter Styles ===== */

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.app-view-open {
    display: block;
}

.imgtool-app [hidden],
.imgtool-app[hidden] {
    display: none !important;
}

.imgtool-intro {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0.4rem 0 1rem;
}

.imgtool-intro strong {
    color: var(--text-primary);
    font-weight: 600;
}

.imgtool-intro i {
    color: var(--secondary-violet);
}

.imgtool-app {
    background: var(--gradient-card);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.imgtool-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ----- Upload ----- */
.imgtool-dropzone {
    width: 100%;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 2rem 1.25rem;
    border-radius: 14px;
    border: 2px dashed rgba(139, 92, 246, 0.45);
    background: rgba(15, 15, 26, 0.45);
    color: var(--text-secondary);
    font: inherit;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.imgtool-dropzone:hover,
.imgtool-dropzone.dragover {
    border-color: var(--primary-violet);
    background: rgba(139, 92, 246, 0.12);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.imgtool-dropzone:focus-visible,
.imgtool-tab:focus-visible,
.imgtool-btn:focus-visible,
.imgtool-primary-btn:focus-visible,
.imgtool-chip:focus-visible,
.imgtool-format-option input:focus-visible + .imgtool-format-card,
.imgtool-check input:focus-visible,
.imgtool-crop-box:focus-visible,
.imgtool-details summary:focus-visible {
    outline: 3px solid var(--secondary-violet);
    outline-offset: 2px;
}

.imgtool-dropzone-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--gradient-main);
    color: #fff;
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}

.imgtool-dropzone-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.imgtool-dropzone-link {
    color: var(--secondary-violet);
    text-decoration: underline;
    font-weight: 600;
}

.imgtool-dropzone-formats {
    font-size: 0.82rem;
    max-width: 560px;
    color: var(--text-muted);
}

.imgtool-file-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.25);
    background: rgba(15, 15, 26, 0.45);
}

.imgtool-file-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 260px;
}

.imgtool-file-meta > i {
    font-size: 1.6rem;
    color: var(--secondary-violet);
    flex-shrink: 0;
}

.imgtool-file-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.imgtool-file-text strong {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.imgtool-file-text span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.imgtool-file-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ----- Notices & status ----- */
.imgtool-notices {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.imgtool-notices:empty {
    display: none;
}

.imgtool-notice {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-size: 0.88rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-secondary);
}

.imgtool-notice i {
    margin-top: 0.2rem;
    color: var(--secondary-violet);
}

.imgtool-notice.warn {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.1);
}

.imgtool-notice.warn i {
    color: #f5b544;
}

.imgtool-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-height: 0;
}

.imgtool-status:empty {
    display: none;
}

.imgtool-status.error,
.imgtool-error {
    color: #ff7a7a;
}

.imgtool-status.success {
    color: #52db93;
}

.imgtool-error {
    font-size: 0.86rem;
}

.imgtool-error:empty {
    display: none;
}

/* ----- Tabs ----- */
.imgtool-tabs {
    display: flex;
    gap: 0.35rem;
    background: rgba(139, 92, 246, 0.08);
    padding: 0.35rem;
    border-radius: 12px;
    border: 2px solid rgba(139, 92, 246, 0.2);
    margin-bottom: 1rem;
}

.imgtool-tab {
    flex: 1;
    padding: 0.6rem 0.75rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.imgtool-tab:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

.imgtool-tab.active {
    background: var(--gradient-main);
    color: #fff;
    box-shadow: var(--shadow-violet);
}

/* ----- Main grid ----- */
.imgtool-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 1.5rem;
    align-items: start;
}

.imgtool-controls,
.imgtool-panel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-width: 0;
}

.imgtool-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    border: 0;
}

.imgtool-field label,
.imgtool-label,
.imgtool-fieldset legend {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.imgtool-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.imgtool-label-row output {
    font-weight: 700;
    color: var(--secondary-violet);
}

.imgtool-select,
.imgtool-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-card);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.imgtool-select option {
    background: #1a1a2e;
    color: #fff;
}

.imgtool-select:focus,
.imgtool-input:focus {
    outline: none;
    border-color: var(--primary-violet);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.imgtool-input[aria-invalid="true"] {
    border-color: #ff7a7a;
}

.imgtool-help {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
}

.imgtool-help:empty {
    display: none;
}

.imgtool-help i {
    color: var(--secondary-violet);
}

.imgtool-warn-text,
.imgtool-warn-text i {
    color: #f5b544;
}

.imgtool-slider-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.imgtool-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 3px;
    cursor: pointer;
}

.imgtool-slider:focus-visible {
    outline: 3px solid var(--secondary-violet);
    outline-offset: 4px;
}

.imgtool-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--gradient-main);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.imgtool-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--gradient-main);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.imgtool-slider:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ----- Buttons ----- */
.imgtool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.2);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.imgtool-btn:hover:not(:disabled) {
    border-color: var(--primary-violet);
    background: rgba(139, 92, 246, 0.28);
}

.imgtool-btn.secondary {
    border-color: rgba(236, 72, 153, 0.35);
    background: rgba(236, 72, 153, 0.15);
}

.imgtool-btn.secondary:hover:not(:disabled) {
    border-color: rgba(236, 72, 153, 0.65);
    background: rgba(236, 72, 153, 0.22);
}

.imgtool-btn:disabled,
.imgtool-primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.imgtool-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: #fff;
    background: var(--gradient-main);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
}

.imgtool-primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-violet);
}

.imgtool-download-btn {
    padding: 0.9rem 1.6rem;
    font-size: 1rem;
}

.imgtool-icon-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.imgtool-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.imgtool-chip {
    border: 1px solid rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
}

.imgtool-chip:hover {
    border-color: var(--primary-violet);
    color: var(--text-primary);
}

.imgtool-chip.active {
    background: var(--gradient-main);
    border-color: transparent;
    color: #fff;
}

/* ----- Resize ----- */
.imgtool-dim-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 0.6rem;
}

.imgtool-dim-x {
    padding-bottom: 0.65rem;
    color: var(--text-muted);
}

.imgtool-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}

.imgtool-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-violet);
    cursor: pointer;
}

.imgtool-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.5rem;
}

/* ----- Convert ----- */
.imgtool-fieldset {
    border: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.imgtool-fieldset legend {
    margin-bottom: 0.45rem;
}

.imgtool-format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.55rem;
}

.imgtool-format-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.imgtool-format-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.imgtool-format-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    height: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 2px solid rgba(139, 92, 246, 0.22);
    background: rgba(15, 15, 26, 0.35);
    transition: var(--transition);
}

.imgtool-format-card strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.imgtool-format-card span {
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.35;
}

.imgtool-format-option:hover .imgtool-format-card {
    border-color: rgba(139, 92, 246, 0.55);
}

.imgtool-format-option input:checked + .imgtool-format-card {
    border-color: var(--primary-violet);
    background: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.25);
}

.imgtool-format-option.unavailable {
    cursor: not-allowed;
}

.imgtool-format-option.unavailable .imgtool-format-card {
    opacity: 0.5;
    border-style: dashed;
}

.imgtool-color-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.imgtool-color-row input[type="color"] {
    width: 48px;
    height: 36px;
    padding: 2px;
    border-radius: 8px;
    border: 2px solid rgba(139, 92, 246, 0.35);
    background: transparent;
    cursor: pointer;
}

.imgtool-details {
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.imgtool-details summary {
    cursor: pointer;
    color: var(--secondary-violet);
    font-weight: 500;
}

.imgtool-details ul {
    list-style: disc;
    padding-left: 1.2rem;
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* ----- Preview ----- */
.imgtool-preview-panel {
    min-width: 0;
}

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

.imgtool-figure {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.imgtool-figure figcaption {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.checkerboard {
    background-color: rgba(15, 15, 26, 0.55);
    background-image:
        linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.06) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.06) 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.imgtool-preview-box {
    position: relative;
    min-height: 220px;
    border-radius: 14px;
    border: 2px dashed rgba(139, 92, 246, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem;
    overflow: hidden;
}

.imgtool-preview-box img {
    max-width: 100%;
    max-height: 340px;
    object-fit: contain;
    border-radius: 6px;
}

.imgtool-preview-box img:not([src]) {
    visibility: hidden;
}

.imgtool-processing {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(15, 15, 26, 0.65);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.imgtool-preview-meta {
    color: var(--text-secondary);
    font-size: 0.82rem;
    word-break: break-word;
}

.imgtool-preview-meta:empty {
    display: none;
}

/* ----- Crop editor ----- */
.imgtool-crop-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.imgtool-crop-stage {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    border-radius: 6px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: crosshair;
    line-height: 0;
}

.imgtool-crop-stage canvas {
    display: block;
}

.imgtool-crop-box {
    position: absolute;
    border: 2px solid #fff;
    box-shadow: 0 0 0 9999px rgba(8, 8, 18, 0.58);
    cursor: move;
    outline: none;
}

.imgtool-crop-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, transparent calc(33.333% - 0.5px), rgba(255, 255, 255, 0.45) calc(33.333% - 0.5px), rgba(255, 255, 255, 0.45) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px), transparent calc(66.666% - 0.5px), rgba(255, 255, 255, 0.45) calc(66.666% - 0.5px), rgba(255, 255, 255, 0.45) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px)),
        linear-gradient(to bottom, transparent calc(33.333% - 0.5px), rgba(255, 255, 255, 0.45) calc(33.333% - 0.5px), rgba(255, 255, 255, 0.45) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px), transparent calc(66.666% - 0.5px), rgba(255, 255, 255, 0.45) calc(66.666% - 0.5px), rgba(255, 255, 255, 0.45) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px));
}

.imgtool-crop-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid var(--primary-violet);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.imgtool-crop-handle::after {
    content: '';
    position: absolute;
    inset: -10px;
}

.imgtool-crop-handle[data-handle="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.imgtool-crop-handle[data-handle="n"] { left: 50%; top: 0; cursor: ns-resize; }
.imgtool-crop-handle[data-handle="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.imgtool-crop-handle[data-handle="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.imgtool-crop-handle[data-handle="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.imgtool-crop-handle[data-handle="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.imgtool-crop-handle[data-handle="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.imgtool-crop-handle[data-handle="w"] { left: 0; top: 50%; cursor: ew-resize; }

/* ----- Result bar ----- */
.imgtool-result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: 14px;
    background: rgba(15, 15, 26, 0.55);
    border: 1px solid rgba(139, 92, 246, 0.18);
}

.imgtool-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.6rem;
    flex: 1 1 360px;
    min-width: 0;
}

.imgtool-stat dt {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.imgtool-stat dd {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.imgtool-stat dd.smaller {
    color: #52db93;
}

.imgtool-stat dd.larger {
    color: #f5b544;
}

.imgtool-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
}

.imgtool-filename {
    margin-top: 0.5rem;
    word-break: break-all;
}

/* ----- Info / SEO content ----- */
.imgtool-about-container {
    background: rgba(15, 15, 26, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 10rem;
}

.imgtool-info-section h2 {
    font-size: 1.35rem;
    margin-bottom: 0.7rem;
}

.imgtool-info-section h3 {
    font-size: 1.08rem;
    margin: 1.4rem 0 0.6rem;
}

.imgtool-info-section p,
.imgtool-info-section li {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}

.imgtool-info-section ol {
    list-style: decimal;
    padding-left: 1.4rem;
}

.imgtool-info-section li {
    margin-bottom: 0.4rem;
}

.imgtool-info-section code {
    background: rgba(139, 92, 246, 0.15);
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    font-size: 0.88em;
}

.imgtool-info-section p a {
    color: var(--secondary-violet);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.imgtool-info-section p a:hover {
    color: var(--accent-pink);
}

.app-page-light .imgtool-info-section p a {
    color: #5B21B6;
}

.imgtool-info-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.imgtool-info-card {
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.06);
    padding: 0.9rem;
}

.imgtool-info-section .imgtool-info-card h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.imgtool-info-card h3 i {
    color: var(--secondary-violet);
}

.imgtool-info-section .imgtool-info-card p {
    margin: 0;
    font-size: 0.88rem;
}

.imgtool-table-wrap {
    overflow-x: auto;
    margin-bottom: 0.9rem;
}

.imgtool-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.imgtool-table th,
.imgtool-table td {
    text-align: left;
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.18);
    color: var(--text-secondary);
}

.imgtool-table thead th {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.12);
}

.imgtool-table tbody th {
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

.imgtool-faq {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.imgtool-faq-item {
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: rgba(139, 92, 246, 0.05);
}

.imgtool-faq-item h4 {
    margin-bottom: 0.35rem;
    font-size: 0.97rem;
}

.imgtool-info-section .imgtool-faq-item p {
    margin: 0;
    font-size: 0.9rem;
}

/* ===== Light theme ===== */
.app-page-light .imgtool-intro,
.app-page-light .imgtool-help,
.app-page-light .imgtool-preview-meta,
.app-page-light .imgtool-file-text span,
.app-page-light .imgtool-dropzone,
.app-page-light .imgtool-details,
.app-page-light .imgtool-check,
.app-page-light .imgtool-color-row,
.app-page-light .imgtool-figure figcaption,
.app-page-light .imgtool-notice,
.app-page-light .imgtool-info-section p,
.app-page-light .imgtool-info-section li,
.app-page-light .imgtool-table td {
    color: #555c78;
}

.app-page-light .imgtool-intro strong,
.app-page-light .imgtool-dropzone-title,
.app-page-light .imgtool-file-text strong,
.app-page-light .imgtool-stat dd,
.app-page-light .imgtool-format-card strong,
.app-page-light .imgtool-info-section h2,
.app-page-light .imgtool-info-section h3,
.app-page-light .imgtool-info-section h4,
.app-page-light .imgtool-info-section strong,
.app-page-light .imgtool-table th {
    color: #161b2e;
}

.app-page-light .imgtool-dropzone-formats,
.app-page-light .imgtool-stat dt,
.app-page-light .imgtool-slider-row,
.app-page-light .imgtool-dim-x,
.app-page-light .imgtool-format-card span {
    color: #5f6680;
}

.app-page-light .imgtool-field label,
.app-page-light .imgtool-label,
.app-page-light .imgtool-fieldset legend {
    color: #1a0c78;
}

.app-page-light .imgtool-dropzone,
.app-page-light .imgtool-file-bar,
.app-page-light .imgtool-result-bar,
.app-page-light .imgtool-about-container,
.app-page-light .imgtool-info-card,
.app-page-light .imgtool-faq-item,
.app-page-light .imgtool-format-card {
    background: rgba(255, 255, 255, 0.9);
}

.app-page-light .imgtool-dropzone:hover,
.app-page-light .imgtool-dropzone.dragover {
    background: rgba(237, 233, 254, 0.95);
}

.app-page-light .imgtool-select,
.app-page-light .imgtool-input {
    color: #161b2e;
    background: rgba(255, 255, 255, 0.95);
}

.app-page-light .imgtool-select option {
    background: #fff;
    color: #161b2e;
}

.app-page-light .imgtool-tab {
    color: #374151;
}

.app-page-light .imgtool-tab.active {
    color: #fff;
}

.app-page-light .imgtool-btn {
    color: #1b2140;
    border-color: rgba(91, 33, 182, 0.35);
    background: rgba(91, 33, 182, 0.14);
}

.app-page-light .imgtool-btn:hover:not(:disabled) {
    background: rgba(91, 33, 182, 0.2);
    border-color: rgba(91, 33, 182, 0.55);
}

.app-page-light .imgtool-btn.secondary {
    color: #5d173b;
    border-color: rgba(236, 72, 153, 0.45);
    background: rgba(236, 72, 153, 0.2);
}

.app-page-light .imgtool-chip {
    color: #312e81;
    border-color: rgba(91, 33, 182, 0.3);
    background: rgba(255, 255, 255, 0.85);
}

.app-page-light .imgtool-chip.active {
    color: #fff;
    background: var(--gradient-main);
}

.app-page-light .imgtool-format-option input:checked + .imgtool-format-card {
    background: rgba(237, 233, 254, 0.95);
}

.app-page-light .checkerboard {
    background-color: #ffffff;
    background-image:
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
}

.app-page-light .imgtool-warn-text,
.app-page-light .imgtool-warn-text i,
.app-page-light .imgtool-stat dd.larger {
    color: #b45309;
}

.app-page-light .imgtool-stat dd.smaller,
.app-page-light .imgtool-status.success {
    color: #15803d;
}

.app-page-light .imgtool-status.error,
.app-page-light .imgtool-error {
    color: #c62828;
}

.app-page-light .imgtool-notice.warn i {
    color: #b45309;
}

/* ===== Responsive ===== */
@media (max-width: 1280px) {
    .imgtool-main {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 980px) {
    .imgtool-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .imgtool-app {
        padding: 1rem;
    }

    .imgtool-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .imgtool-compare {
        grid-template-columns: minmax(0, 1fr);
    }

    .imgtool-result-actions {
        width: 100%;
    }

    .imgtool-result-actions > * {
        flex: 1 1 auto;
    }

    .imgtool-dropzone {
        min-height: 200px;
    }
}
