* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: clamp(12px, 2.5vw, 16px); }
html, body {
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: clamp(13px, 2.8vw, 14px);
    line-height: 1.4;
    background: #fff;
    color: #1f2937;
    min-height: 100vh;
    padding-bottom: 60px;
}
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid rgba(37, 99, 235, 0.2);
}
@media (min-width: 600px) { .header { padding: 20px 24px; } }
.logo {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 3.5vw, 18px);
    line-height: 1;
    letter-spacing: 1px;
    color: #2563eb;
    text-decoration: none;
}
.btn-try {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #2563eb;
    color: #fff;
    font-size: clamp(12px, 2.5vw, 14px);
    line-height: 1;
    letter-spacing: 1px;
    border-radius: 10px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: box-shadow 0.2s, opacity 0.2s;
    flex-shrink: 0;
}
.btn-try:hover { box-shadow: 0 0 20px rgba(37, 99, 235, 0.4); }
.btn-try:active { opacity: 0.9; }
@media (max-width: 599px) { .btn-try { display: none; } }
@media (min-width: 600px) { .burger { display: none; } }
.burger {
    width: 44px; height: 44px;
    min-width: 44px; min-height: 44px;
    flex-shrink: 0;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #1f2937;
    font-size: 1.35rem;
}
.hero {
    position: relative;
    margin: 20px;
    padding: 28px 20px;
    background: #eff6ff;
    border-radius: 20px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    overflow: hidden;
}
@media (min-width: 600px) { .hero { margin: 24px auto; max-width: 560px; padding: 40px 32px; border-radius: 24px; } }
.hero::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, transparent 70%);
    pointer-events: none;
}
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    border-radius: inherit;
}
.hero-dots { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.hero-dots span {
    position: absolute;
    width: 4px; height: 4px;
    background: #2563eb;
    border-radius: 50%;
    opacity: 0.5;
}
.hero-dots span:nth-child(1) { top: 20%; left: 15%; }
.hero-dots span:nth-child(2) { top: 35%; right: 20%; }
.hero-dots span:nth-child(3) { bottom: 30%; left: 25%; }
.hero-dots span:nth-child(4) { bottom: 25%; right: 15%; }
.hero-dots span:nth-child(5) { top: 50%; left: 50%; opacity: 0.3; }
.hero-content { position: relative; z-index: 1; }
.hero h1 {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: clamp(16px, 4.5vw, 24px);
    line-height: 1;
    letter-spacing: 1px;
    color: #1f2937;
    margin-bottom: 12px;
    text-transform: uppercase;
}
@media (min-width: 600px) { .hero h1 { margin-bottom: 16px; } }
.hero .subtitle {
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: clamp(11px, 2.5vw, 14px);
    line-height: 1.4;
    color: #4b5563;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
@media (min-width: 600px) { .hero .subtitle { margin-bottom: 28px; } }
.btn {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 3.5vw, 17px);
    line-height: 1;
    letter-spacing: 1px;
    display: block;
    width: 100%;
    padding: 16px 24px;
    text-align: center;
    border-radius: 12px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: box-shadow 0.2s, opacity 0.2s;
}
@media (min-width: 600px) { .btn { padding: 18px 24px; } }
.btn:active { opacity: 0.9; }
.btn-primary {
    background: #2563eb;
    color: #fff;
    margin-bottom: 12px;
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(37, 99, 235, 0.35); }
.btn-secondary {
    background: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
}
.btn-secondary:hover { box-shadow: 0 0 20px rgba(37, 99, 235, 0.25); }
.main { padding: 0 20px 24px; max-width: 100%; }
@media (min-width: 600px) { .main { padding: 0 24px 32px; max-width: 560px; margin: 0 auto; } }
.services-title {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: clamp(16px, 4vw, 20px);
    line-height: 1;
    letter-spacing: 1px;
    color: #1f2937;
    margin-bottom: 16px;
}
.service-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    transition: box-shadow 0.2s;
}
.service-card:hover { box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4); }
.service-card-left { display: flex; align-items: center; gap: 16px; }
.service-icon {
    width: 48px; height: 48px;
    min-width: 48px; min-height: 48px;
    flex-shrink: 0;
    aspect-ratio: 1;
    background: rgba(37, 99, 235, 0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 1.25rem;
    border: 1px solid rgba(37, 99, 235, 0.3);
}
.service-name {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 3.5vw, 20px);
    line-height: 1;
    letter-spacing: 1px;
    color: #1f2937;
    min-width: 0;
}
.service-arrow {
    width: 40px; height: 40px;
    min-width: 40px; min-height: 40px;
    flex-shrink: 0;
    aspect-ratio: 1;
    background: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    text-decoration: none;
    transition: box-shadow 0.2s;
}
.service-arrow:hover { box-shadow: 0 0 20px rgba(37, 99, 235, 0.5); }
.tag {
    display: inline-block;
    padding: 6px 12px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid rgba(37, 99, 235, 0.3);
    margin-top: 12px;
}
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.menu-overlay.is-open { opacity: 1; visibility: visible; }
.menu-panel {
    position: fixed;
    top: 0; right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: #fff;
    z-index: 1001;
    padding: 24px 20px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.25s;
}
.menu-overlay.is-open .menu-panel { transform: translateX(0); }
.menu-panel .logo { display: block; margin-bottom: 32px; }
.menu-nav { display: flex; flex-direction: column; gap: 4px; }
.menu-link {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    color: #1f2937;
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
}
.menu-link:hover { background: #eff6ff; color: #2563eb; }
.menu-link i { margin-right: 8px; width: 1.2em; }

/* Search page */
.search-hero { margin: 20px; padding: 28px 20px; background: #eff6ff; border-radius: 20px; border: 1px solid rgba(37, 99, 235, 0.25); }
@media (min-width: 600px) { .search-hero { margin: 24px auto; max-width: 560px; padding: 40px 32px; border-radius: 24px; } }
.search-hero h1 { font-family: Montserrat, sans-serif; font-weight: 600; font-size: clamp(18px, 4vw, 22px); margin-bottom: 16px; color: #1f2937; }
.search-form .form-group { margin-bottom: 16px; }
.search-form label { display: block; font-weight: 600; margin-bottom: 6px; color: #374151; }
.search-form input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
}
.search-form input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.flash-error { background: #fef2f2; color: #b91c1c; padding: 12px 20px; border-radius: 12px; margin-bottom: 16px; }
.flash-success { background: #ecfdf5; color: #047857; padding: 12px 20px; border-radius: 12px; margin-bottom: 16px; }

/* Results & risk list */
.results-page body { padding-bottom: 40px; }
.header-bar { background: #fff; border-bottom: 1px solid rgba(37, 99, 235, 0.2); padding: 16px 20px; }
.header-bar-inner { max-width: 560px; margin: 0 auto; }
.back-link {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #2563eb;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.back-link:hover { text-decoration: underline; }
.report-meta { margin-top: 12px; font-size: 12px; color: #6b7280; }
.report-meta span { display: block; margin-top: 4px; }
.person-block {
    background: #fff;
    padding: 20px;
    margin: 16px 20px;
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
.person-name {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: clamp(16px, 4vw, 20px);
    letter-spacing: 0.5px;
    color: #1f2937;
}
.section-title {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: clamp(16px, 4vw, 18px);
    letter-spacing: 0.5px;
    color: #1f2937;
    padding: 20px 20px 12px;
    max-width: 560px;
    margin: 0 auto;
}
.risk-list { max-width: 560px; margin: 0 auto; padding: 0 20px; list-style: none; }
.risk-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid #dbe3ee;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 8px 10px;
    align-items: start;
}
.risk-icon {
    width: 20px; height: 20px;
    min-width: 20px; min-height: 20px;
    flex-shrink: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: transparent;
    margin-top: 2px;
}
.risk-icon--ok { color: #16a34a; }
.risk-icon--info { color: #2563eb; }
.risk-icon--warn { color: #eab308; }
.risk-icon--yellow { color: #eab308; }
.risk-icon--danger { color: #dc2626; }
.risk-icon--default { color: #2563eb; }
.risk-item-body { min-width: 0; }
.risk-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}
.risk-label {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 3.2vw, 18px);
    letter-spacing: 0.2px;
    color: #1f2937;
    display: block;
    margin-bottom: 2px;
}
.risk-source {
    font-size: 12px;
    color: #7b8794;
    white-space: normal;
    flex-shrink: 0;
    order: -1;
    margin-top: 0;
}
.risk-source a,
.risk-source a:visited,
.risk-source a:hover,
.risk-source a:active {
    color: inherit;
    text-decoration: none;
}
.risk-source a:hover { text-decoration: underline; }
.risk-status {
    font-size: 14px;
    color: #273444;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    margin-top: 2px;
}
.risk-item--with-details .risk-status {
    font-size: 18px;
    line-height: 1.3;
    font-weight: 400;
    margin-bottom: 10px;
}
.risk-details {
    margin-top: 8px;
    border-top: 1px solid #dbe3ee;
    padding-top: 10px;
}
.risk-item--with-details .risk-details {
    margin-left: -30px;
    width: calc(100% + 30px);
}
.risk-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.risk-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #526176;
    padding: 6px 10px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #fff;
}
.risk-pill.is-neutral {
    color: #111827;
    border-color: #cad4e2;
}
.risk-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.risk-dot.is-red { background: #dc2626; }
.risk-dot.is-yellow { background: #d97706; }
.risk-disclosure {
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 8px;
    overflow: hidden;
}
.risk-summary-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 18px;
    padding: 12px 14px;
    cursor: pointer;
    align-items: start;
}
.risk-summary-grid.is-court,
.risk-summary-grid.is-arbitration {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.risk-summary-grid.is-arbitration {
    grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(170px, 1.2fr);
}
.risk-summary-grid.is-bankruptcy {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.risk-disclosure summary::-webkit-details-marker { display: none; }
.risk-disclosure summary::marker { content: ''; }
.risk-mini-label {
    display: block;
    font-size: 12px;
    color: #8a97aa;
    margin-bottom: 3px;
}
.risk-mini-value {
    font-size: 14px;
    line-height: 1.35;
    color: #111827;
    font-weight: 500;
    overflow-wrap: break-word;
    word-break: normal;
}
.risk-mini-value a { color: #2563eb; text-decoration: none; }
.risk-mini-value a:hover { text-decoration: underline; }
.risk-disclosure-body {
    border-top: 1px solid #dbe3ee;
    padding: 12px 14px;
}
.risk-kv-grid {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr);
    gap: 8px 12px;
}
.risk-kv-grid > span:nth-child(odd) {
    font-size: 13px;
    color: #7b8794;
}
.risk-kv-grid > span:nth-child(even) {
    font-size: 14px;
    line-height: 1.35;
    color: #1f2937;
    overflow-wrap: break-word;
    word-break: normal;
}
.risk-kv-grid a { color: #2563eb; text-decoration: none; }
.risk-kv-grid a:hover { text-decoration: underline; }

@media (min-width: 900px) {
    .header-bar-inner,
    .person-block,
    .section-title,
    .risk-list {
        max-width: 980px;
    }
}

@media (max-width: 599px) {
    .risk-item--with-details .risk-status { font-size: 14px; }
    .risk-summary-grid,
    .risk-summary-grid.is-court,
    .risk-summary-grid.is-arbitration,
    .risk-summary-grid.is-bankruptcy {
        grid-template-columns: 1fr;
    }
    .risk-kv-grid {
        grid-template-columns: 1fr;
        gap: 2px 0;
    }
}

/* History */
.page-title {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: clamp(18px, 4vw, 22px);
    letter-spacing: 0.5px;
    padding: 24px 20px 16px;
    max-width: 560px;
    margin: 0 auto;
}
.history-list { max-width: 560px; margin: 0 auto; padding: 0 20px; list-style: none; }
.history-item {
    display: block;
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.history-item:hover {
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
    border-color: rgba(37, 99, 235, 0.35);
}
.history-item-title {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 3.2vw, 16px);
    margin-bottom: 6px;
}
.history-item-meta { font-size: 12px; color: #6b7280; }
.cabinet-placeholder {
    max-width: 560px;
    margin: 20px auto;
    padding: 24px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    text-align: center;
    color: #6b7280;
}
.cabinet-card {
    background: #f8fafc;
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 14px;
}
.cabinet-balance-card {
    display: grid;
    gap: 16px;
}
.cabinet-kicker {
    color: #2563eb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}
.cabinet-balance {
    font-family: Montserrat, sans-serif;
    font-size: clamp(28px, 7vw, 36px);
    line-height: 1;
    color: #111827;
}
.cabinet-balance-caption {
    margin-top: 8px;
    color: #6b7280;
    font-size: 13px;
}
.cabinet-topup-form {
    display: grid;
    gap: 10px;
}
.cabinet-topup-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.cabinet-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    font-size: 14px;
    color: #111827;
    background: #fff;
}
.cabinet-topup-btn {
    margin-bottom: 0;
}
.cabinet-muted {
    color: #6b7280;
    font-size: 13px;
}
.cabinet-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.cabinet-title {
    font-family: Montserrat, sans-serif;
    font-size: 20px;
    line-height: 1.1;
    color: #111827;
}
.cabinet-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(37, 99, 235, 0.25);
    background: #fff;
}
.cabinet-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
}
.cabinet-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.cabinet-field {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 14px;
}
.cabinet-field-label {
    display: block;
    margin-bottom: 6px;
    color: #6b7280;
    font-size: 12px;
}
.cabinet-transactions {
    display: grid;
    gap: 10px;
}
.cabinet-transaction {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 14px;
}
.cabinet-transaction-title {
    color: #111827;
    font-weight: 600;
    margin-bottom: 4px;
}
.cabinet-transaction-meta {
    color: #6b7280;
    font-size: 12px;
}
.cabinet-transaction-amount {
    font-family: Montserrat, sans-serif;
    white-space: nowrap;
}
.cabinet-transaction-amount.is-positive {
    color: #047857;
}
.cabinet-transaction-amount.is-negative {
    color: #b91c1c;
}
@media (min-width: 600px) {
    .cabinet-balance-card {
        grid-template-columns: 1.2fr 1fr;
        align-items: end;
    }
    .cabinet-topup-row {
        grid-template-columns: 1fr auto;
    }
    .cabinet-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.wait-message { padding: 24px 20px; text-align: center; }
.wait-message a { color: #2563eb; }

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 3px solid #bfdbfe;
    border-top-color: #2563eb;
    animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin {
    to { transform: rotate(360deg); }
}

.api-response-html { line-height: 1.45; color: #1f2937; }
.api-response-html .api-separator { margin: 12px 0; border: 0; border-top: 1px solid #dbe3ee; }
.api-scoring { margin-top: 14px; border-top: 1px solid #dbe3ee; padding-top: 10px; }
.api-scoring-title { font-weight: 600; margin-bottom: 8px; }
.api-scoring-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.api-scoring-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.api-scoring-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.api-scoring-dot.is-red { background: #dc2626; }
.api-scoring-dot.is-yellow { background: #d97706; }
.api-scoring-dot.is-green { background: #16a34a; }
.api-scoring-dot.is-white { background: #9ca3af; border: 1px solid #d1d5db; }
.api-scoring-dot.is-default { background: #2563eb; }
.api-scoring-label { color: #111827; }
.api-scoring-color { margin-left: auto; color: #6b7280; font-weight: 600; }
