html {
    width: 100%;
}

body.check-api-page {
    min-height: 100vh;
    margin: 0;
    color: #152033;
    background: #eef3f8;
    font-family: Quicksand, Arial, sans-serif;
}

.check-api-page * {
    box-sizing: border-box;
}

.api-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 40px;
}

.api-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0 24px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #152033;
    text-decoration: none;
    font-weight: 700;
}

.brand-link img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.api-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    padding: 8px 12px;
    border: 1px solid #cfd9e5;
    border-radius: 999px;
    background: #fff;
    color: #58667a;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #1f9d72;
}

.page-title {
    margin: 0 0 24px;
}

.page-title h1 {
    margin: 0;
    text-align: left;
    color: #152033;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    line-height: 1.08;
}

.page-title p {
    width: min(720px, 100%);
    margin: 12px 0 0;
    color: #58667a;
    font-size: 16px;
    line-height: 1.6;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
    gap: 20px;
    align-items: start;
}

.panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(21, 32, 51, 0.08);
}

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

.panel-title {
    margin: 0;
    color: #152033;
    font-size: 18px;
    font-weight: 800;
}

.panel-caption {
    margin: 4px 0 0;
    color: #6a7789;
    font-size: 13px;
}

.drag-area {
    min-height: 360px;
    border: 2px dashed #b9c7d8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 22px;
    background: #f8fafc;
    transition: border-color 160ms ease, background-color 160ms ease;
    cursor: pointer;
}

.api-tabs {
    display: inline-flex;
    width: auto;
    gap: 4px;
    margin: 0 0 14px;
    padding: 4px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #f8fafc;
}

.api-tab {
    width: auto;
    min-height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #58667a;
    font-weight: 800;
}

.api-tab.is-active {
    background: #1f76d2;
    color: #fff;
    box-shadow: 0 6px 16px rgba(31, 118, 210, 0.2);
}

.drag-area.active,
.drag-area:focus-within {
    border-color: #1f76d2;
    background: #eef6ff;
}

.drag-area .icon {
    width: auto;
    color: #1f76d2;
    font-size: 48px;
}

.drag-area .header {
    width: auto;
    color: #152033;
    font-size: 18px;
    font-weight: 800;
}

.drag-area .button {
    width: auto;
    color: #1f76d2;
    cursor: pointer;
}

.drag-area .support,
.drag-area .note {
    width: min(420px, 100%);
    margin: 0;
    color: #6a7789;
    text-align: center;
    font-size: 13px;
    line-height: 1.45;
}

.drag-area img {
    max-width: 100%;
    width: auto;
    height: min(340px, 55vh);
    object-fit: contain;
    border-radius: 6px;
}

.actions-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

.btn-extract,
.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    background: #1f76d2;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.btn-extract:disabled {
    cursor: not-allowed;
    background: #aab7c6;
}

.btn-download {
    background: #1f9d72;
}

.json-result-container {
    display: none;
    margin-top: 16px;
}

.json-result-container h4 {
    margin: 0 0 8px;
    text-align: left;
    color: #152033;
    font-size: 14px;
    font-weight: 800;
}

#json-result {
    max-height: 260px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    border-radius: 8px;
    background: #111827;
    color: #7ee787;
    font-size: 13px;
}

.result-layout {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 18px;
}

.person__img {
    width: 126px;
    height: 164px;
    margin: 0;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #f8fafc;
    overflow: hidden;
}

.person__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person__info {
    display: grid;
    gap: 10px;
}

.field-row {
    min-width: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf1f5;
}

.field-label {
    display: block;
    width: auto;
    color: #6a7789;
    font-size: 12px;
    font-weight: 700;
}

.field-value {
    display: block;
    width: auto;
    margin-top: 3px;
    color: #152033;
    overflow-wrap: anywhere;
    font-size: 15px;
    font-weight: 700;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
}

.overlay.is-visible {
    display: flex;
}

.loading_wrapper {
    width: auto;
    min-width: 220px;
    padding: 26px;
    border-radius: 8px;
    background: #fff;
    color: #152033;
    text-align: center;
    font-weight: 800;
}

@media (max-width: 900px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .api-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .api-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 12px;
    }

    .panel {
        padding: 16px;
    }

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

    .person__img {
        width: 118px;
        height: 152px;
    }
}
