/* Portal only: adjacent applications do not load this stylesheet. */
html { scroll-behavior:auto; background:var(--surface-canvas); }
body.portal { margin:0; padding:0; font-family:var(--font-sans); font-size:14px; line-height:1.55; text-align:left; background:var(--surface-canvas); color:var(--ink); }
.portal *, .portal *::before, .portal *::after { box-sizing:border-box; }
.portal [hidden] { display:none!important; }
.portal a { text-underline-offset:3px; }
.portal :is(a,button,input,select,textarea,summary,[role="button"],[tabindex="0"]):focus-visible { outline:2px solid var(--focus)!important; outline-offset:3px; }
.portal h1,.portal h2,.portal h3 { line-height:1.25; letter-spacing:-.025em; }
.portal h1 { font-size:clamp(24px,2.4vw,32px); }
.portal h2 { font-size:22px; }
.portal p { overflow-wrap:anywhere; }
.portal .page-wrapper { min-height:calc(100dvh - 160px); margin-left:var(--sidebar-width); padding:32px; }
.portal .page-wrapper-content { min-width:0; width:100%; max-width:1440px; margin-inline:auto; }
.portal .page-wrapper-content:focus { outline:none; }
.portal .footer { margin-left:var(--sidebar-width); padding:20px 32px; text-align:left; font-size:12px; background:var(--surface-canvas); }
.portal .footer hr { margin:0 0 16px; border:0; border-top:1px solid var(--border); }
.portal .footer p { margin:0; }
.portal-header { position:sticky; top:0; z-index:1100; height:var(--header-height); display:flex; align-items:center; gap:24px; padding:0 24px; background:var(--surface-canvas); border-bottom:1px solid var(--border); }
.portal-brand { width:200px; flex:none; display:flex; align-items:center; text-decoration:none; }
.portal-brand img { display:block; height:36px; width:auto; max-width:100%; object-fit:contain; }
.portal-logo--octo { background:#fff; border-radius:4px; padding:4px; }
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]) .portal-logo { filter:invert(1); }}
:root[data-theme="dark"] .portal-logo { filter:invert(1); }
.portal-header-title { display:flex; flex-direction:column; gap:2px; min-width:0; font-size:16px; font-weight:600; }
.portal-overline { font:11px/1.5 var(--font-mono); text-transform:uppercase; letter-spacing:.13em; color:var(--muted); }
.portal-header .header-utility { position:static; margin-left:auto; flex-direction:row; align-items:center; gap:16px; }
.portal-header .header-user-actions { max-width:320px; gap:12px; }
.portal-header .header-current-user { font-size:0; background:none; padding:0; box-shadow:none; }
.portal-header .username-highlight { background:none; padding:0; margin:0; font-size:13px; font-weight:500; max-width:180px; }
.portal-header .header-logout-button { min-height:40px; border-color:var(--input-border); border-radius:6px; padding:8px 12px; }
.portal-header .theme-toggle__button { display:grid; place-items:center; justify-content:center; gap:0; width:44px; height:44px; padding:0; margin:0; border-radius:8px; border:1px solid var(--input-border); background:var(--surface); color:var(--ink); box-shadow:none; }
.portal-header .theme-toggle__button:hover { background:var(--selected); }
.portal-header .theme-toggle__icon { grid-area:1 / 1; display:flex; width:22px; height:22px; opacity:1; color:inherit; }
.portal-header .theme-toggle__icon--dark { display:none; }
.portal-header .theme-toggle__button[data-mode="dark"] .theme-toggle__icon--dark { display:flex; }
.portal-header .theme-toggle__button[data-mode="dark"] .theme-toggle__icon--light { display:none; }
.portal-sidebar { position:fixed; left:0; top:var(--header-height); bottom:0; width:var(--sidebar-width); z-index:1200; background:#0B1929; color:#fff; display:flex; flex-direction:column; padding:24px 16px 16px; }
.sidebar-heading { display:flex; align-items:center; justify-content:space-between; min-height:32px; margin:0 12px 16px; }
.sidebar-heading .portal-overline { color:rgba(255,255,255,.68); }
.portal-nav { display:flex; flex-direction:column; gap:8px; overflow-y:auto; min-height:0; padding:4px; }
.portal-nav-link { display:flex; align-items:center; gap:12px; min-height:48px; padding:12px; color:rgba(255,255,255,.8)!important; text-decoration:none; border-radius:6px; border:1px solid transparent; font-weight:500; font-size:13px; }
.portal-nav-link:hover { background:#12202F; color:#fff!important; }
.portal-nav-link.active { background:#193C35; color:#fff!important; border-color:#538c7e; }
.portal-icon { flex:none; vertical-align:middle; width:20px; height:20px; }
.portal-nav-link > .portal-icon { width:22px; height:22px; }
.portal-sidebar :focus-visible { outline-color:#8ED8C4!important; }
.sidebar-bottom { margin-top:auto; padding:24px 4px 0; }
.sidebar-caption { display:block; color:rgba(255,255,255,.68); font:10px var(--font-mono); padding:12px; }
.sidebar-collapse { width:100%; display:flex; align-items:center; gap:12px; padding:12px; border:1px solid #536171; border-radius:6px; background:transparent; color:#fff; font:inherit; font-size:13px; cursor:pointer; }
.shell-icon-button { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; flex:none; border:1px solid var(--input-border); background:transparent; color:inherit; border-radius:6px; cursor:pointer; }
.mobile-menu-button,.mobile-nav-close { display:none; }
.skip-link { position:fixed; left:16px; top:-100px; z-index:3000; padding:12px 20px; background:var(--surface); color:var(--link); border:2px solid var(--focus); }
.skip-link:focus { top:12px; }
.portal--public .page-wrapper,.portal--public .footer { margin-left:0; }
.portal--public .portal-header-title { border-left:1px solid var(--border); padding-left:24px; }
@media(min-width:901px){
  :root[data-sidebar-collapsed="true"] { --sidebar-width:80px; }
  :root[data-sidebar-collapsed="true"] .portal-sidebar { padding-inline:8px; }
  :root[data-sidebar-collapsed="true"] .nav-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  :root[data-sidebar-collapsed="true"] .sidebar-heading,:root[data-sidebar-collapsed="true"] .sidebar-caption { display:none; }
  :root[data-sidebar-collapsed="true"] .portal-nav-link { justify-content:center; padding:12px 8px; }
  :root[data-sidebar-collapsed="true"] .sidebar-collapse { justify-content:center; padding:12px 8px; }
  :root[data-sidebar-collapsed="true"] .sidebar-collapse svg { transform:rotate(180deg); }
}
@media(max-width:1100px){
  .portal .page-wrapper { padding:24px; }
  .portal-header .username-highlight { max-width:110px; }
  .portal-header { gap:16px; }
}
@media(max-width:900px){
  :root { --header-height:72px; }
  .portal .page-wrapper { margin-left:0; padding:24px 20px; }
  .portal .footer { margin-left:0; padding:20px; }
  .portal-header { padding-inline:16px; gap:12px; }
  .portal-brand { width:auto; }
  .portal-brand img { height:32px; }
  .portal-header-title { display:none; }
  .portal-header .header-utility { gap:12px; }
  .portal-header .header-current-user { display:none; }
  .portal-sidebar { position:static; width:100%; padding:12px 16px; }
  .sidebar-heading,.sidebar-bottom { display:none; }
  .portal-nav { flex-direction:row; flex-wrap:wrap; }
  .shell-ready .mobile-menu-button,.shell-ready .mobile-nav-close { display:inline-flex; }
  .shell-ready .portal-sidebar { position:fixed; top:0; width:min(320px,calc(100vw - 48px)); padding:20px 16px; transform:translateX(-100%); visibility:hidden; }
  .shell-ready .portal-sidebar .sidebar-heading { display:flex; }
  .shell-ready .portal-nav { flex-direction:column; flex-wrap:nowrap; }
  .shell-ready.nav-open .portal-sidebar { transform:translateX(0); visibility:visible; }
  .sidebar-backdrop { position:fixed; inset:0; z-index:1150; background:rgba(5,12,24,.55); }
  body.nav-open { overflow:hidden; }
  .portal--public .portal-header-title { display:none; }
}
@media(max-width:400px){
  .portal-header { gap:8px; padding-inline:12px; }
  .portal-header .header-utility { gap:8px; }
  .portal-header .header-logout-button { padding-inline:8px; font-size:12px; }
  .portal .page-wrapper { padding:20px 16px; }
}
@media(prefers-reduced-motion:no-preference){
  .portal-nav-link,.shell-icon-button,.sidebar-collapse { transition:background var(--motion),border-color var(--motion); }
  .shell-ready .portal-sidebar { transition:transform var(--motion); }
}
@media(prefers-reduced-motion:reduce){
  .portal *,.portal *::before,.portal *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}
@media print {
  .portal-header,.portal-sidebar,.skip-link,.sidebar-backdrop { display:none!important; }
  .portal .page-wrapper,.portal .footer { margin:0; padding:0; }
}
.portal:not(.shell-ready) .sidebar-collapse { display:none; }
@media(max-width:900px){
  .portal-header .header-logout-button,.portal-header .theme-toggle__button { min-height:44px; }
  .portal-header { padding-left:max(16px,env(safe-area-inset-left)); padding-right:max(16px,env(safe-area-inset-right)); }
  .portal .page-wrapper { padding-left:max(16px,env(safe-area-inset-left)); padding-right:max(16px,env(safe-area-inset-right)); }
  .portal-sidebar { padding-bottom:max(16px,env(safe-area-inset-bottom)); }
}

.sidebar-timezone { display:flex; gap:10px; align-items:flex-start; padding:12px; color:rgba(255,255,255,.72)!important; text-decoration:none; border-radius:6px; }
.sidebar-timezone:hover { background:#12202F; }
.sidebar-timezone > svg { width:18px; height:18px; margin-top:2px; }
.sidebar-timezone-details { display:grid; grid-template-columns:auto 1fr; gap:3px 8px; min-width:0; font-size:11px; }
.sidebar-timezone-label,.sidebar-timezone-name { grid-column:1 / -1; overflow-wrap:anywhere; }
.sidebar-timezone-label { font-size:10px; }
.sidebar-timezone time { font:14px var(--font-mono); font-variant-numeric:tabular-nums; }
.sidebar-timezone [data-zone-date] { align-self:center; }
@media(min-width:901px) { :root[data-sidebar-collapsed="true"] .sidebar-timezone { justify-content:center; } :root[data-sidebar-collapsed="true"] .sidebar-timezone-details { display:none; } }
@media(max-width:900px) { .shell-ready .portal-sidebar .sidebar-bottom { display:block; padding-top:12px; } .shell-ready .sidebar-collapse,.shell-ready .sidebar-caption { display:none; } }

 .organization-switcher { display:flex; align-items:flex-start; gap:10px; padding:12px; color:rgba(255,255,255,.7); font-size:12px; }
.organization-switcher > svg { width:18px; height:18px; flex:none; margin-top:2px; }
.sidebar-owner-details { min-width:0; }
.organization-label { display:block; font-size:10px; margin-bottom:5px; }
.organization-current { display:block; overflow-wrap:anywhere; line-height:1.5; }
.portal .organization-switcher .account-owner-change { display:block; margin-top:8px; min-height:32px; padding:4px 10px; background:transparent; color:inherit; border:1px solid rgba(255,255,255,.25); border-radius:6px; font-size:12px; }
.portal .organization-switcher .account-owner-change:hover { background:#12202F; color:#fff; }
@media(min-width:901px) { :root[data-sidebar-collapsed="true"] .organization-switcher { display:none; } }
.owner-dialog { padding:24px; width:min(520px,calc(100vw - 32px)); max-height:85vh; overflow:auto; box-sizing:border-box; border:1px solid var(--border); border-radius:12px; background:var(--surface); color:var(--ink); }
.owner-dialog::backdrop { background:rgba(5,15,25,.55); }
.owner-dialog h2 { margin-top:0; }
.owner-dialog p { color:var(--muted); line-height:1.6; font-size:14px; }
.owner-options { max-height:40vh; overflow:auto; display:grid; gap:6px; }
.owner-options label { display:flex; align-items:center; gap:12px; padding:12px; border:1px solid var(--border); border-radius:6px; cursor:pointer; }
.owner-options input { width:18px; height:18px; flex:none; accent-color:var(--c-primary); }
.owner-dialog-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:20px; flex-wrap:wrap; }
/* Keep navigation reachable on short windows after adding organization controls. */
.portal-sidebar { overflow-y:auto; }
.portal-sidebar > .sidebar-heading, .portal-sidebar > .organization-switcher,
.portal-sidebar > .portal-nav, .portal-sidebar > .sidebar-bottom { flex-shrink:0; }
.portal-sidebar > .portal-nav { overflow:visible; }

/* Programmatic announcement/landmark focus is not an interactive control. */
.portal .portal-feedback:focus,.portal .page-wrapper-content:focus {outline:none!important}
.portal .portal-noscript{margin:16px 32px 0 calc(var(--sidebar-width) + 32px);padding:14px 18px;border:1px solid var(--warning);border-radius:8px;background:var(--warning-bg);color:var(--warning)}
.portal--public .portal-noscript{margin-left:32px}
@media(max-width:900px){.portal .portal-noscript{margin:16px 20px}}

.portal-subnav { display:grid; margin:0 6px 6px 23px; padding-left:10px; border-left:1px solid #536171; }
.portal-subnav a { color:#d1dce4; font-size:13px; line-height:1.4; padding:7px 9px; border-radius:4px; overflow-wrap:anywhere; text-decoration:none; }
.portal-subnav a:hover,.portal-subnav a:focus-visible,.portal-subnav a[aria-current] { background:#193c35; color:white; text-decoration:underline; }
@media(min-width:901px) { :root[data-sidebar-collapsed="true"] .portal-subnav { display:none; } }
