:root {
  font-family: sans-serif;
  color: #000;
  background: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

a {
  color: #315da8;
  text-decoration: none;
}

a:hover,
.text-button:hover {
  text-decoration: underline;
}

button,
input,
textarea {
  font: inherit;
}

button {
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

input,
textarea {
  width: 100%;
  padding: 0.4rem;
  color: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
}

label {
  display: block;
  margin: 0.9rem 0 0.35rem;
  font-weight: 600;
}

.site-header {
  display: flex;
  align-items: center;
  padding: 0.75rem max(1rem, calc((100% - 760px) / 2));
  border-bottom: 1px solid #ccc;
}

.brand {
  color: inherit;
  font-weight: bold;
}

main {
  width: min(100% - 2rem, 760px);
  margin: 2rem auto;
}

.panel {
  padding: 0.75rem;
  border: 1px solid #ccc;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.4rem;
  font-size: 1.45rem;
}

h2 {
  font-size: 1.2rem;
}

.muted,
.small {
  color: #555;
}

.small {
  font-size: 0.82rem;
}

.form-footer,
.section-heading,
.post-heading,
.post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.form-footer {
  margin-top: 0.8rem;
}

.section-heading {
  margin-bottom: 0.8rem;
}

.section-heading h2 {
  margin-bottom: 0;
}

.post-jump {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.post-jump label {
  margin: 0;
}

.post-jump input {
  width: 8rem;
}

.status {
  min-height: 1.2em;
  color: #333;
  font-size: 0.9rem;
}

.status.error,
.error {
  color: #900;
}

.post-list {
  display: grid;
  gap: 0.85rem;
}

.post h3 {
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.post-heading time {
  flex: 0 0 auto;
}

.post-content,
.comment-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-content {
  margin-bottom: 0.9rem;
}

.post-actions {
  justify-content: flex-start;
  border-top: 1px solid #ccc;
  padding-top: 0.7rem;
}

.text-button {
  padding: 0;
}

.button-danger {
  color: #900;
}

.report summary {
  cursor: pointer;
}

.report form,
.comment-form {
  display: grid;
  gap: 0.55rem;
  width: 100%;
  margin-top: 0.6rem;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.report-reason {
  padding: 0.5rem;
  border-left: 2px solid #999;
}

.comments {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid #ccc;
}

.comments h4 {
  margin-bottom: 0.6rem;
}

.comment-list {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 0.8rem;
  padding: 0;
  list-style: none;
}

.comment {
  padding: 0.65rem;
  border-bottom: 1px solid #ddd;
}

.comment p {
  margin-bottom: 0.35rem;
}

.load-more {
  display: block;
  margin: 1rem auto 0;
}

footer {
  padding: 1rem;
  color: #555;
  text-align: center;
  font-size: 0.85rem;
}

.composer[hidden] {
  display: none;
}

.composer {
  position: fixed;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  height: 45vh;
  min-height: 33vh;
  max-height: 50vh;
  overflow: auto;
  padding: 0.75rem max(1rem, calc((100% - 760px) / 2));
  background: #fff;
  border-top: 1px solid #000;
}

.composer-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.composer-heading h2 {
  margin-bottom: 0.25rem;
}

#post-content {
  min-height: 6rem;
}

@media (max-width: 520px) {
  .site-header {
    padding-inline: 1rem;
  }

  .post-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .composer {
    height: 45vh;
    max-height: 50vh;
  }
}
