:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2933;
  background: #f5f7fa;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid #d9e0e7;
}

.site-header-content,
.site-footer-content {
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 48rem;
  padding-left: 1rem;
  padding-right: 1rem;
  width: 100%;
}

.site-header-content {
  padding-bottom: 0.85rem;
  padding-top: 0.85rem;
}

.site-header-content a {
  color: #1f2933;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
}

.site-footer {
  background: #fff;
  border-top: 1px solid #d9e0e7;
  color: #6b7280;
  font-size: 0.75rem;
  line-height: 1.5;
  margin-top: auto;
}

.site-footer-content {
  padding-bottom: 1rem;
  padding-top: 1rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

.page {
  width: min(100% - 2rem, 48rem);
  margin: 0 auto;
  padding: 2rem 0;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.panel {
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 0.5rem;
  padding: 1rem;
}

hr {
  border: 0;
  border-top: 1px solid #d9e0e7;
  margin: 1.25rem 0;
}

h2 {
  font-size: 1.1rem;
}

.event-card,
.event-form {
  border: 1px solid #d9e0e7;
  border-radius: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
}

.event-card h3 {
  margin: 0;
}

.event-card p {
  margin: 0.35rem 0 0;
}

.event-form label {
  display: block;
  margin: 0.75rem 0;
}

.event-form input {
  box-sizing: border-box;
  display: block;
  font: inherit;
  margin-top: 0.25rem;
  max-width: 100%;
  padding: 0.45rem;
  width: 24rem;
}

.event-form select,
.event-form textarea,
#circle-settings-form input:not([type="checkbox"]),
#circle-settings-form select,
#circle-settings-form textarea,
#publication-form input:not([type="checkbox"]) {
  box-sizing: border-box;
  display: block;
  font: inherit;
  margin-top: 0.25rem;
  max-width: 100%;
  padding: 0.45rem;
  width: 24rem;
}

#request-form input:not([type="checkbox"]),
#request-form select,
#request-form textarea {
  box-sizing: border-box;
  display: block;
  font: inherit;
  margin-top: 0.25rem;
  max-width: 100%;
  padding: 0.45rem;
  width: 24rem;
}

#request-form label {
  display: block;
  margin: 0.75rem 0;
}

textarea {
  min-height: 6rem;
}

.secondary {
  background: #fff;
  color: #1d4ed8;
}

.hidden {
  display: none;
}

.readonly {
  opacity: 0.85;
}

.button,
button {
  display: inline-block;
  border: 1px solid #1d4ed8;
  border-radius: 0.35rem;
  background: #1d4ed8;
  color: #fff;
  cursor: pointer;
  font: inherit;
  padding: 0.55rem 0.8rem;
  text-decoration: none;
}

.error {
  color: #b42318;
}

@media (max-width: 480px) {
  .page {
    padding-top: 1rem;
  }
}

.form-stack label {
  display: block;
  margin: 0.85rem 0;
}

.form-stack input:not([type="checkbox"]),
.form-stack select,
.form-stack textarea {
  box-sizing: border-box;
  display: block;
  font: inherit;
  margin-top: 0.3rem;
  max-width: 100%;
  padding: 0.45rem;
  width: 24rem;
}

.form-stack .checkbox-label {
  align-items: center;
  display: flex;
  gap: 0.55rem;
}

.form-stack .checkbox-label input {
  flex: 0 0 auto;
  margin: 0;
}

.form-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.manage-button {
  background: #7c3aed;
  border-color: #7c3aed;
}

.admin-manage-button {
  background: #c2410c;
  border-color: #c2410c;
}

.admin-notice {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 0.35rem;
  color: #9a3412;
  padding: 0.6rem 0.75rem;
}

.danger {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}

button:disabled {
  background: #9ca3af;
  border-color: #9ca3af;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.8;
}

.is-disabled {
  color: #6b7280;
  opacity: 0.6;
}

.form-message {
  margin: 0.75rem 0 0;
}

.muted {
  color: #6b7280;
}

.audit-table-wrapper {
  overflow-x: auto;
}

.audit-table {
  border-collapse: collapse;
  min-width: 48rem;
  width: 100%;
}

.audit-table th,
.audit-table td {
  border-bottom: 1px solid #d9e0e7;
  padding: 0.6rem;
  text-align: left;
  vertical-align: top;
}

.audit-table th {
  background: #f5f7fa;
  white-space: nowrap;
}

.form-message.success,
.form-message.warning,
.form-message.error {
  border-radius: 0.35rem;
  padding: 0.6rem 0.75rem;
}

.form-message.success {
  background: #ecfdf3;
  color: #067647;
}

.form-message.warning {
  background: #fffaeb;
  color: #92400e;
}

.form-message.error {
  background: #fef3f2;
  color: #b42318;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #e5e7eb;
  color: #6b7280;
  cursor: not-allowed;
}

[data-publication-form] {
  border-top: 1px solid #d9e0e7;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

[data-publication-form] label {
  display: block;
  margin: 0.75rem 0;
}

[data-publication-form] input:not([type="checkbox"]),
[data-publication-form] select {
  box-sizing: border-box;
  display: block;
  font: inherit;
  margin-top: 0.3rem;
  max-width: 100%;
  padding: 0.45rem;
  width: 24rem;
}

[data-publication-form] .checkbox-label {
  align-items: center;
  display: flex;
  gap: 0.55rem;
}

[data-publication-form] .checkbox-label input {
  margin: 0;
}
