:root {
    --tcaf-black: #12120f;
    --tcaf-black-soft: #1d1c18;
    --tcaf-ink: #28261f;
    --tcaf-ink-soft: #5e594d;
    --tcaf-muted: #7c7568;
    --tcaf-gold: #c6a15b;
    --tcaf-gold-dark: #9d7632;
    --tcaf-gold-deep: #78551c;
    --tcaf-gold-pale: #f4ead5;
    --tcaf-cream: #f3eee4;
    --tcaf-cream-deep: #e9e0d1;
    --tcaf-paper: #fffdf9;
    --tcaf-white: #ffffff;
    --tcaf-line: #e3dacb;
    --tcaf-line-strong: #d2c3ad;
    --tcaf-danger: #a72f28;
    --tcaf-danger-pale: #fff1ef;
    --tcaf-warning: #8a611b;
    --tcaf-warning-pale: #fff6df;
    --tcaf-shadow-xs: 0 1px 2px rgba(32, 27, 17, 0.05);
    --tcaf-shadow-sm: 0 8px 24px rgba(32, 27, 17, 0.07);
    --tcaf-shadow-md: 0 20px 60px rgba(22, 19, 12, 0.14);
    --tcaf-radius-sm: 10px;
    --tcaf-radius: 16px;
    --tcaf-radius-lg: 24px;
    --tcaf-topbar-height: 78px;
    --tcaf-font: "DM Sans", "Segoe UI", Arial, sans-serif;
    --tcaf-heading: "Cormorant Garamond", Georgia, serif;
}

.tcafcrm-simple .tcafcrm-sort-tabs {
    display: flex;
    gap: 4px;
    flex: 0 0 auto;
    margin: 0 18px 14px;
    padding: 4px;
    border: 1px solid var(--tcaf-line);
    border-radius: 12px;
    background: var(--tcaf-cream);
}
.tcafcrm-simple .tcafcrm-sort-tabs button {
    flex: 1;
    min-height: 42px;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--tcaf-ink-soft);
}
.tcafcrm-simple .tcafcrm-sort-tabs button[aria-pressed="true"] {
    background: var(--tcaf-black);
    color: var(--tcaf-white);
}
.tcafcrm-simple .tcafcrm-submitted-at {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--tcaf-line);
    color: var(--tcaf-ink-soft);
    background: var(--tcaf-gold-pale);
    font-size: 14px;
}
.tcafcrm-simple .tcafcrm-submitted-at svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    flex-shrink: 0;
}
.tcafcrm-simple .tcafcrm-list-copy .tcafcrm-lead-date {
    color: var(--tcaf-ink-soft);
    line-height: 1.5;
    white-space: normal;
}
.tcafcrm-simple .tcafcrm-phone-review { color: var(--tcaf-warning); }
.tcafcrm-simple .tcafcrm-phone-warning {
    margin: 12px 24px;
    padding: 12px;
    border-radius: 8px;
    color: var(--tcaf-warning);
    background: var(--tcaf-warning-pale);
    font-size: 14px;
}

html.dscm-portal-document,
html.dscm-portal-document body {
    min-height: 100%;
    margin: 0;
    background: var(--tcaf-cream);
}

html.dscm-portal-document {
    color-scheme: light;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.dscm-standalone-portal {
    min-width: 320px;
    color: var(--tcaf-ink);
    font-family: var(--tcaf-font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.dscm-portal-main {
    min-height: 100dvh;
}

.tcafcrm-simple,
.tcafcrm-simple *,
.tcafcrm-auth-wrap,
.tcafcrm-auth-wrap * {
    box-sizing: border-box;
    hyphens: none !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

.tcafcrm-simple :where(h1, h2, h3, h4, p),
.tcafcrm-auth-wrap :where(h1, h2, h3, h4, p) {
    margin-top: 0;
}

.tcafcrm-simple :where(h1, h2, h3, h4),
.tcafcrm-auth-wrap :where(h1, h2, h3, h4) {
    color: var(--tcaf-black);
    font-family: var(--tcaf-heading);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.06;
}

.tcafcrm-simple :where(button, input, select, textarea),
.tcafcrm-auth-wrap :where(button, input, select, textarea) {
    margin: 0;
    color: inherit;
    font: inherit;
}

.tcafcrm-simple :where(button, a),
.tcafcrm-auth-wrap :where(button, a) {
    -webkit-tap-highlight-color: transparent;
}

.tcafcrm-simple :where(button:not(:disabled), a[href], select:not(:disabled), label[for]),
.tcafcrm-auth-wrap :where(button:not(:disabled), a[href], select:not(:disabled), label[for]) {
    cursor: pointer;
}

.tcafcrm-simple svg,
.tcafcrm-auth-wrap svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.tcafcrm-simple [hidden],
.tcafcrm-auth-wrap [hidden] {
    display: none !important;
}

.tcafcrm-simple :focus-visible,
.tcafcrm-auth-wrap :focus-visible {
    outline: 3px solid rgba(198, 161, 91, 0.38);
    outline-offset: 2px;
}

/* Keep normal words intact while letting genuinely long customer data wrap. */
.tcafcrm-list-copy span,
.tcafcrm-list-copy small,
.tcafcrm-original-enquiry dd,
.tcafcrm-timeline p,
.tcafcrm-form-grid input,
.tcafcrm-form-grid textarea {
    min-width: 0;
    overflow-wrap: break-word !important;
    word-break: normal !important;
}

.tcafcrm-simple {
    min-height: 100dvh;
    background:
        radial-gradient(circle at 92% 8%, rgba(198, 161, 91, 0.10), transparent 25rem),
        var(--tcaf-cream);
    color: var(--tcaf-ink);
    font-family: var(--tcaf-font);
}

/* Header */
.tcafcrm-topbar {
    position: sticky;
    z-index: 70;
    top: 0;
    display: flex;
    min-height: var(--tcaf-topbar-height);
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px clamp(18px, 3vw, 44px);
    border-bottom: 1px solid rgba(198, 161, 91, 0.36);
    background: linear-gradient(112deg, #11110e 0%, #1b1914 100%);
    color: var(--tcaf-white);
    box-shadow: 0 10px 32px rgba(16, 14, 9, 0.17);
}

.tcafcrm-topbar::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tcaf-gold), transparent);
    content: "";
    opacity: 0.55;
    pointer-events: none;
}

.tcafcrm-brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
    color: var(--tcaf-white);
    text-decoration: none;
}

.tcafcrm-brand-mark {
    display: inline-grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border: 1px solid #ddc17e;
    border-radius: 12px;
    background: linear-gradient(145deg, #ddc17e, #ad8239);
    color: #17140e;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.45), 0 6px 18px rgba(0, 0, 0, 0.2);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1;
}

.tcafcrm-brand > span:last-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.tcafcrm-brand strong {
    color: var(--tcaf-white);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    white-space: nowrap;
}

.tcafcrm-brand small {
    color: rgba(255, 255, 255, 0.64);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.025em;
    line-height: 1.35;
    white-space: nowrap;
}

.tcafcrm-top-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.tcafcrm-welcome {
    margin-right: 5px;
    color: rgba(255, 255, 255, 0.73);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.tcafcrm-button,
.tcafcrm-icon-link {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-family: var(--tcaf-font);
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.tcafcrm-button {
    padding: 12px 18px;
}

.tcafcrm-icon-link {
    width: 48px;
    padding: 0;
    border-color: rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.065);
    color: rgba(255, 255, 255, 0.84);
}

.tcafcrm-button-primary {
    border-color: #d2ad62;
    background: linear-gradient(145deg, #d7b66f, #b98b3c);
    color: #17130b;
    box-shadow: 0 7px 18px rgba(137, 96, 30, 0.23);
}

.tcafcrm-button-light {
    border-color: var(--tcaf-line-strong);
    background: var(--tcaf-paper);
    color: var(--tcaf-ink);
    box-shadow: var(--tcaf-shadow-xs);
}

.tcafcrm-button:not(:disabled):hover,
.tcafcrm-icon-link:not(:disabled):hover {
    transform: translateY(-1px);
}

.tcafcrm-button-primary:not(:disabled):hover {
    border-color: #e0c47f;
    background: linear-gradient(145deg, #e0c47f, #c79b4d);
    box-shadow: 0 10px 24px rgba(137, 96, 30, 0.30);
}

.tcafcrm-button-light:not(:disabled):hover {
    border-color: var(--tcaf-gold);
    background: #fffaf1;
}

.tcafcrm-icon-link:not(:disabled):hover {
    border-color: rgba(198, 161, 91, 0.72);
    background: rgba(198, 161, 91, 0.14);
    color: #f1d998;
}

.tcafcrm-button:disabled,
.tcafcrm-icon-link:disabled,
.tcafcrm-simple button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Workspace */
.tcafcrm-workspace {
    display: grid;
    width: min(100%, 1680px);
    min-height: calc(100dvh - var(--tcaf-topbar-height));
    grid-template-columns: clamp(330px, 25vw, 405px) minmax(0, 1fr);
    gap: 22px;
    margin: 0 auto;
    padding: 22px clamp(18px, 2.5vw, 38px) 34px;
}

/* Lead queue */
.tcafcrm-queue {
    position: sticky;
    top: calc(var(--tcaf-topbar-height) + 22px);
    display: flex;
    height: calc(100dvh - var(--tcaf-topbar-height) - 44px);
    min-height: 500px;
    flex-direction: column;
    align-self: start;
    overflow: hidden;
    border: 1px solid var(--tcaf-line);
    border-radius: var(--tcaf-radius-lg);
    background: rgba(255, 253, 249, 0.98);
    box-shadow: var(--tcaf-shadow-sm);
}

.tcafcrm-queue-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 23px 23px 14px;
}

.tcafcrm-queue-head p,
.tcafcrm-modal-head p,
.tcafcrm-history-head p {
    margin-bottom: 4px;
    color: var(--tcaf-gold-dark);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    line-height: 1.2;
    text-transform: uppercase;
}

.tcafcrm-queue-head h1 {
    margin-bottom: 0;
    font-size: clamp(31px, 2.6vw, 39px);
}

.tcafcrm-count {
    display: inline-grid;
    min-width: 39px;
    height: 39px;
    padding: 0 10px;
    place-items: center;
    border: 1px solid #dfc996;
    border-radius: 999px;
    background: var(--tcaf-gold-pale);
    color: var(--tcaf-gold-deep);
    font-size: 13px;
    font-weight: 700;
}

.tcafcrm-search {
    padding: 0 18px 12px;
}

.tcafcrm-search > label,
.tcafcrm-filter-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.tcafcrm-search > div {
    position: relative;
}

.tcafcrm-search svg {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 15px;
    width: 18px;
    height: 18px;
    color: var(--tcaf-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.tcafcrm-search input,
.tcafcrm-filter,
.tcafcrm-form-grid input,
.tcafcrm-form-grid select,
.tcafcrm-form-grid textarea,
.tcafcrm-followup-row input,
.tcafcrm-call-note textarea,
.tcafcrm-login-card input[type="text"],
.tcafcrm-login-card input[type="email"],
.tcafcrm-login-card input[type="password"] {
    width: 100%;
    border: 1px solid var(--tcaf-line-strong);
    border-radius: 11px;
    outline: 0;
    background: var(--tcaf-white);
    color: var(--tcaf-ink);
    box-shadow: inset 0 1px 2px rgba(32, 27, 17, 0.025);
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.tcafcrm-search input {
    min-height: 48px;
    padding: 11px 14px 11px 44px;
}

.tcafcrm-search input::placeholder,
.tcafcrm-form-grid input::placeholder,
.tcafcrm-form-grid textarea::placeholder,
.tcafcrm-call-note textarea::placeholder {
    color: #9a9285;
    opacity: 1;
}

.tcafcrm-search input:focus,
.tcafcrm-filter:focus,
.tcafcrm-form-grid input:focus,
.tcafcrm-form-grid select:focus,
.tcafcrm-form-grid textarea:focus,
.tcafcrm-followup-row input:focus,
.tcafcrm-call-note textarea:focus,
.tcafcrm-login-card input:focus {
    border-color: var(--tcaf-gold);
    background: #fffefa;
    box-shadow: 0 0 0 4px rgba(198, 161, 91, 0.14);
}

.tcafcrm-filter {
    width: calc(100% - 36px);
    min-height: 46px;
    margin: 0 18px 14px;
    padding: 10px 42px 10px 14px;
    appearance: none;
    background-color: #f9f5ed;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--tcaf-gold-dark) 50%),
        linear-gradient(135deg, var(--tcaf-gold-dark) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 19px,
        calc(100% - 13px) 19px;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    color: var(--tcaf-ink);
    font-size: 13px;
    font-weight: 700;
}

.tcafcrm-list {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1px 10px 16px;
    border-top: 1px solid var(--tcaf-line);
    scrollbar-color: var(--tcaf-gold) transparent;
    scrollbar-width: thin;
}

.tcafcrm-list::-webkit-scrollbar {
    width: 8px;
}

.tcafcrm-list::-webkit-scrollbar-track {
    background: transparent;
}

.tcafcrm-list::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--tcaf-gold);
    background-clip: padding-box;
}

.tcafcrm-lead-row {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: stretch;
    margin-top: 7px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.tcafcrm-lead-row:hover {
    border-color: #e4d4b6;
    background: #fbf6ec;
}

.tcafcrm-lead-row.is-current {
    border-color: #d8bc80;
    background: linear-gradient(100deg, #fbf2df, #fffaf1);
    box-shadow: inset 4px 0 var(--tcaf-gold), 0 5px 15px rgba(105, 76, 25, 0.08);
}

.tcafcrm-row-main {
    display: flex;
    min-width: 0;
    min-height: 86px;
    flex: 1 1 auto;
    align-items: center;
    gap: 12px;
    padding: 12px 9px 12px 12px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.tcafcrm-row-main > svg {
    width: 17px;
    height: 17px;
    color: #a09789;
}

.tcafcrm-lead-row.is-current .tcafcrm-row-main > svg {
    color: var(--tcaf-gold-dark);
}

.tcafcrm-list-avatar,
.tcafcrm-record-avatar {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #d8c79f;
    border-radius: 50%;
    background: linear-gradient(145deg, #f7ecd5, #e5c98f);
    color: #5f4317;
    font-weight: 700;
    letter-spacing: 0.035em;
}

.tcafcrm-list-avatar {
    width: 43px;
    height: 43px;
    font-size: 12px;
}

.tcafcrm-list-copy {
    display: grid;
    min-width: 0;
    flex: 1 1 auto;
    gap: 3px;
}

.tcafcrm-list-copy strong {
    overflow: hidden;
    color: var(--tcaf-black);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tcafcrm-list-copy > span {
    overflow: hidden;
    color: var(--tcaf-ink-soft);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tcafcrm-list-copy small {
    display: block;
    overflow: hidden;
    color: var(--tcaf-muted);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tcafcrm-list-copy small b {
    font-weight: 700;
}

.tcafcrm-list-copy small b.is-due {
    color: var(--tcaf-danger);
}

.tcafcrm-list-copy small b.is-set {
    color: var(--tcaf-gold-deep);
}

.tcafcrm-list-copy small b.is-empty {
    color: var(--tcaf-muted);
}

.tcafcrm-row-delete,
.tcafcrm-row-action {
    flex: 0 0 auto;
    align-self: center;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.tcafcrm-row-delete {
    display: inline-grid;
    width: 36px;
    height: 40px;
    margin-right: 6px;
    padding: 0;
    place-items: center;
    color: #a59c8e;
}

.tcafcrm-row-delete svg {
    width: 17px;
    height: 17px;
}

.tcafcrm-row-delete:hover {
    border-color: #edc7c2;
    background: var(--tcaf-danger-pale);
    color: var(--tcaf-danger);
}

.tcafcrm-lead-row.is-archived {
    min-height: 78px;
    align-items: center;
    gap: 10px;
    padding: 10px 8px 10px 12px;
    border-color: var(--tcaf-line);
    background: #faf7f1;
    opacity: 0.82;
}

.tcafcrm-row-action {
    min-height: 38px;
    padding: 8px 10px;
    border-color: var(--tcaf-line-strong);
    background: var(--tcaf-white);
    color: var(--tcaf-gold-deep);
}

.tcafcrm-row-action:hover {
    border-color: var(--tcaf-gold);
    background: var(--tcaf-gold-pale);
}

.tcafcrm-list-loading {
    display: flex;
    min-height: 160px;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.tcafcrm-list-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tcaf-gold);
    animation: tcafcrm-pulse 1s ease-in-out infinite;
}

.tcafcrm-list-loading span:nth-child(2) { animation-delay: 120ms; }
.tcafcrm-list-loading span:nth-child(3) { animation-delay: 240ms; }

.tcafcrm-list-empty {
    display: grid;
    min-height: 220px;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 28px 20px;
    color: var(--tcaf-muted);
    text-align: center;
}

.tcafcrm-list-empty > svg {
    width: 30px;
    height: 30px;
    margin-bottom: 4px;
    color: var(--tcaf-gold-dark);
}

.tcafcrm-list-empty strong {
    color: var(--tcaf-black);
    font-size: 15px;
}

.tcafcrm-list-empty span {
    max-width: 250px;
    font-size: 12px;
}

.tcafcrm-list-empty button {
    min-height: 40px;
    margin-top: 5px;
    padding: 8px 14px;
    border: 1px solid var(--tcaf-line-strong);
    border-radius: 9px;
    background: var(--tcaf-white);
    color: var(--tcaf-gold-deep);
    font-weight: 700;
}

/* Leads are a single scrolling queue, never a paginated card stack. */
.tcafcrm-pagination {
    display: none !important;
}

/* Customer record */
.tcafcrm-record {
    min-width: 0;
    align-self: start;
    overflow: hidden;
    border: 1px solid var(--tcaf-line);
    border-radius: var(--tcaf-radius-lg);
    background: var(--tcaf-paper);
    box-shadow: var(--tcaf-shadow-sm);
}

.tcafcrm-customer-record {
    min-width: 0;
}

.tcafcrm-record-head {
    display: flex;
    min-height: 126px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 25px clamp(24px, 3vw, 40px);
    border-bottom: 1px solid rgba(198, 161, 91, 0.33);
    background:
        linear-gradient(115deg, rgba(198, 161, 91, 0.13), transparent 38%),
        linear-gradient(180deg, #fffefa, #fbf7ef);
}

.tcafcrm-mobile-back {
    display: none;
}

.tcafcrm-record-identity {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    gap: 15px;
}

.tcafcrm-record-avatar {
    width: 58px;
    height: 58px;
    font-size: 15px;
    box-shadow: 0 6px 17px rgba(101, 72, 21, 0.12);
}

.tcafcrm-record-identity > div {
    min-width: 0;
}

.tcafcrm-record-identity p {
    margin-bottom: 3px;
    color: var(--tcaf-gold-dark);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.tcafcrm-record-identity h2 {
    margin-bottom: 4px;
    font-size: clamp(32px, 3.1vw, 45px);
}

.tcafcrm-record-identity > div > span {
    display: block;
    color: var(--tcaf-ink-soft);
    font-size: 12px;
    font-weight: 600;
}

.tcafcrm-record-head-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.tcafcrm-record-nav {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--tcaf-line-strong);
    border-radius: 10px;
    background: var(--tcaf-white);
}

.tcafcrm-record-nav button {
    display: inline-flex;
    min-width: 45px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border: 0;
    background: transparent;
    color: var(--tcaf-ink-soft);
    font-size: 12px;
    font-weight: 700;
}

.tcafcrm-record-nav button + button {
    border-left: 1px solid var(--tcaf-line);
}

.tcafcrm-record-nav button:not(:disabled):hover {
    background: var(--tcaf-gold-pale);
    color: var(--tcaf-gold-deep);
}

.tcafcrm-record-nav svg {
    width: 17px;
    height: 17px;
}

.tcafcrm-delete-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    border: 1px solid #e6c6c2;
    border-radius: 10px;
    background: #fffafa;
    color: var(--tcaf-danger);
    font-size: 12px;
    font-weight: 700;
    transition: border-color 150ms ease, background 150ms ease;
}

.tcafcrm-delete-button:hover {
    border-color: #dba29c;
    background: var(--tcaf-danger-pale);
}

.tcafcrm-delete-button svg {
    width: 17px;
    height: 17px;
}

.tcafcrm-contact-actions {
    display: flex;
    gap: 10px;
    padding: 15px clamp(24px, 3vw, 40px);
    border-bottom: 1px solid var(--tcaf-line);
    background: #f8f3e9;
}

.tcafcrm-contact-actions a {
    display: inline-flex;
    min-width: 112px;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #decaa1;
    border-radius: 10px;
    background: var(--tcaf-paper);
    color: #5d4218;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--tcaf-shadow-xs);
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.tcafcrm-contact-actions a:hover {
    border-color: var(--tcaf-gold);
    background: var(--tcaf-gold-pale);
    transform: translateY(-1px);
}

.tcafcrm-contact-actions svg {
    width: 18px;
    height: 18px;
}

.tcafcrm-contact-blocked {
    padding: 15px clamp(24px, 3vw, 40px);
    border-bottom: 1px solid #efc8c3;
    background: var(--tcaf-danger-pale);
    color: var(--tcaf-danger);
    font-size: 13px;
    font-weight: 700;
}

.tcafcrm-lead-form {
    padding: clamp(24px, 3vw, 40px);
}

.tcafcrm-section {
    position: relative;
    padding: clamp(22px, 2.4vw, 32px);
    border: 1px solid var(--tcaf-line);
    border-radius: var(--tcaf-radius);
    background: var(--tcaf-white);
    box-shadow: var(--tcaf-shadow-xs);
}

.tcafcrm-section + .tcafcrm-section {
    margin-top: 20px;
}

.tcafcrm-section::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    border-radius: var(--tcaf-radius) 0 0 var(--tcaf-radius);
    background: linear-gradient(180deg, var(--tcaf-gold), transparent 80%);
    content: "";
    opacity: 0.85;
}

.tcafcrm-section-head {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 22px;
}

.tcafcrm-section-head > span {
    display: inline-grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid #d8bc80;
    border-radius: 50%;
    background: var(--tcaf-gold-pale);
    color: var(--tcaf-gold-deep);
    font-size: 12px;
    font-weight: 700;
}

.tcafcrm-section-head h3 {
    margin-bottom: 4px;
    font-size: clamp(26px, 2.4vw, 32px);
}

.tcafcrm-section-head p {
    margin-bottom: 0;
    color: var(--tcaf-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
}

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

.tcafcrm-form-grid label,
.tcafcrm-followup-row label,
.tcafcrm-call-note {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.tcafcrm-form-grid label > span,
.tcafcrm-followup-row label > span,
.tcafcrm-call-note > span {
    color: #4d483f;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.015em;
    line-height: 1.3;
}

.tcafcrm-form-grid input,
.tcafcrm-form-grid select,
.tcafcrm-form-grid textarea,
.tcafcrm-followup-row input,
.tcafcrm-call-note textarea {
    min-height: 48px;
    padding: 11px 13px;
}

.tcafcrm-form-grid textarea,
.tcafcrm-call-note textarea {
    min-height: 80px;
    resize: vertical;
    line-height: 1.5;
}

.tcafcrm-call-note textarea {
    min-height: 132px;
}

.tcafcrm-span-2 {
    grid-column: span 2;
}

.tcafcrm-original-enquiry {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid var(--tcaf-line);
    border-radius: 11px;
    background: #faf7f1;
}

.tcafcrm-original-enquiry summary {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    color: var(--tcaf-ink-soft);
    font-size: 12px;
    font-weight: 700;
    list-style: none;
}

.tcafcrm-original-enquiry summary::-webkit-details-marker {
    display: none;
}

.tcafcrm-original-enquiry summary svg {
    width: 17px;
    height: 17px;
    transition: transform 150ms ease;
}

.tcafcrm-original-enquiry[open] summary svg {
    transform: rotate(90deg);
}

.tcafcrm-original-enquiry dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0 14px 14px;
    border-top: 1px solid var(--tcaf-line);
}

.tcafcrm-original-enquiry dl > div {
    min-width: 0;
    padding: 13px 10px;
    border-bottom: 1px solid var(--tcaf-line);
}

.tcafcrm-original-enquiry dt {
    margin-bottom: 4px;
    color: var(--tcaf-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tcafcrm-original-enquiry dd {
    margin: 0;
    color: var(--tcaf-ink);
    font-size: 13px;
    line-height: 1.5;
}

/* Call outcomes */
.tcafcrm-call-section {
    background: linear-gradient(145deg, #fffdf9, #fbf4e7);
}

.tcafcrm-legacy-outcome {
    margin-bottom: 15px;
    padding: 10px 13px;
    border-left: 3px solid var(--tcaf-gold);
    border-radius: 0 8px 8px 0;
    background: rgba(198, 161, 91, 0.11);
    color: var(--tcaf-ink-soft);
    font-size: 11px;
}

.tcafcrm-legacy-outcome strong {
    color: var(--tcaf-gold-deep);
    font-weight: 700;
}

.tcafcrm-outcome-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.tcafcrm-outcome-option {
    position: relative;
    display: block;
    min-width: 0;
}

.tcafcrm-outcome-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.tcafcrm-outcome-option > span {
    display: flex;
    min-height: 56px;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--tcaf-line-strong);
    border-radius: 11px;
    background: var(--tcaf-white);
    color: var(--tcaf-ink-soft);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.tcafcrm-outcome-option > span > i {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 2px solid #c6bcae;
    border-radius: 50%;
    background: var(--tcaf-white);
}

.tcafcrm-outcome-option:hover > span {
    border-color: var(--tcaf-gold);
    background: #fffaf0;
    color: var(--tcaf-black);
    transform: translateY(-1px);
}

.tcafcrm-outcome-option input:checked + span {
    border-color: #c09a50;
    background: linear-gradient(145deg, #f7ecd4, #fffaf0);
    color: #4c3612;
    box-shadow: 0 0 0 2px rgba(198, 161, 91, 0.14), 0 7px 16px rgba(91, 64, 20, 0.08);
}

.tcafcrm-outcome-option input:checked + span > i {
    border-color: var(--tcaf-gold-dark);
    background: var(--tcaf-gold);
    box-shadow: inset 0 0 0 4px var(--tcaf-white);
}

.tcafcrm-outcome-option input:focus-visible + span {
    outline: 3px solid rgba(198, 161, 91, 0.34);
    outline-offset: 2px;
}

/* Follow-up */
.tcafcrm-legacy-date {
    margin: -3px 0 16px;
    padding: 11px 13px;
    border: 1px solid #ead7a9;
    border-radius: 9px;
    background: var(--tcaf-warning-pale);
    color: var(--tcaf-warning);
    font-size: 11px;
    line-height: 1.45;
}

.tcafcrm-followup-row {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) minmax(250px, auto);
    align-items: end;
    gap: 16px;
}

.tcafcrm-date-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tcafcrm-date-shortcuts button {
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--tcaf-line-strong);
    border-radius: 9px;
    background: #faf7f1;
    color: var(--tcaf-ink-soft);
    font-size: 11px;
    font-weight: 700;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.tcafcrm-date-shortcuts button:hover {
    border-color: var(--tcaf-gold);
    background: var(--tcaf-gold-pale);
    color: var(--tcaf-gold-deep);
}

/* Save area */
.tcafcrm-save-bar {
    position: sticky;
    z-index: 25;
    bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 22px;
    padding: 14px 15px 14px 18px;
    border: 1px solid rgba(198, 161, 91, 0.45);
    border-radius: 14px;
    background: rgba(24, 23, 19, 0.97);
    color: var(--tcaf-white);
    box-shadow: 0 16px 34px rgba(19, 16, 10, 0.21);
    backdrop-filter: blur(12px);
}

.tcafcrm-save-bar > span {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.tcafcrm-save-bar > span svg {
    width: 17px;
    height: 17px;
    color: #e0c47f;
}

.tcafcrm-save-bar > div {
    display: flex;
    flex: 0 0 auto;
    gap: 9px;
}

.tcafcrm-save-bar .tcafcrm-button {
    min-height: 46px;
    padding: 10px 15px;
    font-size: 12px;
}

.tcafcrm-save-bar .tcafcrm-button-light {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: var(--tcaf-white);
}

.tcafcrm-save-bar .tcafcrm-button-light:hover {
    border-color: rgba(224, 196, 127, 0.65);
    background: rgba(198, 161, 91, 0.14);
}

/* History */
.tcafcrm-history {
    margin: 0 clamp(24px, 3vw, 40px) clamp(28px, 3vw, 40px);
    padding: clamp(22px, 2.4vw, 30px);
    border: 1px solid var(--tcaf-line);
    border-radius: var(--tcaf-radius);
    background: #faf7f1;
}

.tcafcrm-history-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.tcafcrm-history-head > svg {
    width: 24px;
    height: 24px;
    color: var(--tcaf-gold-dark);
}

.tcafcrm-history-head > div {
    min-width: 0;
    flex: 1 1 auto;
}

.tcafcrm-history-head h3 {
    margin-bottom: 0;
    font-size: 27px;
}

.tcafcrm-history-head > span {
    display: inline-grid;
    min-width: 33px;
    height: 33px;
    padding: 0 8px;
    place-items: center;
    border: 1px solid #dec798;
    border-radius: 999px;
    background: var(--tcaf-gold-pale);
    color: var(--tcaf-gold-deep);
    font-size: 11px;
    font-weight: 700;
}

.tcafcrm-timeline {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tcafcrm-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 11px;
    padding-bottom: 19px;
}

.tcafcrm-timeline li:last-child {
    padding-bottom: 0;
}

.tcafcrm-timeline li::before {
    position: absolute;
    top: 14px;
    bottom: -2px;
    left: 6px;
    width: 1px;
    background: #dccba8;
    content: "";
}

.tcafcrm-timeline li:last-child::before {
    display: none;
}

.tcafcrm-timeline-dot {
    position: relative;
    z-index: 1;
    width: 13px;
    height: 13px;
    margin-top: 4px;
    border: 3px solid #f2e4c7;
    border-radius: 50%;
    background: var(--tcaf-gold-dark);
    box-shadow: 0 0 0 1px #d5bd89;
}

.tcafcrm-timeline li > div {
    min-width: 0;
}

.tcafcrm-timeline li > div > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 15px;
}

.tcafcrm-timeline strong {
    color: var(--tcaf-black);
    font-size: 12px;
    font-weight: 700;
}

.tcafcrm-timeline time,
.tcafcrm-timeline small {
    color: var(--tcaf-muted);
    font-size: 10px;
    font-weight: 600;
}

.tcafcrm-timeline time {
    white-space: nowrap;
}

.tcafcrm-timeline small {
    display: block;
    margin-top: 2px;
}

.tcafcrm-timeline p {
    margin: 8px 0 0;
    padding: 11px 13px;
    border: 1px solid var(--tcaf-line);
    border-radius: 9px;
    background: var(--tcaf-white);
    color: var(--tcaf-ink-soft);
    font-size: 12px;
    line-height: 1.55;
}

.tcafcrm-no-history {
    margin: 0;
    padding: 21px;
    border: 1px dashed var(--tcaf-line-strong);
    border-radius: 11px;
    color: var(--tcaf-muted);
    font-size: 12px;
    text-align: center;
}

/* Empty and loading record */
.tcafcrm-empty-record,
.tcafcrm-record-loading {
    display: grid;
    min-height: calc(100dvh - var(--tcaf-topbar-height) - 46px);
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--tcaf-muted);
    text-align: center;
}

.tcafcrm-empty-record > span {
    display: inline-grid;
    width: 68px;
    height: 68px;
    margin-bottom: 4px;
    place-items: center;
    border: 1px solid #ddc99f;
    border-radius: 50%;
    background: var(--tcaf-gold-pale);
    color: var(--tcaf-gold-dark);
}

.tcafcrm-empty-record > span svg {
    width: 29px;
    height: 29px;
}

.tcafcrm-empty-record h2 {
    margin-bottom: 0;
    font-size: 35px;
}

.tcafcrm-empty-record p,
.tcafcrm-record-loading p {
    max-width: 390px;
    margin-bottom: 5px;
    font-size: 13px;
}

.tcafcrm-record-loading > span {
    width: 38px;
    height: 38px;
    border: 3px solid var(--tcaf-gold-pale);
    border-top-color: var(--tcaf-gold-dark);
    border-radius: 50%;
    animation: tcafcrm-spin 0.8s linear infinite;
}

/* Notice */
.tcafcrm-notice {
    position: fixed;
    z-index: 110;
    top: calc(var(--tcaf-topbar-height) + 14px);
    right: 18px;
    display: flex;
    width: min(410px, calc(100vw - 36px));
    align-items: flex-start;
    gap: 11px;
    padding: 14px 13px;
    border: 1px solid #d9bd83;
    border-radius: 12px;
    background: #fffaf0;
    color: var(--tcaf-ink);
    box-shadow: var(--tcaf-shadow-md);
    animation: tcafcrm-in 180ms ease both;
}

.tcafcrm-notice > span {
    display: inline-grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 50%;
    background: var(--tcaf-gold-pale);
    color: var(--tcaf-gold-deep);
}

.tcafcrm-notice > span svg {
    width: 15px;
    height: 15px;
}

.tcafcrm-notice p {
    min-width: 0;
    flex: 1 1 auto;
    margin: 3px 0 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.tcafcrm-notice > button {
    display: inline-grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    padding: 0;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--tcaf-muted);
    font-size: 20px;
    line-height: 1;
}

.tcafcrm-notice.is-error {
    border-color: #e0aaa5;
    background: var(--tcaf-danger-pale);
}

.tcafcrm-notice.is-error > span {
    background: #f8d9d5;
    color: var(--tcaf-danger);
}

/* Modal */
body.tcafcrm-modal-open {
    overflow: hidden;
}

.tcafcrm-modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.tcafcrm-modal-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(13, 12, 9, 0.72);
    backdrop-filter: blur(7px);
}

.tcafcrm-modal-card {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: calc(100dvh - 48px);
    overflow: auto;
    border: 1px solid #dcc692;
    border-radius: 20px;
    background: var(--tcaf-paper);
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.34);
    animation: tcafcrm-modal-in 190ms ease both;
}

.tcafcrm-modal-head {
    position: sticky;
    z-index: 3;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 25px;
    border-bottom: 1px solid var(--tcaf-line);
    background: rgba(255, 253, 249, 0.97);
    backdrop-filter: blur(10px);
}

.tcafcrm-modal-head h2 {
    margin-bottom: 0;
    font-size: 36px;
}

.tcafcrm-modal-head .tcafcrm-icon-link {
    border-color: var(--tcaf-line-strong);
    background: #faf7f1;
    color: var(--tcaf-ink-soft);
}

.tcafcrm-modal-card > .tcafcrm-form-grid {
    padding: 25px;
}

.tcafcrm-modal-actions {
    display: flex;
    grid-column: span 2;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 6px;
}

/* Login */
.tcafcrm-auth-wrap {
    display: grid;
    min-height: 100dvh;
    place-items: center;
    padding: 30px 18px;
    background:
        linear-gradient(rgba(17, 16, 12, 0.86), rgba(17, 16, 12, 0.91)),
        radial-gradient(circle at 20% 20%, rgba(198, 161, 91, 0.38), transparent 34rem),
        #14130f;
    color: var(--tcaf-white);
    font-family: var(--tcaf-font);
}

.tcafcrm-login-card {
    width: min(450px, 100%);
    padding: clamp(30px, 6vw, 50px);
    border: 1px solid rgba(198, 161, 91, 0.42);
    border-radius: 24px;
    background: rgba(255, 253, 249, 0.97);
    color: var(--tcaf-ink);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.38);
}

.tcafcrm-login-card .tcafcrm-brand-mark {
    margin-bottom: 25px;
}

.tcafcrm-auth-kicker {
    margin-bottom: 7px;
    color: var(--tcaf-gold-dark);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.tcafcrm-login-card h1 {
    margin-bottom: 12px;
    font-size: clamp(42px, 8vw, 58px);
}

.tcafcrm-login-card > p:not(.tcafcrm-auth-kicker) {
    margin-bottom: 25px;
    color: var(--tcaf-ink-soft);
    font-size: 13px;
    line-height: 1.65;
}

.tcafcrm-login-card form p {
    margin: 0 0 15px;
}

.tcafcrm-login-card form label {
    display: block;
    margin-bottom: 6px;
    color: #4d483f;
    font-size: 11px;
    font-weight: 700;
}

.tcafcrm-login-card input[type="text"],
.tcafcrm-login-card input[type="email"],
.tcafcrm-login-card input[type="password"] {
    min-height: 50px;
    padding: 12px 14px;
}

.tcafcrm-login-card .login-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}

.tcafcrm-login-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--tcaf-gold-dark);
}

.tcafcrm-login-card .login-submit {
    margin-bottom: 13px;
}

.tcafcrm-login-card input[type="submit"] {
    width: 100%;
    min-height: 50px;
    padding: 12px 18px;
    border: 1px solid #d2ad62;
    border-radius: 11px;
    background: linear-gradient(145deg, #d7b66f, #b98b3c);
    color: #17130b;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(137, 96, 30, 0.23);
}

.tcafcrm-forgot {
    display: inline-block;
    color: var(--tcaf-gold-deep);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.tcafcrm-forgot:hover { text-decoration: underline; }

@keyframes tcafcrm-pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

@keyframes tcafcrm-spin { to { transform: rotate(360deg); } }

@keyframes tcafcrm-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tcafcrm-modal-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Medium desktop */
@media (max-width: 1240px) {
    .tcafcrm-workspace {
        grid-template-columns: 320px minmax(0, 1fr);
        gap: 16px;
        padding-right: 16px;
        padding-left: 16px;
    }

    .tcafcrm-record-head { align-items: flex-start; }

    .tcafcrm-record-head-actions {
        align-items: flex-end;
        flex-direction: column;
    }

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

    .tcafcrm-followup-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

/* Tablet and mobile use one clear screen at a time. */
@media (max-width: 900px) {
    :root { --tcaf-topbar-height: 70px; }

    .tcafcrm-topbar {
        min-height: var(--tcaf-topbar-height);
        padding: 10px 14px;
    }

    .tcafcrm-workspace {
        display: block;
        width: 100%;
        min-height: calc(100dvh - var(--tcaf-topbar-height));
        padding: 14px;
    }

    .tcafcrm-queue {
        position: static;
        width: 100%;
        height: calc(100dvh - var(--tcaf-topbar-height) - 28px);
        min-height: 500px;
        border-radius: 18px;
    }

    .tcafcrm-record {
        display: none;
        width: 100%;
        border-radius: 18px;
    }

    .tcafcrm-simple.is-record-open .tcafcrm-queue { display: none; }
    .tcafcrm-simple.is-record-open .tcafcrm-record { display: block; }

    .tcafcrm-mobile-back {
        display: inline-flex;
        min-height: 42px;
        align-items: center;
        gap: 6px;
        align-self: flex-start;
        padding: 8px 10px 8px 6px;
        border: 0;
        background: transparent;
        color: var(--tcaf-gold-deep);
        font-size: 12px;
        font-weight: 700;
    }

    .tcafcrm-record-head {
        display: grid;
        min-height: auto;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 14px;
        padding: 15px 18px 19px;
    }

    .tcafcrm-mobile-back { grid-column: 1 / -1; }
    .tcafcrm-record-head-actions { align-items: flex-end; }
    .tcafcrm-record-nav { display: none; }

    .tcafcrm-contact-actions,
    .tcafcrm-contact-blocked {
        padding-right: 18px;
        padding-left: 18px;
    }

    .tcafcrm-lead-form { padding: 18px; }
    .tcafcrm-history { margin: 0 18px 22px; }

    .tcafcrm-empty-record,
    .tcafcrm-record-loading {
        min-height: calc(100dvh - var(--tcaf-topbar-height) - 28px);
    }

    .tcafcrm-save-bar { bottom: 8px; }
}

@media (max-width: 680px) {
    .tcafcrm-brand > span:last-child small,
    .tcafcrm-welcome { display: none; }

    .tcafcrm-brand strong { font-size: 14px; }

    .tcafcrm-top-actions { gap: 7px; }

    .tcafcrm-icon-link {
        width: 44px;
        min-height: 44px;
    }

    .tcafcrm-top-actions .tcafcrm-button {
        min-height: 44px;
        padding: 10px 13px;
        font-size: 12px;
    }

    .tcafcrm-form-grid,
    .tcafcrm-original-enquiry dl { grid-template-columns: 1fr; }

    .tcafcrm-span-2,
    .tcafcrm-modal-actions { grid-column: span 1; }

    .tcafcrm-outcome-grid { grid-template-columns: 1fr; }
    .tcafcrm-record-head { grid-template-columns: 1fr; }
    .tcafcrm-record-head-actions { align-items: stretch; }
    .tcafcrm-delete-button { justify-self: start; }

    .tcafcrm-contact-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .tcafcrm-contact-actions a {
        min-width: 0;
        padding-right: 8px;
        padding-left: 8px;
    }

    .tcafcrm-save-bar {
        position: sticky;
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        padding: 13px;
    }

    .tcafcrm-save-bar > span {
        justify-content: center;
        text-align: center;
    }

    .tcafcrm-save-bar > div {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .tcafcrm-save-bar .tcafcrm-button {
        width: 100%;
        padding-right: 8px;
        padding-left: 8px;
    }

    .tcafcrm-timeline li > div > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .tcafcrm-modal { padding: 10px; }

    .tcafcrm-modal-card {
        max-height: calc(100dvh - 20px);
        border-radius: 17px;
    }

    .tcafcrm-modal-head,
    .tcafcrm-modal-card > .tcafcrm-form-grid { padding: 19px; }

    .tcafcrm-modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 460px) {
    :root { --tcaf-topbar-height: 64px; }

    .tcafcrm-topbar { padding: 8px 10px; }
    .tcafcrm-brand { gap: 8px; }

    .tcafcrm-brand-mark {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 10px;
        font-size: 11px;
    }

    .tcafcrm-brand strong { font-size: 13px; }

    .tcafcrm-top-actions .tcafcrm-button {
        width: 43px;
        padding: 0;
    }

    .tcafcrm-top-actions .tcafcrm-button span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .tcafcrm-icon-link {
        width: 43px;
        min-height: 43px;
    }

    .tcafcrm-workspace { padding: 8px; }

    .tcafcrm-queue {
        height: calc(100dvh - var(--tcaf-topbar-height) - 16px);
        min-height: 430px;
        border-radius: 15px;
    }

    .tcafcrm-queue-head { padding: 18px 17px 12px; }

    .tcafcrm-search {
        padding-right: 12px;
        padding-left: 12px;
    }

    .tcafcrm-filter {
        width: calc(100% - 24px);
        margin-right: 12px;
        margin-left: 12px;
    }

    .tcafcrm-list {
        padding-right: 6px;
        padding-left: 6px;
    }

    .tcafcrm-record { border-radius: 15px; }
    .tcafcrm-record-head { padding: 13px 13px 17px; }

    .tcafcrm-record-avatar {
        width: 51px;
        height: 51px;
        font-size: 13px;
    }

    .tcafcrm-record-identity { gap: 11px; }
    .tcafcrm-record-identity h2 { font-size: 31px; }

    .tcafcrm-contact-actions,
    .tcafcrm-contact-blocked { padding: 11px 13px; }

    .tcafcrm-contact-actions a {
        min-height: 43px;
        font-size: 11px;
    }

    .tcafcrm-lead-form { padding: 12px; }

    .tcafcrm-section {
        padding: 18px 15px;
        border-radius: 13px;
    }

    .tcafcrm-section + .tcafcrm-section { margin-top: 13px; }

    .tcafcrm-section-head {
        gap: 10px;
        margin-bottom: 17px;
    }

    .tcafcrm-section-head > span {
        width: 29px;
        height: 29px;
        flex-basis: 29px;
    }

    .tcafcrm-section-head h3 { font-size: 25px; }
    .tcafcrm-form-grid { gap: 13px; }
    .tcafcrm-outcome-option > span { min-height: 52px; }

    .tcafcrm-date-shortcuts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tcafcrm-date-shortcuts button { width: 100%; }

    .tcafcrm-save-bar {
        bottom: 5px;
        margin-top: 14px;
        border-radius: 12px;
    }

    .tcafcrm-save-bar > div { grid-template-columns: 1fr; }

    .tcafcrm-history {
        margin: 0 12px 14px;
        padding: 18px 15px;
        border-radius: 13px;
    }

    .tcafcrm-modal-actions { grid-template-columns: 1fr; }

    .tcafcrm-notice {
        top: calc(var(--tcaf-topbar-height) + 8px);
        right: 8px;
        width: calc(100vw - 16px);
    }

    .tcafcrm-login-card {
        padding: 28px 22px;
        border-radius: 19px;
    }
}

@media (max-width: 360px) {
    .tcafcrm-brand > span:last-child {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .tcafcrm-top-actions {
        gap: 5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tcafcrm-simple *,
    .tcafcrm-auth-wrap * {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
