:root {
  color-scheme: light;
  --canvas: #f5f5f7;
  --surface: #ffffff;
  --surface-raised: #fbfbfd;
  --surface-hover: #f2f2f5;
  --surface-selected: #eaf3ff;
  --line: #e3e3e8;
  --line-strong: #d1d1d6;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #8e8e93;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: #eaf3ff;
  --green: #178a4b;
  --green-soft: #eaf7ef;
  --orange: #a45f00;
  --orange-soft: #fff3dd;
  --red: #d70015;
  --red-soft: #fff0f1;
  --focus: rgba(0, 113, 227, 0.35);
  --toolbar-height: 64px;
  --sidebar-width: 228px;
  --catalog-width: 400px;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
  color: var(--text);
  font:
    14px/1.5 -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "SF Pro Display",
    "PingFang SC",
    "Helvetica Neue",
    Arial,
    sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
summary,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 6px 12px;
  cursor: pointer;
}

button:hover {
  border-color: #b9b9bf;
  background: var(--surface-hover);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}

button.primary:hover {
  border-color: var(--blue-hover);
  background: var(--blue-hover);
}

button.danger {
  border-color: #f0b5bb;
  background: var(--surface);
  color: var(--red);
}

button.danger:hover {
  border-color: #eb929c;
  background: var(--red-soft);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

textarea {
  resize: vertical;
}

svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.muted {
  color: var(--text-secondary);
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.topbar {
  position: relative;
  z-index: 20;
  height: var(--toolbar-height);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 420px) minmax(360px, 1fr);
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid rgba(210, 210, 216, 0.84);
  background: rgba(255, 255, 255, 0.92);
  padding: 0 20px;
  backdrop-filter: saturate(180%) blur(18px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.15;
}

.service-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  padding-top: 2px;
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22a85a;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
}

.global-search > svg {
  position: absolute;
  left: 11px;
  z-index: 1;
  color: var(--text-secondary);
}

.global-search input {
  height: 36px;
  border-color: var(--line);
  background: #f7f7f9;
  padding: 7px 54px 7px 36px;
}

.global-search input:focus {
  border-color: #80baff;
  background: var(--surface);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.icon-button.subtle {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}

.command-button {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.actor-menu {
  position: relative;
}

.actor-menu > summary {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  padding: 2px 7px 2px 3px;
  white-space: nowrap;
}

.actor-menu > summary::-webkit-details-marker {
  display: none;
}

.actor-menu > summary:hover {
  background: var(--surface-hover);
}

.actor-menu > summary > svg {
  width: 13px;
  height: 13px;
  color: var(--text-secondary);
}

#actorDisplay {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actor-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e6edf7;
  color: #34536f;
  overflow: hidden;
}

.actor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.actor-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

.form-grid label span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.actor-popover strong {
  display: block;
  padding-right: 72px;
  font-size: 14px;
}

.actor-role {
  position: absolute;
  top: 13px;
  right: 13px;
  border-radius: 5px;
  background: var(--blue-soft);
  color: #075da8;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
}

.actor-popover p {
  margin: 8px 0 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 7px;
  border-top: 1px solid var(--line);
  color: var(--text-secondary);
  margin: 12px -14px -14px;
  padding: 11px 14px;
  text-decoration: none;
}

.logout-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.logout-link svg {
  width: 15px;
  height: 15px;
}

.workspace {
  height: calc(100vh - var(--toolbar-height));
  display: grid;
  grid-template-columns: var(--sidebar-width) var(--catalog-width) minmax(480px, 1fr);
  overflow: hidden;
}

.sidebar,
.catalog,
.detail-pane {
  min-width: 0;
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #f7f7f9;
  padding: 14px 10px 10px;
}

.sidebar-group {
  padding: 0 0 14px;
}

.sidebar-group + .sidebar-group {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.sidebar-group h2 {
  margin: 0 10px 7px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.nav-row {
  width: 100%;
  height: 36px;
  min-height: 36px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
}

.nav-row:hover {
  border: 0;
  background: #ededf0;
}

.nav-row.active {
  background: #e3efff;
  color: #0568ce;
  font-weight: 600;
}

.nav-row svg {
  width: 16px;
  height: 16px;
}

.nav-count {
  color: var(--text-tertiary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.nav-row.active .nav-count {
  color: #0568ce;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding: 10px 8px 0;
  color: var(--text-tertiary);
  font-size: 11px;
}

.sidebar-command {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: transparent;
  background: transparent;
  padding: 4px 6px;
}

.sidebar-command:hover {
  border-color: transparent;
}

.catalog {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.catalog-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px 10px 16px;
}

.catalog-header p {
  margin: 0 0 2px;
  color: var(--text-secondary);
  font-size: 11px;
}

.catalog-header h2 {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.catalog-count {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.catalog-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.compact-select {
  position: relative;
  display: flex;
  align-items: center;
}

.compact-select svg {
  position: absolute;
  left: 8px;
  z-index: 1;
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
  pointer-events: none;
}

.compact-select select {
  width: 108px;
  height: 34px;
  border-color: transparent;
  background: transparent;
  padding: 5px 4px 5px 27px;
  color: var(--text-secondary);
  font-size: 12px;
}

.compact-select select:hover {
  background: var(--surface-hover);
}

.active-filter-bar {
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
  padding: 7px 12px;
  color: #2367a9;
  font-size: 12px;
}

.knowledge-list {
  flex: 1;
  overflow: auto;
}

.knowledge-row {
  width: 100%;
  min-height: 84px;
  display: block;
  border: 0;
  border-bottom: 1px solid #ededf0;
  border-radius: 0;
  background: var(--surface);
  padding: 11px 15px;
  text-align: left;
}

.knowledge-row:hover {
  border-color: #ededf0;
  background: #f8f8fa;
}

.knowledge-row.selected {
  background: var(--surface-selected);
}

.knowledge-row-top,
.knowledge-row-meta,
.knowledge-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.knowledge-row-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-row-kind {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  font-size: 11px;
}

.knowledge-row-meta {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 12px;
}

.knowledge-row-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-row-bottom {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.row-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
}

.row-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  content: "";
}

.row-status.active::before {
  background: var(--green);
}

.row-status.approved::before {
  background: var(--blue);
}

.row-status.archived::before,
.row-status.superseded::before {
  background: var(--text-tertiary);
}

.empty-list {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin: 0;
  color: var(--text-tertiary);
  text-align: center;
}

.detail-pane {
  overflow: auto;
  background: var(--surface);
  padding: 0 28px 48px;
}

.empty-state {
  max-width: 420px;
  margin: 18vh auto 0;
  color: var(--text-secondary);
  text-align: center;
}

.empty-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
}

.empty-icon svg {
  width: 25px;
  height: 25px;
}

.empty-state h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.empty-state p {
  margin: 7px 0 0;
}

.detail-header {
  position: sticky;
  top: 0;
  z-index: 6;
  min-height: 138px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  margin: 0 -28px;
  padding: 26px 28px 20px;
  backdrop-filter: saturate(180%) blur(16px);
}

.detail-heading {
  min-width: 0;
}

.detail-header h2 {
  max-width: 760px;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  margin: 7px 0 4px;
  font-size: 24px;
  font-weight: 680;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.detail-header h2.long-title {
  font-size: 20px;
  line-height: 1.32;
}

.id-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
}

.id-divider {
  width: 1px;
  height: 12px;
  margin: 0 5px;
  background: var(--line-strong);
}

.sync-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  gap: 6px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sync-state-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.sync-state.pending .sync-state-dot,
.sync-state.indexing .sync-state-dot {
  background: var(--orange);
}

.sync-state.active .sync-state-dot {
  background: var(--green);
}

.sync-state.error .sync-state-dot {
  background: var(--red);
}

.sync-state.archived .sync-state-dot,
.sync-state.not_published .sync-state-dot,
.sync-state.not_configured .sync-state-dot {
  background: var(--text-tertiary);
}

button.sync-retry {
  width: 24px;
  min-height: 24px;
  height: 24px;
  border: 0;
  padding: 3px;
}

button.sync-retry svg {
  width: 14px;
  height: 14px;
}

.detail-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.detail-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.status-label {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  background: var(--orange-soft);
  color: var(--orange);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
}

.status-label.approved {
  background: var(--blue-soft);
  color: #0568ce;
}

.status-label.active {
  background: var(--green-soft);
  color: var(--green);
}

.status-label.archived,
.status-label.superseded {
  background: #eeeeF1;
  color: var(--text-secondary);
}

.action-menu {
  position: relative;
}

.action-menu > summary {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}

.action-menu > summary::-webkit-details-marker {
  display: none;
}

.action-menu > summary:hover {
  background: var(--surface-hover);
}

.action-popover {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: 160px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 5px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
}

.action-popover button {
  width: 100%;
  min-height: 32px;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  padding: 5px 9px;
}

.action-popover button:hover {
  border: 0;
  background: var(--surface-hover);
}

.action-popover button.danger {
  color: var(--red);
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 20px 0;
}

.metadata-grid > div {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 0 24px;
}

.metadata-grid > div:first-child {
  padding-left: 0;
}

.metadata-grid > div:last-child {
  border-right: 0;
}

dt {
  color: var(--text-secondary);
  font-size: 12px;
}

dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.detail-section {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 650;
}

.rule-text {
  max-width: 780px;
  margin: 0;
  font-size: 15px;
  line-height: 1.72;
  white-space: pre-wrap;
}

.rule-text.is-collapsed {
  max-height: 244px;
  overflow: hidden;
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(80px, 1fr));
}

.scope-item {
  min-width: 0;
  border-left: 2px solid var(--line-strong);
  padding: 0 12px;
}

.scope-item:first-child {
  padding-left: 10px;
}

.scope-item span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-secondary);
  font-size: 11px;
}

.scope-item strong {
  display: block;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-definition {
  margin: 0;
}

.inline-definition > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  padding: 6px 0;
}

.inline-definition dd {
  margin: 0;
  font-weight: 400;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h3 {
  margin-bottom: 0;
}

.section-toggle {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-color: transparent;
  background: transparent;
  color: var(--blue);
  padding: 3px 2px;
  font-size: 12px;
}

.section-toggle:hover {
  border-color: transparent;
  background: transparent;
  text-decoration: underline;
}

.section-toggle svg {
  width: 13px;
  height: 13px;
  transition: transform 160ms ease;
}

.section-toggle.is-expanded svg {
  transform: rotate(180deg);
}

.source-toggle {
  margin: 7px 0 0 auto;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--blue);
  font-size: 12px;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.source-link svg {
  width: 13px;
  height: 13px;
}

blockquote {
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-left: 3px solid #b3bac4;
  border-radius: 0 7px 7px 0;
  background: var(--surface-raised);
  padding: 10px 12px;
  white-space: pre-wrap;
}

blockquote.is-collapsed {
  max-height: 190px;
  overflow: hidden;
}

.version-head,
.version-row {
  display: grid;
  grid-template-columns: 70px 100px minmax(110px, 1fr) minmax(150px, 1.4fr);
  gap: 12px;
}

.version-head {
  border-bottom: 1px solid var(--line);
  color: var(--text-tertiary);
  padding: 4px 0 8px;
  font-size: 11px;
}

.version-row {
  align-items: center;
  border-bottom: 1px solid #eeeeF1;
  padding: 9px 0;
}

.version-row:last-child {
  border-bottom: 0;
}

.version-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.version-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  content: "";
}

.version-status.active::before {
  background: var(--green);
}

.version-status.approved::before {
  background: var(--blue);
}

.version-status.archived::before,
.version-status.superseded::before {
  background: var(--text-tertiary);
}

.detail-audit {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 24px;
  padding: 16px 0 0;
  color: var(--text-tertiary);
  font-size: 11px;
}

dialog {
  width: min(800px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 0;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.23);
}

dialog::backdrop {
  background: rgba(25, 25, 28, 0.34);
  backdrop-filter: blur(3px);
}

dialog form {
  padding: 0 22px 20px;
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  margin: 0 -22px;
  padding: 16px 22px 14px;
  backdrop-filter: blur(14px);
}

.dialog-header p {
  margin: 0 0 2px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 20px;
}

.form-section {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.form-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.scope-form-grid {
  grid-template-columns: repeat(4, 1fr);
}

.form-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--red);
}

.form-note {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.dialog-footer {
  position: sticky;
  bottom: -20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  margin: 0 -22px -20px;
  padding: 13px 22px;
  backdrop-filter: blur(14px);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: 420px;
  border-radius: 7px;
  background: #252528;
  color: #fff;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.auth-gate {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(245, 245, 247, 0.96);
  padding: 24px;
  backdrop-filter: blur(16px);
}

.auth-panel {
  width: min(380px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 34px;
  text-align: center;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.1);
}

.auth-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  margin: 0 auto 18px;
}

.auth-icon svg {
  width: 24px;
  height: 24px;
}

.auth-panel p {
  margin: 0 0 4px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.auth-panel h2 {
  margin: 0;
  font-size: 24px;
}

.auth-panel > span:not(.auth-icon) {
  display: block;
  color: var(--text-secondary);
  margin: 9px 0 22px;
}

.auth-panel button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 148px;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 210px;
    --catalog-width: 350px;
  }

  .topbar {
    grid-template-columns: minmax(230px, 1fr) minmax(220px, 400px) minmax(320px, 1fr);
    gap: 12px;
  }

  .detail-pane {
    padding-right: 22px;
    padding-left: 22px;
  }

  .detail-header {
    margin-right: -22px;
    margin-left: -22px;
    padding-right: 22px;
    padding-left: 22px;
  }

  .scope-grid {
    grid-template-columns: repeat(3, minmax(90px, 1fr));
    gap: 16px 0;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .topbar {
    height: auto;
    grid-template-columns: 1fr auto;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .global-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .workspace {
    height: calc(100vh - 112px);
    grid-template-columns: 290px minmax(480px, 1fr);
  }

  .sidebar {
    display: none;
  }

  .catalog {
    grid-column: 1;
  }

  .detail-pane {
    grid-column: 2;
  }

  .actor-menu > summary #actorDisplay {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-right: 12px;
    padding-left: 12px;
  }

  .topbar-actions > .icon-button,
  .actor-menu {
    display: none;
  }

  .command-button {
    width: 38px;
    min-width: 38px;
    overflow: hidden;
    justify-content: flex-start;
    color: transparent;
    gap: 20px;
    padding: 0 10px;
  }

  .command-button svg {
    color: #fff;
  }

  .global-search input {
    padding-right: 10px;
  }

  .workspace {
    height: auto;
    min-height: calc(100vh - 112px);
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .catalog,
  .detail-pane {
    grid-column: 1;
  }

  .catalog {
    max-height: 360px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .knowledge-list {
    max-height: 288px;
  }

  .detail-pane {
    overflow: visible;
    padding: 0 16px 40px;
  }

  .detail-header {
    position: static;
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin: 0 -16px;
    padding: 20px 16px 16px;
  }

  .detail-header h2 {
    font-size: 21px;
  }

  .detail-actions {
    justify-content: flex-start;
  }

  .metadata-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 0;
  }

  .metadata-grid > div:nth-child(2) {
    border-right: 0;
  }

  .metadata-grid > div:nth-child(3) {
    padding-left: 0;
  }

  .scope-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .version-head,
  .version-row {
    grid-template-columns: 48px 80px minmax(0, 1fr);
  }

  .version-head span:nth-child(4),
  .version-row span:nth-child(4) {
    display: none;
  }

  .form-grid,
  .scope-form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

  dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
}
