:root {
  --bg: #0b1016;
  --bg-2: #101720;
  --panel: rgba(17, 24, 33, 0.9);
  --panel-2: rgba(12, 18, 26, 0.94);
  --field: #121b25;
  --field-2: #0d141d;
  --text: #ebf2fb;
  --muted: #8f9cac;
  --line: rgba(171, 189, 210, 0.14);
  --accent: #4fc3a1;
  --accent-2: #7aa2ff;
  --danger: #ff6f7d;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI Variable", "Aptos", "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(79, 195, 161, 0.08), transparent 22%),
    radial-gradient(circle at top right, rgba(122, 162, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #0b1016 0%, #0d131b 45%, #090d12 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.icon-sprite {
  position: absolute;
}

.icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 20px 16px;
  background: linear-gradient(180deg, rgba(8, 13, 18, 0.96), rgba(11, 16, 22, 0.98));
  color: var(--text);
  border-right: 1px solid var(--line);
}

.brand__eyebrow,
.section-head p,
label span,
.meta-lines,
.item-card__top p {
  color: var(--muted);
}

.brand__title {
  margin-top: 6px;
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.1;
}

.brand__mission {
  margin-top: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

.nav {
  margin-top: 24px;
  display: grid;
  gap: 8px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: #d4deeb;
}

.nav a:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.content {
  padding: 18px;
}

.banner {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(79, 195, 161, 0.22);
  border-radius: 12px;
  background: rgba(79, 195, 161, 0.08);
  color: #dff8f0;
}

.overview,
.panel,
.mini-stat {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.overview {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.overview__main h1 {
  margin: 12px 0 4px;
  font-size: 1.55rem;
  line-height: 1.1;
}

.overview__url {
  margin: 0;
  color: var(--muted);
  word-break: break-word;
}

.overview__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-content: start;
}

.mini-stat {
  padding: 12px;
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.mini-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.35rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-grid--single {
  grid-template-columns: 1fr;
}

.panel {
  padding: 16px;
}

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

.section-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 1.04rem;
}

.section-head p {
  margin: 0;
  line-height: 1.35;
  font-size: 0.88rem;
}

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

label {
  display: grid;
  gap: 6px;
}

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

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

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

input::placeholder,
textarea::placeholder {
  color: #677587;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(122, 162, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.12);
}

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

.switch-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 2px 0;
}

.switch-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #273240;
  border: 1px solid rgba(171, 189, 210, 0.15);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d7e2ef;
  transition: transform 0.2s ease, background 0.2s ease;
}

.switch-field input:checked + .switch {
  background: rgba(79, 195, 161, 0.28);
  border-color: rgba(79, 195, 161, 0.45);
}

.switch-field input:checked + .switch::after {
  transform: translateX(18px);
  background: #7cf0cf;
}

.switch-field__text {
  color: var(--text);
  font-size: 0.92rem;
}

.sub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

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

button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #2aa383);
  color: #08110f;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

.danger {
  background: linear-gradient(135deg, var(--danger), #ff4f62);
  color: white;
}

.stack {
  display: grid;
  gap: 10px;
}

.item-card,
.timeline-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}

.item-card__top,
.timeline-item__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.item-card__top h3,
.timeline-item__head strong {
  margin: 0;
  font-size: 0.96rem;
}

.item-card__top p,
.item-card__note,
.timeline-item p {
  margin: 4px 0 0;
}

.item-card__note {
  white-space: pre-wrap;
  color: #c6d2e1;
  font-size: 0.9rem;
}

.inline-form {
  margin-top: 10px;
}

.pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(79, 195, 161, 0.08);
  border: 1px solid rgba(79, 195, 161, 0.16);
  color: #9ae6d1;
  font-size: 0.8rem;
}

.pill--accent {
  background: rgba(122, 162, 255, 0.1);
  border-color: rgba(122, 162, 255, 0.18);
  color: #aac2ff;
}

.pill--muted {
  background: rgba(143, 156, 172, 0.08);
  border-color: rgba(143, 156, 172, 0.12);
  color: #92a0b2;
}

.meta-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  font-size: 0.84rem;
}

.entry-body,
.timeline-item__payload {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--field-2);
  border: 1px solid rgba(171, 189, 210, 0.08);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Iosevka", "Cascadia Mono", "SFMono-Regular", monospace;
  font-size: 0.84rem;
  color: #d5e2f1;
}

.note-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.note-chip {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(171, 189, 210, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.note-chip strong {
  font-size: 0.8rem;
  color: #9ae6d1;
}

.note-chip span {
  color: #c9d6e5;
  font-size: 0.88rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.model-card,
.org-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.model-card__head,
.org-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.model-card p,
.org-card__head span {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.org-chart {
  overflow-x: auto;
  padding-bottom: 4px;
}

.org-chart__roots,
.org-chart__children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.org-chart__roots {
  display: flex;
  justify-content: center;
}

.org-chart__node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 240px;
  padding: 0 8px;
}

.org-chart__children {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 18px;
}

.org-chart__children::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 18px;
  background: var(--line);
}

.org-chart__node > .org-card {
  width: 100%;
  max-width: 280px;
}

.org-chart__children > .org-chart__node::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 50%;
  width: 1px;
  height: 18px;
  background: var(--line);
}

.org-chart__children > .org-chart__node::after {
  content: "";
  position: absolute;
  top: -18px;
  left: calc(-50% + 4px);
  width: calc(100% - 8px);
  height: 1px;
  background: var(--line);
}

.org-chart__children > .org-chart__node:first-child::after {
  left: 50%;
  width: calc(50% - 4px);
}

.org-chart__children > .org-chart__node:last-child::after {
  left: 4px;
  width: calc(50% - 4px);
}

.org-card__meta {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.timeline-item p {
  color: var(--muted);
  font-size: 0.88rem;
}

.empty {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(171, 189, 210, 0.18);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

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

  .sidebar {
    position: static;
    min-height: auto;
  }

  .overview,
  .panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .content {
    padding: 10px;
  }

  .panel,
  .overview,
  .mini-stat {
    padding: 12px;
  }

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

  .overview__stats {
    grid-template-columns: 1fr;
  }
}
