:root {
  color: #18212f;
  background: #edf1f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

.application-shell {
  display: grid;
  grid-template: 64px minmax(0, 1fr) / 264px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  transition: grid-template-columns 180ms ease;
}

.application-shell.navigation-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.top-bar {
  z-index: 30;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 22px;
  color: #fff;
  background: #172433;
  box-shadow: 0 2px 8px rgb(15 23 42 / 16%);
}

.top-bar-leading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.brand,
.session-area,
.user-summary {
  display: flex;
  align-items: center;
}

.menu-toggle {
  position: relative;
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: #f4f7fa;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}

.menu-toggle::before {
  width: 18px;
  height: 2px;
  content: "";
  background: currentcolor;
  border-radius: 2px;
  box-shadow: 0 -6px currentcolor, 0 6px currentcolor;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  color: #75d5c3;
  background: rgb(255 255 255 / 8%);
  border-color: #536577;
  outline: 0;
}

.mobile-menu-toggle {
  display: none;
}

.brand {
  gap: 11px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #172433;
  background: #75d5c3;
  border-radius: 9px;
}

.session-area {
  gap: 16px;
}

.user-summary {
  align-items: flex-end;
  flex-direction: column;
  line-height: 1.25;
}

.user-summary small,
.session-area > small {
  color: #b7c4d3;
}

.primary-button,
.secondary-button {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 650;
}

.primary-button {
  color: #10232b;
  background: #75d5c3;
}

.secondary-button {
  color: #f4f7fa;
  background: transparent;
  border-color: #536577;
}

.primary-button:hover,
.secondary-button:hover {
  filter: brightness(1.08);
}

.sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  color: #263445;
  background: #f8fafc;
  border-right: 1px solid #d8e0e8;
  opacity: 1;
  transition: opacity 140ms ease, visibility 140ms ease;
}

.navigation-collapsed .sidebar {
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  border-right: 0;
}

.sidebar-heading {
  position: relative;
  display: block;
  padding: 14px 12px 12px;
  color: #667587;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-search {
  position: relative;
  width: 100%;
}

.page-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  color: #263445;
  background: #fff;
  border: 1px solid #cbd6e0;
  border-radius: 6px;
  outline: 0;
  font-size: 13px;
  letter-spacing: normal;
  text-transform: none;
}

.page-search input:focus {
  border-color: #62b9aa;
  box-shadow: 0 0 0 3px rgb(117 213 195 / 22%);
}

.page-search-results {
  position: absolute;
  z-index: 8;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  max-height: min(60vh, 420px);
  padding: 5px;
  overflow-y: auto;
  color: #6b7886;
  background: #fff;
  border: 1px solid #cbd6e0;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgb(28 45 61 / 18%);
  font-size: 12px;
  letter-spacing: normal;
  text-transform: none;
}

.page-search-result {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 2px;
  padding: 8px 9px;
  color: #263e52;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
}

.page-search-result:hover,
.page-search-result:focus-visible {
  background: #d9f2ed;
  outline: 0;
}

.page-search-result span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-search-result small {
  overflow: hidden;
  color: #778697;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-count-badge {
  display: grid;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  place-items: center;
  color: #405266;
  background: #e7edf3;
  border-radius: 12px;
}

.page-navigation .page-folder .entity-count-badge {
  margin-left: auto;
  color: #405266;
  font-size: 11px;
}

.page-navigation {
  min-height: 0;
  padding: 0 10px 18px;
  overflow-y: auto;
  scrollbar-color: #aab6c2 transparent;
  scrollbar-width: thin;
}

.page-navigation ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.page-navigation li + li {
  margin-top: 3px;
}

.page-navigation a {
  display: flex;
  padding: 10px 11px;
  color: #354558;
  border-radius: 7px;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}

.page-navigation .page-folder {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  color: #354558;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.page-navigation .page-folder:hover {
  background: #edf2f6;
}

.page-navigation a:hover {
  background: #edf2f6;
}

.page-navigation a.active {
  color: #112f35;
  background: #d9f2ed;
  box-shadow: inset 3px 0 #278978;
}

.page-navigation a span {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-navigation a small {
  overflow: hidden;
  color: #778697;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-navigation {
  padding: 12px;
  color: #7a8897;
  font-size: 13px;
}

.navigation-backdrop {
  display: none;
}

.content-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
}

.content-panel > #jsx-page-host,
.content-panel > .page-surface,
.content-panel > .archisource-page {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.content-panel > #jsx-page-host {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.content-panel > #jsx-page-host > .archisource-page {
  flex: 1 1 auto;
  min-height: 0;
}

.page-surface,
.status-panel {
  width: 100%;
  min-height: 180px;
  padding: 0;
  margin: 0;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 100%;
}

.content-panel > .markdown-page {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.status-panel {
  display: grid;
  color: #637184;
  place-items: center;
  text-align: center;
}

.status-panel.error {
  color: #8d3030;
  background: #fff9f9;
  border-color: #efc9c9;
}

.archisource-page .page-heading {
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e7ebef;
}

.archisource-page h1,
.archisource-page h2,
.archisource-page h3 {
  color: #1e2c3c;
}

.archisource-page h1 {
  margin: 0;
  font-size: 28px;
}

.archisource-page .page-section + .page-section {
  margin-top: 28px;
}

.archisource-page p,
.archisource-page li {
  line-height: 1.65;
}

.archisource-page pre {
  padding: 16px;
  overflow: auto;
  color: #d9e4ef;
  background: #172433;
  border-radius: 7px;
}

@media (max-width: 720px) {
  .application-shell {
    grid-template: 64px minmax(0, 1fr) / 1fr;
  }

  .application-shell.navigation-collapsed {
    grid-template-columns: 1fr;
  }

  .desktop-menu-toggle {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-grid;
  }

  .top-bar {
    padding: 0 12px;
  }

  .sidebar {
    position: fixed;
    z-index: 24;
    top: 64px;
    bottom: 0;
    left: 0;
    width: min(86vw, 320px);
    max-height: none;
    visibility: hidden;
    opacity: 0;
    border-right: 1px solid #cbd6e0;
    box-shadow: 10px 0 28px rgb(15 23 42 / 24%);
    transform: translateX(-102%);
    transition: transform 180ms ease, opacity 180ms ease, visibility 180ms ease;
  }

  .navigation-collapsed .sidebar,
  .sidebar.mobile-open {
    overflow: visible;
  }

  .sidebar.mobile-open {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
  }

  .navigation-backdrop {
    position: fixed;
    z-index: 23;
    inset: 64px 0 0;
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    background: rgb(15 23 42 / 42%);
    border: 0;
    cursor: default;
  }

  .content-panel {
    padding: 0;
  }

  .page-surface,
  .status-panel {
    padding: 0;
  }

  .user-summary {
    display: none;
  }

  .session-area {
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .application-shell,
  .sidebar {
    transition: none;
  }
}
