:root {
  --bg: #f7f8f5;
  --panel: #ffffff;
  --panel-strong: #eef3ea;
  --text: #20251f;
  --muted: #637066;
  --line: #dce3dc;
  --accent: #21695b;
  --accent-strong: #154b43;
  --focus: #246bfe;
  --danger: #9b2c2c;
  --shadow: 0 16px 40px rgba(22, 35, 27, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

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

.docs-sidebar {
  border-right: 1px solid var(--line);
  background: #fbfcfa;
  padding: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand-block strong,
.brand-block small {
  display: block;
}

.brand-block small {
  color: var(--muted);
  margin-top: 2px;
}

.search-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.search-input,
.panel-form input,
.panel-form textarea,
.editor-form input,
.editor-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.search-input:focus,
.panel-form input:focus,
.panel-form textarea:focus,
.editor-form input:focus,
.editor-form textarea:focus,
.button:focus,
.icon-button:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.14);
}

.doc-tree {
  margin-top: 18px;
  display: grid;
  gap: 4px;
}

.tree-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.tree-button small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.35;
}

.tree-button:hover,
.tree-button.active {
  background: var(--panel-strong);
}

.docs-main {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 245, 0.92);
  backdrop-filter: blur(12px);
  padding: 22px clamp(20px, 4vw, 56px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
h4 {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2vw, 2.1rem);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-height: 38px;
  padding: 9px 14px;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.muted {
  color: var(--muted);
}

.icon-button {
  width: 38px;
  padding: 0;
  font-weight: 800;
}

.status-banner {
  margin: 24px clamp(20px, 4vw, 56px) 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  color: var(--muted);
}

.status-banner.error {
  border-left-color: var(--danger);
  color: var(--danger);
}

.doc-content {
  max-width: 880px;
  padding: 34px clamp(20px, 4vw, 56px) 80px;
  line-height: 1.7;
}

.doc-content h1,
.doc-content h2,
.doc-content h3,
.doc-content h4 {
  line-height: 1.25;
  margin: 1.7em 0 0.55em;
}

.doc-content h1:first-child,
.doc-content h2:first-child {
  margin-top: 0;
}

.doc-content a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.doc-content code {
  background: #eef1ef;
  border-radius: 6px;
  padding: 0.15em 0.35em;
}

.doc-content pre {
  background: #1f2924;
  color: #f6fbf7;
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
}

.doc-content pre code {
  background: transparent;
  padding: 0;
}

.doc-content blockquote {
  border-left: 4px solid var(--accent);
  margin: 20px 0;
  padding: 4px 0 4px 16px;
  color: var(--muted);
}

.side-panel,
.editor-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  width: min(440px, 100vw);
  height: 100vh;
  background: #fff;
  box-shadow: var(--shadow);
  border-left: 1px solid var(--line);
  overflow: auto;
}

.panel-form,
.editor-form {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.panel-form h2,
.editor-form h2 {
  margin: 0 0 8px;
}

.editor-panel {
  width: min(720px, 100vw);
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 120px;
  gap: 12px;
  align-items: end;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.checkbox-row input {
  width: auto;
}

.hidden {
  display: none !important;
}

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

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

  .topbar {
    position: static;
    align-items: flex-start;
  }

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

