.ip-page {
    --ip-ink: #0f172a;
    --ip-muted: #5f6f86;
    --ip-line: #d8e4f2;
    --ip-line-strong: #c6d8ee;
    --ip-surface-tint: linear-gradient(180deg, #f8fbff 0%, #f2f7fd 100%);
    --ip-brand: #1f6fe5;
    --ip-brand-deep: #153e90;
    --ip-shadow: 0 22px 60px rgba(15, 23, 42, 0.08);
    --ip-shadow-soft: 0 14px 34px rgba(37, 99, 235, 0.08);
    padding: 2rem 0 2.5rem;
    color: var(--ip-ink);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.06), transparent 28%),
        linear-gradient(180deg, #f3f7fc 0%, #eef4fb 100%);
}

.ip-page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.ip-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 24px;
}

.ip-hero h1,
.ip-panel h2,
.ip-preview-section h2,
.ip-empty-state h3,
.ip-result-bar h3 {
    margin: 0;
}

.ip-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    font-weight: 800;
}

.ip-hero-copy,
.ip-section-label,
.ip-support-text,
.ip-dropzone-meta,
.ip-dropzone-subtitle,
.ip-queue-meta,
.ip-result-bar p {
    color: var(--ip-muted);
}

.ip-hero-copy {
    max-width: 720px;
    margin: 12px 0 0;
    line-height: 1.65;
}

.ip-hero-badges,
.ip-form-actions,
.ip-field-grid,
.ip-flash-stack,
.ip-queue-actions,
.ip-quick-quality-grid,
.ip-metrics-row {
    display: grid;
    gap: 10px;
}

.ip-hero-badges {
    grid-auto-flow: column;
    align-content: start;
}

.ip-hero-badges span,
.ip-pill {
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--ip-line);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    font-weight: 700;
    font-size: 0.84rem;
}

.ip-flash {
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ip-flash.is-hiding {
    opacity: 0;
    transform: translateY(-4px);
}

.ip-flash-success {
    color: #0f6b42;
    background: #eaf8f0;
    border: 1px solid #c7ead7;
}

.ip-flash-error {
    color: #ab2e2e;
    background: #fff0f0;
    border: 1px solid #f4cdcd;
}

.ip-layout-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.ip-panel,
.ip-preview-section {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--ip-line);
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--ip-shadow);
    backdrop-filter: blur(12px);
}

.ip-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.ip-panel h2 {
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    font-weight: 700;
    line-height: 1.15;
}

.ip-preview-head-copy {
    display: grid;
    gap: 4px;
}

.ip-preview-head-copy h2,
.ip-preview-head-copy p {
    margin: 0;
}

.ip-preview-head-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.ip-btn-top-download {
    min-width: 200px;
    min-height: 42px;
    padding: 8px 14px;
}

.ip-dropzone {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 220px;
    padding: 24px;
    border: 2px dashed var(--ip-line-strong);
    border-radius: 22px;
    background: var(--ip-surface-tint);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.ip-dropzone.is-dragover {
    border-color: var(--ip-brand);
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.14);
}

.ip-dropzone-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #e7f0ff, #dbeafe);
    color: var(--ip-brand);
    font-size: 1.8rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.ip-dropzone-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.ip-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ip-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 14px;
}

.ip-field {
    display: grid;
    gap: 7px;
}

.ip-field span,
.ip-toggle span {
    font-weight: 600;
}

.ip-download-form .ip-field span {
    color: #607086;
    font-size: 0.92rem;
}

.ip-download-form .ip-field {
    gap: 4px;
}

.ip-field select,
.ip-field input[type="number"] {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d3dde8;
    border-radius: 5px;
    padding: 0 12px;
}

.ip-field select {
    padding-right: 34px;
}

.ip-field input[type="range"] {
    width: 100%;
}

.ip-range-value {
    color: #1e4ea6;
}

.ip-quick-quality-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
}

.ip-chip {
    border: 1px solid var(--ip-line);
    background: linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
    color: var(--ip-brand-deep);
    border-radius: 14px;
    padding: 10px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ip-metrics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
}

.ip-metric-card {
    border-top: 1px solid #e2e9f1;
    padding-top: 9px;
}

.ip-metric-label {
    font-size: 0.88rem;
    color: #607086;
}

.ip-metric-value {
    display: block;
    margin-top: 3px;
    font-size: 1.08rem;
}

.ip-metric-value-accent {
    color: #2b70f8;
}

.ip-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    cursor: pointer;
}

.ip-form-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
}

.ip-btn {
    border: 0;
    border-radius: 6px;
    min-height: 42px;
    padding: 8px 14px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.ip-btn:disabled {
    opacity: 0.55;
}

.ip-btn-primary {
    color: #fff;
    background: #1f6fe5;
    border: 1px solid #1f6fe5;
}

.ip-btn-secondary {
    color: #5f6f82;
    background: #eef2f6;
    border: 1px solid #8d9aab;
}

.ip-btn-danger {
    color: #d95353;
    background: #ffffff;
    border: 1px solid #d95353;
}

.ip-disabled-note {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f5f8fc;
    border: 1px dashed #c8d5e4;
    color: #607086;
    font-weight: 600;
    text-align: center;
}

.ip-preview-section {
    margin-top: 20px;
}

.ip-queue-grid {
    display: grid;
    gap: 14px;
}

.ip-queue-card {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--ip-line);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    box-shadow: var(--ip-shadow-soft);
    overflow: hidden;
}

.ip-queue-preview {
    min-height: 140px;
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(232, 240, 255, 0.82)),
        #f4f8fc;
    display: grid;
    place-items: center;
    padding: 12px;
    border: 1px solid rgba(198, 216, 238, 0.75);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ip-queue-preview img {
    max-width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.ip-queue-body {
    display: grid;
    gap: 10px;
}

.ip-queue-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.ip-queue-name {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: var(--ip-ink);
}

.ip-queue-meta {
    margin: 0;
}

.ip-processed-size {
    color: var(--ip-brand);
    font-weight: 700;
}

.ip-queue-actions {
    grid-template-columns: repeat(4, minmax(0, max-content));
    align-items: start;
}

.ip-queue-actions form {
    margin: 0;
}

.ip-result-bar {
    margin-top: 18px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(147, 197, 253, 0.35);
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 30%),
        linear-gradient(135deg, #f8fbff 0%, #edf5ff 100%);
    box-shadow: var(--ip-shadow-soft);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.ip-result-head {
    display: grid;
    gap: 4px;
}

.ip-result-head p,
.ip-result-head h3 {
    margin: 0;
}

.ip-download-form {
    display: grid;
    grid-template-columns: minmax(220px, 280px) max-content;
    gap: 10px;
    align-items: end;
}

.ip-file-name-input {
    min-height: 42px;
    border: 1px solid #d3dde8;
    border-radius: 5px;
    padding: 0 12px;
    background: #fff;
}

.ip-empty-state {
    display: grid;
    gap: 10px;
    place-items: center;
    min-height: 220px;
    border: 1px dashed #cbd8e5;
    border-radius: 18px;
    background: #fbfdff;
    text-align: center;
    padding: 24px;
}

@media (max-width: 991.98px) {
    .ip-layout-grid {
        grid-template-columns: 1fr;
    }

    .ip-hero,
    .ip-result-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .ip-result-bar {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .ip-hero-badges {
        grid-auto-flow: row;
    }
}

@media (max-width: 767.98px) {
    .ip-page-shell {
        width: min(100% - 24px, 1180px);
    }

    .ip-field-grid,
    .ip-form-actions,
    .ip-queue-card,
    .ip-queue-actions,
    .ip-quick-quality-grid,
    .ip-metrics-row,
    .ip-download-form {
        grid-template-columns: 1fr;
    }

    .ip-panel-header,
    .ip-queue-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .ip-preview-head-actions {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 10px;
    }
}
