:root {
    color-scheme: dark;
    --bg:#0c0b11;
    --surface:#15141e;
    --line:#2b2839;
    --text:#f3effa;
    --muted:#b4adc3;
    --accent:#d6a8ff;
    --violet:#a05bea;
    --green:#91e0b0;
    --red:#ffc0cb;
    font:14px/1.5 Inter, system-ui, sans-serif;
}
* { box-sizing:border-box }
[hidden] { display:none!important }
body { margin:0; min-height:100vh; color:var(--text); background:var(--bg) }
h1,h2,h3,p,dl,dd { margin:0 }
p,dt { color:var(--muted) }
a { color:var(--accent); text-underline-offset:4px }
button,input,select {
    color:var(--text); background:#11101a; border:1px solid var(--line);
    border-radius:8px; font:inherit; min-height:44px; max-width:100%; padding:9px 13px;
}
button,select,summary { cursor:pointer }
button:hover { background:#231831; border-color:#684290 }
button:disabled { opacity:.6; cursor:wait }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px }
.primary { color:#fff; font-weight:700; background:linear-gradient(180deg,#8c42db,#6d27b8); border-color:#a260e5; box-shadow:inset 0 1px #ffffff30,0 5px 20px #7028bc30 }
.primary:hover { background:#8b43d7 }
.quiet { border-color:transparent; background:transparent; color:var(--accent) }
label { display:grid; gap:5px; margin:12px 0; max-width:420px; color:var(--muted) }
input { width:100%; min-width:0 }
.fields,.actions,.card-heading { display:flex; flex-wrap:wrap; align-items:center; gap:10px }
.card-heading { justify-content:space-between }
.screen-reader { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap }
.screen-reader:focus { position:static; width:auto; height:auto; margin:0 0 12px; clip-path:none }

.brand { display:flex; align-items:center; gap:12px }
.brand { gap:14px; letter-spacing:.01em; font-size:16px; font-weight:800; line-height:1.03; white-space:nowrap }
.brand small,.account small { display:block; color:var(--muted); font-size:11px; font-weight:500; letter-spacing:.03em; margin-top:3px }
.orbit { display:inline-block; position:relative; flex:none; width:26px; height:26px; border-radius:50%; background:linear-gradient(145deg,#dfa0ff 0%,#a657ef 50%,#5715b0 100%); box-shadow:0 0 20px #a45af044 }
.orbit::before { content:""; position:absolute; inset:32% -29%; border:2px solid #e6b0ff; border-radius:50%; transform:rotate(-35deg) }
.orbit::after { content:""; position:absolute; left:4%; right:3%; top:40%; height:24%; background:linear-gradient(180deg,transparent,#6d21b0 70%,transparent); border-radius:50%; transform:rotate(-35deg) }
.environment { padding:4px 9px; background:#20162b; color:#ddb8ff; border:1px solid #45315a; border-radius:6px; font-size:11px }
.account { gap:9px; white-space:nowrap; font-size:12px; font-weight:700 }
.avatar { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#362049; border:1px solid #5d3876; color:#ecd6ff }

.icon { display:inline-block; position:relative; width:16px; height:16px; flex:none; color:inherit }
.icon::before,.icon::after { content:""; position:absolute; box-sizing:border-box }
.ico-grid::before { left:2px; top:2px; width:5px; height:5px; border-radius:1px; background:currentColor; box-shadow:7px 0 currentColor,0 7px currentColor,7px 7px currentColor }
.ico-key::before { width:8px; height:8px; left:0; top:2px; border:1.6px solid; border-radius:50% }
.ico-key::after { width:9px; height:5px; left:7px; top:6px; border-top:1.6px solid; border-right:1.6px solid; border-radius:0 1px 0 0 }
.ico-org::before { top:0; left:6px; width:5px; height:5px; background:currentColor; border-radius:1px; box-shadow:-6px 11px currentColor,6px 11px currentColor }
.ico-org::after { left:2px; top:6px; width:13px; height:4px; border:1px solid; border-bottom:0; border-radius:2px 2px 0 0 }
.ico-shield::before { inset:1px 2px; border:1.6px solid; border-radius:3px 3px 7px 7px }
.ico-shield::after,.ico-check::after { left:5px; top:5px; width:6px; height:4px; border-left:1.5px solid; border-bottom:1.5px solid; transform:rotate(-45deg) }
.ico-check::before { inset:1px; border:1.5px solid; border-radius:4px }
.ico-log::before { inset:1px 2px; border:1.5px solid; border-radius:3px }
.ico-log::after { top:5px; left:5px; width:6px; height:1px; background:currentColor; box-shadow:0 3px currentColor,0 6px currentColor }
.ico-box::before { inset:1px; border:1.5px solid; border-radius:4px }
.ico-box::after { left:4px; right:4px; top:5px; height:1px; background:currentColor; box-shadow:0 5px currentColor }
.ico-lock::before { left:2px; right:2px; top:7px; bottom:1px; border:1.5px solid; border-radius:2px }
.ico-lock::after { top:1px; left:5px; right:5px; height:7px; border:1.5px solid; border-bottom:0; border-radius:5px 5px 0 0 }
.ico-menu::before { left:1px; top:3px; width:14px; height:1.5px; background:currentColor; box-shadow:0 4px currentColor,0 8px currentColor }

#status,#rotate-status { color:var(--accent); padding:10px 13px; background:#221631; border:1px solid #513664; border-radius:8px }
#status { margin:12px auto; width:calc(100% - 32px); max-width:1260px }
#rotate-status { margin-top:12px }
#status:empty,#rotate-status:empty { display:none }
.gate {
    display:grid; grid-template-columns:1fr 1fr; width:min(870px,calc(100% - 36px)); margin:clamp(26px,8vh,90px) auto;
    border:1px solid #352a45; border-radius:17px; overflow:hidden; background:#13121c; box-shadow:0 24px 85px #0007;
}
.gate-intro { overflow:hidden; position:relative; isolation:isolate; min-height:332px; display:flex; align-items:flex-start; justify-content:center; text-align:center; padding:44px 22px; background:radial-gradient(ellipse at 70% 0%,#241834,transparent 75%),#12101c }
.gate-copy { position:relative }
.gate-orbit { width:55px; height:55px; margin:3px 0 26px }
.gate-orbit::before { border-width:3px }
.gate-intro h1 { font-size:clamp(30px,4vw,40px); line-height:1.12; letter-spacing:-.05em }
.gate-intro p { margin-top:8px }
.gate-planet { position:absolute; z-index:-1; top:74%; left:-30%; width:160%; height:265px; transform:rotate(-12deg); border-radius:50%; border-top:2px solid #c989ff; box-shadow:0 -8px 40px #9853e779; background:radial-gradient(ellipse at 48% 0%,#5925a1,#221234 52%,#100e1b 72%) }
.gate-controls { padding:32px 29px; align-self:center }
.gate-controls section+section { margin-top:16px; padding-top:16px; border-top:1px solid var(--line) }
.gate-controls h2 { font-size:18px; letter-spacing:-.02em }
.gate-controls p { margin:6px 0 12px }
.gate-controls summary { color:var(--accent) }
.gate-signin { text-align:center }
.access-icon { display:grid; place-items:center; width:44px; height:44px; margin:0 auto 12px; background:#2d1d40; color:var(--accent); border:1px solid #51346a; border-radius:12px }
.gate-signin .actions { display:grid; gap:6px }
#login { display:flex; width:100%; align-items:center; justify-content:center; gap:9px }
#login span { margin-left:auto }
#login i { margin-right:auto }

.console {
    --rail:222px;
    display:grid; grid-template-columns:var(--rail) minmax(0,1fr); width:min(1390px,calc(100% - 40px));
    margin:20px auto; min-height:calc(100vh - 40px); border:1px solid #2e2c3c;
    border-radius:16px; overflow:clip; background:#0c0c14;
}
.sidebar {
    display:flex; flex-direction:column; background:linear-gradient(115deg,#11111c,#0e0e17);
    border-right:1px solid #22212e; padding:17px 12px;
}
.sidebar>.brand { padding:3px 9px 17px }
.sidebar .orbit { width:31px; height:31px; margin-left:4px }
.sidebar nav { display:grid; gap:3px; margin-top:6px }
.sidebar a,.sidebar button {
    display:flex; align-items:center; gap:12px; min-height:36px; border:1px solid transparent;
    border-radius:7px; padding:7px 11px; text-decoration:none; color:#dad6e5; background:transparent;
    font-size:13px; text-align:left;
}
.sidebar a .icon { color:#d7cfe4 }
.sidebar a:hover,.sidebar button:hover { background:#1e192a; color:var(--text) }
.sidebar .owner-home,.sidebar a[aria-current="page"]:not([href="#overview"]) {
    border-color:#68319b; background:linear-gradient(100deg,#5925a0,#2c1b48);
    color:#fff; box-shadow:inset 0 1px #e1b3ff26,0 3px 12px #190a2d;
}
.sidebar #menu-toggle { display:none }
.workspace { min-width:0; background:#0e0e16 }
.console-title {
    display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 21px;
    border-bottom:1px solid #252331; min-height:75px; background:linear-gradient(105deg,#15141e,#12111b);
}
.console-title h1 { font-size:clamp(24px,3vw,31px); font-weight:780; line-height:1.1; letter-spacing:-.037em }
.console-title p { margin-top:4px; font-size:13px }
.top-actions { display:flex; align-items:center; gap:9px; flex:none }
.icon-button { display:grid; place-items:center; width:38px; min-height:38px; padding:0; color:#e0d7ec; border:1px solid transparent; border-radius:8px; background:transparent }
.icon-button:hover { background:#241933; border-color:#514064 }
.account { position:relative; border-left:1px solid #2e2a39; margin-left:2px; padding-left:12px }
.account summary { display:flex; align-items:center; gap:8px; min-height:40px; list-style:none }
.account summary::-webkit-details-marker { display:none }
.account summary::after { content:""; width:6px; height:6px; border-right:1px solid; border-bottom:1px solid; transform:rotate(45deg); margin:0 2px 3px 3px }
.account small { margin-top:0 }
.account .avatar { width:35px; height:35px; background:linear-gradient(145deg,#a64feb,#6529ab); color:white }
.account-menu { position:absolute; z-index:3; right:0; top:calc(100% + 8px); width:175px; display:grid; gap:7px; padding:11px; background:#1b1726; border:1px solid #4a3a60; border-radius:9px; box-shadow:0 12px 34px #0009 }
.account-menu a { padding:5px }
#console-pages { padding:15px 20px 24px }
.page>h2 { margin-bottom:12px; font-size:22px; letter-spacing:-.027em }
.metrics,.dashboard-grid { display:grid; gap:12px; margin-bottom:13px }
.metrics { grid-template-columns:repeat(5,minmax(0,1fr)) }
.dashboard-grid { grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) }
.metric,.card { background:linear-gradient(155deg,#1e1e29,#171720 74%); border:1px solid #30303e; border-radius:12px; padding:14px; min-width:0; box-shadow:inset 0 1px #ffffff08,0 3px 10px #06060b44 }
.metric { display:grid; grid-template-columns:1fr; align-content:start; gap:3px; min-height:106px }
.metric-icon { display:grid; place-items:center; width:29px; height:25px; color:#d39aff; margin-bottom:4px }
.metric-icon .icon { transform:scale(1.25) }
.metric-security .metric-icon { color:#87e1aa }
.metric dt,.pairs dt { font-size:12px }
.metric dd { font-size:26px; font-weight:760; letter-spacing:-.04em; line-height:1.14; overflow-wrap:anywhere }
.metric small { color:var(--muted); font-size:10px; line-height:1.2 }
.metric dd[data-unavailable] { font-size:12px; letter-spacing:0; line-height:1.25; color:var(--muted) }
.chart { position:relative; min-height:108px; margin-top:8px }
.chart canvas { display:block; width:100%; height:108px }
.chart span { position:absolute; inset:0; display:grid; place-items:center; color:var(--muted); font-size:12px }
.activity-card p { font-size:12px; margin:3px 0 }
.products dt { color:var(--text); display:flex; align-items:center; gap:8px }
.products dt::before { content:""; width:21px; height:21px; flex:none; border:1px solid #614482; background:#36234d; border-radius:6px; box-shadow:inset 0 0 0 4px #251b37 }
.products dd { color:#dec4f4; border:1px solid #49365c; background:#291e38; border-radius:6px; padding:2px 6px; font-size:11px }
.security-list dd { color:var(--green) }
.quick-list { list-style:none; margin:8px 0 0; padding:0 }
.quick-list li+li { border-top:1px solid #30303d }
.quick-list a { display:grid; grid-template-columns:16px minmax(0,1fr) auto; align-items:center; gap:9px; padding:9px 0; color:#ece5f5; text-decoration:none; font-size:13px }
.quick-list a:hover { color:var(--accent) }
.quick-list .icon,.quick-list a span:last-child { color:#c496e5 }
#panel-search { color:var(--text); border:1px solid #543870; border-radius:12px; background:#1b1628; width:min(460px,calc(100% - 28px)); padding:18px; max-height:80vh }
#panel-search::backdrop { background:#06040cbb }
#search-input { margin-top:12px }
.search-close { float:right; min-height:33px; padding:4px 10px }
#search-results a { display:block; padding:2px 0 }
.card+.card { margin-top:12px }
.dashboard-grid .card { margin:0 }
.card h3 { display:flex; align-items:center; gap:8px; font-size:15px; letter-spacing:-.015em }
.card h3 .icon { color:var(--accent) }
.card p { margin:7px 0 11px }
.card h3+button { margin-top:12px }
.card-heading a,.secondary-link { font-size:12px }
.card-heading label { margin:0 }
.pairs { margin:7px 0 }
.pairs>div { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:4px 12px; padding:10px 0; border-bottom:1px solid var(--line) }
.pairs dd { margin:0; font-size:13px; font-weight:650; overflow-wrap:anywhere }
.items,.roles,.tags { list-style:none; padding:0; margin:8px 0 0 }
.items li { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:7px 12px; padding:9px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere }
.items li:last-child,.pairs>div:last-child { border-bottom:0 }
.activity small { display:block; color:var(--muted); margin-top:2px }
.activity .outcome { padding:3px 7px; border:1px solid #453750; background:#242131; border-radius:5px; font-size:11px }
.activity .outcome[data-result="allow"] { color:var(--green); border-color:#2d4a3e; background:#192a25 }
.activity .outcome[data-result="deny"],.activity .outcome[data-result="error"] { color:var(--red); border-color:#563746; background:#30202c }
.tags { display:flex; flex-wrap:wrap; gap:8px }
.roles { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(158px,100%),1fr)); gap:8px }
.tags li,.roles li { background:#15121e; border:1px solid var(--line); border-radius:8px; padding:8px 10px }
.roles li { display:flex; align-items:center; gap:9px; font-weight:650 }
.role-level { color:var(--accent); background:#2b1d3b; padding:3px 6px; border-radius:4px; font-size:11px }
.roles li:first-child { grid-column:1/-1; background:linear-gradient(100deg,#382053,#20162e); border-color:#694489 }
#owner-id,output { overflow-wrap:anywhere }
output { display:block; margin-top:10px; padding:12px; background:#100f18; border:1px solid var(--line); border-radius:7px }

@media(max-width:1020px) {
    .console { --rail:190px; width:calc(100% - 24px); margin:12px auto }
    .sidebar a,.sidebar button { font-size:12px; gap:9px }
    .metric,.card { padding:12px }
    .metrics,.dashboard-grid { gap:9px }
    #console-pages { padding-inline:12px }
}
@media(max-width:780px) {
    .metrics { grid-template-columns:repeat(3,minmax(0,1fr)) }
}
@media(max-width:670px) {
    .console { grid-template-columns:minmax(0,1fr); width:100%; min-height:100vh; margin:0; border:0; border-radius:0 }
    .sidebar { flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:space-between; padding:5px 10px; gap:4px; border-right:0; border-bottom:1px solid var(--line) }
    .sidebar>.brand { padding:6px 7px; font-size:11px; gap:9px }
    .sidebar .brand br { display:contents }
    .sidebar .brand .orbit { width:19px; height:19px }
    .sidebar .owner-home,.sidebar nav { display:none }
    .sidebar #menu-toggle { display:flex }
    .sidebar #menu-toggle[aria-expanded="true"]+nav { display:grid; order:3; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; padding:3px 0 6px; margin:0 }
    .console-title { padding:11px 12px; min-height:62px; gap:4px }
    .console-title h1 { font-size:21px }
    .console-title p { font-size:11px; line-height:1.3 }
    .top-actions { gap:2px }
    .account { padding-left:5px }
    .account-name { display:none }
    .account summary { gap:2px }
    .icon-button { width:32px }
    .account .avatar { width:29px; height:29px }
    #console-pages { padding:12px 10px 44px }
    .metrics { grid-template-columns:repeat(2,minmax(0,1fr)) }
    .dashboard-grid { grid-template-columns:1fr }
    .metric { min-height:88px }
    .metric-security { grid-column:1/-1; grid-template-columns:29px 1fr auto; align-items:center; min-height:auto; padding-block:8px; gap:0 8px }
    .metric-security .metric-icon { grid-row:1/3; margin:0 }
    .metric-security dd { grid-column:3; grid-row:1/3 }
    .metric-security small { grid-column:2 }
    .gate { grid-template-columns:1fr; margin:16px auto; width:calc(100% - 24px) }
    .gate-intro { min-height:183px; padding:24px 14px 27px }
    .gate-orbit { width:38px; height:38px; margin-bottom:15px }
    .gate-planet { top:85% }
    .gate-controls { padding:20px 16px }
}

.ico-home::before { left:3px; top:6px; width:10px; height:9px; border:1.5px solid; border-radius:1px }
.ico-home::after { left:3px; top:2px; width:10px; height:10px; border:1.5px solid; border-right:0; border-bottom:0; transform:rotate(45deg) }
.ico-user::before { left:5px; top:1px; width:6px; height:6px; border:1.5px solid; border-radius:50% }
.ico-user::after { left:2px; top:9px; width:12px; height:6px; border:1.5px solid; border-radius:6px 6px 2px 2px }
.ico-bars::before { left:2px; bottom:2px; width:2px; height:5px; background:currentColor; box-shadow:5px -2px currentColor,10px -4px currentColor }
.ico-bars::after { left:7px; bottom:2px; width:2px; height:2px; background:currentColor; box-shadow:5px 0 currentColor,5px -2px currentColor }
.ico-search::before { left:1px; top:1px; width:11px; height:11px; border:1.6px solid; border-radius:50% }
.ico-search::after { left:10px; top:10px; width:7px; height:1.7px; background:currentColor; transform:rotate(45deg); transform-origin:left }
.ico-bell::before { left:2px; right:2px; top:2px; bottom:4px; border:1.5px solid; border-radius:7px 7px 2px 2px }
.ico-bell::after { left:6px; bottom:1px; width:4px; height:1.5px; background:currentColor; border-radius:1px }
.gate-copy .brand { justify-content:center; text-align:left; margin-bottom:24px; font-size:20px }
.gate-copy .gate-orbit { margin:0 6px 0 0 }
