.mailTestResponse {
    margin: 0;
    max-height: 18rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
:root {
    --page: #f5f7f7;
    --surface: #ffffff;
    --surfaceSoft: #f8faf9;
    --surfaceMuted: #eef2f0;
    --ink: #182621;
    --inkSoft: #596b64;
    --inkFaint: #84938d;
    --line: #dfe6e2;
    --lineStrong: #cbd6d0;
    --brand: #174f42;
    --brandDark: #123c33;
    --brandSoft: #e3f0eb;
    --success: #18794e;
    --successSoft: #e5f6ed;
    --warning: #9a5b12;
    --warningSoft: #fff4dc;
    --danger: #b42318;
    --dangerSoft: #fdebea;
    --purple: #6c4ab6;
    --purpleSoft: #f0ebfb;
    --blue: #2764d9;
    --blueSoft: #e9f0ff;
    --orange: #b85c16;
    --orangeSoft: #fff0e2;
    --slate: #52626d;
    --slateSoft: #edf1f3;
    --shadowSm: 0 1px 2px rgba(17, 37, 30, .05), 0 3px 10px rgba(17, 37, 30, .04);
    --shadowMd: 0 12px 32px rgba(17, 37, 30, .10);
    --radiusSm: 8px;
    --radiusMd: 12px;
    --radiusLg: 18px;
    --sidebarWidth: 238px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--page);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea,
summary {
    outline-color: rgba(23, 79, 66, .35);
}

.appShell {
    min-height: 100vh;
}

.sidebarStateToggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebarWidth);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #214f45;
    background: #143f35;
    color: #dce8e3;
    transition: width .2s ease, transform .2s ease;
}

.brandRow {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brandLink {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -.02em;
    color: #ffffff;
}

.brandMark {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    background: #e6f3ee;
    color: var(--brandDark);
    font-size: 18px;
    font-weight: 850;
}

.brandText {
    white-space: nowrap;
}

.brandActions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mainNav {
    flex: 1;
    padding: 16px 10px;
    overflow-y: auto;
}

.navSectionLabel {
    padding: 17px 11px 7px;
    color: #86a99f;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.navItem {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0;
    padding: 0 11px;
    border-radius: 8px;
    color: #c8dbd4;
    font-weight: 580;
    transition: background-color .16s ease, color .16s ease;
}

.navItem:hover {
    background: rgba(255, 255, 255, .08);
    color: #ffffff;
}

.navItem.active {
    background: #286456;
    color: #ffffff;
}

.navIcon {
    width: 21px;
    display: inline-grid;
    place-items: center;
    color: #a9c5bb;
    font-size: 16px;
}

.navItem.active .navIcon {
    color: #ffffff;
}

.sidebarStateToggle:checked ~ .sidebar .brandRow,
.sidebarPreferenceCollapsed .sidebar .brandRow {
    padding-inline: 12px;
}

.sidebarStateToggle:checked ~ .sidebar .brandText,
.sidebarStateToggle:checked ~ .sidebar .navSectionLabel,
.sidebarStateToggle:checked ~ .sidebar .navItem > span:not(.navIcon),
.sidebarStateToggle:checked ~ .sidebar .sidebarFooter > div,
.sidebarPreferenceCollapsed .sidebar .brandText,
.sidebarPreferenceCollapsed .sidebar .navSectionLabel,
.sidebarPreferenceCollapsed .sidebar .navItem > span:not(.navIcon),
.sidebarPreferenceCollapsed .sidebar .sidebarFooter > div {
    display: none;
}

.sidebarStateToggle:checked ~ .sidebar .brandLink,
.sidebarStateToggle:checked ~ .sidebar .navItem,
.sidebarStateToggle:checked ~ .sidebar .sidebarFooter,
.sidebarPreferenceCollapsed .sidebar .brandLink,
.sidebarPreferenceCollapsed .sidebar .navItem,
.sidebarPreferenceCollapsed .sidebar .sidebarFooter {
    justify-content: center;
}

.sidebarStateToggle:checked ~ .sidebar .navItem,
.sidebarPreferenceCollapsed .sidebar .navItem {
    gap: 0;
    padding-inline: 0;
}

.sidebarStateToggle:checked ~ .sidebar .sidebarFooter,
.sidebarPreferenceCollapsed .sidebar .sidebarFooter {
    padding-inline: 0;
}

.sidebarStateToggle:checked ~ .sidebar .mainNav,
.sidebarPreferenceCollapsed .sidebar .mainNav {
    padding-inline: 8px;
}

.sidebarStateToggle:checked ~ .sidebar,
.sidebarPreferenceCollapsed .sidebar {
    width: 84px;
}

.sidebarHoverLabel {
    position: fixed;
    z-index: 80;
    padding: 7px 10px;
    border: 1px solid rgba(20, 63, 53, .16);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadowSm);
    color: var(--ink);
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(-6px);
    transition: opacity .16s ease, transform .16s ease;
    white-space: nowrap;
}

.sidebarHoverLabel.isVisible {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.sidebarFooter {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 12px;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
}

.sidebarFooter strong,
.sidebarFooter small {
    display: block;
}

.sidebarFooter strong {
    color: #f2f7f5;
    font-size: 12px;
}

.sidebarFooter small {
    max-width: 150px;
    margin-top: 2px;
    overflow: hidden;
    color: #9dbbb1;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.onlineDot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #4bd08a;
    box-shadow: 0 0 0 4px rgba(75, 208, 138, .12);
}

.mainArea {
    min-height: 100vh;
    margin-left: var(--sidebarWidth);
    transition: margin-left .2s ease;
}

.sidebarStateToggle:checked ~ .mainArea,
.sidebarPreferenceCollapsed .mainArea {
    margin-left: 84px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
}

.topbarLeft,
.topbarRight,
.pageHeader,
.pageActions,
.inlineActions,
.metaRow,
.ticketMeta,
.filterActions,
.cardHeaderRow,
.timelineHeader,
.sectionHeader,
.taskTitleRow,
.contactIdentity,
.metricTop {
    display: flex;
    align-items: center;
}

.topbarLeft {
    gap: 10px;
}

.topbarRight {
    gap: 12px;
}

.eyebrow {
    color: var(--inkFaint);
    font-size: 10px;
    font-weight: 780;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.topbar h1 {
    margin: 1px 0 0;
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.iconButton {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.sidebarClose,
.sidebarToggle,
.mobileMenuButton {
    display: none;
}

.sidebarToggle {
    color: #ffffff;
}

.sidebarStateToggle:checked ~ .sidebar .sidebarToggle,
.sidebarPreferenceCollapsed .sidebar .sidebarToggle {
    transform: rotate(180deg);
}

.sidebarToggle:hover {
    background: rgba(255, 255, 255, .08);
}

@media (min-width: 921px) {
    .sidebarToggle {
        display: inline-grid;
    }
}

.globalSearch {
    min-width: 280px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid var(--lineStrong);
    border-radius: 9px;
    background: #ffffff;
    color: var(--inkFaint);
}

.globalSearch:focus-within {
    border-color: #6a9d90;
    box-shadow: 0 0 0 3px rgba(23, 79, 66, .08);
}

.globalSearch input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--ink);
    outline: 0;
}

.contentArea {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 28px;
}

.pageHeader {
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.pageHeader h2 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -.035em;
}

.pageHeader p {
    max-width: 760px;
    margin: 6px 0 0;
    color: var(--inkSoft);
}

.pageActions,
.inlineActions,
.filterActions {
    flex-wrap: wrap;
    gap: 8px;
}

.button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border: 1px solid var(--lineStrong);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font-weight: 690;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background-color .12s ease;
}

.button:hover {
    border-color: #9aaca4;
    box-shadow: var(--shadowSm);
}

.button:active {
    transform: translateY(1px);
}

.buttonPrimary {
    border-color: var(--brand);
    background: var(--brand);
    color: #ffffff;
}

.buttonPrimary:hover {
    border-color: var(--brandDark);
    background: var(--brandDark);
}

.buttonDanger {
    border-color: #efc4c1;
    background: #fffafa;
    color: var(--danger);
}

.buttonSmall {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.buttonLink {
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--brand);
}

.flashMessage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #ffffff;
    box-shadow: var(--shadowSm);
}

.flashMessage button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.flash-success {
    border-color: #badfc9;
    background: var(--successSoft);
    color: #155d3c;
}

.flash-error {
    border-color: #efc5c1;
    background: var(--dangerSoft);
    color: #8d2018;
}

.metricGrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.metricCard,
.panel,
.dataCard,
.formCard,
.ticketCard,
.kanbanColumn,
.emptyState {
    border: 1px solid var(--line);
    border-radius: var(--radiusMd);
    background: var(--surface);
    box-shadow: var(--shadowSm);
}

.metricCard {
    min-height: 128px;
    padding: 17px;
}

.metricTop {
    justify-content: space-between;
    gap: 12px;
}

.metricLabel {
    color: var(--inkSoft);
    font-size: 12px;
    font-weight: 680;
}

.metricIcon {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    background: var(--brandSoft);
    color: var(--brand);
    font-weight: 800;
}

.metricValue {
    margin-top: 15px;
    font-size: 28px;
    font-weight: 780;
    letter-spacing: -.04em;
}

.metricNote {
    margin-top: 3px;
    color: var(--inkFaint);
    font-size: 11px;
}

.dashboardGrid,
.twoColumnGrid,
.ticketLayout {
    display: grid;
    gap: 18px;
}

.dashboardGrid {
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr);
}

.twoColumnGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ticketLayout {
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
}

.panel,
.formCard {
    overflow: hidden;
}

.panelHeader,
.panelBody,
.formCardHeader,
.formCardBody {
    padding: 16px 18px;
}

.panelHeader,
.formCardHeader {
    border-bottom: 1px solid var(--line);
}

.panelHeader h3,
.formCardHeader h3,
.sectionHeader h3 {
    margin: 0;
    font-size: 15px;
    letter-spacing: -.02em;
}

.panelHeader p,
.formCardHeader p {
    margin: 4px 0 0;
    color: var(--inkSoft);
    font-size: 12px;
}

.panelBody.noPadding {
    padding: 0;
}

.dataTableWrap {
    overflow-x: auto;
}

.dataTable {
    width: 100%;
    border-collapse: collapse;
}

.dataTable th,
.dataTable td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.dataTable th {
    background: var(--surfaceSoft);
    color: var(--inkSoft);
    font-size: 10px;
    font-weight: 780;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.dataTable tr:last-child td {
    border-bottom: 0;
}

.dataTable tbody tr:hover {
    background: #fbfcfc;
}

.tablePrimary {
    min-width: 230px;
}

.tablePrimary strong,
.tablePrimary small {
    display: block;
}

.tablePrimary small {
    margin-top: 2px;
    color: var(--inkFaint);
}

.ticketTitleInline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mutedText {
    color: var(--inkSoft);
}

.faintText {
    color: var(--inkFaint);
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-variant-numeric: tabular-nums;
}

.statusBadge,
.priorityBadge,
.typeBadge,
.softBadge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 720;
    line-height: 1;
    white-space: nowrap;
}

.statusBadge,
.priorityBadge,
.typeBadge {
    padding: 6px 8px;
}

.softBadge {
    padding: 5px 7px;
    background: var(--surfaceMuted);
    color: var(--inkSoft);
}

.customerUpdateIndicator {
    width: 9px;
    height: 9px;
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 0 3px var(--orangeSoft);
    vertical-align: middle;
}

.customerUpdateBadge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--orangeSoft);
    color: var(--orange);
    font-size: 11px;
    font-weight: 720;
    line-height: 1;
    white-space: nowrap;
}

.status-open {
    background: var(--blueSoft);
    color: #2457b7;
}

.status-in_progress {
    background: var(--purpleSoft);
    color: #6546a7;
}

.status-waiting_for_customer {
    background: var(--warningSoft);
    color: #855014;
}

.status-finished {
    background: var(--successSoft);
    color: #156443;
}

.priority-low {
    background: var(--slateSoft);
    color: var(--slate);
}

.priority-normal {
    background: var(--blueSoft);
    color: var(--blue);
}

.priority-high {
    background: var(--orangeSoft);
    color: var(--orange);
}

.priority-urgent {
    background: var(--dangerSoft);
    color: var(--danger);
}

.type-blue { background: var(--blueSoft); color: var(--blue); }
.type-purple { background: var(--purpleSoft); color: var(--purple); }
.type-green { background: var(--successSoft); color: var(--success); }
.type-orange { background: var(--orangeSoft); color: var(--orange); }
.type-red { background: var(--dangerSoft); color: var(--danger); }
.type-slate { background: var(--slateSoft); color: var(--slate); }

.filterBar {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(140px, .7fr)) auto;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radiusMd);
    background: #ffffff;
    box-shadow: var(--shadowSm);
}

.filterBar.compact {
    grid-template-columns: repeat(3, minmax(170px, 1fr)) auto;
}

.filterBar.contactDirectoryFilter {
    grid-template-columns: minmax(0, 1fr) auto;
}

.filterBar > .filterActions {
    min-height: 40px;
    align-self: end;
}

.field,
.fieldGroup {
    min-width: 0;
}

.field label,
.fieldGroup > label {
    display: block;
    margin-bottom: 6px;
    color: var(--inkSoft);
    font-size: 11px;
    font-weight: 720;
}

.input,
.select,
.textarea {
    width: 100%;
    border: 1px solid var(--lineStrong);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    transition: border-color .14s ease, box-shadow .14s ease;
}

.input,
.select {
    min-height: 40px;
    padding: 0 11px;
}

.textarea {
    min-height: 112px;
    padding: 10px 11px;
    resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: #6a9d90;
    box-shadow: 0 0 0 3px rgba(23, 79, 66, .08);
    outline: 0;
}

.formGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.formGrid .fullWidth {
    grid-column: 1 / -1;
}

.formActions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.checkboxRow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--inkSoft);
}

.contactEmailField {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
}

.contactSelectControl {
    flex: 1;
    min-width: 0;
}

.contactEmailField .mailToggleButton {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    align-self: flex-end;
    width: 40px;
    height: 40px;
    min-height: 40px;
    place-items: center;
    padding: 0;
    border: 1px solid #efc4c1;
    border-radius: var(--radiusSm);
    background: var(--dangerSoft);
    color: var(--danger);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.mailToggleButton input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.mailToggleButton:has(input:checked) {
    border-color: rgba(24, 121, 78, .3);
    background: var(--successSoft);
    color: var(--success);
}

.mailToggleButton:focus-within {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.mailToggleIcon {
    font-size: 22px;
    line-height: 1;
}

.checkboxRow input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

.emptyState {
    padding: 44px 24px;
    text-align: center;
}

.emptyIcon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    border-radius: 14px;
    background: var(--brandSoft);
    color: var(--brand);
    font-size: 22px;
}

.emptyState h3 {
    margin: 0;
    font-size: 16px;
}

.emptyState p {
    max-width: 480px;
    margin: 6px auto 16px;
    color: var(--inkSoft);
}

.companyGrid,
.projectGrid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dataCard {
    position: relative;
    padding: 17px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.dataCard:hover {
    transform: translateY(-1px);
    border-color: #bac9c2;
    box-shadow: var(--shadowMd);
}

.cardHeaderRow,
.sectionHeader {
    justify-content: space-between;
    gap: 12px;
}

.cardTitle {
    margin: 0;
    font-size: 15px;
    font-weight: 750;
    letter-spacing: -.02em;
}

.cardMeta {
    display: grid;
    gap: 7px;
    margin-top: 14px;
    color: var(--inkSoft);
    font-size: 12px;
}

.cardFooter {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--inkFaint);
    font-size: 11px;
}

.initialAvatar {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    background: var(--brandSoft);
    color: var(--brand);
    font-weight: 800;
    text-transform: uppercase;
}

.contactIdentity {
    gap: 10px;
}

.contactIdentity strong,
.contactIdentity small {
    display: block;
}

.contactIdentity small {
    color: var(--inkFaint);
}

.detailsBox {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surfaceSoft);
}

.detailsBox summary {
    padding: 10px 12px;
    cursor: pointer;
    color: var(--inkSoft);
    font-weight: 680;
}

.detailsBox[open] summary {
    border-bottom: 1px solid var(--line);
}

.detailsBody {
    padding: 12px;
}

.contactDirectoryList,
.contactSearchResults {
    display: grid;
    gap: 12px;
}

.contactDirectoryEntry {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.contactDirectoryEntry .cardHeaderRow {
    align-items: flex-start;
}

.contactDirectoryEntry .contactIdentity,
.contactDirectoryEntry .contactIdentity > div {
    min-width: 0;
}

.contactDirectoryEntry .contactIdentity strong,
.contactDirectoryEntry .contactIdentity small,
.contactDirectoryDetails {
    overflow-wrap: anywhere;
}

.contactDirectoryEntry .contactIdentity small {
    margin-top: 3px;
    color: var(--inkSoft);
}

.contactDirectoryEntry .softBadge {
    flex: 0 0 auto;
}

.contactDirectoryDetails {
    margin-bottom: 16px;
}

.contactDirectoryEntry .cardFooter {
    justify-content: flex-end;
    margin-top: auto;
}

.contactForm .formActions {
    flex-wrap: wrap;
}

.searchableSelect {
    position: relative;
    min-width: 0;
}

.searchableSelect::after {
    position: absolute;
    top: 13px;
    right: 14px;
    color: var(--inkSoft);
    content: '⌄';
    pointer-events: none;
}

.searchableSelectInput {
    padding-right: 36px;
}

.searchableSelectOptions {
    position: absolute;
    z-index: 50;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 250px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    box-shadow: var(--shadowMd);
}

.searchableSelectOption,
.searchableSelectEmpty {
    padding: 9px 10px;
    border-radius: 6px;
    overflow-wrap: anywhere;
}

.searchableSelectOption {
    cursor: pointer;
}

.searchableSelectOption:hover,
.searchableSelectOption.isActive,
.searchableSelectOption[aria-selected="true"] {
    color: var(--brand);
    background: var(--brandSoft);
}

.searchableSelectEmpty {
    color: var(--inkSoft);
}

.contactSearchBlock {
    display: grid;
    gap: 12px;
}

.contactSearchResult {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
}

.contactSearchMeta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 12px;
    color: var(--inkSoft);
    font-size: 12px;
}

.contactSearchAction {
    flex: 0 0 auto;
}

.contactSearchHint {
    margin: 0;
    color: var(--inkSoft);
    font-size: 12px;
}

.metaList {
    display: grid;
    gap: 0;
}

.metaListRow {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.metaListRow:last-child {
    border-bottom: 0;
}

.metaListRow dt {
    color: var(--inkFaint);
    font-size: 11px;
    font-weight: 720;
}

.metaListRow dd {
    min-width: 0;
    margin: 0;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.taskTitleRow {
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ticketId {
    margin-bottom: 4px;
    color: var(--inkFaint);
    font-size: 12px;
    font-weight: 720;
}

.ticketTitle {
    margin: 0;
    font-size: 22px;
    letter-spacing: -.035em;
}

.ticketMeta {
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.customerUpdateNotice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid #efc493;
    border-radius: var(--radiusMd);
    background: var(--orangeSoft);
    color: #7d4215;
    box-shadow: var(--shadowSm);
}

.customerUpdateNotice strong,
.customerUpdateNotice span {
    display: block;
}

.customerUpdateNotice span {
    margin-top: 3px;
    font-size: 12px;
}

.ticketCard {
    overflow: hidden;
}

.ticketCard + .ticketCard {
    margin-top: 14px;
}

.ticketCardHeader,
.ticketCardBody {
    padding: 16px;
}

.ticketCardHeader {
    border-bottom: 1px solid var(--line);
    background: var(--surfaceSoft);
}

.ticketCardHeader h3 {
    margin: 0;
    font-size: 13px;
}

.systemHistorySummary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

.systemHistorySummary strong,
.systemHistorySummary small {
    display: block;
}

.systemHistorySummary strong {
    font-size: 13px;
}

.systemHistorySummary small {
    margin-top: 4px;
    color: var(--inkSoft);
    font-size: 12px;
    font-weight: 400;
}

.systemHistorySummary::after {
    content: "Show ↓";
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.systemHistoryPanel[open] .systemHistorySummary {
    border-bottom: 1px solid var(--line);
}

.systemHistoryPanel[open] .systemHistorySummary::after {
    content: "Hide ↑";
}

.timeline {
    position: relative;
}

.timelineItem {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    padding: 0 0 18px;
}

.timelineItem:last-child {
    padding-bottom: 0;
}

.timelineItem:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 36px;
    bottom: 2px;
    width: 1px;
    background: var(--line);
}

.timelineAvatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--surfaceMuted);
    color: var(--inkSoft);
    font-weight: 800;
}

.timelineItem.inbound .timelineAvatar {
    background: var(--blueSoft);
    color: var(--blue);
}

.timelineItem.outbound .timelineAvatar {
    background: var(--brandSoft);
    color: var(--brand);
}

.timelineContent {
    min-width: 0;
    padding: 1px 0;
}

.timelineHeader {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.timelineHeader strong {
    font-size: 12px;
}

.timelineHeader span {
    color: var(--inkFaint);
    font-size: 11px;
}

[data-public-recipient-field][hidden],
[data-public-email-hint][hidden] {
    display: none;
}

.conversationHeader {
    flex-wrap: wrap;
}

.conversationHeader strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.conversationHeader form {
    margin-left: auto;
}

.messageBubble {
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 0 10px 10px 10px;
    background: #ffffff;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.messageBubble p,
.messageBubble ul,
.messageBubble ol {
    margin: 0;
}

.messageBubble p + p,
.messageBubble p + ul,
.messageBubble p + ol,
.messageBubble ul + p,
.messageBubble ol + p,
.messageBubble ul + ol,
.messageBubble ol + ul {
    margin-top: 10px;
}

.messageBubble ul,
.messageBubble ol {
    padding-left: 22px;
}

.messageBubble li + li {
    margin-top: 0;
}

.messageBubble a {
    color: var(--brand);
    font-weight: 640;
    text-decoration-color: rgba(23, 79, 66, .34);
}

.messageBubble.internal {
    border-color: #e9d7ab;
    background: #fffaed;
}

.messageMeta {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    color: var(--inkFaint);
    font-size: 10px;
}

.stickySide {
    position: sticky;
    top: 92px;
}

.workTimeValue {
    margin: 2px 0 0;
    font-size: 26px;
    font-weight: 780;
    letter-spacing: -.04em;
}

.workLogList {
    display: grid;
    gap: 9px;
    max-height: 480px;
    margin-top: 12px;
    overflow-y: auto;
    padding-right: 3px;
}

.workLogItem {
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.workLogItem strong,
.workLogItem small {
    display: block;
}

.workLogItem small {
    margin-top: 2px;
    color: var(--inkFaint);
    overflow-wrap: anywhere;
}

.workLogActions {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.workLogActions .workLogEdit {
    flex: 1 1 120px;
    margin-top: 0;
}

.workLogActions .workLogEdit[open] {
    flex-basis: 100%;
}

.workLogEdit summary {
    padding: 7px 10px;
    font-size: 12px;
}

.workLogActions .formActions {
    margin-top: 10px;
}

.kanbanToolbar {
    margin-bottom: 14px;
}

.kanbanBoard {
    display: grid;
    grid-template-columns: repeat(4, minmax(280px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.kanbanColumn {
    min-height: 520px;
    overflow: hidden;
    background: #f7f9f8;
    box-shadow: none;
    transition: background-color .15s ease, border-color .15s ease;
}

.kanbanColumn.dragOver {
    border-color: #7aa99b;
    background: #edf5f2;
}

.kanbanColumnHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.kanbanColumnHeader strong {
    font-size: 12px;
}

.kanbanCount {
    min-width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--surfaceMuted);
    color: var(--inkSoft);
    font-size: 11px;
    font-weight: 760;
}

.kanbanCardList {
    display: grid;
    align-content: start;
    gap: 9px;
    min-height: 460px;
    padding: 10px;
}

.kanbanCard {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: var(--shadowSm);
    cursor: grab;
}

.kanbanCard.dragging {
    opacity: .45;
}

.kanbanCard:active {
    cursor: grabbing;
}

.kanbanCardTop {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.kanbanId {
    color: var(--inkFaint);
    font-size: 10px;
    font-weight: 760;
}

.kanbanId .customerUpdateIndicator {
    margin-left: 7px;
}

.kanbanTitle {
    margin: 0;
    font-size: 13px;
    font-weight: 730;
    line-height: 1.35;
}

.kanbanCardMeta {
    display: grid;
    gap: 4px;
    margin-top: 11px;
    color: var(--inkSoft);
    font-size: 11px;
}

.kanbanCardFooter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 9px;
    border-top: 1px solid var(--line);
}

.reportSummary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.summaryCard {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
}

.summaryCard span,
.summaryCard strong {
    display: block;
}

.summaryCard span {
    color: var(--inkFaint);
    font-size: 11px;
}

.summaryCard strong {
    margin-top: 4px;
    font-size: 20px;
}

.colorDot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
}

.colorDot.blue { background: var(--blue); }
.colorDot.purple { background: var(--purple); }
.colorDot.green { background: var(--success); }
.colorDot.orange { background: var(--orange); }
.colorDot.red { background: var(--danger); }
.colorDot.slate { background: var(--slate); }

@media (max-width: 1180px) {
    .metricGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .companyGrid,
    .projectGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filterBar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ticketLayout {
        grid-template-columns: minmax(0, 1fr) 290px;
    }
}

@media (max-width: 920px) {
    .sidebarHoverLabel {
        display: none;
    }

    .sidebar {
        transform: translateX(-101%);
        box-shadow: var(--shadowMd);
    }

    .sidebarOpen .sidebar {
        transform: translateX(0);
    }

    .mainArea {
        margin-left: 0;
    }

    .mobileMenuButton,
    .sidebarClose {
        display: inline-grid;
    }

    .sidebarToggle,
    .sidebarStateToggle:checked ~ .sidebar .brandText,
    .sidebarStateToggle:checked ~ .sidebar .navSectionLabel,
    .sidebarStateToggle:checked ~ .sidebar .navItem > span:not(.navIcon),
    .sidebarStateToggle:checked ~ .sidebar .sidebarFooter > div,
    .sidebarPreferenceCollapsed .sidebar .brandText,
    .sidebarPreferenceCollapsed .sidebar .navSectionLabel,
    .sidebarPreferenceCollapsed .sidebar .navItem > span:not(.navIcon),
    .sidebarPreferenceCollapsed .sidebar .sidebarFooter > div {
        display: revert;
    }

    .sidebarStateToggle:checked ~ .sidebar .brandLink,
    .sidebarStateToggle:checked ~ .sidebar .navItem,
    .sidebarStateToggle:checked ~ .sidebar .sidebarFooter,
    .sidebarPreferenceCollapsed .sidebar .brandLink,
    .sidebarPreferenceCollapsed .sidebar .navItem,
    .sidebarPreferenceCollapsed .sidebar .sidebarFooter {
        justify-content: initial;
    }

    .sidebarStateToggle:checked ~ .sidebar .navItem,
    .sidebarPreferenceCollapsed .sidebar .navItem {
        gap: 10px;
        padding-inline: 11px;
    }

    .sidebarStateToggle:checked ~ .sidebar .sidebarFooter,
    .sidebarPreferenceCollapsed .sidebar .sidebarFooter {
        padding-inline: 13px;
    }

    .sidebarStateToggle:checked ~ .sidebar .mainNav,
    .sidebarPreferenceCollapsed .sidebar .mainNav {
        padding-inline: 10px;
    }

    .sidebarStateToggle:checked ~ .sidebar,
    .sidebarPreferenceCollapsed .sidebar {
        width: var(--sidebarWidth);
    }

    .sidebarStateToggle:checked ~ .mainArea,
    .sidebarPreferenceCollapsed .mainArea {
        margin-left: 0;
    }

    .sidebarClose {
        color: #ffffff;
    }

    .topbar {
        padding-inline: 18px;
    }

    .contentArea {
        padding: 20px 18px;
    }

    .globalSearch {
        min-width: 220px;
    }

    .dashboardGrid,
    .ticketLayout,
    .twoColumnGrid {
        grid-template-columns: 1fr;
    }

    .stickySide {
        position: static;
    }
}

@media (max-width: 680px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding-block: 10px;
    }

    .topbarRight {
        width: 100%;
    }

    .globalSearch {
        min-width: 0;
        flex: 1;
    }

    .contentArea {
        padding: 16px 12px 24px;
    }

    .pageHeader {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .metricGrid,
    .companyGrid,
    .projectGrid,
    .formGrid,
    .reportSummary,
    .filterBar,
    .filterBar.compact,
    .filterBar.contactDirectoryFilter {
        grid-template-columns: 1fr;
    }

    .pageActions {
        width: 100%;
    }

    .pageActions .button {
        flex: 1;
    }

    .customerUpdateNotice {
        align-items: flex-start;
        flex-direction: column;
    }

    .customerUpdateNotice form,
    .customerUpdateNotice .button {
        width: 100%;
    }

    .metaListRow {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .buttonPrimary.topbarButton {
        display: none;
    }
}

/* Authentication and customer-facing pages share the same design tokens. */
.guestPage {
    min-height: 100vh;
    background: var(--page);
}

.authShell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, .92fr);
    min-height: 100vh;
}

.authBrandPanel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px clamp(30px, 5vw, 84px);
    color: #ffffff;
    background: radial-gradient(ellipse at 15% 90%, #297362 0, transparent 60%), var(--brandDark);
    overflow: hidden;
}

.authBrandPanel .brandLink {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    color: #ffffff;
    font-size: 21px;
    font-weight: 750;
    text-decoration: none;
}

.authBrandPanel .brandMark {
    color: #ffffff;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .18);
}

.authBrandContent {
    max-width: 540px;
    padding-block: 64px;
}

.authEyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 24px;
    color: #bfddd2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
}

.authBrandContent h1 {
    margin: 0 0 22px;
    color: #ffffff;
    font-size: clamp(38px, 4.3vw, 66px);
    font-weight: 650;
    line-height: 1.1;
    letter-spacing: -.045em;
}

.authBrandContent > p {
    max-width: 410px;
    color: #c7dfd6;
    font-size: 16px;
    line-height: 1.8;
}

.authPreview {
    margin-top: 44px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: var(--radiusLg);
    background: rgba(255, 255, 255, .075);
    box-shadow: 0 22px 48px rgba(0, 0, 0, .08);
}

.authPreviewTop,
.authPreviewBottom {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #d4e7df;
    font-size: 11px;
}

.authPreviewDot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a3dfc1;
}

.authPreviewTag {
    margin-left: auto;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 20px;
    font-size: 10px;
}

.authPreviewTicket {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-block: 22px;
    padding: 18px;
    border-radius: var(--radiusMd);
    color: var(--ink);
    background: #ffffff;
}

.authPreviewTicket strong,
.authPreviewTicket small {
    display: block;
}

.authPreviewTicket strong {
    font-size: 13px;
}

.authPreviewTicket small {
    margin-top: 5px;
    color: var(--inkSoft);
    font-size: 11px;
    line-height: 1.6;
}

.authPreviewIcon {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brandSoft);
    color: var(--brand);
    font-size: 19px;
}

.authPreviewBottom {
    justify-content: space-between;
    gap: 12px;
}

.authBrandFooter {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: #b5d2c7;
    font-size: 11px;
}

.authFormPanel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--surface);
}

.authFormWrap {
    width: 100%;
    max-width: 410px;
}

.authHeading {
    margin-bottom: 30px;
}

.authHeading h1,
.authHeading h2 {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.035em;
}

.authHeading p {
    margin: 0;
    color: var(--inkSoft);
    font-size: 14px;
    line-height: 1.7;
}

.authMobileBrand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 42px;
}

.authSubmit {
    width: 100%;
    min-height: 46px;
    margin-top: 6px;
}

.authSwitch {
    margin-top: 24px;
    color: var(--inkSoft);
    text-align: center;
    font-size: 13px;
}

.authSwitch a {
    color: var(--brand);
    font-weight: 700;
}

.authTrustNote {
    margin-top: 38px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--inkSoft);
    font-size: 11px;
    line-height: 1.7;
    text-align: center;
}

.authNote,
.infoNote {
    padding: 12px 14px;
    border: 1px solid #cfe1d9;
    border-radius: var(--radiusSm);
    background: var(--brandSoft);
    color: var(--brandDark);
    font-size: 12px;
    line-height: 1.7;
}

.authForm,
.stackFields {
    display: grid;
    gap: 18px;
}

.fieldHint,
.blockHint {
    color: var(--inkSoft);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.6;
}

.blockHint {
    display: block;
    margin: 12px 0;
}

.field input:disabled,
.field select:disabled {
    color: var(--inkSoft);
    background: var(--surfaceMuted);
    cursor: not-allowed;
    opacity: 1;
}

.sectionSpacing {
    margin-block: 20px;
}

.sectionTopSpacing {
    margin-top: 20px;
}

.multiSelect {
    min-height: 160px;
}

.multiSelect option {
    padding: 7px 9px;
    border-radius: 4px;
}

.settingsForm {
    display: grid;
    gap: 20px;
}

.subjectComposer {
    display: flex;
    align-items: stretch;
    min-width: 0;
}

.systemSubjectPrefix {
    display: grid;
    align-items: center;
    flex: 0 0 auto;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: var(--radiusSm) 0 0 var(--radiusSm);
    color: var(--inkSoft);
    background: var(--surfaceMuted);
    font-family: ui-monospace, monospace;
    font-size: 12px;
}

.subjectComposer input {
    min-width: 0;
    border-radius: 0 var(--radiusSm) var(--radiusSm) 0;
}

.templateEditor {
    min-height: 210px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
    line-height: 1.8;
}

.macroManagementGrid {
    align-items: start;
}

.macroCard {
    margin-bottom: 12px;
    box-shadow: none;
}

.macroCard:last-child {
    margin-bottom: 0;
}

.macroTemplateEditor {
    min-height: 170px;
}

.macroShortcutField {
    display: flex;
    align-items: center;
}

.macroShortcutField span {
    min-height: 40px;
    display: grid;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: var(--radiusSm) 0 0 var(--radiusSm);
    background: var(--surfaceMuted);
    color: var(--inkSoft);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
}

.macroShortcutField .input {
    border-radius: 0 var(--radiusSm) var(--radiusSm) 0;
}

.macroEditorField {
    position: relative;
}

.macroMenu {
    position: absolute;
    right: 0;
    left: 0;
    top: calc(100% + 8px);
    z-index: 15;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radiusMd);
    background: #ffffff;
    box-shadow: var(--shadowMd);
}

.macroMenu[hidden] {
    display: none;
}

.macroMenuList {
    display: grid;
    gap: 6px;
}

.macroMenuItem {
    width: 100%;
    display: grid;
    gap: 4px;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.macroMenuItem:hover,
.macroMenuItem.active {
    border-color: rgba(23, 79, 66, .14);
    background: rgba(23, 79, 66, .06);
}

.macroMenuTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.macroMenuName {
    font-weight: 700;
}

.macroMenuShortcut {
    color: var(--brand);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
}

.macroMenuPreview {
    color: var(--inkSoft);
    font-size: 12px;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compactEmptyState {
    padding: 32px 18px;
}

.richTextToolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfcfb 0%, #f4f7f5 100%);
}

.richTextButton {
    min-width: 36px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border: 1px solid var(--lineStrong);
    border-radius: 9px;
    background: #ffffff;
    color: var(--ink);
    font-size: 12px;
    font-weight: 730;
    cursor: pointer;
    transition: background .14s ease, border-color .14s ease, transform .14s ease;
}

.richTextButton:hover {
    border-color: rgba(23, 79, 66, .24);
    background: rgba(23, 79, 66, .06);
    transform: translateY(-1px);
}

.richTextButton.isActive {
    border-color: rgba(23, 79, 66, .42);
    background: rgba(23, 79, 66, .14);
    color: #12372f;
    box-shadow: inset 0 0 0 1px rgba(23, 79, 66, .06);
}

.richTextButton em,
.richTextButton strong,
.richTextButton u {
    font-style: inherit;
}

.richTextDivider {
    width: 1px;
    margin: 2px 2px;
    background: var(--line);
}

.richTextColorControl {
    min-width: 106px;
    height: 34px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--lineStrong);
    border-radius: 9px;
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--lineStrong);
    font-size: 12px;
    font-weight: 730;
    cursor: pointer;
    text-align: left;
}

.richTextColorControl span {
    line-height: 1;
    pointer-events: none;
}

.richTextColorSwatch {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border: 1px solid rgba(31, 45, 42, .18);
    border-radius: 4px;
    background: #1f2d2a;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.richTextColorControl input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
}

.richTextColorControl input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.richTextColorControl input::-webkit-color-swatch {
    border: 1px solid rgba(31, 45, 42, .18);
    border-radius: 4px;
}

.richTextColorControl input::-moz-color-swatch {
    border: 1px solid rgba(31, 45, 42, .18);
    border-radius: 4px;
}

.richTextSource {
    display: none;
}

.richTextEditor {
    min-height: 160px;
    padding: 12px 13px;
    border: 1px solid var(--lineStrong);
    border-radius: 10px;
    background: #ffffff;
    color: var(--ink);
    line-height: 1.65;
    overflow-wrap: anywhere;
    transition: border-color .14s ease, box-shadow .14s ease;
}

.richTextEditor:focus {
    border-color: #6a9d90;
    box-shadow: 0 0 0 3px rgba(23, 79, 66, .08);
    outline: 0;
}

.richTextEditor:empty::before {
    content: attr(data-placeholder);
    color: #8ba09a;
}

.richTextEditor p,
.richTextEditor ul,
.richTextEditor ol {
    margin: 0;
}

.richTextEditor p + p,
.richTextEditor p + ul,
.richTextEditor p + ol,
.richTextEditor ul + p,
.richTextEditor ol + p,
.richTextEditor ul + ol,
.richTextEditor ol + ul {
    margin-top: 10px;
}

.richTextEditor ul,
.richTextEditor ol {
    padding-left: 22px;
}

.richTextEditor a {
    color: #1b4f9a;
    font-weight: 640;
    text-decoration-color: rgba(27, 79, 154, .34);
}

.signaturePreviewCard {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbf9 100%);
}

.signaturePreviewBody {
    min-height: 180px;
}

.signatureLogoPreview {
    margin-top: 14px;
}

.signatureLogoPreview img {
    max-width: 180px;
    max-height: 80px;
    display: block;
}

.fileUploadControl {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 12px;
    border: 1px solid var(--lineStrong);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
    cursor: pointer;
}

.fileUploadControl:hover {
    border-color: rgba(23, 79, 66, .24);
}

.fileUploadControl input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.fileUploadName {
    min-width: 0;
    margin-left: 8px;
    color: var(--inkSoft);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fileUploadPreview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.selectedAttachmentTile {
    width: 122px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f5faf7 100%);
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(20, 42, 34, .05);
}

.selectedAttachmentVisual {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 88px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(224, 235, 230, .92) 0%, rgba(210, 223, 216, .82) 100%);
    overflow: hidden;
}

.selectedAttachmentVisual::before {
    content: "";
    position: absolute;
    inset: 14px 16px 10px;
    border: 1px solid rgba(35, 56, 49, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}

.selectedAttachmentVisual::after {
    content: "";
    position: absolute;
    right: 20px;
    top: 12px;
    width: 12px;
    height: 12px;
    border-top: 1px solid rgba(35, 56, 49, .12);
    border-left: 1px solid rgba(35, 56, 49, .12);
    background: rgba(255, 255, 255, .12);
    transform: skewY(-18deg);
    border-radius: 0 0 0 4px;
}

.selectedAttachmentVisual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.selectedAttachmentVisual span {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(35, 56, 49, .1);
    font-size: 16px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .12em;
    color: rgba(23, 42, 36, .62);
    text-transform: uppercase;
}

.selectedAttachmentRemove {
    position: absolute;
    right: 6px;
    top: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 999px;
    background: rgba(17, 36, 31, .8);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.selectedAttachmentName {
    padding: 8px 10px 10px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--inkStrong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachmentGallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.attachmentPreviewCard {
    width: 132px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f5faf7 100%);
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(20, 42, 34, .05);
}

.attachmentPreviewMedia {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 104px;
    background: linear-gradient(180deg, #eef5f2 0%, #e7f0ec 100%);
    border-bottom: 1px solid var(--line);
}

.attachmentPreviewMedia img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attachmentPreviewOpen {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    text-decoration: none;
}

.attachmentPreviewOpen:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: -3px;
}

.attachmentPreviewOpen:hover img {
    transform: scale(1.04);
}

.attachmentPreviewOpen img {
    transition: transform .18s ease;
}

.attachmentPreviewFallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--inkStrong);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: linear-gradient(180deg, #edf5f2 0%, #dfece7 100%);
}

.attachmentPreviewDownload {
    z-index: 1;
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(17, 36, 31, .8);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
    box-shadow: 0 6px 10px rgba(17, 36, 31, .18);
}

.attachmentPreviewMeta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px 10px;
}

.attachmentPreviewMeta strong {
    display: block;
    font-size: 12px;
    line-height: 1.4;
    color: var(--inkStrong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachmentPreviewMeta small {
    display: block;
    color: var(--inkSoft);
    font-size: 11px;
}

.imageViewerOpen {
    overflow: hidden;
}

.imageViewerOverlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(13, 27, 24, .92);
}

.imageViewerOverlay[hidden] {
    display: none;
}

.imageViewerDialog {
    display: flex;
    flex-direction: column;
    width: min(1120px, 100%);
    max-height: 100%;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 16px;
    background: #182823;
    color: #ffffff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}

.imageViewerHeader,
.imageViewerFooter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
}

.imageViewerHeader strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
}

.imageViewerStage {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    justify-items: center;
    gap: 8px;
    min-height: 180px;
    padding: 12px;
    background: #101c19;
}

.imageViewerStage img {
    display: block;
    max-width: 100%;
    max-height: min(70vh, 900px);
    object-fit: contain;
}

.imageViewerButton {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 9px;
    background: rgba(255, 255, 255, .1);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 24px;
}

.imageViewerButton:hover {
    background: rgba(255, 255, 255, .2);
}

.imageViewerButton[hidden] {
    visibility: hidden;
}

.imageViewerFooter span {
    font-size: 12px;
    color: #cfdbd6;
}

@media (max-width: 600px) {
    .imageViewerOverlay {
        padding: 10px;
    }

    .imageViewerStage {
        grid-template-columns: 32px minmax(0, 1fr) 32px;
        gap: 4px;
        padding: 8px;
    }

    .imageViewerButton {
        width: 32px;
        height: 32px;
    }
}

.linkDialogOverlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(18, 30, 27, .42);
    backdrop-filter: blur(8px);
}

.linkDialog {
    width: min(460px, 100%);
    padding: 20px;
    border: 1px solid rgba(183, 202, 196, .95);
    border-radius: 18px;
    background: linear-gradient(180deg, #fdfefe 0%, #f5f8f6 100%);
    box-shadow: 0 24px 60px rgba(20, 39, 34, .2);
}

.linkDialogHeader h3 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.02em;
}

.linkDialogHeader p {
    margin: 6px 0 0;
    color: var(--inkSoft);
    font-size: 13px;
}

.linkDialogPreview {
    margin: 14px 0 0;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--inkSoft);
    font-size: 13px;
}

.linkDialogPreview strong {
    color: var(--ink);
}

.linkDialogActions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.confirmDialogOverlay {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(18, 30, 27, .46);
    backdrop-filter: blur(8px);
}

.confirmDialog {
    width: min(520px, 100%);
    padding: 24px;
    border: 1px solid rgba(183, 202, 196, .95);
    border-radius: 22px;
    background: linear-gradient(180deg, #fcfefd 0%, #f3f7f5 100%);
    box-shadow: 0 28px 80px rgba(18, 35, 31, .24);
}

.confirmDialogHeader h3 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -.03em;
}

.confirmDialogHeader p {
    margin: 10px 0 0;
    color: var(--inkSoft);
    font-size: 16px;
    line-height: 1.65;
}

.confirmDialogActions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.slaSettingsGrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.slaSetting {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radiusMd);
    background: var(--surfaceSoft);
}

.slaSetting .field {
    margin-top: 14px;
}

.slaCountdown {
    display: block;
    margin: 8px 0;
    color: var(--brand);
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -.025em;
    font-variant-numeric: tabular-nums;
}

.slaCountdown.isOverdue,
.overdueText {
    color: var(--danger);
}

.systemEntry .timelineAvatar {
    color: var(--blue);
    background: var(--blueSoft);
}

.messageBubble.systemMessage {
    border-color: #cfdef9;
    background: var(--blueSoft);
}

.messageBubble.systemMessage .messageMeta,
.messageBubble.systemMessage .messageBody {
    color: #284c7e;
}

.preserveText {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.75;
}

.badgeRow,
.buttonRow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.deliveryRow {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-block: 10px;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.deliveryRow:last-child {
    border-bottom: 0;
}

.navButton {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.publicShell {
    max-width: 880px;
    margin-inline: auto;
    padding: 0 24px 30px;
}

.publicHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-block: 28px;
    border-bottom: 1px solid var(--line);
}

.publicBrand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 750;
}

.publicIntro {
    padding-block: 34px 24px;
}

.publicIntro h1 {
    margin: 12px 0;
    color: var(--ink);
    font-size: clamp(25px, 4vw, 36px);
    line-height: 1.25;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}

.publicIntro p {
    margin: 0;
    color: var(--inkSoft);
    font-size: 14px;
}

.publicMetaGrid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.publicMeta {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 10px;
    padding: 17px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radiusMd);
    background: var(--surface);
}

.publicMeta > span:first-child {
    color: var(--inkSoft);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.publicShell > .panel,
.publicShell > .ticketCard {
    margin-bottom: 22px;
}

.publicEmpty {
    padding: 64px 24px;
    color: var(--inkSoft);
    text-align: center;
    line-height: 1.8;
}

.publicEmpty h1 {
    color: var(--ink);
}

.publicFooter {
    padding-block: 20px;
    color: var(--inkSoft);
    font-size: 12px;
    text-align: center;
    line-height: 1.7;
}

.publicShell .messageMeta,
.publicShell .messageBody {
    overflow-wrap: anywhere;
}

:focus-visible {
    outline: 3px solid #70a391;
    outline-offset: 3px;
}

@media (max-width: 1080px) {
    .authBrandPanel {
        padding-inline: 32px;
    }

    .authBrandFooter {
        flex-direction: column;
        gap: 6px;
    }

    .slaSettingsGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .authShell {
        grid-template-columns: 1fr;
    }

    .authBrandPanel {
        display: none;
    }

    .authMobileBrand {
        display: flex;
    }

    .authFormPanel {
        min-height: 100vh;
        padding: 32px 24px;
    }
}

@media (max-width: 560px) {
    .publicShell {
        padding-inline: 14px;
    }

    .publicHeader {
        align-items: flex-start;
        padding-block: 20px;
    }

    .publicMetaGrid,
    .slaSettingsGrid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .publicMeta {
        grid-template-columns: 95px minmax(0, 1fr);
        align-items: center;
        padding: 13px 16px;
    }

    .authHeading h1,
    .authHeading h2 {
        font-size: 27px;
    }

    .subjectComposer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .systemSubjectPrefix {
        border-right: 1px solid var(--line);
        border-radius: var(--radiusSm);
    }

    .subjectComposer input {
        flex-basis: 100%;
        border-radius: var(--radiusSm);
    }
}

.ticketCardHeader p {
    margin: 4px 0 0;
    color: var(--inkSoft);
    font-size: 12px;
}

.button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

/* Customer portal: separate from the staff application shell. */
.customerPortal {
    min-height: 100vh;
    background: var(--page);
}

.customerPortal .customerHeader {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.customerPortal .customerHeaderInner {
    max-width: 1200px;
    margin-inline: auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px 28px;
}

.customerPortal .customerNav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.customerPortal .customerNav a {
    padding: 9px 13px;
    border-radius: var(--radiusSm);
    color: var(--inkSoft);
    font-weight: 650;
}

.customerPortal .customerNav a:hover,
.customerPortal .customerNav a[aria-current="page"] {
    background: var(--brandSoft);
    color: var(--brand);
}

.customerPortal .customerAccount {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.customerPortal .customerIdentity {
    display: grid;
    overflow-wrap: anywhere;
}

.customerPortal .customerIdentity small {
    color: var(--inkSoft);
}

.customerPortal .customerMain {
    max-width: 1100px;
    margin-inline: auto;
    padding: 32px 24px;
}

.customerPortal .customerMain > .panel,
.customerPortal .customerMain > .ticketCard {
    margin-bottom: 24px;
}

.customerPortal .customerProjectGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 16px;
}

.customerPortal .customerProjectCard {
    display: grid;
    justify-items: start;
    gap: 16px;
    overflow-wrap: anywhere;
}

.customerPortal .customerProjectCard h3 {
    margin: 0;
}

.customerPortal .customerProjectCard:hover {
    border-color: var(--brand);
}

.customerPortal .customerProjectLink,
.customerPortal .customerBackLink {
    color: var(--brand);
    font-weight: 650;
}

.customerPortal .customerBackLink {
    display: inline-block;
    margin-bottom: 12px;
}

.customerPortal .customerTicketList,
.customerPortal .customerTicketForm,
.customerPortal .customerAssignments {
    display: grid;
    gap: 16px;
}

.customerPortal .customerTicketCard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.customerPortal .customerTicketLink {
    display: grid;
    gap: 4px;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.customerPortal .customerTicketLink:hover strong {
    color: var(--brand);
    text-decoration: underline;
}

.customerPortal .customerAssignments {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radiusSm);
}

.customerPortal .customerAttachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.customerPortal .customerAttachments li,
.customerPortal .timelineContent {
    min-width: 0;
}

.customerPortal .customerAttachments a,
.customerPortal .messageBubble {
    overflow-wrap: anywhere;
}

.customerPortal .customerAttachments a {
    white-space: normal;
}

@media (max-width: 700px) {
    .customerPortal .customerHeaderInner {
        padding: 16px;
        gap: 16px;
    }

    .customerPortal .customerAccount {
        flex-basis: 100%;
        justify-content: space-between;
    }

    .customerPortal .customerNav {
        flex-basis: 100%;
        order: 1;
    }

    .customerPortal .customerMain {
        padding: 24px 16px;
    }
}
