:root {
  --fg: #1b1b1b;
  --bg: #f7f7f5;
  --line: #d7d7d2;
  --muted: #646256;
  --paper: #fff;
  --accent: #2d4568;
  --accent-soft: #e8edf4;
  --warn: #8b5e0b;
  --warn-soft: #f1e6c9;
}
body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: "Times New Roman", serif;
  line-height: 1.45;
}
.container { max-width: 920px; margin: 0 auto; padding: 1.25rem; }
.site-header { border-bottom: 1px solid var(--line); }
.header-row { display: flex; justify-content: space-between; align-items: baseline; }
.brand { font-size: 1.1rem; font-weight: 400; letter-spacing: .03em; margin: 0; }
.site-nav { display: flex; gap: 1rem; margin-top: .35rem; font-size: .95rem; }
.panel { background: var(--paper); border: 1px solid var(--line); padding: 1.25rem; margin: 2rem 0; }
.tool-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.tool-list li { border-top: 1px solid var(--line); padding: .8rem 0; }
.tool-list li:first-child { border-top: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button,
.button-link {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: .55rem .9rem;
  cursor: pointer;
  display: inline-block;
}
.button-link { text-decoration: none; }
.link-button,
.text-link { background: none; color: var(--accent); padding: 0; }
.stack > * + * { margin-top: .65rem; }
.back { font-size: .95rem; }
.errorlist { color: #8c1c13; }
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1rem;
}
.section-heading h3,
.section-heading h2 { margin: 0; }
.section-heading p { margin: 0; color: var(--muted); }
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.resource-card {
  border: 1px solid var(--line);
  padding: 1rem;
  background: linear-gradient(180deg, var(--paper), #fbfbfa);
}
.resource-card h4,
.resource-list h4 { margin: .45rem 0; }
.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  color: var(--muted);
  font-size: .9rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .45rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .82rem;
}
.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.resource-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.resource-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}
.resource-list li:first-child { border-top: 0; padding-top: 0; }
.resource-list li:last-child { padding-bottom: 0; }
.resource-list p { margin: .35rem 0 0; color: var(--muted); }
.resource-list.compact li { padding: .8rem 0; }
.resource-actions {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  align-items: flex-end;
  text-align: right;
  white-space: nowrap;
}
.resource-foot {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
.resource-filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: .75rem;
  align-items: end;
}
.resource-filters label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  color: var(--muted);
  font-size: .95rem;
}
.resource-filters input,
.resource-filters select,
input[type="file"],
textarea,
input[type="text"],
input[type="search"],
select {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: .55rem .65rem;
  font: inherit;
  color: inherit;
}
.prose h3 { margin-bottom: .35rem; }
.prose p { margin-top: 0; }
.cta-row,
.stack-inline {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  align-items: center;
}
.empty-state {
  display: block;
  color: var(--muted);
}
@media (max-width: 760px) {
  .header-row,
  .section-heading,
  .resource-list li {
    flex-direction: column;
    align-items: flex-start;
  }
  .resource-actions {
    align-items: flex-start;
    text-align: left;
    white-space: normal;
  }
  .resource-filters {
    grid-template-columns: 1fr;
  }
}
