.rich-body { overflow-wrap: anywhere; line-height: 1.75; }
.rich-body p, .rich-body h2, .rich-body h3, .rich-body pre, .rich-body blockquote { margin: 0 0 .55em; }
.rich-body ul, .rich-body ol { margin: 0 0 .55em; padding-left: 1.5em; }
.rich-body ul { list-style: disc; }
.rich-body ol { list-style: decimal; }
.rich-body pre { overflow-x: auto; padding: 8px 10px; background: #f5f5f5; border: 1px solid #eee; }
.rich-body hr { border: 0; border-top: 1px solid #ccc; margin: 12px 0; }
.rich-body a { text-decoration: underline; }

.reference-page .masthead { display: flex; }
.reference-page .nav-band, .reference-page .board-band { display: block; }
.reference-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
  gap: 10px;
  margin: 14px 0 26px;
}
.reference-columns > * { min-width: 0; }
.reference-widget .panel-head { background: #fafafa; }
.reference-widget p, .profile-details, .widget-links { padding: 10px 12px; font-size: 13px; }
.widget-links { display: flex; flex-wrap: wrap; gap: 4px 9px; }
.reference-tabs {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  padding: 8px 12px;
  border-bottom: 2px solid #ff7500;
}
.reference-tabs h2 { color: #a64000; }

.auth-page .auth-card, .form-page .registration-card { width: min(100%, 420px); margin: 30px auto 50px; padding: 32px 36px; }
.auth-description { text-align: center; color: #626262; font-size: 13px; margin: 6px 0 15px; }
.registration-card h1 { text-align: center; font-size: 20px; }
.auth-tabs { border-bottom: 2px solid #eee; margin-bottom: 16px; text-align: center; }
.auth-tabs h2 {
  display: inline-block; padding: 5px 20px 8px; margin-bottom: -2px;
  border-bottom: 2px solid #ff7500; color: #a64000; font-size: 15px;
}
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding-bottom: 0; font-size: 13px; }

.search-page .search-hero {
  box-shadow: 0 0 0 100vmax #fff3e8;
  clip-path: inset(0 -100vmax);
  padding: 26px 0;
  margin: -.75rem 0 0;
}
.search-page .reference-columns { margin-top: 4px; }
.search-main-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(7rem, 10rem) auto; gap: 8px; }
.search-main-form > * { min-height: 44px; min-width: 0; }
.search-main-form input { border: 1px solid #ff7500; }
.search-main-form button { min-width: 86px; }
.search-results .thread-list { border: 1px solid #eee; border-top: 0; }

.composer-page .form-heading { margin-top: 2px; }
.compose-form { min-width: 0; }
.compose-form input:not([type=hidden]), .compose-form select { max-width: 100%; }
.compose-form [name=title], .compose-form [name=board] { width: min(100%, 36rem); }
.compose-form > .actions { margin-top: 18px; }

.profile-page .profile { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.profile-page .profile-main { flex: 1; min-width: min(100%, 260px); align-items: flex-start; margin: 0; }
.profile-main h1 { font-size: 20px; margin-bottom: 4px; }
.profile-main .post-body { margin-top: 5px; }
.profile-stats { display: flex; gap: 24px; margin-top: 10px; }
.profile-stats div { display: flex; flex-direction: column-reverse; align-items: center; color: #626262; font-size: 12px; }
.profile-stats dd { color: #333; font-size: 18px; font-weight: 700; }
.profile-actions { flex-direction: column; align-items: stretch; }
.profile-details div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed #eee; padding: 5px 0; }
.profile-details dt { color: #626262; }
.profile-details dd { overflow-wrap: anywhere; text-align: right; }

.favorite-sort { border: 1px solid #eee; margin-bottom: 8px; }
.favorite-list .empty { border: 1px solid #eee; }
.favorite-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid #eee;
  border-radius: 2px;
}
.favorite-card:hover { border-color: #ff7500; }
.favorite-card h3 { margin: 0 0 6px; font-size: 16px; }
.favorite-thumb { height: 90px; display: grid; place-items: center; background: #fff0e3; border-radius: 2px; overflow: hidden; font-weight: 700; }
.favorite-thumb img { width: 100%; height: 90px; object-fit: cover; }
.favorite-card .button { min-height: 32px; font-size: 13px; }

.message-heading { margin-top: 2px; border-bottom: 2px solid #ff7500; padding: 8px 0; }
.message-heading h1 { font-size: 22px; }
.message-page .message-nav { border: 1px solid #eee; align-self: start; }
.message-page .message-nav a + a { border-top: 1px solid #eee; }
.message-record {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 12px;
}
.message-record.is-unread { background: #fff9f2; }
.message-record .message-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #fff0e3; color: #8c3500; }
.message-record .message-summary { min-width: 0; }
.message-record .message-summary p { overflow-wrap: anywhere; }
.message-record time { font-size: 12px; }

@media (max-width: 850px) {
  .reference-columns { grid-template-columns: minmax(0, 1fr) minmax(170px, 26%); }
}
@media (max-width: 640px) {
  .reference-columns { grid-template-columns: minmax(0, 1fr); }
  .auth-page .auth-card, .form-page .registration-card { margin: 14px auto 26px; padding: 16px 20px; }
  .search-page .search-hero { padding: 14px 0; }
  .search-main-form { grid-template-columns: minmax(0, 1fr) auto; }
  .search-main-form input { grid-column: 1 / -1; }
  .search-main-form button { min-width: 70px; }
  .profile-actions { flex-direction: row; }
  .favorite-card { grid-template-columns: 58px minmax(0, 1fr); gap: 7px 10px; padding: 9px; }
  .favorite-thumb, .favorite-thumb img { height: 58px; }
  .favorite-card form { grid-column: 2; }
  .message-page .message-nav a + a { border-top: 0; }
  .message-record { grid-template-columns: 30px minmax(0, 1fr); }
  .message-record .message-icon { width: 30px; height: 30px; }
  .message-record time { grid-column: 2; }
}

@media (min-width: 851px) {
  .forum-page main.shell { padding-top: 7px; }
  .composer-page .reference-columns { margin-top: 36px; }
  .profile-page .profile { min-height: 165px; }
  .message-page .message-heading { margin-bottom: 22px; }
  .favorite-page .form-heading { padding-bottom: 15px; }
}
