:root {
  --bg: #f8f4ec;
  --paper: #ffffff;
  --ink: #1d2f35;
  --muted: #5b6670;
  --line: #dfe6de;
  --sun: #f59f26;
  --mint: #0d8e74;
  --sky: #2e83ba;
  --shadow: 0 22px 52px rgba(15, 39, 45, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Nunito", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 6%, rgba(34, 146, 123, 0.18), transparent 34%),
    radial-gradient(circle at 85% 2%, rgba(245, 159, 38, 0.17), transparent 30%),
    radial-gradient(circle at 52% 100%, rgba(46, 131, 186, 0.14), transparent 30%),
    var(--bg);
  min-height: 100vh;
}

.topbar,
.docs-main,
.footer {
  width: min(1180px, 94vw);
  margin-inline: auto;
}

.topbar {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand img {
  width: clamp(170px, 20vw, 240px);
  display: block;
  height: auto;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-btn {
  text-decoration: none;
  font-family: "Baloo 2", "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #0f5748;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #cfe0d8;
  border-radius: 999px;
  padding: 0.6rem 1rem;
}

.top-btn.secondary {
  color: #365676;
  border-color: #d5deea;
}

.about-menu {
  position: relative;
}

.about-menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}

.about-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.about-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transform: translateY(1px);
}

.about-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  width: min(420px, 88vw);
  background: #fff;
  border: 1px solid #d8e5de;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(26, 44, 42, 0.18);
  padding: 0.4rem;
  display: grid;
  gap: 2px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 12;
}

.about-panel a {
  text-decoration: none;
  color: #254444;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.55rem 0.66rem;
  line-height: 1.4;
}

.about-panel a:hover,
.about-panel a:focus-visible,
.about-panel a.is-active {
  background: #edf8f4;
  outline: none;
}

.about-menu:hover .about-panel,
.about-menu:focus-within .about-panel,
.about-menu.is-open .about-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.docs-main {
  margin-top: 10px;
  margin-bottom: 40px;
}

.doc-shell {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.doc-head {
  padding: clamp(18px, 3vw, 30px);
  border-bottom: 1px solid #e7ede6;
  background: linear-gradient(140deg, #fff7eb 0%, #f1fbf7 100%);
}

.doc-kicker {
  margin: 0;
  display: inline-block;
  color: #8a5a1c;
  background: #ffefda;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.86rem;
  padding: 0.3rem 0.66rem;
}

.doc-head h1 {
  margin: 10px 0 0;
  font-family: "Baloo 2", "Nunito", sans-serif;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  line-height: 1.1;
}

.doc-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px clamp(16px, 2.8vw, 28px);
  border-bottom: 1px solid #e9eee8;
  background: #fbfffd;
  position: sticky;
  top: 0;
  z-index: 5;
}

.doc-action {
  border: 1px solid #cedcd4;
  border-radius: 999px;
  background: #fff;
  color: #124e41;
  padding: 0.58rem 0.94rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

.doc-action.primary {
  background: linear-gradient(135deg, var(--sun), #ff7b37);
  border-color: #f4a65c;
  color: #fff;
}

.doc-action.link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.doc-action:hover,
.doc-action:focus-visible {
  transform: translateY(-1px);
}

.doc-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.doc-preview-wrap {
  padding: clamp(14px, 2.2vw, 24px);
}

.doc-preview {
  border: 1px solid #dce5dc;
  border-radius: 18px;
  background: #fff;
  min-height: 48vh;
  overflow: visible;
  padding: clamp(18px, 3vw, 30px);
  line-height: 1.62;
}

.doc-loading,
.doc-error {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.doc-error {
  color: #b92f44;
}

.doc-preview h1,
.doc-preview h2,
.doc-preview h3,
.doc-preview h4 {
  font-family: "Baloo 2", "Nunito", sans-serif;
  margin: 1.15em 0 0.45em;
  line-height: 1.12;
  color: #17343f;
}

.doc-preview h1 {
  font-size: 2rem;
}

.doc-preview h2 {
  font-size: 1.5rem;
}

.doc-preview h3 {
  font-size: 1.25rem;
}

.doc-preview p,
.doc-preview ul,
.doc-preview ol,
.doc-preview blockquote,
.doc-preview table {
  margin: 0.72em 0;
}

.doc-preview ul,
.doc-preview ol {
  padding-left: 1.4em;
}

.doc-preview code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f3f7f5;
  border-radius: 6px;
  padding: 0.12em 0.32em;
  font-size: 0.92em;
}

.doc-preview pre {
  background: #f3f7f5;
  border: 1px solid #dee8e1;
  border-radius: 12px;
  padding: 0.84rem;
  overflow-x: auto;
}

.doc-preview blockquote {
  border-left: 4px solid #a9d7c8;
  margin-left: 0;
  padding: 0.25rem 0 0.25rem 0.9rem;
  color: #3f575f;
}

.doc-preview table {
  width: 100%;
  border-collapse: collapse;
}

.doc-preview th,
.doc-preview td {
  border: 1px solid #d7e2db;
  padding: 0.45rem 0.55rem;
  text-align: left;
}

.doc-preview th {
  background: #eff8f4;
}

.footer {
  margin-bottom: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: #4f6361;
  font-weight: 700;
}

.footer img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  object-fit: cover;
}

@media (max-width: 580px) {
  .topbar {
    margin-top: 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .about-panel {
    left: 0;
    right: auto;
    width: min(95vw, 420px);
  }

  .top-btn {
    font-size: 0.95rem;
    padding: 0.54rem 0.86rem;
  }

  .doc-shell {
    border-radius: 20px;
  }
}

@media print {
  .topbar,
  .footer,
  .doc-toolbar {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .doc-shell,
  .doc-preview {
    box-shadow: none;
    border: 0;
    border-radius: 0;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .doc-head {
    border-bottom: 1px solid #ccc;
    background: #fff;
    padding: 0 0 12px;
  }

  .docs-main {
    width: 100%;
    margin: 0;
  }
}
