:root {
  color-scheme: light;
  --bg: #f5efe5;
  --panel: rgba(255, 252, 247, 0.9);
  --panel-strong: #fffaf3;
  --text: #1d1a16;
  --muted: #6f6256;
  --line: #dfcfbb;
  --accent: #b35724;
  --accent-deep: #6f3513;
  --accent-soft: #efdfcf;
  --shadow: 0 20px 44px rgba(73, 40, 16, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 242, 220, 0.9), transparent 30%),
    linear-gradient(180deg, #f7f1e8 0%, #f3ebe0 52%, #eee4d6 100%);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(111, 53, 19, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 53, 19, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 88%);
}

a {
  color: inherit;
  text-decoration: none;
}

input,
textarea,
select,
button {
  font: inherit;
}

.topbar,
.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-deep);
  color: #fff8ef;
  font-size: 22px;
  font-weight: 700;
}

.name {
  font-size: 22px;
  font-weight: 700;
}

.sub,
.eyebrow,
.section-kicker,
.overview-desc,
.result-count,
.doc-card p,
.recent-card span,
.recent-card small,
.doc-top time,
.help-copy p,
.status-note,
.field label,
.admin-card p,
.admin-card small {
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.hero,
.docs-layout,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.85fr);
  gap: 22px;
}

.hero {
  padding: 20px 0 18px;
}

.hero-copy,
.hero-panel,
.toolbar,
.overview-card,
.doc-card,
.side-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy,
.hero-panel,
.toolbar,
.side-panel {
  border-radius: 20px;
}

.hero-copy,
.hero-panel,
.toolbar,
.side-panel,
.overview-card,
.doc-card {
  padding: 24px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(42px, 7vw, 70px);
  line-height: 0.98;
}

.lead {
  margin: 0;
  font-size: 19px;
  line-height: 1.75;
  max-width: 34em;
}

.cta-row,
.search-row,
.field-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.cta-row {
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  font-weight: 700;
  cursor: pointer;
}

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

.button.ghost {
  background: transparent;
}

.button.full {
  width: 100%;
}

.summary-grid,
.docs-main,
.docs-list,
.category-block,
.sidebar,
.recent-list,
.admin-list {
  display: grid;
  gap: 16px;
}

.summary-card,
.recent-card,
.admin-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.summary-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.summary-card strong {
  font-size: 24px;
}

.toolbar {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.toolbar-head,
.section-head,
.strip-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-head.compact {
  align-items: start;
}

.toolbar h2,
.section-head h2,
.strip-head h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 34px);
}

.search-row input,
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  color: var(--text);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
}

.chip.active {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff8ef;
}

.category-strip {
  margin: 20px 0;
}

.overview-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.overview-card,
.doc-card {
  border-radius: 18px;
}

.overview-card {
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease;
}

.overview-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.overview-name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.overview-desc {
  margin: 8px 0 16px;
  line-height: 1.6;
}

.doc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.doc-badge,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12px;
}

.tag.strong {
  font-weight: 700;
}

.doc-card h3 {
  margin: 0 0 12px;
  font-size: 27px;
  line-height: 1.2;
}

.doc-card p {
  margin: 0;
  line-height: 1.7;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.doc-link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--accent);
  font-weight: 700;
}

.help-copy {
  display: grid;
  gap: 10px;
}

.help-copy p {
  margin: 0;
  line-height: 1.7;
}

.empty-state {
  margin: 0;
  padding: 18px 20px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.7);
}

.admin-shell {
  display: grid;
  gap: 22px;
  padding-bottom: 28px;
}

.docs-layout.single,
.admin-grid.single-admin {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
}

.upload-section {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.field {
  display: grid;
  gap: 8px;
}

.field-grid > * {
  flex: 1 1 220px;
}

.status-note[data-kind="error"] {
  color: #9d2c2c;
}

.status-note[data-kind="success"] {
  color: #2f6a2f;
}

@media (max-width: 980px) {
  .hero,
  .docs-layout,
  .admin-grid,
  .upload-section,
  .overview-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar,
  .toolbar-head,
  .section-head,
  .strip-head {
    display: grid;
    gap: 12px;
  }

  .topbar,
  .shell {
    width: min(100% - 20px, 1180px);
  }

  .hero-copy,
  .hero-panel,
  .toolbar,
  .side-panel,
  .overview-card,
  .doc-card {
    padding: 18px;
  }

  .nav {
    flex-wrap: wrap;
  }
}
