.itt-shell {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: clamp(1rem, 2vw, 1.6rem);
    color: #e5f8ff;
    background: radial-gradient(circle at 15% 10%, rgba(6, 182, 212, .24), transparent 32%), linear-gradient(135deg, rgba(2, 6, 23, .98), rgba(8, 13, 28, .96));
    box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
    isolation: isolate;
}

.itt-grid-bg {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(circle at center, #000 0, transparent 76%);
    opacity: .55;
    pointer-events: none;
    z-index: -1;
}

.itt-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.itt-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid rgba(125, 211, 252, .34);
    border-radius: 999px;
    padding: .35rem .65rem;
    color: #a5f3fc;
    background: rgba(8, 145, 178, .13);
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.itt-hero h2 {
    margin: .75rem 0 .5rem;
    font-size: clamp(1.75rem, 3vw, 3rem);
    line-height: 1;
}

.itt-hero p {
    margin: 0;
    color: rgba(229, 248, 255, .78);
    max-width: 78ch;
}

.itt-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .9rem;
}

.itt-hero__chips span,
.itt-lock-badge {
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 999px;
    padding: .25rem .55rem;
    background: rgba(15, 23, 42, .48);
    color: #cffafe;
    font-size: .78rem;
}

.itt-hero__truth,
.itt-card {
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 22px;
    background: rgba(15, 23, 42, .68);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 44px rgba(0,0,0,.2);
    backdrop-filter: blur(14px);
}

.itt-hero__truth {
    padding: 1rem;
}

.itt-hero__truth strong {
    display: block;
    color: #67e8f9;
    margin-bottom: .4rem;
}

.itt-layout {
    display: grid;
    grid-template-columns: minmax(270px, .85fr) minmax(0, 1.35fr);
    gap: 1rem;
}

.itt-card {
    padding: 1rem;
}

.itt-card__head h3,
.itt-result-card h4 {
    margin: 0;
    color: #f8fafc;
}

.itt-card__head p,
.itt-field small,
.itt-provider-note,
.itt-result-card pre,
.itt-result-card dd,
.itt-result-card li,
.itt-warning-list p {
    color: rgba(226, 232, 240, .76);
}

.itt-dropzone {
    display: grid;
    place-items: center;
    gap: .45rem;
    min-height: 230px;
    margin-top: 1rem;
    padding: 1rem;
    text-align: center;
    border: 1.5px dashed rgba(103, 232, 249, .45);
    border-radius: 18px;
    background: rgba(2, 6, 23, .42);
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.itt-dropzone:hover,
.itt-dropzone.is-dragging {
    transform: translateY(-1px);
    border-color: rgba(103, 232, 249, .92);
    background: rgba(8, 145, 178, .18);
}

.itt-dropzone input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.itt-dropzone__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #22d3ee, #8b5cf6);
    color: white;
    font-size: 2rem;
    line-height: 1;
}

.itt-preview {
    margin-top: 1rem;
    display: grid;
    gap: .75rem;
}

.itt-preview img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(255,255,255,.04);
}

.itt-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-top: 1rem;
    padding: .95rem 1rem;
    border: 1px solid rgba(103, 232, 249, .28);
    border-radius: 18px;
    color: #dffafe;
    background: rgba(8, 47, 73, .42);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.itt-loader__spinner {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 3px solid rgba(165, 243, 252, .28);
    border-top-color: #67e8f9;
    animation: itt-spin .8s linear infinite;
}

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


.itt-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    margin-top: 1rem;
}

.itt-field {
    display: grid;
    gap: .35rem;
}

.itt-field span,
.itt-options-box legend {
    color: #e0f2fe;
    font-weight: 700;
}

.itt-field select {
    width: 100%;
    color: #e2e8f0;
    background: rgba(2, 6, 23, .62);
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 12px;
    padding: .7rem .75rem;
    outline: none;
}

.itt-field select:focus {
    border-color: rgba(103, 232, 249, .9);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .14);
}

.itt-model-field {
    grid-column: 1 / -1;
}

.itt-provider-note,
.itt-warning-list {
    margin: .85rem 0 0;
    padding: .75rem .85rem;
    border-radius: 14px;
    background: rgba(245, 158, 11, .13);
    border: 1px solid rgba(245, 158, 11, .28);
}

.itt-options-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem .75rem;
    margin: 1rem 0 0;
    padding: .85rem;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 16px;
}

.itt-options-box label {
    display: flex;
    gap: .45rem;
    align-items: flex-start;
    color: rgba(226, 232, 240, .86);
}

.itt-options-box input {
    margin-top: .22rem;
    accent-color: #06b6d4;
}

.itt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: 1rem;
}

.itt-primary-btn,
.itt-secondary-btn,
.itt-small-btn,
.itt-copy-btn {
    border: 0;
    border-radius: 999px;
    padding: .75rem 1rem;
    font-weight: 800;
    cursor: pointer;
}

.itt-primary-btn {
    color: #04111f;
    background: linear-gradient(135deg, #67e8f9, #a78bfa);
    box-shadow: 0 14px 28px rgba(6, 182, 212, .22);
}

.itt-primary-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.itt-secondary-btn,
.itt-small-btn,
.itt-copy-btn {
    color: #e0f2fe;
    background: rgba(15, 23, 42, .8);
    border: 1px solid rgba(148, 163, 184, .26);
}

.itt-results {
    margin-top: 1rem;
}

.itt-results__head,
.itt-result-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.itt-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.itt-result-card {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    padding: .9rem;
    background: rgba(2, 6, 23, .46);
}

.itt-result-card__body {
    margin-top: .7rem;
}

.itt-result-card pre {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    font-family: inherit;
    line-height: 1.55;
}

.itt-result-card dl {
    display: grid;
    grid-template-columns: minmax(120px, .34fr) minmax(0, 1fr);
    gap: .55rem .8rem;
    margin: 0;
}

.itt-result-card dt {
    color: #a5f3fc;
    font-weight: 800;
}

.itt-result-card dd {
    margin: 0;
}

.itt-result-card ul {
    margin: 0;
    padding-inline-start: 1.2rem;
}

.itt-warning-list {
    display: grid;
    gap: .35rem;
}

.itt-warning-list p {
    margin: 0;
}

[dir="rtl"] .itt-result-card ul {
    padding-inline-start: 0;
    padding-inline-end: 1.2rem;
}

@media (max-width: 980px) {
    .itt-hero,
    .itt-layout,
    .itt-result-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .itt-settings-grid,
    .itt-options-box,
    .itt-result-card dl {
        grid-template-columns: 1fr;
    }

    .itt-shell {
        border-radius: 18px;
        padding: .85rem;
    }
}

/* fix1.1: Image to Text embedded polish */
.itt-preview[hidden],
.itt-results[hidden],
.itt-loader[hidden],
.itt-page-loader[hidden] {
    display: none !important;
}

.itt-preview img:not([src]) {
    display: none;
}

.itt-preview img {
    display: block;
    min-height: 180px;
}

.itt-open-full {
    position: absolute;
    z-index: 5;
    inset-block-start: 1.2rem;
    inset-inline-end: 1.2rem;
    width: 2.7rem;
    height: 2.7rem;
    display: inline-grid;
    place-items: center;
    border-radius: 1rem;
    border: 1px solid rgba(103, 232, 249, .42);
    background: linear-gradient(135deg, rgba(34, 211, 238, .22), rgba(139, 92, 246, .18));
    color: #e0f2fe;
    text-decoration: none;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .26);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.itt-open-full:hover,
.itt-open-full:focus-visible {
    color: #ffffff;
    border-color: rgba(103, 232, 249, .82);
    transform: translateY(-1px);
    outline: none;
}

.itt-open-full svg {
    width: 1.1rem;
    height: 1.1rem;
}

.itt-hero__copy {
    padding-block-start: .35rem;
    padding-inline-start: .65rem;
    padding-inline-end: 3.4rem;
}

.itt-hero__copy > p {
    margin-top: .45rem;
}

[dir="rtl"] .itt-hero__copy {
    padding-inline-start: 3.4rem;
    padding-inline-end: .65rem;
}

@media (max-width: 760px) {
    .itt-open-full {
        inset-block-start: .85rem;
        inset-inline-end: .85rem;
    }

    .itt-hero__copy,
    [dir="rtl"] .itt-hero__copy {
        padding-block-start: 0;
        padding-inline: .15rem 3.2rem;
    }
}


/* fix5: real page-level loading overlay */
.itt-page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    border-radius: 0;
    background: rgba(2, 6, 23, .78);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

.itt-page-loader__panel {
    display: grid;
    justify-items: center;
    gap: .9rem;
    min-width: min(440px, 92vw);
    padding: 1.25rem 1.45rem;
    border: 1px solid rgba(103, 232, 249, .38);
    border-radius: 22px;
    color: #e0faff;
    background: linear-gradient(135deg, rgba(8, 47, 73, .92), rgba(15, 23, 42, .94));
    box-shadow: 0 24px 70px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255,255,255,.08);
}

.itt-page-loader__line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .85rem;
}

.itt-page-loader__spinner {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 4px solid rgba(165, 243, 252, .24);
    border-top-color: #67e8f9;
    animation: itt-spin .8s linear infinite;
}

.itt-loader-stage {
    position: relative;
    width: min(310px, 76vw);
    height: 92px;
    overflow: hidden;
    border-radius: 18px;
    background:
        radial-gradient(circle at 20% 45%, rgba(34, 211, 238, .18), transparent 24%),
        linear-gradient(90deg, rgba(15, 23, 42, .1), rgba(14, 165, 233, .11), rgba(15, 23, 42, .1));
}

.itt-loader-stage::before,
.itt-loader-stage::after {
    content: "";
    position: absolute;
    inset-inline: 18px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(103, 232, 249, .65), transparent);
    opacity: .65;
    animation: itt-loader-line 1.8s ease-in-out infinite;
}

.itt-loader-stage::before { top: 24px; }
.itt-loader-stage::after {
    bottom: 24px;
    animation-delay: .35s;
}

.itt-loader-image,
.itt-loader-bot {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    transform: translateY(-50%);
    background: rgba(2, 6, 23, .62);
    border: 1px solid rgba(103, 232, 249, .28);
    box-shadow: 0 0 28px rgba(34, 211, 238, .16);
    font-size: 1.6rem;
}

.itt-loader-image {
    inset-inline-start: 22px;
    animation: itt-image-wiggle 1.6s ease-in-out infinite;
}

.itt-loader-bot {
    inset-inline-end: 22px;
    animation: itt-bot-nod 1.35s ease-in-out infinite;
}

.itt-loader-scan {
    position: absolute;
    top: 50%;
    inset-inline-start: 88px;
    width: calc(100% - 176px);
    height: 5px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, #22d3ee, #a78bfa, transparent);
    filter: drop-shadow(0 0 10px rgba(34, 211, 238, .62));
    animation: itt-scan 1.05s ease-in-out infinite alternate;
}

.itt-loader-spark {
    position: absolute;
    color: #67e8f9;
    text-shadow: 0 0 16px rgba(103, 232, 249, .8);
    animation: itt-spark 1.45s ease-in-out infinite;
}

.itt-loader-spark--a {
    top: 12px;
    inset-inline-start: 112px;
}

.itt-loader-spark--b {
    top: 58px;
    inset-inline-start: 52%;
    animation-delay: .25s;
}

.itt-loader-spark--c {
    top: 18px;
    inset-inline-end: 90px;
    animation-delay: .5s;
}

@keyframes itt-loader-line {
    0%, 100% { transform: translateX(-18px); opacity: .18; }
    50% { transform: translateX(18px); opacity: .76; }
}

@keyframes itt-image-wiggle {
    0%, 100% { transform: translateY(-50%) rotate(-2deg); }
    50% { transform: translateY(-54%) rotate(3deg); }
}

@keyframes itt-bot-nod {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-47%) scale(1.05); }
}

@keyframes itt-scan {
    from { transform: translateY(-50%) translateX(-12px) scaleX(.72); opacity: .55; }
    to { transform: translateY(-50%) translateX(12px) scaleX(1.05); opacity: 1; }
}

@keyframes itt-spark {
    0%, 100% { transform: translateY(0) scale(.75); opacity: .2; }
    50% { transform: translateY(-8px) scale(1.15); opacity: 1; }
}


/* fix8: successful analysis should not show the warnings strip */
.itt-warning-list[hidden],
.itt-warning-list:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}


/* fix9: compact workbench layout + featured analysis result */
.itt-form {
    max-width: min(1120px, 100%);
    margin: 1.15rem auto 0;
}

.itt-layout {
    grid-template-columns: minmax(300px, 420px) minmax(420px, 620px);
    justify-content: center;
    align-items: start;
    gap: clamp(.85rem, 1.6vw, 1.25rem);
}

.itt-upload-card,
.itt-settings-card {
    width: 100%;
}

.itt-upload-card .itt-dropzone {
    min-height: 180px;
}

.itt-upload-card .itt-preview img {
    max-height: 360px;
}

.itt-results {
    max-width: min(1320px, 100%);
    margin: 1.1rem auto 0;
}

.itt-result-card--featured {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(8, 47, 73, .48), rgba(2, 6, 23, .54));
    border-color: rgba(103, 232, 249, .3);
}

.itt-result-card--featured pre {
    font-size: 1rem;
}

@media (max-width: 1180px) {
    .itt-form {
        max-width: 100%;
    }

    .itt-layout {
        grid-template-columns: minmax(280px, .82fr) minmax(360px, 1fr);
    }
}

@media (max-width: 980px) {
    .itt-form {
        margin-top: 1rem;
    }

    .itt-layout {
        grid-template-columns: 1fr;
    }
}
