/* Shared frame for public and administrative pages. */
#app .workspace-shell {
  --workspace-margin: clamp(24px, 6vh, 76px);
  --workspace-height: min(760px, calc(100dvh - 2 * var(--workspace-margin)));
  --rail-width: clamp(172px, 15vw, 218px);
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  width: min(93%, 1520px);
  min-height: var(--workspace-height);
  margin: var(--workspace-margin) auto;
  border: 1px solid var(--border);
  border-radius: clamp(20px, 2.5vw, 32px);
  background: rgb(8 14 30 / .64);
  box-shadow: 0 25px 78px rgb(4 8 23 / .5);
  overflow: clip;
  isolation: isolate;
}
#app .workspace-sidebar {
  background: rgb(11 18 37 / calc(.53 + .45 * var(--sidebar-opacity, .72)));
}
.workspace-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: calc(var(--workspace-height) - 3px);
  padding: 23px 14px;
  overflow: auto;
}
.workspace-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.workspace-sidebar .brand { margin: 0 10px; color: #9aafff; }
.workspace-sidebar nav { display: grid; gap: 7px; }
#app .workspace-sidebar .shell-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px;
  border-radius: 12px;
  color: #dbe4fa;
  font-size: .85rem;
  line-height: 1.25;
}
#app .workspace-sidebar .shell-link .rail-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgb(6 11 25 / calc(.25 + .36 * var(--navigation-opacity, .9))) !important;
}
#app .workspace-sidebar .shell-link.active {
  color: #fff;
  font-weight: 700;
}
#app .workspace-sidebar .shell-link.active .rail-icon {
  color: #fff;
  background: radial-gradient(circle at 26% 19%, #8ba7ff, #526de0 43%, #283b9c 90%) !important;
  box-shadow: 0 0 16px rgb(103 132 255 / calc(.25 + .32 * var(--navigation-opacity, .9)));
}
#app .workspace-sidebar .shell-link:hover { background: rgb(139 163 255 / .12); }
#app .workspace-shell :is(.shell-link, .workspace-header a, .workspace-header button, .shell-menu-close):focus-visible {
  outline: 2px solid #a3b9ff !important;
  outline-offset: 2px;
}
#app .workspace-content {
  min-width: 0;
  /* Keep bright wallpapers outside the reading surface at low opacity settings. */
  background:
    radial-gradient(ellipse at 38% 0%, rgb(81 107 198 / .19), transparent 56%),
    linear-gradient(152deg, rgb(24 36 67 / calc(.4 + .58 * var(--workspace-opacity, .74))), rgb(14 24 48 / calc(.4 + .58 * var(--workspace-opacity, .74))));
}
.workspace-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 69px;
  padding: 12px clamp(14px, 3vw, 30px);
  border-bottom: 1px solid var(--border);
  background: rgb(15 24 48 / calc(var(--topbar-opacity, .55) * .78));
}
.workspace-tools, .workspace-crumb { display: flex; align-items: center; gap: 12px; min-width: 0; }
.workspace-tools { flex-shrink: 0; }
.workspace-crumb a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.workspace-crumb strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-crumb > span { opacity: .6; }
.workspace-tools .profile-trigger { border: 0; padding: 0; min-width: 0; border-radius: 50%; }
.workspace-tools .icon-btn { border-radius: 50%; }
#app .workspace-tools .pop-profile { min-width: 150px; }
#app .workspace-tools .pop-notifications { width: min(355px, calc(100vw - 100px)); }
#app :is(.shell-menu-button, .shell-menu-close, .shell-backdrop) { display: none; }
#app .workspace-content .site-main { padding-top: 12px; }
#app .profile-page .profile-hero { justify-content: flex-end; }
#app .profile-page .profile-identity > div { min-width: 0; }
#app .profile-page .profile-identity h1 { display: block; overflow-wrap: anywhere; }
#app .media-fit { object-fit: contain; object-position: center; }
#app .game-art .media-fit { transform:none; }
#app .workspace-metrics { grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr)); }
.workspace-check { display:flex !important; flex-direction:row; align-items:center; gap:8px; margin:12px 0; }
.bot-fields { display:grid; gap:14px; margin-top:16px; }
.role-checkboxes { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:10px 14px; }
#app [data-admin-feature] .role-checkboxes label { display:flex; flex-direction:row; align-items:center; }
#app .role-checkboxes input { flex:none; min-height:0; }
.staff-name { display:flex; align-items:center; gap:10px; }
.staff-name .avatar { flex-shrink:0; }
.staff-role-tags { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.personal-role-title img { vertical-align:middle; object-fit:contain; margin-inline-end:8px; }
#app .media-preview img { display:block; width:100%; height:100%; }
.media-specs { font-size:.82rem; }
#app .media-item { min-width:0; overflow-wrap:anywhere; }
#app .media-item form { min-width:0; }
#app .media-item input[type="file"] { max-width:100%; min-width:0; }
.appearance-workspace { display:grid; grid-template-columns:minmax(225px,1fr) minmax(0,2fr); align-items:start; gap:18px; }
#app .appearance-preview { position:sticky; top:14px; min-width:0; }
.appearance-preview iframe { display:block; width:100%; height:clamp(370px,68vh,760px); border:1px solid var(--border); border-radius:12px; background:#141c34; }
@media(max-width:900px) {
  .appearance-workspace { grid-template-columns:1fr; }
  #app .appearance-preview { grid-row:1; position:static; }
}
@media (max-width: 850px) {
  #app .workspace-shell {
    display: block;
    width: min(96%, 760px);
    min-height: calc(100dvh - 24px);
    margin: 12px auto;
  }
  #app .workspace-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: none;
    width: min(275px, 86vw);
    background: #101a34;
  }
  #app .workspace-sidebar.is-open { display: block; }
  .workspace-sidebar-inner { height: 100dvh; }
  #app :is(.shell-menu-button, .shell-menu-close) { display: inline-grid; }
  #app .shell-backdrop {
    display: block;
    position: fixed;
    z-index: 29;
    inset: 0;
    background: #080c20b3;
  }
}
