body {
    font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
    width: min(430px, 100vw);
    min-width: 360px;
    min-height: 0;
    margin: 0;
    background:
        radial-gradient(circle at top, rgba(255, 216, 153, 0.22), transparent 22%),
        radial-gradient(circle at 20% 0%, rgba(26, 115, 232, 0.08), transparent 18%),
        linear-gradient(180deg, #fffefd 0%, #f7f8fb 100%);
    color: #202124;
    overflow: hidden;
}

.container {
    box-sizing: border-box;
    min-height: min(760px, 100vh);
    max-height: min(760px, 100vh);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

header::after {
    content: "";
    width: 72px;
    height: 4px;
    border-radius: 999px;
    margin-top: 12px;
    background: linear-gradient(90deg, #1a73e8 0%, #36c275 60%, #fbbc05 100%);
    opacity: 0.85;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo-container {
    border: 1px solid rgba(17, 18, 20, 0.07);
    border-radius: 999px;
    padding: 14px 36px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.05);
}

#logo {
    height: 72px;
    width: auto;
    display: block;
}

.brand-title {
    color: #14161b;
    font-size: 24px;
    margin: 10px 0 3px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.subtitle {
    margin: 0;
    color: #5f6368;
    font-size: 13px;
    line-height: 1.4;
}

.status-card {
    background: rgba(255, 255, 255, 0.98);
    position: relative;
    border-radius: 18px;
    padding: 14px 16px;
    border-left: 6px solid #1a73e8;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.05);
}

.status-card strong {
    display: block;
    font-size: 15px;
    margin-bottom: 5px;
}

.status-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #3c4043;
}

.status-info {
    border-left-color: #1a73e8;
}

.status-success {
    border-left-color: #1e8e3e;
}

.status-warning {
    border-left-color: #f9ab00;
}

.status-danger {
    border-left-color: #d93025;
}

.pill-button {
    background: linear-gradient(180deg, #1490ff 0%, #0d77ef 100%);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(26, 115, 232, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.pill-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(26, 115, 232, 0.28);
}

.pill-button:disabled {
    opacity: 0.7;
    cursor: progress;
}

.secondary-button {
    background: #efefef;
    color: #5d6169;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
}

.secondary-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.loader-text {
    font-size: 13px;
    color: #184a9c;
    font-weight: 500;
    line-height: 1.45;
}

.results-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 4px;
}

.triage-panel {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e4e8ef;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.05);
}

.triage-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.triage-panel__header strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.triage-panel__header p {
    margin: 0;
    font-size: 12px;
    color: #5f6368;
    line-height: 1.45;
}

.triage-panel__badge {
    border-radius: 999px;
    background: #eef4ff;
    color: #184a9c;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

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

.triage-area {
    display: block;
    flex: 0 0 auto;
}

.triage-box {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #dde4ee;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.04);
}

.triage-box strong {
    display: block;
    font-size: 24px;
    line-height: 1;
}

.triage-box span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
}

.triage-danger {
    background: rgba(217, 48, 37, 0.1);
    color: #b42318;
}

.triage-warning {
    background: rgba(249, 171, 0, 0.16);
    color: #8a5b00;
}

.triage-success {
    background: rgba(30, 142, 62, 0.1);
    color: #166534;
}

.card {
    display: flex;
    position: relative;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e0e4ea;
    border-left: 6px solid #1a73e8;
    border-radius: 16px;
    padding: 15px 16px;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card--interactive:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 14px 28px rgba(17, 24, 39, 0.1);
}

.card--pressed {
    animation: popupCardPulse 0.42s ease;
}

.left-icon {
    min-width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 1px;
    border-radius: 999px;
    background: rgba(24, 74, 156, 0.08);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.card-content strong {
    font-size: 15px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.card-content p {
    margin: 0;
    font-size: 13px;
    color: #3c4043;
    line-height: 1.45;
}

.card-extra {
    font-weight: 500;
}

.card-quote {
    font-style: italic;
    color: #5f6368;
}

.card-quote-button {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 10px 12px;
    background: #f5f7fb;
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease, transform 0.16s ease;
}

.card-quote-button:hover {
    background: #e8f0fe;
    transform: translateY(-1px);
}

.card-quote-button::before {
    content: "Apri nel testo";
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #184a9c;
    font-style: normal;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.card-button {
    border: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    border-radius: 999px;
    background: #e8f0fe;
    color: #184a9c;
    padding: 8px 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    align-self: flex-start;
}

.card-red {
    border-left-color: #d93025;
}

.card-red .left-icon,
.card-red strong,
.card-danger .left-icon,
.card-danger strong {
    color: #d93025;
}

.card-yellow {
    border-left-color: #f9ab00;
}

.card-yellow .left-icon,
.card-yellow strong,
.card-warning .left-icon,
.card-warning strong {
    color: #b97400;
}

.card-green {
    border-left-color: #1e8e3e;
}

.card-green .left-icon,
.card-green strong,
.card-success .left-icon,
.card-success strong {
    color: #1e8e3e;
}

.card-blue {
    border-left-color: #1a73e8;
}

.card-blue .left-icon,
.card-blue strong,
.card-info .left-icon,
.card-info strong {
    color: #1a73e8;
}

.card-danger {
    border-left-color: #d93025;
}

.card-warning {
    border-left-color: #f9ab00;
}

.card-success {
    border-left-color: #1e8e3e;
}

.card-info {
    border-left-color: #1a73e8;
}

.card-section {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.card-section__label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.card-section__value {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #1e293b;
}

@keyframes popupCardPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.015); }
    100% { transform: scale(1); }
}

.popup-footer {
    margin-top: 0;
    padding: 6px 6px 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: #64748b;
    text-align: center;
}

@media (max-width: 420px) {
    body {
        width: 100vw;
    }

    .container {
        padding: 14px;
        gap: 12px;
    }

    .logo-container {
        padding: 14px 30px;
    }

    #logo {
        height: 74px;
    }

    .brand-title {
        font-size: 24px;
    }

    .action-row {
        grid-template-columns: 1fr;
    }

    .triage-grid,
    .triage-area {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }

    .card {
        padding: 13px;
        gap: 12px;
    }
}


.card-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(26, 115, 232, 0.16);
}

.results-area::-webkit-scrollbar {
    width: 8px;
}

.results-area::-webkit-scrollbar-thumb {
    background: rgba(95, 99, 104, 0.22);
    border-radius: 999px;
}

.card-section:first-child {
    border-color: rgba(21, 130, 255, 0.18);
    background: #f5f9ff;
}



