:root {
  --kb-page: #f4eee7;
  --kb-page-deep: #e9ddd2;
  --kb-paper: #fffdf9;
  --kb-paper-soft: #faf5ef;
  --kb-line: rgba(73, 55, 45, 0.14);
  --kb-line-strong: rgba(73, 55, 45, 0.24);
  --kb-ink: #29221f;
  --kb-muted: #665b55;
  --kb-accent: #5a4032;
  --kb-accent-soft: #7f6150;
  --kb-accent-strong: #34241d;
  --kb-danger: #96372d;
  --kb-success: #3e6854;
  --kb-shadow: 0 20px 60px rgba(52, 36, 29, 0.08);
  --kb-font-sans: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --kb-font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--kb-ink);
  background:
    radial-gradient(circle at 82% 0%, rgba(210, 190, 173, 0.55), transparent 30rem),
    linear-gradient(145deg, #f8f3ed 0%, var(--kb-page) 56%, #efe6dd 100%);
  font-family: var(--kb-font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.kb-skip-link {
  position: fixed;
  top: -4rem;
  left: 1rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  color: #fff;
  background: var(--kb-accent-strong);
}

.kb-skip-link:focus {
  top: 1rem;
}

.kb-shell {
  min-height: 100vh;
}

.kb-eyebrow,
.kb-step-label {
  margin: 0 0 0.75rem;
  color: var(--kb-accent-soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Sign in */
.kb-auth {
  width: min(1180px, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.kb-auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  border-bottom: 1px solid var(--kb-line);
}

.kb-auth-brand img,
.kb-brand img {
  display: block;
  width: 118px;
  height: auto;
}

.kb-auth-brand p {
  color: var(--kb-muted);
  font-size: 0.88rem;
}

.kb-auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.75fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
  min-height: calc(100vh - 150px);
  padding: 4rem 0;
}

.kb-auth-intro {
  max-width: 680px;
}

.kb-auth-intro h1,
.kb-catalog-hero h1,
.kb-article-header h1,
.kb-card h2,
.kb-sidebar h2 {
  font-family: var(--kb-font-serif);
  font-weight: 500;
  letter-spacing: -0.035em;
  color: var(--kb-ink);
}

.kb-auth-intro h1 {
  max-width: 640px;
  margin: 0;
  font-size: clamp(2.8rem, 5.6vw, 5rem);
  line-height: 0.98;
}

.kb-auth-intro > p:not(.kb-eyebrow) {
  max-width: 590px;
  margin: 1.6rem 0 0;
  color: var(--kb-muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.kb-auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.kb-auth-points span {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--kb-line);
  border-radius: 999px;
  color: var(--kb-accent);
  background: rgba(255, 255, 255, 0.5);
  font-size: 0.83rem;
  font-weight: 600;
}

.kb-card {
  padding: clamp(1.6rem, 4vw, 2.5rem);
  border: 1px solid var(--kb-line);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(250, 245, 239, 0.96));
  box-shadow: var(--kb-shadow);
}

.kb-card h2 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  line-height: 1.1;
}

.kb-card-copy {
  margin: 0.9rem 0 0;
  color: var(--kb-muted);
  line-height: 1.6;
}

.kb-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.kb-form label {
  color: var(--kb-ink);
  font-size: 0.86rem;
  font-weight: 600;
}

.kb-form input {
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--kb-line-strong);
  border-radius: 14px;
  outline: none;
  color: var(--kb-ink);
  background: rgba(255, 255, 255, 0.85);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.kb-form input:focus {
  border-color: rgba(90, 64, 50, 0.55);
  box-shadow: 0 0 0 4px rgba(90, 64, 50, 0.09);
}

.kb-form button {
  min-height: 52px;
  margin-top: 0.35rem;
  padding: 0.8rem 1.2rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  background: var(--kb-accent-strong);
  font-weight: 600;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.kb-form button:hover,
.kb-form button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(52, 36, 29, 0.16);
}

.kb-message {
  min-height: 1.4rem;
  margin: 1rem 0 0;
  color: var(--kb-success);
  font-size: 0.88rem;
}

.kb-message.is-error {
  color: var(--kb-danger);
}

.kb-privacy-note {
  margin: 0.6rem 0 0;
  color: var(--kb-muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

/* Application shell */
.kb-app {
  min-height: 100vh;
}

.kb-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--kb-line);
  background: rgba(247, 241, 235, 0.9);
  backdrop-filter: blur(22px);
}

.kb-topbar-inner {
  display: grid;
  grid-template-columns: 240px minmax(280px, 620px) minmax(220px, 1fr);
  gap: 1.5rem;
  align-items: center;
  width: min(1500px, calc(100% - 2rem));
  min-height: 82px;
  margin: 0 auto;
}

.kb-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: transparent;
}

.kb-brand span {
  padding-left: 1rem;
  border-left: 1px solid var(--kb-line-strong);
  color: var(--kb-accent);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kb-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 46px;
  padding: 0 0.9rem;
  border: 1px solid var(--kb-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  transition: background 160ms ease, border-color 160ms ease;
}

.kb-search:focus-within {
  border-color: var(--kb-line-strong);
  background: #fff;
}

.kb-search-icon {
  position: relative;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  border: 1.8px solid var(--kb-accent-soft);
  border-radius: 50%;
}

.kb-search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 2px;
  content: "";
  background: var(--kb-accent-soft);
  transform: rotate(45deg);
}

.kb-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--kb-ink);
  background: transparent;
}

.kb-search input::placeholder {
  color: #8b7c74;
}

.kb-search kbd {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--kb-line);
  border-radius: 6px;
  color: var(--kb-muted);
  background: var(--kb-paper-soft);
  font-size: 0.68rem;
}

.kb-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.kb-account-copy {
  display: grid;
  min-width: 0;
  text-align: right;
}

.kb-account-copy strong {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-account-copy span {
  color: var(--kb-muted);
  font-size: 0.72rem;
}

.kb-ghost-button,
.kb-menu-button,
.kb-back-button,
.kb-article-pagination button {
  border: 1px solid var(--kb-line-strong);
  cursor: pointer;
  background: transparent;
}

.kb-ghost-button {
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.kb-mobile-tools {
  display: none;
}

.kb-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  width: min(1500px, 100%);
  min-height: calc(100vh - 83px);
  margin: 0 auto;
}

.kb-sidebar {
  position: sticky;
  top: 83px;
  align-self: start;
  height: calc(100vh - 83px);
  padding: 2rem 1.25rem 3rem max(1.25rem, calc((100vw - 1500px) / 2 + 1.25rem));
  border-right: 1px solid var(--kb-line);
  overflow-y: auto;
  background: rgba(248, 243, 237, 0.56);
}

.kb-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 0.55rem 1rem;
}

.kb-sidebar h2 {
  margin: 0;
  font-size: 1.55rem;
}

.kb-menu-close {
  display: none;
}

.kb-search-summary {
  margin: 0 0.55rem 1rem;
  color: var(--kb-muted);
  font-size: 0.8rem;
}

.kb-module + .kb-module {
  margin-top: 0.35rem;
}

.kb-module-header {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  padding: 0.75rem 0.55rem;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  background: transparent;
}

.kb-module-header:hover,
.kb-module-header.is-open {
  background: rgba(255, 255, 255, 0.72);
}

.kb-module-number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  color: var(--kb-accent);
  background: rgba(90, 64, 50, 0.09);
  font-family: var(--kb-font-serif);
  font-size: 0.84rem;
}

.kb-module-title {
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.3;
}

.kb-module-chevron {
  color: var(--kb-muted);
  font-size: 1rem;
  transition: transform 180ms ease;
}

.kb-module-header.is-open .kb-module-chevron {
  transform: rotate(90deg);
}

.kb-module-header.is-locked {
  opacity: 0.58;
}

.kb-module-articles {
  display: grid;
  gap: 0.15rem;
  max-height: 0;
  margin-left: 2.55rem;
  overflow: hidden;
  opacity: 0;
  transition: max-height 240ms ease, opacity 180ms ease, padding 180ms ease;
}

.kb-module-articles.is-open {
  max-height: 3000px;
  padding: 0.25rem 0 0.65rem;
  opacity: 1;
}

.kb-article-link {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  width: 100%;
  padding: 0.58rem 0.65rem;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: var(--kb-muted);
  text-align: left;
  background: transparent;
  font-size: 0.78rem;
  line-height: 1.35;
}

.kb-article-link:hover,
.kb-article-link.is-active {
  color: var(--kb-ink);
  background: rgba(255, 255, 255, 0.82);
}

.kb-article-link.is-active {
  box-shadow: inset 2px 0 var(--kb-accent-soft);
}

.kb-article-link.is-locked {
  cursor: not-allowed;
  opacity: 0.58;
}

.kb-material-icon {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 5px;
  color: var(--kb-accent-soft);
  background: rgba(90, 64, 50, 0.08);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kb-workspace {
  min-width: 0;
  padding: clamp(1.5rem, 4vw, 4.5rem);
}

/* Catalog */
.kb-catalog {
  width: 100%;
  min-width: 0;
  max-width: 1080px;
  margin: 0 auto;
}

.kb-catalog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 3rem;
  align-items: end;
  padding: clamp(1rem, 3vw, 2.5rem) 0 clamp(2.5rem, 5vw, 4.5rem);
}

.kb-catalog-hero > div,
.kb-catalog-stats,
.kb-section-card,
.kb-section-card-body,
.kb-section-card-foot {
  min-width: 0;
}

.kb-catalog-hero h1 {
  max-width: 730px;
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.kb-catalog-hero > div > p:not(.kb-eyebrow) {
  max-width: 650px;
  margin: 1.3rem 0 0;
  color: var(--kb-muted);
  line-height: 1.7;
}

.kb-catalog-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 100%;
}

.kb-catalog-stats div {
  display: grid;
  align-content: center;
  min-height: 116px;
  padding: 1rem;
  border: 1px solid var(--kb-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.55);
}

.kb-catalog-stats strong {
  font-family: var(--kb-font-serif);
  font-size: 2rem;
  font-weight: 500;
}

.kb-catalog-stats span {
  color: var(--kb-muted);
  font-size: 0.73rem;
  line-height: 1.3;
}

.kb-catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.kb-section-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 260px;
  padding: 1.6rem;
  border: 1px solid var(--kb-line);
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(247, 239, 231, 0.92));
  box-shadow: 0 14px 40px rgba(52, 36, 29, 0.045);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.kb-section-card::after {
  position: absolute;
  right: -2rem;
  bottom: -4rem;
  width: 10rem;
  height: 10rem;
  border: 1px solid rgba(90, 64, 50, 0.08);
  border-radius: 50%;
  content: "";
}

.kb-section-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--kb-shadow);
}

.kb-section-card.is-locked {
  background: rgba(242, 235, 228, 0.68);
  box-shadow: none;
}

.kb-section-card-head,
.kb-section-card-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.kb-section-index {
  font-family: var(--kb-font-serif);
  color: var(--kb-accent-soft);
  font-size: 0.85rem;
}

.kb-section-status {
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  color: var(--kb-success);
  background: rgba(62, 104, 84, 0.09);
  font-size: 0.68rem;
  font-weight: 700;
}

.kb-section-card.is-locked .kb-section-status {
  color: var(--kb-muted);
  background: rgba(102, 91, 85, 0.09);
}

.kb-section-card-body {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 2rem 0;
}

.kb-section-card h2 {
  margin: 0;
  font-family: var(--kb-font-serif);
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.kb-section-card p {
  margin: 0.8rem 0 0;
  color: var(--kb-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.kb-section-card-foot span {
  color: var(--kb-muted);
  font-size: 0.78rem;
}

.kb-section-open {
  position: relative;
  z-index: 2;
  padding: 0;
  border: 0;
  cursor: pointer;
  color: var(--kb-accent);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
}

.kb-section-open:disabled {
  cursor: default;
  color: var(--kb-muted);
}

.kb-search-empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  margin-bottom: 1rem;
  border: 1px dashed var(--kb-line-strong);
  border-radius: 24px;
  text-align: center;
}

.kb-search-empty strong,
.kb-search-empty span {
  display: block;
}

.kb-search-empty span {
  margin-top: 0.4rem;
  color: var(--kb-muted);
  font-size: 0.85rem;
}

/* Reader */
.kb-reader {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 4rem);
  border: 1px solid var(--kb-line);
  border-radius: 28px;
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--kb-shadow);
}

.kb-back-button {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: var(--kb-accent);
  font-size: 0.78rem;
}

.kb-back-button::before {
  content: "← ";
}

.kb-article-header {
  padding: clamp(2rem, 6vw, 4rem) 0 2rem;
  border-bottom: 1px solid var(--kb-line);
}

.kb-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
  align-items: center;
  color: var(--kb-muted);
  font-size: 0.75rem;
}

.kb-type-badge {
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  color: var(--kb-accent);
  background: rgba(90, 64, 50, 0.09);
  font-weight: 700;
}

.kb-article-meta span + span::before {
  margin-right: 0.8rem;
  color: #b7aaa2;
  content: "•";
}

.kb-article-meta .kb-type-badge::before {
  content: none;
}

.kb-article-header h1 {
  max-width: 760px;
  margin: 1.2rem 0 0;
  font-size: clamp(2.15rem, 5vw, 3.7rem);
  line-height: 1.03;
}

.kb-article-content {
  padding: clamp(2rem, 5vw, 3.5rem) 0;
  color: #3b332f;
  font-size: 1.02rem;
  line-height: 1.78;
  user-select: none;
  -webkit-user-select: none;
}

.kb-article-content > :first-child {
  margin-top: 0;
}

.kb-article-content h1,
.kb-article-content h2,
.kb-article-content h3,
.kb-article-content h4 {
  margin: 2.4em 0 0.7em;
  font-family: var(--kb-font-serif);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--kb-ink);
}

.kb-article-content h1 {
  font-size: 2rem;
}

.kb-article-content h2 {
  font-size: 1.7rem;
}

.kb-article-content h3 {
  font-size: 1.35rem;
}

.kb-article-content p,
.kb-article-content ul,
.kb-article-content ol,
.kb-article-content table,
.kb-article-content blockquote {
  margin: 1.15em 0;
}

.kb-article-content ul,
.kb-article-content ol {
  padding-left: 1.35rem;
}

.kb-article-content li + li {
  margin-top: 0.48rem;
}

.kb-article-content a {
  color: var(--kb-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.kb-article-content blockquote {
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--kb-accent-soft);
  border-radius: 0 14px 14px 0;
  background: var(--kb-paper-soft);
}

.kb-article-content table {
  display: block;
  width: 100%;
  border-collapse: collapse;
  overflow-x: auto;
}

.kb-article-content th,
.kb-article-content td {
  padding: 0.75rem;
  border: 1px solid var(--kb-line);
  text-align: left;
}

.kb-article-content th {
  background: var(--kb-paper-soft);
}

.kb-article-content img,
.kb-article-content video {
  max-width: 100%;
  height: auto;
  border-radius: 18px;
}

.kb-resource-action {
  margin-top: 2rem;
  padding: 1.25rem;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: var(--kb-paper-soft);
}

.kb-resource-action a {
  display: inline-flex;
  margin-top: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: #fff;
  background: var(--kb-accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.kb-article-footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--kb-line);
}

.kb-article-footer > p {
  color: var(--kb-muted);
  font-size: 0.84rem;
}

.kb-article-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.kb-article-pagination button {
  min-height: 58px;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.35;
}

.kb-article-pagination button:last-child {
  text-align: right;
}

.kb-article-pagination button:disabled {
  visibility: hidden;
}

.kb-sidebar-overlay {
  display: none;
}

@media (max-width: 1100px) {
  .kb-topbar-inner {
    grid-template-columns: 210px minmax(240px, 1fr) auto;
  }

  .kb-account-copy {
    display: none;
  }

  .kb-layout {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .kb-catalog-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .kb-catalog-stats {
    max-width: 420px;
  }
}

@media (max-width: 820px) {
  .kb-auth-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 3rem 0;
  }

  .kb-card {
    max-width: 560px;
  }

  .kb-topbar-inner {
    display: flex;
    justify-content: space-between;
  }

  .kb-search-desktop {
    display: none;
  }

  .kb-mobile-tools {
    position: sticky;
    top: 82px;
    z-index: 35;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--kb-line);
    background: rgba(247, 241, 235, 0.94);
    backdrop-filter: blur(20px);
  }

  .kb-menu-button {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    font-size: 0.8rem;
  }

  .kb-menu-button span,
  .kb-menu-button span::before,
  .kb-menu-button span::after {
    display: block;
    width: 14px;
    height: 1.5px;
    content: "";
    background: currentColor;
  }

  .kb-menu-button span {
    position: relative;
  }

  .kb-menu-button span::before {
    position: absolute;
    top: -5px;
  }

  .kb-menu-button span::after {
    position: absolute;
    top: 5px;
  }

  .kb-layout {
    display: block;
    min-height: calc(100vh - 143px);
  }

  .kb-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    width: min(88vw, 360px);
    height: 100vh;
    padding: 1.5rem 1rem 3rem;
    border-right: 1px solid var(--kb-line);
    background: #f8f3ed;
    box-shadow: 20px 0 60px rgba(52, 36, 29, 0.16);
    transform: translateX(-105%);
    transition: transform 240ms ease;
  }

  .kb-sidebar.is-open {
    transform: translateX(0);
  }

  .kb-menu-close {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--kb-line);
    border-radius: 50%;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
  }

  .kb-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    border: 0;
    background: rgba(41, 34, 31, 0.42);
    backdrop-filter: blur(3px);
  }

  .kb-workspace {
    padding: 1.5rem 1rem 3rem;
  }

  .kb-catalog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .kb-auth {
    width: min(100% - 1.25rem, 1180px);
    padding-top: 0.75rem;
  }

  .kb-auth-brand {
    min-height: 62px;
  }

  .kb-auth-brand p {
    display: none;
  }

  .kb-auth-layout {
    padding: 2.25rem 0;
  }

  .kb-auth-intro h1 {
    font-size: clamp(2.45rem, 13vw, 3.4rem);
  }

  .kb-auth-points {
    display: none;
  }

  .kb-card {
    border-radius: 22px;
  }

  .kb-topbar-inner {
    width: calc(100% - 1.25rem);
    min-height: 70px;
  }

  .kb-brand img {
    width: 98px;
  }

  .kb-brand span {
    display: none;
  }

  .kb-mobile-tools {
    top: 70px;
  }

  .kb-ghost-button {
    padding-inline: 0.75rem;
  }

  .kb-catalog-hero {
    padding-top: 0.75rem;
    padding-bottom: 2.25rem;
  }

  .kb-catalog-hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.2rem);
  }

  .kb-catalog-stats div {
    min-height: 100px;
  }

  .kb-section-card {
    min-height: 230px;
    padding: 1.3rem;
    border-radius: 22px;
  }

  .kb-reader {
    padding: 1.25rem;
    border-radius: 20px;
  }

  .kb-article-header {
    padding-top: 2.5rem;
  }

  .kb-article-header h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .kb-article-content {
    font-size: 0.98rem;
  }

  .kb-article-pagination {
    grid-template-columns: 1fr;
  }

  .kb-article-pagination button:last-child {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
