:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202124;
  background: #fff;
  line-height: 1.6;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: #2457a6; text-underline-offset: 3px; }
a:hover { color: #173e7d; }

.site-header {
  min-height: 58px;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
}
.home-link { color: #202124; font-weight: 650; text-decoration: none; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.container { width: min(1180px, calc(100% - 32px)); min-height: calc(100vh - 150px); margin: 42px auto; }
.narrow { width: min(580px, 100%); margin: 0 auto; }
.form-page { width: min(760px, 100%); }
footer { border-top: 1px solid #e5e5e5; color: #666; font-size: .86rem; text-align: center; padding: 24px 16px; }
h1 { font-size: 1.8rem; line-height: 1.25; margin: 0 0 20px; }
h2 { font-size: 1.18rem; margin: 28px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 10px 0; }

label { display: block; font-weight: 600; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  border: 1px solid #aaa;
  border-radius: 4px;
  padding: 9px 10px;
  margin-top: 5px;
  background: #fff;
}
input[type="checkbox"] { width: auto; margin-right: 6px; }
textarea { resize: vertical; }
button, .button {
  display: inline-block;
  width: auto;
  appearance: none;
  border: 1px solid #2457a6;
  border-radius: 4px;
  background: #2457a6;
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  padding: 8px 14px;
  cursor: pointer;
}
button:hover, .button:hover { background: #173e7d; color: #fff; }
.secondary { background: #fff; color: #2457a6; }
.danger { background: #fff; color: #a12525; border-color: #a12525; }
.link-button { border: 0; padding: 0; background: none; color: #2457a6; font-weight: 400; text-decoration: underline; }
.language-toggle { min-width: 52px; padding: 5px 10px; border-color: #aaa; background: #fff; color: #333; font-weight: 500; }
.language-toggle:hover { border-color: #2457a6; background: #f5f7fa; color: #2457a6; }
.inline-form { display: inline; margin: 0; }
.helptext, .muted, .meta { color: #666; font-size: .9rem; }
.errorlist { color: #a12525; padding-left: 20px; }
.notice { padding: 10px 12px; border-left: 3px solid #2457a6; background: #f4f6fa; }
.notice.error, .danger-box { border-color: #a12525; background: #fff1f1; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, .7fr) auto auto;
  align-items: end;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid #ddd;
}
.resource-list article { padding: 22px 0; border-bottom: 1px solid #e3e3e3; }
.resource-list h2 { margin: 0 0 8px; }
.resource-list h2 a { color: #202124; }
.tag, .status { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #f0f1f2; font-size: .8rem; }
.status-approved { color: #176b38; background: #eaf7ee; }
.status-rejected, .status-withdrawn { color: #8d2626; background: #fff0f0; }
.empty { color: #666; padding: 30px 0; }
.secondary-links { margin-top: 32px; }

fieldset { border: 1px solid #ccc; border-radius: 4px; padding: 16px; margin: 24px 0; }
legend { font-weight: 650; padding: 0 6px; }
.link-row { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px dashed #ccc; }
.access-list section { border: 1px solid #ddd; border-radius: 4px; padding: 16px; margin: 12px 0; }
.warning { border-left: 3px solid #b47713; background: #fff8e8; padding: 10px 12px; }
.danger-box { border-left: 3px solid #a12525; padding: 10px 12px; }
dl { display: grid; grid-template-columns: 100px 1fr; gap: 4px 12px; }
dt { color: #666; } dd { margin: 0; min-width: 0; }
.hash { overflow-wrap: anywhere; font-size: .82rem; }
.target { overflow-wrap: anywhere; background: #f5f5f5; padding: 12px; }
.prose { overflow-wrap: anywhere; }

@media (max-width: 680px) {
  .site-header { padding: 12px 16px; align-items: flex-start; flex-direction: column; gap: 8px; }
  nav { gap: 12px; }
  .container { margin: 28px auto; }
  .filters { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; }
  .link-row { grid-template-columns: 1fr; }
  .hall-heading { align-items: stretch; flex-direction: column; }
  .hall-actions, .hall-search { width: 100%; }
  .hall-search { flex: 1; }
  .hall-search input { width: 100%; min-width: 0; }
  .resource-browser { grid-template-columns: 1fr; }
  .category-panel { padding-right: 0; border-right: 0; border-bottom: 1px solid #ddd; }
  .hall-results { padding-left: 0; }
  .filter-row { grid-template-columns: 1fr; gap: 4px; }
}


.hall-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.hall-heading h1 { margin-bottom: 6px; }
.hall-actions { display: flex; align-items: center; gap: 10px; }
.hall-search { display: flex; align-items: center; gap: 8px; }
.hall-search input { width: min(330px, 34vw); min-width: 210px; margin: 0; }
.resource-browser { display: grid; grid-template-columns: 230px minmax(0, 1fr); border-top: 1px solid #d8d8d8; border-bottom: 1px solid #d8d8d8; }
.category-panel { padding: 18px 18px 28px 0; border-right: 1px solid #ddd; }
.panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 34px; font-weight: 650; }
.panel-title a { font-size: .82rem; font-weight: 400; }
.category-tree, .category-tree ul { list-style: none; margin: 0; padding: 0; }
.category-tree ul { margin: 3px 0 6px 10px; padding-left: 11px; border-left: 1px solid #ddd; }
.category-tree a { display: block; padding: 4px 7px; border-radius: 3px; color: #343434; text-decoration: none; font-size: .92rem; }
.category-tree a:hover { background: #f3f5f7; }
.category-tree a.active { background: #edf2fa; color: #174a91; font-weight: 650; }
.hall-results { min-width: 0; padding-left: 24px; }
.condition-panel { padding: 18px 0 12px; border-bottom: 1px solid #ddd; }
.filter-row { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; padding: 9px 0; }
.filter-label { color: #666; font-size: .9rem; padding-top: 3px; }
.filter-options { display: flex; flex-wrap: wrap; gap: 5px 7px; }
.filter-pill { display: inline-block; padding: 2px 8px; border: 1px solid transparent; border-radius: 3px; color: #333; text-decoration: none; font-size: .88rem; }
.filter-pill:hover { border-color: #c7cfda; background: #f6f7f9; }
.filter-pill.active { border-color: #9cb4d5; background: #edf2fa; color: #174a91; }

@media (max-width: 680px) {
  .hall-heading { align-items: stretch; flex-direction: column; }
  .hall-actions, .hall-search { width: 100%; }
  .hall-search { flex: 1; }
  .hall-search input { width: 100%; min-width: 0; }
  .resource-browser { grid-template-columns: 1fr; }
  .category-panel { padding-right: 0; border-right: 0; border-bottom: 1px solid #ddd; }
  .hall-results { padding-left: 0; }
  .filter-row { grid-template-columns: 1fr; gap: 4px; }
}

.resend-form { margin-top: 18px; }
.human-check { margin: 16px 0; padding: 14px; border: 1px solid #ccc; border-radius: 4px; background: #fafafa; }
.human-check-image { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.human-check-image img { display: block; border: 1px solid #aaa; border-radius: 3px; background: #fff; }
.human-check-image button { white-space: nowrap; }
