/*
 * me89x Forum — dreamy mid-2000s message board.
 * Keeps its own palette on purpose, so it looks the same under every messenger theme.
 */

.forum-shell {
  --fm-ink: #43296b;
  --fm-muted: #6c5690;
  --fm-link: #6a2fa8;
  --fm-hover: #c2185b;
  --fm-line: #b9a3e3;
  --fm-line-soft: #ddd0f3;
  --fm-row: #fffaff;
  --fm-row-alt: #f6efff;
  --fm-panel: #fdf6ff;
  --fm-bar-a: #6d4bb8;
  --fm-bar-b: #b0468c;
  --fm-sub-a: #e6dbfa;
  --fm-sub-b: #fbdcef;
  --fm-new: #d81b72;

  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  color: var(--fm-ink);
  font: 12px/1.55 Verdana, Tahoma, "Segoe UI", sans-serif;
  background-color: #d7d3fb;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='%23ffffff' fill-opacity='.75'%3E%3Cpath d='M20 12l2 6 6 2-6 2-2 6-2-6-6-2 6-2z'/%3E%3Cpath d='M86 70l1.500 4.500 4.500 1.500-4.500 1.500-1.500 4.500-1.500-4.500-4.500-1.500 4.500-1.500z'/%3E%3Ccircle cx='66' cy='24' r='1.600'/%3E%3Ccircle cx='24' cy='92' r='1.600'/%3E%3Ccircle cx='106' cy='104' r='1.200'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, #b9c9ff 0%, #d9c9fb 45%, #fbd5ec 100%);
  background-attachment: local, scroll;
}

.forum-shell[hidden] { display: none; }
/* :where keeps this at element specificity so .fm-* classes can set their own color and weight. */
:where(.forum-shell) button { font: inherit; color: inherit; }
.forum-shell a { color: var(--fm-link); text-decoration: underline; }
.forum-shell a:hover { color: var(--fm-hover); }
.forum-shell button,
.forum-shell a { -webkit-user-select: text; user-select: text; }

.fm-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px 14px 20px;
}

/* ---------- Banner ---------- */

.fm-banner {
  position: relative;
  overflow: hidden;
  height: 132px;
  padding: 26px 16px 0;
  text-align: center;
  border: 1px solid #fff;
  outline: 1px solid var(--fm-line);
  background: linear-gradient(180deg, #4a3a9c 0%, #8a63c9 48%, #f0a3cf 100%);
}

.fm-logo {
  position: relative;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #fff !important;
  font: italic bold 38px/1.1 Georgia, "Times New Roman", serif !important;
  text-shadow: 0 0 10px #ffc4ec, 0 0 22px #d6a8ff, 1px 2px 0 #5b2f8f;
}

.fm-tagline {
  position: relative;
  margin: 6px 0 0;
  color: #fff;
  font: italic 12px Georgia, "Times New Roman", serif;
  text-shadow: 1px 1px 0 #5b2f8f;
}

.fm-moon {
  position: absolute;
  top: 14px;
  right: 8%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff4c4;
  box-shadow: 0 0 22px 8px #fff4c480;
}

.fm-moon::after {
  content: "";
  position: absolute;
  top: -5px;
  left: -13px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #6650b2;
}

.fm-cloud {
  position: absolute;
  bottom: -12px;
  width: 170px;
  height: 46px;
  border-radius: 40px;
  background: #ffffffd9;
  box-shadow: 44px -16px 0 2px #ffffffd9, 96px -6px 0 -3px #ffffffd9;
}

.fm-cloud-a { left: -30px; animation: fm-drift 26s ease-in-out infinite alternate; }
.fm-cloud-b { right: 70px; bottom: -22px; opacity: .75; animation: fm-drift 34s ease-in-out infinite alternate-reverse; }

.fm-star { position: absolute; color: #fff; animation: fm-twinkle 2.6s ease-in-out infinite; }
.fm-star-a { top: 16px; left: 9%; font-size: 18px; }
.fm-star-b { top: 52px; left: 22%; font-size: 12px; animation-delay: .7s; }
.fm-star-c { top: 22px; right: 25%; font-size: 13px; animation-delay: 1.3s; }
.fm-star-d { top: 62px; right: 17%; font-size: 16px; animation-delay: 1.9s; }

@keyframes fm-drift { to { transform: translateX(46px); } }
@keyframes fm-twinkle { 50% { opacity: .25; transform: scale(.7); } }
@keyframes fm-marquee { to { transform: translateX(-100%); } }

/* ---------- Navigation ---------- */

.fm-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 14px;
  margin-bottom: 10px;
  padding: 5px 10px;
  border: 1px solid var(--fm-line);
  border-top: 0;
  background: linear-gradient(180deg, #fff 0%, #f3e9ff 50%, #e8dafb 51%, #f6e6f6 100%);
}

.fm-nav > button {
  border: 0;
  background: none;
  padding: 3px 0;
  color: var(--fm-link);
  font-weight: bold;
  cursor: pointer;
}

.fm-nav > button:hover { color: var(--fm-hover); text-decoration: underline; }

.fm-search { display: flex; gap: 4px; margin-left: auto; }

.forum-shell .fm-search input,
.forum-shell .fm-field input,
.forum-shell .fm-editor textarea,
.forum-shell .fm-signature-form textarea,
.forum-shell .fm-mod select {
  border: 1px solid var(--fm-line);
  border-radius: 0;
  background: #fff;
  color: var(--fm-ink);
  font: 12px Verdana, Tahoma, sans-serif;
  box-shadow: none;
}

.forum-shell .fm-search input { width: 170px; height: 24px; padding: 2px 6px; }

.fm-crumbs { margin: 0 0 8px; color: var(--fm-muted); font-size: 11px; }

.fm-crumbs button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--fm-link);
  cursor: pointer;
  text-decoration: underline;
}

.fm-welcome {
  margin: 0 0 8px;
  text-align: center;
  color: var(--fm-link);
  font: italic bold 14px Georgia, "Times New Roman", serif;
}

/* ---------- Marquee ---------- */

.fm-marquee {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 4px 8px;
  border: 1px dashed var(--fm-line);
  background: #fff9;
  font-size: 11px;
}

.fm-marquee strong { flex-shrink: 0; color: var(--fm-new); }
.fm-marquee-window { flex: 1; min-width: 0; overflow: hidden; }

.fm-marquee-track {
  display: inline-flex;
  gap: 26px;
  padding-left: 100%;
  white-space: nowrap;
  animation: fm-marquee 32s linear infinite;
}

.fm-marquee:hover .fm-marquee-track,
.fm-marquee:focus-within .fm-marquee-track { animation-play-state: paused; }

.fm-marquee-track button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--fm-link);
  cursor: pointer;
}

.fm-marquee-track button:hover { color: var(--fm-hover); text-decoration: underline; }

/* ---------- Boxes and tables ---------- */

.fm-box {
  margin-bottom: 12px;
  border: 1px solid var(--fm-line);
  background: var(--fm-row);
  box-shadow: 2px 2px 0 #8a6fc833;
}

.fm-cat {
  position: relative;
  margin: 0;
  padding: 6px 10px;
  color: #fff;
  font: bold 12px "Trebuchet MS", Verdana, sans-serif;
  letter-spacing: .3px;
  text-shadow: 1px 1px 0 #3c2478;
  background: linear-gradient(90deg, var(--fm-bar-a), var(--fm-bar-b));
}

.fm-cat::after {
  content: "";
  position: absolute;
  inset: 0 0 50%;
  background: #ffffff26;
  pointer-events: none;
}

.fm-cat-sub {
  border-top: 1px solid var(--fm-line);
  color: var(--fm-ink);
  text-shadow: none;
  background: linear-gradient(90deg, var(--fm-sub-a), var(--fm-sub-b));
}

.fm-table { width: 100%; border-collapse: collapse; }

.fm-table th {
  padding: 3px 8px;
  border-bottom: 1px solid var(--fm-line);
  text-align: left;
  color: var(--fm-ink);
  font-size: 10px;
  background: linear-gradient(180deg, #fff, var(--fm-sub-a));
}

.fm-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--fm-line-soft);
  vertical-align: middle;
  background: var(--fm-row);
}

.fm-table tr:nth-child(even) td { background: var(--fm-row-alt); }
.fm-table tr:last-child td { border-bottom: 0; }
.fm-table tr.fm-pinned td { background: #fff4d9; }

.forum-shell .fm-num { width: 68px; text-align: center; }
.fm-table th.fm-num { text-align: center; }
.fm-last { width: 240px; font-size: 11px; }

.fm-icon {
  width: 38px;
  text-align: center;
  color: #a58fd0;
  font-size: 19px;
}

.fm-icon-new { color: var(--fm-new); text-shadow: 0 0 6px #ff9ccf; }

.fm-main small,
.fm-last small {
  display: block;
  color: var(--fm-muted);
  font-size: 10px;
}

.fm-board-link,
.fm-thread-link,
.fm-user {
  border: 0;
  background: none;
  padding: 0;
  color: var(--fm-link);
  text-align: left;
  cursor: pointer;
}

.fm-board-link { font-weight: bold; }
.fm-board-link:hover,
.fm-thread-link:hover,
.fm-user:hover { color: var(--fm-hover); text-decoration: underline; }

.fm-thread-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm-new {
  display: inline-block;
  margin: 0 4px;
  padding: 0 4px;
  color: #fff;
  font-size: 9px;
  font-weight: bold;
  background: var(--fm-new);
  animation: fm-twinkle 2.2s ease-in-out infinite;
}

.fm-flag {
  margin-right: 5px;
  color: var(--fm-muted);
  font-size: 10px;
  font-weight: bold;
}

.fm-panel { padding: 8px 10px; background: var(--fm-panel); }
.fm-panel p { margin: 0 0 4px; }
.fm-muted { color: var(--fm-muted); font-size: 11px; }
.fm-empty { padding: 22px 10px; text-align: center; color: var(--fm-muted); }
.fm-stats { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 11px; }
.fm-message { padding: 26px 12px; text-align: center; }
.fm-message p { margin: 0 0 10px; }

/* ---------- Buttons ---------- */

.fm-btn {
  padding: 2px 9px;
  border: 1px solid var(--fm-line);
  border-radius: 3px;
  background: linear-gradient(180deg, #fff 0%, #f4ecff 50%, #e6d8fa 51%, #f3e8ff 100%);
  color: var(--fm-link) !important;
  font-size: 11px !important;
  cursor: pointer;
}

.fm-btn:hover { border-color: #e088bd; background: linear-gradient(180deg, #fff 0%, #ffeaf6 50%, #fdd5ea 51%, #ffe9f6 100%); }

.fm-btn-main {
  border-color: #6a48b5;
  background: linear-gradient(180deg, #a58ae6 0%, #8560d3 50%, #6f49c2 51%, #9a63c7 100%);
  color: #fff !important;
  font-weight: bold;
  text-shadow: 1px 1px 0 #3c2478;
}

.fm-btn-main:hover { border-color: #a83d82; background: linear-gradient(180deg, #e88cc4 0%, #cf5da5 50%, #b5468e 51%, #cf60a8 100%); }
.fm-btn-danger { color: #b0204f !important; }

.fm-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.fm-actions:empty { display: none; }

.fm-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  font-size: 10px;
}

.fm-pager > span:first-child { margin-right: 6px; color: var(--fm-muted); }

.fm-pager button {
  min-width: 22px;
  padding: 1px 5px;
  border: 1px solid var(--fm-line);
  background: var(--fm-row);
  color: var(--fm-link);
  cursor: pointer;
}

.fm-pager button.active { background: var(--fm-bar-a); color: #fff; font-weight: bold; }

/* ---------- Posts ---------- */

.fm-thread-title {
  margin: 0 0 8px;
  color: var(--fm-link);
  font: italic bold 18px Georgia, "Times New Roman", serif;
  overflow-wrap: anywhere;
}

.fm-mod {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 8px;
  border: 1px dashed #d87fb6;
  background: #fff0f8;
  font-size: 11px;
}

.forum-shell .fm-mod select { width: auto; max-width: 220px; height: 22px; padding: 0 4px; font-size: 11px; }

.fm-post {
  margin-bottom: 10px;
  border: 1px solid var(--fm-line);
  background: var(--fm-row);
  box-shadow: 2px 2px 0 #8a6fc833;
  scroll-margin-top: 8px;
}

.fm-post-head {
  display: flex;
  justify-content: space-between;
  padding: 3px 8px;
  color: #fff;
  font-size: 10px;
  text-shadow: 1px 1px 0 #3c2478;
  background: linear-gradient(90deg, var(--fm-bar-a), var(--fm-bar-b));
}

.fm-post-grid { display: grid; grid-template-columns: 158px minmax(0, 1fr); }

.fm-author {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 6px;
  border-right: 1px solid var(--fm-line-soft);
  text-align: center;
  background: var(--fm-row-alt);
}

.fm-author .fm-user { font-weight: bold; text-align: center; overflow-wrap: anywhere; }
.fm-author small { color: var(--fm-muted); font-size: 10px; }
.fm-rank { font-style: italic; }
.fm-stars { color: #e39a1f; font-size: 10px; letter-spacing: 1px; }

.fm-avatar {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 5px 0;
  border: 1px solid var(--fm-line);
  outline: 3px solid #fff;
  outline-offset: -4px;
  background: linear-gradient(135deg, #e3d8ff, #ffdcef);
  font-size: 38px;
  line-height: 1;
}

.fm-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 50%;
  background: #b5aac4;
}

.fm-dot.on { background: #38b26b; box-shadow: 0 0 4px #38b26b; }

.fm-content { min-width: 0; padding: 9px 11px; }

.fm-body {
  min-height: 74px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.fm-edited {
  margin: 8px 0 0;
  color: var(--fm-muted);
  font-size: 10px;
  font-style: italic;
}

.fm-thanks {
  margin-top: 8px;
  padding: 3px 7px;
  border: 1px dotted #e088bd;
  background: #fff3fa;
  font-size: 11px;
}

.fm-signature {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px dashed var(--fm-line);
  color: var(--fm-muted);
  font-size: 11px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.fm-panel > .fm-signature { margin-top: 0; padding-top: 0; border-top: 0; }

.fm-post-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  padding: 4px 8px;
  border-top: 1px solid var(--fm-line-soft);
  background: var(--fm-row-alt);
}

/* ---------- BBCode output ---------- */

.fm-center { text-align: center; }
.fm-size-1 { font-size: 10px; }
.fm-size-2 { font-size: 12px; }
.fm-size-3 { font-size: 14px; }
.fm-size-4 { font-size: 18px; }
.fm-size-5 { font-size: 24px; }

.fm-image { max-width: 100%; height: auto; vertical-align: middle; }

.fm-quote {
  margin: 6px 0;
  padding: 6px 9px;
  border: 1px dashed var(--fm-line);
  border-left: 3px solid #d87fb6;
  background: #fbf4ff;
}

.fm-quote-head {
  margin-bottom: 3px;
  color: var(--fm-muted);
  font-size: 11px;
  font-weight: bold;
}

.fm-code {
  margin: 6px 0;
  max-height: 320px;
  overflow: auto;
  padding: 7px 9px;
  border: 1px solid var(--fm-line);
  background: #f4f0fb;
  font: 12px Consolas, "Courier New", monospace;
  white-space: pre;
}

.fm-spoiler {
  margin: 6px 0;
  padding: 4px 8px;
  border: 1px dotted var(--fm-line);
  background: #fbf4ff;
}

.fm-spoiler summary { color: var(--fm-link); font-size: 11px; cursor: pointer; }

/* ---------- Editor ---------- */

.fm-field { display: block; margin-bottom: 8px; }
.fm-field span { display: block; margin-bottom: 2px; font-weight: bold; font-size: 11px; }
.forum-shell .fm-field input { width: 100%; height: 26px; padding: 3px 6px; }

.fm-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--fm-line);
  border-bottom: 0;
  background: linear-gradient(180deg, #fff, #efe5fd);
}

.fm-tools button {
  min-width: 24px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid transparent;
  background: none;
  color: var(--fm-ink);
  font-size: 11px;
  cursor: pointer;
}

.fm-tools button:hover { border-color: var(--fm-line); background: #fff; }
.fm-tool-group { display: inline-flex; gap: 2px; margin-left: 5px; padding-left: 5px; border-left: 1px solid var(--fm-line); }
.fm-tools .fm-swatch { min-width: 16px; width: 16px; height: 16px; padding: 0; border-color: #fff; }
.fm-smileys { background: #fdf6ff; }
.fm-smileys button { font-size: 15px; }

.forum-shell .fm-editor textarea {
  display: block;
  width: 100%;
  min-height: 130px;
  padding: 7px;
  resize: vertical;
}

.fm-preview {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px dashed var(--fm-line);
  background: #fff;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.fm-preview[hidden] { display: none; }

.fm-form-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

/* ---------- Profile and lists ---------- */

.fm-profile { display: flex; gap: 16px; align-items: flex-start; }
.fm-profile .fm-author { flex-shrink: 0; width: 138px; border: 1px solid var(--fm-line-soft); }
.fm-profile p { overflow-wrap: anywhere; }

.fm-list { margin: 0; padding: 0; list-style: none; }

.fm-list li {
  padding: 5px 0;
  border-bottom: 1px dotted var(--fm-line-soft);
}

.fm-list li:last-child { border-bottom: 0; }
.fm-list small { color: var(--fm-muted); font-size: 10px; }
.fm-results p { margin: 2px 0; overflow-wrap: anywhere; }

.forum-shell .fm-signature-form textarea { display: block; width: 100%; padding: 6px; resize: vertical; }
.fm-signature-form .fm-muted { margin: 4px 0; }

/* ---------- Footer ---------- */

.fm-footer {
  padding: 6px 0;
  text-align: center;
  color: var(--fm-ink);
  font-size: 10px;
}

.fm-footer p { margin: 0 0 2px; }
.fm-divider { color: #7a55b8; letter-spacing: 1px; }
.fm-footer-note { font-style: italic; }

.forum-shell :focus-visible { outline: 2px solid var(--fm-hover); outline-offset: 1px; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .fm-page { padding: 8px 8px 16px; }
  .fm-banner { height: 104px; padding-top: 18px; }
  .fm-logo { font-size: 28px !important; }
  .fm-tagline { font-size: 11px; }
  .fm-moon { top: 8px; right: 5%; width: 32px; height: 32px; }
  .fm-moon::after { width: 32px; height: 32px; left: -9px; }
  .fm-cloud { bottom: -34px; }
  .fm-cloud-b { bottom: -38px; }
  .fm-search { width: 100%; margin-left: 0; }
  .forum-shell .fm-search input { flex: 1; width: auto; min-width: 0; font-size: 16px; }

  .fm-table thead { display: none; }
  .fm-table,
  .fm-table tbody { display: block; }

  .fm-table tr {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto auto;
    padding: 6px 4px;
    border-bottom: 1px solid var(--fm-line-soft);
    background: var(--fm-row);
  }

  .fm-table tr:nth-child(even) { background: var(--fm-row-alt); }
  .fm-table tr.fm-pinned { background: #fff4d9; }
  .fm-table tr:last-child { border-bottom: 0; }
  .fm-table td,
  .fm-table tr:nth-child(even) td,
  .fm-table tr.fm-pinned td { padding: 1px 3px; border: 0; background: none; }

  .fm-icon { grid-row: 1 / 3; align-self: center; width: auto; }
  .fm-main { grid-column: 2 / 5; }

  .forum-shell .fm-num {
    grid-row: 2;
    width: auto;
    padding-left: 8px;
    color: var(--fm-muted);
    font-size: 10px;
    white-space: nowrap;
  }

  .forum-shell .fm-num::before { content: attr(data-label) ": "; }
  .fm-table .fm-last { grid-column: 2; grid-row: 2; width: auto; min-width: 0; }

  .fm-post-grid { grid-template-columns: minmax(0, 1fr); }

  .fm-post .fm-author {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 0 8px;
    padding: 6px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--fm-line-soft);
    text-align: left;
  }

  .fm-post .fm-avatar {
    grid-column: 1;
    grid-row: 1 / 4;
    width: 44px;
    height: 44px;
    margin: 0;
    outline-width: 2px;
    outline-offset: -3px;
    font-size: 24px;
  }

  .fm-post .fm-author > .fm-user { grid-column: 2; grid-row: 1; text-align: left; }
  .fm-post .fm-rank { grid-column: 2; grid-row: 2; }
  .fm-post .fm-stars { grid-column: 2; grid-row: 3; }
  .fm-post .fm-author > small:not(.fm-rank) { grid-column: 3; text-align: right; }

  .fm-body { min-height: 0; }
  .fm-profile { flex-direction: column; }
  .fm-profile .fm-author { width: 100%; }
  .forum-shell .fm-editor textarea,
  .forum-shell .fm-field input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .fm-cloud,
  .fm-star,
  .fm-new { animation: none; }

  .fm-marquee-track {
    padding-left: 0;
    animation: none;
  }

  .fm-marquee-window { overflow-x: auto; }
}

/* ---------- Roles, avatars and moderation ---------- */

.forum-shell .fm-user.role-admin { color: #c0182f; font-weight: bold; }
.forum-shell .fm-user.role-mod { color: #1f7a3a; font-weight: bold; }
.forum-shell .fm-user.is-banned { color: #8d8698; text-decoration: line-through; }
.fm-legend { margin-top: 6px !important; color: var(--fm-muted); font-size: 10px; }

.fm-badge {
  display: inline-block;
  margin: 2px 0;
  padding: 0 6px;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: .3px;
  background: #fff;
}

.fm-badge.role-admin { color: #c0182f; }
.fm-badge.role-mod { color: #1f7a3a; }
.fm-badge.is-banned { color: #6b6375; }

.fm-avatar-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100px;
  max-height: 100px;
  background: #fff;
  object-fit: contain;
}

.fm-avatar.fm-avatar-small {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin: 0;
  outline-width: 2px;
  outline-offset: -3px;
  font-size: 22px;
}

.fm-avatar-img.fm-avatar-small { object-fit: cover; }

.fm-count {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 8px;
  color: #fff;
  font-size: 9px;
  text-align: center;
  background: var(--fm-new);
}

.fm-notice,
.fm-ban {
  margin-bottom: 10px;
  padding: 7px 10px;
  border: 1px solid #e6c46a;
  background: #fff8dc;
  box-shadow: 2px 2px 0 #8a6fc833;
}

.fm-notice strong { display: block; margin-bottom: 3px; color: #a05a00; font-size: 11px; }
.fm-notice .fm-body { min-height: 0; }
.fm-ban { border-color: #e39aa8; color: #9b1c38; background: #ffeef1; font-weight: bold; }

.fm-main .fm-mods,
.fm-board-about .fm-mods { margin-top: 1px; }
.fm-board-about small { display: block; color: var(--fm-muted); font-size: 11px; }
.fm-action-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fm-flag-wait { color: #a05a00; }
.fm-flag-ban { display: block; margin-top: 2px; color: #9b1c38; font-size: 10px; }

.fm-wait {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 8px;
  padding: 6px 9px;
  border: 1px dashed #e0a43a;
  background: #fff8e1;
  color: #7a4a00;
  font-size: 11px;
}

.fm-post .fm-wait { margin: 0; border-width: 0 0 1px; }
.fm-wait-tools { display: inline-flex; gap: 4px; margin-left: auto; }
.fm-post-pending { border-style: dashed; border-color: #e0a43a; }
.fm-post-pending .fm-post-head { background: linear-gradient(90deg, #a8721c, #b86a3e); }
.fm-reported { color: #ffe3a3; font-weight: bold; }

.fm-avatar-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.fm-avatar-form input[type=file] { max-width: 100%; font-size: 11px; }

/* ---------- Control panel ---------- */

.fm-acp { display: grid; grid-template-columns: 170px minmax(0, 1fr); background: var(--fm-panel); }

.fm-acp-nav {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
  border-right: 1px solid var(--fm-line);
  background: linear-gradient(180deg, var(--fm-sub-a), var(--fm-sub-b));
}

.fm-acp-nav button {
  padding: 5px 12px;
  border: 0;
  border-left: 3px solid transparent;
  background: none;
  color: var(--fm-link);
  text-align: left;
  font-weight: bold;
  cursor: pointer;
}

.fm-acp-nav button:hover { color: var(--fm-hover); background: #ffffff80; }
.fm-acp-nav button.active { border-left-color: var(--fm-bar-b); color: var(--fm-ink); background: #fff; }
.fm-acp-body { min-width: 0; padding: 10px 12px; }

.fm-acp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 4px 12px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px dotted var(--fm-line);
  list-style: none;
  background: #fff;
  font-size: 11px;
}

.fm-acp-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.fm-acp-title {
  margin: 10px 0 5px;
  padding-bottom: 2px;
  border-bottom: 1px dashed var(--fm-line);
  color: var(--fm-link);
  font: bold 12px "Trebuchet MS", Verdana, sans-serif;
}

.fm-inline { display: inline; }
.forum-shell .fm-gone { text-decoration: line-through; opacity: .75; }

.fm-queue {
  margin-bottom: 10px;
  padding: 7px 9px;
  border: 1px solid var(--fm-line-soft);
  background: #fff;
}

.fm-queue-head { margin-bottom: 5px; }
.fm-queue-head small { display: block; color: var(--fm-muted); font-size: 10px; }

.fm-queue-body {
  min-height: 0;
  max-height: 240px;
  overflow: auto;
  padding: 6px 8px;
  border: 1px dotted var(--fm-line);
  background: var(--fm-panel);
}

.fm-reasons { margin-bottom: 5px; font-size: 11px; }
.fm-reasons li { padding: 2px 0; }

.forum-shell .fm-acp input,
.forum-shell .fm-acp select,
.forum-shell .fm-acp textarea {
  max-width: 100%;
  height: 24px;
  padding: 2px 5px;
  border: 1px solid var(--fm-line);
  border-radius: 0;
  background: #fff;
  color: var(--fm-ink);
  font: 11px Verdana, Tahoma, sans-serif;
  box-shadow: none;
}

.forum-shell .fm-acp textarea { height: auto; }
/* The messenger styles labels and inputs as roomy stacked fields; the panel wants them compact. */
.forum-shell .fm-acp label { gap: 2px; margin: 0; font-weight: normal; }
.forum-shell .fm-acp select,
.forum-shell .fm-acp input { width: auto; }
.forum-shell .fm-avatar-form input[type=file] { width: auto; padding: 0; border: 0; border-radius: 0; background: none; }
.forum-shell .fm-acp .fm-number { width: 90px; }
.fm-acp-search { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.forum-shell .fm-acp-search input { flex: 1; min-width: 140px; }

.fm-member {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--fm-line);
}

.fm-member-who { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.fm-member-who small { display: block; }
.fm-member-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

.fm-inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 6px; }
.fm-inline-form label { display: flex; flex-direction: column; color: var(--fm-muted); font-size: 10px; }

.fm-board-edit {
  margin-bottom: 10px;
  padding: 7px 9px;
  border: 1px solid var(--fm-line-soft);
  background: #fff;
}

.fm-board-edit-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 5px; }
.fm-board-edit-head small { margin-left: 4px; }
.fm-board-edit-head > span:last-child { display: flex; flex-shrink: 0; gap: 3px; }

.fm-board-fields {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 190px;
  gap: 5px 8px;
}

.fm-board-fields label { display: flex; flex-direction: column; color: var(--fm-muted); font-size: 10px; }
.fm-board-fields .fm-wide { grid-column: 1 / -1; }
.forum-shell .fm-board-fields input,
.forum-shell .fm-board-fields select { width: 100%; }

.fm-board-mods {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed var(--fm-line-soft);
  font-size: 11px;
}

.fm-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 2px 0 6px;
  border: 1px solid var(--fm-line);
  border-radius: 10px;
  background: var(--fm-row-alt);
}

.fm-chip button:not(.fm-user) { border: 0; background: none; color: #b0204f; cursor: pointer; font-size: 10px; }

.fm-log td { font-size: 11px; vertical-align: top; }
.fm-log td small { display: block; color: var(--fm-muted); font-size: 10px; }
.fm-log-time { white-space: nowrap; color: var(--fm-muted); }

@media (max-width: 760px) {
  .fm-acp { grid-template-columns: minmax(0, 1fr); }

  .fm-acp-nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 4px;
    border-right: 0;
    border-bottom: 1px solid var(--fm-line);
  }

  .fm-acp-nav button { padding: 4px 8px; border-left: 0; border-bottom: 2px solid transparent; }
  .fm-acp-nav button.active { border-bottom-color: var(--fm-bar-b); }
  .fm-acp-body { padding: 8px; }
  .fm-acp-columns,
  .fm-member,
  .fm-board-fields { grid-template-columns: minmax(0, 1fr); }

  .forum-shell .fm-acp input,
  .forum-shell .fm-acp select { height: 30px; font-size: 16px; }

  .fm-table.fm-log tr { grid-template-columns: minmax(0, 1fr); }
  .fm-table.fm-log td { padding: 1px 3px; }
  .fm-post .fm-avatar-img { max-width: 44px; max-height: 44px; object-fit: cover; }
  .fm-post .fm-badge { grid-column: 3; grid-row: 1; justify-self: end; }
  .fm-wait-tools { margin-left: 0; }
}
