/* Deliberately minimal: functionality over aesthetics. */

body {
  font-family: system-ui, sans-serif;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  line-height: 1.4;
}

.brand {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ccc;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
}

.logo {
  font-weight: bold;
  font-size: 1.25rem;
}

/* Forms and buttons */

input, button, .button {
  font: inherit;
  padding: 0.35rem 0.6rem;
}

button, .button {
  border: 1px solid #555;
  border-radius: 4px;
  background: #f4f4f4;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

label { display: block; margin-top: 0.75rem; }
form label + input, form > input:not([type=hidden]) { display: block; margin: 0.25rem 0; }
.error { color: #b00020; margin: 0.25rem 0; }
.hint { color: #666; font-size: 0.9em; }
[aria-invalid="true"] { border: 2px solid #b00020; }

/* Settings (header) */

.settings form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
.settings label { margin: 0; }
.settings .error { flex-basis: 100%; }

/* Dashboard */

.toolbar { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.search { flex: 1; }
.search input { width: 100%; box-sizing: border-box; }

#table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.4rem; border-bottom: 1px solid #ddd; }
.nowrap { white-space: nowrap; }
th a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
th a.sort:hover { text-decoration: underline; }
.sort-arrow { font-size: 0.8em; color: #bbb; }
.sort-active .sort-arrow { color: inherit; }
.pager { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }

.status { font-size: 0.85em; padding: 0.1rem 0.4rem; border-radius: 3px; }
.status-pending { background: #eee; }
.status-verified { background: #d7f5dd; }
.status-rejected { background: #fbd9dd; }

/* Modal (request details, new request) */

#modal {
  /* No padding on the dialog itself: clicks that land on the <dialog>
     element are backdrop clicks (see requests.js). */
  padding: 0;
  width: min(40rem, calc(100vw - 2rem));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #888;
  border-radius: 6px;
  box-sizing: border-box;
}
#modal::backdrop { background: rgb(0 0 0 / 0.45); }
#modal-body { padding: 0.25rem 1.25rem 1.25rem; }
#modal-body h2 { padding-right: 2rem; }
.modal-close { position: absolute; top: 0.5rem; right: 0.5rem; margin: 0; }
.modal-close button { font-size: 1.25rem; line-height: 1; padding: 0.2rem 0.55rem; }

dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; }
dt { color: #555; }
dd { margin: 0; }
.mono { font-family: ui-monospace, monospace; }
.copy-row { display: flex; gap: 0.5rem; }
.copy-row .url { flex: 1; min-width: 0; font-family: ui-monospace, monospace; }
.notice, .verified, .rejected { padding: 0.5rem 0.75rem; border-radius: 4px; }
.notice { background: #e8f0fe; }
.verified { background: #d7f5dd; }
.rejected { background: #fbd9dd; font-weight: bold; }

/* Submit flow (accordion) */

.flow { max-width: 36rem; margin: 0 auto; }
.flow form input:not([type=hidden]) { width: 100%; box-sizing: border-box; }
.section-body form button[type=submit] { margin-top: 1rem; }
.warning { border-left: 4px solid #c77c00; padding-left: 0.75rem; }
.blocked { background: #fbd9dd; padding: 0.5rem 0.75rem; border-radius: 4px; margin-bottom: 1rem; }

.accordion { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.section { border: 1px solid #ccc; border-radius: 6px; margin-bottom: 0.75rem; }
.section-open { border-color: #1a5fb4; box-shadow: 0 0 0 1px #1a5fb4; }
.section-locked { color: #888; background: #f7f7f7; }
.section-header-form { margin: 0; }
.section-header {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; box-sizing: border-box; margin: 0;
  padding: 0.75rem 1rem; font-size: 1.05rem; font-weight: bold;
  border: none; background: none; text-align: left; color: inherit;
}
button.section-header { cursor: pointer; border-radius: 6px; }
button.section-header:hover { background: #f2f6fc; }
.section-number {
  display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem;
  border-radius: 50%; border: 1px solid currentColor; font-size: 0.85rem;
}
.section-done .section-number { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.section-open .section-number { background: #1a5fb4; border-color: #1a5fb4; color: #fff; }
.check { color: #2e7d32; }
.change { margin-left: auto; font-weight: normal; font-size: 0.9rem; color: #0645ad; text-decoration: underline; }
.section-body, .section-summary { padding: 0 1rem 1rem; }
.section-summary p, .section-summary dl { margin: 0; }

button.primary { background: #1a5fb4; border-color: #1a5fb4; color: #fff; font-weight: bold; }
button:disabled { opacity: 0.6; cursor: wait; }
