:root {
    color-scheme: light;
    --brand-50: #f2fbef;
    --brand-100: #e4f7dd;
    --brand-200: #c7edba;
    --brand-500: #4caf36;
    --brand-600: #3f942d;
    --brand-700: #337724;
    --brand-900: #1d4615;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-500: #64748b;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;
}

* {
    box-sizing: border-box;
}

.app-body {
    min-height: 100vh;
    margin: 0;
    background: var(--slate-50);
    color: var(--slate-900);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--brand-700);
    text-decoration: none;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

a:hover {
    color: var(--brand-600);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--slate-200);
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
    backdrop-filter: blur(8px);
}

.app-nav {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.app-nav-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.app-brand {
    display: flex;
    width: fit-content;
    align-items: center;
}

.app-logo {
    height: 48px;
    width: auto;
}

.app-links,
.app-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.app-links {
    gap: 8px;
}

.app-actions {
    gap: 12px;
}

.app-actions form {
    margin: 0;
}

.app-user-email {
    display: none;
    color: var(--slate-500);
    font-size: 14px;
    font-weight: 600;
}

.app-main {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 32px 20px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--slate-700);
    font-size: 14px;
    font-weight: 700;
}

.nav-link:hover {
    background: var(--brand-50);
    color: var(--brand-700);
}

h1 {
    margin: 0 0 24px;
    color: var(--slate-950);
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0;
}

h2 {
    margin: 0 0 16px;
    color: var(--slate-950);
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0;
}

h3 {
    margin: 0 0 12px;
    color: var(--slate-900);
    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: 0;
}

.button,
button {
    display: inline-flex;
    width: fit-content;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: white;
    color: var(--slate-800);
    padding: 8px 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.button:hover,
button:hover {
    border-color: var(--brand-500);
    color: var(--brand-700);
}

.button:focus,
button:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--brand-100);
}

.button-primary {
    border-color: var(--brand-500);
    background: var(--brand-500);
    color: white;
}

.button-primary:hover {
    border-color: var(--brand-600);
    background: var(--brand-600);
    color: white;
}

.danger-button {
    border-color: #fecaca;
    color: #b91c1c;
}

.danger-button:hover {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form {
    margin: 0;
}

.text-button {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--brand-700);
    font-size: 12px;
    font-weight: 700;
    box-shadow: none;
}

.danger-text {
    color: #b91c1c;
}

.danger-text:hover {
    color: #991b1b;
}

.panel,
.metric,
form.editor {
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    background: white;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.compact-panel {
    padding: 14px;
    box-shadow: none;
}

.metric {
    min-height: 112px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.status-metric {
    color: var(--slate-700);
}

.metric strong {
    display: block;
    margin-top: 8px;
    color: var(--slate-950);
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
}

.muted {
    color: var(--slate-500);
}

.status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-700);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.status.failed {
    background: #fef2f2;
    color: #b91c1c;
}

.status.queued,
.status.processing {
    background: #fffbeb;
    color: #b45309;
}

.alert {
    margin-bottom: 20px;
    border: 1px solid var(--brand-200);
    border-radius: 8px;
    background: var(--brand-50);
    color: var(--brand-900);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
}

.grid {
    display: grid;
    gap: 20px;
}

.cols-2,
.cols-4 {
    grid-template-columns: minmax(0, 1fr);
}

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

.full {
    grid-column: 1 / -1;
}

.settings-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    background: white;
    padding: 12px;
}

.check-row input {
    width: auto;
    box-shadow: none;
}

.check-row span {
    display: grid;
    gap: 2px;
}

.check-row small {
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 600;
}

.form-actions {
    margin-top: 18px;
}

.settings-card {
    max-width: 980px;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: white;
    padding: 22px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.settings-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.settings-card-header h2 {
    margin-bottom: 4px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.settings-tile {
    display: grid;
    gap: 8px;
    min-height: 132px;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: white;
    padding: 22px;
    color: var(--slate-700);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.settings-tile strong {
    color: var(--slate-950);
    font-size: 17px;
}

.settings-tile:hover {
    border-color: var(--brand-500);
    color: var(--brand-700);
}

.mapping-table {
    display: grid;
    gap: 8px;
}

.mapping-row {
    display: grid;
    grid-template-columns: minmax(220px, 34%) minmax(280px, 1fr);
    gap: 16px;
    align-items: center;
    margin: 0;
    border-bottom: 1px solid var(--slate-100);
    padding: 10px 0;
}

.mapping-row small {
    display: block;
    margin-top: 3px;
    color: var(--slate-500);
    font-size: 12px;
}

.mapping-heading {
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.field-picker {
    display: grid;
    gap: 6px;
}

.field-picker-help {
    color: var(--slate-500);
    font-size: 12px;
}

.documentation-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.documentation-nav {
    display: grid;
    gap: 6px;
}

.documentation-nav a {
    border-radius: 8px;
    padding: 9px 10px;
    color: var(--slate-700);
    font-weight: 700;
}

.documentation-nav a.active,
.documentation-nav a:hover {
    background: var(--brand-50);
    color: var(--brand-700);
}

.documentation-body {
    max-width: 980px;
}

.documentation-body h1,
.documentation-body h2,
.documentation-body h3 {
    margin-top: 22px;
}

.documentation-body h1:first-child,
.documentation-body h2:first-child,
.documentation-body h3:first-child {
    margin-top: 0;
}

.documentation-body p,
.documentation-body ul,
.documentation-body ol,
.documentation-body pre {
    margin: 12px 0;
}

.documentation-body ul,
.documentation-body ol {
    padding-left: 22px;
}

.documentation-body ul {
    list-style: disc;
}

.documentation-body ol {
    list-style: decimal;
}

.documentation-body code {
    border-radius: 5px;
    background: var(--slate-100);
    padding: 2px 5px;
}

.documentation-body pre {
    overflow: auto;
    border-radius: 10px;
    background: var(--slate-900);
    color: white;
    padding: 14px;
}

.documentation-body pre code {
    background: transparent;
    padding: 0;
}

.multi-select {
    position: relative;
}

.multi-select-control {
    width: 100%;
    justify-content: space-between;
    padding: 10px 12px;
}

.multi-select-arrow {
    color: var(--slate-500);
    font-size: 16px;
}

.multi-select-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    background: white;
    padding: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, .16);
}

.multi-select-search {
    margin-bottom: 10px;
}

.multi-select-options {
    display: grid;
    max-height: 320px;
    overflow: auto;
    gap: 4px;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    border-radius: 8px;
    padding: 9px 10px;
    cursor: pointer;
    font-weight: 600;
}

.multi-select-option:hover {
    background: var(--brand-50);
}

.multi-select-option input {
    width: auto;
    box-shadow: none;
}

.multi-select-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.multi-select-chip {
    width: auto;
    border-color: var(--brand-200);
    background: var(--brand-50);
    color: var(--brand-700);
    padding: 6px 10px;
    box-shadow: none;
}

.sequence-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
}

.template-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 36%);
    gap: 20px;
    align-items: start;
}

.template-edit-main {
    min-width: 0;
}

.template-side-panel {
    display: grid;
    gap: 16px;
}

.template-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wysiwyg-editor {
    min-height: 320px;
    overflow: auto;
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    background: white;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    outline: none;
}

.wysiwyg-editor:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px var(--brand-100);
}

.code-editor,
.sms-editor {
    min-height: 320px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    line-height: 1.55;
}

.sms-editor {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    white-space: pre-wrap;
}

.field-help {
    margin: 8px 0 0;
    color: var(--slate-500);
    font-size: 13px;
}

.variable-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variable-token {
    width: auto;
    border-color: var(--slate-200);
    background: var(--slate-50);
    color: var(--slate-700);
    padding: 6px 9px;
    font-size: 12px;
    box-shadow: none;
}

.template-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.template-preview-frame {
    width: 100%;
    min-height: 420px;
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    background: white;
}

.template-test-form {
    display: grid;
    gap: 10px;
}

.manual-message-editor {
    min-height: 176px;
}

.manual-preview-frame {
    min-height: 224px;
}

.sequence-card,
.sequence-step-editor {
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: white;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.sequence-card-header,
.sequence-card-footer,
.sequence-step-editor summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.sequence-card h2 {
    margin-bottom: 4px;
}

.sequence-step-preview,
.sequence-step-list {
    display: grid;
    gap: 10px;
}

.sequence-step-preview {
    margin-top: 14px;
}

.sequence-step-preview div {
    display: grid;
    gap: 3px;
    border-radius: 10px;
    background: var(--slate-50);
    padding: 11px 12px;
}

.sequence-step-preview span,
.sequence-step-editor summary span {
    color: var(--slate-500);
    font-size: 13px;
}

.sequence-card-footer {
    margin-top: 16px;
    align-items: center;
}

.sequence-editor-grid {
    align-items: start;
    margin-bottom: 20px;
}

.sequence-steps-panel {
    margin-top: 20px;
}

.sequence-step-editor summary {
    cursor: pointer;
    list-style: none;
}

.sequence-step-editor summary::-webkit-details-marker {
    display: none;
}

.sequence-step-editor[open] {
    border-color: var(--brand-200);
}

.sequence-step-editor form {
    margin-top: 16px;
}

.timing-row {
    display: grid;
    grid-template-columns: .8fr 1fr 1fr;
    gap: 10px;
}

table {
    width: 100%;
    border: 1px solid var(--slate-200);
    border-spacing: 0;
    border-collapse: separate;
    overflow: hidden;
    border-radius: 12px;
    background: white;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    font-size: 14px;
}

th {
    background: var(--slate-50);
    color: var(--slate-500);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

td {
    border-top: 1px solid var(--slate-100);
    color: var(--slate-700);
    padding: 12px 16px;
    vertical-align: top;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: white;
    color: var(--slate-900);
    padding: 9px 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px var(--brand-100);
}

textarea {
    min-height: 128px;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--slate-700);
    font-size: 14px;
    font-weight: 700;
}

pre {
    overflow: auto;
    border-radius: 8px;
    background: var(--slate-950);
    color: var(--slate-100);
    padding: 16px;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.nav-search {
    position: relative;
}

.nav-search[open]::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(15, 23, 42, .28);
    backdrop-filter: blur(3px);
}

.nav-search summary {
    position: relative;
    z-index: 45;
    width: 40px;
    height: 40px;
    cursor: pointer;
    list-style: none;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.nav-search summary:hover {
    border-color: var(--brand-500);
    background: var(--brand-50);
}

.nav-search summary::-webkit-details-marker {
    display: none;
}

.nav-search summary::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 10px;
    width: 13px;
    height: 13px;
    border: 2px solid var(--slate-800);
    border-radius: 50%;
}

.nav-search summary::after {
    content: "";
    position: absolute;
    left: 23px;
    top: 25px;
    width: 9px;
    height: 2px;
    background: var(--slate-800);
    transform: rotate(45deg);
}

.nav-search-panel {
    position: fixed;
    top: 96px;
    left: 50%;
    z-index: 50;
    width: min(720px, calc(100vw - 40px));
    transform: translateX(-50%);
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    background: white;
    padding: 18px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .28);
}

.nav-search-panel form {
    display: flex;
    gap: 8px;
}

.search-modal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.search-modal-heading strong {
    display: block;
    color: var(--slate-950);
    font-size: 18px;
    font-weight: 800;
}

.search-modal-heading span {
    display: block;
    margin-top: 3px;
    color: var(--slate-500);
    font-size: 14px;
}

.search-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
    font-size: 22px;
    line-height: 1;
}

.search-shake .nav-search-panel {
    animation: search-shake .24s ease-in-out;
}

@keyframes search-shake {
    0%, 100% { transform: translateX(-50%); }
    25% { transform: translateX(calc(-50% - 8px)); }
    75% { transform: translateX(calc(-50% + 8px)); }
}

.ajax-results {
    display: grid;
    max-height: 460px;
    overflow: auto;
    gap: 8px;
    margin-top: 12px;
}

.search-section {
    display: grid;
    gap: 8px;
}

.search-section + .search-section {
    margin-top: 10px;
}

.search-section h3 {
    margin: 4px 2px;
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.search-card-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 36%);
    gap: 16px;
}

.search-card-main > div,
.search-card-side {
    display: grid;
    gap: 5px;
}

.search-card-main span {
    color: var(--slate-500);
    font-size: 13px;
    line-height: 1.45;
}

.search-card-side {
    justify-items: end;
    text-align: right;
}

.search-chip {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px !important;
    font-weight: 800;
}

.search-chip.neutral {
    background: var(--slate-100);
    color: var(--slate-700);
}

.search-chip.good {
    background: var(--brand-50);
    color: var(--brand-700);
}

.search-chip.bad {
    background: #fef2f2;
    color: #b91c1c;
}

.ajax-result {
    display: block;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: white;
    color: var(--slate-800);
    padding: 12px;
}

.ajax-result:hover {
    border-color: var(--brand-500);
    background: var(--brand-50);
}

.ajax-result strong {
    display: block;
    margin-bottom: 4px;
    color: var(--slate-950);
    font-size: 14px;
    font-weight: 700;
}

.ajax-result .meta,
.ajax-empty {
    color: var(--slate-500);
    font-size: 12px;
    line-height: 1.55;
}

.ajax-empty {
    padding: 8px 4px;
}

.customer-page-heading,
.composer-heading,
.feed-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.customer-page-heading h1 {
    margin-bottom: 4px;
}

.customer-workspace {
    display: grid;
    grid-template-columns: minmax(280px, 32%) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.customer-sidebar,
.communication-workspace,
.conversation-feed,
.mini-appointment-list {
    display: grid;
    gap: 14px;
}

.customer-card,
.composer-card,
.feed-card {
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: white;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.detail-list {
    display: grid;
    gap: 13px;
    margin: 0;
}

.detail-list div {
    display: grid;
    gap: 3px;
}

.detail-list dt {
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0;
    color: var(--slate-900);
    font-size: 14px;
    line-height: 1.45;
}

.appointment-date {
    margin: 0 0 6px;
    color: var(--slate-950);
    font-size: 18px;
    font-weight: 800;
}

.mini-appointment-list a {
    display: grid;
    gap: 3px;
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    padding: 11px 12px;
    color: var(--slate-800);
}

.mini-appointment-item {
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    background: white;
}

.mini-appointment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
}

.mini-appointment-list .mini-appointment-row > a {
    border: 0;
    border-radius: 10px 0 0 10px;
    box-shadow: none;
}

.mini-appointment-list a:hover,
.mini-appointment-item:has(a:hover) {
    border-color: var(--brand-500);
    background: var(--brand-50);
}

.mini-appointment-list span {
    color: var(--slate-500);
    font-size: 13px;
}

.appointment-disclosure {
    display: contents;
}

.appointment-disclosure summary {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    cursor: pointer;
    list-style: none;
    border: 1px solid var(--slate-200);
    border-radius: 999px;
    background: white;
    color: var(--brand-700);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    margin: 8px 8px 0 0;
}

.appointment-disclosure summary::-webkit-details-marker {
    display: none;
}

.appointment-disclosure[open] summary {
    border-color: var(--brand-500);
    background: var(--brand-50);
}

.appointment-disclosure[open] summary {
    font-size: 0;
}

.appointment-disclosure[open] summary::before {
    content: "-";
    font-size: 18px;
}

.appointment-disclosure .appointment-detail-list {
    grid-column: 1 / -1;
    margin: 0 12px 12px;
    border-top: 1px solid var(--slate-100);
    padding-top: 10px;
}

.composer-heading {
    align-items: center;
}

.composer-heading h2,
.feed-heading h2 {
    margin-bottom: 4px;
}

.conversation-feed {
    border-radius: 12px;
    background: var(--slate-50);
    padding: 16px;
}

.message-bubble {
    width: min(82%, 720px);
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: white;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.message-bubble.outbound {
    justify-self: end;
    border-color: var(--brand-200);
    background: var(--brand-50);
}

.message-bubble.email-message {
    width: 100%;
    max-width: none;
    border-left: 4px solid #2563eb;
    background: #ffffff;
}

.message-bubble.sms-message {
    border-left: 4px solid var(--brand-500);
}

.message-bubble.inbound {
    justify-self: start;
}

.message-bubble h3 {
    margin: 8px 0 6px;
}

.message-bubble p {
    margin: 8px 0 0;
}

.message-body {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    word-break: break-word;
}

.email-feed-preview {
    width: 100%;
    min-height: 720px;
    margin-top: 14px;
    border: 0;
    border-radius: 12px;
    background: white;
    box-shadow: inset 0 0 0 1px #dbeafe;
}

.message-table-main {
    min-width: 320px;
    max-width: 560px;
}

.message-table-body {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.input-suffix {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border: 1px solid #d7deea;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.input-suffix input {
    border: 0;
    box-shadow: none;
}

.input-suffix span {
    padding: 0 12px;
    color: var(--slate-600);
    font-size: .9rem;
    white-space: nowrap;
}

.message-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--slate-500);
    font-size: 12px;
}

.message-meta strong {
    color: var(--slate-900);
}

.error-text {
    color: #b91c1c;
}

.table-action {
    color: var(--brand-700);
    font-size: 13px;
    font-weight: 700;
}

.appointment-detail-list {
    margin: 14px 0;
    gap: 10px;
}

.pagination-summary {
    margin-top: 18px;
    color: var(--slate-500);
    font-size: 14px;
}

nav[role="navigation"][aria-label*="Pagination"] {
    margin-top: 18px;
    color: var(--slate-700);
    font-size: 14px;
}

nav[role="navigation"][aria-label*="Pagination"] > div:first-child,
nav[role="navigation"][aria-label*="Pagination"] .sm\:hidden {
    display: none !important;
}

nav[role="navigation"][aria-label*="Pagination"] > div:last-child,
nav[role="navigation"][aria-label*="Pagination"] > .hidden {
    display: flex !important;
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

nav[role="navigation"][aria-label*="Pagination"] > .hidden > div:last-child {
    margin-left: auto;
}

nav[role="navigation"][aria-label*="Pagination"] p {
    display: none;
}

nav[role="navigation"][aria-label*="Pagination"] span.relative {
    display: inline-flex;
    gap: 4px;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

nav[role="navigation"][aria-label*="Pagination"] span.relative > a,
nav[role="navigation"][aria-label*="Pagination"] span.relative > span {
    display: inline-flex;
    min-width: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: white;
    padding: 9px 12px;
    color: var(--slate-700);
    line-height: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

nav[role="navigation"][aria-label*="Pagination"] span.relative > a:first-child,
nav[role="navigation"][aria-label*="Pagination"] span.relative > span:first-child {
    border-left: 1px solid var(--slate-200);
}

nav[role="navigation"][aria-label*="Pagination"] span.relative > a:hover {
    background: var(--brand-50);
    color: var(--brand-700);
}

nav[role="navigation"][aria-label*="Pagination"] [aria-current="page"] > span {
    background: var(--brand-500);
    color: white;
}

nav[role="navigation"][aria-label*="Pagination"] [aria-disabled="true"] {
    color: #94a3b8;
    background: var(--slate-50);
}

nav[role="navigation"][aria-label*="Pagination"] svg,
nav[role="navigation"][aria-label*="Pagination"] .w-5,
nav[role="navigation"][aria-label*="Pagination"] .h-5,
nav[role="navigation"][aria-label*="Pagination"] .w-3,
nav[role="navigation"][aria-label*="Pagination"] .h-3 {
    width: 16px !important;
    height: 16px !important;
}

nav[role="navigation"][aria-label*="Pagination"] svg {
    display: block;
    flex: none;
}

@media (min-width: 768px) {
    .app-nav,
    .app-nav-left {
        flex-direction: row;
        align-items: center;
    }

    .app-nav {
        justify-content: space-between;
    }

    .app-nav-left {
        gap: 32px;
    }

    .cols-2,
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .app-nav,
    .app-main {
        padding-left: 32px;
        padding-right: 32px;
    }

    .app-user-email {
        display: inline;
    }
}

@media (min-width: 1280px) {
    .cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .nav-search-panel {
        top: 72px;
        left: 20px;
        width: calc(100vw - 40px);
        transform: none;
    }

    @keyframes search-shake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-8px); }
        75% { transform: translateX(8px); }
    }

    .nav-search-panel form,
    .customer-page-heading,
    .composer-heading,
    .feed-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .customer-workspace {
        grid-template-columns: 1fr;
    }

    .message-bubble {
        width: 100%;
    }

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

    .mapping-row {
        grid-template-columns: 1fr;
    }

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

    .search-card-main {
        grid-template-columns: 1fr;
    }

    .search-card-side {
        justify-items: start;
        text-align: left;
    }
}
