.graphics-tool {
    display: grid;
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.graphics-tool h1 {
    margin: 0 0 8px;
    color: #1a1a1a;
    font-size: 30px;
}

.graphics-card {
    display: grid;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    padding: 24px;
    box-shadow: var(--shadow);
}

.graphics-card label,
.graphics-field span,
.graphics-checkbox {
    color: #475467;
    font-weight: 700;
}

.graphics-field {
    display: grid;
    gap: 8px;
}

.graphics-field input[type="file"] {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    padding: 12px;
    font: 15px/1.45 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.graphics-field input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.graphics-field input:focus,
.graphics-result textarea:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(37, 99, 235, 0.16);
}

.graphics-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.graphics-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.graphics-actions,
.graphics-result__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.graphics-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 6px;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
}

.graphics-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.graphics-button--primary,
.graphics-actions .graphics-button {
    background: var(--primary);
    color: #ffffff;
}

.graphics-button--success {
    background: #15803d;
    color: #ffffff;
}

.graphics-button--danger {
    background: #b42318;
    color: #ffffff;
}

.graphics-status {
    color: var(--muted);
    font-weight: 700;
}

.graphics-storage {
    gap: 0;
    padding: 0;
}

.graphics-storage summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 22px;
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    list-style: none;
}

.graphics-storage summary::-webkit-details-marker {
    display: none;
}

.graphics-storage summary::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.graphics-storage[open] summary::after {
    transform: translateY(4px) rotate(225deg);
}

.graphics-storage__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
    gap: 18px;
    border-top: 1px solid var(--border);
    padding: 20px 22px 18px;
}

.graphics-storage__stats {
    display: grid;
    gap: 10px;
    margin: 0;
}

.graphics-storage__stats div {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    background: #f8fafc;
}

.graphics-storage__stats dt,
.graphics-storage__stats dd {
    margin: 0;
}

.graphics-storage__stats dt {
    color: #475467;
    font-weight: 800;
}

.graphics-storage__stats dd {
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
}

.graphics-storage__actions {
    display: grid;
    align-content: start;
    gap: 10px;
}

.graphics-storage .graphics-status {
    min-height: 20px;
    padding: 0 22px 18px;
}

.graphics-progress {
    display: grid;
    gap: 10px;
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    background: #eef4ff;
    color: #475467;
    padding: 12px;
}

.graphics-progress[hidden],
.graphics-result[hidden],
.graphics-result textarea[hidden],
.graphics-result button[hidden] {
    display: none;
}

.graphics-progress__top,
.graphics-progress__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 700;
}

.graphics-progress__top strong {
    color: var(--primary);
    font-weight: 800;
}

.graphics-progress__track {
    overflow: hidden;
    height: 12px;
    border-radius: 999px;
    background: #dbe7ff;
}

.graphics-progress__bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 0.25s ease;
}

.graphics-result textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    color: var(--text);
    background: #ffffff;
    font: 15px/1.45 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    resize: vertical;
}

.graphics-errors {
    border-left: 4px solid #dc2626;
    border-radius: 4px;
    background: #fff1f2;
    color: #991b1b;
    padding: 10px 12px;
}

.graphics-errors p {
    margin: 0;
}

.graphics-errors p + p {
    margin-top: 6px;
}

@media (max-width: 640px) {
    .graphics-tool h1 {
        font-size: 25px;
    }

    .graphics-actions,
    .graphics-result__actions,
    .graphics-progress__top,
    .graphics-progress__meta {
        align-items: stretch;
        flex-direction: column;
    }

    .graphics-storage__body {
        grid-template-columns: 1fr;
    }

    .graphics-storage__stats div {
        grid-template-columns: 1fr;
    }
}
