.mail-dashboard {
    display: grid;
    gap: 1.5rem;
}

.fi-sidebar-nav-groups > .fi-sidebar-group { margin-bottom: .5rem; }
.mail-dashboard__card { transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.mail-dashboard__card:hover { border-color: #fdba74; box-shadow: 0 10px 24px rgb(124 45 18 / 7%); transform: translateY(-2px); }
.fi-section, .fi-ta-ctn, .fi-fo-component-ctn { border-radius: 1rem !important; }
@media (prefers-reduced-motion: reduce) {
    .mail-dashboard__card { transition: none; }
    .mail-dashboard__card:hover { transform: none; }
}
@media (max-width: 48rem) {
    .mail-dashboard__hero { grid-template-columns: 1fr; }
    .mail-dashboard__steps, .mail-dashboard__cards { grid-template-columns: 1fr; }
}

.mail-dashboard__hero {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(17rem, 0.85fr);
    align-items: center;
    gap: 2rem;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    overflow: hidden;
    border: 1px solid #fed7aa;
    border-radius: 1rem;
    background:
        radial-gradient(circle at 90% 10%, rgb(251 146 60 / 16%), transparent 34%),
        linear-gradient(125deg, #fff7ed 0%, #fff 62%, #fffaf5 100%);
}

.mail-dashboard__hero-copy {
    display: grid;
    justify-items: start;
    gap: 1rem;
    max-width: 48rem;
}

.mail-dashboard__eyebrow,
.mail-dashboard__card-label,
.mail-dashboard__section-mark {
    margin: 0;
    color: #c2410c;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.mail-dashboard__hero h2 {
    margin: 0;
    color: #1c1917;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.mail-dashboard__intro {
    max-width: 42rem;
    margin: 0;
    color: #57534e;
    font-size: 1rem;
    line-height: 1.7;
}

.mail-dashboard__provider {
    padding: 1.25rem;
    border: 1px solid rgb(231 229 228 / 90%);
    border-radius: 0.9rem;
    background: rgb(255 255 255 / 88%);
    box-shadow: 0 8px 24px rgb(124 45 18 / 6%);
}

.mail-dashboard__provider-top,
.mail-dashboard__section-heading,
.mail-dashboard__card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.mail-dashboard__provider-top > span {
    color: #78716c;
    font-size: 0.8rem;
    font-weight: 600;
}

.mail-dashboard__provider h3 {
    margin: 1rem 0 0.35rem;
    color: #1c1917;
    font-size: 1.25rem;
    font-weight: 700;
}

.mail-dashboard__provider p {
    margin: 0;
    color: #57534e;
    font-size: 0.875rem;
    line-height: 1.6;
}

.mail-dashboard__section {
    padding: 1.5rem;
    border: 1px solid #e7e5e4;
    border-radius: 1rem;
    background: #fff;
}

.mail-dashboard__section-heading {
    margin-bottom: 1.25rem;
}

.mail-dashboard__section-heading h3 {
    margin: 0;
    color: #1c1917;
    font-size: 1.1rem;
    font-weight: 700;
}

.mail-dashboard__section-heading p {
    margin: 0.35rem 0 0;
    color: #78716c;
    font-size: 0.875rem;
}

.mail-dashboard__section-mark {
    color: #a8a29e;
    white-space: nowrap;
}

.mail-dashboard__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mail-dashboard__steps li {
    display: flex;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid #f5f5f4;
    border-radius: 0.8rem;
    background: #fafaf9;
}

.mail-dashboard__step-number {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    flex: 0 0 2.2rem;
    place-items: center;
    border-radius: 999px;
    background: #ffedd5;
    color: #c2410c;
    font-size: 0.75rem;
    font-weight: 700;
}

.mail-dashboard__step-number--muted {
    background: #e7e5e4;
    color: #78716c;
}

.mail-dashboard__steps h4 {
    margin: 0.15rem 0 0.35rem;
    color: #292524;
    font-size: 0.9rem;
    font-weight: 650;
}

.mail-dashboard__steps p {
    margin: 0;
    color: #78716c;
    font-size: 0.8rem;
    line-height: 1.5;
}

.mail-dashboard__cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.mail-dashboard__card {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 0.8rem;
    min-height: 11rem;
    padding: 1.25rem;
    border: 1px solid #e7e5e4;
    border-radius: 1rem;
    background: #fff;
}

.mail-dashboard__card-top {
    width: 100%;
}

.mail-dashboard__card-label {
    color: #a8a29e;
    font-size: 0.65rem;
}

.mail-dashboard__card-icon {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border-radius: 0.75rem;
}

.mail-dashboard__card-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.mail-dashboard__card-icon--orange {
    background: #fff7ed;
    color: #ea580c;
}

.mail-dashboard__card-icon--blue {
    background: #eff6ff;
    color: #2563eb;
}

.mail-dashboard__card-icon--purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.mail-dashboard__card h3 {
    margin: 0;
    color: #1c1917;
    font-size: 1rem;
    font-weight: 700;
}

.mail-dashboard__card p {
    margin: 0;
    color: #78716c;
    font-size: 0.85rem;
    line-height: 1.55;
}

.dark .mail-dashboard__hero {
    border-color: rgb(251 146 60 / 25%);
    background:
        radial-gradient(circle at 90% 10%, rgb(251 146 60 / 12%), transparent 34%),
        linear-gradient(125deg, #292524 0%, #1c1917 62%, #211b18 100%);
}

.dark .mail-dashboard__hero h2,
.dark .mail-dashboard__provider h3,
.dark .mail-dashboard__section-heading h3,
.dark .mail-dashboard__steps h4,
.dark .mail-dashboard__card h3 {
    color: #fafaf9;
}

.dark .mail-dashboard__intro,
.dark .mail-dashboard__provider p,
.dark .mail-dashboard__steps p,
.dark .mail-dashboard__card p {
    color: #a8a29e;
}

.dark .mail-dashboard__provider,
.dark .mail-dashboard__section,
.dark .mail-dashboard__card {
    border-color: rgb(255 255 255 / 10%);
    background: #1c1917;
}

.dark .mail-dashboard__steps li {
    border-color: rgb(255 255 255 / 8%);
    background: rgb(255 255 255 / 4%);
}

.mail-settings {
    width: 100%;
    max-width: 70rem;
}

.mail-settings__form {
    display: grid;
    gap: 1.25rem;
}

.mail-settings__card {
    display: grid;
    gap: 1.75rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid #e7e5e4;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgb(28 25 23 / 4%);
}

.mail-settings__header,
.mail-settings__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.mail-settings__header h2 {
    margin: 0;
    color: #1c1917;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.mail-settings__header p {
    max-width: 46rem;
    margin: 0.5rem 0 0;
    color: #78716c;
    font-size: 0.9rem;
    line-height: 1.6;
}

.mail-settings__badge {
    flex: 0 0 auto;
    padding: 0.4rem 0.7rem;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 0.75rem;
    font-weight: 650;
}

.mail-settings__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1.5rem;
}

.mail-settings__field {
    display: grid;
    align-content: start;
    gap: 0.5rem;
    min-width: 0;
    color: #292524;
    font-size: 0.875rem;
    font-weight: 600;
}

.mail-settings__field input,
.mail-settings__field textarea,
.mail-settings__value {
    width: 100%;
    min-height: 2.85rem;
    margin: 0;
    padding: 0.7rem 0.85rem;
    border: 1px solid #d6d3d1;
    border-radius: 0.65rem;
    background: #fff;
    color: #1c1917;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgb(28 25 23 / 4%);
}

.mail-settings__field textarea {
    min-height: 6rem;
    resize: vertical;
}

.mail-settings__field input::placeholder,
.mail-settings__field textarea::placeholder {
    color: #a8a29e;
}

.mail-settings__field input:focus,
.mail-settings__field textarea:focus {
    border-color: #f97316;
    outline: 3px solid rgb(249 115 22 / 18%);
    outline-offset: 1px;
}

.mail-settings__field small {
    color: #78716c;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.5;
}

.mail-settings__optional {
    margin-left: 0.35rem;
    color: #78716c;
    font-size: 0.75rem;
    font-weight: 400;
}

.mail-settings__value {
    display: flex;
    align-items: center;
    overflow-wrap: anywhere;
    background: #fafaf9;
}

.mail-settings__error {
    color: #b91c1c;
    font-size: 0.8rem;
    font-weight: 500;
}

.mail-settings__footer {
    flex-wrap: wrap;
    padding-top: 1.25rem;
    border-top: 1px solid #e7e5e4;
}

.mail-settings__status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    color: #57534e;
    font-size: 0.82rem;
}

.mail-settings__status strong {
    color: #292524;
    font-weight: 650;
}

.mail-settings__status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 0 3px #fef3c7;
}

.mail-settings__status-dot--ready {
    background: #16a34a;
    box-shadow: 0 0 0 3px #dcfce7;
}

.mail-settings__status-divider {
    width: 1px;
    height: 1rem;
    margin-inline: 0.2rem;
    background: #d6d3d1;
}

.mail-settings__note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border: 1px solid #e7e5e4;
    border-radius: 0.85rem;
    background: #fafaf9;
}

.mail-settings__note-icon {
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 1.35rem;
    place-items: center;
    border-radius: 50%;
    background: #e7e5e4;
    color: #57534e;
    font-size: 0.8rem;
    font-weight: 700;
}

.mail-settings__note p {
    margin: 0;
    color: #57534e;
    font-size: 0.82rem;
    line-height: 1.65;
}

.mail-settings__note strong {
    margin-right: 0.25rem;
    color: #292524;
}

.mail-settings__note code {
    overflow-wrap: anywhere;
    color: #44403c;
    font-size: 0.78rem;
}

.dark .mail-settings__card {
    border-color: rgb(255 255 255 / 10%);
    background: #1c1917;
}

.dark .mail-settings__header h2,
.dark .mail-settings__field,
.dark .mail-settings__status strong,
.dark .mail-settings__note strong {
    color: #fafaf9;
}

.dark .mail-settings__header p,
.dark .mail-settings__field small,
.dark .mail-settings__optional,
.dark .mail-settings__status,
.dark .mail-settings__note p {
    color: #a8a29e;
}

.dark .mail-settings__field input,
.dark .mail-settings__field textarea,
.dark .mail-settings__value {
    border-color: rgb(255 255 255 / 12%);
    background: rgb(255 255 255 / 5%);
    color: #fafaf9;
}

.dark .mail-settings__value,
.dark .mail-settings__note {
    background: rgb(255 255 255 / 4%);
}

.dark .mail-settings__footer {
    border-color: rgb(255 255 255 / 10%);
}

.dark .mail-settings__status-divider {
    background-color: rgb(255 255 255 / 12%);
}

@media (max-width: 48rem) {
    .mail-settings__fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .mail-settings__header,
    .mail-settings__footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .mail-settings__badge {
        order: -1;
    }
}

.mail-compose {
    display: grid;
    width: 100%;
    max-width: 74rem;
    gap: 1.5rem;
}

.mail-compose__sender,
.mail-compose__fields,
.mail-compose__preview {
    min-width: 0;
    border: 1px solid #e7e5e4;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgb(28 25 23 / 4%);
}

.mail-compose__sender {
    display: grid;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
}

.mail-compose__sender-heading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.mail-compose__sender-icon {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    place-items: center;
    border-radius: 0.8rem;
    background: #fff7ed;
    color: #ea580c;
}

.mail-compose__sender-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.mail-compose__sender-heading h2,
.mail-compose__preview h2 {
    margin: 0;
    color: #1c1917;
    font-size: 1.05rem;
    font-weight: 700;
}

.mail-compose__sender-heading p {
    margin: 0.2rem 0 0;
    color: #78716c;
    font-size: 0.82rem;
    line-height: 1.5;
}

.mail-compose__sender-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) minmax(15rem, 1.2fr);
    gap: 0.75rem;
    margin: 0;
}

.mail-compose__sender-details > div {
    min-width: 0;
    padding: 0.75rem 0.9rem;
    border: 1px solid #f5f5f4;
    border-radius: 0.7rem;
    background: #fafaf9;
}

.mail-compose__sender-details dt {
    margin-bottom: 0.25rem;
    color: #78716c;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mail-compose__sender-details dd {
    margin: 0;
    color: #292524;
    font-size: 0.84rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.mail-compose__sender-details .mail-compose__footer-status {
    border-color: #fed7aa;
    background: #fff7ed;
}

.mail-compose__sender-details .mail-compose__footer-status--ready {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.mail-compose__form {
    display: grid;
    gap: 1.25rem;
}

.mail-compose__fields {
    padding: clamp(1rem, 2.5vw, 1.75rem);
}

.mail-compose__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mail-compose__preview {
    display: grid;
    gap: 1rem;
    padding: clamp(1.1rem, 2.5vw, 1.75rem);
}

.mail-compose__preview-subject {
    margin: 0;
    color: #57534e;
    font-size: 0.9rem;
}

.mail-compose__preview-body {
    min-width: 0;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid #e7e5e4;
    border-radius: 0.8rem;
    background: #fafaf9;
    overflow-wrap: anywhere;
}

.mail-compose__preview-body hr {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid #e7e5e4;
}

.mail-compose__preview-footer {
    margin: 0.5rem 0 0;
    color: #78716c;
    font-size: 0.82rem;
    line-height: 1.6;
}

.dark .mail-compose__sender,
.dark .mail-compose__fields,
.dark .mail-compose__preview {
    border-color: rgb(255 255 255 / 10%);
    background: #1c1917;
}

.dark .mail-compose__sender-heading h2,
.dark .mail-compose__preview h2,
.dark .mail-compose__sender-details dd {
    color: #fafaf9;
}

.dark .mail-compose__sender-heading p,
.dark .mail-compose__sender-details dt,
.dark .mail-compose__preview-subject,
.dark .mail-compose__preview-footer {
    color: #a8a29e;
}

.dark .mail-compose__sender-details > div,
.dark .mail-compose__preview-body {
    border-color: rgb(255 255 255 / 8%);
    background: rgb(255 255 255 / 4%);
}

@media (max-width: 64rem) {
    .mail-compose__sender-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mail-compose__sender-details > div:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 40rem) {
    .mail-compose__sender-details {
        grid-template-columns: minmax(0, 1fr);
    }

    .mail-compose__sender-details > div:last-child {
        grid-column: auto;
    }

    .mail-compose__actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .mail-compose__actions > * {
        width: 100%;
    }
}

.mail-reports {
    display: grid;
    width: 100%;
    max-width: 74rem;
    gap: 1.25rem;
}

.mail-reports > *,
.mail-reports .fi-section,
.mail-reports .fi-section-content-ctn,
.mail-reports .fi-section-content,
.mail-reports .fi-sc,
.mail-reports .fi-fo-component-ctn,
.mail-reports .fi-fo-field-wrp {
    min-width: 0;
    max-width: 100%;
}

.mail-reports > *,
.mail-reports .fi-section,
.mail-reports .fi-section-content-ctn,
.mail-reports .fi-section-content,
.mail-reports .fi-sc {
    width: 100% !important;
}

.mail-reports .fi-select-input,
.mail-reports .fi-select-input-ctn,
.mail-reports .fi-select-input-btn,
.mail-reports .fi-input-wrp {
    width: 100%;
    min-width: 0;
}

.mail-reports .fi-select-input-btn {
    white-space: nowrap;
}

.mail-reports .fi-section-header-description {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.65;
}

.mail-reports .fi-section-header,
.mail-reports .fi-section-header-heading,
.mail-reports .fi-section-header-description {
    min-width: 0;
}

.mail-reports .fi-section-content-ctn {
    overflow-wrap: anywhere;
}

@media (max-width: 48rem) {
    .mail-reports .fi-section-content,
    .mail-reports .fi-sc {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 1100px) {
    .mail-dashboard__hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .mail-dashboard__provider {
        max-width: 32rem;
    }
}

@media (max-width: 800px) {
    .mail-dashboard__steps,
    .mail-dashboard__cards {
        grid-template-columns: minmax(0, 1fr);
    }
}
