:root {
  --bg: #e9ecf0;
  --bg-strong: #dfe4e8;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: rgba(248, 250, 252, 0.96);
  --panel-dark: #17283d;
  --line: rgba(23, 40, 61, 0.12);
  --line-strong: rgba(23, 40, 61, 0.18);
  --text: #18212c;
  --muted: #5c6d80;
  --accent: #0c8a73;
  --accent-soft: rgba(12, 138, 115, 0.1);
  --rose: #b2485d;
  --amber: #9a6500;
  --blue: #2d5d99;
  --shadow: 0 24px 60px rgba(14, 26, 42, 0.12);
  --radius: 28px;
  --radius-sm: 18px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(12, 138, 115, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(45, 93, 153, 0.14), transparent 20%),
    linear-gradient(180deg, #f4f1eb 0%, var(--bg) 48%, var(--bg-strong) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(24, 33, 44, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 44, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
}

#app {
  position: relative;
  z-index: 1;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--panel-dark);
  color: white;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 120ms ease;
  z-index: 4;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.primary-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  background: rgba(248, 244, 236, 0.88);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 24px;
}

.brand-lockup {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0c8a73, #2d5d99);
  color: white;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.1;
}

.brand-copy,
.nav-link-copy,
.topbar p,
.mini-copy,
.shortcut-card p,
.hero-card p,
.list-card p,
.empty-state p,
.empty-inline,
.nav-foot p,
.definition-item dd,
.text-link {
  color: var(--muted);
}

.nav-stack,
.list-stack,
.stack {
  display: grid;
  gap: 12px;
}

.nav-pane,
.nav-group {
  display: grid;
}

.nav-pane {
  gap: 18px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.nav-group {
  gap: 10px;
}

.nav-group-title {
  padding: 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.nav-link {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 22px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.42);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  transform: translateX(2px);
  border-color: rgba(12, 138, 115, 0.18);
  background: rgba(255, 255, 255, 0.86);
}

.nav-link-mark {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(12, 138, 115, 0.08);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.nav-link-label,
.mini-value,
.detail-title,
.metric-value {
  font-weight: 700;
}

.nav-foot {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
}

.shell-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  overflow: hidden;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  margin-bottom: 0;
}

.topbar h1,
.auth-panel h1,
.page-header-surface h2,
.hero-card h2,
.surface h3,
.list-card h4,
.capability-card h4 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.topbar-kicker,
.section-kicker,
.hero-card-kicker,
.mini-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--accent);
}

.status-stack,
.card-actions,
.tag-row,
.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.breadcrumbs,
.loading-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumbs {
  margin-top: 14px;
  font-size: 14px;
}

.page-header-surface .breadcrumbs {
  margin-top: 0;
  margin-bottom: 16px;
}

.breadcrumb-link,
.breadcrumb-current {
  color: var(--muted);
}

.breadcrumb-link {
  text-decoration: none;
}

.breadcrumb-current {
  font-weight: 700;
  color: var(--panel-dark);
}

.breadcrumb-sep {
  color: rgba(92, 109, 128, 0.6);
}

.status-pill,
.user-pill,
.pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.status-stack {
  justify-content: flex-end;
}

.topbar-main,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-main {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.topbar-main p,
.auth-panel-auth .page-copy {
  margin: 0;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-utilities {
  gap: 8px;
}

.page-header-surface {
  display: grid;
  gap: 14px;
  margin-bottom: 0;
}

.page-header-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.page-copy,
.module-nav-copy {
  color: var(--muted);
}

.page-header-meta {
  display: flex;
  justify-content: flex-end;
}

.module-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.module-nav-link {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
}

.module-nav-link:hover,
.module-nav-link.is-active {
  transform: translateY(-1px);
  border-color: rgba(12, 138, 115, 0.2);
  background: rgba(255, 255, 255, 0.88);
}

.module-nav-label {
  font-weight: 700;
}

.card-actions-tight {
  justify-content: flex-end;
}

.status-pill,
.user-pill {
  max-width: min(100%, 420px);
  overflow-wrap: anywhere;
}

.status-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.user-pill {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.user-pill-copy {
  color: var(--muted);
  font-size: 12px;
}

.user-menu {
  position: relative;
}

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

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(360px, calc(100vw - 48px));
  padding: 18px;
  border-radius: 22px;
  background: rgba(250, 252, 255, 0.98);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  z-index: 2;
}

.user-menu:not([open]) .user-menu-panel {
  display: none;
}

.status-loading {
  color: var(--blue);
  border-color: rgba(45, 93, 153, 0.18);
  background: rgba(45, 93, 153, 0.08);
}

.page-content {
  display: grid;
  gap: 24px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.auth-shell,
.state-shell {
  min-height: 100vh;
  padding: 48px 32px;
  display: grid;
  place-items: center;
}

.auth-shell {
  grid-template-columns: minmax(320px, 460px);
}

.auth-panel,
.state-shell-card,
.state-panel {
  width: min(100%, 720px);
  padding: 28px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-panel {
  display: grid;
  gap: 18px;
}

.auth-panel-auth {
  width: min(100%, 460px);
}

.auth-panel-head {
  margin-bottom: 0;
}

.state-shell-card,
.state-panel {
  display: grid;
  gap: 18px;
}

.state-panel {
  max-width: 760px;
}

.state-panel-body {
  display: grid;
  gap: 12px;
}

.home-grid .hero-strip {
  grid-column: span 12;
}

.hero-strip {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.surface,
.hero-card,
.sub-surface {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.surface-accent {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 249, 250, 0.94)),
    radial-gradient(circle at top left, rgba(12, 138, 115, 0.08), transparent 24%);
}

.shell-notice {
  padding: 18px 24px;
}

.surface-empty {
  min-height: 280px;
  display: grid;
  place-items: center;
}

.hero-card {
  display: grid;
  gap: 14px;
}

.hero-card-wide {
  background:
    linear-gradient(145deg, rgba(12, 138, 115, 0.1), rgba(45, 93, 153, 0.08)),
    var(--panel);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.metric-strip-compact .metric-value {
  font-size: 28px;
}

.metric-card,
.mini-card,
.shortcut-card,
.list-card {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.metric-value {
  font-size: 34px;
  line-height: 1;
  color: var(--panel-dark);
}

.shortcut-card,
.text-link {
  text-decoration: none;
  color: inherit;
}

.shortcut-grid,
.capability-grid,
.docs-grid {
  display: grid;
  gap: 14px;
}

.shortcut-grid,
.docs-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.capability-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.capability-card {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.capability-top,
.section-head,
.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.section-head {
  margin-bottom: 18px;
}

.section-head-gap {
  margin-top: 22px;
}

.section-subhead {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--panel-dark);
}

.risk-low {
  color: var(--accent);
  border-color: rgba(12, 138, 115, 0.18);
  background: rgba(12, 138, 115, 0.08);
}

.risk-medium {
  color: var(--amber);
  border-color: rgba(154, 101, 0, 0.18);
  background: rgba(154, 101, 0, 0.08);
}

.risk-high {
  color: var(--rose);
  border-color: rgba(178, 72, 93, 0.18);
  background: rgba(178, 72, 93, 0.08);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span,
.checkbox span {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.checkbox {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 13px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0c8a73, #2d5d99);
  color: white;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.button.subtle {
  background: rgba(255, 255, 255, 0.88);
  color: var(--panel-dark);
  border: 1px solid var(--line);
}

.button[disabled] {
  opacity: 0.56;
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav-link:focus-visible,
.module-nav-link:focus-visible,
.shortcut-card:focus-visible,
.breadcrumb-link:focus-visible,
.status-link:focus-visible,
.list-button:focus-visible,
.tab-button:focus-visible {
  outline: 3px solid rgba(12, 138, 115, 0.22);
  outline-offset: 2px;
}

.button:hover,
.nav-link:hover,
.list-button:hover,
.tab-button:hover,
.shortcut-card:hover,
.list-card:hover {
  filter: brightness(1.01);
}

.console {
  margin: 0;
  min-height: 180px;
  padding: 16px;
  border-radius: 20px;
  background: #101925;
  color: #edf4ff;
  overflow: auto;
  line-height: 1.6;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.empty-inline {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px dashed var(--line-strong);
}

.state-banner {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.state-banner-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.state-banner p {
  margin: 0;
  line-height: 1.6;
}

.loading-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(45, 93, 153, 0.08);
  border: 1px solid rgba(45, 93, 153, 0.14);
  color: var(--blue);
}

.loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  animation: pulse-dot 1.1s ease-in-out infinite;
}

.state-success {
  background: rgba(12, 138, 115, 0.08);
  border-color: rgba(12, 138, 115, 0.18);
}

.state-info {
  background: rgba(45, 93, 153, 0.08);
  border-color: rgba(45, 93, 153, 0.16);
}

.state-warn {
  background: rgba(154, 101, 0, 0.08);
  border-color: rgba(154, 101, 0, 0.16);
}

.state-error {
  background: rgba(178, 72, 93, 0.08);
  border-color: rgba(178, 72, 93, 0.16);
}

.empty-state {
  max-width: 420px;
  text-align: center;
  display: grid;
  gap: 14px;
}

.empty-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(23, 40, 61, 0.08);
  text-align: left;
  vertical-align: top;
}

.data-table td {
  color: var(--muted);
  max-width: 240px;
  word-break: break-word;
}

.data-table tr.is-selected td {
  background: rgba(12, 138, 115, 0.08);
}

.definition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0;
}

.definition-item {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.definition-item dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 8px;
}

.definition-item dd {
  margin: 0;
  line-height: 1.6;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 16px;
}

.sub-surface {
  padding: 18px;
  box-shadow: none;
}

.list-card {
  display: grid;
  gap: 12px;
}

.browser-tree {
  display: grid;
  gap: 14px;
}

.browser-tree-group {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.browser-tree-title {
  font-weight: 700;
  color: var(--panel-dark);
}

.browser-tree-subtitle,
.browser-tree-meta {
  font-size: 13px;
  color: var(--muted);
}

.browser-tree-button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.browser-tree-object {
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.list-card.is-active,
.list-button.is-active,
.tab-button.is-active,
.shortcut-card-active {
  border-color: rgba(12, 138, 115, 0.24);
  background: rgba(12, 138, 115, 0.08);
}

.list-button,
.tab-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: inherit;
  padding: 12px 14px;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
}

.tight-list {
  max-height: 460px;
  overflow: auto;
}

.detail-copy,
.mini-copy,
.nav-link-copy,
.shortcut-card p,
.hero-card p,
.list-card p {
  line-height: 1.6;
  margin: 0;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions-vertical {
  flex-direction: column;
  align-items: flex-start;
}

.table-actions .button {
  padding: 9px 12px;
}

.table-primary {
  font-weight: 700;
  color: var(--panel-dark);
}

.table-text-link {
  font-size: 13px;
}

.report-section,
.drawer-section {
  margin-top: 18px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3;
  background: rgba(16, 25, 37, 0.28);
  display: flex;
  justify-content: flex-end;
  padding: 18px;
}

.drawer-panel {
  width: min(680px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(247, 249, 252, 0.98);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.82);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.detail-header {
  margin-bottom: 14px;
}

.detail-title {
  font-size: 28px;
  font-family: Georgia, "Times New Roman", serif;
}

.span-8 {
  grid-column: span 8;
}

.span-7 {
  grid-column: span 7;
}

.span-6 {
  grid-column: span 6;
}

.span-5 {
  grid-column: span 5;
}

.span-4 {
  grid-column: span 4;
}

code {
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .primary-nav {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .shell-main {
    padding-top: 20px;
    height: auto;
  }
}

@media (max-width: 980px) {
  .auth-shell,
  .hero-strip,
  .two-column,
  .topbar,
  .page-header-main {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  .module-nav {
    grid-template-columns: 1fr 1fr;
  }

  .span-8,
  .span-7,
  .span-6,
  .span-5,
  .span-4 {
    grid-column: span 12;
  }
}

@media (max-width: 720px) {
  .auth-shell,
  .state-shell {
    padding: 24px 18px;
  }

  .shell-main,
  .primary-nav {
    padding: 18px;
  }

  .topbar,
  .auth-panel,
  .state-shell-card,
  .state-panel,
  .surface,
  .hero-card {
    padding: 20px;
    border-radius: 22px;
  }

  .page-grid {
    gap: 14px;
  }

  .metric-strip,
  .shortcut-grid,
  .docs-grid,
  .capability-grid,
  .definition-grid,
  .module-nav {
    grid-template-columns: 1fr;
  }

  .user-menu-panel {
    right: auto;
    left: 0;
    width: min(100%, 320px);
  }

  .drawer-backdrop {
    padding: 0;
  }

  .drawer-panel {
    max-height: 100vh;
    border-radius: 24px 24px 0 0;
  }
}
