:root { --bg:#f6f7f9; --panel:#ffffff; --line:rgba(15,23,42,0.12); --muted:#64748b; --text:#0f172a; --green:#16a34a; --red:#ef4444; --accent:#ef4444; --accent2:#f59e0b; }
        * { box-sizing:border-box; }
        body { margin:0; min-height:100vh; color:var(--text); background:linear-gradient(180deg,#f7f8fb 0%,#eef2f7 100%); font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; }
        .container { width:min(1160px, calc(100% - 32px)); margin:0 auto; }
        .side-nav { position:fixed; left:16px; top:16px; bottom:16px; z-index:90; width:180px; padding:14px 12px; border:1px solid var(--line); border-radius:16px; background:rgba(255,255,255,0.92); box-shadow:0 18px 44px rgba(15,23,42,0.10); display:flex; flex-direction:column; gap:8px; }
        .side-brand { display:flex; align-items:center; gap:9px; padding:4px 4px 12px; margin-bottom:4px; border-bottom:1px solid rgba(15,23,42,0.10); color:#0f172a; font-size:0.95rem; font-weight:950; }
        .brand-mark { width:28px; height:28px; border-radius:10px; display:inline-grid; place-items:center; color:#fff7ed; background:linear-gradient(135deg,var(--accent),var(--accent2)); box-shadow:0 10px 22px rgba(239,68,68,0.18); font-size:0.82rem; font-weight:950; }
        .side-nav-link { display:flex; align-items:center; gap:9px; min-height:38px; padding:9px 10px; border-radius:12px; color:#475569; text-decoration:none; font-size:0.86rem; font-weight:850; transition:background 0.18s ease,color 0.18s ease,transform 0.18s ease; }
        .side-nav-link:hover { color:#0f172a; background:#f1f5f9; transform:translateX(2px); }
        .side-nav-link.active { color:#991b1b; background:rgba(239,68,68,0.10); box-shadow:inset 0 0 0 1px rgba(239,68,68,0.18); }
        .side-nav-icon { width:20px; text-align:center; font-size:0.98rem; }
        .status { display:inline-flex; align-items:center; width:max-content; padding:5px 9px; border-radius:999px; background:rgba(254,242,242,0.90); color:#991b1b; border:1px solid rgba(239,68,68,0.18); font-size:0.78rem; font-weight:850; }
        .hero { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; padding:26px 0 16px; }
        .hero-title { font-size:1.9rem; font-weight:950; margin:0 0 8px; letter-spacing:0; }
        .hero-copy { margin:0; color:var(--muted); line-height:1.7; max-width:700px; }
        .hero-chip { display:inline-flex; align-items:center; gap:7px; min-height:34px; padding:0 12px; border-radius:999px; border:1px solid rgba(239,68,68,0.18); background:rgba(255,255,255,0.82); color:#991b1b; font-size:0.8rem; font-weight:900; white-space:nowrap; box-shadow:0 10px 28px rgba(15,23,42,0.06); }
        .profile-shell { display:grid; gap:16px; padding:26px 0 36px; }
        .profile-panel { overflow:hidden; border:1px solid rgba(15,23,42,0.10); border-radius:18px; background:rgba(255,255,255,0.94); box-shadow:0 18px 44px rgba(15,23,42,0.09); }
        .profile-panel-head { position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:18px; align-items:center; padding:20px 22px; background:linear-gradient(135deg,rgba(254,242,242,0.92),rgba(255,251,235,0.70)); border-bottom:0; }
        .profile-panel-head::after { content:""; position:absolute; right:-92px; top:-122px; width:230px; height:230px; border-radius:50%; background:radial-gradient(circle,rgba(245,158,11,0.18),rgba(245,158,11,0)); pointer-events:none; }
        .account-main { position:relative; z-index:1; display:flex; align-items:center; gap:16px; min-width:0; }
        .avatar { width:68px; height:68px; border-radius:22px; display:grid; place-items:center; background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff7ed; font-size:1.6rem; font-weight:950; flex:0 0 auto; box-shadow:0 16px 34px rgba(239,68,68,0.22); }
        .account-name-line { display:flex; align-items:center; gap:9px; min-width:0; flex-wrap:wrap; }
        .account-name { max-width:min(560px, 58vw); font-size:1.32rem; font-weight:950; line-height:1.2; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .account-sub { color:#64748b; margin-top:6px; font-size:0.9rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .account-actions { position:relative; z-index:1; display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
        .account-actions .nav-button,
        .account-actions button { width:auto; min-width:112px; }
        .profile-tabs { display:flex; align-items:center; justify-content:flex-start; gap:4px; padding:10px 22px; border-bottom:1px solid rgba(15,23,42,0.08); background:linear-gradient(135deg,rgba(254,242,242,0.92),rgba(255,251,235,0.70)); }
        .profile-tab { width:auto; min-width:0; min-height:36px; padding:7px 14px; border:1px solid rgba(239,68,68,0.12); border-radius:9px; color:#7f1d1d; background:rgba(255,255,255,0.72); box-shadow:none; font-size:0.82rem; transition:color .18s ease,border-color .18s ease,background .18s ease,box-shadow .18s ease; }
        .profile-tab:hover { color:#991b1b; border-color:rgba(239,68,68,0.28); background:rgba(255,247,237,0.94); }
        .profile-tab.is-active { color:#fff; border-color:rgba(239,68,68,0.34); background:linear-gradient(135deg,var(--accent),var(--accent2)); box-shadow:0 6px 16px rgba(239,68,68,0.16); }
        .profile-panel-body { display:block; }
        .profile-view[hidden] { display:none !important; }
        .account-key-section { margin-top:22px; padding-top:20px; border-top:1px solid rgba(15,23,42,0.08); }
        .profile-section { padding:20px 22px 22px; min-width:0; }
        .section-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
        .section-title { margin:0; color:#0f172a; font-size:1rem; font-weight:950; }
        .section-sub { margin:4px 0 0; color:#64748b; font-size:0.78rem; line-height:1.45; }
        .info-grid { overflow:hidden; display:grid; grid-template-columns:1fr; border:1px solid rgba(15,23,42,0.08); border-radius:14px; background:#fff; }
        .info-tile { min-width:0; min-height:52px; padding:12px 14px; display:grid; grid-template-columns:132px minmax(0,1fr); align-items:center; gap:18px; border:0; border-bottom:1px solid rgba(15,23,42,0.07); border-radius:0; background:#fff; }
        .info-tile:last-child { border-bottom:0; }
        .info-tile-link { width:100%; appearance:none; font:inherit; color:inherit; text-align:left; cursor:pointer; transition:border-color .16s ease,background .16s ease; }
        .info-tile-link:hover { background:#f8fafc; }
        .info-tile-link:focus-visible { outline:2px solid rgba(100,116,139,0.20); outline-offset:2px; }
        .info-tile-link { grid-template-columns:132px minmax(0,1fr) 18px; }
        .info-tile-link::after { content:"›"; color:#94a3b8; font-size:1rem; font-weight:800; line-height:1; text-align:right; }
        .info-label { color:#0f172a; font-size:0.84rem; font-weight:850; line-height:1.35; }
        .info-value { margin-top:0; color:#0f172a; font-weight:850; font-size:0.84rem; line-height:1.35; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:right; }
        .info-value.muted { color:#94a3b8; font-weight:850; }
        .info-grid .info-value,
        .info-grid .info-value.muted { color:#0f172a; }
        .permission-section { border-top:1px solid rgba(15,23,42,0.08); background:#fff; }
        .permission-access-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:14px; }
        .permission-access-title { color:#0f172a; font-size:1rem; font-weight:950; }
        .permission-access-note { margin-top:4px; color:#64748b; font-size:0.76rem; }
        .permission-access-count { color:#991b1b; font-size:0.76rem; font-weight:900; }
        .permission-endpoint-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
        .permission-group { min-width:0; overflow:hidden; border:1px solid rgba(15,23,42,0.09); border-radius:13px; background:#f8fafc; }
        .permission-group-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; min-height:38px; padding:9px 11px; border-bottom:1px solid rgba(15,23,42,0.07); background:rgba(255,255,255,0.78); }
        .permission-group-name { display:flex; align-items:center; gap:7px; color:#334155; font-size:0.78rem; font-weight:950; }
        .permission-group-name::before { content:""; width:6px; height:6px; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent2)); box-shadow:0 0 0 3px rgba(239,68,68,0.08); }
        .permission-group-meta { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:7px; min-width:0; max-width:100%; }
        .permission-group-count { color:#94a3b8; font-size:0.68rem; font-weight:850; }
        .permission-group-expiry { color:#64748b; font-size:0.68rem; font-weight:850; white-space:nowrap; }
        .permission-group-expiry.expired { color:#b91c1c; }
        .permission-group-links { display:grid; padding:5px; }
        .permission-endpoint { display:grid; grid-template-columns:minmax(0,1fr) auto auto auto; align-items:center; gap:7px; min-height:34px; padding:7px 8px; border-radius:8px; color:#334155; text-decoration:none; font-size:0.75rem; font-weight:900; transition:color .16s ease,background .16s ease; }
        .permission-endpoint:hover { color:#991b1b; background:#fff1f2; }
        .permission-endpoint.expired { color:#94a3b8; background:rgba(248,250,252,0.78); }
        .permission-endpoint code { color:#94a3b8; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:0.66rem; font-weight:750; }
        .permission-endpoint-expiry { color:#64748b; font-size:0.66rem; font-weight:850; overflow-wrap:anywhere; }
        .permission-endpoint-expiry.expired { color:#b91c1c; }
        .permission-endpoint-arrow { color:#cbd5e1; font-size:0.78rem; }
        .permission-endpoint:hover .permission-endpoint-arrow { color:#ef4444; }
        .permission-endpoint-empty { color:#94a3b8; font-size:0.78rem; font-weight:800; }
        .phone-tile { display:grid; }
        .phone-value-row { display:flex; align-items:center; justify-content:flex-end; gap:8px; min-width:0; }
        .phone-value-row .info-value { margin-top:0; min-width:0; }
        .inline-action { width:auto; min-height:28px; padding:4px 9px; border-radius:999px; color:#b42318; border-color:rgba(239,68,68,0.25); background:#fff1f2; box-shadow:none; font-size:0.78rem; line-height:1.35; white-space:nowrap; }
        .inline-action:hover { background:#ffe4e6; }
        .inline-action.contact-edit-action { width:32px; min-width:32px; height:32px; min-height:32px; flex:0 0 32px; padding:0; border-radius:6px; color:#64748b; border-color:transparent; background:transparent; }
        .inline-action.contact-edit-action:hover { color:#b42318; border-color:rgba(239,68,68,0.25); background:#fff1f2; }
        .contact-edit-action:focus-visible { outline:2px solid #ef4444; outline-offset:2px; }
        .contact-edit-action svg { display:block; width:16px; height:16px; flex:0 0 16px; }
        .phone-bind-dialog { position:fixed; inset:0; z-index:200; display:none; place-items:center; padding:20px; background:rgba(15,23,42,0.42); backdrop-filter:blur(5px); }
        .phone-bind-dialog.is-open { display:grid; }
        .phone-bind-card { width:min(100%, 420px); padding:22px; border:1px solid rgba(15,23,42,0.12); border-radius:20px; background:#fffdfb; box-shadow:0 26px 80px rgba(15,23,42,0.24); }
        .phone-bind-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
        .phone-bind-title { margin:0; color:#0f172a; font-size:1.1rem; font-weight:950; }
        .phone-bind-copy { margin:5px 0 0; color:#64748b; font-size:0.82rem; line-height:1.5; }
        .dialog-close { width:32px; min-width:32px; height:32px; min-height:32px; padding:0; border-radius:50%; color:#64748b; background:#f8fafc; box-shadow:none; font-size:1.15rem; }
        .phone-bind-field { display:grid; gap:7px; margin-top:12px; }
        .phone-bind-label { color:#475569; font-size:0.78rem; font-weight:900; }
        .phone-bind-field input { width:100%; min-height:42px; padding:0 12px; border:1px solid rgba(15,23,42,0.14); border-radius:11px; color:#0f172a; background:#fff; font:inherit; outline:none; }
        .phone-bind-field input:focus { border-color:rgba(239,68,68,0.60); box-shadow:0 0 0 3px rgba(239,68,68,0.10); }
        .verify-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; }
        .verify-row button { width:auto; min-width:104px; padding:0 12px; color:#b42318; border-color:rgba(239,68,68,0.28); background:#fff1f2; }
        .verify-row button:disabled { cursor:not-allowed; color:#94a3b8; border-color:rgba(148,163,184,0.28); background:#f8fafc; }
        .phone-bind-status { min-height:20px; margin:12px 0 0; color:#64748b; font-size:0.78rem; line-height:1.5; }
        .phone-bind-status.error { color:#b42318; }
        .phone-bind-submit { margin-top:14px; color:#fff; border-color:#e5484d; background:linear-gradient(135deg,#ef4444,#f97316); }
        .phone-bind-submit:disabled { cursor:not-allowed; opacity:.62; }
        .password-card { max-height:calc(100dvh - 40px); overflow-y:auto; }
        .password-help { display:block; margin-top:12px; color:#b42318; font-size:.8rem; text-align:center; }
        .meta-label { color:var(--muted); font-size:0.74rem; font-weight:850; }
        .meta-value { margin-top:8px; color:#0f172a; font-size:1rem; font-weight:950; }
        .settings-list { border:1px solid rgba(15,23,42,0.08); border-radius:14px; background:#fff; overflow:hidden; }
        .setting-row { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:46px; padding:10px 12px; border-bottom:1px solid rgba(15,23,42,0.07); }
        .setting-row:last-child { border-bottom:0; }
        .setting-name { color:#64748b; font-size:0.84rem; font-weight:850; }
        .setting-value { color:#0f172a; font-size:0.88rem; font-weight:950; text-align:right; }
        .logout-area { display:flex; justify-content:flex-end; align-items:center; margin-top:14px; padding-top:12px; border-top:1px dashed rgba(15,23,42,0.12); }
        button, .nav-button { width:100%; border:1px solid rgba(15,23,42,0.12); border-radius:13px; padding:11px 14px; background:#f8fafc; color:#334155; font-weight:900; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:7px; }
        button:hover, .nav-button:hover { background:#e2e8f0; }
        .logout-link { width:auto; min-height:32px; padding:0 12px; border-radius:999px; border:1px solid rgba(239,68,68,0.24); color:#b91c1c; background:rgba(254,242,242,0.66); box-shadow:none; font-size:0.82rem; font-weight:900; }
        .logout-link:hover { background:rgba(254,226,226,0.86); border-color:rgba(239,68,68,0.34); }
        .secondary-action { color:#475569; background:#fff; }
        .api-key-toolbar { display:flex; gap:9px; align-items:center; flex-wrap:wrap; }
        .api-key-toolbar input { flex:1 1 220px; min-height:40px; padding:0 11px; border:1px solid rgba(15,23,42,0.14); border-radius:11px; font:inherit; outline:none; }
        .api-key-toolbar input:focus { border-color:rgba(239,68,68,0.60); box-shadow:0 0 0 3px rgba(239,68,68,0.10); }
        .api-key-toolbar button { width:auto; min-height:40px; padding:0 13px; color:#fff; border-color:#e5484d; background:linear-gradient(135deg,#ef4444,#f97316); }
        .api-key-list { display:grid; gap:9px; margin-top:14px; }
        .api-key-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:center; padding:12px; border:1px solid rgba(15,23,42,0.09); border-radius:13px; background:#f8fafc; }
        .api-key-row > div { min-width:0; }
        .api-key-name, .api-key-meta { overflow-wrap:anywhere; }
        .api-key-name { font-size:0.9rem; font-weight:950; }
        .api-key-meta { margin-top:5px; color:#64748b; font-size:0.75rem; line-height:1.45; }
        .api-key-value-row { display:flex; align-items:center; gap:8px; min-width:0; }
        .api-key-prefix { flex:1 1 auto; min-width:0; margin-top:6px; color:#334155; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:0.8rem; font-weight:800; overflow-wrap:anywhere; }
        .api-key-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; white-space:nowrap; }
        .api-key-state { padding:4px 8px; border-radius:999px; font-size:0.72rem; font-weight:900; background:#dcfce7; color:#166534; }
        .api-key-state.disabled { background:#fee2e2; color:#991b1b; }
        .api-key-actions button { width:auto; min-height:32px; padding:0 10px; font-size:0.76rem; }
        .api-key-actions .api-key-delete { color:#b42318; border-color:#f4b4ae; background:#fff7f6; }
        .api-key-copy-button { flex:0 0 30px; width:30px !important; min-height:30px !important; padding:0 !important; border-radius:8px; color:#475569; background:#fff; }
        .api-key-copy-button:hover { color:#0f172a; background:#e2e8f0; }
        .api-key-copy-button.copied { color:#166534; border-color:rgba(22,163,74,0.28); background:#dcfce7; }
        .api-key-copy-button svg { width:15px; height:15px; display:block; }
        .api-key-empty { padding:16px; border:1px dashed rgba(15,23,42,0.16); border-radius:12px; color:#64748b; font-size:0.84rem; text-align:center; }
        @media(min-width:1020px) { body { padding-left:212px; } }
        @media(max-width:1019px) {
            .hero { display:block; padding-top:18px; }
            .hero-chip { margin-top:12px; }
            .profile-panel-head { grid-template-columns:1fr; padding:18px; }
            .account-actions { justify-content:stretch; }
            .account-actions .nav-button,
            .account-actions button { width:auto; flex:1 1 120px; }
            .info-tile { grid-template-columns:94px minmax(0,1fr); gap:10px; padding:11px 12px; }
            .info-tile-link { grid-template-columns:94px minmax(0,1fr) 16px; }
            .permission-endpoint-list { grid-template-columns:1fr; }
            .profile-tabs { gap:3px; padding:8px 12px; overflow-x:auto; }
            .profile-tab { flex:0 0 auto; min-height:36px; padding:7px 11px; font-size:0.76rem; }
            .api-key-row { grid-template-columns:minmax(0,1fr); align-items:stretch; }
            .api-key-actions { justify-content:flex-start; }
        }
        .mobile-nav-toggle { display:none; }
        @media(max-width:1019px) {
            body { padding-left:0 !important; padding-top:0 !important; padding-bottom:calc(86px + env(safe-area-inset-bottom)) !important; }
            .mobile-nav-toggle { position:fixed; right:16px; bottom:calc(16px + env(safe-area-inset-bottom)); z-index:130; display:inline-flex; align-items:center; justify-content:center; gap:6px; min-width:76px; min-height:44px; padding:0 14px; border:1px solid rgba(16,185,129,0.28); border-radius:999px; color:#065f46; background:rgba(236,253,245,0.94); box-shadow:0 16px 40px rgba(15,23,42,0.18); font-size:0.86rem; font-weight:900; backdrop-filter:blur(14px); }
            .side-nav { display:none !important; position:fixed !important; left:auto !important; right:14px !important; top:auto !important; bottom:calc(72px + env(safe-area-inset-bottom)) !important; width:min(232px, calc(100vw - 28px)) !important; height:auto !important; max-height:min(70vh, 430px) !important; min-height:0 !important; flex-direction:column !important; align-items:stretch !important; justify-content:flex-start !important; gap:6px !important; overflow-y:auto !important; overflow-x:hidden !important; padding:10px !important; border-radius:18px !important; background:rgba(255,255,255,0.96) !important; box-shadow:0 22px 56px rgba(15,23,42,0.22) !important; backdrop-filter:blur(16px); }
            .side-nav.mobile-open { display:flex !important; }
            .side-nav .side-brand { display:flex !important; padding:4px 4px 10px !important; margin-bottom:4px !important; }
            .side-nav .side-nav-link { flex:0 0 auto !important; min-width:0 !important; min-height:40px !important; flex-direction:row !important; align-items:center !important; justify-content:flex-start !important; gap:9px !important; padding:9px 10px !important; border-radius:13px !important; font-size:0.86rem !important; line-height:1.2 !important; white-space:nowrap !important; }
            .side-nav .side-nav-icon { width:20px !important; font-size:0.98rem !important; }
        }
