/*
 * EXP Forum — a 2003 message board inside an XP window.
 *
 * Every rule below is namespaced under .forum-app (or the scroll box that
 * holds it) so the forum palette cannot leak into the XP chrome around it.
 * The title bar, resize gutters and taskbar button all still come from the
 * window manager, untouched. Nothing here draws a window.
 *
 * ---------------------------------------------------------------------------
 * ONE THING TO KNOW BEFORE EDITING
 *
 * index.html loads xp.css AFTER this file, and xp.css styles the bare
 * `button` element: min-width 75px, min-height 23px, a bevel box-shadow and
 * a border-radius. That is right for the real push buttons here (Post Thread,
 * Post Reply, Attach Picture...) and wrong for the three kinds of button this
 * app uses that are NOT push buttons:
 *
 *   .forum-link       inline blue text links built as <button>
 *   .forum-action     the small bracket-ish actions under a post
 *   .forum-picker-grid button   48px picture tiles
 *
 * Those must reset min-width, min-height, box-shadow, border-radius, padding
 * and background explicitly. A class beats an element selector, so the resets
 * below win regardless of file order — but only for the properties they
 * actually name. Anything left unnamed silently inherits the push-button look.
 * ---------------------------------------------------------------------------
 *
 * DENSITY IS THE POINT
 *
 * There is no centred reading column here and no max-width on the layout. A
 * message board fills its window: at 1440px the reader should see navigation,
 * a dozen thread rows, and the statistics panels at once. Line-height is 1.35,
 * table cells are 3-5px, and the type is 11px Tahoma — the same size the rest
 * of the desktop uses.
 */

.forum-window-content {
  overflow: auto;
  padding: 0;
  background: #f4f6fb;
  font: 11px Tahoma, Verdana, Arial, sans-serif;
  color: #000;
  scrollbar-gutter: stable;

  /*
   * The forum reacts to the WINDOW being resized, not to the browser being
   * resized. A viewport media query cannot see that: dragging an XP window's
   * corner never changes the viewport, so the narrow rules would only ever
   * fire on a small screen — which is not the case being designed for here.
   * Declaring the scroll box a container makes the queries at the foot of
   * this file measure the window instead.
   */
  container-type: inline-size;
  container-name: forum;
}

.forum-app {
  min-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: #f4f6fb;
  line-height: 1.35;
}

.forum-app [hidden] {
  display: none !important;
}

/* ------------------------------------------------------------- the banner */

/*
 * The dark identity strip. This is the forum's own header INSIDE the XP
 * window — it is not a second title bar, and it deliberately carries no
 * window controls of any kind.
 */
.forum-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 5px 9px;
  background: linear-gradient(#3a3a3a, #1c1c1c);
  border: 1px solid #000;
  color: #fff;
}

.forum-banner-brand {
  font: bold 15px Tahoma, Verdana, sans-serif;
  letter-spacing: 1px;
  white-space: nowrap;
}

.forum-banner-exp {
  color: #7dd87d;
  margin-right: 3px;
}

.forum-banner-identity {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
}

.forum-banner-welcome,
.forum-banner-guest {
  color: #cfcfcf;
}

.forum-banner-name {
  color: #fff;
}

.forum-banner .forum-link {
  color: #9fd0ff;
}

.forum-banner .forum-link:hover {
  color: #cfe8ff;
}

/* ---------------------------------------------------------- badges */

.forum-badge {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid #8a8a8a;
  background: #e9e9e9;
  color: #333;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 14px;
  vertical-align: middle;
}

/*
 * XP HOLDER. Understated on purpose: this marks a capability, not a rank, and
 * the forum never prints a balance beside it.
 */
.forum-badge--holder {
  border-color: #2e7d32;
  background: #e8f5e9;
  color: #1b5e20;
}

.forum-badge--admin {
  border-color: #b71c1c;
  background: #ffebee;
  color: #b71c1c;
}

.forum-badge--quiet {
  border-color: #b9c6d6;
  background: #eef3fa;
  color: #4a6079;
  font-weight: normal;
  text-transform: lowercase;
  letter-spacing: 0;
}

/* -------------------------------------------------------- breadcrumb bar */

.forum-crumbbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 3px 6px;
  background: #fff;
  border: 1px solid #b9c6d6;
}

.forum-crumbs,
.forum-activity {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.forum-activity {
  color: #4a6079;
}

.forum-crumb-sep {
  color: #8fa4bb;
}

.forum-crumb-current {
  font-weight: bold;
  color: #1c1c1c;
}

/* ------------------------------------------------------------ text links */

/*
 * Blue underlined links, built as <button> so they need no href and no
 * navigation. The resets here are the ones xp.css would otherwise impose.
 */
.forum-link {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  font: inherit;
  color: #0b4ea2;
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}

.forum-link:hover:not(:disabled) {
  color: #d84315;
}

.forum-link:disabled {
  color: #8a8a8a;
  cursor: default;
  text-decoration: none;
}

.forum-link:focus-visible {
  outline: 1px dotted #333;
  outline-offset: 1px;
}

/* --------------------------------------------------------------- panels */

.forum-panel {
  border: 1px solid #7f9db9;
  background: #fff;
  min-width: 0;
}

/*
 * The blue section header. Two flat blues rather than a soft gradient: this
 * is the XP table header idiom, not a modern card header.
 */
.forum-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 7px;
  background: linear-gradient(#3f7fd0, #1f5fae);
  border-bottom: 1px solid #16467f;
  color: #fff;
  font-weight: bold;
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.forum-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: normal;
}

.forum-panel-head .forum-link {
  color: #dbeaff;
}

.forum-panel-body {
  padding: 6px 8px;
}

/* --------------------------------------------------------- the two columns */

.forum-columns {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;

  /*
   * The board area takes the slack, so the statistics panels sit at the foot
   * of the window instead of floating halfway up it with dead space beneath.
   * A short board therefore looks like an empty board, not like a broken
   * layout.
   */
  flex: 1 1 auto;
  min-height: 0;
}

/*
 * At the lobby the sidebar would be a second copy of the table beside it, so
 * the index runs full width. It comes back on every other screen, where it is
 * navigation rather than duplication.
 */
.forum-columns--single {
  grid-template-columns: minmax(0, 1fr);
}

.forum-columns--single .forum-sidebar {
  display: none;
}

.forum-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.forum-main-body {
  min-width: 0;
  flex: 1 1 auto;
}

/* ---------------------------------------------------------------- tables */

/*
 * The dense forum table: thin borders, small type, alternating rows. Cells
 * are padded 3px/6px, which is what makes twelve thread rows fit where the
 * old feed fitted three posts.
 */
.forum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: auto;
}

.forum-table th {
  padding: 3px 6px;
  background: #dce6f2;
  border-bottom: 1px solid #7f9db9;
  color: #16467f;
  font-weight: bold;
  font-size: 10px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.forum-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #dfe6ee;
  vertical-align: top;
}

.forum-table tbody tr:nth-child(even) {
  background: #f7f9fc;
}

.forum-table tbody tr:hover {
  background: #eef3fa;
}

.forum-col-num {
  width: 1%;
  text-align: right;
  white-space: nowrap;
  color: #33475c;
}

.forum-col-last {
  width: 1%;
  white-space: nowrap;
}

.forum-cell-empty {
  padding: 8px;
  color: #667;
}

/* --------------------------------------------------------- board rows */

.forum-boardnav-line,
.forum-thread-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.forum-boardnav-name {
  font-weight: bold;
  letter-spacing: 0.3px;
}

.forum-boardnav-desc {
  color: #55697e;
  margin-left: 21px;
}

.forum-boardnav-counts {
  color: #7b8a99;
  margin-left: 21px;
  font-size: 10px;
}

.forum-boardnav-row.is-current {
  background: #dce6f2 !important;
}

.forum-boardnav-row.is-current .forum-boardnav-name {
  color: #16467f;
}

/* The sidebar shows counts, the lobby table shows them in columns instead. */
.forum-main .forum-boardnav-counts {
  display: none;
}

.forum-glyph {
  display: inline-flex;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  line-height: 0;
}

/* -------------------------------------------------------- thread rows */

.forum-thread-topic {
  font-weight: bold;
  /* User casing is preserved: no text-transform anywhere on a topic. */
  overflow: hidden;
  text-overflow: ellipsis;
}

.forum-thread-author {
  color: #55697e;
  margin-left: 21px;
}

.forum-thread-author-name {
  font-weight: normal;
}

.forum-table tbody tr.is-pinned {
  background: #fffdf0;
}

.forum-table tbody tr.is-pinned:hover {
  background: #fff8dc;
}

.forum-table tbody tr.is-pinned .forum-thread-topic {
  color: #8a4b00;
}

.forum-last-when {
  color: #33475c;
}

.forum-last-who {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #7b8a99;
  font-size: 10px;
}

.forum-last-author {
  color: #0b4ea2;
}

.forum-muted {
  color: #7b8a99;
}

/* --------------------------------------------------------------- avatars */

/*
 * XP Character avatars. Square, pixel-crisp and small — this is a forum
 * avatar, not a profile photo. image-rendering keeps a generated pixel
 * character sharp when it is scaled down.
 */
.forum-avatar {
  width: 20px;
  height: 20px;
  object-fit: cover;
  border: 1px solid #7f9db9;
  background: #fff;
  image-rendering: pixelated;
  flex: 0 0 auto;
}

.forum-avatar--tiny {
  width: 16px;
  height: 16px;
}

.forum-avatar--banner {
  width: 22px;
  height: 22px;
  border-color: #000;
}

.forum-avatar--poster {
  width: 64px;
  height: 64px;
}

/* ------------------------------------------------------------- pagination */

.forum-pager {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 5px 7px;
  border-top: 1px solid #dfe6ee;
  background: #f7f9fc;
}

.forum-pager-label {
  color: #55697e;
  margin-right: 2px;
}

.forum-pager-page,
.forum-pager-step {
  padding: 0 4px;
  border: 1px solid #b9c6d6;
  background: #fff;
  text-decoration: none;
  line-height: 16px;
}

.forum-pager-page:hover:not(:disabled),
.forum-pager-step:hover:not(:disabled) {
  background: #eef3fa;
}

.forum-pager-current {
  padding: 0 4px;
  border: 1px solid #16467f;
  background: #1f5fae;
  color: #fff;
  font-weight: bold;
  line-height: 16px;
}

.forum-pager-gap {
  color: #8fa4bb;
}

/* --------------------------------------------------------- NEW THREAD */

/*
 * The one prominent control in the application. A real XP push button, not a
 * floating action button: it sits in the board header where the reader is
 * already looking.
 */
.forum-newthread {
  min-height: 19px;
  padding: 1px 9px;
  border: 1px solid #16467f;
  border-radius: 2px;
  background: linear-gradient(#fdfdfd, #dfe6ee);
  box-shadow: none;
  font: bold 10px Tahoma, Verdana, sans-serif;
  letter-spacing: 0.3px;
  color: #16467f;
  cursor: pointer;
  white-space: nowrap;
}

.forum-newthread:hover {
  background: linear-gradient(#fff, #eef3fa);
}

.forum-newthread:active {
  background: #dce6f2;
}

/* ----------------------------------------------------------------- posts */

.forum-thread-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 8px;
  background: #f7f9fc;
  border-bottom: 1px solid #dfe6ee;
}

.forum-posts {
  display: block;
}

/*
 * A classic two-column post: identity on the left, content on the right,
 * separated by a rule. Explicitly NOT a card — no radius, no shadow, no gap
 * between posts, and the border is shared with the post above.
 */
.forum-post {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border-bottom: 1px solid #b9c6d6;
}

.forum-post--opener {
  background: #fbfcfe;
}

.forum-poster {
  padding: 8px;
  border-right: 1px solid #b9c6d6;
  background: #eef3fa;
  text-align: center;
  min-width: 0;
}

.forum-poster-identity {
  width: 100%;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.forum-poster-identity .user-identity {
  flex-direction: column;
  gap: 0;
}

.forum-poster-identity .user-identity-text {
  align-items: center;
}

.forum-poster-name {
  margin-top: 4px;
  font-weight: bold;
  color: #16467f;
  word-break: break-word;
}

.forum-poster .forum-badge {
  margin-top: 3px;
}

.forum-poster-facts {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 5px;
  justify-content: center;
  margin: 6px 0 0;
  font-size: 10px;
  color: #55697e;
  text-align: left;
}

.forum-poster-facts dt {
  white-space: nowrap;
}

.forum-poster-facts dd {
  margin: 0;
  color: #33475c;
}

.forum-post-content {
  padding: 6px 8px;
  min-width: 0;
}

.forum-post-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #dfe6ee;
  color: #55697e;
  font-size: 10px;
}

.forum-post-number {
  font-weight: bold;
  color: #16467f;
}

.forum-post-body {
  margin: 6px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.45;
}

.forum-greentext {
  color: #789922;
}

.forum-post-image {
  margin: 6px 0;
}

.forum-post-image img {
  display: block;
  max-width: 180px;
  max-height: 180px;
  border: 1px solid #7f9db9;
  background: #fff;
  cursor: zoom-in;
  image-rendering: pixelated;
}

.forum-post-image img.expanded {
  max-width: 100%;
  max-height: none;
  cursor: zoom-out;
}

.forum-post-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid #dfe6ee;
}

.forum-post-foot:empty {
  display: none;
}

/*
 * Post actions. Understated text, never a reaction bar: Like reads "Like (4)"
 * and does nothing but change that number.
 */
.forum-action {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  font: inherit;
  font-size: 10px;
  color: #0b4ea2;
  text-decoration: underline;
  cursor: pointer;
}

.forum-action:hover:not(:disabled) {
  color: #d84315;
}

.forum-action:disabled {
  color: #8a8a8a;
  cursor: default;
  text-decoration: none;
}

.forum-action--liked {
  font-weight: bold;
  color: #1b5e20;
}

.forum-action--danger {
  color: #a32020;
}

.forum-confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a32020;
  font-size: 10px;
}

/* --------------------------------------------------- composer / quick reply */

.forum-compose {
  padding: 8px;
}

.forum-quickreply {
  margin-top: 6px;
  border: 1px solid #7f9db9;
  border-top: 0;
}

.forum-quickreply .forum-panel-head {
  border-top: 1px solid #16467f;
}

.forum-field {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 5px 8px;
  align-items: start;
  margin-bottom: 7px;
}

.forum-field-label {
  padding-top: 3px;
  color: #33475c;
  font-weight: bold;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.forum-input,
.forum-select,
.forum-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 3px 4px;
  border: 1px solid #7f9db9;
  background: #fff;
  font: 11px Tahoma, Verdana, Arial, sans-serif;
  color: #000;
}

.forum-textarea {
  resize: vertical;
  min-height: 56px;
  line-height: 1.4;
}

.forum-input:focus,
.forum-select:focus,
.forum-textarea:focus {
  outline: 1px solid #1f5fae;
  outline-offset: -1px;
}

.forum-compose-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

/* Real push buttons; xp.css's bevel is wanted here, so nothing is reset. */
.forum-button {
  min-height: 21px;
  padding: 1px 12px;
  font: 11px Tahoma, Verdana, sans-serif;
  cursor: pointer;
}

.forum-button--primary {
  font-weight: bold;
}

.forum-counter {
  margin-left: auto;
  color: #7b8a99;
  font-size: 10px;
}

.forum-attach-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.forum-attach-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid #7f9db9;
  image-rendering: pixelated;
}

/*
 * The real <input type="file">, kept out of the layout without being
 * display:none — a display:none input cannot reliably be opened by a
 * programmatic .click() in every engine, and the visible ATTACH PICTURE...
 * button forwards to it. Positioned rather than sized to zero so a focus ring
 * is not drawn in the corner of the composer.
 */
.forum-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The chosen filename, which can be long and must not stretch the composer. */
.forum-attach-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #33475c;
}

/* The Quick Reply attachment row sits under the textarea, label aligned with
   the compose fields above it so the two composers read as one design. */
.forum-field--reply-attach {
  margin-top: 6px;
  margin-bottom: 0;
}

.forum-picker {
  grid-column: 2;
  margin-top: 5px;
  padding: 6px;
  border: 1px solid #b9c6d6;
  background: #f7f9fc;
}

.forum-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.forum-picker-grid button {
  min-width: 0;
  min-height: 0;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #7f9db9;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.forum-picker-grid button[aria-pressed='true'] {
  border: 2px solid #1f5fae;
}

.forum-picker-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
}

/* ------------------------------------------------------- footer panels */

.forum-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
}

.forum-footer-panel .forum-panel-head {
  gap: 5px;
  justify-content: flex-start;
}

.forum-stat-line {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.forum-stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.forum-stat-table td {
  padding: 1px 0;
  color: #55697e;
  vertical-align: top;
}

.forum-stat-value {
  text-align: right;
  color: #16467f;
  font-weight: bold;
  white-space: nowrap;
}

.forum-stat-value .forum-avatar {
  vertical-align: middle;
  margin-right: 3px;
}

.forum-legend {
  display: grid;
  gap: 2px;
}

.forum-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #33475c;
}

/* -------------------------------------------------------- status / states */

/*
 * The status strip only exists when it has something to say. `:empty` is the
 * belt to setStatus()'s braces: without it an empty div still contributes its
 * padding and border, leaving a blank yellow band above the board index.
 */
.forum-status {
  padding: 4px 8px;
  border: 1px solid #b9c6d6;
  background: #fffbe6;
  color: #33475c;
}

.forum-status:empty {
  display: none;
}

.forum-status--error {
  border-color: #d9a0a0;
  background: #fdeded;
  color: #a32020;
}

.forum-status--success {
  border-color: #a8cfa8;
  background: #edf7ed;
  color: #1b5e20;
}

.forum-loading,
.forum-empty {
  padding: 14px 10px;
  color: #55697e;
  text-align: center;
}

.forum-empty .forum-muted {
  margin-top: 4px;
}

/* ------------------------------------------- board permissions (Phase 3) */

/*
 * Who may read and post where, and why not. Every line here is drawn from the
 * server's answer about this reader or from the board's published rules; the
 * styles only say how loudly.
 */

.forum-badge--guest {
  border-color: #8a8a8a;
  background: #f3f3f3;
  color: #555;
}

.forum-badge--whale {
  border-color: #1f5fa8;
  background: #e6f0fb;
  color: #164a85;
}

.forum-badge--private {
  border-color: #c9a227;
  background: #fff8dc;
  color: #6b5200;
  font-weight: normal;
  text-transform: lowercase;
  letter-spacing: 0;
}

/* Standing notices: an ended Guest session, permissions that could not be checked. */
.forum-notices {
  display: grid;
  gap: 4px;
}

.forum-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 4px 8px;
  border: 1px solid #d9c27a;
  background: #fff8dc;
  color: #4d3d00;
}

.forum-notice--error {
  border-color: #d9a0a0;
  background: #fdeded;
  color: #a32020;
}

.forum-notice-text {
  flex: 1 1 260px;
  min-width: 0;
}

.forum-notice-action {
  flex: 0 0 auto;
}

/* The line under a board's title: its rules, then what this reader can do. */
.forum-board-intro {
  margin: 0 0 6px;
  padding: 4px 8px;
  border: 1px solid #b9c6d6;
  background: #f3f7fc;
  color: #33475c;
  overflow-wrap: anywhere;
}

.forum-board-intro--warning {
  border-color: #d9c27a;
  background: #fff8dc;
  color: #4d3d00;
}

.forum-board-intro--error {
  border-color: #d9a0a0;
  background: #fdeded;
  color: #a32020;
}

.forum-board-intro--quiet {
  color: #7b8a99;
}

.forum-board-rules {
  font-weight: bold;
}

.forum-board-guest {
  margin-top: 2px;
  color: #4d3d00;
}

/* A private board this reader may not read: name, lock, reason. */
.forum-locked {
  margin: 10px auto;
  max-width: 460px;
  padding: 12px 14px;
  border: 1px solid #b9c6d6;
  background: #f7f9fc;
  text-align: center;
  overflow-wrap: anywhere;
}

.forum-locked-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #16467f;
}

.forum-locked-text {
  margin-top: 6px;
  color: #33475c;
}

.forum-locked-action {
  margin-top: 8px;
}

.forum-table tr.is-locked td {
  background: #f7f7f7;
}

/* A Guest author: plain text, never a profile link. */
.forum-guest-name {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  color: #33475c;
}

.forum-guest-label {
  font-weight: bold;
}

.forum-poster-identity--guest {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* The Guest line above a composer, and any wait the server reported. */
.forum-guest-note {
  margin: 0 0 6px;
  padding: 4px 8px;
  border: 1px dashed #b9c6d6;
  background: #fbfcfe;
  color: #33475c;
}

.forum-guest-wait {
  margin: 2px 0;
  color: #8a5a00;
  font-weight: bold;
}

.forum-picture-note,
.forum-compose-rules {
  display: block;
  margin-top: 2px;
}

/* A Super Admin editing an announcement in place. */
.forum-post-edit {
  display: grid;
  gap: 4px;
}

.forum-post-edit .forum-compose-actions {
  justify-content: flex-start;
}

/* --------------------------------------------------------- narrow windows */

/*
 * These measure the WINDOW, not the viewport — see the container declaration
 * at the top of the file. Dragging the forum window narrow triggers them; so
 * does opening it on a phone-sized screen.
 */

/* Statistics panels stack before anything else gives way. */
@container forum (max-width: 760px) {
  .forum-footer {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container forum (max-width: 640px) {
  /* Navigation moves above the thread list rather than shrinking further. */
  .forum-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Views is the first column to go: replies and last-post carry more. */
  .forum-table th:nth-child(3),
  .forum-table td:nth-child(3) {
    display: none;
  }

  /* The identity panel goes above the post instead of beside it. */
  .forum-post {
    grid-template-columns: minmax(0, 1fr);
  }

  .forum-poster {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    border-right: 0;
    border-bottom: 1px solid #b9c6d6;
    padding: 5px 8px;
  }

  .forum-avatar--poster {
    width: 32px;
    height: 32px;
  }

  .forum-poster-name {
    margin-top: 0;
  }

  .forum-poster-facts {
    grid-auto-flow: column;
    justify-content: start;
    margin: 0 0 0 auto;
    gap: 0 4px;
  }
}

@container forum (max-width: 480px) {
  /* Only the topic and the last post survive. Both stay readable. */
  .forum-table th:nth-child(2),
  .forum-table td:nth-child(2) {
    display: none;
  }

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

  .forum-picker {
    grid-column: 1;
  }

  .forum-attach-name {
    max-width: 100%;
  }

  .forum-banner {
    gap: 4px;
  }

  .forum-locked {
    margin: 6px 0;
    padding: 10px 8px;
  }

  .forum-panel-head-actions .forum-newthread {
    white-space: nowrap;
  }
}
