/* ══ PAGE STYLES ═══════════════════════════════════════════════════ */

/* ── Tool Hero ── */
.tool-hero {
    background: linear-gradient(145deg, #0a2420 0%, #0e2d27 45%, #133829 100%);
    padding: 56px 0 48px;
    position: relative;
    overflow: hidden;
}
.tool-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(78,179,154,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(78,179,154,.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
.tool-hero::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(ellipse, rgba(78,179,154,.10) 0%, transparent 65%);
    pointer-events: none;
}
.tool-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 32px;
}
.tool-hero-icon {
    width: 64px;
    height: 64px;
    background: rgba(78,179,154,.15);
    border: 1.5px solid rgba(78,179,154,.35);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 4px;
}
.tool-hero-icon svg {
    width: 30px;
    height: 30px;
    stroke: #6fd1b3;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tool-hero-text { flex: 1; }
.tool-hero-eyebrow {
    font-family: 'DM Mono', monospace;
    font-size: .65rem;
    font-weight: 500;
    color: rgba(111,209,179,.65);
    letter-spacing: .16em;
    text-transform: uppercase;
    margin-bottom: .85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.tool-hero-eyebrow::before { content: '//'; opacity: .45; }
.tool-hero h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -.025em;
    margin-bottom: .75rem;
}
.tool-hero h1 em { font-style: normal; color: #6fd1b3; }
.tool-hero-desc {
    font-size: .97rem;
    color: rgba(255,255,255,.55);
    line-height: 1.75;
    max-width: 620px;
    margin-bottom: 1.5rem;
}
.tool-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.tool-badge {
    font-family: 'DM Mono', monospace;
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 11px;
    border-radius: 20px;
    border: 1px solid rgba(78,179,154,.35);
    color: rgba(111,209,179,.8);
    background: rgba(78,179,154,.08);
}

/* ── Spec Alert ── */
.spec-alert {
    background: rgba(78,179,154,.08);
    border: 1.5px solid rgba(78,179,154,.3);
    border-left: 4px solid #4eb39a;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 28px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.spec-alert-icon {
    width: 36px;
    height: 36px;
    background: rgba(78,179,154,.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.spec-alert-icon svg {
    width: 18px;
    height: 18px;
    stroke: #4eb39a;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.spec-alert-body { flex: 1; }
.spec-alert-title {
    font-size: .875rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.spec-alert-text {
    font-size: .83rem;
    color: var(--text-muted);
    line-height: 1.65;
}
.spec-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.spec-pill {
    font-family: 'DM Mono', monospace;
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: #4eb39a;
    color: #0e2d27;
    letter-spacing: .04em;
}

/* ── Main Layout ── */
.tool-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    align-items: start;
    padding: 36px 0 48px;
}
@media (max-width: 900px) {
    .tool-layout { grid-template-columns: 1fr; }
}

/* ── Card ── */
.card-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.card-panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fafcfb;
}
.card-panel-header svg {
    width: 18px;
    height: 18px;
    stroke: var(--brand);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.card-panel-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
}
.card-panel-body { padding: 24px; }

/* ── Drop Zone ── */
.drop-zone {
    border: 2px dashed rgba(78,179,154,.35);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative;
    background: #f9fcfb;
}
.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--brand);
    background: var(--accent-light);
}
.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.drop-zone-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-light);
    border: 1.5px solid rgba(78,179,154,.3);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    transition: background .2s;
}
.drop-zone-icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--brand);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.drop-zone-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.drop-zone-sub {
    font-size: .83rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.drop-zone-formats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}
.drop-zone-format {
    font-family: 'DM Mono', monospace;
    font-size: .65rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(78,179,154,.1);
    color: var(--brand-dark);
    border: 1px solid rgba(78,179,154,.2);
}

/* ── File Info Card ── */
.file-info-card {
    background: var(--accent-light);
    border: 1px solid rgba(78,179,154,.25);
    border-radius: 10px;
    padding: 16px 18px;
    margin-top: 20px;
    display: none;
}
.file-info-card.visible { display: block; }
.file-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.file-info-icon {
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid rgba(78,179,154,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.file-info-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--brand);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.file-info-name {
    font-size: .875rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-all;
}
.file-info-size {
    font-family: 'DM Mono', monospace;
    font-size: .72rem;
    color: var(--text-muted);
}
.file-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.file-info-stat {
    background: #fff;
    border: 1px solid rgba(78,179,154,.2);
    border-radius: 8px;
    padding: 8px 12px;
}
.file-info-stat-label {
    font-family: 'DM Mono', monospace;
    font-size: .62rem;
    font-weight: 500;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 3px;
}
.file-info-stat-value {
    font-size: .83rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 5px;
}
.check-ok  { color: #16a34a; }
.check-bad { color: #dc2626; }
.check-warn{ color: #d97706; }

/* ── Waveform ── */
.waveform-wrap {
    background: #0e2d27;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 16px;
    position: relative;
    overflow: hidden;
    display: none;
}
.waveform-wrap.visible { display: block; }
.waveform-label {
    font-family: 'DM Mono', monospace;
    font-size: .65rem;
    color: rgba(111,209,179,.5);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
canvas#waveformCanvas {
    width: 100%;
    height: 60px;
    border-radius: 6px;
}

/* ── Options ── */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.option-group { display: flex; flex-direction: column; gap: 6px; }
.option-group label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}
.option-group label svg {
    width: 13px;
    height: 13px;
    stroke: var(--brand);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.option-group select,
.option-group input[type="range"] {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: .85rem;
    color: var(--text);
    background: #f9fcfb;
    outline: none;
    transition: border-color .18s;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235f7a74'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.option-group select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(78,179,154,.12);
    background-color: #fff;
}
.option-badge {
    font-family: 'DM Mono', monospace;
    font-size: .62rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: #4eb39a;
    color: #0e2d27;
}
.option-note {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Progress ── */
.progress-wrap {
    background: rgba(78,179,154,.08);
    border: 1px solid rgba(78,179,154,.2);
    border-radius: 10px;
    padding: 16px 20px;
    display: none;
    margin-bottom: 16px;
}
.progress-wrap.visible { display: block; }
.progress-label {
    font-size: .83rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.progress-bar-track {
    height: 8px;
    background: rgba(78,179,154,.15);
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4eb39a, #6fd1b3);
    border-radius: 10px;
    width: 0%;
    transition: width .25s ease;
}
.progress-step {
    font-family: 'DM Mono', monospace;
    font-size: .7rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ── Buttons ── */
.btn-convert {
    width: 100%;
    padding: 14px 24px;
    background: var(--brand);
    color: #0e2d27;
    border: none;
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, transform .15s, box-shadow .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}
.btn-convert:hover:not(:disabled) {
    background: #6fd1b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(78,179,154,.3);
}
.btn-convert:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}
.btn-convert svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.btn-download {
    width: 100%;
    padding: 13px 24px;
    background: #0e2d27;
    color: #6fd1b3;
    border: 2px solid rgba(78,179,154,.4);
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: .93rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, border-color .18s, transform .15s;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}
.btn-download.visible {
    display: flex;
}
.btn-download:hover {
    background: #133829;
    border-color: var(--brand);
    transform: translateY(-1px);
}
.btn-download svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Result panel ── */
.result-panel {
    background: #0e2d27;
    border: 1px solid rgba(78,179,154,.25);
    border-radius: 10px;
    padding: 18px 20px;
    display: none;
    margin-top: 16px;
}
.result-panel.visible { display: block; }
.result-panel-title {
    font-family: 'DM Mono', monospace;
    font-size: .65rem;
    color: rgba(111,209,179,.6);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.result-stat {
    background: rgba(78,179,154,.08);
    border: 1px solid rgba(78,179,154,.15);
    border-radius: 8px;
    padding: 9px 12px;
}
.result-stat-label {
    font-family: 'DM Mono', monospace;
    font-size: .6rem;
    font-weight: 500;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: rgba(111,209,179,.5);
    margin-bottom: 3px;
}
.result-stat-value {
    font-size: .85rem;
    font-weight: 700;
    color: #6fd1b3;
}

/* ── Validation badge ── */
.validation-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    margin-top: 4px;
}
.validation-badge.pass {
    background: rgba(22,163,74,.12);
    border: 1px solid rgba(22,163,74,.3);
    color: #4ade80;
}
.validation-badge.warn {
    background: rgba(217,119,6,.12);
    border: 1px solid rgba(217,119,6,.3);
    color: #fbbf24;
}
.validation-badge svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* ── Error state ── */
.error-box {
    background: rgba(220,38,38,.07);
    border: 1px solid rgba(220,38,38,.25);
    border-left: 4px solid #dc2626;
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: .85rem;
    color: #dc2626;
    margin-bottom: 14px;
    display: none;
    gap: 10px;
    align-items: flex-start;
}
.error-box.visible { display: flex; }
.error-box svg {
    width: 16px;
    height: 16px;
    stroke: #dc2626;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Sidebar ── */
.sidebar-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}
.sidebar-card-header {
    background: #fafcfb;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: .83rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-card-header svg {
    width: 15px;
    height: 15px;
    stroke: var(--brand);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sidebar-card-body { padding: 16px 18px; }
.req-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f7f5;
}
.req-item:last-child { border-bottom: none; padding-bottom: 0; }
.req-icon {
    width: 30px;
    height: 30px;
    background: var(--accent-light);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.req-icon svg {
    width: 14px;
    height: 14px;
    stroke: var(--brand);
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.req-label { font-size: .78rem; font-weight: 700; color: var(--text); }
.req-value {
    font-family: 'DM Mono', monospace;
    font-size: .75rem;
    color: var(--brand-dark);
    font-weight: 600;
}
.req-note { font-size: .72rem; color: var(--text-muted); margin-top: 1px; }

.sidebar-tip {
    background: linear-gradient(135deg, #0e2d27 0%, #133829 100%);
    border: 1px solid rgba(78,179,154,.25);
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 12px;
}
.sidebar-tip-title {
    font-family: 'DM Mono', monospace;
    font-size: .65rem;
    color: #6fd1b3;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sidebar-tip-text {
    font-size: .8rem;
    color: rgba(255,255,255,.6);
    line-height: 1.65;
}

/* ── FAQ ── */
.faq-section { padding: 0 0 48px; }
.faq-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.faq-section .section-sub {
    color: var(--text-muted);
    font-size: .93rem;
    margin-bottom: 28px;
}
.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 700px) { .faq-grid { grid-template-columns: 1fr; } }
.faq-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.faq-question {
    padding: 16px 20px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: background .15s;
    list-style: none;
    user-select: none;
}
.faq-question:hover { background: var(--accent-light); }
.faq-question::after {
    content: '';
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%234eb39a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    flex-shrink: 0;
    transition: transform .2s;
}
details.faq-item[open] .faq-question::after { transform: rotate(180deg); }
.faq-answer {
    padding: 0 20px 16px;
    font-size: .85rem;
    color: var(--text-muted);
    line-height: 1.7;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

/* ── How it works ── */
.how-section { padding: 0 0 48px; }
.how-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.how-section .section-sub {
    color: var(--text-muted);
    font-size: .93rem;
    margin-bottom: 28px;
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 800px) { .steps-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .steps-grid { grid-template-columns: 1fr; } }
.step-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    text-align: center;
}
.step-num {
    font-family: 'DM Mono', monospace;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .1em;
    color: var(--brand);
    margin-bottom: 10px;
}
.step-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-light);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}
.step-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--brand);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.step-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.step-desc { font-size: .78rem; color: var(--text-muted); line-height: 1.6; }

/* ── Responsive tweaks ── */
@media (max-width: 640px) {
    .tool-hero-inner { flex-direction: column; gap: 16px; }
    .tool-hero-icon { display: none; }
    .options-grid { grid-template-columns: 1fr; }
    .result-grid  { grid-template-columns: 1fr; }
    .file-info-grid { grid-template-columns: 1fr; }
}

/* ── btn (reuse site style) ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--brand);
    color: #0e2d27;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 700;
    transition: background .18s, transform .15s;
    border: none;
    cursor: pointer;
}
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); }

/* Audio player */
.audio-player-wrap {
    margin-top: 16px;
    display: none;
}
.audio-player-wrap.visible { display: block; }
.audio-player-label {
    font-family: 'DM Mono', monospace;
    font-size: .65rem;
    color: var(--text-muted);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
audio {
    width: 100%;
    border-radius: 8px;
    outline: none;
}
audio::-webkit-media-controls-panel { background: var(--accent-light); }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(14,45,39,.3);
    border-top-color: #0e2d27;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
