:root {
    --mw-color-canvas: #f7f7f8;
    --mw-color-surface: #ffffff;
    --mw-color-surface-subtle: #f3f3f3;
    --mw-color-surface-raised: #ffffff;
    --mw-color-border: #e2e2e5;
    --mw-color-border-strong: #d4d4d8;
    --mw-color-text: #202123;
    --mw-color-text-muted: #565869;
    --mw-color-text-subtle: #8e8ea0;
    --mw-color-surface-hover: #ececf1;
    --mw-color-accent: #2563eb;
    --mw-color-accent-hover: #1d4ed8;
    --mw-color-accent-soft: #eff6ff;
    --mw-color-success: #16a34a;
    --mw-color-warning: #d97706;
    --mw-color-danger: #dc2626;
    --mw-color-sidebar-surface: #f3f3f3;
    --mw-color-sidebar-surface-raised: #ececf1;
    --mw-color-sidebar-text: #202123;
    --mw-color-sidebar-muted: #565869;
    --mw-color-focus-ring: rgba(37, 99, 235, 0.28);
    --mw-elevation-1: 0 12px 30px rgba(15, 23, 42, 0.06);
    --mw-elevation-2: 0 18px 40px rgba(15, 23, 42, 0.08);
    --mw-radius-lg: 1.25rem;
    --mw-radius-md: 0.85rem;
    --mw-radius-sm: 0.65rem;
    --mw-control-height: 2.8rem;
    --mw-control-height-sm: 2.45rem;
    --mw-control-radius: 0.85rem;
    --mw-shell-sidebar-width: 248px;
    --mw-shell-sidebar-width-compact: 80px;
    --mw-shell-gap: 1.25rem;
    --mw-shell-content-max-width: 1440px;

    /* Aliases conservés pour les composants existants. */
    --mw-sidebar-bg: var(--mw-color-sidebar-surface);
    --mw-sidebar-bg-2: var(--mw-color-sidebar-surface-raised);
    --mw-primary: var(--mw-color-accent);
    --mw-primary-hover: var(--mw-color-accent-hover);
    --mw-bg: var(--mw-color-canvas);
    --mw-card-bg: var(--mw-color-surface);
    --mw-border: var(--mw-color-border);
    --mw-text: var(--mw-color-text);
    --mw-muted: var(--mw-color-text-muted);
    --mw-shadow: var(--mw-elevation-2);
    --mw-radius: var(--mw-radius-lg);
    --mw-radius-sm: var(--mw-radius-md);
    --mw-surface-radius: var(--mw-radius-lg);
    --mw-surface-radius-sm: var(--mw-radius-md);
    --mw-surface-shadow: var(--mw-elevation-2);
    --mw-progress-track: #e2e2e5;
}

html,
body {
    min-height: 100%;
}

html {
    background: var(--mw-color-canvas);
}

html.theme-dark-preload {
    background: var(--mw-color-canvas);
    color-scheme: dark;
}

body {
    margin: 0;
    color: var(--mw-text);
    background: var(--mw-color-canvas);
    font-family: Inter, "Segoe UI", sans-serif;
}

body.theme-dark {
    --mw-color-canvas: #212121;
    --mw-color-surface: #2f2f2f;
    --mw-color-surface-subtle: #292929;
    --mw-color-surface-raised: #383838;
    --mw-color-surface-hover: #383838;
    --mw-color-border: #424242;
    --mw-color-border-strong: #505050;
    --mw-color-text: #f2f2f2;
    --mw-color-text-muted: #b4b4b4;
    --mw-color-text-subtle: #8e8e8e;
    --mw-color-accent: #3b82f6;
    --mw-color-accent-hover: #2563eb;
    --mw-color-accent-soft: rgba(59, 130, 246, 0.12);
    --mw-color-sidebar-surface: #171717;
    --mw-color-sidebar-surface-raised: #242424;
    --mw-color-sidebar-text: #f2f2f2;
    --mw-color-sidebar-muted: #b4b4b4;
    --mw-color-focus-ring: rgba(59, 130, 246, 0.32);
    --mw-color-success: #3fb950;
    --mw-color-warning: #d29922;
    --mw-color-danger: #f85149;
    --mw-elevation-1: 0 8px 24px rgba(0, 0, 0, 0.16);
    --mw-elevation-2: 0 16px 36px rgba(0, 0, 0, 0.22);
    --mw-bg: var(--mw-color-canvas);
    --mw-card-bg: var(--mw-color-surface);
    --mw-border: var(--mw-color-border);
    --mw-text: var(--mw-color-text);
    --mw-muted: var(--mw-color-text-muted);
    --mw-shadow: var(--mw-elevation-2);
    --mw-sidebar-bg: var(--mw-color-sidebar-surface);
    --mw-sidebar-bg-2: var(--mw-color-sidebar-surface-raised);
    --mw-surface-shadow: var(--mw-elevation-2);
    --mw-progress-track: rgba(71, 85, 105, 0.45);
    background: var(--mw-color-canvas);
}

html.theme-dark-preload body {
    --mw-color-canvas: #212121;
    --mw-color-surface: #2f2f2f;
    --mw-color-surface-subtle: #292929;
    --mw-color-surface-raised: #383838;
    --mw-color-surface-hover: #383838;
    --mw-color-border: #424242;
    --mw-color-border-strong: #505050;
    --mw-color-text: #f2f2f2;
    --mw-color-text-muted: #b4b4b4;
    --mw-color-text-subtle: #8e8e8e;
    --mw-color-accent: #3b82f6;
    --mw-color-accent-hover: #2563eb;
    --mw-color-accent-soft: rgba(59, 130, 246, 0.12);
    --mw-color-sidebar-surface: #171717;
    --mw-color-sidebar-surface-raised: #242424;
    --mw-color-sidebar-text: #f2f2f2;
    --mw-color-sidebar-muted: #b4b4b4;
    --mw-color-focus-ring: rgba(59, 130, 246, 0.32);
    --mw-color-success: #3fb950;
    --mw-color-warning: #d29922;
    --mw-color-danger: #f85149;
    --mw-elevation-1: 0 8px 24px rgba(0, 0, 0, 0.16);
    --mw-elevation-2: 0 16px 36px rgba(0, 0, 0, 0.22);
    --mw-bg: var(--mw-color-canvas);
    --mw-card-bg: var(--mw-color-surface);
    --mw-border: var(--mw-color-border);
    --mw-text: var(--mw-color-text);
    --mw-muted: var(--mw-color-text-muted);
    --mw-shadow: var(--mw-elevation-2);
    --mw-sidebar-bg: var(--mw-color-sidebar-surface);
    --mw-sidebar-bg-2: var(--mw-color-sidebar-surface-raised);
    --mw-surface-shadow: var(--mw-elevation-2);
    --mw-progress-track: rgba(71, 85, 105, 0.45);
    color: var(--mw-text);
    background: var(--mw-color-canvas);
}

a {
    text-decoration: none;
}

.app-shell {
    --sidebar-width: 248px;
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    background: var(--mw-bg);
    transition: grid-template-columns 0.2s ease;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1.6rem 1rem 1rem;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.32), transparent 30%),
        linear-gradient(180deg, var(--mw-sidebar-bg) 0%, var(--mw-sidebar-bg-2) 100%);
    color: var(--mw-color-on-accent);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    transition: width 0.2s ease, padding 0.2s ease;
    z-index: 10;
}

.sidebar-brand {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.15rem 0.4rem 0.1rem;
}

.sidebar-brand-copy {
    min-width: 0;
    flex: 1;
}

.brand-mark {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.95rem;
    color: var(--workspace-accent, #22c55e);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.workspace-brand-mark {
    color: var(--workspace-accent, #22c55e);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.workspace-brand-mark i,
.workspace-brand-mark i::before {
    color: var(--workspace-accent, #22c55e);
}

.brand-mark-professionnel {
    color: inherit;
}

.brand-mark-personnel {
    color: inherit;
}

.brand-mark-brouillons {
    color: inherit;
}

.brand-mark-archive {
    color: inherit;
}

.sidebar-brand strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-brand span,
.sidebar-footer small {
    display: block;
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.66);
}

.workspace-switcher {
    margin: 0.35rem 0 0;
}

.workspace-current {
    width: auto;
    max-width: 100%;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    border-radius: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    box-shadow: none;
    font-size: 0.92rem;
}

.workspace-current::after {
    margin-left: 0.35rem;
}

.workspace-menu {
    width: 220px;
    border: 0;
    border-radius: 1rem;
    padding: 0.5rem;
    margin-top: 0.45rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.workspace-menu li form {
    margin: 0;
}

.workspace-menu .dropdown-item {
    border-radius: 0.8rem;
    padding: 0.7rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 500;
}

.workspace-menu .dropdown-item.active,
.workspace-menu .dropdown-item:active {
    background: #eff6ff;
    color: #1d4ed8;
}

.workspace-menu .dropdown-divider {
    margin: 0.45rem 0;
    border-top-color: rgba(148, 163, 184, 0.18);
}

.workspace-option-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--mw-color-on-accent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--workspace-accent, #2563eb) 78%, #ffffff 22%) 0%, var(--workspace-accent, #2563eb) 100%);
    box-shadow: 0 10px 22px color-mix(in srgb, var(--workspace-accent, #2563eb) 22%, transparent);
}

.brand-mark i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1.05rem;
}

.workspace-menu-action {
    color: #0f172a;
}

.workspace-modal-dialog {
    width: min(560px, 92vw);
    max-width: min(560px, 92vw);
}

.workspace-manage-dialog {
    width: min(940px, 94vw);
    max-width: min(940px, 94vw);
}

.workspace-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.workspace-color-option {
    cursor: pointer;
    margin: 0;
}

.workspace-color-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.workspace-color-swatch {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    display: inline-flex;
    border: 3px solid transparent;
    background: linear-gradient(180deg, color-mix(in srgb, var(--workspace-accent, #2563eb) 78%, #ffffff 22%) 0%, var(--workspace-accent, #2563eb) 100%);
    box-shadow: 0 10px 18px color-mix(in srgb, var(--workspace-accent, #2563eb) 20%, transparent);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.workspace-color-option:hover .workspace-color-swatch,
.workspace-color-input:checked + .workspace-color-swatch {
    transform: scale(1.06);
    border-color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.workspace-manage-list {
    display: grid;
    gap: 0.75rem;
}

.workspace-manage-head,
.workspace-manage-row {
    display: grid;
    grid-template-columns: minmax(280px, 2.25fr) minmax(210px, 1.4fr) minmax(90px, 0.8fr) minmax(150px, auto);
    gap: 0.9rem;
    align-items: center;
}

.workspace-manage-head {
    padding: 0 0.2rem;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.workspace-manage-head-color,
.workspace-manage-head-projects {
    text-align: center;
}

.workspace-manage-head-actions {
    text-align: right;
}

.workspace-manage-row {
    padding: 0.95rem 1rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.88);
    min-height: 5rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.workspace-manage-name {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.workspace-drag-handle {
    width: 2rem;
    height: 2rem;
    border: 0;
    padding: 0;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
    cursor: grab;
    flex: 0 0 auto;
}

.workspace-drag-handle:active {
    cursor: grabbing;
}

.workspace-manage-row.is-dragging {
    opacity: 0.72;
    transform: scale(0.995);
}

.workspace-manage-row.is-drop-target {
    border-color: rgba(37, 99, 235, 0.46);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.workspace-manage-name strong {
    display: block;
    color: #0f172a;
}

.workspace-manage-meta,
.workspace-manage-count,
.workspace-delete-note {
    color: #64748b;
    font-size: 0.92rem;
}

.workspace-manage-count {
    text-align: center;
}

.workspace-color-dot {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    display: inline-flex;
    background: var(--workspace-accent, #2563eb);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--workspace-accent, #2563eb) 16%, transparent);
}

.workspace-manage-color-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.workspace-manage-color-form {
    width: 100%;
    margin: 0;
}

.workspace-manage-inline-palette {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.workspace-color-option-sm .workspace-color-swatch-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.14);
}

.workspace-color-option-sm:hover .workspace-color-swatch-sm,
.workspace-color-option-sm .workspace-color-input:checked + .workspace-color-swatch-sm {
    transform: scale(1.12);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--workspace-accent, #2563eb) 18%, transparent);
}

.workspace-manage-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    min-width: 0;
}

.workspace-delete-note {
    margin-top: 0.9rem;
}

body.theme-dark .workspace-menu .dropdown-item.active,
body.theme-dark .workspace-menu .dropdown-item:active {
    background: rgba(37, 99, 235, 0.18);
    color: #dbeafe;
}

body.theme-dark .workspace-menu-action {
    color: #e2e8f0;
}

body.theme-dark .workspace-color-option:hover .workspace-color-swatch,
body.theme-dark .workspace-color-input:checked + .workspace-color-swatch {
    border-color: rgba(15, 23, 42, 0.95);
}

body.theme-dark .workspace-manage-head,
body.theme-dark .workspace-manage-meta,
body.theme-dark .workspace-manage-count,
body.theme-dark .workspace-delete-note {
    color: #94a3b8;
}

body.theme-dark .workspace-manage-row {
    background: rgba(15, 23, 42, 0.54);
    border-color: rgba(51, 65, 85, 0.9);
}

body.theme-dark .workspace-manage-name strong {
    color: #f8fafc;
}

body.theme-dark .workspace-drag-handle {
    background: rgba(51, 65, 85, 0.7);
    color: #cbd5e1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.78rem 0.9rem;
    border-radius: 0.95rem;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    position: relative;
}

.menu-badge {
    margin-left: auto;
    min-width: 1.4rem;
    height: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.menu-badge.is-hidden {
    display: none;
}

.menu-badge-info {
    background: #2563eb;
}

.nav-link:hover,
.nav-link.is-active {
    color: #fff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.96), rgba(59, 130, 246, 0.92));
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.sidebar-footer {
    margin-top: auto;
    padding: 0.35rem 0.35rem 0;
    display: grid;
    gap: 0.65rem;
}

.sidebar-footer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.sidebar-user-chip {
    width: 100%;
    justify-content: flex-start;
    padding: 0.45rem 0.6rem 0.45rem 0.4rem;
    background: linear-gradient(180deg, rgba(40, 58, 84, 0.98), rgba(24, 39, 60, 0.98));
    border-color: rgba(148, 163, 184, 0.16);
    color: #fff;
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.24);
}

.sidebar-user-chip .avatar {
    background: #eff6ff;
    color: #2563eb;
}

.sidebar-user-chip span {
    color: #f8fbff;
}

.sidebar-user-chip-arrow {
    margin-left: auto;
    color: #b7c5d9;
    font-size: 0.82rem;
}

.sidebar-user-chip:hover,
.sidebar-user-chip.is-active {
    background: linear-gradient(180deg, rgba(52, 76, 110, 0.98), rgba(31, 51, 79, 0.98));
    border-color: rgba(59, 130, 246, 0.26);
    transform: translateY(-1px);
}

body.theme-dark .sidebar-user-chip {
    background: linear-gradient(180deg, rgba(40, 58, 84, 0.98), rgba(24, 39, 60, 0.98));
    border-color: rgba(148, 163, 184, 0.14);
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.26);
}

body.theme-dark .sidebar-user-chip span,
body.theme-dark .sidebar-user-chip-arrow {
    color: #f8fbff;
}

body.theme-dark .sidebar-user-chip:hover,
body.theme-dark .sidebar-user-chip.is-active {
    background: linear-gradient(180deg, rgba(52, 76, 110, 0.98), rgba(31, 51, 79, 0.98));
    border-color: rgba(59, 130, 246, 0.26);
}

.sidebar-theme-button {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    border-radius: 0.95rem;
    min-height: 2.9rem;
    padding: 0.7rem 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sidebar-theme-button:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.35);
}

.sidebar-utility-button {
    justify-content: center;
    padding: 0.7rem;
    gap: 0;
}

.sidebar-utility-button i {
    font-size: 1.05rem;
}

.sidebar-spotlight-button {
    justify-content: center;
}

.sidebar-theme-toggle-button {
    position: relative;
}

.project-card-shared {
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.92));
}

.form-static {
    min-height: 46px;
    display: flex;
    align-items: center;
}

.modal-subtitle {
    color: var(--mw-muted);
    font-size: 0.92rem;
}

.share-invite-form {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.8fr) auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

.share-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.share-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--mw-border);
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.9);
}

.share-owner {
    background: rgba(239, 246, 255, 0.9);
}

.share-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.share-actions form {
    margin: 0;
}

.app-main {
    padding: 1.4rem 1.5rem 6.25rem;
    transition: padding-right 0.25s ease;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.menu-toggle,
.icon-button {
    border: 1px solid var(--mw-border);
    background: var(--mw-card-bg);
    color: var(--mw-text);
    border-radius: 1rem;
    width: 2.85rem;
    height: 2.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--mw-shadow);
}

.menu-toggle {
    display: none;
}

.search-wrapper {
    position: relative;
}

.global-search-wrapper {
    max-width: 820px;
}

.spotlight-search-shell[hidden] {
    display: none !important;
}

.spotlight-search-shell {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: grid;
    align-items: start;
    justify-items: center;
    padding-top: 1.35rem;
}

body.spotlight-open {
    overflow: hidden;
}

.spotlight-search-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(226, 232, 240, 0.32);
    backdrop-filter: blur(8px);
}

.spotlight-search {
    position: relative;
    z-index: 1;
    width: min(92vw, 820px);
}

.spotlight-search .global-search-wrapper {
    max-width: none;
}

.search-wrapper > i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-wrapper input {
    width: 100%;
    border: 1px solid var(--mw-border);
    background: var(--mw-card-bg);
    color: var(--mw-text);
    border-radius: 1rem;
    min-height: 3rem;
    padding: 0.85rem 4.75rem 0.85rem 2.8rem;
    box-shadow: var(--mw-shadow);
}

.search-shortcut {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.18rem 0.45rem;
    border-radius: 0.5rem;
    background: #eef2ff;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 600;
}

.global-search-panel {
    position: absolute;
    top: calc(100% + 0.7rem);
    left: 0;
    width: 100%;
    background: var(--mw-card-bg);
    border: 1px solid var(--mw-border);
    border-radius: 1.2rem;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
    z-index: 1090;
    padding: 0.6rem;
}

.app-toast-stack {
    position: fixed;
    top: 5.5rem;
    right: 1.6rem;
    z-index: 1040;
    display: grid;
    gap: 0.75rem;
    width: min(92vw, 360px);
}

.app-toast {
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    background: #fff;
    border: 1px solid var(--mw-border);
    border-left: 4px solid #2563eb;
    border-radius: 1rem;
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.16);
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-toast.is-leaving {
    opacity: 0;
    transform: translateY(-8px);
}

.app-toast-success {
    border-left-color: #22c55e;
}

.app-toast-info {
    border-left-color: #3b82f6;
}

.app-toast-warning {
    border-left-color: #f59e0b;
}

.app-toast-error {
    border-left-color: #ef4444;
}

.app-toast-body {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.95rem 1rem 1rem;
}

.app-toast-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    flex: 0 0 auto;
}

.app-toast-success .app-toast-icon {
    background: #dcfce7;
    color: #16a34a;
}

.app-toast-warning .app-toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.app-toast-error .app-toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.app-toast-copy {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
    flex: 1;
}

.app-toast-copy strong {
    font-size: 0.95rem;
}

.app-toast-copy span {
    color: var(--mw-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.app-toast .btn-close {
    margin-top: 0.05rem;
}

.app-toast-progress {
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: rgba(37, 99, 235, 0.18);
    transform-origin: left center;
    animation: appToastProgress 3.8s linear forwards;
}

.app-toast-success .app-toast-progress {
    background: rgba(34, 197, 94, 0.2);
}

.app-toast-warning .app-toast-progress {
    background: rgba(245, 158, 11, 0.24);
}

.app-toast-error .app-toast-progress {
    background: rgba(239, 68, 68, 0.22);
}

body.theme-dark .app-toast {
    background: rgba(17, 28, 45, 0.96);
    border-color: rgba(51, 67, 95, 0.9);
    box-shadow: 0 20px 42px rgba(2, 6, 23, 0.34);
}

body.theme-dark .app-toast-copy strong {
    color: #f3f7ff;
}

body.theme-dark .app-toast-copy span {
    color: #b7c5d9;
}

body.theme-dark .app-toast .btn-close {
    filter: invert(1) opacity(0.85);
}

@keyframes appToastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.global-search-section {
    display: grid;
    gap: 0.25rem;
}

.global-search-section + .global-search-section {
    margin-top: 0.5rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--mw-border);
}

.global-search-section h3 {
    margin: 0;
    padding: 0.15rem 0.4rem 0.35rem;
    color: var(--mw-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.global-search-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.95rem;
    color: var(--mw-text);
}

.global-search-result:hover,
.global-search-result.is-active {
    background: color-mix(in srgb, var(--mw-card-bg) 82%, var(--mw-primary) 18%);
}

.global-search-result-icon {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: #eff6ff;
    color: var(--mw-primary);
    flex: 0 0 auto;
}

.brand-mark i,
.stat-icon i,
.project-page-icon i,
.project-tab-icon i,
.service-glyph i,
.global-search-result-icon i {
    width: 1em;
    height: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.brand-mark i::before,
.stat-icon i::before,
.project-page-icon i::before,
.project-tab-icon i::before,
.service-glyph i::before,
.global-search-result-icon i::before {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.global-search-result-copy {
    min-width: 0;
    display: grid;
}

.global-search-result-title,
.global-search-result-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-result-title {
    color: var(--mw-text);
}

.global-search-result-subtitle,
.global-search-empty {
    color: var(--mw-muted);
    font-size: 0.88rem;
}

.global-search-result-badge {
    margin-left: auto;
    color: var(--mw-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.global-search-empty {
    padding: 0.9rem 0.8rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.45rem 0.35rem 0.35rem;
    background: var(--mw-card-bg);
    border: 1px solid var(--mw-border);
    border-radius: 999px;
    box-shadow: var(--mw-shadow);
}

.user-chip span {
    font-size: 0.9rem;
    font-weight: 600;
}

.sidebar-user-chip.user-chip {
    background: linear-gradient(180deg, rgba(40, 58, 84, 0.98), rgba(24, 39, 60, 0.98));
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.24);
}

.sidebar-user-chip.user-chip span {
    color: #f8fbff;
}

.avatar {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 0.85rem;
    font-weight: 700;
}

.page-content {
    display: grid;
    gap: 1.35rem;
}

.btn.is-loading {
    pointer-events: none;
    gap: 0.55rem;
}

.btn.is-loading .spinner-border {
    width: 0.95rem;
    height: 0.95rem;
}

.hero-card,
.card,
.panel,
.stat-card,
.info-card,
.project-card,
.note-card,
.login-card,
.empty-state {
    background: var(--mw-card-bg);
    border: 1px solid var(--mw-border);
    border-radius: var(--mw-radius);
    box-shadow: var(--mw-shadow);
}

.hero-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.65rem 1.75rem;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 34%),
        var(--mw-card-bg);
}

.hero-copy h1,
.section-header h1,
.empty-state h1 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.8rem, 2.2vw, 2.25rem);
    font-weight: 700;
}

.hero-copy p,
.section-header p,
.muted,
.sidebar-brand span,
.details-list dt,
.login-help span {
    color: var(--mw-muted);
}

.hero-wave {
    margin-left: 0.3rem;
}

.inline-alert {
    display: grid;
    gap: 0.2rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(245, 158, 11, 0.12);
    color: #9a6700;
}

.stats-grid,
.content-grid,
.project-cards,
.note-grid,
.search-grid,
.timeline-groups {
    display: grid;
    gap: 1.35rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.content-grid.two-up,
.search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card,
.card,
.panel,
.info-card,
.login-card,
.empty-state,
.project-card,
.note-card {
    padding: 1.4rem;
}

.empty-state {
    display: grid;
    gap: 0.55rem;
    justify-items: start;
}

.empty-state p {
    margin: 0;
    color: var(--mw-muted);
    line-height: 1.6;
}

.empty-state h3 {
    margin: 0;
    font-size: 1.2rem;
}

.empty-state-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.2rem;
}

.stat-top,
.section-header,
.section-heading,
.filters-row,
.card-actions,
.table-actions,
.project-meta,
.quick-tabs,
.details-list div,
.tabs,
.timeline-list li,
.link-list li,
.project-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 88px;
    padding: 0.95rem 1.1rem;
    gap: 0.4rem;
}

[data-card-link] {
    cursor: pointer;
}

.stat-headline {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.stat-card strong {
    display: block;
    margin: 0;
    font-size: 1.75rem;
    line-height: 1;
}

.stat-label {
    color: var(--mw-muted);
    font-weight: 600;
    line-height: 1.2;
}

.stat-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    flex: 0 0 auto;
}

.stat-icon.is-blue,
.service-glyph.is-blue {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.stat-icon.is-amber,
.service-glyph.is-amber {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.stat-icon.is-violet,
.service-glyph.is-violet {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}

.stat-icon.is-green,
.service-glyph.is-green {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.stat-icon.is-cyan,
.service-glyph.is-cyan {
    background: rgba(6, 182, 212, 0.12);
    color: #0891b2;
}

.stat-icon.is-dark,
.service-glyph.is-dark {
    background: rgba(15, 23, 42, 0.08);
    color: #111827;
}

.stat-icon.is-slate,
.service-glyph.is-slate {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.stat-card small {
    display: block;
    padding-left: 3.1rem;
    margin: 0;
    color: var(--mw-muted);
    line-height: 1.25;
    text-align: right;
}

.project-list,
.simple-list,
.timeline-list,
.link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.project-list-compact,
.link-list-compact {
    gap: 0.8rem;
}

.project-list li,
.timeline-list li,
.link-list li {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--mw-border);
}

.project-list-compact li,
.link-list-compact li {
    padding-bottom: 0.8rem;
}

.project-list li:last-child,
.timeline-list li:last-child,
.link-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.item-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-main strong,
.project-list strong,
.timeline-list strong,
.link-list strong,
.note-card h3,
.project-card h3 {
    display: block;
    margin-bottom: 0.2rem;
}

.item-main span,
.project-list span,
.timeline-list span,
.link-list span {
    display: block;
    color: var(--mw-muted);
    font-size: 0.9rem;
}

.line-clamp-1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dot,
.project-mini-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    margin-top: 0.45rem;
    flex: 0 0 auto;
}

.dot-danger {
    background: #ef4444;
}

.dot-muted {
    background: #cbd5e1;
}

.dot-dark {
    background: #111827;
}

.project-mini-dot {
    width: 0.7rem;
    height: 0.7rem;
}

.due-label {
    color: #ef4444;
    font-weight: 600;
}

.list-meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.7rem;
    padding: 0.34rem 0.68rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.badge-success {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.badge-success-soft {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.badge-warning,
.badge-warning-soft {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.badge-danger,
.badge-danger-soft {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.badge-info {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

.badge-muted {
    background: rgba(148, 163, 184, 0.14);
    color: #64748b;
}

.badge-dark {
    background: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

.btn-status-compact {
    min-height: 0;
    padding: 0.42rem 0.7rem;
    border-radius: 999px;
    font-size: 0.74rem;
    line-height: 1;
}

.app-form-field-clearable {
    position: relative;
}

.app-form-field-clearable input[data-clearable-date] {
    padding-right: 2.3rem;
}

.app-form-clear-button {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.4rem;
    height: 1.4rem;
    border: 0;
    border-radius: 999px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.14);
    color: #64748b;
}

body.theme-dark .app-form-clear-button {
    background: rgba(51, 65, 85, 0.78);
    color: #cbd5e1;
}

.filters-row {
    flex-wrap: wrap;
}

.filters-row-compact {
    gap: 0.75rem;
}

.filters-row input,
.filters-row select,
.filters-row button {
    min-height: 2.9rem;
}

.filters-row input,
.filters-row select {
    flex: 1 1 180px;
}

.filters-row-compact input,
.filters-row-compact select,
.filters-row-compact button {
    min-height: 2.65rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--mw-border);
    background: var(--mw-card-bg);
    color: var(--mw-text);
    border-radius: 1rem;
    padding: 0.85rem 0.95rem;
    font: inherit;
    line-height: 1.45;
    vertical-align: middle;
}

/*
 * Safari/WebKit conserve un rendu natif différent pour les <select> :
 * métriques de police, padding interne et flèches. On dessine uniquement
 * le contrôle fermé pour garder le menu natif accessible au clavier.
 */
select:not([multiple]):not([size]) {
    -webkit-appearance: none;
    appearance: none;
    min-height: var(--mw-control-height);
    padding-right: 2.75rem;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 1.05rem) 50%,
        calc(100% - 0.72rem) 50%;
    background-repeat: no-repeat;
    background-size: 0.42rem 0.42rem, 0.42rem 0.42rem;
}

select:disabled {
    cursor: not-allowed;
}

/* Bootstrap Icons utilise un décalage de baseline utile en texte courant,
 * mais incorrect dans les boutons et champs positionnés en flex. */
.bi::before {
    vertical-align: 0;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.12);
}

textarea {
    resize: vertical;
    overflow-wrap: anywhere;
    word-break: break-word;
}

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

.app-card-compact {
    padding: 1rem 1.15rem;
}

.form-group {
    display: grid;
    gap: 0.45rem;
}

.form-group label {
    font-size: 0.92rem;
    font-weight: 600;
}

.form-label-with-help {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.form-label-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    color: var(--mw-muted);
    font-size: 0.85rem;
    cursor: help;
}

.form-label-help:focus-visible {
    outline: 2px solid var(--mw-primary);
    outline-offset: 2px;
    border-radius: 999px;
}

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

.form-actions {
    justify-content: flex-end;
}

.checkbox-group {
    align-self: end;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.table-compact th,
.table-compact td {
    padding: 0.72rem 0.65rem;
}

.data-table th,
.data-table td {
    padding: 0.95rem 0.75rem;
    border-bottom: 1px solid var(--mw-border);
    vertical-align: top;
}

.data-table th {
    color: var(--mw-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quick-tabs {
    flex-wrap: wrap;
}

.quick-tabs-compact {
    gap: 0.55rem;
    padding-top: 0.25rem;
}

.quick-tabs a,
.category-sidebar a,
.tab-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
    border-radius: 0.9rem;
    color: var(--mw-muted);
}

.quick-tabs-compact a {
    padding: 0.55rem 0.2rem 0.65rem;
    border-radius: 0;
    border-bottom: 2px solid transparent;
}

.quick-tabs a.is-active,
.category-sidebar a.is-active,
.tab-link.is-active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--mw-primary);
}

.quick-tabs-compact a.is-active {
    background: transparent;
    border-bottom-color: var(--mw-primary);
}

.page-list {
    display: grid;
    gap: 0.9rem;
}

.table-actions-compact {
    gap: 0.45rem;
    justify-content: flex-end;
}

.table-status-select {
    min-width: 124px;
    min-height: 2.25rem;
    padding: 0.45rem 2rem 0.45rem 0.7rem;
    border-radius: 0.85rem;
    font-size: 0.85rem;
}

.icon-only {
    width: 2.2rem;
    height: 2.2rem;
    min-height: 2.2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--mw-control-radius) - 0.1rem);
}

.btn.icon-only i,
.btn.icon-only i::before {
    font-size: 0.92rem;
}

.app-dropdown-menu {
    border: 0;
    border-radius: 0.95rem;
    padding: 0.4rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    z-index: 1085;
}

.app-dropdown-menu .dropdown-item {
    border-radius: 0.75rem;
    padding: 0.58rem 0.75rem;
    font-weight: 500;
}

.app-dropdown-menu .dropdown-divider {
    margin: 0.35rem 0;
    border-top-color: rgba(148, 163, 184, 0.18);
}

.app-dropdown-menu .dropdown-item.danger-text,
.app-dropdown-menu .dropdown-item.text-danger {
    color: #dc2626;
}

.task-modal-content {
    border: 0;
    border-radius: 1.35rem;
    background: var(--mw-card-bg);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
}

.task-modal-content > .modal-header {
    padding: 1.15rem 1.25rem 0.95rem;
    border-bottom: 1px solid color-mix(in srgb, var(--mw-border) 82%, transparent);
}

.task-modal-content > .modal-body {
    padding: 1.15rem 1.25rem;
    background: inherit;
}

.project-task-modal-dialog {
    width: min(86vw, 1100px);
    max-width: min(86vw, 1100px);
}

.task-shared-indicator {
    display: inline-flex;
    align-items: center;
    color: var(--mw-color-text-muted);
    font-size: .78rem;
}

.note-editor-modal-dialog {
    width: min(75vw, 1100px);
    max-width: min(75vw, 1100px);
}

.app-modal {
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--mw-border) 92%, transparent);
    border-radius: 1.35rem;
    background: var(--mw-card-bg);
    box-shadow: var(--mw-surface-shadow);
}

.note-editor-modal-dialog .modal-content {
    max-height: 85vh;
}

.note-editor-modal-dialog .modal-body {
    overflow: auto;
}

.app-modal-header {
    padding: 1.15rem 1.25rem 0.95rem;
    border-bottom: 1px solid color-mix(in srgb, var(--mw-border) 82%, transparent);
}

.task-modal-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.task-modal-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.95rem;
    background: #e9f1ff;
    color: var(--mw-primary);
    font-size: 1.35rem;
    flex: 0 0 auto;
}

.task-modal-form input,
.task-modal-form select,
.task-modal-form textarea {
    min-height: var(--mw-control-height);
    border-radius: 1rem;
}

.app-modal .modal-body {
    padding: 1.15rem 1.25rem;
    background: inherit;
}

.app-modal .modal-footer {
    padding: 0.95rem 1.25rem 1.15rem;
    gap: 0.7rem;
    border-top: 1px solid color-mix(in srgb, var(--mw-border) 82%, transparent);
    background: inherit;
}

.app-form-field {
    position: relative;
}

.app-form-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    transform: translateY(-50%);
    color: #94a3b8;
    z-index: 1;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.app-form-icon .bi {
    display: block;
    line-height: 1;
}

.app-form-icon .bi,
.app-form-icon .bi::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

.project-modal-form .app-form-icon {
    top: 0;
    bottom: 0;
    height: auto;
    transform: none;
}

.app-form-field input,
.app-form-field select {
    padding-left: 2.7rem;
}

.app-form-field-with-action input {
    padding-right: 3rem;
}

.app-form-action {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #94a3b8;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease;
}

.app-form-action:hover {
    color: var(--mw-primary);
    background: rgba(37, 99, 235, 0.08);
}

.app-form-action:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.14);
}

.app-form-field-textarea .app-form-icon {
    top: 1rem;
    transform: none;
}

.app-form-field-textarea textarea {
    padding-left: 2.7rem;
    padding-top: 0.95rem;
}

.task-modal-form textarea {
    min-height: 112px;
}

.project-task-modal-dialog .app-form-icon,
.project-task-modal-dialog .app-form-icon .bi,
.project-task-modal-dialog .app-form-icon .bi::before {
    display: inline-flex;
    width: 1rem;
    height: 1rem;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

/* Le dessin du glyphe Bootstrap est optiquement un peu plus bas que le texte. */
.project-task-modal-dialog .app-form-icon {
    top: calc(50% - 6px);
    transform: translateY(-50%);
}

.project-task-modal-dialog .app-form-icon .bi::before {
    position: static;
}

.note-editor-form {
    gap: 0.9rem 1rem;
}

.note-editor-meta-grid {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(260px, 1.15fr);
    gap: 0.9rem 1rem;
    align-items: start;
}

.note-editor-meta-grid.has-visibility {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.note-editor-toggle-stack {
    display: grid;
    gap: 0.7rem;
    align-self: stretch;
}

.note-unlock-form {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
}

.note-locked-box {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.9rem;
    align-items: center;
    padding: 1rem 1.05rem;
    border: 1px solid rgba(59, 130, 246, 0.14);
    border-radius: 1rem;
    background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
}

.note-locked-box-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
    font-size: 0.95rem;
}

.note-locked-box-copy {
    min-width: 0;
}

.note-locked-box-copy strong {
    display: block;
    font-size: 0.96rem;
    color: #1e3a8a;
    margin-bottom: 0.22rem;
}

.note-locked-box-copy p {
    margin: 0;
    color: #4b5563;
    line-height: 1.45;
    font-size: 0.92rem;
}

.note-locked-box-actions {
    display: flex;
    justify-content: flex-end;
}

body.theme-dark .note-locked-box {
    border-color: rgba(51, 67, 95, 0.9);
    background: linear-gradient(180deg, rgba(17, 28, 45, 0.96) 0%, rgba(15, 24, 38, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

body.theme-dark .note-locked-box-icon {
    color: #ffffff;
    background: rgba(37, 99, 235, 0.22);
}

body.theme-dark .note-locked-box-copy strong {
    color: #dbe8ff;
}

body.theme-dark .note-locked-box-copy p {
    color: #a8b7cc;
}

.note-editor-static-badge {
    min-height: 2.9rem;
    display: flex;
    align-items: center;
}

.task-focus-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.2rem 0;
    cursor: pointer;
}

.task-focus-checkbox input {
    width: 1rem;
    min-height: 1rem;
    margin-top: 0.15rem;
}

.task-focus-checkbox span {
    display: grid;
    gap: 0.12rem;
}

.task-focus-checkbox strong {
    font-size: 0.96rem;
}

.task-focus-checkbox small {
    color: var(--mw-muted);
    font-size: 0.84rem;
}

.project-files-list {
    display: grid;
    gap: 0.9rem;
}

.project-file-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.05rem;
    border: 1px solid var(--mw-border);
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.88);
}

.project-file-main {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    min-width: 0;
    flex: 1 1 auto;
}

.project-file-icon,
.project-files-empty-icon {
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf3ff;
    color: var(--mw-primary);
    font-size: 1.15rem;
    flex: 0 0 auto;
}

.project-file-copy {
    min-width: 0;
}

.project-file-copy strong {
    display: block;
    margin-bottom: 0.2rem;
}

.project-file-copy p {
    margin: 0 0 0.45rem;
    color: var(--mw-muted);
}

.project-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
    color: var(--mw-muted);
    font-size: 0.85rem;
}

.project-file-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
}

.project-files-empty {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 0.55rem;
    padding: 1.75rem 1rem;
    color: var(--mw-muted);
}

@media (max-width: 900px) {
    .project-file-card {
        flex-direction: column;
    }

    .project-file-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.users-table-profile {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.users-table-card,
.users-table-responsive {
    overflow: visible;
}

.users-table td,
.users-table th {
    overflow: visible;
}

.users-table .dropdown-menu {
    z-index: 1080;
}

.users-table td:last-child,
.users-table th:last-child {
    width: 92px;
    text-align: center;
}

.users-table-avatar {
    width: 2.8rem;
    height: 2.8rem;
    font-size: 1rem;
    flex: 0 0 auto;
}

.users-table-copy {
    display: grid;
    gap: 0.12rem;
}

.users-table-copy strong {
    font-size: 1rem;
}

.users-table-copy small,
.table-footer-note {
    color: var(--mw-muted);
}

.table-footer-note {
    padding-top: 1rem;
    font-size: 0.92rem;
}

.settings-tabs {
    display: flex;
    gap: 1.7rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--mw-color-border);
    margin: 0 0 1.5rem;
    scrollbar-width: none;
}

.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    flex: 0 0 auto;
    padding: .8rem .15rem 1rem;
    border-bottom: 3px solid transparent;
    color: var(--mw-color-text-muted);
    font-weight: 650;
}
.settings-tab:hover, .settings-tab.is-active { color: var(--mw-color-accent); }
.settings-tab.is-active { border-bottom-color: var(--mw-color-accent); }
.settings-content { display: grid; gap: 1.35rem; max-width: 980px; }
.settings-panel { display: grid; gap: 1.35rem; padding: clamp(1.35rem, 3vw, 2rem); border: 1px solid var(--mw-color-border); box-shadow: var(--mw-elevation-1); }
.settings-panel-heading { display: flex; align-items: center; gap: 1rem; }
.settings-panel-heading h2 { margin: 0; font-size: 1.22rem; }
.settings-panel-heading p { margin: .25rem 0 0; color: var(--mw-color-text-muted); }
.settings-panel-icon { display: inline-flex; align-items: center; justify-content: center; width: 3.15rem; height: 3.15rem; border-radius: 1rem; font-size: 1.3rem; flex: 0 0 auto; }
.settings-panel-icon--account, .settings-panel-icon--preferences { color: #4f46e5; background: #f0edff; }
.settings-panel-icon--security { color: #16a34a; background: #eaf9ef; }
.settings-panel-icon--integrations { color: #7c3aed; background: #f2eaff; }
.settings-panel-icon--session { color: #dc2626; background: #fff0f0; }

.settings-account-card {
    display: grid;
    gap: 1rem;
}

.settings-account-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.settings-account-avatar {
    width: 4.6rem;
    height: 4.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 1.8rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.settings-account-copy {
    display: grid;
    gap: 0.18rem;
}

.settings-account-copy strong {
    font-size: 1.5rem;
}

.settings-account-copy span,
.settings-help-text {
    color: var(--mw-muted);
}

.settings-form { display: grid; gap: 1.15rem; max-width: 760px; }
.settings-form input, .settings-password-form input { width: 100%; min-height: var(--mw-control-height); padding: .65rem .85rem; border: 1px solid var(--mw-color-border); border-radius: var(--mw-control-radius); background: var(--mw-color-surface); color: var(--mw-color-text); }
.settings-form input:focus, .settings-password-form input:focus { outline: 3px solid var(--mw-color-focus-ring); border-color: var(--mw-color-accent); }
.settings-form-actions { display: flex; justify-content: flex-end; padding-top: .25rem; }
.settings-session-panel { gap: 1rem; }
.settings-session-row { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 1.05rem 1.15rem; border: 1px solid var(--mw-color-border); border-radius: var(--mw-radius-md); }
.settings-session-details { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.settings-session-details div, .settings-password-summary div { display: grid; gap: .25rem; }
.settings-session-details small, .settings-password-summary small, .settings-password-form small { color: var(--mw-color-text-muted); }
.settings-session-details strong, .settings-password-summary strong { font-weight: 600; }
.settings-password-summary { display: flex; align-items: center; gap: clamp(1.5rem, 7vw, 6rem); padding: 1.15rem 1.25rem; border: 1px solid var(--mw-color-border); border-radius: var(--mw-radius-md); }
.settings-password-summary button { margin-left: auto; }
.settings-preference-list { border-top: 1px solid var(--mw-color-border); }
.settings-preference-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--mw-color-border); }
.settings-preference-item div { display: grid; gap: .25rem; }
.settings-preference-item span { color: var(--mw-color-text-muted); }
.settings-coming-soon { font-size: .86rem; }
.settings-password-form { display: grid; gap: 1rem; }

.settings-help-text {
    font-size: 0.88rem;
}

.settings-status-list dd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
}

.settings-inline-note,
.settings-backup-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
}

.settings-inline-note {
    background: #eff6ff;
    color: #2563eb;
}

.settings-backup-note {
    background: #ecfdf3;
    color: #166534;
}

.settings-session-card {
    display: grid;
    gap: 0.95rem;
}

.settings-session-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    padding-top: 0.1rem;
}

.color-dot {
    position: relative;
    display: inline-flex;
}

.color-dot input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.color-dot span {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: var(--dot-color);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.color-dot.is-selected span,
.color-dot input:checked + span {
    outline: 3px solid rgba(37, 99, 235, 0.18);
    outline-offset: 3px;
}

.project-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
}

.project-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.95rem;
}

.project-color {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 1rem;
    flex: 0 0 auto;
}

.project-page-hero {
    margin-bottom: 0.4rem;
}

.project-page-icon.small {
    width: 2.7rem;
    height: 2.7rem;
    min-width: 2.7rem;
    border-radius: 0.95rem;
    font-size: 1.05rem;
}

.project-page-icon.small.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.project-stats-grid {
    margin-bottom: 0.9rem;
}

.task-stats-grid {
    margin-bottom: 0.9rem;
}

.compact-stats-grid {
    margin-bottom: 0.9rem;
}

.stat-card-compact {
    padding: 1rem 1.1rem;
    display: grid;
    gap: 0.55rem;
}

.stat-compact-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.stat-compact-main {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    min-width: 0;
}

.stat-compact-main strong {
    font-size: 2rem;
    line-height: 1;
}

.stat-compact-main span {
    font-weight: 600;
    color: var(--mw-text);
}

.stat-compact-meta {
    color: var(--mw-muted);
    font-size: 0.9rem;
    padding-left: 3.65rem;
}

.project-filters-row {
    align-items: center;
}

.project-view-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.project-card {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid rgba(229, 231, 235, 0.85);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.1);
    border-color: rgba(191, 219, 254, 0.95);
}

.project-card-headline {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    min-width: 0;
}

.project-card-headline-link,
.project-card-body-link {
    color: inherit;
    text-decoration: none;
}

.project-card-body-link {
    display: grid;
    gap: 1rem;
}

.project-card-headline h3 {
    margin: 0 0 0.28rem;
    font-size: 1.45rem;
}

.project-card-headline p {
    margin: 0;
    color: var(--mw-muted);
}

.project-card-actions-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.project-card-meta-grid {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--mw-muted);
    font-size: 0.93rem;
}

.project-card-meta-grid span {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.project-card-progress {
    display: grid;
    gap: 0.45rem;
}

.project-card-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.project-card-progress-header strong {
    margin: 0;
    font-size: 0.96rem;
}

.project-card-progress-header span,
.project-card-progress small {
    color: var(--mw-muted);
}

.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--mw-border);
}

.project-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--mw-primary);
    font-weight: 700;
}

.project-card-link i {
    transition: transform 0.2s ease;
}

.project-card-link:hover i {
    transform: translateX(3px);
}

.secrets-service-cell {
    min-width: 220px;
}

.secrets-service-cell.item-main {
    align-items: center;
}

.service-glyph {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    background: rgba(37, 99, 235, 0.08);
    color: var(--mw-primary);
    flex: 0 0 auto;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    overflow: visible;
}

.service-glyph i {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 0.95rem;
    margin: 0;
    padding: 0;
}

.service-glyph i::before {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    margin: 0;
}

.secrets-table-modern td {
    vertical-align: middle;
}

.secret-inline-value {
    min-width: 6.25rem;
    color: var(--mw-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.list-footer-meta {
    padding-top: 0.95rem;
    color: var(--mw-muted);
    font-size: 0.92rem;
}

.security-card,
.alert-card {
    padding: 1.2rem 1.25rem;
    border-radius: 1.35rem;
    border: 1px solid rgba(229, 231, 235, 0.9);
    background: var(--mw-card-bg);
    box-shadow: var(--mw-shadow);
}

.security-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.security-card-head h2 {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
}

.security-card-head p {
    margin: 0;
    color: var(--mw-muted);
    line-height: 1.6;
}

.alert-card-danger {
    border-color: rgba(248, 113, 113, 0.28);
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.92), rgba(255, 255, 255, 1));
}

.compact-empty-state {
    padding: 1.2rem 0.4rem;
}

.app-confirm-modal {
    border: 0;
    border-radius: 1.25rem;
    box-shadow: 0 28px 50px rgba(15, 23, 42, 0.22);
}

.app-confirm-modal .modal-body {
    padding: 1.35rem;
    display: grid;
    gap: 1rem;
}

.app-confirm-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.15rem;
}

.app-confirm-icon.is-danger {
    background: #fee2e2;
    color: #dc2626;
}

.app-confirm-icon.is-warning {
    background: #ffedd5;
    color: #ea580c;
}

.app-confirm-copy {
    display: grid;
    gap: 0.35rem;
}

.app-confirm-title {
    margin: 0;
    font-size: 1.12rem;
}

.app-confirm-message {
    margin: 0;
    color: var(--mw-muted);
    line-height: 1.5;
}

.app-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
}

.link-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.link-card-modern {
    gap: 0.95rem;
    padding: 1.15rem 1.2rem;
}

.link-card-modern .project-card-headline h3 {
    font-size: 1.2rem;
    margin-bottom: 0.24rem;
}

.link-card-url a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--mw-primary);
    font-weight: 600;
}

.link-card-url a::after {
    content: "\F1C5";
    font-family: "bootstrap-icons";
    font-size: 0.88rem;
}

.link-card-modern .project-card-footer {
    align-items: flex-end;
}

.journal-timeline-shell {
    gap: 1rem;
}

.journal-timeline-card {
    padding: 0;
    overflow: hidden;
}

.journal-day-group + .journal-day-group {
    border-top: 1px solid var(--mw-border);
}

.journal-day-heading {
    padding: 1rem 1.2rem;
    font-weight: 700;
    color: var(--mw-primary);
    background: rgba(37, 99, 235, 0.03);
}

.journal-events {
    display: grid;
}

.journal-event-row {
    display: grid;
    grid-template-columns: 58px 52px minmax(0, 1fr) 170px;
    gap: 0.9rem;
    align-items: start;
    padding: 1rem 1.2rem;
    color: inherit;
    border-top: 1px solid rgba(229, 231, 235, 0.8);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.journal-events .journal-event-row:first-child {
    border-top: 0;
}

.journal-event-row:hover {
    background: rgba(37, 99, 235, 0.04);
}

.journal-event-time {
    color: var(--mw-muted);
    font-weight: 600;
    padding-top: 0.5rem;
}

.journal-event-marker {
    position: relative;
    display: flex;
    justify-content: center;
    min-height: 100%;
}

.journal-event-marker::after {
    content: "";
    position: absolute;
    top: 2.5rem;
    bottom: -1.4rem;
    left: 50%;
    width: 1px;
    background: rgba(226, 232, 240, 0.95);
    transform: translateX(-50%);
}

.journal-event-row:last-child .journal-event-marker::after {
    display: none;
}

.journal-event-content {
    min-width: 0;
    display: grid;
    gap: 0.3rem;
    padding-top: 0.2rem;
}

.journal-event-project {
    color: var(--mw-muted);
    font-weight: 600;
    text-align: right;
    padding-top: 0.5rem;
}

.journal-event-side {
    display: grid;
    justify-items: end;
    gap: 0.55rem;
    padding-top: 0.35rem;
}

.journal-event-side-meta {
    color: var(--mw-muted);
    font-weight: 600;
    text-align: right;
}

.journal-event-side-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.journal-quick-tabs {
    margin-top: 0.35rem;
}


.notes-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.75rem;
}

.notes-layout-modern {
    align-items: start;
}

.notes-page-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    padding: 1.3rem 1.45rem;
    margin-bottom: 1.15rem;
}

.notes-page-hero-copy {
    max-width: none;
}

.notes-page-title-row {
    align-items: flex-start;
}

.notes-page-title-row > div {
    display: grid;
    gap: 0.32rem;
}

.notes-page-title-row p {
    margin: 0;
    color: var(--mw-muted);
    font-size: 1rem;
}

.notes-page-hero-actions {
    min-width: 0;
}

.notes-toolbar-card {
    margin-bottom: 1.35rem;
    padding: 0.8rem;
    border-radius: 1.5rem;
}

.notes-toolbar-form {
    gap: 0.9rem;
    flex-wrap: nowrap;
}

.notes-toolbar-form select {
    flex: 0 0 300px;
    min-width: 220px;
}

.notes-toolbar-search {
    flex: 1 1 auto;
    width: 100%;
}

.category-sidebar {
    align-self: start;
    position: sticky;
    top: 1.5rem;
}

.category-sidebar-modern {
    padding: 1.4rem;
    border-radius: 1.55rem;
    overflow: hidden;
}

.category-sidebar-modern .section-heading {
    margin-bottom: 1rem;
}

.category-sidebar-modern .section-heading h2 {
    font-size: 1.45rem;
}

.category-list {
    display: grid;
    gap: 0.5rem;
}

.category-list a {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
    padding: 1rem 1.05rem;
    border-radius: 1.1rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.category-list a span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.category-list a span:last-child {
    min-width: 1.8rem;
    height: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: inherit;
    font-size: 0.82rem;
    font-weight: 700;
}

.category-list a:hover {
    background: rgba(37, 99, 235, 0.06);
    color: var(--mw-primary);
    transform: translateX(2px);
}

.category-list a.is-active span:last-child {
    background: rgba(37, 99, 235, 0.15);
}

.note-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.note-grid > .note-card {
    align-self: start;
    height: auto;
}

.note-block {
    display: grid;
    grid-template-rows: min-content minmax(0, auto) min-content;
    gap: 1.1rem;
    align-content: start;
}

.note-card-modern {
    position: relative;
    min-height: 255px;
    padding: 1.4rem 1.45rem 1.2rem;
    border-radius: 1.55rem;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.note-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
    border-color: rgba(37, 99, 235, 0.18);
}

.note-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
}

.note-card-header h3 {
    margin-bottom: 0.35rem;
    font-size: 1.28rem;
    line-height: 1.3;
}

.note-card-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.note-pin-form {
    margin: 0;
}

.note-state-pin {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.note-state-pin:hover,
.note-state-pin.is-active {
    color: #ef4444;
}

.note-state-lock {
    color: #60a5fa;
}

.note-state-lock:hover,
.note-state-lock.is-active {
    color: #2563eb;
}

.note-state-pin:hover {
    transform: translateY(-1px);
}

.note-state-pin:focus-visible {
    outline: none;
    border-radius: 999px;
    box-shadow: 0 0 0 0.16rem rgba(239, 68, 68, 0.14);
}

.note-content-clamp {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-height: 1.75;
    min-height: 8rem;
}

.note-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: auto;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.note-card-meta .list-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.note-card-meta small {
    color: var(--mw-muted);
    font-size: 0.85rem;
    text-align: right;
}

.note-content {
    margin: 0;
    color: var(--mw-text);
    line-height: 1.65;
    white-space: normal;
}

.note-content > :first-child,
.rich-note-surface > :first-child {
    margin-top: 0;
}

.note-content > :last-child,
.rich-note-surface > :last-child {
    margin-bottom: 0;
}

.note-content p,
.rich-note-surface p {
    margin: 0;
}

.note-content p + p,
.rich-note-surface p + p {
    margin-top: 0.35rem;
}

.note-content ul,
.note-content ol,
.note-content blockquote,
.note-content pre,
.rich-note-surface ul,
.rich-note-surface ol,
.rich-note-surface blockquote,
.rich-note-surface pre {
    margin: 0.45rem 0;
}

.note-content li + li,
.rich-note-surface li + li {
    margin-top: 0.2rem;
}

.note-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 0.9rem 0;
}

.note-content,
.note-content-clamp,
.rich-note-surface,
.rich-note-source {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.note-content a {
    color: var(--mw-primary);
}

.rich-note-editor {
    position: relative;
    border: 1px solid color-mix(in srgb, var(--mw-border) 90%, white 10%);
    border-radius: 1rem;
    background: var(--mw-card-bg);
    overflow: hidden;
}

.rich-note-toolbar {
    display: none;
    align-items: center;
    gap: 0.35rem;
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid color-mix(in srgb, var(--mw-border) 86%, white 14%);
    background: color-mix(in srgb, var(--mw-card-bg) 94%, #f8fafc 6%);
    flex-wrap: wrap;
}

.rich-note-toolbar .btn {
    min-width: 2.2rem;
    height: 2.2rem;
    min-height: 2.2rem;
}

.rich-note-surface {
    display: none;
    min-height: min(52vh, 560px);
    padding: 1rem 1.05rem;
    outline: none;
    line-height: 1.7;
    background: transparent;
    color: var(--mw-text);
    overflow: auto;
}

.rich-note-editor-compact .rich-note-surface {
    min-height: min(30vh, 240px);
}

.rich-note-editor-compact .rich-note-source {
    min-height: 140px;
}

.rich-note-editor-compact .rich-note-surface:empty::before {
    content: "Décrivez la tâche… Vous pouvez aussi coller une capture d’écran.";
}

.rich-note-surface:empty::before {
    content: "Écrivez votre note ici… Vous pouvez aussi coller une image.";
    color: var(--mw-muted);
}

.rich-note-source {
    width: 100%;
    min-height: 220px;
    border: 0;
    background: transparent;
    color: var(--mw-text);
}

.note-editor-modal-dialog-create .rich-note-surface {
    min-height: min(42vh, 448px);
}

.note-editor-modal-dialog-create .rich-note-source {
    min-height: 176px;
}

.rich-note-status {
    display: none;
    padding: 0.7rem 1rem 0.9rem;
    font-size: 0.86rem;
    color: var(--mw-muted);
    border-top: 1px solid rgba(241, 245, 249, 0.95);
}

.rich-note-status.is-visible {
    display: block;
}

.rich-note-editor.is-ready .rich-note-toolbar,
.rich-note-editor.is-ready .rich-note-surface {
    display: flex;
}

.rich-note-editor.is-ready .rich-note-surface {
    display: block;
}

.rich-note-editor.is-ready .rich-note-source {
    display: none;
}

.rich-note-image-toolbar {
    position: absolute;
    top: 4.1rem;
    right: 1rem;
    z-index: 3;
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.rich-note-image-toolbar.is-visible {
    display: inline-flex;
}

.rich-note-image-toolbar .btn {
    min-width: auto;
    height: 2rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
}

.rich-note-image-toolbar .btn.is-active {
    background: rgba(37, 99, 235, 0.12);
    color: var(--mw-primary);
    border-color: rgba(37, 99, 235, 0.18);
}

.rich-note-surface img,
.note-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 0.8rem 0;
}

.rich-note-surface img.is-selected {
    outline: 2px solid rgba(37, 99, 235, 0.28);
    outline-offset: 3px;
}

.rich-note-surface img.note-img-25,
.note-content img.note-img-25 {
    width: 25%;
}

.rich-note-surface img.note-img-50,
.note-content img.note-img-50 {
    width: 50%;
}

.rich-note-surface img.note-img-75,
.note-content img.note-img-75 {
    width: 75%;
}

.rich-note-surface img.note-img-100,
.note-content img.note-img-100 {
    width: 100%;
}

.entry-heading,
.entry-badges {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.entry-heading {
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

.details-list {
    display: grid;
    gap: 0.85rem;
    margin: 0;
}

.details-list dt,
.details-list dd {
    margin: 0;
}

.details-list dd {
    text-align: right;
}

.tabs {
    flex-wrap: wrap;
    margin-bottom: 0.2rem;
}

.project-page-header {
    align-items: flex-start;
    gap: 1rem;
}

.project-page-title {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.project-page-title h1 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0 0 0.3rem;
}

.project-page-title .badge {
    align-self: center;
}

.project-page-icon,
.project-tab-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0.06));
    color: var(--mw-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.project-tabs {
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.project-detail-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    padding: 1.35rem 1.45rem;
    margin-bottom: 1rem;
    border-radius: calc(var(--mw-surface-radius) + 0.1rem);
    box-shadow: var(--mw-surface-shadow);
}

.project-detail-hero-copy {
    max-width: none;
}

.project-identity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem 1rem;
    margin-top: .5rem;
    color: var(--mw-muted);
    font-size: .78rem;
}

.project-identity-meta span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.project-detail-title-wrap {
    align-items: flex-start;
}

.project-detail-hero-visual {
    min-width: 0;
}

.project-detail-hero-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.project-detail-title-wrap .breadcrumb {
    margin: 0 0 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--mw-muted);
}

.project-detail-title-wrap .breadcrumb span {
    opacity: 0.65;
}

.project-detail-hero-actions .btn,
.project-detail-hero-actions > a.btn {
    min-height: var(--mw-control-height-sm);
}

.project-detail-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.2rem;
    align-items: start;
}

.project-detail-sidebar {
    position: sticky;
    top: 1.5rem;
    align-self: start;
}

.project-detail-main {
    min-width: 0;
}

.project-tabs-ribbon {
    display: grid;
    gap: 0.35rem;
    width: 100%;
    padding: 0.55rem;
    margin-bottom: 1.2rem;
    border-radius: var(--mw-surface-radius);
    border: 1px solid color-mix(in srgb, var(--mw-border) 92%, transparent);
    box-shadow: var(--mw-surface-shadow);
}

.project-tabs .tab-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    justify-content: flex-start;
    min-height: 3rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    color: inherit;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.project-tabs .tab-link i {
    width: 1rem;
    text-align: center;
    font-size: 1rem;
}

.project-tabs-ribbon .tab-link:hover {
    background: rgba(248, 250, 252, 0.96);
    transform: translateY(-1px);
}

.project-tabs-ribbon .tab-link.is-active {
    background: rgba(248, 250, 252, 0.98);
    color: var(--mw-primary);
    box-shadow: inset 0 -4px 0 #2563eb;
}

.project-tab-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-tab-header .btn,
.project-tab-header > a.btn,
.tasks-hero-actions .btn,
.tasks-hero-actions > a.btn {
    min-height: var(--mw-control-height-sm);
    padding: 0.52rem 0.95rem;
}

.project-tab-header .btn.icon-only,
.tasks-hero-actions .btn.icon-only {
    padding: 0;
}

.project-tab-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.project-tab-heading.compact {
    margin-bottom: 1rem;
}

.project-tab-heading h2,
.project-summary-card h2 {
    margin: 0 0 0.2rem;
}

.project-tab-heading p,
.project-summary-card p,
.project-page-title p,
.project-tab-note {
    margin: 0;
    color: var(--mw-muted);
}

.project-summary-card {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding: 1.35rem;
    border-radius: var(--mw-surface-radius);
    border: 1px solid color-mix(in srgb, var(--mw-border) 92%, transparent);
    box-shadow: var(--mw-surface-shadow);
}

.project-overview-summary {
    margin-bottom: 1.2rem;
}

.project-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.8rem;
}

.project-summary-stats-ribbon {
    gap: 0;
    padding: 0.35rem;
    border-radius: calc(var(--mw-surface-radius) - 0.05rem);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 14px 34px rgba(148, 163, 184, 0.1);
}

.project-summary-stat {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    min-height: 5.15rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 0;
    background: transparent;
    position: relative;
}

.project-summary-stats-ribbon .project-summary-stat:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18%;
    right: 0;
    width: 1px;
    height: 64%;
    background: rgba(226, 232, 240, 0.9);
}

.project-summary-stats-ribbon .project-summary-stat.is-active {
    background: rgba(248, 250, 252, 0.98);
    box-shadow: inset 0 -4px 0 #2563eb;
}

.project-summary-stat-icon {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    background: #eff6ff;
    color: var(--mw-primary);
    flex: 0 0 auto;
}

.project-summary-stat strong,
.project-progress-header strong {
    display: block;
    margin: 0 0 0.15rem;
}

.project-summary-stat span,
.project-progress-header span {
    color: var(--mw-muted);
    font-size: 0.92rem;
}

.tone-status .project-summary-stat-icon {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.tone-task .project-summary-stat-icon {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

.tone-reminder .project-summary-stat-icon {
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
}

.tone-note .project-summary-stat-icon {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.tone-link .project-summary-stat-icon {
    background: rgba(14, 165, 233, 0.12);
    color: #0ea5e9;
}

.project-progress-card {
    padding: 1rem 1.05rem 1.05rem;
    border-radius: var(--mw-surface-radius-sm);
    border: 1px solid var(--mw-border);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.94), rgba(255, 255, 255, 0.98));
}

.project-progress-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.project-progress-bar {
    width: 100%;
    height: 0.72rem;
    border-radius: 999px;
    background: var(--mw-progress-track);
    overflow: hidden;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.08);
}

.project-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
}

.project-overview-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.project-overview-card {
    min-width: 0;
    border-radius: var(--mw-surface-radius);
    border: 1px solid color-mix(in srgb, var(--mw-border) 92%, transparent);
    box-shadow: var(--mw-surface-shadow);
}

.project-overview-card-wide {
    grid-column: 1 / -1;
}

.project-overview-card-soft {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.03));
}

.project-overview-card .section-heading {
    align-items: flex-start;
    margin-bottom: 0.05rem;
}

.project-overview-card .section-heading h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    font-size: 1.04rem;
}

.project-overview-card .section-heading h2 i {
    color: var(--mw-primary);
    font-size: 0.96rem;
}

.project-overview-card .section-heading a {
    flex: 0 0 auto;
    color: var(--mw-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.project-overview-card .card-actions {
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.project-note-grid {
    margin-top: 1.15rem;
    align-items: start;
}

.project-note-grid .note-card {
    display: flex;
    flex-direction: column;
    align-self: start;
    height: auto;
}

.project-note-grid .note-content,
.project-note-grid .note-locked-box {
    flex: 1 1 auto;
}

.project-summary-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.details-list-compact {
    gap: 0.75rem;
}

.details-list-compact div {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.8rem;
    align-items: start;
}

.details-list-compact dd {
    text-align: left;
}

.details-list-stacked div {
    grid-template-columns: 110px 1fr;
    gap: 0.65rem;
}

.table-item-title {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.project-mini-icon {
    width: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.12rem;
    flex: 0 0 auto;
}

.task-table-title {
    min-width: 220px;
}

.tasks-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    gap: 1.25rem;
    padding: 1.15rem 1.35rem 1rem;
    min-height: 186px;
    border-radius: 1.7rem;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.08);
}

.tasks-hero-copy,
.tasks-hero-visual {
    position: relative;
    z-index: 1;
}

.tasks-hero-copy {
    display: grid;
    align-content: start;
    align-self: start;
    gap: 0.4rem;
    max-width: 540px;
    padding-top: 0.05rem;
}

.tasks-hero-title-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

.tasks-hero-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0.08));
    color: #2563eb;
    font-size: 1.35rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.tasks-hero-copy h1 {
    margin: 0;
    font-size: clamp(1.8rem, 2.7vw, 2.7rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #0f172a;
    flex: 0 0 auto;
}

.tasks-hero-visual {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.projects-hero .tasks-hero-copy {
    max-width: none;
}

.projects-page-heading {
    align-items: flex-end;
    padding: 0.25rem 0 0;
}

.projects-page-heading h2 {
    margin: 0;
    color: var(--mw-color-text);
    font-size: clamp(1.7rem, 2.4vw, 2.25rem);
    letter-spacing: -0.04em;
}

.projects-page-heading p {
    margin: 0.4rem 0 0;
    color: var(--mw-color-text-muted);
}

.app-shell--foundation .projects-status-nav {
    gap: 0.15rem;
    min-height: 2.7rem;
    margin: 0 0 1.05rem;
}

.app-shell--foundation .projects-status-nav-link {
    gap: 0.45rem;
    min-height: 2.7rem;
    padding-inline: 0.85rem;
    font-size: 0.84rem;
}

.projects-status-nav-link i {
    color: var(--mw-color-text-subtle);
    font-size: 0.82rem;
}

.projects-status-nav-link small {
    color: var(--mw-color-text-subtle);
    font-size: 0.74rem;
    font-weight: 700;
}

.projects-status-nav-link:hover i,
.projects-status-nav-link.is-active i,
.projects-status-nav-link:hover small,
.projects-status-nav-link.is-active small {
    color: inherit;
}

.tasks-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
}

.task-stats-grid-mock {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.project-stats-ribbon {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 0;
}

.task-stats-floating {
    margin-top: -5.7rem;
    position: relative;
    z-index: 2;
}

.task-stats-ribbon {
    gap: 0;
    padding: 0.35rem;
    border-radius: 1.55rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 18px 50px rgba(148, 163, 184, 0.14);
}

.task-stat-card {
    min-height: 0;
    gap: 0.2rem;
    padding: 0.85rem 1rem 0.65rem;
    border-radius: 1.15rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    position: relative;
}

.task-stat-link {
    color: inherit;
    text-decoration: none;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.task-stat-link:hover {
    background: rgba(248, 250, 252, 0.96);
}

.task-stat-link.is-active {
    background: rgba(248, 250, 252, 0.98);
    box-shadow: inset 0 -4px 0 #2563eb;
}

.task-stat-link:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18%;
    right: 0;
    width: 1px;
    height: 64%;
    background: rgba(226, 232, 240, 0.9);
}

.task-stat-card .stat-top {
    align-items: center;
    justify-content: flex-start;
    gap: 0.8rem;
}

.task-stat-card .stat-headline {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.task-stat-card .stat-headline strong {
    order: 2;
    font-size: 0.9rem;
    line-height: 1;
    color: #64748b;
}

.task-stat-card small {
    display: none;
}

.task-stat-progress {
    display: none;
}

.task-stat-card .stat-icon {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 0.7rem;
    font-size: 0.9rem;
    flex: 0 0 auto;
}

.task-stat-card .stat-label {
    order: 1;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-icon.is-coral {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.tasks-table-card {
    border-radius: 1.55rem;
    background: var(--mw-color-surface);
    border-color: var(--mw-color-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tasks-search-field {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.8rem;
    padding: 0 0.95rem;
    border: 1px solid var(--mw-border);
    border-radius: 1rem;
    background: #fff;
}

.tasks-search-field i {
    color: #64748b;
}

.tasks-search-field input {
    min-height: 2.7rem;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.tasks-search-field input:focus {
    border: 0;
    box-shadow: none;
}

.tasks-hero-search-form {
    margin-left: auto;
    flex: 1 1 auto;
    justify-content: flex-end;
}

.tasks-hero-search-field {
    width: min(100%, 420px);
    margin-left: auto;
}

.tasks-table-card .data-table th {
    padding-top: 0.3rem;
}

.tasks-table-card .data-table tbody tr:last-child td {
    border-bottom: 0;
}

.tasks-table-card .data-table tbody tr:hover {
    background: var(--mw-color-surface-hover);
}

.task-row-copy {
    display: grid;
    gap: 0.18rem;
}

.task-row-copy strong {
    color: #1e293b;
    font-size: 1rem;
}

.task-project-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #334155;
    font-weight: 600;
}

.task-project-avatar {
    width: 2.55rem;
    height: 2.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: inset 0 0 0 1px rgba(191, 219, 254, 0.95);
}

.task-due-date {
    font-weight: 700;
}

.task-due-date.is-muted {
    color: #64748b;
}

.task-due-date.is-warning {
    color: #ea580c;
}

.task-due-date.is-overdue {
    color: #ef4444;
}

.tasks-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
    text-decoration: none;
    font: inherit;
}

.tasks-sort-link i {
    color: #94a3b8;
    font-size: 0.82rem;
}

.tasks-sort-link.is-active,
.tasks-sort-link:hover {
    color: var(--mw-primary);
}

.tasks-sort-link.is-active i,
.tasks-sort-link:hover i {
    color: var(--mw-primary);
}

body.theme-dark .tasks-hero {
    background: var(--mw-color-surface);
    border-color: var(--mw-color-border);
    box-shadow: none;
}

body.theme-dark .tasks-hero-copy h1,
body.theme-dark .task-stat-card .stat-label,
body.theme-dark .task-row-copy strong,
body.theme-dark .task-project-chip {
    color: var(--mw-color-text);
}

body.theme-dark .task-stat-card .stat-headline strong {
    color: var(--mw-color-text-muted);
}

body.theme-dark .tasks-search-field {
    background: var(--mw-color-surface-raised);
    border-color: var(--mw-color-border);
}

body.theme-dark .tasks-search-field i,
body.theme-dark .tasks-search-field input,
body.theme-dark .tasks-search-field input::placeholder {
    color: var(--mw-color-text-muted);
}

html.theme-dark-preload .notes-toolbar-search,
html.theme-dark-preload .notes-toolbar-search input,
body.theme-dark .notes-toolbar-search,
body.theme-dark .notes-toolbar-search input {
    background: var(--mw-color-surface-raised);
    color: var(--mw-color-text);
    border-color: var(--mw-color-border);
}

html.theme-dark-preload .notes-toolbar-search input::placeholder,
body.theme-dark .notes-toolbar-search input::placeholder {
    color: var(--mw-color-text-muted);
}

body.theme-dark .task-stats-ribbon {
    background: var(--mw-color-surface);
    border-color: var(--mw-color-border);
    box-shadow: none;
}

body.theme-dark .task-stat-link:hover {
    background: var(--mw-color-surface-raised);
}

body.theme-dark .task-stat-link.is-active {
    background: var(--mw-color-surface-raised);
    box-shadow: inset 0 -4px 0 #3b82f6;
}

body.theme-dark .task-stat-link:not(:last-child)::after {
    background: rgba(51, 67, 95, 0.9);
}

body.theme-dark .tasks-table-card {
    background: var(--mw-color-surface);
    border-color: var(--mw-color-border);
    box-shadow: none;
}

/* Tasks & reminders: compact, readable, independently selectable cards. */
.tasks-list-shell { position: relative; overflow: visible; padding: 0; background: transparent; border: 0; box-shadow: none; }
.tasks-table-card.tasks-list-shell, body.theme-dark .tasks-table-card.tasks-list-shell { background: transparent; border-color: transparent; box-shadow: none; }
.tasks-list-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 2.4rem; padding: 0.15rem 0.35rem 0.65rem; color: var(--mw-color-text-muted); font-size: .8rem; }
.tasks-list-shell > [data-bulk-toolbar]:not([hidden]) { position: absolute; z-index: 3; top: .15rem; right: .35rem; display: flex; flex-wrap: nowrap !important; align-items: center; gap: .45rem; width: max-content; min-width: max-content; margin: 0; padding: .2rem .35rem .2rem .65rem; border: 1px solid var(--mw-color-border); border-radius: .65rem; background: var(--mw-color-surface-raised); box-shadow: 0 8px 20px rgba(2, 6, 23, .16); font-size: .76rem; white-space: nowrap; }
.tasks-list-shell > [data-bulk-toolbar]:not([hidden]) select { min-height: 1.8rem; max-width: 8.5rem; padding-top: .2rem; padding-bottom: .2rem; font-size: .76rem; }
.tasks-list-shell > [data-bulk-toolbar]:not([hidden]) .btn { min-height: 1.8rem; padding: .25rem .55rem; font-size: .74rem; }
.task-select-all { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; white-space: nowrap; }
.tasks-card-list { display: grid; gap: .55rem; }
.task-card { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(0, auto); column-gap: 16px; align-items: start; padding: .9rem .8rem; border: 1px solid var(--mw-color-border); border-left: 3px solid var(--mw-color-border); border-radius: .85rem; background: var(--mw-color-surface-raised); cursor: pointer; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.task-card:hover, .task-card:focus-visible { z-index: 2; background: var(--mw-color-surface-hover); border-color: var(--mw-color-border); outline: none; transform: scale(1.01); box-shadow: 0 10px 24px rgba(2, 6, 23, .18); }
.task-card.is-selected { background: var(--mw-color-surface-hover); border-color: color-mix(in srgb, var(--mw-primary) 70%, var(--mw-color-border)); box-shadow: inset 3px 0 0 var(--mw-primary); }
.task-card.task-priority-urgent:hover, .task-card.task-priority-urgent:focus-visible, .task-card.task-priority-high:hover, .task-card.task-priority-high:focus-visible { border-left-color: #ef6464; }
.task-card.task-priority-medium:hover, .task-card.task-priority-medium:focus-visible { border-left-color: #f5a623; }
.task-card.task-priority-low:hover, .task-card.task-priority-low:focus-visible { border-left-color: #4fbd82; }
.task-card.task-priority-urgent, .task-card.task-priority-high { border-left-color: #ef6464; }
.task-card.task-priority-medium { border-left-color: #f5a623; }
.task-card.task-priority-low { border-left-color: #4fbd82; }
.task-card-selectors { display: flex; flex-direction: column; gap: .65rem; padding-top: .18rem; }
.task-card-selectors input { accent-color: var(--mw-primary); }
.task-card-main, .task-row-copy { min-width: 0; width: 100%; }
.task-row-copy { gap: .3rem; }
.task-row-copy strong { font-size: .95rem; line-height: 1.3; }
.task-description { width: 100%; max-width: none; color: var(--mw-color-text-muted); font-size: .85rem; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.task-description.is-empty { opacity: .55; font-style: italic; }
.task-card.is-expanded .task-description { display: block; width: 100%; max-width: none; max-height: none; -webkit-line-clamp: unset; overflow: visible; }
.task-description-toggle { border: 0; padding: 0; background: transparent; color: var(--mw-primary); font-size: .78rem; cursor: pointer; text-align: left; width: max-content; }
.task-card-meta { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-top: .65rem; }
.task-inline-status select { min-height: 1.9rem; padding: .28rem 1.7rem .28rem .55rem; border: 1px solid color-mix(in srgb, var(--mw-primary) 65%, var(--mw-border)); border-radius: .55rem; color: var(--mw-color-text); background: var(--mw-color-surface-raised); font-size: .78rem; cursor: pointer; }
.task-status-readonly { color: var(--mw-color-text-muted); font-size: .8rem; }
.task-priority-dot { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 650; }
.task-priority-dot i { width: .48rem; height: .48rem; border-radius: 50%; background: #94a3b8; }
.task-priority-dot.priority-urgent i, .task-priority-dot.priority-high i { background: #ef6464; }
.task-priority-dot.priority-medium i { background: #f5a623; }
.task-priority-dot.priority-low i { background: #4fbd82; }
.task-card .task-due-date { font-size: .78rem; font-weight: 500; }
.task-card .task-due-date i { margin-right: .3rem; }
.task-card-actions { position: relative; min-width: 0; padding-top: .05rem; }
.task-card-actions-row { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; min-width: 0; }
.task-card.has-task-waiting-popover { z-index: 5; }
.task-waiting-badge { display: inline-flex; align-items: center; gap: .28rem; min-width: 0; max-width: min(13rem, 28vw); height: 1.9rem; padding: .25rem .5rem; border: 1px solid color-mix(in srgb, #f5a623 45%, var(--mw-color-border)); border-radius: .55rem; color: color-mix(in srgb, #a16207 82%, var(--mw-color-text)); background: color-mix(in srgb, #f5a623 12%, var(--mw-color-surface-raised)); font-size: .75rem; line-height: 1; cursor: pointer; }
.task-waiting-badge i { flex: 0 0 auto; }
.task-waiting-badge span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-waiting-badge:hover, .task-waiting-badge:focus-visible { border-color: #f5a623; outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, #f5a623 18%, transparent); }
.task-waiting-popover { position: absolute; top: calc(100% + .45rem); right: 0; z-index: 15; width: min(260px, calc(100vw - 2rem)); padding: .7rem; border: 1px solid var(--mw-color-border); border-radius: .7rem; background: var(--mw-color-surface-raised); box-shadow: 0 14px 32px rgba(2, 6, 23, .2); }
.task-waiting-popover form { display: grid; gap: .45rem; }
.task-waiting-popover label { color: var(--mw-color-text-muted); font-size: .75rem; font-weight: 650; }
.task-waiting-popover input { width: 100%; min-height: 2rem; padding: .35rem .5rem; border: 1px solid var(--mw-color-border); border-radius: .45rem; color: var(--mw-color-text); background: var(--mw-color-surface); font-size: .8rem; }
.task-waiting-popover input:focus { border-color: var(--mw-primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--mw-primary) 18%, transparent); }
.task-waiting-popover-actions { display: flex; justify-content: flex-end; gap: .4rem; }
.task-more { opacity: .38; transition: opacity .15s ease, background .15s ease; }
.task-card:hover .task-more, .task-more:focus { opacity: 1; }
.task-card-actions .dropdown-menu { min-width: 10rem; }
.task-card-actions form { margin: 0; }
@media (max-width: 700px) {
    .task-card { grid-template-columns: 24px minmax(0, 1fr) minmax(0, auto); column-gap: 10px; padding: .85rem .45rem; }
    .task-waiting-badge { max-width: min(10rem, 38vw); }
    .task-card-meta { gap: .55rem; }
    .task-card-meta .task-due-date { flex-basis: 100%; }
    .tasks-list-shell > [data-bulk-toolbar]:not([hidden]) { position: static; justify-content: flex-end; margin: -.15rem .35rem .45rem auto; width: fit-content; max-width: 100%; }
}

body.theme-dark .project-tabs-ribbon,
body.theme-dark .project-summary-stats-ribbon {
    background: rgba(17, 28, 45, 0.78);
    border-color: rgba(51, 67, 95, 0.9);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.3);
}

body.theme-dark .project-tabs-ribbon .tab-link:hover,
body.theme-dark .project-tabs-ribbon .tab-link.is-active,
body.theme-dark .project-summary-stats-ribbon .project-summary-stat.is-active {
    background: rgba(28, 45, 70, 0.82);
}

body.theme-dark .project-summary-stats-ribbon .project-summary-stat:not(:last-child)::after {
    background: rgba(51, 67, 95, 0.9);
}

body.theme-dark .project-summary-card,
body.theme-dark .project-overview-card,
body.theme-dark .project-progress-card {
    background-color: rgba(17, 28, 45, 0.9);
    border-color: rgba(51, 67, 95, 0.9);
}

body.theme-dark .project-progress-card {
    background: linear-gradient(180deg, rgba(19, 31, 48, 0.96), rgba(15, 24, 38, 0.98));
}

body.theme-dark .project-overview-card-soft {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(17, 28, 45, 0.9));
}

body.theme-dark .project-detail-hero {
    border-color: rgba(51, 67, 95, 0.9);
}

body.theme-dark .project-detail-title-wrap .breadcrumb,
body.theme-dark .project-overview-card .section-heading a,
body.theme-dark .link-list span,
body.theme-dark .details-list dt,
body.theme-dark .details-list dd,
body.theme-dark .project-tab-heading p,
body.theme-dark .project-page-title p,
body.theme-dark .project-tab-note,
body.theme-dark .notes-page-title-row p,
body.theme-dark .note-card-meta small,
body.theme-dark .note-card .muted {
    color: #a8b7cc;
}

body.theme-dark .project-page-title h1,
body.theme-dark .project-overview-card .section-heading h2,
body.theme-dark .item-main strong {
    color: #f3f7ff;
}

body.theme-dark .project-progress-bar {
    box-shadow: inset 0 1px 1px rgba(2, 6, 23, 0.32);
}

body.theme-dark .badge-success,
body.theme-dark .badge-success-soft {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

body.theme-dark .badge-warning,
body.theme-dark .badge-warning-soft {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

body.theme-dark .badge-danger,
body.theme-dark .badge-danger-soft {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

body.theme-dark .badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

body.theme-dark .badge-muted,
body.theme-dark .badge-dark {
    background: rgba(100, 116, 139, 0.24);
    color: #d8e2f2;
}

body.theme-dark .btn-ghost {
    background: rgba(15, 23, 42, 0.36);
    color: #c5d1e2;
    border-color: rgba(71, 85, 105, 0.7);
}

body.theme-dark .btn-ghost:hover,
body.theme-dark .btn-ghost:focus {
    background: rgba(30, 41, 59, 0.82);
    color: #f3f7ff;
    border-color: rgba(96, 165, 250, 0.34);
}

body.theme-dark .btn.btn-ghost.icon-only {
    background: rgba(51, 65, 85, 0.78);
    color: #d8e2f2;
    border-color: rgba(100, 116, 139, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-dark .btn.btn-ghost.icon-only:hover,
body.theme-dark .btn.btn-ghost.icon-only:focus {
    background: rgba(37, 99, 235, 0.18);
    color: #f8fbff;
    border-color: rgba(96, 165, 250, 0.44);
}

body.theme-dark .share-row {
    background: rgba(17, 28, 45, 0.92);
    border-color: rgba(51, 67, 95, 0.9);
}

body.theme-dark .share-owner {
    background: rgba(18, 35, 65, 0.94);
}

body.theme-dark .share-row strong,
body.theme-dark .project-file-copy strong {
    color: #d7e1f2;
}

body.theme-dark .share-row .muted,
body.theme-dark .project-file-copy p,
body.theme-dark .project-file-meta,
body.theme-dark .project-files-empty {
    color: #a8b7cc;
}

body.theme-dark .project-file-card {
    background: rgba(17, 28, 45, 0.92);
    border-color: rgba(51, 67, 95, 0.9);
}

body.theme-dark .project-file-icon,
body.theme-dark .project-files-empty-icon {
    background: rgba(30, 58, 138, 0.22);
    color: #dbeafe;
}

body.theme-dark .app-modal {
    background: rgba(17, 28, 45, 0.98);
    border-color: rgba(51, 67, 95, 0.9);
}

body.theme-dark .app-modal-header,
body.theme-dark .app-modal .modal-footer {
    border-color: rgba(51, 67, 95, 0.85);
}

body.theme-dark .task-modal-icon {
    background: rgba(37, 99, 235, 0.16);
    color: #93c5fd;
}

body.theme-dark .task-modal-content {
    background: rgba(17, 28, 45, 0.98);
    border-color: rgba(51, 67, 95, 0.9);
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.34);
}

body.theme-dark .task-modal-content > .modal-header {
    border-color: rgba(51, 67, 95, 0.85);
}

body.theme-dark .app-form-icon {
    color: #8fa4c2;
}

body.theme-dark .rich-note-editor {
    background: rgba(17, 28, 45, 0.98);
    border-color: rgba(51, 67, 95, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

body.theme-dark .rich-note-toolbar {
    background: rgba(15, 23, 42, 0.46);
    border-bottom-color: rgba(51, 67, 95, 0.85);
}

body.theme-dark .rich-note-toolbar .btn {
    background: rgba(71, 85, 105, 0.58);
    color: #d8e2f2;
    border-color: rgba(100, 116, 139, 0.9);
}

body.theme-dark .rich-note-toolbar .btn:hover,
body.theme-dark .rich-note-toolbar .btn:focus {
    background: rgba(37, 99, 235, 0.18);
    color: #f8fbff;
    border-color: rgba(96, 165, 250, 0.44);
}

body.theme-dark .rich-note-surface,
body.theme-dark .rich-note-source {
    background: rgba(17, 28, 45, 0.98);
    color: #eef4ff;
}

body.theme-dark .rich-note-source::placeholder,
body.theme-dark .rich-note-surface:empty::before,
body.theme-dark .rich-note-status {
    color: #9fb1ca;
}

body.theme-dark .rich-note-status {
    border-top-color: rgba(51, 67, 95, 0.85);
}

body.theme-dark .notes-toolbar-card,
body.theme-dark .category-sidebar-modern,
body.theme-dark .note-card-modern {
    background: rgba(17, 28, 45, 0.88);
    border-color: rgba(51, 67, 95, 0.9);
}

body.theme-dark .note-card-modern:hover {
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.32);
    border-color: rgba(59, 130, 246, 0.34);
}

body.theme-dark .category-list a:hover,
body.theme-dark .category-list a.is-active {
    background: rgba(29, 78, 216, 0.18);
}

body.theme-dark .category-list a span:last-child {
    background: rgba(71, 85, 105, 0.35);
}

body.theme-dark .category-list a.is-active span:last-child {
    background: rgba(59, 130, 246, 0.24);
}

body.theme-dark .project-card:hover {
    box-shadow: 0 26px 54px rgba(2, 6, 23, 0.38);
    border-color: rgba(59, 130, 246, 0.4);
}

body.theme-dark .tasks-sort-link {
    color: #b9c7db;
}

body.theme-dark .tasks-sort-link i {
    color: #6f84a3;
}

.project-tab-note {
    margin-bottom: 0.9rem;
}

.share-list-inline {
    display: grid;
    gap: 0.8rem;
}

.share-empty-state {
    padding: 0.9rem 0;
}

@media (max-width: 900px) {
    .tasks-hero {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .task-stats-grid-mock {
        grid-template-columns: 1fr;
    }

    .task-stats-ribbon {
        gap: 0.35rem;
        padding: 0.5rem;
    }

    .task-stat-link:not(:last-child)::after {
        display: none;
    }

    .task-stat-card {
        border: 1px solid rgba(226, 232, 240, 0.9);
    }

    .task-stats-floating {
        margin-top: 0;
    }

    .tasks-hero-title-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .projects-page-heading {
        align-items: flex-start;
    }

    .tasks-hero-search-form,
    .tasks-hero-search-field {
        width: 100%;
    }

    .project-stats-ribbon {
        grid-template-columns: 1fr;
    }

    .project-page-title,
    .project-tab-heading,
    .project-tab-header {
        flex-direction: column;
    }

    .project-detail-hero {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

    .project-detail-sidebar {
        position: static;
    }

    .project-detail-hero-actions {
        justify-content: flex-start;
    }

    .details-list-compact div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

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

    .project-overview-card-wide {
        grid-column: auto;
    }

    .project-card-meta-grid,
    .project-card-footer,
    .project-card-top {
        align-items: flex-start;
        flex-direction: column;
    }
}

.organizer-panel-heading-copy {
    display: flex;
    align-items: baseline;
    gap: .55rem;
    flex: 0 0 auto;
}

.organizer-panel-heading-search {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex: 1 1 10rem;
    min-width: 7rem;
    max-width: 15rem;
    padding: .38rem .6rem;
    border: 1px solid var(--mw-color-border);
    border-radius: .65rem;
    color: var(--mw-color-text-muted);
    background: var(--mw-color-surface-subtle);
}

.organizer-panel-heading-search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--mw-color-text);
    background: transparent;
    font-size: .74rem;
}

.organizer-panel-heading-search input::placeholder {
    color: var(--mw-color-text-muted);
}

.organizer-task-row {
    grid-template-columns: 1.35rem minmax(0, 1fr);
    border-left: 3px solid var(--organizer-task-accent, var(--mw-color-accent));
}

.organizer-task-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: .15rem;
}

.organizer-task-copy small {
    color: var(--mw-color-text-muted);
    font-size: .66rem;
    line-height: 1.2;
}

.organizer-task-copy small i {
    margin-right: .25rem;
}

.organizer-task-editor-panel {
    min-height: 32rem;
}

.organizer-task-editor {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    padding: 0 1.25rem 1.25rem;
}

.organizer-task-editor .note-focus-header {
    padding: .25rem 0 .65rem;
}

.organizer-task-editor .note-focus-back {
    padding-left: 0;
    font-size: .76rem;
}

.organizer-task-editor .note-focus-status {
    font-size: .68rem;
}

.task-focus-form {
    display: grid;
    gap: .55rem;
    flex: 1;
    min-height: 0;
    padding: .7rem 0 0;
    border-top: 1px solid var(--mw-color-border);
    overflow: auto;
}

.task-focus-form label {
    display: grid;
    gap: .3rem;
    color: var(--mw-color-text-muted);
    font-size: .7rem;
    font-weight: 650;
}

.task-focus-form input,
.task-focus-form select,
.task-focus-form textarea {
    width: 100%;
    padding: .55rem .65rem;
    border: 1px solid var(--mw-color-border);
    border-radius: .6rem;
    outline: 0;
    color: var(--mw-color-text);
    background: var(--mw-color-surface);
    font: inherit;
    font-size: .78rem;
}

.task-focus-form input:focus,
.task-focus-form select:focus,
.task-focus-form textarea:focus {
    border-color: var(--mw-color-accent);
    box-shadow: 0 0 0 3px var(--mw-color-accent-soft);
}

.task-focus-title {
    font-size: 1.2rem !important;
    font-weight: 700;
}

.task-focus-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
    margin: .15rem 0 .45rem;
}

.task-focus-form textarea {
    min-height: 10rem;
    resize: vertical;
    line-height: 1.55;
}

@media (max-width: 700px) {
    .organizer-panel-heading {
        flex-wrap: wrap;
    }

    .organizer-panel-heading-copy,
    .organizer-panel-heading-search,
    .organizer-panel-heading .organizer-add-action {
        flex-basis: auto;
    }

    .organizer-panel-heading-search {
        order: 3;
        width: 100%;
        max-width: none;
    }

    .organizer-task-editor,
    .organizer-note-editor {
        padding-inline: .9rem;
    }

    .task-focus-fields {
        grid-template-columns: 1fr;
    }

    .organizer-task-row {
        grid-template-columns: 1.35rem minmax(0, 1fr);
    }
}

.info-card {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.03));
}

.empty-state {
    text-align: center;
}

.premium-orb {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 48% 52% 51% 49% / 52% 47% 53% 48%;
    overflow: hidden;
    isolation: isolate;
    opacity: var(--orb-opacity);
    background:
        radial-gradient(circle at 36% 32%, rgba(255, 255, 255, 0.95) 0%, rgba(225, 242, 255, 0.8) 18%, transparent 42%),
        radial-gradient(circle at 48% 58%, rgba(163, 218, 255, 0.95) 0%, rgba(104, 159, 255, 0.65) 38%, rgba(70, 79, 190, 0.5) 68%, rgba(41, 35, 110, 0.35) 100%);
    box-shadow:
        inset 18px 16px 42px rgba(255, 255, 255, 0.2),
        inset -24px -22px 48px rgba(35, 34, 110, 0.4),
        inset 0 -18px 36px rgba(99, 178, 255, 0.24),
        0 0 24px rgba(92, 171, 255, 0.2);
    filter: hue-rotate(var(--orb-hue, 0deg)) saturate(112%) drop-shadow(0 16px 28px rgba(var(--orb-shadow-rgb, 37, 99, 235), calc(0.18 * var(--orb-glow))));
    transform: translateZ(0);
    animation:
        premiumOrbMorph var(--orb-speed) cubic-bezier(0.45, 0.05, 0.2, 1) infinite,
        premiumOrbBob calc(var(--orb-speed) * 0.9) ease-in-out infinite,
        premiumOrbDrift calc(var(--orb-speed) * 1.28) ease-in-out infinite;
}

.premium-orb::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background:
        conic-gradient(
            from 210deg,
            rgba(99, 230, 255, 0.95),
            rgba(107, 159, 255, 0.8),
            rgba(150, 128, 255, 0.85),
            rgba(255, 160, 226, 0.65),
            rgba(100, 235, 255, 0.95)
        );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    filter: blur(0.3px) drop-shadow(0 0 8px rgba(114, 198, 255, 0.45));
    opacity: 0.95;
    pointer-events: none;
    animation: premiumOrbRim calc(var(--orb-speed) * 1.05) ease-in-out infinite;
}

.premium-orb > * {
    position: absolute;
    border-radius: inherit;
    pointer-events: none;
}

.premium-orb__core {
    inset: 12%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 44% 48%, rgba(255, 255, 255, 0.98), rgba(208, 237, 255, 0.9) 22%, rgba(121, 189, 255, 0.55) 48%, transparent 74%);
    filter: blur(10px);
    opacity: 0.9;
    animation: premiumOrbCore calc(var(--orb-speed) * 0.78) ease-in-out infinite;
}

.premium-orb__clouds {
    inset: 5%;
    background:
        radial-gradient(ellipse at 62% 72%, rgba(122, 164, 255, 0.5), transparent 42%),
        radial-gradient(ellipse at 32% 68%, rgba(104, 231, 255, 0.36), transparent 38%),
        radial-gradient(ellipse at 74% 42%, rgba(142, 115, 255, 0.3), transparent 34%);
    filter: blur(18px);
    mix-blend-mode: screen;
    opacity: 0.88;
    animation: premiumOrbClouds calc(var(--orb-speed) * 0.92) ease-in-out infinite;
}

.premium-orb__particles {
    inset: 10%;
    background:
        radial-gradient(circle at 18% 34%, rgba(255, 255, 255, 0.72) 0 1px, transparent 1.8px),
        radial-gradient(circle at 30% 62%, rgba(184, 231, 255, 0.58) 0 1.1px, transparent 2px),
        radial-gradient(circle at 56% 28%, rgba(198, 241, 255, 0.62) 0 1px, transparent 1.7px),
        radial-gradient(circle at 68% 54%, rgba(255, 255, 255, 0.5) 0 0.9px, transparent 1.7px),
        radial-gradient(circle at 74% 70%, rgba(166, 213, 255, 0.44) 0 1px, transparent 1.8px),
        radial-gradient(circle at 44% 78%, rgba(255, 255, 255, 0.42) 0 0.9px, transparent 1.7px),
        radial-gradient(circle at 82% 38%, rgba(132, 198, 255, 0.46) 0 1px, transparent 1.8px),
        radial-gradient(circle at 24% 84%, rgba(202, 233, 255, 0.38) 0 0.9px, transparent 1.7px);
    filter: blur(0.2px);
    mix-blend-mode: screen;
    opacity: 0.68;
    animation: premiumOrbParticles calc(var(--orb-speed) * 0.92) linear infinite;
}

.premium-orb__shine {
    inset: 0;
    overflow: hidden;
    mix-blend-mode: screen;
    animation: premiumOrbSheen calc(var(--orb-speed) * 1.06) ease-in-out infinite;
}

.premium-orb__shine::before,
.premium-orb__shine::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.premium-orb__shine::before {
    inset: 8% 18% 56% 18%;
    border-radius: 50% 50% 42% 58% / 58% 48% 52% 42%;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0) 16%, rgba(255, 255, 255, 0.82) 42%, rgba(255, 255, 255, 0.24) 62%, rgba(255, 255, 255, 0) 78%);
    filter: blur(2px);
    opacity: 0.95;
    transform: rotate(-12deg);
    animation: premiumOrbShine calc(var(--orb-speed) * 0.62) ease-in-out infinite;
}

.premium-orb__shine::after {
    inset: 58% 10% 6% 34%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 40%, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.08) 24%, rgba(255, 255, 255, 0) 58%),
        linear-gradient(202deg, rgba(255, 166, 228, 0.22), rgba(108, 229, 255, 0.4) 42%, rgba(255, 255, 255, 0) 74%);
    filter: blur(7px);
    opacity: 0.86;
    animation: premiumOrbLowerLight calc(var(--orb-speed) * 0.82) ease-in-out infinite;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    background:
        radial-gradient(circle at top center, rgba(37, 99, 235, 0.08), transparent 26%),
        linear-gradient(180deg, #fdfcf9 0%, #f8f6f3 100%);
}

.login-shell {
    width: min(1520px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(420px, 0.8fr);
    gap: 2rem;
    padding: 3.2rem 3.5rem;
    border-radius: 2.25rem;
    background:
        radial-gradient(circle at top center, rgba(37, 99, 235, 0.06), transparent 24%),
        rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(18px);
}

.login-showcase {
    display: grid;
    align-content: space-between;
    gap: 1.8rem;
    padding: 2rem 2.2rem 1.8rem;
}

.login-card {
    width: 100%;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.login-brand-showcase h1 {
    margin: 0;
    font-size: 2.1rem;
}

.login-showcase-copy {
    display: grid;
    gap: 1rem;
    max-width: 680px;
}

.login-showcase-copy h2 {
    margin: 0;
    font-size: clamp(2.6rem, 4vw, 4.1rem);
    line-height: 1.08;
    letter-spacing: -0.05em;
}

.login-showcase-copy h2 span {
    white-space: nowrap;
}

.login-showcase-copy p {
    margin: 0;
    color: #64748b;
    font-size: 1.08rem;
    line-height: 1.65;
}

.login-feature-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.login-feature {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.8rem;
    align-items: start;
}

.login-feature-icon {
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.login-feature strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 1.05rem;
}

.login-feature span {
    color: #64748b;
    line-height: 1.6;
}

.login-card-elevated {
    align-self: center;
    padding: 2.7rem 2.9rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.login-form-stack {
    display: grid;
    gap: 1.15rem;
}

.login-input-shell {
    position: relative;
}

.login-input-shell > i,
.login-input-trailing {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.login-input-shell > i {
    left: 1rem;
}

.login-input-trailing {
    right: 1rem;
}

.login-input-shell input {
    width: 100%;
    min-height: 3.35rem;
    padding: 0.9rem 1rem 0.9rem 3rem;
    border: 1px solid #dbe3ef;
    border-radius: 0.95rem;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.login-input-shell-password input {
    padding-right: 3rem;
}

.login-form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: -0.1rem;
}

.login-check {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #475569;
    font-size: 0.95rem;
}

.login-check input {
    width: 1rem;
    height: 1rem;
    accent-color: #3158ea;
}

.login-inline-link {
    border: 0;
    background: transparent;
    padding: 0;
    color: #3158ea;
    font-weight: 600;
}

.login-submit-btn {
    min-height: 3.4rem;
    font-size: 1.05rem;
}

@media (max-width: 1100px) {
    .login-shell {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 1.35rem;
    }

    .login-showcase {
        padding: 1rem;
    }

    .login-feature-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .login-body {
        padding: 1rem;
    }

    .login-shell {
        padding: 1rem;
        border-radius: 1.5rem;
    }

    .login-showcase {
        padding: 0.5rem;
        gap: 1.15rem;
    }

    .login-showcase-copy h2 {
        font-size: 2.2rem;
    }

    .login-card-elevated {
        padding: 1.5rem 1.2rem;
        border-radius: 1.5rem;
    }

    .login-form-meta {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

}

.btn {
    min-height: var(--mw-control-height);
    border-radius: var(--mw-control-radius);
    padding: 0.72rem 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    line-height: 1.2;
}

.btn.btn-sm {
    min-height: var(--mw-control-height-sm);
    padding: 0.52rem 0.85rem;
}

.btn i,
.btn i::before {
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(180deg, var(--mw-primary) 0%, var(--mw-primary-hover) 100%);
    border-color: var(--mw-primary);
}

.btn-secondary {
    background: rgba(37, 99, 235, 0.09);
    border-color: rgba(37, 99, 235, 0.08);
    color: var(--mw-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--mw-muted);
    border: 1px solid var(--mw-border);
}

.btn-ghost:hover,
.btn-ghost:focus {
    background: rgba(37, 99, 235, 0.06);
    color: var(--mw-text);
    border-color: rgba(37, 99, 235, 0.18);
}

.btn-danger-outline {
    background: transparent;
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.18);
}

.btn-block {
    width: 100%;
}

.danger-text {
    color: #dc2626;
}

.row-overdue td {
    background: rgba(239, 68, 68, 0.05);
}

.row-overdue strong {
    color: #dc2626;
}

.toast {
    background: var(--mw-card-bg);
    color: var(--mw-text);
    border-radius: 1rem;
}

.toast-header {
    background: transparent;
    color: var(--mw-text);
    border-bottom: 1px solid var(--mw-border);
}

.reminder-toast-stack {
    z-index: 1085;
}

.reminder-toast-compact {
    width: min(92vw, 460px);
    border-radius: 1.2rem;
}

.reminder-toast-compact .toast-body {
    padding: 0.95rem 1rem;
}

.reminder-toast-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.reminder-toast-main {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
    flex: 1;
}

.reminder-toast-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.reminder-toast-title strong,
.reminder-toast-project {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reminder-toast-project {
    color: var(--mw-muted);
    font-size: 0.88rem;
}

.reminder-toast-deadline {
    margin: 0.7rem 0 0.8rem;
    color: var(--mw-text);
    font-weight: 500;
}

.reminder-toast-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

@media (max-width: 1199px) {
    .stats-grid,
    .project-cards,
    .content-grid.two-up,
    .note-grid,
    .search-grid,
    .focus-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) { .home-topnav a { padding-inline: .45rem; font-size: .75rem; }.home-hero { grid-template-columns: 1fr; padding: 2rem; }.home-hero__visual { display: none; }.home-work-grid { grid-template-columns: 1fr; } }
/* MonWorkspace v2 — project shell and light reference surface. */
:root {
    --mw-shell-sidebar-width: 276px;
    --mw-shell-gap: 1.5rem;
    --mw-shell-content-max-width: 1220px;
    --mw-color-canvas: #f7f7f8;
    --mw-color-surface: #ffffff;
    --mw-color-surface-subtle: #f3f3f3;
    --mw-color-surface-raised: #ffffff;
    --mw-color-border: #e2e2e5;
    --mw-color-border-strong: #d4d4d8;
    --mw-color-text: #202123;
    --mw-color-text-muted: #565869;
    --mw-color-text-subtle: #8e8ea0;
    --mw-color-surface-hover: #ececf1;
    --mw-color-sidebar-surface: #f3f3f3;
    --mw-color-sidebar-surface-raised: #ececf1;
    --mw-color-sidebar-text: #202123;
    --mw-color-sidebar-muted: #565869;
    --mw-color-accent-violet: #7c3aed;
    --mw-color-accent-orange: #f59e0b;
    --mw-color-accent-green: #22c55e;
    --mw-color-on-accent: #ffffff;
    --mw-color-accent-violet-soft: #f3edff;
    --mw-color-accent-orange-soft: #fff5e8;
    --mw-color-accent-green-soft: #ebfaef;
    --mw-elevation-1: 0 8px 24px rgba(27, 48, 84, 0.05);
    --mw-elevation-2: 0 16px 36px rgba(27, 48, 84, 0.08);
    --mw-radius-lg: 1.05rem;
    --mw-radius-md: 0.82rem;
}

body.theme-dark {
    --mw-color-canvas: #212121;
    --mw-color-surface: #2f2f2f;
    --mw-color-surface-subtle: #292929;
    --mw-color-surface-raised: #383838;
    --mw-color-border: #424242;
    --mw-color-border-strong: #505050;
    --mw-color-text: #f2f2f2;
    --mw-color-text-muted: #b4b4b4;
    --mw-color-text-subtle: #8e8e8e;
    --mw-color-accent: #3b82f6;
    --mw-color-accent-hover: #2563eb;
    --mw-color-accent-soft: rgba(59, 130, 246, 0.12);
    --mw-color-sidebar-surface: #171717;
    --mw-color-sidebar-surface-raised: #242424;
    --mw-color-sidebar-text: #f2f2f2;
    --mw-color-sidebar-muted: #b4b4b4;
    --mw-color-accent-violet-soft: rgba(139, 92, 246, 0.12);
    --mw-color-accent-orange-soft: rgba(210, 153, 34, 0.12);
    --mw-color-accent-green-soft: rgba(63, 185, 80, 0.12);
    --mw-color-focus-ring: rgba(59, 130, 246, 0.32);
    --mw-color-success: #3fb950;
    --mw-color-warning: #d29922;
    --mw-color-danger: #f85149;
    --mw-color-on-accent: #ffffff;
    --mw-elevation-1: 0 8px 24px rgba(0, 0, 0, 0.16);
    --mw-elevation-2: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.app-shell--foundation {
    --sidebar-width: var(--mw-shell-sidebar-width);
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-width: 0;
    background: var(--mw-color-canvas);
}

.app-shell--foundation .app-sidebar {
    position: sticky;
    inset: 0 auto auto 0;
    width: var(--sidebar-width);
    min-width: 0;
    height: 100vh;
    padding: 1.35rem 1.25rem 1.1rem;
    gap: 1.25rem;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--mw-color-sidebar-surface);
    color: var(--mw-color-sidebar-text);
    border-right: 1px solid var(--mw-color-border);
    box-shadow: none;
}

.app-shell--foundation .sidebar-brand {
    display: block;
    padding: 0;
}

.app-shell--foundation .sidebar-brand-copy {
    display: block;
}

.app-shell--foundation .sidebar-brand strong {
    color: var(--mw-color-text);
    font-size: 1.12rem;
    letter-spacing: -0.02em;
}

.app-shell--foundation .brand-mark {
    width: 1.75rem;
    height: 1.75rem;
    margin-right: 0.5rem;
    display: inline-flex;
    vertical-align: middle;
    color: var(--mw-color-accent);
    background: var(--mw-color-accent-soft);
    box-shadow: none;
}

.app-shell--foundation .workspace-switcher {
    display: block;
    margin-top: 1rem;
}

.app-shell--foundation .workspace-current {
    width: 100%;
    min-height: 3.05rem;
    justify-content: space-between;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--mw-color-border);
    border-radius: var(--mw-radius-md);
    background: var(--mw-color-surface);
    color: var(--mw-color-text);
    box-shadow: var(--mw-elevation-1);
}

.app-shell--foundation .workspace-current::after {
    margin-left: auto;
}

.sidebar-project-section {
    min-width: 0;
}

.sidebar-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.9rem 0 0.65rem;
    padding: 0 0.15rem;
    color: var(--mw-color-sidebar-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.sidebar-section-heading-link {
    color: inherit;
    text-decoration: none;
}

.sidebar-section-heading-link:hover,
.sidebar-section-heading-link:focus-visible {
    color: var(--mw-color-accent);
    text-decoration: none;
}

.sidebar-section-action,
.sidebar-new-project {
    color: var(--mw-color-accent);
}

.sidebar-section-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    border: 1px solid var(--mw-color-border);
    border-radius: 0.55rem;
    background: var(--mw-color-surface);
    line-height: 1;
}

.sidebar-section-action .bi,
.sidebar-theme-toggle-button .bi {
    display: inline-flex;
    width: 1em;
    height: 1em;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sidebar-project-list {
    display: grid;
    gap: 0.22rem;
}

.sidebar-project-row {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 2.7rem;
    padding: 0.28rem 0.3rem 0.28rem 0.2rem;
    border-radius: var(--mw-radius-md);
}

.sidebar-project-row:hover,
.sidebar-project-row:focus-within,
.sidebar-project-row.is-active {
    z-index: 20;
    background: var(--mw-color-accent-soft);
}

.sidebar-project-link {
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
    gap: 0.65rem;
    color: var(--mw-color-text);
}

.sidebar-project-folder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.35rem;
    color: var(--project-accent, var(--mw-color-accent));
    font-size: 1.02rem;
}

.sidebar-project-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--mw-color-text);
    font-size: 0.86rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-project-shortcuts {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.12rem;
    margin-left: 0.35rem;
    padding: 0.08rem 0.12rem;
    border-radius: 0.5rem;
    background: var(--mw-color-accent-soft);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.sidebar-project-row:hover .sidebar-project-shortcuts,
.sidebar-project-row:focus-within .sidebar-project-shortcuts,
.sidebar-project-row.is-active .sidebar-project-shortcuts {
    opacity: 1;
}

.sidebar-project-row.is-active .sidebar-project-name {
    padding-right: 2rem;
}

.sidebar-project-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    padding: 0;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: var(--mw-color-sidebar-muted);
    font-size: 0.68rem;
}

.sidebar-project-shortcut:hover,
.sidebar-project-shortcut:focus-visible {
    background: var(--mw-color-surface);
    color: var(--mw-color-accent);
}

.sidebar-project-menu {
    display: inline-flex;
    z-index: 30;
}

.sidebar-project-empty {
    margin: 0;
    padding: 0.75rem 0.2rem;
    color: var(--mw-color-text-muted);
    font-size: 0.82rem;
}

.note-focus-page {
    display: grid;
    gap: 1rem;
    min-height: calc(100vh - 11rem);
}

.note-focus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.note-focus-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border: 0;
    border-radius: 0.65rem;
    background: transparent;
    color: var(--mw-color-text-muted);
    font-weight: 700;
}

.note-focus-back:hover,
.note-focus-back:focus-visible {
    background: var(--mw-color-accent-soft);
    color: var(--mw-color-accent);
}

.note-focus-status {
    margin-left: auto;
    color: var(--mw-color-text-muted);
    font-size: 0.78rem;
}

.note-focus-status.is-saving {
    color: var(--mw-color-accent);
}

.note-focus-status.is-saved {
    color: #16803c;
}

.note-focus-status.is-error {
    color: #c2410c;
}

.note-focus-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: clamp(1.1rem, 3vw, 2.5rem);
    border: 1px solid var(--mw-color-border);
    border-radius: 1.2rem;
    background: var(--mw-color-surface);
    box-shadow: var(--mw-elevation-1);
}

.note-focus-title {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--mw-color-text);
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    font-weight: 750;
    letter-spacing: -0.04em;
}

.note-focus-rich-editor {
    flex: 1 1 auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.note-focus-rich-editor .rich-note-toolbar {
    margin: 0 -0.65rem 0.75rem;
    padding: 0.35rem 0.55rem;
    border: 0;
    border-radius: 0.7rem;
    background: var(--mw-color-surface-subtle);
}

.note-focus-rich-editor .rich-note-surface {
    min-height: min(62vh, 680px);
    padding: 0.5rem 0;
    font-size: 1rem;
    line-height: 1.8;
}

body.theme-dark .note-focus-status.is-saved {
    color: #86efac;
}

@media (max-width: 767px) {
    .note-focus-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .note-focus-status {
        order: 3;
        flex-basis: 100%;
        margin-left: 0;
    }

    .note-focus-form {
        padding: 1.1rem;
    }

    .note-focus-rich-editor .rich-note-surface {
        min-height: 60vh;
    }
}

.sidebar-new-project {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.8rem;
    padding: 0.45rem 0.2rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.sidebar-secondary-menu {
    margin-top: auto;
    color: var(--mw-color-sidebar-muted);
}

.sidebar-secondary-menu summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.25rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.8rem;
    font-weight: 600;
}

.sidebar-secondary-menu summary::-webkit-details-marker {
    display: none;
}

.sidebar-secondary-menu .nav-link {
    min-height: 2.2rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.6rem;
    color: var(--mw-color-sidebar-muted);
    font-size: 0.78rem;
}

.sidebar-secondary-menu .nav-link:hover,
.sidebar-secondary-menu .nav-link.is-active {
    background: var(--mw-color-accent-soft);
    color: var(--mw-color-accent);
}

.app-shell--foundation .sidebar-footer {
    padding-top: 0.85rem;
    border-top: 1px solid var(--mw-color-border);
}

.app-shell--foundation .sidebar-footer-actions {
    display: flex;
    gap: 0.35rem;
}

.app-shell--foundation .sidebar-section-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.app-shell--foundation .sidebar-assistant-action {
    color: var(--mw-color-accent);
}


.app-shell--foundation .sidebar-spotlight-button {
    display: none;
}

.app-shell--foundation .sidebar-theme-toggle-button {
    width: 2.25rem;
    min-height: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--mw-color-border);
    border-radius: 0.7rem;
    background: var(--mw-color-surface);
    color: var(--mw-color-text-muted);
    line-height: 1;
}

.app-shell--foundation .sidebar-user-chip span {
    color: var(--mw-color-text);
}

.app-shell--foundation .sidebar-user-chip-arrow {
    color: var(--mw-color-text-muted);
}

.app-shell--foundation .sidebar-user-chip {
    border: 1px solid var(--mw-color-border);
    background: var(--mw-color-surface);
    box-shadow: none;
    color: var(--mw-color-text);
}

.app-shell--foundation .sidebar-user-chip:hover,
.app-shell--foundation .sidebar-user-chip.is-active {
    background: var(--mw-color-accent-soft);
}

.app-shell--foundation .sidebar-user-chip .avatar {
    background: var(--mw-color-accent-soft);
    color: var(--mw-color-accent);
}

.app-shell--foundation .app-main {
    min-width: 0;
    padding: 0.55rem 2rem 4rem;
    overflow-x: hidden;
}

.app-shell--foundation .app-shell__header {
    min-height: 0;
    height: 0;
    margin: 0 auto;
    width: min(100%, var(--mw-shell-content-max-width));
}

.app-shell--foundation .menu-toggle {
    display: none;
}

.topbar__end {
    gap: 0.65rem;
}


.app-shell--foundation .page-content {
    width: min(100%, var(--mw-shell-content-max-width));
    min-width: 0;
    margin-inline: auto;
}

/* Project page matching the supplied reference mock. */
.project-detail-layout-v2 {
    display: block;
    min-width: 0;
}

.mw-project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-width: 0;
    padding: 1.1rem 0 1.35rem;
}

.mw-project-identity,
.mw-project-actions,
.mw-project-meta,
.mw-project-section-heading,
.mw-secondary-page-heading {
    display: flex;
    align-items: center;
}

.mw-project-identity {
    min-width: 0;
    gap: 1rem;
}

.mw-project-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5.6rem;
    height: 5.6rem;
    flex: 0 0 auto;
    border-radius: 1.25rem;
    background: var(--mw-color-accent-soft);
    color: var(--project-accent, var(--mw-color-accent));
    font-size: 2.25rem;
}

.mw-project-identity-copy {
    min-width: 0;
}

.mw-project-kicker,
.mw-secondary-kicker {
    margin-bottom: 0.25rem;
    color: var(--mw-color-text-subtle);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mw-project-identity h1,
.mw-secondary-page-heading h2 {
    margin: 0;
    color: var(--mw-color-text);
    font-size: clamp(1.7rem, 2.4vw, 2.25rem);
    letter-spacing: -0.04em;
}

.mw-project-meta {
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.55rem;
    color: var(--mw-color-text-muted);
    font-size: 0.83rem;
}

.mw-project-meta i {
    color: var(--mw-color-accent);
}

.mw-project-shared {
    color: var(--mw-color-accent);
}

.mw-project-actions {
    flex: 0 0 auto;
    gap: 0.65rem;
}

.mw-icon-button {
    width: 2.85rem;
    height: 2.85rem;
    border: 1px solid var(--mw-color-border);
    border-radius: 0.8rem;
    background: var(--mw-color-surface);
    color: var(--mw-color-text);
    box-shadow: var(--mw-elevation-1);
}

.mw-project-primary-action {
    min-height: 2.85rem;
    padding-inline: 1rem;
}


.mw-project-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 2.7rem;
    margin-bottom: 1.3rem;
    border-bottom: 1px solid var(--mw-color-border);
}

.mw-project-nav-link,
.mw-project-nav-more {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.7rem;
    padding: 0 0.85rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--mw-color-text-muted);
    font-size: 0.86rem;
    font-weight: 650;
}

.mw-project-nav-link:hover,
.mw-project-nav-link.is-active,
.mw-project-nav-more:hover {
    border-bottom-color: var(--mw-color-accent);
    color: var(--mw-color-accent);
}

.mw-project-nav-spacer {
    flex: 1 1 auto;
}

.mw-project-nav-more {
    gap: 0.3rem;
    padding-inline: 0.55rem;
    font-size: 0.78rem;
}

.mw-project-section-heading {
    justify-content: space-between;
    gap: 1rem;
}

.mw-project-section-heading h2 {
    margin: 0;
    color: var(--mw-color-text);
    font-size: 1.1rem;
}

.mw-project-section-heading a {
    color: var(--mw-color-accent);
    font-size: 0.82rem;
    font-weight: 650;
}

@media (max-width: 1100px) {
    .app-shell--foundation { --sidebar-width: 248px; }
    .app-shell--foundation .app-sidebar { width: 248px; }
}

@media (max-width: 991px) {
    .app-shell--foundation { grid-template-columns: 1fr; }
    .app-shell--foundation .app-sidebar {
        position: fixed;
        left: -290px;
        top: 0;
        z-index: 1045;
        width: min(276px, calc(100vw - 2rem));
        transition: left 0.2s ease;
    }
    .app-shell--foundation .app-sidebar.is-open { left: 0; }
    .app-shell--foundation .app-main { padding: 1rem 1.2rem 3rem; }
    .app-shell--foundation .menu-toggle { display: inline-flex; }
    .mw-project-header { align-items: flex-start; }
    .mw-project-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 700px) {
    .app-shell--foundation .app-main { padding: 0.75rem 0.85rem 2.5rem; }
    .app-shell--foundation .app-shell__header { min-height: 3.5rem; height: auto; gap: 0.45rem; }
    .mw-project-header { display: grid; gap: 1rem; padding-top: 0.35rem; }
    .mw-project-actions { justify-content: flex-start; }
    .mw-project-icon { width: 3.8rem; height: 3.8rem; font-size: 1.55rem; }
    .mw-project-identity h1 { font-size: 1.65rem; }
    .mw-project-nav { overflow-x: auto; }
    .mw-project-nav-link { flex: 0 0 auto; padding-inline: 0.55rem; }
    .mw-project-intent { padding: 1.4rem 0.9rem 1.1rem; }
    .mw-project-intent-heading h2 { font-size: 1.22rem; }
}

@media (max-width: 991px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1050;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: inline-flex;
    }

    .spotlight-search-shell {
        padding-top: 0.9rem;
    }

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

    .notes-toolbar-form {
        flex-wrap: wrap;
    }

    .notes-toolbar-form select {
        flex-basis: 100%;
    }

    .category-sidebar {
        position: static;
    }

    .category-sidebar-modern {
        padding: 1rem;
    }

    .journal-event-row {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .journal-event-time,
    .journal-event-project,
    .journal-event-side-meta {
        padding-top: 0;
        text-align: left;
    }

    .journal-event-marker {
        justify-content: flex-start;
    }

    .journal-event-marker::after {
        display: none;
    }

    .journal-event-side {
        justify-items: start;
        padding-top: 0;
    }

    .journal-event-side-actions {
        justify-content: flex-start;
    }

}

@media (max-width: 767px) {
    .app-main {
        padding: 1rem 1rem 6rem;
    }

    .topbar,
    .hero-card,
    .section-header,
    .section-heading,
    .project-list li,
    .timeline-list li,
    .link-list li,
    .card-actions,
    .table-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid,
    .content-grid.two-up,
    .project-cards,
    .note-grid,
    .search-grid,
    .form-grid,
    .focus-grid {
        grid-template-columns: 1fr;
    }

    .note-editor-modal-dialog {
        width: auto;
        max-width: calc(100vw - 1rem);
    }

    .note-editor-meta-grid,
    .note-editor-meta-grid.has-visibility {
        grid-template-columns: 1fr;
    }

    .note-card-meta,
    .note-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .note-card-head-actions {
        width: 100%;
        justify-content: space-between;
    }

    .note-card-meta small {
        text-align: left;
    }

    .notes-page-hero {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .notes-page-hero .tasks-hero-actions {
        justify-content: flex-start;
    }

    .form-span-2 {
        grid-column: span 1;
    }

    .rich-note-image-toolbar {
        left: 0.8rem;
        right: 0.8rem;
        top: auto;
        bottom: 0.8rem;
        flex-wrap: wrap;
        border-radius: 1rem;
        justify-content: center;
    }

    .search-shortcut {
        display: none;
    }

    .data-table,
    .data-table thead,
    .data-table tbody,
    .data-table tr,
    .data-table th,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        padding: 0.8rem 0;
        border-bottom: 1px solid var(--mw-border);
    }

    .data-table td {
        padding: 0.4rem 0;
        border: 0;
    }

    .stat-card small {
        padding-left: 0;
    }
}

.btn-assistant {
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: #fff;
    color: #14213d;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.btn-assistant:hover,
.btn-assistant:focus {
    background: linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
    color: #0f172a;
    border-color: rgba(37, 99, 235, 0.32);
}

.assistant-modal-dialog {
    transition: max-width 0.24s ease;
}

.assistant-modal-dialog.assistant-modal-dialog-input {
    width: min(85vw, 1480px);
    max-width: min(85vw, 1480px);
}

.assistant-modal-dialog.assistant-modal-dialog-result {
    width: min(88vw, 1500px);
    max-width: min(88vw, 1500px);
}

.assistant-modal-content {
    height: min(86vh, 980px);
    max-height: min(86vh, 980px);
    overflow: hidden;
}

.assistant-modal-body {
    max-height: calc(min(86vh, 980px) - 76px);
    overflow: hidden;
    padding: 1.2rem 1.5rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.assistant-modal-body.is-result-stage {
    overflow-y: auto;
}

.assistant-stage {
    min-height: 0;
    height: 100%;
    position: relative;
}

.assistant-input-form {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.assistant-modal-topline {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.assistant-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.assistant-question-block {
    margin-bottom: 0.55rem;
    min-height: 0;
}

.assistant-textarea-shell {
    position: relative;
}

.assistant-field-help {
    margin: 0.25rem 0 0.55rem;
    color: var(--text-muted);
}

.assistant-attachments-block {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    padding: 0.85rem 0 0.8rem;
    margin-bottom: 0.65rem;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.assistant-block-head {
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
    align-items: center;
    margin-bottom: 0.7rem;
}

.assistant-block-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    min-width: 0;
}

.assistant-block-head h3 {
    margin: 0 0 0.25rem;
    font-size: 1.02rem;
}

.assistant-block-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.assistant-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.assistant-section-icon {
    width: 1.8rem;
    height: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    flex: 0 0 auto;
}

.assistant-add-source-btn {
    white-space: nowrap;
    min-height: 2.5rem;
    padding-inline: 0.95rem;
    flex: 0 0 auto;
}

.assistant-source-summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.7rem 0.95rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 248, 255, 0.98) 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #1e3a8a;
    font-weight: 600;
    text-align: center;
}

.assistant-attachments-layout {
    display: grid;
    grid-template-columns: minmax(260px, 27%) minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
    min-height: 0;
}

.assistant-upload-panel {
    display: grid;
    gap: 0.75rem;
    align-content: start;
}

.assistant-upload-dropzone {
    min-height: clamp(180px, 24vh, 230px);
    border-radius: 1rem;
    border: 1.5px dashed rgba(37, 99, 235, 0.28);
    background: rgba(255, 255, 255, 0.96);
    display: grid;
    place-items: center;
    text-align: center;
    gap: 0.45rem;
    padding: 1.25rem 1.1rem;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.assistant-upload-dropzone i {
    font-size: 2rem;
    color: #2563eb;
}

.assistant-upload-dropzone.is-dragover {
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.12);
}

.assistant-upload-dropzone small {
    color: var(--text-muted);
}

.assistant-sources-column {
    min-width: 0;
    min-height: 0;
}

.assistant-source-list {
    display: grid;
    gap: 0;
}

.assistant-source-list-panel {
    align-content: start;
    min-height: clamp(180px, 26vh, 260px);
    max-height: min(31vh, 340px);
    overflow: auto;
    padding-right: 0.2rem;
}

.assistant-source-item,
.assistant-source-empty {
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.96);
}

.assistant-source-item {
    display: grid;
    grid-template-columns: 16px 46px minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    min-height: 62px;
    padding: 0.7rem 0.85rem;
    border-radius: 0;
    border-top: 0;
    border-left: 0;
    border-right: 0;
}

.assistant-source-item:first-child {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

.assistant-source-item:last-child {
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

.assistant-source-item.is-pending {
    border-style: dashed;
}

.assistant-source-grip {
    color: rgba(100, 116, 139, 0.8);
    font-size: 0.95rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.assistant-source-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    font-size: 1rem;
}

.assistant-source-thumb {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(37, 99, 235, 0.1);
}

.assistant-source-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.assistant-source-item-body {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.assistant-source-item-body strong {
    font-size: 0.94rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assistant-source-item-body small {
    color: var(--text-muted);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assistant-source-item-body p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.84rem;
    line-height: 1.35;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.assistant-source-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    min-width: 150px;
}

.assistant-source-status {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.assistant-source-status.is-ready {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.assistant-source-status.is-pending {
    background: rgba(251, 191, 36, 0.14);
    color: #a16207;
}

.assistant-source-status.is-error {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.assistant-source-error {
    color: #b91c1c;
    font-size: 0.8rem;
}

.assistant-source-badge {
    display: inline-flex;
    width: fit-content;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.16);
    color: #92400e;
    font-size: 0.78rem;
    font-weight: 700;
}

.assistant-source-badge-inline {
    margin-left: 0.45rem;
    vertical-align: middle;
    font-size: 0.72rem;
}

.assistant-source-spreadsheet-preview .assistant-spreadsheet-preview {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.55rem;
}

.assistant-spreadsheet-preview-sheet {
    display: grid;
    gap: 0.45rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.85rem;
    background: rgba(241, 245, 249, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.assistant-spreadsheet-preview-sheet-head {
    display: grid;
    gap: 0.12rem;
}

.assistant-spreadsheet-preview-sheet-head strong {
    font-size: 0.82rem;
}

.assistant-spreadsheet-preview-sheet-head small,
.assistant-spreadsheet-preview-meta {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.assistant-spreadsheet-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.assistant-spreadsheet-preview-warnings {
    display: grid;
    gap: 0.25rem;
    color: #92400e;
    font-size: 0.75rem;
}

.assistant-spreadsheet-preview-table-wrap {
    overflow: auto;
    border-radius: 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.95);
}

.assistant-spreadsheet-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.assistant-spreadsheet-preview-table th,
.assistant-spreadsheet-preview-table td {
    padding: 0.42rem 0.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.assistant-spreadsheet-preview-table th {
    position: sticky;
    top: 0;
    background: rgba(248, 250, 252, 0.96);
    font-weight: 700;
}

.assistant-spreadsheet-preview-table tbody tr:last-child td {
    border-bottom: 0;
}

.assistant-spreadsheet-preview-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.assistant-source-empty {
    padding: 1rem 1.1rem;
    color: var(--text-muted);
    min-height: clamp(120px, 18vh, 180px);
    display: flex;
    align-items: center;
}

.assistant-source-delete {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.assistant-source-delete:hover,
.assistant-source-delete:focus {
    color: #dc2626;
}

.assistant-source-transcript {
    margin-top: 0.4rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    grid-column: 2 / -1;
}

.assistant-source-transcript summary {
    cursor: pointer;
    color: #2563eb;
    font-weight: 600;
}

.assistant-source-transcript textarea {
    width: 100%;
    margin-top: 0.55rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 0.8rem 0.9rem;
    resize: vertical;
}

.assistant-source-transcript-actions {
    margin-top: 0.55rem;
    display: flex;
    justify-content: flex-end;
}

.assistant-textarea {
    min-height: 170px;
    max-height: 190px;
    resize: none;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.32);
    padding: 0.95rem 4rem 0.95rem 1rem;
    line-height: 1.55;
    overflow-y: auto;
}

.assistant-dictation-btn {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: rgba(255, 255, 255, 0.96);
    color: #2563eb;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.assistant-dictation-btn:hover,
.assistant-dictation-btn:focus {
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.28);
}

.assistant-dictation-btn.is-active {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.22);
    background: rgba(254, 242, 242, 0.98);
    animation: assistantPulse 1.5s ease-in-out infinite;
}

.assistant-dictation-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.assistant-input-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 0;
    align-items: end;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.98);
}

.assistant-input-toolbar-bottom {
    padding-top: 1rem;
    margin-top: 0.15rem;
    box-shadow: 0 -14px 24px rgba(255, 255, 255, 0.96);
}

.assistant-project-field {
    max-width: 380px;
}

.assistant-project-field label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding-right: 0.4rem;
    background: rgba(255, 255, 255, 0.98);
    position: relative;
    z-index: 1;
}

.assistant-input-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.assistant-input-meta-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    text-align: right;
}

.assistant-dictation-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #2563eb;
    font-weight: 600;
    white-space: nowrap;
}

.assistant-dictation-status.is-active {
    color: #dc2626;
}

.assistant-dictation-status::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: currentColor;
    display: inline-block;
}

.assistant-input-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.85rem;
}

.assistant-input-actions .btn-primary {
    min-width: 170px;
    min-height: 3.1rem;
    border-radius: 1rem;
    padding-inline: 1.35rem;
}

.assistant-source-recap {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-primary);
    font-weight: 500;
}

.assistant-source-recap-inline {
    justify-content: center;
    width: auto;
    font-size: 0.92rem;
    overflow: hidden;
}

.assistant-source-recap-head {
    max-width: 100%;
}

.assistant-source-recap-head .assistant-source-recap-pill {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.assistant-source-recap-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.assistant-source-recap-pill + .assistant-source-recap-pill {
    border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.assistant-source-recap-pill i {
    color: #2563eb;
}

.assistant-source-recap-pill.is-total {
    font-weight: 700;
}

.assistant-preview-overlay {
    position: absolute;
    inset: 1.2rem;
    background: rgba(15, 23, 42, 0.78);
    border-radius: 1.1rem;
    display: grid;
    place-items: center;
    padding: 1.2rem;
    z-index: 10;
}

.assistant-preview-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.9rem;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.32);
}

.assistant-preview-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.assistant-loading-state,
.assistant-success-state {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.9rem;
}

.assistant-success-icon {
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.assistant-loading-state {
    position: relative;
    overflow: hidden;
    gap: 1.25rem;
}

.assistant-loading-state::before {
    content: "";
    position: absolute;
    inset: 5% 14% 18%;
    background:
        radial-gradient(circle at 50% 38%, rgba(59, 130, 246, 0.16), rgba(59, 130, 246, 0) 36%),
        radial-gradient(circle at 50% 56%, rgba(103, 232, 249, 0.12), rgba(103, 232, 249, 0) 34%),
        radial-gradient(circle at 58% 48%, rgba(139, 92, 246, 0.11), rgba(139, 92, 246, 0) 42%);
    filter: blur(26px);
    pointer-events: none;
}

.assistant-loading-orb {
    position: relative;
    width: clamp(210px, 22vw, 290px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    isolation: isolate;
    filter: none;
}

.assistant-loading-orb::after {
    content: "";
    position: absolute;
    inset: auto 14% -10% 14%;
    height: 16%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, rgba(103, 232, 249, 0.48), rgba(96, 165, 250, 0.22) 34%, rgba(168, 85, 247, 0.18) 58%, rgba(168, 85, 247, 0) 76%);
    filter: blur(12px);
    opacity: 0.88;
    pointer-events: none;
}

.assistant-loading-orb > .premium-orb--assistant-loading {
    position: absolute;
    inset: 0;
    --orb-speed: 5.6s;
    --orb-glow: 1.12;
    --orb-deformation: 4.2%;
    --orb-opacity: 1;
    filter: saturate(116%) drop-shadow(0 26px 44px rgba(37, 99, 235, 0.22));
}

.assistant-loading-orb > * {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.assistant-loading-orb__backglow {
    inset: -24%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 42% 42%, rgba(125, 211, 252, 0.36), rgba(125, 211, 252, 0) 38%),
        radial-gradient(circle at 62% 56%, rgba(96, 165, 250, 0.26), rgba(96, 165, 250, 0) 44%),
        radial-gradient(circle at 54% 52%, rgba(168, 85, 247, 0.18), rgba(168, 85, 247, 0) 48%);
    filter: blur(28px);
    opacity: 0.92;
    animation: assistantOrbBackglow 9.4s ease-in-out infinite alternate;
}

.assistant-loading-orb__halo {
    inset: -7%;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.14) 34%, rgba(96, 165, 250, 0.12) 54%, rgba(96, 165, 250, 0) 72%);
    filter: blur(9px);
    opacity: 0.92;
    animation: assistantOrbBreathe 8.6s ease-in-out infinite;
}

.assistant-loading-orb__shell {
    background:
        radial-gradient(circle at 26% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.24) 18%, rgba(255, 255, 255, 0.06) 28%, rgba(255, 255, 255, 0) 44%),
        radial-gradient(circle at 74% 72%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.2) 18%, rgba(255, 255, 255, 0) 36%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        inset 0 -18px 28px rgba(139, 92, 246, 0.1),
        inset 14px 20px 34px rgba(255, 255, 255, 0.34),
        inset -18px -18px 32px rgba(59, 130, 246, 0.14);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    overflow: hidden;
    opacity: 0.92;
    animation: assistantOrbMorph 8.8s cubic-bezier(0.42, 0, 0.24, 1) infinite;
}

.assistant-loading-orb__shell::before,
.assistant-loading-orb__shell::after,
.assistant-loading-orb__core::before,
.assistant-loading-orb__core::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.assistant-loading-orb__shell::before {
    inset: 6% 8%;
    background:
        linear-gradient(118deg, rgba(255, 255, 255, 0) 18%, rgba(255, 255, 255, 0.34) 36%, rgba(255, 255, 255, 0.08) 52%, rgba(255, 255, 255, 0) 70%),
        radial-gradient(circle at 24% 28%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 34%);
    mix-blend-mode: screen;
    filter: blur(4px);
    opacity: 0.82;
    animation: assistantOrbShellSweep 6.9s ease-in-out infinite;
}

.assistant-loading-orb__shell::after {
    inset: 18% 14%;
    background:
        linear-gradient(210deg, rgba(103, 232, 249, 0.02), rgba(103, 232, 249, 0.22) 34%, rgba(59, 130, 246, 0.08) 54%, rgba(255, 255, 255, 0) 72%);
    filter: blur(8px);
    opacity: 0.54;
    mix-blend-mode: screen;
    animation: assistantOrbShellInner 8.4s ease-in-out infinite;
}

.assistant-loading-orb__core {
    inset: 12%;
    background:
        radial-gradient(circle at 50% 50%, rgba(29, 78, 216, 0.94) 0%, rgba(59, 130, 246, 0.78) 24%, rgba(96, 165, 250, 0.52) 42%, rgba(125, 211, 252, 0.16) 60%, rgba(125, 211, 252, 0) 72%),
        conic-gradient(from 145deg, rgba(255, 255, 255, 0.14), rgba(96, 165, 250, 0.58), rgba(6, 182, 212, 0.44), rgba(99, 102, 241, 0.56), rgba(255, 255, 255, 0.14));
    filter: blur(1px) saturate(116%);
    mix-blend-mode: screen;
    overflow: hidden;
    opacity: 0.96;
    animation: assistantOrbCore 9.2s cubic-bezier(0.42, 0, 0.24, 1) infinite;
}

.assistant-loading-orb__core::before {
    inset: 8% 10%;
    background:
        linear-gradient(102deg, rgba(255, 255, 255, 0) 8%, rgba(125, 211, 252, 0.5) 28%, rgba(37, 99, 235, 0.22) 46%, rgba(255, 255, 255, 0) 68%),
        radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 34%);
    filter: blur(7px);
    opacity: 0.9;
    mix-blend-mode: screen;
    animation: assistantOrbCoreRibbon 5.9s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.assistant-loading-orb__core::after {
    inset: 16% 14%;
    background:
        linear-gradient(188deg, rgba(255, 255, 255, 0) 14%, rgba(99, 102, 241, 0.34) 30%, rgba(34, 211, 238, 0.4) 52%, rgba(255, 255, 255, 0) 76%);
    filter: blur(9px);
    opacity: 0.78;
    mix-blend-mode: screen;
    animation: assistantOrbCoreRibbonTwo 8.7s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.assistant-loading-orb__flow {
    inset: 16%;
    opacity: 0.9;
    filter: blur(7px);
    mix-blend-mode: screen;
    background-size: 180% 180%;
}

.assistant-loading-orb__flow--one {
    background:
        linear-gradient(135deg, rgba(6, 182, 212, 0.02) 8%, rgba(6, 182, 212, 0.74) 26%, rgba(59, 130, 246, 0.28) 42%, rgba(255, 255, 255, 0.02) 62%);
    transform: rotate(-18deg) scale(1.03);
    animation: assistantOrbFlowOne 6.8s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.assistant-loading-orb__flow--two {
    inset: 20% 14%;
    background:
        linear-gradient(208deg, rgba(168, 85, 247, 0.04) 8%, rgba(99, 102, 241, 0.58) 32%, rgba(34, 211, 238, 0.68) 50%, rgba(255, 255, 255, 0.05) 74%);
    transform: rotate(26deg) scale(0.96);
    animation: assistantOrbFlowTwo 9.1s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.assistant-loading-orb__flow--three {
    inset: 24% 18%;
    background:
        radial-gradient(circle at 40% 52%, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0) 26%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(96, 165, 250, 0.42) 28%, rgba(37, 99, 235, 0.78) 52%, rgba(59, 130, 246, 0.12) 82%);
    filter: blur(10px);
    transform: rotate(-34deg) scale(1.04);
    animation: assistantOrbFlowThree 7.6s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.assistant-loading-orb__highlight {
    mix-blend-mode: screen;
    opacity: 0.95;
}

.assistant-loading-orb__highlight--main {
    inset: 10% 16% 46% 18%;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.3) 42%, rgba(255, 255, 255, 0) 70%);
    filter: blur(3px);
    transform: rotate(-10deg);
    animation: assistantOrbHighlightMain 7.2s ease-in-out infinite;
}

.assistant-loading-orb__highlight--side {
    inset: 52% 16% 12% 48%;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.22) 40%, rgba(255, 255, 255, 0) 68%);
    filter: blur(4px);
    animation: assistantOrbHighlightSide 8.1s ease-in-out infinite;
}

.assistant-loading-orb__shadow {
    inset: auto 18% -16% 18%;
    height: 18%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.26), rgba(59, 130, 246, 0) 68%);
    filter: blur(10px);
    opacity: 0.65;
    animation: assistantOrbShadow 8.4s ease-in-out infinite;
}

.assistant-success-icon {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    font-size: 2rem;
}

.assistant-loading-state h3 {
    margin: 0;
    font-size: clamp(1.8rem, 2.1vw, 2.3rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.assistant-loading-state p {
    margin: -0.1rem 0 0;
    font-size: 1.02rem;
    color: var(--text-muted);
}

.assistant-loading-actions {
    display: flex;
    gap: 0.75rem;
}

@keyframes assistantOrbMorph {
    0% {
        border-radius: 44% 56% 42% 58% / 58% 42% 56% 44%;
        transform: scale(0.99) rotate(0deg);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.82),
            inset 0 -18px 28px rgba(139, 92, 246, 0.09),
            inset 14px 20px 34px rgba(255, 255, 255, 0.34),
            inset -18px -18px 32px rgba(59, 130, 246, 0.13);
    }
    18% {
        border-radius: 58% 42% 50% 50% / 40% 60% 42% 58%;
        transform: scale(1.006) rotate(0.22deg);
    }
    37% {
        border-radius: 47% 53% 38% 62% / 63% 41% 59% 37%;
        transform: scale(1.016) rotate(-0.28deg);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.84),
            inset 0 -20px 30px rgba(139, 92, 246, 0.12),
            inset 16px 19px 36px rgba(255, 255, 255, 0.36),
            inset -20px -16px 30px rgba(59, 130, 246, 0.16);
    }
    56% {
        border-radius: 40% 60% 57% 43% / 50% 38% 62% 50%;
        transform: scale(0.996) rotate(0.14deg);
    }
    76% {
        border-radius: 61% 39% 45% 55% / 43% 57% 39% 61%;
        transform: scale(1.012) rotate(-0.2deg);
    }
    100% {
        border-radius: 43% 57% 60% 40% / 56% 44% 53% 47%;
        transform: scale(0.992) rotate(0deg);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.8),
            inset 0 -17px 28px rgba(139, 92, 246, 0.08),
            inset 13px 18px 32px rgba(255, 255, 255, 0.31),
            inset -17px -18px 31px rgba(59, 130, 246, 0.12);
    }
}

@keyframes assistantOrbBreathe {
    0% {
        transform: scale(0.986);
        opacity: 0.74;
    }
    35% {
        transform: scale(1.008);
        opacity: 0.88;
    }
    68% {
        transform: scale(1.02);
        opacity: 0.92;
    }
    100% {
        transform: scale(0.992);
        opacity: 0.8;
    }
}

@keyframes assistantOrbBackglow {
    0% {
        transform: scale(0.99);
        opacity: 0.72;
    }
    33% {
        transform: scale(1.02);
        opacity: 0.86;
    }
    66% {
        transform: scale(1.035);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 0.78;
    }
}

@keyframes assistantOrbCore {
    0% {
        border-radius: 56% 44% 48% 52% / 44% 59% 41% 56%;
        transform: translate(-2px, -1px) scale(0.994);
        filter: blur(1px) saturate(116%);
    }
    22% {
        border-radius: 46% 54% 39% 61% / 61% 42% 58% 39%;
        transform: translate(3px, -2px) scale(1.012);
    }
    47% {
        border-radius: 60% 40% 55% 45% / 41% 55% 45% 59%;
        transform: translate(4px, 3px) scale(1.02);
        filter: blur(1.6px) saturate(124%);
    }
    71% {
        border-radius: 41% 59% 53% 47% / 58% 39% 61% 42%;
        transform: translate(-3px, 4px) scale(1.006);
    }
    100% {
        border-radius: 58% 42% 60% 40% / 45% 58% 42% 55%;
        transform: translate(1px, 0) scale(0.998);
        filter: blur(1.1px) saturate(118%);
    }
}

@keyframes assistantOrbFlowOne {
    0% {
        border-radius: 63% 37% 45% 55% / 40% 61% 39% 60%;
        transform: rotate(-22deg) translate(-4px, -6px) scale(1);
        opacity: 0.7;
    }
    28% {
        border-radius: 43% 57% 35% 65% / 60% 42% 58% 40%;
        transform: rotate(-13deg) translate(0, -3px) scale(1.07);
    }
    57% {
        border-radius: 59% 41% 61% 39% / 44% 62% 38% 56%;
        transform: rotate(-4deg) translate(5px, 3px) scale(1.05);
        opacity: 0.92;
    }
    82% {
        border-radius: 39% 61% 52% 48% / 66% 34% 66% 34%;
        transform: rotate(-17deg) translate(3px, 6px) scale(1);
    }
    100% {
        border-radius: 62% 38% 43% 57% / 38% 60% 40% 62%;
        transform: rotate(-24deg) translate(-4px, 3px) scale(1.02);
        opacity: 0.76;
    }
}

@keyframes assistantOrbFlowTwo {
    0% {
        border-radius: 40% 60% 63% 37% / 56% 39% 61% 44%;
        transform: rotate(18deg) translate(6px, -2px) scale(0.95);
        opacity: 0.64;
    }
    24% {
        border-radius: 61% 39% 44% 56% / 38% 58% 42% 62%;
        transform: rotate(25deg) translate(3px, 1px) scale(1.03);
    }
    52% {
        border-radius: 45% 55% 38% 62% / 64% 43% 57% 36%;
        transform: rotate(31deg) translate(-4px, 6px) scale(1.06);
        opacity: 0.9;
    }
    78% {
        border-radius: 58% 42% 62% 38% / 42% 60% 40% 58%;
        transform: rotate(21deg) translate(-6px, 3px) scale(1.01);
    }
    100% {
        border-radius: 38% 62% 55% 45% / 60% 37% 63% 40%;
        transform: rotate(27deg) translate(3px, -5px) scale(0.99);
        opacity: 0.72;
    }
}

@keyframes assistantOrbFlowThree {
    0% {
        border-radius: 60% 40% 39% 61% / 46% 64% 36% 54%;
        transform: rotate(-36deg) translate(1px, -2px) scale(0.98);
        opacity: 0.82;
    }
    30% {
        border-radius: 42% 58% 62% 38% / 36% 56% 44% 64%;
        transform: rotate(-27deg) translate(5px, 3px) scale(1.07);
    }
    60% {
        border-radius: 64% 36% 42% 58% / 61% 39% 61% 39%;
        transform: rotate(-17deg) translate(3px, 5px) scale(1.05);
        opacity: 0.94;
    }
    84% {
        border-radius: 37% 63% 58% 42% / 43% 62% 38% 57%;
        transform: rotate(-31deg) translate(-4px, 4px) scale(1);
    }
    100% {
        border-radius: 59% 41% 54% 46% / 40% 58% 42% 60%;
        transform: rotate(-40deg) translate(-3px, -2px) scale(1.02);
        opacity: 0.72;
    }
}

@keyframes assistantOrbHighlightMain {
    0% {
        transform: translate(-5px, -3px) scale(0.98) rotate(-8deg);
        opacity: 0.82;
    }
    26% {
        transform: translate(-1px, -5px) scale(1.02) rotate(-5deg);
    }
    55% {
        transform: translate(5px, 1px) scale(1.07) rotate(-1deg);
        opacity: 0.98;
    }
    100% {
        transform: translate(-2px, 5px) scale(0.99) rotate(-10deg);
        opacity: 0.84;
    }
}

@keyframes assistantOrbHighlightSide {
    0% {
        transform: translate(3px, 1px) scale(0.96);
        opacity: 0.66;
    }
    34% {
        transform: translate(-2px, -4px) scale(1.02);
    }
    68% {
        transform: translate(-5px, -1px) scale(1.05);
        opacity: 0.9;
    }
    100% {
        transform: translate(1px, 4px) scale(0.98);
        opacity: 0.72;
    }
}

@keyframes assistantOrbShadow {
    0% {
        transform: scaleX(0.94) scaleY(0.9);
        opacity: 0.42;
    }
    38% {
        transform: scaleX(1.03) scaleY(0.96);
        opacity: 0.56;
    }
    71% {
        transform: scaleX(1.06) scaleY(1);
        opacity: 0.62;
    }
    100% {
        transform: scaleX(0.97) scaleY(0.92);
        opacity: 0.48;
    }
}

@keyframes assistantOrbShellSweep {
    0% {
        transform: translateX(-8px) translateY(-3px) rotate(-10deg) scale(0.98);
        opacity: 0.56;
    }
    35% {
        transform: translateX(2px) translateY(-5px) rotate(-3deg) scale(1.02);
        opacity: 0.82;
    }
    68% {
        transform: translateX(9px) translateY(2px) rotate(4deg) scale(1.04);
        opacity: 0.96;
    }
    100% {
        transform: translateX(-2px) translateY(5px) rotate(-8deg) scale(0.99);
        opacity: 0.62;
    }
}

@keyframes assistantOrbShellInner {
    0% {
        transform: rotate(-18deg) translate(-5px, 1px) scale(0.98);
        opacity: 0.34;
    }
    50% {
        transform: rotate(-7deg) translate(4px, -3px) scale(1.04);
        opacity: 0.58;
    }
    100% {
        transform: rotate(-22deg) translate(1px, 5px) scale(1);
        opacity: 0.4;
    }
}

@keyframes assistantOrbCoreRibbon {
    0% {
        transform: rotate(-18deg) translate(-9px, -2px) scale(0.94);
        opacity: 0.5;
    }
    28% {
        transform: rotate(-10deg) translate(-2px, -4px) scale(1.03);
        opacity: 0.82;
    }
    62% {
        transform: rotate(2deg) translate(8px, 3px) scale(1.06);
        opacity: 0.96;
    }
    100% {
        transform: rotate(-14deg) translate(-3px, 7px) scale(0.98);
        opacity: 0.58;
    }
}

@keyframes assistantOrbCoreRibbonTwo {
    0% {
        transform: rotate(18deg) translate(8px, -4px) scale(0.98);
        opacity: 0.36;
    }
    32% {
        transform: rotate(26deg) translate(3px, -1px) scale(1.02);
        opacity: 0.62;
    }
    66% {
        transform: rotate(34deg) translate(-6px, 5px) scale(1.05);
        opacity: 0.86;
    }
    100% {
        transform: rotate(20deg) translate(2px, 6px) scale(0.99);
        opacity: 0.42;
    }
}

.assistant-result-shell {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    min-height: 100%;
}

.assistant-result-head {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    align-items: flex-start;
}

.assistant-result-intro {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.assistant-result-intro h3 {
    margin: 0 0 0.2rem;
    font-size: 2rem;
    line-height: 1.05;
}

.assistant-result-intro p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.02rem;
}

.assistant-result-status-icon {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
    font-size: 1.55rem;
    flex: 0 0 auto;
}

.assistant-result-relaunch {
    align-self: center;
}

.assistant-count-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
}

.assistant-count-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.05rem 1.15rem;
    min-width: 0;
}

.assistant-count-bar {
    border-radius: 1.15rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #fff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.assistant-count-card + .assistant-count-card {
    border-left: 1px solid rgba(148, 163, 184, 0.16);
}

.assistant-count-card strong {
    display: block;
    font-size: 1.55rem;
    line-height: 1;
    color: var(--text-primary);
}

.assistant-count-card span:last-child {
    display: block;
    margin-top: 0.18rem;
    color: var(--text-secondary);
}

.assistant-count-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.assistant-count-card.is-reminder .assistant-count-icon {
    background: rgba(249, 115, 22, 0.12);
    color: #ea580c;
}

.assistant-count-card.is-note .assistant-count-icon {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.assistant-count-card.is-secret .assistant-count-icon {
    background: rgba(79, 70, 229, 0.12);
    color: #4f46e5;
}

.assistant-count-card.is-link .assistant-count-icon {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
}

.assistant-warnings {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.assistant-warning {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: rgba(251, 191, 36, 0.12);
    color: #92400e;
}

.assistant-result-helper {
    margin: -0.15rem 0 0;
    color: var(--text-muted);
}

.assistant-result-list-head {
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.assistant-result-list-head h4 {
    margin: 0;
    font-size: 1.5rem;
}

.assistant-cards {
    flex: 0 0 auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    display: grid;
    gap: 1rem;
    padding-right: 0.2rem;
    padding-bottom: 0.2rem;
}

.assistant-card {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.15rem;
    background: #fff;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.assistant-card.is-open {
    border-color: rgba(99, 102, 241, 0.22);
}

.assistant-card.is-unselected {
    opacity: 0.78;
}

.assistant-card-preview {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem 1.3rem;
}

.assistant-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    font-size: 1.45rem;
}

.assistant-card.is-reminder .assistant-card-icon {
    background: rgba(249, 115, 22, 0.1);
    color: #ea580c;
}

.assistant-card.is-note .assistant-card-icon {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.assistant-card.is-link .assistant-card-icon {
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
}

.assistant-card.is-secret .assistant-card-icon {
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
}

.assistant-card-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.assistant-card-check input {
    width: 18px;
    height: 18px;
}

.assistant-card-heading {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.assistant-card-heading h4 {
    margin: 0;
    font-size: 1.28rem;
    line-height: 1.15;
}

.assistant-card-type-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #2563eb;
}

.assistant-card-preview-text {
    margin: 0;
    color: var(--text-secondary);
}

.assistant-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-top: 0.1rem;
}

.assistant-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-secondary);
    min-width: 0;
}

.assistant-card-meta-button {
    border: 0;
    padding: 0;
    font: inherit;
    text-align: left;
    background: transparent;
    cursor: pointer;
}

.assistant-card-meta-button:hover,
.assistant-card-meta-button:focus-visible {
    color: var(--text-primary);
}

.assistant-card-meta-inline-editor {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.assistant-card-meta-inline-editor select,
.assistant-card-meta-inline-editor input {
    width: auto;
    min-width: 8.5rem;
    max-width: 15rem;
    min-height: 2rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid rgba(37, 99, 235, 0.5);
    border-radius: 0.55rem;
    color: var(--text-primary);
    background: #fff;
}

.assistant-card-meta-inline-editor input[type="date"] {
    min-width: 9.5rem;
}

.assistant-card-meta-item i {
    color: var(--text-primary);
}

.assistant-card-meta-item.is-low i {
    color: #38bdf8;
}

.assistant-card-meta-item.is-medium i {
    color: #f59e0b;
}

.assistant-card-meta-item.is-high i {
    color: #f97316;
}

.assistant-card-meta-item.is-urgent i {
    color: #ef4444;
}

.assistant-card-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.assistant-card-chevron {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.assistant-card-chevron i {
    transition: transform 0.2s ease;
}

.assistant-card-chevron.is-open i {
    transform: rotate(180deg);
}

.assistant-card-body {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding: 1.15rem 1.3rem 1.3rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.36) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.assistant-card-body.is-disabled {
    opacity: 0.58;
}

.assistant-card-head {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}

.assistant-card-description {
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(248, 250, 252, 0.72);
    padding: 0.85rem 0.95rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.05);
}

.assistant-card.is-secret {
    background: linear-gradient(180deg, #ffffff 0%, #f7f7ff 100%);
}

.assistant-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.assistant-field-span-2 {
    grid-column: span 2;
}

.assistant-card label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.assistant-card input,
.assistant-card select,
.assistant-card textarea {
    width: 100%;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 0.7rem 0.85rem;
    color: var(--text-primary);
    background: #fff;
}

.assistant-card textarea {
    min-height: 110px;
    resize: vertical;
}

.assistant-secret-inline {
    display: flex;
    gap: 0.6rem;
}

.assistant-secret-inline input {
    flex: 1;
}

.assistant-footer-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-top: 0.95rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.92) 18%, rgba(255, 255, 255, 1) 100%);
}

.assistant-success-list {
    width: 100%;
    display: grid;
    gap: 0.8rem;
    max-width: 560px;
}

.assistant-success-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    text-decoration: none;
    color: inherit;
}

.assistant-success-item span {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

body.theme-dark .btn-assistant {
    border-color: rgba(96, 165, 250, 0.24);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(17, 24, 39, 0.94) 100%);
    color: #e5eefc;
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.34);
}

body.theme-dark .btn-assistant:hover,
body.theme-dark .btn-assistant:focus {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%);
    color: #f8fbff;
    border-color: rgba(96, 165, 250, 0.38);
}

body.theme-dark .assistant-modal-content,
body.theme-dark .assistant-modal-header,
body.theme-dark .assistant-modal-body {
    background: #111827;
    color: #e5e7eb;
}

body.theme-dark .assistant-field-help,
body.theme-dark .assistant-block-head p,
body.theme-dark .assistant-input-meta,
body.theme-dark .assistant-result-intro p,
body.theme-dark .assistant-result-helper,
body.theme-dark .assistant-card-preview-text,
body.theme-dark .assistant-card-meta-item,
body.theme-dark .assistant-card label,
body.theme-dark .assistant-success-item,
body.theme-dark .assistant-source-empty,
body.theme-dark .assistant-source-item-body small,
body.theme-dark .assistant-spreadsheet-preview-sheet-head small,
body.theme-dark .assistant-spreadsheet-preview-meta,
body.theme-dark .assistant-spreadsheet-preview-empty {
    color: #94a3b8;
}

body.theme-dark .assistant-attachments-block,
body.theme-dark .assistant-input-toolbar,
body.theme-dark .assistant-result-list-head,
body.theme-dark .assistant-card-body {
    border-color: rgba(71, 85, 105, 0.42);
}

body.theme-dark .assistant-source-summary,
body.theme-dark .assistant-upload-dropzone,
body.theme-dark .assistant-source-item,
body.theme-dark .assistant-source-empty,
body.theme-dark .assistant-spreadsheet-preview-table-wrap,
body.theme-dark .assistant-count-bar,
body.theme-dark .assistant-card,
body.theme-dark .assistant-success-item,
body.theme-dark .assistant-source-recap,
body.theme-dark .assistant-dictation-btn {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(71, 85, 105, 0.48);
    box-shadow: none;
}

body.theme-dark .assistant-source-summary {
    color: #bfdbfe;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.88) 100%);
}

body.theme-dark .assistant-upload-dropzone {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
}

body.theme-dark .assistant-upload-dropzone.is-dragover {
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.16);
}

body.theme-dark .assistant-upload-dropzone small,
body.theme-dark .assistant-source-grip,
body.theme-dark .assistant-source-delete,
body.theme-dark .assistant-source-item-body p,
body.theme-dark .assistant-spreadsheet-preview-table td,
body.theme-dark .assistant-spreadsheet-preview-table th,
body.theme-dark .assistant-project-field label {
    color: #cbd5e1;
}

body.theme-dark .assistant-spreadsheet-preview-sheet,
body.theme-dark .assistant-card-description,
body.theme-dark .assistant-card-body,
body.theme-dark .assistant-card.is-secret {
    background: rgba(17, 24, 39, 0.82);
    border-color: rgba(71, 85, 105, 0.4);
    box-shadow: none;
}

body.theme-dark .assistant-spreadsheet-preview-table th {
    background: rgba(30, 41, 59, 0.96);
}

body.theme-dark .assistant-spreadsheet-preview-table th,
body.theme-dark .assistant-spreadsheet-preview-table td {
    border-bottom-color: rgba(71, 85, 105, 0.32);
}

body.theme-dark .assistant-source-transcript,
body.theme-dark .assistant-source-transcript textarea,
body.theme-dark .assistant-card input,
body.theme-dark .assistant-card select,
body.theme-dark .assistant-card textarea,
body.theme-dark .assistant-textarea,
body.theme-dark .assistant-project-field .form-select {
    background: rgba(15, 23, 42, 0.92);
    color: #e5e7eb;
    border-color: rgba(71, 85, 105, 0.5);
}

body.theme-dark .assistant-textarea::placeholder,
body.theme-dark .assistant-source-transcript textarea::placeholder,
body.theme-dark .assistant-card input::placeholder,
body.theme-dark .assistant-card textarea::placeholder {
    color: #64748b;
}

body.theme-dark .assistant-dictation-btn {
    color: #60a5fa;
}

body.theme-dark .assistant-dictation-btn:hover,
body.theme-dark .assistant-dictation-btn:focus {
    color: #93c5fd;
    border-color: rgba(96, 165, 250, 0.38);
}

body.theme-dark .assistant-dictation-btn.is-active {
    background: rgba(127, 29, 29, 0.3);
    border-color: rgba(248, 113, 113, 0.42);
    color: #fca5a5;
}

body.theme-dark .assistant-input-toolbar {
    background: rgba(17, 24, 39, 0.98);
}

body.theme-dark .assistant-input-toolbar-bottom {
    box-shadow: 0 -14px 24px rgba(17, 24, 39, 0.96);
}

body.theme-dark .assistant-project-field label {
    background: rgba(17, 24, 39, 0.98);
}

body.theme-dark .assistant-footer-actions {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0) 0%, rgba(17, 24, 39, 0.92) 18%, rgba(17, 24, 39, 1) 100%);
}

body.theme-dark .assistant-card-chevron,
body.theme-dark .assistant-add-source-btn {
    border-color: rgba(71, 85, 105, 0.48);
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.84);
}

body.theme-dark .assistant-card-chevron:hover,
body.theme-dark .assistant-add-source-btn:hover {
    color: #f8fafc;
    background: rgba(30, 41, 59, 0.92);
}

body.theme-dark .assistant-card-meta-inline-editor select,
body.theme-dark .assistant-card-meta-inline-editor input {
    border-color: rgba(96, 165, 250, 0.58);
    color: #e5e7eb;
    background: #0f172a;
}

body.theme-dark .assistant-source-recap-pill + .assistant-source-recap-pill,
body.theme-dark .assistant-count-card + .assistant-count-card {
    border-color: rgba(71, 85, 105, 0.36);
}

body.theme-dark .assistant-count-card strong,
body.theme-dark .assistant-card-heading h4,
body.theme-dark .assistant-result-intro h3,
body.theme-dark .assistant-source-item-body strong,
body.theme-dark .assistant-result-list-head h4 {
    color: #f8fafc;
}

body.theme-dark .assistant-warning {
    background: rgba(120, 53, 15, 0.22);
    color: #fbbf24;
}

@keyframes assistantPulse {
    0%,
    100% {
        transform: scale(0.96);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.28);
    }
    50% {
        transform: scale(1);
        box-shadow: 0 0 0 18px rgba(37, 99, 235, 0);
    }
}

@keyframes premiumOrbMorph {
    0% {
        border-radius: 48% 52% 51% 49% / 52% 47% 53% 48%;
        transform: translate3d(0, 0, 0) scale(1);
    }
    25% {
        border-radius: 50% 50% 48% 52% / 49% 47% 53% 51%;
        transform: translate3d(calc(var(--orb-deformation) * 0.3), calc(var(--orb-deformation) * -0.5), 0) scale(1.018);
    }
    50% {
        border-radius: 46% 54% 53% 47% / 54% 45% 55% 46%;
        transform: translate3d(calc(var(--orb-deformation) * -0.26), calc(var(--orb-deformation) * 0.38), 0) scale(1.026);
    }
    75% {
        border-radius: 51% 49% 47% 53% / 48% 52% 47% 53%;
        transform: translate3d(calc(var(--orb-deformation) * 0.2), calc(var(--orb-deformation) * 0.22), 0) scale(1.012);
    }
    100% {
        border-radius: 48% 52% 51% 49% / 52% 47% 53% 48%;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes premiumOrbBob {
    0%,
    100% {
        filter: hue-rotate(var(--orb-hue, 0deg)) saturate(112%) drop-shadow(0 16px 28px rgba(var(--orb-shadow-rgb, 37, 99, 235), calc(0.18 * var(--orb-glow))));
    }
    50% {
        filter: hue-rotate(var(--orb-hue, 0deg)) saturate(122%) drop-shadow(0 26px 38px rgba(var(--orb-shadow-rgb, 37, 99, 235), calc(0.3 * var(--orb-glow))));
    }
}

@keyframes premiumOrbDrift {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    25% {
        transform: translate3d(calc(var(--orb-deformation) * 0.08), calc(var(--orb-deformation) * -0.14), 0) rotate(1.4deg);
    }
    50% {
        transform: translate3d(calc(var(--orb-deformation) * -0.1), calc(var(--orb-deformation) * 0.08), 0) rotate(-1.8deg);
    }
    75% {
        transform: translate3d(calc(var(--orb-deformation) * 0.06), calc(var(--orb-deformation) * 0.16), 0) rotate(1deg);
    }
}

@keyframes premiumOrbRim {
    0%,
    100% {
        opacity: 0.9;
        transform: rotate(0deg) scale(1);
    }
    50% {
        opacity: 1;
        transform: rotate(11deg) scale(1.02);
    }
}

@keyframes premiumOrbCore {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(0.98);
        opacity: 0.86;
    }
    50% {
        transform: translate3d(calc(var(--orb-deformation) * -0.42), calc(var(--orb-deformation) * 0.22), 0) scale(1.08);
        opacity: 0.98;
    }
}

@keyframes premiumOrbClouds {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
        opacity: 0.8;
    }
    33% {
        transform: translate3d(calc(var(--orb-deformation) * 0.34), calc(var(--orb-deformation) * -0.18), 0) rotate(7deg) scale(1.08);
        opacity: 0.96;
    }
    66% {
        transform: translate3d(calc(var(--orb-deformation) * -0.26), calc(var(--orb-deformation) * 0.24), 0) rotate(-6deg) scale(0.96);
        opacity: 0.86;
    }
}

@keyframes premiumOrbParticles {
    0% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
        opacity: 0.34;
    }
    50% {
        transform: translate3d(calc(var(--orb-deformation) * 0.22), calc(var(--orb-deformation) * -0.22), 0) scale(1.08) rotate(5deg);
        opacity: 0.86;
    }
    100% {
        transform: translate3d(calc(var(--orb-deformation) * -0.18), calc(var(--orb-deformation) * 0.18), 0) scale(0.96) rotate(-4deg);
        opacity: 0.42;
    }
}

@keyframes premiumOrbSheen {
    0%,
    100% {
        transform: rotate(0deg) scale(1);
        opacity: 0.92;
    }
    50% {
        transform: rotate(8deg) scale(1.02);
        opacity: 1;
    }
}

@keyframes premiumOrbShine {
    0%,
    100% {
        transform: rotate(-12deg) translate3d(0, 0, 0) scale(0.94);
        opacity: 0.84;
    }
    50% {
        transform: rotate(-4deg) translate3d(calc(var(--orb-deformation) * 0.48), calc(var(--orb-deformation) * -0.34), 0) scale(1.08);
        opacity: 1;
    }
}

@keyframes premiumOrbLowerLight {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(0.96);
        opacity: 0.66;
    }
    50% {
        transform: translate3d(calc(var(--orb-deformation) * -0.3), calc(var(--orb-deformation) * 0.24), 0) scale(1.12);
        opacity: 0.96;
    }
}

@media (prefers-reduced-motion: reduce) {
    .premium-orb,
    .premium-orb::before,
    .premium-orb > *,
    .premium-orb__shine::before,
    .premium-orb__shine::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 991px) {
    .assistant-modal-dialog.assistant-modal-dialog-input,
    .assistant-modal-dialog.assistant-modal-dialog-result {
        max-width: calc(100vw - 1.25rem);
        width: calc(100vw - 1.25rem);
        margin: 0.625rem;
    }

    .assistant-modal-body {
        max-height: calc(90vh - 68px);
        padding: 1.1rem;
    }

    .assistant-modal-body.is-result-stage {
        overflow-y: auto;
    }

    .assistant-input-form {
        overflow: auto;
    }

    .assistant-modal-topline,
    .assistant-block-head,
    .assistant-block-head-actions,
    .assistant-attachments-layout,
    .assistant-upload-footer,
    .assistant-input-meta,
    .assistant-result-head,
    .assistant-footer-actions,
    .assistant-secret-inline {
        flex-direction: column;
    }

    .assistant-attachments-layout,
    .assistant-input-toolbar {
        grid-template-columns: 1fr;
    }

    .assistant-input-meta-right {
        justify-content: flex-start;
        text-align: left;
        flex-wrap: wrap;
    }

    .assistant-source-list-panel {
        max-height: 280px;
        min-height: 240px;
    }

    .assistant-source-item {
        grid-template-columns: 16px 40px minmax(0, 1fr) auto;
    }

    .assistant-source-actions {
        min-width: 0;
    }

    .assistant-input-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .assistant-source-recap-inline {
        width: 100%;
    }

    .assistant-field-grid,
    .assistant-count-grid {
        grid-template-columns: 1fr;
    }

    .assistant-field-span-2 {
        grid-column: span 1;
    }

    .assistant-source-item {
        grid-template-columns: 1fr;
    }

    .assistant-result-head,
    .assistant-result-intro,
    .assistant-card-preview {
        grid-template-columns: 1fr;
        display: grid;
    }

    .assistant-result-relaunch {
        align-self: stretch;
    }

    .assistant-count-card + .assistant-count-card {
        border-left: 0;
        border-top: 1px solid rgba(148, 163, 184, 0.16);
    }

.assistant-card-actions {
        justify-content: flex-start;
    }
}

/* MonWorkspace v2 — phase 1 shell foundation. */
.app-shell--foundation {
    --sidebar-width: var(--mw-shell-sidebar-width);
    background: var(--mw-color-canvas);
}

.app-shell__main {
    min-width: 0;
    background: var(--mw-color-canvas);
}

.sidebar[data-shell-zone="sidebar"] {
    background: var(--mw-color-sidebar-surface);
    color: var(--mw-color-sidebar-text);
}

.app-shell__header {
    min-height: 3rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--mw-shell-gap);
    margin-bottom: var(--mw-shell-gap);
}

.topbar__start,
.topbar__end {
    min-width: 0;
    display: flex;
    align-items: center;
}

.topbar__end {
    justify-content: flex-end;
}


.app-shell--foundation :where(button, a, input, select, textarea):focus-visible {
    outline: 3px solid var(--mw-color-focus-ring);
    outline-offset: 2px;
}

.app-shell--foundation .page-content {
    width: min(100%, var(--mw-shell-content-max-width));
    margin-inline: auto;
    gap: var(--mw-shell-gap);
}

@media (max-width: 991px) {
    .app-shell__header {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

}

@media (max-width: 700px) {
    .app-shell__header {
        gap: 0.7rem;
        margin-bottom: 0.85rem;
    }


}

/* MonWorkspace v2 — visual simplification pass. */
.app-shell--foundation .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.app-shell--foundation .sidebar-brand-copy {
    min-width: 0;
}

.app-shell--foundation .workspace-switcher {
    margin: 0.18rem 0 0 0.05rem;
}

.app-shell--foundation .workspace-current {
    width: auto;
    min-height: 1.8rem;
    justify-content: flex-start;
    gap: 0.28rem;
    padding: 0.1rem 0.25rem;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    box-shadow: none;
    color: var(--mw-color-text-muted);
    font-size: 0.78rem;
}

.app-shell--foundation .workspace-current:hover,
.app-shell--foundation .workspace-current:focus-visible {
    background: var(--mw-color-accent-soft);
    color: var(--mw-color-text);
}

.app-shell--foundation .workspace-current-prefix {
    color: var(--mw-color-text-subtle);
}

.app-shell--foundation .workspace-current::after {
    margin-left: 0.12rem;
}

.app-shell--foundation .sidebar-secondary-menu {
    display: none;
}

.app-shell--foundation .app-shell__header,
.app-shell--foundation .page-content {
    width: 100%;
    max-width: none;
}

.app-shell--foundation .page-content {
    margin-inline: 0;
}

.app-shell--foundation .mw-project-nav {
    width: 100%;
    margin-bottom: 1.05rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.app-shell--foundation .mw-project-nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
}

.app-shell--foundation {
    --sidebar-width: 276px;
}

.app-shell--foundation .sidebar-footer-actions {
    display: none !important;
}

.app-shell--foundation .sidebar-footer-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.app-shell--foundation .sidebar-user-chip {
    flex: 1 1 auto;
    min-width: 0;
}

.app-shell--foundation .sidebar-theme-toggle-button {
    flex: 0 0 2.25rem;
    height: 2.25rem;
}

.app-shell--foundation .mw-project-subnav {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    min-height: 2.15rem;
    margin: -0.55rem 0 1.05rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--mw-color-border);
    scrollbar-width: thin;
}

.app-shell--foundation .mw-project-subnav-link {
    flex: 0 0 auto;
    min-height: 2.15rem;
    padding: 0.42rem 0.7rem;
    border-bottom: 2px solid transparent;
    color: var(--mw-color-text-muted);
    font-size: 0.78rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.app-shell--foundation .mw-project-subnav-link:hover,
.app-shell--foundation .mw-project-subnav-link.is-active {
    border-bottom-color: var(--mw-color-accent);
    color: var(--mw-color-accent);
}

@media (max-width: 991px) {
    .app-shell--foundation {
        --sidebar-width: 1fr;
    }
}

.app-shell--foundation .mw-project-nav-spacer,
.app-shell--foundation .mw-project-secondary-menu,
.app-shell--foundation .mw-project-nav-more {
    display: none;
}

.app-shell--foundation .mw-project-overview {
    gap: 1.35rem;
}

.app-shell--foundation .mw-project-intent {
    padding-block: 1.45rem 1.25rem;
}

.app-shell--foundation .sidebar-project-row.is-active .sidebar-project-shortcut {
    display: inline-flex;
}


.app-shell--foundation .journal-page-heading .tasks-hero-copy {
    max-width: none;
}

.app-shell--foundation .journal-page-heading .tasks-hero-title-row {
    align-items: flex-end;
}


body.theme-dark {
    color-scheme: dark;
}

body.theme-dark .app-shell--foundation .app-sidebar {
    background: var(--mw-color-sidebar-surface);
    border-right-color: var(--mw-color-border);
}

body.theme-dark .app-shell--foundation .app-main,
body.theme-dark .app-shell--foundation .page-content {
    background: var(--mw-color-canvas);
}

body.theme-dark .app-shell--foundation .workspace-current,
body.theme-dark .app-shell--foundation .mw-icon-button,
body.theme-dark .app-shell--foundation .sidebar-user-chip {
    border-color: var(--mw-color-border);
    background: var(--mw-color-surface);
    box-shadow: var(--mw-elevation-1);
}

body.theme-dark .app-shell--foundation .workspace-current:hover,
body.theme-dark .app-shell--foundation .workspace-current:focus-visible,
body.theme-dark .app-shell--foundation .sidebar-user-chip:hover,
body.theme-dark .app-shell--foundation .sidebar-user-chip.is-active,
body.theme-dark .app-shell--foundation .sidebar-project-row.is-active {
    background: var(--mw-color-surface-raised);
    border-color: var(--mw-color-border);
}

body.theme-dark .app-shell--foundation .sidebar-project-row.is-active {
    box-shadow: inset 2px 0 0 var(--mw-color-accent);
}

/* Étape 1 — accueil organisateur, isolé des anciennes interfaces projet. */
.organizer-project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: .35rem 0 1.2rem;
}

.organizer-project-identity,
.organizer-project-actions,
.organizer-project-title-line,
.organizer-panel-heading,
.organizer-panel-heading > div,
.organizer-capture-callout {
    display: flex;
    align-items: center;
}

.organizer-project-identity {
    min-width: 0;
    gap: 1rem;
}

.organizer-project-folder {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 auto;
    border-radius: .8rem;
    color: var(--project-accent, var(--mw-color-accent));
    background: color-mix(in srgb, var(--project-accent, var(--mw-color-accent)) 13%, transparent);
    font-size: 1.65rem;
}

.organizer-project-title-line {
    min-width: 0;
    gap: .55rem;
}

.organizer-project-title-line h1 {
    overflow: hidden;
    margin: 0;
    color: var(--mw-color-text);
    font-size: clamp(1.55rem, 2.3vw, 2rem);
    font-weight: 720;
    letter-spacing: -.04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organizer-project-title-line a {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: .45rem;
    color: var(--mw-color-text-subtle);
    font-size: .78rem;
}

.organizer-project-title-line a:hover {
    color: var(--mw-color-accent);
    background: var(--mw-color-accent-soft);
}

.organizer-project-identity p {
    margin: .22rem 0 0;
    color: var(--mw-color-text-muted);
    font-size: .82rem;
}

.organizer-project-actions {
    flex: 0 0 auto;
    gap: .85rem;
}

.organizer-search-trigger {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: min(25vw, 22rem);
    min-width: 15rem;
    min-height: 2.85rem;
    padding: 0 .75rem;
    border: 1px solid var(--mw-color-border-strong);
    border-radius: .7rem;
    color: var(--mw-color-text-muted);
    background: color-mix(in srgb, var(--mw-color-surface) 82%, transparent);
    font: inherit;
    font-size: .79rem;
    text-align: left;
}

.organizer-search-trigger:hover {
    border-color: color-mix(in srgb, var(--mw-color-accent) 55%, var(--mw-color-border));
    color: var(--mw-color-text);
}

.organizer-search-trigger span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organizer-search-trigger kbd {
    padding: 0;
    color: var(--mw-color-text-subtle);
    background: transparent;
    font: inherit;
    font-size: .68rem;
}

.organizer-capture-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.85rem;
    padding-inline: 1.2rem;
    border-radius: .7rem;
    font-weight: 700;
}

.organizer-capture-button .bi {
    display: inline-flex;
    width: 1em;
    height: 1em;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mw-project-nav--organizer {
    gap: .7rem;
    margin-bottom: 1.45rem;
}

.mw-project-nav--organizer > .mw-project-nav-link {
    padding-inline: .8rem;
}

.mw-project-nav--organizer > .mw-project-nav-link i {
    display: none;
}

.organizer-home {
    display: grid;
    gap: 1.2rem;
}

.organizer-home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(22rem, .95fr);
    gap: 1rem;
    align-items: stretch;
}

.organizer-panel {
    display: flex;
    min-width: 0;
    min-height: 32rem;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--mw-color-border);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--mw-color-surface) 92%, transparent);
    box-shadow: var(--mw-elevation-1);
}

.organizer-panel-heading {
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.25rem .95rem;
}

.organizer-panel-heading > div {
    gap: .55rem;
}

.organizer-panel-heading h2 {
    margin: 0;
    color: var(--mw-color-text);
    font-size: 1.18rem;
    font-weight: 720;
    letter-spacing: -.025em;
}

.organizer-panel-heading > div > span {
    color: var(--mw-color-text-subtle);
    font-size: .7rem;
}

.organizer-add-action {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .2rem;
    border: 0;
    color: var(--mw-color-accent);
    background: transparent;
    font: inherit;
    font-size: .8rem;
    font-weight: 650;
    white-space: nowrap;
}

.organizer-add-action:hover {
    color: var(--mw-color-accent-hover);
}

.organizer-filter-row {
    display: flex;
    gap: .35rem;
    overflow-x: auto;
    padding: 0 1.15rem .8rem;
    border-bottom: 1px solid var(--mw-color-border);
}

.organizer-filter-row a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex: 0 0 auto;
    padding: .4rem .65rem;
    border-radius: 999px;
    color: var(--mw-color-text-muted);
    font-size: .7rem;
    font-weight: 650;
    text-decoration: none;
}

.organizer-filter-row a:hover,
.organizer-filter-row a.is-active {
    color: var(--mw-color-accent);
    background: var(--mw-color-accent-soft);
}

.organizer-filter-row span {
    color: inherit;
    opacity: .8;
}

.organizer-task-list,
.organizer-note-list {
    display: grid;
    align-content: start;
    flex: 1;
}

.organizer-task-row {
    display: grid;
    grid-template-columns: 1.35rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    min-height: 3.65rem;
    padding: .62rem 1.25rem;
    border-bottom: 1px solid color-mix(in srgb, var(--mw-color-border) 72%, transparent);
}

.organizer-task-row:hover,
.organizer-note-row:hover {
    background: color-mix(in srgb, var(--mw-color-accent-soft) 35%, transparent);
}

.organizer-task-toggle {
    margin: 0;
}

.organizer-task-toggle button,
.organizer-task-toggle.is-readonly {
    display: grid;
    place-items: center;
    width: 1.15rem;
    height: 1.15rem;
    padding: 0;
    border: 1px solid var(--mw-color-border-strong);
    border-radius: .32rem;
    color: #fff;
    background: transparent;
    font-size: .72rem;
}

.organizer-task-toggle button:hover {
    border-color: var(--mw-color-accent);
}

.organizer-task-row.is-done .organizer-task-toggle button,
.organizer-task-row.is-done .organizer-task-toggle.is-readonly {
    border-color: var(--mw-color-accent);
    background: var(--mw-color-accent);
}

.organizer-task-copy {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .55rem;
    color: inherit;
    text-decoration: none;
}

.organizer-task-copy strong {
    overflow: hidden;
    color: var(--mw-color-text);
    font-size: .82rem;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organizer-task-copy > span {
    display: flex;
    gap: .3rem;
    flex: 0 0 auto;
}

.organizer-task-copy .badge {
    padding: .24rem .42rem;
    font-size: .6rem;
}

.organizer-task-row > time {
    color: var(--mw-color-text-muted);
    font-size: .68rem;
    white-space: nowrap;
}

.organizer-task-row > time i {
    margin-right: .3rem;
}

.organizer-task-row > time.is-overdue {
    color: var(--mw-color-danger);
}

.organizer-task-row.is-done .organizer-task-copy strong {
    color: var(--mw-color-text-subtle);
    text-decoration: line-through;
}

.organizer-note-row {
    display: grid;
    grid-template-columns: 1.45rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .75rem;
    min-height: 4.45rem;
    padding: .72rem 1.25rem;
    border-bottom: 1px solid color-mix(in srgb, var(--mw-color-border) 72%, transparent);
    color: inherit;
    text-decoration: none;
}

.organizer-note-icon {
    color: var(--mw-color-text-muted);
    font-size: 1rem;
}

.organizer-note-copy {
    display: grid;
    min-width: 0;
    gap: .2rem;
}

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

.organizer-note-copy strong {
    color: var(--mw-color-text);
    font-size: .82rem;
    font-weight: 650;
}

.organizer-note-copy small,
.organizer-note-row time {
    color: var(--mw-color-text-muted);
    font-size: .68rem;
}

.organizer-note-row time {
    white-space: nowrap;
}

.organizer-note-pin {
    color: var(--mw-color-accent);
    font-size: .72rem;
}

.organizer-empty {
    display: grid;
    place-items: center;
    align-content: center;
    gap: .3rem;
    min-height: 12rem;
    padding: 1.5rem;
    color: var(--mw-color-text-muted);
    text-align: center;
}

.organizer-empty > i {
    margin-bottom: .2rem;
    color: var(--mw-color-accent);
    font-size: 1.45rem;
}

.organizer-empty strong {
    color: var(--mw-color-text);
    font-size: .82rem;
}

.organizer-empty span {
    font-size: .7rem;
}

.organizer-panel-footer {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: fit-content;
    margin: auto 1.25rem 0;
    padding: 1rem 0 1.15rem;
    color: var(--mw-color-accent);
    font-size: .76rem;
    font-weight: 650;
    text-decoration: none;
}

.organizer-capture-callout {
    gap: 1rem;
    min-height: 6.8rem;
    padding: 1rem 1.25rem;
    border: 1px dashed color-mix(in srgb, var(--mw-color-accent) 72%, var(--mw-color-border));
    border-radius: 1rem;
    background: color-mix(in srgb, var(--mw-color-accent-soft) 28%, transparent);
}

.organizer-capture-icon {
    display: grid;
    place-items: center;
    width: 3.1rem;
    height: 3.1rem;
    flex: 0 0 auto;
    border-radius: .75rem;
    color: var(--mw-color-accent);
    background: var(--mw-color-accent-soft);
    font-size: 1.35rem;
}

.organizer-capture-callout > div {
    flex: 1;
    min-width: 0;
}

.organizer-capture-callout h2 {
    margin: 0 0 .2rem;
    color: var(--mw-color-text);
    font-size: 1rem;
}

.organizer-capture-callout p,
.organizer-capture-callout small {
    display: block;
    margin: 0;
    color: var(--mw-color-text-muted);
    font-size: .75rem;
    line-height: 1.45;
}

.organizer-capture-callout small {
    color: var(--mw-color-text-subtle);
    font-size: .67rem;
}

.organizer-capture-callout .btn {
    flex: 0 0 auto;
    gap: .45rem;
}

.organizer-home-quote {
    margin: .2rem 0 0;
    color: var(--mw-color-text-subtle);
    font-size: .76rem;
    font-style: italic;
    text-align: center;
}

@media (max-width: 1050px) {
    .organizer-project-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .organizer-project-actions,
    .organizer-search-trigger {
        width: 100%;
    }

    .organizer-search-trigger {
        min-width: 0;
    }

    .organizer-home-grid {
        grid-template-columns: 1fr;
    }

    .organizer-panel {
        min-height: 0;
    }
}

@media (max-width: 700px) {
    .organizer-project-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .organizer-capture-button {
        padding-inline: .9rem;
    }

    .mw-project-nav--organizer {
        overflow-x: auto;
    }

    .mw-project-nav--organizer > .mw-project-nav-link {
        flex: 0 0 auto;
        padding-inline: .55rem;
    }

    .organizer-panel-heading {
        padding-inline: .9rem;
    }

    .organizer-task-row,
    .organizer-note-row {
        padding-inline: .9rem;
    }

    .organizer-task-copy > span {
        display: none;
    }

    .organizer-note-row {
        grid-template-columns: 1.45rem minmax(0, 1fr) auto;
    }

    .organizer-note-pin {
        display: none;
    }

    .organizer-capture-callout {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .organizer-capture-callout .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .organizer-project-actions {
        grid-template-columns: 1fr;
    }

    .organizer-task-row > time,
    .organizer-note-row time {
        display: none;
    }

    .organizer-task-row {
        grid-template-columns: 1.35rem minmax(0, 1fr);
    }

    .organizer-note-row {
        grid-template-columns: 1.45rem minmax(0, 1fr);
    }
}

/* Ajustements premium du thème sombre et des accents de statut. */
.organizer-task-row {
    position: relative;
    border-left: 0;
}

.organizer-task-row::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 2px;
    height: 50%;
    border-radius: 0 .2rem .2rem 0;
    background: var(--organizer-task-accent, var(--mw-color-accent));
    content: "";
    transform: translateY(-50%);
}

.organizer-task-row.is-done::before {
    display: none;
}

.organizer-panel-heading-search input:focus,
.organizer-panel-heading-search input:focus-visible {
    border-color: transparent;
    outline: none !important;
    box-shadow: none;
}

.organizer-panel-heading-search:focus-within {
    box-shadow: none;
}

body.theme-dark .note-focus-rich-editor .rich-note-surface,
body.theme-dark .note-focus-rich-editor .rich-note-source {
    background: var(--mw-color-surface);
    color: var(--mw-color-text);
}

body.theme-dark .task-modal-form .app-form-field input,
body.theme-dark .task-modal-form .app-form-field select,
body.theme-dark .task-modal-form .app-form-field textarea {
    border-color: rgba(51, 67, 95, .9);
    background: rgba(17, 28, 45, .98);
    color: #eef4ff;
}

body.theme-dark .task-modal-form .app-form-field input::placeholder,
body.theme-dark .task-modal-form .app-form-field textarea::placeholder {
    color: #9fb1ca;
}

.organizer-list-search {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0 1.15rem .7rem;
    padding: .45rem .65rem;
    border: 1px solid var(--mw-color-border);
    border-radius: .7rem;
    color: var(--mw-color-text-muted);
    background: var(--mw-color-surface-subtle);
}

.organizer-list-search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--mw-color-text);
    background: transparent;
    font-size: .78rem;
}

/* Finition de l'accueil organisateur : recherche compacte, lignes lisibles et responsive. */
.organizer-panel-heading {
    gap: .75rem;
}

.organizer-panel-heading-copy {
    min-width: 0;
    gap: .45rem;
}

.organizer-panel-heading-search {
    display: flex;
    align-items: center;
    flex: 1 1 11rem;
    width: auto;
    min-width: 8rem;
    max-width: 16rem;
    min-height: 2.35rem;
    padding: 0 .72rem;
    border: 1px solid var(--mw-color-border-strong);
    border-radius: .7rem;
    color: var(--mw-color-text-muted);
    background: color-mix(in srgb, var(--mw-color-surface) 82%, transparent);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.organizer-panel-heading-search:focus-within {
    border-color: color-mix(in srgb, var(--mw-color-accent) 60%, var(--mw-color-border));
    background: var(--mw-color-surface);
    box-shadow: none;
}

.organizer-panel-heading-search input {
    min-height: 2.2rem;
    font-size: .78rem;
}

.organizer-task-row {
    grid-template-columns: 1.15rem minmax(0, 1fr) auto;
    gap: .65rem;
    border-left: 0;
}

.organizer-task-row.is-done {
    border-left: 0;
}

.organizer-task-toggle button,
.organizer-task-toggle.is-readonly {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: .3rem;
}

.organizer-task-copy {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: .14rem;
}

.organizer-task-copy strong,
.organizer-task-copy small {
    display: block;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.organizer-task-copy strong {
    white-space: nowrap;
}

.organizer-task-copy small {
    white-space: nowrap;
}

@media (max-width: 760px) {
    .organizer-panel-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: .65rem;
    }

    .organizer-panel-heading-copy {
        min-width: 0;
    }

    .organizer-panel-heading-search {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .organizer-panel-heading .organizer-add-action {
        justify-self: end;
        white-space: nowrap;
    }

    .organizer-task-row {
        grid-template-columns: 1.05rem minmax(0, 1fr);
        gap: .55rem;
        padding: .65rem .8rem;
    }

    .organizer-task-copy strong {
        display: -webkit-box;
        overflow: hidden;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .organizer-task-copy small {
        white-space: normal;
    }

    .organizer-note-row {
        grid-template-columns: 1.15rem minmax(0, 1fr) auto;
        gap: .55rem;
        padding: .68rem .8rem;
    }

    .organizer-note-copy strong,
    .organizer-note-copy small {
        white-space: normal;
    }

    .organizer-note-copy small {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 480px) {
    .organizer-panel-heading {
        padding: .95rem .8rem .8rem;
    }

    .organizer-panel-heading h2 {
        font-size: 1.05rem;
    }

    .organizer-panel-heading > div > span {
        font-size: .64rem;
    }

    .organizer-add-action {
        font-size: .72rem;
    }

    .organizer-task-row,
    .organizer-note-row {
        padding-inline: .8rem;
    }
}

.organizer-list-search input::placeholder {
    color: var(--mw-color-text-muted);
}

.organizer-pagination {
    display: flex;
    justify-content: center;
    gap: .3rem;
    padding: .7rem 1rem 1rem;
}

.organizer-pagination .btn {
    min-width: 2rem;
    padding-inline: .45rem;
}

.organizer-pagination .btn.is-active {
    color: var(--mw-color-accent);
    background: var(--mw-color-accent-soft);
}

.organizer-pagination-ellipsis {
    display: inline-flex;
    min-width: 1rem;
    align-items: center;
    justify-content: center;
    color: var(--mw-color-text-muted);
    font-size: .75rem;
}

.organizer-notes-editor-panel {
    min-height: 32rem;
}

.organizer-note-editor {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    padding: 0 1.25rem 1.25rem;
}

.organizer-note-editor .note-focus-header {
    padding: .25rem 0 .65rem;
}

.organizer-note-editor .note-focus-back {
    padding-left: 0;
    font-size: .76rem;
}

.organizer-note-editor .note-focus-status {
    font-size: .68rem;
}

.organizer-note-editor .note-focus-form {
    flex: 1;
    min-height: 0;
    padding: .7rem 0 0;
    border: 0;
    border-top: 1px solid var(--mw-color-border);
    border-radius: 0;
    box-shadow: none;
    overflow: auto;
}

.organizer-note-editor .note-focus-title {
    margin-bottom: .7rem;
    font-size: 1.25rem;
}

.organizer-note-editor .note-focus-rich-editor .rich-note-toolbar {
    margin-inline: -.35rem;
}

.organizer-note-editor .note-focus-rich-editor .rich-note-surface {
    min-height: 16rem;
    padding-top: .35rem;
    font-size: .84rem;
    line-height: 1.65;
}

@media (max-width: 700px) {
    .organizer-list-search {
        margin-inline: .9rem;
    }

    .organizer-note-editor {
        padding-inline: .9rem;
    }

    .organizer-note-editor .note-focus-header {
        align-items: center;
    }

    .organizer-note-editor .note-focus-status {
        order: initial;
        flex-basis: auto;
        margin-left: auto;
    }
}

@media (min-width: 1051px) {
    .app-main:has(.organizer-home) {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        padding-bottom: .85rem;
    }

    .app-main:has(.organizer-home) .page-content {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .app-main:has(.organizer-home) .project-detail-layout-v2 {
        display: flex;
        height: 100%;
        min-height: 0;
        align-items: stretch;
        flex-direction: column;
    }

    .app-main:has(.organizer-home) .project-detail-main {
        display: flex;
        min-height: 0;
        height: 100%;
        flex: 1 1 0;
        align-self: stretch;
        width: 100%;
        max-width: 100%;
        flex-direction: column;
    }

    .organizer-home {
        min-height: 0;
        height: auto;
        flex: 1 1 0;
        overflow: hidden;
    }

    .organizer-home-grid {
        min-height: 0;
        height: 100%;
        grid-template-rows: minmax(0, 1fr);
    }

    .organizer-panel {
        min-height: 0;
        height: 100%;
    }

    .organizer-task-list,
    .organizer-note-list {
        min-height: 0;
        overflow-y: auto;
        scrollbar-width: thin;
    }
}

/* Les modales restent contenues dans l’écran ; seul leur contenu peut défiler. */
.app-modal,
.task-modal-content {
    max-height: calc(100dvh - 1rem);
}

.app-modal > .modal-body,
.task-modal-content > .modal-body {
    min-height: 0;
    overflow-y: auto;
}

@media (max-width: 767px) {
    .modal-dialog,
    .project-task-modal-dialog,
    .note-editor-modal-dialog {
        width: auto;
        max-width: calc(100vw - 1rem);
        margin: .5rem;
    }

    .app-modal,
    .task-modal-content {
        max-height: calc(100dvh - 1rem);
    }

    .app-modal-header {
        padding: .8rem .9rem .7rem;
    }

    .app-modal .modal-body,
    .task-modal-content > .modal-body {
        padding: .8rem .9rem;
    }

    .task-modal-form {
        gap: .65rem;
    }

    .note-editor-modal-dialog-create .rich-note-surface {
        min-height: clamp(5rem, 18vh, 8rem);
    }

    .note-editor-modal-dialog-create .rich-note-source {
        min-height: 5rem;
    }

    .task-modal-form .rich-note-editor-compact .rich-note-surface {
        min-height: clamp(4.5rem, 16vh, 7rem);
    }

    .task-modal-form .rich-note-editor-compact .rich-note-source {
        min-height: 4.5rem;
    }
}

/* Compactage dynamique des formulaires de création/édition. */
.note-editor-modal-dialog .modal-content,
.project-task-modal-dialog .modal-content {
    display: flex;
    min-height: 0;
    height: min(calc(100dvh - 1rem), 900px);
    flex-direction: column;
}

.note-editor-modal-dialog .modal-header,
.project-task-modal-dialog .modal-header {
    flex: 0 0 auto;
}

.note-editor-modal-dialog .modal-body,
.project-task-modal-dialog .modal-body {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.note-editor-form {
    width: 100%;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.project-task-modal-dialog .task-modal-form {
    width: 100%;
    min-height: 0;
}

.note-editor-content-field,
.task-modal-description-field {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

.note-editor-content-field .rich-note-editor,
.task-modal-description-field .rich-note-editor {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.note-editor-content-field .rich-note-surface,
.task-modal-description-field .rich-note-surface {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
}

.note-editor-content-field .rich-note-source,
.task-modal-description-field .rich-note-source {
    min-height: 0;
    flex: 1 1 auto;
}

@media (max-height: 800px) {
    .note-editor-modal-dialog .modal-body,
    .project-task-modal-dialog .modal-body {
        padding: .75rem .9rem;
    }

    .note-editor-form,
    .task-modal-form {
        gap: .55rem .7rem;
    }

    .note-editor-form .form-group,
    .task-modal-form .form-group {
        gap: .25rem;
    }

    .note-editor-meta-grid {
        gap: .45rem .6rem;
    }

    .task-modal-form input,
    .task-modal-form select {
        min-height: 2.25rem;
        padding-top: .45rem;
        padding-bottom: .45rem;
    }

    .note-editor-content-field .rich-note-toolbar,
    .task-modal-description-field .rich-note-toolbar {
        padding-top: .35rem;
        padding-bottom: .35rem;
    }
}

/* Organizer views: access, documents and history */
.organizer-secondary-page {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    flex: 1 1 0;
    flex-direction: column;
}

.organizer-secondary-panel {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    height: 100%;
    flex: 1 1 0;
    flex-direction: column;
}

.app-main:has(.organizer-secondary-page) .project-detail-layout-v2 {
    align-items: stretch;
}

.organizer-secondary-heading {
    flex: 0 0 auto;
}

.organizer-resource-list,
.organizer-history-list {
    display: grid;
    min-height: 0;
    flex: 1 1 auto;
    align-content: start;
    overflow-y: auto;
    scrollbar-width: thin;
}

.organizer-resource-row,
.organizer-history-row {
    min-width: 0;
    border-bottom: 1px solid var(--mw-color-border-subtle, rgba(127, 127, 127, .18));
}

.organizer-resource-row {
    display: grid;
    min-height: 4rem;
    grid-template-columns: 1.35rem minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.25rem;
}

.organizer-resource-icon {
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    color: var(--mw-color-text-muted);
}

.organizer-resource-copy,
.organizer-history-copy {
    display: grid;
    min-width: 0;
    gap: .15rem;
}

.organizer-resource-copy strong,
.organizer-resource-copy small,
.organizer-document-type,
.organizer-history-title strong,
.organizer-history-title small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organizer-resource-copy strong,
.organizer-history-title strong {
    color: var(--mw-color-text);
    font-size: .82rem;
}

.organizer-resource-copy small,
.organizer-document-type,
.organizer-history-title small {
    color: var(--mw-color-text-muted);
    font-size: .68rem;
}

.organizer-secret-value {
    min-width: 8rem;
    overflow: hidden;
    color: var(--mw-color-text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organizer-resource-row time {
    color: var(--mw-color-text-muted);
    font-size: .68rem;
    white-space: nowrap;
}

.organizer-resource-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
}

.organizer-resource-actions .btn {
    white-space: nowrap;
}

.organizer-document-type {
    max-width: 12rem;
}

.organizer-history-row {
    display: grid;
    grid-template-columns: 5rem 1.35rem minmax(0, 1fr) auto;
    align-items: start;
    gap: .75rem;
    padding: .7rem 1.25rem;
}

.organizer-history-time {
    display: grid;
    gap: .12rem;
    padding-top: .15rem;
    color: var(--mw-color-text-muted);
    font-size: .68rem;
}

.organizer-history-time strong {
    color: var(--mw-color-text);
    font-size: .75rem;
}

.organizer-history-title {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: .5rem;
}

.organizer-history-copy p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--mw-color-text-muted);
    font-size: .7rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

@media (min-width: 1051px) {
    .app-main:has(.organizer-secondary-page) {
        display: flex;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        padding-bottom: .85rem;
        flex-direction: column;
    }

    .app-main:has(.organizer-secondary-page) .page-content,
    .app-main:has(.organizer-secondary-page) .project-detail-layout-v2,
    .app-main:has(.organizer-secondary-page) .project-detail-main {
        min-height: 0;
    }

    .app-main:has(.organizer-secondary-page) .page-content,
    .app-main:has(.organizer-secondary-page) .project-detail-layout-v2,
    .app-main:has(.organizer-secondary-page) .project-detail-main {
        height: 100%;
    }

    .app-main:has(.organizer-secondary-page) .project-detail-layout-v2,
    .app-main:has(.organizer-secondary-page) .project-detail-main {
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 760px) {
    .organizer-resource-row {
        grid-template-columns: 1.2rem minmax(0, 1fr) auto;
        gap: .55rem;
        padding: .65rem .8rem;
    }

    .organizer-resource-row time,
    .organizer-document-type,
    .organizer-secret-value {
        display: none;
    }

    .organizer-resource-actions .btn:not(.icon-only) {
        padding-right: .4rem;
        padding-left: .4rem;
        font-size: .68rem;
    }

    .organizer-history-row {
        grid-template-columns: 4rem 1.2rem minmax(0, 1fr);
        gap: .55rem;
        padding: .65rem .8rem;
    }

    .organizer-history-row > .organizer-resource-actions {
        grid-column: 3;
        justify-content: flex-start;
    }

    .organizer-history-title {
        display: grid;
        gap: .15rem;
    }
}

@media (max-width: 1050px) {
    .app-main:has(.organizer-secondary-page) {
        display: flex;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        padding-bottom: .85rem;
        flex-direction: column;
    }

    .app-main:has(.organizer-secondary-page) .page-content,
    .app-main:has(.organizer-secondary-page) .project-detail-layout-v2,
    .app-main:has(.organizer-secondary-page) .project-detail-main {
        display: flex;
        min-height: 0;
        height: 100%;
        flex-direction: column;
    }

    .app-main:has(.organizer-secondary-page) .page-content {
        flex: 1 1 0;
        height: auto;
        overflow: hidden;
    }

    .app-main:has(.organizer-secondary-page) .project-detail-main {
        flex: 1 1 0;
        align-self: stretch;
        width: 100%;
        max-width: 100%;
    }
}
