:root {
    --bg: #eef3f8;
    --card: rgba(255, 255, 255, 0.86);
    --border: #d5deea;
    --text: #203049;
    --muted: #6c7a92;
    --accent: #2474c9;
    --accent-strong: #14529b;
    --accent-soft: rgba(36, 116, 201, 0.12);
    --shadow: 0 22px 45px rgba(31, 57, 93, 0.08);
    --shadow-soft: 0 12px 24px rgba(31, 57, 93, 0.06);
    --font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", sans-serif;
    --heading-font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    --base-font-size: 14px;
    --app-zoom-scale: 1;
    --sidebar-width: 244px;
    --detail-side-width: 320px;
    --create-side-width: 320px;
    --topbar-shell-bg:
        linear-gradient(135deg, rgba(183, 221, 255, 0.88), rgba(119, 184, 244, 0.82)),
        linear-gradient(180deg, #f1f7ff 0%, #c9e2fb 100%);
    --topbar-shell-border: rgba(107, 154, 205, 0.28);
    --topbar-shell-shadow: 0 14px 28px rgba(74, 133, 196, 0.12);
    --topbar-shell-divider: rgba(213, 222, 234, 0.9);
    --topbar-search-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.96));
    --topbar-search-border: rgba(93, 134, 178, 0.22);
    --topbar-search-text: #29415d;
    --topbar-search-placeholder: rgba(59, 81, 110, 0.72);
}

body.theme-light {
    --bg: #eef3f9;
    --card: #ffffff;
    --border: #d6deea;
    --text: #223145;
    --muted: #697a92;
    --shadow: 0 8px 24px rgba(36, 64, 105, 0.08);
}

body.theme-dark {
    --bg: #171411;
    --card: rgba(33, 28, 24, 0.95);
    --border: #433831;
    --text: #f7efe8;
    --muted: #b8aba1;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    --topbar-search-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 253, 0.94));
    --topbar-search-border: rgba(125, 150, 183, 0.24);
    --topbar-search-text: #29415d;
    --topbar-search-placeholder: rgba(59, 81, 110, 0.72);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #171411;
        --card: rgba(33, 28, 24, 0.95);
        --border: #433831;
        --text: #f7efe8;
        --muted: #b8aba1;
        --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: calc(100dvh / var(--app-zoom-scale));
    font-family: var(--font-family);
    font-size: var(--base-font-size);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(102, 169, 255, 0.18), transparent 22%),
        radial-gradient(circle at right 10%, rgba(30, 111, 214, 0.14), transparent 18%),
        linear-gradient(180deg, #f9fbff 0%, var(--bg) 58%, #e8eef7 100%);
    overflow-x: hidden;
}

body.detail-scroll-lock {
    overflow-y: auto;
}

.shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: calc(100dvh / var(--app-zoom-scale));
    transition: grid-template-columns 0.24s ease;
}

body.sidebar-hidden .shell {
    grid-template-columns: 24px 1fr;
}

.login-shell {
    --login-shell-orb-a: radial-gradient(
        circle at 38% 40%,
        rgba(56, 188, 255, 0.95),
        rgba(2, 103, 255, 0.9) 46%,
        rgba(11, 41, 171, 0.9) 72%,
        transparent 73%
    );
    --login-shell-orb-b: radial-gradient(
        circle at 38% 42%,
        rgba(68, 180, 255, 0.88),
        rgba(22, 80, 255, 0.94) 44%,
        rgba(10, 34, 146, 0.95) 74%,
        transparent 75%
    );
    --login-card-width: 460px;
    --login-card-bg: rgba(255, 255, 255, 0.72);
    --login-card-border: rgba(255, 255, 255, 0.64);
    --login-card-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(239, 246, 255, 0.72));
    --login-card-shadow:
        0 24px 60px rgba(52, 87, 136, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
    --login-card-backdrop: blur(28px);
    --login-card-radius: 34px;
    --login-card-padding: 34px 34px 30px;
    --login-card-text: #203049;
    --login-card-muted: #5e6881;
    --login-field-bg: rgba(255, 255, 255, 0.86);
    --login-field-border: rgba(82, 124, 182, 0.22);
    --login-field-text: #29415d;
    --login-field-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
    --login-role-bg: rgba(255, 255, 255, 0.68);
    --login-role-border: rgba(82, 124, 182, 0.22);
    --login-role-text: #385071;
    --login-role-subtext: #65748d;
    --login-role-hover-border: rgba(47, 109, 246, 0.28);
    --login-role-hover-shadow: 0 10px 18px rgba(49, 96, 164, 0.14);
    --login-role-active-border: rgba(47, 109, 246, 0.42);
    --login-role-active-bg: linear-gradient(180deg, rgba(74, 151, 255, 0.18), rgba(255, 255, 255, 0.82));
    --login-role-active-text: #234a85;
    --login-role-active-shadow:
        0 14px 24px rgba(46, 114, 193, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
    --login-button-bg: linear-gradient(180deg, #3176d2 0%, #14529b 100%);
    --login-button-color: #ffffff;
    --login-button-shadow: 0 12px 24px rgba(31, 112, 193, 0.22);
    --login-heading-align: center;
    --login-copy-align: center;
    --login-brand-justify: center;
    --login-card-glow-a: rgba(120, 194, 255, 0.4);
    --login-card-glow-b: rgba(59, 118, 255, 0.18);
    min-height: calc(100dvh / var(--app-zoom-scale));
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 78%, rgba(38, 150, 255, 0.42), transparent 28%),
        radial-gradient(circle at 78% 30%, rgba(0, 110, 255, 0.28), transparent 30%),
        linear-gradient(180deg, #d7ecfb 0%, #c2e0f7 100%);
}

.login-shell[data-login-bg-theme="aurora"] {
    background:
        radial-gradient(circle at 12% 76%, rgba(40, 184, 255, 0.45), transparent 30%),
        radial-gradient(circle at 84% 24%, rgba(23, 98, 255, 0.32), transparent 34%),
        linear-gradient(180deg, #d4ebff 0%, #b8d7ff 52%, #afcdfa 100%);
}

.login-shell[data-login-bg-theme="soft"] {
    background:
        radial-gradient(circle at 22% 72%, rgba(164, 219, 255, 0.45), transparent 26%),
        radial-gradient(circle at 80% 26%, rgba(119, 176, 245, 0.25), transparent 30%),
        linear-gradient(180deg, #edf6ff 0%, #dbeafb 58%, #d2e4f8 100%);
}

.login-shell[data-login-bg-theme="slate"] {
    background:
        radial-gradient(circle at 18% 75%, rgba(96, 136, 186, 0.35), transparent 28%),
        radial-gradient(circle at 78% 28%, rgba(70, 108, 162, 0.26), transparent 32%),
        linear-gradient(180deg, #d6dfeb 0%, #c3cfdf 58%, #bccada 100%);
}

.login-shell::before,
.login-shell::after {
    content: "";
    position: absolute;
    border-radius: 42% 58% 60% 40% / 44% 42% 58% 56%;
    filter: blur(1px);
    pointer-events: none;
    will-change: transform;
}

.login-shell::before {
    width: 780px;
    height: 780px;
    left: -140px;
    bottom: -250px;
    background: var(--login-shell-orb-a);
    transform: rotate(-18deg);
    animation: login-shell-float-a 18s ease-in-out infinite alternate;
}

.login-shell::after {
    width: 860px;
    height: 860px;
    right: -220px;
    top: -280px;
    background: var(--login-shell-orb-b);
    transform: rotate(24deg);
    animation: login-shell-float-b 24s ease-in-out infinite alternate;
}

.login-shell[data-login-card-style="command"] {
    --login-shell-orb-a: radial-gradient(circle at 34% 44%, rgba(44, 178, 255, 0.8), rgba(7, 28, 92, 0) 72%);
    --login-shell-orb-b: radial-gradient(circle at 42% 42%, rgba(38, 118, 255, 0.72), rgba(8, 18, 66, 0) 74%);
    --login-card-width: 500px;
    --login-card-bg: rgba(8, 20, 39, 0.74);
    --login-card-border: rgba(126, 184, 255, 0.16);
    --login-card-surface: linear-gradient(145deg, rgba(17, 42, 79, 0.96), rgba(7, 14, 27, 0.88));
    --login-card-shadow:
        0 32px 78px rgba(10, 22, 43, 0.34),
        inset 0 1px 0 rgba(160, 206, 255, 0.08);
    --login-card-text: #f3f8ff;
    --login-card-muted: rgba(211, 225, 247, 0.8);
    --login-field-bg: rgba(6, 17, 33, 0.58);
    --login-field-border: rgba(106, 165, 239, 0.26);
    --login-field-text: #f3f8ff;
    --login-role-bg: rgba(11, 25, 48, 0.62);
    --login-role-border: rgba(106, 165, 239, 0.18);
    --login-role-text: #eaf4ff;
    --login-role-subtext: rgba(196, 216, 242, 0.74);
    --login-role-hover-border: rgba(110, 182, 255, 0.3);
    --login-role-hover-shadow: 0 12px 22px rgba(4, 16, 34, 0.3);
    --login-role-active-border: rgba(110, 182, 255, 0.42);
    --login-role-active-bg: linear-gradient(180deg, rgba(65, 145, 255, 0.2), rgba(10, 26, 48, 0.9));
    --login-role-active-text: #ffffff;
    --login-button-bg: linear-gradient(180deg, #3ea5ff 0%, #1d61d6 100%);
    --login-button-shadow: 0 16px 30px rgba(14, 74, 168, 0.34);
    --login-heading-align: left;
    --login-copy-align: left;
    --login-brand-justify: flex-start;
    --login-card-glow-a: rgba(76, 168, 255, 0.34);
    --login-card-glow-b: rgba(48, 109, 255, 0.2);
}

.login-shell[data-login-card-style="split"] {
    --login-card-width: 520px;
    --login-card-bg: rgba(255, 255, 255, 0.7);
    --login-card-border: rgba(255, 255, 255, 0.72);
    --login-card-surface: linear-gradient(
        112deg,
        rgba(38, 117, 223, 0.18) 0 30%,
        rgba(255, 255, 255, 0.94) 30%,
        rgba(244, 249, 255, 0.82) 100%
    );
    --login-card-shadow:
        0 28px 64px rgba(39, 72, 120, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
    --login-card-padding: 36px 38px 32px;
    --login-field-bg: rgba(255, 255, 255, 0.92);
    --login-role-hover-shadow: 0 12px 24px rgba(40, 77, 128, 0.18);
    --login-heading-align: left;
    --login-copy-align: left;
    --login-brand-justify: flex-start;
    --login-card-glow-a: rgba(112, 177, 255, 0.26);
    --login-card-glow-b: rgba(255, 255, 255, 0);
}

.login-shell[data-login-card-style="halo"] {
    --login-shell-orb-a: radial-gradient(circle at 42% 44%, rgba(255, 255, 255, 0.68), rgba(79, 163, 255, 0) 74%);
    --login-shell-orb-b: radial-gradient(circle at 38% 42%, rgba(141, 205, 255, 0.64), rgba(53, 111, 255, 0) 74%);
    --login-card-width: 470px;
    --login-card-bg: rgba(255, 255, 255, 0.82);
    --login-card-border: rgba(255, 255, 255, 0.92);
    --login-card-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 255, 0.9));
    --login-card-shadow:
        0 34px 88px rgba(50, 98, 162, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
    --login-field-bg: rgba(255, 255, 255, 0.94);
    --login-field-border: rgba(139, 181, 230, 0.3);
    --login-button-bg: linear-gradient(180deg, #4d8ff0 0%, #225fbd 100%);
    --login-card-glow-a: rgba(255, 255, 255, 0.58);
    --login-card-glow-b: rgba(110, 186, 255, 0.22);
}

.login-shell[data-login-card-style="midnight"] {
    --login-shell-orb-a: radial-gradient(circle at 38% 38%, rgba(29, 177, 235, 0.6), rgba(13, 24, 67, 0) 74%);
    --login-shell-orb-b: radial-gradient(circle at 40% 42%, rgba(104, 103, 255, 0.52), rgba(17, 18, 48, 0) 75%);
    --login-card-width: 480px;
    --login-card-bg: rgba(10, 12, 24, 0.76);
    --login-card-border: rgba(148, 184, 255, 0.18);
    --login-card-surface: linear-gradient(180deg, rgba(22, 27, 55, 0.98), rgba(8, 10, 22, 0.92));
    --login-card-shadow:
        0 34px 84px rgba(7, 10, 24, 0.44),
        inset 0 1px 0 rgba(142, 195, 255, 0.08);
    --login-card-text: #f7f8ff;
    --login-card-muted: rgba(204, 214, 244, 0.78);
    --login-field-bg: rgba(17, 22, 45, 0.78);
    --login-field-border: rgba(106, 132, 212, 0.28);
    --login-field-text: #f7f8ff;
    --login-role-bg: rgba(18, 24, 48, 0.78);
    --login-role-border: rgba(110, 138, 219, 0.22);
    --login-role-text: #f2f4ff;
    --login-role-subtext: rgba(188, 198, 232, 0.74);
    --login-role-active-bg: linear-gradient(180deg, rgba(87, 125, 255, 0.32), rgba(22, 28, 54, 0.92));
    --login-role-active-border: rgba(121, 154, 255, 0.5);
    --login-role-active-text: #ffffff;
    --login-button-bg: linear-gradient(180deg, #6a7cff 0%, #2d4fc4 100%);
    --login-button-shadow: 0 18px 30px rgba(42, 61, 150, 0.34);
    --login-card-glow-a: rgba(96, 117, 255, 0.32);
    --login-card-glow-b: rgba(40, 210, 255, 0.18);
}

.login-shell[data-login-card-style="soft"] {
    --login-shell-orb-a: radial-gradient(circle at 38% 40%, rgba(255, 198, 215, 0.7), rgba(132, 178, 255, 0) 72%);
    --login-shell-orb-b: radial-gradient(circle at 42% 44%, rgba(141, 196, 255, 0.66), rgba(95, 129, 255, 0) 74%);
    --login-card-width: 470px;
    --login-card-bg: rgba(255, 252, 255, 0.72);
    --login-card-border: rgba(255, 255, 255, 0.9);
    --login-card-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 242, 255, 0.88));
    --login-card-shadow:
        0 30px 76px rgba(103, 115, 181, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
    --login-card-text: #2f3552;
    --login-card-muted: #6f7093;
    --login-field-bg: rgba(255, 255, 255, 0.92);
    --login-field-border: rgba(176, 166, 227, 0.28);
    --login-field-text: #2f3552;
    --login-role-bg: rgba(255, 255, 255, 0.78);
    --login-role-border: rgba(179, 172, 230, 0.24);
    --login-role-text: #43486c;
    --login-role-subtext: #7d7fa2;
    --login-role-active-bg: linear-gradient(180deg, rgba(255, 209, 229, 0.5), rgba(255, 255, 255, 0.92));
    --login-role-active-text: #33457a;
    --login-button-bg: linear-gradient(180deg, #7487ff 0%, #5367de 100%);
    --login-button-shadow: 0 14px 26px rgba(95, 111, 211, 0.24);
    --login-card-glow-a: rgba(255, 215, 233, 0.42);
    --login-card-glow-b: rgba(135, 177, 255, 0.2);
}

.login-shell[data-login-card-style="orbital"] {
    --login-shell-orb-a: radial-gradient(circle at 34% 38%, rgba(73, 222, 255, 0.68), rgba(46, 88, 255, 0) 74%);
    --login-shell-orb-b: radial-gradient(circle at 42% 42%, rgba(255, 84, 180, 0.54), rgba(90, 74, 255, 0) 74%);
    --login-card-width: 500px;
    --login-card-bg: rgba(247, 250, 255, 0.18);
    --login-card-border: rgba(255, 255, 255, 0.34);
    --login-card-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(245, 249, 255, 0.08));
    --login-card-shadow:
        0 34px 92px rgba(43, 56, 131, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    --login-card-backdrop: blur(36px);
    --login-card-text: #f5fbff;
    --login-card-muted: rgba(232, 241, 255, 0.8);
    --login-field-bg: rgba(255, 255, 255, 0.14);
    --login-field-border: rgba(255, 255, 255, 0.26);
    --login-field-text: #f5fbff;
    --login-role-bg: rgba(255, 255, 255, 0.12);
    --login-role-border: rgba(255, 255, 255, 0.2);
    --login-role-text: #f5fbff;
    --login-role-subtext: rgba(231, 238, 255, 0.72);
    --login-role-hover-shadow: 0 12px 24px rgba(52, 31, 132, 0.2);
    --login-role-active-bg: linear-gradient(180deg, rgba(77, 224, 255, 0.2), rgba(255, 96, 192, 0.22));
    --login-role-active-border: rgba(255, 255, 255, 0.38);
    --login-role-active-text: #ffffff;
    --login-button-bg: linear-gradient(180deg, #ffca28 0%, #f59e0b 100%);
    --login-button-color: #142642;
    --login-button-shadow: 0 16px 28px rgba(190, 126, 8, 0.3);
    --login-card-glow-a: rgba(72, 234, 255, 0.32);
    --login-card-glow-b: rgba(255, 73, 177, 0.26);
}

.login-card {
    width: min(var(--login-card-width), 100%);
    position: relative;
    z-index: 1;
    overflow: hidden;
    isolation: isolate;
    color: var(--login-card-text);
    background: var(--login-card-bg);
    border: 1px solid var(--login-card-border);
    box-shadow: var(--login-card-shadow);
    backdrop-filter: var(--login-card-backdrop);
    border-radius: var(--login-card-radius);
    padding: var(--login-card-padding);
}

.login-card::before,
.login-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.login-card::before {
    background: var(--login-card-surface);
}

.login-card::after {
    inset: auto;
    width: 260px;
    height: 260px;
    right: -88px;
    top: -104px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, var(--login-card-glow-a), transparent 58%),
        radial-gradient(circle at 65% 64%, var(--login-card-glow-b), transparent 68%);
    filter: blur(2px);
    animation: login-card-glow-drift 22s ease-in-out infinite alternate;
}

.login-card > * {
    position: relative;
    z-index: 1;
}

.login-brand {
    margin-bottom: 18px;
    justify-content: var(--login-brand-justify);
    border: 0;
    padding: 0;
}

.login-message {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #d78f8f;
    background: rgba(191, 52, 52, 0.08);
    color: #8e1f1f;
}

.login-card h1 {
    margin: 0 0 12px;
    font-size: 2.45rem;
    color: var(--login-card-text);
    text-align: var(--login-heading-align);
}

.login-card > p {
    margin: 0 0 24px;
    color: var(--login-card-muted);
    text-align: var(--login-copy-align);
    line-height: 1.45;
}

.login-card .ticket-form {
    gap: 18px;
}

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

.login-role-option {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--login-role-border);
    background: var(--login-role-bg);
    color: var(--login-role-text);
    cursor: pointer;
    text-align: left;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.login-role-option strong {
    font-size: 1rem;
}

.login-role-option span {
    color: var(--login-role-subtext);
    font-size: 0.85rem;
}

.login-role-option:hover {
    transform: translateY(-1px);
    border-color: var(--login-role-hover-border);
    box-shadow: var(--login-role-hover-shadow);
}

.login-role-option.active {
    border-color: var(--login-role-active-border);
    background: var(--login-role-active-bg);
    color: var(--login-role-active-text);
    box-shadow: var(--login-role-active-shadow);
}

.login-card .field input {
    min-height: 56px;
    border-radius: 18px;
    color: var(--login-field-text);
    background: var(--login-field-bg);
    border-color: var(--login-field-border);
    box-shadow: var(--login-field-shadow);
}

.login-card .field label {
    font-size: 0.98rem;
    color: var(--login-card-text);
}

.login-card small {
    line-height: 1.4;
    color: var(--login-card-muted);
}

.login-card .primary {
    min-height: 50px;
    border-radius: 999px;
    color: var(--login-button-color);
    background: var(--login-button-bg);
    box-shadow: var(--login-button-shadow);
}

.login-card .field input::placeholder {
    color: color-mix(in srgb, var(--login-field-text) 62%, transparent);
}

@keyframes login-shell-float-a {
    0% {
        transform: translate3d(0, 0, 0) rotate(-18deg) scale(1);
    }

    100% {
        transform: translate3d(56px, -28px, 0) rotate(-8deg) scale(1.08);
    }
}

@keyframes login-shell-float-b {
    0% {
        transform: translate3d(0, 0, 0) rotate(24deg) scale(1);
    }

    100% {
        transform: translate3d(-42px, 34px, 0) rotate(12deg) scale(1.06);
    }
}

@keyframes login-card-glow-drift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(-26px, 20px, 0) scale(1.08);
    }
}

@media (max-width: 640px) {
    .login-shell {
        padding: 18px;
    }

    .login-card {
        padding: 28px 22px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-shell::before,
    .login-shell::after,
    .login-card::after {
        animation: none;
    }
}

.sidebar {
    position: sticky;
    top: 0;
    height: calc(100dvh / var(--app-zoom-scale));
    border-right: 1px solid rgba(181, 196, 216, 0.7);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 26%),
        linear-gradient(180deg, rgba(247, 250, 255, 0.96) 0%, rgba(239, 245, 252, 0.98) 100%);
    padding: 18px 14px 22px;
    transition:
        padding 0.24s ease,
        background 0.24s ease;
    backdrop-filter: blur(20px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 8px 6px 16px;
    border-bottom: 1px solid rgba(201, 214, 231, 0.76);
    justify-content: center;
}

.sidebar-brand {
    justify-content: flex-start;
}

.brand strong {
    display: block;
    font-family: var(--heading-font);
    font-size: 0.92rem;
    line-height: 1.15;
    letter-spacing: 0.01em;
}

.sidebar-brand-toggle {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #f1f4f8 0%, #e3e9f1 100%);
    color: #4d5b6d;
    border: 1px solid #c3cfdd;
    box-shadow:
        0 6px 14px rgba(34, 49, 69, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.hamburger-lines {
    position: relative;
    width: 16px;
    height: 12px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-lines span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: center;
    transition:
        transform 0.22s ease,
        opacity 0.18s ease,
        width 0.22s ease;
}

.hamburger-lines span:nth-child(2) {
    width: 12px;
    align-self: flex-end;
}

body.sidebar-hidden .hamburger-lines span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

body.sidebar-hidden .hamburger-lines span:nth-child(2) {
    opacity: 0;
}

body.sidebar-hidden .hamburger-lines span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

.sidebar-brand-toggle:hover {
    background: linear-gradient(180deg, #e8eef5 0%, #dbe3ed 100%);
    color: #344255;
    border-color: #b9c6d6;
}

.brand span {
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.2;
}

.app-brand-copy {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.app-brand-title {
    color: var(--text);
    font-size: clamp(0.78rem, 0.62rem + 0.34vw, 1.04rem);
    font-weight: 700;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
}

.brand-mark,
.brand-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #e59f52);
    color: white;
    font-weight: 700;
}

.brand-logo {
    display: block;
    object-fit: contain;
}

.menu {
    display: grid;
    gap: 6px;
    justify-items: stretch;
}

.menu-item {
    border: 1px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.42);
    padding: 11px 12px;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        color 0.18s ease;
}

.menu-item.active,
.menu-item:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 242, 255, 0.92));
    border-color: rgba(36, 116, 201, 0.18);
    color: var(--accent-strong);
    box-shadow: var(--shadow-soft);
    transform: translateX(2px);
}

.menu-icon {
    width: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6a7485;
    font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
}

.menu-item.active .menu-icon,
.menu-item:hover .menu-icon {
    color: currentColor;
}

.create-ticket-wrap {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    align-items: stretch;
    width: min(212px, 100%);
    margin: 0 auto 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(34, 49, 69, 0.1);
    box-shadow:
        0 10px 22px rgba(34, 49, 69, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.94);
    overflow: visible;
}

.create-ticket-nav {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: stretch;
    gap: 10px;
    min-height: 42px;
    margin-bottom: 0;
    padding: 0 14px;
    border: 0;
    border-radius: 999px 0 0 999px;
    background: transparent;
    box-shadow: none;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.create-ticket-icon {
    width: 24px;
    height: 24px;
    background: center / contain no-repeat url("/assets/images/plus_icon.jpg");
    flex-shrink: 0;
}

.create-ticket-menu-button {
    min-height: 42px;
    padding: 0;
    border: 0;
    border-left: 1px solid rgba(34, 49, 69, 0.08);
    border-radius: 0 999px 999px 0;
    background: transparent;
    color: #6b7586;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.create-ticket-caret {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid currentColor;
    transition: transform 0.18s ease;
}

.create-ticket-menu-button[aria-expanded="true"] .create-ticket-caret {
    transform: rotate(180deg);
}

.create-ticket-wrap:hover,
.create-ticket-wrap:focus-within {
    border-color: rgba(34, 49, 69, 0.18);
    box-shadow:
        0 12px 24px rgba(34, 49, 69, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.create-ticket-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: grid;
    gap: 4px;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 36px rgba(18, 34, 58, 0.14);
    z-index: 40;
}

.create-ticket-menu-item {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.create-ticket-menu-item strong {
    font-size: 0.84rem;
}

.create-ticket-menu-item span {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

.create-ticket-menu-item:hover {
    background: rgba(36, 116, 201, 0.08);
    border-color: rgba(36, 116, 201, 0.14);
    transform: none;
}

.menu-item span:last-child {
    flex: 1 1 auto;
    text-align: left;
}

.sidebar .menu {
    justify-items: stretch;
}

.sidebar nav.menu > .menu-item {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: center;
    justify-content: stretch !important;
    justify-items: start;
    gap: 12px;
    width: 100%;
    padding: 11px 14px 11px 18px;
    text-align: left !important;
}

.sidebar nav.menu > .menu-item .menu-icon {
    width: 16px;
    margin: 0;
}

.sidebar nav.menu > .menu-item span:last-child {
    width: 100%;
    text-align: left !important;
}

.create-ticket-nav.active,
.create-ticket-nav:hover {
    background: transparent;
    border-color: transparent;
    color: #1f2937;
    box-shadow: none;
    transform: none;
}

body.theme-dark .sidebar-brand-toggle {
    background: rgba(255, 255, 255, 0.12);
    color: #e6edf7;
    border-color: rgba(255, 255, 255, 0.16);
}

body.theme-dark .sidebar-brand-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.sidebar-restore-button {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 46px;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    background: linear-gradient(180deg, #f4f7fb 0%, #e6edf7 100%);
    color: #5f6d7f;
    border: 1px solid #d8e0ea;
    box-shadow: 0 10px 22px rgba(34, 49, 69, 0.12);
    font-size: 0.95rem;
    line-height: 1;
}

.sidebar-restore-button:hover {
    background: #e4eaf2;
    color: #4f5d70;
    border-color: #c8d3e0;
}

body.sidebar-hidden .sidebar {
    position: relative;
    overflow: hidden;
    padding: 8px 2px;
    opacity: 1;
    pointer-events: auto;
    width: 24px;
    min-width: 24px;
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.sidebar-hidden .brand {
    justify-content: center;
    margin-bottom: 0;
    padding: 0;
    border-bottom: 0;
}

body.sidebar-hidden .brand-mark,
body.sidebar-hidden .brand-logo,
body.sidebar-hidden .brand > div:last-child,
body.sidebar-hidden .menu,
body.sidebar-hidden .sidebar-brand-toggle {
    display: none;
}

body.sidebar-hidden .sidebar-restore-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.06em;
}

body.theme-dark .sidebar-restore-button {
    background: rgba(255, 255, 255, 0.12);
    color: #e6edf7;
    border-color: rgba(255, 255, 255, 0.16);
}

body.theme-dark .sidebar-restore-button:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0;
    padding: 18px 18px 0;
    height: calc(100dvh / var(--app-zoom-scale));
    overflow-x: hidden;
    overflow-y: auto;
    min-width: 0;
    position: relative;
    align-content: start;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 108, 122, 0.72) rgba(214, 222, 234, 0.42);
}

.main::-webkit-scrollbar {
    width: 10px;
}

.main::-webkit-scrollbar-track {
    background: rgba(214, 222, 234, 0.42);
    border-radius: 999px;
}

.main::-webkit-scrollbar-thumb {
    background: rgba(96, 108, 122, 0.72);
    border-radius: 999px;
}

.topbar,
.panel {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 24px;
    backdrop-filter: blur(18px);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    align-items: center;
    background: var(--topbar-shell-bg);
    border-color: var(--topbar-shell-border);
    box-shadow: var(--topbar-shell-shadow);
    position: relative;
    z-index: 20;
}

.topbar::after {
    content: "";
    position: absolute;
    left: -24px;
    right: -24px;
    bottom: -8px;
    border-bottom: 1px solid var(--topbar-shell-divider);
    pointer-events: none;
}

.sidebar-toggle-button {
    font-size: 1.15rem;
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.topbar h1,
.section-header h2,
.admin-card h3 {
    margin: 0 0 6px;
    font-family: var(--heading-font);
}

.topbar p,
.section-header p,
small,
.meta-label,
.ticket-card small {
    color: var(--muted);
}

.topbar .meta-label,
.topbar .sr-only {
    color: rgba(255, 255, 255, 0.8);
}

.panel {
    padding: 20px;
}

.main > section.panel {
    min-height: 0;
    overflow: auto;
    margin-bottom: 18px;
    padding-bottom: 18px;
}

.main > section.panel#detailPanel {
    overflow: hidden;
    padding-bottom: 0;
}

.app-footer {
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 52px;
    padding: 14px 12px 14px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1;
    background: color-mix(in srgb, var(--bg) 94%, white 6%);
    position: relative;
    z-index: 20;
    flex-shrink: 0;
}

.app-footer::before {
    content: "";
    position: absolute;
    left: -24px;
    right: -24px;
    top: 0;
    border-top: 1px solid rgba(213, 222, 234, 0.9);
    pointer-events: none;
}

body.ticket-focus-mode .shell {
    grid-template-columns: minmax(0, 1fr);
}

body.ticket-focus-mode .sidebar,
body.ticket-focus-mode .topbar,
body.ticket-focus-mode .app-footer {
    display: none !important;
}

body.ticket-focus-mode .main {
    grid-template-rows: minmax(0, 1fr);
    padding: 16px;
}

body.ticket-focus-mode .main > section.panel {
    margin-bottom: 0;
    padding: 18px;
    min-height: 100%;
}

.footer-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.footer-link:hover,
.footer-link:focus-visible {
    color: var(--accent-strong);
}

.app-footer-divider {
    display: inline-block;
    margin: 0 8px;
    color: var(--muted);
}

.legal-panel {
    min-height: 220px;
}

.legal-card {
    max-width: 720px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-header > div {
    min-width: 0;
}

.section-eyebrow {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-soft) 60%, white);
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-panel-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.panel-grid,
.admin-grid {
    display: grid;
    gap: 22px;
}

.home-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dashboard-actions,
.dashboard-menu-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-menu-wrap {
    position: relative;
}

.tool-launcher-panel {
    overflow: visible;
    padding: 18px 20px 20px;
}

.tool-launcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.tool-launcher-header h2,
.tool-launcher-header h3 {
    margin: 0 0 6px;
    font-family: var(--heading-font);
}

.tool-launcher-header p {
    margin: 0;
    color: var(--muted);
}

.tool-launcher-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tool-launcher-card {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 18px 18px 16px;
    border: 1px solid color-mix(in srgb, var(--border) 82%, white);
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(127, 175, 255, 0.18), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.94));
    text-align: left;
    color: var(--text);
    box-shadow: 0 14px 28px rgba(32, 78, 134, 0.08);
    cursor: pointer;
    transition:
        transform 140ms ease,
        box-shadow 140ms ease,
        border-color 140ms ease;
}

.tool-launcher-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
    box-shadow: 0 18px 32px rgba(32, 78, 134, 0.14);
}

.tool-launcher-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tool-launcher-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent-soft) 65%, white);
    color: var(--accent-strong);
    font-size: 1.1rem;
    font-weight: 700;
}

.tool-launcher-meta {
    white-space: nowrap;
}

.tool-launcher-card strong {
    font-size: 1.02rem;
}

.tool-launcher-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.tool-launcher-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 700;
}

.tool-launcher-link::after {
    content: "↗";
    font-size: 0.9rem;
}

#dashboardAddWidgetButton {
    min-height: 40px;
    padding-inline: 16px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(47, 109, 246, 0.18);
}

#dashboardMenuButton {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #2c4b6b;
    border: 1px solid rgba(37, 72, 111, 0.14);
    box-shadow: 0 10px 18px rgba(23, 53, 91, 0.12);
    padding: 0;
}

#dashboardMenuButton svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

#dashboardMenuButton:hover {
    background: #ffffff;
    color: var(--accent-strong);
    border-color: rgba(47, 109, 246, 0.22);
}

.dashboard-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-content: start;
}

.dashboard-widget-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    min-height: 132px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 255, 0.92));
    box-shadow: 0 14px 28px rgba(24, 56, 96, 0.09);
}

.dashboard-widget-wide {
    grid-column: span 2;
}

.dashboard-widget-header,
.dashboard-widget-actions,
.dashboard-chart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dashboard-widget-header h3 {
    margin: 0 0 4px;
}

.dashboard-widget-header .meta-label {
    display: none;
    text-transform: capitalize;
}

.dashboard-widget-actions .icon-button {
    width: 34px;
    height: 34px;
    background: rgba(18, 42, 71, 0.07);
    color: #47617d;
    border-color: rgba(18, 42, 71, 0.09);
}

.dashboard-widget-actions .icon-button:hover {
    background: rgba(47, 109, 246, 0.14);
    color: var(--accent-strong);
    border-color: rgba(47, 109, 246, 0.22);
}

.dashboard-kpi {
    display: grid;
    gap: 8px;
    align-content: start;
}

.dashboard-kpi strong {
    font-size: clamp(1.9rem, 3.8vw, 2.4rem);
    line-height: 1;
}

.dashboard-kpi span,
.dashboard-notes,
.dashboard-embed-card {
    color: var(--muted);
    line-height: 1.35;
}

.dashboard-notes {
    min-height: 180px;
    line-height: 1.6;
}

.dashboard-embed-card {
    display: grid;
    gap: 10px;
    min-height: 180px;
    align-content: start;
}

.dashboard-embed-card a {
    color: var(--accent);
    font-weight: 600;
}

.dashboard-chart {
    display: grid;
    gap: 12px;
}

.dashboard-widget-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.dashboard-widget-range input {
    width: auto;
    min-width: 145px;
}

.dashboard-chart-bar {
    flex: 1;
    height: 10px;
    border-radius: 999px;
    background: rgba(57, 82, 112, 0.1);
    overflow: hidden;
}

.dashboard-chart-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #49a3ff 0%, #6c80ff 100%);
}

.dashboard-donut {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.dashboard-donut-chart {
    width: min(220px, 100%);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    background: conic-gradient(
        #2f6df6 0deg 72deg,
        #34c3a6 72deg 144deg,
        #f6b82f 144deg 216deg,
        #f07a41 216deg 288deg,
        #9f7aea 288deg 360deg
    );
}

.dashboard-donut-chart::after {
    content: "";
    position: absolute;
    inset: 22%;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06);
}

.dashboard-donut-chart span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 1;
    font-weight: 700;
    font-size: 1.1rem;
}

.dashboard-donut-legend {
    display: grid;
    gap: 10px;
}

.dashboard-donut-legend div,
.report-legend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.dashboard-donut-legend strong,
.report-legend-row strong {
    color: var(--text);
}

.dashboard-empty-state {
    justify-items: center;
    text-align: center;
    padding: 36px 20px;
}

#homePanel .section-header {
    margin-bottom: 14px;
}

#homePanel .dashboard-actions {
    margin-left: auto;
    flex-wrap: wrap;
}

#homePanel .dashboard-widget-card h3 {
    font-size: 1.18rem;
    margin: 0;
}

#homePanel .dashboard-widget-card strong {
    letter-spacing: 0.01em;
}

.account-panel-body {
    gap: 14px;
}

.account-panel-hero {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.account-panel-hero h4 {
    font-size: 1.05rem;
}

.dashboard-empty-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 6px;
}

.panel-grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, var(--create-side-width));
}

#createPanel .panel-grid {
    grid-template-columns: minmax(0, 1fr) minmax(250px, var(--create-side-width));
    align-items: start;
}

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

.ticket-form,
.admin-card,
.ticket-meta {
    display: grid;
    gap: 16px;
}

.admin-card,
.ticket-meta,
.ticket-card,
.comment-card,
.attachment-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    padding: 14px;
}

#createPanel .ticket-form {
    gap: 14px;
}

#createPanel .ticket-meta {
    gap: 8px;
    max-width: var(--create-side-width);
    justify-self: end;
    width: 100%;
    padding: 16px 14px;
    position: sticky;
    top: 16px;
}

#createPanel .ticket-meta h3 {
    margin: 0;
    font-size: 0.98rem;
}

#createPanel .ticket-meta .meta-row {
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 6px;
    padding: 0;
    align-items: start;
}

#createPanel .ticket-meta .meta-label {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    padding-top: 3px;
}

#createPanel .ticket-meta .ticket-info-static {
    font-size: 0.84rem;
    line-height: 1.32;
}

#createPanel .ticket-meta .ticket-info-editable input,
#createPanel .ticket-meta .ticket-info-editable select {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 0.84rem;
}

#createPanel .ticket-meta .ticket-inline-field {
    gap: 6px;
}

#createPanel .ticket-meta .ticket-inline-toggle {
    width: 18px;
    height: 18px;
    align-self: center;
}

#createPanel .ticket-meta .ticket-inline-toggle svg {
    width: 15px;
    height: 15px;
}

#createPanel .ticket-meta .ticket-inline-view .ticket-info-static {
    min-height: 28px;
    display: flex;
    align-items: center;
}

#createPanel .ticket-meta .modern-date-input,
#createPanel .ticket-meta input[type="date"],
#createPanel .ticket-meta input[type="datetime-local"] {
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-color: color-mix(in srgb, var(--accent) 16%, var(--border));
    color: var(--text);
}

#createPanel .ticket-meta input[type="date"]::-webkit-calendar-picker-indicator,
#createPanel .ticket-meta input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.82;
}

#createPanel .ticket-meta .card-heading {
    margin-bottom: 2px;
}

.create-component-select-wrap {
    position: relative;
}

.create-component-select {
    border-radius: 999px;
    min-height: 42px;
    padding: 8px 38px 8px 14px;
    background: color-mix(in srgb, var(--accent-soft) 68%, white);
    border-color: color-mix(in srgb, var(--accent) 14%, var(--border));
    font-weight: 600;
    color: var(--accent-strong);
}

.create-description-attachments {
    display: grid;
    gap: 8px;
}

.create-description-attachments small {
    color: var(--muted);
}

.field {
    display: grid;
    gap: 8px;
}

label {
    font-weight: 600;
}

input,
select,
textarea,
button {
    font: inherit;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
}

textarea {
    resize: vertical;
}

.actions {
    display: flex;
    gap: 12px;
}

button {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
}

button.primary {
    background: var(--accent);
    color: white;
}

button.primary:hover {
    background: var(--accent-strong);
}

button.secondary {
    background: rgba(59, 45, 34, 0.08);
    color: var(--text);
}

.meta-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px;
    align-items: start;
}

.cc-field,
.cc-chip-list,
.claim-card {
    display: grid;
    gap: 10px;
}

.cc-picker {
    display: grid;
    gap: 8px;
}

.cc-picker-toggle {
    justify-self: start;
}

.cc-picker-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfdff;
    max-height: 220px;
    overflow: auto;
}

.cc-search-input {
    width: 100%;
    font-size: 0.8rem;
}

.cc-option-list {
    display: grid;
    gap: 8px;
    max-height: 220px;
    overflow: auto;
}

.cc-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #edf2f9;
    border-radius: 12px;
    background: white;
}

.cc-option-copy {
    display: grid;
    gap: 2px;
}

.cc-option-copy strong {
    color: var(--text);
    font-size: 0.96rem;
}

.cc-option-copy small {
    color: var(--muted);
    font-size: 0.82rem;
}

.cc-email-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.cc-chip-list {
    grid-template-columns: repeat(auto-fit, minmax(170px, max-content));
    gap: 6px;
}

.cc-chip {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(29, 123, 99, 0.12);
    color: var(--accent-strong);
    width: fit-content;
    max-width: 100%;
}

.chip-remove {
    padding: 0;
    min-width: 18px;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    line-height: 1;
}

.claim-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(47, 109, 246, 0.08);
    padding: 16px;
}

.meta-value {
    font-weight: 500;
}

.ticket-info-form {
    gap: 2px;
}

.ticket-info-heading {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}

.ticket-info-heading h3 {
    grid-column: 2;
    justify-self: center;
    text-align: center;
    margin: 0;
}

.ticket-info-heading-spacer {
    grid-column: 2;
    min-width: 1px;
    min-height: 1px;
}

.ticket-info-visibility-toggle {
    grid-column: 3;
    justify-self: end;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.ticket-info-visibility-toggle:hover {
    color: var(--accent-strong);
}

.ticket-info-body {
    display: grid;
    gap: 2px;
}

.ticket-info-form .meta-row {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 2px;
    padding: 0;
    align-items: start;
}

.ticket-info-form .meta-label {
    padding-top: 1px;
    font-size: var(--ticket-info-font-size, 0.76rem);
    font-weight: 600;
    line-height: 1.2;
}

.ticket-info-static {
    min-height: 0;
    display: block;
    font-weight: 500;
    font-size: var(--ticket-info-font-size, 0.78rem);
    line-height: 1.2;
    padding: 0;
    word-break: break-word;
}

.ticket-info-inline-person {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
}

.ticket-info-editable {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1px;
    align-items: center;
    min-width: 0;
}

.assignee-typeahead {
    position: relative;
    min-width: 0;
    z-index: 2;
}

.assignee-search-input {
    min-height: 24px;
    margin: 0;
    width: 100%;
}

.assignee-typeahead.is-disabled .assignee-search-input {
    background: color-mix(in srgb, var(--card) 92%, #f4f7fb 8%);
}

.ticket-info-editable select {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 0.78rem;
}

.ticket-info-editable input {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 0.78rem;
}

.ticket-info-editable .assignee-search-input,
.ticket-inline-editor .assignee-search-input {
    min-height: 24px;
    padding: 3px 8px;
    font-size: var(--ticket-info-font-size, 0.78rem);
    font-weight: 500;
    line-height: 1.2;
    font-family: inherit;
    color: inherit;
    letter-spacing: inherit;
}

.ticket-info-edit-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.ticket-info-edit-mark svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.ticket-inline-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px;
    align-items: start;
}

.ticket-inline-field-content {
    min-width: 0;
}

.ticket-inline-editor.hidden,
.ticket-inline-view.hidden {
    display: none;
}

.ticket-inline-toggle {
    border: 0;
    background: transparent;
    color: var(--accent);
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.ticket-inline-toggle svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.ticket-inline-toggle:hover {
    color: var(--accent-strong);
}

.compact-ticket-meta .ticket-info-form {
    justify-items: stretch;
    text-align: left;
}

.compact-ticket-meta .card-heading {
    justify-items: stretch;
    text-align: left;
}

.compact-ticket-meta .meta-row {
    grid-template-columns: 90px minmax(0, 1fr);
    justify-items: stretch;
    gap: 2px;
    text-align: left;
}

.compact-ticket-meta .meta-row > div:last-child {
    width: auto;
    max-width: none;
    justify-self: stretch;
}

.compact-ticket-meta .ticket-info-inline-person,
.compact-ticket-meta .ticket-info-static,
.compact-ticket-meta .ticket-inline-field,
.compact-ticket-meta .ticket-inline-field-content {
    justify-content: flex-start;
    justify-items: stretch;
    text-align: left;
}

.compact-ticket-meta .ticket-info-editable,
.compact-ticket-meta .ticket-inline-field {
    grid-template-columns: minmax(0, 1fr) auto;
}

.compact-ticket-meta .ticket-info-editable input,
.compact-ticket-meta .ticket-info-editable select,
.compact-ticket-meta .ticket-inline-editor input,
.compact-ticket-meta .ticket-inline-editor select {
    text-align: left;
}

.ticket-info-field-manager {
    display: grid;
    gap: 12px;
}

.create-template-manager {
    display: grid;
    gap: 12px;
}

.create-template-container {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 42%, var(--border));
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
}

.create-template-container-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.create-template-container-head strong {
    color: var(--text-strong);
    font-size: 0.95rem;
}

.create-template-row {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 42%, var(--border));
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
}

.create-template-row-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.create-template-row-head strong {
    font-size: 0.92rem;
}

.create-template-row-head span {
    color: var(--muted);
    font-size: 0.85rem;
}

.create-template-summary {
    display: grid;
    gap: 6px;
}

.create-template-summary-line {
    color: var(--muted);
    font-size: 0.84rem;
}

.create-template-summary-line strong {
    color: var(--text-strong);
}

.create-template-editor.hidden {
    display: none;
}

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

.create-template-grid .field {
    margin: 0;
}

.create-template-grid .field:last-child {
    grid-column: 1 / -1;
}

.create-template-grid textarea {
    min-height: 96px;
    resize: vertical;
}

.create-template-actions {
    margin-top: 0;
    justify-content: flex-start;
}

.ticket-info-field-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.9fr) auto minmax(180px, 1.2fr) 110px 130px;
    gap: 12px;
    align-items: end;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 42%, var(--border));
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
}

.ticket-info-field-main {
    display: grid;
    gap: 4px;
}

.ticket-info-field-main strong {
    text-transform: capitalize;
}

.ticket-info-field-main span {
    color: var(--muted);
    font-size: 0.82rem;
}

.ticket-info-field-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    font-weight: 600;
}

.ticket-info-field-control {
    display: grid;
    gap: 6px;
}

.ticket-info-field-control span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

@media (max-width: 1200px) {
    .ticket-info-field-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .ticket-info-field-row {
        grid-template-columns: minmax(0, 1fr);
    }

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

.compact-ticket-meta .ticket-inline-toggle {
    margin-top: 0;
}

.ticket-link-tags-static {
    padding-top: 4px;
}

.ticket-info-claim-button {
    margin-top: 8px;
    justify-self: start;
}

.ticket-link-editor,
.cc-typeahead {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--card) 96%, #f7fbff 4%);
}

.ticket-link-editor.is-disabled,
.cc-typeahead.is-disabled {
    background: color-mix(in srgb, var(--card) 92%, #f4f7fb 8%);
}

.ticket-link-editor input[type="text"],
.cc-search-input {
    min-height: 28px;
    margin: 0;
    font-size: 0.78rem;
}

.ticket-link-feedback {
    font-size: 0.75rem;
    font-weight: 600;
    color: #b42318;
    line-height: 1.2;
}

.ticket-link-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ticket-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(46, 136, 221, 0.1);
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 500;
}

.ticket-tag-chip span {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ticket-tag-link {
    text-decoration: none;
    transition:
        transform 120ms ease,
        background 120ms ease,
        color 120ms ease;
}

.ticket-tag-link:hover {
    background: rgba(46, 136, 221, 0.16);
    color: var(--accent-strong);
    transform: translateY(-1px);
}

.ticket-tag-chip small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 500;
}

.ticket-tag-chip button {
    min-width: 16px;
    min-height: 16px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    line-height: 1;
    font-size: 0.78rem;
}

.cc-suggestion-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 140;
    display: grid;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow);
    max-height: 180px;
    overflow: auto;
}

.cc-suggestion-list button {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.cc-suggestion-list button:hover {
    background: var(--accent-soft);
}

.cc-suggestion-list strong {
    font-size: 0.82rem;
}

.cc-suggestion-list span {
    color: var(--muted);
    font-size: 0.74rem;
}

.chip-row,
.lookup-lists,
.ticket-list,
.detail-grid {
    display: grid;
    gap: 14px;
}

.member-row {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(29, 123, 99, 0.12);
    color: var(--accent-strong);
    margin-right: 8px;
    margin-bottom: 8px;
}

.ticket-card {
    cursor: pointer;
}

.ticket-card:hover {
    transform: translateY(-2px);
}

.ticket-card h3,
.comment-card h4 {
    margin: 0 0 8px;
}

.ticket-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.detail-grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, var(--detail-side-width));
    align-items: start;
    min-height: 0;
    column-gap: 24px;
}

.hidden {
    display: none !important;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    max-width: 320px;
    background: #221b16;
    color: white;
    padding: 14px 16px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.setup-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 22px;
    min-height: 720px;
}

.setup-sidebar {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
    padding: 18px;
    display: grid;
    align-content: start;
    gap: 18px;
}

.setup-sidebar-head h2,
.setup-header h2,
.card-heading h3 {
    margin: 0;
}

.setup-sidebar-head p,
.setup-header p,
.card-heading p,
.setup-eyebrow {
    color: var(--muted);
}

.setup-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.setup-search input {
    background: white;
}

.setup-search input::placeholder {
    color: #99a8c2;
}

.setup-nav {
    display: grid;
    gap: 6px;
}

.setup-nav-item {
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    font-weight: 600;
}

.setup-nav-item:hover,
.setup-nav-item.active {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.setup-main {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 18px;
}

.setup-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    padding: 8px 4px 0;
}

.setup-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.setup-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--accent-soft) 50%, white);
    border-radius: 999px;
    color: var(--accent-strong);
    font-weight: 700;
    font-size: 0.88rem;
}

.setup-section,
.setup-card {
    display: grid;
    gap: 16px;
}

.setup-kpi-grid,
.setup-two-column,
.setup-form-grid,
.summary-list,
.permission-matrix,
.table-list {
    display: grid;
    gap: 16px;
}

.setup-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.setup-kpi {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 253, 0.94));
    padding: 18px;
    box-shadow: var(--shadow);
}

.setup-kpi strong {
    display: block;
    font-size: 1.8rem;
    margin-top: 10px;
}

.setup-kpi span {
    color: var(--muted);
    font-size: 0.92rem;
}

.setup-two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.setup-card {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.9));
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.system-diagnostics-shell {
    display: grid;
    gap: 18px;
}

.system-health-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.system-health-card,
.system-health-chart-card,
.system-health-storage-card {
    display: grid;
    gap: 16px;
}

.system-health-card-head,
.system-health-refresh-row,
.system-health-storage-head,
.system-health-storage-stats,
.system-health-storage-meta,
.system-health-chart-legend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.system-health-refresh-row {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.system-health-chart-grid,
.system-health-donut-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.system-health-chart-card {
    border: 1px solid color-mix(in srgb, var(--border) 88%, white);
    border-radius: 20px;
    background: color-mix(in srgb, var(--card) 90%, white);
    padding: 18px;
}

.system-health-chart-frame {
    border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 247, 255, 0.92)),
        radial-gradient(circle at top right, rgba(85, 161, 255, 0.12), transparent 45%);
    padding: 12px;
}

.system-health-chart-svg {
    display: block;
    width: 100%;
    height: auto;
}

.system-health-grid-line {
    stroke: rgba(77, 96, 126, 0.12);
    stroke-width: 1;
}

.system-health-grid-label {
    fill: rgba(92, 108, 132, 0.82);
    font-size: 10px;
    text-anchor: end;
}

.system-health-chart-line {
    fill: none;
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.system-health-chart-legend {
    display: grid;
    gap: 10px;
}

.system-health-chart-legend-row span,
.system-health-storage-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.system-health-chart-legend-row i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.system-health-chart-footer {
    margin: 0;
}

.system-health-storage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.system-health-storage-card {
    border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
    border-radius: 20px;
    background: color-mix(in srgb, var(--card) 86%, white);
    padding: 18px;
}

.system-health-storage-head {
    align-items: start;
}

.system-health-storage-head h4 {
    margin: 0;
    font-size: 1.02rem;
}

.system-health-storage-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    word-break: break-word;
}

.system-health-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-soft) 58%, white);
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 700;
}

.system-health-capacity-bar {
    height: 14px;
    border-radius: 999px;
    background: rgba(57, 82, 112, 0.1);
    overflow: hidden;
}

.system-health-capacity-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2f6df6 0%, #25c3b0 55%, #ffb74f 100%);
}

.system-health-storage-stats span,
.system-health-storage-meta span,
.system-health-summary-inline .summary-row span {
    color: var(--muted);
}

.system-health-empty-state {
    min-height: 240px;
    align-content: center;
}

.system-health-interface-list .table-row {
    align-items: start;
}

@media (max-width: 1180px) {
    .system-health-grid,
    .system-health-chart-grid,
    .system-health-donut-grid,
    .system-health-storage-grid {
        grid-template-columns: 1fr;
    }
}

.full-width-card {
    margin-top: 4px;
}

.card-heading {
    display: grid;
    gap: 6px;
    padding-bottom: 4px;
}

.setup-helper-note {
    margin: -2px 0 4px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent-soft) 55%, white);
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.toggle-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.toggle-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f9fbff;
    font-weight: 600;
}

.toggle-chip input {
    width: auto;
    margin: 0;
}

.inline-toggle {
    justify-self: start;
}

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

.search-bar-color-field {
    gap: 10px;
}

.search-bar-color-builder {
    display: grid;
    gap: 14px;
}

.search-bar-color-toolbar {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

input.search-bar-color-picker {
    width: 72px;
    min-width: 72px;
    height: 50px;
    padding: 4px;
    border-radius: 16px;
    cursor: pointer;
}

.search-bar-color-value {
    min-height: 50px;
}

.search-bar-color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-bar-color-swatch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    box-shadow: 0 8px 20px rgba(35, 60, 96, 0.08);
}

.search-bar-color-swatch::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(60, 84, 113, 0.12);
    background: var(--swatch-color, linear-gradient(180deg, #ffffff, #f7fbff));
}

.search-bar-color-swatch.active {
    border-color: color-mix(in srgb, var(--accent) 55%, white);
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--accent-soft) 70%, white),
        0 12px 24px rgba(35, 60, 96, 0.12);
}

.search-bar-color-preview {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.94), rgba(238, 244, 252, 0.92));
}

.search-bar-color-preview-shell {
    display: flex;
    align-items: center;
    min-height: 62px;
    padding: 0 20px;
    border-radius: 22px;
    border: 1px solid var(--topbar-search-border);
    background: var(--topbar-search-bg);
    color: var(--topbar-search-text);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        0 14px 28px rgba(37, 69, 110, 0.08);
}

.search-bar-color-preview-label {
    color: var(--topbar-search-placeholder);
    font-weight: 500;
}

.topbar-shell-color-preview {
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.94), rgba(238, 244, 252, 0.92));
}

.topbar-shell-color-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 78px;
    padding: 14px 16px;
    border-radius: 22px;
    border: 1px solid var(--topbar-shell-border);
    background: var(--topbar-shell-bg);
    box-shadow: var(--topbar-shell-shadow);
}

.topbar-shell-color-preview-search {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 0 18px;
    border-radius: 18px;
    border: 1px solid var(--topbar-search-border);
    background: var(--topbar-search-bg);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        0 10px 22px rgba(37, 69, 110, 0.08);
}

.topbar-shell-color-preview-search-text {
    color: var(--topbar-search-placeholder);
    font-weight: 600;
}

.topbar-shell-color-preview-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-shell-color-preview-icons span {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.topbar-shell-color-preview-icons span.is-avatar {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.5);
}

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

.integration-api-hero-card,
.integration-api-card {
    overflow: hidden;
}

.integration-api-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 20px;
    align-items: start;
    padding: 6px 2px;
}

.integration-api-hero-copy h3 {
    margin: 10px 0 0;
    font-size: 1.5rem;
}

.integration-api-hero-copy p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.7;
    max-width: 720px;
}

.integration-api-hero-points {
    display: grid;
    gap: 12px;
}

.integration-api-hero-point {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 255, 0.94)),
        radial-gradient(circle at top right, rgba(72, 135, 255, 0.12), transparent 50%);
}

.integration-api-hero-point strong {
    font-size: 0.96rem;
}

.integration-api-hero-point span {
    color: var(--muted);
    line-height: 1.55;
}

.integration-api-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 18px;
    align-items: start;
}

.integration-api-card {
    display: grid;
    gap: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.94)),
        radial-gradient(circle at top right, rgba(92, 153, 255, 0.12), transparent 42%);
}

.integration-api-mail-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(245, 249, 255, 0.95)),
        radial-gradient(circle at top left, rgba(63, 173, 157, 0.1), transparent 34%),
        radial-gradient(circle at top right, rgba(92, 153, 255, 0.12), transparent 40%);
}

.integration-api-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.integration-api-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, white);
    background: color-mix(in srgb, var(--accent-soft) 72%, white);
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.integration-api-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.integration-api-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--border) 85%, white);
    background: rgba(255, 255, 255, 0.88);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.integration-api-form-grid {
    align-items: start;
}

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

.integration-api-note-list {
    display: grid;
    gap: 10px;
}

.integration-api-note {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted);
    line-height: 1.6;
}

.integration-api-code-textarea {
    min-height: 250px;
    background: linear-gradient(180deg, rgba(14, 25, 42, 0.96), rgba(19, 34, 54, 0.92));
    color: rgba(236, 244, 255, 0.96);
    border-color: rgba(65, 116, 191, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.integration-api-code-textarea::placeholder {
    color: rgba(201, 219, 242, 0.64);
}

.setup-code-textarea {
    min-height: 220px;
    font-family: "SFMono-Regular", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88rem;
    line-height: 1.5;
}

.workspace-mail-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.workspace-mail-settings-panel {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    padding: 18px 20px;
    border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 255, 0.93)),
        radial-gradient(circle at top right, rgba(104, 164, 255, 0.08), transparent 48%);
    box-shadow: 0 16px 32px rgba(30, 57, 92, 0.06);
}

.workspace-mail-settings-panel .card-heading {
    margin-bottom: 0;
}

.workspace-mail-settings-panel h4 {
    margin: 0;
    font-size: 0.96rem;
}

.workspace-mail-settings-panel p {
    margin: 6px 0 0;
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.5;
}

.workspace-mail-toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 14px;
    align-items: start;
}

.workspace-mail-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 45%, var(--border));
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.45;
    box-sizing: border-box;
}

.workspace-mail-toggle input {
    flex: 0 0 18px;
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 3px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    accent-color: var(--accent);
    appearance: auto;
}

.workspace-mail-toggle span {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.88rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: normal;
}

@media (max-width: 900px) {
    .search-bar-color-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    input.search-bar-color-picker {
        width: 100%;
        min-width: 0;
    }

    .topbar-shell-color-preview-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-shell-color-preview-icons {
        justify-content: flex-end;
    }

    .workspace-mail-settings-grid,
    .workspace-mail-toggle-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .integration-api-grid,
    .integration-api-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .integration-api-card-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

.setup-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
}

#layoutProfileConfig {
    min-height: 180px;
    font-family: "SFMono-Regular", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.55;
}

.summary-list,
.permission-matrix,
.table-list {
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(250, 252, 255, 0.95);
}

.summary-row,
.matrix-row,
.table-row {
    display: grid;
    grid-template-columns: minmax(140px, 0.9fr) minmax(0, 1.4fr);
    gap: 16px;
    align-items: center;
    justify-items: start;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.summary-row span,
.matrix-row span,
.table-row span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.summary-row strong,
.matrix-row strong,
.table-row strong {
    font-size: 0.96rem;
    line-height: 1.45;
}

.about-panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 20px;
}

.about-panel .section-header {
    align-items: end;
}

.about-summary-card,
.about-learning-card {
    align-content: start;
}

.about-card-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.about-learning-card p {
    margin: 0;
    line-height: 1.7;
}

.markdown-help-intro {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(36, 116, 201, 0.06);
    color: var(--text);
    line-height: 1.7;
}

.markdown-help-table {
    display: grid;
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.88);
}

.markdown-help-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(180px, 0.9fr);
    gap: 18px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.markdown-help-row:last-child {
    border-bottom: 0;
}

.markdown-help-header {
    background: rgba(36, 116, 201, 0.06);
    font-weight: 700;
    color: var(--accent-strong);
}

.markdown-help-row code,
.markdown-help-row pre {
    margin: 0;
    font-family: "SFMono-Regular", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88rem;
}

.markdown-help-row code {
    display: block;
    padding: 0;
    background: transparent;
    white-space: pre-wrap;
    word-break: break-word;
}

.markdown-preview {
    line-height: 1.6;
}

.heading-preview-1,
.heading-preview-2 {
    display: block;
    font-family: var(--heading-font);
    color: var(--text);
}

.heading-preview-1 {
    font-size: 2rem;
}

.heading-preview-2 {
    font-size: 1.5rem;
}

.markdown-help-row blockquote {
    margin: 0;
    padding: 6px 0 6px 14px;
    border-left: 4px solid var(--border);
    color: var(--text);
}

.markdown-preview-list {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
}

.markdown-preview-ordered {
    padding-left: 24px;
}

.markdown-preview-rule-wrap {
    display: grid;
    gap: 10px;
}

.markdown-preview-rule-wrap hr {
    width: 100%;
    margin: 0;
    border: 0;
    border-top: 3px solid var(--border);
}

.markdown-preview-code {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(24, 36, 58, 0.06);
    overflow: auto;
}

.about-learning-card a {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(36, 116, 201, 0.08);
    color: var(--accent-strong);
    font-weight: 700;
    text-decoration: none;
}

.about-learning-card a:hover {
    background: rgba(36, 116, 201, 0.14);
}

.table-row.table-row-wide {
    grid-template-columns: minmax(0, 1fr) auto;
}

.table-row:last-child,
.summary-row:last-child,
.matrix-row:last-child {
    border-bottom: 0;
}

.portal-users-card .table-list {
    gap: 0;
    border-radius: 20px;
    background: #fff;
}

.portal-users-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.portal-users-search-wrap {
    width: min(420px, 100%);
}

.portal-users-search-wrap input {
    min-height: 42px;
}

.portal-users-card .card-heading h3,
.portal-user-table,
.portal-user-table button,
.portal-user-table strong,
.portal-user-table span,
.portal-user-table p {
    font-family: var(--font-family);
}

.portal-user-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(36, 116, 201, 0.35) rgba(36, 116, 201, 0.08);
}

.portal-user-scroll::-webkit-scrollbar {
    height: 10px;
}

.portal-user-scroll::-webkit-scrollbar-track {
    background: rgba(36, 116, 201, 0.08);
    border-radius: 999px;
}

.portal-user-scroll::-webkit-scrollbar-thumb {
    background: rgba(36, 116, 201, 0.34);
    border-radius: 999px;
}

.portal-user-table {
    display: grid;
    min-width: 1220px;
}

.portal-user-toolbar {
    display: grid;
    gap: 16px;
    padding: 20px 24px 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(245, 249, 255, 0.96), rgba(255, 255, 255, 0.98));
}

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

.portal-user-stat {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 55%, var(--border));
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
}

.portal-user-stat span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.portal-user-stat strong {
    font-size: 1.4rem;
    line-height: 1;
}

.portal-user-toolbar-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.portal-user-toolbar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.compact-summary-list {
    margin-bottom: 18px;
    border-radius: 18px;
    background: rgba(247, 250, 255, 0.88);
}

.compact-summary-list .summary-row {
    padding-top: 12px;
    padding-bottom: 12px;
}

.project-admin-card {
    gap: 18px;
    min-width: 0;
}

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

.project-overview-hero {
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.project-overview-hero::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -80px;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(44, 119, 208, 0.12), rgba(44, 119, 208, 0));
    pointer-events: none;
}

.project-settings-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-settings-flow-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 52%, var(--border));
    background: color-mix(in srgb, var(--accent-soft) 42%, white 58%);
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 700;
}

.project-admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    min-width: 0;
}

.project-admin-search-wrap {
    width: min(440px, 100%);
    flex: 1 1 320px;
    min-width: min(100%, 280px);
}

.project-admin-search-wrap input {
    min-height: 42px;
}

.project-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.project-overview-stat {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 55%, var(--border));
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(245, 249, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.project-overview-stat span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.project-overview-stat strong {
    font-size: 1.55rem;
    line-height: 1;
}

.project-overview-stat small {
    color: var(--muted);
    line-height: 1.45;
}

.project-directory-shell {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scrollbar-gutter: stable;
}

.project-directory-scroll {
    width: max-content;
    min-width: 100%;
    overflow: visible;
}

.project-directory-table {
    display: grid;
    min-width: 1140px;
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
}

.project-directory-head,
.project-directory-row {
    display: grid;
    grid-template-columns:
        minmax(240px, 1.45fr)
        minmax(160px, 0.82fr)
        minmax(210px, 1fr)
        minmax(220px, 1.05fr)
        minmax(150px, 0.72fr)
        minmax(150px, 0.68fr);
    gap: 12px;
    align-items: flex-start;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.project-directory-head {
    background: #f9fbff;
}

.project-directory-head span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.project-directory-row:last-child {
    border-bottom: 0;
}

.project-directory-cell {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.project-directory-name,
.project-directory-main {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.project-directory-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-directory-tag,
.project-directory-empty-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
}

.project-directory-tag {
    background: rgba(36, 116, 201, 0.08);
    color: var(--accent-strong);
}

.project-directory-empty-tag {
    background: rgba(32, 48, 73, 0.06);
    color: var(--muted);
}

.project-directory-actions {
    display: grid;
    justify-items: end;
}

.project-directory-empty {
    padding: 18px 22px;
    color: var(--muted);
    font-weight: 600;
}

.project-config-card .card-heading.compact-heading {
    margin-top: 8px;
}

.project-config-card {
    gap: 14px;
}

.project-config-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.project-config-head .card-heading {
    padding-bottom: 0;
}

.project-config-head .secondary {
    flex-shrink: 0;
    min-height: 38px;
    border-radius: 12px;
    font-weight: 700;
}

.project-config-section-heading {
    margin-top: 2px;
    margin-bottom: 2px;
}

.project-config-modules-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    align-items: start;
}

.project-config-module {
    display: grid;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.9));
}

.project-config-module-teams {
    border-color: rgba(47, 136, 234, 0.22);
}

.project-config-module-rules {
    border-color: rgba(96, 115, 218, 0.22);
}

.project-config-module-fields {
    border-color: rgba(31, 159, 147, 0.24);
}

.project-config-module .card-heading.compact-heading {
    margin-top: 0;
    margin-bottom: 0;
}

.project-config-module .card-heading p {
    margin: 0;
}

.project-config-card .portal-project-picker-field {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
}

.project-config-card .portal-project-picker-field .actions.inline-actions {
    margin-top: 8px;
}

.project-config-rules-grid,
.project-config-fields-grid {
    gap: 12px;
}

.project-config-rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-config-rules-grid .project-sla-note-field,
.project-module-row-grid .project-sla-note-field {
    grid-column: 1 / -1;
}

.project-config-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-config-card .summary-list {
    margin: 0;
}

.project-admin-grid {
    align-items: start;
    gap: 18px;
}

.project-admin-grid.is-form-hidden {
    grid-template-columns: minmax(0, 1fr);
}

.project-admin-stack {
    display: grid;
    gap: 18px;
    align-content: start;
}

.project-primary-stack {
    gap: 16px;
}

.project-secondary-stack {
    gap: 14px;
}

.project-access-card {
    gap: 16px;
}

.project-module-card {
    --project-card-accent: #2f88ea;
    --project-card-soft: rgba(47, 136, 234, 0.14);
    border-radius: 28px;
    border: 1px solid color-mix(in srgb, var(--project-card-soft) 44%, var(--border));
    background:
        radial-gradient(
            circle at 94% 8%,
            color-mix(in srgb, var(--project-card-accent) 12%, transparent),
            transparent 34%
        ),
        linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
    overflow: hidden;
    position: relative;
    transition:
        transform 0.18s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
    box-shadow:
        0 18px 44px rgba(22, 44, 80, 0.08),
        0 2px 0 rgba(255, 255, 255, 0.9) inset;
}

.project-module-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 24px 54px rgba(20, 40, 74, 0.14),
        0 2px 0 rgba(255, 255, 255, 0.92) inset;
    border-color: color-mix(in srgb, var(--project-card-accent) 35%, var(--border));
}

.project-module-card .card-heading {
    margin: -20px -20px 16px;
    padding: 14px 20px 16px 24px;
    border-bottom: 1px solid color-mix(in srgb, var(--project-card-soft) 48%, var(--border));
    background: linear-gradient(180deg, color-mix(in srgb, var(--project-card-soft) 34%, #f4f9ff), #fbfdff);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.project-module-card .card-heading::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    height: 100%;
    border-radius: 0 12px 12px 0;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--project-card-accent) 92%, white 8%),
        color-mix(in srgb, var(--project-card-accent) 68%, black 32%)
    );
}

.project-module-teams .card-heading::before {
    background: linear-gradient(180deg, #2f88ea, #1672cf);
}

.project-module-fields .card-heading::before {
    background: linear-gradient(180deg, #3ea1bd, #1e8c86);
}

.project-module-rules .card-heading::before {
    background: linear-gradient(180deg, #6f85ea, #4f62c5);
}

.project-module-teams {
    --project-card-accent: #2f88ea;
    --project-card-soft: rgba(47, 136, 234, 0.16);
}

.project-module-fields {
    --project-card-accent: #1f9f93;
    --project-card-soft: rgba(31, 159, 147, 0.16);
}

.project-module-rules {
    --project-card-accent: #6073da;
    --project-card-soft: rgba(96, 115, 218, 0.16);
}

.project-module-card .field {
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--project-card-soft) 46%, var(--border));
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
}

.project-module-card .field label {
    font-size: 0.8rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--project-card-accent) 35%, var(--muted));
    font-weight: 700;
}

.project-module-card .card-heading h3 {
    margin-bottom: 4px;
    font-size: 1.06rem;
    letter-spacing: 0.01em;
}

.project-module-card .card-heading p {
    margin: 0;
    color: var(--muted);
    max-width: 72ch;
}

.project-module-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.project-module-heading-actions .secondary {
    min-height: 36px;
    padding: 8px 15px;
    border-radius: 999px;
    border-color: color-mix(in srgb, var(--project-card-accent) 30%, var(--border));
    background: color-mix(in srgb, var(--project-card-soft) 34%, #ffffff);
    color: color-mix(in srgb, var(--project-card-accent) 76%, #1c2b42);
    font-weight: 700;
}

.project-module-card .actions.inline-actions {
    border-top: 1px solid color-mix(in srgb, var(--project-card-soft) 46%, var(--border));
    padding-top: 12px;
    margin-top: 6px;
}

.project-module-grid {
    gap: 14px;
}

.project-module-row-grid {
    gap: 0;
    border: 1px solid color-mix(in srgb, var(--project-card-soft) 44%, var(--border));
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, color-mix(in srgb, var(--project-card-soft) 26%, #f8fbff), #ffffff);
}

.project-module-row-grid-1 {
    grid-template-columns: minmax(0, 1fr);
}

.project-module-row-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-module-row-grid .field {
    border: 0;
    border-right: 1px solid color-mix(in srgb, var(--project-card-soft) 42%, var(--border));
    border-radius: 0;
    background: transparent;
    padding: 13px 14px;
    margin: 0;
}

.project-module-row-grid .field:last-child {
    border-right: 0;
}

.project-module-row-grid .field label {
    letter-spacing: 0.06em;
    font-size: 0.72rem;
    color: color-mix(in srgb, var(--project-card-accent) 38%, var(--muted));
}

.project-module-card textarea {
    min-height: 84px;
    resize: vertical;
}

.project-module-card select[multiple] {
    min-height: 136px;
}

.project-module-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid color-mix(in srgb, var(--project-card-soft) 44%, var(--border));
    border-radius: 16px;
    padding: 10px 12px;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--project-card-soft) 22%, #f8fbff),
        color-mix(in srgb, var(--project-card-soft) 10%, #f3f8ff)
    );
}

.project-module-actions .secondary {
    border-color: color-mix(in srgb, var(--project-card-accent) 28%, var(--border));
    background: rgba(255, 255, 255, 0.86);
    font-weight: 700;
}

.project-module-actions .secondary:hover {
    background: color-mix(in srgb, var(--project-card-soft) 28%, #ffffff);
    border-color: color-mix(in srgb, var(--project-card-accent) 42%, var(--border));
}

#projectSectionPopupBackdrop {
    z-index: 85;
}

.project-module-card-popup {
    position: fixed;
    top: 16px;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1280px, calc(100vw - 36px));
    max-height: calc(100vh - 32px);
    overflow: hidden;
    z-index: 90;
    box-shadow: 0 30px 60px rgba(17, 35, 66, 0.28);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
}

.project-module-card-popup .project-module-card-body {
    min-height: 0;
    overflow: auto;
    padding-right: 6px;
    padding-bottom: 10px;
    scrollbar-gutter: stable;
    scroll-padding-bottom: 96px;
}

.project-module-card-popup .project-module-actions {
    position: relative;
    background: linear-gradient(180deg, rgba(251, 253, 255, 0.7), rgba(255, 255, 255, 0.98));
    border-top: 1px solid color-mix(in srgb, var(--accent-soft) 44%, var(--border));
    margin: 0 -24px -24px;
    padding: 14px 24px calc(18px + env(safe-area-inset-bottom, 0px));
}

.project-config-card-popup {
    position: fixed;
    top: 16px;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1220px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: hidden;
    scrollbar-gutter: stable;
    z-index: 90;
    box-shadow: 0 30px 60px rgba(17, 35, 66, 0.28);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
}

.project-config-card-popup .project-config-card-body {
    min-height: 0;
    overflow: auto;
    display: grid;
    gap: 14px;
    padding-right: 8px;
    padding-bottom: 10px;
    scrollbar-gutter: stable;
    scroll-padding-bottom: 104px;
}

.project-config-card-popup .project-form-footer {
    position: relative;
    margin: 0 -24px -24px;
    padding: 14px 24px calc(18px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(36, 116, 201, 0.18);
    background: linear-gradient(180deg, rgba(251, 253, 255, 0.72), rgba(255, 255, 255, 0.98));
}

body.project-popup-open {
    overflow: hidden;
}

#customerPortalPopupBackdrop {
    z-index: 82;
}

.customer-portal-settings-card {
    gap: 14px;
}

.customer-portal-banner-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 46%, var(--border));
    border-radius: 18px;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--accent-soft) 24%, #f8fbff),
        #ffffff 42%,
        color-mix(in srgb, var(--accent-soft) 14%, #f6faff)
    );
    box-shadow:
        0 10px 22px rgba(24, 49, 86, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.customer-portal-banner-pill {
    display: grid;
    gap: 3px;
    align-content: center;
    min-height: 58px;
    padding: 8px 12px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 36%, var(--border));
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
}

.customer-portal-banner-pill span {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.customer-portal-banner-pill strong {
    font-size: 0.84rem;
    color: var(--text);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.customer-portal-background-preview {
    width: 100%;
    min-height: 168px;
    max-height: 240px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 40%, var(--border));
    background:
        linear-gradient(135deg, rgba(16, 34, 62, 0.85), rgba(25, 83, 154, 0.55)),
        linear-gradient(180deg, #edf5ff 0%, #d5e8fb 100%);
    box-shadow: 0 12px 24px rgba(24, 49, 86, 0.1);
}

.customer-portal-settings-card:not(.customer-portal-settings-card-popup) .customer-portal-settings-body {
    display: none;
}

.customer-portal-settings-card.customer-portal-settings-card-popup .customer-portal-banner-row {
    display: none;
}

.customer-portal-settings-card:not(.customer-portal-settings-card-popup) .setup-actions {
    justify-content: flex-end;
}

.customer-portal-settings-card-popup {
    position: fixed;
    top: 18px;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1040px, calc(100vw - 40px));
    max-height: none;
    overflow: hidden;
    z-index: 88;
    border-radius: 24px;
    box-shadow: 0 30px 68px rgba(17, 35, 66, 0.32);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
}

.customer-portal-settings-card-popup .card-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -24px -24px 0;
    padding: 24px 24px 14px;
    background: linear-gradient(180deg, rgba(250, 253, 255, 0.98), rgba(250, 253, 255, 0.92));
    border-bottom: 1px solid color-mix(in srgb, var(--accent-soft) 42%, var(--border));
}

.customer-portal-settings-card-popup .customer-portal-settings-body {
    min-height: 0;
    overflow: auto;
    display: grid;
    gap: 16px;
    padding-right: 8px;
    padding-bottom: 10px;
    scrollbar-gutter: stable;
    scroll-padding-bottom: 104px;
}

.customer-portal-settings-card-popup .setup-actions {
    position: relative;
    background: linear-gradient(180deg, rgba(251, 253, 255, 0.78), rgba(255, 255, 255, 0.98));
    border-top: 1px solid color-mix(in srgb, var(--accent-soft) 42%, var(--border));
    margin: 0 -24px -24px;
    padding: 14px 24px calc(22px + env(safe-area-inset-bottom, 0px));
}

body.customer-portal-popup-open {
    overflow: hidden;
}

.customer-portal-access-field {
    grid-column: 1 / -1;
}

.customer-portal-team-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.customer-portal-team-panel {
    display: grid;
    gap: 8px;
}

.customer-portal-team-panel-head {
    display: grid;
    gap: 3px;
}

.customer-portal-team-panel-head strong {
    color: var(--text);
    font-size: 0.92rem;
}

.customer-portal-team-panel-head span {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.customer-portal-team-panel select {
    min-height: 198px;
}

.customer-portal-team-picker-actions {
    display: grid;
    gap: 10px;
}

.customer-portal-team-picker-actions button {
    min-width: 128px;
}

.project-access-form-grid {
    display: grid;
    gap: 14px;
}

.project-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.project-access-group {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
}

.project-access-group + .project-access-group {
    margin-top: 12px;
}

.project-access-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.project-access-group-head > div {
    display: grid;
    gap: 4px;
}

.project-access-group-head span {
    color: var(--muted);
}

.project-access-group-list {
    display: grid;
    gap: 10px;
}

.project-access-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(36, 116, 201, 0.1);
    border-radius: 16px;
    background: rgba(247, 250, 255, 0.92);
}

.project-access-user {
    display: grid;
    gap: 3px;
}

.project-access-user span {
    color: var(--muted);
    font-size: 0.88rem;
}

.project-access-actions {
    justify-self: end;
}

.lookup-properties-head,
.lookup-properties-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.85fr) minmax(170px, 0.7fr) minmax(220px, 0.95fr);
    gap: 16px;
    align-items: center;
}

.lookup-properties-head {
    padding: 0 14px 10px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lookup-properties-row {
    padding: 14px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
}

.lookup-properties-name {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.lookup-properties-name div {
    display: grid;
    gap: 4px;
}

.lookup-properties-name strong {
    font-size: 1rem;
}

.lookup-properties-name span {
    color: var(--muted);
    font-size: 0.86rem;
}

.lookup-properties-order,
.lookup-properties-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lookup-properties-actions .chip-remove {
    min-width: auto;
    padding: 8px 12px;
    border-radius: 12px;
}

.portal-user-head,
.portal-user-row {
    display: grid;
    grid-template-columns:
        56px
        minmax(260px, 1.5fr)
        minmax(190px, 0.9fr)
        minmax(160px, 0.7fr)
        minmax(260px, 1.05fr)
        minmax(190px, 0.85fr)
        minmax(250px, 1fr);
    gap: 20px;
    align-items: center;
    justify-items: stretch;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.portal-user-head {
    padding-top: 14px;
    padding-bottom: 14px;
    background: #f9fbff;
    position: sticky;
    top: 0;
    z-index: 2;
}

.portal-user-head span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.portal-user-row:last-child {
    border-bottom: 0;
}

.portal-user-row-deleted {
    grid-template-columns:
        minmax(320px, 1.8fr)
        minmax(210px, 0.95fr)
        minmax(170px, 0.75fr)
        minmax(210px, 0.9fr)
        minmax(180px, 0.85fr);
}

.portal-user-index {
    color: var(--muted);
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
}

.portal-user-identity,
.portal-user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-user-identity > div:last-child {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.portal-user-identity strong {
    font-size: 1.08rem;
    letter-spacing: -0.01em;
}

.portal-user-identity span {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.45;
}

.portal-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
}

.portal-user-avatar .account-avatar {
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 20px rgba(24, 51, 95, 0.08);
}

.portal-user-avatar .avatar-fallback,
.portal-user-avatar .avatar-image {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 20px rgba(24, 51, 95, 0.08);
}

.portal-user-cell {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-size: 0.94rem;
    min-width: 0;
    word-break: break-word;
}

.portal-user-main-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.portal-user-meta-line,
.portal-user-projects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-user-project-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(36, 116, 201, 0.08);
    color: var(--accent-strong);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
}

.portal-user-group-tag {
    background: rgba(38, 166, 154, 0.1);
    color: #0f766e;
}

.portal-user-project-access-cell .portal-user-projects {
    margin-top: 2px;
}

.portal-user-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
}

.portal-user-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.portal-user-status-active {
    color: #20a54a;
}

.portal-user-status-inactive {
    color: #cf8b11;
}

.portal-user-status-deleted {
    color: #7b879a;
}

.portal-user-actions {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.portal-user-action-buttons {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-user-actions button {
    min-width: 84px;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 12px;
    white-space: nowrap;
}

.portal-user-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 132px;
    padding: 6px 10px 6px 8px;
    border-radius: 999px;
    background: rgba(32, 48, 73, 0.06);
    color: var(--text);
}

.portal-user-switch:hover {
    background: rgba(36, 116, 201, 0.1);
}

.portal-user-switch-track {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: rgba(125, 138, 160, 0.36);
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.portal-user-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(15, 32, 56, 0.18);
    transition: transform 0.2s ease;
}

.portal-user-switch.is-on .portal-user-switch-track {
    background: linear-gradient(180deg, #37bf69, #1f9c4d);
}

.portal-user-switch.is-on .portal-user-switch-thumb {
    transform: translateX(18px);
}

.portal-user-switch-label {
    font-size: 0.88rem;
    font-weight: 700;
}

.portal-user-action-note {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.portal-user-empty {
    padding: 18px 24px;
    color: var(--muted);
    font-weight: 600;
}

.portal-user-pagination {
    padding-left: 24px;
    padding-right: 24px;
    border-top: 1px solid var(--border);
}

.danger-button {
    background: rgba(221, 75, 57, 0.1);
    color: #b74334;
}

.danger-button:hover {
    background: rgba(221, 75, 57, 0.16);
}

.portal-user-form-card .setup-actions {
    margin: 0 -28px -28px;
    padding: 16px 28px calc(22px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid color-mix(in srgb, var(--accent-soft) 40%, var(--border));
    background: linear-gradient(180deg, rgba(251, 253, 255, 0.74), rgba(255, 255, 255, 0.98));
}

.portal-user-modal {
    width: min(1080px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow:
        0 34px 80px rgba(20, 45, 84, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.portal-user-form-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 22px;
    padding: 28px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    max-height: calc(100vh - 48px);
}

.portal-user-form-body {
    min-height: 0;
    overflow: auto;
    display: grid;
    gap: 22px;
    padding-right: 8px;
    padding-bottom: 8px;
    scrollbar-gutter: stable;
    scroll-padding-bottom: 104px;
}

.portal-user-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid color-mix(in srgb, var(--accent-soft) 45%, var(--border));
}

.portal-user-form-head h3 {
    font-family: var(--font-family);
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}

.portal-user-form-head p {
    max-width: 760px;
    line-height: 1.6;
}

.portal-user-form-section {
    display: grid;
    gap: 16px;
    padding: 20px 22px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 42%, var(--border));
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(249, 252, 255, 0.92), rgba(255, 255, 255, 0.98));
}

.portal-user-form-section-head {
    display: grid;
    gap: 4px;
}

.portal-user-form-section-head h4 {
    margin: 0;
    font-size: 1.02rem;
}

.portal-user-form-section-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.portal-user-form-grid {
    gap: 16px;
}

.portal-user-project-grid {
    align-items: start;
}

.portal-project-picker-field {
    align-content: start;
}

.portal-project-dropdown {
    position: relative;
}

.portal-project-search {
    min-height: 44px;
}

.portal-project-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 22px;
    margin-top: 10px;
}

.project-team-removal-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 46%, var(--border));
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.76);
}

.project-team-removal-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text);
}

.project-team-removal-item input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.portal-project-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(36, 116, 201, 0.1);
    color: var(--accent-strong);
    font-weight: 700;
}

.portal-project-chip-label,
.portal-project-chip-remove-button {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.portal-project-chip-label {
    font-weight: 700;
}

.portal-project-chip-label:hover {
    text-decoration: underline;
}

.portal-project-chip-remove-button {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.85;
}

.portal-project-chip-remove-button:hover {
    opacity: 1;
}

.portal-project-picker {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 15;
    display: grid;
    gap: 10px;
    max-height: 240px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 34px rgba(20, 45, 84, 0.12);
    overflow-y: auto;
}

.portal-project-option {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: rgba(32, 48, 73, 0.04);
    color: var(--text);
    text-align: left;
    box-shadow: none;
    transform: none;
}

.portal-project-option:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
    background: rgba(36, 116, 201, 0.08);
}

.portal-project-option.is-selected {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    background: rgba(36, 116, 201, 0.12);
}

.portal-project-option-check {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(36, 116, 201, 0.12);
    color: var(--accent-strong);
    font-size: 0.86rem;
    font-weight: 700;
}

.portal-project-option.is-selected .portal-project-option-check {
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    color: white;
}

.portal-project-option-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.portal-project-option-copy strong {
    font-size: 0.95rem;
}

.portal-project-option-copy span,
.portal-project-empty {
    color: var(--muted);
    font-size: 0.84rem;
}

.portal-project-empty {
    padding: 8px 2px;
}

.portal-project-picker-field small {
    display: block;
    margin-top: 12px;
}

.portal-team-create-modal {
    width: min(680px, calc(100vw - 28px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: color-mix(in srgb, var(--panel) 96%, white 4%);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 30px 60px rgba(20, 45, 84, 0.22);
    padding: 18px;
}

.portal-team-create-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.portal-team-create-header h3 {
    margin: 0;
}

.portal-team-create-form {
    display: grid;
    gap: 12px;
}

.portal-team-create-list {
    display: grid;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.66);
}

.portal-team-create-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
    border-radius: 12px;
    padding: 8px 10px;
    background: color-mix(in srgb, var(--accent-soft) 55%, white 45%);
}

.portal-team-create-user {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.portal-team-create-user strong,
.portal-team-create-user span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-team-create-user span {
    color: var(--muted);
    font-size: 0.84rem;
}

.portal-tool-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.portal-tool-access-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(32, 48, 73, 0.04);
    cursor: pointer;
    transition:
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease;
}

.portal-tool-access-option:hover {
    border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
    background: rgba(36, 116, 201, 0.08);
}

.portal-tool-access-option.is-selected {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
    background: rgba(36, 116, 201, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.portal-tool-access-option input {
    width: auto;
    margin: 2px 0 0;
}

.portal-tool-access-copy {
    display: grid;
    gap: 4px;
}

.portal-tool-access-copy strong {
    font-size: 0.96rem;
}

.portal-tool-access-copy span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.portal-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.portal-radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(32, 48, 73, 0.03);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.portal-radio-option:hover {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    background: rgba(36, 116, 201, 0.08);
}

.portal-radio-option input[type="radio"] {
    width: auto;
    margin: 0;
}

.portal-radio-option:has(input[type="radio"]:checked) {
    border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
    background: rgba(36, 116, 201, 0.12);
}

.portal-user-form-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.portal-user-form-card .toggle-chip {
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(36, 116, 201, 0.07);
    border-color: color-mix(in srgb, var(--accent) 16%, var(--border));
}

.portal-user-form-card small {
    color: var(--muted);
    line-height: 1.5;
}

.summary-row span,
.matrix-row span,
.table-row span {
    color: var(--muted);
}

.setup-tabbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}

.setup-tab {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

.setup-tab.active {
    background: white;
    color: var(--accent-strong);
    border-color: #bfd0f4;
    box-shadow: 0 4px 12px rgba(47, 109, 246, 0.1);
}

.setup-nav-hidden,
.admin-search-hidden {
    display: none !important;
}

.admin-card-dimmed {
    opacity: 0.62;
    transition: opacity 0.2s ease;
}

.static-chip-row {
    display: flex;
    flex-wrap: wrap;
}

.lookup-lists > div {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fbfdff;
    padding: 14px;
}

.lookup-lists {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.lookup-group-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fbfdff;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.lookup-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.lookup-group-head strong,
.workflow-map-head strong {
    display: block;
    font-size: 0.95rem;
}

.lookup-group-head span,
.workflow-map-head span,
.lookup-empty-state {
    color: var(--muted);
    font-size: 0.78rem;
}

.lookup-compact-list {
    display: grid;
    gap: 8px;
}

.lookup-compact-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(47, 109, 246, 0.12);
    border-radius: 12px;
    background: rgba(47, 109, 246, 0.04);
    cursor: grab;
}

.lookup-compact-item.is-disabled {
    opacity: 0.62;
}

.lookup-compact-item.dragging {
    opacity: 0.45;
}

.lookup-compact-item.drag-over {
    border-color: var(--accent);
    background: rgba(47, 109, 246, 0.1);
}

.lookup-drag-handle {
    min-width: 24px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.lookup-compact-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
}

.lookup-compact-order {
    font-size: 0.75rem;
    color: var(--muted);
}

.compact-action-button {
    padding: 4px 8px;
    font-size: 0.72rem;
    min-height: auto;
}

.lookup-workflow-select-wrap select {
    min-width: 104px;
    padding: 4px 8px;
    font-size: 0.74rem;
}

.lookup-workflow-map {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.workflow-map-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fbfdff;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.workflow-map-head {
    display: grid;
    gap: 3px;
}

.workflow-map-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.workflow-map-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    font-size: 0.82rem;
    cursor: pointer;
}

.workflow-map-chip.is-selected {
    border-color: rgba(29, 123, 99, 0.28);
    background: rgba(29, 123, 99, 0.12);
    color: var(--accent-strong);
}

.workflow-map-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.member-row {
    background: #fbfdff;
}

.permissions-grid {
    display: grid;
    gap: 14px;
}

.permissions-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.permissions-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.permissions-toolbar .small-label {
    margin-right: auto;
}

.permissions-toolbar button {
    min-height: 38px;
    padding: 8px 14px;
}

.permissions-grid-top,
.permissions-grid-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(120px, 1fr));
    gap: 14px;
    align-items: center;
}

.permissions-grid-top {
    padding: 0 10px 8px;
}

.permissions-grid-top > span {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
}

.permissions-role-head {
    display: grid;
    gap: 4px;
    justify-items: center;
    text-align: center;
}

.permissions-role-head strong {
    font-size: 1rem;
    color: var(--text);
}

.permissions-role-head span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.permissions-section {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: #fbfdff;
}

.permissions-section-title {
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-strong);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 253, 0.94));
}

.permissions-grid-row {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.permissions-section .permissions-grid-row:last-child {
    border-bottom: 0;
}

.permissions-label {
    color: var(--text);
    font-size: 0.96rem;
    font-weight: 700;
}

.permission-input-wrap {
    display: flex;
    justify-content: center;
}

.permission-input-wrap input,
.permission-input-wrap select {
    width: min(100%, 180px);
    min-height: 42px;
    font-size: 0.92rem;
}

.permission-toggle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.permission-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.permission-checkmark {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2px solid #c1d0ea;
    background: white;
    position: relative;
    transition: all 0.18s ease;
}

.permission-toggle input:checked + .permission-checkmark {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 8px 18px rgba(47, 109, 246, 0.2);
}

.permission-toggle input:checked + .permission-checkmark::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 2px;
    width: 5px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.topbar-search {
    position: relative;
    min-width: min(340px, 100%);
    max-width: none;
    width: 100%;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 42px;
    gap: 10px;
    align-items: center;
    padding: 0 16px;
    min-height: 50px;
    border-radius: 18px;
    border: 1px solid var(--topbar-search-border);
    background: var(--topbar-search-bg);
    box-shadow:
        0 12px 24px rgba(50, 94, 143, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.topbar-search-icon {
    color: var(--topbar-search-text);
    font-size: 1.2rem;
    line-height: 1;
}

.topbar-search-scope-native {
    display: none;
}

.topbar-search-filter {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    border: 0;
    background: transparent;
    color: var(--topbar-search-text);
    font-size: 1.15rem;
    justify-self: end;
}

.topbar-search-filter:hover {
    background: rgba(47, 109, 246, 0.08);
    color: var(--accent-strong);
}

.topbar-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
}

body.password-vault-standalone .topbar {
    justify-content: space-between;
}

body.password-vault-banner-hidden .topbar {
    justify-content: flex-end;
}

body.kba-standalone .topbar {
    justify-content: flex-end;
}

body.snipping-standalone .topbar {
    justify-content: flex-end;
}

body.kba-standalone .shell,
body.password-vault-standalone .shell,
body.snipping-standalone .shell {
    grid-template-columns: 1fr !important;
}

body.kba-standalone .sidebar,
body.password-vault-standalone .sidebar,
body.snipping-standalone .sidebar {
    display: none !important;
}

body.kba-standalone .sidebar-restore-button,
body.password-vault-standalone .sidebar-restore-button,
body.snipping-standalone .sidebar-restore-button {
    display: none !important;
}

body.kba-standalone .main,
body.password-vault-standalone .main,
body.snipping-standalone .main {
    padding-left: 18px;
}

body.kba-standalone .topbar-search {
    display: none !important;
}

body.snipping-standalone .topbar-search {
    display: none !important;
}

body.password-vault-standalone .topbar-search {
    display: block;
    min-width: min(420px, 100%);
    max-width: min(980px, calc(100% - 12px));
    padding: 6px;
    border-color: rgba(255, 255, 255, 0.22);
    background:
        linear-gradient(180deg, rgba(215, 234, 255, 0.18), rgba(175, 213, 255, 0.12));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 8px 18px rgba(31, 88, 156, 0.08);
}

body.password-vault-standalone .topbar-search-icon,
body.password-vault-standalone .topbar-search-scope-native,
body.password-vault-standalone .topbar-search input,
body.password-vault-standalone .topbar-search-filter,
body.password-vault-standalone .global-search-results {
    display: none;
}

.vault-scorpion-stage {
    display: none;
    position: relative;
    min-height: 78px;
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(180, 190, 215, 0.82);
    background:
        radial-gradient(circle at 18% 20%, rgba(132, 179, 255, 0.12), transparent 22%),
        linear-gradient(180deg, #0c1119 0%, #05080d 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 10px 22px rgba(30, 47, 74, 0.12);
}

body.password-vault-standalone .vault-scorpion-stage {
    display: block;
}

.vault-scorpion-stage[hidden],
body.password-vault-standalone .vault-scorpion-stage[hidden] {
    display: none !important;
}

.vault-scorpion-stage::after {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 12px;
    border: 1px solid rgba(248, 250, 255, 0.88);
    pointer-events: none;
}

.vault-scorpion-caption {
    position: absolute;
    left: 14px;
    top: 10px;
    z-index: 2;
    display: grid;
    gap: 2px;
    max-width: 280px;
    pointer-events: none;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
}

.vault-scorpion-caption-title {
    color: rgba(228, 236, 251, 0.72);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.vault-scorpion-caption-copy {
    color: rgba(214, 223, 242, 0.84);
    font-size: 0.76rem;
    line-height: 1.2;
}

.vault-scorpion-stage.is-reveal-ready .vault-scorpion-caption-copy {
    color: rgba(185, 214, 255, 0.96);
}

.vault-scorpion-stage.is-paused .vault-scorpion-caption-copy {
    color: rgba(255, 234, 183, 0.96);
}

.vault-scorpion-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.vault-scorpion-classic {
    position: absolute;
    left: 0;
    top: 0;
    display: none;
    font-size: 2rem;
    line-height: 1;
    transform: translate(-42px, 22px);
    filter: drop-shadow(0 5px 12px rgba(53, 124, 255, 0.18)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
    user-select: none;
    pointer-events: none;
    z-index: 1;
}

.vault-scorpion-stage[data-vault-motion="classic"] .vault-scorpion-classic {
    display: block;
}

.vault-scorpion-stage[data-vault-motion="classic"] .vault-scorpion-canvas,
.vault-scorpion-stage[data-vault-motion="none"] .vault-scorpion-canvas,
.vault-scorpion-stage[data-vault-motion="none"] .vault-scorpion-classic {
    display: none;
}

.icon-button,
.account-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.icon-button:hover,
.account-button:hover {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.24);
}

.sidebar .sidebar-brand-toggle {
    background: linear-gradient(180deg, #f1f4f8 0%, #e3e9f1 100%);
    color: #4d5b6d;
    border: 1px solid #c3cfdd;
    box-shadow:
        0 6px 14px rgba(34, 49, 69, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.sidebar .sidebar-brand-toggle:hover {
    background: linear-gradient(180deg, #e8eef5 0%, #dbe3ed 100%);
    color: #344255;
    border-color: #b9c6d6;
}

.account-menu-wrap {
    position: relative;
    z-index: 80;
}

.advanced-search-drawer.drawer {
    width: min(920px, calc(100vw - 64px));
    max-height: calc(100vh - 72px);
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 28px 50px rgba(8, 17, 30, 0.24);
    overflow: hidden;
    display: grid;
    justify-items: stretch;
    align-content: start;
}

.advanced-search-form {
    display: grid;
    gap: 10px;
    padding: 14px 20px 20px;
}

.advanced-search-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.advanced-search-row:last-of-type {
    border-bottom: 0;
}

.advanced-search-row label {
    padding-top: 8px;
}

.advanced-search-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px 12px;
}

.advanced-search-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
}

.advanced-search-check input {
    width: auto;
    margin: 0;
}

.account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 120;
}

.topbar-search input {
    background: transparent;
    border: 0;
    padding-left: 0;
    padding-right: 0;
    font-size: 0.98rem;
    color: var(--topbar-search-text);
}

.topbar-search input::placeholder {
    color: var(--topbar-search-placeholder);
}

.topbar-search input:focus {
    outline: none;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

button {
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease,
        color 0.16s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:disabled,
button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

button:disabled:hover,
button[aria-disabled="true"]:hover {
    transform: none;
}

button.primary {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: white;
    box-shadow: 0 12px 20px rgba(20, 82, 155, 0.18);
}

button.secondary {
    background: rgba(32, 48, 73, 0.07);
    color: var(--text);
}

.account-menu button {
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--text);
    border-radius: 0;
    padding: 12px 14px;
}

.account-menu button:hover {
    background: rgba(47, 109, 246, 0.08);
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(9, 17, 28, 0.3);
}

.overlay.hidden {
    display: none;
}

.widget-gallery-overlay {
    place-items: start;
    padding: 0;
    background: rgba(9, 17, 28, 0.12);
}

.widget-gallery.drawer,
.widget-config-drawer.drawer {
    width: min(1200px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 28px 50px rgba(8, 17, 30, 0.24);
    overflow: hidden;
    display: grid;
    justify-items: stretch;
    align-content: start;
}

.widget-gallery.drawer {
    position: fixed;
    top: var(--widget-gallery-top, 132px);
    left: var(--widget-gallery-left, auto);
    right: var(--widget-gallery-right, 32px);
    width: min(820px, calc(100vw - 32px));
    max-height: min(70vh, 720px);
    border-radius: 22px;
}

.widget-gallery-header,
.widget-gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.widget-gallery-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.widget-gallery-header .icon-button,
.widget-config-drawer .icon-button {
    background: rgba(18, 42, 71, 0.06);
    color: #4b5d73;
    border-color: rgba(18, 42, 71, 0.12);
}

.widget-gallery-toolbar {
    justify-content: flex-end;
    border-bottom: 0;
    padding-bottom: 8px;
}

.widget-gallery-toolbar input {
    max-width: 280px;
}

.widget-gallery-list {
    display: grid;
    gap: 22px;
    padding: 12px 24px 26px;
    overflow: auto;
}

.widget-gallery-group {
    display: grid;
    gap: 12px;
}

.widget-gallery-group h4 {
    margin: 0;
    color: #6c8790;
}

.widget-gallery-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.widget-gallery-card {
    display: grid;
    gap: 8px;
    min-height: 96px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(191, 210, 236, 0.9);
    background: white;
    text-align: left;
    box-shadow: 0 10px 22px rgba(17, 55, 93, 0.08);
    cursor: pointer;
    transition:
        transform 0.12s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease;
}

.widget-gallery-card strong {
    font-size: 1rem;
}

.widget-gallery-card span {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.widget-gallery-card:hover {
    transform: translateY(-1px);
    border-color: rgba(47, 109, 246, 0.26);
    box-shadow: 0 14px 26px rgba(17, 55, 93, 0.14);
}

.widget-gallery-card:active {
    transform: translateY(0) scale(0.992);
}

.widget-gallery-card.is-selected {
    background: color-mix(in srgb, var(--accent-soft) 34%, white);
    border-color: rgba(47, 109, 246, 0.22);
    box-shadow: 0 10px 22px rgba(17, 55, 93, 0.08);
}

.widget-config-drawer .ticket-form {
    padding: 22px 24px 24px;
}

.dashboard-grid [data-dashboard-widget-id] {
    cursor: move;
}

.account-avatar,
.account-avatar-large,
.avatar-fallback,
.avatar-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
}

.account-avatar {
    width: 32px;
    height: 32px;
}

.account-avatar-large {
    width: 72px;
    height: 72px;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent), #e59f52);
    color: white;
    font-weight: 700;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-panel-body,
.account-panel-hero,
.account-summary-list,
.knowledge-base-list,
.knowledge-comments,
.knowledge-comment-list {
    display: grid;
    gap: 16px;
}

.kba-shell {
    display: grid;
    gap: 18px;
}

.kba-hero {
    background:
        radial-gradient(circle at 12% 18%, rgba(74, 150, 255, 0.22), transparent 26%),
        radial-gradient(circle at 88% 16%, rgba(70, 203, 173, 0.18), transparent 26%),
        linear-gradient(135deg, rgba(235, 245, 255, 0.96), rgba(224, 241, 255, 0.88));
}

.kba-hero-mark {
    background: linear-gradient(135deg, #2474c9, #4bb7ff);
}

.kba-workspace {
    gap: 18px;
}

.kba-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "search search"
        "summary action";
    align-items: start;
    row-gap: 12px;
}

.snipping-panel {
    display: grid;
    gap: 16px;
}

.snipping-shell {
    display: grid;
    gap: 18px;
}

.snipping-hero {
    background:
        radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.18), transparent 24%),
        radial-gradient(circle at 86% 18%, rgba(88, 214, 178, 0.22), transparent 24%),
        linear-gradient(135deg, #4b7bff 0%, #6072ff 46%, #6a5ff0 100%);
}

.snipping-hero-mark {
    background: linear-gradient(135deg, #ffffff, #eef6ff);
    color: #4567f4;
    font-size: 1.5rem;
}

.snipping-workspace {
    gap: 18px;
}

.snipping-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(150px, 0.44fr) minmax(150px, 0.4fr) auto;
    gap: 12px;
    align-items: center;
}

.snipping-toolbar .secondary,
.snipping-toolbar .primary {
    min-height: 56px;
    border-radius: 18px;
    padding: 0 20px;
    font-weight: 700;
    font-size: 0.94rem;
    white-space: nowrap;
}

.snipping-search-shell {
    min-height: 58px;
}

.snipping-secure-note {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
    background: color-mix(in srgb, var(--accent-soft) 58%, white);
    color: var(--muted);
    line-height: 1.55;
}

.snipping-notice-copy {
    display: grid;
    gap: 4px;
    min-width: min(420px, 100%);
    flex: 1 1 420px;
}

.snipping-notice-copy strong {
    color: var(--text);
    font-size: 0.95rem;
}

.snipping-notice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.snipping-install-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    text-decoration: none;
}

.snipping-install-steps,
.snipping-permissions-list {
    margin: 4px 0 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 6px;
    color: var(--muted);
}

.snipping-install-steps li,
.snipping-permissions-list li {
    line-height: 1.5;
}

.snipping-install-security {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--accent) 15%, var(--border));
    background: color-mix(in srgb, var(--accent-soft) 32%, white);
}

.snipping-install-security strong {
    color: var(--text);
    font-size: 0.92rem;
}

.snipping-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.snipping-summary-card,
.snipping-editor-meta-card {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 52%, var(--border));
    background: linear-gradient(180deg, rgba(245, 249, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.snipping-summary-card span,
.snipping-editor-meta-card span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.snipping-summary-card strong,
.snipping-editor-meta-card strong {
    font-size: 1.3rem;
    line-height: 1.15;
}

.snipping-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.snipping-card {
    display: grid;
    gap: 0;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(212, 220, 235, 0.86);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-soft);
}

.snipping-card-preview {
    border: 0;
    padding: 0;
    background: linear-gradient(180deg, rgba(238, 244, 253, 0.96), rgba(226, 235, 248, 0.9));
    cursor: pointer;
}

.snipping-card-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.snipping-card-body {
    display: grid;
    gap: 12px;
    padding: 16px 18px 18px;
}

.snipping-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.snipping-card-head h3 {
    margin: 0;
    font-size: 1.03rem;
}

.snipping-card-head p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.snipping-card-mode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(85, 117, 255, 0.1);
    color: #3f57d8;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.snipping-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.snipping-card-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(37, 86, 138, 0.07);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.snipping-keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.snipping-keyword-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(108, 97, 239, 0.09);
    color: #5f56d2;
    font-size: 0.8rem;
    font-weight: 700;
}

.snipping-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.snipping-card-actions .secondary,
.snipping-card-open-link {
    min-height: 42px;
    border-radius: 14px;
}

.snipping-card-open-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.snipping-empty-state {
    min-height: 420px;
}

.snipping-editor-modal {
    width: min(1320px, calc(100vw - 40px));
}

.snipping-editor-shell {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 18px;
    padding: 0 26px 22px;
    min-height: 0;
}

.snipping-editor-sidebar {
    display: grid;
    gap: 16px;
    align-content: start;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.snipping-editor-section {
    gap: 14px;
}

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

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

.snipping-tool-grid .secondary.active,
.snipping-color-swatch.active {
    border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
    background: color-mix(in srgb, var(--accent-soft) 65%, white);
    color: var(--accent-strong);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        0 10px 18px rgba(34, 82, 142, 0.12);
}

.snipping-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
    gap: 8px;
}

.snipping-color-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    min-width: 38px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    color: transparent;
    font-size: 0;
    cursor: pointer;
}

.snipping-color-swatch::before {
    content: "";
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 1px solid rgba(47, 62, 90, 0.14);
    background: var(--snipping-swatch, #ff4d5a);
}

.snipping-editor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.snipping-editor-stage-card {
    display: grid;
    gap: 14px;
    min-height: 0;
}

.snipping-editor-stage-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: var(--muted);
}

.snipping-editor-stage-head strong {
    color: var(--text);
}

.snipping-editor-stage {
    display: grid;
    place-items: center;
    min-height: 420px;
    max-height: calc(100vh - 260px);
    padding: 18px;
    border-radius: 24px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 50%, var(--border));
    background:
        linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(237, 244, 253, 0.92)),
        radial-gradient(circle at top right, rgba(75, 123, 255, 0.12), transparent 34%);
    overflow: auto;
}

#snippingEditorCanvas {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 20px 44px rgba(19, 42, 75, 0.18);
    cursor: crosshair;
}

.kba-toolbar .vault-search {
    grid-area: search;
}

.kba-toolbar #knowledgeBaseNewArticleButton {
    grid-area: action;
    justify-self: end;
    min-width: 176px;
    white-space: nowrap;
}

.kba-summary-grid {
    grid-area: summary;
    display: grid;
    grid-template-columns: repeat(3, minmax(124px, 1fr));
    gap: 10px;
    min-width: min(100%, 520px);
}

.kba-summary-card {
    display: grid;
    gap: 4px;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(210, 222, 238, 0.92);
    background: linear-gradient(180deg, rgba(247, 251, 255, 0.96), rgba(236, 244, 255, 0.9));
}

.kba-summary-card span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.kba-summary-card strong {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 800;
}

.kba-write-hint {
    padding: 12px 14px;
    border: 1px dashed rgba(69, 135, 214, 0.36);
    border-radius: 14px;
    background: rgba(36, 116, 201, 0.05);
    color: var(--muted);
    font-size: 0.88rem;
}

.kba-article-list {
    gap: 18px;
}

.account-panel-hero {
    justify-items: start;
}

.account-avatar-preview-shell {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(36, 116, 201, 0.06);
}

.account-avatar-preview-copy {
    display: grid;
    gap: 4px;
}

.account-avatar-preview-copy strong {
    font-size: 0.92rem;
}

.account-avatar-preview-copy span {
    color: var(--muted);
    line-height: 1.5;
}

.account-panel-hero h4,
.knowledge-article-head h3 {
    margin: 0;
}

.account-panel-hero p {
    margin: 0;
    color: var(--muted);
}

.account-summary-list {
    width: 100%;
}

.account-summary-list div {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.55);
}

.account-summary-list span {
    color: var(--muted);
    font-size: 0.85rem;
}

#accountPasswordForm {
    gap: 12px;
}

.knowledge-article-card,
.knowledge-comment-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    padding: 18px;
}

.kba-article-card {
    border-radius: 20px;
    background:
        radial-gradient(circle at 100% 0%, rgba(36, 116, 201, 0.08), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 251, 255, 0.95));
    box-shadow: 0 14px 30px rgba(31, 45, 71, 0.08);
}

.knowledge-article-head,
.knowledge-comment-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.kba-article-head {
    margin-bottom: 10px;
}

.kba-article-copy {
    display: grid;
    gap: 10px;
}

.kba-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kba-keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kba-keyword-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(36, 116, 201, 0.09);
    color: #205ea7;
    font-size: 0.78rem;
    font-weight: 700;
}

.knowledge-article-body {
    line-height: 1.7;
}

.kba-comments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.knowledge-comment-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.kba-article-actions {
    justify-content: flex-end;
    flex-shrink: 0;
}

.knowledge-comment-actions .secondary.danger {
    color: #c4494c;
}

.knowledge-comment-body {
    line-height: 1.7;
}

.knowledge-comment-editor-shell {
    margin-top: 10px;
}

.knowledge-comment-edit-form .actions,
.knowledge-comment-form .actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.knowledge-comment-form .comment-editor-main,
.knowledge-comment-edit-form .comment-editor-main {
    display: grid;
    gap: 10px;
}

.knowledge-comment-form .comment-body-editor,
.knowledge-comment-edit-form .comment-body-editor {
    min-height: 140px;
}

.knowledge-comment-toolbar {
    grid-template-columns: repeat(auto-fit, minmax(44px, max-content));
}

.knowledge-comment-form textarea,
.knowledge-article-card textarea {
    min-height: 90px;
}

@media (max-width: 760px) {
    .kba-article-head {
        flex-direction: column;
    }

    .kba-article-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.kba-modal {
    max-width: 980px;
}

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

.knowledge-empty-state {
    min-height: 360px;
}

.avatar-cropper-drawer.drawer {
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    background: white;
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: 0 28px 50px rgba(8, 17, 30, 0.24);
    overflow: hidden;
    display: grid;
    justify-items: stretch;
    align-content: start;
}

.avatar-cropper-body {
    display: grid;
    gap: 18px;
    padding: 0 22px 22px;
}

.avatar-cropper-body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.avatar-cropper-stage-wrap {
    position: relative;
    width: min(280px, 100%);
    margin: 0 auto;
}

.avatar-cropper-stage {
    width: 280px;
    max-width: 100%;
    aspect-ratio: 1;
    border-radius: 28px;
    background:
        linear-gradient(
            45deg,
            rgba(32, 48, 73, 0.05) 25%,
            transparent 25%,
            transparent 75%,
            rgba(32, 48, 73, 0.05) 75%
        ),
        linear-gradient(
            45deg,
            rgba(32, 48, 73, 0.05) 25%,
            transparent 25%,
            transparent 75%,
            rgba(32, 48, 73, 0.05) 75%
        );
    background-position:
        0 0,
        12px 12px;
    background-size: 24px 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    touch-action: none;
    cursor: grab;
}

.avatar-cropper-stage:active {
    cursor: grabbing;
}

.avatar-cropper-stage img {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: none;
    max-height: none;
    transform-origin: center;
    user-select: none;
    -webkit-user-drag: none;
}

.avatar-cropper-ring {
    position: absolute;
    inset: 16px;
    border-radius: 50%;
    box-shadow:
        0 0 0 999px rgba(12, 18, 30, 0.42),
        inset 0 0 0 2px rgba(255, 255, 255, 0.92);
    pointer-events: none;
}

.topbar-search input {
    width: 100%;
    border: 0;
    background: transparent;
    min-height: 38px;
    padding: 0;
    box-shadow: none;
}

.topbar-search input:focus {
    box-shadow: none;
    outline: none;
}

.global-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(20, 35, 61, 0.12);
    overflow: hidden;
    z-index: 20;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.report-summary-card,
.report-legend-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    padding: 14px 16px;
    display: grid;
    gap: 6px;
}

.report-summary-card span {
    color: var(--muted);
}

.report-summary-card strong {
    font-size: 1.45rem;
}

.report-visual-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.report-legend-list {
    display: grid;
    gap: 10px;
}

.global-search-results button {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: inherit;
}

.global-search-results button:last-child {
    border-bottom: 0;
}

.global-search-results button:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.wrap-actions {
    flex-wrap: wrap;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    flex-wrap: wrap;
    padding: 0;
}

.list-toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.list-panel-header-shell .list-toolbar-actions {
    display: none;
}

.list-toolbar-actions .secondary {
    min-height: 30px;
    font-size: 0.76rem;
    padding: 6px 10px;
    border-radius: 10px;
}

.list-count-summary,
.list-page-summary {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.list-panel-header-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 16px;
    padding: 10px 16px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--card) 98%, #f8fbff 2%);
    box-shadow: 0 10px 24px rgba(31, 45, 71, 0.05);
}

.list-section-header {
    min-height: 0;
    margin: 0;
    padding: 0;
}

.list-toolbar-spacer {
    display: none;
    min-width: 0;
}

.list-panel-header-shell .section-header h2 {
    margin: 0;
    font-size: 1rem;
}

.list-panel-header-shell .section-header p {
    display: none;
}

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

.list-toolbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.list-toolbar-summaries {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 0.8rem;
}

.list-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 0;
}

.list-toolbar-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.list-nav-button {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 94%, #f3f6fb 6%);
    color: #45576f;
    font-size: 1.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.list-nav-button:hover:not(:disabled) {
    background: color-mix(in srgb, var(--card) 88%, #edf4ff 12%);
    color: var(--accent-strong);
}

.list-nav-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ticket-grid-shell {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: visible;
    background: var(--card);
    min-width: 0;
}

.ticket-grid-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: stable both-edges;
    -webkit-overflow-scrolling: touch;
}

.ticket-grid {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    position: relative;
    z-index: 0;
}

.ticket-grid th,
.ticket-grid td {
    padding: 13px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid #e8eef7;
    vertical-align: middle;
    white-space: nowrap;
}

.ticket-grid th {
    background: #f7faff;
    color: #5f718a;
    font-weight: 700;
    position: relative;
    z-index: 3;
    overflow: visible;
}

.ticket-grid thead {
    position: relative;
    z-index: 10;
}

.ticket-grid tbody {
    position: relative;
    z-index: 1;
}

.ticket-grid-head {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.ticket-grid-head-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
}

.ticket-grid-favorite-header .ticket-grid-head-label {
    display: none;
}

.ticket-grid th[data-ticket-header-cell] {
    position: relative;
}

.ticket-grid th[data-ticket-header-cell][draggable="true"] {
    cursor: grab;
}

.ticket-grid th.ticket-grid-head-dragging {
    opacity: 0.56;
}

.ticket-grid th.ticket-grid-head-drop-before::before,
.ticket-grid th.ticket-grid-head-drop-after::after {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: var(--accent);
}

.ticket-grid th.ticket-grid-head-drop-before::before {
    left: 0;
}

.ticket-grid th.ticket-grid-head-drop-after::after {
    right: 0;
}

.ticket-grid-head-button {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #566983;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 0.85rem;
}

.ticket-grid-head-button:hover,
.ticket-grid-head-button.active {
    background: rgba(46, 136, 221, 0.12);
    color: var(--accent-strong);
}

.ticket-grid-head-select {
    justify-content: center;
}

.ticket-grid-column-subject,
.ticket-grid-cell-subject {
    text-align: left !important;
}

.ticket-grid-head-subject {
    justify-content: flex-start;
}

.ticket-grid-cell-subject {
    min-width: 520px;
    white-space: normal;
}

.ticket-grid-cell-subject .ticket-title-normal,
.ticket-grid-cell-subject .ticket-title-urgent {
    display: block;
    width: 100%;
    text-align: left;
}

.ticket-grid-select-cell,
.ticket-grid-favorite-cell {
    width: 44px;
    text-align: center;
}

.ticket-grid-select-cell input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.ticket-grid-favorite-button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #8a97a8;
    cursor: pointer;
    padding: 0;
    font-size: 1.15rem;
    line-height: 1;
}

.ticket-grid-favorite-button:hover,
.ticket-grid-favorite-button.active {
    color: #d79a1f;
    background: rgba(215, 154, 31, 0.12);
}

.ticket-toolbar-icon-image {
    width: 18px;
    height: 18px;
    object-fit: contain;
    object-position: center;
    display: block;
    margin: auto;
}

.ticket-grid-row-selected td {
    background: rgba(46, 136, 221, 0.12);
}

.ticket-grid-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: #fafcff;
}

.ticket-grid-actions-main,
.ticket-grid-actions-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ticket-grid-actions-side {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    justify-self: end;
}

.ticket-grid-action-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: var(--accent-strong);
    font-weight: 700;
    cursor: pointer;
    padding: 4px 2px;
}

.ticket-grid-header-control {
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 0.76rem;
    white-space: nowrap;
}

.ticket-grid-action-button:disabled {
    color: var(--muted);
    cursor: not-allowed;
}

.ticket-grid-action-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.ticket-grid-selected-ids {
    color: var(--muted);
    font-size: 0.88rem;
}

.ticket-grid-header-menu-wrap {
    position: relative;
    z-index: 40;
}

.ticket-grid-header-menu-wrap-left .ticket-grid-header-menu {
    left: 0;
    right: auto;
}

.ticket-grid-header-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow);
    z-index: 1200;
    display: grid;
    gap: 4px;
}

.ticket-grid-header-menu button {
    border: 0;
    background: transparent;
    text-align: left;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
}

.ticket-grid-header-menu button:hover:not(:disabled) {
    background: rgba(46, 136, 221, 0.1);
}

.ticket-grid-header-menu button:disabled {
    color: var(--muted);
    cursor: not-allowed;
}

.ticket-grid tr:hover td {
    background: rgba(46, 136, 221, 0.06);
}

.ticket-grid th:last-child,
.ticket-grid td:last-child {
    border-right: 0;
}

.ticket-grid-row {
    cursor: pointer;
}

.ticket-title-normal {
    font-weight: 500;
}

.ticket-title-urgent {
    font-weight: 700;
}

.empty-state-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    min-height: 480px;
    padding: 40px 24px 56px;
    text-align: center;
}

.empty-state-illustration {
    width: min(100%, 520px);
    max-width: 520px;
    height: auto;
    object-fit: contain;
}

.empty-state-card h3 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 600;
}

.empty-state-card p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.ticket-grid-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 12px 16px;
    background: #fafcff;
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.ticket-grid-footer-meta,
.ticket-grid-footer-pager {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ticket-grid-footer-pager button {
    min-height: 34px;
    padding: 8px 12px;
}

.ticket-page-size {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.ticket-page-size span {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ticket-page-size select {
    width: auto;
    min-width: 86px;
    min-height: 34px;
    padding: 6px 28px 6px 10px;
    font-size: 0.9rem;
}

.detail-head-actions .secondary {
    min-height: 38px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    line-height: 1.1;
    font-weight: 700;
}

.status-open {
    background: #19a7dc;
    color: white;
}

.status-re-open,
.status-reopen {
    background: #19a7dc;
    color: white;
}

.status-in-progress,
.status-inprogress {
    background: #ffbf16;
    color: #1d2533;
}

.status-resolved {
    background: #c8f0d1;
    color: #1c6b37;
}

.status-closed {
    background: #dde4ef;
    color: #435067;
}

.drawer {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    justify-items: end;
}

.drawer.hidden {
    display: none;
}

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 18, 30, 0.42);
}

.drawer-panel {
    position: relative;
    width: min(560px, 100vw);
    height: calc(100vh / var(--app-zoom-scale));
    background: white;
    border-left: 1px solid var(--border);
    box-shadow: -22px 0 42px rgba(14, 24, 39, 0.12);
    padding: 18px 16px 20px;
    display: grid;
    align-content: start;
    gap: 12px;
    overflow: auto;
    font-size: 14px;
}

#columnManager {
    padding: 22px;
    justify-items: end;
}

#columnManager .drawer-panel {
    width: min(400px, calc(100vw - 40px));
    height: auto;
    max-height: calc(100vh - 44px);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 20px 34px rgba(14, 24, 39, 0.14);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: -18px;
    z-index: 2;
    padding: 2px 0 12px;
    background: white;
    border-bottom: 1px solid rgba(220, 229, 239, 0.9);
}

#columnManager .drawer-header {
    top: 0;
    margin: -18px -16px 0;
    padding: 16px 16px 12px;
    background: linear-gradient(180deg, rgba(252, 254, 255, 0.98), rgba(248, 251, 255, 0.94));
}

.drawer-header h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
}

.drawer-close {
    background: transparent;
    color: var(--accent);
    padding-inline: 0;
    font-size: 0.86rem;
}

.drawer-panel .field {
    gap: 8px;
}

.drawer-panel .field label {
    font-size: 0.84rem;
    line-height: 1.2;
    font-weight: 600;
}

.drawer-panel input[type="search"] {
    min-height: 40px;
    padding: 9px 12px;
    font-size: 0.92rem;
}

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

#columnManager .drawer-list {
    gap: 10px;
}

.drawer-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfdff;
    font-weight: 600;
    font-size: 0.92rem;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

#columnManager .drawer-option {
    min-height: 58px;
    padding: 8px 12px;
}

.drawer-option-main,
.drawer-order-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-option-main {
    flex: 1;
    min-width: 0;
}

.drawer-option-label {
    font-size: 0.94rem;
    line-height: 1.3;
}

.drawer-option .meta-label {
    font-size: 0.72rem;
}

.drawer-option-draggable {
    cursor: grab;
}

.drawer-order-actions {
    flex-shrink: 0;
}

.drawer-option.dragging {
    opacity: 0.55;
    background: #eef5ff;
}

.drawer-option.drag-over {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.drawer-option input {
    width: auto;
    margin: 0;
    transform: scale(1);
}

.drawer-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 28px;
    height: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text);
    cursor: grab;
    padding: 0 5px;
}

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

.drawer-drag-handle span {
    width: 3px;
    height: 13px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text) 55%, transparent);
}

.detail-stream-head,
.issue-card-head,
.comment-card-head,
.activity-panel-head,
.comments-shell-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.detail-stream-head {
    margin-bottom: 16px;
}

.detail-panel-header {
    display: none;
}

.detail-ticket-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ticket-detail,
.ticket-detail input,
.ticket-detail select,
.ticket-detail textarea,
.ticket-detail button {
    font-size: 1rem;
}

.ticket-number-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-top: 1px;
}

.ticket-number-copy {
    flex: 0 0 auto;
    min-height: 26px;
    padding: 4px 10px;
    font-size: 0.66rem;
    letter-spacing: 0.02em;
}

.ticket-number-renumber {
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.66rem;
    letter-spacing: 0.02em;
}

.ticket-detail-shell {
    display: grid;
    gap: 10px;
}

.ticket-detail-topbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
    box-shadow: 0 8px 18px rgba(30, 44, 71, 0.05);
}

.ticket-detail-topbar-main,
.ticket-detail-topbar-side,
.ticket-detail-toolbar,
.ticket-detail-heading-strip,
.ticket-detail-navbuttons,
.ticket-detail-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket-detail-leading {
    display: grid;
    gap: 6px;
    align-content: start;
}

.ticket-detail-topbar-main {
    flex: 1 1 auto;
    display: grid;
    gap: 8px;
    align-content: start;
}

.ticket-detail-topbar-side {
    flex-wrap: wrap;
    justify-content: flex-end;
    align-content: flex-start;
}

.ticket-focus-toggle.is-active {
    background: color-mix(in srgb, var(--accent) 14%, #ffffff 86%);
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    color: var(--accent-strong);
}

.ticket-detail-toolbar {
    position: relative;
    flex-wrap: wrap;
}

.ticket-toolbar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
}

.ticket-toolbar-button-menu {
    font-size: 0.95rem;
    line-height: 1;
    padding-top: 1px;
}

.ticket-detail-titleblock {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 0;
}

.ticket-title-form {
    margin: 0;
    width: 100%;
    min-width: 0;
}

.ticket-detail-breadcrumbs {
    flex-wrap: wrap;
    gap: 6px;
}

.ticket-detail-breadcrumbs-inline {
    margin-left: 4px;
    position: relative;
}

.ticket-breadcrumb-chip,
.ticket-header-meta-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-soft) 80%, white);
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 700;
}

.ticket-breadcrumb-separator {
    color: var(--muted);
}

.ticket-detail-heading-strip {
    display: inline-flex;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    min-height: 0;
    line-height: 1.1;
    padding: 0;
    flex: 0 0 auto;
}

.ticket-detail-heading-label {
    color: color-mix(in srgb, var(--text) 84%, white);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ticket-detail-heading-divider {
    color: color-mix(in srgb, var(--text) 84%, white);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.1;
}

.ticket-detail-heading-display {
    cursor: text;
    min-width: 0;
    width: 100%;
    display: flex;
    align-items: baseline;
    justify-content: start;
    gap: 8px;
    text-align: left;
}

.ticket-detail-heading-edit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 8px;
    text-align: left;
}

.ticket-detail-heading-box {
    min-height: 34px;
    width: 100%;
    min-width: 0;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.ticket-detail-heading-box-empty {
    min-height: 34px;
}

.ticket-detail-heading-box-standalone {
    width: 100%;
    min-height: 0;
    padding: 10px 12px;
    border-radius: 18px;
    display: grid;
    justify-items: start;
    gap: 8px;
    margin-bottom: 6px;
}

.ticket-detail-heading-edit input {
    min-height: 24px;
    flex: 1 1 auto;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: left;
}

.ticket-detail-heading-display h2 {
    margin: 0;
    min-width: 0;
    width: 100%;
    display: block;
    flex: 1 1 auto;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.15;
    color: color-mix(in srgb, var(--text) 92%, white);
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: left;
    justify-self: stretch;
}

.ticket-detail-number {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ticket-detail-heading-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.ticket-detail-navmeta {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.ticket-detail-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 2px 2px 10px;
}

.ticket-detail-tabs-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, var(--detail-side-width));
    gap: 20px;
    align-items: start;
    margin-bottom: 10px;
    padding-bottom: 2px;
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 20;
}

.detail-tabs-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    align-self: center;
    justify-content: flex-end;
    padding-right: 12px;
}

.ticket-detail-tab {
    min-width: 0;
    padding: 7px 11px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.82rem;
}

.ticket-detail-tab.active,
.ticket-detail-tab:hover {
    background: rgba(255, 255, 255, 0.86);
    border-color: var(--border);
    color: var(--accent-strong);
}

.ticket-detail-main,
.detail-panel-stack {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.ticket-detail-main,
#createPanel .ticket-meta {
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 108, 122, 0.72) rgba(214, 222, 234, 0.42);
}

.ticket-detail-main::-webkit-scrollbar,
#createPanel .ticket-meta::-webkit-scrollbar {
    width: 10px;
}

.ticket-detail-main::-webkit-scrollbar-track,
#createPanel .ticket-meta::-webkit-scrollbar-track {
    background: rgba(214, 222, 234, 0.42);
    border-radius: 999px;
}

.ticket-detail-main::-webkit-scrollbar-thumb,
#createPanel .ticket-meta::-webkit-scrollbar-thumb {
    background: rgba(96, 108, 122, 0.72);
    border-radius: 999px;
}

@media (min-width: 981px) {
    #detailPanel {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    #ticketDetail.ticket-detail {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        flex: 1 1 auto;
    }

    .ticket-detail {
        min-height: 0;
    }

    .ticket-detail-shell {
        grid-template-rows: auto auto auto minmax(0, 1fr);
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .detail-grid {
        grid-template-rows: minmax(0, 1fr);
        min-height: 0;
        height: 100%;
        align-items: stretch;
        overflow: hidden;
        margin-top: 12px;
        position: relative;
        z-index: 1;
    }

    .detail-grid > * {
        min-height: 0;
    }

    .ticket-detail-main {
        padding-right: 8px;
        padding-top: 4px;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto !important;
        overflow-x: hidden;
        scrollbar-gutter: stable;
        align-self: stretch;
        overscroll-behavior: contain;
    }

    .compact-ticket-meta {
        padding-right: 4px;
        max-height: none;
        overflow: visible;
        scrollbar-gutter: auto;
    }

    #createPanel .ticket-meta {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-gutter: stable both-edges;
    }
}

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

.ticket-detail-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.ticket-detail-summary-grid .detail-static-value {
    display: grid;
    gap: 4px;
    min-height: 60px;
}

.detail-related-card p {
    margin: 0;
}

.status-timeline-table-wrap {
    overflow-x: auto;
}

.status-timeline-head-tools {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.status-timeline-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.86);
}

.status-timeline-view-button {
    min-width: 0;
    padding: 5px 10px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.status-timeline-view-button.active {
    background: rgba(36, 116, 201, 0.12);
    color: var(--accent-strong);
}

.status-flow-snake {
    display: grid;
    gap: 10px;
    padding: 8px 2px 2px;
    overflow-x: auto;
    overflow-y: hidden;
}

.status-flow-row-block {
    display: grid;
    gap: 8px;
}

.status-flow-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 76px;
}

.status-flow-row.reverse {
    flex-direction: row-reverse;
}

.status-flow-status {
    display: grid;
    justify-items: center;
    gap: 6px;
    flex: 0 0 124px;
    min-width: 0;
}

.status-timeline-empty {
    margin: 0;
    color: var(--muted);
}

.status-flow-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 116px;
    max-width: 132px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 10px rgba(25, 44, 72, 0.08);
    white-space: nowrap;
}

.status-flow-pill-open {
    background: linear-gradient(180deg, #24ace0, #0f9bd1);
    color: #fff;
}

.status-flow-pill-progress {
    background: linear-gradient(180deg, #ffd34d, #f4bc08);
    color: #151515;
}

.status-flow-pill-closed {
    background: linear-gradient(180deg, #5ee0d0, #45cab9);
    color: #10222b;
}

.status-flow-pill-default {
    background: linear-gradient(180deg, #f2f6fb, #e7eef9);
    color: var(--text);
}

.status-flow-segment {
    display: grid;
    align-items: center;
    justify-items: center;
    gap: 6px;
    min-width: 220px;
}

.status-flow-connector {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 5px;
    flex: 1 1 120px;
    min-width: 96px;
    padding-top: 0;
}

.status-flow-duration {
    font-size: 0.72rem;
    font-weight: 700;
    color: #344764;
    white-space: nowrap;
}

.status-flow-actor {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    line-height: 1.25;
}

.status-flow-arrow-line {
    position: relative;
    display: block;
    width: 100%;
    min-width: 72px;
    border-top: 1px dashed rgba(112, 131, 160, 0.65);
}

.status-flow-arrow-line::after {
    content: "";
    position: absolute;
    top: -5px;
    right: -1px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid rgba(112, 131, 160, 0.9);
}

.status-flow-row.reverse .status-flow-arrow-line::after {
    right: auto;
    left: -1px;
    border-left: 0;
    border-right: 8px solid rgba(112, 131, 160, 0.9);
}

.status-flow-turn {
    display: grid;
    justify-items: center;
    gap: 4px;
    width: 124px;
}

.status-flow-turn-right {
    justify-self: end;
}

.status-flow-turn-left {
    justify-self: start;
}

.status-flow-turn-line {
    position: relative;
    display: block;
    width: 2px;
    height: 28px;
    background: linear-gradient(180deg, rgba(112, 131, 160, 0.2), rgba(112, 131, 160, 0.75));
}

.status-flow-turn-line::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid rgba(112, 131, 160, 0.9);
}

.activity-stream-feed {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.activity-stream-group {
    display: grid;
    gap: 10px;
}

.activity-stream-date-row {
    padding-left: 42px;
}

.activity-stream-date-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
}

.activity-stream-date-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}

.activity-stream-item {
    position: relative;
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 22px;
    min-width: 0;
}

.activity-stream-item::before {
    content: "";
    position: absolute;
    left: 57px;
    top: -24px;
    bottom: -18px;
    width: 2px;
    background: linear-gradient(180deg, rgba(112, 131, 160, 0.16), rgba(112, 131, 160, 0.44));
}

.activity-stream-item:last-child::before {
    bottom: 26px;
}

.activity-stream-time-rail {
    position: relative;
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
}

.activity-stream-time-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.95);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.activity-stream-time-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
}

.activity-stream-entry {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(112, 131, 160, 0.18);
}

.activity-stream-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #7fd9d7, #5fc7c4);
    color: #17313b;
    font-size: 1rem;
    font-weight: 800;
}

.activity-stream-entry-body {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding-top: 2px;
}

.activity-stream-title {
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.4;
}

.activity-stream-actor {
    font-weight: 700;
}

.activity-stream-action {
    color: var(--accent-strong);
    font-weight: 800;
}

.activity-stream-change {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.activity-stream-change strong {
    color: var(--text);
    font-weight: 700;
}

.activity-stream-summary {
    min-width: 0;
}

.activity-stream-summary p {
    margin: 0;
    color: var(--text);
    line-height: 1.65;
}

.activity-stream-empty {
    color: var(--muted);
    padding: 4px 0;
}

@media (max-width: 860px) {
    .status-flow-row,
    .status-flow-row.reverse {
        flex-direction: column;
        gap: 10px;
    }

    .status-flow-status,
    .status-flow-connector {
        width: 100%;
        flex: none;
    }

    .status-flow-arrow-line {
        width: 2px;
        min-width: 0;
        height: 34px;
        border-top: 0;
        background: linear-gradient(180deg, rgba(112, 131, 160, 0.2), rgba(112, 131, 160, 0.75));
    }

    .status-flow-arrow-line::after,
    .status-flow-row.reverse .status-flow-arrow-line::after {
        top: auto;
        left: 50%;
        right: auto;
        bottom: -1px;
        transform: translateX(-50%);
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 10px solid rgba(112, 131, 160, 0.9);
        border-bottom: 0;
    }

    .status-flow-turn,
    .status-flow-turn-right,
    .status-flow-turn-left {
        justify-self: center;
    }

    .activity-stream-date-row {
        padding-left: 28px;
    }

    .activity-stream-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding-left: 28px;
    }

    .activity-stream-item::before {
        left: 19px;
        top: -20px;
        bottom: -16px;
    }

    .activity-stream-time-rail {
        justify-content: flex-start;
    }

    .activity-stream-entry {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .activity-stream-avatar {
        width: 42px;
        height: 42px;
        font-size: 0.88rem;
    }
}

.status-timeline-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.status-timeline-table th,
.status-timeline-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.status-timeline-table th {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-timeline-table tbody tr:last-child td {
    border-bottom: 0;
}

.detail-inline-label-side {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding-left: 16px;
    min-width: max-content;
}

.detail-description-actions {
    position: relative;
    display: inline-flex;
    align-items: center;
    align-self: center;
}

.detail-project-inline {
    display: grid;
    gap: 6px;
    min-width: 280px;
}

.detail-project-groups-view {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.ticket-path-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    max-width: min(84vw, 1320px);
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 6px 18px rgba(33, 58, 92, 0.05);
}

.ticket-path-folder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #28384e;
    flex: 0 0 auto;
}

.ticket-path-folder svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ticket-path-items {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    color: #2a3b53;
    font-size: 0.88rem;
    font-weight: 700;
}

.ticket-path-item {
    display: inline-block;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
    vertical-align: bottom;
}

.ticket-path-separator {
    color: var(--muted);
    margin: 0 5px;
    font-weight: 700;
}

.detail-project-groups-edit {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 20;
    width: min(430px, calc(100vw - 64px));
}

.detail-project-tags {
    padding-top: 0;
}

.detail-project-tags .ticket-tag-chip,
.project-group-editor .ticket-tag-chip {
    position: relative;
}

.detail-project-tags .ticket-tag-chip + .ticket-tag-chip::before,
.project-group-editor .ticket-tag-chip + .ticket-tag-chip::before {
    content: ">";
    margin-right: 6px;
    color: var(--muted);
    font-weight: 700;
}

.detail-inline-add-button {
    flex: 0 0 auto;
    min-width: 28px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
}

.detail-inline-add-button svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.detail-project-groups-edit .project-group-editor {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.96));
    box-shadow:
        0 18px 38px rgba(28, 53, 86, 0.12),
        0 2px 8px rgba(28, 53, 86, 0.06);
}

.detail-project-groups-edit .ticket-link-tags {
    min-height: 26px;
    align-items: center;
}

.project-group-popover-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.project-group-popover-head strong {
    display: block;
    font-size: 0.98rem;
    color: #233550;
}

.project-group-popover-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.project-group-project-pill {
    display: inline-flex;
    align-items: center;
    max-width: min(56vw, 520px);
    padding: 5px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-soft) 72%, white);
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-group-selected-strip {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
}

.project-group-selected-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.project-group-empty-state {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
}

.project-group-route-controls {
    display: grid;
    gap: 6px;
}

.project-group-route-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.project-group-route-controls select[data-project-group-project] {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.82rem;
}

.project-group-inline-actions {
    margin-left: auto;
}

.detail-project-groups-edit [data-project-group-team-list] {
    display: grid;
    gap: 10px;
    min-height: 104px;
    max-height: 240px;
    overflow: auto;
    padding: 6px;
    border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
}

.project-group-team-option {
    display: grid;
    grid-template-columns: 16px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: color-mix(in srgb, var(--surface) 90%, white);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    transition:
        border-color 0.16s ease,
        background 0.16s ease,
        transform 0.16s ease;
}

.project-group-team-option:hover {
    border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
    background: color-mix(in srgb, var(--accent) 7%, white);
    transform: translateY(-1px);
}

.project-group-team-option input[type="checkbox"] {
    margin: 0;
}

.project-group-team-option:has(input:checked) {
    border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
    background: color-mix(in srgb, var(--accent) 11%, white);
}

.project-group-editor-actions {
    justify-content: flex-end;
    margin-top: 2px;
}

.project-group-suggestions {
    position: absolute;
    left: 10px;
    right: 10px;
    top: calc(100% - 4px);
    z-index: 12;
    display: grid;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
    max-height: 220px;
    overflow: auto;
}

.project-group-suggestion {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    background: transparent;
    text-align: left;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
}

.project-group-suggestion:hover,
.project-group-suggestion:focus-visible {
    background: var(--accent-soft);
}

.project-group-primary-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.project-group-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.16s ease,
        background 0.16s ease,
        color 0.16s ease;
}

.detail-project-tags .ticket-tag-chip:hover .project-group-chip-remove,
.detail-project-tags .ticket-tag-chip:focus-within .project-group-chip-remove,
.project-group-editor .ticket-tag-chip:hover .project-group-chip-remove,
.project-group-editor .ticket-tag-chip:focus-within .project-group-chip-remove {
    opacity: 1;
    pointer-events: auto;
}

.project-group-chip-remove:hover,
.project-group-chip-remove:focus-visible {
    background: color-mix(in srgb, var(--accent) 10%, white);
    color: var(--accent-strong);
}

.ticket-tag-chip.project-group-primary-unlocked,
.ticket-tag-chip[data-project-group-primary="1"].project-group-primary-unlocked {
    outline: 1px dashed color-mix(in srgb, var(--accent) 60%, white);
    outline-offset: 1px;
}

.detail-stream-title {
    margin: 4px 0 0;
    font-size: 1.2rem;
}

.detail-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-content-form {
    display: grid;
    gap: 10px;
}

.detail-content-view,
.detail-content-edit {
    display: grid;
    gap: 10px;
}

.detail-content-form .field {
    margin: 0;
}

.detail-description-editor {
    min-height: 96px;
}

.detail-inline-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.detail-inline-label-split {
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 10px;
    column-gap: 16px;
}

.detail-inline-label-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.detail-edit-button {
    min-width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.detail-edit-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.detail-static-value,
.detail-static-rich {
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
}

.detail-description-date {
    white-space: nowrap;
}

.detail-description-timestamps {
    display: grid;
    justify-items: end;
    gap: 2px;
    text-align: right;
}

.detail-content-actions {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
}

.detail-menu-wrap {
    position: relative;
}

.favorite-ticket-button.active {
    background: #eef5ff;
    border-color: #bfd0f4;
    color: var(--accent-strong);
}

.detail-menu-button {
    min-width: 48px;
    letter-spacing: 2px;
}

.detail-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 10;
}

.detail-menu button {
    width: 100%;
    background: transparent;
    border-radius: 0;
    padding: 10px 12px;
    text-align: left;
}

.issue-card,
.comments-shell,
.activity-panel,
.comment-editor {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    padding: 18px;
}

.activity-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    min-height: 320px;
    height: min(74vh, calc(100dvh - 180px));
    max-height: min(74vh, calc(100dvh - 180px));
    overflow: hidden;
}

.editor-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rich-toolbar {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fbff;
}

.rich-toolbar button,
.rich-toolbar select {
    padding: 8px 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
}

.rich-editor {
    min-height: 150px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: auto;
}

.markdown-editor {
    width: 100%;
    resize: vertical;
    color: var(--text);
    font: inherit;
    line-height: 1.55;
    white-space: pre-wrap;
}

.rich-editor:empty::before {
    content: attr(data-placeholder);
    color: #9aa4b2;
}

.rich-preview {
    min-height: 150px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: auto;
}

.markdown-preview {
    font-size: 0.9rem;
    line-height: 1.55;
}

.markdown-preview > :first-child {
    margin-top: 0;
}

.markdown-preview > :last-child {
    margin-bottom: 0;
}

.compact-ticket-meta {
    align-self: start;
    position: sticky;
    top: 16px;
    gap: 4px;
    max-width: var(--detail-side-width);
    width: 100%;
    justify-self: end;
    isolation: isolate;
}

@media (max-width: 1320px) {
    .ticket-detail-tabs-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .ticket-detail-tabs-spacer {
        display: none;
    }

    .compact-ticket-meta {
        justify-self: stretch;
        max-width: none;
    }

    .detail-inline-label-side {
        margin-left: 0;
        padding-left: 0;
        min-width: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .detail-description-timestamps {
        justify-items: start;
        text-align: left;
    }
}

.compact-heading {
    margin-top: 6px;
}

.compact-ticket-meta .setup-card,
.compact-ticket-meta .ticket-meta,
.compact-ticket-meta .admin-card {
    padding: 8px 10px;
    border-radius: 11px;
}

.compact-ticket-meta .field {
    gap: 2px;
}

.issue-card,
.comments-shell,
.activity-panel {
    margin-bottom: 16px;
}

/* Ticket detail-only spacing adjustments to prevent tight/overlapped stacking */
#ticketDetail .ticket-detail-tabs-grid {
    margin-bottom: 0;
    position: static;
    top: auto;
}

#ticketDetail .detail-grid {
    margin-top: 0;
}

#ticketDetail .ticket-detail-main {
    padding-top: 0;
    overflow-y: auto;
    align-content: start;
}

#ticketDetail .ticket-detail-topbar {
    position: relative;
    z-index: 30;
}

#ticketDetail .ticket-detail-breadcrumbs-inline {
    min-width: 0;
    z-index: 35;
}

#ticketDetail .ticket-path-breadcrumb {
    max-width: min(84vw, 1320px);
}

#ticketDetail .ticket-path-items {
    overflow: visible;
    text-overflow: clip;
}

#ticketDetail .ticket-path-item {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
}

#ticketDetail .project-group-project-pill {
    max-width: min(56vw, 520px);
}

#ticketDetail .detail-project-groups-edit {
    z-index: 90;
}

#ticketDetail .detail-project-groups-edit .project-group-editor {
    position: relative;
}

#ticketDetail .detail-panel-stack[data-ticket-detail-panel="description"] {
    gap: 14px;
}

#ticketDetail .detail-grid {
    align-items: stretch;
    align-content: start;
    grid-template-rows: minmax(0, 1fr);
}

#ticketDetail .detail-grid > .ticket-detail-main {
    align-self: stretch;
    min-height: 0;
}

#ticketDetail .detail-grid > .compact-ticket-meta {
    align-self: start;
}

#ticketDetail .detail-panel-stack {
    align-content: start;
}

#ticketDetail .detail-inline-label {
    margin-bottom: 10px;
}

#ticketDetail .detail-static-rich {
    margin-top: 2px;
}

#ticketDetail .issue-attachments {
    margin-top: 18px;
    padding-top: 6px;
}

#ticketDetail .detail-panel-stack > .comments-shell {
    margin-top: 8px;
}

.issue-card-body,
.comment-thread,
.activity-timeline {
    display: grid;
    gap: 14px;
}

.activity-panel-head {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-bottom: 4px;
    background: inherit;
}

.activity-timeline {
    min-height: 0;
    height: 100%;
    max-height: none;
    overflow-y: auto !important;
    overflow-x: hidden;
    align-content: start;
    padding-right: 8px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 108, 122, 0.72) rgba(214, 222, 234, 0.42);
}

.activity-timeline::-webkit-scrollbar {
    width: 10px;
}

.activity-timeline::-webkit-scrollbar-track {
    background: rgba(214, 222, 234, 0.42);
    border-radius: 999px;
}

.activity-timeline::-webkit-scrollbar-thumb {
    background: rgba(96, 108, 122, 0.72);
    border-radius: 999px;
}

.issue-card-head strong,
.comments-shell-head strong,
.compact-ticket-meta h3 {
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.comments-shell-title {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.comments-shell-count {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
}

.comments-shell-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.comments-shell-subhead {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin: -6px 0 4px;
}

.comment-order-select {
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.8rem;
}

.comment-scope-select {
    min-width: 138px;
    max-width: 154px;
}

.comment-order-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.comment-order-arrow {
    font-size: 0.82rem;
    line-height: 1;
}

.comment-action-wrap {
    position: relative;
}

.comment-action-toggle {
    min-width: auto;
    padding: 1px 6px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
    letter-spacing: 0;
    box-shadow: none;
}

.comment-action-toggle:hover,
.comment-action-toggle[aria-expanded="true"] {
    background: color-mix(in srgb, var(--accent-soft) 70%, white);
    color: var(--accent-strong);
}

.comment-action-menu {
    min-width: 116px;
}

.comment-action-menu button {
    border: 0;
    font-size: 0.78rem;
    font-weight: 600;
}

.comment-action-menu button:disabled,
.comment-action-menu button[aria-disabled="true"] {
    background: rgba(32, 48, 73, 0.03);
    color: var(--muted);
}

.comment-edit-shell {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.comment-edit-editor {
    min-height: 120px;
}

.comment-edit-attachments {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 97%, transparent);
}

.comment-edit-attachments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comment-edit-existing-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-edit-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    font-size: 0.78rem;
}

.comment-edit-file-chip small {
    color: #b42318;
    font-weight: 700;
}

.comment-edit-upload-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.issue-card p,
.comment-card p,
.activity-item p,
.compact-ticket-meta p,
.compact-ticket-meta label,
.compact-ticket-meta small,
.compact-ticket-meta .meta-label,
.compact-ticket-meta .meta-row {
    font-size: 0.78rem;
}

.issue-number {
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
    flex: 0 0 auto;
}

.issue-attachments {
    margin-top: 16px;
    padding: 0;
    border: 0;
    background: transparent;
}

.comment-thread {
    gap: 0;
}

.comment-thread .comment-card {
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
    border-radius: 0;
    background: transparent;
}

.comment-thread .comment-card:last-child {
    border-bottom: 0;
}

.comment-card-shell {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 2px;
}

.comment-card-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--accent-soft) 78%, white);
    color: var(--accent-strong);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.comment-card-avatar-history {
    background: color-mix(in srgb, var(--card) 88%, #eef4ff);
    color: var(--muted);
    font-size: 0.58rem;
}

.comment-card-main {
    min-width: 0;
}

.comment-card-head {
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.comment-card-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.comment-card-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
    white-space: nowrap;
}

.comment-card-author {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
    flex: 0 1 auto;
}

.comment-card-email {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.25;
    min-width: 0;
    white-space: nowrap;
    flex: 0 1 auto;
}

.comment-card-email .issue-number {
    display: inline-block;
    margin-left: 6px;
}

.comment-card-side {
    display: grid;
    justify-items: end;
    align-content: start;
    gap: 2px;
    flex: 0 0 auto;
}

.comment-card-date {
    white-space: nowrap;
    margin-top: 1px;
    font-size: 0.76rem;
}

.comment-editor {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.comment-composer {
    display: block;
}

.comment-composer-main {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--card) 99%, transparent);
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(31, 45, 71, 0.05);
}

.ticket-grid-shell {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 28px rgba(31, 45, 71, 0.08);
}

.ticket-grid-actions {
    padding: 14px 16px 0;
}

.ticket-grid-scroll {
    padding: 0 12px;
}

.ticket-grid th {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ticket-grid td {
    padding-top: 12px;
    padding-bottom: 12px;
}

.ticket-grid-footer {
    padding: 0 16px 14px;
}

.dashboard-menu-wrap .account-menu {
    min-width: 190px;
    right: 0;
    top: calc(100% + 10px);
}

.comment-composer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 251, 255, 0.82));
}

.comment-composer-title {
    display: grid;
    gap: 2px;
}

.comment-edit-notice {
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 700;
}

.comment-rich-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 10px 10px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: linear-gradient(180deg, rgba(246, 249, 254, 0.98), rgba(241, 246, 252, 0.98));
    box-sizing: border-box;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.comment-toolbar-group {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    padding-right: 10px;
    margin-right: 2px;
    white-space: nowrap;
    border-right: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
}

[data-editor-preview] {
    display: none !important;
}

.comment-toolbar-group:last-child {
    padding-right: 0;
    margin-right: 0;
    border-right: 0;
}

.comment-toolbar-group-selects {
    flex: 0 0 auto;
}

.comment-toolbar-group-mode {
    gap: 8px;
    padding-right: 14px;
}

.comment-toolbar-group-zoom {
    flex: 0 0 auto;
}

.docs-toolbar-button,
.docs-toolbar-select {
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: color-mix(in srgb, var(--text) 92%, white);
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

.docs-toolbar-button {
    position: relative;
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    cursor: pointer;
}

.docs-toolbar-button:hover,
.docs-toolbar-select:hover {
    background: rgba(255, 255, 255, 0.82);
    border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}

.docs-toolbar-button-mode.is-active {
    background: color-mix(in srgb, var(--accent-soft) 72%, white);
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    color: var(--accent-strong);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
}

.docs-toolbar-button-mode {
    width: auto;
    min-width: 78px;
    flex: 0 0 auto;
    padding: 0 14px;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.docs-toolbar-select-font {
    min-width: 112px;
    max-width: 150px;
}

.docs-toolbar-select-style {
    min-width: 132px;
}

.docs-toolbar-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
}

.docs-toolbar-button svg,
.docs-toolbar-button svg * {
    pointer-events: none;
}

.docs-toolbar-button-icon {
    opacity: 0.82;
}

.docs-toolbar-button-step,
.docs-toolbar-button-text {
    font-size: 1.05rem;
    font-weight: 700;
}

.docs-toolbar-button-color,
.docs-toolbar-button-highlight {
    position: relative;
}

.docs-toolbar-button-color::after,
.docs-toolbar-button-highlight::after {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 6px;
    height: 3px;
    border-radius: 999px;
    background: var(--editor-toolbar-color-indicator, #111827);
}

.docs-toolbar-button-color::after {
    background: var(--editor-toolbar-color-indicator, #111827);
}

.docs-toolbar-button-highlight::after {
    background: var(--editor-toolbar-color-indicator, #facc15);
}

.docs-toolbar-select {
    padding: 0 32px 0 12px;
    font-size: 0.82rem;
    font-weight: 600;
    appearance: none;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 15px) 14px,
        calc(100% - 10px) 14px;
    background-size:
        5px 5px,
        5px 5px;
    background-repeat: no-repeat;
}

.docs-toolbar-select-zoom {
    min-width: 84px;
}

.docs-toolbar-select-style {
    min-width: 148px;
}

.docs-toolbar-select-font {
    min-width: 128px;
    max-width: 168px;
}

.docs-toolbar-select-size {
    min-width: 66px;
}

.docs-toolbar-select-line {
    min-width: 74px;
}

.rich-editor-shell {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.rich-editor-shell .rich-editor {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 220px;
}

.rich-editor-shell.is-advanced .rich-editor {
    display: none;
}

.rich-editor-shell.is-simple .rich-editor-surface {
    display: none;
}

.rich-editor-shell.is-advanced .rich-editor-surface {
    display: block;
}

.rich-editor-surface {
    min-height: 220px;
    padding: 16px 18px;
    outline: none;
    overflow: auto;
    line-height: 1.6;
    color: var(--text);
    background: rgba(255, 255, 255, 0.98);
}

.rich-editor-surface:empty::before,
.rich-editor-surface[data-placeholder]:not(:focus):has(> p:only-child > br:only-child)::before {
    content: attr(data-placeholder);
    color: color-mix(in srgb, var(--text-muted) 88%, white);
}

.rich-editor-surface p,
.rich-editor-surface div,
.rich-editor-surface blockquote,
.rich-editor-surface pre,
.rich-editor-surface table,
.rich-editor-surface ul,
.rich-editor-surface ol,
.rich-editor-surface h1,
.rich-editor-surface h2,
.rich-editor-surface h3,
.rich-editor-surface h4 {
    margin: 0 0 0.8rem;
}

.rich-editor-surface table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
}

.rich-editor-surface td,
.rich-editor-surface th {
    border: 1px solid color-mix(in srgb, var(--border) 80%, white);
    padding: 8px 10px;
    vertical-align: top;
}

.rich-editor-surface img {
    max-width: 100%;
    height: auto;
}

.comment-editor-field {
    margin: 0;
}

.comment-existing-attachments {
    display: grid;
    gap: 6px;
    padding: 8px 14px 0;
}

.comment-existing-attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.comment-existing-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid color-mix(in srgb, var(--border) 85%, white);
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-soft) 68%, white);
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 600;
}

.comment-existing-attachment-chip-removed {
    opacity: 0.65;
    text-decoration: line-through;
}

.comment-existing-attachment-remove {
    font-size: 0.84rem;
    line-height: 1;
}

.comment-body-editor {
    min-height: 230px;
    border: 0;
    border-radius: 0;
    padding: 14px 16px;
    background: #fff;
}

.comment-body {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.comment-body > :not(pre) {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.comment-body [data-checklist-item="true"],
.rich-editor [data-checklist-item="true"] {
    list-style: square;
}

.detail-static-rich img,
.comment-body img,
.knowledge-article-body img,
.knowledge-comment-body img,
.rich-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.detail-static-rich blockquote,
.comment-body blockquote,
.knowledge-article-body blockquote,
.knowledge-comment-body blockquote {
    margin: 12px 0;
    padding-left: 12px;
    border-left: 3px solid color-mix(in srgb, var(--accent) 40%, var(--border));
    color: var(--muted);
}

.detail-static-rich pre,
.comment-body pre,
.knowledge-article-body pre,
.knowledge-comment-body pre {
    padding: 10px 12px;
    border-radius: 10px;
    overflow-x: auto;
    background: color-mix(in srgb, var(--card) 96%, #eef4ff);
}

.detail-static-rich table,
.comment-body table,
.knowledge-article-body table,
.knowledge-comment-body table {
    width: 100%;
    max-width: 100%;
    margin: 14px 0;
    border-collapse: collapse;
    table-layout: auto;
    background: color-mix(in srgb, var(--card) 97%, white);
}

.detail-static-rich th,
.detail-static-rich td,
.comment-body th,
.comment-body td,
.knowledge-article-body th,
.knowledge-article-body td,
.knowledge-comment-body th,
.knowledge-comment-body td {
    padding: 8px 10px;
    border: 1px solid color-mix(in srgb, var(--border) 88%, white);
    vertical-align: top;
    text-align: left;
}

.detail-static-rich th,
.comment-body th,
.knowledge-article-body th,
.knowledge-comment-body th {
    font-weight: 700;
    background: color-mix(in srgb, var(--card) 92%, #eef4ff);
}

.comment-editor-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 14px 14px;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.88), rgba(255, 255, 255, 0.96));
}

.comment-attachment-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.markdown-toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.markdown-toggle-row-inline {
    margin: 8px 14px 0;
}

.comment-markdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.comment-markdown-toggle input {
    appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 2px solid color-mix(in srgb, var(--muted) 48%, white);
    border-radius: 50%;
    background: #fff;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.comment-markdown-toggle input::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: transparent;
}

.comment-markdown-toggle input:checked {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, white);
}

.comment-markdown-toggle input:checked::after {
    background: var(--accent);
}

.comment-markdown-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.comment-markdown-help:hover {
    color: var(--accent-strong);
}

.comment-markdown-help-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, currentColor 65%, white);
    border-radius: 50%;
    background: color-mix(in srgb, var(--card) 88%, #eef4ff);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.comment-attachment-row input[type="file"] {
    display: none;
}

.attachment-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 96%, transparent);
    cursor: pointer;
}

.comment-attachment-trigger {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 600;
}

.comment-attachment-trigger:hover {
    color: var(--accent-strong);
}

.comment-attachment-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.comment-attachment-icon {
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--border) 85%, white);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.comment-attachment-image {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.comment-attachment-summary {
    font-size: 0.82rem;
}

.comment-resource-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.comment-selected-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.comment-selected-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--border) 82%, white);
    border-radius: 999px;
    background: color-mix(in srgb, var(--card) 94%, var(--accent-soft));
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1.2;
    cursor: pointer;
}

.comment-selected-file-chip:hover {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
    color: var(--accent-strong);
}

.comment-selected-file-name {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.comment-selected-file-size {
    color: var(--muted);
    font-size: 0.72rem;
}

.comment-selected-file-remove {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
}

.comment-resource-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-soft) 72%, white);
    color: var(--accent-strong);
    font-size: 0.78rem;
}

.comment-resource-chip-icon {
    font-size: 0.8rem;
}

.comment-resource-chip button {
    min-width: 14px;
    padding: 0;
    background: transparent;
    color: inherit;
}

.comment-public-warning {
    margin-top: 8px;
    padding: 9px 11px;
    border: 1px solid color-mix(in srgb, #d97706 30%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, #fff7e6 88%, var(--card));
    color: #9a3412;
    font-size: 0.79rem;
    font-weight: 700;
    line-height: 1.45;
    max-width: 340px;
}

.comment-import-datetime-field {
    min-width: min(100%, 270px);
}

.comment-import-datetime-field input[type="datetime-local"] {
    min-height: 38px;
    padding: 7px 10px;
}

.comment-import-datetime-help {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.comment-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
    align-self: flex-end;
}

.attachment-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.attachment-card {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f9fbff;
}

.attachment-actions {
    display: flex;
    gap: 12px;
}

.attachment-actions a {
    color: var(--accent);
    text-decoration: none;
}

.writing-assistant {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 14px;
    border: 1px solid color-mix(in srgb, var(--border) 80%, white);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 98%, transparent);
}

.writing-assistant-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.writing-assistant-actions .secondary {
    padding: 7px 11px;
    font-size: 0.84rem;
    border-radius: 999px;
}

.writing-assistant-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.editor-action-overlay {
    z-index: 70;
    background: rgba(9, 17, 28, 0.4);
    backdrop-filter: blur(4px);
}

.editor-action-modal {
    width: min(560px, calc(100vw - 32px));
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 28px 50px rgba(8, 17, 30, 0.24);
}

.editor-action-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.editor-action-modal-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.editor-action-close {
    min-width: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 999px;
    background: rgba(59, 45, 34, 0.08);
}

.editor-action-help {
    margin: -4px 0 0;
}

.editor-action-field {
    display: grid;
    gap: 10px;
}

.editor-action-field input,
.editor-action-field textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.editor-action-field textarea {
    min-height: 140px;
    resize: vertical;
}

.editor-action-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.editor-color-popover {
    position: fixed;
    z-index: 95;
    width: min(316px, calc(100vw - 24px));
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 44px rgba(16, 24, 40, 0.22);
}

.editor-color-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.editor-color-popover-head h3 {
    margin: 0;
    font-size: 0.98rem;
}

.editor-color-popover-close {
    min-width: 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 999px;
    background: rgba(59, 45, 34, 0.08);
}

.editor-color-popover-help {
    margin: -2px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.editor-color-swatch-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 8px;
}

.editor-color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
    background: var(--editor-swatch-color, #2563eb);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.editor-color-swatch:hover {
    transform: translateY(-1px);
    box-shadow:
        0 8px 18px rgba(37, 99, 235, 0.16),
        inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.editor-color-popover-custom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.editor-color-popover-custom input[type="text"] {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.editor-color-popover-custom input[type="color"] {
    width: 44px;
    height: 42px;
    padding: 2px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.editor-color-popover-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.activity-item {
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 14px;
}

.activity-item p {
    margin: 8px 0 0;
}

body.theme-dark,
body.theme-dark .sidebar,
body.theme-dark .main,
body.theme-dark .shell {
    background:
        radial-gradient(circle at top left, rgba(255, 215, 127, 0.08), transparent 24%),
        linear-gradient(180deg, #13100d 0%, var(--bg) 38%, #191613 100%);
}

body.theme-dark .comment-composer-avatar,
body.theme-dark .comment-composer-main,
body.theme-dark .comment-editor-footer {
    background: color-mix(in srgb, var(--card) 98%, transparent);
}

body.theme-dark .comment-public-warning {
    border-color: color-mix(in srgb, #f59e0b 36%, var(--border));
    background: color-mix(in srgb, #3a2a05 78%, var(--card));
    color: #fcd34d;
}

body.theme-dark .topbar,
body.theme-dark .panel,
body.theme-dark .login-card,
body.theme-dark .drawer-panel,
body.theme-dark .summary-list,
body.theme-dark .permission-matrix,
body.theme-dark .table-list,
body.theme-dark .lookup-lists > div,
body.theme-dark .lookup-group-card,
body.theme-dark .workflow-map-card,
body.theme-dark .setup-card,
body.theme-dark .admin-card,
body.theme-dark .ticket-meta,
body.theme-dark .ticket-grid-shell,
body.theme-dark .knowledge-article-card,
body.theme-dark .knowledge-comment-card,
body.theme-dark .comment-card,
body.theme-dark .issue-card,
body.theme-dark .comments-shell,
body.theme-dark .activity-panel {
    background: color-mix(in srgb, var(--card) 97%, #000 3%);
}

body.theme-dark .main {
    scrollbar-color: rgba(128, 177, 255, 0.5) rgba(255, 255, 255, 0.08);
}

body.theme-dark .main::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .main::-webkit-scrollbar-thumb {
    background: rgba(128, 177, 255, 0.5);
}

body.theme-dark .kba-hero {
    background:
        radial-gradient(circle at 12% 18%, rgba(74, 150, 255, 0.24), transparent 28%),
        radial-gradient(circle at 88% 16%, rgba(70, 203, 173, 0.18), transparent 28%),
        linear-gradient(135deg, rgba(30, 40, 55, 0.96), rgba(23, 31, 43, 0.92));
}

body.theme-dark .kba-summary-card,
body.theme-dark .kba-write-hint {
    border-color: rgba(95, 121, 160, 0.32);
    background: rgba(27, 36, 49, 0.82);
}

body.theme-dark .kba-keyword-chip {
    background: rgba(61, 137, 228, 0.18);
    color: #9bcbff;
}

body.theme-dark .project-module-card {
    border-color: rgba(135, 156, 187, 0.3);
    background:
        radial-gradient(
            circle at 94% 8%,
            color-mix(in srgb, var(--project-card-accent) 12%, transparent),
            transparent 36%
        ),
        linear-gradient(180deg, rgba(38, 46, 60, 0.94), rgba(28, 35, 46, 0.96));
    box-shadow:
        0 18px 36px rgba(0, 0, 0, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-dark .login-shell .login-card {
    background: var(--login-card-bg);
    border-color: var(--login-card-border);
    color: var(--login-card-text);
}

body.theme-dark .login-shell .login-card::before {
    background: var(--login-card-surface);
}

body.theme-dark .project-module-card .card-heading {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--project-card-accent) 18%, rgba(54, 64, 80, 0.92)),
        rgba(35, 43, 56, 0.94)
    );
    border-bottom-color: rgba(135, 156, 187, 0.28);
}

body.theme-dark .project-module-card:hover {
    border-color: rgba(132, 178, 241, 0.45);
    box-shadow:
        0 24px 44px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.theme-dark .project-settings-flow-chip {
    border-color: rgba(112, 146, 186, 0.38);
    background: rgba(52, 71, 94, 0.62);
    color: #d9e8ff;
}

body.theme-dark .project-module-card .field {
    border-color: rgba(126, 149, 178, 0.3);
    background: rgba(32, 41, 54, 0.62);
}

body.theme-dark .project-module-row-grid {
    border-color: rgba(126, 149, 178, 0.32);
    background: linear-gradient(180deg, rgba(41, 50, 64, 0.84), rgba(30, 38, 50, 0.9));
}

body.theme-dark .project-module-row-grid .field {
    border-right-color: rgba(126, 149, 178, 0.28);
}

body.theme-dark .project-module-actions {
    border-color: rgba(126, 149, 178, 0.32);
    background: linear-gradient(180deg, rgba(36, 45, 59, 0.94), rgba(30, 38, 50, 0.96));
}

body.theme-dark .project-module-heading-actions .secondary,
body.theme-dark .project-module-actions .secondary {
    border-color: rgba(126, 149, 178, 0.4);
    background: rgba(59, 72, 92, 0.5);
    color: #e4edf9;
}

body.theme-dark .project-module-heading-actions .secondary:hover,
body.theme-dark .project-module-actions .secondary:hover {
    background: rgba(71, 88, 112, 0.62);
}

body.theme-dark .project-module-card-popup {
    box-shadow: 0 34px 66px rgba(0, 0, 0, 0.52);
}

body.theme-dark .project-module-card-popup .project-module-actions {
    background: linear-gradient(180deg, rgba(29, 37, 50, 0.7), rgba(26, 33, 45, 0.98));
    border-top-color: rgba(126, 149, 178, 0.3);
}

body.theme-dark .customer-portal-settings-card-popup {
    box-shadow: 0 34px 74px rgba(0, 0, 0, 0.56);
}

body.theme-dark .customer-portal-banner-row {
    border-color: rgba(126, 149, 178, 0.3);
    background: linear-gradient(135deg, rgba(44, 55, 72, 0.96), rgba(30, 38, 51, 0.98));
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-dark .customer-portal-banner-pill {
    border-color: rgba(126, 149, 178, 0.34);
    background: rgba(46, 58, 76, 0.62);
}

body.theme-dark .customer-portal-banner-pill span {
    color: #9db2d0;
}

body.theme-dark .customer-portal-banner-pill strong {
    color: #eef4ff;
}

body.theme-dark .customer-portal-settings-card-popup .setup-actions {
    background: linear-gradient(180deg, rgba(29, 37, 50, 0.68), rgba(26, 33, 45, 0.98));
    border-top-color: rgba(126, 149, 178, 0.28);
}

body.theme-dark .project-config-card-popup .project-form-footer,
body.theme-dark .portal-user-form-card .setup-actions {
    background: linear-gradient(180deg, rgba(29, 37, 50, 0.7), rgba(26, 33, 45, 0.98));
    border-top-color: rgba(126, 149, 178, 0.28);
}

body.theme-dark .sidebar {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 24%),
        linear-gradient(180deg, rgba(25, 21, 18, 0.96) 0%, rgba(22, 18, 15, 0.98) 100%);
    border-right-color: rgba(95, 81, 68, 0.65);
}

body.theme-dark .menu-item {
    background: rgba(255, 255, 255, 0.02);
}

body.theme-dark .lookup-compact-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .lookup-compact-item.drag-over,
body.theme-dark .workflow-map-chip.is-selected {
    background: rgba(56, 189, 149, 0.14);
}

body.theme-dark .menu-item.active,
body.theme-dark .menu-item:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(79, 123, 183, 0.08));
}

body.theme-dark .create-ticket-wrap,
body.theme-dark .create-ticket-menu {
    background: color-mix(in srgb, var(--card) 96%, #000 4%);
    border-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .create-ticket-menu-button {
    border-left-color: rgba(255, 255, 255, 0.1);
    color: #d7e2f1;
}

body.theme-dark .create-ticket-menu-item:hover {
    background: rgba(116, 170, 246, 0.12);
    border-color: rgba(116, 170, 246, 0.16);
}

body.theme-dark .comment-markdown-toggle input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: none;
}

body.theme-dark .ticket-detail-topbar,
body.theme-dark .ticket-detail-heading-box,
body.theme-dark .ticket-detail-tabs-grid {
    border-color: rgba(128, 151, 184, 0.24);
    background: linear-gradient(180deg, rgba(35, 30, 26, 0.96), rgba(28, 24, 21, 0.98));
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.theme-dark .ticket-detail-heading-box {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        inset 0 0 0 1px rgba(128, 151, 184, 0.08);
}

body.theme-dark .ticket-toolbar-button,
body.theme-dark .ticket-detail-tab {
    color: #e9f1ff;
}

body.theme-dark .ticket-toolbar-button {
    border-color: rgba(128, 151, 184, 0.28);
    background: rgba(255, 255, 255, 0.05);
}

body.theme-dark .ticket-toolbar-button:hover,
body.theme-dark .ticket-toolbar-button:focus-visible,
body.theme-dark .ticket-detail-tab.active,
body.theme-dark .ticket-detail-tab:hover {
    background: rgba(116, 170, 246, 0.16);
    border-color: rgba(116, 170, 246, 0.34);
    color: #ffffff;
}

body.theme-dark .ticket-breadcrumb-chip,
body.theme-dark .ticket-header-meta-chip {
    background: rgba(55, 72, 95, 0.72);
    color: #dfeaff;
}

body.theme-dark .ticket-breadcrumb-separator,
body.theme-dark .ticket-detail-navmeta,
body.theme-dark .ticket-number,
body.theme-dark .ticket-detail-heading-label,
body.theme-dark .ticket-detail-heading-divider,
body.theme-dark .ticket-detail-heading-box-empty {
    color: #c9d6ea;
}

body.theme-dark .ticket-detail-heading-display h2,
body.theme-dark .ticket-detail-heading-edit input,
body.theme-dark .ticket-info-heading h3,
body.theme-dark .ticket-info-form .meta-label,
body.theme-dark .ticket-info-static,
body.theme-dark .ticket-info-inline-person,
body.theme-dark .ticket-info-editable input,
body.theme-dark .ticket-info-editable select,
body.theme-dark .ticket-info-editable .assignee-search-input,
body.theme-dark .ticket-info-edit-mark {
    color: #f4f8ff;
}

body.theme-dark .ticket-info-editable input,
body.theme-dark .ticket-info-editable select,
body.theme-dark .ticket-info-editable .assignee-search-input {
    border-color: rgba(128, 151, 184, 0.26);
    background: rgba(255, 255, 255, 0.05);
}

body.theme-dark .comment-rich-toolbar {
    border-bottom-color: rgba(128, 151, 184, 0.22);
    background: linear-gradient(180deg, rgba(45, 39, 33, 0.98), rgba(35, 30, 25, 0.98));
    scrollbar-color: rgba(128, 177, 255, 0.42) rgba(255, 255, 255, 0.05);
}

body.theme-dark .comment-toolbar-group {
    border-right-color: rgba(128, 151, 184, 0.2);
}

body.theme-dark .docs-toolbar-button,
body.theme-dark .docs-toolbar-select {
    border-color: rgba(128, 151, 184, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: #edf4ff;
}

body.theme-dark .docs-toolbar-button:hover,
body.theme-dark .docs-toolbar-button:focus-visible,
body.theme-dark .docs-toolbar-select:hover,
body.theme-dark .docs-toolbar-select:focus-visible {
    background: rgba(116, 170, 246, 0.14);
    border-color: rgba(116, 170, 246, 0.3);
    color: #ffffff;
}

body.theme-dark .docs-toolbar-button-mode.is-active {
    background: rgba(116, 170, 246, 0.22);
    border-color: rgba(116, 170, 246, 0.38);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

body.theme-dark .rich-editor-shell {
    border-color: rgba(128, 151, 184, 0.22);
    background: rgba(24, 20, 17, 0.98);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 18px 32px rgba(0, 0, 0, 0.22);
}

body.theme-dark .rich-editor-surface,
body.theme-dark .comment-body-editor {
    background: rgba(19, 23, 31, 0.98);
    color: #f4f8ff;
    caret-color: #9eccff;
}

body.theme-dark .rich-editor-surface:empty::before,
body.theme-dark .rich-editor-surface[data-placeholder]:not(:focus):has(> p:only-child > br:only-child)::before {
    color: #9eadc5;
}

body.theme-dark .comment-markdown-toggle,
body.theme-dark .comment-markdown-help,
body.theme-dark .comment-import-datetime-help,
body.theme-dark .comment-selected-file-size {
    color: #c6d2e6;
}

body.theme-dark .comment-markdown-help-icon {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(128, 151, 184, 0.26);
}

body.theme-dark .comment-attachment-icon,
body.theme-dark .comment-selected-file-chip,
body.theme-dark .comment-resource-chip,
body.theme-dark .attachment-trigger {
    border-color: rgba(128, 151, 184, 0.24);
    background: rgba(255, 255, 255, 0.05);
    color: #eef4ff;
}

body.theme-dark .detail-static-rich,
body.theme-dark .comment-body,
body.theme-dark .knowledge-article-body,
body.theme-dark .knowledge-comment-body {
    color: #f4f8ff;
}

body.theme-dark .detail-static-rich blockquote,
body.theme-dark .comment-body blockquote,
body.theme-dark .knowledge-article-body blockquote,
body.theme-dark .knowledge-comment-body blockquote {
    border-left-color: rgba(116, 170, 246, 0.42);
    color: #d6e1f1;
    background: rgba(255, 255, 255, 0.03);
}

body.theme-dark .detail-static-rich pre,
body.theme-dark .comment-body pre,
body.theme-dark .knowledge-article-body pre,
body.theme-dark .knowledge-comment-body pre {
    border: 1px solid rgba(128, 151, 184, 0.18);
    background: rgba(12, 16, 24, 0.96);
    color: #f4f8ff;
}

body.theme-dark .detail-static-rich table,
body.theme-dark .comment-body table,
body.theme-dark .knowledge-article-body table,
body.theme-dark .knowledge-comment-body table {
    background: rgba(255, 255, 255, 0.03);
}

body.theme-dark .detail-static-rich th,
body.theme-dark .detail-static-rich td,
body.theme-dark .comment-body th,
body.theme-dark .comment-body td,
body.theme-dark .knowledge-article-body th,
body.theme-dark .knowledge-article-body td,
body.theme-dark .knowledge-comment-body th,
body.theme-dark .knowledge-comment-body td {
    border-color: rgba(128, 151, 184, 0.2);
    color: #eef4ff;
}

body.theme-dark .detail-static-rich th,
body.theme-dark .comment-body th,
body.theme-dark .knowledge-article-body th,
body.theme-dark .knowledge-comment-body th {
    background: rgba(255, 255, 255, 0.06);
}

body.theme-dark .activity-stream-date-pill,
body.theme-dark .activity-stream-time-pill {
    border-color: rgba(128, 151, 184, 0.24);
    background: rgba(35, 30, 25, 0.96);
    color: #eef4ff;
}

body.theme-dark .activity-stream-item::before {
    background: linear-gradient(180deg, rgba(128, 151, 184, 0.12), rgba(128, 151, 184, 0.36));
}

body.theme-dark .activity-stream-entry {
    border-bottom-color: rgba(128, 151, 184, 0.16);
}

body.theme-dark .activity-stream-avatar {
    background: linear-gradient(180deg, #74d4d1, #56b1ca);
    color: #102233;
}

body.theme-dark .activity-stream-title,
body.theme-dark .activity-stream-change strong,
body.theme-dark .activity-stream-summary p {
    color: #f4f8ff;
}

body.theme-dark .activity-stream-change {
    color: #cfd9ea;
}

body.theme-dark .activity-stream-empty {
    color: #c6d2e6;
}

body.theme-dark .editor-action-modal,
body.theme-dark .editor-color-popover {
    border-color: rgba(128, 151, 184, 0.24);
    background: rgba(34, 29, 25, 0.98);
    color: #f4f8ff;
}

body.theme-dark .editor-action-close,
body.theme-dark .editor-color-popover-close {
    background: rgba(255, 255, 255, 0.08);
    color: #eef4ff;
}

body.theme-dark .editor-action-field input,
body.theme-dark .editor-action-field textarea,
body.theme-dark .editor-color-popover-custom input[type="text"],
body.theme-dark .editor-color-popover-custom input[type="color"] {
    border-color: rgba(128, 151, 184, 0.24);
    background: rgba(255, 255, 255, 0.05);
    color: #f4f8ff;
}

body.theme-dark .account-avatar-preview-shell,
body.theme-dark .avatar-cropper-drawer.drawer {
    background: color-mix(in srgb, var(--card) 96%, #000 4%);
    border-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .avatar-cropper-stage {
    border-color: rgba(255, 255, 255, 0.12);
}

body.theme-dark .setup-card,
body.theme-dark .summary-list {
    background: color-mix(in srgb, var(--card) 95%, #000 5%);
}

body.theme-dark .permissions-section {
    background: color-mix(in srgb, var(--card) 97%, #000 3%);
}

body.theme-dark .admin-card-dimmed {
    opacity: 0.48;
}

body.theme-dark .setup-helper-note {
    background: color-mix(in srgb, var(--card) 96%, #1d4f91 4%);
}

body.theme-dark .permissions-section-title {
    background: color-mix(in srgb, var(--card) 96%, #fff 4%);
}

body.theme-dark .permission-checkmark {
    background: color-mix(in srgb, var(--card) 94%, #000 6%);
    border-color: #536079;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .detail-static-value,
body.theme-dark .detail-static-rich,
body.theme-dark .rich-editor,
body.theme-dark .account-summary-list div {
    background: color-mix(in srgb, var(--card) 94%, #000 6%);
    color: var(--text);
}

body.theme-dark .topbar-search {
    background: var(--topbar-search-bg);
    border-color: var(--topbar-search-border);
}

body.theme-dark .dashboard-widget-card,
body.theme-dark .widget-gallery.drawer,
body.theme-dark .widget-config-drawer.drawer {
    background: #241f1a;
    border-color: rgba(122, 95, 69, 0.34);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.32);
}

body.theme-dark .account-panel-hero {
    background: color-mix(in srgb, var(--card) 94%, #000 6%);
    border-color: rgba(122, 95, 69, 0.34);
}

body.theme-dark .dashboard-widget-actions .icon-button,
body.theme-dark .widget-gallery-header .icon-button,
body.theme-dark .widget-config-drawer .icon-button {
    background: rgba(255, 255, 255, 0.08);
    color: #f2f0ea;
    border-color: rgba(255, 255, 255, 0.12);
}

body.theme-dark #dashboardMenuButton {
    background: rgba(255, 255, 255, 0.12);
    color: #f5f8ff;
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

body.theme-dark #dashboardMenuButton:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.26);
}

body.theme-dark .dashboard-chart-bar {
    background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .dashboard-donut-chart::after {
    background: #1c1a18;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body.theme-dark .report-summary-card,
body.theme-dark .report-legend-card {
    background: color-mix(in srgb, var(--card) 97%, #000 3%);
}

body.theme-dark .knowledge-comment-actions .secondary.danger {
    color: #ff8d8d;
}

body.theme-dark .overlay {
    background: rgba(0, 0, 0, 0.48);
}

body.theme-dark .widget-gallery-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .widget-gallery-overlay {
    background: rgba(0, 0, 0, 0.22);
}

body.theme-dark .topbar-search input,
body.theme-dark .topbar-search-scope-native {
    background: transparent;
    box-shadow: none;
    color: var(--topbar-search-text);
}

body.theme-dark .topbar-search-icon {
    color: var(--topbar-search-text);
}

body.theme-dark .topbar-search-filter {
    color: var(--topbar-search-text);
}

body.theme-dark .topbar-search-filter:hover {
    background: rgba(47, 109, 246, 0.08);
    color: var(--accent-strong);
}

body.theme-dark .customer-portal-settings-card-popup .card-heading {
    background: linear-gradient(180deg, rgba(39, 34, 28, 0.98), rgba(39, 34, 28, 0.92));
}

body.theme-dark #columnManager .drawer-header {
    background: linear-gradient(180deg, rgba(39, 34, 28, 0.98), rgba(39, 34, 28, 0.92));
}

body.theme-dark .about-learning-card a {
    background: rgba(116, 170, 246, 0.14);
    color: #d8e9ff;
}

body.theme-dark .markdown-help-intro,
body.theme-dark .markdown-help-header {
    background: rgba(116, 170, 246, 0.1);
}

body.theme-dark .markdown-help-table {
    background: color-mix(in srgb, var(--card) 95%, #000 5%);
}

body.theme-dark .markdown-preview-code {
    background: rgba(255, 255, 255, 0.06);
}

body.theme-dark .footer-link:hover,
body.theme-dark .footer-link:focus-visible {
    color: #f7efe8;
}

body.theme-dark .app-footer {
    background: color-mix(in srgb, var(--bg) 92%, #000 8%);
}

body.theme-dark .topbar::after,
body.theme-dark .app-footer::before {
    border-color: rgba(67, 56, 49, 0.9);
}

body.theme-dark .empty-state-card,
body.theme-dark .empty-state-card p,
body.theme-dark .empty-state-card h3 {
    color: var(--text);
}

body.theme-dark .portal-users-card .table-list {
    background: color-mix(in srgb, var(--card) 97%, #000 3%);
}

body.theme-dark .portal-user-toolbar {
    background: linear-gradient(180deg, rgba(39, 54, 78, 0.58), rgba(23, 28, 41, 0.32));
}

body.theme-dark .portal-user-head {
    background: rgba(255, 255, 255, 0.06);
}

body.theme-dark .portal-user-stat,
body.theme-dark .portal-user-project-tag {
    background: rgba(255, 255, 255, 0.05);
}

body.theme-dark .portal-user-scroll {
    scrollbar-color: rgba(128, 177, 255, 0.5) rgba(255, 255, 255, 0.08);
}

body.theme-dark .portal-user-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .portal-user-scroll::-webkit-scrollbar-thumb {
    background: rgba(128, 177, 255, 0.5);
}

body.theme-dark .portal-user-modal {
    background: rgba(28, 35, 49, 0.9);
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .portal-user-row {
    background: rgba(255, 255, 255, 0.01);
}

body.theme-dark .portal-user-avatar .account-avatar,
body.theme-dark .portal-user-avatar .avatar-fallback,
body.theme-dark .portal-user-avatar .avatar-image {
    border-color: rgba(255, 255, 255, 0.12);
}

body.theme-dark .portal-user-switch {
    background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .portal-user-switch:hover {
    background: rgba(128, 177, 255, 0.14);
}

body.theme-dark .portal-user-switch-track {
    background: rgba(255, 255, 255, 0.2);
}

body.theme-dark .portal-user-form-section {
    background: linear-gradient(180deg, rgba(34, 43, 59, 0.8), rgba(24, 30, 42, 0.84));
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .status-flow-actor {
    color: #e6eefb;
}

body.theme-dark .status-flow-arrow-line {
    border-top-color: rgba(149, 174, 209, 0.7);
}

body.theme-dark .status-flow-arrow-line::after {
    border-left-color: rgba(149, 174, 209, 0.95);
}

body.theme-dark .status-flow-row.reverse .status-flow-arrow-line::after {
    border-right-color: rgba(149, 174, 209, 0.95);
}

body.theme-dark .status-flow-turn-line {
    background: linear-gradient(180deg, rgba(149, 174, 209, 0.28), rgba(149, 174, 209, 0.85));
}

body.theme-dark .status-flow-turn-line::after {
    border-top-color: rgba(149, 174, 209, 0.95);
}

body.theme-dark .status-timeline-view-toggle {
    background: rgba(36, 45, 59, 0.92);
    border-color: rgba(126, 149, 178, 0.24);
}

body.theme-dark .project-overview-stat,
body.theme-dark .project-access-group,
body.theme-dark .project-access-row,
body.theme-dark .project-directory-table {
    background: color-mix(in srgb, var(--card) 97%, #000 3%);
}

body.theme-dark .project-directory-head {
    background: rgba(255, 255, 255, 0.06);
}

body.theme-dark .project-directory-tag,
body.theme-dark .project-directory-empty-tag {
    background: rgba(255, 255, 255, 0.06);
}

body.theme-dark .portal-project-picker {
    background: rgba(27, 35, 49, 0.96);
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .portal-tool-access-option {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .portal-tool-access-option:hover {
    background: rgba(128, 177, 255, 0.12);
}

body.theme-dark .portal-tool-access-option.is-selected {
    background: rgba(128, 177, 255, 0.16);
}

body.theme-dark .portal-radio-option {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .portal-radio-option:hover {
    background: rgba(128, 177, 255, 0.12);
}

body.theme-dark .portal-radio-option:has(input[type="radio"]:checked) {
    background: rgba(128, 177, 255, 0.16);
    border-color: rgba(128, 177, 255, 0.35);
}

body.theme-dark .portal-project-option {
    background: rgba(255, 255, 255, 0.04);
}

body.theme-dark .portal-project-option:hover {
    background: rgba(128, 177, 255, 0.12);
}

body.theme-dark .portal-project-option.is-selected {
    background: rgba(128, 177, 255, 0.16);
}

body.theme-dark .danger-button {
    background: rgba(221, 75, 57, 0.18);
    color: #ffb1a5;
}

body.theme-dark .vault-scorpion-stage {
    border-color: rgba(98, 84, 74, 0.72);
    background:
        radial-gradient(circle at 18% 20%, rgba(183, 144, 92, 0.1), transparent 24%),
        linear-gradient(180deg, rgba(20, 16, 13, 0.96), rgba(11, 9, 8, 0.98));
}

body.theme-dark .vault-scorpion-caption-title {
    color: #e6cb98;
}

body.theme-dark .vault-scorpion-caption-copy {
    color: #c8baaf;
}

body.theme-dark .vault-scorpion-stage::after {
    border-color: rgba(255, 248, 239, 0.82);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 980px) {
    .shell,
    .panel-grid,
    .admin-grid,
    .ticket-detail-tabs-grid,
    .detail-grid,
    .topbar {
        grid-template-columns: 1fr;
        display: grid;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .setup-shell,
    .setup-kpi-grid,
    .setup-two-column,
    .setup-form-grid,
    .cc-email-entry,
    .about-panel-grid {
        grid-template-columns: 1fr;
    }

    .markdown-help-row {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-widget-wide {
        grid-column: span 1;
    }

    .widget-gallery-overlay {
        padding: 16px;
        place-items: start center;
    }

    .widget-gallery.drawer {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        width: min(100%, 720px);
        max-height: calc(100vh - 32px);
    }

    .portal-user-stat-grid {
        grid-template-columns: 1fr;
    }

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

    .project-admin-toolbar {
        align-items: stretch;
    }

    .project-settings-flow {
        gap: 6px;
    }

    .project-settings-flow-chip {
        font-size: 0.76rem;
        padding: 6px 10px;
    }

    .project-module-card .card-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .project-module-row-grid .field {
        border-right: 0;
        border-bottom: 1px solid color-mix(in srgb, var(--accent-soft) 38%, var(--border));
    }

    .project-module-row-grid .field:last-child {
        border-bottom: 0;
    }

    .project-module-heading-actions {
        justify-content: flex-start;
    }

    .project-module-card-popup {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .customer-portal-settings-card-popup {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .customer-portal-settings-card-popup .card-heading {
        margin: -24px -24px 0;
        padding-inline: 24px;
    }

    #columnManager {
        padding: 12px;
    }

    #columnManager .drawer-panel {
        width: min(100%, 420px);
        max-height: calc(100vh - 24px);
    }

    .customer-portal-banner-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-portal-team-picker {
        grid-template-columns: minmax(0, 1fr);
    }

    .customer-portal-team-picker-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-portal-team-picker-actions button {
        width: 100%;
    }

    .project-config-head {
        flex-direction: column;
        align-items: stretch;
    }

    .project-config-head .secondary {
        align-self: flex-start;
    }

    .project-config-modules-row,
    .project-config-rules-grid,
    .project-config-fields-grid {
        grid-template-columns: 1fr;
    }

    .project-config-card-popup {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        padding: 18px;
    }

    .project-config-card-popup .project-config-card-body {
        padding-right: 4px;
    }

    .project-config-card-popup .project-form-footer {
        margin: 0 -18px -18px;
        padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    }

    .portal-users-topbar,
    .portal-user-toolbar-meta {
        align-items: stretch;
    }

    .portal-user-head,
    .portal-user-head-deleted {
        display: none;
    }

    .portal-user-table {
        min-width: 0;
    }

    .portal-user-scroll {
        overflow: visible;
    }

    .portal-user-row,
    .portal-user-row-deleted {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .portal-user-modal {
        width: min(100vw - 20px, 1080px);
        max-height: calc(100vh - 20px);
    }

    .portal-user-form-card {
        max-height: calc(100vh - 20px);
        padding: 18px;
    }

    .portal-user-form-head {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-user-form-section {
        padding: 16px;
    }

    .portal-project-picker {
        position: static;
        margin-top: 10px;
        box-shadow: none;
    }

    .project-access-row {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .portal-tool-access-grid {
        grid-template-columns: 1fr;
    }

    .portal-user-index {
        display: none;
    }

    .portal-user-actions {
        justify-items: start;
    }

    .portal-user-action-buttons {
        justify-content: flex-start;
    }

    .setup-header {
        flex-direction: column;
        align-items: stretch;
    }

    .setup-header-actions {
        justify-content: flex-start;
    }

    .list-toolbar,
    .ticket-grid-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .ticket-detail-topbar,
    .ticket-detail-topbar-main,
    .ticket-detail-heading-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ticket-detail-topbar-side,
    .ticket-detail-heading-meta {
        justify-content: flex-start;
    }

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

    .compact-ticket-meta {
        position: static;
        max-height: none;
    }

    .setup-sidebar {
        order: 2;
    }

    .topbar-search {
        min-width: 0;
        grid-template-columns: 28px minmax(0, 1fr);
    }

    body.password-vault-standalone .topbar-search {
        grid-template-columns: minmax(0, 1fr);
        max-width: none;
    }

    .vault-scorpion-caption {
        max-width: 180px;
    }

    .vault-scorpion-caption-copy {
        font-size: 0.74rem;
    }

    .vault-scorpion-stage {
        min-height: 68px;
    }

    .topbar-search-filter {
        grid-column: auto;
        justify-self: end;
    }

    .advanced-search-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .advanced-search-row label {
        padding-top: 0;
    }

    .ticket-detail-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .comment-composer {
        grid-template-columns: 1fr;
    }

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

    body.sidebar-hidden .shell {
        grid-template-columns: 24px 1fr;
    }
}

.vault-panel {
    display: grid;
    gap: 14px;
}

.vault-shell {
    display: grid;
    gap: 14px;
}

.vault-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    border-radius: 24px;
    color: #ffffff;
    background:
        radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(90deg, #6f59e8 0%, #8272ef 42%, #9386f7 100%);
    box-shadow: 0 24px 44px rgba(88, 83, 210, 0.22);
}

.vault-hero-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.vault-hero-mark {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #6658de;
    font-size: 1.7rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(33, 32, 84, 0.18);
}

.vault-hero-brand-copy {
    display: grid;
    gap: 6px;
}

.vault-hero-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vault-hero-lock {
    font-size: 1.5rem;
    line-height: 1;
}

.vault-hero-title-row h2 {
    margin: 0;
    font-size: clamp(1.7rem, 1.5rem + 0.45vw, 2.15rem);
    font-weight: 800;
    font-family: var(--font-family);
    letter-spacing: -0.03em;
}

.vault-hero-copy p {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.92rem;
}

.vault-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.vault-hero-actions .secondary {
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #24bfd1 0%, #14a6c0 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: none;
}

.vault-hero-actions .secondary:hover {
    background: linear-gradient(180deg, #22b1c3 0%, #0d97b1 100%);
}

.vault-summary-grid {
    display: none;
}

.vault-workspace {
    display: grid;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid rgba(212, 220, 235, 0.86);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-soft);
}

.vault-toolbar {
    display: grid;
    grid-template-columns: minmax(420px, 1.7fr) minmax(150px, 0.55fr) minmax(150px, 0.55fr) auto auto;
    gap: 12px;
    align-items: center;
}

.vault-search,
.vault-filter {
    display: block;
}

.vault-search-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 18px;
    border-radius: 18px;
    border: 1px solid rgba(141, 169, 206, 0.42);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 8px 18px rgba(47, 109, 163, 0.08);
}

.vault-search-icon {
    color: #5d6f88;
    font-size: 1rem;
}

.vault-search input,
.vault-filter select,
.vault-form input:not([type="checkbox"]):not([type="hidden"]),
.vault-form textarea {
    width: 100%;
    border: 1px solid #d7deeb;
    border-radius: 14px;
    padding: 10px 12px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.vault-search input {
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1rem;
    font-weight: 600;
    color: #23364f;
}

.vault-search input::placeholder {
    color: rgba(70, 92, 121, 0.62);
    font-weight: 600;
}

.vault-filter select {
    min-height: 56px;
    padding-inline: 14px;
    border-radius: 18px;
    font-weight: 600;
    font-size: 0.94rem;
}

.vault-toolbar .secondary,
.vault-toolbar .primary {
    min-height: 56px;
    border-radius: 18px;
    padding: 0 20px;
    font-weight: 700;
    font-size: 0.94rem;
    white-space: nowrap;
}

.vault-toolbar .secondary {
    background: linear-gradient(180deg, #707b88 0%, #596371 100%);
    color: #ffffff;
    border: 0;
    box-shadow: none;
}

.vault-toolbar .secondary:hover {
    background: linear-gradient(180deg, #626b78 0%, #4d5561 100%);
}

.vault-toolbar .primary {
    border: 0;
    background: linear-gradient(180deg, #8f85f7 0%, #786aef 100%);
    box-shadow: none;
}

.vault-toolbar .primary:hover {
    background: linear-gradient(180deg, #8377ee 0%, #6d61e2 100%);
}

.vault-list {
    min-width: 0;
}

.vault-table-wrap {
    overflow-x: auto;
    border: 1px solid #e1e6f0;
    border-radius: 16px;
    background: #ffffff;
}

.vault-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 880px;
}

.vault-table thead th {
    padding: 14px 14px;
    background: #f7f9fc;
    border-bottom: 1px solid #dfe5ef;
    color: #2f3b4d;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

.vault-table tbody td {
    padding: 14px 14px;
    border-bottom: 1px solid #edf1f6;
    vertical-align: middle;
    color: #304257;
    background: #ffffff;
}

.vault-table tbody tr:last-child td {
    border-bottom: 0;
}

.vault-name-cell strong {
    font-size: 0.94rem;
    font-weight: 600;
}

.vault-portal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 9px;
    background: linear-gradient(180deg, #8e84f6 0%, #7469ec 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.86rem;
    text-decoration: none;
    white-space: nowrap;
}

.vault-url-muted {
    color: #8d96a6;
    font-style: italic;
}

.vault-inline-value {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.vault-password-text {
    letter-spacing: 0.1em;
    font-weight: 700;
    font-size: 0.92rem;
}

.vault-inline-icon {
    min-width: 26px;
    min-height: 26px;
    padding: 0;
    border-radius: 7px;
    border: 1px solid #dce3ee;
    background: #f7f9fc;
    color: #5d6b7d;
    box-shadow: none;
    line-height: 1;
}

.vault-inline-icon:hover {
    background: #eef4ff;
    color: #3456a4;
}

.vault-type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.vault-type-pill.is-shared {
    background: #2bb04b;
    color: #ffffff;
}

.vault-type-pill.is-only-me {
    background: #1e76f0;
    color: #ffffff;
}

.vault-row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
}

.vault-row-action {
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 7px;
    border: 1px solid #dbe2ec;
    background: #f7f9fc;
    color: #5d6b7d;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: none;
}

.vault-row-action:hover {
    background: #eef4ff;
    color: #3456a4;
}

.vault-row-action.is-danger:hover {
    background: rgba(209, 54, 54, 0.1);
    color: #bb3030;
}

.vault-details-row td {
    padding-top: 0;
    background: #fbfcfe;
}

.vault-details-panel {
    padding: 13px 15px 15px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid #e1e8f2;
}

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

.vault-details-grid span,
.vault-details-notes span,
.vault-footer-summary {
    display: block;
    margin-bottom: 4px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6f7d93;
}

.vault-details-grid strong,
.vault-details-notes p {
    color: #2c3c4f;
}

.vault-details-notes {
    margin-top: 12px;
}

.vault-details-notes p {
    margin: 0;
    line-height: 1.6;
}

.vault-workspace-footer {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 4px 0;
}

.vault-page-size {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.vault-page-size label {
    color: #697a92;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.vault-page-size select {
    width: auto;
    min-width: 72px;
    min-height: 38px;
    padding: 0 28px 0 12px;
    border: 1px solid #d7deeb;
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.vault-pagination {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.vault-pagination .secondary {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 0.88rem;
}

.vault-footer-summary {
    margin-bottom: 0;
    color: #617189;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

.vault-environment {
    color: #697a92;
    font-weight: 700;
    font-size: 0.92rem;
    justify-self: end;
}

.vault-environment strong {
    color: #ffad0f;
}

.vault-policy-banner {
    padding: 14px 18px;
    border: 1px solid #f0c24a;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff8dc 0%, #fff1bb 100%);
    color: #8b6b11;
    font-size: 0.94rem;
    line-height: 1.6;
}

.vault-empty-state {
    padding: 34px 20px;
    border-radius: 20px;
    border: 1px dashed #d9e1ee;
    background: #ffffff;
    text-align: center;
}

.vault-empty-state h3 {
    margin: 0 0 10px;
}

.vault-empty-state p {
    margin: 0;
    color: var(--muted);
}

.vault-modal {
    width: min(1100px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(249, 244, 240, 0.96));
    box-shadow: 0 28px 60px rgba(18, 22, 33, 0.24);
    backdrop-filter: blur(16px);
}

.vault-modal-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 24px 26px 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
}

.vault-modal-header-copy {
    display: grid;
    gap: 4px;
}

.vault-modal-header h3 {
    margin: 0 0 6px;
}

.vault-modal-header p {
    margin: 0;
    color: var(--muted);
}

.vault-form {
    display: grid;
    gap: 20px;
    min-height: 0;
    overflow: auto;
    align-content: start;
    padding: 20px 26px 0;
    scrollbar-gutter: stable;
    scroll-padding-bottom: 112px;
}

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

.vault-form-section {
    display: grid;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid color-mix(in srgb, var(--accent-soft) 42%, var(--border));
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.vault-form-section-head {
    display: grid;
    gap: 4px;
}

.vault-form-section-head h4 {
    margin: 0;
    font-size: 1.02rem;
}

.vault-form-section-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.vault-form .field {
    align-content: start;
}

.vault-form .field label {
    font-size: 0.92rem;
    font-weight: 700;
}

.vault-form .field small {
    color: var(--muted);
    line-height: 1.45;
}

.vault-notes-field textarea {
    min-height: 132px;
}

.vault-secret-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

.vault-secret-input .secondary {
    min-width: 88px;
}

.vault-sharing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.vault-share-field {
    gap: 12px;
}

.vault-share-section-head {
    display: grid;
    gap: 4px;
}

.vault-share-section-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}

.vault-share-section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.vault-share-list {
    display: grid;
    gap: 10px;
    max-height: 288px;
    overflow: auto;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 242, 237, 0.88));
}

.vault-share-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
    padding: 14px 15px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
    cursor: pointer;
    transition:
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}

.vault-share-option:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
    background: rgba(243, 248, 255, 0.9);
}

.vault-share-option:has(input[type="checkbox"]:checked) {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
    background: rgba(36, 116, 201, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.vault-share-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex: 0 0 auto;
    accent-color: var(--accent);
}

.vault-share-option-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.vault-share-option-copy strong {
    font-size: 0.95rem;
}

.vault-share-option small {
    color: var(--muted);
    line-height: 1.45;
}

.vault-share-empty {
    color: var(--muted);
    font-size: 0.9rem;
}

.vault-toggle-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 2px;
}

.vault-permission-chip {
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 16px;
    background: rgba(36, 116, 201, 0.06);
    border-color: color-mix(in srgb, var(--accent) 16%, var(--border));
}

.vault-permission-chip:has(input:checked) {
    background: rgba(36, 116, 201, 0.12);
    border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
    color: var(--accent-strong);
}

.vault-modal-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 -26px;
    padding: 16px 26px calc(22px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid color-mix(in srgb, var(--accent-soft) 40%, var(--border));
    background: linear-gradient(180deg, rgba(251, 253, 255, 0.76), rgba(255, 255, 255, 0.98));
    backdrop-filter: blur(12px);
}

.vault-modal-footer p {
    margin: 0;
    max-width: 560px;
    color: var(--muted);
    line-height: 1.5;
}

.vault-modal-footer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

body.theme-dark .vault-hero {
    color: #fff4ee;
    background:
        radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.12), transparent 28%),
        linear-gradient(90deg, #5440b8 0%, #6b5ad6 44%, #7d70ea 100%);
    box-shadow: 0 24px 44px rgba(0, 0, 0, 0.28);
}

body.theme-dark .vault-workspace,
body.theme-dark .vault-table-wrap,
body.theme-dark .vault-modal,
body.theme-dark .vault-form-section,
body.theme-dark .vault-search-shell,
body.theme-dark .vault-page-size select,
body.theme-dark .vault-filter select,
body.theme-dark .vault-form input:not([type="checkbox"]):not([type="hidden"]),
body.theme-dark .vault-form textarea,
body.theme-dark .vault-share-list,
body.theme-dark .vault-empty-state {
    background: rgba(38, 31, 26, 0.95);
}

body.theme-dark .vault-table thead th {
    background: rgba(53, 44, 38, 0.98);
    border-bottom-color: rgba(92, 79, 69, 0.82);
    color: #f2e7dd;
}

body.theme-dark .vault-table tbody td,
body.theme-dark .vault-details-row td {
    background: rgba(38, 31, 26, 0.95);
    border-bottom-color: rgba(88, 73, 63, 0.5);
}

body.theme-dark .vault-details-panel,
body.theme-dark .vault-policy-banner {
    background: rgba(48, 39, 33, 0.95);
}

body.theme-dark .vault-filter select,
body.theme-dark .vault-page-size select,
body.theme-dark .vault-inline-icon,
body.theme-dark .vault-row-action {
    border-color: rgba(91, 80, 72, 0.9);
}

body.theme-dark .vault-inline-icon,
body.theme-dark .vault-row-action {
    background: rgba(53, 44, 38, 0.95);
    color: #d8cbc0;
}

body.theme-dark .vault-inline-icon:hover,
body.theme-dark .vault-row-action:hover {
    background: rgba(73, 89, 124, 0.38);
    color: #f5ede6;
}

body.theme-dark .vault-share-option small,
body.theme-dark .vault-form-section-head p,
body.theme-dark .vault-share-section-head p,
body.theme-dark .vault-modal-footer p,
body.theme-dark .vault-empty-state p,
body.theme-dark .vault-url-muted,
body.theme-dark .vault-footer-summary,
body.theme-dark .vault-page-size label,
body.theme-dark .vault-environment,
body.theme-dark .vault-details-grid span,
body.theme-dark .vault-details-notes span,
body.theme-dark .vault-modal-header p {
    color: #c6b7ac;
}

body.theme-dark .vault-portal-link {
    color: #ffffff;
}

body.theme-dark .vault-details-grid strong,
body.theme-dark .vault-details-notes p,
body.theme-dark .vault-name-cell strong,
body.theme-dark .vault-inline-value span,
body.theme-dark .vault-updated-cell {
    color: #f5ede6;
}

body.theme-dark .vault-share-option {
    background: rgba(46, 37, 31, 0.84);
}

body.theme-dark .vault-share-option:hover {
    background: rgba(55, 44, 37, 0.92);
}

body.theme-dark .vault-share-option:has(input[type="checkbox"]:checked) {
    background: rgba(60, 96, 148, 0.24);
    border-color: rgba(109, 153, 214, 0.5);
}

body.theme-dark .vault-permission-chip {
    background: rgba(53, 74, 108, 0.26);
    border-color: rgba(91, 118, 162, 0.32);
}

body.theme-dark .vault-permission-chip:has(input:checked) {
    background: rgba(60, 96, 148, 0.3);
    border-color: rgba(109, 153, 214, 0.5);
}

body.theme-dark .vault-modal-footer {
    background: linear-gradient(180deg, rgba(38, 31, 26, 0.78), rgba(31, 25, 21, 0.98));
}

body.theme-dark .vault-policy-banner {
    border-color: rgba(178, 136, 34, 0.62);
    color: #f0d27b;
}

body.theme-dark .snipping-card,
body.theme-dark .snipping-editor-stage,
body.theme-dark .snipping-summary-card,
body.theme-dark .snipping-editor-meta-card,
body.theme-dark .snipping-secure-note,
body.theme-dark .snipping-color-swatch {
    background: rgba(38, 31, 26, 0.95);
}

body.theme-dark .snipping-card-head p,
body.theme-dark .snipping-secure-note,
body.theme-dark .snipping-editor-stage-head,
body.theme-dark .snipping-card-meta span,
body.theme-dark .snipping-summary-card span,
body.theme-dark .snipping-editor-meta-card span {
    color: #c6b7ac;
}

body.theme-dark .snipping-card-head h3,
body.theme-dark .snipping-summary-card strong,
body.theme-dark .snipping-editor-meta-card strong,
body.theme-dark .snipping-editor-stage-head strong,
body.theme-dark .snipping-color-swatch {
    color: #f5ede6;
}

body.theme-dark .snipping-card-mode {
    background: rgba(95, 110, 231, 0.28);
    color: #f3efff;
}

body.theme-dark .snipping-keyword-chip {
    background: rgba(95, 110, 231, 0.26);
    color: #f3efff;
}

@media (max-width: 1100px) {
    .vault-toolbar {
        grid-template-columns: minmax(0, 1fr) repeat(2, minmax(160px, 1fr));
    }

    .kba-toolbar {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "search"
            "action"
            "summary";
    }

    .kba-summary-grid {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .kba-toolbar #knowledgeBaseNewArticleButton {
        justify-self: stretch;
        min-width: 0;
    }

    .vault-toolbar .secondary,
    .vault-toolbar .primary {
        grid-column: span 1;
    }

    .snipping-toolbar,
    .snipping-editor-shell,
    .snipping-editor-meta {
        grid-template-columns: minmax(0, 1fr);
    }

    .snipping-summary-grid {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .vault-form-grid,
    .vault-sharing-grid,
    .vault-details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .vault-hero,
    .vault-modal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .vault-toolbar,
    .vault-form-grid,
    .vault-sharing-grid,
    .vault-details-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .snipping-toolbar,
    .snipping-summary-grid,
    .snipping-editor-shell,
    .snipping-editor-meta,
    .snipping-tool-grid,
    .snipping-color-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .kba-summary-grid,
    .kba-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .kba-toolbar #knowledgeBaseNewArticleButton {
        width: 100%;
    }

    .vault-workspace {
        padding: 16px;
    }

    .vault-workspace-footer {
        grid-template-columns: minmax(0, 1fr);
        justify-items: stretch;
    }

    .vault-hero {
        padding: 22px 20px;
    }

    .vault-hero-brand {
        align-items: flex-start;
    }

    .vault-hero-mark {
        width: 56px;
        height: 56px;
        font-size: 1.8rem;
    }

    .vault-toolbar .secondary,
    .vault-toolbar .primary {
        width: 100%;
    }

    .vault-search-shell,
    .vault-filter select {
        min-height: 52px;
    }

    .vault-page-size,
    .vault-pagination {
        justify-content: center;
    }

    .vault-footer-summary,
    .vault-environment {
        text-align: center;
        justify-self: center;
    }

    .vault-modal {
        width: min(100vw - 20px, 1000px);
        max-height: calc(100vh - 20px);
    }

    .vault-form,
    .vault-modal-header {
        padding-left: 18px;
        padding-right: 18px;
    }

    .vault-form {
        padding-bottom: 0;
    }

    .vault-form-section {
        padding: 16px;
    }

    .vault-modal-footer {
        flex-direction: column;
        align-items: stretch;
        margin: 0 -18px;
        padding-left: 18px;
        padding-right: 18px;
    }

    .vault-modal-footer-actions {
        width: 100%;
        margin-left: 0;
    }

    .vault-modal-footer-actions button {
        flex: 1 1 0;
    }

    .vault-secret-input {
        grid-template-columns: minmax(0, 1fr);
    }

    .snipping-editor-shell {
        padding-left: 18px;
        padding-right: 18px;
    }

    .snipping-editor-stage {
        min-height: 320px;
    }
}
