:root {
  --paper: light-dark(#faf9f6, #202220);
  --ink: light-dark(#252c28, #e1e5df);
  --quiet: light-dark(#626b62, #a6afa5);
  --rule: light-dark(#d6dcd2, #424a42);
  --wash: light-dark(#edf0e9, #2d342c);
  --flag: light-dark(#2a6fa3, #79b8e8);

  background: var(--paper);
  color: var(--ink);
  color-scheme: light dark;
  font-family: system-ui, sans-serif;
}

body {
  margin: 0 auto;
  max-width: 65ch;
  overflow-wrap: anywhere;
  padding: 2rem;
}

.site-header {
  align-items: center;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 2.5rem;
  padding-bottom: 1.5rem;
}

.site-name {
  /* font: 2rem ui-monospace, monospace; */
}

.site-header a {
  color: var(--quiet);
  text-decoration: none;
}

.reading-room a {
  color: inherit;
  text-decoration: none;
}

.site-header nav,
.entry-actions {
  display: flex;
}

.site-header nav {
  gap: 2rem;
}

.site-header nav a {
  color: var(--quiet);
}

.reading-room {
  padding-top: 2rem;
}

.search-form {
  align-items: end;
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr auto auto;
}

.search-form label {
  grid-column: 1 / -1;
}

.search-form input,
.search-form select,
.entry-form textarea,
.entry-actions button,
button,
.cancel {
  background: var(--paper);
  color: var(--quiet);
  border: 1px solid var(--rule);
  box-sizing: border-box;
  font: inherit;
  padding: .65rem;
}

.journal-entry {
  border-bottom: 1px solid var(--rule);
  padding: 2rem 0;
}

.entry-detail {
  border-bottom: 0;
}

.entry-meta,
.list-summary,
.entry-form p,
footer {
  color: var(--quiet);
}

.flagged-icon {
  color: var(--flag);
}

.entry-time {
  display: block;
  font-size: .8em;
  margin-top: .2rem;
}

.entry-continuation {
  font-size: .8em;
  margin: .2rem 0 0;
}

.reading-room > h1 {
  font: 2rem "Source Serif 4", serif;
  font-weight: 400;
}

.entry-title {
  font: 1.15rem/1.4 "Source Serif 4", serif;
  font-weight: 500;
  margin: .5rem 0 0;
}

.entry-detail-title {
  font: 2rem "Source Serif 4", serif;
  font-weight: 400;
}

.entry-body {
  font: 1.1rem/1.6 "Source Serif 4", serif;
  margin: 1.5rem 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.entry-actions {
  gap: .75rem;
}

.entry-detail-page
.entry-actions {
  gap: .75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.entry-actions form {
  margin: 0;
}

.entry-actions a,
.entry-actions button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: .9rem/1.4 system-ui, sans-serif;
  padding: 0;
  text-decoration: none;
  color: var(--quiet);
}

.entry-actions a {
  text-decoration: none;
}

.cancel,
.all-entries-link {
  display: inline-block;
  border: 1px solid var(--rule);
  color: var(--quiet) !important;
  padding: .65rem;
  text-decoration: none;
}

.entry-form {
  display: grid;
  gap: 1rem;
}

.entry-form textarea {
  font: .85rem/1.5 ui-monospace, monospace;
  min-height: 20rem;
  white-space: pre-wrap;
}

.append-form {
  margin-top: 1.5rem;
}

.append-form textarea {
  min-height: 6rem;
}

.form-actions {
  display: flex;
  gap: .75rem;
}

.form-actions button,
.form-actions .cancel {
  width: fit-content;
}

.form-error {
  background: var(--wash);
  color: var(--ink);
  padding: .65rem;
}

.site-footer {
  border-top: 1px solid var(--rule);
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
}

.site-footer p {
  margin: 0;
}

.shutdown-form {
  margin: 0;
}

.shutdown-form button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

@media (max-width: 40rem) {
  body {
    padding: 1rem;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .site-header nav {
    gap: 1rem;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .search-form label {
    grid-column: auto;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
