:root {
    --aa-bg: #0f1724;
    --aa-panel: rgba(255,255,255,0.045);
    --aa-border: rgba(125,211,252,0.14);
    --aa-text: #eef4f8;
    --aa-muted: #94a3b8;
    --aa-primary: #7dd3fc;
    --aa-highlight: #facc15;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: transparent;
    color: var(--aa-text);
    font-family:
        Inter,
        Arial,
        sans-serif;
}

.anchorage-analysis-widget {
    min-height: 100vh;
    padding: 24px;

    background:
        radial-gradient(
            circle at top right,
            rgba(125,211,252,0.10),
            transparent 420px
        ),
        var(--aa-bg);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;

    margin-bottom: 22px;
}

.widget-kicker {
    margin-bottom: 6px;

    color: var(--aa-primary);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.analysis-header h1 {
    margin: 0;

    font-size: 28px;
    line-height: 1.15;
}

.anchorage-selector {
    display: grid;
    gap: 7px;

    min-width: min(420px, 45vw);

    color: var(--aa-muted);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.anchorage-selector select {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;

    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;

    background: #172131;
    color: var(--aa-text);

    font: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.analysis-status {
    padding: 22px;

    border: 1px solid var(--aa-border);
    border-radius: 18px;

    background: var(--aa-panel);
    color: var(--aa-muted);

    text-align: center;
}

.anchorage-identity {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    margin-bottom: 18px;
    padding: 20px 22px;

    border: 1px solid var(--aa-border);
    border-radius: 22px;

    background: var(--aa-panel);
}

.anchorage-number {
    margin-bottom: 4px;

    color: var(--aa-primary);

    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.anchorage-identity h2 {
    margin: 0 0 5px;

    font-size: 26px;
    line-height: 1.15;
}

.anchorage-region {
    color: var(--aa-muted);
    font-size: 14px;
}

.state-badge {
    flex: 0 0 auto;

    padding: 7px 12px;

    border: 1px solid rgba(125,211,252,0.25);
    border-radius: 999px;

    color: var(--aa-primary);

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.state-green {
    border-color: rgba(52,211,153,0.28);
    color: #6ee7b7;
}

.state-red {
    border-color: rgba(248,113,113,0.32);
    color: #fca5a5;
}

.state-blue {
    border-color: rgba(96,165,250,0.32);
    color: #93c5fd;
}

.analysis-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.analysis-card {
    min-width: 0;
    padding: 20px 22px;

    border: 1px solid var(--aa-border);
    border-radius: 22px;

    background: var(--aa-panel);

    box-shadow:
        0 18px 50px
        rgba(0,0,0,0.12);
}

.analysis-card h3 {
    margin: 0 0 16px;

    color: #cdd7e0;

    font-size: 16px;
    font-weight: 700;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 18px;

    padding: 10px 0;

    border-top:
        1px solid
        rgba(255,255,255,0.06);
}

.metric-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.metric-row span {
    min-width: 0;

    color: var(--aa-muted);

    font-size: 13px;
}

.metric-row strong {
    flex: 0 0 auto;

    color: var(--aa-text);

    font-size: 16px;
    font-weight: 700;

    text-align: right;
}

.metric-highlight strong {
    color: var(--aa-highlight);
    font-size: 18px;
}

[hidden] {
    display: none !important;
}

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

    .anchorage-selector {
        min-width: 0;
        width: 100%;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .anchorage-analysis-widget {
        padding: 14px;
    }

    .analysis-header h1 {
        font-size: 24px;
    }

    .anchorage-identity {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .analysis-card {
        padding: 18px;
    }

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

    .metric-row strong {
        max-width: 55%;
        white-space: normal;
    }
}
