:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #17202a;
    background: #f3f5f7;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
    border-radius: 0 !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f3f5f7;
}

body.modal-open {
    overflow: hidden;
}

button,
select,
textarea {
    font: inherit;
}

button,
select,
textarea {
    border: 1px solid #c8cfd6;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.site-header {
    min-height: 72px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: #ffffff;
    border-bottom: 1px solid #dce1e5;
}

.brand {
    color: #17202a;
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.main-navigation {
    display: flex;
    align-items: stretch;
    align-self: stretch;
    gap: 28px;
}

.main-navigation a,
.disabled-link {
    display: flex;
    align-items: center;
    color: #5b6570;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.main-navigation .active {
    color: #17202a;
    border-bottom-color: #2563eb;
}

.disabled-link {
    opacity: 0.45;
}

.page-shell {
    width: min(760px, calc(100% - 40px));
    margin: 0 auto;
    padding: 64px 0 80px;
}

.section-label {
    margin: 0 0 8px;
    color: #64707c;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

h2,
p {
    overflow-wrap: anywhere;
}

h2 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -0.025em;
}

.recorder-panel,
.review-modal {
    background: #ffffff;
    border: 1px solid #dce1e5;
    box-shadow: 0 16px 45px rgba(23, 32, 42, 0.06);
}

.recorder-panel {
    padding: 30px;
}

.recorder-toolbar {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e8eb;
}

.language-field {
    display: grid;
    gap: 7px;
    color: #5b6570;
    font-size: 13px;
    font-weight: 700;
}

.language-field select {
    min-width: 150px;
    padding: 10px 36px 10px 12px;
    color: #17202a;
    background: #ffffff;
}

.status-row {
    min-height: 64px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    color: #5b6570;
}

.status-indicator {
    width: 10px;
    height: 10px;
    display: inline-block;
    background: #8b96a1;
}

.status-indicator.recording {
    background: #d92d20;
    animation: pulse 1.2s infinite;
}

.status-indicator.transcribing {
    width: 14px;
    height: 14px;
    background: transparent;
    border: 2px solid #bfd0ff;
    border-top-color: #2563eb;
    animation: spin 0.8s linear infinite;
}

.status-indicator.error {
    background: #b42318;
}

#timer {
    color: #17202a;
    font-variant-numeric: tabular-nums;
}

.record-button {
    width: 100%;
    min-height: 156px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 26px;
    color: #ffffff;
    background: #17202a;
    border-color: #17202a;
    font-size: 22px;
    font-weight: 750;
}

.record-button:hover:not(:disabled) {
    background: #25313d;
}

.record-button.recording {
    background: #b42318;
    border-color: #b42318;
}

.record-button.recording:hover:not(:disabled) {
    background: #982116;
}

.record-button.transcribing {
    background: #25313d;
    border-color: #25313d;
}

.record-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    background: #ffffff;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(23, 32, 42, 0.62);
}

.modal-backdrop[hidden] {
    display: none;
}

.review-modal {
    width: min(620px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 30px;
}

.review-field {
    display: grid;
    gap: 8px;
    margin-top: 24px;
    color: #39434d;
    font-size: 14px;
    font-weight: 700;
}

.review-field textarea {
    width: 100%;
    min-height: 190px;
    padding: 14px;
    color: #17202a;
    background: #ffffff;
    line-height: 1.55;
    resize: vertical;
}

.review-field textarea:focus,
.language-field select:focus,
button:focus-visible {
    outline: 2px solid #17202a;
    outline-offset: 2px;
}

.review-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.secondary-button,
.primary-button {
    min-height: 48px;
    padding: 11px 18px;
    font-weight: 700;
}

.secondary-button {
    color: #17202a;
    background: #ffffff;
}

.secondary-button:hover:not(:disabled) {
    background: #f4f6f8;
}

.danger-button {
    color: #b42318;
}

.primary-button {
    color: #ffffff;
    background: #2563eb;
    border-color: #2563eb;
}

.primary-button:hover:not(:disabled) {
    background: #1d4ed8;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 640px) {
    .site-header {
        min-height: 64px;
        padding: 0 20px;
    }

    .main-navigation {
        gap: 16px;
        font-size: 14px;
    }

    .page-shell {
        width: min(100% - 24px, 760px);
        padding: 38px 0 48px;
    }

    .recorder-panel {
        padding: 20px;
    }

    .recorder-toolbar {
        justify-content: stretch;
    }

    .language-field {
        width: 100%;
    }

    .language-field select {
        width: 100%;
    }

    .record-button {
        min-height: 132px;
    }

    .modal-backdrop {
        place-items: end center;
        padding: 0;
    }

    .review-modal {
        width: 100%;
        max-height: 92vh;
        padding: 24px 20px;
    }

    .review-actions {
        grid-template-columns: 1fr;
    }

    .primary-button {
        grid-row: 1;
    }
}

.login-shell {
    width: min(520px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    place-items: center;
    padding: 40px 0;
}

.login-panel {
    width: 100%;
    padding: 36px;
    background: #ffffff;
    border: 1px solid #dce1e5;
    box-shadow: 0 16px 45px rgba(23, 32, 42, 0.06);
}

.login-form {
    display: grid;
    gap: 20px;
    margin-top: 28px;
}

.login-form label {
    display: grid;
    gap: 8px;
    color: #39434d;
    font-size: 14px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    color: #17202a;
    background: #ffffff;
    border: 1px solid #c8cfd6;
}

.login-error {
    margin-top: 22px;
    padding: 14px;
    color: #8f1d14;
    background: #fff1f0;
    border: 1px solid #f1b7b2;
}
.review-status {

    margin: 16px 0 0;

    color: #5b6570;

    font-size: 14px;

}



.review-warning {

    margin: 14px 0 0;

    padding: 12px 14px;

    color: #8f1d14;

    background: #fff1f0;

    border: 1px solid #f1b7b2;

    font-size: 14px;

}



.review-grid {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 18px;

    margin-top: 24px;

}



.review-grid .review-field {

    margin-top: 0;

}



.review-field-wide {

    grid-column: 1 / -1;

}



.review-field input,

.review-field select,

.review-field textarea {

    width: 100%;

    min-height: 48px;

    padding: 12px;

    color: #17202a;

    background: #ffffff;

    border: 1px solid #c8cfd6;

}



.review-field textarea {

    min-height: 120px;

}



.review-field input:focus,

.review-field select:focus,

.review-field textarea:focus {

    outline: 2px solid #17202a;

    outline-offset: 2px;

}



.transcript-details {

    margin-top: 22px;

    padding-top: 18px;

    border-top: 1px solid #e5e8eb;

}



.transcript-details summary {

    color: #5b6570;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

}



.transcript-details textarea {

    width: 100%;

    min-height: 110px;

    margin-top: 14px;

    padding: 12px;

    color: #5b6570;

    background: #f7f8f9;

    border: 1px solid #dce1e5;

    line-height: 1.5;

    resize: vertical;

}



@media (max-width: 640px) {

    .review-grid {

        grid-template-columns: 1fr;

    }



    .review-field-wide {

        grid-column: auto;

    }

}.clients-shell {

    width: min(980px, calc(100% - 40px));

}



.page-heading,

.client-detail-heading,

.entry-section-heading {

    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 24px;

}



.result-count {

    min-width: 44px;

    padding: 10px 12px;

    color: #ffffff;

    background: #17202a;

    text-align: center;

    font-variant-numeric: tabular-nums;

}



.client-search {

    margin-top: 28px;

    padding: 24px;

    background: #ffffff;

    border: 1px solid #dce1e5;

}



.client-search > label {

    display: block;

    margin-bottom: 8px;

    color: #39434d;

    font-size: 14px;

    font-weight: 700;

}



.client-search-row {

    display: grid;

    grid-template-columns: 1fr auto;

    gap: 12px;

}



.client-search input {

    width: 100%;

    min-height: 48px;

    padding: 11px 13px;

    color: #17202a;

    background: #ffffff;

    border: 1px solid #c8cfd6;

}



.client-search input:focus {

    outline: 2px solid #17202a;

    outline-offset: 2px;

}



.clear-search,

.back-link {

    display: inline-block;

    margin-top: 14px;

    color: #2563eb;

    font-size: 14px;

    font-weight: 700;

    text-decoration: none;

}



.client-list {

    margin-top: 20px;

    background: #ffffff;

    border: 1px solid #dce1e5;

}



.client-row {

    min-height: 92px;

    display: grid;

    grid-template-columns: minmax(0, 1fr) auto 24px;

    align-items: center;

    gap: 24px;

    padding: 20px 24px;

    color: #17202a;

    text-decoration: none;

    border-bottom: 1px solid #e5e8eb;

}



.client-row:last-child {

    border-bottom: 0;

}



.client-row:hover {

    background: #f7f8f9;

}



.client-row-main {

    min-width: 0;

    display: grid;

    gap: 6px;

}



.client-name {

    font-size: 18px;

    overflow-wrap: anywhere;

}



.client-last-activity {

    color: #64707c;

    font-size: 13px;

}



.client-row-stats {

    min-width: 130px;

    display: grid;

    justify-items: end;

    gap: 6px;

    color: #64707c;

    font-size: 13px;

    font-variant-numeric: tabular-nums;

}



.client-row-stats strong {

    color: #17202a;

    font-size: 16px;

}



.client-row-arrow {

    color: #64707c;

    font-size: 20px;

}



.empty-state {

    padding: 48px 28px;

    text-align: center;

}



.empty-state h2 {

    margin-top: 6px;

}



.empty-state p:last-child {

    margin: 10px 0 0;

    color: #64707c;

}



.back-link {

    margin: 0 0 24px;

}



.client-record-link {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    text-decoration: none;

}



.client-summary {

    display: grid;

    grid-template-columns: 1fr 1fr 2fr;

    margin-top: 28px;

    background: #ffffff;

    border: 1px solid #dce1e5;

}



.summary-item {

    min-height: 110px;

    display: grid;

    align-content: center;

    gap: 8px;

    padding: 22px 24px;

    border-right: 1px solid #e5e8eb;

}



.summary-item:last-child {

    border-right: 0;

}



.summary-item > span {

    color: #64707c;

    font-size: 13px;

    font-weight: 700;

}



.summary-item > strong {

    font-size: 22px;

    font-variant-numeric: tabular-nums;

}



.alias-list {

    display: flex;

    flex-wrap: wrap;

    gap: 7px;

}



.alias-tag {

    padding: 6px 8px;

    color: #39434d;

    background: #f1f3f5;

    border: 1px solid #dce1e5;

    font-size: 13px;

}



.entry-section {

    margin-top: 40px;

}



.entry-list {

    margin-top: 20px;

    background: #ffffff;

    border: 1px solid #dce1e5;

}



.entry-row {

    min-height: 94px;

    display: grid;

    grid-template-columns: 5px minmax(0, 1fr) auto;

    gap: 20px;

    padding: 20px 24px 20px 0;

    border-bottom: 1px solid #e5e8eb;

}



.entry-row:last-child {

    border-bottom: 0;

}



.entry-category-marker {

    background: var(--category-color, #64748b);

}



.entry-content {

    min-width: 0;

}



.entry-meta {

    display: flex;

    flex-wrap: wrap;

    gap: 8px 16px;

    color: #64707c;

    font-size: 13px;

}



.entry-description {

    margin: 9px 0 0;

    color: #17202a;

    line-height: 1.5;

}



.entry-duration {

    align-self: center;

    white-space: nowrap;

    font-variant-numeric: tabular-nums;

}



@media (max-width: 700px) {

    .clients-shell {

        width: min(100% - 24px, 980px);

    }



    .client-search-row {

        grid-template-columns: 1fr;

    }



    .client-row {

        grid-template-columns: minmax(0, 1fr) auto;

        gap: 16px;

        padding: 18px;

    }



    .client-row-stats {

        min-width: auto;

    }



    .client-row-arrow {

        display: none;

    }



    .client-detail-heading {

        align-items: stretch;

        flex-direction: column;

    }



    .client-record-link {

        width: 100%;

    }



    .client-summary {

        grid-template-columns: 1fr 1fr;

    }



    .summary-aliases {

        grid-column: 1 / -1;

        border-top: 1px solid #e5e8eb;

    }



    .summary-item:nth-child(2) {

        border-right: 0;

    }



    .entry-row {

        grid-template-columns: 5px minmax(0, 1fr);

        padding-right: 18px;

    }



    .entry-duration {

        grid-column: 2;

        justify-self: start;

    }

}.billing-sections {

    display: grid;

    gap: 42px;

    margin-top: 40px;

}



.billing-group-heading {

    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 24px;

}



.billing-group-summary {

    display: grid;

    justify-items: end;

    gap: 5px;

    color: #64707c;

    font-size: 13px;

    font-variant-numeric: tabular-nums;

}



.billing-group-summary strong {

    color: #17202a;

    font-size: 16px;

}



.billing-group .entry-list {

    margin-top: 18px;

}



.billing-empty-state {

    padding: 28px 24px;

    color: #64707c;

    text-align: center;

}



.billing-entry {

    grid-template-columns: 5px minmax(0, 1fr) auto;

    padding-right: 24px;

}



.entry-open-button {

    min-width: 0;

    padding: 0;

    color: inherit;

    background: transparent;

    border: 0;

    text-align: left;

}



.entry-open-button:hover .entry-description {

    color: #2563eb;

}



.entry-open-button .entry-meta {

    display: flex;

}



.entry-open-button .entry-description {

    display: block;

}



.billing-status-badge {

    padding: 3px 7px;

    color: #39434d;

    background: #f1f3f5;

    border: 1px solid #dce1e5;

    font-size: 11px;

    font-weight: 700;

}



.billing-status-to_invoice {

    color: #8a4b08;

    background: #fff7e6;

    border-color: #f3cf91;

}



.billing-status-not_billable {

    color: #5b6570;

    background: #f1f3f5;

}



.billing-status-invoiced {

    color: #17643a;

    background: #edf8f1;

    border-color: #a8d7b8;

}



.billing-actions {

    grid-column: 2 / -1;

    display: flex;

    flex-wrap: wrap;

    justify-content: flex-end;

    gap: 8px;

    margin-top: 4px;

}



.billing-action-button {

    min-height: 38px;

    padding: 8px 12px;

    font-size: 13px;

}



.client-page-message {

    margin: 24px 0 0;

    padding: 12px 14px;

    color: #17643a;

    background: #edf8f1;

    border: 1px solid #a8d7b8;

    font-size: 14px;

}



.client-page-message.error {

    color: #8f1d14;

    background: #fff1f0;

    border-color: #f1b7b2;

}



@media (max-width: 700px) {

    .billing-group-heading {

        align-items: flex-start;

    }



    .billing-entry {

        grid-template-columns: 5px minmax(0, 1fr);

        padding-right: 18px;

    }



    .billing-entry .entry-duration {

        grid-column: 2;

    }



    .billing-actions {

        grid-column: 2;

        justify-content: stretch;

    }



    .billing-action-button {

        flex: 1 1 auto;

    }

}/* Billing-status visual hierarchy */

.billing-group-to_invoice {

    --billing-color: #b45309;

    --billing-soft: #fff7e6;

    --billing-border: #f3cf91;

}



.billing-group-not_billable {

    --billing-color: #475569;

    --billing-soft: #f1f3f5;

    --billing-border: #c8cfd6;

}



.billing-group-invoiced {

    --billing-color: #15803d;

    --billing-soft: #edf8f1;

    --billing-border: #a8d7b8;

}



.billing-group-heading {

    padding-left: 14px;

    border-left: 4px solid var(--billing-color);

}



.billing-status-badge {

    color: var(--billing-color);

    background: var(--billing-soft);

    border-color: var(--billing-border);

}



/* Keep entry content, duration and actions on one desktop row */

.billing-entry {

    grid-template-columns:

        5px

        minmax(0, 1fr)

        auto

        auto;

    align-items: center;

    column-gap: 20px;

}



.billing-entry .entry-category-marker {

    grid-column: 1;

    grid-row: 1;

    align-self: stretch;

}



.billing-entry .entry-open-button {

    grid-column: 2;

    grid-row: 1;

}



.billing-entry .entry-duration {

    grid-column: 3;

    grid-row: 1;

    align-self: center;

}



.billing-actions {

    grid-column: 4;

    grid-row: 1;

    align-self: center;

    justify-content: flex-end;

    flex-wrap: nowrap;

    margin-top: 0;

}



/* Matching status-button colours */

.billing-action-button[data-status="to_invoice"] {

    color: #ffffff;

    background: #b45309;

    border-color: #b45309;

}



.billing-action-button[data-status="to_invoice"]:hover:not(:disabled) {

    background: #92400e;

    border-color: #92400e;

}



.billing-action-button[data-status="not_billable"] {

    color: #ffffff;

    background: #475569;

    border-color: #475569;

}



.billing-action-button[data-status="not_billable"]:hover:not(:disabled) {

    background: #334155;

    border-color: #334155;

}



.billing-action-button[data-status="invoiced"] {

    color: #ffffff;

    background: #15803d;

    border-color: #15803d;

}



.billing-action-button[data-status="invoiced"]:hover:not(:disabled) {

    background: #166534;

    border-color: #166534;

}



@media (max-width: 850px) {

    .billing-entry {

        grid-template-columns: 5px minmax(0, 1fr) auto;

    }



    .billing-entry .entry-duration {

        grid-column: 3;

        grid-row: 1;

    }



    .billing-actions {

        grid-column: 2 / -1;

        grid-row: 2;

        justify-content: flex-end;

        flex-wrap: wrap;

        margin-top: 8px;

    }

}



@media (max-width: 520px) {

    .billing-entry {

        grid-template-columns: 5px minmax(0, 1fr);

    }



    .billing-entry .entry-duration {

        grid-column: 2;

        grid-row: 2;

        justify-self: start;

    }



    .billing-actions {

        grid-column: 2;

        grid-row: 3;

        justify-content: stretch;

    }



    .billing-action-button {

        flex: 1 1 auto;

    }

}

.billing-group .entry-category-marker {
    background: var(--billing-color);
}

.entry-edit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.entry-modal-close {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #5b6570;
    background: transparent;
    border: 0;
    font-size: 27px;
    font-weight: 400;
    line-height: 1;
}

.entry-modal-close:hover {
    color: #17202a;
    background: transparent;
}

.entry-edit-actions {
    grid-template-columns: 1fr 1fr;
}

.entry-mail-sources {
    margin-top: 20px;
    border: 1px solid #dce1e5;
}

.entry-mail-sources summary {
    padding: 13px 15px;
    color: #4d5863;
    background: #fafbfc;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.entry-mail-sources[open] summary {
    border-bottom: 1px solid #e5e8eb;
}

.entry-mail-sources-list {
    display: grid;
}

.entry-mail-source-row {
    display: grid;
    gap: 7px;
    padding: 12px 15px;
    border-bottom: 1px solid #edf0f2;
}

.entry-mail-source-row:last-child {
    border-bottom: 0;
}

.entry-mail-source-meta {
    color: #39434d;
    font-size: 13px;
}

.entry-mail-source-ids {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: #7a848e;
    font-size: 11px;
}

.entry-mail-source-ids code {
    overflow-wrap: anywhere;
}

.review-field[hidden] {
    display: none !important;
}

/* Global messages */

.global-messages {
    width: min(760px, calc(100% - 40px));
    margin: 20px auto -36px;
}

.global-message {
    margin: 0 0 10px;
    padding: 12px 14px;
    color: #39434d;
    background: #f7f8f9;
    border: 1px solid #dce1e5;
    font-size: 14px;
}

.global-message.error {
    color: #8f1d14;
    background: #fff1f0;
    border-color: #f1b7b2;
}

.global-message.success {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}


/* Mail import */

.recorder-panel .review-grid {
    align-items: start;
}

.recorder-panel .review-field input[type="text"],
.recorder-panel .review-field input[type="email"] {
    height: 52px;
    min-height: 52px;
    margin: 0;
    box-sizing: border-box;
}

.mail-jobs {
    margin-top: 56px;
}

.mail-section-heading {
    margin-bottom: 18px;
}

.mail-section-heading h2 {
    margin-bottom: 0;
}

.mail-job-list {
    background: #ffffff;
    border: 1px solid #dce1e5;
}

.mail-job-row {
    min-height: 92px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e8eb;
}

.mail-job-row:last-child {
    border-bottom: 0;
}

.mail-job-row:hover {
    background: #f7f8f9;
}

.mail-job-main {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.mail-job-main > strong {
    font-size: 18px;
}

.mail-job-main > span,
.mail-job-meta > span {
    color: #64707c;
    font-size: 13px;
}

.mail-job-error {
    color: #b42318 !important;
}

.mail-job-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    white-space: nowrap;
}

.mail-job-meta > strong {
    color: #17202a;
    font-size: 14px;
}

.mail-job-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mail-delete-form {
    display: inline-flex;
    margin: 0;
}

.mail-job-actions .secondary-button,
.mail-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 16px;
    text-decoration: none;
}


/* Mail review */

.mail-review-shell {
    width: min(940px, calc(100% - 40px));
}

.mail-review-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.mail-review-header h2 {
    font-size: 30px;
}

.mail-review-subtitle {
    margin: 8px 0 0;
    color: #64707c;
    font-size: 14px;
}

.mail-review-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 28px;
    background: #ffffff;
    border: 1px solid #dce1e5;
}

.mail-review-summary > div {
    display: grid;
    gap: 5px;
    padding: 18px 20px;
    border-right: 1px solid #e5e8eb;
}

.mail-review-summary > div:last-child {
    border-right: 0;
}

.mail-review-summary span {
    color: #64707c;
    font-size: 13px;
}

.mail-review-summary strong {
    color: #17202a;
    font-size: 22px;
}

.mail-review-finished {
    display: grid;
    gap: 6px;
    margin-top: 20px;
    padding: 16px 18px;
    color: #31533a;
    background: #f4faf5;
    border: 1px solid #cfe4d3;
}

.mail-review-finished span {
    color: #53705a;
    font-size: 13px;
    line-height: 1.5;
}

.mail-thread-list {
    display: grid;
    gap: 24px;
    margin-top: 32px;
}

.mail-thread-card {
    background: #ffffff;
    border: 1px solid #dce1e5;
}

.mail-thread-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e8eb;
}

.mail-thread-header h2 {
    font-size: 20px;
    line-height: 1.35;
}

.mail-thread-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 8px;
    color: #64707c;
    font-size: 13px;
}

.mail-task-list {
    background: #ffffff;
}

.mail-task-row {
    min-height: 104px;
    display: grid;
    grid-template-columns: 5px minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 20px;
    padding: 20px 24px 20px 0;
    border-bottom: 1px solid #e5e8eb;
}

.mail-task-row:last-child {
    border-bottom: 0;
}

.mail-task-marker {
    background: var(--category-color, #a3aab2);
}

.mail-task-row-empty .mail-task-marker {
    background: #c4cad0;
}

.mail-task-main {
    min-width: 0;
    align-self: center;
}

.mail-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    color: #64707c;
    font-size: 12px;
}

.mail-task-description {
    display: block;
    margin-top: 8px;
    color: #17202a;
    font-size: 16px;
    line-height: 1.5;
}

.mail-task-result {
    display: block;
    margin-top: 8px;
    color: #166534;
    font-size: 13px;
    font-weight: 700;
}

.mail-task-result.pending {
    color: #925f0a;
}

.mail-task-result.muted {
    color: #64707c;
}

.mail-task-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    align-self: center;
}

.mail-task-actions .primary-button,
.mail-task-actions .secondary-button {
    min-height: 42px;
    padding: 9px 13px;
    white-space: nowrap;
}

.mail-evidence {
    border-top: 1px solid #e5e8eb;
}

.mail-evidence summary {
    padding: 16px 24px;
    color: #4d5863;
    background: #fafbfc;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.mail-evidence[open] summary {
    border-bottom: 1px solid #e5e8eb;
}

.mail-email-list {
    display: grid;
}

.mail-email-card {
    padding: 18px 24px;
    border-bottom: 1px solid #edf0f2;
}

.mail-email-card:last-child {
    border-bottom: 0;
}

.mail-email-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    color: #64707c;
    font-size: 12px;
}

.mail-email-header > div {
    display: flex;
    gap: 10px;
}

.mail-email-header strong {
    color: #17202a;
}

.mail-email-body {
    margin: 14px 0 0;
    padding: 0;
    color: #303a44;
    background: transparent;
    border: 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.mail-email-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 14px;
    color: #7a848e;
    font-size: 11px;
}

.mail-email-refs code {
    overflow-wrap: anywhere;
}

.mail-finish-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    margin-top: 32px;
    padding: 22px 24px;
    background: #ffffff;
    border: 1px solid #dce1e5;
}

.mail-finish-panel p:last-child {
    max-width: 650px;
    margin: 8px 0 0;
    color: #64707c;
    font-size: 13px;
    line-height: 1.55;
}

.mail-finish-panel .primary-button {
    min-width: 150px;
}

.mail-finish-panel .primary-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#mail-connect-target {
    min-height: 52px;
}

@media (max-width: 850px) {
    .mail-job-row {
        grid-template-columns: 1fr;
    }

    .mail-job-meta {
        justify-content: flex-start;
        flex-wrap: wrap;
        white-space: normal;
    }

    .mail-task-row {
        grid-template-columns: 5px minmax(0, 1fr);
    }

    .mail-task-actions {
        grid-column: 2;
        justify-content: flex-start;
        flex-wrap: wrap;
        padding-bottom: 2px;
    }
}

@media (max-width: 640px) {
    .mail-review-header,
    .mail-finish-panel {
        grid-template-columns: 1fr;
        display: grid;
    }

    .mail-review-summary {
        grid-template-columns: 1fr;
    }

    .mail-review-summary > div {
        border-right: 0;
        border-bottom: 1px solid #e5e8eb;
    }

    .mail-review-summary > div:last-child {
        border-bottom: 0;
    }

    .mail-thread-header,
    .mail-email-card {
        padding-left: 18px;
        padding-right: 18px;
    }

    .mail-task-row {
        gap: 14px;
        padding-right: 18px;
    }

    .mail-email-header {
        display: grid;
    }

    .mail-email-header > div {
        flex-wrap: wrap;
    }

    .mail-evidence summary {
        padding-left: 18px;
        padding-right: 18px;
    }
}
