.ag-client {
    --ag-blue: #0a405f;
    --ag-ink: #294858;
    --ag-muted: #486070;
    --ag-outline: #cbd9df;
}
.ag-client .yi-attivita-misura {
    --ag-distance-icon: url("/Assets/Img/icons/distanza-diretta.svg?v=1eb21ccd7943");
    position: relative;
    min-height: 1.6em;
    margin: 4px 0 14px;
    padding-inline-start: 2.1em;
    color: #45596a;
    line-height: 1.6;
    text-align: start;
    overflow-wrap: anywhere;
}
.ag-client .yi-attivita-misura::before,
.ag-client .yi-attivita-misura::after {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    width: 1.6em;
    height: 1.6em;
    pointer-events: none;
}
.ag-client .yi-attivita-misura::before {
    border-radius: 50%;
    background-color: #e8f3f8;
}
.ag-client .yi-attivita-misura::after {
    background: var(--ag-distance-icon) center / 1.35em no-repeat;
}
.ag-client .ag-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 0;
}
.ag-client .ag-grid:not(:has(> :nth-child(3))) {
    justify-content: flex-start;
}
.ag-client .ag-grid:has(.ag-photo) { align-items: start; }
.ag-client > .ag-grid + p,
.ag-client > .ag-calendars {
    padding-block-start: clamp(20px, 2.5vw, 28px);
}
.ag-client > .ag-calendars {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
}
.ag-client .ag-calendars > .yi-event-calendar { margin: 0; }
.customer-page-content .ag-client .ag-calendars > a:first-child:not(:only-child) {
    border-color: #145474;
    background: #145474;
    color: #fff;
    font-weight: 600;
}
.customer-page-content .ag-client .ag-calendars > a:first-child:not(:only-child):is(:hover, :focus-visible) {
    border-color: #0a405f;
    background: #0a405f;
}
@media (max-width: 480px) {
    .ag-client .ag-calendars > .yi-event-calendar { flex-basis: 100%; }
}
.ag-grid .ag-card {
    flex: 0 0 calc((100% - 32px) / 3);
    box-sizing: border-box;
    position: relative;
    min-width: 0;
    padding: clamp(16px, 1.7vw, 23px);
    border: 1px solid var(--ag-outline);
    border-radius: 14px;
    background: white;
    color: var(--ag-ink);
    text-align: start;
    overflow-wrap: anywhere;
}
.ag-card .ag-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    color: var(--ag-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}
.ag-head .ag-date {
    max-width: 100%;
    padding: 4px 9px;
    border: 1px solid #f1cda8;
    border-radius: 7px;
    background: #fff0df;
    color: #783e15;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}
.ag-client article.ag-card > h3.ag-title,
#page .ag-client article.ag-card > h3.ag-title {
    display: block;
    position: static;
    min-height: 0;
    margin: 10px 0 6px !important;
    padding: 0;
    font-size: clamp(20px, 1.7vw, 24px);
    font-weight: 750;
    line-height: 1.28;
    letter-spacing: -.015em;
    text-align: start;
    white-space: normal;
    overflow: visible;
}
.ag-title > a.ag-open {
    position: static;
    color: var(--ag-blue);
    font: inherit;
    text-decoration: none;
}
.ag-open::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 14px;
}
.ag-title .ag-open:focus-visible { outline: none; text-decoration: underline; }
.ag-open:focus-visible::after { outline: 3px solid #205c80; outline-offset: 2px; }
.ag-card .ag-place,
.ag-card .ag-related {
    margin: 0;
    text-align: start;
    line-height: 1.45;
}
.ag-card .ag-place { font-size: 15px; color: var(--ag-ink); }
.ag-card .ag-town { color: var(--ag-muted); }
.ag-card .ag-related {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #dee7eb;
    color: var(--ag-muted);
    font-size: 13px;
}
.ag-related .ag-relation { color: #31556a; font-weight: 700; }
.ag-related .ag-distance { color: var(--ag-muted); }
.ag-distance::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 3px;
    margin-inline-end: 8px;
    vertical-align: .22em;
    border-radius: 50%;
    background: #738a97;
}
.ag-card[data-proprio="1"] .ag-relation { color: #145d49; }
.ag-card .ag-photo {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    margin: 15px 0 0;
    text-align: start;
}
.ag-card .ag-photo img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 170px;
    object-fit: contain;
    object-position: left top;
    border-radius: 8px;
}
.ag-photo figcaption {
    margin: 0;
    padding: 0;
    color: #3a5261;
    font-size: 12px;
    line-height: 1.45;
}
.ag-photo .ag-credit { display: block; margin-top: 3px; }
.ag-photo .ag-credit a {
    position: relative;
    z-index: 2;
    display: inline-block;
    min-height: 24px;
    line-height: 24px;
    color: #164c70;
    text-decoration: underline;
    text-underline-offset: .15em;
}
.ag-credit a:focus-visible { outline: 2px solid #205c80; outline-offset: 2px; }
@media (hover: hover) {
    .ag-card:has(.ag-open:hover) { border-color: #799bab; }
    .ag-card .ag-open:hover { text-decoration: underline; text-underline-offset: .12em; }
}
@media (max-width: 970px) {
    .ag-grid .ag-card { flex-basis: calc((100% - 16px) / 2); }
}
@media (max-width: 630px) {
    .ag-client .ag-grid { gap: 12px; }
    .ag-grid .ag-card { flex-basis: 100%; }
}
@layer portal-word-flow {
    #page .ag-card :is(h3, p, a, span),
    #page .ag-client :is(.yi-attivita-misura, .ag-calendars a),
    #page .ag-client :is(.yi-attivita-misura, .ag-calendars) span.portal-whole-word {
        overflow-wrap: anywhere !important;
    }
    #page .ag-card span.portal-whole-word,
    #page .ag-client :is(.yi-attivita-misura, .ag-calendars) span.portal-whole-word {
        white-space: normal !important;
    }
}
@media (forced-colors: active) {
    .ag-client .yi-attivita-misura::after {
        forced-color-adjust: none;
        background: CanvasText;
        -webkit-mask: var(--ag-distance-icon) center / 1.35em no-repeat;
        mask: var(--ag-distance-icon) center / 1.35em no-repeat;
    }
    .ag-card .ag-open:focus-visible::after { outline-color: Highlight; }
}
