/* Leads: an editorial work ledger for incoming furniture requests. */

.lead-command-bar {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.lead-metrics {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.lead-metric {
    position: relative;
    min-height: 112px;
    overflow: hidden;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 17px 18px;
    background: rgba(255, 253, 248, 0.62);
}

.lead-metric::after {
    position: absolute;
    right: -22px;
    bottom: -22px;
    width: 68px;
    height: 68px;
    border: 1px solid rgba(29, 34, 32, 0.08);
    content: "";
    transform: rotate(28deg);
}

.lead-metric > span,
.lead-metric > strong,
.lead-metric > small {
    display: block;
}

.lead-metric > span {
    color: var(--ink-soft);
    font-size: 9px;
    font-weight: 760;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.lead-metric > strong {
    margin-top: 11px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    font-weight: 400;
    line-height: 1;
}

.lead-metric > small {
    margin-top: 8px;
    color: #858b86;
    font-size: 10px;
}

.lead-metric-blue > strong { color: #466a7c; }
.lead-metric-copper > strong { color: var(--copper-dark); }
.lead-metric-danger > strong { color: var(--danger); }

.lead-create-button {
    min-width: 190px;
    align-self: flex-end;
}

.lead-workbench {
    border: 1px solid var(--line);
    background: var(--paper-strong);
    box-shadow: 0 16px 42px rgba(35, 30, 24, 0.055);
}

.lead-status-rail {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: var(--sidebar);
    scrollbar-width: thin;
}

.lead-status-tab {
    position: relative;
    display: inline-flex;
    min-width: max-content;
    min-height: 52px;
    align-items: center;
    gap: 9px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 17px;
    background: transparent;
    color: rgba(255, 255, 255, 0.57);
    cursor: pointer;
    font-size: 11px;
    transition: background 150ms ease, color 150ms ease;
}

.lead-status-tab::after {
    position: absolute;
    right: 13px;
    bottom: 0;
    left: 13px;
    height: 2px;
    background: transparent;
    content: "";
}

.lead-status-tab i {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--lead-status, #8f9892);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lead-status, #8f9892) 18%, transparent);
}

.lead-status-tab:first-child i {
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    box-shadow: none;
}

.lead-status-tab:hover,
.lead-status-tab.is-active {
    background: rgba(255, 255, 255, 0.055);
    color: #fff;
}

.lead-status-tab.is-active::after {
    background: var(--lead-status, var(--copper));
}

.lead-filter-panel {
    display: grid;
    grid-template-columns: minmax(250px, 1.6fr) repeat(5, minmax(135px, auto)) auto auto;
    gap: 9px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 13px;
    background: #f8f5ee;
}

.lead-filter-panel select,
.lead-filter-panel .search-field input {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 11px;
}

.lead-filter-panel select {
    min-width: 0;
    padding: 0 31px 0 11px;
}

.lead-filter-panel select:focus,
.lead-filter-panel .search-field input:focus {
    border-color: var(--copper);
    box-shadow: 0 0 0 3px rgba(185, 101, 63, 0.1);
    outline: none;
}

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

.lead-ledger-head,
.lead-ledger-row {
    display: grid;
    grid-template-columns: minmax(190px, 1.3fr) minmax(210px, 1.65fr) minmax(150px, 0.95fr) minmax(140px, 0.9fr) minmax(135px, 0.85fr) minmax(110px, 0.7fr);
    align-items: center;
}

.lead-ledger-head {
    min-width: 1080px;
    border-bottom: 1px solid var(--line);
    padding: 0 16px;
    background: #fffdf8;
}

.lead-ledger-head > span {
    padding: 13px 10px;
    color: #858b86;
    font-size: 8px;
    font-weight: 780;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.lead-ledger {
    overflow-x: auto;
}

.lead-ledger-row {
    min-width: 1080px;
    min-height: 84px;
    border-bottom: 1px solid #e7e3da;
    padding: 0 16px;
    color: var(--ink);
    text-decoration: none;
    transition: background 140ms ease, box-shadow 140ms ease;
}

.lead-ledger-row:last-child {
    border-bottom: 0;
}

.lead-ledger-row:hover {
    position: relative;
    z-index: 1;
    background: #fbf8f2;
    box-shadow: inset 3px 0 0 var(--copper);
}

.lead-ledger-row > span {
    min-width: 0;
    padding: 14px 10px;
}

.lead-ledger-row strong,
.lead-ledger-row small {
    display: block;
}

.lead-ledger-row strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-ledger-row small {
    overflow: hidden;
    margin-top: 5px;
    color: var(--ink-soft);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-contact-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lead-index {
    display: grid;
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--copper-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9px;
    font-style: normal;
}

.lead-contact-cell > span,
.lead-subject-cell {
    min-width: 0;
}

.lead-status-badge {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    gap: 7px;
    border: 1px solid color-mix(in srgb, var(--lead-status, #6b7280) 38%, #e0ddd6);
    padding: 0 9px;
    background: color-mix(in srgb, var(--lead-status, #6b7280) 8%, white);
    color: var(--ink);
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.lead-status-badge i {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: var(--lead-status, #6b7280);
}

.lead-priority {
    display: block;
    margin-top: 6px;
    color: #858b86;
    font-size: 9px;
    font-style: normal;
}

.lead-priority-high,
.lead-priority-urgent {
    color: var(--danger) !important;
}

.lead-priority-low {
    color: var(--sage) !important;
}

.lead-assignee-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lead-assignee-cell > i {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    place-items: center;
    background: #e9e5dc;
    color: var(--ink-soft);
    font-size: 8px;
    font-style: normal;
    font-weight: 750;
}

.lead-assignee-cell > span {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-follow-cell strong {
    font-size: 10px;
}

.lead-follow-cell.is-planned strong { color: var(--success); }
.lead-follow-cell.is-overdue strong,
.lead-follow-cell.is-overdue small { color: var(--danger); }
.lead-follow-cell.is-closed { opacity: 0.58; }

.lead-created-cell strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9px;
    font-weight: 650;
}

.lead-empty-state {
    display: flex;
    min-height: 260px;
    align-items: center;
    justify-content: center;
    gap: 26px;
    padding: 35px;
    background:
        linear-gradient(rgba(29, 34, 32, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(29, 34, 32, 0.025) 1px, transparent 1px),
        #fffdf8;
    background-size: 34px 34px;
}

.lead-empty-state > span {
    color: var(--line);
    font-family: Georgia, serif;
    font-size: 86px;
    line-height: 1;
}

.lead-empty-state h2 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 30px;
    font-weight: 400;
}

.lead-empty-state p {
    max-width: 430px;
    margin: 9px 0 0;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.6;
}

.lead-pagination {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
    padding: 9px 14px;
}

.lead-pagination > span {
    color: var(--ink-soft);
    font-size: 10px;
}

/* Lead record */

.lead-detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.lead-detail-toolbar > div {
    display: flex;
    gap: 9px;
}

.lead-back-link {
    border-bottom: 1px solid transparent;
    color: var(--copper-dark);
    font-size: 11px;
    text-decoration: none;
}

.lead-back-link:hover {
    border-bottom-color: currentColor;
}

.lead-record-head {
    position: relative;
    display: grid;
    min-height: 190px;
    grid-template-columns: 170px minmax(0, 1fr) 150px;
    overflow: hidden;
    border: 1px solid var(--line-dark);
    background: var(--sidebar);
    color: #f8f3eb;
}

.lead-record-head::after {
    position: absolute;
    top: -115px;
    right: 16%;
    width: 260px;
    height: 350px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    content: "";
    transform: rotate(24deg);
}

.lead-record-number,
.lead-record-priority {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px;
}

.lead-record-number {
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.lead-record-number > span,
.lead-record-priority > span {
    color: rgba(255, 255, 255, 0.46);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.lead-record-number > strong {
    color: rgba(255, 255, 255, 0.88);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 26px;
    font-weight: 450;
    letter-spacing: 0.08em;
}

.lead-record-title {
    position: relative;
    z-index: 1;
    align-self: center;
    padding: 28px clamp(24px, 4vw, 56px);
}

.lead-record-title .lead-status-badge {
    border-color: color-mix(in srgb, var(--lead-status, #6b7280) 55%, transparent);
    background: color-mix(in srgb, var(--lead-status, #6b7280) 20%, transparent);
    color: #fff;
}

.lead-record-title h1 {
    max-width: 720px;
    margin: 18px 0 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(32px, 4vw, 54px);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.lead-record-title p {
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
}

.lead-record-priority {
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.lead-record-priority > strong {
    font-family: Georgia, serif;
    font-size: 20px;
    font-weight: 400;
}

.lead-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.75fr);
    gap: 22px;
    margin-top: 22px;
}

.lead-detail-main,
.lead-detail-side {
    display: grid;
    align-content: start;
    gap: 18px;
}

.lead-detail-card,
.lead-side-card {
    border: 1px solid var(--line);
    background: var(--paper-strong);
}

.lead-detail-card {
    padding: clamp(22px, 3vw, 34px);
}

.lead-side-card {
    padding: 22px;
}

.lead-section-heading {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.lead-section-heading > span,
.lead-side-index {
    color: var(--copper-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9px;
    letter-spacing: 0.08em;
}

.lead-section-heading h3 {
    margin: 0;
    font-size: 10px;
    font-weight: 780;
    letter-spacing: 0.105em;
    text-transform: uppercase;
}

.lead-section-heading small {
    display: grid;
    min-width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 9px;
}

.lead-contact-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lead-contact-profile > span {
    display: grid;
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    place-items: center;
    background: var(--sidebar-soft);
    color: #fff;
    font-family: Georgia, serif;
    font-size: 20px;
}

.lead-contact-profile h2,
.lead-request-card h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
    font-weight: 400;
}

.lead-contact-profile p {
    margin: 5px 0 0;
    color: var(--ink-soft);
    font-size: 11px;
}

.lead-contact-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.lead-contact-actions > a,
.lead-contact-actions > div {
    min-width: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 15px;
    color: var(--ink);
    text-decoration: none;
}

.lead-contact-actions span,
.lead-contact-actions strong {
    display: block;
}

.lead-contact-actions span {
    color: var(--ink-soft);
    font-size: 8px;
    font-weight: 760;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.lead-contact-actions strong {
    overflow: hidden;
    margin-top: 7px;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-contact-actions a:hover {
    background: #faf5ed;
    color: var(--copper-dark);
}

.lead-request-card > h2 {
    font-size: 34px;
}

.lead-message {
    margin-top: 20px;
    border-left: 2px solid var(--copper);
    padding: 4px 0 4px 19px;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.75;
}

.lead-message > span {
    color: #999d99;
    font-style: italic;
}

.lead-facts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 28px 0 0;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.lead-facts-grid > div {
    min-width: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 13px;
}

.lead-facts-grid dt {
    color: var(--ink-soft);
    font-size: 8px;
    font-weight: 760;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.lead-facts-grid dd {
    overflow: hidden;
    margin: 7px 0 0;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-note-form {
    border: 1px solid var(--line);
    padding: 15px;
    background: #f9f6ef;
}

.lead-note-form textarea,
.lead-status-form textarea,
.lead-form-stack textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 12px 14px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    line-height: 1.55;
    resize: vertical;
}

.lead-note-form textarea:focus,
.lead-status-form textarea:focus,
.lead-form-stack textarea:focus {
    border-color: var(--copper);
    box-shadow: 0 0 0 3px rgba(185, 101, 63, 0.1);
    outline: none;
}

.lead-note-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 11px;
}

.lead-note-controls > label {
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 10px;
}

.lead-note-controls input {
    accent-color: var(--copper);
}

.lead-notes-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.lead-note {
    border: 1px solid var(--line);
    border-left: 3px solid #b8b8b1;
    padding: 15px 17px;
    background: #fff;
}

.lead-note.is-pinned {
    border-left-color: var(--copper);
    background: #fffaf4;
}

.lead-note header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-soft);
    font-size: 9px;
}

.lead-note p {
    margin: 11px 0 0;
    font-size: 12px;
    line-height: 1.65;
}

.lead-attribution-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.lead-attribution-grid article {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 19px;
}

.lead-attribution-grid span,
.lead-attribution-grid strong {
    display: block;
}

.lead-attribution-grid span {
    color: var(--ink-soft);
    font-size: 8px;
    font-weight: 760;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.lead-attribution-grid strong {
    margin-top: 12px;
    font-family: Georgia, serif;
    font-size: 22px;
    font-weight: 400;
}

.lead-attribution-grid p {
    margin: 6px 0 0;
    color: var(--ink-soft);
    font-size: 10px;
}

.lead-status-form {
    display: grid;
    gap: 14px;
}

.lead-readonly-status span,
.lead-readonly-status strong {
    display: block;
}

.lead-readonly-status span {
    color: var(--ink-soft);
    font-size: 9px;
    text-transform: uppercase;
}

.lead-readonly-status strong {
    margin-top: 7px;
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 400;
}

.lead-side-divider {
    height: 1px;
    margin: 20px 0;
    background: var(--line);
}

.lead-side-fact {
    display: grid;
    grid-template-columns: minmax(100px, 0.75fr) minmax(0, 1.25fr);
    gap: 12px;
    border-bottom: 1px solid #e7e3da;
    padding: 11px 0;
}

.lead-side-fact:last-child {
    border-bottom: 0;
}

.lead-side-fact span {
    color: var(--ink-soft);
    font-size: 9px;
}

.lead-side-fact strong {
    font-size: 10px;
    line-height: 1.45;
}

.lead-conversion-card {
    position: relative;
    overflow: hidden;
    background: #ede8df;
}

.lead-conversion-card::after {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 110px;
    height: 110px;
    border: 1px solid rgba(29, 34, 32, 0.09);
    content: "";
    transform: rotate(31deg);
}

.lead-conversion-card h3 {
    margin: 24px 0 8px;
    font-family: Georgia, serif;
    font-size: 25px;
    font-weight: 400;
}

.lead-conversion-card p {
    margin: 0 0 20px;
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.55;
}

.lead-timeline {
    position: relative;
    display: grid;
    gap: 18px;
}

.lead-timeline::before {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 5px;
    width: 1px;
    background: var(--line);
    content: "";
}

.lead-timeline article {
    position: relative;
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 12px;
}

.lead-timeline article > i {
    position: relative;
    z-index: 1;
    width: 11px;
    height: 11px;
    margin-top: 2px;
    border: 3px solid var(--paper-strong);
    border-radius: 50%;
    background: var(--lead-status, #6b7280);
    box-shadow: 0 0 0 1px var(--lead-status, #6b7280);
}

.lead-timeline strong,
.lead-timeline span {
    display: block;
}

.lead-timeline strong {
    font-size: 10px;
}

.lead-timeline span {
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 8px;
}

.lead-timeline p {
    margin: 7px 0 0;
    color: var(--ink-soft);
    font-size: 9px;
    line-height: 1.5;
}

.lead-activity-list {
    display: grid;
}

.lead-activity-list article {
    display: grid;
    border-top: 1px solid #e7e3da;
    padding: 11px 0;
}

.lead-activity-list article:first-child {
    border-top: 0;
    padding-top: 0;
}

.lead-activity-list span,
.lead-activity-list small {
    color: var(--ink-soft);
    font-size: 8px;
}

.lead-activity-list strong {
    margin: 4px 0;
    font-size: 10px;
    line-height: 1.4;
}

.lead-muted-empty {
    margin: 0;
    color: #929792;
    font-size: 10px;
    font-style: italic;
}

/* Create and edit dialog */

.lead-modal {
    width: min(940px, calc(100vw - 28px));
}

.lead-form-section {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding: 0 0 25px;
    margin-bottom: 25px;
}

.lead-form-section:last-of-type {
    margin-bottom: 0;
}

.lead-form-index {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--copper-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9px;
}

.lead-form-section h3 {
    margin: 9px 0 18px;
    font-family: Georgia, serif;
    font-size: 23px;
    font-weight: 400;
}

.lead-form-stack {
    display: grid;
    gap: 18px;
}

@media (max-width: 1420px) {
    .lead-filter-panel {
        grid-template-columns: minmax(250px, 1.5fr) repeat(3, minmax(140px, 1fr)) auto auto;
    }

    .lead-filter-panel select:nth-of-type(4),
    .lead-filter-panel select:nth-of-type(5) {
        grid-row: 2;
    }
}

@media (max-width: 1180px) {
    .lead-command-bar {
        flex-direction: column;
    }

    .lead-create-button {
        align-self: flex-start;
    }

    .lead-detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .lead-detail-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lead-workflow-card,
    .lead-history-card {
        grid-row: span 2;
    }
}

@media (max-width: 960px) {
    .lead-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lead-filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lead-filter-panel .lead-search {
        grid-column: 1 / -1;
    }

    .lead-filter-panel select:nth-of-type(4),
    .lead-filter-panel select:nth-of-type(5) {
        grid-row: auto;
    }

    .lead-record-head {
        grid-template-columns: 130px minmax(0, 1fr);
    }

    .lead-record-priority {
        display: none;
    }

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

@media (max-width: 700px) {
    .lead-command-bar {
        margin-bottom: 16px;
    }

    .lead-create-button {
        width: 100%;
    }

    .lead-status-tab {
        min-height: 48px;
        padding: 0 14px;
    }

    .lead-filter-panel {
        grid-template-columns: 1fr;
    }

    .lead-filter-panel .lead-search {
        grid-column: auto;
    }

    .lead-ledger-head {
        display: none;
    }

    .lead-ledger {
        overflow: visible;
    }

    .lead-ledger-row {
        display: grid;
        min-width: 0;
        min-height: 0;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        padding: 12px;
    }

    .lead-ledger-row > span {
        padding: 9px;
    }

    .lead-contact-cell,
    .lead-subject-cell {
        grid-column: 1 / -1;
    }

    .lead-subject-cell {
        border-bottom: 1px solid #e7e3da;
        padding-bottom: 15px !important;
    }

    .lead-created-cell {
        display: none;
    }

    .lead-detail-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .lead-detail-toolbar > div {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .lead-record-head {
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .lead-record-number {
        min-height: 62px;
        flex-direction: row;
        align-items: center;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        padding: 15px 18px;
    }

    .lead-record-number > strong {
        font-size: 15px;
    }

    .lead-record-title {
        padding: 28px 20px 32px;
    }

    .lead-record-title h1 {
        font-size: 34px;
    }

    .lead-detail-layout {
        gap: 16px;
        margin-top: 16px;
    }

    .lead-detail-side {
        grid-template-columns: 1fr;
    }

    .lead-workflow-card,
    .lead-history-card {
        grid-row: auto;
    }

    .lead-contact-actions,
    .lead-attribution-grid {
        grid-template-columns: 1fr;
    }

    .lead-note-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .lead-note header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 500px) {
    .lead-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .lead-metric {
        min-height: 96px;
        padding: 14px;
    }

    .lead-metric > strong {
        font-size: 28px;
    }

    .lead-metric > small {
        display: none;
    }

    .lead-empty-state {
        align-items: flex-start;
        flex-direction: column;
    }

    .lead-empty-state > span {
        font-size: 60px;
    }

    .lead-pagination {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }

    .lead-detail-toolbar > div,
    .lead-facts-grid {
        grid-template-columns: 1fr;
    }

    .lead-detail-card,
    .lead-side-card {
        padding: 18px;
    }

    .lead-contact-profile > span {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }

    .lead-form-section {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
