:root {
  color: #ece9e1;
  background: #171815;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 3rem, 1100px);
  margin: 0 auto;
  padding: 1.5rem 0;
}
.brand { color: #f5f2eb; font-weight: 800; text-decoration: none; }
.site-header form { display: flex; align-items: center; gap: 1rem; }
.user-email, .muted, small { color: #9d9e95; }
.link-button, .text-link { color: #b6d577; background: none; border: 0; cursor: pointer; font: inherit; }
.text-link { text-decoration: none; }

.page-shell { width: min(100% - 3rem, 1100px); margin: 0 auto; padding: 5rem 0 8rem; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2.5rem; }
.eyebrow { margin: 0 0 .8rem; color: #b6d577; font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .8rem; color: #f5f2eb; font-size: clamp(2.8rem, 7vw, 5.5rem); line-height: .98; letter-spacing: -.06em; }
h2 { margin-bottom: 0; color: #f5f2eb; font-size: 1.35rem; }

.card, .auth-card { padding: 1.5rem; border: 1px solid #35382f; border-radius: 1.25rem; background: #22241f; box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 18%); }
.auth-card { width: min(100%, 450px); margin: 4rem auto; }
.narrow-card { max-width: 650px; }
.section-heading, .tenant-row, .stats div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-heading { padding-bottom: 1.2rem; border-bottom: 1px solid #35382f; }
.tenant-list { display: grid; gap: .75rem; padding-top: 1rem; }
.tenant-row { padding: 1rem; border-radius: .8rem; text-decoration: none; }
.tenant-row:hover { background: #2c2f29; }
.tenant-row span:first-child { display: grid; gap: .25rem; }
.tenant-meta { display: grid; justify-items: end; gap: .25rem; }
.badge { padding: .3rem .6rem; border-radius: 999px; color: #171815; background: #b6d577; font-size: .75rem; font-weight: 800; text-transform: capitalize; }
.empty-state { padding: 2rem 0 .5rem; color: #9d9e95; }
.button { display: inline-block; padding: .75rem 1.1rem; border: 0; border-radius: 999px; color: #171815; background: #b6d577; cursor: pointer; font: inherit; font-weight: 800; text-decoration: none; }
.button:hover { background: #cbe991; }
.stack { display: grid; gap: 1.1rem; }
label { display: grid; gap: .45rem; color: #d9d6ce; font-size: .9rem; font-weight: 700; }
input { width: 100%; padding: .8rem .9rem; border: 1px solid #484b42; border-radius: .6rem; color: #f5f2eb; background: #171815; font: inherit; }
input:focus { outline: 2px solid #b6d577; outline-offset: 2px; }
.notice { margin: 1rem 0; padding: .8rem 1rem; border-radius: .6rem; }
.notice.error { color: #ffd2c7; background: #4b2927; }
.notice.success { color: #d9f3b1; background: #2c4225; }
.notice a { color: inherit; font-weight: 800; }
.result-area { max-width: 650px; margin-top: 1rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.stats { display: grid; gap: 1rem; margin: 1.5rem 0 0; }
.stats div { padding-bottom: .8rem; border-bottom: 1px solid #35382f; }
.stats dt { color: #9d9e95; }
.stats dd { margin: 0; color: #f5f2eb; font-weight: 800; }

textarea {
  width: 100%;
  padding: .8rem .9rem;
  border: 1px solid #484b42;
  border-radius: .6rem;
  color: #f5f2eb;
  background: #171815;
  font: inherit;
  resize: vertical;
}
textarea:focus { outline: 2px solid #b6d577; outline-offset: 2px; }

.page-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-footer { width: min(100% - 3rem, 1100px); margin: 0 auto; padding: 0 0 3rem; color: #9d9e95; }
.site-footer a { color: #b6d577; }
.compact-footer { padding-top: 2rem; border-top: 1px solid #35382f; }

.marketing-body { background: #171815; }
.marketing-header, .marketing-nav { display: flex; align-items: center; gap: 1.5rem; }
.marketing-header {
  justify-content: space-between;
  width: min(100% - 3rem, 1100px);
  margin: 0 auto;
  padding: 1.5rem 0;
}
.marketing-nav a { color: #d9d6ce; text-decoration: none; }
.hero { width: min(100% - 3rem, 1100px); margin: 0 auto; padding: 4rem 0 2rem; }
.hero-copy { max-width: 42rem; color: #d9d6ce; font-size: 1.1rem; line-height: 1.6; }
.hero-actions { display: flex; gap: 1rem; align-items: center; margin-top: 2rem; }
.feature-grid, .steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  width: min(100% - 3rem, 1100px);
  margin: 0 auto;
  padding: 2rem 0 5rem;
}
.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.marketing-page-heading { width: min(100% - 3rem, 1100px); margin: 0 auto; padding-top: 4rem; }
.price { color: #f5f2eb; font-size: 2.5rem; font-weight: 800; }
.price span { color: #9d9e95; font-size: 1rem; }
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  color: #171815;
  background: #b6d577;
  font-weight: 800;
}

.knowledge-train-form { max-width: 650px; margin-top: 1.5rem; }
.topic-card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #35382f;
  border-radius: .8rem;
  background: #1b1d19;
}
.topic-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; }
.topic-form { margin-top: 1rem; }
.topic-actions { display: flex; gap: 1rem; align-items: center; }
.badge.subtle { color: #d9d6ce; background: #35382f; }
.link-button.danger { color: #ffb4a8; }

.upload-dropzone {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1.5rem;
  border: 1px dashed #484b42;
  border-radius: 1rem;
  background: #1b1d19;
}
.upload-label { display: grid; gap: .5rem; cursor: pointer; }
.document-list { display: grid; gap: .75rem; margin-top: 1rem; }
.document-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: .8rem;
  background: #1b1d19;
}
.document-row span, .document-row small { display: block; }
.document-actions { display: flex; gap: 1rem; align-items: center; }

@media (max-width: 700px) {
  .site-header, .page-shell { width: min(100% - 2rem, 1100px); }
  .page-shell { padding-top: 3rem; }
  .page-heading { align-items: start; flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .marketing-header { flex-direction: column; align-items: start; }
  .document-row { flex-direction: column; align-items: start; }
}
