:root {
    --ys-bg: #f7f8fb;
    --ys-surface: rgba(255, 255, 255, 0.86);
    --ys-surface-solid: #ffffff;
    --ys-text: #090a17;
    --ys-muted: #687089;
    --ys-border: rgba(120, 95, 190, 0.18);
    --ys-border-strong: rgba(112, 91, 210, 0.32);
    --ys-cyan: #39d7ff;
    --ys-purple: #7c4dff;
    --ys-pink: #ff0f7b;
    --ys-dark: #070814;
    --ys-success: #048a5a;
    --ys-danger: #e11d48;
    --ys-shadow: 0 24px 70px rgba(10, 12, 28, 0.10);
    --ys-soft-shadow: 0 12px 35px rgba(16, 16, 40, 0.08);
    --radius-xl: 34px;
    --radius-lg: 24px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ys-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        linear-gradient(rgba(12, 17, 34, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(12, 17, 34, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 8% 10%, rgba(57, 215, 255, 0.16), transparent 32%),
        radial-gradient(circle at 92% 45%, rgba(255, 15, 123, 0.16), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f9fbff 42%, #f7f5ff 100%);
    background-size: 34px 34px, 34px 34px, auto, auto, auto;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at center, transparent 0 52%, rgba(255,255,255,0.62) 88%);
    z-index: -1;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

img,
svg {
    display: block;
}

.hidden {
    display: none !important;
}

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

.ambient {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 999px;
    filter: blur(45px);
    opacity: 0.18;
    pointer-events: none;
    z-index: -1;
}

.ambient-one {
    left: -180px;
    top: 90px;
    background: var(--ys-cyan);
}

.ambient-two {
    right: -160px;
    bottom: 110px;
    background: var(--ys-pink);
}

.ys-header {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    border-bottom: 1px solid rgba(10, 12, 28, 0.06);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
}

.ys-header-inner {
    width: min(1120px, calc(100% - 36px));
    height: 66px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.ys-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ys-text);
}

.ys-brand img {
    width: auto;
    height: 28px;
    max-width: 190px;
    object-fit: contain;
}

.ys-brand-fallback {
    display: none;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-weight: 700;
    letter-spacing: -0.04em;
    font-size: 20px;
}

.ys-brand-fallback span {
    color: var(--ys-purple);
}

.page-shell {
    width: min(1040px, calc(100% - 34px));
    margin: 0 auto;
    padding: 70px 0 90px;
}

.search-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.search-logo-mobile {
    display: none;
}

.search-stage h1 {
    margin: 0;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: clamp(44px, 8vw, 84px);
    line-height: 0.9;
    letter-spacing: -0.075em;
    color: var(--ys-text);
}

.search-stage p {
    max-width: 610px;
    margin: 18px auto 28px;
    color: var(--ys-muted);
    font-size: 17px;
    line-height: 1.55;
}

.search-bar {
    position: relative;
    width: min(770px, 100%);
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 9px 8px 22px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(124, 77, 255, 0.18);
    border-radius: 999px;
    box-shadow: 0 20px 60px rgba(32, 20, 90, 0.12), inset 0 0 0 1px rgba(255,255,255,0.8);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.search-bar:focus-within {
    border-color: rgba(124, 77, 255, 0.42);
    box-shadow: 0 26px 80px rgba(32, 20, 90, 0.16), 0 0 0 5px rgba(124, 77, 255, 0.08);
    transform: translateY(-1px);
}

.search-symbol {
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    color: #8a90a6;
}

.search-symbol svg {
    width: 100%;
    height: 100%;
}

.search-bar input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ys-text);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.search-bar input::placeholder {
    color: #989fb1;
    font-weight: 600;
}

.cnpj-status {
    flex: 0 0 auto;
    min-width: 48px;
    color: #969daf;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.cnpj-status.valid {
    color: var(--ys-success);
}

.cnpj-status.invalid {
    color: var(--ys-danger);
}

.consult-button {
    position: relative;
    flex: 0 0 auto;
    height: 52px;
    min-width: 132px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, var(--ys-pink), var(--ys-purple) 50%, var(--ys-cyan));
    box-shadow: 0 16px 34px rgba(124, 77, 255, 0.26);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.consult-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 20px 44px rgba(124, 77, 255, 0.32);
}

.consult-button:disabled {
    cursor: wait;
    opacity: 0.82;
}

.button-loader {
    display: none;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.48);
    border-top-color: #fff;
    animation: spin .8s linear infinite;
}

.consult-button.is-loading .button-label {
    display: none;
}

.consult-button.is-loading .button-loader {
    display: block;
}

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

.error-box {
    width: min(720px, 100%);
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(255, 241, 242, 0.94);
    border: 1px solid rgba(225, 29, 72, 0.18);
    color: #9f1239;
    font-weight: 700;
    text-align: left;
    box-shadow: var(--ys-soft-shadow);
}

.empty-state {
    width: fit-content;
    max-width: 100%;
    margin: 34px auto 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px 10px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.74);
    border: 1px solid rgba(124, 77, 255, 0.13);
    box-shadow: 0 12px 35px rgba(12, 15, 35, 0.06);
    color: #737b93;
    font-size: 14px;
    font-weight: 700;
}

.empty-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(124, 77, 255, .2);
}

.empty-avatar img {
    width: 100%;
    height: 100%;
}

.conversation {
    margin-top: 56px;
}

.chat-row {
    display: flex;
    width: 100%;
    margin-bottom: 22px;
}

.user-row {
    justify-content: flex-end;
}

.agent-row {
    align-items: flex-start;
    gap: 14px;
}

.chat-bubble {
    border: 1px solid var(--ys-border);
    box-shadow: var(--ys-soft-shadow);
}

.user-bubble {
    width: min(620px, calc(100% - 48px));
    padding: 16px 22px;
    border-radius: 26px 26px 8px 26px;
    background: rgba(255, 255, 255, .9);
    text-align: left;
}

.user-bubble span,
.agent-kicker,
.compact-heading span,
.panel-heading span {
    display: block;
    margin-bottom: 7px;
    color: #8b52ff;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.user-bubble p {
    margin: 0;
    color: var(--ys-text);
    font-size: 17px;
    line-height: 1.45;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.agent-avatar {
    position: sticky;
    top: 86px;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    overflow: hidden;
    background: var(--ys-dark);
    box-shadow: 0 16px 36px rgba(124, 77, 255, 0.22);
}

.agent-avatar img {
    width: 100%;
    height: 100%;
}

.agent-card {
    width: min(900px, calc(100% - 70px));
    padding: 24px;
    border: 1px solid rgba(124, 77, 255, 0.16);
    border-radius: 10px 30px 30px 30px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--ys-shadow);
    backdrop-filter: blur(16px);
}

.agent-card-header {
    display: flex;
    gap: 18px;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 17px;
    border-bottom: 1px solid rgba(122, 132, 160, 0.13);
}

.agent-card-header h2 {
    margin: 0;
    font-family: "Space Grotesk", Inter, sans-serif;
    color: var(--ys-text);
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.05;
    letter-spacing: -0.065em;
}

.agent-card-header p {
    margin: 8px 0 0;
    color: var(--ys-muted);
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
}

.agent-kicker {
    width: fit-content;
    background: linear-gradient(90deg, var(--ys-cyan), var(--ys-purple), var(--ys-pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.status-pill {
    flex: 0 0 auto;
    max-width: 150px;
    padding: 9px 13px;
    border-radius: 999px;
    color: #047857;
    background: rgba(16, 185, 129, 0.10);
    border: 1px solid rgba(16, 185, 129, 0.22);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1;
    text-align: center;
}

.status-pill.inactive {
    color: #b45309;
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.24);
}

.agent-intro {
    margin: 18px 0 18px;
    padding: 15px 17px;
    border: 1px solid rgba(124, 77, 255, 0.13);
    border-radius: 18px;
    color: #424b61;
    background: linear-gradient(135deg, rgba(57,215,255,.08), rgba(124,77,255,.055), rgba(255,15,123,.06));
    font-size: 15px;
    font-weight: 650;
    line-height: 1.55;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.info-card {
    position: relative;
    min-height: 82px;
    padding: 16px 17px;
    border: 1px solid rgba(110, 117, 145, 0.16);
    border-radius: 20px;
    background: rgba(250, 251, 255, 0.83);
    overflow: hidden;
}

.info-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15px;
    bottom: 15px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--ys-cyan), var(--ys-purple), var(--ys-pink));
    opacity: .85;
}

.info-card.wide {
    grid-column: 1 / -1;
}

.info-card small {
    display: block;
    margin-bottom: 9px;
    color: #858da4;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.info-card strong {
    display: block;
    color: #161827;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 850;
    word-break: break-word;
}

.empty-value {
    color: #a3a8b7;
    font-style: italic;
}

.state-registry,
.raw-json,
.all-data-panel {
    margin-top: 16px;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(124, 77, 255, 0.13);
    background: rgba(251, 252, 255, 0.86);
}

.compact-heading,
.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}

.compact-heading strong,
.panel-heading strong {
    display: block;
    color: #171927;
    font-size: 16px;
    letter-spacing: -0.03em;
}

.panel-heading em {
    flex: 0 0 auto;
    padding: 7px 11px;
    border-radius: 999px;
    color: #6e56d9;
    background: rgba(124, 77, 255, 0.09);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.state-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.state-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 13px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(110, 117, 145, 0.13);
}

.state-item strong,
.state-item span,
.state-item em {
    display: block;
}

.state-item strong {
    font-size: 14px;
    color: #161827;
}

.state-item span {
    margin-top: 2px;
    color: var(--ys-muted);
    font-size: 12px;
    font-weight: 650;
}

.state-item em {
    align-self: flex-start;
    padding: 5px 8px;
    border-radius: 999px;
    color: #057857;
    background: rgba(16, 185, 129, 0.10);
    font-size: 11px;
    font-weight: 900;
    font-style: normal;
}

.answer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.ghost-button {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    color: #303244;
    background: #ffffff;
    border: 1px solid rgba(124, 77, 255, 0.20);
    box-shadow: 0 9px 22px rgba(12, 15, 35, 0.04);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: transform .2s ease, border-color .2s ease, color .2s ease;
}

.ghost-button:hover {
    transform: translateY(-1px);
    border-color: rgba(124, 77, 255, 0.44);
    color: #6d36f5;
}

.ghost-button.primary {
    color: #ffffff;
    background: var(--ys-dark);
    border-color: var(--ys-dark);
}

.ghost-button.primary:hover {
    color: #ffffff;
}

.raw-json pre {
    max-height: 420px;
    margin: 0;
    padding: 16px;
    overflow: auto;
    border-radius: 18px;
    color: #e7ecff;
    background: #080a16;
    font-size: 12.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.all-data-heading {
    align-items: center;
}

.field-tools {
    display: flex;
    align-items: center;
    gap: 9px;
}

.field-tools input {
    width: min(280px, 42vw);
    height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    outline: 0;
    border: 1px solid rgba(110, 117, 145, 0.18);
    background: #ffffff;
    color: var(--ys-text);
    font-size: 13px;
    font-weight: 700;
}

.field-tools input:focus {
    border-color: rgba(124, 77, 255, 0.42);
    box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.07);
}

.dynamic-data {
    display: grid;
    gap: 10px;
}

.data-block {
    border: 1px solid rgba(110, 117, 145, 0.14);
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
}

.data-block.hidden-by-filter {
    display: none;
}

.data-block-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 15px;
    background: linear-gradient(90deg, rgba(57,215,255,.08), rgba(124,77,255,.06));
    border-bottom: 1px solid rgba(110, 117, 145, 0.11);
}

.data-block-header span,
.data-node summary span {
    color: #171927;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.data-block-header em,
.data-node summary em {
    flex: 0 0 auto;
    color: #7b4cff;
    font-size: 11px;
    font-weight: 900;
    font-style: normal;
    text-transform: uppercase;
}

.data-children {
    display: grid;
    gap: 8px;
    padding: 10px;
}

.data-node {
    border: 1px solid rgba(110, 117, 145, 0.12);
    border-radius: 15px;
    background: rgba(250, 251, 255, 0.85);
    overflow: hidden;
}

.data-node summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    cursor: pointer;
    list-style: none;
}

.data-node summary::-webkit-details-marker {
    display: none;
}

.data-node summary::before {
    content: "+";
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    margin-right: 2px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--ys-purple), var(--ys-pink));
    font-size: 15px;
    font-weight: 900;
}

.data-node[open] > summary::before {
    content: "−";
}

.data-node summary span {
    margin-right: auto;
}

.data-leaf {
    display: grid;
    grid-template-columns: minmax(150px, 0.36fr) 1fr;
    gap: 14px;
    padding: 11px 12px;
    border: 1px solid rgba(110, 117, 145, 0.10);
    border-radius: 13px;
    background: #ffffff;
}

.data-key {
    color: #838aa0;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.data-value {
    min-width: 0;
    color: #171927;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
    word-break: break-word;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 90;
    width: min(380px, calc(100% - 36px));
    padding: 14px 16px;
    border-radius: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, #0b1020, #161827);
    box-shadow: 0 22px 55px rgba(7, 8, 20, 0.25);
    font-size: 14px;
    font-weight: 800;
}

@media (max-width: 860px) {
    .ys-header-inner {
        width: min(100% - 26px, 1120px);
        height: 60px;
    }

    .page-shell {
        width: min(100% - 22px, 1040px);
        padding: 44px 0 62px;
    }

    .search-stage h1 {
        font-size: clamp(42px, 13vw, 68px);
    }

    .search-stage p {
        font-size: 15px;
        margin-bottom: 22px;
    }

    .search-bar {
        min-height: auto;
        display: grid;
        grid-template-columns: 24px 1fr auto;
        border-radius: 28px;
        padding: 13px;
    }

    .search-bar input {
        height: 44px;
        font-size: 15px;
    }

    .cnpj-status {
        grid-column: 2 / 4;
        justify-self: start;
        min-width: auto;
        padding-left: 2px;
    }

    .consult-button {
        grid-column: 1 / 4;
        width: 100%;
        margin-top: 4px;
    }

    .conversation {
        margin-top: 40px;
    }

    .agent-row {
        gap: 10px;
    }

    .agent-avatar {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        border-radius: 15px;
    }

    .agent-card {
        width: calc(100% - 54px);
        padding: 17px;
        border-radius: 8px 24px 24px 24px;
    }

    .agent-card-header {
        flex-direction: column;
    }

    .status-pill {
        max-width: 100%;
    }

    .summary-grid,
    .state-list {
        grid-template-columns: 1fr;
    }

    .field-tools {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .field-tools input {
        width: 100%;
    }

    .all-data-heading,
    .compact-heading,
    .panel-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .data-leaf {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

@media (max-width: 520px) {
    .ys-header {
        background: rgba(255,255,255,0.88);
    }

    .ys-brand img {
        max-width: 150px;
        height: 24px;
    }

    .search-stage p {
        max-width: 320px;
    }

    .empty-state {
        border-radius: 24px;
        align-items: flex-start;
    }

    .user-bubble {
        width: calc(100% - 28px);
        padding: 14px 17px;
    }

    .agent-row {
        align-items: flex-start;
    }

    .agent-avatar {
        position: relative;
        top: auto;
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    .agent-card {
        width: calc(100% - 48px);
        padding: 14px;
    }

    .agent-card-header h2 {
        font-size: 23px;
    }

    .answer-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ghost-button {
        width: 100%;
    }

    .raw-json pre {
        max-height: 330px;
        font-size: 11.5px;
    }
}

/* v4 · ajustes de conversa e visualização avançada */
.compact-answer-card {
    padding: 22px;
}

.single-action {
    justify-content: flex-start;
    margin-top: 20px;
    padding-top: 4px;
}

.single-action .ghost-button {
    min-height: 46px;
    padding: 0 22px;
}

.advanced-message {
    margin-top: 4px;
}

.advanced-card {
    padding: 22px;
    box-shadow: 0 18px 55px rgba(10, 12, 28, 0.08);
}

.advanced-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(122, 132, 160, 0.13);
}

.advanced-card-header h2 {
    margin: 0;
    font-family: "Space Grotesk", Inter, sans-serif;
    color: var(--ys-text);
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.08;
    letter-spacing: -0.055em;
}

.advanced-card-header p {
    max-width: 560px;
    margin: 8px 0 0;
    color: var(--ys-muted);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 650;
}

.advanced-card .field-tools {
    flex: 0 0 auto;
    margin-top: 4px;
}

.data-block-header {
    justify-content: flex-start;
    padding: 14px 16px;
}

.data-block-header span {
    font-size: 15px;
}

.data-node summary {
    justify-content: flex-start;
}

.data-node summary span {
    margin-right: 0;
}

.data-block-header em,
.data-node summary em {
    display: none !important;
}

.data-leaf {
    grid-template-columns: minmax(155px, 0.32fr) 1fr;
}

@media (max-width: 860px) {
    .advanced-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .advanced-card .field-tools {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .advanced-card .field-tools input {
        width: 100%;
    }

    .advanced-card .field-tools em {
        width: fit-content;
    }
}

/* v6 · enriquecimento, score, mapa e relatório */
.recent-box {
    width: min(770px, 100%);
    margin-top: 18px;
    padding: 14px;
    border-radius: 24px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(124, 77, 255, 0.12);
    box-shadow: 0 14px 38px rgba(12, 15, 35, 0.05);
    text-align: left;
}

.recent-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.recent-head span {
    color: #8b52ff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.recent-head button {
    background: transparent;
    color: #858da4;
    font-size: 12px;
    font-weight: 800;
}

.recent-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.recent-item {
    text-align: left;
    padding: 11px 12px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(110, 117, 145, 0.13);
}

.recent-item strong,
.recent-item span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-item strong {
    color: #171927;
    font-size: 13px;
    font-weight: 900;
}

.recent-item span {
    margin-top: 4px;
    color: #767f96;
    font-size: 12px;
    font-weight: 700;
}

.score-panel {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 18px 0;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid rgba(124, 77, 255, 0.14);
    background: linear-gradient(135deg, rgba(57,215,255,.10), rgba(124,77,255,.065), rgba(255,15,123,.075));
}

.score-ring {
    --score: 0;
    flex: 0 0 104px;
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, #fff 0 55%, transparent 56%),
        conic-gradient(var(--ys-purple) calc(var(--score) * 1%), rgba(124,77,255,.13) 0);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 18px 42px rgba(124,77,255,.12);
}

.score-ring strong {
    grid-area: 1 / 1;
    transform: translateY(-4px);
    color: #111425;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: 31px;
    line-height: 1;
    letter-spacing: -.06em;
}

.score-ring span {
    grid-area: 1 / 1;
    transform: translateY(24px);
    color: #8a90a6;
    font-size: 12px;
    font-weight: 900;
}

.mini-kicker {
    display: block;
    margin-bottom: 6px;
    color: #8b52ff;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.score-panel h3,
.validation-panel h3,
.map-heading h3 {
    margin: 0;
    color: #111425;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: 21px;
    letter-spacing: -.04em;
}

.score-panel p,
.validation-panel p,
.map-heading p,
.mode-content p {
    margin: 7px 0 0;
    color: #566077;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.55;
}

.analysis-panel,
.validation-panel,
.map-panel,
.insight-card {
    margin-top: 16px;
    border: 1px solid rgba(124, 77, 255, 0.13);
    background: rgba(251, 252, 255, 0.88);
    border-radius: 22px;
}

.analysis-panel {
    padding: 13px;
}

.mode-tabs {
    display: flex;
    gap: 8px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(124, 77, 255, 0.06);
}

.mode-tab {
    flex: 1;
    min-height: 38px;
    border-radius: 999px;
    background: transparent;
    color: #69728a;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.mode-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--ys-pink), var(--ys-purple));
    box-shadow: 0 12px 26px rgba(124,77,255,.18);
}

.mode-content {
    padding: 13px 5px 2px;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.insight-card {
    margin: 0;
    padding: 16px;
}

.insight-card.wide {
    grid-column: 1 / -1;
}

.insight-card ul,
.pdf-report ul {
    margin: 0;
    padding-left: 18px;
}

.insight-card li,
.pdf-report li {
    margin: 7px 0;
    color: #34394d;
    font-size: 13px;
    font-weight: 720;
    line-height: 1.45;
}

.opportunity-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.opportunity-chips span,
.source-badge {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 0 11px;
    border-radius: 999px;
    color: #5f35d9;
    background: rgba(124, 77, 255, 0.09);
    border: 1px solid rgba(124, 77, 255, 0.13);
    font-size: 12px;
    font-weight: 850;
}

.validation-panel {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
}

.source-badges {
    flex: 0 0 min(340px, 42%);
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.source-badge.ok {
    color: #047857;
    background: rgba(16,185,129,.10);
    border-color: rgba(16,185,129,.17);
}

.source-badge.warn {
    color: #b45309;
    background: rgba(245,158,11,.10);
    border-color: rgba(245,158,11,.17);
}

.map-panel {
    padding: 16px;
    overflow: hidden;
}

.map-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}

.map-heading a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    color: #fff;
    background: #090a17;
    text-decoration: none;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .045em;
}

.map-panel iframe {
    width: 100%;
    height: 250px;
    border: 0;
    border-radius: 18px;
    background: #eef2f7;
}

.print-area {
    display: none;
}

.pdf-report {
    font-family: Inter, Arial, sans-serif;
    color: #090a17;
    padding: 28px;
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 2px solid #111425;
}

.pdf-header strong,
.pdf-header span,
.pdf-header em {
    display: block;
}

.pdf-header strong {
    font-size: 22px;
    font-weight: 900;
}

.pdf-header span,
.pdf-header em {
    color: #667085;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.pdf-report h1 {
    margin: 22px 0 8px;
    font-size: 28px;
    line-height: 1.12;
}

.pdf-subtitle {
    margin: 0 0 18px;
    color: #475467;
    font-weight: 800;
}

.pdf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin: 18px 0;
}

.pdf-grid article {
    min-height: 64px;
    padding: 10px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
}

.pdf-grid small {
    display: block;
    margin-bottom: 6px;
    color: #667085;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.pdf-grid strong {
    display: block;
    font-size: 13px;
    line-height: 1.35;
}

.pdf-section,
.pdf-columns {
    margin-top: 18px;
}

.pdf-section h2,
.pdf-columns h2 {
    margin: 0 0 8px;
    font-size: 16px;
}

.pdf-section p {
    margin: 0;
    color: #344054;
    font-size: 13px;
    line-height: 1.55;
}

.pdf-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 860px) {
    .recent-list,
    .insights-grid {
        grid-template-columns: 1fr;
    }

    .score-panel,
    .validation-panel,
    .map-heading {
        flex-direction: column;
    }

    .source-badges {
        flex-basis: auto;
        width: 100%;
        justify-content: flex-start;
    }

    .mode-tabs {
        flex-direction: column;
        border-radius: 18px;
    }

    .map-heading a {
        width: 100%;
        justify-content: center;
    }
}

@media print {
    body > *:not(.print-area) {
        display: none !important;
    }

    .print-area {
        display: block !important;
    }

    @page {
        size: A4;
        margin: 12mm;
    }
}
