:root {
  color-scheme: light;
  --navy: #0b1c31;
  --ink: #121f32;
  --muted: #4e5e72;
  --brand-orange: #ffa14d;
  --steel: #355d83;
  --steel-hover: #294d70;
  --paper: #fff;
  --bg: #f1f4f8;
  --line: #d5dee9;
  --pad: clamp(20px, 4vw, 64px);
  --font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: "DM Mono", ui-monospace, monospace;
  font: 16px/1.5 var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; min-height: 100vh; }
h1, h2, p { margin: 0; }
h1, h2, h3, h4, h5, h6, .brand, .nav-link, .workspace-personal-control, .button {
  font-family: var(--font-heading);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
svg { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.line-icon { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 3px solid #1b68bd; outline-offset: 3px; }
.visually-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 5; top: 10px; left: 10px; padding: 10px 14px; background: var(--paper); color: var(--navy); }

.brand-assets { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.brand { display: inline-flex; align-items: center; gap: .57rem; text-decoration: none; font-size: 1.5rem; font-weight: 400; letter-spacing: -.055em; line-height: 1; }
.brand-title { color: #f7f8fa; white-space: nowrap; }
.brand-mark { display: block; width: 34px; height: 34px; flex: none; }

.workspace-header, .access-header { background: var(--navy); color: #f4f7fc; }
.workspace-header {
  position: sticky;
  z-index: 3;
  inset-block-start: 0;
  border-bottom: 1px solid #22344d;
}
.workspace-header-inner {
  display: grid;
  grid-template-columns: minmax(min-content, 1fr) auto minmax(min-content, 1fr);
  align-items: center;
  gap: 12px 16px;
  min-width: 0;
  padding: 9px var(--pad);
}
.workspace-header .brand { justify-self: start; }
.workspace-header :focus-visible, .access-header :focus-visible { outline-color: #8fc1f5; }
.workspace-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.workspace-personal-controls { display: flex; align-items: center; gap: 3px; flex: none; }
.workspace-personal-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid transparent;
  color: inherit;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.workspace-personal-control .line-icon { width: 17px; height: 17px; color: #bfd4ee; stroke: currentColor; fill: none; stroke-width: 1.6; }
.workspace-personal-control:hover, .workspace-personal-control:focus-visible { border-color: #385572; background: #1e3654; }
.workspace-picker { justify-self: end; width: min(100%, 230px); min-width: 0; }
.workspace-picker p, .workspace-picker select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #405671;
  background: #142943;
  color: #f4f7fc;
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-picker select { cursor: pointer; }
.workspace-main-nav { display: flex; align-items: stretch; justify-content: center; gap: 5px; min-width: 0; }
.nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover, .nav-link[aria-current="page"] { border-color: #385572; background: #1e3654; }
.nav-link[aria-current="page"] { border-bottom-color: #8db3dc; }
.nav-link:focus-visible { outline-offset: -3px; }
.nav-link svg { color: #bfd4ee; }
.demo-user-picker { max-width: min(190px, 55vw); color: inherit; background: var(--paper); border: 1px solid var(--line); padding: 4px 5px; font: inherit; }

.content { min-width: 0; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); padding: 0 var(--pad); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 43px; gap: 16px; width: 100%; font-size: 13px; }
.breadcrumbs, .account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.breadcrumbs span, .account { color: var(--muted); }
.breadcrumbs span:first-child, .account span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account a { white-space: nowrap; font-weight: 650; }
#main { width: 100%; min-width: 0; padding: clamp(28px, 4.5vw, 62px) var(--pad) 60px; }
#main:focus, #gate-title:focus { outline: none; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 30px; }
.page-heading h1 { font-size: clamp(36px, 5vw, 58px); font-weight: 300; line-height: 1.04; letter-spacing: -.06em; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: 15px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 14px; border: 1px solid transparent; font-size: 14px; line-height: 1.25; font-weight: 700; text-decoration: none; white-space: nowrap; }
.button svg { width: 17px; height: 17px; }
.primary { background: var(--steel); color: white; border-color: #2c5278; }
.primary:hover:not(:disabled) { background: var(--steel-hover); }
.secondary { background: var(--paper); color: #233650; border-color: #c4d0df; }
.secondary:hover:not(:disabled) { background: #f1f5fa; border-color: #9aaec2; }

.directory { border: 1px solid var(--line); background: var(--paper); }
.directory-head { display: flex; align-items: center; justify-content: space-between; gap: 11px 23px; padding: 16px 21px; border-bottom: 1px solid var(--line); }
.directory-head h2 { min-width: 0; font-size: 20px; letter-spacing: -.032em; }
.search-wrap { position: relative; width: min(295px, 50%); max-width: 100%; }
.search-wrap svg { position: absolute; top: 11px; left: 11px; color: #627892; pointer-events: none; }
.search-wrap input { appearance: none; width: 100%; min-height: 42px; border: 1px solid #c8d4e2; color: var(--ink); background: #f9fbfd; padding: 7px 9px 7px 38px; font-size: 14px; }
.directory-table { width: 100%; border-collapse: collapse; text-align: left; }
.directory-table th { padding: 11px 12px; border-bottom: 1px solid var(--line); background: #f8fafd; color: #40536c; font-size: 12px; font-weight: 700; }
.directory-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); color: #24384f; font-size: 14px; overflow-wrap: anywhere; }
.directory-table :is(th, td):first-child { padding-left: 21px; }
.directory-table :is(th, td):last-child { padding-right: 21px; }
.directory-table tbody tr:last-child td { border-bottom: 0; }
.directory-table tbody tr:hover { background: #fafbfd; }
.directory-table td:first-child { font-weight: 750; color: var(--ink); }
.directory-table .user-department { font-weight: 400; }
.user-detail { display: block; }
.user-detail + .user-detail { margin-top: 2px; color: var(--muted); font-size: 12px; }
.user-role, .user-status { display: inline-block; border: 1px solid #cddbec; padding: 2px 6px; color: #274969; background: #f0f5fb; font-size: 12px; font-weight: 700; }
.user-status.active { color: #244f40; background: #edf7f0; border-color: #c8e0d1; }
.user-status.invited { color: #4e445e; background: #f5f1f8; border-color: #dfd6e6; }
.user-status.expired { color: #714729; background: #f9f1e9; border-color: #ebd9c6; }
.directory-message { padding: 31px 21px; color: var(--muted); text-align: center; font-size: 14px; }
.directory-retry { display: flex; margin: -12px auto 22px; }

.access-header { padding: 15px var(--pad); }
.access-body { display: grid; justify-items: center; padding: clamp(28px, 8vh, 85px) var(--pad); }
.access-panel { width: min(100%, 510px); padding: clamp(21px, 4vw, 36px); border: 1px solid var(--line); border-top: 4px solid var(--steel); background: var(--paper); }
.access-panel h1 { font-size: clamp(27px, 5vw, 36px); line-height: 1.12; letter-spacing: -.045em; }
.access-panel p { margin-top: 11px; color: var(--muted); overflow-wrap: anywhere; }
.access-panel .access-account { font-size: 13px; }
.gate-actions { margin-top: 19px; display: flex; flex-wrap: wrap; gap: 8px; }
.gate-actions:not(:has(:not([hidden]))) { margin-top: 0; }

dialog { width: min(520px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #09182981; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 15px 19px; }
.dialog-head h2 { font-size: 24px; font-weight: 750; letter-spacing: -.04em; }
.icon-button { display: grid; place-items: center; min-width: 42px; min-height: 42px; padding: 0; color: var(--ink); border: 1px solid #c9d4e1; background: var(--paper); }
.icon-button:hover:not(:disabled) { background: #f0f5fb; }
.dialog-body { padding: 18px 19px 21px; display: grid; gap: 15px; }
.dialog-body p { overflow-wrap: anywhere; }
.dialog-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding: 12px 19px; background: #f8fafd; }
.field { display: grid; gap: 4px; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field label { font-size: 13px; font-weight: 700; }
.field input, .field select { width: 100%; min-width: 0; min-height: 42px; padding: 7px 9px; border: 1px solid #bac9da; background: var(--paper); color: var(--ink); font-size: 16px; }
.field input { appearance: none; }
.field input[readonly] { background: #f5f7fa; }
.field-note, #copy-feedback { font-size: 13px; color: var(--muted); }
.inline-error { padding: 8px 10px; border-left: 3px solid #ba5662; background: #fff3f3; color: #922a39; font-size: 13px; }

@media (max-width: 1240px) {
  .workspace-header-inner { grid-template-columns: auto minmax(0, 1fr); }
  .workspace-header-actions { grid-area: 1 / 2; }
  .workspace-main-nav {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .workspace-header { position: relative; }
  .workspace-header-inner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 12px;
    padding: 9px var(--pad) 8px;
  }
  .workspace-header .brand { font-size: 21px; }
  .workspace-header-actions { gap: 5px; flex-wrap: wrap; }
  .workspace-picker { width: min(100%, 160px); order: 1; }
  .workspace-picker:has(select[hidden]) { display: none; }
  .workspace-picker select { min-height: 34px; padding: 5px 8px; }
  .workspace-personal-control { padding-inline: 6px; font-size: 13px; gap: 4px; }
  .workspace-header :is(#workspace-inbox, .workspace-menu-toggle) { min-width: 44px; min-height: 44px; }
  .workspace-header #workspace-inbox > .line-icon { display: block; width: 20px; height: 20px; }
  .workspace-header #workspace-inbox > span { display: none; }
  .workspace-menu-toggle { border-radius: 8px; }
  .workspace-menu-toggle .line-icon { width: 24px; height: 24px; stroke-width: 1.8; }
  .workspace-menu-toggle .line-icon path {
    transform-origin: center;
    transition: transform .18s ease-out, opacity .18s ease-out;
  }
  .workspace-menu-toggle[aria-expanded="true"] { border-color: #5c7591; background: #1e3654; }
  .workspace-menu-toggle[aria-expanded="true"] path:first-child { transform: rotate(45deg) translateY(5px); }
  .workspace-menu-toggle[aria-expanded="true"] path:nth-child(2) { opacity: 0; }
  .workspace-menu-toggle[aria-expanded="true"] path:last-child { transform: rotate(-45deg) translateY(-5px); }
  @media (prefers-reduced-motion: reduce) {
    .workspace-menu-toggle .line-icon path { transition: none; }
  }
  .workspace-mobile-menu {
    position: absolute;
    z-index: 4;
    inset-block-start: calc(100% + 5px);
    inset-inline-end: var(--pad);
    width: min(290px, calc(100% - var(--pad) * 2));
    max-height: min(420px, calc(100dvh - 70px));
    padding: 5px;
    border: 1px solid #4a6582;
    background: #142943;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 12px 28px #0b1c3144;
  }
  .workspace-mobile-menu .workspace-main-nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .workspace-mobile-menu .workspace-main-nav .nav-link,
  .workspace-mobile-menu #workspace-profile {
    grid-column: 1;
    justify-content: flex-start;
    min-height: 44px;
    width: 100%;
    gap: 9px;
    padding: 7px 11px;
    text-align: start;
    font-size: 14px;
  }
  .workspace-mobile-menu .workspace-main-nav .line-icon,
  .workspace-mobile-menu #workspace-profile > .line-icon { display: block; width: 18px; height: 18px; }
  .workspace-mobile-menu .nav-link { border-bottom-width: 1px; border-inline-start-width: 3px; }
  .workspace-mobile-menu .nav-link[aria-current="page"] { border-bottom-color: #385572; border-inline-start-color: #8db3dc; }
  .workspace-mobile-menu #workspace-profile { margin-top: 5px; border-top-color: #385572; }
  .workspace-mobile-menu #workspace-profile:focus-visible { outline-offset: -3px; }
  .nav-link { padding: 7px 5px; }
  .topbar-inner { min-height: 37px; }
  .breadcrumbs span[aria-hidden], .breadcrumbs strong, .account #account-email { display: none; }
  .account { margin-left: auto; }
  .page-heading { margin-bottom: 19px; }
  .page-heading p { font-size: 14px; }
}

@media (max-width: 920px) {
  .workspace-main-nav .line-icon { display: none; }
  .workspace-main-nav .nav-link { padding-inline: 4px; font-size: 13px; text-align: center; white-space: normal; overflow-wrap: anywhere; }
}

@media (max-width: 640px) {
  .workspace-main-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .workspace-main-nav .nav-link { grid-column: span 2; }
}

@media (max-width: 500px) {
  .workspace-personal-control .line-icon { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .directory-head { flex-wrap: wrap; padding: 12px 14px; }
  .search-wrap { width: 100%; }
  .search-wrap input { font-size: 16px; }
  .directory-table, .directory-table tbody { display: block; }
  .directory-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .directory-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; border-bottom: 1px solid var(--line); gap: 6px 12px; }
  .directory-table tr:last-child { border-bottom: 0; }
  .directory-table td { padding: 0 !important; border: 0; }
  .directory-table td:nth-child(2) { grid-area: 2 / 1; }
  .directory-table td:nth-child(3) { grid-area: 2 / 2; }
  .directory-table td:nth-child(4) { grid-area: 1 / 2; }
  .directory-table td:nth-child(n+3) { text-align: right; }
}

@media (max-width: 350px) {
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .workspace-header-inner { column-gap: 8px; }
  .workspace-header .brand { gap: 6px; font-size: 18px; }
  .workspace-header .brand-mark { width: 30px; height: 30px; }
}

@media (max-width: 430px) {
  :root { --pad: clamp(12px, 3.5vw, 16px); }
  .workspace-main-nav { column-gap: 3px; }
  .workspace-personal-control { min-height: 44px; }
  .topbar-inner { gap: 8px; }
  .account .demo-user-picker { min-width: 0; max-width: min(152px, 49vw); }
}

.studio-demo-notice {
  margin: 8px var(--pad) 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.studio-demo-notice strong { color: var(--navy); }
