* { box-sizing: border-box; }
.ij-main [hidden] { display: none !important; }

.ij-main {
    width: min(1280px, calc(100% - 36px));
    margin: 0 auto;
    padding: 26px 0 38px;
}

.ij-workspace,
.ij-loading,
.ij-result,
.ij-scope {
    border: 1px solid #dce4f2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(34, 66, 132, .08);
}

.ij-workspace { padding: 24px; }
.ij-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.ij-heading h2 { margin: 0; color: #172554; font-size: 1.16rem; }
.ij-heading p { margin: 6px 0 0; color: #667085; font-size: .86rem; line-height: 1.6; }

.ij-input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.ij-panel { min-width: 0; }
.ij-panel label,
.ij-field-label { display: block; margin-bottom: 8px; color: #344054; font-size: .88rem; font-weight: 700; }
.ij-required { color: #b42318; font-size: .76rem; font-weight: 400; }

#ij-standard-text {
    display: block;
    width: 100%;
    min-height: 190px;
    padding: 14px;
    resize: vertical;
    border: 1px solid #cdd7e7;
    border-radius: 10px;
    outline: none;
    background: #fbfcfe;
    color: #17213c;
    font: inherit;
    font-size: .9rem;
    line-height: 1.75;
}
#ij-standard-text:focus { border-color: #0849df; box-shadow: 0 0 0 3px rgba(8, 73, 223, .11); background: #fff; }
#ij-standard-text::placeholder { color: #7a869e; }

.ij-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 210px;
    padding: 26px 22px;
    border: 2px dashed #85a8e8;
    border-radius: 12px;
    background: #f5f8ff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8);
    color: #172554;
    cursor: pointer;
    font: inherit;
    text-align: center;
    transition: border-color .16s, background-color .16s, transform .16s;
}
.ij-upload-zone:hover,
.ij-upload-zone.ij-dragging { border-color: #0849df; background: #eaf1ff; }
.ij-upload-zone:focus-visible { outline: 3px solid rgba(8, 73, 223, .22); outline-offset: 3px; }
.ij-upload-zone:active { transform: scale(.99); }
.ij-upload-zone > i {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: #dbe8ff;
    color: #0849df;
    font-size: 1.45rem;
}
.ij-upload-zone strong { color: #172554; font-size: 1rem; line-height: 1.45; }
.ij-upload-zone span { margin-top: 7px; color: #425574; font-size: .82rem; line-height: 1.5; }
.ij-upload-zone small { margin-top: 12px; color: #5f6f89; font-size: .74rem; line-height: 1.5; }

.ij-pdf-hint { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; padding: 9px 12px; border: 1px solid #fce4c7; border-radius: 9px; background: #fff8ed; color: #9a3412; font-size: .78rem; }

.ij-file-list { display: grid; gap: 8px; margin-top: 12px; }
.ij-file-item { display: grid; grid-template-columns: 54px minmax(0, 1fr) 32px; gap: 10px; align-items: center; padding: 7px; border-radius: 9px; background: #f4f7fb; }
.ij-file-preview { position: relative; width: 54px; height: 54px; padding: 0; overflow: hidden; border: 1px solid #cbd8eb; border-radius: 8px; background: #fff; cursor: zoom-in; }
.ij-file-preview img { width: 100%; height: 100%; object-fit: cover; }
.ij-file-preview i { position: absolute; right: 3px; bottom: 3px; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 6px; background: rgba(15, 49, 104, .84); color: #fff; font-size: .66rem; }
.ij-file-preview:hover { border-color: #4e7fe5; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.ij-file-icon { display: grid; width: 54px; height: 54px; place-items: center; border: 1px solid #cbd8eb; border-radius: 8px; background: #fff; color: #b42318; font-size: 1.35rem; }
.ij-file-item div { min-width: 0; }
.ij-file-item strong { display: block; overflow: hidden; color: #334155; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.ij-file-item span { display: block; margin-top: 3px; color: #718096; font-size: .7rem; }
.ij-file-remove { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #9a3412; cursor: pointer; }
.ij-file-remove:hover { background: #ffedd5; }

.form-error { margin-top: 16px; padding: 11px 13px; border: 1px solid #fecaca; border-radius: 9px; background: #fff1f2; color: #9f1239; font-size: .84rem; }
.ij-actions { display: flex; justify-content: flex-start; gap: 10px; margin-top: 20px; }
.ij-actions .tool-button { min-width: 126px; }
.ij-actions #ij-submit { min-width: 184px; }

.ij-loading { margin-top: 18px; padding: 24px; }
.ij-loading-copy { display: flex; gap: 13px; align-items: center; color: #1e3a78; }
.ij-loading-copy > i { font-size: 1.25rem; }
.ij-loading-copy strong,
.ij-loading-copy span { display: block; }
.ij-loading-copy span { margin-top: 4px; color: #6a7892; font-size: .8rem; }
.ij-skeleton { display: grid; gap: 9px; margin-top: 20px; }
.ij-skeleton span { height: 11px; border-radius: 6px; background: #e9eef7; }
.ij-skeleton span:nth-child(2) { width: 82%; }
.ij-skeleton span:nth-child(3) { width: 61%; }
@media (prefers-reduced-motion: no-preference) {
    .ij-skeleton span { animation: ij-pulse 1.35s ease-in-out infinite alternate; }
}
@keyframes ij-pulse { to { opacity: .42; } }

.ij-result { margin-top: 18px; padding: 24px; scroll-margin-top: 18px; }
.ij-result-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.ij-result-heading h2 { margin: 0; color: #172554; font-size: 1.16rem; }
.ij-result-heading p { margin: 6px 0 0; color: #667085; font-size: .86rem; line-height: 1.6; }

.ij-verdict-badge { flex: 0 0 auto; padding: 7px 12px; border-radius: 9px; font-size: .82rem; font-weight: 800; }
.ij-verdict-badge.pass { background: #dcfce7; color: #166534; }
.ij-verdict-badge.fail { background: #fee2e2; color: #991b1b; }
.ij-verdict-badge.partial { background: #fef3c7; color: #92400e; }
.ij-verdict-badge.unknown { background: #f2f4f7; color: #667085; }

.ij-report-info { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.ij-report-info > div { padding: 12px 14px; border-radius: 11px; background: #f6f8fc; }
.ij-report-info span,
.ij-report-info strong { display: block; }
.ij-report-info span { color: #68758d; font-size: .72rem; }
.ij-report-info strong { margin-top: 5px; color: #1f3b70; font-size: .88rem; line-height: 1.5; word-break: break-word; }

.ij-verdict { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; padding: 16px 18px; border: 1px solid #e3e7ec; border-radius: 12px; }
.ij-verdict > i { margin-top: 2px; font-size: 1.4rem; }
.ij-verdict strong { display: block; font-size: 1rem; }
.ij-verdict p { margin: 5px 0 0; font-size: .84rem; line-height: 1.65; }
.ij-verdict.pass { border-color: #c9ecd9; background: #effaf4; color: #17613f; }
.ij-verdict.pass p { color: #4e7563; }
.ij-verdict.fail { border-color: #fbd5d5; background: #fef2f2; color: #991b1b; }
.ij-verdict.fail p { color: #7f4a4a; }
.ij-verdict.partial { border-color: #fce4c7; background: #fff8ed; color: #9a3412; }
.ij-verdict.partial p { color: #8a5a33; }
.ij-verdict.unknown { border-color: #e3e7ec; background: #f6f7f9; color: #5b6472; }
.ij-verdict.unknown p { color: #6b7482; }

.ij-table-wrap h3,
.ij-untested h3 { margin: 0 0 10px; color: #233252; font-size: .95rem; }
.ij-table-wrap { margin-bottom: 16px; overflow-x: auto; }
.ij-items-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.ij-items-table th,
.ij-items-table td { padding: 10px 12px; border: 1px solid #e4eaf3; text-align: left; vertical-align: top; line-height: 1.6; }
.ij-items-table thead th { background: #f2f6fc; color: #41516d; font-size: .78rem; white-space: nowrap; }
.ij-items-table tbody tr:nth-child(even) { background: #f8fafd; }
.ij-items-table td { color: #4d5c73; word-break: break-word; }
.ij-item-badge { display: inline-block; padding: 4px 9px; border-radius: 7px; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.ij-item-badge.pass { background: #dcfce7; color: #166534; }
.ij-item-badge.fail { background: #fee2e2; color: #991b1b; }
.ij-item-badge.unknown { background: #f2f4f7; color: #667085; }

.ij-items-empty { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; padding: 18px; border-radius: 11px; background: #f6f7f9; color: #5b6472; }
.ij-items-empty > i { margin-top: 2px; font-size: 1.35rem; }
.ij-items-empty strong { display: block; }
.ij-items-empty p { margin: 5px 0 0; color: #6b7482; font-size: .82rem; line-height: 1.65; }

.ij-untested { margin-bottom: 16px; padding: 16px 18px; border: 1px solid #fce4c7; border-radius: 12px; background: #fff8ed; }
.ij-untested ul { margin: 0; padding-left: 20px; color: #8a5a33; font-size: .84rem; line-height: 1.9; }

.ij-disclaimer { display: flex; gap: 8px; align-items: center; margin: 18px 0 0; padding: 11px 13px; border: 1px solid #cbdcf8; border-radius: 9px; background: #edf4ff; color: #173f85; font-size: .8rem; }
.ij-result-actions { display: flex; justify-content: flex-start; gap: 10px; margin-top: 14px; }
.ij-billing { margin-top: 12px; color: #7a8699; font-size: .74rem; text-align: right; }

.ij-scope { margin-top: 18px; padding: 22px 24px; }
.ij-scope h2 { margin: 0 0 14px; color: #172554; font-size: 1.16rem; }
.ij-scope-grid p { margin: 0; color: #657188; font-size: .8rem; line-height: 1.65; }

.ij-preview-dialog { width: min(1120px, calc(100vw - 32px)); max-height: 92vh; }
.ij-preview-body { display: flex; min-height: 240px; max-height: calc(92vh - 76px); align-items: center; justify-content: center; overflow: auto; background: #0f1f38; }
.ij-preview-body img { display: block; max-width: 100%; max-height: calc(92vh - 108px); object-fit: contain; }

@media (max-width: 760px) {
    .ij-main { width: calc(100% - 24px); padding-top: 16px; }
    .ij-workspace, .ij-result, .ij-scope { padding: 17px; }
    .ij-heading, .ij-result-heading { align-items: stretch; flex-direction: column; gap: 10px; }
    .ij-input-grid { grid-template-columns: 1fr; }
    .ij-upload-zone { min-height: 180px; padding: 22px 18px; }
    #ij-standard-text { min-height: 170px; }
    .ij-actions { flex-direction: column; }
    .ij-actions .tool-button { width: 100%; }
    .ij-report-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ij-verdict-badge { align-self: flex-start; }
    .ij-result-actions .tool-button { width: 100%; }
    .ij-billing { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
