.layout{display:flex;min-height:100vh}
.sidebar{position:sticky;top:0;z-index:40;width:218px;height:100vh;flex:0 0 218px;display:flex;flex-direction:column;background:var(--surface);border-right:1px solid var(--line);padding:18px 0 12px}
.sidebar .sb-brand{display:flex;align-items:center;gap:10px;flex:0 0 auto;padding:0 20px 18px;font-size:15px;font-weight:700;letter-spacing:-.01em}
.sidebar .sb-brand .dot{width:24px;height:24px;border-radius:7px;display:grid;place-items:center;background:linear-gradient(135deg,var(--accent),var(--accent-deep));color:#fff;font-size:12px;font-weight:800}
.sidebar .nav{min-height:0;flex:1 1 auto;display:flex;flex-direction:column;gap:2px;overflow-y:auto;padding:8px 12px}
.sidebar .nav a{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:9px;color:var(--ink-soft);font-size:14px;font-weight:500;transition:.12s}
.sidebar .nav a:hover{background:var(--surface-2);color:var(--ink)}
.sidebar .nav a.active{background:var(--accent-soft);color:var(--accent-deep);font-weight:600}
.sidebar .nav a .ico{width:18px;text-align:center;opacity:.8}
.portal-nav-separator{height:1px;flex:0 0 auto;background:var(--line);margin:10px 8px}
.main{min-width:0;flex:1 1 auto;display:flex;flex-direction:column}

.sidebar-account-wrap{position:relative;flex:0 0 auto;border-top:1px solid var(--line);padding:12px 12px 0}
.sidebar-account{position:relative}
.sidebar-account>summary{display:flex;align-items:center;gap:9px;width:100%;min-height:48px;padding:7px 8px;border-radius:10px;cursor:pointer;list-style:none;transition:.15s}
.sidebar-account>summary::-webkit-details-marker{display:none}
.sidebar-account>summary:hover,.sidebar-account[open]>summary{background:var(--surface-2)}
.sidebar-account-avatar{width:32px;height:32px;flex:0 0 32px;display:grid;place-items:center;border-radius:50%;background:var(--accent-soft);color:var(--accent-deep);font-size:13px;font-weight:750}
.sidebar-account-copy{min-width:0;display:grid;line-height:1.25}.sidebar-account-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;color:var(--ink)}.sidebar-account-copy small{font-size:11px;color:var(--muted);margin-top:3px}
.sidebar-account-more{margin-left:auto;color:var(--muted);font-weight:700}
.sidebar-account-menu{position:absolute;left:0;bottom:calc(100% + 8px);z-index:90;width:194px;padding:8px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 16px 38px rgba(15,27,45,.16)}
.sidebar-account-meta{display:grid;gap:2px;padding:8px 10px 10px;border-bottom:1px solid var(--line);margin-bottom:5px}.sidebar-account-meta strong{font-size:13px}.sidebar-account-meta span{font-size:11px;color:var(--muted);line-height:1.4}
.sidebar-account-menu a,.sidebar-account-menu button{display:flex;align-items:center;width:100%;min-height:36px;padding:7px 10px;border:0;border-radius:8px;background:transparent;color:var(--ink-soft);font:600 13px var(--font);cursor:pointer;text-align:left}
.sidebar-account-menu a:hover,.sidebar-account-menu button:hover{background:var(--surface-2);color:var(--accent)}

.portal-global-header{position:sticky;top:0;z-index:60;width:100%;background:rgba(255,255,255,.97);border-bottom:1px solid var(--line);box-shadow:0 2px 10px rgba(15,27,45,.035);backdrop-filter:saturate(140%) blur(8px);overflow:visible}
.portal-global-header-inner{width:100%;padding:9px 24px;overflow:visible}
.portal-global-header--context{min-height:62px;display:flex;align-items:center}.portal-global-header--context .portal-global-header-inner{display:flex;align-items:center}
.portal-global-header form{width:100%;overflow:visible}
.global-scope-controls{display:flex;align-items:center;gap:8px;min-height:44px;overflow:visible}
.scope-project,.scope-control{height:42px;display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:9px;background:#fff;padding:0 11px;transition:.15s}
.scope-project{min-width:190px;max-width:245px}.scope-project>span,.scope-control>span{flex:0 0 auto;color:var(--muted);font-size:11px;font-weight:650;white-space:nowrap}.scope-project>strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-soft);font-size:13px}
.proj-select{min-width:0!important;max-width:190px;height:34px!important;padding:0 25px 0 0!important;border:0!important;border-radius:0!important;background-color:transparent!important;color:var(--ink-soft)!important;font:650 13px var(--font)!important;box-shadow:none!important;outline:0;cursor:pointer}
.scope-control{cursor:pointer;list-style:none}.scope-control::-webkit-details-marker{display:none}.scope-control:hover,.scope-control:focus-visible,.scope-menu[open]>.scope-control,.scope-select:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(14,116,144,.09);outline:0}
.scope-control b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-soft);font-size:12.5px;font-weight:680}
.scope-control i{min-width:20px;height:20px;display:grid;place-items:center;border-radius:10px;background:var(--accent);color:#fff;font-size:11px;font-style:normal}
.scope-menu{position:relative;flex:0 0 auto}
.scope-period-trigger{min-width:230px;max-width:275px}.scope-period-trigger svg{width:16px;height:16px;flex:0 0 16px;fill:none;stroke:currentColor;stroke-width:1.8;color:var(--muted)}
.scope-platform-popover{width:290px}
.scope-select{min-width:180px;cursor:default}.scope-select select{min-width:0!important;max-width:150px;border:0!important;padding:0!important;background:transparent!important;color:var(--ink-soft)!important;font:650 12.5px var(--font)!important;outline:0;cursor:pointer}
.scope-more>.scope-control{min-width:105px;justify-content:center}
.scope-result-count{margin-left:auto;flex:0 0 auto;color:var(--muted);font-size:12px;white-space:nowrap}.scope-result-count b{color:var(--ink-soft)}

.scope-popover{position:absolute;left:0;top:calc(100% + 8px);z-index:90;width:280px;max-height:min(480px,calc(100vh - 92px));overflow:auto;padding:14px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 18px 42px rgba(15,27,45,.17)}
.scope-popover[hidden]{display:none!important}
.scope-popover-actions{display:flex;justify-content:flex-end;gap:6px;margin-bottom:10px}
.scope-popover-actions button,.scope-shortcuts button,.scope-button-secondary,.scope-button-primary{min-height:32px;border:1px solid var(--line);border-radius:8px;padding:6px 10px;background:var(--surface-2);color:var(--ink-soft);font:600 12px var(--font);cursor:pointer}
.scope-popover-actions button:hover,.scope-shortcuts button:hover,.scope-button-secondary:hover{border-color:var(--accent);color:var(--accent)}
.scope-button-primary{border-color:var(--accent);background:var(--accent);color:#fff}.scope-button-primary:hover{background:var(--accent-deep)}
.scope-popover-footer{display:flex;justify-content:flex-end;align-items:center;gap:8px;border-top:1px solid var(--line);padding-top:12px;margin-top:13px}
.scope-check-list{display:grid;gap:7px}.scope-check-list label,.scope-more-popover>fieldset>label{display:flex;align-items:center;gap:8px;color:var(--ink-soft);font-size:13px;cursor:pointer}.scope-check-list input,.scope-more-popover input{accent-color:var(--accent)}
.scope-more-popover{right:0;left:auto;width:min(620px,calc(100vw - 250px));display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.scope-more-popover fieldset{min-width:0;border:0;border-bottom:1px solid var(--line);padding:0 0 14px}.scope-more-popover legend{color:var(--ink);font-size:13px;font-weight:700;margin-bottom:8px}
.scope-more-footer{grid-column:1/-1;display:grid;grid-template-columns:auto 1fr auto auto}.scope-more-footer>span{display:block}

.scope-date-popover{width:min(690px,calc(100vw - 250px));max-height:min(650px,calc(100vh - 92px));overflow:auto;padding:16px}
.scope-popover-align-right .scope-date-popover{right:0;left:auto}

.scope-chips{display:flex;align-items:center;gap:7px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:7px;margin-top:7px}.scope-chip{display:inline-flex;align-items:center;gap:5px;border-radius:14px;background:var(--accent-soft);color:var(--accent-deep);font-size:11.5px;font-weight:600;padding:3px 8px}.scope-chip:hover{filter:brightness(.96)}

.portal-section-header{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:18px}.portal-section-header h1{font-size:24px;letter-spacing:-.025em;line-height:1.25}.portal-section-header p{color:var(--muted);font-size:13.5px;margin-top:5px}
.shared-empty-state{text-align:center;padding:46px 20px;color:var(--muted)}
.shared-quality-notice{border:1px solid #bae6fd;background:#f0f9ff;color:#075985;border-radius:10px;padding:11px 14px;margin-bottom:16px;font-size:13px}
.shared-status{display:inline-flex;border-radius:12px;padding:3px 8px;background:var(--neu-bg);color:var(--ink-soft);font-size:12px;font-weight:600}.shared-status.positive{background:var(--pos-bg);color:var(--pos)}.shared-status.warning{background:#fff7ed;color:#9a3412}.shared-status.danger{background:var(--neg-bg);color:var(--neg)}.shared-status.info{background:var(--accent-soft);color:var(--accent-deep)}
.portal-detail-header{background:linear-gradient(135deg,#f0f9fb,#fff);border:1px solid #cfe8ed;border-radius:14px;padding:20px 22px;margin-bottom:18px;box-shadow:var(--shadow)}.portal-detail-header>a{display:inline-flex;color:var(--accent);font-size:13px;font-weight:650;margin-bottom:14px}.portal-detail-header>a:hover{text-decoration:underline}.portal-detail-kicker{font-size:12px;color:var(--accent);font-weight:700;margin-bottom:6px}.portal-detail-header h2{font-size:24px;line-height:1.35}.portal-detail-header p{color:var(--muted);font-size:13px;line-height:1.6;margin-top:7px}

@media(max-width:1180px){.portal-global-header-inner{padding:9px 16px}.global-scope-controls{flex-wrap:wrap;overflow:visible}.scope-result-count{margin-left:0}.scope-project{min-width:175px}.scope-date-popover{width:min(690px,calc(100vw - 36px))}.scope-more-popover{width:min(620px,calc(100vw - 36px))}}
@media(max-width:820px){.layout{flex-direction:column}.sidebar{position:relative;width:100%;height:auto;flex:0 0 auto;display:grid;grid-template-columns:auto 1fr auto;align-items:center;padding:8px 10px;border-right:0;border-bottom:1px solid var(--line)}.sidebar .sb-brand{padding:0 12px 0 0}.sidebar .nav{flex-direction:row;overflow-x:auto;overflow-y:hidden;padding:0;white-space:nowrap}.sidebar .nav a{padding:8px 10px}.portal-nav-separator{width:1px;height:28px;margin:2px 7px}.sidebar-account-wrap{border:0;padding:0 0 0 8px}.sidebar-account-copy{display:none}.sidebar-account>summary{min-height:40px;padding:4px}.sidebar-account-more{display:none}.sidebar-account-menu{left:auto;right:0;bottom:auto;top:calc(100% + 8px)}.portal-global-header{top:0}.scope-date-popover{position:fixed;left:16px!important;right:16px!important;top:72px;width:auto}.scope-more-popover{position:fixed;left:16px!important;right:16px!important;top:72px;width:auto}}
@media(max-width:560px){.wrap{padding-left:16px!important;padding-right:16px!important}.portal-global-header-inner{padding:8px 10px}.scope-project{min-width:165px}.scope-period-trigger{min-width:210px}.scope-select{min-width:170px}.scope-popover:not(.scope-date-popover):not(.scope-more-popover){position:fixed;left:12px;right:12px;top:72px;width:auto}.portal-section-header{margin-bottom:14px}.portal-section-header h1{font-size:21px}}
