/* Shared console shell. Business pages keep their own content styles. */
body.claude-shell {
  --shell-sidebar-width: 248px;
  --shell-toolbar-height: 56px;
  --shell-content-gutter: 28px;
  background: var(--surface-bg);
}

.claude-shell .app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding-left: var(--shell-sidebar-width);
}

.claude-shell.top-layout .main-content {
  width: 100%;
  margin-left: 0 !important;
  padding: calc(var(--topbar-offset, var(--shell-toolbar-height)) + 24px) var(--shell-content-gutter) 36px;
  transition: none;
}

.claude-shell .content-area {
  width: 100%;
  min-width: 0;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.claude-shell .topbar {
  left: var(--shell-sidebar-width);
  right: 0;
  height: var(--shell-toolbar-height);
  min-height: var(--shell-toolbar-height);
  padding: 0 var(--shell-content-gutter);
  gap: 16px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  background: var(--surface-bg);
  border-bottom: 1px solid var(--surface-border);
  box-shadow: none;
  backdrop-filter: none;
  z-index: var(--z-sticky);
}

.claude-shell .shell-topbar-left {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.claude-shell .shell-breadcrumb {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.claude-shell .shell-console-label,
.claude-shell .shell-breadcrumb-divider {
  color: var(--neutral-500);
  flex: none;
}

.claude-shell .shell-page-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--neutral-900);
  font-weight: 600;
}

.claude-shell .topbar-right {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  order: initial;
  gap: 6px;
  margin-left: auto;
}

.claude-shell .topbar-right .theme-trigger,
.claude-shell .topbar-right .lang-dropdown-trigger {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  background: var(--surface-bg-strong);
  color: var(--neutral-700);
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}

.claude-shell .topbar-right .theme-trigger:hover,
.claude-shell .topbar-right .lang-dropdown-trigger:hover,
.claude-shell .topbar-right .theme-switcher.open .theme-trigger,
.claude-shell .topbar-right .lang-dropdown.open .lang-dropdown-trigger {
  background: var(--surface-hover);
  border-color: var(--surface-border-strong);
  color: var(--neutral-900);
}

.claude-shell .topbar-right .btn {
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  background: var(--surface-bg-strong);
  color: var(--neutral-700);
  box-shadow: none;
}

.claude-shell .topbar-right .btn:hover {
  background: var(--surface-hover);
  border-color: var(--surface-border-strong);
  color: var(--neutral-900);
}

.claude-shell .shell-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--shell-sidebar-width);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-bg-muted);
  border-right: 1px solid var(--surface-border);
  z-index: calc(var(--z-sticky) + 1);
}

.claude-shell .shell-sidebar-header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: var(--shell-toolbar-height);
  padding: 10px 16px;
  border-bottom: 1px solid var(--surface-border);
}

.claude-shell .shell-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
  color: var(--neutral-900);
  border-radius: 8px;
}

.claude-shell .brand-logo {
  display: block;
  width: 24px;
  height: 24px;
  flex: none;
}

.claude-shell .shell-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}

.claude-shell .shell-brand-name {
  font-family: var(--font-family-sans);
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--neutral-900);
  white-space: nowrap;
}

.claude-shell .shell-brand-caption {
  color: var(--neutral-500);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.claude-shell .shell-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 14px 10px 18px;
}

.claude-shell .topnav {
  display: flex;
  flex-direction: column;
  flex: none;
  align-items: stretch;
  justify-content: flex-start;
  order: initial;
  width: 100%;
  gap: 20px;
  padding: 0;
  overflow: visible;
  white-space: normal;
}

.claude-shell .shell-nav-group {
  min-width: 0;
}

.claude-shell .shell-nav-heading {
  padding: 0 10px;
  margin: 0 0 6px;
  color: var(--neutral-500);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.claude-shell .shell-nav-links {
  display: grid;
  gap: 2px;
}

.claude-shell .topnav-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--neutral-600);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.claude-shell .topnav-link svg {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
  opacity: 0.72;
  transition: opacity var(--duration-fast), color var(--duration-fast);
}

.claude-shell .topnav-link:hover {
  background: var(--surface-hover);
  color: var(--neutral-900);
}

.claude-shell .topnav-link:hover svg {
  opacity: 0.92;
}

.claude-shell .topnav-link.active {
  background: var(--surface-bg-strong);
  border-color: var(--surface-border);
  box-shadow: 0 1px 2px rgba(20, 20, 19, 0.04);
  color: var(--neutral-900);
  font-weight: 600;
}

.claude-shell .topnav-link.active svg {
  color: var(--primary-600);
  opacity: 1;
}

.claude-shell .shell-sidebar-footer {
  flex: none;
  min-height: 48px;
  padding: 8px 12px;
  border-top: 1px solid var(--surface-border);
}

.claude-shell .shell-sidebar .version-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.claude-shell .shell-sidebar .version-badge {
  min-height: 32px;
  min-width: 0;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--neutral-500);
}

.claude-shell .shell-sidebar #version-display {
  max-width: 22ch;
}

.claude-shell .shell-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 8px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--neutral-700);
  cursor: pointer;
}

.claude-shell .shell-icon-button:hover {
  background: var(--surface-hover);
  color: var(--neutral-900);
}

.claude-shell .shell-menu-button,
.claude-shell .shell-drawer-close,
.claude-shell .shell-drawer-backdrop {
  display: none;
}

.claude-shell .shell-sidebar a:focus-visible,
.claude-shell .shell-icon-button:focus-visible,
.claude-shell .topbar-right button:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

@media (max-width: 1200px) {
  body.claude-shell {
    --shell-content-gutter: 22px;
  }
}

@media (max-width: 1024px) {
  body.claude-shell {
    --shell-content-gutter: 20px;
  }

  .claude-shell .app-container {
    padding-left: 0;
  }

  .claude-shell .topbar {
    left: 0;
  }

  .claude-shell .shell-sidebar {
    width: 280px;
    max-width: calc(100vw - 48px);
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform var(--duration-normal) var(--timing-function);
    z-index: calc(var(--z-dropdown) + 2);
    box-shadow: var(--shadow-lg);
  }

  .claude-shell .shell-sidebar-header {
    padding: 12px 14px 12px 16px;
  }

  .claude-shell .shell-menu-button,
  .claude-shell .shell-drawer-close {
    display: inline-flex;
  }

  .claude-shell .shell-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.34);
    z-index: calc(var(--z-dropdown) + 1);
  }

  .claude-shell.shell-drawer-open {
    overflow: hidden;
  }

  .claude-shell.shell-drawer-open .shell-sidebar {
    visibility: visible !important;
    transform: translateX(0) !important;
    transition-property: transform;
  }

  /* Visibility is inherited. Keep the open drawer contents discoverable when
     another page stylesheet has hidden the sidebar subtree. */
  .claude-shell.shell-drawer-open .shell-sidebar,
  .claude-shell.shell-drawer-open .shell-sidebar * {
    visibility: visible !important;
    animation: none !important;
    transition: none !important;
  }

  .claude-shell .topnav-link {
    min-height: 40px;
  }

  .claude-shell .shell-sidebar .version-badge,
  .claude-shell .shell-sidebar .github-link {
    min-height: 40px;
  }

  .claude-shell .shell-sidebar .github-link {
    width: 40px;
  }
}

@media (max-width: 640px) {
  body.claude-shell {
    --shell-content-gutter: 14px;
  }

  .claude-shell.top-layout .main-content {
    padding-top: calc(var(--topbar-offset, var(--shell-toolbar-height)) + 16px);
    padding-bottom: 24px;
  }

  .claude-shell .topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .claude-shell .shell-topbar-left,
  .claude-shell .shell-breadcrumb {
    gap: 4px;
  }

  .claude-shell .shell-console-label,
  .claude-shell .shell-breadcrumb-divider {
    display: none;
  }

  .claude-shell .topbar-right {
    gap: 4px;
  }

  .claude-shell .topbar-right .theme-trigger,
  .claude-shell .topbar-right .lang-dropdown-trigger {
    min-width: 40px;
    height: 40px;
  }

  .claude-shell .topbar-right .btn {
    min-height: 40px;
    height: 40px;
    padding: 0 10px;
    font-size: 12px;
  }

  .claude-shell .lang-dropdown-trigger .lang-arrow {
    display: none;
  }

  .claude-shell .shell-page-label {
    max-width: 9em;
  }
}

/* Page refinements load after each page's data-layout stylesheet. */
.claude-shell .card {
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}

.claude-shell .btn {
  border-radius: 7px;
  font-weight: 500;
}

.claude-shell .page-title {
  font-family: var(--font-family-sans);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--neutral-900);
}

.claude-shell .page-subtitle {
  max-width: 78ch;
  color: var(--neutral-600);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 400;
  text-wrap: pretty;
}

/* Simple pages whose header only echoes the topbar breadcrumb hide the duplicate bare h1 on desktop */
.claude-shell .shell-simple-title {
  margin: 0 0 18px;
}

@media (min-width: 641px) {
  .claude-shell .shell-simple-title {
    display: none;
  }
}

.claude-shell .content-area > .member-head,
.claude-shell .content-area > header .card {
  padding: 0 0 20px !important;
  margin: 0 0 4px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  transition: none;
}

.claude-shell .member-section-head h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.claude-shell .member-metric-value {
  letter-spacing: -0.02em;
  font-weight: 600;
}

.claude-shell .member-metric-label,
.claude-shell .member-note {
  color: var(--neutral-600);
}

.claude-shell .member-table th {
  background: var(--neutral-50);
}

.claude-shell .member-table-wrap {
  border-radius: 8px;
}

@media (max-width: 640px) {
  .claude-shell .page-title {
    font-size: 20px;
  }

  .claude-shell .member-head {
    gap: 16px;
  }

  .claude-shell .btn {
    min-height: 40px;
  }

  .claude-shell .form-input {
    min-height: 42px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
