/* customer grid: "Merkmale" tags. Colors come inline as --bg / --fg */
.ctags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 320px;
}

.badge.ctag {
    background-color: var(--bg);
    color: var(--fg);
    border: 1px solid var(--color-highlight2);
    margin-bottom: 0;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ctag i {
    font-size: 1.25em;
    vertical-align: -.15em;
}

/* customer grid: address as a little business card */
.customer-address {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: 280px;
    max-width: 100%;
    padding: 8px 32px 8px 12px;
    line-height: 1.35;
    /* the grid cells are nowrap: without this a long street runs out of the card */
    white-space: normal;
    overflow-wrap: anywhere;
    border: 1px solid var(--color-border-medium, #dde1e5);
    border-left: 4px solid var(--color-highlight2);
    border-radius: 4px;
    background-color: rgba(0, 0, 0, .02);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.customer-address .ca-street {
    font-weight: 600;
}

.customer-address .ca-country {
    font-size: .7rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.customer-address .ca-street ~ .ca-country,
.customer-address .ca-city ~ .ca-country {
    margin-top: 3px;
    padding-top: 3px;
    border-top: 1px solid var(--color-border-medium, #dde1e5);
}

.customer-address .ca-map {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 20px;
    text-align: center;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--color-highlight2);
}

/* contact history widget */
.ce-create {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border-medium, #dde1e5);
}
.ce-create .ce-add {
    border-radius: 999px !important;
    padding: 2px 12px;
    background: color-mix(in srgb, var(--color-highlight) 10%, transparent);
    color: var(--color-highlight);
    border: 0;
}
.ce-create .ce-add:hover {
    background: color-mix(in srgb, var(--color-highlight) 20%, transparent);
}
.ce-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 -8px;
    padding: 8px;
    border-radius: .3rem;
}
.ce-item:hover {
    background: var(--color-surface-light-1);
}
.ce-icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-highlight) 13%, transparent);
    color: var(--color-highlight);
    font-size: 1.15rem;
}
.ce-body {
    flex: 1 1 0;
    min-width: 0;
}
.ce-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0 12px;
    font-size: .78rem;
    color: var(--color-text-muted);
}
.ce-meta strong {
    font-weight: var(--font-weight-strong);
    color: inherit;
}
.ce-creator {
    margin-left: auto;
}
.ce-creator i {
    margin-right: 3px;
}
.ce-content {
    overflow-wrap: anywhere;
}
.ce-missing {
    color: var(--danger, #d93025);
    font-style: italic;
}
.ce-tools {
    flex: none;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s ease;
}
.ce-item:hover .ce-tools,
.ce-item:focus-within .ce-tools {
    opacity: 1;
}
@media (hover: none) {
    .ce-tools {
        opacity: 1;
    }
}
.ce-tools .btn {
    padding: 0 5px;
    color: var(--color-text-faint-2);
}
.ce-tools .btn:hover {
    color: var(--color-highlight);
}
.ce-empty {
    padding: 14px 0;
    text-align: center;
    font-size: 1.8rem;
    color: var(--color-text-faint-3);
}
.ce-total {
    margin-top: 8px;
    font-size: .78rem;
    color: var(--color-text-muted);
    text-align: right;
}

/* addresses widget (shares .ce-create / .ce-tools / .ce-empty with the contact history) */
.ad-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 -8px;
    padding: 8px;
    border-radius: .3rem;
}
.ad-item:hover {
    background: var(--color-surface-light-1);
}
.ad-icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-text-muted) 14%, transparent);
    color: var(--color-text-muted);
    font-size: 1.15rem;
}
.ad-primary .ad-icon {
    background: var(--color-highlight);
    color: #fff;
}
.ad-body {
    flex: 1 1 0;
    min-width: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.ad-name,
.ad-street {
    font-weight: var(--font-weight-strong);
}
.ad-additional {
    color: var(--color-text-muted);
}
.ad-country {
    font-size: .7rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.ad-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    font-size: .75rem;
    background: color-mix(in srgb, var(--color-highlight) 13%, transparent);
    color: var(--color-highlight);
}
.ad-badge-action {
    background: transparent;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-text-muted) 35%, transparent);
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease;
}
.ad-item:hover .ad-badge-action,
.ad-badge-action:focus {
    opacity: 1;
}
.ad-badge-action:hover {
    color: var(--color-highlight);
    box-shadow: inset 0 0 0 1px var(--color-highlight);
}
@media (hover: none) {
    .ad-badge-action {
        opacity: 1;
    }
}
.ad-item:hover .ce-tools,
.ad-item:focus-within .ce-tools {
    opacity: 1;
}
