/* Shadow R67: one visual/navigation boundary for the public and Matter surfaces.
   Deliberately scoped: existing permission, session, and model UI keep their owners. */
:root {
  --shadow-shell-bg: #081218;
  --shadow-shell-deep: #070e14;
  --shadow-shell-elevated: #12232b;
  --shadow-shell-ink: #edf4f4;
  --shadow-shell-subtle: #acc0c2;
  --shadow-shell-accent: #92d3c4;
  --shadow-shell-focus: #e8cd97;
  --shadow-shell-outline: rgba(162, 207, 208, .2);
  --shadow-shell-radius: 18px;
}
html { color-scheme: dark; }
html[data-shadow-site-version="r67"] body {
  -webkit-text-size-adjust: 100%;
}
html[data-shadow-site-version="r67"] .sw-header {
  border-bottom: 1px solid var(--shadow-shell-outline);
  background: linear-gradient(112deg, rgba(7, 18, 24, .94), rgba(14, 32, 39, .88));
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
html[data-shadow-site-version="r67"] .sw-header-tools {
  min-width: 0;
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: nowrap;
}
html[data-shadow-site-version="r67"] .sw-header-tools > * { min-width: 0; }
html[data-shadow-site-version="r67"] .sw-focus-head { min-width: 0; gap: 12px; }
html[data-shadow-site-version="r67"] .sw-focus-head > div { min-width: 0; }
html[data-shadow-site-version="r67"] .sw-focus-head h1 {
  text-wrap: balance;
  overflow-wrap: anywhere;
}
html[data-shadow-site-version="r67"] .sw-plane-rail {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
html[data-shadow-site-version="r67"] .sw-plane-rail button {
  min-height: 44px;
  flex-shrink: 0;
}
html[data-shadow-site-version="r67"] #sw-connect-controls,
html[data-shadow-site-version="r67"] .sw-connect-surface > div:last-child {
  max-width: 100%;
  min-width: 0;
}
html[data-shadow-site-version="r67"] #sw-connect-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
html[data-shadow-site-version="r67"] #sw-connect-controls button {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
html[data-shadow-site-version="r67"] #shadow-inherited-surfaces[hidden],
html[data-shadow-site-version="r67"] .legacy-depth-reservoir[hidden] {
  display: none !important;
  visibility: hidden !important;
}
html[data-shadow-site-version="r67"] :is(.access-top, .fileset-top, .inspection-top, .explore-top, .vault-top) {
  box-sizing: border-box;
  min-height: 65px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--shadow-shell-outline);
  color: var(--shadow-shell-ink);
  background: linear-gradient(112deg, rgba(7, 18, 24, .96), rgba(14, 32, 39, .9));
}
html[data-shadow-site-version="r67"] :is(.access-top, .fileset-top, .inspection-top, .explore-top, .vault-top) > :last-child {
  flex-shrink: 0;
}
html[data-shadow-site-version="r67"] :is(.access-shell, .fileset-space, .shadow-inspection, .public-shadow-shell) {
  background:
    radial-gradient(ellipse at 83% 12%, rgba(43, 100, 103, .15), transparent 43%),
    linear-gradient(135deg, #081218, #090f17 72%);
  color: var(--shadow-shell-ink);
  min-width: 0;
}
html[data-shadow-site-version="r67"] :is(.access-shell, .fileset-space, .shadow-inspection, .public-shadow-shell) main {
  min-width: 0;
}
html[data-shadow-site-version="r67"] :is(.action-line, .fileset-actions, .inspection-actions) {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
}
html[data-shadow-site-version="r67"] :is(.action-line, .fileset-actions, .inspection-actions) button {
  max-width: 100%;
  white-space: normal;
}
.shadow-global-menu-trigger {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 43px;
  min-width: 43px;
  padding: 0 12px;
  color: var(--shadow-shell-ink);
  border: 1px solid var(--shadow-shell-outline);
  border-radius: 999px;
  background: rgba(31, 57, 64, .66);
  font: 600 12px/1.15 system-ui, sans-serif;
  letter-spacing: .01em;
  cursor: pointer;
  touch-action: manipulation;
}
.shadow-global-menu-trigger:hover,
.shadow-global-menu-trigger[aria-expanded="true"] {
  border-color: rgba(146, 211, 196, .64);
  background: rgba(35, 78, 82, .7);
}
.shadow-global-menu-bars {
  display: block;
  width: 17px;
  height: 14px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  position: relative;
}
.shadow-global-menu-bars::after {
  content: "";
  width: 17px;
  position: absolute;
  top: 5px;
  left: 0;
  border-top: 2px solid currentColor;
}
.shadow-global-menu[hidden] { display: none !important; }
.shadow-global-menu {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: flex;
  justify-content: flex-end;
  color: var(--shadow-shell-ink);
  font: 15px/1.45 system-ui, sans-serif;
}
.shadow-global-menu-scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 9, 13, .8);
  border: 0;
  cursor: pointer;
}
.shadow-global-menu-panel {
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(370px, 100vw);
  max-height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: radial-gradient(circle at top right, #1b4145 0%, transparent 53%), #0b171e;
  border-left: 1px solid var(--shadow-shell-outline);
  box-shadow: -20px 0 80px rgba(0, 0, 0, .35);
}
.shadow-global-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--shadow-shell-outline);
}
.shadow-global-menu-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.055em;
}
.shadow-global-menu-close {
  appearance: none;
  width: 44px;
  height: 44px;
  color: var(--shadow-shell-ink);
  background: rgba(138, 190, 195, .09);
  border: 1px solid var(--shadow-shell-outline);
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.shadow-global-menu-panel nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0 20px;
  gap: 3px;
}
.shadow-global-menu-group {
  color: var(--shadow-shell-accent);
  margin: 19px 10px 7px;
  font-size: 10px;
  letter-spacing: .14em;
  font-weight: 700;
  text-transform: uppercase;
}
.shadow-global-menu-link {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 45px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--shadow-shell-ink);
  text-decoration: none;
  font-size: 15px;
}
.shadow-global-menu-link:hover,
.shadow-global-menu-link:focus-visible,
.shadow-global-menu-link[aria-current="page"] {
  background: rgba(120, 201, 192, .11);
  border-color: rgba(146, 211, 196, .22);
}
.shadow-global-menu-foot {
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--shadow-shell-outline);
  color: var(--shadow-shell-subtle);
  font-size: 11px;
}
html[data-shadow-site-version="r67"] :is(
  .shadow-global-menu-trigger,.shadow-global-menu-close,.shadow-global-menu-link,
  .vault-link
):focus-visible {
  outline: 2px solid var(--shadow-shell-focus);
  outline-offset: 3px;
}
body.shadow-global-menu-open { overflow: hidden !important; }
@media (max-width: 660px) {
  html[data-shadow-site-version="r67"] .sw-header {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    min-width: 0;
  }
  html[data-shadow-site-version="r67"] .sw-header > .sw-breadcrumb { display: none; }
  html[data-shadow-site-version="r67"] .sw-header-tools {
    flex: 0 1 auto;
    max-width: calc(100% - 79px);
    gap: 4px;
  }
  html[data-shadow-site-version="r67"] .sw-header-tools #sw-connection {
    overflow: hidden;
    max-width: 76px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  html[data-shadow-site-version="r67"] :is(.access-top, .fileset-top, .inspection-top, .explore-top, .vault-top) {
    padding-inline: 16px;
    justify-content: space-between;
  }
  html[data-shadow-site-version="r67"] :is(
    .top-scope, .fileset-context, .header-context, .explore-context,
    .top-return, .fileset-return, .inspection-top .exit, .explore-back
  ) { display: none; }
  html[data-shadow-site-version="r67"] .shadow-global-menu-label { display: none; }
  html[data-shadow-site-version="r67"] .shadow-global-menu-trigger { padding: 0; }
  html[data-shadow-site-version="r67"] .sw-focus-head { flex-wrap: wrap; }
  html[data-shadow-site-version="r67"] .sw-back-button { min-height: 44px; }
  html[data-shadow-site-version="r67"] .sw-connect-surface { min-width: 0; max-width: 100%; }
  html[data-shadow-site-version="r67"] #sw-connect-controls { justify-content: flex-start; }
  html[data-shadow-site-version="r67"] #sw-connect-controls button { min-height: 44px; }
}
@media (max-width: 390px) {
  html[data-shadow-site-version="r67"] .sw-header-tools #sw-connection { max-width: 52px; }
  html[data-shadow-site-version="r67"] .sw-header-tools #sw-shadow-control { max-width: 69px; }
  html[data-shadow-site-version="r67"] .sw-header .sw-home { max-width: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .shadow-global-menu * { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}

/* Hosted Vault entry: same tokens, distinct function, no false storage claim. */
.shadow-vault-page {
  min-height: 100dvh;
  margin: 0;
  color: var(--shadow-shell-ink);
  background:
    radial-gradient(circle at 77% 27%, rgba(46, 120, 128, .2), transparent 34%),
    linear-gradient(130deg, #081218, #071016 75%);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
.vault-shell { max-width: 1200px; margin: 0 auto; }
.vault-top { padding: 10px clamp(16px, 4vw, 45px); }
.vault-mark { font-weight: 680; color: var(--shadow-shell-ink); letter-spacing: -.06em; font-size: 21px; text-decoration: none; }
.vault-mark span { color: var(--shadow-shell-accent); }
.vault-context { color: var(--shadow-shell-subtle); letter-spacing: .15em; font-size: 10px; margin-left: auto; }
.vault-main { padding: clamp(36px, 7vw, 90px) clamp(20px, 5vw, 55px) 75px; }
.vault-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(160px, .7fr); align-items: center; gap: 30px; }
.vault-eyebrow { font-size: 11px; font-weight: 670; letter-spacing: .15em; text-transform: uppercase; color: var(--shadow-shell-accent); }
.vault-main h1 { font-size: clamp(39px, 6vw, 76px); line-height: 1.04; letter-spacing: -.055em; font-weight: 620; max-width: 15ch; margin: 16px 0 18px; }
.vault-main h1 span { color: var(--shadow-shell-accent); }
.vault-intro { color: var(--shadow-shell-subtle); font-size: clamp(14px, 1.5vw, 17px); max-width: 51ch; line-height: 1.7; }
.vault-orbit { justify-self: center; width: min(31vw, 270px); aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(146,211,196,.22); display: grid; place-items: center; background: radial-gradient(circle,rgba(76,170,165,.17),transparent 70%); box-shadow:0 0 0 22px rgba(95,165,170,.025),0 0 0 44px rgba(95,165,170,.02); }
.vault-orbit-inner { display: grid; place-items: center; width: 53%; aspect-ratio: 1; border: 1px solid rgba(146,211,196,.27); border-radius: 50%; font-weight: 700; letter-spacing: -.035em; text-align:center; font-size: clamp(15px, 2.3vw, 24px); }
.vault-divider { border:0; border-top: 1px solid var(--shadow-shell-outline); margin:clamp(36px, 7vw, 85px) 0 25px; }
.vault-section { display:grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr); gap:16px 45px; padding:24px 0; border-bottom: 1px solid var(--shadow-shell-outline); }
.vault-section h2 { font-size: clamp(18px,2vw,25px); letter-spacing:-.03em; margin:0; font-weight:600; }
.vault-section p { margin:0 0 15px; color:var(--shadow-shell-subtle); line-height:1.65; }
.vault-link { display:inline-flex; align-items:center; justify-content:center; min-height:46px; min-width:155px; padding: 9px 16px; border:1px solid rgba(146,211,196,.38); border-radius:999px; background:rgba(45,97,98,.24); color:var(--shadow-shell-ink); text-decoration:none; font-weight:600; font-size:14px; }
.vault-link:hover { background:rgba(45,97,98,.43); }
.vault-notice { font-size:13px; max-width:65ch; }
.vault-footer { margin-top:38px; font-size:12px; color:var(--shadow-shell-subtle); }
@media(max-width:650px) {
  .vault-hero { grid-template-columns: minmax(0,1fr); }
  .vault-orbit { display:none; }
  .vault-section { grid-template-columns:minmax(0,1fr); }
  .vault-main { padding-bottom:45px; }
}
