
        :root {
            color-scheme: light dark;
            --bg: #081018;
            --bg-soft: #0f1722;
            --paper: rgba(13, 22, 34, 0.88);
            --paper-strong: rgba(10, 17, 28, 0.96);
            --ink: #ecf6ff;
            --muted: #8ba0b8;
            --accent: #3dd9c5;
            --accent-deep: #8ff7ea;
            --accent-soft: rgba(61, 217, 197, 0.14);
            --warning: #ffb25b;
            --line: rgba(143, 247, 234, 0.14);
            --shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
        }
        * { box-sizing: border-box; }
        body {
            margin: 0;
            color: var(--ink);
            background:
                radial-gradient(circle at 18% 18%, rgba(61, 217, 197, 0.16), transparent 18%),
                radial-gradient(circle at 82% 14%, rgba(82, 145, 255, 0.16), transparent 16%),
                radial-gradient(circle at 50% 100%, rgba(110, 64, 255, 0.10), transparent 26%),
                linear-gradient(180deg, #07111a 0%, var(--bg) 46%, #050b12 100%);
            font-family: Bahnschrift, "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
        }
        .shell, .login-shell {
            max-width: 1580px;
            margin: 0 auto;
            padding: 28px;
        }
        .command-shell { max-width: 100%; padding: 14px; }
        .login-shell {
            min-height: 100vh;
            display: grid;
            place-items: center;
        }
        body[data-panel-root="login"] {
            background: #f6f7f9 !important;
            color: #111111;
        }
        /* Banner ảnh nền trên cùng: bo góc, canh giữa, vừa vặn */
        .site-top-banner {
            display: block;
            height: auto;
            max-width: 100%;
            margin: 0 auto;
            border-radius: 16px;
        }
        /* Login: banner nhỏ ~2/3, canh giữa */
        body[data-panel-root="login"] .site-top-banner {
            width: 66%;
            max-width: 620px;
            margin: 30px auto 0;
        }
        .login-system-title {
            margin: 18px auto 0;
            max-width: 760px;
            text-align: center;
            font-size: 1.7rem;
            line-height: 1.3;
            font-weight: 800;
            letter-spacing: 0.5px;
            color: #111111;
            text-transform: uppercase;
            padding: 0 16px;
        }
        body[data-panel-root="login"] .login-shell {
            min-height: auto;
            padding-top: 120px;
        }
        .card, .sub-card {
            background: var(--paper);
            border: 1px solid var(--line);
            border-radius: 24px;
            padding: 22px;
            box-shadow: var(--shadow);
            backdrop-filter: blur(18px);
        }
        .sub-card { margin-top: 16px; }
        .graph-stage {
            position: relative;
            min-height: calc(100vh - 36px);
            border-radius: 32px;
            overflow: hidden;
            border: 1px solid #e5e7eb;
            background: #ffffff;
            box-shadow: 0 14px 30px rgba(17, 24, 39, 0.08);
        }
        /* Banner ảnh nền đầu dashboard: dán liền vào nền trắng (không ranh giới),
           nằm góc trên bên trái, đáy ngang chân nút Tài khoản. */
        .dashboard-top-banner {
            width: auto;
            height: 56px;
            max-width: 70%;
            margin: 14px 0 6px 24px;
            border-radius: 0;
            box-shadow: none;
        }
        .minimal-stage { min-height: calc(100vh - 36px); }
        .floating-controls {
            position: absolute;
            top: 18px;
            right: 18px;
            z-index: 6;
            display: grid;
            gap: 12px;
            justify-items: end;
        }
        .top-control-row {
            display: flex;
            gap: 12px;
            align-items: start;
        }
        .control-action-stack {
            display: grid;
            gap: 12px;
            justify-items: end;
            margin-top: 12px;
        }
        .panel-shell {
            position: relative;
        }
        .compact-panel {
            position: absolute;
            top: calc(100% + 10px);
            right: 0;
            display: none !important;
            width: min(320px, calc(100vw - 40px));
            padding: 12px 14px;
            background: #ffffff;
            border-radius: 20px;
            border: 1px solid #d1d5db;
            color: #111111;
            box-shadow: 0 18px 38px rgba(17, 24, 39, 0.16);
            backdrop-filter: blur(18px);
            z-index: 8;
        }
        .panel-shell[data-panel="settings"] > .compact-panel {
            width: min(188px, calc(100vw - 40px));
            padding: 10px;
            border-radius: 14px;
            border: 1px solid #d1d5db;
            box-shadow: 0 12px 24px rgba(17, 24, 39, 0.14);
        }
        .settings-password-wrap {
            display: grid;
            gap: 8px;
            justify-items: stretch;
            width: 100%;
        }
        .settings-action-button {
            background: #ffffff;
            border: 2px solid #111111;
            border-radius: 8px;
            color: #111111;
            width: 100%;
            min-width: 156px;
            min-height: 34px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 6px 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            white-space: nowrap;
        }
        .settings-action-button svg {
            width: 18px;
            height: 18px;
            display: block;
        }
        .settings-action-button:hover {
            background: #111111;
            border-color: #111111;
            color: #ffffff;
        }
        .settings-password-panel {
            display: grid;
            gap: 8px;
            width: 100%;
        }
        .settings-password-panel[hidden] {
            display: none !important;
        }
        .settings-username-row {
            position: relative;
            width: 100%;
        }
        .settings-username-input {
            padding-right: 36px;
        }
        .settings-username-confirm {
            position: absolute;
            top: 50%;
            right: 6px;
            transform: translateY(-50%);
            width: 24px;
            height: 24px;
            border: none;
            border-radius: 6px;
            background: #1f9d55;
            color: #ffffff;
            font-size: 0.95rem;
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .settings-username-confirm[hidden] { display: none; }
        .settings-password-input {
            width: 100%;
            min-height: 34px;
            border-radius: 8px;
            border: 1px solid #d1d5db;
            background: #ffffff;
            color: #111111;
            padding: 8px 10px;
            outline: none;
            box-shadow: none;
        }
        .settings-password-input::placeholder {
            color: #6b7280;
        }
        .settings-password-input:focus {
            border-color: #111111;
        }
        .settings-password-save {
            background: #111111;
            border: 1px solid #111111;
            border-radius: 8px;
            color: #ffffff;
            min-height: 34px;
            cursor: pointer;
            width: 100%;
        }
        .settings-password-save:hover {
            background: #ffffff;
            border-color: #111111;
            color: #111111;
        }
        .settings-password-save:disabled {
            opacity: 0.6;
            cursor: wait;
        }
        .offline-toast {
            position: fixed;
            left: 50%;
            bottom: 22px;
            transform: translate(-50%, 18px);
            padding: 10px 18px;
            border-radius: 999px;
            border: 1px solid rgba(255, 196, 128, 0.42);
            background: rgba(29, 16, 8, 0.94);
            color: #ffe2b8;
            font-size: 0.84rem;
            letter-spacing: 0.02em;
            box-shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.18s ease, transform 0.18s ease;
            z-index: 90;
        }
        .offline-toast.is-visible {
            opacity: 1;
            transform: translate(-50%, 0);
        }
        .offline-toast.is-success {
            border-color: rgba(121, 232, 215, 0.4);
            background: rgba(7, 34, 30, 0.94);
            color: #bff8ef;
        }
        .offline-toast.is-error {
            border-color: rgba(255, 145, 145, 0.34);
            background: rgba(38, 10, 12, 0.94);
            color: #ffd0d0;
        }
        .compact-account-panel {
            width: min(116px, calc(100vw - 40px));
            padding: 6px;
            gap: 6px;
            border-radius: 10px;
            border: 0 !important;
            background: transparent !important;
            box-shadow: none !important;
        }
        .panel-shell[data-panel="user"] > .compact-panel {
            top: calc(100% - 30px);
            right: 17px;
            left: auto;
            transform: none;
            justify-items: end;
        }
        .tree-edit-mode-btn,
        .lan-mode-button {
            background: rgba(143, 247, 234, 0.1);
            border: 1px solid rgba(143, 247, 234, 0.2);
            border-radius: 6px;
            color: rgba(143, 247, 234, 0.6);
            width: auto;
            flex: 0 0 auto;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 6px 12px;
            min-width: 0;
            height: 30px;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.3s;
        }
        .tree-edit-mode-btn {
            width: auto;
            height: 30px;
            flex: 0 0 auto;
            min-width: 136px;
            padding: 6px 12px;
            color: rgba(255, 255, 255, 0.92);
        }
        .tree-edit-mode-btn svg,
        .tree-edit-sidebar-btn svg,
        .tree-node-editor-btn svg {
            width: 16px;
            height: 16px;
            fill: currentColor;
            display: block;
        }
        .tree-node-editor-btn.user svg {
            width: 20px;
            height: 20px;
            min-width: 20px;
            flex: 0 0 20px;
            overflow: visible;
        }
        .lan-mode-toggle {
            position: relative;
            display: flex;
            align-items: center;
            width: 136px;
            gap: 4px;
        }
        .lan-mode-toggle .lan-mode-button {
            width: 100%;
            min-width: 136px;
            flex: 1 1 136px;
        }
        .lan-mode-toggle .lan-mode-button[data-is-lan="true"] {
            min-width: 0;
            flex-basis: 98px;
        }
        .lan-mode-button[data-is-lan="true"] {
            background: rgba(115, 255, 232, 0.42);
            border-color: rgba(177, 255, 242, 0.74);
            color: #023838;
            box-shadow: 0 0 10px rgba(101, 255, 228, 0.34), 0 0 18px rgba(101, 255, 228, 0.2);
        }
        .lan-mode-button:hover,
        .tree-edit-mode-btn:hover {
            background: rgba(61, 217, 197, 0.2);
            border-color: rgba(61, 217, 197, 0.4);
            color: var(--accent-deep);
        }
        .tree-edit-mode-btn[data-editing="true"] {
            background: rgba(115, 255, 232, 0.42);
            border-color: rgba(177, 255, 242, 0.74);
            color: #023838;
            box-shadow: 0 0 10px rgba(101, 255, 228, 0.34), 0 0 18px rgba(101, 255, 228, 0.2);
        }
        .tree-edit-mode-btn[data-editing="true"]:hover {
            background: rgba(115, 255, 232, 0.42);
            border-color: rgba(177, 255, 242, 0.74);
            color: #023838;
            box-shadow: 0 0 10px rgba(101, 255, 228, 0.34), 0 0 18px rgba(101, 255, 228, 0.2);
        }
        .lan-edit-btn {
            background: rgba(143, 247, 234, 0.1);
            border: 1px solid rgba(143, 247, 234, 0.2);
            border-radius: 6px;
            color: rgba(143, 247, 234, 0.5);
            width: 34px;
            height: 30px;
            flex: 0 0 34px;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s;
        }
        .lan-edit-btn[hidden] { display: none !important; }
        .lan-edit-btn:hover {
            background: rgba(143, 247, 234, 0.15);
            color: var(--accent-deep);
        }
        .lan-edit-btn svg {
            width: 18px;
            height: 18px;
            display: block;
            fill: currentColor;
        }
        .ip-whitelist-section {
            position: absolute;
            right: 0;
            top: calc(100% + 8px);
            z-index: 12;
            display: none;
            flex-direction: column;
            gap: 6px;
            width: min(176px, calc(100vw - 40px));
            padding: 8px;
            border-radius: 10px;
            background: rgba(9, 17, 28, 0.96);
            border: 1px solid rgba(143, 247, 234, 0.2);
            box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
            backdrop-filter: blur(16px);
            max-height: 172px;
            overflow-y: auto;
            scrollbar-width: thin;
        }
        .ip-whitelist-section.is-open {
            display: flex;
        }
        .ip-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
            max-height: 102px;
            overflow-y: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        .ip-list::-webkit-scrollbar { display: none; width: 0; height: 0; }
        .ip-row {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 4px;
            background: rgba(6, 16, 28, 0.8);
            border: 1px solid rgba(143, 247, 234, 0.15);
            border-radius: 6px;
        }
        .ip-row-input {
            flex: 1;
            min-width: 0;
            border: none;
            background: transparent;
            color: var(--accent-deep);
            font-family: monospace;
            font-size: 0.78rem;
            padding: 2px 4px;
            outline: none;
        }
        .remove-ip-btn {
            background: none;
            border: none;
            color: rgba(255, 100, 100, 0.7);
            cursor: pointer;
            font-size: 0.9rem;
            width: 18px;
            height: 18px;
            padding: 0;
            line-height: 1;
        }
        .remove-ip-btn:hover { color: rgba(255, 100, 100, 1); }
        .ip-add-row-btn {
            align-self: flex-end;
            width: 28px;
            height: 28px;
            background: rgba(61, 217, 197, 0.2);
            border: 1px solid rgba(61, 217, 197, 0.4);
            border-radius: 6px;
            color: var(--accent-deep);
            cursor: pointer;
            font-weight: 600;
            font-size: 1rem;
            line-height: 1;
            padding: 0;
        }
        .ip-add-row-btn:hover { background: rgba(61, 217, 197, 0.3); }
        .account-logout-form {
            margin: 0;
            width: auto;
        }
        .logout-icon-btn {
            width: auto;
            min-width: 108px;
            min-height: 36px;
            border-radius: 8px;
            border: 2px solid #111111 !important;
            outline: 0 !important;
            box-shadow: none !important;
            background: #ffffff !important;
            color: #111111 !important;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 8px 12px;
            line-height: 1;
            font-size: 0.84rem;
            font-weight: 800;
            white-space: nowrap;
        }
        .account-logout-form .logout-icon-btn,
        .compact-account-panel .logout-icon-btn,
        .panel-shell[data-panel="user"] .logout-icon-btn {
            border: 2px solid #111111 !important;
            outline: 0 !important;
            box-shadow: none !important;
            background: #ffffff !important;
            color: #111111 !important;
        }
        .tree-edit-sidebar {
            position: fixed;
            top: auto;
            bottom: 22px;
            left: 50%;
            right: auto;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 6px;
            z-index: 40;
            padding: 8px 10px;
            border: 1px solid rgba(17, 17, 17, 0.16);
            border-radius: 9px;
            background: #ffffff;
            box-shadow: 0 10px 24px rgba(17, 24, 39, 0.10);
        }
        .tree-edit-sidebar[hidden] { display: none !important; }
        .tree-edit-sidebar-close {
            position: absolute;
            top: -9px;
            right: -9px;
            width: 20px;
            height: 20px;
            min-width: 20px;
            padding: 0;
            border-radius: 999px;
            border: 1px solid rgba(17, 17, 17, 0.20);
            background: #ffffff;
            color: #111111;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.86rem;
            font-weight: 800;
            line-height: 1;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(17, 24, 39, 0.12);
        }
        .tree-edit-sidebar-close:hover {
            background: #f3f4f6;
            color: #111111;
        }
        .tree-edit-sidebar-btn {
            width: 32px;
            height: 32px;
            min-width: 32px;
            padding: 0;
            border-radius: 7px;
            border: 1px solid rgba(17, 17, 17, 0.16);
            background: #ffffff;
            color: #111111;
            box-shadow: none;
            cursor: pointer;
            font-size: 1.05rem;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            text-align: center;
        }
        .tree-edit-sidebar-btn:hover {
            background: #f3f4f6;
            border-color: rgba(17, 17, 17, 0.24);
            color: #111111;
        }
        .tree-edit-sidebar-btn:disabled {
            opacity: 0.45;
            cursor: default;
            box-shadow: none;
            background: #ffffff;
            color: #111111;
        }
        .tree-user-card {
            position: absolute;
            z-index: 21;
            min-width: 184px;
            display: grid;
            gap: 8px;
            padding: 10px;
            border-radius: 12px;
            border: 1px solid rgba(143, 247, 234, 0.22);
            background: rgba(6, 16, 28, 0.95);
            box-shadow: 0 16px 32px rgba(0, 0, 0, 0.34);
            backdrop-filter: blur(10px);
            transform: translate(-50%, 0);
        }
        .tree-user-card[hidden] { display: none !important; }
        .tree-rename-card {
            position: absolute;
            z-index: 22;
            min-width: 220px;
            padding: 8px;
            border-radius: 12px;
            border: 1px solid rgba(143, 247, 234, 0.22);
            background: rgba(6, 16, 28, 0.97);
            box-shadow: 0 16px 32px rgba(0, 0, 0, 0.34);
            backdrop-filter: blur(10px);
            transform: translate(-50%, 0);
        }
        .tree-rename-card[hidden] { display: none !important; }
        .tree-rename-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .tree-cred-card {
            position: absolute;
            z-index: 23;
            min-width: 200px;
            padding: 8px 10px;
            border-radius: 10px;
            border: 1px solid #d8dee9;
            background: #ffffff;
            box-shadow: 0 12px 28px rgba(17, 24, 39, 0.18);
            transform: translate(-50%, 0);
            display: grid;
            gap: 4px;
        }
        .tree-cred-card[hidden] { display: none !important; }
        .tree-cred-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            font-size: 0.85rem;
        }
        .tree-cred-label { color: #6b7280; }
        .tree-cred-value { color: #111111; font-weight: 700; font-family: ui-monospace, monospace; }
        .tree-rename-input {
            min-width: 0;
            flex: 1;
        }
        .tree-rename-save {
            width: 34px;
            height: 32px;
            flex: 0 0 34px;
            padding: 0;
            border-radius: 8px;
            border: 1px solid rgba(143, 247, 234, 0.28);
            background: rgba(61, 217, 197, 0.16);
            color: var(--accent-deep);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }
        .tree-rename-save:hover {
            background: rgba(61, 217, 197, 0.26);
            border-color: rgba(143, 247, 234, 0.42);
        }
        .tree-rename-save svg {
            width: 16px;
            height: 16px;
            fill: currentColor;
            display: block;
        }
        .tree-user-input {
            height: 32px;
            border-radius: 6px;
            border: 1px solid rgba(143, 247, 234, 0.22);
            background: rgba(9, 18, 28, 0.88);
            color: var(--ink);
            padding: 0 10px;
            outline: none;
            font-size: 0.9rem;
        }
        .tree-user-input::placeholder {
            color: rgba(143, 247, 234, 0.5);
        }
        .tree-user-input:focus {
            border-color: rgba(143, 247, 234, 0.44);
            box-shadow: 0 0 0 2px rgba(143, 247, 234, 0.15);
        }
        .logout-icon-btn:hover {
            background: #ffffff;
            border-color: #111111;
            color: #111111;
        }
        @media (max-width: 640px) {
            .ip-whitelist-section {
                right: 0;
                top: calc(100% + 8px);
                width: min(212px, calc(100vw - 40px));
            }
        }
        .overlay-panel {
            position: absolute;
            inset: 88px 22px 22px 22px;
            z-index: 9;
            display: none;
            align-items: start;
            pointer-events: none;
        }
        .overlay-panel.is-open { display: grid; }
        .overlay-card {
            pointer-events: auto;
            background: rgba(8, 15, 24, 0.95);
            border: 1px solid rgba(143, 247, 234, 0.14);
            border-radius: 24px;
            box-shadow: 0 22px 50px rgba(0, 0, 0, 0.34);
            padding: 16px;
            backdrop-filter: blur(18px);
        }
        .large-overlay-panel { justify-items: center; }
        .large-overlay-panel .overlay-card { width: min(920px, calc(100vw - 80px)); }
        .side-overlay-panel { justify-items: start; }
        .overlay-head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            margin-bottom: 12px;
        }
        .profile-right-tools {
            display: flex;
            gap: 10px;
            align-items: start;
            margin-left: auto;
        }
        .profile-corner-button {
            width: 46px;
            height: 46px;
            min-width: 46px;
            padding: 0;
            border: none !important;
            background: transparent !important;
            box-shadow: none !important;
            color: #ffffff !important;
        }
        .profile-corner-button svg {
            width: 24px;
            height: 24px;
            display: block;
        }
        .profile-home-button svg {
            width: 23px;
            height: 23px;
        }
        .profile-home-unit-code {
            display: inline-grid;
            place-items: center;
            width: 100%;
            height: 100%;
            border-radius: 999px;
            background: transparent;
            color: #111111;
            border: 0;
            font-size: 0.78rem;
            font-weight: 800;
            line-height: 1;
            text-transform: none;
            padding: 0 5px;
        }
        .icon-drawer, .message-drawer {
            border-radius: 22px;
            background: rgba(9, 17, 28, 0.82);
            border: 1px solid rgba(143, 247, 234, 0.14);
            box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
            overflow: hidden;
            backdrop-filter: blur(18px);
        }
        .icon-drawer > summary, .message-drawer > summary {
            cursor: pointer;
            list-style: none;
            background: transparent;
        }
        .icon-drawer > summary::-webkit-details-marker,
        .message-drawer > summary::-webkit-details-marker,
        .nested-drawer > summary::-webkit-details-marker { display: none; }
        .icon-button, .unit-badge-button {
            width: 40px;
            height: 40px;
            display: inline-grid;
            place-items: center;
            border-radius: 999px;
            border: 1.5px solid rgba(143, 247, 234, 0.38);
            background: rgba(6, 15, 24, 0.86);
            color: var(--ink);
            font-weight: 700;
            font-size: 1.25rem;
            line-height: 1;
            box-shadow: 0 11px 19px rgba(0, 0, 0, 0.22);
        }
        .unit-badge-button {
            min-width: 40px;
            width: auto;
            padding: 0 12px;
            text-transform: lowercase;
        }
        .icon-button.dashboard-control-button {
            width: 32px;
            height: 32px;
            border: none !important;
            border-radius: 0 !important;
            box-shadow: none !important;
            background: transparent !important;
            padding: 0 !important;
            font-size: 1.65rem;
            color: #ffffff !important;
            line-height: 1;
            display: grid !important;
            place-items: center;
        }
        .icon-button.dashboard-control-button svg {
            width: 20px;
            height: 20px;
            display: block;
            fill: currentColor;
        }
        .icon-button.dashboard-control-button.account-control-button {
            width: 62px;
            height: 62px;
            transform: translateY(-13px);
        }
        .icon-button.dashboard-control-button.account-control-button:hover,
        .icon-button.dashboard-control-button.account-control-button:focus-visible,
        .icon-button.dashboard-control-button.account-control-button:active {
            transform: translateY(-13px) !important;
            animation: none !important;
            box-shadow: none !important;
        }
        .icon-button.dashboard-control-button.account-control-button svg {
            width: 28px;
            height: 28px;
        }
        .dashboard-action-button {
            width: 108px;
            height: 38px;
            font-size: 0.88rem;
            line-height: 1;
            border: 1.5px solid #111111 !important;
            border-radius: 8px !important;
            box-shadow: none !important;
            background: #ffffff !important;
            color: #111111 !important;
            text-decoration: none !important;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            padding: 0 11px;
            font-weight: 800;
            white-space: nowrap;
        }
        .dashboard-action-button svg {
            width: 17px;
            height: 17px;
            fill: currentColor;
            flex: 0 0 17px;
        }
        .icon-panel {
            display: grid;
            gap: 14px;
            padding: 14px 16px 16px;
            width: min(420px, calc(100vw - 48px));
        }
        .panel-shell[data-panel="settings"] > .icon-panel.compact-panel {
            width: min(236px, calc(100vw - 40px)) !important;
            padding: 8px 10px !important;
            border-radius: 14px;
            border: 1px solid rgba(143, 247, 234, 0.1);
            box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
        }
        .panel-shell[data-panel="user"] > .icon-panel.compact-panel {
            width: min(116px, calc(100vw - 40px)) !important;
            padding: 6px !important;
            border-radius: 10px;
            border: 0 !important;
            background: transparent !important;
            box-shadow: none !important;
        }
        .panel-shell > .compact-panel { display: none !important; }
        .panel-shell.is-open > .compact-panel { display: grid !important; }
        .nested-drawer {
            border: 1px solid rgba(143, 247, 234, 0.10);
            border-radius: 18px;
            background: rgba(255,255,255,0.02);
            padding: 10px 12px;
        }
        .nested-drawer > summary {
            cursor: pointer;
            list-style: none;
            font-weight: 700;
            color: var(--ink);
        }
        .compact-tag {
            display: inline-flex;
            align-items: center;
            padding: 7px 12px;
            border-radius: 999px;
            background: rgba(61, 217, 197, 0.08);
            border: 1px solid rgba(61, 217, 197, 0.16);
            color: var(--accent-deep);
            font-size: 0.84rem;
        }
        .graph-card {
            position: relative;
            min-height: calc(100vh - 36px);
            padding: 52px 24px 24px;
            background: transparent;
            border: 0;
            box-shadow: none;
        }
        .graph-grid, .graph-aura {
            position: absolute;
            inset: 0;
            pointer-events: none;
        }
        .graph-grid {
            background-image:
                linear-gradient(rgba(143, 247, 234, 0.06) 1px, transparent 1px),
                linear-gradient(90deg, rgba(143, 247, 234, 0.06) 1px, transparent 1px);
            background-size: 40px 40px;
            mask-image: radial-gradient(circle at center, black 46%, transparent 92%);
        }
        .graph-aura-left {
            background: radial-gradient(circle at 20% 30%, rgba(61,217,197,0.16), transparent 28%);
        }
        .graph-aura-right {
            background: radial-gradient(circle at 78% 20%, rgba(82,145,255,0.14), transparent 24%);
        }
        .pill {
            display: inline-flex;
            align-items: center;
            padding: 8px 12px;
            border-radius: 999px;
            background: rgba(255,255,255,0.14);
            border: 1px solid rgba(255,255,255,0.2);
        }
        .eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.76rem; opacity: 0.84; }
        .muted-eyebrow { color: var(--muted); opacity: 1; }
        .muted { color: var(--muted); }
        .details { display: grid; grid-template-columns: 1fr 2fr; gap: 10px 14px; }
        .tree-canvas {
            position: relative;
            padding: 12px 72px 12px 12px;
            border-radius: 28px;
            background: linear-gradient(180deg, rgba(7, 13, 21, 0.66), rgba(7, 13, 21, 0.18));
            border: 1px solid rgba(143, 247, 234, 0.10);
            min-height: calc(100vh - 116px);
            display: grid;
            align-items: center;
        }
        .tree-viewport {
            width: 100%;
            min-height: calc(100vh - 104px);
            touch-action: none;
            cursor: grab;
            display: grid;
            place-items: center;
        }
        .tree-viewport.dragging { cursor: grabbing; }
        .tree-viewport.edit-mode { cursor: default; }
        .tree-viewport.edit-mode .tree-node-group { cursor: move; }
        .tree-node-editor {
            position: absolute;
            z-index: 20;
            display: grid;
            gap: 6px;
            padding: 7px;
            border-radius: 12px;
            border: 1px solid rgba(143, 247, 234, 0.24);
            background: rgba(6, 16, 28, 0.94);
            box-shadow: 0 12px 26px rgba(0, 0, 0, 0.36);
            backdrop-filter: blur(10px);
            transform: translate(-50%, 0);
        }
        .tree-node-editor[hidden] { display: none !important; }
        .tree-node-editor-btn {
            width: 34px;
            height: 34px;
            border-radius: 8px;
            border: 1px solid rgba(143, 247, 234, 0.28);
            background: rgba(143, 247, 234, 0.08);
            color: rgba(143, 247, 234, 0.9);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            line-height: 1;
            cursor: pointer;
        }
        .tree-node-editor-btn:hover {
            background: rgba(143, 247, 234, 0.17);
            border-color: rgba(143, 247, 234, 0.44);
        }
        .tree-node-editor-btn.user {
            color: rgba(255, 255, 255, 0.92);
        }
        .tree-node-editor-btn.delete:hover {
            border-color: rgba(255, 117, 117, 0.55);
            color: #ff8d8d;
            background: rgba(255, 117, 117, 0.14);
        }
        .tree-edit-edge {
            stroke: rgba(143, 247, 234, 0.34);
            stroke-width: 1.8;
        }
        .org-svg {
            width: 100%;
            height: min(calc(100vh - 88px), 1260px);
            display: block;
        }
        .tree-edge { stroke: rgba(143, 247, 234, 0.24); stroke-width: 1.7; pointer-events: none; }
        .tree-edge.highlighted {
            stroke: rgba(145, 255, 212, 0.94);
            stroke-width: 3.2;
            filter: drop-shadow(0 0 12px rgba(145, 255, 212, 0.33));
        }
        .d-cluster, .tree-node-group {
            transition: filter 140ms ease, opacity 140ms ease, stroke 140ms ease;
            transform-box: fill-box;
            transform-origin: center;
        }
        .tree-node-link, .tree-node-link * { pointer-events: all; }
        .tree-node {
            fill: #ffffff;
            stroke: #111111;
            stroke-width: 2.2;
            filter: drop-shadow(0 6px 12px rgba(17, 24, 39, 0.14));
        }
        .tree-node.highlighted {
            fill: #ffffff;
            stroke: #111111;
            stroke-width: 3;
            filter: drop-shadow(0 8px 16px rgba(17, 24, 39, 0.18));
        }
        .tree-node.current.highlighted {
            fill: #ffffff;
            stroke: #111111;
        }
        .tree-node-link:hover .tree-node,
        .tree-node-link:focus-visible .tree-node {
            stroke: #111111;
            stroke-width: 3;
            filter: drop-shadow(0 8px 18px rgba(17, 24, 39, 0.22));
        }
        .tree-node.current { fill: #ffffff; stroke: #111111; stroke-width: 3; }
        .tier-0 .tree-node,
        .tier-1 .tree-node,
        .tier-2 .tree-node,
        .tier-3 .tree-node { fill: #ffffff; stroke: #111111; stroke-width: 2.2; }
        .generation-0 .tree-node { stroke: #dc2626; }
        .generation-1 .tree-node { stroke: #2563eb; }
        .generation-2 .tree-node { stroke: #0ea5e9; }
        .tier-0 .tree-node.highlighted,
        .tier-1 .tree-node.highlighted,
        .tier-2 .tree-node.highlighted,
        .tier-3 .tree-node.highlighted {
            fill: #ffffff;
            stroke-width: 3;
            filter: drop-shadow(0 8px 16px rgba(17, 24, 39, 0.18));
        }
        .tier-0 .tree-node.current.highlighted,
        .tier-1 .tree-node.current.highlighted,
        .tier-2 .tree-node.current.highlighted,
        .tier-3 .tree-node.current.highlighted {
            fill: #ffffff;
        }
        .tier-0 .tree-node-text { font-size: 28px; }
        .tier-1 .tree-node-text { font-size: 22px; }
        .tier-2 .tree-node-text { font-size: 17px; }
        .tier-3 .tree-node-text { font-size: 14px; }
        .tree-node-text { font-weight: 800; fill: #111111; pointer-events: none; letter-spacing: 0; }
        .command-shell { background: #ffffff; color: #111111; }
        .command-shell .icon-button.dashboard-control-button { color: #111111 !important; }
        .command-shell .dashboard-action-button {
            width: 108px;
            height: 38px;
            border: 1.5px solid #111111 !important;
            border-radius: 8px !important;
            background: #ffffff !important;
            color: #111111 !important;
            box-shadow: none !important;
            font-size: 0.88rem;
            font-weight: 800;
            white-space: nowrap;
            text-decoration: none !important;
        }
        .command-shell .dashboard-action-button:hover,
        .command-shell .dashboard-action-button:focus-visible { background: #111111 !important; color: #ffffff !important; }
        .command-shell .compact-panel { background: #ffffff; color: #111111; border-color: #d1d5db; box-shadow: 0 18px 38px rgba(17,24,39,0.16); }
        .command-shell .graph-card-minimal { padding: 0; min-height: calc(100vh - 30px); }
        .command-shell .tree-canvas { background: transparent; border-color: transparent; border-radius: 0; padding: 18px 118px 18px 18px; min-height: calc(100vh - 30px); }
        .command-shell .tree-viewport { min-height: calc(100vh - 66px); }
        .command-shell .panel-shell[data-panel="settings"] > .icon-panel.compact-panel,
        .command-shell .panel-shell[data-panel="settings"] > .compact-panel { width: min(188px, calc(100vw - 40px)) !important; padding: 10px !important; }
        .command-shell .panel-shell[data-panel="user"] > .icon-panel.compact-panel,
        .command-shell .panel-shell[data-panel="user"] > .compact-panel { top: calc(100% - 30px); right: 17px; width: min(116px, calc(100vw - 40px)) !important; padding: 6px !important; border: 0 !important; border-radius: 10px; background: transparent !important; box-shadow: none !important; justify-items: end; }
        .command-shell .logout-icon-btn { background: #ffffff !important; color: #111111 !important; border: 1.5px solid #111111 !important; outline: 0 !important; box-shadow: none !important; }
        .command-shell .logout-icon-btn:hover { background: #111111 !important; color: #ffffff !important; }
        .command-shell .panel-shell[data-panel="docs"] > .compact-panel,
        .command-shell .panel-shell[data-panel="reports"] > .compact-panel { top: calc(100% + 8px); right: 0; width: min(160px, calc(100vw - 40px)) !important; padding: 10px !important; border: 1px solid #d1d5db !important; border-radius: 12px !important; background: #ffffff; }
        .command-shell .settings-action-button { width: 100%; min-width: 156px; background: #ffffff; border: 1.5px solid #111111; color: #111111; }
        .command-shell .settings-action-button:hover { background: #111111; color: #ffffff; }
        .command-shell .lan-mode-toggle { width: 156px; }
        .command-shell .lan-mode-toggle .lan-mode-button { min-width: 156px; height: 30px; background: #ffffff !important; border: 1.5px solid #111111 !important; color: #111111 !important; box-shadow: none !important; }
        .command-shell .lan-mode-toggle .lan-mode-button[data-is-lan="true"] { min-width: 0; flex-basis: 116px; }
        .command-shell .lan-edit-btn { background: #ffffff !important; border: 1.5px solid #111111 !important; color: #111111 !important; box-shadow: none !important; }
        .command-shell .lan-mode-button:hover, .command-shell .lan-edit-btn:hover { background: #111111 !important; color: #ffffff !important; }
        .command-shell .ip-whitelist-section { background: #ffffff; border: 1.5px solid #111111; color: #111111; box-shadow: 0 14px 28px rgba(17,24,39,0.16); }
        .command-shell .ip-row { background: #ffffff; border: 1px solid #d1d5db; }
        .command-shell .ip-row-input { color: #111111; }
        .command-shell .remove-ip-btn { color: #111111; }
        .command-shell .remove-ip-btn:hover { color: #111111; }
        .command-shell .ip-add-row-btn { background: #ffffff; border: 1.5px solid #111111; color: #111111; }
        .command-shell .ip-add-row-btn:hover { background: #111111; color: #ffffff; }
        .command-shell .graph-grid { background-image: linear-gradient(rgba(17,24,39,0.055) 1px, transparent 1px), linear-gradient(90deg, rgba(17,24,39,0.055) 1px, transparent 1px); }
        .command-shell .graph-aura { background: transparent; }
        .command-shell .tree-node-editor { background: #ffffff; border-color: #111111; box-shadow: 0 12px 26px rgba(17,24,39,0.18); }
        .command-shell .tree-node-editor-btn { background: #ffffff; border-color: #111111; color: #111111; }
        .command-shell .tree-node-editor-btn svg { fill: #111111; }
        .command-shell .tree-node-editor-btn:hover { background: #111111; color: #ffffff; }
        .command-shell .tree-node-editor-btn:hover svg { fill: #ffffff; }
        .command-shell .tree-edge { stroke: rgba(17,24,39,0.22); }
        .command-shell .tree-node, .command-shell .tier-0 .tree-node, .command-shell .tier-1 .tree-node, .command-shell .tier-2 .tree-node, .command-shell .tier-3 .tree-node { fill: #ffffff; stroke: #111111; stroke-width: 2.2; }
        .command-shell .generation-0 .tree-node { stroke: #dc2626; }
        .command-shell .generation-1 .tree-node { stroke: #2563eb; }
        .command-shell .generation-2 .tree-node { stroke: #0ea5e9; }
        .command-shell .tree-node.highlighted, .command-shell .tier-0 .tree-node.highlighted, .command-shell .tier-1 .tree-node.highlighted, .command-shell .tier-2 .tree-node.highlighted, .command-shell .tier-3 .tree-node.highlighted { fill: #ffffff; stroke-width: 3; }
        .command-shell .tier-0 .tree-node-text { font-size: 32px; }
        .command-shell .tier-1 .tree-node-text { font-size: 25px; }
        .command-shell .tier-2 .tree-node-text { font-size: 20px; }
        .command-shell .tier-3 .tree-node-text { font-size: 16px; }
        .command-shell .tree-node-text { fill: #111111; letter-spacing: 0; }
        .dashboard-documents-panel { max-height: none; overflow: visible; gap: 7px; padding: 9px; box-shadow: 0 14px 28px rgba(17,24,39,0.16) !important; }
        .dashboard-unit-picker { display: grid; gap: 7px; min-width: 0; font-size: 0.84rem; }
        .dashboard-unit-picker strong { font-size: 0.82rem; color: #111111; }
        .dashboard-unit-search { width: 100%; min-height: 30px; border: 1px solid #d1d5db; border-radius: 7px; background: #ffffff; color: #111111; padding: 5px 8px; outline: none; font-size: 0.78rem; }
        .dashboard-unit-search:focus { border-color: #111111; box-shadow: inset 0 0 0 1px #111111; }
        .dashboard-doc-panel-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: center; gap: 6px; }
        .dashboard-doc-upload-link { min-height: 28px; display: flex; align-items: center; justify-content: center; color: #166534; border: 1.5px solid #16a34a; border-radius: 7px; background: #f0fdf4; padding: 5px 8px; font-size: 0.78rem; font-weight: 800; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.10); }
        .dashboard-doc-upload-link:hover { color: #ffffff; background: #16a34a; border-color: #15803d; }
        .dashboard-doc-search-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: transparent; color: #111111; cursor: pointer; font-size: 1rem; padding: 0; }
        .dashboard-doc-search-icon:hover, .dashboard-doc-search-icon.is-active { color: #2563eb; }
        .dashboard-unit-search-collapsed[hidden] { display: none !important; }
        .dashboard-report-panel { max-height: none; overflow: visible; gap: 7px; padding: 9px; box-shadow: 0 14px 28px rgba(17,24,39,0.16) !important; }
        .report-unit-list { display: grid; gap: 5px; margin-top: 6px; max-height: 176px; overflow: auto; }
        .report-unit-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 18px; column-gap: 2px; align-items: center; min-width: 0; }
        .report-unit-item { display: flex; align-items: center; width: 100%; min-height: 28px; border-radius: 7px; border: 1px solid #d1d5db; background: #ffffff; color: #111111; text-align: left; cursor: pointer; padding: 5px 8px; font-size: 0.78rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .report-unit-more { display: grid; place-items: center; width: 18px; min-width: 18px; min-height: 28px; border: 0; border-radius: 0; background: transparent; color: #111111; cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 0; }
        .report-unit-more:hover { color: #2563eb; background: transparent; }
        .report-unit-action-menu { position: fixed; z-index: 2000; display: grid; gap: 4px; padding: 5px; border: 1px solid #d1d5db; border-radius: 8px; background: #ffffff; box-shadow: 0 12px 24px rgba(17,24,39,0.16); }
        .report-unit-action-menu[hidden] { display: none !important; }
        .report-unit-action { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #d1d5db; border-radius: 7px; background: #ffffff; color: #111111; cursor: pointer; padding: 0; font-size: 0.94rem; }
        .report-unit-action:hover { border-color: #111111; background: #111111; color: #ffffff; }
        .report-unit-action-delete:hover { border-color: #dc2626; background: #dc2626; color: #ffffff; }
        .report-unit-item:hover, .report-unit-item.is-active { border-color: #111111; box-shadow: inset 0 0 0 1px #111111; }
        .report-document-workspace { display: grid; gap: 0; width: min(1120px, 100%); margin: 0 auto; }
        .report-tab-bar { border: 1px solid rgba(17, 17, 17, 0.14); border-bottom: 0; border-radius: 8px 8px 0 0; }
        .report-document-tab { max-width: 170px; }
        .report-add-tab-btn { flex: 0 0 auto; }
        .report-tab-actions .xl-action-btn { text-decoration: none; }
        .report-edit-surface { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; outline: none; font-family: "Times New Roman", Times, serif; }
        .report-tab-bar + .report-word-ribbon + .report-edit-surface,
        .report-tab-bar + .report-edit-surface { border-radius: 0 0 10px 10px; }
        .report-edit-surface.is-editing { border-color: #111111; box-shadow: inset 0 0 0 1px #111111; }
        .report-document { color: #111111; background: #ffffff; display: grid; gap: 12px; line-height: 1.45; font-family: "Times New Roman", Times, serif; }
        .report-letterhead {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 6px 4px 14px;
            border-bottom: 2.5px solid #8c1109;
            margin-bottom: 4px;
        }
        .report-letterhead-emblem {
            flex: 0 0 64px;
            width: 64px;
            height: 64px;
            background: url("/assets/emblem.svg") center / contain no-repeat;
        }
        .report-letterhead-text { display: grid; gap: 2px; }
        .report-letterhead-over { font-size: 0.82rem; font-weight: 700; letter-spacing: 2px; color: #8c1109; }
        .report-letterhead-title { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: 1px; color: #111111; }
        .report-letterhead-unit { margin: 0; font-size: 0.92rem; color: #374151; }
        body[data-panel-root="manage"] {
            background:
                radial-gradient(circle at 50% 120%, rgba(205, 162, 58, 0.08), transparent 55%),
                #f4f5f7 !important;
            color: #111111;
        }
        .manage-shell { max-width: 1080px; margin: 0 auto; padding: 22px 18px 60px; }
        .manage-header {
            display: flex; align-items: center; gap: 14px;
            padding: 14px 18px; margin-bottom: 18px;
            background: #ffffff; border-radius: 16px;
            border-left: 5px solid #8c1109;
            box-shadow: 0 8px 22px rgba(17, 24, 39, 0.08);
        }
        .manage-emblem { width: 56px; height: 56px; }
        .manage-header-text { display: grid; gap: 2px; margin-right: auto; }
        .manage-over { font-size: 0.74rem; font-weight: 700; letter-spacing: 2px; color: #8c1109; }
        .manage-title { margin: 0; font-size: 1.3rem; font-weight: 800; color: #111111; }
        .manage-header-actions { display: flex; gap: 8px; }
        .manage-link-btn {
            text-decoration: none; color: #111111; background: #ffffff;
            border: 1.5px solid #111111; border-radius: 8px;
            padding: 7px 14px; font-size: 0.85rem; font-weight: 600; white-space: nowrap;
        }
        .manage-link-btn:hover { background: #111111; color: #ffffff; }
        .manage-card {
            background: #ffffff; border: 1px solid #e5e7eb; border-radius: 16px;
            padding: 18px 20px; margin-bottom: 16px;
            box-shadow: 0 6px 16px rgba(17, 24, 39, 0.05);
        }
        .manage-card h2 { margin: 0 0 12px; font-size: 1.05rem; color: #111111; border-bottom: 1px solid #eef0f3; padding-bottom: 8px; }
        .manage-table-wrap { overflow-x: auto; }
        .manage-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
        .manage-table th, .manage-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
        .manage-table th { color: #6b7280; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; }
        .manage-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
        .manage-list a { color: #1a56d6; font-weight: 600; text-decoration: none; }
        .manage-list a:hover { text-decoration: underline; }
        .manage-add, .manage-edit { margin-top: 12px; }
        .manage-add > summary, .manage-edit > summary {
            cursor: pointer; display: inline-block; font-weight: 700; color: #8c1109;
            padding: 6px 10px; border: 1.5px dashed #8c1109; border-radius: 8px; font-size: 0.85rem;
        }
        .manage-edit > summary { color: #1a56d6; border-color: #b9c6e6; }
        .manage-add[open] > summary, .manage-edit[open] > summary { margin-bottom: 10px; }
        .manage-form-grid {
            display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px;
            background: #fafbfc; border: 1px solid #eef0f3; border-radius: 12px; padding: 14px;
        }
        .manage-form-grid label { display: grid; gap: 4px; font-size: 0.8rem; color: #374151; font-weight: 600; }
        .manage-form-grid input[type=text], .manage-form-grid input[type=number],
        .manage-form-grid input[type=password], .manage-form-grid select {
            border: 1.5px solid #cbd2dc; border-radius: 8px; padding: 8px 10px; font-size: 0.9rem; background: #ffffff; color: #111111;
        }
        .manage-form-grid input:focus, .manage-form-grid select:focus { outline: none; border-color: #8c1109; }
        .manage-span2 { grid-column: 1 / -1; }
        .manage-check { flex-direction: row; align-items: center; display: flex; gap: 8px; font-weight: 600; }
        .manage-check input { width: 16px; height: 16px; }
        .manage-submit {
            grid-column: 1 / -1; justify-self: start;
            background: #8c1109; color: #ffffff; border: 0; border-radius: 8px;
            padding: 9px 18px; font-weight: 700; font-size: 0.88rem; cursor: pointer;
        }
        .manage-submit:hover { background: #a8160d; }
        .manage-submit-sm { padding: 5px 12px; font-size: 0.8rem; }
        .manage-inline-form { margin: 0; }
        .manage-note { margin: 10px 0 0; font-size: 0.82rem; }
        @media (max-width: 640px) { .manage-form-grid { grid-template-columns: 1fr; } }
        .report-word-ribbon {
            display: flex;
            flex-wrap: nowrap;
            align-items: stretch;
            background: #ffffff;
            border: 1px solid rgba(17, 17, 17, 0.14);
            border-bottom: 0;
            color: #111111;
            padding: 7px 8px 6px;
            max-height: 82px;
            overflow-x: auto;
            overflow-y: hidden;
            scrollbar-width: thin;
        }
        .word-ribbon-group { display: flex; flex: 0 0 auto; flex-direction: column; gap: 5px; align-items: flex-start; justify-content: center; padding: 4px 10px 5px; }
        .report-word-ribbon .xl-group-label { color: #111111; }
        .report-word-ribbon .xl-ribbon-sep { background: #111111; opacity: 0.22; }
        .report-word-ribbon .xl-btn { color: #111111; border-color: transparent; }
        .report-word-ribbon .xl-btn:hover,
        .report-word-ribbon .xl-btn.is-active { background: #111111; color: #ffffff; border-color: #111111; }
        .report-word-ribbon .xl-select { background: #ffffff; color: #111111; border-color: rgba(17, 17, 17, 0.18); }
        .report-document dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
        .report-document dl div { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px; }
        .report-document dt { color: #4b5563; font-size: 0.78rem; }
        .report-document dd { margin: 2px 0 0; font-weight: 800; }
        .report-chart h4, .report-activities h4 { margin: 0 0 8px; }
        .report-chart-row { display: grid; grid-template-columns: 96px minmax(220px, 0.92fr) minmax(280px, 1.18fr); gap: 14px; align-items: center; }
        .report-pie { width: 92px; height: 92px; border-radius: 999px; border: 1px solid #e5e7eb; flex: 0 0 92px; }
        .report-chart ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
        .report-chart li { display: flex; gap: 7px; align-items: center; }
        .report-chart li span { width: 12px; height: 12px; border-radius: 999px; flex: 0 0 12px; }
        .report-chart-analysis { display: grid; gap: 5px; align-self: stretch; align-content: center; padding: 8px 10px; border-left: 1px solid #e5e7eb; color: #111111; }
        .report-chart-analysis p { margin: 0; font-size: 0.92rem; line-height: 1.42; }
        @media (max-width: 820px) {
            .report-chart-row { grid-template-columns: 96px 1fr; }
            .report-chart-analysis { grid-column: 1 / -1; border-left: 0; border-top: 1px solid #e5e7eb; padding-left: 0; }
        }
        .profile-report-surface { background: #ffffff; }
        .tab-link, .text-link, .back-link {
            color: var(--accent-deep);
            text-decoration: none;
            font-weight: 600;
        }
        .back-link, .text-link:hover { text-decoration: underline; }
        html:has(body[data-panel-root="profile"]),
        body[data-panel-root="profile"] { background: #ffffff !important; color: #111111; }
        body[data-panel-root="profile"] { min-width: 0; overflow-x: hidden; }
        .profile-shell { padding-top: 12px; background: #ffffff; min-height: 100vh; width: 100%; max-width: 100vw; color: #111; box-sizing: border-box; overflow-x: hidden; }
        .profile-shell * { --text-primary: #111; --text-muted: #444; }
        .profile-shell .sheet-title, .profile-shell .sheet-label,
        .profile-shell .xl-tab-label, .profile-shell .compact-tag,
        .profile-shell .text-link { color: #1a56d6; }
        .profile-shell .rail-button { background: #ffffff; border-color: #111111; color: #111111; }
        .profile-shell .xl-sheet td, .profile-shell .xl-sheet th { color: #111; border-color: #dde3f0; }
        .profile-shell .xl-sheet { background: #fff; }
        .profile-shell .xl-sheet-shell,
        .profile-shell .xl-sheet-scroll {
            background: #ffffff !important;
            scrollbar-color: #cbd8f4 #ffffff;
        }
        .profile-shell .xl-sheet-shell::-webkit-scrollbar,
        .profile-shell .xl-sheet-scroll::-webkit-scrollbar { width: 12px; height: 12px; }
        .profile-shell .xl-sheet-shell::-webkit-scrollbar-track,
        .profile-shell .xl-sheet-scroll::-webkit-scrollbar-track { background: #ffffff; }
        .profile-shell .xl-sheet-shell::-webkit-scrollbar-thumb,
        .profile-shell .xl-sheet-scroll::-webkit-scrollbar-thumb { background: #cbd8f4; border: 3px solid #ffffff; border-radius: 999px; }
        .profile-shell .xl-sheet-shell::-webkit-scrollbar-corner,
        .profile-shell .xl-sheet-scroll::-webkit-scrollbar-corner { background: #ffffff; }
        .profile-shell .xl-sheet thead th {
            background: #f7fafd !important;
            color: #1a56d6 !important;
            border-color: #cbd8f4 !important;
            border-bottom: 1.5px solid #b3c6f7 !important;
        }
        .profile-shell .xl-sheet tbody td {
            background: #ffffff !important;
            color: #111111 !important;
            border-color: #dde3f0 !important;
        }
        .profile-shell .xl-sheet tbody tr.is-data-header td {
            font-weight: 800;
            color: #111111 !important;
            background: #f8fbff !important;
        }
        .profile-shell .xl-sheet td.xl-unit-activity-cell {
            vertical-align: top;
            white-space: pre-wrap;
            line-height: 1.5;
            background: #ffffff !important;
        }
        .profile-shell .xl-tab-strip { border-bottom: 2px solid #dde3f0; }
        .profile-shell .xl-tab-chip { color: #444; background: #f5f7ff; border-color: #ccd5f0; }
        .profile-shell .xl-tab-chip.is-active { background: #e2e9ff; border-color: #7096f0; color: #1a3fa6; }
        .profile-shell .xl-action-btn { background: #f0f4ff; border-color: #b3c6f7; color: #1a56d6; }
        .profile-shell .compact-panel { background: #fff; border: 1.5px solid #b3c6f7; }
        .profile-shell .profile-document-actions { border-top: 2px solid #dde3f0; }
        /* Profile-shell light theme overrides — make icons visible on white,
           drop the legacy dark tab bar, and harmonize the sheet header. */
        .profile-shell .profile-corner-button {
            color: #111111 !important;
            background: #ffffff !important;
            border: 1.5px solid #111111 !important;
            box-shadow: none !important;
        }
        .profile-shell .profile-corner-button:hover {
            background: #111111 !important;
            color: #ffffff !important;
        }
        .profile-shell .profile-home-button.profile-corner-button {
            background: #ffffff !important;
            color: #111111 !important;
            border: none !important;
            width: 38px !important;
            height: 38px !important;
            min-width: 38px !important;
            box-shadow: none !important;
        }
        .profile-shell .profile-home-button.profile-corner-button svg { width: 26px; height: 26px; display: block; }
        .profile-shell .rail-back.profile-corner-button {
            border: none !important;
            background: transparent !important;
            box-shadow: none !important;
        }
        .profile-shell .rail-back.profile-corner-button:hover {
            border: none !important;
            background: #f3f4f6 !important;
            color: #111111 !important;
        }
        .profile-shell .profile-home-button.profile-corner-button:hover {
            background: #f3f4f6 !important;
            color: #111111 !important;
        }
        .profile-shell .profile-unit-title-code { color: #111111; font-size: 1.55rem; line-height: 1; font-weight: 800; text-transform: none; padding-top: 0; }
        .doc-file-manager { color: #111111; }
        .doc-file-manager-summary { cursor: pointer; list-style: none; display: inline-block; }
        .doc-file-manager-summary::-webkit-details-marker { display: none; }
        .doc-file-manager-hint { font-size: 1.5rem; line-height: 1; font-weight: 900; color: #111111; margin-left: 10px; white-space: nowrap; align-self: flex-end; }
        .doc-file-manager[open] .doc-file-manager-hint { transform: rotate(180deg); }
        .doc-file-manager-panel {
            margin-top: 12px; padding: 14px 16px; max-width: 760px;
            background: #fafbfc; border: 1px solid #e5e7eb; border-radius: 12px;
        }
        .doc-file-manager-panel h3 { margin: 0 0 10px; font-size: 1rem; color: #111111; }
        .doc-file-table-wrap { overflow-x: auto; }
        .doc-file-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
        .doc-file-table th, .doc-file-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
        .doc-file-table th { color: #6b7280; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.4px; }
        .doc-file-name { font-weight: 600; }
        .doc-file-inline-form { display: flex; gap: 6px; margin: 0; align-items: center; }
        .doc-file-rename-input { border: 1.5px solid #cbd2dc; border-radius: 6px; padding: 5px 8px; font-size: 0.86rem; min-width: 150px; }
        .doc-file-btn { background: #ffffff; border: 1.5px solid #111111; color: #111111; border-radius: 6px; padding: 5px 12px; font-weight: 600; font-size: 0.82rem; cursor: pointer; }
        .doc-file-btn:hover { background: #111111; color: #ffffff; }
        .doc-file-btn-delete { border-color: #b3160f; color: #b3160f; }
        .doc-file-btn-delete:hover { background: #b3160f; color: #ffffff; }
        .doc-file-upload-form { margin-top: 12px; }
        .doc-file-add-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; color: #8c1109; border: 1.5px dashed #8c1109; border-radius: 8px; padding: 8px 14px; font-size: 0.86rem; }
        .doc-file-add-label input[type=file] { display: none; }
        .doc-file-note { margin-top: 10px; font-size: 0.82rem; }
        .profile-shell .profile-header-action-button,
        .profile-shell .title-doc-button {
            color: #11315f !important;
            background: #e9f2ff !important;
            border: 1.5px solid #8db4f5 !important;
            box-shadow: 0 6px 14px rgba(37, 99, 235, 0.12) !important;
        }
        .profile-shell .profile-header-action-button:hover,
        .profile-shell .title-doc-button:hover {
            background: #dbeafe !important;
            color: #0f2f66 !important;
        }
        .profile-shell .profile-header-action-button.is-active,
        .profile-shell .title-doc-button.is-active {
            background: #2563eb !important;
            border-color: #1d4ed8 !important;
            color: #ffffff !important;
        }
        .profile-shell .title-doc-actions .title-doc-dropdown {
            background: #ffffff !important;
            border: 1.5px solid #b3c6f7 !important;
            color: #111 !important;
            box-shadow: 0 10px 24px rgba(20, 30, 60, 0.12) !important;
        }
        .profile-shell .xl-tab-bar {
            background: #ffffff;
            border: 1px solid rgba(17, 17, 17, 0.14);
            border-bottom: 0;
            border-radius: 8px 8px 0 0;
        }
        .profile-shell .xl-tab-strip { border-bottom: 0 !important; }
        .profile-shell .xl-action-btn {
            width: auto;
            min-width: 32px;
            color: #111111;
            background: #ffffff;
            border: 1px solid rgba(17, 17, 17, 0.14);
            border-radius: 7px;
        }
        .profile-shell .xl-action-btn:hover { background: #f3f4f6; color: #111111; }
        .profile-shell .xl-action-btn.is-active {
            background: #f3f4f6;
            color: #111111;
            border-color: rgba(17, 17, 17, 0.24);
        }
        .profile-shell .xl-action-btn[data-profile-doc-search-toggle="true"] {
            min-width: 38px;
            font-size: 1.12rem;
            font-weight: 800;
        }
        .profile-shell .xl-action-btn-kind-switch {
            min-width: 42px;
            font-size: 0.86rem;
            font-weight: 800;
        }
        .profile-shell .xl-action-btn-edit {
            min-width: 36px;
            background: #ffffff;
            color: #111111;
            border: 1px solid rgba(17, 17, 17, 0.14);
            font-weight: 800;
        }
        .profile-shell .xl-action-btn-edit:hover,
        .profile-shell .xl-action-btn-edit.is-active {
            background: #f3f4f6;
            color: #000000;
            border: 1px solid rgba(17, 17, 17, 0.24);
        }
        .profile-shell .xl-action-btn-edit.is-disabled {
            background: transparent;
            color: #9ca3af;
            border: 1px solid rgba(17, 17, 17, 0.10);
            opacity: 1;
            cursor: not-allowed;
        }
        .profile-shell .xl-tab-actions .export-form {
            min-width: 0;
            width: auto;
            display: block;
            gap: 0;
        }
        .profile-shell .xl-tab-actions .export-form .xl-action-btn {
            width: 34px;
            min-width: 34px;
            padding: 0;
        }
        .profile-shell .xl-tab-actions .profile-toolbar-upload-form {
            position: relative;
        }
        .profile-shell .xl-tab-actions .profile-toolbar-upload-label {
            display: inline-grid;
            place-items: center;
            height: 34px;
            cursor: pointer;
            font-size: 1rem;
            font-weight: 800;
        }
        .profile-shell .profile-document-tab {
            background: #f5f7ff;
            border-color: #ccd5f0;
        }
        .profile-shell .profile-document-tab.is-active {
            background: #e2e9ff;
            border-color: #7096f0;
        }
        .profile-shell .profile-document-tab-button { color: #444; }
        .profile-shell .profile-document-tab.is-active .profile-document-tab-button { color: #1a3fa6; }
        .profile-shell .profile-document-tab-close { color: #888; }
        .profile-shell .profile-document-tab-close:hover { color: #d23030; }
        .profile-shell .xl-sheet thead th {
            background: #f7fafd;
            color: #1a56d6;
            border-bottom: 1.5px solid #b3c6f7;
        }
        .profile-shell .card.sheet-card {
            background: #ffffff;
            color: #111;
            border: 1px solid #e3e8f3;
            box-shadow: 0 6px 22px rgba(20, 30, 60, 0.06);
        }
        .profile-shell .sheet-head h1 { color: #0f1f3d; }
        .profile-shell .compact-panel { color: #111; }
        .profile-shell .xl-doc-add-dropdown {
            background: #ffffff;
            border: 1.5px solid #b3c6f7;
            box-shadow: 0 8px 24px rgba(20, 30, 60, 0.12);
        }
        .profile-shell .xl-doc-add-search {
            background: #ffffff;
            border: 1.5px solid #b3c6f7;
            color: #111;
        }
        .profile-shell .xl-doc-add-group-label { color: #1a56d6; }
        .profile-shell .xl-doc-add-item { color: #111; }
        .profile-shell .xl-doc-add-item:hover { background: #e1ecff; color: #1a56d6; }
        .profile-shell .xl-doc-add-empty { color: #888; }
        .spreadsheet-shell { max-width: 100%; width: 100%; box-sizing: border-box; overflow-x: hidden; }
        .profile-corners {
            display: flex;
            justify-content: space-between;
            align-items: start;
            gap: 18px;
            margin-bottom: 6px;
        }
        .left-rail {
            display: grid;
            gap: 10px;
        }
        .nav-rail-row, .doc-rail-row {
            display: flex;
            gap: 10px;
            align-items: center;
        }
        .rail-button {
            width: 50px;
            height: 50px;
            display: grid;
            place-items: center;
            border-radius: 999px;
            background: rgba(6, 15, 24, 0.88);
            border: 1.5px solid rgba(143, 247, 234, 0.34);
            color: #ffffff;
            text-decoration: none;
            font-size: 1.55rem;
            font-weight: 700;
            line-height: 1;
            box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24);
        }
        .rail-back {
            font-family: inherit;
            cursor: pointer;
        }
        .rail-button:hover { color: #ffffff; }
        .profile-account-drawer { margin-left: auto; }
        .sheet-layout { display: grid; }
        .sheet-card { padding: 14px 16px 16px; }
        .sheet-head {
            display: flex;
            justify-content: space-between;
            gap: 16px;
            align-items: end;
            margin-bottom: 8px;
        }
        .profile-shell .sheet-head .profile-mode-title {
            margin: 0;
            color: #111111;
            font-size: 1.55rem;
            line-height: 1.08;
            font-weight: 900;
            letter-spacing: 0;
        }
        .sheet-head h1 { margin: 0; font-size: clamp(1.5rem, 2vw, 2.1rem); }
        .sheet-subtitle { margin: 6px 0 0; color: var(--muted); }
        .sheet-title-row {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }
        .title-doc-actions {
            display: flex;
            align-items: flex-end;
            gap: 8px;
        }
        .title-doc-actions > .panel-shell {
            display: flex;
            align-items: flex-end;
        }
        .profile-header-action-button {
            width: auto !important;
            height: 38px !important;
            min-width: 132px !important;
            min-height: 38px !important;
            padding: 0 14px !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            align-self: flex-end;
            border-radius: 9px !important;
            text-decoration: none !important;
            font-size: 0.92rem;
            font-weight: 800;
            white-space: nowrap;
        }
        .profile-header-action-icon {
            width: 28px;
            height: 28px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: inherit;
        }
        .profile-header-action-icon svg {
            width: 28px;
            height: 28px;
            display: block;
        }
        .title-doc-button {
            width: auto;
            height: 38px;
            min-width: 132px;
            border-radius: 9px !important;
            filter: none;
        }
        @keyframes icon-pop {
            0%   { transform: scale(1); }
            35%  { transform: scale(1.22); }
            65%  { transform: scale(1.1); }
            100% { transform: scale(1.14); }
        }
        .dashboard-action-button:hover,
        .dashboard-control-button:hover,
        .title-doc-button:hover {
            animation: icon-pop 0.22s ease forwards;
            cursor: pointer;
        }
        /* title-doc dropdowns open to the right */
        .title-doc-dropdown {
            right: auto;
            left: 0;
            width: min(336px, calc(100vw - 28px));
            padding: 10px;
            background: var(--paper-strong) !important;
            border: 1px solid rgba(143, 247, 234, 0.24) !important;
            outline: none !important;
            box-shadow: 0 16px 32px rgba(0, 0, 0, 0.26) !important;
        }
        .title-doc-actions .title-doc-dropdown {
            background: var(--paper-strong) !important;
            border: 1px solid rgba(143, 247, 234, 0.24) !important;
            outline: none !important;
            box-shadow: 0 16px 32px rgba(0, 0, 0, 0.26) !important;
        }
        .title-doc-dropdown .document-list-card {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            padding: 0;
        }
        .sheet-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
        .compact-qc-line { font-size: 0.82rem; letter-spacing: 0.04em; }
        .document-tabs { display: grid; gap: 12px; }
        .tab-strip { display: flex; gap: 8px; flex-wrap: wrap; }
        .tab-chip {
            width: auto;
            padding: 8px 14px;
            border-radius: 999px;
            background: rgba(255,255,255,0.06);
            color: var(--muted);
            box-shadow: none;
        }
        .tab-chip.is-active {
            background: rgba(61, 217, 197, 0.16);
            color: var(--accent-deep);
        }
        .tab-panel { display: none; }
        .tab-panel.is-active { display: block; }
        .document-list-card {
            border: 1px solid rgba(143, 247, 234, 0.10);
            border-radius: 18px;
            padding: 12px;
            background: rgba(255,255,255,0.03);
        }
        .doc-list-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 8px;
        }
        .doc-sync-btn {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            border: 1px solid rgba(143, 247, 234, 0.2) !important;
            outline: none;
            box-shadow: none !important;
            appearance: none;
            background: var(--paper-strong) !important;
            color: var(--ink);
            font-size: 0.96rem;
            cursor: pointer;
            display: grid;
            place-items: center;
            padding: 0;
        }
        .doc-sync-btn:hover {
            background: var(--paper-strong) !important;
            color: var(--accent-deep);
            border: 1px solid rgba(143, 247, 234, 0.34) !important;
            outline: none !important;
            box-shadow: none !important;
        }
        .doc-sync-btn:focus,
        .doc-sync-btn:focus-visible,
        .doc-sync-btn:active {
            border: 1px solid rgba(143, 247, 234, 0.34) !important;
            outline: none !important;
            box-shadow: none !important;
        }
        .doc-sync-btn:disabled { opacity: 0.55; cursor: wait; }
        .doc-method-col-label {
            font-size: 0.76rem;
            letter-spacing: 0.03em;
            color: rgba(143,247,234,0.62);
            min-height: 1px;
        }
        .profile-empty-upload-form {
            margin: 0;
        }
        .profile-empty-upload-tile {
            display: inline-flex;
            flex-direction: row;
            align-items: center;
            gap: 6px;
            padding: 6px 12px 6px 8px;
            border-radius: 20px;
            border: 1px dashed rgba(143, 247, 234, 0.30);
            background: rgba(61, 217, 197, 0.06);
            cursor: pointer;
            white-space: nowrap;
            transition: border-color 160ms ease, background 160ms ease;
        }
        .profile-empty-upload-tile:hover {
            border-color: rgba(143, 247, 234, 0.50);
            background: rgba(61, 217, 197, 0.12);
        }
        .profile-empty-upload-input {
            position: absolute;
            width: 1px;
            height: 1px;
            opacity: 0;
            pointer-events: none;
        }
        .profile-empty-upload-plus {
            width: 22px;
            height: 22px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: rgba(61, 217, 197, 0.18);
            border: 1px solid rgba(143, 247, 234, 0.28);
            color: var(--accent-deep);
            font-size: 1.1rem;
            line-height: 1;
            font-weight: 400;
            flex-shrink: 0;
        }
        .profile-empty-upload-copy {
            font-size: 0.82rem;
            color: rgba(236, 246, 255, 0.84);
        }
        .document-name-list {
            list-style: none;
            margin: 0;
            padding: 0;
            display: grid;
            gap: 4px;
        }
        .doc-name-row {
            display: grid;
            grid-template-columns: 18px minmax(0, 1fr) 32px 24px;
            align-items: center;
            gap: 6px;
            padding: 6px 6px;
            border-radius: 9px;
            border: none;
            background: transparent;
            position: relative;
        }
        .doc-name-row:hover { background: transparent; }
        .doc-row-num {
            min-width: 18px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.72rem;
            color: rgba(200,237,255,0.72);
            text-align: center;
            flex-shrink: 0;
            padding-top: 0;
            line-height: 1;
        }
        .doc-action-wrap {
            display: flex;
            align-items: flex-start;
            gap: 2px;
            flex-shrink: 0;
            position: relative;
            margin-top: 1px;
        }
        .doc-file-cell {
            border: 1px solid rgba(143, 247, 234, 0.2);
            border-radius: 8px;
            background: var(--paper-strong);
            padding: 5px 7px;
            min-height: 38px;
            display: flex;
            align-items: center;
        }
        .doc-file-cell:hover {
            border-color: rgba(143, 247, 234, 0.34);
        }
        .doc-method-wrap {
            display: flex;
            align-items: flex-start;
            justify-content: flex-start;
            min-width: 32px;
            max-width: 32px;
            flex: 0 0 32px;
            border: none;
            border-radius: 8px;
            background: transparent;
            padding: 0;
            position: relative;
        }
        .doc-method-pick {
            width: 28px;
            height: 28px;
            border-radius: 6px;
            border: 1px solid rgba(143, 247, 234, 0.2);
            box-shadow: none;
            background: var(--paper-strong);
            color: rgba(238,248,255,0.94);
            font-size: 0.98rem;
            font-weight: 700;
            cursor: pointer;
            line-height: 1;
            padding: 0;
        }
        .doc-method-pick:hover {
            color: #ffffff;
            background: var(--paper-strong);
            border-color: rgba(143, 247, 234, 0.34);
        }
        .doc-method-menu {
            position: absolute;
            z-index: 321;
            display: grid;
            gap: 2px;
            min-width: 190px;
            background: var(--paper-strong);
            border: 1px solid rgba(143, 247, 234, 0.2);
            border-radius: 10px;
            padding: 6px;
            box-shadow: 0 10px 22px rgba(0,0,0,0.32);
            top: calc(100% + 6px);
            left: 0;
            transform: none;
        }
        .doc-method-menu[hidden] { display: none !important; }
        .doc-method-item {
            border: 1px solid rgba(143, 247, 234, 0.16);
            background: var(--paper-strong);
            color: rgba(236,246,255,0.96);
            border-radius: 8px;
            padding: 6px 10px;
            text-align: left;
            font-size: 0.74rem;
            cursor: pointer;
            position: relative;
            display: grid;
            grid-template-columns: 14px minmax(0, 1fr);
            align-items: center;
            gap: 8px;
        }
        .doc-method-check {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 14px;
            min-width: 14px;
            color: rgba(236,246,255,0.94);
            opacity: 0;
            font-weight: 700;
        }
        .doc-method-item.is-selected .doc-method-check {
            opacity: 1;
        }
        .doc-method-item:hover {
            background: var(--paper-strong);
            border-color: rgba(143, 247, 234, 0.3);
        }
        .doc-action-bar {
            position: absolute;
            z-index: 320;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 3px;
            background: var(--paper-strong);
            border: 1px solid rgba(143,247,234,0.22);
            border-radius: 10px;
            padding: 4px 6px;
            box-shadow: 0 4px 18px rgba(0,0,0,0.55);
            top: 4px;
            left: calc(100% + 2px);
            transform: none;
        }
        .doc-action-bar[hidden] { display: none !important; }
        .doc-more-btn {
            background: var(--paper-strong);
            border: 1px solid rgba(143,247,234,0.2);
            color: rgba(236,246,255,0.86);
            font-size: 1.1rem;
            line-height: 1;
            padding: 2px 5px;
            border-radius: 6px;
            cursor: pointer;
        }
        .doc-more-btn:hover {
            color: var(--accent-deep);
            background: var(--paper-strong);
            border-color: rgba(143,247,234,0.34);
        }
        .doc-act-btn {
            background: var(--paper-strong);
            border: 1px solid rgba(143,247,234,0.2);
            color: rgba(236,246,255,0.86);
            font-size: 0.9rem;
            width: 28px;
            height: 28px;
            border-radius: 7px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
        }
        .doc-act-btn:hover {
            background: var(--paper-strong);
            color: var(--accent-deep);
            border-color: rgba(105,244,207,0.4);
        }
        .doc-act-delete:hover { color: #ff6b6b; border-color: rgba(255,107,107,0.4); }
        .document-link {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 8px;
            padding: 0;
            border-radius: 0;
            text-decoration: none;
            color: var(--ink);
            flex: 1;
            min-width: 0;
        }
        .document-link:hover {
            color: var(--accent-deep);
        }
        .document-link-disabled {
            cursor: default;
            opacity: 0.72;
        }
        .document-filename {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: normal;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            line-height: 1.15;
            max-height: 2.35em;
        }
        .tiny-tag { padding: 4px 8px; font-size: 0.72rem; }
        .quick-preview-card {
            margin-top: 12px;
            border: 1px solid rgba(143, 247, 234, 0.10);
            border-radius: 18px;
            background: rgba(4, 10, 18, 0.84);
            padding: 12px;
            display: grid;
            gap: 10px;
        }
        .quick-preview-head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
        }
        .quick-preview-body {
            max-height: 240px;
            overflow: auto;
            border-radius: 14px;
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(143, 247, 234, 0.08);
            padding: 12px;
        }
        .quick-preview-body pre {
            margin: 0;
            white-space: pre-wrap;
            word-break: break-word;
            font-family: Consolas, "Cascadia Code", monospace;
            color: rgba(236, 246, 255, 0.90);
        }
        .tiny-icon-button {
            width: 34px;
            height: 34px;
            min-width: 34px;
            font-size: 0.94rem;
        }
        .overlay-upload-form {
            margin-top: 12px;
            grid-template-columns: 2fr 100px 1fr auto;
            align-items: center;
        }
        .disabled { opacity: 0.44; pointer-events: none; }
        .visually-hidden {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            border: 0;
        }
        [hidden] { display: none !important; }
        .profile-preview-strip { margin-bottom: 14px; }
        .profile-preview-card { margin-top: 0; }
        .document-manager-page { display: grid; gap: 16px; }
        .document-manager-layout {
            display: grid;
            grid-template-columns: minmax(260px, 360px) 1fr;
            gap: 16px;
            align-items: start;
        }
        .empty-preview { margin-top: 0; }
        .profile-document-workspace {
            margin-bottom: 0;
            display: flex;
            flex-direction: column;
            gap: 0;
            border-radius: 0 0 22px 22px;
            overflow: hidden;
        }
        /* ── Excel Ribbon ── */
        .xl-ribbon {
            display: flex;
            flex-wrap: nowrap;
            align-items: stretch;
            background: #ffffff;
            border: 1px solid rgba(17, 17, 17, 0.14);
            border-top: 1px solid rgba(17, 17, 17, 0.14);
            border-bottom: 1px solid rgba(17, 17, 17, 0.14);
            padding: 7px 8px 6px;
            gap: 2px;
            max-height: 82px;
            overflow-x: auto;
            overflow-y: hidden;
            scrollbar-width: thin;
        }
        .xl-ribbon-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
            align-items: flex-start;
            justify-content: center;
            padding: 4px 10px 5px;
            position: relative;
        }
        .xl-group-label {
            font-size: 0.64rem;
            color: #111111;
            text-align: center;
            width: 100%;
            margin-top: 1px;
            order: 99;
        }
        .xl-ribbon-sep {
            width: 1px;
            background: #111111;
            opacity: 0.22;
            margin: 4px 2px;
            align-self: stretch;
        }
        .xl-row {
            display: flex;
            gap: 4px;
            align-items: center;
        }
        .xl-btn {
            min-width: 28px;
            width: auto;
            height: 28px;
            padding: 0 8px;
            border-radius: 5px;
            border: 1px solid transparent;
            background: transparent;
            color: #111111;
            font-size: 0.82rem;
            box-shadow: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            white-space: nowrap;
        }
        .xl-btn:hover { background: #111111; border-color: #111111; color: #ffffff; transform: none; box-shadow: none; }
        .xl-btn.is-active { background: #111111; color: #ffffff; border-color: #111111; }
        .xl-btn-icon b, .xl-btn-icon i, .xl-btn-icon u, .xl-btn-icon s { font-size: 0.85rem; }
        .xl-select {
            height: 28px;
            padding: 0 8px;
            border-radius: 5px;
            border: 1px solid rgba(17, 17, 17, 0.18);
            background: #ffffff;
            color: #111111;
            font-size: 0.78rem;
        }
        .xl-font-name { min-width: 124px; }
        .xl-font-size { min-width: 58px; }
        .xl-num-format { min-width: 116px; }
        .xl-color-wrap { display: flex; align-items: center; }
        .xl-color-label {
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            gap: 1px;
            padding: 3px 5px;
            border-radius: 5px;
            border: 1px solid transparent;
        }
        .xl-color-label:hover { background: rgba(255,255,255,0.08); }
        .xl-color-label span { font-size: 0.82rem; line-height: 1; font-weight: 700; }
        .xl-color-input {
            width: 22px;
            height: 5px;
            padding: 0;
            border: none;
            border-radius: 2px;
            background: transparent;
            cursor: pointer;
        }
        /* ── Tab bar ── */
        .xl-tab-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            background: #ffffff;
            border: 1px solid rgba(17, 17, 17, 0.14);
            border-bottom: 0;
            border-radius: 8px 8px 0 0;
            padding: 4px 8px;
            min-height: 38px;
        }
        .xl-tab-strip {
            display: flex;
            gap: 4px;
            align-items: center;
            flex: 1;
            overflow-x: auto;
            overflow-y: visible;
            scrollbar-width: none;
        }
        .xl-tab-strip::-webkit-scrollbar { display: none; }
        .xl-tab-actions {
            display: flex;
            gap: 4px;
            align-items: center;
            flex-shrink: 0;
            position: relative;
        }
        .xl-doc-add-shell {
            position: relative;
        }
        .xl-add-tab-btn {
            font-size: 1.1rem;
            font-weight: 700;
            padding: 0 9px;
        }
        .xl-doc-add-dropdown {
            position: fixed;
            z-index: 300;
            background: rgba(6,16,28,0.97);
            border: 1px solid rgba(143,247,234,0.22);
            border-radius: 14px;
            padding: 8px 6px;
            width: 240px;
            max-height: 320px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 2px;
            box-shadow: 0 6px 28px rgba(0,0,0,0.55);
        }
        .xl-doc-add-search-row {
            padding: 0 4px 6px;
            border-bottom: 1px solid rgba(143,247,234,0.1);
            margin-bottom: 4px;
        }
        .xl-doc-add-search {
            width: 100%;
            background: rgba(255,255,255,0.05);
            border: 1px solid rgba(143,247,234,0.18);
            border-radius: 8px;
            padding: 5px 10px;
            color: var(--ink);
            font-size: 0.82rem;
            outline: none;
        }
        .xl-doc-add-search:focus { border-color: rgba(105,244,207,0.38); }
        .xl-doc-add-group-label {
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: rgba(143,247,234,0.5);
            padding: 6px 8px 2px;
        }
        .xl-doc-add-item {
            display: block;
            width: 100%;
            background: none;
            border: none;
            text-align: left;
            color: var(--ink);
            font-size: 0.82rem;
            padding: 6px 10px;
            border-radius: 8px;
            cursor: pointer;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .xl-doc-add-item:hover { background: rgba(105,244,207,0.10); color: var(--accent-deep); }
        .xl-doc-add-item.is-recent { font-weight: 600; }
        .xl-doc-add-empty { padding: 10px; color: rgba(143,247,234,0.45); font-size: 0.8rem; text-align: center; }
        .xl-action-btn {
            min-width: 30px;
            height: 28px;
            padding: 0 8px;
            border-radius: 7px;
            border: 1px solid rgba(143,247,234,0.14);
            background: rgba(255,255,255,0.05);
            color: var(--ink);
            font-size: 0.88rem;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            text-decoration: none;
            box-shadow: none;
        }
        .xl-action-btn:hover { background: rgba(61,217,197,0.12); transform: none; box-shadow: none; }
        .xl-action-btn.is-active { background: rgba(61,217,197,0.18); color: var(--accent-deep); }
        .xl-search-shell {
            position: relative;
            display: inline-flex;
            align-items: center;
            width: auto;
            flex: 0 0 auto;
        }
        /* Tab items */
        .profile-document-tab {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 22px;
            align-items: center;
            gap: 4px;
            padding: 5px 6px 5px 10px;
            border-radius: 8px;
            border: 1px solid transparent;
            background: transparent;
            max-width: 160px;
            min-width: 90px;
            flex-shrink: 0;
        }
        .profile-document-tab.is-active {
            border-color: rgba(105, 244, 207, 0.22);
            background: rgba(61, 217, 197, 0.10);
        }
        .profile-document-tab-button,
        .profile-document-tab-close {
            width: auto; min-width: 0; padding: 0; border: 0;
            background: transparent; color: inherit; box-shadow: none; text-align: left;
        }
        .profile-document-tab-button:hover, .profile-document-tab-close:hover { transform: none; box-shadow: none; }
        .profile-document-tab-button { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.80rem; color: rgba(236,246,255,0.75); }
        .profile-document-tab.is-active .profile-document-tab-button { color: var(--accent-deep); }
        .profile-document-tab-close { display: grid; place-items: center; height: 22px; border-radius: 999px; font-size: 0.82rem; color: rgba(236,246,255,0.45); }
        .profile-document-tab-close:hover { color: #ffffff; }
        /* ── Sheet shell ── */
        .xl-doc-search-bar {
            display: flex;
            align-items: center;
            gap: 8px;
            position: absolute;
            top: calc(100% + 7px);
            right: 0;
            z-index: 320;
            width: min(360px, calc(100vw - 32px));
            padding: 8px;
            background: #ffffff;
            border: 1px solid rgba(17, 17, 17, 0.14);
            border-radius: 8px;
            box-shadow: 0 14px 28px rgba(17, 24, 39, 0.16);
        }
        .xl-doc-search-bar[hidden] { display: none !important; }
        .xl-doc-search-input {
            flex: 1;
            padding: 6px 12px;
            border: 1px solid rgba(17, 17, 17, 0.16);
            border-radius: 6px;
            font-size: 0.92rem;
            background: #fff;
            color: #111;
            outline: none;
        }
        .xl-doc-search-input:focus { border-color: rgba(17, 17, 17, 0.34); box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.18); }
        .xl-doc-search-count { font-size: 0.82rem; color: #111111; white-space: nowrap; }
        .xl-doc-search-close {
            display: grid;
            place-items: center;
            width: 24px;
            height: 24px;
            min-width: 24px;
            padding: 0;
            border: 1px solid rgba(17, 17, 17, 0.14);
            border-radius: 999px;
            background: #ffffff;
            color: #111111;
            font-size: 1rem;
            line-height: 1;
            box-shadow: none;
        }
        .xl-doc-search-close:hover { background: rgba(17, 17, 17, 0.06); transform: none; box-shadow: none; }
        tr.xl-search-hidden { display: none; }
        .xl-sheet-shell {
            position: relative;
            min-height: min(70vh, 800px);
            padding-bottom: 70px;
            overflow: auto;
            background:
                linear-gradient(180deg, rgba(4, 11, 18, 0.94), rgba(4, 11, 18, 0.94)),
                linear-gradient(90deg, rgba(61, 217, 197, 0.04), transparent 26%);
        }
        .profile-shell .xl-sheet-shell {
            background: #fff;
        }
        .xl-sheet-scroll { overflow: auto; }
        .xl-sheet {
            min-width: 100%;
            border-collapse: collapse;
            table-layout: fixed;
            margin: 0;
            font-family: "Times New Roman", Times, serif;
        }
        .xl-sheet thead th {
            position: sticky;
            top: 0;
            z-index: 1;
            background: rgba(6, 14, 23, 0.98);
            color: var(--accent-deep);
            font-size: 0.80rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }
        .xl-sheet th,
        .xl-sheet td {
            min-width: 120px;
            height: 40px;
            border: 1px solid rgba(143, 247, 234, 0.08);
            padding: 8px 10px;
            vertical-align: middle;
        }
        .xl-sheet td {
            color: rgba(236, 246, 255, 0.90);
            background: rgba(255,255,255,0.02);
            white-space: pre-wrap;
            word-break: break-word;
        }
        .xl-sheet td.is-editing {
            background: rgba(61, 217, 197, 0.06);
        }
        .xl-sheet td:focus {
            outline: 0;
            box-shadow: inset 0 0 0 2px rgba(105, 244, 207, 0.32);
            background: rgba(61, 217, 197, 0.10);
        }
        .profile-document-save-form { display: block; }
        .xl-save-fab {
            position: absolute;
            right: 18px;
            bottom: 18px;
            width: 52px; height: 52px; min-width: 52px;
            padding: 0;
            border-radius: 16px;
            box-shadow: 0 16px 30px rgba(0,0,0,0.28);
        }
        .sheet-table {
            table-layout: fixed;
            font-size: calc(0.96rem * var(--sheet-scale, 1));
            background: rgba(5, 12, 20, 0.46);
            border: 1px solid rgba(143, 247, 234, 0.12);
        }
        .sheet-table thead th {
            position: sticky;
            top: 0;
            z-index: 1;
            background: rgba(4, 12, 20, 0.96);
            color: var(--accent-deep);
        }
        .sheet-table th, .sheet-table td {
            padding: calc(12px * var(--sheet-scale, 1)) calc(10px * var(--sheet-scale, 1));
            border: 1px solid rgba(143, 247, 234, 0.08);
            vertical-align: middle;
            min-width: 120px;
        }
        .sheet-group-row td {
            background: rgba(61, 217, 197, 0.10);
            color: var(--accent-deep);
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }
        /* dropdowns in title-doc-actions open to the right */
        .title-doc-actions .compact-panel { right: auto; left: 0; }
        .export-form {
            display: grid;
            gap: 10px;
            min-width: 240px;
        }
        form { display: grid; gap: 10px; }
        .stack { margin-top: 12px; }
        .inline-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }
        input, select, textarea, button {
            width: 100%;
            padding: 12px 14px;
            border-radius: 14px;
            border: 1px solid rgba(143, 247, 234, 0.10);
            background: rgba(255,255,255,0.05);
            color: var(--ink);
            font: inherit;
        }
        textarea { min-height: 84px; resize: vertical; }
        input:focus, select:focus, textarea:focus {
            outline: 2px solid rgba(61, 217, 197, 0.18);
            border-color: rgba(143, 247, 234, 0.34);
        }
        button {
            background: linear-gradient(135deg, rgba(61,217,197,0.96), rgba(82,145,255,0.82));
            color: #02141a;
            font-weight: 600;
            cursor: pointer;
            transition: transform 120ms ease, box-shadow 120ms ease;
        }
        button:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(61, 217, 197, 0.18); }
        button.secondary { background: linear-gradient(135deg, #ffb25b, #ff8f66); color: #101827; max-width: 220px; }
        button.compact { width: auto; min-width: 132px; }
        button.ghost {
            background: rgba(61, 217, 197, 0.10);
            color: var(--accent-deep);
            border: 1px solid rgba(61, 217, 197, 0.16);
            box-shadow: none;
        }
        button.strong-ghost { background: rgba(17, 72, 63, 0.12); }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 12px;
        }
        th, td {
            text-align: left;
            padding: 12px 10px;
            border-bottom: 1px solid var(--line);
            vertical-align: top;
        }
        .ok { color: var(--accent); font-weight: 700; }
        .error { color: #b91c1c; font-weight: 700; }
        .compact-login {
            width: min(332px, calc(100vw - 40px));
            padding: 0;
            display: grid;
            gap: 10px;
        }
        .login-card {
            background: #ffffff;
            border: 0;
            box-shadow: none;
            backdrop-filter: none;
            transition: border-color 160ms ease, box-shadow 160ms ease;
        }
        .login-error-flash {
            animation: login-error-pulse 0.5s ease;
        }
        .login-field {
            display: grid;
            grid-template-columns: 1fr;
            align-items: center;
            gap: 8px;
            min-height: 54px;
            padding: 0;
            border: 0;
            background: transparent;
            box-shadow: none;
        }
        .login-field input {
            min-height: 54px;
            width: 100%;
            border-radius: 8px;
            border: 2px solid #111111;
            background: #ffffff;
            padding: 0 16px;
            outline: none;
            box-shadow: none;
            color: #111111;
            caret-color: #111111;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
        }
        .login-field input::placeholder { color: #4b5563; }
        .login-field input:focus {
            outline: none;
            border-color: #111111;
            box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.10);
        }
        .login-field input:-webkit-autofill,
        .login-field input:-webkit-autofill:hover,
        .login-field input:-webkit-autofill:focus,
        .login-field input:-webkit-autofill:active {
            -webkit-text-fill-color: #111111 !important;
            caret-color: #111111;
            border: 1.5px solid #111111 !important;
            -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
            box-shadow: 0 0 0 1000px #ffffff inset !important;
            transition: background-color 9999s ease-out 0s;
        }
        .login-field-icon {
            display: grid;
            place-items: center;
            width: 30px;
            height: 30px;
            border-radius: 999px;
            color: var(--accent-deep);
            background: rgba(61, 217, 197, 0.08);
            border: 1px solid rgba(61, 217, 197, 0.12);
        }
        .login-submit {
            width: 52px;
            height: 52px;
            justify-self: center;
            border-radius: 8px;
            padding: 0;
            display: grid;
            place-items: center;
            color: #111111;
            background: #ffffff;
            border: 2px solid #111111;
            box-shadow: none;
            transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
        }
        .login-submit:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 8px 18px rgba(17, 17, 17, 0.10);
            filter: none;
        }
        .login-submit:disabled {
            opacity: 0.56;
            cursor: not-allowed;
        }
        .login-submit-icon {
            width: 28px;
            height: 28px;
            overflow: visible;
        }
        .login-submit-bracket {
            fill: none;
            stroke: currentColor;
            stroke-width: 4.2;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        .login-submit-arrow-shaft,
        .login-submit-arrow-head {
            fill: none;
            stroke: currentColor;
            stroke-width: 4.2;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        .login-submit-arrow-head {
            stroke-width: 4.6;
        }
        .login-wait-message {
            margin: 0;
            text-align: center;
            color: #ffb25b;
            font-weight: 700;
            letter-spacing: 0.04em;
        }
        @keyframes login-error-pulse {
            0% { border-color: rgba(255, 89, 89, 0.14); box-shadow: var(--shadow); }
            45% { border-color: rgba(255, 89, 89, 0.98); box-shadow: 0 0 0 1px rgba(255, 89, 89, 0.96), 0 0 28px rgba(255, 89, 89, 0.24); }
            100% { border-color: rgba(255, 89, 89, 0.14); box-shadow: var(--shadow); }
        }
        @media (max-width: 720px) {
            .inline-grid { grid-template-columns: 1fr; }
            .details { grid-template-columns: 1fr; }
            .shell, .login-shell, .command-shell { padding: 16px; }
            .graph-stage, .graph-card, .tree-canvas { min-height: calc(100vh - 32px); }
            .floating-controls { top: 14px; right: 14px; }
            .org-svg { min-height: 56vh; }
            .profile-corners, .sheet-head, .sheet-title-row, .profile-right-tools { flex-direction: column; align-items: stretch; }
            .overlay-panel { inset: 82px 12px 12px 12px; }
            .overlay-upload-form, .crypto-grid, .document-manager-layout { grid-template-columns: 1fr; }
            .top-control-row, .nav-rail-row, .doc-rail-row { flex-wrap: wrap; }
        }
        .login-locked {
            display: flex;
            justify-content: center;
            margin: 24px auto 0;
        }
        .login-countdown {
            font-size: 1.4rem;
            font-weight: 800;
            letter-spacing: 2px;
            color: #8c1109;
            font-family: ui-monospace, monospace;
        }
        body[data-panel-root="login"] .login-card[hidden] { display: none !important; }
    