:root {
    --tools-content-max-width: 1440px;
    --tools-content-gutter: 24px;
}
@media (min-width: 1024px) { :root { --tools-content-gutter: 32px; } }
@media (max-width: 600px) { :root { --tools-content-gutter: 12px; } }

html,
body {
    overflow-x: hidden;
    min-height: 100vh;
}

body {
    color: #1f2937;
}

.bg-tools-grid {
    background:
        linear-gradient(135deg, rgba(236, 253, 245, 0.7), rgba(255, 255, 255, 0.9), rgba(240, 253, 250, 0.7)),
        radial-gradient(#d1d5db 1px, transparent 1px);
    background-size: auto, 28px 28px;
}

.footer-grid {
    background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.8;
}

.navbar-blur {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
    border-bottom-color: rgba(229, 231, 235, 0.9);
}

.mobile-nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    color: #4b5563;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.mobile-nav-link:hover {
    color: #111827;
    background: #f9fafb;
}

.mobile-nav-link-active {
    color: #059669;
    background: #ecfdf5;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #ea580c;
}

.footer-link-dot {
    flex: 0 0 auto;
    width: 0.25rem;
    height: 0.25rem;
    border-radius: 999px;
    background: #d1d5db;
    transition: background-color 0.2s ease;
}

.footer-link:hover .footer-link-dot {
    background: #f97316;
}

.footer-link [data-i18n] {
    min-width: 0;
}

.tools-shell {
    max-width: var(--tools-content-max-width);
    margin: 0 auto;
    padding: 2rem var(--tools-content-gutter) 4rem;
}

.tools-hero {
    padding: 4rem 0 2rem;
}

.tools-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 0.875rem;
    font-weight: 700;
}

.tool-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 0.75rem;
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.06);
}

.glass {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 0.75rem;
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.06);
}

.glass-light {
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.28);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-purple {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.btn-purple:hover {
    background: linear-gradient(135deg, #2dd4bf, #14b8a6);
    box-shadow: 0 12px 28px rgba(20, 184, 166, 0.24);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    transition: box-shadow 0.2s ease;
    cursor: pointer;
}

.btn-danger:hover {
    box-shadow: 0 10px 26px rgba(239, 68, 68, 0.22);
}

.tool-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    min-width: 10rem;
    padding: 0 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.tool-action-button-wide {
    min-width: 14rem;
}

.tool-action-button.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .tool-action-button {
        width: 100%;
        min-width: 0;
    }
}

.progress-bar {
    background: linear-gradient(90deg, #10b981, #14b8a6);
    transition: width 0.3s ease;
}

.audio-file-header {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
}

.audio-file-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-file-actions > * {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .audio-file-header {
        grid-template-columns: 2.5rem minmax(0, 1fr);
        gap: 0.75rem;
    }

    .audio-file-actions {
        grid-column: 2;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}

.waveform-container {
    position: relative;
    cursor: crosshair;
}

.waveform-canvas {
    width: 100%;
    height: 128px;
}

.selection-overlay {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(16, 185, 129, 0.18);
    border-left: 2px solid #10b981;
    border-right: 2px solid #10b981;
    pointer-events: none;
}

.track-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.track-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    width: 100%;
    height: 28px;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: #dbe4f0;
    border: 1px solid #cbd5e1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #ffffff;
    margin-top: -6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
    transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: #dbe4f0;
    border: 1px solid #cbd5e1;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.file-drop {
    border: 2px dashed #cbd5e1;
    background: rgba(255, 255, 255, 0.88);
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.file-drop:hover,
.file-drop.dragover {
    border-color: #10b981;
    background: #ecfdf5;
    box-shadow: 0 14px 32px rgba(16, 185, 129, 0.1);
}

.nav-link {
    position: relative;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #10b981;
    border-radius: 1px;
}

.fade-in {
    opacity: 1;
    transform: none;
    animation: toolsFadeIn 0.35s ease-out both;
}

@keyframes toolsFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spinner {
    border: 3px solid #e5e7eb;
    border-top: 3px solid #10b981;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
    background-color: #fff !important;
    color: #1f2937 !important;
    border-color: #d0d5dd !important;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (max-width: 640px) {
    .tools-shell {
        padding: 1.25rem var(--tools-content-gutter) 3rem;
    }

    .tools-hero {
        padding-top: 2.5rem;
    }
}
