:root {
    --ink: #071743;
    --muted: #586a95;
    --line: #dbe4f3;
    --panel: #ffffff;
    --surface: #f5f8fd;
    --blue: #0f63ff;
    --blue-dark: #001f56;
    --blue-deep: #00123d;
    --teal: #12c1c8;
    --teal-dark: #079aa4;
    --green: #12945a;
    --orange: #f59a23;
    --purple: #7d46f2;
    --shadow: 0 18px 45px rgba(11, 31, 78, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

.app-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 70% 5%, rgba(157, 194, 236, 0.28), transparent 34%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.auth-body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex: 0 0 92px;
    flex-direction: column;
    height: 100vh;
    padding: 24px 14px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background:
        linear-gradient(180deg, rgba(10, 21, 34, 0.94), rgba(4, 10, 18, 0.98)),
        repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
        #06101c;
    border-right: 1px solid rgba(104, 124, 153, 0.26);
    color: #f5f8fb;
}

/* Matter dashboard refresh */
.matter-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    gap: 24px;
    align-items: start;
    width: min(100%, 1580px);
    color: #071743;
}

.matter-dashboard-main,
.matter-side-rail,
.matter-bottom-grid {
    min-width: 0;
}

.matter-dashboard-main,
.matter-side-rail,
.matter-bottom-grid,
.matter-activity-list,
.matter-people-list,
.matter-deadline-list {
    display: grid;
    gap: 16px;
}

.matter-dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    min-width: 0;
}

.matter-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #52647d;
    font-size: 13px;
    font-weight: 700;
}

.matter-breadcrumb a,
.matter-breadcrumb span,
.matter-breadcrumb svg {
    color: inherit;
}

.matter-breadcrumb a {
    text-decoration: none;
}

.matter-breadcrumb svg {
    width: 15px;
    height: 15px;
}

.matter-dashboard-hero h1 {
    max-width: 860px;
    margin: 14px 0 0;
    color: #071743;
    font-size: 34px;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.08;
}

.matter-dashboard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 16px;
    color: #243659;
    font-size: 14px;
    font-weight: 650;
}

.matter-dashboard-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.matter-dashboard-meta span + span {
    position: relative;
}

.matter-dashboard-meta span + span::before {
    width: 1px;
    height: 18px;
    margin-right: 7px;
    background: #cdd7e6;
    content: "";
}

.matter-dashboard-meta svg {
    width: 17px;
    height: 17px;
    color: #263b62;
}

.matter-meta-status i {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #12a66a;
    box-shadow: 0 0 0 3px rgba(18, 166, 106, 0.12);
}

.matter-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.matter-dashboard .matter-button,
.disclosure-wizard-modal .matter-button {
    border-radius: 8px;
}

.matter-dashboard .matter-button-primary,
.disclosure-wizard-modal .matter-button-primary {
    border: 1px solid rgba(18, 193, 200, 0.34);
    background:
        linear-gradient(90deg, rgba(18, 193, 200, 0.22), rgba(255, 255, 255, 0.06)),
        #07111e;
    color: #ffffff;
    box-shadow: 0 14px 24px rgba(4, 10, 18, 0.18);
}

.matter-dashboard .matter-button-secondary,
.disclosure-wizard-modal .matter-button-secondary {
    border: 1px solid #cfd8e7;
    background: #ffffff;
    color: #071743;
    box-shadow: 0 1px 1px rgba(18, 44, 86, 0.03);
}

.matter-dashboard .matter-button-primary:hover,
.disclosure-wizard-modal .matter-button-primary:hover {
    border-color: rgba(18, 193, 200, 0.62);
    color: #ffffff;
}

.matter-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.matter-stat-card,
.matter-folder-panel,
.matter-info-panel {
    border: 1px solid #dce5f1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 36px rgba(11, 31, 78, 0.06);
}

.matter-stat-card {
    display: grid;
    gap: 8px;
    min-width: 0;
    min-height: 132px;
    padding: 18px;
}

.matter-stat-card-wide {
    grid-column: span 1;
}

.matter-stat-icon {
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    border-radius: 8px;
    background: #eef5f7;
    color: #0b5260;
}

.matter-stat-icon svg {
    width: 21px;
    height: 21px;
}

.matter-stat-icon.is-green {
    background: #e7f8ef;
    color: #0e8752;
}

.matter-stat-icon.is-blue,
.matter-stat-icon.is-check {
    background: #e9f7f8;
    color: #087f86;
}

.matter-stat-icon.is-shield {
    background: #eef5f7;
    color: #263b62;
}

.matter-stat-icon.is-person {
    background: #f1f4f8;
    color: #071743;
}

.matter-stat-card small,
.matter-invoice-summary small,
.matter-detail-list dt {
    color: #52647d;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.matter-stat-card strong {
    min-width: 0;
    color: #071743;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.matter-stat-card p {
    margin: 0;
    color: #50617a;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
}

.matter-folder-panel,
.matter-info-panel {
    padding: 22px;
}

.matter-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    margin-bottom: 16px;
}

.matter-panel-heading h2 {
    margin: 0;
    color: #071743;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.2;
}

.matter-panel-heading p {
    margin: 7px 0 0;
    color: #52647d;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
}

.matter-panel-heading a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #071743;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.matter-panel-heading a svg {
    width: 15px;
    height: 15px;
    color: #0b8b92;
}

.matter-panel-heading-inline {
    align-items: center;
}

.matter-panel-heading-icon {
    align-items: center;
    justify-content: flex-start;
}

.matter-panel-heading-icon > svg {
    width: 19px;
    height: 19px;
    color: #0b8b92;
}

.matter-folder-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    padding-bottom: 2px;
}

.matter-folder-card {
    display: grid;
    align-content: space-between;
    gap: 20px;
    min-width: 0;
    min-height: 150px;
    padding: 16px;
    border: 1px solid #dce5f1;
    border-radius: 8px;
    background: #ffffff;
}

.matter-folder-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.matter-folder-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    background: #eaf7f8;
    color: #087f86;
}

.matter-folder-icon svg {
    width: 24px;
    height: 24px;
}

.matter-folder-icon-1,
.matter-folder-icon-5 {
    background: #edf3f7;
    color: #17425f;
}

.matter-folder-icon-2 {
    background: #f2eefa;
    color: #6b42b8;
}

.matter-folder-icon-4 {
    background: #f2eafa;
    color: #7c33aa;
}

.matter-folder-card h3 {
    margin: 2px 0 7px;
    color: #071743;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.matter-folder-card p {
    margin: 0;
    color: #52647d;
    font-size: 13px;
    font-weight: 700;
}

.matter-folder-open {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #dce5f1;
    border-radius: 8px;
    color: #071743;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.matter-folder-open:hover {
    border-color: rgba(18, 193, 200, 0.5);
    background: #f6fbfc;
}

.matter-folder-open svg {
    width: 17px;
    height: 17px;
    color: #071743;
}

.matter-bottom-grid {
    grid-template-columns: minmax(280px, 1.15fr) minmax(280px, 0.95fr) minmax(260px, 0.8fr);
}

.matter-compact-note-form {
    display: grid;
    gap: 10px;
}

.matter-compact-note-form .matter-button {
    justify-self: start;
}

.matter-note-preview {
    margin-top: 14px;
    padding: 14px;
    border-left: 3px solid #f0b429;
    border-radius: 8px;
    background: #fff8e8;
}

.matter-note-preview p {
    margin: 0;
    color: #071743;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-line;
}

.matter-note-preview span {
    display: block;
    margin-top: 12px;
    color: #52647d;
    font-size: 12px;
    font-weight: 700;
}

.matter-activity-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.matter-activity-item > svg {
    width: 22px;
    height: 22px;
    color: #0b8b92;
}

.matter-activity-item div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.matter-activity-item strong,
.matter-activity-item span,
.matter-activity-item time {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.matter-activity-item strong {
    color: #071743;
    font-size: 13px;
    font-weight: 850;
}

.matter-activity-item span,
.matter-activity-item time {
    color: #52647d;
    font-size: 12px;
    font-weight: 650;
}

.matter-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.matter-quick-actions a,
.matter-quick-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 10px;
    border: 1px solid #dce5f1;
    border-radius: 8px;
    background: #ffffff;
    color: #071743;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.matter-quick-actions a:hover,
.matter-quick-actions button:hover {
    border-color: rgba(18, 193, 200, 0.5);
    background: #f6fbfc;
}

.matter-quick-actions svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: #0b8b92;
}

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

.matter-detail-list div {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.matter-detail-list dd {
    min-width: 0;
    margin: 0;
    color: #172842;
    font-size: 13px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.matter-deadline-list article {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.matter-deadline-list i {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #0b8b92;
}

.matter-deadline-list i.is-red {
    background: #e63f35;
}

.matter-deadline-list i.is-orange {
    background: #f5a623;
}

.matter-deadline-list strong,
.matter-deadline-list span {
    overflow: hidden;
    color: #071743;
    font-size: 13px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.matter-deadline-list span {
    color: #52647d;
    font-weight: 650;
}

.matter-invoice-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 112px;
    gap: 12px;
    align-items: center;
}

.matter-invoice-summary div {
    min-width: 0;
}

.matter-invoice-summary strong {
    display: block;
    margin-top: 6px;
    color: #071743;
    font-size: 18px;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.matter-invoice-summary span {
    display: block;
    margin-top: 5px;
    color: #52647d;
    font-size: 12px;
    font-weight: 650;
}

.matter-invoice-ring {
    display: grid;
    width: 96px;
    height: 96px;
    place-items: center;
    justify-self: end;
    padding: 16px;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, #ffffff 0 55%, transparent 56%),
        conic-gradient(#12c1c8 0 72%, #e7edf5 72% 100%);
    text-align: center;
}

.matter-invoice-ring strong {
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
}

.matter-invoice-ring span {
    margin: 2px 0 0;
    font-size: 11px;
}

.matter-people-list article {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 24px;
    gap: 12px;
    align-items: center;
}

.matter-people-list article > span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 999px;
    background: #07111e;
    color: #ffffff;
    font-size: 12px;
    font-weight: 850;
}

.matter-people-list div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.matter-people-list strong,
.matter-people-list small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.matter-people-list strong {
    color: #071743;
    font-size: 13px;
    font-weight: 850;
}

.matter-people-list small {
    color: #52647d;
    font-size: 12px;
    font-weight: 650;
}

.matter-people-list svg {
    width: 18px;
    height: 18px;
    color: #071743;
}

.matter-dashboard .link-button {
    color: #071743;
}

.matter-panel-heading a:hover,
.matter-folder-open:hover,
.matter-quick-actions a:hover,
.matter-quick-actions button:hover {
    color: #063b42;
}

.disclosure-wizard-modal {
    width: min(1120px, calc(100vw - 48px));
    height: min(780px, calc(100vh - 48px));
}

.disclosure-wizard-panel {
    min-height: 0;
}

.disclosure-wizard-body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 18px;
    min-height: 0;
    padding: 20px;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 0%, rgba(18, 193, 200, 0.10), transparent 30%),
        #f8fbff;
}

.disclosure-progress {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.disclosure-progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border: 1px solid #dce5f1;
    border-radius: 8px;
    background: #ffffff;
    color: #52647d;
}

.disclosure-progress-step span {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 999px;
    background: #eef3f8;
    color: #52647d;
    font-size: 12px;
    font-weight: 850;
}

.disclosure-progress-step span svg {
    width: 14px;
    height: 14px;
}

.disclosure-progress-step strong {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.disclosure-progress-step.is-active {
    border-color: rgba(18, 193, 200, 0.48);
    background: #f3fbfc;
    color: #071743;
}

.disclosure-progress-step.is-active span,
.disclosure-progress-step.is-complete span {
    background: #07111e;
    color: #ffffff;
}

.disclosure-progress-step.is-complete {
    color: #071743;
}

.disclosure-wizard-page {
    display: grid;
    align-content: start;
    gap: 18px;
    min-height: 0;
    padding: 22px;
    overflow: hidden;
    border: 1px solid #dce5f1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
}

.disclosure-wizard-copy h3,
.disclosure-final-state h3 {
    margin: 0;
    color: #071743;
    font-size: 22px;
    font-weight: 850;
    line-height: 1.2;
}

.disclosure-wizard-copy p,
.disclosure-final-state p {
    max-width: 760px;
    margin: 8px 0 0;
    color: #52647d;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.55;
}

.disclosure-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    max-width: 760px;
}

.disclosure-review-list {
    display: grid;
    gap: 10px;
    min-height: 0;
    max-height: 440px;
    padding-right: 6px;
    overflow-y: auto;
    scrollbar-color: #bac7d9 #eef3f8;
}

.disclosure-review-list article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
    gap: 14px;
    align-items: center;
    padding: 13px;
    border: 1px solid #dce5f1;
    border-radius: 8px;
    background: #fbfdff;
}

.disclosure-review-list strong,
.disclosure-review-list span,
.disclosure-review-list p {
    overflow-wrap: anywhere;
}

.disclosure-review-list strong {
    display: block;
    color: #071743;
    font-size: 14px;
    font-weight: 850;
}

.disclosure-review-list span {
    display: block;
    margin-top: 4px;
    color: #52647d;
    font-size: 12px;
    font-weight: 650;
}

.disclosure-review-list p {
    margin: 0;
    color: #071743;
    font-size: 13px;
    font-weight: 750;
}

.disclosure-wizard-actions {
    display: flex;
    justify-content: flex-end;
}

.disclosure-wizard-actions .matter-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.disclosure-final-state {
    display: grid;
    justify-items: center;
    align-content: center;
    min-height: 430px;
    text-align: center;
}

.disclosure-final-state > span {
    display: grid;
    width: 108px;
    height: 108px;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 999px;
    background: #e7f8ef;
    color: #0e8752;
    box-shadow: 0 18px 36px rgba(14, 135, 82, 0.15);
}

.disclosure-final-state svg {
    width: 58px;
    height: 58px;
}

.disclosure-final-state .matter-button {
    min-width: 130px;
    margin-top: 18px;
}

@media (max-width: 1320px) {
    .matter-dashboard {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 1120px) {
    .matter-dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .matter-dashboard-actions {
        justify-content: flex-start;
    }

    .matter-stat-grid,
    .matter-folder-grid,
    .matter-bottom-grid,
    .matter-side-rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .disclosure-progress {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .matter-dashboard,
    .matter-dashboard-main,
    .matter-side-rail,
    .matter-bottom-grid {
        gap: 14px;
    }

    .matter-dashboard-hero h1 {
        font-size: 30px;
    }

    .matter-dashboard-meta {
        display: grid;
        gap: 8px;
    }

    .matter-dashboard-meta span + span::before {
        display: none;
    }

    .matter-stat-grid,
    .matter-folder-grid,
    .matter-bottom-grid,
    .matter-side-rail,
    .matter-detail-list div,
    .matter-invoice-summary,
    .disclosure-progress,
    .disclosure-upload-form,
    .disclosure-review-list article {
        grid-template-columns: 1fr;
    }

    .matter-folder-grid {
        display: flex;
        overflow-x: auto;
    }

    .matter-folder-card {
        width: min(82vw, 260px);
        flex: 0 0 auto;
    }

    .matter-invoice-ring {
        justify-self: start;
    }

    .disclosure-wizard-modal {
        width: calc(100vw - 24px);
        height: calc(100vh - 24px);
    }

    .disclosure-wizard-body,
    .disclosure-wizard-page {
        padding: 14px;
    }

    .disclosure-wizard-actions {
        justify-content: stretch;
    }

    .disclosure-wizard-actions .matter-button,
    .disclosure-upload-form .matter-button {
        width: 100%;
    }
}

/* File notes workspace */
.page-content:has(.notes-page) {
    padding: 22px 26px 30px;
}

.notes-page {
    --notes-navy: #07111e;
    --notes-navy-soft: #0b1b2f;
    --notes-teal: #12c1c8;
    --notes-ink: #0a1831;
    --notes-muted: #5f6f89;
    --notes-border: #dce4ee;
    --notes-surface: #f6f9fc;
    display: grid;
    gap: 14px;
    width: min(100%, 1740px);
    margin: 0 auto;
    color: var(--notes-ink);
}

.notes-page button,
.notes-modal button,
.notes-topbar-search {
    font: inherit;
}

.notes-button,
.notes-page button:not(.notes-checklist-item button),
.notes-modal button,
.notes-topbar-search,
.notes-checklist-item button {
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        filter 160ms ease,
        transform 160ms ease;
}

.notes-button,
.notes-topbar-search,
.notes-modal-header > button,
.notes-checklist-item button,
.notes-file-chip button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid rgba(18, 193, 200, 0.34);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(10, 21, 34, 0.94), rgba(4, 10, 18, 0.98)),
        repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
        #06101c;
    color: #f5f8fb;
    box-shadow: 0 9px 18px rgba(4, 10, 18, 0.14);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.notes-button:hover,
.notes-button:focus-visible,
.notes-topbar-search:hover,
.notes-topbar-search:focus-visible,
.notes-modal-header > button:hover,
.notes-modal-header > button:focus-visible,
.notes-checklist-item button:hover,
.notes-checklist-item button:focus-visible,
.notes-file-chip button:hover,
.notes-file-chip button:focus-visible {
    border-color: var(--notes-teal);
    color: #ffffff;
    filter: brightness(1.12);
    outline: 0;
    box-shadow:
        0 0 0 2px rgba(18, 193, 200, 0.16),
        0 0 20px rgba(18, 193, 200, 0.5),
        0 12px 24px rgba(4, 10, 18, 0.2);
    transform: translateY(-1px);
}

.notes-button svg,
.notes-topbar-search svg,
.notes-modal-header > button svg {
    width: 17px;
    height: 17px;
}

.notes-topbar-search {
    width: 44px;
    height: 44px;
    min-height: 44px;
    flex: 0 0 auto;
    padding: 0;
}

.notes-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid #b9e4d0;
    border-radius: 8px;
    background: #effbf5;
    color: #12643f;
    font-size: 13px;
    font-weight: 750;
}

.notes-alert-error {
    border-color: #f4c8c2;
    background: #fff5f3;
    color: #a6372c;
}

.notes-alert svg {
    width: 18px;
    height: 18px;
}

.notes-controls {
    display: grid;
    gap: 11px;
}

.notes-control-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.notes-primary-action {
    min-width: 170px;
    flex: 0 0 auto;
}

.notes-filter-grid {
    display: grid;
    min-width: 0;
    flex: 1;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
}

.notes-select-control,
.notes-search-field,
.notes-input-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--notes-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 4px rgba(11, 31, 78, 0.025);
}

.notes-select-control:focus-within,
.notes-search-field:focus-within,
.notes-input-with-icon:focus-within,
.notes-field input:focus,
.notes-field select:focus {
    border-color: #5bcbd0;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(18, 193, 200, 0.12);
}

.notes-select-control > svg:first-child,
.notes-search-field > svg,
.notes-input-with-icon > svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: #2a3d59;
}

.notes-select-control > svg:last-child {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    color: #71809a;
    pointer-events: none;
}

.notes-select-control select,
.notes-search-field input,
.notes-input-with-icon input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    appearance: none;
    background: transparent;
    color: var(--notes-ink);
    font-size: 13px;
    font-weight: 650;
}

.notes-search-panel {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    animation: notes-search-reveal 180ms ease both;
}

.notes-search-panel[hidden] {
    display: none;
}

.notes-search-field {
    width: min(600px, 100%);
}

.notes-search-field a {
    display: grid;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 999px;
    background: #e8eef5;
    color: #30405a;
}

.notes-search-field a svg {
    width: 14px;
    height: 14px;
}

@keyframes notes-search-reveal {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.notes-stats {
    display: flex;
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--notes-border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 22px rgba(11, 31, 78, 0.045);
}

.notes-stat-card {
    display: grid;
    grid-template-columns: 48px minmax(145px, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 230px;
    padding: 12px 18px;
}

.notes-stat-card + .notes-stat-card {
    border-left: 1px solid #e4e9f0;
}

.notes-stat-card > span {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 10px;
    background: #e8f7f8;
    color: #078a96;
}

.notes-stat-pinned > span,
.notes-stat-followup > span {
    background: #fff6e5;
    color: #bd7900;
}

.notes-stat-card svg {
    width: 22px;
    height: 22px;
}

.notes-stat-card div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1px 12px;
}

.notes-stat-card small {
    color: var(--notes-muted);
    font-size: 11px;
    font-weight: 700;
}

.notes-stat-card strong {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    color: var(--notes-ink);
    font-size: 23px;
    font-weight: 900;
}

.notes-stat-card p {
    margin: 1px 0 0;
    color: #263752;
    font-size: 11px;
    font-weight: 600;
}

.notes-workspace-grid {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 14px;
    min-height: 690px;
    align-items: start;
}

.notes-workspace-grid.has-pinned-notes {
    grid-template-columns: 300px minmax(0, 1fr) 260px;
}

.notes-list-panel,
.notes-detail-panel,
.notes-pinned-panel,
.notes-checklist,
.notes-context-card {
    border: 1px solid var(--notes-border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(11, 31, 78, 0.045);
}

.notes-list-panel {
    position: sticky;
    top: 103px;
    min-width: 0;
    max-height: calc(100vh - 124px);
    overflow: hidden;
}

.notes-list-panel > header,
.notes-pinned-panel > header {
    padding: 13px 14px 11px;
    border-bottom: 1px solid #e5eaf1;
}

.notes-list-panel > header > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notes-list-panel h2,
.notes-pinned-panel h2 {
    margin: 0;
    color: var(--notes-ink);
    font-size: 13px;
    font-weight: 850;
}

.notes-list-panel > header span {
    color: #71809a;
    font-size: 10px;
    font-weight: 750;
}

.notes-list {
    display: grid;
    gap: 7px;
    max-height: calc(100vh - 169px);
    padding: 8px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.notes-list-card {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 10px;
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    background: #ffffff;
    color: var(--notes-ink);
    text-decoration: none;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.notes-list-card:hover,
.notes-list-card.is-selected {
    border-color: #16aeba;
    background: linear-gradient(100deg, #f4fcfc, #ffffff 75%);
    box-shadow: 0 7px 18px rgba(10, 123, 135, 0.1);
}

.notes-list-title {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notes-list-title strong {
    min-width: 0;
    overflow: hidden;
    color: var(--notes-ink);
    font-size: 12px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-list-title svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    color: #d88b00;
    fill: #ffd979;
}

.notes-list-card > b {
    overflow: hidden;
    color: #087f8c;
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-list-card > span {
    color: #30405a;
    font-size: 10px;
    font-weight: 650;
}

.notes-list-card > p {
    display: -webkit-box;
    min-height: 28px;
    margin: 2px 0;
    overflow: hidden;
    color: #35455e;
    font-size: 10px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.notes-list-card > footer {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.notes-avatar {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid #b7dde0;
    border-radius: 999px;
    background: linear-gradient(135deg, #d9f5f5, #dce5f5);
    color: #0b4251;
    font-size: 8px;
    font-weight: 900;
}

.notes-list-card footer small,
.notes-list-card footer time {
    overflow: hidden;
    color: #55657d;
    font-size: 9px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-card-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 1px;
}

.notes-type-badge,
.notes-draft-badge,
.notes-followup-badge,
.notes-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 5px;
    background: #ede7ff;
    color: #6546b8;
    font-size: 8px;
    font-weight: 800;
}

.notes-draft-badge {
    background: #e9eef5;
    color: #52627b;
}

.notes-followup-badge {
    background: #fff0d8;
    color: #a95c00;
}

.notes-empty-list,
.notes-empty-detail {
    display: grid;
    justify-items: center;
    gap: 9px;
    padding: 34px 20px;
    color: #63728a;
    text-align: center;
}

.notes-empty-list > svg {
    width: 32px;
    height: 32px;
    color: #7790a8;
}

.notes-empty-list strong,
.notes-empty-detail h2 {
    margin: 0;
    color: var(--notes-ink);
    font-size: 16px;
}

.notes-empty-list p,
.notes-empty-detail p {
    max-width: 430px;
    margin: 0 0 4px;
    font-size: 12px;
    line-height: 1.55;
}

.notes-detail-panel {
    min-width: 0;
    padding: 14px;
}

.notes-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e4e9f0;
}

.notes-detail-header > label {
    min-width: 0;
    flex: 1;
}

.notes-detail-header input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    outline: 0;
    background: transparent;
    color: var(--notes-ink);
    font-size: 19px;
    font-weight: 850;
}

.notes-detail-header input:hover,
.notes-detail-header input:focus {
    border-color: #c9d5e3;
    background: #f8fafc;
}

.notes-pin-button {
    min-width: 112px;
}

.notes-pin-button.is-active {
    border-color: #e3a419;
    box-shadow: 0 0 16px rgba(227, 164, 25, 0.28);
}

.notes-detail-meta {
    display: grid;
    grid-template-columns: 1.2fr 0.85fr 0.85fr 1fr;
    padding: 12px 4px;
    border-bottom: 1px solid #e6ebf1;
}

.notes-detail-meta > div {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
}

.notes-detail-meta > div + div {
    border-left: 1px solid #e3e8ef;
}

.notes-detail-meta svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: #496078;
}

.notes-detail-meta > div > span:last-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.notes-detail-meta small {
    color: #708097;
    font-size: 9px;
    font-weight: 700;
}

.notes-detail-meta b {
    overflow: hidden;
    color: #26364f;
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-detail-type-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px;
    padding: 11px 0;
}

.notes-field {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: #26364f;
    font-size: 11px;
    font-weight: 800;
}

.notes-field > span:first-child b {
    color: #ec3f3f;
}

.notes-field > span:first-child small {
    color: #76859b;
    font-weight: 600;
}

.notes-field > input,
.notes-field > select {
    width: 100%;
    height: 41px;
    padding: 0 11px;
    border: 1px solid #d3dce7;
    border-radius: 7px;
    outline: 0;
    appearance: none;
    background: #ffffff;
    color: #13213a;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
}

.notes-compact-field {
    width: min(260px, 100%);
}

.notes-tag {
    align-self: end;
    min-height: 30px;
    padding: 0 9px;
    background: #edf3f8;
    color: #53647d;
    font-size: 9px;
}

.notes-tag svg {
    width: 12px;
    height: 12px;
}

.notes-editor {
    overflow: hidden;
    border: 1px solid #d5dee9;
    border-radius: 8px;
    background: #ffffff;
}

.notes-editor:focus-within {
    border-color: #5bcbd0;
    box-shadow: 0 0 0 3px rgba(18, 193, 200, 0.1);
}

.notes-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 46px;
    padding: 6px 8px;
    overflow-x: auto;
    border-bottom: 1px solid #dde4ed;
    background: #f8fafc;
}

.notes-format-select select {
    height: 32px;
    padding: 0 26px 0 9px;
    border: 1px solid rgba(18, 193, 200, 0.34);
    border-radius: 6px;
    appearance: none;
    background:
        linear-gradient(180deg, rgba(10, 21, 34, 0.94), rgba(4, 10, 18, 0.98)),
        repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
        #06101c;
    color: #f5f8fb;
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
}

.notes-format-select option {
    background: #06101c;
    color: #f5f8fb;
}

.notes-format-select select:hover,
.notes-format-select select:focus-visible {
    border-color: var(--notes-teal);
    outline: 0;
    box-shadow: 0 0 14px rgba(18, 193, 200, 0.55);
}

.notes-editor-tool {
    display: grid;
    width: 32px;
    height: 32px;
    min-height: 32px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(18, 193, 200, 0.28);
    border-radius: 6px;
    background:
        linear-gradient(180deg, rgba(10, 21, 34, 0.94), rgba(4, 10, 18, 0.98)),
        repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
        #06101c;
    color: #f5f8fb;
    cursor: pointer;
}

.notes-editor-tool:hover,
.notes-editor-tool:focus-visible {
    border-color: var(--notes-teal);
    outline: 0;
    box-shadow: 0 0 14px rgba(18, 193, 200, 0.55);
    filter: brightness(1.18);
}

.notes-editor-tool svg {
    width: 15px;
    height: 15px;
}

.notes-toolbar-divider {
    width: 1px;
    height: 23px;
    flex: 0 0 auto;
    margin: 0 2px;
    background: #d2d9e4;
}

.notes-toolbar-spacer {
    min-width: 8px;
    flex: 1;
}

.notes-editor-content {
    min-height: 250px;
    padding: 13px;
    overflow-y: auto;
    outline: 0;
    color: #1d2b42;
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.notes-editor-content:empty::before {
    color: #8a97aa;
    content: attr(data-placeholder);
    pointer-events: none;
}

.notes-editor-content p,
.notes-editor-content div,
.notes-editor-content blockquote,
.notes-editor-content ul,
.notes-editor-content ol {
    margin: 0 0 9px;
}

.notes-editor-content blockquote {
    padding-left: 12px;
    border-left: 3px solid #4cc4ca;
    color: #465873;
}

.notes-editor > footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    min-height: 34px;
    padding: 6px 11px;
    border-top: 1px solid #e2e7ee;
    color: #728096;
    font-size: 9px;
    font-weight: 650;
}

.notes-editor > footer span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.notes-editor > footer svg {
    width: 12px;
    height: 12px;
    color: #0b919c;
}

.notes-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding-top: 12px;
}

.notes-checklist {
    margin-top: 12px;
    overflow: hidden;
}

.notes-checklist > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8ef;
}

.notes-checklist > header > div {
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.notes-checklist h3,
.notes-context-card h3 {
    margin: 0;
    color: var(--notes-ink);
    font-size: 11px;
    font-weight: 850;
}

.notes-checklist > header span {
    color: #74839a;
    font-size: 9px;
    font-weight: 700;
}

.notes-small-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 10px;
}

.notes-checklist-add {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(130px, 0.8fr) 140px auto;
    gap: 8px;
    align-items: end;
    padding: 10px 12px;
    border-bottom: 1px solid #e4e9f0;
    background: #f8fbfc;
}

.notes-checklist-add[hidden] {
    display: none;
}

.notes-checklist-list {
    display: grid;
}

.notes-checklist-item {
    display: grid;
    grid-template-columns: 34px minmax(160px, 1fr) minmax(95px, 0.6fr) 100px 34px;
    gap: 8px;
    align-items: center;
    min-height: 46px;
    padding: 5px 9px;
    border-bottom: 1px solid #e8edf2;
}

.notes-checklist-item:last-child {
    border-bottom: 0;
}

.notes-checklist-item button {
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
}

.notes-checklist-item button svg {
    width: 14px;
    height: 14px;
}

.notes-checklist-item p {
    margin: 0;
    color: #24344d;
    font-size: 10px;
    font-weight: 650;
}

.notes-checklist-item span,
.notes-checklist-item time {
    color: #64738a;
    font-size: 9px;
    font-weight: 650;
}

.notes-checklist-item.is-complete p {
    color: #8290a3;
    text-decoration: line-through;
}

.notes-checklist-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 64px;
    color: #738198;
    font-size: 10px;
    font-weight: 650;
}

.notes-checklist-empty svg {
    width: 16px;
    height: 16px;
}

.notes-context-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
    gap: 12px;
    margin-top: 12px;
}

.notes-context-card {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 12px;
}

.notes-context-card > header {
    display: flex;
    align-items: center;
    gap: 7px;
}

.notes-context-card > header svg {
    width: 15px;
    height: 15px;
    color: #4f637d;
}

.notes-context-card > strong {
    overflow: hidden;
    color: #1d2b42;
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-context-card > span,
.notes-context-empty {
    color: #68778c;
    font-size: 9px;
    font-weight: 650;
}

.notes-context-card > a {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 5px;
    color: #087f8c;
    font-size: 10px;
    font-weight: 850;
    text-decoration: none;
}

.notes-context-card > a:hover {
    text-decoration: underline;
}

.notes-context-card > a svg {
    width: 13px;
    height: 13px;
}

.notes-document-link {
    display: grid !important;
    width: 100% !important;
    grid-template-columns: 28px minmax(0, 1fr) 16px;
    gap: 8px;
    align-items: center;
    padding: 7px;
    border: 1px solid #e5eaf0;
    border-radius: 7px;
    background: #fafbfd;
    color: inherit !important;
    text-decoration: none !important;
}

.notes-document-link > svg:first-child {
    width: 18px;
    height: 18px;
    color: #e25555;
}

.notes-document-link > svg:last-child {
    width: 13px;
    height: 13px;
    color: #718197;
}

.notes-document-link span {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.notes-document-link b,
.notes-document-link small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-document-link b {
    color: #24334a;
    font-size: 9px;
}

.notes-document-link small {
    color: #718096;
    font-size: 8px;
}

.notes-pinned-panel {
    position: sticky;
    top: 103px;
    min-width: 0;
    overflow: hidden;
}

.notes-pinned-panel > header {
    display: flex;
    align-items: center;
    gap: 9px;
}

.notes-pinned-panel > header > span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    background: #fff3d8;
    color: #b56f00;
}

.notes-pinned-panel > header svg {
    width: 17px;
    height: 17px;
}

.notes-pinned-panel > header p {
    margin: 2px 0 0;
    color: #718096;
    font-size: 9px;
    font-weight: 650;
}

.notes-pinned-list {
    display: grid;
    gap: 7px;
    padding: 8px;
}

.notes-pinned-list > a {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 15px;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid #e4e9ef;
    border-radius: 7px;
    color: var(--notes-ink);
    text-decoration: none;
}

.notes-pinned-list > a:hover,
.notes-pinned-list > a.is-selected {
    border-color: #65cbd0;
    background: #eefafb;
}

.notes-pinned-list > a > span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 6px;
    background: #fff2d5;
    color: #c67c00;
}

.notes-pinned-list > a svg {
    width: 13px;
    height: 13px;
}

.notes-pinned-list > a > svg {
    color: #b97a09;
}

.notes-pinned-list div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.notes-pinned-list strong,
.notes-pinned-list small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-pinned-list strong {
    font-size: 9px;
    font-weight: 800;
}

.notes-pinned-list small {
    color: #718096;
    font-size: 8px;
    font-weight: 650;
}

.notes-empty-detail {
    min-height: 520px;
    align-content: center;
}

.notes-empty-detail > span {
    display: grid;
    width: 70px;
    height: 70px;
    place-items: center;
    border-radius: 18px;
    background: #e8f8f9;
    color: #078d98;
}

.notes-empty-detail > span svg {
    width: 34px;
    height: 34px;
}

.notes-modal {
    width: min(900px, calc(100vw - 32px));
    max-width: 900px;
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--notes-ink, #0a1831);
    box-shadow: 0 30px 80px rgba(2, 11, 24, 0.34);
}

.notes-modal::backdrop {
    background: rgba(4, 12, 24, 0.62);
    backdrop-filter: blur(3px);
}

.notes-modal-panel {
    display: grid;
    max-height: calc(100vh - 32px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    background: #ffffff;
}

.notes-modal-header {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 40px;
    gap: 12px;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #dfe5ed;
}

.notes-modal-header > span {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 10px;
    background: #e7f7f8;
    color: #078c98;
}

.notes-modal-header > span svg {
    width: 23px;
    height: 23px;
}

.notes-modal-header h2 {
    margin: 0;
    color: #0b1830;
    font-size: 20px;
    font-weight: 900;
}

.notes-modal-header p {
    margin: 3px 0 0;
    color: #65748a;
    font-size: 11px;
    font-weight: 600;
}

.notes-modal-header > button {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
}

.notes-modal-body {
    display: grid;
    gap: 14px;
    padding: 16px 20px 20px;
    overflow-y: auto;
}

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

.notes-options-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    gap: 12px;
    align-items: end;
}

.notes-input-with-icon {
    height: 41px;
}

.notes-toggle-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.notes-toggle-card {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.notes-toggle-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.notes-toggle-card > span {
    display: flex;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 9px;
    border: 1px solid rgba(18, 193, 200, 0.34);
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(10, 21, 34, 0.94), rgba(4, 10, 18, 0.98)),
        repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
        #06101c;
    color: #f5f8fb;
    font-size: 10px;
    font-weight: 800;
    transition: box-shadow 150ms ease, filter 150ms ease;
}

.notes-toggle-card:hover > span,
.notes-toggle-card input:focus-visible + span {
    box-shadow: 0 0 17px rgba(18, 193, 200, 0.52);
    filter: brightness(1.14);
}

.notes-toggle-card input:checked + span {
    border-color: var(--notes-teal, #12c1c8);
    background:
        linear-gradient(90deg, rgba(18, 193, 200, 0.32), rgba(4, 10, 18, 0.7)),
        repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
        #06101c;
    box-shadow: inset 0 0 0 1px rgba(18, 193, 200, 0.4), 0 0 15px rgba(18, 193, 200, 0.32);
}

.notes-toggle-card svg {
    width: 14px;
    height: 14px;
}

.notes-follow-up-date {
    width: min(260px, 100%);
}

.notes-follow-up-date[hidden] {
    display: none;
}

.notes-editor-label {
    gap: 7px;
}

.notes-modal-editor .notes-editor-content {
    min-height: 190px;
    max-height: 260px;
}

.notes-modal-lower-grid {
    display: grid;
    grid-template-columns: minmax(180px, 0.55fr) minmax(0, 1.45fr);
    gap: 18px;
    align-items: start;
}

.notes-dropzone {
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border: 1px dashed #65c7cc;
    border-radius: 7px;
    background: #f5fcfc;
    cursor: pointer;
}

.notes-dropzone:hover,
.notes-dropzone.is-dragging {
    border-color: #079ba5;
    background: #eaf9fa;
    box-shadow: 0 0 15px rgba(18, 193, 200, 0.2);
}

.notes-dropzone > svg {
    width: 20px;
    height: 20px;
    color: #087f8c;
}

.notes-dropzone > span {
    display: grid;
    gap: 2px;
}

.notes-dropzone b {
    color: #087f8c;
    font-size: 10px;
}

.notes-dropzone small {
    color: #6f7f94;
    font-size: 8px;
}

.notes-file-list {
    display: grid;
    gap: 6px;
    margin-top: 7px;
}

.notes-file-chip {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 7px 9px;
    border: 1px solid #dfe6ed;
    border-radius: 7px;
    background: #f9fbfd;
}

.notes-file-chip > svg {
    width: 17px;
    height: 17px;
    color: #df5757;
}

.notes-file-chip span {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.notes-file-chip b,
.notes-file-chip small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-file-chip b {
    color: #233249;
    font-size: 9px;
}

.notes-file-chip small {
    color: #718096;
    font-size: 8px;
}

.notes-file-chip button {
    width: 30px;
    min-height: 30px;
    padding: 0;
}

.notes-modal-footer {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #dfe5ed;
    background: #fbfcfe;
}

.notes-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    padding: 11px 15px;
    border: 1px solid #65cbd0;
    border-radius: 8px;
    background: var(--notes-navy, #07111e);
    color: #ffffff;
    box-shadow: 0 0 24px rgba(18, 193, 200, 0.46), 0 15px 35px rgba(4, 10, 18, 0.25);
    font-size: 12px;
    font-weight: 750;
}

.notes-toast[hidden] {
    display: none;
}

@media (max-width: 1460px) {
    .notes-workspace-grid.has-pinned-notes {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .notes-pinned-panel {
        position: static;
        grid-column: 1 / -1;
    }

    .notes-pinned-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .notes-control-row {
        align-items: stretch;
        flex-direction: column;
    }

    .notes-primary-action {
        align-self: flex-start;
    }

    .notes-workspace-grid,
    .notes-workspace-grid.has-pinned-notes {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .notes-detail-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 0;
    }

    .notes-detail-meta > div:nth-child(3) {
        border-left: 0;
    }

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

@media (max-width: 900px) {
    .page-content:has(.notes-page) {
        padding: 16px;
    }

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

    .notes-stats {
        width: 100%;
    }

    .notes-stat-card {
        min-width: 0;
        flex: 1;
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 10px;
    }

    .notes-stat-card > span {
        width: 38px;
        height: 38px;
    }

    .notes-workspace-grid,
    .notes-workspace-grid.has-pinned-notes {
        grid-template-columns: 1fr;
    }

    .notes-list-panel,
    .notes-pinned-panel {
        position: static;
        max-height: none;
    }

    .notes-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 430px;
    }

    .notes-pinned-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .notes-options-row,
    .notes-modal-lower-grid {
        grid-template-columns: 1fr;
    }

    .notes-checklist-add {
        grid-template-columns: 1fr 1fr;
    }

    .notes-checklist-content-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .notes-filter-grid,
    .notes-modal-grid,
    .notes-list,
    .notes-pinned-list,
    .notes-detail-meta,
    .notes-checklist-add {
        grid-template-columns: 1fr;
    }

    .notes-search-panel,
    .notes-detail-header {
        align-items: stretch;
        flex-direction: column;
    }

    .notes-stats {
        display: grid;
    }

    .notes-stat-card {
        width: 100%;
    }

    .notes-stat-card + .notes-stat-card {
        border-top: 1px solid #e4e9f0;
        border-left: 0;
    }

    .notes-detail-meta > div,
    .notes-detail-meta > div + div,
    .notes-detail-meta > div:nth-child(3) {
        padding: 7px 4px;
        border-top: 1px solid #e3e8ef;
        border-left: 0;
    }

    .notes-detail-meta > div:first-child {
        border-top: 0;
    }

    .notes-checklist-item {
        grid-template-columns: 34px minmax(0, 1fr) 34px;
    }

    .notes-checklist-item > span,
    .notes-checklist-item > time {
        grid-column: 2;
    }

    .notes-checklist-item > form:last-child {
        grid-column: 3;
        grid-row: 1;
    }

    .notes-modal {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }

    .notes-modal-panel {
        max-height: calc(100vh - 16px);
    }

    .notes-toggle-group {
        grid-template-columns: 1fr;
    }

    .notes-modal-footer {
        grid-template-columns: 1fr;
    }

    .notes-modal-footer > span {
        display: none;
    }
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.primary-nav {
    display: grid;
    gap: 8px;
    justify-items: center;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    min-height: 52px;
    padding: 12px;
    border-radius: 8px;
    color: rgba(245, 248, 251, 0.88);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover,
.nav-item.is-active {
    background: linear-gradient(90deg, rgba(18, 193, 200, 0.2), rgba(255, 255, 255, 0.055));
    color: #ffffff;
    box-shadow: inset 3px 0 0 var(--teal);
}

.nav-item:hover {
    transform: none;
}

.nav-item svg,
.nav-item i {
    width: 23px;
    height: 23px;
    flex: 0 0 auto;
    transition: color 160ms ease, filter 160ms ease;
}

.nav-item:hover svg,
.nav-item:focus-visible svg,
.nav-item.is-active svg,
.nav-item:hover i,
.nav-item:focus-visible i,
.nav-item.is-active i {
    color: #ffffff;
    filter: drop-shadow(0 0 9px rgba(18, 193, 200, 0.92));
}

.nav-icon-wrap {
    position: relative;
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
}

.nav-badge {
    position: absolute;
    top: -7px;
    right: -8px;
    display: grid;
    min-width: 17px;
    height: 17px;
    place-items: center;
    padding: 0 4px;
    border: 2px solid #07111e;
    border-radius: 999px;
    background: #f04438;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.sidebar-logo-link {
    display: grid;
    width: 58px;
    height: 58px;
    margin: auto auto 0;
    place-items: center;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 160ms ease, filter 160ms ease;
}

.sidebar-logo-link:hover,
.sidebar-logo-link:focus-visible {
    filter: drop-shadow(0 0 14px rgba(18, 193, 200, 0.62));
    outline: 0;
    transform: translateY(-1px);
}

.sidebar-logo {
    display: block;
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow:
        0 0 0 1px rgba(18, 193, 200, 0.2),
        0 12px 22px rgba(0, 0, 0, 0.32);
}

.main-column {
    min-width: 0;
    flex: 1;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 82px;
    padding: 14px 32px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
}

.icon-button,
.notification-button,
.profile-button,
.new-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.icon-button {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
}

.icon-button svg,
.notification-button svg {
    width: 24px;
    height: 24px;
}

.global-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(470px, 42vw);
    min-width: 280px;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fbff, #f2f6fd);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.global-search svg {
    width: 20px;
    height: 20px;
    color: #31528c;
}

.global-search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.global-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
}

.global-search input::placeholder {
    color: #3c4d78;
}

.global-search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 20;
    display: grid;
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 20px 45px rgba(11, 31, 78, 0.16);
}

.global-search-results[hidden] {
    display: none;
}

.global-search-result {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 64px;
    padding: 11px 13px;
    color: var(--ink);
    text-decoration: none;
}

.global-search-result:hover,
.global-search-result.is-active {
    background: #eef6ff;
}

.global-search-result svg,
.global-search-result i {
    width: 20px;
    height: 20px;
    justify-self: center;
    color: #31528c;
}

.global-search-result-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.global-search-result-copy strong,
.global-search-result-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-result-copy strong {
    font-size: 14px;
    font-weight: 800;
}

.global-search-result-copy small,
.global-search-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.global-search-empty {
    padding: 16px;
}

.client-list-row {
    scroll-margin-top: 110px;
}

.client-list-row:target {
    background: #eef6ff;
}

.global-search kbd {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 7px;
    border: 1px solid #cdd8ed;
    border-radius: 5px;
    background: #ffffff;
    color: #33446e;
    font-size: 12px;
    font-family: inherit;
}

.topbar-spacer {
    flex: 1;
}

.topbar-page-title {
    display: grid;
    align-content: center;
    justify-content: center;
    justify-items: start;
    gap: 2px;
    min-height: 46px;
}

.topbar-page-title h1 {
    margin: 0;
    color: #111827;
    font-size: 28px;
    font-weight: 850;
    line-height: 1.1;
}

.topbar-page-title p {
    margin: 0;
    color: #5f6b7f;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.new-button {
    gap: 9px;
    min-width: 118px;
    height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    background: var(--blue);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(15, 99, 255, 0.24);
}

.new-button svg {
    width: 18px;
    height: 18px;
}

.notification-button {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: transparent;
    color: #1c2f61;
}

.notification-button span {
    position: absolute;
    top: 3px;
    right: 2px;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 999px;
    background: #f04438;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
}

/* Login */
.login-container {
    width: 100%;
    max-width: 600px;
    margin: 60px auto;
}

.login-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    min-height: 600px;
}

.login-card-compact {
    min-height: 420px;
}

.login-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin: 35px 0;
}

.login-header h2 {
    color: #1a202c;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-header p {
    color: #718096;
    font-size: 14px;
    font-weight: 400;
}

/* Form Group & Input Styles */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    margin-top: 15px;
}

.input-wrapper input {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px 16px;
    color: #1a202c;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    width: 100%;
    outline: none;
}

.input-wrapper input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-wrapper input:focus + label,
.input-wrapper input:valid + label {
    transform: translateY(-32px) scale(0.85);
    color: #3b82f6;
    font-weight: 500;
}

.input-wrapper label {
    position: absolute;
    left: 16px;
    top: 12px;
    color: #718096;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    pointer-events: none;
    transform-origin: left top;
    background: #ffffff;
    padding: 0 4px;
}

/* Password Toggle */
.input-wrapper .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #718096;
    transition: color 0.2s ease;
    z-index: 2;
}

.input-wrapper .password-toggle:hover {
    color: #3b82f6;
}

.toggle-icon {
    display: block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23718096' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-image 0.2s ease;
}

.password-toggle:hover .toggle-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%233b82f6' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3e%3c/svg%3e");
}

.toggle-icon.show-password {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23718096' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 11-4.243-4.243m4.242 4.242L9.88 9.88'/%3e%3c/svg%3e");
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.remember-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: #ffffff;
}

.time-selector:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background-color: #ccc;
    border-radius: 34px;
    transition: .3s;
}

.slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
}

.switch input:checked + .slider {
    background-color: #4CAF50;
}

.switch input:checked + .slider::before {
    transform: translateX(24px);
}

.remember-wrapper input[type="checkbox"]:checked + .checkbox-label .checkmark {
    background: #3b82f6;
    border-color: #3b82f6;
}

.remember-wrapper input[type="checkbox"]:checked + .checkbox-label .checkmark::after {
    content: '✓';
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.checkbox-label {
    color: #4a5568;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.forgot-password {
    color: #3b82f6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #2563eb;
}

/* Login Button */
.login-btn {
    width: 100%;
    background: #3b82f6;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 24px;
}

.login-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.login-btn:active {
    transform: translateY(0);
}

/* Loading State */
.login-btn.loading {
    pointer-events: none;
    background: #9ca3af;
}

.btn-text {
    transition: opacity 0.2s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    opacity: 0;
    animation: spin 1s linear infinite;
    transition: opacity 0.2s ease;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-loader {
    opacity: 1;
}

/* Error States */
.error-message {
    color: #dc2626;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
    margin-left: 4px;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.form-group.error .input-wrapper input {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    padding: 32px 20px;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.success-message.is-visible {
    display: block;
    transform: none;
}

.success-icon {
    width: 48px;
    height: 48px;
    background: #059669;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    margin: 0 auto 16px;
}

.success-message h3 {
    color: #1a202c;
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.success-message p {
    color: #718096;
    font-size: 14px;
}

/* Signup Link */
.signup-link {
    text-align: center;
}

.signup-link p {
    color: #718096;
    font-size: 14px;
}

.signup-link a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.signup-link a:hover {
    color: #2563eb;
}

.auth-note {
    display: block;
    margin: 8px 0 18px;
    color: #586a95;
    font-size: 13px;
    font-weight: 600;
}

.secondary-auth-button {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cdd8ed;
    border-radius: 6px;
    background: #ffffff;
    color: #1c2f61;
    font-weight: 700;
    cursor: pointer;
}

.secondary-auth-button:hover {
    background: #f2f6fd;
}

.secondary-auth-button:disabled,
.secondary-button:disabled,
.inline-form button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* Animations */
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .login-card {
        padding: 24px;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}
/* === Accessibility: keyboard focus indicators === */
/* Restores visible focus rings for keyboard users without affecting mouse interaction. */
:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion: respect user preference. Animations defined per form will tone down. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
/* End login */

/* Darvoxa sign-in */
.signin-auth-body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, rgba(10, 21, 34, 0.92), rgba(4, 10, 18, 0.98)),
        repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
        #06101c;
    color: #f5f8fb;
}

.signin-auth-body .auth-page {
    display: block;
    min-height: 100vh;
    padding: 0;
}

.darvoxa-signin {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: clamp(50px, 12.5vh, 120px) 24px 72px;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.22)),
        linear-gradient(180deg, rgba(24, 39, 59, 0.24), rgba(2, 8, 15, 0.18));
}

.darvoxa-signin-logo {
    display: block;
    width: min(690px, calc(100vw - 64px));
    height: auto;
    margin: 0 0 44px;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.42));
}

.darvoxa-signin-card {
    position: relative;
    width: min(716px, calc(100vw - 48px));
    min-height: 560px;
    padding: 47px 54px 50px;
    border: 1px solid rgba(104, 124, 153, 0.42);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(24, 40, 62, 0.76), rgba(14, 27, 44, 0.68));
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(16px);
}

.darvoxa-signin-title {
    margin: 0 0 31px;
    color: #f4f6f8;
    font-size: 38px;
    font-weight: 760;
    line-height: 1.18;
    text-align: center;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}

.darvoxa-auth-copy {
    max-width: 520px;
    margin: -14px auto 31px;
    color: rgba(222, 230, 241, 0.78);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
}

.darvoxa-signin-form {
    display: grid;
    gap: 25px;
}

.darvoxa-field {
    display: grid;
    gap: 12px;
}

.darvoxa-field label {
    color: #f1f5f9;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.darvoxa-field input {
    width: 100%;
    height: 66px;
    border: 1px solid rgba(126, 147, 174, 0.66);
    border-radius: 7px;
    outline: 0;
    background: rgba(5, 15, 27, 0.48);
    color: #f8fafc;
    font-size: 19px;
    font-weight: 500;
    line-height: 1;
    padding: 0 22px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.darvoxa-field input::placeholder {
    color: rgba(186, 195, 209, 0.58);
}

.darvoxa-field input:focus {
    border-color: #12c1c8;
    background: rgba(5, 15, 27, 0.62);
    box-shadow:
        0 0 0 3px rgba(18, 193, 200, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.darvoxa-field input:-webkit-autofill,
.darvoxa-field input:-webkit-autofill:hover,
.darvoxa-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f8fafc;
    box-shadow: 0 0 0 1000px #071827 inset;
    transition: background-color 9999s ease-out;
}

.darvoxa-password-control {
    position: relative;
}

.darvoxa-password-control input {
    padding-right: 64px;
}

.darvoxa-password-control .password-toggle {
    position: absolute;
    top: 50%;
    right: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(235, 241, 249, 0.9);
    cursor: pointer;
    transform: translateY(-50%);
    transition: color 160ms ease, background 160ms ease;
}

.darvoxa-password-control .password-toggle:hover,
.darvoxa-password-control .password-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.darvoxa-password-control .password-toggle svg,
.darvoxa-password-control .password-toggle i {
    width: 26px;
    height: 26px;
}

.darvoxa-signin-options {
    align-items: center;
    gap: 18px;
    margin: 0 0 14px;
}

.signin-auth-body .remember-wrapper {
    gap: 14px;
}

.signin-auth-body .remember-wrapper input[type="checkbox"] {
    position: absolute;
    display: block;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.signin-auth-body .checkbox-label {
    gap: 14px;
    color: #f8fafc;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.signin-auth-body .checkmark {
    width: 30px;
    height: 30px;
    border: 2px solid rgba(135, 154, 182, 0.9);
    border-radius: 5px;
    background: rgba(11, 24, 40, 0.68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.signin-auth-body .remember-wrapper input[type="checkbox"]:focus-visible + .checkbox-label .checkmark {
    outline: 2px solid #14c8cf;
    outline-offset: 3px;
}

.signin-auth-body .remember-wrapper input[type="checkbox"]:checked + .checkbox-label .checkmark {
    border-color: #11b9c1;
    background: #079ca4;
}

.signin-auth-body .remember-wrapper input[type="checkbox"]:checked + .checkbox-label .checkmark::after {
    color: #ffffff;
    content: "✓";
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.signin-auth-body .forgot-password {
    color: #06c7ce;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.signin-auth-body .forgot-password:hover,
.signin-auth-body .forgot-password:focus-visible {
    color: #28eef3;
}

.signin-auth-body .login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 66px;
    margin: 0;
    padding: 0 24px;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(180deg, #16b9bd, #079aa4);
    box-shadow: 0 13px 28px rgba(0, 174, 181, 0.18);
    color: #ffffff;
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
}

.signin-auth-body .login-btn:hover {
    background: linear-gradient(180deg, #20c8cc, #08a8b1);
    box-shadow: 0 18px 34px rgba(0, 174, 181, 0.23);
    transform: none;
}

.signin-auth-body .login-btn.loading {
    background: linear-gradient(180deg, #0e9ca3, #087e87);
}

.signin-auth-body .error-message {
    display: block;
    margin: -4px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 118, 118, 0.34);
    border-radius: 7px;
    background: rgba(144, 28, 37, 0.24);
    color: #ffc6c6;
    font-size: 14px;
    font-weight: 700;
    transform: none;
}

.signin-auth-body .success-message {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid rgba(18, 193, 200, 0.26);
    border-radius: 7px;
    background: rgba(7, 156, 164, 0.16);
    color: #f8fafc;
}

.signin-auth-body .success-message p {
    color: #f8fafc;
}

.darvoxa-passkey-button {
    position: absolute;
    bottom: 13px;
    left: 50%;
    display: flex;
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid rgba(17, 185, 193, 0.26);
    border-radius: 7px;
    background: rgba(5, 15, 27, 0.18);
    color: #75e6ea;
    font-size: 13px;
    font-weight: 800;
    transform: translateX(-50%);
}

.darvoxa-passkey-button:hover {
    background: rgba(17, 185, 193, 0.1);
}

.darvoxa-passkey-status {
    position: absolute;
    right: 54px;
    bottom: -28px;
    left: 54px;
    min-height: 18px;
    margin: 0;
    color: rgba(204, 216, 232, 0.78);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.darvoxa-verify-card {
    min-height: 464px;
}

.darvoxa-verify-form {
    gap: 25px;
}

.darvoxa-inline-note {
    margin: -6px 0 0;
    color: rgba(204, 216, 232, 0.82);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.darvoxa-resend-form {
    margin-top: 16px;
}

.darvoxa-resend-button {
    width: 100%;
    min-height: 50px;
    border: 1px solid rgba(17, 185, 193, 0.32);
    border-radius: 7px;
    background: rgba(5, 15, 27, 0.26);
    color: #75e6ea;
    font-size: 15px;
    font-weight: 800;
}

.darvoxa-resend-button:hover {
    background: rgba(17, 185, 193, 0.1);
}

.darvoxa-logout {
    justify-content: center;
    padding: 48px 24px;
}

.darvoxa-logout-card {
    display: grid;
    justify-items: center;
    width: min(560px, calc(100vw - 48px));
    min-height: 0;
    padding: 48px 54px 50px;
    text-align: center;
}

.darvoxa-logout-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 25px;
    place-items: center;
    border: 1px solid rgba(17, 185, 193, 0.34);
    border-radius: 50%;
    background: linear-gradient(180deg, #16b9bd, #079aa4);
    box-shadow: 0 18px 34px rgba(0, 174, 181, 0.22);
    color: #ffffff;
    font-size: 27px;
    font-weight: 900;
    line-height: 1;
}

.darvoxa-logout-link {
    margin-top: 4px;
    text-decoration: none;
}

@media (max-width: 720px) {
    .darvoxa-signin {
        padding: 46px 18px 48px;
    }

    .darvoxa-signin-logo {
        width: min(520px, calc(100vw - 42px));
        margin-bottom: 34px;
    }

    .darvoxa-signin-card {
        width: 100%;
        min-height: 0;
        padding: 34px 24px 28px;
    }

    .darvoxa-signin-title {
        margin-bottom: 26px;
        font-size: 32px;
    }

    .darvoxa-auth-copy {
        margin: -10px auto 25px;
        font-size: 15px;
    }

    .darvoxa-field label,
    .signin-auth-body .checkbox-label,
    .signin-auth-body .forgot-password {
        font-size: 16px;
    }

    .darvoxa-field input,
    .signin-auth-body .login-btn {
        min-height: 58px;
        height: 58px;
        font-size: 16px;
    }

    .darvoxa-passkey-button,
    .darvoxa-passkey-status {
        position: static;
        transform: none;
    }

    .darvoxa-passkey-button {
        margin: 13px auto 0;
    }

    .darvoxa-passkey-status {
        margin: 8px 0 0;
    }

    .darvoxa-logout {
        padding: 34px 14px;
    }

    .darvoxa-logout-card {
        width: 100%;
        padding: 34px 24px 30px;
    }
}

@media (max-width: 480px) {
    .signin-auth-body {
        padding: 0;
    }

    .darvoxa-signin {
        padding: 34px 14px 36px;
    }

    .darvoxa-signin-card {
        padding: 28px 18px 24px;
    }

    .darvoxa-signin-title {
        font-size: 28px;
    }

    .darvoxa-signin-options {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Forgot pw */
.forgotpw_card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.forgotpw_header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.forgotpw_subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.forgotpw_input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.forgetpw_btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

.forgetpw_btn:hover {
    background: #1d4ed8;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: #2563eb;
    text-decoration: none;
}
/* End forgot pw */

/* Logout */
.logout_card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.logout_icon {
    width: 60px;
    height: 60px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 1rem;
}

.logout_header {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.logout_paragraph {
    color: #666;
    margin-bottom: 1.5rem;
}

.logout_link {
    display: inline-block;
    text-decoration: none;
    background: #2563eb;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    transition: 0.2s;
}
/* End logout */

/* Admin and licensing */
.admin-page {
    display: grid;
    gap: 22px;
}

.admin-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.admin-header h1 {
    margin: 0;
    color: var(--ink);
    font-size: 32px;
    font-weight: 800;
}

.admin-header p,
.admin-panel-header p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.admin-alert {
    padding: 12px 14px;
    border: 1px solid #cdd8ed;
    border-radius: 8px;
    background: #ffffff;
    color: #1c2f61;
    font-weight: 700;
}

.admin-alert.error {
    border-color: #fecaca;
    background: #fff5f5;
    color: #b42318;
}

.admin-alert.success {
    border-color: #abefc6;
    background: #f0fdf4;
    color: #067647;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.admin-panel,
.credential-reveal {
    display: grid;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.admin-panel-wide {
    min-width: 0;
}

.admin-panel-header h2,
.credential-reveal h2 {
    margin: 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 800;
}

.admin-panel label {
    display: grid;
    gap: 6px;
    color: #33446e;
    font-size: 13px;
    font-weight: 800;
}

.admin-field {
    display: grid;
    gap: 8px;
    color: #33446e;
    font-size: 13px;
    font-weight: 800;
}

.checkbox-stack {
    display: grid;
    gap: 8px;
}

.checkbox-stack label,
.permission-form label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #33446e;
    font-size: 12px;
    font-weight: 800;
}

.admin-panel input,
.admin-panel select,
.credential-reveal input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cdd8ed;
    border-radius: 6px;
    padding: 9px 11px;
    color: var(--ink);
    font: inherit;
}

.admin-panel input[type="checkbox"],
.permission-form input[type="checkbox"] {
    width: auto;
    min-height: 0;
    padding: 0;
}

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.credential-reveal {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
    align-items: center;
    border-color: #abefc6;
    background: #f7fef9;
}

.credential-reveal p {
    margin: 6px 0 0;
    color: #067647;
    font-weight: 700;
}

.credential-reveal input {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 15px;
    font-weight: 800;
    background: #ffffff;
}

.data-table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.data-table th,
.data-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: #33446e;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.data-table strong,
.data-table small {
    display: block;
}

.data-table small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
}

.status-pill.active {
    background: #dcfae6;
    color: #067647;
}

.status-pill.suspended,
.status-pill.inactive {
    background: #fee4e2;
    color: #b42318;
}

.status-pill.expired {
    background: #fff1d6;
    color: #9a4c00;
}

.account-stack {
    display: grid;
    gap: 10px;
}

.account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.inline-form {
    display: inline-flex;
}

.permission-form {
    flex-wrap: wrap;
    gap: 9px 12px;
    align-items: center;
}

.inline-form button {
    min-height: 34px;
    border: 1px solid #cdd8ed;
    border-radius: 6px;
    background: #ffffff;
    color: #1c2f61;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.inline-form button:hover {
    background: #eef6ff;
}

.license-edit-form {
    display: grid;
    gap: 10px;
    min-width: 320px;
}

.license-edit-grid {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 92px;
    gap: 10px;
}

.license-edit-grid label:nth-child(3),
.license-edit-grid label:nth-child(4) {
    grid-column: span 2;
}

.license-edit-form select,
.license-edit-form input {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 13px;
}

.license-save-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: fit-content;
    min-height: 34px;
    border: 1px solid #cdd8ed;
    border-radius: 6px;
    background: #ffffff;
    color: #1c2f61;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.license-save-button:hover {
    background: #eef6ff;
}

.license-save-button svg {
    width: 15px;
    height: 15px;
}

.inline-action-form {
    display: inline-flex;
    margin: 0;
}

.inline-action-form button {
    border: 0;
    font: inherit;
    cursor: pointer;
}

.link-button {
    border: 0;
    background: transparent;
    color: #0f63ff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.link-button:hover {
    color: #001f56;
}

.admin-help {
    min-height: 18px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.admin-alert a {
    color: inherit;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 920px) {
    .admin-grid,
    .credential-reveal {
        grid-template-columns: 1fr;
    }
}

.profile-button {
    position: relative;
    gap: 12px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.profile-menu-wrap {
    position: relative;
}

.profile-avatar {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: linear-gradient(145deg, #d98a62, #f1c2a4 52%, #56301f 53%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 7px 18px rgba(13, 35, 82, 0.16);
}

.profile-copy {
    display: grid;
    gap: 2px;
    min-width: 112px;
}

.profile-copy span {
    font-size: 14px;
    font-weight: 800;
}

.profile-copy small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.profile-button svg {
    width: 18px;
    height: 18px;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 30;
    display: grid;
    gap: 6px;
    width: min(270px, calc(100vw - 32px));
    padding: 10px;
    border: 1px solid rgba(104, 124, 153, 0.28);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 22px 48px rgba(10, 21, 34, 0.16);
}

.profile-menu[hidden] {
    display: none;
}

.profile-menu-user {
    display: grid;
    gap: 3px;
    padding: 10px 10px 12px;
    border-bottom: 1px solid var(--line);
}

.profile-menu-user strong,
.profile-menu-user small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu-user strong {
    color: var(--ink);
    font-size: 14px;
    font-weight: 850;
}

.profile-menu-user small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.profile-menu form {
    margin: 0;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #17285a;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
}

.profile-menu-item:hover,
.profile-menu-item:focus-visible {
    background: #f1f6ff;
    color: var(--blue);
    outline: 0;
}

.profile-menu-item svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.profile-menu-signout:hover,
.profile-menu-signout:focus-visible {
    background: #fff1f0;
    color: #c03333;
}

.settings-modal-shell {
    width: min(1120px, calc(100vw - 48px));
    height: min(780px, calc(100vh - 48px));
    max-width: none;
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(104, 124, 153, 0.32);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    box-shadow: 0 34px 90px rgba(4, 10, 18, 0.36);
}

.settings-modal-shell::backdrop {
    background: rgba(4, 10, 18, 0.52);
    backdrop-filter: blur(4px);
}

.settings-modal-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 14px 18px 14px 22px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(24, 40, 62, 0.96), rgba(14, 27, 44, 0.94)),
        #06101c;
    color: #f8fafc;
}

.settings-modal-header p,
.settings-modal-header h2 {
    margin: 0;
}

.settings-modal-header p {
    color: rgba(222, 230, 241, 0.72);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-modal-header h2 {
    margin-top: 3px;
    font-size: 21px;
    font-weight: 850;
    line-height: 1.15;
}

.settings-modal-close {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(126, 147, 174, 0.44);
    border-radius: 8px;
    background: rgba(5, 15, 27, 0.38);
    color: #f8fafc;
    cursor: pointer;
}

.settings-modal-close:hover {
    border-color: rgba(18, 193, 200, 0.58);
    color: var(--teal);
}

.settings-modal-close svg {
    width: 20px;
    height: 20px;
}

.settings-modal-panel iframe {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #f8fbff;
}

.settings-modal-body {
    margin: 0;
    min-width: 320px;
    background: #f8fbff;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.settings-modal-content {
    padding: 18px;
}

.settings-modal-content .settings-layout {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 14px;
}

.settings-modal-content .firm-card {
    padding: 22px;
}

.page-content {
    padding: 32px;
}

.page-action-row {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 16px;
}

.settings-hero {
    position: relative;
    min-height: 164px;
    margin: -32px -32px 0;
    overflow: hidden;
    background: linear-gradient(90deg, #fbfdff 0%, #eef6ff 100%);
}

.settings-hero::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, rgba(248, 251, 255, 0.98) 0%, rgba(248, 251, 255, 0.76) 35%, rgba(248, 251, 255, 0.08) 70%);
}

.settings-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center right;
}

.settings-hero-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 7px;
    padding: 38px 32px 32px;
}

.settings-hero-copy h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0;
}

.settings-hero-copy p {
    margin: 0;
    color: #14224f;
    font-size: 16px;
    font-weight: 500;
}

.settings-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 16px;
    margin-top: 0;
}

.settings-tabs,
.firm-card,
.settings-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1px 1px rgba(18, 44, 86, 0.02);
}

.settings-tabs {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 14px 10px;
}

.settings-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 46px;
    padding: 10px 13px 10px 18px;
    border-radius: 8px;
    color: #142658;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
}

.settings-tab svg {
    width: 21px;
    height: 21px;
    color: #42598b;
}

.settings-tab.is-active,
.settings-tab:hover {
    background: linear-gradient(90deg, #f1f6ff, #f8fbff);
    color: var(--blue);
}

.settings-tab.is-active::before {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 0;
    width: 3px;
    border-radius: 999px;
    background: var(--blue);
    content: "";
}

.settings-tab.is-active svg,
.settings-tab:hover svg {
    color: var(--blue);
}

.settings-main {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.firm-card {
    min-width: 0;
    padding: 26px 28px 28px;
}

.firm-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.firm-card h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 850;
}

.firm-card p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.settings-save-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 12px 16px;
    border: 1px solid #bde7cf;
    border-radius: 8px;
    background: #eefaf3;
    color: #0d6e3e;
    font-size: 14px;
    font-weight: 750;
}

.settings-save-banner svg {
    width: 20px;
    height: 20px;
}

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

.settings-form {
    display: grid;
    gap: 22px;
}

.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.settings-field-wide {
    grid-column: 1 / -1;
}

.settings-field span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.settings-field input,
.settings-field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    outline: 0;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.settings-field input {
    height: 44px;
    padding: 0 13px;
}

.settings-field textarea {
    resize: vertical;
    padding: 12px 13px;
}

.settings-field input:focus,
.settings-field textarea:focus {
    border-color: #8fb3f4;
    box-shadow: 0 0 0 3px rgba(15, 99, 255, 0.12);
}

.settings-field input[readonly] {
    background: #f5f8fd;
    color: var(--muted);
    cursor: not-allowed;
}

.settings-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.settings-check {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.settings-check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--blue);
}

.settings-check span {
    display: grid;
    gap: 4px;
}

.settings-check strong {
    font-size: 14px;
    font-weight: 850;
    line-height: 1.25;
}

.settings-check small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 550;
    line-height: 1.4;
}

.secondary-button {
    gap: 9px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: #17285a;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 1px 1px rgba(18, 44, 86, 0.03);
}

.secondary-button svg {
    width: 17px;
    height: 17px;
}

.firm-profile-grid {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) 250px;
    gap: 34px;
    align-items: start;
}

.firm-details {
    display: grid;
    gap: 24px;
    margin: 0;
}

.firm-details div {
    display: grid;
    gap: 6px;
}

.firm-details dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.firm-details dd {
    margin: 0;
    color: #071743;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.45;
}

.firm-details a {
    color: var(--blue);
    text-decoration: none;
}

.logo-upload-panel {
    display: grid;
    justify-items: center;
    gap: 14px;
    min-height: 210px;
    padding: 30px 18px 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff, #fafcff);
    text-align: center;
}

.logo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
}

.logo-preview-mark {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
}

.logo-preview strong,
.logo-preview small {
    display: block;
}

.logo-preview strong {
    font-size: 21px;
    font-weight: 850;
    letter-spacing: 0.14em;
    line-height: 1;
    text-transform: uppercase;
}

.logo-preview small {
    margin-top: 7px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.logo-upload-panel .logo-button {
    min-width: 140px;
}

.logo-upload-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.settings-logo-row {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.settings-logo-panel {
    min-height: 190px;
}

.uploaded-logo {
    max-width: 58px;
    max-height: 58px;
    object-fit: contain;
}

.file-input-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 40px;
    padding: 0 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: #17285a;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 1px 1px rgba(18, 44, 86, 0.03);
}

.file-input-button svg {
    width: 17px;
    height: 17px;
}

.file-input-button input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.settings-summary {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.audit-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.audit-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    background: #ffffff;
}

.audit-table th,
.audit-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.audit-table th {
    background: #f5f8fd;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.audit-table tr:last-child td {
    border-bottom: 0;
}

.settings-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.settings-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 18px;
    gap: 16px;
    align-items: center;
    min-height: 114px;
    padding: 18px;
    color: var(--ink);
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.settings-card:hover {
    border-color: #b7c8e6;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.settings-card > svg {
    width: 18px;
    height: 18px;
    color: #31528c;
}

.module-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 999px;
}

.module-icon svg {
    width: 27px;
    height: 27px;
}

.module-icon.blue {
    background: #e7f0ff;
    color: var(--blue);
}

.module-icon.green {
    background: #ddf4e9;
    color: var(--green);
}

.module-icon.purple {
    background: #eee5ff;
    color: var(--purple);
}

.module-icon.orange {
    background: #fff0d8;
    color: var(--orange);
}

.module-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.module-copy strong {
    overflow-wrap: anywhere;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.2;
}

.module-copy small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 550;
    line-height: 1.45;
}

/* Calendar */
.main-column:has(.calendar-page) > .topbar .new-button {
    display: none;
}

.calendar-page {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 16px;
    align-items: start;
    width: 100%;
    max-width: 1440px;
    overflow-x: hidden;
    color: #202124;
}

.calendar-page [data-calendar-color="blue"] {
    --calendar-color: #1a73e8;
    --calendar-bg: #e8f0fe;
    --calendar-ink: #174ea6;
}

.calendar-page [data-calendar-color="green"] {
    --calendar-color: #0b8043;
    --calendar-bg: #e6f4ea;
    --calendar-ink: #0f6d3b;
}

.calendar-page [data-calendar-color="purple"] {
    --calendar-color: #8430ce;
    --calendar-bg: #f3e8fd;
    --calendar-ink: #681da8;
}

.calendar-page [data-calendar-color="orange"] {
    --calendar-color: #f29900;
    --calendar-bg: #fff4dd;
    --calendar-ink: #a15c00;
}

.calendar-page [data-calendar-color="red"] {
    --calendar-color: #d93025;
    --calendar-bg: #fce8e6;
    --calendar-ink: #a50e0e;
}

.calendar-page [data-calendar-color="teal"] {
    --calendar-color: #129eaf;
    --calendar-bg: #e4f7f9;
    --calendar-ink: #08727f;
}

.calendar-page [data-calendar-color="pink"] {
    --calendar-color: #d01884;
    --calendar-bg: #fde7f3;
    --calendar-ink: #9e0f61;
}

.calendar-page [data-calendar-color="cyan"] {
    --calendar-color: #0097a7;
    --calendar-bg: #e0f7fa;
    --calendar-ink: #006978;
}

.calendar-page [data-calendar-color="indigo"] {
    --calendar-color: #3f51b5;
    --calendar-bg: #e8eaf6;
    --calendar-ink: #283593;
}

.calendar-page [data-calendar-color="brown"] {
    --calendar-color: #795548;
    --calendar-bg: #efebe9;
    --calendar-ink: #5d4037;
}

.calendar-toolbar {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    padding: 2px 0 8px;
}

.calendar-toolbar-main {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.calendar-view-menu-wrap {
    position: relative;
    flex: 0 0 auto;
}

.calendar-view-menu-button {
    list-style: none;
    user-select: none;
}

.calendar-view-menu-button::-webkit-details-marker {
    display: none;
}

.calendar-view-menu-button svg:last-child {
    transition: transform 140ms ease;
}

.calendar-view-menu-wrap[open] .calendar-view-menu-button svg:last-child {
    transform: rotate(180deg);
}

.calendar-view-menu {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    z-index: 45;
    display: grid;
    width: 190px;
    padding: 6px;
    border: 1px solid #d8dee9;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.calendar-view-menu a {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    color: #17285a;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}

.calendar-view-menu a:hover,
.calendar-view-menu a.is-active {
    background: #eef5ff;
    color: #155eef;
}

.calendar-view-menu svg {
    width: 17px;
    height: 17px;
}

.calendar-toolbar-title {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.calendar-toolbar-title h1 {
    margin: 0;
    overflow: hidden;
    color: #202124;
    font-size: 22px;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-toolbar-title span {
    color: #5f6368;
    font-size: 12px;
    font-weight: 600;
}

.calendar-today-button,
.calendar-create-button,
.calendar-sidebar-create,
.calendar-primary-action,
.calendar-secondary-action,
.calendar-danger-action,
.calendar-nav-cluster a,
.calendar-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 40px;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.calendar-today-button,
.calendar-secondary-action,
.calendar-danger-action,
.calendar-nav-cluster a,
.calendar-icon-button {
    border: 1px solid #dadce0;
    background: #ffffff;
    color: #202124;
}

.calendar-today-button,
.calendar-primary-action,
.calendar-secondary-action,
.calendar-danger-action {
    padding: 0 16px;
}

.calendar-create-button,
.calendar-sidebar-create {
    border: 1px solid rgba(104, 124, 153, 0.26);
    background:
        linear-gradient(180deg, rgba(10, 21, 34, 0.94), rgba(4, 10, 18, 0.98)),
        #06101c;
    color: #f5f8fb;
    box-shadow: 0 12px 24px rgba(4, 10, 18, 0.18);
}

.calendar-primary-action {
    border: 1px solid #1a73e8;
    background: #1a73e8;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18);
}

.calendar-create-button,
.calendar-sidebar-create {
    padding: 0 18px;
}

.calendar-sidebar-create {
    align-self: center;
    justify-content: flex-start;
    width: 100%;
}

.calendar-create-button:hover,
.calendar-sidebar-create:hover {
    border-color: rgba(18, 193, 200, 0.58);
    background:
        linear-gradient(180deg, rgba(16, 31, 49, 0.98), rgba(7, 17, 30, 0.98)),
        #07111e;
}

.calendar-primary-action:hover {
    background: #185abc;
}

.calendar-today-button:hover,
.calendar-secondary-action:hover,
.calendar-nav-cluster a:hover,
.calendar-icon-button:hover {
    background: #f1f3f4;
}

.calendar-danger-action {
    border-color: #f1c7c3;
    color: #a50e0e;
}

.calendar-danger-action:hover {
    background: #fce8e6;
}

.calendar-primary-action:disabled,
.calendar-danger-action:disabled {
    cursor: wait;
    opacity: 0.64;
}

.calendar-nav-cluster {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.calendar-nav-cluster a,
.calendar-icon-button {
    width: 40px;
    padding: 0;
}

.calendar-nav-cluster svg,
.calendar-create-button svg,
.calendar-sidebar-create svg,
.calendar-primary-action svg,
.calendar-secondary-action svg,
.calendar-danger-action svg,
.calendar-icon-button svg,
.calendar-view-pill svg,
.calendar-block-summary svg {
    width: 17px;
    height: 17px;
}

.calendar-workspace {
    display: contents;
}

.calendar-sidebar {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    gap: 16px;
    min-width: 0;
}

.calendar-sidebar-section {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: #ffffff;
}

.calendar-sidebar-section h2 {
    margin: 0;
    color: #202124;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
}

.calendar-lawyer-list {
    display: grid;
    gap: 6px;
}

.calendar-lawyer-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 46px;
    padding: 6px;
    border-radius: 8px;
    background: #ffffff;
}

.calendar-lawyer-row:hover {
    background: #f8fafd;
}

.calendar-lawyer-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 999px;
    background: var(--calendar-bg, #e8f0fe);
    color: var(--calendar-ink, #174ea6);
    font-size: 11px;
    font-weight: 750;
}

.calendar-lawyer-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.calendar-lawyer-copy strong,
.calendar-lawyer-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-lawyer-copy strong {
    color: #202124;
    font-size: 13px;
    font-weight: 650;
}

.calendar-lawyer-copy small,
.calendar-business-hours p {
    margin: 0;
    color: #5f6368;
    font-size: 12px;
    font-weight: 550;
}

.calendar-business-hours strong {
    color: #202124;
    font-size: 18px;
    font-weight: 650;
}

.calendar-board,
.calendar-agenda-panel {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}

.calendar-day-page .calendar-agenda-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: min(820px, calc(100vh - 154px));
    min-height: min(520px, calc(100vh - 154px));
}

.calendar-board-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 44px;
    padding: 5px 10px;
    border-bottom: 1px solid #dadce0;
}

.calendar-board-topline .calendar-today-button,
.calendar-board-topline .calendar-nav-cluster a {
    min-height: 34px;
}

.calendar-board-topline .calendar-nav-cluster a {
    width: 34px;
}

.calendar-board-topline .calendar-toolbar-title h1 {
    font-size: 19px;
}

.calendar-board-topline .calendar-toolbar-title span {
    font-size: 11px;
}

.calendar-view-pill {
    color: #5f6368;
    font-size: 12px;
    font-weight: 550;
}

.calendar-view-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: #ffffff;
    color: #3c4043;
    font-size: 12px;
    font-weight: 650;
}

.calendar-weekdays,
.premium-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
    min-height: 36px;
    border-bottom: 1px solid #dadce0;
    background: #ffffff;
}

.calendar-weekdays span {
    display: grid;
    place-items: center end;
    padding-right: 10px;
    color: #70757a;
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
}

.premium-calendar-grid {
    background: #dadce0;
    gap: 1px;
}

.premium-calendar-day {
    min-width: 0;
    min-height: clamp(92px, 10.5vh, 118px);
    background: #ffffff;
}

.premium-calendar-day-link {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
    height: 100%;
    min-height: clamp(92px, 10.5vh, 118px);
    padding: 7px;
    color: inherit;
    text-decoration: none;
    transition: background 120ms ease, box-shadow 120ms ease;
}

.premium-calendar-day-link:hover {
    background: #f8fafd;
    box-shadow: inset 0 0 0 1px #d2e3fc;
}

.premium-calendar-day.is-muted {
    background: #fafafa;
}

.premium-calendar-day.is-muted .calendar-day-number,
.premium-calendar-day.is-muted .premium-calendar-event {
    opacity: 0.42;
}

.calendar-cell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}

.calendar-cell-header small {
    color: #1a73e8;
    font-size: 11px;
    font-weight: 650;
}

.premium-calendar-day.is-today .calendar-day-number {
    background: #1a73e8;
    color: #ffffff;
}

.calendar-day-number {
    display: inline-grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 999px;
    color: #3c4043;
    font-size: 12px;
    font-weight: 650;
}

.premium-day-events {
    display: grid;
    align-content: start;
    gap: 4px;
    min-width: 0;
}

.premium-calendar-event {
    display: grid;
    grid-template-columns: 7px 38px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    min-height: 23px;
    overflow: hidden;
    padding: 3px 6px;
    border-radius: 4px;
    background: var(--calendar-bg, #e8f0fe);
    color: var(--calendar-ink, #174ea6);
}

.premium-calendar-event i,
.calendar-event-lawyer i {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--calendar-color, #1a73e8);
}

.premium-calendar-event small,
.premium-calendar-event strong,
.premium-calendar-event em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.premium-calendar-event small {
    color: inherit;
    font-size: 10px;
    font-weight: 700;
}

.premium-calendar-event strong {
    color: #202124;
    font-size: 11px;
    font-weight: 650;
}

.premium-calendar-event em {
    grid-column: 3;
    margin-top: -2px;
    color: #5f6368;
    font-size: 10px;
    font-style: normal;
    font-weight: 500;
}

.premium-more-events {
    padding-left: 13px;
    color: #1a73e8;
    font-size: 11px;
    font-weight: 650;
}

.calendar-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: #dadce0;
}

.calendar-week-card {
    min-width: 0;
    min-height: clamp(360px, calc(100vh - 248px), 620px);
    background: #ffffff;
}

.calendar-week-card .premium-calendar-day-link {
    min-height: 100%;
}

.calendar-week-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #edf0f5;
}

.calendar-week-card-heading span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.calendar-week-card-heading strong {
    color: #202124;
    font-size: 14px;
    font-weight: 700;
}

.calendar-week-card-heading small,
.calendar-week-card-heading em {
    color: #5f6368;
    font-size: 11px;
    font-style: normal;
    font-weight: 650;
}

.calendar-week-card-heading em {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: #e8f0fe;
    color: #1a73e8;
}

.calendar-year-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: #dadce0;
}

.calendar-year-month {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
    min-height: 230px;
    padding: 10px;
    background: #ffffff;
}

.calendar-year-month header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.calendar-year-month header a {
    overflow: hidden;
    color: #202124;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-year-month header a:hover {
    color: #1a73e8;
}

.calendar-year-month header span {
    flex: 0 0 auto;
    color: #5f6368;
    font-size: 11px;
    font-weight: 650;
}

.calendar-year-weekdays,
.calendar-year-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
}

.calendar-year-weekdays span {
    display: grid;
    min-height: 18px;
    place-items: center;
    color: #70757a;
    font-size: 10px;
    font-weight: 750;
}

.calendar-year-day {
    display: grid;
    min-height: 24px;
    place-items: center;
    border-radius: 6px;
    color: #3c4043;
    font-size: 11px;
    font-weight: 650;
    text-decoration: none;
}

.calendar-year-day.has-events {
    background: #e8f0fe;
    color: #174ea6;
}

.calendar-year-day.is-today {
    background: #1a73e8;
    color: #ffffff;
}

.calendar-year-day.is-muted {
    color: #c2c7cf;
}

.calendar-year-day:not(.is-muted):hover {
    background: #f1f6ff;
    color: #155eef;
}

.calendar-event-popover,
.calendar-event-detail-popover {
    width: min(620px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 0;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: #ffffff;
    color: #202124;
    box-shadow: 0 24px 64px rgba(60, 64, 67, 0.24);
}

.calendar-event-popover:popover-open,
.calendar-event-detail-popover:popover-open {
    position: fixed;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
}

.calendar-event-popover::backdrop,
.calendar-event-detail-popover::backdrop {
    background: rgba(32, 33, 36, 0.32);
}

.calendar-event-form,
.calendar-event-detail {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.calendar-popover-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.calendar-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #5f6368;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.calendar-kicker svg {
    width: 15px;
    height: 15px;
}

.calendar-popover-header h2 {
    margin: 7px 0 0;
    color: #202124;
    font-size: 20px;
    font-weight: 650;
    line-height: 1.2;
}

.calendar-icon-button {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
}

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

.calendar-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

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

.calendar-field > span {
    color: #5f6368;
    font-size: 12px;
    font-weight: 650;
}

.calendar-field input,
.calendar-field select {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    outline: 0;
    background: #ffffff;
    color: #202124;
    font: inherit;
    font-size: 14px;
    font-weight: 550;
}

.calendar-field input:focus,
.calendar-field select:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.13);
}

.calendar-field input:disabled,
.calendar-field select:disabled {
    cursor: not-allowed;
    background: #f8fafd;
    color: #9aa0a6;
}

.calendar-block-panel {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: #ffffff;
}

.calendar-check-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    color: #202124;
    cursor: pointer;
}

.calendar-check-row input {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: #1a73e8;
}

.calendar-check-row span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.calendar-check-row strong {
    color: #202124;
    font-size: 13px;
    font-weight: 650;
}

.calendar-check-row small {
    color: #5f6368;
    font-size: 12px;
    font-weight: 550;
    line-height: 1.35;
}

.calendar-block-summary {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid #d2e3fc;
    border-radius: 8px;
    background: #f8fafd;
    color: #3c4043;
    font-size: 12px;
    font-weight: 600;
}

.calendar-block-summary svg {
    flex: 0 0 auto;
    color: #1a73e8;
}

.calendar-form-error {
    min-height: 18px;
    color: #d93025;
    font-size: 12px;
    font-weight: 650;
}

.calendar-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.calendar-form-actions .calendar-danger-action {
    margin-right: auto;
}

.calendar-agenda-list {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.calendar-day-schedule {
    display: grid;
    background: #ffffff;
}

.calendar-day-page .calendar-day-schedule {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.calendar-day-column-schedule {
    --calendar-time-column: 64px;
}

.calendar-day-column-header,
.calendar-day-row {
    display: grid;
    grid-template-columns:
        var(--calendar-time-column)
        repeat(var(--calendar-lawyer-columns, 1), minmax(112px, 1fr));
}

.calendar-day-column-header {
    position: sticky;
    top: 0;
    z-index: 3;
    min-height: 48px;
    border-bottom: 1px solid #dadce0;
    background: #f8fafd;
}

.calendar-day-time-heading,
.calendar-day-row > time {
    position: sticky;
    left: 0;
    z-index: 2;
    display: grid;
    align-items: start;
    justify-items: end;
    padding: 10px 9px;
    border-right: 1px solid #edf0f5;
    color: #70757a;
    font-size: 11px;
    font-weight: 700;
}

.calendar-day-time-heading {
    z-index: 4;
    align-items: center;
    background: #f8fafd;
    text-transform: uppercase;
}

.calendar-day-row > time {
    border-bottom: 1px solid #d8e0ec;
    background: #fbfcff;
    color: #4d5b70;
}

.calendar-lawyer-column-heading {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-width: 0;
    padding: 7px 9px;
    border-left: 1px solid #edf0f5;
}

.calendar-lawyer-column-heading .calendar-lawyer-avatar {
    width: 30px;
    height: 30px;
    font-size: 10px;
}

.calendar-lawyer-column-heading span:last-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.calendar-lawyer-column-heading strong,
.calendar-lawyer-column-heading small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-lawyer-column-heading strong {
    color: #202124;
    font-size: 12px;
    font-weight: 750;
}

.calendar-lawyer-column-heading small {
    color: #5f6368;
    font-size: 10px;
    font-weight: 650;
}

.calendar-day-row {
    min-height: 72px;
    border-bottom: 0;
    box-shadow: inset 0 -1px 0 #d8e0ec;
}

.calendar-day-row:last-child {
    box-shadow: none;
}

.calendar-day-row:last-child > time,
.calendar-day-row:last-child .calendar-lawyer-time-cell {
    border-bottom: 0;
}

.calendar-lawyer-time-cell {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    min-height: 72px;
    padding: 6px;
    border-left: 1px solid #edf0f5;
    border-bottom: 1px solid #d8e0ec;
    background: #ffffff;
}

.calendar-lawyer-time-cell:hover {
    background: #fbfdff;
}

.calendar-lawyer-time-cell .calendar-time-empty {
    min-height: 24px;
    padding: 0 6px;
    font-size: 11px;
}

.calendar-lawyer-time-cell .calendar-day-event {
    grid-template-columns: 1fr;
    gap: 5px;
    min-height: 58px;
    padding: 8px;
}

.calendar-lawyer-time-cell .calendar-event-time {
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 8px;
}

.calendar-lawyer-time-cell .calendar-event-time strong {
    font-size: 12px;
}

.calendar-lawyer-time-cell .calendar-event-time small,
.calendar-lawyer-time-cell .calendar-event-card-copy small {
    font-size: 11px;
}

.calendar-lawyer-time-cell .calendar-event-card-copy strong {
    font-size: 12px;
}

.calendar-time-slot {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    min-height: 76px;
    border-bottom: 1px solid #edf0f5;
}

.calendar-time-slot:last-child {
    border-bottom: 0;
}

.calendar-time-slot > time {
    padding: 12px 10px 0 14px;
    border-right: 1px solid #edf0f5;
    color: #70757a;
    font-size: 11px;
    font-weight: 650;
    text-align: right;
}

.calendar-time-lane {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
    padding: 8px;
}

.calendar-time-empty {
    display: inline-flex;
    align-items: center;
    align-self: start;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    color: #9aa0a6;
    font-size: 12px;
    font-weight: 550;
}

.calendar-day-event {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) minmax(120px, auto);
    gap: 12px;
    align-items: center;
    width: 100%;
    min-height: 68px;
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-left: 4px solid var(--calendar-color, #1a73e8);
    border-radius: 8px;
    background: #ffffff;
    color: #202124;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease;
}

.calendar-day-event:hover {
    border-color: #c9d7ee;
    border-left-color: var(--calendar-color, #1a73e8);
    background: #f8fafd;
}

.calendar-event-time {
    display: grid;
    gap: 2px;
    color: #3c4043;
}

.calendar-event-time strong {
    font-size: 14px;
    font-weight: 650;
}

.calendar-event-time small,
.calendar-event-card-copy small {
    color: #5f6368;
    font-size: 12px;
    font-weight: 550;
}

.calendar-event-card-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.calendar-event-card-copy strong,
.calendar-event-card-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event-card-copy strong {
    color: #202124;
    font-size: 14px;
    font-weight: 650;
}

.calendar-event-lawyer {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 7px;
    max-width: 180px;
    min-height: 28px;
    padding: 0 9px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--calendar-bg, #e8f0fe);
    color: var(--calendar-ink, #174ea6);
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-height: 220px;
    place-content: center;
    padding: 32px;
    color: #5f6368;
    text-align: center;
}

.calendar-empty-state svg {
    width: 34px;
    height: 34px;
    color: #9aa0a6;
}

.calendar-empty-state strong {
    color: #202124;
    font-size: 15px;
    font-weight: 650;
}

.calendar-empty-state span {
    font-size: 13px;
    font-weight: 550;
}

.calendar-event-detail-popover {
    width: min(520px, calc(100vw - 32px));
}

.calendar-event-detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.calendar-event-detail-list div {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 12px;
    padding: 11px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: #f8fafd;
}

.calendar-event-detail-list dt {
    color: #5f6368;
    font-size: 12px;
    font-weight: 650;
}

.calendar-event-detail-list dd {
    margin: 0;
    color: #202124;
    font-size: 14px;
    font-weight: 550;
    line-height: 1.45;
}

.calendar-detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
/* End calendar */

/* Client pages */
.required::after {
    content: "*";
    color: red;
}
/* End client pages */

/* Task pages */
.notification-button {
    text-decoration: none;
}

.task-toast-stack {
    position: fixed;
    top: 96px;
    right: 24px;
    z-index: 30;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
}

.task-toast {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 34px;
    gap: 11px;
    align-items: center;
    padding: 12px;
    border: 1px solid #cdd8ed;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(11, 31, 78, 0.18);
}

.task-toast-icon,
.task-stat-card > span,
.task-detail-empty i {
    display: grid;
    place-items: center;
    border-radius: 8px;
}

.task-toast-icon {
    width: 42px;
    height: 42px;
    background: #eef6ff;
    color: var(--blue);
}

.task-toast-icon svg,
.task-toast form svg {
    width: 19px;
    height: 19px;
}

.task-toast-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.task-toast-copy strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
}

.task-toast-copy a {
    overflow: hidden;
    color: var(--blue);
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-toast-copy small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.task-toast form {
    margin: 0;
}

.task-toast button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #dbe4f3;
    border-radius: 8px;
    background: #ffffff;
    color: #263a70;
    cursor: pointer;
}

.tasks-page {
    display: grid;
    gap: 22px;
}

.tasks-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.tasks-hero h1 {
    margin: 0;
    color: var(--ink);
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.05;
}

.tasks-hero p,
.task-create-heading p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
}

.tasks-create-button,
.task-primary-action,
.task-secondary-action,
.tasks-toolbar button,
.task-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.tasks-create-button,
.task-primary-action {
    border: 0;
    background: linear-gradient(135deg, #0f63ff, #5b38f5);
    color: #ffffff;
    box-shadow: 0 14px 26px rgba(43, 74, 221, 0.24);
}

.tasks-create-button {
    padding: 0 18px;
}

.tasks-create-button svg,
.task-primary-action svg,
.task-secondary-action svg,
.tasks-toolbar button svg {
    width: 18px;
    height: 18px;
}

.task-create-panel,
.tasks-list-panel,
.task-detail-panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 1px rgba(18, 44, 86, 0.02);
}

.task-create-panel {
    display: grid;
    gap: 18px;
    padding: 20px;
}

.task-create-heading,
.task-form-actions,
.tasks-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.task-create-heading h2,
.tasks-section-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 900;
}

.task-create-heading > a {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #dbe4f3;
    border-radius: 8px;
    color: #263a70;
}

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

.task-field {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: #33446e;
    font-size: 13px;
    font-weight: 850;
}

.task-field-wide {
    grid-column: span 2;
}

.task-field input,
.task-field select,
.task-field textarea,
.tasks-toolbar select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    outline: 0;
}

.task-field input,
.task-field select,
.tasks-toolbar select {
    min-height: 42px;
    padding: 0 12px;
}

.task-field textarea {
    padding: 10px 12px;
    resize: vertical;
}

.task-form-actions {
    align-items: center;
    justify-content: flex-end;
}

.tasks-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.task-stat-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-height: 116px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
}

.task-stat-card > span {
    width: 52px;
    height: 52px;
}

.task-stat-card svg {
    width: 29px;
    height: 29px;
}

.task-stat-card strong {
    display: block;
    color: var(--ink);
    font-size: 26px;
    font-weight: 950;
    line-height: 1;
}

.task-stat-card p {
    margin: 7px 0 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
}

.task-stat-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.task-stat-red > span {
    background: #fff1f3;
    color: #e11d48;
}

.task-stat-orange > span {
    background: #fff7ed;
    color: #f97316;
}

.task-stat-green > span {
    background: #ecfdf3;
    color: #0f9f62;
}

.tasks-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tasks-toolbar label {
    display: inline-grid;
    gap: 5px;
    min-width: min(220px, 100%);
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.tasks-toolbar label:first-child {
    margin-right: auto;
}

.tasks-toolbar button,
.task-secondary-action {
    padding: 0 14px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: #15285c;
}

.tasks-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
    gap: 18px;
    align-items: start;
}

.tasks-list-panel {
    overflow: hidden;
}

.tasks-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.tasks-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.tasks-table th,
.tasks-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #e7edf7;
    color: #132752;
    font-size: 14px;
    text-align: left;
    vertical-align: middle;
}

.tasks-table th {
    background: #f7faff;
    color: #4b5d86;
    font-size: 12px;
    font-weight: 900;
}

.tasks-table tbody tr.is-selected {
    background: linear-gradient(90deg, rgba(15, 99, 255, 0.08), rgba(91, 56, 245, 0.05));
    box-shadow: inset 3px 0 0 #4f46e5;
}

.tasks-table td small,
.tasks-table td > .task-muted {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.task-check-cell {
    width: 48px;
}

.task-check-cell form {
    margin: 0;
}

.task-check-cell button {
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border: 1px solid #b8c6dc;
    border-radius: 5px;
    background: #ffffff;
    color: #ffffff;
    cursor: pointer;
}

.task-check-cell button:hover {
    border-color: var(--blue);
    background: var(--blue);
}

.task-check-cell svg {
    width: 13px;
    height: 13px;
}

.task-title-link,
.task-matter-link,
.task-detail-grid a,
.task-detail-header a {
    color: #10275e;
    font-weight: 900;
    text-decoration: none;
}

.task-title-link:hover,
.task-matter-link:hover,
.task-detail-grid a:hover,
.task-detail-header a:hover {
    color: var(--blue);
}

.task-avatar {
    display: inline-grid;
    width: 30px;
    height: 30px;
    margin-right: 8px;
    place-items: center;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: linear-gradient(145deg, #0ea5e9, #f5b56f 52%, #15315f 53%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 6px 14px rgba(13, 35, 82, 0.14);
    vertical-align: middle;
}

.task-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.task-status-pill.is-overdue {
    background: #fff1f3;
    color: #e11d48;
}

.task-status-pill.is-in-progress {
    background: #eaf3ff;
    color: #0f63ff;
}

.task-status-pill.is-waiting {
    background: #f0edff;
    color: #5741c8;
}

.task-status-pill.is-not-started {
    background: #eef2f7;
    color: #344054;
}

.task-status-pill.is-completed {
    background: #ecfdf3;
    color: #0f7546;
}

.task-due-overdue {
    color: #e11d48;
    font-weight: 900;
}

.tasks-empty-row {
    height: 96px;
    color: var(--muted);
    text-align: center !important;
}

.tasks-completed-section {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.tasks-section-heading {
    align-items: center;
}

.tasks-section-heading span {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    background: #eef6ff;
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
}

.tasks-completed-list {
    display: grid;
    gap: 8px;
}

.tasks-completed-list p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.tasks-completed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #e7edf7;
    border-radius: 8px;
    background: #fbfdff;
    color: #10275e;
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
}

.tasks-completed-row span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.tasks-completed-row svg {
    width: 17px;
    height: 17px;
    color: #0f9f62;
}

.tasks-completed-row small {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.task-detail-panel {
    position: sticky;
    top: 104px;
    display: grid;
    gap: 22px;
    padding: 24px;
}

.task-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.task-detail-header h2 {
    margin: 0;
    color: var(--ink);
    font-size: 22px;
    font-weight: 950;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.task-detail-header a {
    display: inline-flex;
    margin-top: 12px;
    padding: 7px 10px;
    border-radius: 8px;
    background: #eef2ff;
    color: #1d4ed8;
    font-size: 12px;
}

.task-detail-grid {
    display: grid;
    gap: 18px;
    margin: 0;
    padding: 0;
}

.task-detail-grid div {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.task-detail-grid dt {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #25396b;
    font-size: 13px;
    font-weight: 800;
}

.task-detail-grid dt svg {
    width: 17px;
    height: 17px;
}

.task-detail-grid dd {
    min-width: 0;
    margin: 0;
    color: #10275e;
    font-size: 14px;
    font-weight: 750;
}

.task-detail-notes {
    display: grid;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.task-detail-notes h3 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
}

.task-detail-notes p {
    margin: 0;
    color: #314779;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.55;
    white-space: pre-line;
}

.task-detail-actions {
    display: grid;
    gap: 10px;
    padding-top: 8px;
}

.task-detail-actions form {
    margin: 0;
}

.task-primary-action,
.task-secondary-action {
    width: 100%;
}

.task-detail-empty {
    display: grid;
    gap: 14px;
    min-height: 360px;
    place-items: center;
    align-content: center;
    color: var(--muted);
    text-align: center;
}

.task-detail-empty i {
    width: 58px;
    height: 58px;
    background: #eef6ff;
    color: var(--blue);
}

.task-detail-empty svg {
    width: 30px;
    height: 30px;
}

.task-detail-empty p {
    margin: 0;
    font-weight: 800;
}

.page-content:has(.tasks-page) {
    padding: 20px 24px 28px;
    background:
        radial-gradient(circle at 8% 0%, rgba(15, 99, 255, 0.07), transparent 28%),
        linear-gradient(180deg, #f7faff 0%, #ffffff 42%);
}

.tasks-page {
    gap: 22px;
}

.tasks-page .page-action-row,
.page-action-row:has(.tasks-create-split) {
    margin: 0;
    padding-top: 0;
}

.tasks-create-split {
    display: inline-flex;
    align-items: stretch;
    gap: 2px;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 99, 255, 0.24);
}

.tasks-create-split .tasks-create-button,
.tasks-create-arrow {
    min-height: 44px;
    border-radius: 0;
    background: #0f63ff;
    color: #ffffff;
    box-shadow: none;
}

.tasks-create-split .tasks-create-button {
    border-radius: 8px 0 0 8px;
}

.tasks-create-arrow {
    display: inline-flex;
    width: 44px;
    align-items: center;
    justify-content: center;
    border-left: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 0 8px 8px 0;
    text-decoration: none;
}

.tasks-create-arrow svg {
    width: 18px;
    height: 18px;
}

.tasks-stats {
    gap: 18px;
}

.task-stat-card {
    min-height: 124px;
    padding: 24px;
    border-color: #e4eaf5;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 34px rgba(17, 37, 78, 0.06);
}

.task-stat-card > span {
    width: 64px;
    height: 64px;
    border-radius: 999px;
}

.task-stat-card strong {
    font-size: 30px;
}

.task-stat-red small,
.task-due-overdue {
    color: #f00025;
}

.task-stat-orange small {
    color: #f26a00;
}

.task-stat-green small {
    color: #00a650;
}

.tasks-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1.25fr) 170px 140px minmax(150px, 0.7fr) minmax(160px, 0.8fr) minmax(170px, 0.9fr);
    gap: 20px;
    align-items: center;
    padding: 16px;
    border: 1px solid #e4eaf5;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 34px rgba(17, 37, 78, 0.06);
}

.tasks-toolbar label,
.tasks-search-control,
.tasks-sort-control,
.tasks-select-control {
    min-width: 0;
}

.tasks-search-control,
.tasks-sort-control,
.tasks-select-control,
.tasks-filter-button {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 48px;
    border: 1px solid #dce5f3;
    border-radius: 8px;
    background: #ffffff;
    color: #12275d;
}

.tasks-search-control {
    gap: 10px;
    padding: 0 14px;
}

.tasks-search-control svg {
    width: 19px;
    height: 19px;
    color: #243865;
}

.tasks-search-control input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
}

.tasks-search-control input::placeholder {
    color: #657595;
}

.tasks-sort-control,
.tasks-select-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    gap: 8px;
    padding: 0 12px;
}

.tasks-sort-control > span,
.tasks-select-control > span {
    position: absolute;
    top: -9px;
    left: 12px;
    padding: 0 6px;
    background: #ffffff;
    color: #536286;
    font-size: 12px;
    font-weight: 700;
}

.tasks-sort-control select,
.tasks-select-control select {
    min-width: 0;
    width: 100%;
    height: 46px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #071743;
    font: inherit;
    font-size: 14px;
    font-weight: 850;
    appearance: none;
}

.tasks-sort-control svg,
.tasks-select-control::after {
    align-self: center;
    justify-self: end;
    color: #243865;
}

.tasks-select-control::after {
    width: 18px;
    height: 18px;
    content: "";
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.tasks-filter-button {
    justify-content: center;
    gap: 10px;
    padding: 0 14px;
    box-shadow: none;
}

.tasks-filter-button strong {
    display: grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 999px;
    background: #eaf1ff;
    color: #0f63ff;
    font-size: 12px;
    font-weight: 900;
}

.tasks-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
    gap: 18px;
}

.tasks-list-panel,
.task-detail-panel {
    border-color: #e4eaf5;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 34px rgba(17, 37, 78, 0.06);
}

.tasks-list-panel {
    min-height: 530px;
}

.tasks-table {
    min-width: 930px;
}

.tasks-table th,
.tasks-table td {
    padding: 17px 18px;
}

.tasks-table th {
    background: #ffffff;
    color: #21345f;
    font-size: 13px;
    text-transform: none;
}

.tasks-table th svg {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-left: 3px;
    vertical-align: -2px;
}

.tasks-table tbody tr {
    min-height: 82px;
}

.tasks-table tbody tr.is-selected {
    background: #f6faff;
    box-shadow: inset 4px 0 0 #0f63ff;
}

.task-title-link {
    font-size: 15px;
}

.task-title-link + small::before {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 999px;
    background: #0f63ff;
    content: "";
    vertical-align: 1px;
}

.task-priority-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #24345d;
    font-size: 13px;
    font-weight: 800;
}

.task-priority-pill::before {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #f5b700;
    content: "";
}

.task-priority-pill.is-low::before {
    background: #32a46c;
}

.task-priority-pill.is-high::before,
.task-priority-pill.is-urgent::before {
    background: #f00025;
}

.task-row-menu {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    color: #0d2356;
    text-decoration: none;
}

.task-row-menu svg {
    width: 18px;
    height: 18px;
}

.tasks-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 76px;
    padding: 14px 22px;
    border-top: 1px solid #e4eaf5;
    color: #314263;
    font-size: 13px;
    font-weight: 650;
}

.tasks-pagination {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.tasks-pagination button,
.tasks-pagination strong,
.tasks-pagination select {
    display: inline-grid;
    min-width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid #dce5f3;
    border-radius: 8px;
    background: #ffffff;
    color: #486081;
    font: inherit;
    font-size: 13px;
}

.tasks-pagination button {
    border-color: transparent;
    cursor: pointer;
}

.tasks-pagination button svg {
    width: 18px;
    height: 18px;
}

.tasks-pagination strong {
    background: #f1f5ff;
    color: #0f63ff;
    font-weight: 900;
}

.tasks-pagination select {
    min-width: 142px;
    padding: 0 12px;
}

.tasks-completed-section {
    border-top: 1px solid #e4eaf5;
}

.task-detail-panel {
    top: 102px;
    gap: 12px;
    padding: 16px;
}

.task-detail-header {
    align-items: center;
}

.task-detail-header h2 {
    font-size: 21px;
}

.task-detail-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.task-detail-header-actions > a {
    display: grid;
    width: 34px;
    height: 34px;
    margin: 0;
    place-items: center;
    padding: 0;
    background: transparent;
    color: #132752;
}

.task-detail-header-actions svg {
    width: 19px;
    height: 19px;
}

.task-detail-tabs {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 38px;
    border-bottom: 1px solid #dfe7f5;
}

.task-detail-tabs a {
    display: inline-flex;
    align-items: center;
    height: 38px;
    border-bottom: 2px solid transparent;
    color: #4d5d7d;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.task-detail-tabs a.is-active {
    border-bottom-color: #0f63ff;
    color: #0f63ff;
}

.task-detail-card {
    display: grid;
    gap: 11px;
    padding: 13px;
    border: 1px solid #dfe7f5;
    border-radius: 8px;
    background: #ffffff;
}

.task-detail-card h3 {
    margin: 0;
    color: #182a55;
    font-size: 14px;
    font-weight: 900;
}

.task-detail-card p {
    margin: 0;
    color: #34466c;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
}

.task-detail-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.task-detail-card-heading a,
.task-detail-card-heading button {
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid #8ab0ff;
    border-radius: 8px;
    background: #ffffff;
    color: #0f63ff;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.task-detail-grid {
    gap: 11px;
}

.task-detail-grid div {
    grid-template-columns: 120px minmax(0, 1fr);
}

.task-detail-grid dt,
.task-detail-grid dd {
    font-size: 13px;
}

.task-detail-grid .task-avatar {
    width: 24px;
    height: 24px;
    font-size: 9px;
}

.task-detail-actions {
    grid-template-columns: minmax(0, 1fr) 52px;
    align-items: center;
    padding-top: 10px;
}

.task-more-action {
    display: grid;
    width: 52px;
    height: 46px;
    place-items: center;
    border: 1px solid #b7c9ee;
    border-radius: 8px;
    background: #ffffff;
    color: #0d2356;
    cursor: pointer;
}

.task-more-action svg {
    width: 22px;
    height: 22px;
}

/* Screenshot-matched task workspace pass */
.page-content:has(.tasks-page) {
    padding: 20px 24px 28px;
}

.tasks-page {
    max-width: 1420px;
    margin: 0 auto;
}

.tasks-page .page-action-row,
.page-action-row:has(.tasks-create-split) {
    justify-content: flex-end;
    min-height: 46px;
}

.tasks-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.task-stat-card {
    grid-template-columns: 68px minmax(0, 1fr);
    min-height: 126px;
    padding: 24px 28px;
    border: 1px solid #e2e9f5;
    border-radius: 8px;
}

.task-stat-card p {
    margin-top: 8px;
}

.tasks-toolbar {
    grid-template-columns:
        minmax(220px, 1.4fr)
        minmax(126px, 0.58fr)
        minmax(120px, 0.48fr)
        minmax(128px, 0.58fr)
        minmax(138px, 0.66fr)
        minmax(138px, 0.66fr);
    gap: 16px;
    padding: 16px;
}

.tasks-toolbar label:first-child {
    margin-right: 0;
}

.tasks-search-control,
.tasks-sort-control,
.tasks-select-control,
.tasks-filter-button {
    min-height: 46px;
}

.tasks-sort-control select,
.tasks-select-control select {
    height: 44px;
    font-size: 13px;
}

.tasks-filter-button {
    min-width: 0;
    font-size: 13px;
}

.tasks-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 400px);
    align-items: stretch;
}

.tasks-list-panel {
    display: grid;
    grid-template-rows: minmax(390px, 1fr) auto auto;
    min-height: 510px;
}

.tasks-table-wrap {
    min-height: 390px;
}

.tasks-table {
    min-width: 820px;
}

.tasks-table th,
.tasks-table td {
    padding: 15px 16px;
}

.tasks-table th:first-child,
.tasks-table td:first-child {
    width: 52px;
}

.tasks-table th:last-child,
.tasks-table td:last-child {
    width: 48px;
}

.tasks-table tbody tr {
    height: 86px;
}

.tasks-table td {
    font-size: 13px;
}

.tasks-table td small,
.tasks-table td > .task-muted {
    font-size: 12px;
}

.task-title-link {
    font-size: 14px;
}

.task-avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
}

.task-status-pill {
    min-height: 28px;
    border-radius: 8px;
    font-size: 12px;
}

.tasks-table-footer {
    min-height: 78px;
}

.task-detail-panel {
    min-height: 510px;
    align-self: start;
}

.task-detail-card {
    padding: 12px;
}

.task-primary-action {
    min-height: 46px;
}

@media (max-width: 1320px) {
    .tasks-toolbar {
        grid-template-columns: minmax(240px, 1fr) minmax(130px, 0.55fr) minmax(120px, 0.5fr);
    }

    .tasks-workbench {
        grid-template-columns: 1fr;
    }

    .task-detail-panel {
        position: static;
    }
}

@media (max-width: 1180px) {
    .tasks-workbench {
        grid-template-columns: 1fr;
    }

    .task-detail-panel {
        position: static;
    }
}

@media (max-width: 920px) {
    .tasks-stats,
    .task-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .task-field-wide {
        grid-column: span 2;
    }

    .tasks-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
    }
}

@media (max-width: 720px) {
    .task-toast-stack {
        top: 84px;
        right: 16px;
        left: 16px;
        width: auto;
    }

    .tasks-hero,
    .tasks-toolbar,
    .task-create-heading,
    .task-form-actions {
        display: grid;
        justify-content: stretch;
    }

    .tasks-toolbar {
        grid-template-columns: 1fr;
    }

    .tasks-create-button,
    .tasks-toolbar button,
    .tasks-create-split {
        width: 100%;
    }

    .tasks-stats,
    .task-form-grid {
        grid-template-columns: 1fr;
    }

    .task-field-wide {
        grid-column: span 1;
    }

    .task-detail-grid div {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .tasks-completed-row {
        display: grid;
    }
}
/* End task pages */

.matter-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding: 6px 0 2px;
}

.matter-eyebrow,
.matter-section-kicker {
    margin: 0;
    color: #60719d;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.matter-hero h1 {
    max-width: 980px;
    margin: 8px 0 0;
    color: var(--ink);
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.02;
}

.matter-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
}

.matter-meta span,
.matter-button,
.document-name,
.compact-row,
.task-row,
.attachment-list a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.matter-meta svg,
.matter-button svg,
.document-name svg,
.compact-row svg,
.attachment-list svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.matter-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
    gap: 18px;
    align-items: start;
}

.matter-ordered-stack {
    display: grid;
    gap: 18px;
    max-width: 1180px;
}

.matter-main-stack,
.matter-side-stack {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.matter-panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 1px rgba(18, 44, 86, 0.02);
}

.matter-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.matter-panel h2,
.generated-documents h3 {
    margin: 5px 0 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 850;
    line-height: 1.2;
}

.matter-form,
.correspondence-form {
    display: grid;
    gap: 12px;
}

.matter-form {
    margin-bottom: 18px;
}

.matter-form .matter-button,
.correspondence-form .matter-button {
    justify-self: start;
}

.matter-toolbar-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.matter-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.matter-inline-form,
.matter-upload-form,
.matter-sort-form,
.attachment-form {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.matter-upload-form,
.matter-sort-form {
    flex-wrap: wrap;
}

.matter-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.matter-input,
.matter-input-small,
.matter-select-small,
.matter-file-input {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    line-height: 1.35;
    outline: 0;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.matter-input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
}

textarea.matter-input {
    resize: vertical;
}

.matter-input-small,
.matter-select-small {
    height: 34px;
    padding: 0 9px;
    font-size: 13px;
}

.matter-file-input {
    max-width: 100%;
    padding: 8px;
    color: #31436f;
    background: #fbfdff;
}

.matter-input:focus,
.matter-input-small:focus,
.matter-select-small:focus,
.matter-file-input:focus {
    border-color: #8fb3f4;
    box-shadow: 0 0 0 3px rgba(15, 99, 255, 0.12);
}

.matter-button {
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.matter-button-primary {
    background: var(--blue);
    color: #ffffff;
    box-shadow: 0 9px 18px rgba(15, 99, 255, 0.18);
}

.matter-button-secondary {
    border: 1px solid var(--line);
    background: #ffffff;
    color: #17285a;
}

.matter-button-success {
    background: var(--green);
    color: #ffffff;
}

.matter-button-danger {
    border: 1px solid #f1c7c7;
    background: #fff5f5;
    color: #b42318;
}

.matter-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.matter-legal-aid-number {
    margin: 6px 0 0;
    color: #344054;
    font-size: 13px;
    font-weight: 750;
}

.clients-page {
    display: grid;
    gap: 18px;
    max-width: 1180px;
}

.client-toolbar,
.client-profile-summary,
.client-action-row,
.client-form-footer,
.client-panel-header,
.client-matter-result,
.client-matter-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.client-toolbar,
.client-profile-summary,
.client-panel-header {
    justify-content: space-between;
}

.client-search-form {
    display: grid;
    grid-template-columns: 20px minmax(180px, 420px) auto auto;
    align-items: center;
    gap: 10px;
    min-width: min(100%, 640px);
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.client-search-form input {
    min-width: 0;
    height: 38px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
}

.client-panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 1px rgba(18, 44, 86, 0.02);
}

.client-panel-header {
    align-items: flex-start;
    margin-bottom: 18px;
}

.client-panel h2 {
    margin: 5px 0 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 850;
    line-height: 1.2;
}

.client-count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #cfe0ff;
    border-radius: 6px;
    background: #edf4ff;
    color: var(--blue);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.client-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.client-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.client-table th,
.client-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e5ebf4;
    color: #26385f;
    font-size: 14px;
    text-align: left;
    vertical-align: middle;
}

.client-table th {
    color: #60719d;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.client-table a {
    color: var(--blue);
    font-weight: 850;
    text-decoration: none;
}

.client-list-row:hover {
    background: #f8fbff;
}

.client-empty-cell {
    color: var(--muted);
    text-align: center !important;
}

.client-matter-result-list,
.client-matter-card-list,
.client-form {
    display: grid;
    gap: 12px;
}

.client-matter-result {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) minmax(160px, 240px);
    padding: 13px 0;
    border-bottom: 1px solid #e5ebf4;
    color: #26385f;
    text-decoration: none;
}

.client-matter-result span {
    color: var(--blue);
    font-weight: 850;
}

.client-matter-result strong,
.client-matter-result small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-profile-summary {
    padding: 4px 0;
}

.client-author-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 7px 0 0;
    color: #344054;
    font-size: 14px;
    font-weight: 750;
}

.client-author-line svg {
    width: 17px;
    height: 17px;
}

.client-detail-grid {
    display: grid;
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

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

.client-form label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.client-form label > span {
    color: #60719d;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.client-field-wide,
.client-form-footer {
    grid-column: 1 / -1;
}

.client-form-footer {
    justify-content: flex-start;
    margin-top: 4px;
}

.client-form-panel {
    max-width: 820px;
}

.client-form-actions-top {
    justify-content: flex-start;
}

.client-matter-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid #e5ebf4;
    border-radius: 8px;
    background: #fbfdff;
}

.client-matter-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}

.client-matter-title span {
    color: var(--blue);
    font-size: 14px;
    font-weight: 850;
}

.client-matter-title small {
    color: #60719d;
    font-size: 12px;
    font-weight: 800;
}

.client-matter-title strong {
    color: var(--ink);
    font-size: 17px;
    font-weight: 850;
    line-height: 1.25;
}

.client-matter-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.client-matter-card .matter-button {
    justify-self: start;
}

.matter-file-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    max-width: 1180px;
    margin-bottom: 18px;
}

.matter-file-menu a {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: #17285a;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 1px 1px rgba(18, 44, 86, 0.02);
}

.matter-file-menu a:hover,
.matter-file-menu a.is-active {
    border-color: #a9bfdf;
    background: #f5f9ff;
}

.matter-file-menu svg {
    width: 20px;
    height: 20px;
    color: #31528c;
}

.matter-file-menu span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.matter-file-menu strong {
    display: grid;
    min-width: 26px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: #edf3ff;
    color: #31528c;
    font-size: 12px;
    font-weight: 850;
}

.matter-list,
.bundle-stack,
.disclosure-browser {
    display: grid;
    gap: 10px;
}

.matter-list-row,
.bundle-card,
.disclosure-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.matter-list-row {
    padding: 15px;
}

.matter-note-copy {
    margin: 0;
    color: #14224f;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-line;
}

.matter-row-meta,
.matter-empty {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.disclosure-group {
    overflow: hidden;
}

.disclosure-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 52px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #f7faff;
}

.disclosure-group-header h3 {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    margin: 0;
    color: #12275d;
    font-size: 15px;
    font-weight: 850;
}

.disclosure-group-header h3 svg {
    width: 18px;
    height: 18px;
    color: #31528c;
}

.disclosure-group-header > span,
.folder-tools > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.folder-tools,
.folder-rename-form,
.document-actions,
.bundle-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.folder-rename-form > button:not(.matter-button) {
    border: 0;
    background: transparent;
    color: var(--blue);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.matter-danger-link {
    color: #c03333;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.document-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 54px;
    padding: 10px 14px;
    border-bottom: 1px solid #e9eef8;
}

.document-row:last-child {
    border-bottom: 0;
}

.document-name span {
    overflow: hidden;
    color: #102452;
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-name svg {
    color: #4b638f;
}

a.document-name {
    color: inherit;
    text-decoration: none;
}

.document-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, auto) minmax(160px, 220px);
    justify-content: end;
}

.document-actions a,
.processing-result-meta a,
.matter-table a,
.task-row a,
.attachment-list a {
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.document-actions a:hover,
.processing-result-meta a:hover,
.matter-table a:hover,
.task-row a:hover,
.attachment-list a:hover {
    text-decoration: underline;
}

.matter-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.matter-table {
    width: 100%;
    min-width: 660px;
    border-collapse: collapse;
    background: #ffffff;
}

.matter-table th,
.matter-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    color: #14224f;
    font-size: 14px;
    text-align: left;
    vertical-align: top;
}

.matter-table th {
    background: #f5f8fd;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.matter-table tr:last-child td {
    border-bottom: 0;
}

.bundle-card {
    padding: 14px;
}

.bundle-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.bundle-card-header p,
.compact-row p,
.task-row p,
.processing-result-row p,
.correspondence-heading p {
    margin: 0;
    color: #102452;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.bundle-card-header span,
.bundle-meta,
.compact-row span,
.task-row span,
.processing-result-row span,
.correspondence-heading span,
.correspondence-party-grid {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.4;
}

.bundle-meta {
    display: grid;
    gap: 3px;
    margin-top: 9px;
}

.bundle-actions {
    margin-top: 12px;
}

.matter-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.matter-status-green {
    background: #e8f8ef;
    color: #0f7546;
}

.matter-status-orange {
    background: #fff4df;
    color: #9b5a00;
}

.processing-results {
    display: grid;
    gap: 8px;
    max-height: 360px;
    margin-top: 14px;
    padding-right: 4px;
    overflow-y: auto;
    scrollbar-color: #bdc9dd #f2f6fd;
}

.processing-result-row {
    display: grid;
    gap: 9px;
    padding: 11px;
    border: 1px solid #e5ecf7;
    border-radius: 8px;
    background: #fbfdff;
}

.processing-result-meta {
    display: grid;
    gap: 7px;
    justify-items: start;
}

.processing-result-meta > span:first-child {
    color: #52648f;
    font-size: 12px;
    line-height: 1.4;
}

.generated-documents {
    display: grid;
    gap: 9px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.generated-document-list {
    display: grid;
    gap: 9px;
    max-height: 320px;
    padding-right: 4px;
    overflow-y: auto;
    scrollbar-color: #bdc9dd #f2f6fd;
}

.compact-row,
.task-row {
    justify-content: space-between;
    width: 100%;
    padding: 12px;
    border: 1px solid #e5ecf7;
    border-radius: 8px;
    background: #fbfdff;
}

.compact-row {
    justify-content: flex-start;
    align-items: flex-start;
}

.compact-row svg {
    margin-top: 1px;
    color: #31528c;
}

.task-row {
    align-items: flex-start;
}

.task-row .is-complete {
    color: #8794ad;
    text-decoration: line-through;
}

.matter-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.correspondence-form {
    margin-bottom: 18px;
}

.correspondence-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.correspondence-party-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin-bottom: 10px;
}

.attachment-form {
    margin-top: 12px;
}

.attachment-list {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.dictation-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
    gap: 20px;
    align-items: start;
    max-width: 1320px;
}

.dictation-workspace[data-active-stage="review"],
.dictation-workspace[data-active-stage="generate"] {
    grid-template-columns: 1fr;
    max-width: none;
}

.dictation-workspace:not([data-active-stage="capture"]) .dictation-setup-card,
.dictation-workspace:not([data-active-stage="capture"]) .dictation-side-rail {
    display: none;
}

.dictation-workspace[data-active-stage="review"] .dictation-form {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.dictation-main-column,
.dictation-form,
.dictation-side-rail {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.dictation-side-rail {
    position: sticky;
    top: 104px;
}

.dictation-stepper,
.dictation-setup-card,
.dictation-card {
    min-width: 0;
    border: 1px solid #dde6f3;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 34px rgba(20, 37, 72, 0.06);
}

.dictation-stepper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
}

.dictation-step {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 4px 12px;
    align-items: center;
    min-height: 82px;
    padding: 17px 26px;
    color: #4b5c86;
    text-decoration: none;
}

.dictation-step::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: transparent;
    content: "";
}

.dictation-step span {
    display: grid;
    grid-row: span 2;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid #d8e1f0;
    border-radius: 999px;
    background: #f2f5fb;
    color: #24375f;
    font-size: 13px;
    font-weight: 900;
}

.dictation-step strong,
.dictation-step small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dictation-step strong {
    color: #07163d;
    font-size: 15px;
    font-weight: 900;
}

.dictation-step small {
    color: #64739d;
    font-size: 12px;
    font-weight: 700;
}

.dictation-step.is-active span,
.dictation-step.is-complete span {
    border-color: transparent;
    background: linear-gradient(135deg, #4d2fff, #6725db);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(78, 47, 255, 0.24);
}

.dictation-step.is-active::after,
.dictation-step.is-complete::after {
    background: linear-gradient(90deg, #4d2fff, #6d4cff);
}

.dictation-setup-card,
.dictation-card {
    padding: 22px;
}

.dictation-setup-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 20px;
}

.dictation-field {
    position: relative;
    display: grid;
    gap: 8px;
    min-width: 0;
}

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

.dictation-field > span {
    color: #07163d;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
}

.dictation-field > span em {
    color: #7180a8;
    font-style: normal;
    font-weight: 750;
}

.dictation-field-with-icon > svg {
    position: absolute;
    bottom: 12px;
    left: 13px;
    z-index: 1;
    width: 18px;
    height: 18px;
    color: #263b70;
    pointer-events: none;
}

.dictation-field-with-icon .matter-input {
    padding-left: 42px;
}

.dictation-matter-field.is-hidden {
    display: none;
}

.dictation-stage-panel {
    display: none;
}

.dictation-transcript-source {
    display: none;
}

.dictation-workspace[data-active-stage="capture"] [data-stage-panel="capture"],
.dictation-workspace[data-active-stage="review"] [data-stage-panel="review"] {
    display: grid;
    gap: 18px;
}

.dictation-capture-grid,
.dictation-review-layout,
.dictation-generate-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    min-width: 0;
}

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

.dictation-generate-stage {
    min-width: 0;
}

.dictation-card-heading,
.dictation-panel-heading,
.dictation-review-footer,
.dictation-stage-actions,
.dictation-side-actions,
.dictation-file-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dictation-card-heading,
.dictation-panel-heading,
.dictation-review-footer {
    justify-content: space-between;
}

.dictation-card h2,
.dictation-card-heading h2,
.dictation-panel-heading h2 {
    margin: 0;
    color: #07163d;
    font-size: 17px;
    font-weight: 950;
    line-height: 1.2;
}

.dictation-panel-heading > div {
    display: grid;
    gap: 6px;
}

.dictation-panel-heading > div > span,
.dictation-panel-heading > a {
    color: #4d2fff;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.dictation-panel-heading > div > span {
    display: inline-flex;
    width: max-content;
    min-height: 24px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: #dff7e9;
    color: #087443;
}

.dictation-panel-heading > div > span.is-empty {
    background: #eef3ff;
    color: #50618e;
}

.dictation-heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.dictation-icon-action {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #dde6f3;
    border-radius: 8px;
    background: #ffffff;
    color: #263b70;
    text-decoration: none;
    cursor: pointer;
}

.dictation-record-card,
.dictation-upload-card,
.dictation-review-panel,
.dictation-document-preview-panel,
.dictation-generate-panel {
    display: grid;
    gap: 18px;
}

.dictation-recorder-visual {
    --voice-ring: 1;
    --voice-bar: 0.58;
    display: grid;
    grid-template-columns: minmax(82px, 1fr) 128px minmax(82px, 1fr);
    gap: 14px;
    align-items: center;
    justify-items: center;
    min-height: 166px;
}

.dictation-mic-trigger {
    position: relative;
    display: grid;
    width: 92px;
    height: 92px;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #4d2fff, #6f22db);
    color: #ffffff;
    box-shadow: 0 18px 32px rgba(77, 47, 255, 0.28);
    cursor: pointer;
}

.dictation-mic-trigger::before,
.dictation-mic-trigger::after {
    position: absolute;
    inset: -20px;
    border-radius: inherit;
    background: rgba(100, 79, 255, 0.12);
    content: "";
    transform: scale(var(--voice-ring));
    transition: transform 90ms ease-out, opacity 90ms ease-out;
}

.dictation-mic-trigger::after {
    inset: -34px;
    background: rgba(100, 79, 255, 0.07);
    opacity: 0.85;
}

.dictation-mic-trigger:disabled {
    cursor: not-allowed;
}

.dictation-mic-trigger svg {
    position: relative;
    z-index: 1;
    width: 38px;
    height: 38px;
}

.voice-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    height: 80px;
    color: #6b55ff;
}

.voice-wave span {
    width: 3px;
    min-height: 5px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.6;
    transform: scaleY(var(--voice-bar));
    transform-origin: center;
    transition: transform 80ms ease-out, opacity 120ms ease;
}

.voice-wave span:nth-child(1),
.voice-wave span:nth-child(7) {
    height: 13px;
    opacity: 0.35;
}

.voice-wave span:nth-child(2),
.voice-wave span:nth-child(6) {
    height: 23px;
    opacity: 0.48;
}

.voice-wave span:nth-child(3),
.voice-wave span:nth-child(5) {
    height: 38px;
}

.voice-wave span:nth-child(4) {
    height: 54px;
    opacity: 0.8;
}

.dictation-recorder-status {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    justify-items: center;
    gap: 7px 9px;
    color: #3c4d7c;
    text-align: center;
}

.dictation-recorder-status strong {
    color: #34466f;
    font-size: 14px;
    font-weight: 900;
}

.dictation-recorder-status small {
    grid-column: 1 / -1;
    color: #5e6f9b;
    font-size: 14px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.dictation-status-dot {
    width: 10px;
    height: 10px;
    align-self: center;
    border-radius: 999px;
    background: #9aabc8;
    box-shadow: 0 0 0 4px rgba(154, 171, 200, 0.16);
}

.dictation-status-dot.is-active {
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(18, 148, 90, 0.14);
}

.dictation-status-dot.is-paused {
    background: var(--orange);
    box-shadow: 0 0 0 4px rgba(245, 154, 35, 0.16);
}

.dictation-status-dot.is-error {
    background: #c03333;
    box-shadow: 0 0 0 4px rgba(192, 51, 51, 0.13);
}

.dictation-controls {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(96px, auto) minmax(88px, auto);
    gap: 10px;
}

.dictation-controls .matter-button:disabled,
.dictation-heading-actions .matter-button:disabled,
.dictation-side-actions .matter-button:disabled,
.dictation-wide-action:disabled,
.dictation-generate-actions .matter-button:disabled {
    cursor: not-allowed;
    opacity: 0.56;
}

.dictation-audio-preview {
    width: 100%;
    min-height: 42px;
}

.dictation-security-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #65749c;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.dictation-security-note svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: #31528c;
}

.dictation-dropzone {
    display: grid;
    min-height: 224px;
    place-items: center;
    padding: 26px;
    border: 1px dashed #b8c6dc;
    border-radius: 8px;
    background: #fbfdff;
    color: #34466f;
    text-align: center;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.dictation-dropzone.is-dragging {
    border-color: #4d2fff;
    background: #f6f3ff;
    box-shadow: inset 0 0 0 1px rgba(77, 47, 255, 0.18);
}

.dictation-dropzone svg {
    width: 42px;
    height: 42px;
    color: #33446e;
}

.dictation-dropzone strong {
    margin-top: 12px;
    color: #16264f;
    font-size: 15px;
    font-weight: 900;
}

.dictation-dropzone span {
    color: #5c6d99;
    font-size: 13px;
    font-weight: 700;
}

.dictation-dropzone em {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 0 14px;
    border: 1px solid #d7def0;
    border-radius: 8px;
    background: #ffffff;
    color: #4d2fff;
    font-size: 13px;
    font-style: normal;
    font-weight: 900;
}

.dictation-dropzone small {
    margin-top: 10px;
    color: #7584ab;
    font-size: 12px;
    font-weight: 700;
}

.dictation-file-native {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.dictation-wide-action {
    width: 100%;
    min-height: 46px;
    border-color: #9b7cff;
    color: #4d2fff;
}

.dictation-transcript-overview {
    gap: 18px;
}

.dictation-transcript-preview {
    display: grid;
    min-height: 148px;
    align-content: start;
    gap: 10px;
    padding: 20px;
    overflow: auto;
    border: 1px solid #edf1f8;
    border-radius: 8px;
    background: linear-gradient(135deg, #fbfdff, #f7f4ff);
    color: #23355f;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    white-space: pre-wrap;
}

.dictation-transcript-preview.is-empty {
    min-height: 150px;
    place-items: center;
    align-content: center;
    color: #53658f;
    text-align: center;
}

.dictation-transcript-preview.is-empty svg {
    width: 42px;
    height: 42px;
    padding: 8px;
    border-radius: 999px;
    background: #ece8ff;
    color: #4d2fff;
}

.dictation-transcript-preview.is-empty strong {
    color: #46577e;
    font-size: 15px;
    font-weight: 900;
}

.dictation-transcript-preview.is-empty span {
    font-size: 13px;
    font-weight: 700;
}

.dictation-review-textarea {
    min-height: 560px;
    padding: 18px;
    color: #13254f;
    font-size: 15px;
    line-height: 1.65;
}

.dictation-review-footer {
    padding-top: 2px;
}

.dictation-review-footer > div:first-child {
    display: grid;
    gap: 4px;
}

.dictation-review-footer strong {
    color: #07163d;
    font-size: 14px;
    font-weight: 900;
}

.dictation-review-footer small,
.dictation-muted-copy {
    margin: 0;
    color: #64739d;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
}

.dictation-review-summary {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.dictation-check-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.dictation-check-list span {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #23355f;
    font-size: 13px;
    font-weight: 800;
}

.dictation-check-list svg {
    width: 18px;
    height: 18px;
    color: #0f9f62;
}

.dictation-document-preview {
    overflow: hidden;
    border: 1px solid #e0e7f4;
    border-radius: 8px;
    background: #ffffff;
}

.dictation-document-preview header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    border-bottom: 1px solid #edf1f8;
    background: #f8fbff;
}

.dictation-document-preview header strong {
    color: #07163d;
    font-size: 22px;
    font-weight: 950;
    line-height: 1.18;
}

.dictation-document-preview header span {
    flex: 0 0 auto;
    padding: 5px 10px;
    border-radius: 999px;
    background: #ece8ff;
    color: #4d2fff;
    font-size: 12px;
    font-weight: 900;
}

.dictation-document-preview dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    border-bottom: 1px solid #edf1f8;
}

.dictation-document-preview dl div {
    min-width: 0;
    padding: 14px 18px;
    border-right: 1px solid #edf1f8;
}

.dictation-document-preview dl div:last-child {
    border-right: 0;
}

.dictation-document-preview dt {
    color: #7180a8;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.dictation-document-preview dd {
    margin: 4px 0 0;
    overflow: hidden;
    color: #17285a;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dictation-preview-body {
    min-height: 430px;
    padding: 24px;
    color: #17285a;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.7;
    white-space: pre-wrap;
}

.dictation-generate-stage .dictation-document-preview-panel {
    gap: 16px;
    padding: 20px;
    overflow: hidden;
}

.dictation-word-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid #e1e8f4;
    border-radius: 8px;
    background: #f8fbff;
}

.dictation-word-toolbar label {
    display: grid;
    grid-template-columns: auto minmax(220px, 340px);
    gap: 12px;
    align-items: center;
    min-width: 0;
    color: #263b70;
    font-size: 12px;
    font-weight: 900;
}

.dictation-word-toolbar .matter-input {
    min-width: 0;
}

.dictation-export-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.dictation-word-document {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: calc(100vh - 330px);
    overflow: hidden;
    border: 1px solid #dce5f3;
    border-radius: 8px;
    background: linear-gradient(180deg, #eef3f9, #f7faff);
}

.dictation-word-page {
    width: min(100%, 940px);
    min-height: 980px;
    justify-self: center;
    margin: 24px;
    padding: 64px 72px;
    border: 1px solid #d8e1ee;
    background: #ffffff;
    box-shadow: 0 24px 54px rgba(20, 37, 72, 0.14);
}

.dictation-word-letterhead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 20px;
    border-bottom: 2px solid #17285a;
}

.dictation-word-letterhead div {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.dictation-word-letterhead strong {
    color: #07163d;
    font-size: 20px;
    font-weight: 950;
    line-height: 1.15;
}

.dictation-word-letterhead span {
    overflow: hidden;
    color: #5b6b92;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dictation-word-letterhead small {
    flex: 0 0 auto;
    padding: 5px 10px;
    border-radius: 999px;
    background: #ece8ff;
    color: #4d2fff;
    font-size: 12px;
    font-weight: 900;
}

.dictation-word-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    margin-top: 30px;
}

.dictation-word-title-row h2 {
    margin: 0;
    color: #07163d;
    font-size: 25px;
    font-weight: 950;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.dictation-word-title-row span {
    color: #60719d;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.dictation-word-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 24px 0 28px;
    border: 1px solid #e6edf7;
    border-radius: 8px;
    background: #fbfdff;
}

.dictation-word-meta div {
    min-width: 0;
    padding: 13px 16px;
    border-right: 1px solid #e6edf7;
}

.dictation-word-meta div:last-child {
    border-right: 0;
}

.dictation-word-meta dt {
    color: #7180a8;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
}

.dictation-word-meta dd {
    margin: 5px 0 0;
    overflow: hidden;
    color: #17285a;
    font-size: 13px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dictation-word-editor {
    min-height: 540px;
    margin-left: -12px;
    padding: 10px 0 10px 12px;
    border-left: 3px solid transparent;
    outline: 0;
    color: #111827;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.72;
    white-space: pre-wrap;
}

.dictation-word-editor:focus {
    border-left-color: #4d2fff;
    background: linear-gradient(90deg, rgba(77, 47, 255, 0.05), rgba(255, 255, 255, 0));
}

.dictation-word-editor.is-empty {
    color: #7a879f;
    font-family: var(--font, inherit);
    font-weight: 700;
}

.dictation-word-editor.is-empty::before {
    color: #7a879f;
    content: attr(data-placeholder);
}

.dictation-word-document .dictation-document-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    border-top-color: #dce5f3;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
}

.dictation-document-footer {
    display: flex;
    justify-content: flex-end;
    padding: 18px 22px;
    border-top: 1px solid #edf1f8;
    background: #fbfdff;
}

.dictation-document-footer .matter-button {
    min-width: 190px;
    min-height: 46px;
}

.dictation-workspace.is-generated .dictation-document-footer {
    display: none;
}

.dictation-generated-state {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 36px 24px;
    border: 1px solid #cdeedc;
    border-radius: 8px;
    background: linear-gradient(135deg, #f6fff9, #fbfdff);
    color: #23466f;
    text-align: center;
    animation: dictationSuccessRise 260ms ease-out both;
}

.dictation-generated-state[hidden] {
    display: none;
}

.dictation-generated-mark {
    display: grid;
    width: 74px;
    height: 74px;
    place-items: center;
    border-radius: 999px;
    background: #dff7e9;
    color: #087443;
    box-shadow: 0 0 0 12px rgba(8, 116, 67, 0.08);
    animation: dictationSuccessPulse 900ms ease-out both;
}

.dictation-generated-mark svg {
    width: 38px;
    height: 38px;
    stroke-width: 3;
}

.dictation-generated-state strong {
    color: #07163d;
    font-size: 20px;
    font-weight: 950;
}

.dictation-generated-state p {
    max-width: 440px;
    margin: 0;
    color: #53658f;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.55;
}

.matter-button svg[data-lucide="loader-circle"] {
    animation: dictationSpin 850ms linear infinite;
}

@keyframes dictationSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes dictationSuccessRise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dictationSuccessPulse {
    0% {
        transform: scale(0.86);
        box-shadow: 0 0 0 0 rgba(8, 116, 67, 0.22);
    }

    65% {
        transform: scale(1.04);
        box-shadow: 0 0 0 18px rgba(8, 116, 67, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 12px rgba(8, 116, 67, 0.08);
    }
}

.dictation-generate-panel {
    align-self: start;
}

.dictation-generate-options {
    display: grid;
    gap: 12px;
}

.dictation-generate-options label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    color: #23355f;
    font-size: 13px;
    font-weight: 800;
}

.dictation-generate-options input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #4d2fff;
}

.dictation-generate-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
}

.dictation-side-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
}

.dictation-side-actions .matter-button {
    min-height: 46px;
}

.dictation-recent-panel,
.dictation-files-panel {
    padding: 18px;
}

.dictation-recent-list {
    display: grid;
    gap: 10px;
}

.dictation-recent-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto 18px;
    gap: 12px;
    align-items: center;
    min-height: 72px;
    padding: 12px;
    border: 1px solid #e3eaf5;
    border-radius: 8px;
    background: #ffffff;
    color: #17285a;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dictation-recent-item:hover {
    border-color: #c7d3e6;
    box-shadow: 0 12px 26px rgba(20, 37, 72, 0.08);
    transform: translateY(-1px);
}

.dictation-recent-item.is-new {
    background: #f5fff9;
}

.dictation-recent-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 8px;
    background: #eef3ff;
    color: #31528c;
}

.dictation-recent-icon svg,
.dictation-recent-item > svg {
    width: 19px;
    height: 19px;
}

.dictation-recent-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.dictation-recent-main strong,
.dictation-recent-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dictation-recent-main strong {
    color: #07163d;
    font-size: 13px;
    font-weight: 950;
}

.dictation-recent-main small {
    color: #64739d;
    font-size: 12px;
    font-weight: 700;
}

.dictation-status-pill {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 10px;
    border-radius: 6px;
    background: #e9edff;
    color: #4d2fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.dictation-status-pill.is-draft {
    background: #dff7e9;
    color: #087443;
}

.dictation-empty-state {
    display: grid;
    justify-items: center;
    gap: 10px;
    min-height: 260px;
    padding: 28px;
    border: 1px solid #e3eaf5;
    border-radius: 8px;
    background: linear-gradient(135deg, #fbfdff, #f7f4ff);
    color: #53658f;
    text-align: center;
}

.dictation-empty-state > svg {
    width: 64px;
    height: 64px;
    padding: 18px;
    border-radius: 999px;
    background: #ece8ff;
    color: #46577e;
}

.dictation-empty-state strong {
    color: #46577e;
    font-size: 16px;
    font-weight: 950;
}

.dictation-empty-state span {
    max-width: 250px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.dictation-count {
    display: grid;
    min-width: 30px;
    height: 26px;
    place-items: center;
    border-radius: 999px;
    background: #edf3ff;
    color: #31528c;
    font-size: 12px;
    font-weight: 850;
}

.dictation-folder-list {
    display: grid;
    gap: 10px;
}

.dictation-folder {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.dictation-folder-heading {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto 18px;
    gap: 10px;
    align-items: center;
    width: 100%;
    min-height: 58px;
    padding: 12px 14px;
    border: 0;
    background: #f7faff;
    color: #12275d;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.dictation-folder-heading svg {
    width: 20px;
    height: 20px;
    color: #31528c;
}

.dictation-folder-heading span,
.dictation-file-main span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.dictation-folder-heading strong,
.dictation-file-main strong {
    overflow: hidden;
    color: #102452;
    font-size: 14px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dictation-folder-heading small,
.dictation-file-main small {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dictation-folder-heading em {
    display: grid;
    min-width: 26px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: #edf3ff;
    color: #31528c;
    font-size: 12px;
    font-style: normal;
    font-weight: 850;
}

.dictation-file-list {
    display: grid;
}

.dictation-folder.is-collapsed .dictation-file-list {
    display: none;
}

.dictation-folder.is-collapsed .dictation-folder-heading svg:last-child {
    transform: rotate(-90deg);
}

.dictation-file {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid #e9eef8;
}

.dictation-file.is-new {
    background: #f1fbf6;
}

.dictation-file-main {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.dictation-file-main svg {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: #31528c;
}

.dictation-file-actions a {
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.dictation-file-actions a:hover {
    text-decoration: underline;
}

.file-browser-hero {
    align-items: flex-start;
}

.file-browser-shell {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 18px;
    max-width: 1180px;
    min-height: calc(100vh - 260px);
}

.file-browser-list,
.file-preview-pane {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 1px rgba(18, 44, 86, 0.02);
}

.file-browser-list {
    overflow: hidden;
}

.file-browser-list-header,
.file-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.file-browser-list-header h2,
.file-preview-header h2,
.file-preview-empty h2 {
    margin: 5px 0 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 850;
    line-height: 1.2;
}

.file-browser-list-header > span {
    display: grid;
    min-width: 30px;
    height: 26px;
    place-items: center;
    border-radius: 999px;
    background: #edf3ff;
    color: #31528c;
    font-size: 12px;
    font-weight: 850;
}

.file-browser-items {
    display: grid;
    gap: 6px;
    max-height: calc(100vh - 342px);
    min-height: 420px;
    padding: 10px;
    overflow-y: auto;
}

.file-browser-item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
}

.file-browser-item:hover,
.file-browser-item.is-active {
    border-color: #c8d6ee;
    background: #f5f9ff;
}

.file-browser-item svg {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: #31528c;
}

.file-browser-item span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.file-browser-item strong {
    overflow: hidden;
    color: #102452;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-browser-item small,
.file-preview-header span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
}

.file-preview-pane {
    display: grid;
    grid-template-rows: auto minmax(520px, 1fr);
    overflow: hidden;
}

.file-preview-header {
    align-items: center;
}

.file-preview-frame {
    width: 100%;
    height: 100%;
    min-height: 620px;
    border: 0;
    background: #f4f7fc;
}

.file-preview-empty {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 620px;
    padding: 34px;
    color: var(--muted);
    text-align: center;
}

.file-preview-empty svg {
    width: 44px;
    height: 44px;
    color: #31528c;
}

.file-preview-empty p {
    margin: 8px 0 0;
    font-size: 14px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.files-page {
    display: grid;
    gap: 16px;
    max-width: 1480px;
}

.files-hero,
.files-search-row,
.files-breadcrumb,
.files-tabs,
.files-usage-strip,
.files-tool-button,
.files-primary-button,
.files-owner,
.files-section-label,
.files-detail-heading,
.files-activity > div,
.files-access-panel > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.files-hero {
    align-items: flex-start;
    justify-content: space-between;
}

.files-hero h1 {
    margin: 0;
    color: var(--ink);
    font-size: 38px;
    font-weight: 850;
    line-height: 1.05;
}

.files-hero p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 15px;
    font-weight: 650;
}

.files-usage-strip {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.files-usage-strip span {
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: #31436f;
    font-size: 13px;
    font-weight: 800;
}

.files-usage-strip svg,
.files-tool-button svg,
.files-primary-button svg,
.files-breadcrumb svg,
.files-section-label svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.files-search-row {
    flex-wrap: wrap;
    padding: 10px 0 0;
}

.files-search-form,
.files-upload-form,
.files-new-folder-form {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.files-search-form {
    flex: 1 1 420px;
}

.files-search-box {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 260px;
    height: 48px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: #52648f;
    box-shadow: 0 1px 1px rgba(18, 44, 86, 0.02);
}

.files-search-box input,
.files-new-folder-form input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
}

.files-search-box kbd {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 7px;
    border: 1px solid #d6deed;
    border-radius: 6px;
    background: #f7faff;
    color: #60719d;
    font-size: 12px;
    font-weight: 800;
}

.files-tool-button,
.files-primary-button {
    justify-content: center;
    min-height: 44px;
    padding: 0 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.files-tool-button {
    border: 1px solid var(--line);
    background: #ffffff;
    color: #17285a;
}

.files-primary-button {
    border: 0;
    background: var(--blue);
    color: #ffffff;
    box-shadow: 0 9px 18px rgba(15, 99, 255, 0.18);
}

.files-tool-button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.files-upload-form input[type="file"] {
    max-width: 210px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: #31436f;
    font-size: 13px;
}

.files-new-folder-form {
    min-height: 44px;
    padding-left: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.files-new-folder-form input {
    width: 132px;
}

.files-new-folder-form .files-tool-button {
    margin: -1px;
}

.files-breadcrumb {
    flex-wrap: wrap;
    color: #52648f;
    font-size: 14px;
    font-weight: 750;
}

.files-breadcrumb a {
    color: #17285a;
    text-decoration: none;
}

.files-breadcrumb a:last-child {
    color: var(--blue);
}

.files-tabs {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
}

.files-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: #17285a;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.files-tabs a:hover,
.files-tabs a.is-active {
    border-color: #9cb8ea;
    background: #eef5ff;
    color: var(--blue);
}

.files-workspace {
    display: grid;
    grid-template-columns: minmax(230px, 280px) minmax(520px, 1fr) minmax(300px, 360px);
    min-height: calc(100vh - 285px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 1px rgba(18, 44, 86, 0.02);
}

.files-tree-panel,
.files-main-panel,
.files-detail-panel {
    min-width: 0;
    background: #ffffff;
}

.files-tree-panel {
    border-right: 1px solid var(--line);
}

.files-detail-panel {
    display: grid;
    align-content: start;
    gap: 15px;
    border-left: 1px solid var(--line);
}

.files-tree-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 58px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    color: #17285a;
    font-size: 14px;
}

.files-tree-heading button {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: #edf3ff;
    color: #31528c;
    cursor: pointer;
}

.files-tree-list {
    display: grid;
    gap: 3px;
    margin: 0;
    padding: 8px 8px 8px 14px;
    list-style: none;
}

.files-tree-list .files-tree-list {
    padding: 3px 0 3px 18px;
}

.files-tree-link {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 34px;
    padding: 7px 9px;
    border-radius: 7px;
    color: #17285a;
    font-size: 13px;
    font-weight: 780;
    text-decoration: none;
}

.files-tree-link:hover,
.files-tree-link.is-active {
    background: #eef5ff;
    color: var(--blue);
}

.files-tree-link svg {
    width: 18px;
    height: 18px;
}

.files-tree-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.files-tree-link small {
    display: grid;
    min-width: 22px;
    height: 20px;
    place-items: center;
    border-radius: 999px;
    background: #f0f4fb;
    color: #52648f;
    font-size: 11px;
}

.files-main-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.files-pinned-row {
    display: grid;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line);
}

.files-section-label {
    color: #17285a;
    font-size: 13px;
    font-weight: 850;
}

.files-pinned-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.files-pinned-card {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 18px;
    gap: 10px;
    align-items: start;
    min-height: 82px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
    color: #102452;
    text-decoration: none;
}

.files-pinned-card:hover {
    border-color: #aac0e5;
    background: #f3f8ff;
}

.files-pinned-card svg {
    width: 20px;
    height: 20px;
    color: #31528c;
}

.files-pinned-card > svg:first-child {
    width: 24px;
    height: 24px;
    margin-top: 2px;
}

.files-pinned-card span {
    min-width: 0;
}

.files-pinned-card strong,
.files-pinned-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.files-pinned-card strong {
    font-size: 13px;
    font-weight: 850;
    line-height: 1.3;
    white-space: normal;
}

.files-pinned-card small {
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.files-table-wrap {
    overflow: auto;
}

.files-table {
    width: 100%;
    min-width: 840px;
    border-collapse: collapse;
}

.files-table th,
.files-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e8eef8;
    color: #14224f;
    font-size: 13px;
    text-align: left;
    vertical-align: middle;
}

.files-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #ffffff;
    color: #60719d;
    font-size: 12px;
    font-weight: 850;
}

.files-table tr.is-selected td {
    background: #eef5ff;
}

.files-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

.files-file-name {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    color: #102452;
    font-weight: 800;
    text-decoration: none;
}

.files-file-name svg {
    width: 20px;
    height: 20px;
    color: #31528c;
}

.files-file-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.files-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.files-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #edf3ff;
    color: #31528c;
    font-size: 11px;
    font-weight: 850;
}

.files-tags span:nth-child(2n) {
    background: #eef8f2;
    color: #0f7546;
}

.files-tags span:nth-child(3n) {
    background: #fff5e7;
    color: #9b5a00;
}

.files-owner {
    color: #14224f;
    font-weight: 750;
}

.files-owner small,
.files-activity article > span {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 999px;
    background: #e9f6f0;
    color: #0f7546;
    font-size: 11px;
    font-weight: 850;
}

.files-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f0f4fb;
    color: #52648f;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.files-table td:last-child a {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: #17285a;
    text-decoration: none;
}

.files-empty-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 180px;
    color: var(--muted);
    font-weight: 750;
}

.files-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 0 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.files-detail-heading {
    justify-content: space-between;
    min-height: 62px;
    padding: 15px 18px 0;
}

.files-detail-heading h2 {
    margin: 0;
    color: #102452;
    font-size: 17px;
    font-weight: 850;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.files-detail-heading a {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    color: #52648f;
    text-decoration: none;
}

.files-preview-card {
    margin: 0 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faff;
    aspect-ratio: 16 / 10;
}

.files-preview-card iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

.files-preview-placeholder {
    display: grid;
    height: 100%;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: #31528c;
    text-align: center;
}

.files-preview-placeholder svg {
    width: 44px;
    height: 44px;
}

.files-preview-placeholder strong {
    color: #102452;
    font-size: 16px;
    font-weight: 850;
}

.files-preview-placeholder span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.files-detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0 18px;
}

.files-detail-list div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.files-detail-list dt {
    color: #60719d;
    font-size: 12px;
    font-weight: 850;
}

.files-detail-list dd {
    min-width: 0;
    margin: 0;
    color: #14224f;
    font-size: 13px;
    font-weight: 750;
}

.files-activity,
.files-access-panel {
    display: grid;
    gap: 10px;
    margin: 0 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.files-activity > div,
.files-access-panel > div {
    justify-content: space-between;
}

.files-activity h3,
.files-access-panel h3 {
    margin: 0;
    color: #102452;
    font-size: 15px;
    font-weight: 850;
}

.files-activity a,
.files-access-panel > div span {
    color: var(--blue);
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.files-activity article {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
}

.files-activity article p {
    margin: 0;
    color: #42547f;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
}

.files-activity article strong {
    color: #102452;
    font-weight: 850;
}

.files-activity article small {
    grid-column: 2;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.files-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 18px 18px;
}

.files-detail-actions .files-primary-button,
.files-detail-actions .files-tool-button {
    min-width: 0;
    width: 100%;
}

.files-access-panel {
    padding-bottom: 18px;
}

.files-access-panel form {
    display: grid;
    gap: 9px;
}

.files-access-panel label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    padding: 9px;
    border: 1px solid #e8eef8;
    border-radius: 8px;
    background: #fbfdff;
}

.files-access-panel input {
    margin-top: 3px;
    accent-color: var(--blue);
}

.files-access-panel strong,
.files-access-panel small {
    display: block;
}

.files-access-panel strong {
    overflow: hidden;
    color: #102452;
    font-size: 13px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.files-access-panel small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.files-detail-empty,
.files-empty-state {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 280px;
    gap: 10px;
    color: var(--muted);
    text-align: center;
}

.files-detail-empty svg,
.files-empty-state svg {
    width: 44px;
    height: 44px;
    color: #31528c;
}

.files-detail-empty h2,
.files-empty-state h2 {
    margin: 0;
    color: #102452;
    font-size: 18px;
    font-weight: 850;
}

@media (max-width: 1280px) {
    .files-workspace {
        grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    }

    .files-detail-panel {
        grid-column: 1 / -1;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .files-detail-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .files-hero,
    .files-workspace {
        display: grid;
    }

    .files-usage-strip {
        justify-content: flex-start;
    }

    .files-workspace {
        grid-template-columns: 1fr;
    }

    .files-tree-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .files-pinned-grid {
        grid-template-columns: 1fr;
    }

    .files-detail-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Screenshot-aligned Files workspace */
.main-column:has(.files-page) {
    position: relative;
}

.main-column:has(.files-page) > .topbar {
    position: absolute;
    top: 15px;
    right: 28px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    width: auto;
    min-height: 46px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
}

.main-column:has(.files-page) > .topbar .icon-button,
.main-column:has(.files-page) > .topbar .global-search,
.main-column:has(.files-page) > .topbar .topbar-spacer,
.main-column:has(.files-page) > .topbar .new-button {
    display: none;
}

.page-content:has(.files-page) {
    padding: 16px 28px 0;
    background: #ffffff;
}

.files-page {
    max-width: none;
    gap: 0;
    min-height: calc(100vh - 34px);
    color: #111827;
}

.files-page .admin-alert {
    margin-bottom: 12px;
}

.files-hero {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) minmax(360px, 520px) minmax(230px, 1fr);
    align-items: center;
    gap: 22px;
    margin-bottom: 12px;
}

.files-hero h1 {
    margin: 0;
    color: #111827;
    font-size: 28px;
    font-weight: 850;
    line-height: 1.1;
}

.files-hero p {
    margin: 6px 0 0;
    color: #5f6b7f;
    font-size: 14px;
    font-weight: 500;
}

.files-hero .files-search-form {
    position: relative;
    grid-column: 2;
    width: 100%;
}

.files-search-box {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 13px;
    border-color: #d8dee9;
    border-radius: 8px;
    background: #ffffff;
    color: #667085;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.files-search-box input {
    color: #111827;
    font-size: 14px;
    font-weight: 500;
}

.files-search-box input::placeholder {
    color: #7a8494;
}

.files-search-box kbd {
    height: 24px;
    border-color: #d8dee9;
    background: #f8fafc;
    color: #667085;
    font-size: 12px;
    font-weight: 750;
}

.files-search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 30;
    display: grid;
    max-height: 330px;
    overflow-y: auto;
    border: 1px solid #d8dee9;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.files-search-suggestions[hidden] {
    display: none;
}

.files-search-suggestion {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 10px 12px;
    color: #111827;
    text-decoration: none;
}

.files-search-suggestion:hover {
    background: #f8fbff;
}

.files-search-suggestion i,
.files-search-suggestion svg {
    width: 18px;
    height: 18px;
    justify-self: center;
    color: #155eef;
}

.files-search-suggestion span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.files-search-suggestion strong,
.files-search-suggestion small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.files-search-suggestion strong {
    font-size: 13px;
    font-weight: 850;
}

.files-search-suggestion small,
.files-search-suggestion-empty {
    color: #667085;
    font-size: 12px;
    font-weight: 650;
}

.files-search-suggestion-empty {
    padding: 14px;
}

.files-command-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.files-command-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.files-breadcrumb {
    min-width: 0;
    color: #667085;
    font-size: 14px;
    font-weight: 650;
}

.files-breadcrumb svg {
    width: 21px;
    height: 21px;
    color: #64748b;
}

.files-breadcrumb a {
    color: #475467;
}

.files-breadcrumb a:last-child {
    color: #155eef;
    font-weight: 800;
}

.files-tool-button,
.files-primary-button {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 800;
    box-shadow: none;
}

.files-tool-button {
    border-color: #cbd5e1;
    background: #ffffff;
    color: #101828;
}

.files-tool-button:hover {
    border-color: #98a2b3;
    background: #f8fafc;
}

.files-primary-button {
    background: #155eef;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(21, 94, 239, 0.16);
}

.files-upload-form {
    gap: 8px;
}

.files-upload-form input[type="file"] {
    max-width: 168px;
    height: 42px;
    padding: 8px;
    border-color: #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #475467;
    font-size: 12px;
}

.files-new-folder-form {
    min-height: 42px;
    border-color: #cbd5e1;
    border-radius: 6px;
}

.files-new-folder-form input {
    width: 118px;
    font-size: 13px;
}

.files-tabs {
    gap: 10px;
    margin: 0 -28px;
    padding: 10px 28px;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.files-tabs a {
    min-height: 34px;
    padding: 0 15px;
    border-color: #d8dee9;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
}

.files-tabs a:hover,
.files-tabs a.is-active {
    border-color: #8fb1ff;
    background: #eff6ff;
    color: #155eef;
}

.files-workspace {
    grid-template-columns: 260px minmax(560px, 1fr) 368px;
    height: calc(100vh - 188px);
    min-height: calc(100vh - 188px);
    margin: 0 -28px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
}

.files-tree-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
    overflow: hidden;
    border-right: 1px solid #e5e7eb;
    background: #fbfcfe;
}

.files-tree-heading {
    min-height: 58px;
    padding: 0 18px;
    border-bottom: 0;
    color: #111827;
    font-size: 14px;
    font-weight: 850;
}

.files-tree-heading button {
    width: 22px;
    height: 22px;
    background: transparent;
    color: #667085;
}

.files-tree-list {
    align-content: start;
    gap: 3px;
    min-height: 0;
    padding: 8px 14px;
}

.files-tree-panel > .files-tree-list {
    overflow-y: auto;
}

.files-tree-list .files-tree-list {
    padding: 4px 0 4px 22px;
    overflow: visible;
}

.files-tree-link {
    min-height: 34px;
    padding: 7px 9px;
    border-radius: 5px;
    color: #344054;
    font-size: 13px;
    font-weight: 750;
}

.files-tree-link svg {
    color: #64748b;
}

.files-tree-link:hover,
.files-tree-link.is-active {
    background: linear-gradient(90deg, #eaf2ff, #f3f7ff);
    color: #155eef;
}

.files-tree-link.is-active svg {
    color: #155eef;
}

.files-tree-link small {
    min-width: 22px;
    height: 20px;
    background: #e2e8f0;
    color: #475467;
}

.files-storage-meter {
    display: grid;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e5e7eb;
    color: #667085;
    font-size: 13px;
    font-weight: 700;
}

.files-storage-meter span {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    line-height: 1.35;
}

.files-storage-meter svg {
    width: 18px;
    height: 18px;
    color: #64748b;
}

.files-storage-meter div {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.files-storage-meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #155eef;
}

.files-main-panel {
    min-height: 0;
    overflow-y: auto;
    background: #ffffff;
}

.files-pinned-row {
    gap: 12px;
    padding: 18px 22px 16px;
    border-bottom: 0;
}

.files-section-label {
    color: #111827;
    font-size: 13px;
    font-weight: 800;
}

.files-section-label svg {
    color: #344054;
}

.files-pinned-grid {
    gap: 12px;
}

.files-pinned-card {
    grid-template-columns: 30px minmax(0, 1fr) 18px;
    min-height: 96px;
    padding: 13px 14px;
    border-color: #d8dee9;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.files-pinned-card:hover {
    border-color: #b7c7ea;
    background: #f8fbff;
}

.files-pinned-card > svg:first-child {
    color: #155eef;
}

.files-pinned-card strong {
    color: #111827;
    font-size: 13px;
    font-weight: 850;
}

.files-pinned-card small {
    display: inline-flex;
    width: fit-content;
    min-height: 22px;
    align-items: center;
    margin-top: 10px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e8f8ef;
    color: #0f7546;
    font-size: 11px;
    font-weight: 850;
}

.files-table {
    min-width: 920px;
}

.files-table th,
.files-table td {
    padding: 12px 14px;
    border-bottom-color: #edf0f5;
    color: #111827;
    font-size: 13px;
}

.files-table th {
    background: #ffffff;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}

.files-table tr:hover td {
    background: #f8fbff;
}

.files-table tr.is-selected td {
    background: #eff6ff;
}

.files-file-name {
    color: #111827;
    font-weight: 750;
}

.files-file-name svg {
    color: #155eef;
}

.files-tags span {
    min-height: 22px;
    background: #eaf2ff;
    color: #155eef;
    font-size: 11px;
    font-weight: 800;
}

.files-tags span:nth-child(2n) {
    background: #f2f4f7;
    color: #475467;
}

.files-tags span:nth-child(3n) {
    background: #e8f8ef;
    color: #0f7546;
}

.files-owner {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.files-owner small,
.files-activity article > span {
    width: 26px;
    height: 26px;
    background: #fff1e8;
    color: #b54708;
    font-size: 10px;
}

.files-status {
    min-height: 22px;
    background: #f2f4f7;
    color: #475467;
    font-size: 11px;
}

.files-table-footer {
    min-height: 46px;
    padding: 0 22px;
    border-top-color: #e5e7eb;
    color: #667085;
    background: #ffffff;
}

.files-detail-panel {
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
    border-left-color: #e5e7eb;
    background: #ffffff;
}

.files-detail-heading {
    min-height: 66px;
    padding: 18px 20px 0;
}

.files-detail-heading h2 {
    color: #111827;
    font-size: 16px;
    font-weight: 850;
}

.files-detail-heading a {
    color: #667085;
}

.files-preview-card {
    margin: 0 20px;
    border-color: #d8dee9;
    border-radius: 6px;
    background: #ffffff;
    aspect-ratio: 16 / 10.8;
}

.files-text-preview-card {
    display: grid;
    height: clamp(280px, 42vh, 460px);
    min-height: 280px;
    overflow: hidden;
    aspect-ratio: auto;
}

.files-text-preview {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 16px 18px;
    overflow: auto;
    border: 0;
    background: #ffffff;
    color: #111827;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    overscroll-behavior: contain;
}

.files-text-preview:focus {
    outline: 2px solid rgba(21, 94, 239, 0.35);
    outline-offset: -2px;
}

.files-preview-placeholder {
    border: 1px solid #eef2f7;
    background:
        linear-gradient(135deg, rgba(21, 94, 239, 0.04), transparent 52%),
        #ffffff;
}

.files-preview-placeholder svg {
    color: #155eef;
}

.files-detail-list {
    gap: 11px;
    padding: 0 20px;
}

.files-detail-list div {
    grid-template-columns: 108px minmax(0, 1fr);
}

.files-detail-list dt {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}

.files-detail-list dd {
    color: #111827;
    font-size: 13px;
    font-weight: 700;
}

.files-activity,
.files-access-panel {
    margin: 0 20px;
    padding-top: 16px;
    border-top-color: #e5e7eb;
}

.files-activity h3,
.files-access-panel h3 {
    color: #111827;
    font-size: 15px;
}

.files-activity a,
.files-access-panel > div span {
    color: #155eef;
}

.files-activity article p {
    color: #475467;
}

.files-activity article strong {
    color: #111827;
}

.files-detail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 20px 20px;
}

.files-detail-actions .files-primary-button,
.files-detail-actions .files-tool-button {
    min-height: 44px;
    border-radius: 6px;
}

.files-access-panel label {
    border-color: #edf0f5;
    border-radius: 6px;
    background: #fbfcfe;
}

.files-primary-button,
.files-tool-button,
.files-danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.files-danger-button {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #b42318;
    font-size: 14px;
    font-weight: 800;
}

.files-danger-button:hover {
    border-color: #fda29b;
    background: #fff1f0;
}

.files-inline-form {
    margin: 0;
}

.files-tree-link.is-drop-target,
.files-table tr.is-drop-target td {
    outline: 2px solid rgba(21, 94, 239, 0.38);
    outline-offset: 2px;
    background: #dbeafe;
}

.files-pinned-card.is-dragging,
.files-table tr.is-dragging td,
.files-tree-link.is-dragging {
    opacity: 0.48;
}

.files-workspace.is-file-drop-target .files-main-panel {
    background:
        linear-gradient(135deg, rgba(21, 94, 239, 0.08), transparent 45%),
        #f8fbff;
}

.files-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.files-row-actions form {
    margin: 0;
}

.files-row-actions button,
.files-row-actions > span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #475467;
    cursor: pointer;
}

.files-row-actions button:hover {
    background: #eef4ff;
    color: #155eef;
}

.files-row-actions form button:hover {
    background: #fff1f0;
    color: #b42318;
}

.files-row-actions svg {
    width: 16px;
    height: 16px;
}

.files-preview-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.files-detail-actions .files-primary-button,
.files-detail-actions .files-tool-button,
.files-detail-actions .files-danger-button,
.files-detail-actions form {
    min-height: 44px;
    width: 100%;
    border-radius: 6px;
}

.files-detail-actions form {
    margin: 0;
}

.files-detail-actions form button {
    width: 100%;
}

.files-dialog {
    width: min(460px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid #d8dee9;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
}

.files-dialog::backdrop {
    background: rgba(15, 23, 42, 0.34);
}

.files-dialog form {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.files-dialog-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.files-dialog-heading h2 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 850;
}

.files-dialog-heading button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: #f2f4f7;
    color: #475467;
    cursor: pointer;
}

.files-dialog label {
    display: grid;
    gap: 7px;
}

.files-dialog label span {
    color: #667085;
    font-size: 12px;
    font-weight: 850;
}

.files-dialog input,
.files-dialog select {
    width: 100%;
    min-height: 42px;
    padding: 0 11px;
    border: 1px solid #d8dee9;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-size: 14px;
    outline: 0;
}

.files-dialog input:focus,
.files-dialog select:focus {
    border-color: #8fb1ff;
    box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.12);
}

.files-dialog-note {
    margin: 0;
    color: #667085;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
}

.files-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 2px;
}

.files-action-dialog {
    width: min(540px, calc(100vw - 32px));
    overflow: hidden;
    border-color: rgba(104, 124, 153, 0.32);
    box-shadow: 0 34px 90px rgba(4, 10, 18, 0.32);
}

.files-action-dialog::backdrop {
    background: rgba(4, 10, 18, 0.48);
    backdrop-filter: blur(4px);
}

.files-action-dialog form,
.files-dialog-panel {
    display: grid;
    gap: 0;
    padding: 0;
}

.files-action-dialog .files-dialog-heading {
    min-height: 72px;
    padding: 14px 18px 14px 22px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.16);
    background:
        linear-gradient(180deg, rgba(24, 40, 62, 0.96), rgba(14, 27, 44, 0.94)),
        #06101c;
    color: #f8fafc;
}

.files-action-dialog .files-dialog-heading div {
    display: grid;
    gap: 3px;
}

.files-action-dialog .files-dialog-heading p,
.files-action-dialog .files-dialog-heading h2 {
    margin: 0;
}

.files-action-dialog .files-dialog-heading p {
    color: rgba(222, 230, 241, 0.72);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.files-action-dialog .files-dialog-heading h2 {
    color: #f8fafc;
    font-size: 21px;
    font-weight: 850;
}

.files-action-dialog .files-dialog-heading button {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(126, 147, 174, 0.44);
    border-radius: 8px;
    background: rgba(5, 15, 27, 0.38);
    color: #f8fafc;
}

.files-action-dialog .files-dialog-heading button:hover {
    border-color: rgba(18, 193, 200, 0.58);
    color: var(--teal);
}

.files-dialog-body {
    display: grid;
    gap: 16px;
    padding: 20px;
    background: #f8fbff;
}

.files-info-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.files-info-list div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid #e5eaf3;
}

.files-info-list div:last-child {
    border-bottom: 0;
}

.files-info-list dt {
    color: #667085;
    font-size: 12px;
    font-weight: 850;
}

.files-info-list dd {
    min-width: 0;
    margin: 0;
    color: #111827;
    font-size: 13px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.files-context-menu {
    position: fixed;
    z-index: 80;
    display: grid;
    width: 224px;
    padding: 6px;
    border: 1px solid #d8dee9;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.files-context-menu[hidden] {
    display: none;
}

.files-context-menu button {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #17285a;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
}

.files-context-menu button:hover {
    background: #eef5ff;
    color: #155eef;
}

.files-context-menu button.is-danger {
    color: #b42318;
}

.files-context-menu button.is-danger:hover {
    background: #fff1f0;
    color: #b42318;
}

.files-context-menu svg {
    width: 17px;
    height: 17px;
}

.files-context-separator {
    height: 1px;
    margin: 6px 4px;
    background: #e5eaf3;
}

@media (max-width: 1320px) {
    .files-hero {
        grid-template-columns: minmax(220px, 1fr) minmax(340px, 460px);
    }

    .files-hero .files-search-form {
        grid-column: 2;
    }

    .files-workspace {
        grid-template-columns: 250px minmax(520px, 1fr) 340px;
    }

    .files-tree-panel {
        border-right: 1px solid #e5e7eb;
        border-bottom: 0;
    }

    .files-detail-panel {
        grid-column: auto;
        border-top: 0;
        border-left: 1px solid #e5e7eb;
    }
}

@media (max-width: 1080px) {
    .files-command-row {
        display: grid;
    }

    .files-command-actions {
        justify-content: flex-start;
    }

    .files-workspace {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .files-tree-panel {
        border-right: 1px solid #e5e7eb;
        border-bottom: 0;
    }

    .files-detail-panel {
        grid-column: 1 / -1;
        border-top: 1px solid #e5e7eb;
        border-left: 0;
    }
}

@media (max-width: 760px) {
    .main-column:has(.files-page) > .topbar {
        top: 12px;
        right: 16px;
    }

    .page-content:has(.files-page) {
        padding: 14px 16px 0;
    }

    .files-hero {
        grid-template-columns: 1fr;
        padding-right: 110px;
        gap: 12px;
        margin-bottom: 10px;
    }

    .files-hero .files-search-form {
        grid-column: auto;
    }

    .files-tabs,
    .files-workspace {
        margin-right: -16px;
        margin-left: -16px;
    }

    .files-tabs {
        padding-right: 16px;
        padding-left: 16px;
    }

    .files-workspace {
        grid-template-columns: 1fr;
    }

    .files-tree-panel {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }
}

.research-hero,
.research-review-hero {
    align-items: flex-start;
}

.research-hero-actions,
.research-card-actions,
.research-memo-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.research-search-panel {
    max-width: 1180px;
    margin-bottom: 18px;
}

.research-search-form {
    display: flex;
    align-items: end;
    gap: 10px;
}

.research-search-field {
    display: grid;
    flex: 1;
    gap: 7px;
    min-width: 220px;
}

.research-search-field span {
    color: #60719d;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
}

.research-results {
    display: grid;
    gap: 14px;
    max-width: 1180px;
}

.research-matter-card,
.research-act-card,
.research-file-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.research-matter-card {
    padding: 18px;
}

.research-matter-heading,
.research-issue-heading,
.research-act-heading,
.research-memo-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.research-matter-heading {
    margin-bottom: 14px;
}

.research-matter-heading h2,
.research-act-card h3,
.research-issue-card h3,
.research-memo-heading p {
    margin: 0;
    color: #102452;
    font-weight: 850;
    line-height: 1.25;
}

.research-matter-heading h2 {
    margin-top: 5px;
    font-size: 20px;
}

.research-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.research-file-card {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 18px;
    gap: 10px;
    align-items: center;
    min-height: 72px;
    padding: 12px;
    color: var(--ink);
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.research-file-card:hover {
    border-color: #b8c9e5;
    background: #f5f9ff;
    transform: translateY(-1px);
}

.research-file-card svg {
    width: 20px;
    height: 20px;
    color: #31528c;
}

.research-file-card span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.research-file-card strong,
.research-file-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.research-file-card strong {
    font-size: 14px;
    font-weight: 850;
}

.research-file-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.research-source-strip {
    display: grid;
    grid-auto-columns: minmax(220px, 300px);
    grid-auto-flow: column;
    gap: 10px;
    margin-bottom: 18px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.research-source-strip a {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    text-decoration: none;
}

.research-source-strip a:hover,
.research-source-strip a.is-active {
    border-color: #a9bfdf;
    background: #f5f9ff;
}

.research-source-strip svg {
    width: 19px;
    height: 19px;
    color: #31528c;
}

.research-source-strip span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.research-source-strip strong,
.research-source-strip small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.research-source-strip strong {
    font-size: 13px;
    font-weight: 850;
}

.research-source-strip small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.research-intelligence-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.research-intelligence-strip article {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.research-intelligence-strip span {
    display: block;
    overflow-wrap: anywhere;
    color: #102452;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.2;
}

.research-intelligence-strip p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.research-review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    gap: 18px;
    align-items: start;
    max-width: 1280px;
}

.research-main-flow {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.research-action-rail {
    position: sticky;
    top: 104px;
    display: grid;
    gap: 16px;
    min-width: 0;
}

.research-review-card,
.research-section,
.research-disclosure {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 1px rgba(18, 44, 86, 0.02);
}

.research-brief-card,
.research-section {
    padding: 18px;
}

.research-flow-heading,
.research-section-heading,
.research-issue-compact-main,
.research-primary-issue,
.research-primary-actions,
.research-quick-stats,
.research-detail-card > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.research-flow-heading,
.research-section-heading {
    margin-bottom: 14px;
}

.research-flow-heading h2,
.research-section-heading h2 {
    margin: 5px 0 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 850;
    line-height: 1.2;
}

.research-mode-pill,
.research-severity {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #edf3ff;
    color: #31528c;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.research-stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.research-stepper a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
    color: #17285a;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.research-stepper a:hover,
.research-stepper a.is-active {
    border-color: #a9bfdf;
    background: #eef6ff;
    color: var(--blue);
}

.research-stepper svg {
    width: 17px;
    height: 17px;
}

.research-primary-issue {
    align-items: center;
    padding: 16px;
    border: 1px solid #dce6f6;
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    background: #f8fbff;
}

.research-primary-issue.severity-high {
    border-left-color: #e33131;
}

.research-primary-issue.severity-medium {
    border-left-color: var(--orange);
}

.research-primary-issue span {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    background: #ffffff;
    color: #31528c;
    font-size: 12px;
    font-weight: 850;
}

.research-primary-issue h3 {
    margin: 9px 0 0;
    color: #102452;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.25;
}

.research-primary-issue p {
    margin: 7px 0 0;
    color: #42547f;
    font-size: 14px;
    line-height: 1.5;
}

.research-primary-actions {
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.research-issue-stack,
.research-evidence-list,
.research-detail-grid {
    display: grid;
    gap: 10px;
}

.research-issue-compact,
.research-evidence-card,
.research-detail-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    scroll-margin-top: 116px;
}

.research-issue-compact {
    border-left-width: 4px;
}

.research-issue-compact.severity-high {
    border-left-color: #e33131;
}

.research-issue-compact.severity-medium {
    border-left-color: var(--orange);
}

.research-issue-compact.severity-low {
    border-left-color: var(--blue);
}

.research-issue-compact:target,
.research-evidence-card:target,
.research-detail-card:target {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(15, 99, 255, 0.12);
}

.research-issue-compact-main {
    justify-content: flex-start;
}

.research-issue-compact h3,
.research-detail-card h3 {
    margin: 0;
    color: #102452;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.3;
}

.research-issue-compact p,
.research-evidence-card p,
.research-detail-card p {
    margin: 7px 0 0;
    color: #14224f;
    font-size: 14px;
    line-height: 1.55;
}

.research-mini-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.research-mini-meta span,
.research-detail-card strong {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f1f6ff;
    color: #31528c;
    font-size: 12px;
    font-weight: 850;
}

.research-detail-toggle {
    margin-top: 10px;
    border-radius: 8px;
    background: #f8fbff;
}

.research-detail-toggle summary {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0 10px;
    color: #17285a;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.research-detail-body {
    display: grid;
    gap: 6px;
    padding: 0 10px 10px;
}

.research-detail-body h4 {
    margin: 8px 0 0;
    color: #102452;
    font-size: 12px;
    font-weight: 850;
}

.research-detail-body p,
.research-detail-body span,
.research-detail-body a {
    margin: 0;
    color: #42547f;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
}

.research-detail-body a,
.research-detail-card a {
    color: var(--blue);
    text-decoration: none;
}

.research-detail-body a:hover,
.research-detail-card a:hover {
    text-decoration: underline;
}

.research-evidence-card > span {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    background: #edf3ff;
    color: #31528c;
    font-size: 12px;
    font-weight: 850;
}

.research-evidence-card mark {
    padding: 2px 4px;
    border-radius: 5px;
    color: inherit;
    font-weight: 850;
}

.research-disclosure {
    overflow: hidden;
}

.research-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 62px;
    padding: 14px 18px;
    color: #102452;
    font-size: 15px;
    font-weight: 850;
    cursor: pointer;
}

.research-disclosure > summary small {
    display: block;
    margin-bottom: 4px;
    color: #60719d;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.research-disclosure > summary svg {
    width: 18px;
    height: 18px;
    transition: transform 160ms ease;
}

.research-disclosure[open] > summary svg {
    transform: rotate(180deg);
}

.research-detail-grid {
    padding: 0 18px 18px;
}

.research-detail-card span,
.research-detail-card small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
}

.research-detail-card a {
    display: inline-flex;
    margin-top: 10px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 850;
}

.research-action-panel {
    padding-bottom: 18px;
}

.research-quick-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 12px;
}

.research-quick-stats article {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    background: #fbfdff;
}

.research-quick-stats article:first-child {
    border-radius: 8px 0 0 8px;
}

.research-quick-stats article:last-child {
    border-radius: 0 8px 8px 0;
}

.research-quick-stats span {
    color: #102452;
    font-size: 22px;
    font-weight: 850;
    line-height: 1;
}

.research-quick-stats p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.25;
}

.research-ai-note {
    display: grid;
    gap: 4px;
    padding: 11px;
    border-radius: 8px;
    background: #f8fbff;
}

.research-ai-note strong {
    color: #102452;
    font-size: 13px;
    font-weight: 850;
}

.research-ai-note span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
}

.research-workbench {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(460px, 1fr) minmax(320px, 390px);
    gap: 16px;
    align-items: start;
}

.research-legislation-panel,
.research-side-stack {
    position: sticky;
    top: 104px;
}

.research-side-stack {
    display: grid;
    gap: 16px;
}

.research-act-list,
.research-issue-list,
.research-provision-list,
.research-fact-list,
.research-law-list,
.research-ai-list,
.research-memo-form {
    display: grid;
    gap: 10px;
}

.research-act-card {
    overflow: hidden;
}

.research-act-heading {
    padding: 13px;
}

.research-act-icon,
.research-issue-icon {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
}

.research-act-icon svg,
.research-issue-icon svg {
    width: 19px;
    height: 19px;
}

.research-act-blue {
    background: #e7f0ff;
    color: var(--blue);
}

.research-act-red {
    background: #fff0f0;
    color: #c03333;
}

.research-act-purple {
    background: #f1ebff;
    color: var(--purple);
}

.research-act-orange {
    background: #fff0d8;
    color: var(--orange);
}

.research-act-heading h3 {
    font-size: 14px;
}

.research-act-heading p,
.research-issue-heading p,
.research-memo-heading span {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.research-provision-list {
    padding: 0 13px 13px;
}

.research-provision-list a {
    display: grid;
    gap: 5px;
    padding: 10px;
    border-left: 3px solid #d7e1f2;
    border-radius: 6px;
    background: #f8fbff;
    color: var(--ink);
    text-decoration: none;
}

.research-provision-list a.is-matched {
    border-left-color: var(--blue);
    background: #eef6ff;
}

.research-provision-list strong {
    font-size: 13px;
    font-weight: 850;
    line-height: 1.3;
}

.research-provision-list span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.research-provision-list em {
    justify-self: start;
    min-height: 22px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #eaf2ff;
    color: #31528c;
    font-size: 11px;
    font-style: normal;
    font-weight: 850;
}

.research-open-act {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 42px;
    padding: 0 13px;
    border-top: 1px solid var(--line);
    color: var(--blue);
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.research-open-act svg {
    width: 16px;
    height: 16px;
}

.research-count-pill {
    display: grid;
    min-width: 28px;
    height: 26px;
    place-items: center;
    border-radius: 999px;
    background: #edf3ff;
    color: #31528c;
    font-size: 12px;
    font-weight: 850;
}

.research-document-panel {
    padding: 0;
    overflow: hidden;
}

.research-document-panel .matter-panel-header {
    margin: 0;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.research-document-lines {
    display: grid;
    gap: 8px;
    max-height: calc(100vh - 255px);
    min-height: 650px;
    overflow-y: auto;
    padding: 18px;
    background: #fbfdff;
}

.research-document-line {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #ffffff;
    scroll-margin-top: 116px;
}

.research-document-line.has-issue {
    border-color: #d4e0f2;
}

.research-document-line:target {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(15, 99, 255, 0.12);
}

.research-line-number {
    color: #7b89a6;
    font-size: 12px;
    font-weight: 850;
    text-align: right;
}

.research-document-line p {
    margin: 0;
    color: #14224f;
    font-size: 14px;
    line-height: 1.6;
}

.research-document-line mark {
    padding: 2px 4px;
    border-radius: 5px;
    color: inherit;
    font-weight: 800;
}

.research-mark-red {
    background: #ffe1e1;
}

.research-mark-orange {
    background: #fff0cf;
}

.research-mark-purple {
    background: #eee6ff;
}

.research-mark-blue {
    background: #dceaff;
}

.research-line-links {
    display: flex;
    gap: 5px;
}

.research-line-links a {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #31528c;
}

.research-line-links svg {
    width: 14px;
    height: 14px;
}

.research-issue-card {
    padding: 13px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 8px;
    background: #ffffff;
    scroll-margin-top: 116px;
}

.research-fact-card,
.research-law-card,
.research-ai-list article {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    scroll-margin-top: 116px;
}

.research-fact-card:target {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(15, 99, 255, 0.12);
}

.research-fact-heading,
.research-law-card > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.research-fact-heading {
    justify-content: flex-start;
}

.research-fact-heading svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    color: #31528c;
}

.research-fact-heading h3,
.research-law-card h3,
.research-ai-list strong {
    margin: 0;
    color: #102452;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.25;
}

.research-fact-heading p,
.research-law-card span,
.research-ai-list span,
.research-ai-status {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
}

.research-fact-card > p,
.research-law-card > p {
    margin: 9px 0 0;
    color: #14224f;
    font-size: 13px;
    line-height: 1.48;
}

.research-law-card strong {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #edf3ff;
    color: #31528c;
    font-size: 11px;
    font-weight: 850;
}

.research-issue-card:target {
    box-shadow: 0 0 0 3px rgba(15, 99, 255, 0.12);
}

.research-issue-card.severity-high {
    border-left-color: #e33131;
}

.research-issue-card.severity-medium {
    border-left-color: var(--orange);
}

.research-issue-card.severity-low {
    border-left-color: var(--blue);
}

.research-issue-icon {
    background: #eef6ff;
    color: var(--blue);
}

.research-issue-heading {
    align-items: center;
}

.research-issue-heading h3 {
    font-size: 14px;
}

.research-issue-heading strong {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: #eef3fb;
    color: #31528c;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.research-issue-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
}

.research-issue-meta div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.research-issue-meta dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.research-issue-meta dd {
    margin: 0;
    color: #102452;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.research-issue-card > p {
    margin: 0;
    color: #14224f;
    font-size: 13px;
    line-height: 1.5;
}

.research-reasoning-block {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    background: #f8fbff;
}

.research-reasoning-block strong {
    color: #102452;
    font-size: 12px;
    font-weight: 850;
}

.research-reasoning-block span,
.research-reasoning-block a {
    color: #42547f;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
}

.research-reasoning-block a {
    color: var(--blue);
    text-decoration: none;
}

.research-reasoning-block a:hover {
    text-decoration: underline;
}

.research-location-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.research-location-list a {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f1f6ff;
    color: var(--blue);
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.research-card-actions .matter-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
}

.research-add-issue.is-added {
    border-color: #bde7cf;
    background: #eefaf3;
    color: #0d6e3e;
}

.research-memo-form textarea {
    min-height: 310px;
    line-height: 1.5;
}

.research-memo-form .matter-button {
    justify-self: start;
}

.research-memo-row {
    display: grid;
    gap: 10px;
}

.research-memo-heading p {
    font-size: 15px;
}

.research-empty-state {
    max-width: 1180px;
}

.timeline-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-width: 1180px;
    margin-bottom: 18px;
}

.timeline-summary article {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.timeline-summary span {
    display: block;
    color: var(--ink);
    font-size: 28px;
    font-weight: 850;
    line-height: 1;
}

.timeline-summary p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.timeline-shell,
.message-timeline-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    max-width: 1180px;
    align-items: start;
}

.message-timeline-shell {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

.timeline-tree,
.timeline-items,
.timeline-transcript-list,
.participant-list,
.message-tree {
    display: grid;
}

.timeline-tree {
    gap: 22px;
}

.timeline-date-group h3 {
    margin: 0 0 12px;
    color: #52648f;
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.timeline-items {
    position: relative;
    gap: 12px;
}

.timeline-items::before,
.message-tree::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 19px;
    width: 2px;
    background: #dce6f6;
    content: "";
}

.timeline-event {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
}

.timeline-marker {
    z-index: 1;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid #c9d8ee;
    border-radius: 999px;
    background: #ffffff;
    color: #31528c;
}

.timeline-marker svg,
.timeline-transcript-card svg {
    width: 19px;
    height: 19px;
}

.timeline-card,
.message-event-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid #e5ecf7;
    border-radius: 8px;
    background: #fbfdff;
}

.timeline-card-header,
.timeline-footer,
.message-event-header,
.timeline-hero-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.timeline-card-header p,
.message-event-header p {
    margin: 0;
    color: #102452;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.3;
}

.timeline-card-header span,
.timeline-footer,
.message-event-time,
.message-event-header span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.timeline-card-header strong,
.message-event-header span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #edf3ff;
    color: #31528c;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.timeline-description {
    margin: 10px 0 0;
    color: #14224f;
    font-size: 14px;
    line-height: 1.55;
}

.timeline-footer {
    align-items: center;
    margin-top: 12px;
}

.timeline-footer a {
    color: var(--blue);
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.timeline-footer a:hover {
    text-decoration: underline;
}

.timeline-side {
    position: sticky;
    top: 104px;
}

.timeline-transcript-list,
.participant-list {
    gap: 8px;
}

.timeline-transcript-card {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid #e5ecf7;
    border-radius: 8px;
    background: #fbfdff;
    color: var(--ink);
    text-decoration: none;
}

.timeline-transcript-card:hover {
    border-color: #c8d6ee;
    background: #f5f9ff;
}

.timeline-transcript-card span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.timeline-transcript-card strong {
    overflow: hidden;
    color: #102452;
    font-size: 14px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-transcript-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.participant-list span {
    padding: 10px 12px;
    border: 1px solid #e5ecf7;
    border-radius: 8px;
    background: #fbfdff;
    color: #102452;
    font-size: 13px;
    font-weight: 800;
}

.message-tree {
    position: relative;
    gap: 12px;
}

.message-event {
    position: relative;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
}

.message-event::before {
    position: absolute;
    top: 18px;
    left: 13px;
    z-index: 1;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #31528c;
    box-shadow: 0 0 0 1px #b9c9e2;
    content: "";
}

.message-event-time {
    padding-left: 32px;
}

.message-event-time strong,
.message-event-time span {
    display: block;
}

.message-event.mentions-client .message-event-card {
    border-color: #bfe6ce;
    background: #f4fbf7;
}

.message-copy {
    margin: 9px 0 0;
    color: #14224f;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.message-copy mark {
    border-radius: 4px;
    background: #fff2a8;
    color: inherit;
    font-weight: 850;
}

.timeline-empty-state {
    min-height: 360px;
}

@media (max-width: 1420px) {
    .settings-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .firm-profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .logo-upload-panel {
        grid-column: 1 / -1;
        min-height: auto;
    }

    .matter-layout {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    }

    .matter-file-menu {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .timeline-shell,
    .message-timeline-shell {
        grid-template-columns: 1fr;
    }

    .timeline-side {
        position: static;
    }

    .research-workbench {
        grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    }

    .research-review-layout {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    }

    .research-intelligence-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .research-side-stack {
        position: static;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 12px;
    }

    .primary-nav {
        grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
    }

    .sidebar-logo-link {
        width: 50px;
        height: 50px;
        margin: 12px auto 0;
    }

    .sidebar-logo {
        width: 46px;
        height: 46px;
    }

    .topbar {
        top: 0;
        flex-wrap: wrap;
        padding: 12px 18px;
    }

    .global-search {
        order: 5;
        width: 100%;
        min-width: 0;
    }

    .topbar-spacer {
        display: none;
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-modal-content .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-tabs {
        grid-auto-flow: column;
        grid-auto-columns: max-content;
        overflow-x: auto;
        padding: 10px;
    }

    .matter-layout,
    .dictation-shell,
    .dictation-workspace,
    .dictation-workspace[data-active-stage="review"] .dictation-form,
    .dictation-capture-grid,
    .dictation-review-layout,
    .dictation-generate-layout,
    .matter-action-grid {
        grid-template-columns: 1fr;
    }

    .dictation-side-rail {
        position: static;
    }

    .dictation-word-toolbar,
    .dictation-word-toolbar label {
        grid-template-columns: 1fr;
    }

    .dictation-export-actions {
        justify-content: flex-start;
    }

    .dictation-word-page {
        width: calc(100% - 32px);
        margin: 16px;
        padding: 48px 42px;
    }

    .matter-side-stack {
        grid-row: auto;
    }

    .matter-file-menu,
    .file-browser-shell {
        grid-template-columns: 1fr;
    }

    .file-browser-items {
        max-height: 360px;
        min-height: 0;
    }

    .file-preview-pane {
        grid-template-rows: auto minmax(460px, 1fr);
    }

    .file-preview-frame,
    .file-preview-empty {
        min-height: 460px;
    }

    .timeline-summary {
        grid-template-columns: 1fr;
    }

    .research-workbench,
    .research-side-stack,
    .research-review-layout {
        grid-template-columns: 1fr;
    }

    .research-action-rail {
        position: static;
    }

    .research-legislation-panel {
        position: static;
    }

    .research-document-lines {
        max-height: none;
        min-height: 460px;
    }

    .research-intelligence-strip {
        grid-template-columns: 1fr;
    }

    .research-stepper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .research-primary-issue {
        display: grid;
    }

    .research-primary-actions {
        justify-content: stretch;
    }

    .research-primary-actions .matter-button {
        width: 100%;
    }

    .calendar-page {
        grid-template-columns: 1fr;
    }

    .calendar-toolbar {
        grid-column: auto;
    }

    .calendar-workspace {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .calendar-sidebar {
        grid-column: auto;
        grid-row: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
    }

    .calendar-board,
    .calendar-agenda-panel {
        grid-column: auto;
        grid-row: auto;
    }

    .calendar-sidebar-create {
        grid-column: 1 / -1;
    }

    .calendar-week-grid,
    .calendar-year-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-form-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    .page-content {
        padding: 22px 16px;
    }

    .settings-hero {
        min-height: 150px;
        margin: -22px -16px 0;
    }

    .settings-hero-copy {
        padding: 32px 16px 26px;
    }

    .settings-layout {
        margin-top: 0;
    }

    .firm-card {
        padding: 20px;
    }

    .firm-card-header {
        display: grid;
    }

    .firm-card-header .secondary-button {
        justify-self: start;
    }

    .firm-profile-grid,
    .settings-card-grid,
    .settings-form-grid,
    .settings-check-grid,
    .settings-logo-row {
        grid-template-columns: 1fr;
    }

    .profile-copy,
    .profile-button > svg {
        display: none;
    }

    .settings-modal-shell {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
    }

    .settings-modal-content {
        padding: 14px;
    }

    .settings-modal-header {
        min-height: 64px;
        padding: 12px 14px;
    }

    .new-button {
        min-width: 94px;
        padding: 0 13px;
    }

    .matter-hero h1 {
        font-size: 30px;
    }

    .matter-panel {
        padding: 18px;
    }

    .client-toolbar,
    .client-profile-summary,
    .client-action-row,
    .matter-hero-actions {
        align-items: stretch;
        display: grid;
        grid-template-columns: 1fr;
    }

    .client-search-form {
        grid-template-columns: 20px minmax(0, 1fr);
    }

    .client-search-form .matter-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .client-detail-grid,
    .client-form,
    .client-matter-result {
        grid-template-columns: 1fr;
    }

    .client-panel {
        padding: 18px;
    }

    .client-table {
        min-width: 620px;
    }

    .matter-inline-form,
    .matter-upload-form,
    .matter-toolbar-form,
    .dictation-upload-row,
    .attachment-form,
    .document-row,
    .correspondence-heading {
        display: grid;
        grid-template-columns: 1fr;
    }

    .matter-two-col,
    .matter-mini-grid,
    .dictation-form-grid,
    .dictation-setup-grid,
    .correspondence-party-grid {
        grid-template-columns: 1fr;
    }

    .dictation-stepper {
        grid-template-columns: 1fr;
    }

    .dictation-step {
        min-height: 68px;
        padding: 14px 16px;
    }

    .dictation-recorder-visual {
        grid-template-columns: minmax(56px, 1fr) 96px minmax(56px, 1fr);
        gap: 8px;
        min-height: 136px;
    }

    .dictation-mic-trigger {
        width: 76px;
        height: 76px;
    }

    .dictation-mic-trigger svg {
        width: 31px;
        height: 31px;
    }

    .voice-wave {
        gap: 4px;
    }

    .dictation-heading-actions,
    .dictation-panel-heading,
    .dictation-review-footer,
    .dictation-side-actions,
    .dictation-generate-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dictation-export-actions,
    .dictation-export-actions .matter-button {
        width: 100%;
    }

    .dictation-word-document {
        min-height: 620px;
    }

    .dictation-word-page {
        min-height: 720px;
        padding: 34px 24px;
    }

    .dictation-word-letterhead,
    .dictation-word-title-row,
    .dictation-word-meta {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dictation-word-letterhead small,
    .dictation-word-title-row span {
        justify-self: start;
    }

    .dictation-word-meta div,
    .dictation-word-meta div:last-child {
        border-right: 0;
        border-bottom: 1px solid #e6edf7;
    }

    .dictation-word-meta div:last-child {
        border-bottom: 0;
    }

    .dictation-word-editor {
        min-height: 420px;
        font-size: 14px;
    }

    .dictation-heading-actions .matter-button,
    .dictation-side-actions .matter-button,
    .dictation-stage-actions .matter-button {
        width: 100%;
    }

    .dictation-document-preview header,
    .dictation-document-preview dl {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dictation-document-preview dl div,
    .dictation-document-preview dl div:last-child {
        border-right: 0;
        border-bottom: 1px solid #edf1f8;
    }

    .dictation-document-preview dl div:last-child {
        border-bottom: 0;
    }

    .dictation-actions,
    .dictation-controls {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .dictation-actions .matter-button,
    .dictation-controls .matter-button,
    .dictation-upload-row .matter-button {
        width: 100%;
    }

    .document-actions {
        justify-content: flex-start;
    }

    .document-actions-grid {
        grid-template-columns: repeat(2, auto);
        justify-content: start;
    }

    .folder-tools {
        width: 100%;
    }

    .folder-rename-form {
        width: 100%;
    }

    .folder-rename-form .matter-input-small {
        flex: 1;
    }

    .matter-panel-header,
    .file-preview-header,
    .file-browser-hero,
    .research-review-hero,
    .research-matter-heading,
    .research-search-form,
    .research-flow-heading,
    .research-section-heading,
    .research-issue-compact-main {
        display: grid;
    }

    .research-stepper {
        grid-template-columns: 1fr;
    }

    .research-quick-stats {
        grid-template-columns: 1fr;
    }

    .research-quick-stats article,
    .research-quick-stats article:first-child,
    .research-quick-stats article:last-child {
        border-radius: 8px;
    }

    .research-hero-actions,
    .research-card-actions {
        justify-content: stretch;
    }

    .research-hero-actions .matter-button,
    .research-card-actions .matter-button,
    .research-search-form .matter-button {
        width: 100%;
    }

    .research-document-line {
        grid-template-columns: 1fr;
    }

    .research-line-number,
    .research-line-links {
        display: none;
    }

    .timeline-event,
    .message-event {
        grid-template-columns: 1fr;
    }

    .timeline-items::before,
    .message-tree::before,
    .message-event::before {
        display: none;
    }

    .timeline-marker,
    .message-event-time {
        display: none;
    }

    .timeline-card-header,
    .timeline-footer,
    .message-event-header,
    .timeline-hero-actions {
        display: grid;
        justify-content: stretch;
    }

    .calendar-toolbar,
    .calendar-toolbar-main {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .calendar-toolbar-title h1 {
        white-space: normal;
    }

    .calendar-sidebar {
        grid-template-columns: 1fr;
    }

    .calendar-create-button,
    .calendar-sidebar-create,
    .calendar-today-button,
    .calendar-primary-action,
    .calendar-secondary-action,
    .calendar-danger-action {
        width: 100%;
    }

    .calendar-nav-cluster {
        justify-content: flex-start;
    }

    .calendar-board {
        overflow-x: hidden;
    }

    .calendar-weekdays,
    .premium-calendar-grid {
        min-width: 0;
    }

    .calendar-board-topline,
    .calendar-popover-header,
    .calendar-form-actions,
    .calendar-detail-actions {
        display: grid;
        justify-content: stretch;
    }

    .calendar-view-menu,
    .calendar-view-menu-wrap,
    .calendar-event-lawyer {
        width: 100%;
    }

    .calendar-view-menu {
        position: static;
        margin-top: 8px;
    }

    .calendar-week-grid,
    .calendar-year-grid {
        grid-template-columns: 1fr;
    }

    .calendar-day-column-header,
    .calendar-day-row {
        grid-template-columns: 1fr;
    }

    .calendar-day-time-heading,
    .calendar-day-row > time {
        justify-items: start;
        border-right: 0;
        border-bottom: 1px solid #edf0f5;
        text-align: left;
    }

    .calendar-lawyer-column-heading,
    .calendar-lawyer-time-cell {
        border-left: 0;
        border-bottom: 1px solid #edf0f5;
    }

    .calendar-event-lawyer {
        justify-self: start;
    }

    .calendar-form-grid,
    .calendar-event-detail-list div,
    .calendar-day-event,
    .calendar-time-slot {
        grid-template-columns: 1fr;
    }

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

    .calendar-event-time {
        grid-template-columns: auto auto;
        justify-content: start;
    }

    .calendar-time-slot > time {
        border-right: 0;
        padding: 10px 12px 0;
        text-align: left;
    }
}

@media (max-width: 520px) {
    .primary-nav {
        grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
    }

    .topbar {
        gap: 10px;
    }

    .new-button span,
    .global-search kbd {
        display: none;
    }

    .global-search {
        height: 42px;
    }

    .settings-card {
        grid-template-columns: 44px minmax(0, 1fr) 16px;
        min-height: 100px;
        padding: 15px;
    }

    .module-icon {
        width: 44px;
        height: 44px;
    }

    .module-icon svg {
        width: 23px;
        height: 23px;
    }
}

.admin-choice-group {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}

.admin-choice-group legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.admin-choice-group label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 0;
    cursor: pointer;
}

.admin-choice-group input {
    margin-top: 4px;
}

.admin-choice-group strong,
.admin-choice-group small {
    display: block;
}

.admin-choice-group small {
    margin-top: 3px;
    color: var(--muted);
    line-height: 1.4;
}

.invoicing-page {
    display: grid;
    gap: 20px;
}

.invoicing-hero,
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.invoicing-hero h1 {
    margin: 4px 0 4px;
    font-size: 34px;
    line-height: 1.1;
}

.invoicing-hero p,
.panel-heading p {
    margin: 0;
    color: var(--muted);
}

.module-kicker {
    color: var(--purple);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoicing-hero-actions,
.legal-aid-upload,
.inline-action-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.invoicing-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.invoicing-subnav a {
    padding: 8px 10px;
    border-radius: 8px;
    color: #264269;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.invoicing-subnav a:hover {
    background: #eef4ff;
    color: var(--blue);
}

.invoicing-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.invoicing-stat-grid article,
.import-summary-grid article,
.import-review-grid article,
.completion-grid article {
    display: grid;
    gap: 6px;
    min-height: 118px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.invoicing-stat-grid p,
.import-summary-grid p,
.completion-grid p {
    margin: 0;
    color: #27395e;
    font-size: 13px;
    font-weight: 800;
}

.invoicing-stat-grid strong,
.import-summary-grid strong,
.import-review-grid strong,
.completion-grid strong {
    color: var(--ink);
    font-size: 24px;
    line-height: 1.15;
}

.invoicing-stat-grid small,
.import-review-grid small {
    color: var(--muted);
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-icon.purple {
    background: #f0eaff;
    color: var(--purple);
}

.stat-icon.green {
    background: #e8f7ef;
    color: var(--green);
}

.stat-icon.blue {
    background: #eaf2ff;
    color: var(--blue);
}

.stat-icon.orange {
    background: #fff3df;
    color: #b86400;
}

.stat-icon.red {
    background: #fff0f0;
    color: #c93636;
}

.invoicing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 16px;
}

.invoicing-panel {
    display: grid;
    gap: 16px;
    align-content: start;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.invoicing-panel-wide {
    grid-column: 1 / -1;
}

.accepted-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.accepted-formats span {
    padding: 6px 9px;
    border: 1px solid #d9e3f3;
    border-radius: 8px;
    background: #f8fbff;
    color: #294468;
    font-size: 12px;
    font-weight: 700;
}

.import-summary-grid,
.import-review-grid,
.completion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.import-review-grid article {
    min-height: 92px;
    box-shadow: none;
}

.import-review-grid h3 {
    margin: 0;
    font-size: 14px;
}

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

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

.invoice-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 8px;
    background: #eef4ff;
    color: #1f57b4;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.posting-preview {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid #d9e3f3;
    border-radius: 8px;
    background: #f8fbff;
}

.posting-preview h3,
.attention-list h3 {
    margin: 0;
}

.posting-preview p {
    margin: 3px 0 0;
    color: var(--muted);
}

.posting-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.posting-preview-grid span,
.completion-actions-list span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #dbe4f3;
    border-radius: 8px;
    background: #ffffff;
    color: #20375d;
    font-size: 13px;
    font-weight: 700;
}

.approval-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.approval-checklist li,
.completion-actions-list span {
    justify-content: flex-start;
}

.approval-checklist li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #294468;
    font-size: 13px;
    font-weight: 700;
}

.approval-checklist svg,
.completion-actions-list svg {
    width: 18px;
    height: 18px;
    color: var(--green);
}

.compact-list {
    display: grid;
    gap: 10px;
}

.compact-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e1e8f4;
    border-radius: 8px;
    background: #fbfdff;
}

.compact-list strong,
.compact-list small {
    display: block;
}

.compact-list small {
    margin-top: 3px;
    color: var(--muted);
}

.transfer-mini-form {
    display: grid;
    grid-template-columns: 142px minmax(120px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.transfer-mini-form input {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 10px;
}

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

.attention-list {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid #f1d2a7;
    border-radius: 8px;
    background: #fff8ed;
}

.attention-list p {
    margin: 0;
    color: #7b4b00;
}

.matter-account-form {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}

.matter-account-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.matter-account-form label {
    display: grid;
    gap: 6px;
    color: #24395e;
    font-size: 13px;
    font-weight: 800;
}

.matter-account-form input,
.matter-account-form select {
    min-height: 40px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 10px;
    background: #ffffff;
    color: var(--ink);
}

.matter-account-table-wrap {
    overflow-x: auto;
}

.matter-account-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.matter-account-table th,
.matter-account-table td {
    padding: 11px 10px;
    border-bottom: 1px solid #e1e8f4;
    text-align: left;
    font-size: 13px;
}

.matter-account-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.matter-account-table a {
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
}

@media (max-width: 1180px) {
    .invoicing-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .invoicing-hero,
    .panel-heading,
    .compact-list article {
        display: grid;
    }

    .legal-aid-upload,
    .invoicing-hero-actions,
    .legal-aid-upload .matter-button,
    .legal-aid-upload .file-input-button,
    .transfer-mini-form .secondary-button {
        width: 100%;
    }

    .transfer-mini-form {
        grid-template-columns: 1fr;
        width: 100%;
    }
}

/* General user dashboard */
.topbar-dashboard {
    align-items: center;
}

.dashboard-topbar-greeting {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.dashboard-topbar-greeting h1 {
    margin: 0;
    color: #071743;
    font-size: 28px;
    font-weight: 850;
    line-height: 1.1;
}

.dashboard-topbar-greeting p {
    margin: 0;
    color: #52688f;
    font-size: 14px;
    font-weight: 650;
}

.general-dashboard {
    display: grid;
    gap: 18px;
}

.dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-stat-card,
.dashboard-panel {
    min-width: 0;
    border: 1px solid #dfe7f3;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(16, 42, 92, 0.06);
}

.dashboard-stat-card {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 12px;
    align-content: start;
    min-height: 132px;
    padding: 18px;
}

.dashboard-stat-card > a,
.dashboard-panel-header a,
.dashboard-panel-footer {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #2319ff;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.dashboard-stat-card > a {
    grid-column: 1 / -1;
    align-self: end;
}

.dashboard-stat-card svg,
.dashboard-panel-header svg,
.dashboard-panel-footer svg,
.dashboard-action-grid svg {
    width: 18px;
    height: 18px;
}

.dashboard-stat-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
}

.dashboard-stat-icon svg {
    width: 26px;
    height: 26px;
}

.dashboard-stat-icon.is-purple {
    background: #f0eaff;
    color: #4d24e8;
}

.dashboard-stat-icon.is-green {
    background: #e8f8ef;
    color: #109657;
}

.dashboard-stat-icon.is-orange {
    background: #fff1df;
    color: #e06a00;
}

.dashboard-stat-icon.is-indigo {
    background: #edeaff;
    color: #3524d6;
}

.dashboard-stat-icon.is-blue {
    background: #e7f1ff;
    color: #1267d8;
}

.dashboard-stat-card p,
.dashboard-kicker,
.dashboard-performance-summary p {
    margin: 0;
    color: #465d86;
    font-size: 13px;
    font-weight: 800;
}

.dashboard-stat-card strong {
    display: block;
    margin-top: 6px;
    color: #08163f;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.05;
}

.dashboard-stat-card small,
.dashboard-muted {
    color: #5b6d8f;
    font-size: 12px;
    font-weight: 650;
}

.dashboard-progress {
    grid-column: 1 / -1;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe2ed;
}

.dashboard-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2319ff, #7c4dff);
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(320px, 1fr) minmax(360px, 1.15fr);
    gap: 18px;
    align-items: start;
}

.dashboard-panel {
    display: grid;
    align-content: start;
    overflow: hidden;
}

.dashboard-panel-header,
.dashboard-panel-footer {
    min-height: 54px;
    padding: 16px 18px;
}

.dashboard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e5ecf6;
}

.dashboard-panel-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
    color: #08163f;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.2;
}

.dashboard-panel-header h2 svg {
    color: #2b22ff;
}

.dashboard-panel-header > span {
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid #dce6f3;
    border-radius: 8px;
    color: #25395d;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.dashboard-panel-footer {
    justify-content: center;
    border-top: 1px solid #e5ecf6;
}

.dashboard-calendar-list,
.dashboard-task-list,
.dashboard-activity-list,
.dashboard-review-list {
    display: grid;
}

.dashboard-calendar-list h3 {
    margin: 14px 18px 2px;
    color: #0f234d;
    font-size: 13px;
    font-weight: 900;
}

.dashboard-calendar-row,
.dashboard-task-row,
.dashboard-activity-row,
.dashboard-review-row {
    display: grid;
    gap: 12px;
    align-items: center;
    min-width: 0;
    min-height: 66px;
    padding: 12px 18px;
    border-bottom: 1px solid #edf2f8;
    color: #0f234d;
    text-decoration: none;
}

.dashboard-calendar-row {
    grid-template-columns: 64px minmax(0, 1fr) auto;
}

.dashboard-calendar-row:hover,
.dashboard-task-row:hover,
.dashboard-activity-row:hover,
.dashboard-review-row:hover,
.dashboard-action-grid a:hover {
    background: #f7faff;
}

.dashboard-calendar-time {
    display: grid;
    gap: 4px;
    padding-right: 12px;
    border-right: 2px solid #d8e2ef;
}

.dashboard-calendar-time strong,
.dashboard-calendar-time small,
.dashboard-calendar-copy strong,
.dashboard-calendar-copy small,
.dashboard-task-row strong,
.dashboard-task-row small,
.dashboard-activity-row strong,
.dashboard-activity-row small,
.dashboard-review-row strong,
.dashboard-review-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-calendar-time strong,
.dashboard-calendar-copy strong,
.dashboard-task-row strong,
.dashboard-activity-row strong,
.dashboard-review-row strong {
    color: #0f234d;
    font-size: 13px;
    font-weight: 900;
}

.dashboard-calendar-time small,
.dashboard-calendar-copy small,
.dashboard-task-row small,
.dashboard-activity-row small,
.dashboard-review-row small,
.dashboard-activity-row time {
    color: #516893;
    font-size: 12px;
    font-weight: 650;
}

.dashboard-calendar-copy,
.dashboard-task-row span:nth-child(2),
.dashboard-activity-row span,
.dashboard-review-row span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.dashboard-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.dashboard-tag.is-purple,
.dashboard-tag.is-high {
    background: #f0eaff;
    color: #5d32dd;
}

.dashboard-tag.is-green,
.dashboard-tag.is-low {
    background: #e9f8f0;
    color: #16885a;
}

.dashboard-tag.is-blue {
    background: #e9f2ff;
    color: #1765c1;
}

.dashboard-tag.is-urgent {
    background: #ffecef;
    color: #c92a3f;
}

.dashboard-tag.is-normal {
    background: #fff3e6;
    color: #c25d00;
}

.dashboard-task-row {
    grid-template-columns: 14px minmax(0, 1fr) auto 84px;
}

.dashboard-task-dot {
    width: 11px;
    height: 11px;
    border: 2px solid currentColor;
    border-radius: 999px;
}

.dashboard-task-dot.is-urgent,
.dashboard-task-dot.is-high {
    color: #f04438;
}

.dashboard-task-dot.is-normal {
    color: #f27a1a;
}

.dashboard-task-dot.is-low {
    color: #16a66a;
}

.dashboard-activity-row {
    grid-template-columns: 24px minmax(0, 1fr) max-content;
}

.dashboard-activity-row > svg {
    width: 18px;
    height: 18px;
    justify-self: center;
    color: #244374;
}

.dashboard-activity-row time {
    white-space: nowrap;
}

.dashboard-usage-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(190px, 1.05fr);
    gap: 18px;
    padding: 18px;
}

.dashboard-large-number {
    display: block;
    margin-top: 6px;
    color: #071743;
    font-size: 26px;
    font-weight: 950;
    line-height: 1.1;
}

.dashboard-trend {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 850;
}

.dashboard-trend.is-positive {
    color: #13955b;
}

.dashboard-trend.is-negative {
    color: #c93636;
}

.dashboard-trend.is-neutral {
    color: #637493;
}

.dashboard-bar-chart,
.dashboard-performance-chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    align-items: end;
    gap: 8px;
    height: 116px;
    margin-top: 18px;
    padding: 0 2px;
}

.dashboard-bar-chart span,
.dashboard-performance-chart span {
    min-height: 4px;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(180deg, #7257ff, #271fff);
    box-shadow: 0 8px 16px rgba(45, 31, 255, 0.16);
}

.dashboard-bar-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.dashboard-bar-labels small {
    overflow: hidden;
    color: #52688f;
    font-size: 10px;
    font-weight: 750;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-feature-list {
    display: grid;
    align-content: start;
    gap: 10px;
}

.dashboard-feature-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 34px 58px;
    gap: 8px;
    align-items: center;
}

.dashboard-feature-row svg {
    width: 16px;
    height: 16px;
    color: #3524d6;
}

.dashboard-feature-row strong {
    display: block;
    margin-bottom: 5px;
    color: #172a52;
    font-size: 12px;
    font-weight: 900;
}

.dashboard-feature-row em {
    display: block;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #e1e7f0;
}

.dashboard-feature-row em span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #3326ff;
}

.dashboard-feature-row small {
    color: #52688f;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    text-align: right;
}

.dashboard-performance-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 18px 18px 12px;
}

.dashboard-performance-summary strong {
    display: block;
    margin-top: 5px;
    color: #071743;
    font-size: 22px;
    font-weight: 950;
}

.dashboard-performance-summary small {
    color: #52688f;
    font-size: 12px;
    font-weight: 650;
}

.dashboard-progress.is-wide {
    margin: 0 18px;
}

.dashboard-performance-chart {
    margin: 14px 18px 0;
}

.dashboard-side-stack {
    display: grid;
    gap: 18px;
}

.dashboard-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 18px;
}

.dashboard-action-grid a {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 54px;
    padding: 12px;
    border-radius: 8px;
    background: #f3f0fb;
    color: #14224f;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.dashboard-action-grid a svg {
    width: 24px;
    height: 24px;
    color: #2d22ff;
}

.dashboard-review-row {
    grid-template-columns: minmax(0, 1fr) 112px auto;
    min-height: 58px;
}

.dashboard-empty-state {
    display: grid;
    gap: 10px;
    justify-items: center;
    min-height: 180px;
    padding: 32px 20px;
    color: #52688f;
    text-align: center;
}

.dashboard-empty-state svg {
    width: 32px;
    height: 32px;
    color: #8ba0c1;
}

.dashboard-empty-state p,
.dashboard-muted {
    margin: 0;
}

@media (max-width: 1540px) {
    .dashboard-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .dashboard-side-stack {
        grid-column: 1 / -1;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1080px) {
    .dashboard-stat-grid,
    .dashboard-main-grid,
    .dashboard-side-stack {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 720px) {
    .dashboard-topbar-greeting h1 {
        font-size: 22px;
    }

    .dashboard-stat-card,
    .dashboard-panel-header,
    .dashboard-panel-footer,
    .dashboard-usage-grid,
    .dashboard-performance-summary,
    .dashboard-action-grid {
        padding-right: 14px;
        padding-left: 14px;
    }

    .dashboard-calendar-row,
    .dashboard-task-row,
    .dashboard-activity-row,
    .dashboard-review-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .dashboard-calendar-time {
        grid-template-columns: auto auto;
        justify-content: start;
        border-right: 0;
        padding-right: 0;
    }

    .dashboard-task-dot,
    .dashboard-activity-row > svg {
        display: none;
    }

    .dashboard-activity-row time {
        white-space: normal;
    }

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

    .dashboard-review-row > small,
    .dashboard-feature-row small {
        text-align: left;
    }
}

/* Reports */
.reports-page {
    display: grid;
    gap: 18px;
    color: #091642;
}

.reports-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 42px;
}

.reports-filter-form {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.reports-select-control,
.reports-export-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    border: 1px solid #dfe7f3;
    border-radius: 8px;
    background: #ffffff;
    color: #162757;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(24, 42, 88, 0.04);
}

.reports-select-control {
    position: relative;
    padding: 0 12px;
}

.reports-select-control select {
    min-width: 132px;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    appearance: none;
    cursor: pointer;
}

.reports-select-control svg,
.reports-export-button svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: #294170;
}

.reports-export-button {
    padding: 0 16px;
}

.reports-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.reports-stat-card,
.reports-panel {
    min-width: 0;
    border: 1px solid #dfe7f3;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(16, 42, 92, 0.06);
}

.reports-stat-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
    min-height: 130px;
    padding: 20px;
}

.reports-stat-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 8px;
}

.reports-stat-icon svg {
    width: 28px;
    height: 28px;
}

.reports-stat-icon.is-purple {
    background: #f0eaff;
    color: #4d24e8;
}

.reports-stat-icon.is-green {
    background: #e7f8ef;
    color: #0f9d58;
}

.reports-stat-icon.is-blue {
    background: #e8f1ff;
    color: #1267d8;
}

.reports-stat-icon.is-orange {
    background: #fff1e5;
    color: #f27400;
}

.reports-stat-icon.is-indigo {
    background: #edeaff;
    color: #5430e8;
}

.reports-stat-copy {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
}

.reports-stat-copy p,
.reports-kpi-body p,
.reports-chart-unit {
    margin: 0;
    color: #405487;
    font-size: 13px;
    font-weight: 800;
}

.reports-stat-copy strong {
    display: block;
    color: #07133d;
    font-size: 25px;
    font-weight: 950;
    line-height: 1.05;
}

.reports-stat-copy small,
.reports-kpi-meta small {
    color: #52658c;
    font-size: 12px;
    font-weight: 700;
}

.reports-trend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.reports-trend svg {
    width: 14px;
    height: 14px;
}

.reports-trend.is-positive {
    color: #12a15b;
}

.reports-trend.is-negative {
    color: #c93636;
}

.reports-trend.is-neutral {
    color: #637493;
}

.reports-progress {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #dce3ed;
}

.reports-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #251bff, #744dff);
}

.reports-main-grid {
    display: grid;
    grid-template-columns: minmax(340px, 1.06fr) minmax(300px, 1fr) minmax(340px, 1.08fr);
    gap: 18px;
    align-items: stretch;
}

.reports-lower-grid {
    display: grid;
    grid-template-columns: minmax(430px, 1.45fr) minmax(330px, 0.94fr) minmax(300px, 0.9fr);
    gap: 18px;
    align-items: stretch;
}

.reports-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.reports-panel-header,
.reports-panel-footer {
    min-height: 54px;
    padding: 16px 18px;
}

.reports-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.reports-panel-header h2 {
    margin: 0;
    color: #07133d;
    font-size: 16px;
    font-weight: 950;
    line-height: 1.2;
}

.reports-panel-header > span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid #dfe7f3;
    border-radius: 8px;
    color: #25395d;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.reports-panel-footer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid #e6edf6;
    color: #2319ff;
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
}

.reports-panel-footer svg {
    width: 17px;
    height: 17px;
}

.reports-line-chart {
    display: grid;
    gap: 6px;
    padding: 0 18px 18px;
}

.reports-line-chart svg {
    width: 100%;
    min-height: 190px;
}

.reports-line-chart line {
    stroke: #e2e8f2;
    stroke-width: 1;
}

.reports-line-chart text {
    fill: #4e6290;
    font-size: 11px;
    font-weight: 750;
}

.reports-line-chart polygon {
    fill: url(#reports-time-area);
}

.reports-line-chart polyline {
    fill: none;
    stroke: #3d2fff;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.reports-line-chart circle {
    fill: #ffffff;
    stroke: #3d2fff;
    stroke-width: 2.4;
}

.reports-line-labels {
    display: grid;
    gap: 2px;
    min-height: 18px;
    padding-left: 40px;
}

.reports-line-labels small {
    overflow: hidden;
    color: #52658c;
    font-size: 10px;
    font-weight: 750;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-matter-bars {
    display: grid;
    align-content: start;
    gap: 15px;
    padding: 10px 18px 18px;
}

.reports-matter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(100px, 0.72fr) 62px;
    gap: 12px;
    align-items: center;
    color: #10224f;
    text-decoration: none;
}

.reports-matter-row span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.reports-matter-row strong,
.reports-work-row strong,
.reports-export-list strong {
    overflow: hidden;
    color: #10224f;
    font-size: 13px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-matter-row small,
.reports-work-row small,
.reports-export-list small {
    overflow: hidden;
    color: #52658c;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-matter-row em {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f1;
}

.reports-matter-row i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2c21ff, #724cff);
}

.reports-matter-row b {
    color: #192c59;
    font-size: 13px;
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
}

.reports-activity-layout {
    display: grid;
    grid-template-columns: minmax(150px, 0.9fr) minmax(170px, 1fr);
    gap: 18px;
    align-items: center;
    padding: 14px 24px 18px;
}

.reports-donut {
    position: relative;
    display: grid;
    width: min(190px, 100%);
    aspect-ratio: 1;
    justify-self: center;
    place-items: center;
    border-radius: 999px;
}

.reports-donut::after {
    position: absolute;
    inset: 44px;
    border-radius: inherit;
    background: #ffffff;
    content: "";
}

.reports-donut span {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 2px;
    color: #0d1d49;
    text-align: center;
}

.reports-donut strong {
    font-size: 22px;
    font-weight: 950;
    line-height: 1;
}

.reports-donut small {
    color: #52658c;
    font-size: 11px;
    font-weight: 750;
}

.reports-activity-legend {
    display: grid;
    gap: 13px;
}

.reports-activity-legend div {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) 48px;
    gap: 10px;
    align-items: center;
    color: #122654;
    font-size: 13px;
    font-weight: 800;
}

.reports-activity-legend i {
    width: 9px;
    height: 9px;
    border-radius: 999px;
}

.reports-activity-legend strong {
    color: #10224f;
    text-align: right;
}

.reports-table-wrap {
    min-width: 0;
    overflow: visible;
    padding: 0 18px 10px;
}

.reports-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.reports-table th,
.reports-table td {
    padding: 14px 0;
    border-bottom: 1px solid #e7edf6;
    color: #10224f;
    font-size: 13px;
    font-weight: 750;
    text-align: left;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.reports-table th {
    color: #415682;
    font-size: 12px;
    font-weight: 900;
}

.reports-table td + td,
.reports-table th + th {
    padding-left: 18px;
}

.reports-table a {
    color: #213967;
    text-decoration: none;
}

.reports-deadlines-panel .reports-table th:nth-child(1),
.reports-deadlines-panel .reports-table td:nth-child(1) {
    width: 18%;
}

.reports-deadlines-panel .reports-table th:nth-child(2),
.reports-deadlines-panel .reports-table td:nth-child(2) {
    width: 34%;
}

.reports-deadlines-panel .reports-table th:nth-child(3),
.reports-deadlines-panel .reports-table td:nth-child(3) {
    width: 32%;
}

.reports-deadlines-panel .reports-table th:nth-child(4),
.reports-deadlines-panel .reports-table td:nth-child(4) {
    width: 16%;
}

.reports-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.reports-status.is-today {
    background: #ffe9ec;
    color: #e23a4d;
}

.reports-status.is-upcoming {
    background: #fff1e4;
    color: #eb7600;
}

.reports-status.is-overdue {
    background: #ffe1e1;
    color: #c6292d;
}

.reports-work-list {
    display: grid;
}

.reports-work-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) max-content;
    gap: 12px;
    align-items: center;
    min-height: 64px;
    padding: 11px 18px;
    border-bottom: 1px solid #e7edf6;
    text-decoration: none;
}

.reports-work-row > svg,
.reports-export-list > a > svg:first-child {
    display: grid;
    width: 28px;
    height: 28px;
    padding: 6px;
    border-radius: 7px;
    background: #e9f2ff;
    color: #1765d1;
}

.reports-work-row span,
.reports-export-list span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.reports-work-row time {
    color: #435983;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.reports-side-stack {
    display: grid;
    gap: 18px;
}

.reports-kpi-body {
    display: grid;
    gap: 10px;
    padding: 0 18px 14px;
}

.reports-kpi-value {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.reports-kpi-value strong {
    color: #07133d;
    font-size: 26px;
    font-weight: 950;
    line-height: 1;
}

.reports-kpi-value small {
    color: #405487;
    font-size: 13px;
    font-weight: 750;
}

.reports-progress.is-kpi {
    height: 7px;
}

.reports-kpi-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.reports-export-list {
    display: grid;
    padding: 0 18px 10px;
}

.reports-export-list a {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 24px;
    gap: 12px;
    align-items: center;
    min-height: 48px;
    color: #10224f;
    text-decoration: none;
}

.reports-export-list a > svg:last-child {
    width: 18px;
    height: 18px;
    justify-self: end;
    color: #17315f;
}

.reports-empty-state {
    display: grid;
    gap: 10px;
    justify-items: center;
    min-height: 170px;
    padding: 32px 20px;
    color: #52658c;
    text-align: center;
}

.reports-empty-state svg {
    width: 32px;
    height: 32px;
    color: #879bbd;
}

.reports-empty-state p {
    margin: 0;
    font-size: 13px;
    font-weight: 750;
}

@media (max-width: 1540px) {
    .reports-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .reports-main-grid,
    .reports-lower-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reports-activity-panel,
    .reports-side-stack {
        grid-column: 1 / -1;
    }

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

@media (max-width: 1080px) {
    .reports-stat-grid,
    .reports-main-grid,
    .reports-lower-grid,
    .reports-side-stack {
        grid-template-columns: 1fr;
    }

    .reports-activity-panel,
    .reports-side-stack {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    .reports-header,
    .reports-filter-form,
    .reports-kpi-value,
    .reports-kpi-meta {
        align-items: stretch;
        flex-direction: column;
    }

    .reports-filter-form {
        width: 100%;
    }

    .reports-select-control,
    .reports-export-button {
        justify-content: center;
        width: 100%;
    }

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

    .reports-stat-card,
    .reports-panel-header,
    .reports-panel-footer,
    .reports-line-chart,
    .reports-matter-bars,
    .reports-table-wrap,
    .reports-kpi-body,
    .reports-export-list {
        padding-right: 14px;
        padding-left: 14px;
    }

    .reports-activity-layout {
        grid-template-columns: 1fr;
        padding-right: 14px;
        padding-left: 14px;
    }

    .reports-matter-row,
    .reports-work-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .reports-work-row > svg {
        display: none;
    }

    .reports-work-row time,
    .reports-matter-row b {
        text-align: left;
        white-space: normal;
    }

    .reports-line-labels {
        padding-left: 0;
    }
}

/* Partner dashboard */
.partner-dashboard .dashboard-stat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.partner-stat-card {
    min-height: 116px;
}

.partner-stat-card .dashboard-trend {
    margin-top: 8px;
    font-size: 12px;
}

.partner-operations-grid,
.partner-bottom-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr) minmax(360px, 1.1fr);
    gap: 18px;
    align-items: stretch;
}

.partner-bottom-grid {
    align-items: stretch;
}

.partner-operations-grid > .dashboard-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 530px;
}

.partner-operations-grid .dashboard-calendar-list,
.partner-operations-grid .dashboard-task-list,
.partner-operations-grid .dashboard-activity-list {
    min-height: 0;
}

.partner-bottom-grid > .dashboard-panel {
    height: 100%;
    align-content: stretch;
}

.partner-finance-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 18px 18px 8px;
}

.partner-finance-summary > div + div {
    border-left: 1px solid #e0e8f4;
    padding-left: 16px;
}

.partner-finance-summary p,
.partner-trust-metrics p {
    margin: 0;
    color: #516893;
    font-size: 12px;
    font-weight: 800;
}

.partner-finance-summary strong,
.partner-trust-metrics strong {
    display: block;
    margin-top: 7px;
    color: #071743;
    font-size: 20px;
    font-weight: 950;
}

.partner-line-chart {
    padding: 10px 18px 18px;
}

.partner-line-chart svg {
    width: 100%;
    min-height: 220px;
}

.partner-line-chart line {
    stroke: #e2e9f4;
    stroke-width: 1;
}

.partner-line-chart polygon {
    fill: rgba(40, 169, 87, 0.14);
}

.partner-line-chart polyline {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.partner-line-chart polyline.is-billed {
    stroke: #4d2fff;
}

.partner-line-chart polyline.is-collected {
    stroke: #28a957;
}

.partner-chart-labels,
.partner-chart-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.partner-chart-labels small {
    color: #536b94;
    font-size: 11px;
    font-weight: 750;
}

.partner-chart-legend {
    justify-content: center;
    padding: 0 18px 18px;
}

.partner-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #536b94;
    font-size: 12px;
    font-weight: 800;
}

.partner-chart-legend i,
.partner-trust-legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
}

.partner-chart-legend i.is-billed {
    background: #4d2fff;
}

.partner-chart-legend i.is-collected {
    background: #28a957;
}

.partner-trust-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
    padding: 18px;
    min-width: 0;
    overflow: hidden;
}

.partner-trust-panel,
.partner-trust-panel .dashboard-panel-header {
    min-width: 0;
}

.partner-trust-panel .dashboard-panel-header a {
    flex: 0 0 auto;
    white-space: nowrap;
}

.partner-trust-grid > * {
    min-width: 0;
}

.partner-trust-metrics {
    display: grid;
    align-content: start;
    gap: 12px;
}

.partner-trust-metrics strong {
    padding-bottom: 10px;
    border-bottom: 1px solid #e5ecf6;
    font-size: 16px;
}

.partner-trust-metrics p:not(:first-child) {
    margin-top: 2px;
}

.partner-donut-wrap {
    display: grid;
    justify-items: center;
    gap: 14px;
}

.partner-donut {
    position: relative;
    display: grid;
    width: min(172px, 100%);
    aspect-ratio: 1;
    place-items: center;
    border-radius: 999px;
}

.partner-donut::after {
    position: absolute;
    inset: 24px;
    border-radius: inherit;
    background: #ffffff;
    content: "";
}

.partner-donut span {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 4px;
    text-align: center;
}

.partner-donut strong {
    color: #071743;
    font-size: 15px;
    font-weight: 950;
}

.partner-donut small {
    color: #52688f;
    font-size: 12px;
    font-weight: 750;
}

.partner-trust-legend {
    display: grid;
    gap: 9px;
    width: 100%;
}

.partner-trust-legend span {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    color: #52688f;
    font-size: 11px;
    font-weight: 800;
}

.partner-trust-legend strong {
    grid-column: 2;
    color: #172a52;
    font-size: 11px;
    font-weight: 900;
}

.partner-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    height: 100%;
    align-content: start;
}

.partner-action-grid a {
    min-height: 82px;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
}

.partner-action-grid a svg {
    width: 30px;
    height: 30px;
}

@media (max-width: 1540px) {
    .partner-dashboard .dashboard-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .partner-operations-grid,
    .partner-bottom-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .partner-bottom-grid > .dashboard-panel:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1080px) {
    .partner-operations-grid,
    .partner-bottom-grid,
    .partner-trust-grid {
        grid-template-columns: 1fr;
    }

    .partner-bottom-grid > .dashboard-panel:last-child {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    .partner-dashboard .dashboard-stat-grid,
    .partner-finance-summary,
    .partner-action-grid {
        grid-template-columns: 1fr;
    }

    .partner-finance-summary > div + div {
        border-left: 0;
        border-top: 1px solid #e0e8f4;
        padding-left: 0;
        padding-top: 12px;
    }
}
