/* Cancel Assist: the letter sheet (CancelLetterSheet.razor), where a member reads the cancellation request Chip In
   wrote, changes it and sends it themselves. Built on the Recurring area's dialog, tags, rows and buttons
   (recurring-area.css), the Cancel sheet's sections (cancel-assist.css) and the popups' field box; this file adds only
   the layout those don't have. Colors come from the area's variables, so light and dark follow the site theme. No
   filled tiles, by design. Prefix: cl-. */

.cl-body { gap: 16px; }

/* E-mail or letter: two choices side by side, the chosen one filled. */
.cl-seg {
    display: inline-flex;
    align-self: flex-start;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--rc-line);
    border-radius: 12px;
}

.cl-seg-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--rc-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}

.cl-seg-btn:hover:not(:disabled) { color: var(--tx-primary); }
.cl-seg-btn[aria-pressed="true"] { background: var(--tx-primary); color: #fff; }
.cl-seg-btn:disabled { cursor: default; opacity: .6; }
.cl-seg-btn:focus-visible { outline: 2px solid var(--tx-primary); outline-offset: 2px; }

.cl-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cl-note { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--rc-muted); }
.cl-address { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }

/* The request itself: room to read a whole letter, and to grow. */
.cl-text.tx-field-textarea {
    min-height: 300px;
    resize: vertical;
    font-size: 14px;
    line-height: 1.6;
}

.cl-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--rc-card-border);
    border-left: 4px solid var(--tx-positive);
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
}

.cl-notice i { margin-top: 3px; color: var(--tx-positive); }

/* What the provider needs: closed until the member wants it. */
.cl-details { border: 1px solid var(--rc-card-border); border-radius: 14px; }

.cl-details > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.cl-details > summary::-webkit-details-marker { display: none; }
.cl-details > summary::after { content: "+"; margin-left: auto; font-size: 18px; font-weight: 500; color: var(--rc-muted); }
.cl-details[open] > summary::after { content: "\2212"; }
.cl-details > summary i { color: var(--tx-primary); }
.cl-details > summary:focus-visible { outline: 2px solid var(--tx-primary); outline-offset: 2px; border-radius: 12px; }
.cl-details-body { display: flex; flex-direction: column; gap: 12px; padding: 0 14px 14px; }
.cl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cl-grid .cl-wide { grid-column: 1 / -1; }

.cl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    margin: 0;
    font-size: 12.5px;
    color: var(--rc-muted);
}

.cl-meta .rc-link-btn { margin-left: auto; }

/* The correspondence: one message under another, a provider's reply marked on its edge. */
.cl-thread { display: flex; flex-direction: column; gap: 10px; }

.cl-msg {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid var(--rc-card-border);
    border-radius: 14px;
}

.cl-msg-in { border-left: 4px solid var(--tx-primary); }
.cl-msg-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.cl-msg-who { font-size: 13.5px; font-weight: 700; }
.cl-msg-to { margin: 0; overflow-wrap: anywhere; }
.cl-msg-subject { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }

.cl-msg-body {
    margin: 0;
    font: inherit;
    font-size: 13.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.cl-foot { gap: 8px; }

/* What the member agrees to before Chip In sends in their name: the words stand apart, marked on their edge. */
.cl-statement {
    margin: 0;
    padding-left: 12px;
    border-left: 3px solid var(--rc-line);
    font-size: 13.5px;
    line-height: 1.6;
}

/* The way in from the Cancel sheet. */
.cax-letter { padding-top: 12px; border-top: 1px solid var(--rc-card-border); }

@media (max-width: 575.98px) {
    .cl-grid { grid-template-columns: minmax(0, 1fr); }
    .cl-seg { align-self: stretch; }
    .cl-seg-btn { flex: 1 1 0; justify-content: center; }
    .cl-text.tx-field-textarea { min-height: 240px; }
    .cl-foot .rc-task-btn { flex: 1 1 auto; justify-content: center; }
    .cl-meta .rc-link-btn { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cl-seg-btn { transition: none; }
}
