/* The owner interface: every page under /manage (Pages/Manage).
   It looks like the rest of the community site: light gray page, white cards, the
   community's accent color. It borrows the page heading, buttons, fields, pager and tags
   from threads.css and the notice and profile blocks from account.css.

   Mobile first: the rules outside a media query lay the page out for a phone; the
   min-width block at the end adds the desktop columns. Everything tapped is at least
   44 px tall, form fields use 16 px text (smaller makes an iPhone zoom the page), and
   the only motion is a hover fading in (site.css turns it off where the device asks).

   Every color, font, corner radius, shadow and gradient is a custom property from
   site.css, so a community's theme can change them. A value with no variable yet gets
   one there first. */

.manage { display: flex; flex-direction: column; gap: 14px; margin-top: -12px; }

.manage a:focus-visible, .manage button:focus-visible, .manage input:focus-visible,
.manage select:focus-visible, .manage textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-chip);
}

/* The section menu is Manage/_ManageNav: see "The Manage menu" below. */

/* The landing page: numbers, the way in to each section, two short lists */
.m-stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.m-stat { padding: 12px 16px; }
.m-stat dt { color: var(--muted); font-size: 13px; }
.m-stat dd { margin: 2px 0 0; font-family: var(--font-heading); font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: var(--tight); }

.m-sections { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.m-section { display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: 14px 16px; color: var(--ink); text-decoration: none; transition: border-color var(--ease), box-shadow var(--ease); }
.m-section:hover { border-color: var(--accent); box-shadow: var(--elev-3); }
.m-section-name { color: var(--accent); font-family: var(--font-heading); font-size: 17px; font-weight: 700; }

.m-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.m-card-title { margin: 0; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--head-fill); font-size: 17px; font-weight: 700; }
.m-card-foot { margin: 0; padding: 0 16px; border-top: 1px solid var(--line-soft); }
.m-card-foot a { display: inline-flex; align-items: center; min-height: 44px; }
.m-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 16px; padding: 10px 16px; border-top: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.m-line:first-of-type { border-top: 0; }
.m-line-main { min-width: 0; }
.m-card-intro { margin: 0; padding: 12px 16px 4px; font-size: 14px; }
.m-line-main a { display: inline-flex; align-items: center; min-height: 44px; }
.m-change { flex-direction: column; align-items: flex-start; }

/* Forms */
.m-form { display: flex; flex-direction: column; gap: 16px; max-width: 680px; padding: 16px; }
.m-form-title { margin: 0; font-size: 18px; font-weight: 700; }
.m-field { display: flex; flex-direction: column; gap: 6px; }
.m-field > label:not(.check), .m-label { font-weight: 600; }
.m-hint { margin: 0; color: var(--muted); font-size: 14px; }
.m-error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 600; }
/* A heads-up beside a choice (a group that opens boards): quiet text on a band, edged with the accent. */
.m-warning { margin: 0; padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: var(--radius-small); background: var(--surface-alt); color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.manage .forum-field[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.manage select.forum-field { appearance: auto; }
.m-number-field { max-width: 160px; }
.manage .forum-button:disabled { color: var(--muted); background: var(--ground); cursor: default; }
.m-danger, .m-danger:hover { border-color: var(--danger); background: var(--danger); color: var(--on-danger); }
.m-danger-quiet { color: var(--danger); }
/* A delete that cannot be done yet (a board with boards inside, a category with boards):
   quiet instead of red, and its tip says what to do first. It still leads to the page that
   explains, for a finger that has no tip to hover. */
.m-icon-button.is-blocked { color: var(--muted); }

/* The board's icon picker (Manage/_BoardFields, js/icon-picker.js): what is chosen now,
   a search box and two "jump to" buttons (shown by the script), then every line icon and
   emoji as a real radio button drawn as a tile ("Your emoji" for one typed in the search).
   About 690 choices are too long for the form, so the grid scrolls inside its own box,
   with the "Icons" and "Emoji" headings staying at its top. The one picked is filled
   with the accent and ringed, so it is told apart by more than color. Every tile is at
   least 44 by 44 px, for a thumb, and the columns fill whatever width there is: five
   across on a 360 px phone, never a sideways scroll.
   [hidden] is spelled out for each part because the rules here set "display". */
.m-icons { min-width: 0; max-width: 560px; margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; }
.m-icons legend { padding: 0 0 6px; font-family: var(--font); font-weight: 600; letter-spacing: 0; }
.m-icon-now { display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.m-icon-now .board-tile { overflow: hidden; }
.m-icon-find { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.m-icon-search { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.m-icon-search label { font-weight: 600; }
.m-icon-jumps { display: flex; gap: 8px; }
.m-icon-box {
  position: relative; max-height: 320px; padding: 0 12px 12px; overflow-y: auto; overscroll-behavior: contain; scroll-padding-top: 52px;
  border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface);
}
.m-icon-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: 8px; margin: 0 -12px; padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line-soft); background: var(--surface); font-size: 15px; font-weight: 700;
}
.m-icon-part + .m-icon-part .m-icon-head { margin-top: 14px; border-top: 1px solid var(--line-soft); }
.m-icon-head-count { color: var(--muted); font-family: var(--font); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.m-icon-sub { margin: 14px 0 0; color: var(--label); font-family: var(--font); font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.m-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; padding-top: 10px; }
.m-icon-none { margin: 0; padding: 18px 2px 6px; color: var(--muted); }
.m-icon-find[hidden], .m-icon-part[hidden], .m-icon-group[hidden], .m-icon[hidden], .m-icon-none[hidden] { display: none; }
.m-icon { position: relative; display: block; cursor: pointer; }
.m-icon input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.m-icon-tile {
  display: flex; align-items: center; justify-content: center; height: 44px;
  border: 1px solid var(--button-line); border-radius: var(--radius-mark);
  background: var(--surface); color: var(--muted); transition: border-color var(--ease), background-color var(--ease), color var(--ease);
}
.m-icon:hover .m-icon-tile { border-color: var(--control-line); color: var(--ink); }
.m-icon input:checked + .m-icon-tile { border-color: var(--accent); background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.m-icon input:focus-visible + .m-icon-tile { outline: 2px solid var(--accent); outline-offset: 5px; }

/* The cover banner and the logo on /manage/settings: what members see now, then the
   form that replaces it. The logo is shown on the header's own dark slate. */
.m-upload { display: flex; flex-direction: column; gap: 14px; }
.m-form .banner { min-height: 96px; }
.m-form .banner-name { font-size: 22px; }
.m-form .banner-words { padding: 28px 16px 12px; }
.m-logo-now {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; overflow: hidden;
  border-radius: var(--radius-small); background: var(--header-fill); color: var(--header-ink); box-shadow: var(--elev-1);
}
.m-logo-now .brand-name { min-width: 0; overflow-wrap: anywhere; }
.manage .forum-field[type="file"] { padding: 8px; }
.m-form .check { align-items: flex-start; }
.m-form .check input { margin-top: 2px; }

/* The accent color: a hex field, a picker beside it, and a preview of what uses it */
.m-color { display: flex; align-items: center; gap: 10px; }
.m-color-hex { max-width: 180px; font-family: var(--font-mono); }
.m-color-pick { flex: none; width: 48px; height: 44px; padding: 2px; border: 1px solid var(--control-line); border-radius: var(--radius-small); background: var(--surface); cursor: pointer; }
/* The preview is always drawn on the light theme (color-scheme), where the color is used
   as picked with white text on it. The dark theme lightens it (Theme/AccentShades.cs). */
.m-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px; border: 1px dashed var(--control-line); border-radius: var(--radius-small); color-scheme: light; background: var(--surface); }
.m-preview-mark { width: 36px; height: 36px; border-radius: var(--radius-small); background: var(--preview, var(--accent)); }
.m-preview-button { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--radius-small); background: var(--preview, var(--accent)); color: var(--on-accent); font-weight: 600; }
.m-preview-link { color: var(--preview, var(--accent)); font-weight: 600; text-decoration: underline; }

/* Categories and boards. On a phone a board is its name and description, then its row
   of buttons underneath. */
.m-category { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--head-fill); scroll-margin-top: 12px; }
.m-category-name { flex: 1 1 200px; min-width: 0; margin: 0; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.m-board { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; border-top: 1px solid var(--line-soft); scroll-margin-top: 12px; }
.m-category + .m-board { border-top: 0; }
.m-node:target > .m-board, section:target > .m-category { box-shadow: inset 4px 0 0 var(--accent); }
.m-node { scroll-margin-top: 12px; }

/* The tree (_BoardNode): a board's own boards sit in a list under it, indented, with a
   line down the left that shows what holds them. An empty list takes no room; the drag
   script puts a board straight into one. */
/* The categories' cards keep the page's spacing between them inside the wrapper the drag needs. */
.m-arrange { display: flex; flex-direction: column; gap: inherit; }
.m-tree { margin: 0; padding: 0; list-style: none; }
.m-tree:empty { display: none; }
.m-tree .m-tree { margin-left: 18px; border-left: 2px solid var(--line); }
.m-cat > .m-tree > .m-node:first-child > .m-board { border-top: 0; }
.m-tree:not(:empty) ~ .m-tree-empty { display: none; }

/* The handle a board or a category is dragged by (js/arrange.js). Only with JavaScript: a
   page without it moves boards on their Move page, and categories with the arrows, which
   are hidden once the script runs. touch-action keeps a finger on the handle from
   scrolling the page instead. */
.m-handle { display: none; }
html.js .m-handle {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -6px 0 -6px -10px;
  padding: 0; border: 0; border-radius: var(--radius-small); background: none; color: var(--muted); cursor: grab; touch-action: none;
  transition: background-color var(--ease), color var(--ease);
}
html.js .m-handle:hover { background: var(--surface-alt); color: var(--ink); }
.m-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.js .m-arrows { display: none; }
.m-arrange-keys { display: none; }
html.js .m-arrange-keys { display: block; margin-top: 6px; }

/* While a board or a category is being moved: its own place in the page is a dashed
   outline, and a copy of its row follows the pointer. Picked up from the keyboard, it is
   marked with the accent instead. Dragging a category folds every category to its heading. */
.m-node.is-dragging > .m-board, .m-cat.is-dragging > .m-category {
  outline: 2px dashed var(--accent-line); outline-offset: -4px; background: var(--accent-soft);
}
.m-node.is-dragging > .m-board > *, .m-cat.is-dragging > .m-category > * { opacity: 0.45; }
.m-node.is-lifted > .m-board, .m-cat.is-lifted > .m-category { box-shadow: inset 4px 0 0 var(--accent); background: var(--accent-soft); }
.m-ghost {
  position: fixed; left: 0; top: 0; z-index: 60; margin: 0; pointer-events: none;
  border: 1px solid var(--card-line); border-radius: var(--radius); background: var(--surface-raised); box-shadow: var(--elev-3);
}
/* The copy under the pointer is the board's name and what it holds, not its buttons: on a phone those would make it a screen tall. */
.m-ghost .m-actions, .m-ghost .m-board-access { display: none; }
html.m-grabbing, html.m-grabbing * { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.is-sorting-categories .m-tree, .is-sorting-categories .m-tree-empty, .is-sorting-categories .m-card-foot { display: none; }
.m-arrange[aria-busy="true"] { opacity: 0.7; }
.m-board-main { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.m-board-counts { font-size: 13px; }
.m-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* A board's row on /manage/boards (_BoardNode) is one grid at every depth: the handle,
   the icon, the words, the buttons. So a board deep in the tree, with less room, keeps
   the same shape instead of its icon dropping onto a line of its own. */
.m-node > .m-board { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 2px 12px; }
.m-node > .m-board > .m-board-main { grid-column: 3; grid-row: 1; align-self: end; }
.m-node > .m-board > .m-board-details { grid-column: 3; grid-row: 2; min-width: 0; overflow-wrap: anywhere; }
.m-node > .m-board > .m-handle, .m-node > .m-board > .board-tile, .m-node > .m-board > .m-actions { grid-row: 1 / span 2; align-self: center; }
.m-node > .m-board > .m-handle { grid-column: 1; }
.m-node > .m-board > .board-tile { grid-column: 2; }
.m-node > .m-board > .m-actions { grid-column: 4; }
.m-node > .m-board .board-tile { width: 40px; height: 40px; }

/* The buttons of a board or a category: a row on a desktop and with JavaScript off; on a
   phone one "⋯" button whose panel lists them (js/menu.js), like the thread page's
   Moderate menu. */
.m-row-menu { position: relative; display: flex; }
.m-row-menu-button { display: none; width: 44px; padding: 0; }
.m-row-menu-button[aria-expanded="true"] { border-color: var(--ink); }
.m-row-menu-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 767.98px) {
  /* With JavaScript off the row of buttons takes the whole width under the words. */
  .m-node > .m-board > .m-actions { grid-column: 1 / -1; grid-row: 3; }
  .m-tree .m-tree { margin-left: 12px; }

  html.js .m-node > .m-board > .m-actions { grid-column: 4; }

  /* The first line is the handle, the icon, the name and the menu; the description, the
     counts and the access go under it as wide as the row, from the icon's edge, so the
     words have room however deep the board sits. */
  .m-node > .m-board { gap: 6px 10px; }
  .m-node > .m-board .board-tile { width: 36px; height: 36px; }
  html.js .m-node > .m-board > .m-handle, .m-node > .m-board > .board-tile, html.js .m-node > .m-board > .m-actions { grid-row: 1; }
  .m-node > .m-board > .m-board-main { align-self: center; }
  .m-node > .m-board > .m-board-details { grid-column: 2 / -1; }
  html.js .m-category-name { flex-basis: 0; }
  html.js .m-row-menu-button { display: inline-flex; }
  html.js .m-row-menu-panel:not(.is-open) { display: none; }
  html.js .m-row-menu-panel {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; min-width: 200px; max-width: calc(100vw - 32px);
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding: 6px;
    border: 1px solid var(--card-line); border-radius: var(--radius-small);
    background: var(--surface-raised); box-shadow: var(--elev-3);
  }
  html.js .m-row-menu-panel .forum-button {
    justify-content: flex-start; width: 100%; min-height: 44px; padding: 0 12px;
    border-color: transparent; border-radius: var(--radius-chip); background: none; box-shadow: none;
    font-size: 15px; font-weight: 500; text-align: left;
  }
  html.js .m-row-menu-panel .forum-button:focus-visible { outline-offset: -2px; }
}
@media (max-width: 767.98px) and (hover: hover) {
  html.js .m-row-menu-panel .forum-button:hover { border-color: transparent; background: var(--band); box-shadow: none; transform: none; }
}

/* Each of those buttons is an icon (_ManageIcon) and a word. On a phone, in the menu and
   with JavaScript off, both show. On a desktop the row is icons only, and the word shows
   under the button as a tip when it is pointed at or reached with the keyboard. Under,
   not above: a card clips what rises past its top edge, and a category's heading sits
   there. The button's aria-label says the whole thing ("Edit the board FT8 & FT4"). */
.m-icon-button { gap: 10px; }
.m-action-icon { flex: none; }
@media (min-width: 768px) {
  .m-icon-button { position: relative; width: 44px; padding: 0; }
  .m-action-word { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .m-icon-button::after {
    content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; z-index: 30;
    padding: 4px 8px; border-radius: var(--radius-small); background: var(--ink); color: var(--on-ink); box-shadow: var(--elev-2);
    font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none;
    opacity: 0; transform: translate(-50%, -4px); transition: opacity var(--ease), transform var(--ease);
  }
  .m-icon-button:hover::after, .m-icon-button:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
  /* A blocked delete's tip is a sentence, and its button is the last in the row: it hangs
     from the button's right edge so it never runs off the screen. */
  .m-icon-button.is-blocked::after { left: auto; right: 0; transform: translate(0, -4px); }
  .m-icon-button.is-blocked:hover::after, .m-icon-button.is-blocked:focus-visible::after { transform: translate(0, 0); }
  .m-row-menu-panel { gap: 6px; }
}
.m-arrows { margin: 0; display: flex; gap: 8px; }
.m-arrow { width: 44px; padding: 0; }
.manage .forum-button.small { min-height: 44px; }

/* Members: on a phone and a tablet each member is a block of lines; from 1024 px, a table. */
.m-search { display: flex; flex-wrap: wrap; gap: 8px; }
.m-search .forum-field { flex: 1 1 200px; width: auto; }
.m-table { width: 100%; border-collapse: collapse; }
.m-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.m-table tr { display: block; padding: 6px 16px 12px; border-top: 1px solid var(--line-soft); }
.m-table tbody tr:first-child { border-top: 0; }
.m-table th, .m-table td { display: block; padding: 0; text-align: left; font-weight: 400; overflow-wrap: anywhere; }
.m-table td { color: var(--muted); font-size: 14px; }
.m-table td[data-label] { display: inline; }
.m-table td[data-label]::before { content: attr(data-label) " "; }
.m-table td[data-label] + td[data-label]::before { content: " · " attr(data-label) " "; }
.m-member-name a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-size: 16px; font-weight: 600; text-decoration: none; }
.m-member-name a:hover span { text-decoration: underline; }
.m-member-avatar { flex: none; }
.m-table .tag { margin: 4px 6px 4px 0; }
.m-member-roles .role-chip { margin: 4px 6px 4px 0; }

/* One member */
.m-member { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.m-member .m-card-foot { padding: 0; }
.m-fact-text { overflow-wrap: anywhere; }
/* The member page: what an owner came to do (roles, the built-in role, "Use their
   permissions", ownership) comes first, and the activity after it. On a phone that is the
   order down the page. From 960 px they sit side by side: the activity on the left, the
   actions in a column on the right, so both are on the first screen. */
.m-member-cols { display: flex; flex-direction: column; gap: 14px; }
.m-member-actions { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.m-member-actions .m-form { max-width: none; gap: 12px; }
.m-member-actions .m-choice { padding: 8px 10px; }
.m-member-activity { min-width: 0; }
/* A box to choose in with its button beside it. */
.m-pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.m-pick-row .forum-field { flex: 1 1 180px; width: auto; min-width: 0; }
/* "Show 15 more": the rest of a list, folded, with no script. */
.m-more { border-top: 1px solid var(--line-soft); }
.m-more > summary { display: flex; align-items: center; min-height: 44px; padding: 0 16px; color: var(--accent); font-weight: 600; cursor: pointer; list-style: none; }
.m-more > summary::-webkit-details-marker { display: none; }
.m-more > summary::before { content: "+"; display: inline-block; width: 18px; font-weight: 700; }
.m-more[open] > summary::before { content: "\2212"; }
.m-more > summary:hover { text-decoration: underline; }
.m-more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-chip); }
.m-more[open] > summary { border-bottom: 1px solid var(--line-soft); }
.m-choices { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 4px; }
.m-choices legend { padding: 0 0 8px; font-weight: 600; }
.m-choice { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-small); cursor: pointer; transition: border-color var(--ease), background-color var(--ease); }
.m-choice:hover { border-color: var(--control-line); background: var(--surface-alt); }
.m-choice:has(input:checked) { border-color: var(--accent); background: var(--surface-alt); }
.m-choice input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.m-choice > span { display: flex; flex-direction: column; gap: 2px; }

/* A confirmation: one question, what it means, the button and the way out */
.m-confirm { max-width: 680px; padding: 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.m-confirm-title { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: var(--tight); overflow-wrap: anywhere; }
.m-confirm-text { margin: 0; }
.m-confirm-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.m-confirm-form { display: flex; flex-direction: column; gap: 12px; }
.m-change-facts { margin: 0; display: flex; flex-wrap: wrap; gap: 10px 32px; padding: 12px 14px; border-radius: var(--radius-small); background: var(--ground); }
.m-change-facts dt { color: var(--muted); font-size: 13px; }
.m-change-facts dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; }

/* One member: what they have been doing lately. A line is what it was, what it was
   about, the first words, then who and when. */
.m-activity .m-line-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.m-activity .m-line-main a { min-height: 32px; }
.m-activity .tag { margin-right: 0; }
.m-activity-detail { overflow-wrap: anywhere; }
.m-choice.is-locked { cursor: default; }
.m-choice.is-locked:hover { border-color: var(--line); background: none; }
.m-choice strong { display: inline-flex; align-items: center; }

/* Roles: the list, a role's badge colors, and what a role opens in a board */
.m-role { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; border-top: 1px solid var(--line-soft); scroll-margin-top: 12px; }
.m-card-title + .m-role { border-top: 0; }
.m-role:target { box-shadow: inset 4px 0 0 var(--accent); }
.m-role-main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.m-role-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 28px; }
.page-title .role-chip { padding: 2px 14px; font-size: 20px; }
.m-role-badge { gap: 10px; }
.m-role-colors { display: flex; flex-wrap: wrap; gap: 8px; }
/* Each color is a real radio button drawn as the badge it gives. The one picked has a
   heavier frame as well as its own color. */
.m-role-color { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius-small); cursor: pointer; }
.m-role-color input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.m-role-color:has(input:checked) { border-color: var(--ink); background: var(--surface-alt); box-shadow: inset 0 0 0 1px var(--ink); }
.m-role-color:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.m-grant { min-width: 0; margin: 0; padding: 2px 12px; border: 1px solid var(--line); border-radius: var(--radius-small); display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; }
.m-form .m-grant .check { align-items: center; }
.m-form .m-grant .check input { margin-top: 0; }
.m-grant legend { padding: 0 6px; font-family: var(--font); letter-spacing: 0; }

/* Add-ons */
.m-addon-switch { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.m-addon-switch .tag { margin-right: 0; }
.m-addon-off { padding: 0 16px 14px; }
.m-addon { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; padding: 14px 16px; }
.m-addon-main { flex: 1 1 260px; min-width: 0; }
.m-addon-main p { margin: 4px 0 0; }
.m-addon-name { margin: 0; font-size: 17px; font-weight: 700; }
.m-addon-name .tag { margin-left: 6px; }
.m-addon-settings { border-top: 1px solid var(--line-soft); }

/* Tablet and up: more air, numbers in one row, lists side by side. */
@media (min-width: 768px) {
  .manage { gap: 16px; margin-top: -8px; }

  .m-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .m-stat { padding: 16px 18px; }
  .m-stat dd { font-size: 26px; }
  .m-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .m-section { padding: 16px 20px; }
  .m-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .m-card-title, .m-line { padding-left: 20px; padding-right: 20px; }
  .m-card-foot { padding: 0 20px; }

  .m-form { padding: 20px; }
  .m-category, .m-board { padding-left: 20px; padding-right: 20px; }
  .m-tree .m-tree { margin-left: 32px; }
  .m-member { padding: 24px; }
  .m-more > summary { padding: 0 20px; }
  .m-confirm { padding: 28px; }
  .m-addon { padding: 16px 20px; }
  .m-addon-off { padding: 0 20px 16px; }
  .m-role { padding-left: 20px; padding-right: 20px; }
}

/* The member list has seven columns, so it stays in its stacked phone layout on a tablet
   and becomes a table only from 1024 px. Names, dates and addresses stay on one line
   there, so the roles column is the one that wraps; "Joined" waits for a wider screen
   (the member's own page has it); and if a table is ever still too wide it scrolls
   inside its card, never the page. */
@media (min-width: 1024px) {
  .m-table thead { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; display: table-header-group; }
  .m-table tr { display: table-row; padding: 0; border: 0; }
  .m-table th, .m-table td, .m-table td[data-label] { display: table-cell; padding: 10px 20px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
  .m-table thead th { border-top: 0; border-bottom: 1px solid var(--line); background: var(--head-fill); color: var(--label); font-size: 13px; font-weight: 700; }
  .m-table tbody tr:first-child td, .m-table tbody tr:first-child th { border-top: 0; }
  .m-table td { color: var(--ink); font-size: 15px; }
  .m-table td[data-label]::before, .m-table td[data-label] + td[data-label]::before { content: none; }
  .m-table .m-number { text-align: right; }
  .m-table .tag { margin: 0; }
  .m-member-roles .role-chip { margin: 2px 4px 2px 0; }
  .m-member-roles .tag { margin-right: 4px; }
  .m-table-scroll { overflow-x: auto; }
  .m-members th, .m-members td, .m-members td[data-label] { padding-left: 12px; padding-right: 12px; }
  .m-members tr > :first-child { padding-left: 20px; }
  .m-members tr > :last-child { padding-right: 20px; }
  .m-members .m-member-name, .m-members td[data-label] { white-space: nowrap; }
  .m-members .m-member-email { overflow-wrap: normal; }
  .m-member-email .tag { margin-left: 8px; }
  .m-members .m-member-roles { min-width: 150px; overflow-wrap: normal; }
  .m-members .role-chip, .m-members .tag { white-space: nowrap; }
}
@media (min-width: 1024px) and (max-width: 1199.98px) {
  .m-members th.m-col-wide, .m-members td.m-col-wide { display: none; }
}

/* Three section cards in a row when there is room for them: a group holds three or five. */
@media (min-width: 1100px) {
  .m-sections { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* /manage/files: the kinds of file, a group per category, a wrapping grid of tick boxes. */
.m-type-group { margin-top: 12px; }
/* The group's name with "All" and "None" beside it (shown by js/manage-forms.js). */
.m-type-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 44px; }
.m-type-heading { margin: 0; font-size: 15px; font-weight: 700; }
.m-type-all { display: inline-flex; gap: 6px; }
.m-type-all[hidden] { display: none; }
.manage .m-type-all .forum-button { min-height: 36px; padding: 0 12px; font-size: 13px; }
.m-type-grid { display: grid; grid-template-columns: 1fr; gap: 2px 16px; }
.m-form .m-type { min-height: 44px; align-items: center; }
.m-form .m-type input { margin-top: 0; }
.m-type.is-off { color: var(--muted); }
@media (min-width: 600px) { .m-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* As many to a row as fit once the form has the card's whole width. */
@media (min-width: 1024px) { .m-type-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }

/* Anti-spam (/manage/spam): a number box a few digits wide with its unit beside it */
.spam-form { display: flex; flex-direction: column; gap: 16px; }
.spam-form .m-hint { margin: 0; }
.spam-number { display: flex; align-items: center; gap: 10px; }
.spam-number .forum-field { width: 8rem; max-width: 100%; }
.spam-field select.forum-field { max-width: 22rem; }

/* The member page, side by side: see "The member page" above. */
@media (min-width: 960px) {
  .m-member-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); align-items: start; gap: 16px; }
  .m-member-activity { grid-column: 1; grid-row: 1; }
  .m-member-actions { grid-column: 2; grid-row: 1; }
}

/* ---- The Manage menu (Manage/_ManageNav) ----
   The sections in three groups (ManageSections.cs). It is built on the section tabs of
   site.css (.tabs, .tabs-menu, .tabs-button) and adds the groups:
   - Without JavaScript, at every width: each group's name and its links, a line each.
   - A phone, with JavaScript: the one button opens the whole list, as for any section
     tabs; each group's name is a small heading in it. The group buttons are hidden.
   - From 768 px, with JavaScript: a row of three buttons in the tabs' track. Each opens
     its links as a small menu under it (js/menu.js). The group of the page shown is
     drawn as the current tab. */
.manage-nav { flex-direction: column; flex-wrap: nowrap; gap: 4px; }
.manage-group { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.manage-group-label { padding: 0 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.manage-group-panel { display: flex; flex-wrap: wrap; gap: 2px; }
.manage-group-button { display: none; }

@media (max-width: 767.98px) {
  html.js .manage-group { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  html.js .manage-group + .manage-group { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
  html.js .manage-group-label { padding: 6px 14px 2px; }
  html.js .manage-group-panel { flex-direction: column; flex-wrap: nowrap; }
}

@media (min-width: 768px) {
  html.js .manage-nav { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px; }
  html.js .manage-group { position: relative; display: block; }
  html.js .manage-group-label { display: none; }
  html.js .manage-group-button {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 14px;
    border: 0; border-radius: var(--radius-chip); background: transparent; color: var(--muted);
    font: inherit; font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer;
    transition: background-color var(--ease), color var(--ease);
  }
  html.js .manage-group-button:hover, html.js .manage-group-button[aria-expanded="true"] { background: var(--surface); color: var(--ink); }
  html.js .manage-group-button.is-current { background: var(--ink); color: var(--on-ink); font-weight: 700; box-shadow: var(--elev-1); }
  html.js .manage-group-button svg { flex: none; transition: transform var(--ease); }
  html.js .manage-group-button[aria-expanded="true"] svg { transform: rotate(180deg); }
  /* The links hang over the page under their button and move nothing. */
  html.js .manage-group-panel:not(.is-open) { display: none; }
  html.js .manage-group-panel {
    position: absolute; top: calc(100% + 8px); left: -4px; z-index: 20; min-width: 220px; max-width: calc(100vw - 32px);
    flex-direction: column; flex-wrap: nowrap; padding: 6px;
    border: 1px solid var(--card-line); border-radius: var(--radius-small);
    background: var(--surface-raised); box-shadow: var(--elev-3);
  }
  html.js .manage-group-panel a { justify-content: flex-start; padding: 0 12px; color: var(--ink); font-weight: 500; }
  html.js .manage-group-panel a:hover { background: var(--band); }
  html.js .manage-group-panel a[aria-current] { background: var(--ink); color: var(--on-ink); font-weight: 700; }
}

/* The overview's cards, under a heading per group. */
.m-group { display: flex; flex-direction: column; gap: 10px; }
.m-group-title { margin: 6px 0 0; font-size: 18px; font-weight: 700; }

/* ---- Forms that use the width of a desktop ----
   A phone and a tablet keep every form in one column, as written above. From 1024 px a
   form may spread out, in three ways, so a page is not a narrow column beside an empty
   half (Alex, 2026-11-14):

   .m-cols   two columns INSIDE one form: fields on the left, what explains or previews
             them on the right (.m-col is a column that stacks several things).
   .m-side   two CARDS side by side, for forms that have nothing to do with each other.
   .m-rows   a list of settings, one to a row: its name, its box, and (from 1200 px)
             what it means beside the box instead of under it.

   A form that holds any of them takes the card's whole width. */
.m-cols, .m-side { display: grid; grid-template-columns: minmax(0, 1fr); }
.m-cols { gap: 16px; }
.m-side { gap: 14px; }
.m-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.m-form.m-wide, .m-form:has(> .m-cols), .m-form:has(> .m-rows), .m-form:has(> .m-grants) { max-width: none; }
.m-rows { display: flex; flex-direction: column; gap: 16px; }
.m-grants { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 16px; }

@media (min-width: 768px) {
  .m-side { gap: 16px; }
}

@media (min-width: 1024px) {
  .m-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; align-items: start; }
  .m-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* One setting to a row: its name on the left, lined up with the words inside its box,
     and the box with what it means under it on the right. */
  .m-rows { gap: 0; }
  .m-rows > .m-field {
    display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 6px 24px; align-items: start;
    padding: 12px 0; border-top: 1px solid var(--line-soft);
  }
  .m-rows > .m-field:first-child { padding-top: 0; border-top: 0; }
  .m-rows > .m-field:last-child { padding-bottom: 0; }
  .m-rows > .m-field > label { grid-column: 1; padding-top: 11px; }
  .m-rows > .m-field > :not(label) { grid-column: 2; }
  .m-rows > .m-field > .forum-field { max-width: 27rem; }

  /* What each custom role may do in a board (a board's Access page): two roles to a row. */
  .m-grants { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
}

/* With more room still, what a setting means moves beside its box: three columns. An
   error stays under the box, across to the right edge. */
@media (min-width: 1200px) {
  .m-rows > .m-field { grid-template-columns: minmax(0, 14rem) minmax(0, 27rem) minmax(0, 1fr); gap: 4px 24px; }
  .m-rows > .m-field > .m-hint { grid-column: 3; grid-row: 1; align-self: center; }
  .m-rows > .m-field > .m-error { grid-column: 2 / -1; }
}

/* A few choices with their explanations, side by side on a desktop instead of stacked
   (who can download files). The legend stays on a line of its own above them. */
@media (min-width: 1024px) {
  .m-choices-across { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
  .m-choices-across > legend, .m-choices-across > .m-hint { grid-column: 1 / -1; }
}

/* A part of a form that starts folded to one line (Add a board's access; the script is
   js/manage-forms.js). The body is in full view unless scripts are running AND the page
   said it starts folded, so a browser without scripts sees every field. The sentence and
   the button mean nothing without the script, so they wait for it too. */
.m-fold { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.m-fold-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.m-fold-now { flex: 1 1 220px; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.m-fold-now, .m-fold-line .forum-button { display: none; }
html.js .m-fold-now { display: block; }
html.js .m-fold-line .forum-button { display: inline-flex; }
html.js .m-fold.is-folded .m-fold-body { display: none; }

/* ---- Ranks (/manage/ranks; Core/Ranks) ---- */
.m-rank-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 28px; color: var(--muted); }
.m-rank-name strong { color: var(--ink); }
.m-rank-order { margin: 0; padding: 12px 16px 14px 38px; display: flex; flex-direction: column; gap: 6px; }
.m-rank-now { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
/* An uploaded picture as a choice in the icon picker (Shared/_SymbolPicker). */
.m-icon-picture { display: block; max-width: 36px; max-height: 32px; width: auto; height: auto; object-fit: contain; }
.m-rank-posts.forum-field { width: 9rem; max-width: 100%; }
/* A rank's own page: its picture at the size of the heading beside it. */
.page-title.m-rank-now { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-title.m-rank-now .rank-icon { width: 28px; height: 28px; }
.page-title.m-rank-now .rank-emoji { font-size: 26px; }
.page-title.m-rank-now .rank-picture { max-height: 32px; }
