/* Shared primitives, loaded after page CSS; includes dialogs mounted outside live-root. */
:root select:not([multiple]):not([size]),
:root select:not([multiple])[size="0"],
:root select:not([multiple])[size="1"],
#organization,
#workspace-mode,
#operator-context {
  --select-arrow-inset: 14px;
  --select-arrow-space: 38px;
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: var(--select-arrow-space);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%233d6256' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--select-arrow-inset) center;
  background-size: 12px 8px;
}
:root select:not([multiple]):dir(rtl) { background-position: left var(--select-arrow-inset) center; }
/* Keep all navigation icons aligned when the sidebar is expanded or collapsed. */
.live-nav.sidebar nav button > .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  line-height: 1;
}
.nav-icon .menu-icon { display: block; width: 20px; height: 20px; flex: none; }
@media (forced-colors: active) {
  :root select:not([multiple]):not([size]), :root select:not([multiple])[size="0"],
  :root select:not([multiple])[size="1"], #organization, #workspace-mode, #operator-context {
    appearance: auto;
    -webkit-appearance: auto;
    background-image: none;
  }
}

.live-nav nav .navigation-group{display:block;margin:17px 0 6px;padding:0 12px}.live-nav nav .navigation-group:first-child{margin-top:0}.sidebar-collapsed .live-nav nav .navigation-group{display:none}
[data-domain-status]{overflow-wrap:anywhere}.domain-records td code{overflow-wrap:anywhere;word-break:break-word}

/* One document scrollbar. The sidebar contributes its full height to the page. */
.live-shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  align-items: stretch;
  min-height: 100svh;
}
.live-shell > .live-nav.sidebar {
  position: static;
  inset: auto;
  width: auto;
  min-width: 0;
  min-height: 100svh;
  max-height: none;
  overflow: visible;
}
.live-shell > .shell { margin-left: 0; min-width: 0; }
.live-shell .live-nav-bottom { margin-top: 24px; padding-top: 12px; }
.live-shell .topbar { position: sticky; top: 0; z-index: 25; }
.topbar .topbar-start { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-start .breadcrumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-shell .topbar .sidebar-toggle {
  display: inline-grid;
  place-items: center;
  order: 0;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
}
.sidebar-toggle svg { display: block; pointer-events: none; }
@media (min-width: 851px) {
  .live-shell.sidebar-collapsed { grid-template-columns: 80px minmax(0, 1fr); }
  .live-shell.sidebar-collapsed > .live-nav.sidebar { width: auto; padding: 25px 12px 20px; }
  .live-shell.sidebar-collapsed > .shell { margin-left: 0; }
  .live-shell.sidebar-collapsed .sidebar-header {
    flex-direction: row;
    justify-content: center;
    gap: 0;
    min-height: 36px;
    margin-bottom: 24px;
  }
}
@media (max-width: 850px) {
  .live-shell, .live-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
  }
  .live-shell > .shell { display: contents; }
  .live-shell > .live-nav.sidebar {
    display: none;
    grid-row: 2;
    grid-column: 1;
    min-height: 0;
    width: auto;
    max-height: none;
    overflow: visible;
    scroll-margin-top: 90px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .live-shell > .live-nav.sidebar.open { display: flex; }
  .live-shell .topbar { grid-row: 1; grid-column: 1; gap: 12px; padding: 0 16px; }
  .live-shell .topbar .sidebar-toggle { width: 44px; height: 44px; flex-basis: 44px; }
  .live-shell .live-main { grid-row: 3; grid-column: 1; width: 100%; }
  .live-shell .shell > footer { grid-row: 4; grid-column: 1; }
  .topbar .top-actions { gap: 10px; flex-shrink: 0; }
  .topbar .topbar-start { gap: 8px; }
}

/* Separate operation context from authenticated user identity. */
.live-nav .sidebar-header { margin-bottom: 24px; }
.live-nav.sidebar .workspace { margin-top: 0; }
.live-nav .profile > div { min-width: 0; }
.profile-user { display: block; font-size: 11px; overflow-wrap: anywhere; }

.security-feedback:not(:empty){padding:12px 14px;border:1px solid var(--line);border-radius:8px;font-size:13px;line-height:1.6}.security-feedback[data-state="pending"]{background:#f1f5f2;color:#355d4e}.security-feedback[data-state="success"]{background:#eaf4ee;border-color:#b8d9c7;color:#175e43}.security-feedback[data-state="error"]{background:#fff1ef;border-color:#e8bbb3;color:#87392c}.security-feedback[data-state="warning"]{background:#fff8e8;border-color:#e5cf9f;color:#70551d}

.security-feedback{scroll-margin-block:90px}
