:root {
    --im-blue: #03b3f8;
    --im-blue-rgb: 3, 179, 248;
}

body.bootstrap-dark {
    --im-bg: #0e1114;
    --im-surface: #151b1f;
    --im-surface-2: #1b2328;
    --im-border: rgba(205, 229, 241, .14);
    --im-text: #f4f8fb;
    --im-muted: #a3b1bb;
    --im-field: #1e282e;
    background: var(--im-bg);
    color: var(--im-text);
}

body.bootstrap {
    --im-bg: #f3f7fa;
    --im-surface: #fff;
    --im-surface-2: #edf5f9;
    --im-border: rgba(32, 69, 87, .17);
    --im-text: #172832;
    --im-muted: #58707c;
    --im-field: #f4f8fa;
    background: var(--im-bg);
    color: var(--im-text);
}

body[class^="bootstrap"] {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-image: radial-gradient(circle at 74% -12%, rgba(var(--im-blue-rgb), .13), transparent 37%);
}

.im-container.container { width: min(100% - 40px, 1380px); max-width: none; padding: 0; }
.im-site-header { padding: 0 0 12px; }
.im-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 88px; }
.im-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--im-text) !important; text-decoration: none !important; }
.im-brand img { width: 46px; height: 46px; filter: drop-shadow(0 6px 16px rgba(var(--im-blue-rgb), .19)); }
.im-brand strong { display: block; font-size: 21px; line-height: 1.1; letter-spacing: -.035em; }
.im-brand strong span { color: var(--im-blue); }
.im-brand small { display: block; color: var(--im-muted); font-size: 11px; margin-top: 5px; letter-spacing: .01em; }
.im-topbar-status, .im-refresh-hint { display: inline-flex; align-items: center; gap: 8px; color: var(--im-muted); font-size: 12px; }
.im-status-dot { display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #4de0a0; box-shadow: 0 0 0 4px rgba(77, 224, 160, .1); }
.im-topbar-status { padding: 8px 12px; border: 1px solid var(--im-border); border-radius: 999px; background: var(--im-surface); }

.im-hero { position: relative; overflow: hidden; padding: clamp(23px, 3vw, 38px); border: 1px solid rgba(var(--im-blue-rgb), .22); border-radius: 24px; background: linear-gradient(116deg, rgba(var(--im-blue-rgb), .13), transparent 52%), var(--im-surface); box-shadow: 0 20px 55px rgba(0, 0, 0, .12); }
.im-hero::after { content: ""; position: absolute; width: 320px; height: 320px; right: -130px; top: -185px; border: 1px solid rgba(var(--im-blue-rgb), .11); border-radius: 50%; pointer-events: none; }
.im-hero-intro { position: relative; z-index: 1; margin-bottom: 27px; }
.im-kicker { display: block; color: var(--im-blue); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.im-hero h1 { margin: 10px 0 10px; color: var(--im-text); font-size: clamp(28px, 3.5vw, 44px); font-weight: 800; letter-spacing: -.045em; line-height: 1.12; }
.im-hero-intro p { max-width: 650px; margin: 0; color: var(--im-muted); font-size: 15px; line-height: 1.6; }
.im-address-label { position: relative; z-index: 1; margin-bottom: 9px; color: var(--im-muted); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
#address-box-normal.row { position: relative; z-index: 1; align-items: center; gap: 12px; margin: 0; }
#address-box-normal .col { min-width: 0; }
#address-box-normal .my-address-block { display: flex; align-items: center; gap: 12px; min-height: 56px; margin: 0; padding: 9px 11px 9px 18px; border: 1px solid var(--im-border); border-radius: 13px; background: var(--im-field); text-align: left; }
#my-address { display: block; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--im-text); font-size: 16px; font-weight: 700; }
#address-box-normal .get-new-address-col { display: flex; flex: 0 0 auto; gap: 9px; padding: 0; }
#address-box-normal .copy-button { flex: 0 0 auto; min-height: 36px; padding: 6px 11px; border: 1px solid rgba(var(--im-blue-rgb), .3); border-radius: 9px; background: rgba(var(--im-blue-rgb), .12); color: var(--im-blue) !important; font-size: 13px !important; font-weight: 700; }
#address-box-normal .copy-button:hover { background: rgba(var(--im-blue-rgb), .21); }

body[class^="bootstrap"] .btn { border-radius: 10px; transition: background .2s, border-color .2s, transform .2s; }
body[class^="bootstrap"] .btn:hover { transform: translateY(-1px); }
body[class^="bootstrap"] .btn-primary { border-color: #168dc0; background: linear-gradient(180deg, #147fb0, #095679); color: #fff; }
body[class^="bootstrap"] .btn-primary:hover { border-color: var(--im-blue); background: #087cae; }
body[class^="bootstrap"] .btn-outline-dark,
body[class^="bootstrap"] .btn-dark,
body[class^="bootstrap"] .btn-white,
body[class^="bootstrap"] .btn-outline-primary { border-color: var(--im-border); background: var(--im-surface-2); color: var(--im-text); }
body[class^="bootstrap"] .btn-outline-dark:hover,
body[class^="bootstrap"] .btn-dark:hover,
body[class^="bootstrap"] .btn-white:hover,
body[class^="bootstrap"] .btn-outline-primary:hover { border-color: rgba(var(--im-blue-rgb), .48); background: rgba(var(--im-blue-rgb), .12); color: var(--im-text); }
#address-box-edit, #settings-box-edit { margin: 14px 0 0; }
#address-box-edit .card, #settings-box-edit .card { border: 1px solid var(--im-border); border-radius: 15px; background: var(--im-surface-2); color: var(--im-text); }
#address-box-edit .form-control, #address-box-edit .custom-select, #address-box-edit .input-group-text, #settings-box-edit .form-control { border-color: var(--im-border); background: var(--im-field); color: var(--im-text); }

.im-main { padding: 16px 0 46px; }
.im-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 0 0 16px; }
.im-section-heading h2 { margin: 7px 0 0; color: var(--im-text); font-size: 24px; font-weight: 800; letter-spacing: -.035em; }
.im-message-count { display: inline-grid; place-items: center; min-width: 25px; height: 25px; padding: 0 6px; border: 1px solid rgba(var(--im-blue-rgb), .26); border-radius: 8px; background: rgba(var(--im-blue-rgb), .1); color: var(--im-blue); font-size: 12px; vertical-align: middle; }
.im-mailbox-layout { display: grid; grid-template-columns: minmax(290px, .37fr) minmax(0, .63fr); min-height: 500px; overflow: hidden; border: 1px solid var(--im-border); border-radius: 20px; background: var(--im-surface); }
.im-list-pane { min-width: 0; border-right: 1px solid var(--im-border); }
.im-pane-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 59px; padding: 16px 19px; border-bottom: 1px solid var(--im-border); color: var(--im-text); font-size: 14px; font-weight: 750; }
.im-pane-heading small { color: var(--im-muted); font-size: 12px; font-weight: 500; }
#email-list { border-radius: 0; }
#email-list .email-list-item { padding: 15px 17px; border: 0; border-bottom: 1px solid var(--im-border); background: transparent; color: var(--im-text); transition: background .2s; }
#email-list .email-list-item:hover, #email-list .email-list-item.im-selected { background: rgba(var(--im-blue-rgb), .09); color: var(--im-text); }
#email-list .email-list-item.im-selected { box-shadow: inset 3px 0 var(--im-blue); }
#email-list .media { align-items: center; }
#email-list .open-collapse-button { display: grid; flex: 0 0 35px; place-items: center; width: 35px; height: 35px; margin-right: 8px; padding: 0; border: 1px solid rgba(var(--im-blue-rgb), .22); border-radius: 11px; background: rgba(var(--im-blue-rgb), .09); color: var(--im-blue); }
#email-list .open-collapse-button i { font-size: 12px; }
#email-list .media-body { min-width: 0; }
#email-list .list-group-item-heading { display: flex; align-items: baseline; gap: 7px; min-width: 0; margin: 0 0 5px; font-size: 13px; font-weight: 750; }
#email-list .list-group-item-heading .text-muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--im-muted) !important; font-size: 11px; font-weight: 400; }
#email-list .list-group-item-heading small { margin-left: auto; white-space: nowrap; color: var(--im-muted); font-size: 10px; font-weight: 400; }
#email-list .list-group-item-text { width: 100% !important; margin: 0; color: var(--im-muted); font-size: 13px; }
.im-reader-pane { min-width: 0; background: linear-gradient(135deg, rgba(var(--im-blue-rgb), .025), transparent 52%); }
.im-reader-placeholder { display: flex; min-height: 500px; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; }
.im-reader-placeholder[hidden] { display: none; }
.im-reader-placeholder-icon { display: grid; place-items: center; width: 66px; height: 66px; margin-bottom: 16px; border: 1px solid rgba(var(--im-blue-rgb), .24); border-radius: 19px; background: rgba(var(--im-blue-rgb), .1); color: var(--im-blue); font-size: 27px; }
.im-reader-placeholder h3 { margin: 0 0 6px; color: var(--im-text); font-size: 18px; font-weight: 750; }
.im-reader-placeholder p { max-width: 250px; margin: 0; color: var(--im-muted); font-size: 13px; line-height: 1.55; }
.im-reader-pane .card-collapse { border: 0; background: transparent; color: var(--im-text); }
.im-reader-pane .card-body { padding: 21px; }
.im-reader-pane .email-body { min-height: 300px; overflow-wrap: anywhere; color: var(--im-text); }
.im-reader-pane .email-body a { color: var(--im-blue); }
.im-reader-pane .float-mail-actions { display: flex; float: none; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.im-reader-pane .float-mail-actions::after { display: none; }
#empty-mailbox { padding: 35px 18px; color: var(--im-muted); text-align: center; }
.spinner > div { background: var(--im-blue); }

body[class^="bootstrap"] .modal-content { border: 1px solid var(--im-border); border-radius: 18px; background: var(--im-surface); color: var(--im-text); }
body[class^="bootstrap"] .modal-header, body[class^="bootstrap"] .modal-footer { border-color: var(--im-border); }
body[class^="bootstrap"] .modal .form-control { border-color: var(--im-border); background: var(--im-field); color: var(--im-text); }
body[class^="bootstrap"] .modal .close { color: var(--im-text); text-shadow: none; }
.alert-fixed { border: 1px solid rgba(var(--im-blue-rgb), .35); background: #12364a !important; color: #e9f9ff !important; }

.im-footer { padding: 24px 0 28px; border-top: 1px solid var(--im-border); background: var(--im-surface) !important; color: var(--im-muted); }
.im-footer .quick-summary { display: block; max-width: 750px; line-height: 1.55; }
.im-footer .quick-summary a { color: var(--im-blue) !important; }
.im-footer #about { margin-top: 12px; border: 1px solid var(--im-border); border-radius: 12px; background: var(--im-surface-2); color: var(--im-text); }
.im-footer-brand { display: flex; align-items: center; gap: 7px; margin: 18px 0 0; color: var(--im-text); font-weight: 700; }
.im-footer-brand small { color: var(--im-muted); font-weight: 400; }

@media (max-width: 800px) {
    .im-container.container { width: min(100% - 24px, 1380px); }
    .im-topbar { min-height: 74px; }
    .im-topbar-status { display: none; }
    #address-box-normal.row { display: flex !important; flex-direction: column; align-items: stretch; }
    #address-box-normal .my-address-block { width: 100%; }
    #address-box-normal .get-new-address-col { justify-content: stretch; width: 100%; }
    #address-box-normal .get-new-address-col .btn { flex: 1; }
    .im-mailbox-layout { grid-template-columns: 1fr; }
    .im-list-pane { border-right: 0; border-bottom: 1px solid var(--im-border); }
    .im-reader-placeholder { min-height: 250px; }
    .im-reader-pane .email-body { min-height: 220px; }
}

@media (max-width: 520px) {
    .im-brand strong { font-size: 18px; }
    .im-brand small { font-size: 10px; }
    .im-hero { padding: 22px 18px; border-radius: 18px; }
    .im-hero-intro p { font-size: 14px; }
    #my-address { font-size: 13px; }
    #address-box-normal .copy-button { font-size: 12px !important; }
    #address-box-normal .get-new-address-col { flex-wrap: wrap; }
    .im-refresh-hint { display: none; }
    #email-list .list-group-item-heading { flex-wrap: wrap; }
    #email-list .list-group-item-heading small { width: 100%; margin-left: 0; }
}
