* { box-sizing: border-box; margin: 0; padding: 0; }

.ip-site-nav {
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
    font: 700 16px/1.2 "Segoe UI", Tahoma, sans-serif;
}

.ip-site-nav-inner {
    max-width: 1180px;
    min-height: 70px;
    margin: 0 auto;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.ip-site-nav a,
.ip-site-nav button {
    min-height: 44px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    border-radius: 999px;
    padding: 10px 18px;
    color: #f8fafc;
    background: rgba(30, 41, 59, 0.9);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.ip-site-nav a:hover,
.ip-site-nav button:hover,
.ip-site-nav a:focus-visible,
.ip-site-nav button:focus-visible {
    color: #ffffff;
    background: #fb923c;
    border-color: #fb923c;
    outline: none;
}

.ip-site-nav-back {
    margin-right: auto;
    color: #ffffff !important;
    background: #0f172a !important;
    border-color: #0f172a !important;
}

.ip-site-nav-home {
    border-color: #38bdf8 !important;
    color: #bae6fd !important;
}

.ip-site-nav-dashboard {
    border-color: #fb923c !important;
    color: #fed7aa !important;
}

.ip-site-nav-tools {
    border-color: #4ade80 !important;
    color: #bbf7d0 !important;
}

@media (max-width: 650px) {
    .ip-site-nav-inner {
        min-height: auto;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 10px 12px;
    }

    .ip-site-nav a,
    .ip-site-nav button {
        min-height: 42px;
        padding: 9px 14px;
        font-size: 14px;
    }
}

body.image-perfect-page {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: #e5e7eb;
    background:
        linear-gradient(rgba(2, 6, 23, 0.55), rgba(2, 6, 23, 0.72)),
        radial-gradient(ellipse at 20% 0%, rgba(249, 115, 22, 0.16), transparent 50%),
        radial-gradient(ellipse at 90% 20%, rgba(14, 165, 233, 0.14), transparent 45%),
        #0b1220;
}

.ip-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.92);
}

.ip-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.ip-brand {
    color: #fb923c;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ip-header h1 {
    font-size: 1.45rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ip-title-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: block;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.35);
}
    color: #f8fafc;
}

.ip-header-note {
    color: #94a3b8;
    font-size: 13px;
}

.ip-wrap {
    max-width: 1180px;
    margin: 28px auto 40px;
    padding: 0 18px;
}

.ip-hero {
    margin-bottom: 22px;
    padding: 22px 24px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.ip-hero h2 {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    font-weight: 800;
    color: #f8fafc;
}

.ip-hero p {
    margin: 0;
    max-width: 62ch;
    color: #cbd5e1;
    font-size: 14.5px;
    line-height: 1.55;
}

.ip-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 8px 0;
    background: #0f172a;
}

.ip-tab {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.72);
    color: #e2e8f0;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.ip-tab:hover { border-color: rgba(251, 146, 60, 0.7); }

.ip-tab.is-active {
    background: linear-gradient(180deg, #fb923c, #ea580c);
    border-color: transparent;
    color: #1c1917;
}

.ip-tab-ai {
    border-color: rgba(167, 139, 250, 0.9);
    color: #ddd6fe;
}

.ip-tab-ai.is-active {
    background: linear-gradient(180deg, #a78bfa, #7c3aed);
    border-color: transparent;
    color: #faf5ff;
}

.ip-tab-oken {
    border-color: rgba(56, 189, 248, 0.8);
    color: #7dd3fc;
}

.oken-frame {
    width: 100%;
    min-height: 78vh;
    border: 0;
    border-radius: 16px;
    background: transparent;
}

.ip-panel[hidden] { display: none !important; }

.ip-grid {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .ip-grid { grid-template-columns: 1fr; }
    #panel-aadhaarlong .ip-preview-card { order: -1; }
}

.ip-card {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.82);
    padding: 18px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

.ip-card h3 { margin: 0 0 8px; font-size: 16px; color: #f1f5f9; }

.ip-hint {
    margin: 0 0 14px;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.45;
}

.ip-drop {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 110px;
    padding: 18px;
    border: 1.5px dashed rgba(251, 146, 60, 0.5);
    border-radius: 12px;
    background: rgba(249, 115, 22, 0.08);
    cursor: pointer;
    text-align: center;
}

.ip-drop:hover,
.ip-drop.is-drag {
    border-color: #fb923c;
    background: rgba(249, 115, 22, 0.16);
}

.ip-drop.compact { min-height: 88px; }

.ip-batch-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 10px;
}

.ip-batch-bar[hidden] { display: none !important; }

.ip-batch-bar span {
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    min-width: 72px;
    text-align: center;
}
.ip-drop-title { color: #e2e8f0; font-weight: 700; font-size: 14px; }
.ip-drop-sub { color: #94a3b8; font-size: 12px; }

.ip-dual-upload {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

@media (max-width: 520px) {
    .ip-dual-upload { grid-template-columns: 1fr; }
}

.ip-controls {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.ip-controls label {
    display: grid;
    gap: 6px;
    color: #cbd5e1;
    font-size: 12.5px;
    font-weight: 600;
}

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

.ip-controls select,
.ip-controls input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(2, 6, 23, 0.65);
    color: #f8fafc;
    font-size: 13px;
}

.ip-custom-size {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ip-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.ip-btn {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(30, 41, 59, 0.9);
    color: #f1f5f9;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.ip-btn:hover { filter: brightness(1.08); }
.ip-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.ip-btn-primary {
    background: linear-gradient(180deg, #22c55e, #16a34a);
    border-color: transparent;
    color: #052e16;
}

.ip-btn-autocrop {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: linear-gradient(180deg, #fb923c, #ea580c);
    border: none;
    border-radius: 10px;
    color: #1c1917;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.35);
}

.ip-btn-autocrop:hover { filter: brightness(1.06); }
.ip-btn-autocrop:disabled { opacity: 0.6; cursor: wait; }

.ip-pipe {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
}
.ip-pipe li {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.55);
}
.ip-pipe li.is-now {
    color: #fff7ed;
    border-color: rgba(251, 146, 60, 0.55);
    background: rgba(234, 88, 12, 0.22);
}
.ip-pipe li.is-on {
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(22, 101, 52, 0.28);
}
.ip-ocr {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #fdba74;
}

.ip-btn-manual {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.03em;
    background: linear-gradient(180deg, #38bdf8, #0284c7);
    border: none;
    border-radius: 10px;
    color: #082f49;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.28);
}

.ip-btn-manual:hover { filter: brightness(1.06); }
.ip-btn-manual[hidden],
.ip-btn[hidden],
.ip-btn-primary[hidden] { display: none !important; }

.ip-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.03em;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.55);
    color: #e2e8f0;
    cursor: pointer;
}
.ip-switch.is-on {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(22, 101, 52, 0.28);
    color: #bbf7d0;
}
.ip-switch-track {
    margin-left: auto;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #334155;
    position: relative;
    flex-shrink: 0;
}
.ip-switch.is-on .ip-switch-track { background: #22c55e; }
.ip-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.16s ease;
}
.ip-switch.is-on .ip-switch-thumb { left: 21px; }
.ip-switch-state {
    min-width: 2.2em;
    text-align: right;
    font-size: 12px;
    font-weight: 800;
}

.ip-pipe li.is-skip {
    color: #64748b;
    border-color: rgba(100, 116, 139, 0.35);
    background: rgba(15, 23, 42, 0.35);
    text-decoration: line-through;
}

.ip-btn-clear {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    background: transparent;
    border: 1px solid rgba(248, 113, 113, 0.55);
    color: #fca5a5;
    border-radius: 10px;
    cursor: pointer;
}

.ip-btn-clear:hover {
    background: rgba(248, 113, 113, 0.12);
}

.ip-btn-remove {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 16px 16px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(180deg, #fb7185, #e11d48);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(225, 29, 72, 0.35);
}

.ip-btn-remove:hover { filter: brightness(1.06); }
.ip-btn-remove:disabled { opacity: 0.65; cursor: wait; }

.ip-select-wrap {
    touch-action: none;
    cursor: crosshair;
    position: relative;
}

.ip-draw-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    touch-action: none;
    user-select: none;
}

.ip-preview-card .ip-canvas-wrap.is-drawing {
    overflow: hidden;
    max-height: none;
    touch-action: none;
}

.ip-preview-card .ip-canvas-wrap.is-drawing canvas {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: min(78vh, 920px);
    touch-action: none;
    cursor: crosshair;
}

.ip-draw-layer {
    position: absolute;
    inset: 0;
    z-index: 6;
    touch-action: none;
    cursor: crosshair;
    background: rgba(2, 6, 23, 0.34);
}

.ip-draw-layer[hidden] { display: none !important; }

.ip-draw-box {
    position: absolute;
    box-sizing: border-box;
    border: 2px dashed #fb923c;
    background: rgba(251, 146, 60, 0.08);
    box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.5);
    pointer-events: none;
}

.ip-draw-box[hidden] { display: none !important; }

.ip-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.72);
    z-index: 5;
    border-radius: 12px;
}

.ip-loading[hidden] { display: none !important; }

.ip-loading-card {
    display: grid;
    gap: 12px;
    justify-items: center;
    padding: 18px 20px;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.92);
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    max-width: 260px;
}

.ip-spinner {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 3px solid rgba(148, 163, 184, 0.35);
    border-top-color: #fb7185;
    animation: ip-spin 0.8s linear infinite;
}

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


.ip-btn-print {
    background: linear-gradient(180deg, #38bdf8, #0284c7);
    border-color: transparent;
    color: #082f49;
}

.ip-btn-ghost { background: transparent; }

.ip-preview-card .ip-canvas-wrap {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 320px;
    max-height: 70vh;
    overflow: auto;
    border-radius: 12px;
    background:
        linear-gradient(45deg, #1e293b 25%, transparent 25%) 0 0 / 16px 16px,
        linear-gradient(-45deg, #1e293b 25%, transparent 25%) 0 0 / 16px 16px,
        #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 12px;
}

.ip-preview-card canvas {
    max-width: 100%;
    height: auto;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ip-crop-stage {
    touch-action: none;
    overflow: hidden;
    isolation: isolate;
}

.ip-crop-box {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid #fb923c;
    background: transparent;
    cursor: move;
    z-index: 2;
    touch-action: none;
    will-change: left, top, width, height;
    box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.52);
}

.ip-crop-handle {
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fb923c;
    border: 2px solid #fff;
    border-radius: 2px;
}

.ip-crop-handle.nw { left: -9px; top: -9px; cursor: nwse-resize; }
.ip-crop-handle.ne { right: -9px; top: -9px; cursor: nesw-resize; }
.ip-crop-handle.sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.ip-crop-handle.se { right: -9px; bottom: -9px; cursor: nwse-resize; }

.ip-rot-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.ip-wrong { margin: 6px 0 0; font-size: 12px; font-weight: 700; color: #fdba74; }

.ip-meta {
    margin: 10px 0 0;
    color: #94a3b8;
    font-size: 12.5px;
}

.ip-footer {
    max-width: 1180px;
    margin: 0 auto 40px;
    padding: 0 18px;
    color: #64748b;
    font-size: 12px;
}

@media print {
    body > *:not(.ip-print-only) { display: none !important; }
    body.image-perfect-page > *:not(.ip-print-only) { display: none !important; }
    .ip-print-only {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        display: block;
        background: #fff;
    }
    .ip-print-only img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: fill;
    }
}

.ip-people {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ip-person {
    appearance: none;
    width: 92px;
    padding: 4px;
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    cursor: pointer;
}

.ip-person canvas {
    display: block;
    width: 80px;
    height: 102px;
    object-fit: cover;
    border-radius: 6px;
    background: #0f172a;
}

.ip-person span {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.ip-person.is-selected {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.ip-person:hover { filter: brightness(1.08); }

.ip-bg-custom input[type="color"] {
    width: 100%;
    height: 42px;
    padding: 2px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(2, 6, 23, 0.65);
    cursor: pointer;
}

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

.ip-swatch-label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 12.5px;
    font-weight: 600;
}

.ip-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ip-swatch {
    appearance: none;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 2px solid rgba(248, 250, 252, 0.35);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.35);
}

.ip-swatch.is-selected {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

.ip-swatch-keep {
    background: repeating-conic-gradient(#94a3b8 0 25%, #e2e8f0 0 50%) 50% / 10px 10px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.ip-bg-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
}

.ip-tool {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(30, 41, 59, 0.9);
    color: #f1f5f9;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.ip-tool.is-active {
    background: linear-gradient(180deg, #38bdf8, #0284c7);
    border-color: transparent;
    color: #082f49;
}

.ip-brush-label {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
    color: #cbd5e1;
    font-size: 12.5px;
    font-weight: 600;
}

.ip-edit-wrap {
    min-height: 240px;
    max-height: 52vh;
    touch-action: none;
}

#passport-edit {
    cursor: cell;
    touch-action: none;
}

#passport-edit-panel {
    margin-bottom: 18px;
}

.ip-ai-label {
    display: block;
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
}

.ip-ai-prompt {
    width: 100%;
    min-height: 110px;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid rgba(167, 139, 250, 0.45);
    background: rgba(15, 23, 42, 0.9);
    color: #f8fafc;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.45;
    font-family: inherit;
    box-sizing: border-box;
}

.ip-ai-prompt:focus {
    outline: 2px solid rgba(167, 139, 250, 0.7);
    outline-offset: 1px;
}

.ip-ai-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 4px;
}

.ip-chip {
    appearance: none;
    border: 1px solid rgba(167, 139, 250, 0.45);
    background: rgba(76, 29, 149, 0.28);
    color: #ede9fe;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ip-chip:hover {
    border-color: #c4b5fd;
    background: rgba(124, 58, 237, 0.4);
}

.ip-ai-placeholder {
    margin: 0;
    padding: 28px 16px;
    color: #94a3b8;
    font-size: 14px;
    text-align: center;
}

#ai-canvas[hidden] {
    display: none !important;
}

#ai-generate:disabled {
    opacity: 0.65;
}
