:root {
    --msp-ink: #1f2430;
    --msp-muted: #697080;
    --msp-paper: #f5f2ec;
    --msp-panel: #ffffff;
    --msp-line: #e6e0d6;
    --msp-accent: #d04458;
    --msp-accent-dark: #a92e42;
    --msp-green: #25845f;
    --msp-sidebar: #20232c;
}

.msp-app,
.msp-app * {
    box-sizing: border-box;
}

.msp-app {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 760px;
    overflow: hidden;
    color: var(--msp-ink);
    background: var(--msp-paper);
    border: 1px solid var(--msp-line);
    border-radius: 20px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.msp-sidebar {
    display: flex;
    flex-direction: column;
    padding: 26px 18px 18px;
    color: #fff;
    background: var(--msp-sidebar);
}

.msp-brand,
.msp-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.msp-brand {
    padding: 0 8px 24px;
}

.msp-brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #fff;
    background: var(--msp-accent);
    border-radius: 14px;
    font-weight: 800;
    letter-spacing: -.04em;
}

.msp-brand strong,
.msp-brand small,
.msp-user-card strong,
.msp-user-card small {
    display: block;
}

.msp-brand small,
.msp-user-card small {
    margin-top: 2px;
    color: #aeb4c1;
    font-size: 12px;
}

.msp-navigation {
    display: grid;
    gap: 5px;
}

.msp-nav-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    color: #cbd0da;
    background: transparent;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.msp-nav-item:hover,
.msp-nav-item:focus-visible,
.msp-nav-item.is-active {
    color: #fff;
    background: rgba(255, 255, 255, .09);
}

.msp-nav-icon {
    display: inline-grid;
    width: 24px;
    place-items: center;
    color: #f293a1;
    font-weight: 700;
}

.msp-nav-icon img {
    display: block;
    width: 27px;
    height: 27px;
    max-width: none;
    object-fit: contain;
}

.msp-user-card {
    margin-top: auto;
    padding: 16px 8px 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.msp-avatar {
    border-radius: 50%;
}

.msp-main {
    min-width: 0;
}

.msp-topbar {
    display: flex;
    min-height: 105px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 34px;
    background: rgba(255, 255, 255, .72);
    border-bottom: 1px solid var(--msp-line);
}

.msp-topbar h1,
.msp-content h2 {
    margin: 0;
    color: var(--msp-ink);
    line-height: 1.1;
}

.msp-topbar h1 {
    font-size: clamp(26px, 3vw, 36px);
}

.msp-eyebrow {
    margin: 0 0 7px;
    color: var(--msp-accent-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.msp-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    color: var(--msp-muted);
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.msp-status::before {
    width: 7px;
    height: 7px;
    content: "";
    background: #d3a83b;
    border-radius: 50%;
}

.msp-status.is-connected::before {
    background: var(--msp-green);
}

.msp-status.has-error::before {
    background: var(--msp-accent);
}

.msp-content {
    padding: 34px;
}

.msp-welcome-card,
.msp-module-placeholder {
    padding: clamp(26px, 5vw, 48px);
    background: linear-gradient(135deg, #fff 0%, #fff8f4 100%);
    border: 1px solid var(--msp-line);
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(46, 38, 30, .06);
}

.msp-welcome-card h2,
.msp-module-placeholder h2 {
    font-size: clamp(26px, 3vw, 38px);
}

.msp-welcome-card > p:last-child,
.msp-module-placeholder > p:last-child {
    max-width: 760px;
    margin: 16px 0 0;
    color: var(--msp-muted);
    font-size: 16px;
    line-height: 1.7;
}

.msp-section-header,
.msp-section-actions,
.msp-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.msp-section-header {
    margin-bottom: 22px;
}

.msp-section-header h2,
.msp-subheading {
    margin: 0;
}

.msp-section-header h2 {
    font-size: clamp(24px, 3vw, 34px);
}

.msp-button {
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
}

.msp-button:disabled {
    cursor: wait;
    opacity: .6;
}

.msp-button-primary {
    color: #fff;
    background: var(--msp-accent);
}

.msp-button-primary:hover,
.msp-button-primary:focus-visible {
    background: var(--msp-accent-dark);
}

.msp-button-secondary {
    color: var(--msp-ink);
    background: #fff;
    border: 1px solid var(--msp-line);
}

.msp-select,
.msp-field input,
.msp-field textarea {
    width: 100%;
    color: var(--msp-ink);
    background: #fff;
    border: 1px solid #d8d2c8;
    border-radius: 9px;
    font: inherit;
}

.msp-select {
    width: auto;
    min-width: 160px;
    padding: 10px 34px 10px 12px;
}

.msp-table-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid rgba(31, 36, 48, .08);
    border-radius: 14px;
    box-shadow: 0 10px 32px rgba(31, 36, 48, .055);
}

.msp-database-description {
    max-width: 940px;
    margin: 0 0 18px;
    color: var(--msp-muted);
    line-height: 1.6;
}

.msp-app .msp-table {
    width: 100%;
    min-width: 620px;
    margin: 0;
    border: 0 !important;
    border-collapse: collapse;
    border-spacing: 0;
    background: #fff;
    font-size: 14px;
}

.msp-app .msp-table th,
.msp-app .msp-table td {
    max-width: 360px;
    padding: 12px 16px;
    overflow: hidden;
    border: 0 !important;
    border-bottom: 1px solid #eeeae4 !important;
    text-align: left;
    vertical-align: middle;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msp-app .msp-table th {
    color: var(--msp-muted);
    background: #faf9f7 !important;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.msp-app .msp-table tbody tr {
    color: var(--msp-ink);
    background: #fff !important;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.msp-app .msp-table tbody tr:last-child td {
    border-bottom: 0 !important;
}

.msp-app .msp-table th.msp-table-row-actions,
.msp-app .msp-table td.msp-table-row-actions {
    width: 48px;
    padding-right: 6px;
    padding-left: 6px;
    overflow: visible;
    text-align: center;
}

.msp-icon-button {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--msp-muted);
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}

.msp-icon-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.msp-icon-button-danger:hover,
.msp-icon-button-danger:focus-visible {
    color: #9f2940;
    background: #fff0f2;
    outline: 0;
}

.msp-table td strong,
.msp-table td small {
    display: block;
}

.msp-table td small {
    margin-top: 3px;
    color: var(--msp-muted);
}

.msp-clickable-row {
    cursor: pointer;
}

.msp-app .msp-table .msp-clickable-row:hover,
.msp-app .msp-table .msp-clickable-row:focus-visible {
    background: #fff7f5 !important;
    box-shadow: inset 3px 0 0 var(--msp-accent);
    outline: none;
}

.msp-app .msp-table .msp-clickable-row:hover td,
.msp-app .msp-table .msp-clickable-row:focus-visible td {
    background: transparent !important;
}

.msp-table-disclosure {
    width: 42px;
    max-width: 42px !important;
    padding-right: 14px !important;
    color: #a4a8b1;
    font-size: 22px;
    font-weight: 500;
    text-align: right !important;
}

.msp-clickable-row:hover .msp-table-disclosure,
.msp-clickable-row:focus-visible .msp-table-disclosure {
    color: var(--msp-accent);
}

.msp-acquisition-table-controls {
    margin: 0 0 14px;
}

.msp-research-search {
    min-width: min(300px, 42vw);
}

.msp-research-inbox-holder .msp-table-wrap {
    margin-top: 0;
}

.msp-acquisition-status {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    padding: 5px 9px;
    overflow: hidden;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msp-acquisition-status-incomplete {
    color: #8a3e49;
    background: #fbe8eb;
}

.msp-acquisition-status-ready {
    color: #405f8f;
    background: #eaf1fb;
}

.msp-acquisition-status-sent {
    color: #287054;
    background: #e5f5ed;
}

.msp-acquisition-status-follow_up_due {
    color: #846020;
    background: #fbf1d9;
}

.msp-acquisition-status-exchange {
    color: #644f8a;
    background: #f0ebf8;
}

.msp-acquisition-status-response {
    color: #176345;
    background: #dcf6e9;
}

.msp-acquisition-status-negative {
    color: #8a3e49;
    background: #f8dde2;
}

.msp-acquisition-status-completed {
    color: #54645c;
    background: #eaf0ed;
}

.msp-app .msp-table tbody tr.msp-acquisition-row-incomplete {
    background: #fff8f8 !important;
}

.msp-app .msp-table tbody tr.msp-acquisition-row-ready {
    background: #f8faff !important;
}

.msp-app .msp-table tbody tr.msp-acquisition-row-sent {
    background: #f6fcf9 !important;
}

.msp-app .msp-table tbody tr.msp-acquisition-row-follow_up_due {
    background: #fffaf0 !important;
}

.msp-app .msp-table tbody tr.msp-acquisition-row-exchange {
    background: #fbf9fe !important;
}

.msp-app .msp-table tbody tr.msp-acquisition-row-response {
    background: #f1fbf6 !important;
}

.msp-app .msp-table tbody tr.msp-acquisition-row-negative {
    background: #fff5f6 !important;
}

.msp-app .msp-table tbody tr.msp-acquisition-row-completed {
    background: #f8faf9 !important;
}

.msp-pill {
    display: inline-flex;
    padding: 5px 9px;
    color: #824218;
    background: #fff1d8;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.msp-pill-confirmed {
    color: #176345;
    background: #dcf6e9;
}

.msp-pill-cancelled {
    color: #7b3943;
    background: #f8dde2;
}

.msp-calendar-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.msp-calendar-status-open {
    color: #80551b;
    background: #fff0cf;
}

.msp-calendar-status-confirmed {
    color: #176345;
    background: #dcf6e9;
}

.msp-calendar-status-completed {
    color: #53615d;
    background: #e9efed;
}

.msp-app .msp-table tbody tr.msp-calendar-row-open {
    background: #fffbf2 !important;
}

.msp-app .msp-table tbody tr.msp-calendar-row-confirmed {
    background: #f3fbf7 !important;
}

.msp-app .msp-table tbody tr.msp-calendar-row-completed {
    background: #f7f9f8 !important;
}

.msp-empty-state,
.msp-loading,
.msp-alert {
    padding: 26px;
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 16px;
}

.msp-empty-state h3,
.msp-empty-state p {
    margin: 0;
}

.msp-empty-state p {
    margin-top: 8px;
    color: var(--msp-muted);
}

.msp-alert-error {
    color: #8d2436;
    background: #fff5f6;
    border-color: #efc2ca;
}

.msp-detail-grid,
.msp-note-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.msp-detail-card {
    padding: 18px;
    white-space: pre-wrap;
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 14px;
}

.msp-detail-card > span {
    color: var(--msp-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.msp-detail-card > p {
    margin: 9px 0 0;
    line-height: 1.55;
}

.msp-subheading {
    margin: 34px 0 15px;
    font-size: 20px;
}

.msp-slot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.msp-slot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 10px;
}

.msp-slot-filled {
    color: #176345;
    background: #e8f8ef;
    border-color: #b9e2cb;
}

.msp-slot-filled small {
    color: #28775a;
    font-weight: 750;
}

.msp-slot small,
.msp-muted {
    color: var(--msp-muted);
}

body.msp-dialog-open {
    overflow: hidden;
}

.msp-dialog-backdrop {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: grid;
    overflow-y: auto;
    place-items: start center;
    padding: 36px 18px;
    background: rgba(20, 22, 28, .72);
    backdrop-filter: blur(5px);
}

.msp-dialog-backdrop,
.msp-dialog-backdrop * {
    box-sizing: border-box;
}

.msp-dialog {
    width: min(940px, 100%);
    overflow: hidden;
    color: var(--msp-ink);
    background: var(--msp-paper);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.msp-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    background: #fff;
    border-bottom: 1px solid var(--msp-line);
}

.msp-dialog-header h2 {
    margin: 0;
    color: var(--msp-ink);
    font-family: inherit;
    font-size: clamp(23px, 3vw, 31px);
    line-height: 1.15;
}

.msp-dialog-close {
    position: relative;
    display: inline-flex;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--msp-muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0;
    line-height: 1;
}

.msp-dialog-close::before,
.msp-dialog-close::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 17px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    content: '';
}

.msp-dialog-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.msp-dialog-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.msp-dialog-close:hover {
    color: var(--msp-ink);
    background: var(--msp-paper);
}

.msp-inquiry-form {
    padding: 28px;
}

.msp-inquiry-form fieldset {
    margin: 0 0 24px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 14px;
}

.msp-inquiry-form legend {
    padding: 0 8px;
    font-size: 16px;
    font-weight: 800;
}

.msp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.msp-field {
    display: grid;
    align-content: start;
    gap: 7px;
}

.msp-field > span {
    color: #4f5664;
    font-size: 13px;
    font-weight: 750;
}

.msp-field-wide {
    grid-column: 1 / -1;
}

.msp-field input,
.msp-field textarea {
    padding: 10px 12px;
}

.msp-field textarea {
    min-height: 92px;
    resize: vertical;
}

.msp-field input:focus,
.msp-field textarea:focus,
.msp-select:focus {
    border-color: var(--msp-accent);
    outline: 3px solid rgba(208, 68, 88, .12);
}

.msp-form-footer {
    position: sticky;
    bottom: 0;
    margin: 0 -28px -28px;
    padding: 18px 28px;
    background: rgba(255, 255, 255, .95);
    border-top: 1px solid var(--msp-line);
}

.msp-form-feedback {
    margin: 0;
    color: #8d2436;
    font-weight: 700;
}

.msp-button-danger {
    color: #8d2436;
    background: #fff1f3;
    border: 1px solid #efc2ca;
}

.msp-link-button {
    padding: 0;
    color: var(--msp-accent-dark);
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
    text-align: left;
}

.msp-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
}

.msp-upload-bar {
    display: grid;
    grid-template-columns: 120px 1fr 1fr auto;
    align-items: center;
    gap: 9px;
    margin: 16px 0;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 12px;
}

.msp-upload-bar input {
    width: 100%;
    padding: 8px;
}

.msp-card-grid,
.msp-workflow-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.msp-resource-card,
.msp-member-card,
.msp-workflow-panel,
.msp-guest-card {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 15px;
}

.msp-resource-card {
    display: grid;
    gap: 8px;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.msp-resource-card:hover,
.msp-resource-card:focus-visible {
    border-color: var(--msp-accent);
    box-shadow: 0 12px 30px rgba(46, 38, 30, .08);
    outline: 0;
}

.msp-resource-card strong {
    font-size: 18px;
}

.msp-resource-card small {
    color: var(--msp-muted);
}

.msp-document-content {
    margin-top: 18px;
    padding: 24px;
    white-space: pre-wrap;
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 14px;
    line-height: 1.7;
}

.msp-dialog-compact {
    width: min(760px, 100%);
}

.msp-booking-source-select {
    min-width: min(320px, 42vw);
}

.msp-booking-scope-actions {
    margin-top: 0;
}

.msp-booking-source-hint {
    margin: 0 0 14px;
}

.msp-booking-composer {
    width: min(820px, 100%);
}

.msp-booking-composer-summary {
    display: grid;
    gap: 4px;
    margin-bottom: 18px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 12px;
}

.msp-booking-composer-summary strong {
    font-size: 17px;
}

.msp-booking-composer-summary span {
    color: var(--msp-muted);
}

.msp-tone-picker {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: start;
    gap: 10px 14px;
    padding: 12px 14px;
    background: #f5f2ed;
    border: 1px solid var(--msp-line);
    border-radius: 12px;
}

.msp-tone-picker > span {
    color: #4f5664;
    font-size: 13px;
    font-weight: 800;
}

.msp-tone-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    background: #e9e5df;
    border-radius: 10px;
}

.msp-tone-toggle .msp-button {
    min-height: 32px;
    padding: 6px 14px;
    justify-content: center;
    border-color: transparent;
    background: transparent;
}

.msp-tone-toggle .msp-button.is-active {
    color: var(--msp-ink);
    background: #fff;
    box-shadow: 0 2px 7px rgba(31, 36, 48, .10);
}

.msp-booking-composer-notices .msp-alert {
    margin: 0 0 10px;
    padding: 12px 14px;
    border-radius: 10px;
}

.msp-booking-composer-notices {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.msp-warning-card {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    padding: 13px 15px;
    color: #7d2938;
    background: #fff1f3;
    border: 1px solid #f0c7cf;
    border-radius: 12px;
}

.msp-warning-card-icon {
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #cf3552;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

.msp-warning-card-copy strong,
.msp-warning-card-copy p {
    display: block;
    margin: 0;
}

.msp-warning-card-copy p {
    margin-top: 3px;
    color: #874653;
    font-size: 13px;
    line-height: 1.45;
}

.msp-info-card {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    margin-bottom: 16px;
    padding: 13px 15px;
    color: #334d66;
    background: #f0f6fb;
    border: 1px solid #ccdfef;
    border-radius: 12px;
}

.msp-info-card-icon {
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #547b9e;
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 16px;
    font-style: italic;
    font-weight: 800;
    line-height: 1;
}

.msp-info-card-copy strong,
.msp-info-card-copy p {
    display: block;
    margin: 0;
}

.msp-info-card-copy p {
    margin-top: 3px;
    color: #526d84;
    font-size: 13px;
    line-height: 1.45;
}

.msp-template-editor-dialog {
    width: min(1020px, 100%);
}

.msp-template-editor-workspace {
    display: grid;
    gap: 22px;
}

.msp-template-editor-workspace .msp-template-editor-section {
    margin: 0;
    padding: 22px;
    border-radius: 16px;
}

.msp-template-editor-section legend {
    padding: 0 10px;
    font-size: 17px;
    font-weight: 850;
}

.msp-template-editor-section-base {
    background: #fff;
    border-color: var(--msp-line);
}

.msp-template-editor-section-formal {
    background: #f5f8fc;
    border-color: #d6e1ed;
}

.msp-template-editor-section-formal legend {
    color: #3d607f;
}

.msp-template-editor-section-du {
    background: #fff5f7;
    border-color: #efd5db;
}

.msp-template-editor-section-du legend {
    color: #a43149;
}

.msp-template-editor-grid,
.msp-template-salutations-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.msp-template-salutations {
    padding: 16px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(100, 107, 120, .16);
    border-radius: 12px;
}

.msp-template-salutations h4 {
    margin: 0 0 13px;
    color: var(--msp-ink);
    font-size: 14px;
}

.msp-booking-composer-footer {
    align-items: center;
}

.msp-booking-composer-footer .msp-action-bar {
    justify-content: flex-end;
    margin: 0;
}

.msp-record-backdrop {
    place-items: center;
}

.msp-record-dialog {
    width: min(720px, 100%);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
}

.msp-record-body {
    padding: 26px 28px 28px;
}

.msp-record-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 26px;
    margin: 0;
}

.msp-record-field {
    min-width: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--msp-line);
}

.msp-record-field dt {
    margin: 0 0 6px;
    color: var(--msp-muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.msp-record-field dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--msp-ink);
    line-height: 1.5;
    white-space: pre-wrap;
}

.msp-record-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin: 24px -28px -28px;
    padding: 18px 28px;
    background: #fff;
    border-top: 1px solid var(--msp-line);
}

.msp-inline-record-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 26px;
}

.msp-inline-record-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
    padding: 12px 0;
    border-bottom: 1px solid var(--msp-line);
}

.msp-inline-record-field-wide {
    grid-column: 1 / -1;
}

.msp-inline-record-field > span {
    color: var(--msp-muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.msp-inline-record-control {
    width: 100%;
    min-height: 35px;
    padding: 5px 7px;
    color: var(--msp-ink);
    background: transparent;
    border: 0;
    border-radius: 7px;
    outline: 0;
    font: inherit;
    line-height: 1.45;
    transition: background-color .15s ease, box-shadow .15s ease;
}

textarea.msp-inline-record-control {
    min-height: 74px;
    resize: vertical;
}

.msp-inline-record-control:hover,
.msp-inline-record-control:focus {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(207, 53, 82, .12);
}

.msp-inline-checkbox {
    width: 22px;
    height: 22px;
    margin: 6px 0;
    accent-color: var(--msp-accent);
}

.msp-inline-record-notice {
    margin: 16px 0 0;
    padding: 11px 13px;
    color: #8e2335;
    background: #fff0f2;
    border-radius: 9px;
}

.msp-inline-record-actions {
    justify-content: space-between;
}

.msp-inline-database-form .msp-form-grid {
    gap: 0 26px;
}

.msp-inline-database-form .msp-field {
    gap: 5px;
    padding: 12px 0;
    border-bottom: 1px solid var(--msp-line);
}

.msp-inline-database-form .msp-field > span {
    color: var(--msp-muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.msp-inline-database-form .msp-field input,
.msp-inline-database-form .msp-field select,
.msp-inline-database-form .msp-field textarea {
    min-height: 35px;
    padding: 5px 7px;
    background: transparent;
    border: 0;
    border-radius: 7px;
    outline: 0;
}

.msp-inline-database-form .msp-field input:focus,
.msp-inline-database-form .msp-field select:focus,
.msp-inline-database-form .msp-field textarea:focus {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(207, 53, 82, .12);
}

.msp-inline-database-actions {
    justify-content: space-between;
}

.msp-workflow {
    margin-top: 36px;
    padding-top: 12px;
    border-top: 1px solid var(--msp-line);
}

.msp-workflow-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.msp-workflow-header h3 {
    margin: 3px 0 0;
    font-size: 28px;
}

.msp-job-action-menu {
    position: relative;
}

.msp-job-action-menu > summary {
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 10px;
    font-weight: 800;
}

.msp-job-action-menu > summary::-webkit-details-marker {
    display: none;
}

.msp-job-action-menu > summary::after {
    content: "⌄";
    margin-left: 10px;
    color: var(--msp-muted);
}

.msp-job-action-menu[open] > summary::after {
    content: "⌃";
}

.msp-job-action-menu-body {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    width: min(560px, 86vw);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 13px;
    box-shadow: 0 18px 48px rgba(24, 27, 36, .16);
}

.msp-job-owner-row {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(150px, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--msp-line);
}

.msp-workflow-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 6px;
    background: #ebe8e3;
    border-radius: 14px;
}

.msp-workflow-tab {
    display: grid;
    grid-template-columns: 29px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 10px 12px;
    color: var(--msp-muted);
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 10px;
    font: inherit;
    text-align: left;
}

.msp-workflow-tab:hover,
.msp-workflow-tab:focus-visible {
    color: var(--msp-ink);
    background: rgba(255, 255, 255, .65);
    outline: none;
}

.msp-workflow-tab.is-active {
    color: var(--msp-ink);
    background: #fff;
    box-shadow: 0 2px 10px rgba(25, 29, 39, .08);
}

.msp-workflow-tab-number {
    display: inline-flex;
    width: 29px;
    height: 29px;
    align-items: center;
    justify-content: center;
    color: var(--msp-accent);
    background: #fbe8ec;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 900;
}

.msp-workflow-tab-copy {
    display: grid;
    min-width: 0;
}

.msp-workflow-tab-copy strong,
.msp-workflow-tab-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msp-workflow-tab-copy small {
    margin-top: 2px;
    color: var(--msp-muted);
    font-size: 11px;
}

.msp-workflow-notes {
    margin: 12px 0;
    background: #fffaf4;
    border: 1px solid #eadfce;
    border-radius: 12px;
}

.msp-workflow-notes > summary {
    display: grid;
    grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 11px 14px;
    cursor: pointer;
    list-style: none;
}

.msp-workflow-notes > summary::-webkit-details-marker {
    display: none;
}

.msp-workflow-notes > summary > span:first-child {
    display: grid;
}

.msp-workflow-notes > summary small,
.msp-workflow-note-preview {
    color: var(--msp-muted);
    font-size: 12px;
}

.msp-workflow-note-preview {
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msp-workflow-notes-body {
    display: grid;
    gap: 12px;
    padding: 0 14px 14px;
    border-top: 1px solid #efe3d2;
}

.msp-workflow-notes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px 18px;
}

.msp-workflow-notes-grid > div {
    padding: 11px 0;
    border-bottom: 1px solid #efe7dc;
}

.msp-workflow-notes-grid p {
    margin: 4px 0 0;
    color: var(--msp-muted);
    line-height: 1.45;
}

.msp-workflow-stage-host {
    min-width: 0;
}

.msp-workflow-stage[hidden] {
    display: none;
}

.msp-workflow-pager {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--msp-line);
}

.msp-workflow-pager > :only-child:last-child {
    margin-left: auto;
}

.msp-workflow-panel {
    min-width: 0;
    width: 100%;
}

.msp-workflow-panel > h4,
.msp-member-card h3,
.msp-guest-card h2,
.msp-guest-card h3 {
    margin-top: 0;
}

.msp-workflow-row {
    display: grid;
    grid-template-columns: minmax(105px, .55fr) minmax(170px, 1fr) minmax(340px, 1.7fr);
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 7px 0;
    border-bottom: 1px solid var(--msp-line);
}

.msp-workflow-row-controls {
    display: flex;
    grid-column: auto;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.msp-workflow-row-controls .msp-select {
    min-width: 150px;
    flex: 1 1 180px;
    padding: 7px 30px 7px 9px;
    font-size: 13px;
}

.msp-workflow-row-controls .msp-button {
    flex: 0 1 auto;
    white-space: nowrap;
}

.msp-workflow-row-confirmed {
    margin: 5px 0;
    padding: 8px 11px;
    background: #edf9f2;
    border: 1px solid #b9e2cb;
    border-radius: 10px;
}

.msp-availability-confirmation {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #176345;
}

.msp-availability-confirmation-source {
    display: inline-flex;
    padding: 4px 8px;
    color: #28775a;
    background: #d8f1e3;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.msp-workflow-row-controls-confirmed {
    justify-content: flex-end;
}

.msp-button-small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
}

.msp-workflow-empty-state {
    padding: 32px;
    text-align: center;
    background: #faf9f7;
    border: 1px dashed #d8d1c7;
    border-radius: 13px;
}

.msp-workflow-empty-state p {
    max-width: 620px;
    margin: 8px auto 0;
    color: var(--msp-muted);
}

.msp-document-workspace {
    padding: 0;
    overflow: hidden;
}

.msp-document-workspace > h4 {
    display: none;
}

.msp-document-workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: #fff;
    border-bottom: 1px solid var(--msp-line);
}

.msp-document-workspace-header h3 {
    margin: 3px 0 0;
    font-size: 23px;
}

.msp-document-status {
    display: inline-flex;
    padding: 6px 10px;
    color: #665f6a;
    background: #f1eef1;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.msp-document-status-accepted {
    color: #176345;
    background: #def3e7;
}

.msp-document-status-sent {
    color: #315e91;
    background: #e5effa;
}

.msp-document-status-ready {
    color: #775b18;
    background: #fff0c9;
}

.msp-document-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    align-items: start;
    gap: 24px;
    padding: 24px;
    background: #fafafa;
}

.msp-document-main {
    min-width: 0;
    background: #fff;
    border: 1px solid #e5e2de;
    border-radius: 14px;
}

.msp-document-section {
    padding: 24px;
    border-bottom: 1px solid #ece8e3;
}

.msp-document-section:last-child {
    border-bottom: 0;
}

.msp-document-section > h4,
.msp-document-section-heading h4 {
    margin: 0 0 18px;
    font-size: 18px;
}

.msp-document-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.msp-booking-rate-field {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--msp-muted);
    font-size: 12px;
    font-weight: 700;
}

.msp-booking-rate-field input {
    width: 72px;
    padding: 7px 8px;
}

.msp-document-meta-form .msp-form-grid {
    gap: 14px;
}

.msp-document-meta-form .msp-field input,
.msp-document-meta-form .msp-field textarea {
    background: #fbfbfb;
}

.msp-document-meta-form .msp-field textarea {
    min-height: 92px;
}

.msp-document-product-picker {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 8px;
    margin-bottom: 18px;
    padding: 12px;
    background: #f8f7f5;
    border: 1px solid #ece8e3;
    border-radius: 12px;
}

.msp-document-picker-label {
    grid-column: 1 / -1;
    color: #77717c;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.msp-document-line-labels {
    display: grid;
    grid-template-columns: minmax(340px, 1fr) 105px 72px 84px 100px;
    gap: 8px;
    margin: 0 42px 6px 30px;
    color: #77717c;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.msp-document-lines {
    counter-reset: document-line;
    gap: 10px;
}

.msp-line-editor-row.msp-document-line {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) 40px;
    align-items: start;
    gap: 14px;
    padding: 0 14px 0 0;
    counter-increment: document-line;
    overflow: hidden;
    background: rgba(255, 255, 255, .78);
    border: 1px solid #ebe5e1;
    border-radius: 14px;
    box-shadow: 0 1px 0 rgba(42, 34, 43, .025);
    transition: border-color .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.msp-line-editor-row.msp-document-line.is-dragging {
    opacity: .56;
    border-color: rgba(211, 55, 88, .35);
    box-shadow: 0 8px 24px rgba(42, 34, 43, .1);
}

.msp-document-line-controls {
    display: grid;
    grid-column: 1;
    grid-row: 1 / span 2;
    grid-template-columns: 1fr 1fr;
    align-self: stretch;
    min-height: 100%;
    color: #817982;
    background: #f7f1ef;
    border-right: 1px solid #eadfdb;
}

.msp-document-line-number,
.msp-document-line-handle {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
}

.msp-document-line-number {
    font-size: 12px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.msp-document-line-number::before {
    content: counter(document-line) ".";
}

.msp-document-line-handle {
    color: #a29aa3;
    cursor: grab;
    font-size: 20px;
    font-weight: 900;
    border-left: 1px solid rgba(218, 205, 201, .75);
}

.msp-document-line-handle:hover {
    color: var(--msp-accent);
    background: rgba(255, 255, 255, .58);
}

.msp-document-line-handle:active {
    cursor: grabbing;
}

.msp-document-line-product {
    display: grid;
    grid-column: 2;
    gap: 8px;
    padding-top: 14px;
}

.msp-document-line-product > div:first-child {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 8px;
}

.msp-document-line input,
.msp-document-line select,
.msp-document-line textarea {
    min-width: 0;
    width: 100%;
    padding: 8px 9px;
    color: var(--msp-ink);
    background: #f7f5f3;
    border: 1px solid transparent;
    border-radius: 9px;
    font: inherit;
    font-size: 13px;
    box-shadow: inset 0 0 0 1px rgba(81, 69, 80, .04);
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.msp-document-line input:hover,
.msp-document-line select:hover,
.msp-document-line textarea:hover {
    background: #f3f0ed;
    border-color: #e4ddd8;
}

.msp-document-line input:focus,
.msp-document-line select:focus,
.msp-document-line textarea:focus {
    outline: none;
    background: #fff;
    border-color: rgba(211, 55, 88, .48);
    box-shadow: 0 0 0 3px rgba(211, 55, 88, .09);
}

.msp-document-line [data-field="title"] {
    min-height: 40px;
    font-weight: 750;
}

.msp-document-line [data-field="description"] {
    min-height: 94px;
    padding: 10px 12px;
    line-height: 1.45;
    resize: vertical;
}

.msp-document-line-details {
    display: grid;
    grid-column: 2;
    grid-template-columns: minmax(130px, 1.15fr) minmax(82px, .6fr) minmax(105px, .85fr) minmax(115px, .9fr);
    align-items: end;
    gap: 10px;
    padding-bottom: 14px;
}

.msp-document-line-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.msp-document-line-field > span:first-child {
    color: #77717c;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.msp-document-line .msp-inline-check {
    grid-column: 1 / -1;
    justify-self: start;
    color: var(--msp-muted);
    font-size: 11px;
}

.msp-document-line .msp-inline-check input {
    width: auto;
}

.msp-document-number-field {
    position: relative;
    display: flex;
    align-items: center;
}

.msp-document-number-field span {
    position: absolute;
    right: 9px;
    color: var(--msp-muted);
    font-size: 12px;
}

.msp-document-number-field input {
    padding-right: 25px;
}

.msp-document-line-total {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: flex-end;
    padding-top: 0;
    text-align: right;
    white-space: nowrap;
}

.msp-document-line-remove {
    grid-column: 3;
    grid-row: 1;
    width: 32px;
    min-height: 32px;
    margin-top: 14px;
    padding: 0;
    border-radius: 8px;
}

.msp-document-line.is-heading .msp-document-line-details,
.msp-document-line.is-heading [data-field="description"] {
    display: none;
}

.msp-document-position-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 12px;
}

.msp-document-position-actions .msp-button {
    min-height: 32px;
    padding: 6px 9px;
    color: var(--msp-accent);
    background: transparent;
    border-color: transparent;
    font-size: 12px;
}

.msp-document-totals {
    display: grid;
    gap: 9px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e9e6e2;
}

.msp-document-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: var(--msp-muted);
    font-size: 13px;
}

.msp-document-totals .msp-document-total-row {
    margin-top: 6px;
    padding-top: 13px;
    color: var(--msp-ink);
    border-top: 1px solid #e9e6e2;
    font-size: 17px;
    font-weight: 850;
}

.msp-document-grand-total {
    font-size: 22px;
}

.msp-document-savebar,
.msp-document-lifecycle-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
}

.msp-document-lifecycle-actions {
    flex-wrap: wrap;
    background: #fff;
    border-top: 1px solid var(--msp-line);
}

.msp-document-preview {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 10px;
    padding: 14px;
    text-align: center;
    background: #f4f2ef;
    border: 1px solid #e2ded8;
    border-radius: 14px;
}

.msp-document-preview-paper {
    display: grid;
    min-height: 245px;
    align-content: start;
    gap: 9px;
    padding: 20px 15px;
    text-align: left;
    background: #fff;
    border: 1px solid #e4e0db;
    box-shadow: 0 8px 22px rgba(31, 29, 33, .08);
}

.msp-document-preview-paper span {
    display: block;
    height: 5px;
    margin-top: 12px;
    background: #efede9;
    border-radius: 99px;
}

.msp-document-preview-paper span:nth-last-child(2) {
    width: 75%;
}

.msp-document-preview-paper span:last-child {
    width: 48%;
}

.msp-document-preview-total {
    font-size: 19px;
}

.msp-document-subheading {
    margin: 24px 24px 10px;
}

.msp-billing-workspace > .msp-distribution-editor,
.msp-billing-workspace > .msp-button,
.msp-billing-workspace > .msp-table-wrap,
.msp-billing-workspace > h4:not(.msp-document-subheading) {
    margin-right: 24px;
    margin-left: 24px;
}

.msp-readonly-document {
    margin: 24px;
    padding: 24px;
    background: #fff;
    border: 1px solid #e5e2de;
    border-radius: 13px;
}

.msp-readonly-document h4 {
    margin: 0;
    font-size: 21px;
}

.msp-readonly-document-lines {
    display: grid;
    gap: 0;
    margin-top: 20px;
}

.msp-readonly-document-lines > div {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid #ece9e5;
}

.msp-readonly-document-total {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 2px solid #e7e3df;
    font-size: 18px;
}

.msp-line-editor,
.msp-distribution-editor {
    display: grid;
    gap: 9px;
    margin: 14px 0;
}

.msp-line-editor-row {
    display: grid;
    grid-template-columns: 105px minmax(130px, 1.4fr) minmax(140px, 1.6fr) 76px 90px 105px auto auto;
    align-items: center;
    gap: 8px;
}

.msp-line-editor-row input,
.msp-compact-input,
.msp-copy-input,
.msp-member-card textarea,
.msp-guest-card textarea,
.msp-json-editor {
    width: 100%;
    padding: 9px 10px;
    color: var(--msp-ink);
    background: #fff;
    border: 1px solid #d8d2c8;
    border-radius: 8px;
    font: inherit;
}

.msp-setlist-editor,
.msp-set-items {
    display: grid;
    gap: 9px;
}

.msp-set-editor {
    padding: 14px;
    background: #faf8f4;
    border: 1px solid var(--msp-line);
    border-radius: 12px;
}

.msp-set-editor > input,
.msp-set-editor > textarea,
.msp-setlist-editor > textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 9px;
    font: inherit;
    color: var(--msp-ink);
    background: #fff;
    border: 1px solid #d8d2c8;
    border-radius: 8px;
}

.msp-set-editor > input {
    font-weight: 800;
}

.msp-set-item {
    display: grid;
    grid-template-columns: auto minmax(120px, 1.2fr) minmax(120px, 1fr) 82px auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 8px;
}

.msp-set-item input {
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid #d8d2c8;
    border-radius: 7px;
}

.msp-drag-handle {
    color: var(--msp-muted);
    cursor: grab;
}

.msp-compact-input {
    width: 90px;
}

.msp-inline-check,
.msp-recipient-option {
    display: flex;
    align-items: center;
    gap: 7px;
}

.msp-distribution-block {
    display: grid;
    gap: 9px;
    padding: 14px;
    background: #faf8f4;
    border: 1px solid var(--msp-line);
    border-radius: 12px;
}

.msp-recipient-option {
    display: grid;
    grid-template-columns: auto 1fr 110px;
}

.msp-recipient-option input[type="number"] {
    width: 110px;
    padding: 7px;
}

.msp-json-editor {
    min-height: 320px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
}

.msp-song-list {
    display: grid;
    gap: 7px;
    padding-left: 24px;
}

.msp-toast {
    position: fixed;
    z-index: 110000;
    right: 24px;
    bottom: 24px;
    padding: 13px 17px;
    color: #fff;
    background: var(--msp-sidebar);
    border-radius: 10px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .22);
    font-weight: 700;
}

.msp-guest-app {
    max-width: 880px;
    margin: 30px auto;
    padding: 20px;
    color: var(--msp-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.msp-guest-hero {
    padding: clamp(28px, 6vw, 56px);
    background: linear-gradient(135deg, #fff 0%, #fff4f1 100%);
    border: 1px solid var(--msp-line);
    border-radius: 20px;
}

.msp-guest-hero h1 {
    margin: 0 0 16px;
    font-size: clamp(32px, 6vw, 54px);
}

.msp-guest-card {
    margin-top: 16px;
}

.msp-fee-list {
    display: grid;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.msp-fee-list li {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 9px 0;
    border-bottom: 1px solid var(--msp-line);
}

.msp-field select[multiple] {
    min-height: 140px;
    padding: 8px;
}

.msp-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.msp-stat-card {
    display: grid;
    min-height: 150px;
    align-content: space-between;
    padding: 22px;
    background: var(--msp-panel);
    border: 1px solid var(--msp-line);
    border-radius: 16px;
}

.msp-stat-card span,
.msp-stat-card small {
    color: var(--msp-muted);
}

.msp-stat-card strong {
    font-size: 32px;
}

.msp-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.msp-overview-card {
    display: grid;
    align-content: start;
    gap: 18px;
    min-width: 0;
    padding: 24px;
    background: #fff;
    border: 1px solid rgba(31, 36, 48, .08);
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(31, 36, 48, .055);
}

.msp-overview-card-header h3,
.msp-overview-card-header p {
    margin: 0;
}

.msp-overview-card-header h3 {
    font-size: 21px;
}

.msp-overview-card-header p {
    margin-top: 5px;
    color: var(--msp-muted);
    font-size: 13px;
}

.msp-overview-metrics {
    display: grid;
    margin: 0;
}

.msp-overview-metric {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
    padding: 12px 0 12px 18px;
    color: inherit;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #eeeae4;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: color .15s ease, background-color .15s ease;
}

.msp-overview-metric:last-child {
    border-bottom: 0;
}

.msp-overview-metric:hover,
.msp-overview-metric:focus-visible {
    color: var(--msp-accent-dark);
    background: #fff7f5;
    outline: 0;
}

.msp-overview-metric::before {
    position: absolute;
    left: 0;
    width: 7px;
    height: 7px;
    background: #b8bbc3;
    border-radius: 50%;
    content: '';
}

.msp-overview-metric-open::before {
    background: var(--msp-accent);
}

.msp-overview-metric-cancelled::before {
    background: #a4a8b1;
}

.msp-overview-metric-pending::before,
.msp-overview-metric-exchange::before {
    background: #d99a35;
}

.msp-overview-metric-invoice::before {
    background: #9467bd;
}

.msp-overview-metric-completed::before {
    background: #2d936c;
}

.msp-overview-metric span {
    min-width: 0;
    color: var(--msp-muted);
    font-size: 14px;
}

.msp-overview-metric strong {
    color: var(--msp-ink);
    font-size: 23px;
    font-weight: 850;
    line-height: 1;
}

.msp-overview-card > .msp-button {
    justify-self: start;
}

.msp-dashboard-action-card {
    min-height: 190px;
    align-content: space-between;
    cursor: pointer;
    background: linear-gradient(135deg, #fff 0%, #fff3f0 100%);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.msp-dashboard-action-card:hover,
.msp-dashboard-action-card:focus-visible {
    border-color: rgba(208, 68, 88, .36);
    box-shadow: 0 14px 38px rgba(31, 36, 48, .09);
    outline: 0;
    transform: translateY(-1px);
}

.msp-dashboard-action-card .msp-eyebrow {
    margin-bottom: 9px;
    color: var(--msp-accent-dark);
}

.msp-inquiry-mode-switch {
    display: inline-flex;
    gap: 4px;
    margin: 0 0 5px;
    padding: 4px;
    border: 1px solid var(--msp-line);
    border-radius: 13px;
    background: #f5f2ed;
}

.msp-inquiry-mode-switch button {
    padding: 9px 14px;
    color: var(--msp-muted);
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
}

.msp-inquiry-mode-switch button.is-active {
    color: var(--msp-ink);
    background: #fff;
    box-shadow: 0 2px 8px rgba(31, 36, 48, .08);
}

.msp-inquiry-mode-description {
    margin: 0 0 18px;
}

.msp-composer-switch {
    display: flex;
    gap: 5px;
    margin: 0 0 18px;
    padding: 4px;
    border: 1px solid var(--msp-line);
    border-radius: 12px;
    background: #f5f2ed;
}

.msp-composer-switch .msp-button {
    flex: 1 1 0;
    justify-content: center;
    border-color: transparent;
    background: transparent;
}

.msp-composer-switch .msp-button.is-active {
    color: var(--msp-ink);
    background: #fff;
    border-color: rgba(92, 82, 71, .10);
    box-shadow: 0 2px 8px rgba(31, 36, 48, .08);
}

.msp-login-required {
    padding: 28px;
    background: #fff;
    border: 1px solid var(--msp-line);
    border-radius: 16px;
}

.msp-button {
    display: inline-flex;
    padding: 10px 16px;
    color: #fff;
    background: var(--msp-accent);
    border-radius: 9px;
    text-decoration: none;
}

.msp-button.msp-button-secondary {
    color: var(--msp-ink);
    background: #fff;
    border: 1px solid var(--msp-line);
}

.msp-button.msp-button-secondary:hover,
.msp-button.msp-button-secondary:focus-visible {
    color: var(--msp-accent-dark);
    background: #fff8f6;
    border-color: #e8bbc2;
}

.msp-button.msp-button-danger {
    color: #8d2436;
    background: #fff1f3;
    border: 1px solid #efc2ca;
}

.msp-login-shell,
.msp-login-shell * {
    box-sizing: border-box;
}

.msp-login-shell {
    display: grid;
    grid-template-columns: minmax(300px, .9fr) minmax(380px, 1.1fr);
    width: min(1040px, 100%);
    min-height: 650px;
    margin: 28px auto;
    overflow: hidden;
    color: var(--msp-ink);
    background: var(--msp-panel);
    border: 1px solid var(--msp-line);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(31, 36, 48, .14);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.msp-login-intro {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(32px, 5vw, 64px);
    color: #fff;
    background:
        radial-gradient(circle at 85% 15%, rgba(208, 68, 88, .45), transparent 34%),
        linear-gradient(145deg, #292d38 0%, var(--msp-sidebar) 72%);
}

.msp-login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.msp-login-brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: #fff;
    background: var(--msp-accent);
    border-radius: 15px;
    box-shadow: 0 12px 28px rgba(208, 68, 88, .28);
    font-weight: 850;
    letter-spacing: -.05em;
}

.msp-login-brand strong,
.msp-login-brand small {
    display: block;
}

.msp-login-brand strong {
    font-size: 17px;
}

.msp-login-brand small,
.msp-login-note {
    color: #b9bfcb;
}

.msp-login-intro .msp-eyebrow {
    color: #f3a0ac;
}

.msp-login-intro h1 {
    max-width: 440px;
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(38px, 5vw, 62px);
    line-height: .98;
    letter-spacing: -.045em;
}

.msp-login-intro p:not(.msp-eyebrow) {
    max-width: 440px;
    margin: 0;
    color: #d8dce4;
    font-size: 17px;
    line-height: 1.65;
}

.msp-login-note {
    font-size: 12px;
    line-height: 1.5;
}

.msp-login-panel {
    display: grid;
    place-items: center;
    padding: clamp(30px, 6vw, 76px);
    background:
        linear-gradient(rgba(255, 255, 255, .91), rgba(255, 255, 255, .97)),
        radial-gradient(circle at 100% 0%, #f9dce0, transparent 48%);
}

.msp-login-form {
    display: grid;
    width: min(100%, 430px);
    gap: 20px;
}

.msp-login-heading h2 {
    margin: 0;
    color: var(--msp-ink);
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.1;
    letter-spacing: -.035em;
}

.msp-login-heading > p:last-child {
    margin: 10px 0 0;
    color: var(--msp-muted);
    line-height: 1.55;
}

.msp-login-field {
    display: grid;
    gap: 8px;
    color: var(--msp-ink);
    font-size: 14px;
    font-weight: 750;
}

.msp-login-field input {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    color: var(--msp-ink);
    background: #fff;
    border: 1px solid #d7d1c8;
    border-radius: 11px;
    outline: none;
    font: inherit;
    font-weight: 500;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.msp-login-field input:focus {
    border-color: var(--msp-accent);
    box-shadow: 0 0 0 4px rgba(208, 68, 88, .12);
}

.msp-login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--msp-muted);
    font-size: 13px;
}

.msp-login-options a {
    color: var(--msp-accent-dark);
    font-weight: 750;
    text-decoration: none;
}

.msp-login-options a:hover,
.msp-login-options a:focus-visible {
    text-decoration: underline;
}

.msp-login-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.msp-login-remember input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--msp-accent);
}

.msp-login-error {
    padding: 12px 14px;
    color: #8d2637;
    background: #fff0f2;
    border: 1px solid #f2c6ce;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.msp-login-submit {
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    color: #fff;
    background: var(--msp-accent);
    border: 0;
    border-radius: 11px;
    box-shadow: 0 12px 26px rgba(208, 68, 88, .24);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    transition: background .16s ease, transform .16s ease;
}

.msp-login-submit:hover,
.msp-login-submit:focus-visible {
    background: var(--msp-accent-dark);
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    .msp-app {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .msp-brand > span:last-child,
    .msp-nav-item > span:last-child,
    .msp-user-card > span:last-child {
        display: none;
    }

    .msp-brand,
    .msp-user-card,
    .msp-nav-item {
        justify-content: center;
    }

    .msp-stat-grid {
        grid-template-columns: 1fr;
    }

    .msp-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .msp-dashboard-action-card {
        order: -1;
    }

    .msp-detail-grid,
    .msp-note-grid,
    .msp-card-grid,
    .msp-workflow-grid,
    .msp-record-list,
    .msp-inline-record-grid {
        grid-template-columns: 1fr;
    }

    .msp-workflow-row,
    .msp-line-editor-row,
    .msp-set-item,
    .msp-upload-bar {
        grid-template-columns: 1fr;
    }

    .msp-workflow-row-controls {
        grid-column: auto;
    }

    .msp-workflow-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .msp-workflow-row {
        grid-template-columns: minmax(100px, .6fr) minmax(160px, 1fr);
    }

    .msp-workflow-row-controls {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .msp-document-layout {
        grid-template-columns: 1fr;
    }

    .msp-document-preview {
        display: none;
    }

    .msp-document-line-labels {
        display: none;
    }

    .msp-line-editor-row.msp-document-line {
        grid-template-columns: 66px minmax(0, 1fr) 34px;
        gap: 10px;
        padding-right: 10px;
    }

    .msp-document-line-product,
    .msp-document-line-details {
        grid-column: 2;
    }

    .msp-document-line-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .msp-document-line-remove {
        grid-column: 3;
        grid-row: 1;
    }

    .msp-login-shell {
        grid-template-columns: 1fr;
    }

    .msp-login-intro {
        min-height: 330px;
        gap: 42px;
    }
}

@media (max-width: 620px) {
    .msp-app {
        display: block;
        border-radius: 0;
    }

    .msp-sidebar {
        padding: 12px;
    }

    .msp-brand,
    .msp-user-card {
        display: none;
    }

    .msp-navigation {
        display: flex;
        overflow-x: auto;
    }

    .msp-nav-item {
        width: auto;
        min-width: 44px;
        flex: 0 0 auto;
    }

    .msp-inquiry-mode-switch {
        display: grid;
        width: 100%;
    }

    .msp-topbar,
    .msp-content {
        padding: 20px;
    }

    .msp-section-header,
    .msp-section-actions,
    .msp-form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .msp-select {
        width: 100%;
    }

    .msp-workflow-header,
    .msp-document-workspace-header,
    .msp-document-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .msp-job-action-menu,
    .msp-job-action-menu > summary {
        width: 100%;
    }

    .msp-job-action-menu-body {
        position: static;
        width: 100%;
        grid-template-columns: 1fr;
        margin-top: 8px;
        box-shadow: none;
    }

    .msp-job-owner-row {
        grid-template-columns: 1fr;
    }

    .msp-workflow-nav {
        display: flex;
        overflow-x: auto;
    }

    .msp-workflow-tab {
        min-width: 185px;
        flex: 0 0 auto;
    }

    .msp-workflow-notes > summary {
        grid-template-columns: 1fr;
    }

    .msp-workflow-note-preview {
        text-align: left;
    }

    .msp-workflow-notes-grid {
        grid-template-columns: 1fr;
    }

    .msp-workflow-row,
    .msp-workflow-row-confirmed {
        display: grid;
        grid-template-columns: 1fr;
    }

    .msp-workflow-row-controls {
        grid-column: auto;
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .msp-workflow-row-controls .msp-select,
    .msp-workflow-row-controls .msp-button {
        width: 100%;
    }

    .msp-document-layout,
    .msp-document-section,
    .msp-document-workspace-header {
        padding: 16px;
    }

    .msp-document-product-picker {
        grid-template-columns: 1fr;
    }

    .msp-document-line-product > div:first-child {
        grid-template-columns: 1fr;
    }

    .msp-document-line-details {
        grid-template-columns: 1fr 1fr;
    }

    .msp-document-savebar,
    .msp-document-lifecycle-actions {
        align-items: stretch;
        flex-direction: column;
        padding: 14px 16px;
    }

    .msp-dialog-backdrop {
        padding: 0;
    }

    .msp-dialog {
        min-height: 100vh;
        border-radius: 0;
    }

    .msp-app .msp-table {
        min-width: 540px;
    }

    .msp-app .msp-table th,
    .msp-app .msp-table td {
        padding: 11px 13px;
    }

    .msp-record-body {
        padding: 20px;
    }

    .msp-record-actions {
        margin: 20px -20px -20px;
        padding: 16px 20px;
    }

    .msp-form-grid {
        grid-template-columns: 1fr;
    }

    .msp-tone-picker {
        grid-template-columns: auto auto;
        align-items: start;
    }

    .msp-template-editor-grid,
    .msp-template-salutations-grid {
        grid-template-columns: 1fr;
    }

    .msp-field-wide {
        grid-column: auto;
    }

    .msp-status {
        display: none;
    }

    .msp-login-shell {
        min-height: 100vh;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .msp-login-intro {
        min-height: 300px;
        padding: 30px 24px;
    }

    .msp-login-intro h1 {
        font-size: 40px;
    }

    .msp-login-note {
        display: none;
    }

    .msp-login-panel {
        padding: 38px 24px 48px;
    }

    .msp-login-options {
        align-items: flex-start;
        flex-direction: column;
    }
}

.msp-pill-draft {
    color: #6b6470;
    background: #f0edf1;
}

.msp-staffing-editor {
    display: grid;
    gap: 10px;
    margin: 10px 0 14px;
}

.msp-staffing-editor-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.6fr) 90px auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--msp-border, #e8e1d8);
    border-radius: 14px;
    background: #fff;
}

.msp-deadline-field {
    max-width: 220px;
}

.msp-staffing-deadline {
    display: grid;
    gap: 3px;
    font-size: 11px;
    color: #77717d;
}

.msp-settings-intro {
    max-width: 720px;
    margin: -8px 0 24px;
    color: var(--msp-muted);
}

.msp-settings-form {
    display: grid;
    gap: 16px;
}

.msp-settings-group {
    margin: 0;
    padding: 22px 24px 24px;
    border: 1px solid rgba(92, 82, 71, .16);
    border-radius: 18px;
    background: rgba(255, 255, 255, .58);
    box-shadow: none;
}

.msp-settings-group legend {
    padding: 0 9px;
    color: var(--msp-ink);
    font-size: 18px;
    font-weight: 850;
}

.msp-settings-description {
    margin: 0 0 18px;
    color: var(--msp-muted);
    font-size: 14px;
}

.msp-settings-subheader {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(92, 82, 71, .12);
}

.msp-branding-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.msp-branding-card {
    padding: 16px;
    border: 1px solid var(--msp-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .7);
}

.msp-branding-card h5 {
    margin: 0 0 4px;
    font-size: 15px;
}

.msp-branding-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 112px;
    margin: 14px 0;
    padding: 14px;
    overflow: hidden;
    border-radius: 12px;
    background: #f4f2ee;
}

.msp-branding-preview img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 86px;
    object-fit: contain;
}

.msp-branding-actions {
    align-items: center;
}

.msp-branding-actions .msp-file-input {
    min-width: 0;
    max-width: 220px;
}

.msp-settings-subheader h4,
.msp-settings-subheader p {
    margin: 0 0 5px;
}

.msp-settings-lineup {
    display: grid;
    gap: 9px;
    margin: 14px 0 12px;
}

.msp-settings-lineup-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(92, 82, 71, .12);
    border-radius: 13px;
    background: rgba(255, 255, 255, .78);
}

.msp-mail-toolbar,
.msp-mail-settings-heading {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.msp-mail-toolbar-actions,
.msp-mail-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.msp-mail-search {
    display: flex;
    min-width: 210px;
    max-width: 360px;
    flex: 1 1 260px;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid rgba(92, 82, 71, .14);
    border-radius: 12px;
    background: rgba(255, 255, 255, .76);
}

.msp-mail-search:focus-within {
    border-color: rgba(208, 68, 88, .4);
    box-shadow: 0 0 0 3px rgba(208, 68, 88, .08);
}

.msp-mail-search svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--msp-muted);
    stroke-width: 1.8;
    stroke-linecap: round;
}

.msp-mail-search input {
    min-width: 0;
    width: 100%;
    padding: 9px 0;
    border: 0;
    outline: 0;
    color: var(--msp-ink);
    background: transparent;
    font: inherit;
    font-size: 12px;
}

.msp-mail-icon-button {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(92, 82, 71, .16);
    border-radius: 10px;
    color: var(--msp-ink);
    background: rgba(255, 255, 255, .82);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.msp-mail-icon-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.msp-mail-icon-button:hover,
.msp-mail-icon-button:focus-visible {
    border-color: rgba(208, 68, 88, .34);
    color: var(--msp-accent);
    background: #fff;
    outline: 0;
    transform: translateY(-1px);
}

.msp-mail-icon-button-primary {
    border-color: var(--msp-accent);
    color: #fff;
    background: var(--msp-accent);
}

.msp-mail-icon-button-primary:hover,
.msp-mail-icon-button-primary:focus-visible {
    color: #fff;
    background: #bd354d;
}

.msp-mail-icon-button-danger {
    color: #a52b42;
    background: #fff4f5;
}

.msp-mail-icon-button:disabled {
    opacity: .38;
    cursor: not-allowed;
    transform: none;
}

.msp-mail-icon-button.has-label {
    width: auto;
    min-width: 0;
    gap: 7px;
    padding: 0 11px;
    font: inherit;
    font-size: 12px;
    font-weight: 750;
}

.msp-mailbox-switch {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(92, 82, 71, .14);
    border-radius: 15px;
    background: rgba(230, 225, 218, .62);
}

.msp-mailbox-switch-option {
    display: grid;
    gap: 1px;
    min-width: 0;
    padding: 9px 13px;
    border: 0;
    border-radius: 11px;
    color: var(--msp-muted);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.msp-mailbox-switch-option strong,
.msp-mailbox-switch-option small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msp-mailbox-switch-option strong {
    color: inherit;
    font-size: 13px;
}

.msp-mailbox-switch-option small {
    font-size: 11px;
}

.msp-mailbox-switch-option.is-active {
    color: var(--msp-ink);
    background: #fff;
    box-shadow: 0 2px 10px rgba(48, 41, 35, .08);
}

.msp-mail-folders {
    display: flex;
    gap: 8px;
    margin: 12px 0 8px;
}

.msp-mail-folders .is-active {
    color: #fff;
    border-color: var(--msp-accent);
    background: var(--msp-accent);
}

.msp-mail-host {
    min-height: 360px;
}

.msp-mail-layout {
    display: grid;
    grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
    min-height: 500px;
    overflow: hidden;
    border: 1px solid rgba(92, 82, 71, .14);
    border-radius: 18px;
    background: rgba(255, 255, 255, .74);
}

.msp-mail-list {
    max-height: 680px;
    overflow-y: auto;
    border-right: 1px solid rgba(92, 82, 71, .13);
    background: rgba(247, 244, 239, .72);
}

.msp-mail-list-item {
    position: relative;
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid rgba(92, 82, 71, .11);
    color: var(--msp-ink);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.msp-mail-list-item:hover,
.msp-mail-list-item.is-active {
    background: #fff;
}

.msp-mail-list-item.is-active::before {
    position: absolute;
    inset: 9px auto 9px 0;
    width: 3px;
    border-radius: 999px;
    background: var(--msp-accent);
    content: '';
}

.msp-mail-list-item.has-error {
    background: #fff7f7;
}

.msp-mail-sender {
    display: flex;
    gap: 7px;
    align-items: center;
    min-width: 0;
}

.msp-mail-sender strong,
.msp-mail-subject {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msp-mail-list-item.is-unread .msp-mail-subject,
.msp-mail-list-item.is-unread .msp-mail-sender strong {
    font-weight: 800;
}

.msp-mail-unread-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--msp-accent);
}

.msp-mail-subject {
    color: #4f4a53;
    font-size: 13px;
}

.msp-mail-date {
    color: var(--msp-muted);
    font-size: 11px;
}

.msp-mail-assignment-label {
    overflow: hidden;
    padding: 4px 7px;
    border-radius: 7px;
    color: #27724d;
    background: #e5f5ec;
    font-size: 11px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msp-mail-error-label {
    color: #9f2940;
    font-size: 11px;
    font-weight: 750;
}

.msp-mail-thread-count {
    width: fit-content;
    padding: 3px 7px;
    border-radius: 999px;
    color: #72505a;
    background: #f3e8eb;
    font-size: 10px;
    font-weight: 800;
}

.msp-mail-detail {
    min-width: 0;
    padding: 20px;
    background: rgba(255, 255, 255, .8);
}

.msp-mail-detail-header {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(92, 82, 71, .12);
}

.msp-mail-detail-header h3,
.msp-mail-detail-header p {
    margin: 0 0 7px;
}

.msp-mail-action-bar {
    margin: 12px 0;
}

.msp-mail-assignment-card {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0;
    padding: 13px 15px;
    border: 1px solid #bde3cd;
    border-radius: 13px;
    background: #edf9f2;
}

.msp-mail-assignment-card > div:first-child {
    display: grid;
    gap: 2px;
}

.msp-mail-assignment-card span {
    color: #5d7165;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.msp-mail-meta {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 12px;
    margin: 18px 0;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--msp-muted);
    background: rgba(245, 241, 236, .8);
    font-size: 12px;
}

.msp-mail-meta strong {
    overflow-wrap: anywhere;
    color: var(--msp-ink);
}

.msp-mail-body {
    max-width: 780px;
    color: #34313a;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.msp-mail-thread {
    display: grid;
    gap: 9px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(92, 82, 71, .14);
}

.msp-mail-thread > h4 {
    margin: 0 0 4px;
}

.msp-mail-thread-entry {
    overflow: hidden;
    border: 1px solid rgba(92, 82, 71, .13);
    border-radius: 12px;
    background: rgba(249, 247, 244, .74);
}

.msp-mail-thread-entry > summary {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding: 11px 13px;
    cursor: pointer;
    list-style: none;
}

.msp-mail-thread-entry > summary::-webkit-details-marker {
    display: none;
}

.msp-mail-thread-entry > summary span {
    color: var(--msp-muted);
    font-size: 11px;
}

.msp-mail-thread-content {
    padding: 0 13px 14px;
    border-top: 1px solid rgba(92, 82, 71, .1);
}

.msp-mail-delivery-state {
    display: inline-flex;
    margin: 12px 0 0;
    padding: 4px 8px;
    border-radius: 999px;
    color: #27724d;
    background: #e5f5ec;
    font-size: 11px;
    font-weight: 800;
}

.msp-mail-delivery-state.is-failed {
    color: #9f2940;
    background: #fff0f2;
}

.msp-mail-compose-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.msp-mail-compose-form {
    padding: 20px 24px 24px;
}

.msp-mail-compose-form > .msp-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.msp-mail-compose-form [name="subject"],
.msp-mail-compose-form [name="bodyText"] {
    grid-column: 1 / -1;
}

.msp-mail-compose-form textarea[name="bodyText"] {
    min-height: 260px;
    resize: vertical;
}

.msp-mail-compose-sender {
    margin: 0 0 14px;
    padding: 9px 11px;
    border-radius: 10px;
    color: var(--msp-muted);
    background: rgba(245, 241, 236, .72);
    font-size: 12px;
}

.msp-mail-compose-footer {
    margin-top: 14px;
}

.msp-mail-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(92, 82, 71, .12);
}

.msp-mail-attachments > span,
.msp-mail-attachment {
    padding: 6px 9px;
    border-radius: 9px;
    color: var(--msp-ink);
    background: #f4f0eb;
    font-size: 12px;
    text-decoration: none;
}

.msp-mail-attachment {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.msp-mail-attachment:hover,
.msp-mail-attachment:focus-visible {
    color: var(--msp-accent);
    background: #fff;
    outline: 1px solid rgba(208, 68, 88, .25);
}

.msp-mail-attachment svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.msp-mail-settings {
    display: grid;
    gap: 16px;
    margin-top: 18px;
    padding: 24px;
    border: 1px solid rgba(92, 82, 71, .16);
    border-radius: 18px;
    background: rgba(255, 255, 255, .68);
}

.msp-mail-settings-heading h3,
.msp-mail-settings-heading p {
    margin: 0 0 5px;
}

.msp-mail-settings-form {
    margin-top: 2px;
}

.msp-mail-settings-form > .msp-form-grid {
    grid-template-columns: minmax(220px, .72fr) minmax(320px, 1.28fr);
}

.msp-mail-settings-form .msp-field-wide {
    grid-column: 1 / -1;
}

.msp-mail-profile-grid textarea {
    min-height: 132px;
}

.msp-mail-connection-details {
    overflow: hidden;
    border: 1px solid rgba(92, 82, 71, .14);
    border-radius: 14px;
    background: rgba(247, 244, 239, .58);
}

.msp-mail-connection-summary {
    display: flex;
    gap: 9px;
    min-height: 48px;
    align-items: center;
    padding: 9px 13px;
    color: var(--msp-ink);
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 800;
}

.msp-mail-connection-summary::-webkit-details-marker {
    display: none;
}

.msp-mail-connection-summary > svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: var(--msp-accent);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.msp-mail-connection-summary::after {
    margin-left: 2px;
    color: var(--msp-muted);
    content: '⌄';
    transition: transform .16s ease;
}

.msp-mail-connection-details[open] .msp-mail-connection-summary::after {
    transform: rotate(180deg);
}

.msp-mail-connection-states {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-left: auto;
}

.msp-mail-connection-states i {
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
}

.msp-mail-connection-states .is-ready {
    color: #27724d;
    background: #e5f5ec;
}

.msp-mail-connection-states .is-missing {
    color: #9f2940;
    background: #fff0f2;
}

.msp-mail-connection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 4px 13px 14px;
}

.msp-mail-job-dialog {
    width: min(1040px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.msp-mail-job-form > .msp-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.msp-mail-staffing {
    margin: 18px 0 4px;
    padding: 17px;
    border: 1px solid rgba(92, 82, 71, .13);
    border-radius: 15px;
    background: rgba(248, 245, 240, .72);
}

.msp-mail-staffing h3,
.msp-mail-staffing p {
    margin: 0 0 6px;
}

.msp-mail-staffing-list {
    display: grid;
    gap: 8px;
    margin: 13px 0 10px;
}

.msp-mail-staffing-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(190px, 1.3fr) 85px auto;
    gap: 8px;
    align-items: center;
}

.msp-job-mail-history {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(92, 82, 71, .13);
}

.msp-job-mail-history h3,
.msp-job-mail-history p {
    margin: 0 0 8px;
}

.msp-job-mail-list {
    display: grid;
    gap: 8px;
    margin-top: 13px;
}

.msp-job-mail-item {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(92, 82, 71, .13);
    border-radius: 12px;
    color: var(--msp-ink);
    background: rgba(255, 255, 255, .7);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.msp-job-mail-item:hover {
    border-color: rgba(208, 68, 88, .35);
    background: #fff;
}

.msp-job-mail-item span,
.msp-job-mail-item time {
    color: var(--msp-muted);
    font-size: 12px;
}

.msp-tag-search {
    margin-bottom: 8px;
}

.msp-onboarding-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 12px;
}

.msp-onboarding-steps span {
    padding: 7px 11px;
    border-radius: 999px;
    color: #8c3244;
    background: #fae9ed;
    font-size: 13px;
    font-weight: 700;
}

.msp-profile-photo-panel,
.msp-onboarding-calendar {
    display: flex;
    gap: 18px;
    align-items: center;
    margin: 18px 0;
    padding: 18px;
    border: 1px solid var(--msp-border, #e8e1d8);
    border-radius: 16px;
    background: #fff;
}

.msp-onboarding-calendar {
    display: block;
}

.msp-profile-photo,
.msp-profile-photo-placeholder {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    border-radius: 50%;
    object-fit: cover;
}

.msp-profile-photo-placeholder {
    display: grid;
    place-items: center;
    color: #fff;
    background: #d6405c;
    font-size: 24px;
    font-weight: 800;
}

@media (max-width: 780px) {
    .msp-mail-toolbar,
    .msp-mail-settings-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .msp-mailbox-switch {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .msp-mail-search {
        width: 100%;
        max-width: none;
    }

    .msp-mail-layout {
        grid-template-columns: 1fr;
    }

    .msp-mail-list {
        max-height: 320px;
        border-right: 0;
        border-bottom: 1px solid rgba(92, 82, 71, .13);
    }

    .msp-mail-detail {
        padding: 20px;
    }

    .msp-mail-settings {
        padding: 18px;
    }

    .msp-mail-settings-form > .msp-form-grid {
        grid-template-columns: 1fr;
    }

    .msp-mail-connection-grid {
        grid-template-columns: 1fr;
    }

    .msp-mail-connection-summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .msp-mail-connection-states {
        width: 100%;
        margin-left: 27px;
    }

    .msp-mail-compose-form {
        padding: 16px;
    }

    .msp-mail-compose-form > .msp-form-grid {
        grid-template-columns: 1fr;
    }

    .msp-mail-job-form > .msp-form-grid,
    .msp-mail-staffing-row,
    .msp-job-mail-item {
        grid-template-columns: 1fr;
    }

    .msp-branding-grid {
        grid-template-columns: 1fr;
    }

    .msp-branding-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .msp-branding-actions .msp-file-input {
        width: 100%;
        max-width: none;
    }

    .msp-staffing-editor-row {
        grid-template-columns: 1fr;
    }

    .msp-profile-photo-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .msp-settings-lineup-row {
        grid-template-columns: 1fr;
    }

    .msp-settings-group {
        padding: 18px;
    }
}
