:root {
  color-scheme: light;
  --paper: #f6f4f0;
  --surface: #ffffff;
  --ink: #24201f;
  --muted: #716967;
  --accent: #772b37;
  --line: #ded8d2;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
a { color: var(--accent); }
button, input { font: inherit; }
button { min-height: 44px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--surface); padding: .75rem; }
.site-header { min-height: 64px; padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header a { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.site-header nav { display: flex; align-items: center; gap: 1rem; }
.site-header form { margin: 0; }
.brand { color: var(--ink); font-weight: 750; text-decoration: none; }
.link-button { border: 0; background: transparent; color: var(--accent); cursor: pointer; }
.welcome-card, .auth-card, .error-card { width: min(720px, calc(100% - 2rem)); margin: clamp(2rem, 10vh, 7rem) auto; padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 18px 50px rgb(38 25 25 / 8%); }
.eyebrow { color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
input { width: 100%; min-height: 44px; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 8px; }
button[type="submit"] { padding: .7rem 1rem; border: 0; border-radius: 8px; background: var(--accent); color: white; cursor: pointer; }
.knowledge-layout { width: min(920px, calc(100% - 3rem)); margin: clamp(2rem, 7vh, 5rem) auto; }
.knowledge-heading { margin-bottom: 2rem; }
.knowledge-heading h1 { margin: .35rem 0 0; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.08; }
.knowledge-section { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.knowledge-section h2 { margin: 0 0 .75rem; font-size: 1.15rem; }
.knowledge-links { margin: 0; padding: 0; list-style: none; }
.knowledge-links a, .knowledge-back a, .knowledge-results a { display: inline-flex; min-height: 44px; align-items: center; }
.knowledge-empty, .knowledge-message { color: var(--muted); }
.knowledge-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem .75rem; align-items: end; margin-bottom: 2rem; }
.knowledge-search-form label { grid-column: 1 / -1; font-weight: 650; }
.knowledge-search-form button { min-width: 96px; }
.knowledge-results { margin: 0; padding: 0; list-style: none; }
.knowledge-results li { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.knowledge-results a { font-size: 1.1rem; font-weight: 650; }
.knowledge-results p { max-width: 72ch; margin: .35rem 0 0; color: var(--muted); line-height: 1.6; }
.knowledge-document { max-width: 76ch; font-size: 1.05rem; line-height: 1.7; overflow-wrap: anywhere; }
.knowledge-document img, .knowledge-document table, .knowledge-document pre { max-width: 100%; overflow-x: auto; }
.knowledge-document a { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid #b85d70; outline-offset: 2px; }
@media (max-width: 640px) {
  .site-header { padding: .75rem 1rem; align-items: flex-start; }
  .site-header nav { flex-wrap: wrap; justify-content: flex-end; gap: .25rem; }
  .welcome-card, .auth-card, .error-card { margin: 1rem auto; border-radius: 12px; }
  .knowledge-layout { width: min(100% - 2rem, 920px); margin: 1.5rem auto; }
  .knowledge-search-form { grid-template-columns: 1fr; }
  .knowledge-search-form label { grid-column: auto; }
  .knowledge-search-form button { width: 100%; }
}
