:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ink: #14213a;
    --muted: #55657f;
    --muted-strong: #3f506b;
    --canvas: #f5f7fb;
    --surface: #ffffff;
    --line: #dce4ef;
    --line-strong: #c8d4e3;
    --nav: #0d1528;
    --nav-muted: #d1dbef;
    --nav-active: #26385e;
    --primary: #2857c7;
    --primary-dark: #1f459f;
    --primary-soft: #eaf0ff;
    --success: #0b6b43;
    --success-soft: #e4f6ed;
    --warning: #8a5200;
    --warning-soft: #fff3d6;
    --danger: #a73545;
    --danger-soft: #ffebee;
    --shadow: 0 10px 30px rgba(26, 46, 84, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.mailer-shell { min-height: 100vh; display: flex; }
.mailer-nav { width: 264px; min-height: 100vh; display: flex; flex-direction: column; flex: 0 0 264px; padding: 26px 16px 18px; background: var(--nav); color: #fff; }
.mailer-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; margin: 0 0 40px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(145deg, #3f63c8, #2448a6); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .04em; box-shadow: 0 7px 18px rgba(58, 99, 216, .3); }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { color: #fff; font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.brand-copy strong span { color: #b8c8ff; }
.brand-copy small { color: #b6c2d8; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.nav-section-label { padding: 0 12px 9px; color: #aab9d3; font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.nav-section-label-spaced { margin-top: 26px; }
.mailer-nav-links { display: grid; gap: 4px; }
.mailer-nav-link { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; color: var(--nav-muted); text-decoration: none; transition: background .16s ease, color .16s ease, transform .16s ease; }
.mailer-nav-link:hover { background: rgba(89, 116, 180, .16); color: #fff; }
.mailer-nav-link.active { background: var(--nav-active); color: #fff; box-shadow: inset 3px 0 0 #7e9bff; }
.nav-icon { display: grid; place-items: center; width: 20px; color: #91a2c7; font-size: 17px; line-height: 1; }
.mailer-nav-link.active .nav-icon, .mailer-nav-link:hover .nav-icon { color: #b8c8ff; }
.mailer-nav-spacer { flex: 1; min-height: 28px; }
.nav-status-card { display: flex; align-items: center; gap: 10px; margin: 0 2px 14px; padding: 12px; border: 1px solid rgba(145, 166, 215, .13); border-radius: 12px; background: rgba(255, 255, 255, .045); }
.nav-status-card strong, .nav-status-card small, .user-copy strong, .user-copy small { display: block; }
.nav-status-card strong { color: #dce5fb; font-size: 12px; font-weight: 650; }
.nav-status-card small { margin-top: 1px; color: #b3bfd6; font-size: 10px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 99px; background: #42c79a; box-shadow: 0 0 0 4px rgba(66, 199, 154, .12); }
.mailer-user-card { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: #e0e8ff; color: #3655ad; font-size: 12px; font-weight: 800; }
.user-copy { min-width: 0; flex: 1; }
.user-copy strong { overflow: hidden; color: #e3e9f7; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { color: #b3bfd6; font-size: 10px; }
.user-logout { color: #b3bfd6; font-size: 20px; text-decoration: none; }
.user-logout:hover { color: #fff; }

.mailer-main { min-width: 0; flex: 1; }
.mailer-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 0 42px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .72); }
.topbar-context, .topbar-meta { display: flex; align-items: center; gap: 10px; }
.topbar-kicker { color: var(--muted-strong); font-size: 12px; font-weight: 650; }
.topbar-divider { color: #7f8da3; }
.topbar-current { color: var(--muted-strong); font-size: 12px; font-weight: 600; }
.topbar-meta { color: var(--muted-strong); font-size: 11px; }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font-weight: 650; }
.live-indicator span { width: 6px; height: 6px; border-radius: 50%; background: #2bb889; }
.topbar-date { padding-left: 14px; border-left: 1px solid var(--line-strong); }
.mailer-content { width: min(1480px, 100%); margin: 0 auto; padding: 42px; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-header h1 { margin: 4px 0 7px; color: var(--ink); font-size: 30px; font-weight: 760; letter-spacing: -.045em; line-height: 1.15; }
.page-header p { max-width: 700px; margin: 0; color: var(--muted); font-size: 13px; }
.page-header p strong { color: var(--muted-strong); font-weight: 750; }
.eyebrow { color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.page-header-actions { display: flex; align-items: center; gap: 10px; padding-top: 10px; }
.secure-chip, .count-chip, .provider-badge, .status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.secure-chip { padding: 8px 11px; color: #214caa; background: var(--primary-soft); }
.secure-chip::before { content: ""; width: 7px; height: 7px; border: 1.5px solid currentColor; border-radius: 3px; }
.count-chip { padding: 6px 9px; color: var(--muted-strong); background: #f1f4f8; }

.surface, .table-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.settings-form-card { margin-bottom: 20px; padding: 26px 28px 24px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading h2 { margin: 0 0 4px; color: var(--ink); font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.section-heading-icon { display: flex; align-items: flex-start; gap: 12px; }
.section-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); font-size: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px 16px; }
.form-field { grid-column: span 4; min-width: 0; }
.form-field.span-2 { grid-column: span 2; }
.form-field.span-3 { grid-column: span 3; }
.form-field.span-5 { grid-column: span 5; }
.form-field.span-6 { grid-column: span 6; }
.form-field.span-12 { grid-column: span 12; }
.form-field label { display: block; margin-bottom: 7px; color: var(--muted-strong); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.label-optional { color: #52617b; font-size: 10px; font-weight: 600; }
.form-help { display: block; margin-top: 6px; color: #52617b; font-size: 11px; }
.inline-note { display: block; padding: 10px 12px; border: 1px solid #d9e3f0; border-radius: 9px; color: #52617b; background: #f8faff; font-size: 11px; line-height: 1.45; }
.inline-note strong { color: var(--primary); font-weight: 750; }
.provider-help-panel { display: grid; gap: 10px; margin: 22px 0 20px; padding: 15px 17px; border: 1px solid #d7e2f4; border-radius: 12px; color: #52617b; background: #f7faff; font-size: 11px; line-height: 1.5; }
.provider-help-panel > div { display: grid; gap: 3px; }
.provider-help-panel strong { color: var(--ink); font-size: 13px; }
.provider-help-panel a { width: fit-content; color: #214caa; font-weight: 750; text-decoration: none; }
.provider-help-panel a:hover { text-decoration: underline; }
.provider-help-panel ol { display: grid; gap: 4px; margin: 0; padding-left: 20px; }
.provider-help-panel li b { color: #33445f; }
.cloudflare-help-panel { border-color: #f1c6b5; background: #fff8f5; }
.cloudflare-help-panel strong { color: #8b3b1f; }
.backblaze-help-panel { border-color: #cbdcf1; background: #f6faff; }
.storage-common-section { display: grid; gap: 18px; margin-top: 24px; padding: 19px 0 2px; border-top: 1px solid #edf0f5; }
.storage-common-section h3 { margin: 0 0 3px; color: var(--ink); font-size: 13px; }
.storage-common-section p { margin: 0; color: var(--muted); font-size: 11px; }
.storage-policy-card { display: grid; gap: 16px; margin-top: 24px; padding: 16px 17px; border: 1px solid #ead7ad; border-radius: 12px; background: #fffaf0; }
.storage-policy-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.storage-policy-heading > div { display: grid; gap: 4px; }
.storage-policy-heading strong { color: #765215; font-size: 13px; }
.storage-policy-heading span:not(.status-pill) { color: #775524; font-size: 11px; line-height: 1.5; }
.storage-policy-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.storage-policy-grid > div { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 39px; padding: 8px 10px; border: 1px solid #f0dfba; border-radius: 8px; background: #fff; color: #775524; font-size: 10px; }
.storage-policy-grid b { width: 100%; color: #765215; font-size: 10px; }
.storage-policy-grid code, .storage-policy-details code { padding: 2px 5px; border-radius: 4px; color: #765215; background: #fff2cd; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.storage-policy-details { color: #775524; font-size: 11px; }
.storage-policy-details summary { cursor: pointer; color: #765215; font-weight: 750; }
.storage-policy-details pre { overflow: auto; margin: 10px 0 0; padding: 11px 12px; border: 1px solid #f0dfba; border-radius: 8px; color: #4f3d1c; background: #fff; font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.storage-policy-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; color: #775524; font-size: 11px; }
.storage-policy-links a { color: #765215; font-weight: 750; text-decoration: none; }
.storage-policy-links a:hover { text-decoration: underline; }
.input-with-suffix { display: flex; align-items: stretch; }
.input-with-suffix .form-control { min-width: 0; border-radius: 9px 0 0 9px; }
.input-with-suffix .form-select { min-width: 0; border-left: 0; border-radius: 0 9px 9px 0; background-color: #f4f7fb; }
.input-with-suffix span { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 9px 9px 0; color: #52617b; background: #f4f7fb; font-size: 11px; white-space: nowrap; }
.readonly-field-input { color: #52617b !important; background: #f4f7fb !important; font-size: 12px !important; }
.form-control, .form-select, input.form-control, select.form-select, textarea.form-control { display: block; width: 100%; min-height: 40px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 9px; outline: none; background: #fbfcfe; color: var(--ink); font-size: 13px; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.form-control:focus, .form-select:focus { border-color: #4f75d3; background: #fff; box-shadow: 0 0 0 3px rgba(40, 87, 199, .16); }
.form-control::placeholder { color: #5b6a82; opacity: 1; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 25px; padding-top: 20px; border-top: 1px solid #edf0f5; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 15px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 700; line-height: 1; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 5px 12px rgba(59, 99, 216, .2); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline-primary { color: #214caa; border-color: #b9c9f2; background: #f8faff; }
.btn-outline-primary:hover { color: #fff; border-color: var(--primary); background: var(--primary); }
.btn-outline-secondary { color: #465772; border-color: var(--line-strong); background: #fff; }
.btn-outline-secondary:hover { color: var(--ink); border-color: #aeb9ca; background: #f7f9fc; }
.btn-outline-warning { color: #7f4b00; border-color: #e6c77e; background: #fffaf0; }
.btn-outline-warning:hover { color: #fff; border-color: #7f4b00; background: #7f4b00; }
.btn-outline-danger { color: var(--danger); border-color: #f0c5cc; background: #fff8f9; }
.btn-outline-danger:hover { color: #fff; border-color: var(--danger); background: var(--danger); }
.btn-sm { min-height: 31px; padding: 6px 10px; border-radius: 7px; font-size: 11px; }
.alert { margin-top: 18px; padding: 11px 13px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; }
.alert-info { color: #244c87; border-color: #c9d8fb; background: #f1f5ff; }
.alert-warning { color: #704300; border-color: #e8c879; background: var(--warning-soft); }
.alert-danger { color: #8f2f3c; border-color: #efc2ca; background: var(--danger-soft); }

.table-card { overflow: hidden; padding: 0; }
.table-card > .section-heading { padding: 24px 28px 0; }
.table-scroll { overflow-x: auto; }
.table, table { width: 100%; border-collapse: collapse; }
.modern-table th, .modern-table td { padding: 15px 18px; border-bottom: 1px solid #edf0f5; text-align: left; vertical-align: middle; }
.modern-table th { color: #52617b; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.modern-table td { color: var(--muted-strong); font-size: 12px; }
.modern-table tbody tr:last-child td { border-bottom: 0; }
.modern-table tbody tr:hover { background: #fbfcff; }
.setting-primary { display: flex; align-items: center; gap: 11px; min-width: 185px; }
.setting-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #3f63c8, #2448a6); font-size: 11px; font-weight: 800; }
.setting-primary strong, .setting-primary small, .setting-name-button { display: block; }
.setting-name-button { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 12px; font-weight: 750; text-align: left; cursor: pointer; }
.setting-name-button:hover { color: var(--primary); text-decoration: underline; }
.setting-primary strong { color: var(--ink); font-size: 12px; font-weight: 750; }
.setting-primary small { margin-top: 2px; color: #52617b; font-size: 10px; }
.provider-badge { padding: 5px 8px; color: #214c92; background: var(--primary-soft); }
.status-pill { padding: 5px 8px; }
.status-pill.success { color: var(--success); background: var(--success-soft); }
.status-pill.warning { color: var(--warning); background: var(--warning-soft); }
.status-pill.danger { color: var(--danger); background: var(--danger-soft); }
.status-pill.neutral { color: #465772; background: #edf1f6; }
.table-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.table-empty { padding: 42px 20px; color: var(--muted); text-align: center; }
.table-primary-text { color: var(--ink); font-size: 12px; font-weight: 750; }
.usage-number { color: var(--primary); font-size: 14px; font-weight: 800; }
.code-badge { display: inline-flex; align-items: center; padding: 5px 8px; border: 1px solid #d4deeb; border-radius: 7px; color: #4d5e77; background: #f8f9fc; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 48px 24px 52px; color: var(--muted); text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 7px; border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-size: 18px; }
.empty-state strong { color: var(--ink); font-size: 14px; }
.empty-state span:last-child { font-size: 12px; }
.allocation-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 20px; padding: 18px 22px; }
.tool-field label { display: block; margin-bottom: 7px; color: var(--muted-strong); font-size: 11px; font-weight: 700; }
.tool-field small { display: block; margin-top: 6px; color: #52617b; font-size: 11px; }
.generated-key-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 18px 20px; border: 1px solid #f0d59b; border-radius: 14px; background: #fffaf0; }
.generated-key-card > div { display: grid; gap: 2px; }
.generated-key-card strong { color: #765215; font-size: 14px; }
.generated-key-card small { color: #775524; font-size: 11px; }
.generated-key-card code { max-width: 58%; overflow: auto; padding: 9px 11px; border: 1px solid #edd8a9; border-radius: 8px; color: #765215; background: #fff; font-size: 11px; }
.template-body { min-height: 120px !important; resize: vertical; }
.file-input { min-height: 42px; padding: 8px 10px; }
.form-help-error { color: var(--danger); font-weight: 650; }
.checkbox-field { display: flex !important; align-items: center; gap: 8px; min-height: 40px; margin-bottom: 3px !important; color: var(--ink) !important; font-size: 12px !important; }
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--primary); }
.readonly-field { display: flex; align-items: center; min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted-strong); background: #f4f7fb; font-size: 13px; }
.permission-badge { color: #166534 !important; font-weight: 750; }
.muted-text { color: var(--muted) !important; }
.count-chip-inline { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 3px; padding: 0 5px; border-radius: 999px; color: #214caa; background: #dfe8ff; font-size: 10px; }
.company-logo-thumb { display: block; width: 34px; height: 34px; flex: 0 0 34px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.template-preview-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .7fr); gap: 20px; align-items: start; }
.template-preview-stage { overflow: hidden; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.preview-toolbar strong { display: block; margin-top: 5px; color: var(--ink); font-size: 14px; }
.preview-device-chips { display: flex; align-items: center; gap: 6px; }
.preview-device-chip { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #f8fafc; font-size: 10px; font-weight: 700; white-space: nowrap; }
.preview-device-chip.active { color: #214caa; border-color: #b9c9f2; background: var(--primary-soft); }
.template-preview-canvas { padding: 26px; background: #e9eef5; }
.template-preview-frame { display: block; width: 100%; min-height: 820px; border: 0; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(26, 46, 84, .12); }
.template-preview-details { padding: 24px 26px; }
.template-parameter-list { display: grid; gap: 8px; margin: 10px 0; padding: 0; list-style: none; }
.template-parameter-list li { display: grid; gap: 2px; }
.template-parameter-list code { color: var(--ink); font-size: 12px; font-weight: 750; }
.template-parameter-list span { color: #52617b; font-size: 11px; line-height: 1.4; }
.preview-detail-list { display: grid; gap: 0; margin: 0 0 22px; }
.preview-detail-list > div { display: grid; gap: 4px; padding: 13px 0; border-bottom: 1px solid #edf0f5; }
.preview-detail-list dt { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.preview-detail-list dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.template-attachment-list { display: grid; gap: 9px; margin-top: 18px; }
.template-attachment-list h3 { margin: 0 0 2px; color: var(--ink); font-size: 13px; }
.template-attachment { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcff; }
.template-attachment-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; color: #214caa; background: var(--primary-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.template-attachment-copy { min-width: 0; flex: 1; }
.template-attachment-copy strong { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.template-attachment-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.template-attachment a { color: #214caa; font-size: 10px; font-weight: 750; text-decoration: none; }
.template-attachment a:hover { text-decoration: underline; }
.table-card > h2 { margin: 0; padding: 24px 28px 0; color: var(--ink); font-size: 16px; font-weight: 750; }

.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { min-height: 112px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.metric-card span { display: block; color: var(--muted-strong); font-size: 11px; font-weight: 750; }
.metric-card strong { display: block; margin-top: 7px; color: var(--ink); font-size: 28px; font-weight: 780; letter-spacing: -.04em; line-height: 1.1; }
.metric-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.loading-state { padding: 24px 28px; color: var(--muted-strong); }
.text-muted { color: var(--muted) !important; }
.mb-4 { margin-bottom: 20px !important; }
.mt-3 { margin-top: 16px !important; }
.me-1 { margin-right: 5px !important; }
.me-2 { margin-right: 8px !important; }
.row { display: flex; flex-wrap: wrap; gap: 14px; }
.row > [class*="col-"] { flex: 1 1 220px; }
.align-self-end { align-self: flex-end; }
.table-sm th, .table-sm td { padding: 12px 14px; }

.mailer-login-shell { width: min(420px, calc(100% - 32px)); margin: 11vh auto; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 18px 50px rgba(31, 48, 83, .1); }
.login-card { display: grid; gap: 0; }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; }
.login-brand strong { display: block; color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.login-brand strong span { color: var(--primary); }
.login-brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.mailer-login-shell h1 { margin: 6px 0 7px; font-size: 25px; letter-spacing: -.04em; }
.login-description { margin: 0 0 26px; color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 17px; }
.login-submit { width: 100%; margin-top: 3px; }
.login-links { margin-top: 14px; font-size: 12px; }
.login-links a { color: var(--primary); font-weight: 700; }
.secret-key { margin: 8px 0 12px; padding: 12px 14px; border-radius: 10px; background: #f4f7fb; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 16px; letter-spacing: .08em; }
.recovery-codes { margin: 8px 0 0; padding-left: 18px; }
.recovery-codes li { margin: 4px 0; }
.company-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 0 4px; }
.mailer-login-shell .form-control { background: #fbfcff; }

*:focus-visible { outline: 3px solid #2857c7; outline-offset: 2px; }

@media (max-width: 1000px) {
    .mailer-nav { width: 224px; flex-basis: 224px; }
    .mailer-content { padding: 32px 24px; }
    .mailer-topbar { padding: 0 24px; }
    .form-field { grid-column: span 6; }
    .form-field.span-2, .form-field.span-3, .form-field.span-5 { grid-column: span 6; }
    .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .mailer-shell { display: block; }
    .mailer-nav { width: 100%; min-height: auto; padding: 15px 16px; }
    .mailer-brand { margin-bottom: 15px; }
    .mailer-nav-links { display: flex; overflow-x: auto; gap: 5px; padding-bottom: 2px; }
    .mailer-nav-link { min-width: max-content; min-height: 36px; padding: 0 10px; }
    .nav-section-label, .nav-status-card, .mailer-user-card, .nav-section-label-spaced, .mailer-nav-spacer { display: none; }
    .mailer-topbar { min-height: 55px; padding: 0 18px; }
    .topbar-date { display: none; }
    .mailer-content { padding: 26px 16px; }
    .page-header { display: block; margin-bottom: 22px; }
    .page-header-actions { padding-top: 15px; }
    .page-header h1 { font-size: 26px; }
    .dashboard-metrics { grid-template-columns: 1fr; }
    .settings-form-card { padding: 20px 18px; }
    .allocation-tools { grid-template-columns: 1fr; padding: 16px 18px; }
    .generated-key-card { display: block; }
    .generated-key-card code { display: block; max-width: 100%; margin-top: 12px; }
    .storage-policy-heading { display: block; }
    .storage-policy-heading > .status-pill { display: inline-flex; margin-top: 10px; }
    .storage-policy-grid { grid-template-columns: 1fr; }
    .form-field, .form-field.span-2, .form-field.span-3, .form-field.span-5, .form-field.span-6 { grid-column: span 12; }
    .section-heading { display: block; }
    .section-heading > .count-chip { display: inline-flex; margin-top: 12px; }
    .table-card > .section-heading { padding: 20px 18px 0; }
    .template-preview-layout { grid-template-columns: 1fr; }
    .preview-toolbar { display: block; padding: 20px 18px; }
    .preview-device-chips { margin-top: 13px; }
    .template-preview-canvas { padding: 14px; }
    .template-preview-frame { min-height: 760px; }
    .template-preview-details { padding: 20px 18px; }
    .portal-panel { max-height: calc(100vh - 32px); }
}

.portal-overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(18, 28, 48, .45); }
.portal-panel { width: min(920px, 100%); max-height: min(720px, calc(100vh - 48px)); overflow: auto; padding: 22px 24px 8px; }
.portal-panel .section-heading { align-items: center; }
.portal-panel .section-heading h2 { margin: 0; color: var(--ink); font-size: 18px; }
.portal-panel .section-heading p { margin: 6px 0 0; }
.portal-panel small { display: block; margin-top: 2px; color: #52617b; }
.portal-error { max-width: 320px; white-space: normal; line-height: 1.45; }
.portal-error.is-failed { color: var(--danger); }
