.docs-shell {
  min-height: 100vh;
  background: var(--docs-bg);
}

.docs-sidebar {
  background: var(--docs-surface);
  border-right-color: var(--docs-border);
}

.docs-sidebar .app-nav a.is-active {
  background: var(--green-active);
}

.docs-content {
  width: 100%;
  max-width: 980px;
  padding: 40px 48px 64px;
  margin: 0 auto;
}

.docs-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--green-active);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.docs-kicker::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.docs-content h1 {
  margin: 0 0 12px;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.9px;
  line-height: 1.15;
}

.docs-lead {
  max-width: 760px;
  margin: 0 0 28px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.65;
}

.docs-section {
  padding-top: 8px;
  margin-top: 34px;
}

.docs-section h2 {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.docs-section h3 {
  margin: 24px 0 8px;
  font-size: 17px;
  font-weight: 600;
}

.docs-section p,
.docs-section li {
  color: #3f3f3f;
  font-size: 14px;
  line-height: 1.7;
}

.docs-section p {
  margin: 0 0 12px;
}

.docs-section ul,
.docs-section ol {
  padding-left: 22px;
  margin: 8px 0 16px;
}

.docs-section li {
  margin-bottom: 6px;
}

.docs-section a {
  color: var(--green-active);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(121, 178, 89, 0.35);
}

.docs-section a:hover {
  border-bottom-color: var(--green);
}

.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 8px;
}

.docs-card {
  display: flex;
  flex-direction: column;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.16s, transform 0.16s, box-shadow 0.16s;
}

.docs-card:hover {
  border-color: var(--green);
  box-shadow: 0 10px 26px rgba(121, 178, 89, 0.12);
  transform: translateY(-2px);
}

.docs-card .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 14px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green-active);
  font-size: 11px;
  font-weight: 700;
}

.docs-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.docs-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}

.docs-card .meta {
  margin-top: auto;
  padding-top: 14px;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.callout {
  padding: 16px 18px;
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: #3f3f3f;
  font-size: 13px;
  line-height: 1.6;
}

.callout b {
  color: var(--text);
}

.callout.green {
  border-color: transparent;
  background: var(--green-soft);
  color: var(--green-active);
}

.callout.warning {
  border-color: transparent;
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.callout.error {
  border-color: transparent;
  background: var(--error-bg);
  color: var(--error-fg);
}

.docs-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.docs-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12px;
}

.docs-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.docs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--row-border);
  color: var(--text);
  line-height: 1.45;
  vertical-align: top;
}

.docs-table tr:last-child td {
  border-bottom: 0;
}

.docs-table .strong {
  font-weight: 600;
}

.docs-table .muted {
  color: var(--text-2);
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.flow-step {
  position: relative;
  min-height: 112px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg);
}

.flow-step:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -9px;
  z-index: 2;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  content: "→";
  font-size: 11px;
  transform: translateY(-50%);
}

.flow-step .n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-bottom: 10px;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green-active);
  font-size: 10px;
  font-weight: 700;
}

.flow-step b {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.flow-step span {
  display: block;
  margin-top: 4px;
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.4;
}

.arch-layer {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.arch-layer > b {
  padding-top: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.arch-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.arch-item {
  padding: 8px 11px;
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}

.arch-item small {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 400;
}

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

.role-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.role-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.role-card .role-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 11px;
  margin-bottom: 10px;
  border-radius: var(--radius-pill);
  background: var(--green-soft);
  color: var(--green-active);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.role-card p {
  margin: 0 0 8px;
  color: #3f3f3f;
  font-size: 13px;
  line-height: 1.6;
}

.role-card p:last-child {
  margin-bottom: 0;
}

.role-card strong {
  color: var(--text);
  font-weight: 600;
}

.scheme-frame {
  padding: 16px;
  margin: 18px 0 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.scheme-frame a {
  display: block;
  border-bottom: 0;
}

.scheme-image {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-md);
}

.scheme-caption {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 12px;
}

.module-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 24px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
}

.chip.green {
  border-color: transparent;
  background: var(--green-soft);
  color: var(--green-active);
}

.demo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  margin-top: 8px;
  border-radius: var(--radius-md);
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.demo-link:hover {
  background: var(--green-hover);
}

.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
}

.docs-pager a {
  color: var(--green-active);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.docs-pager a:hover {
  text-decoration: underline;
}

.docs-sidebar .brand span span {
  white-space: normal;
}

.docs-sidebar .app-nav a {
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .docs-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .flow-step::after {
    display: none !important;
  }

  .docs-content {
    padding: 28px 24px 48px;
  }
}

@media (max-width: 720px) {
  .docs-content h1 {
    font-size: 28px;
  }

  .docs-card-grid,
  .flow {
    grid-template-columns: 1fr;
  }

  .arch-layer {
    grid-template-columns: 1fr;
  }
}
