/* Exact-stage Forum only: original main metal on header + one content enclosure. */
@media screen {
  body#phpbb.forum-circuit-stage:not(.forum-print-view) {
    --fm-corner-w: 64px;
    --fm-corner-h: 30.58px;
    --fm-side-w: 10px;
  }
  /* Keep the native header's reserved border and padding, replace only its paint. */
  body#phpbb.forum-circuit-stage:not(.forum-print-view) .headerbar {
    border-color: transparent;
    outline: none;
    clip-path: none;
    background-image:
      url('/assets/circuit-forum/metal-frames/header-top-left.8e6cbb517b6d.webp'),url('/assets/circuit-forum/metal-frames/header-top-right.6d8062a57f89.webp'),
      url('/assets/circuit-forum/metal-frames/header-bottom-left.a5e1e6ed444c.webp'),url('/assets/circuit-forum/metal-frames/header-bottom-right.edd167fe1cbc.webp'),
      url('/assets/circuit-forum/metal-frames/header-top.650cecfad2fd.webp'),url('/assets/circuit-forum/metal-frames/header-bottom.92d7e30ae8ee.webp'),
      url('/assets/circuit-forum/metal-frames/straight-rail-left.33e32b350d08.png'),url('/assets/circuit-forum/metal-frames/straight-rail-right.56e356b2a5e7.png');
    background-position: left top,right top,left bottom,right bottom,center top,center bottom,left center,right center;
    background-size:
      var(--fm-corner-w) var(--fm-corner-h),var(--fm-corner-w) var(--fm-corner-h),
      var(--fm-corner-w) var(--fm-corner-h),var(--fm-corner-w) var(--fm-corner-h),
      calc(100% - 2 * var(--fm-corner-w)) var(--fm-corner-h),calc(100% - 2 * var(--fm-corner-w)) var(--fm-corner-h),
      var(--fm-side-w) 2.3px,var(--fm-side-w) 2.3px;
    background-repeat: no-repeat,no-repeat,no-repeat,no-repeat,no-repeat,no-repeat,repeat-y,repeat-y;
    background-origin: border-box;
    background-clip: border-box;
  }
  /* The previous cyan underline belonged to the replaced header bevel. */
  body#phpbb.forum-circuit-stage:not(.forum-print-view) .headerbar::after { content: none; }
  /* One major content frame; no new border/padding on individual posts or cards. */
  body#phpbb.forum-circuit-stage:not(.forum-print-view) #page-body {
    position: relative;
    padding-block: 24px;
  }
  body#phpbb.forum-circuit-stage:not(.forum-print-view) #page-body::before {
    --fm-corner-w: 48px;
    --fm-corner-h: 22.93px;
    content: "";
    position: absolute;
    inset: 0 max(-16px,calc((100% - 100vw) / 2 + 4px));
    pointer-events: none;
    z-index: 0;
    background-image:
      url('/assets/circuit-forum/metal-frames/header-top-left.8e6cbb517b6d.webp'),url('/assets/circuit-forum/metal-frames/header-top-right.6d8062a57f89.webp'),
      url('/assets/circuit-forum/metal-frames/header-bottom-left.a5e1e6ed444c.webp'),url('/assets/circuit-forum/metal-frames/header-bottom-right.edd167fe1cbc.webp'),
      url('/assets/circuit-forum/metal-frames/header-top.650cecfad2fd.webp'),url('/assets/circuit-forum/metal-frames/header-bottom.92d7e30ae8ee.webp'),
      url('/assets/circuit-forum/metal-frames/straight-rail-left.33e32b350d08.png'),url('/assets/circuit-forum/metal-frames/straight-rail-right.56e356b2a5e7.png');
    background-position: left top,right top,left bottom,right bottom,center top,center bottom,left center,right center;
    background-size:
      var(--fm-corner-w) var(--fm-corner-h),var(--fm-corner-w) var(--fm-corner-h),
      var(--fm-corner-w) var(--fm-corner-h),var(--fm-corner-w) var(--fm-corner-h),
      calc(100% - 2 * var(--fm-corner-w)) var(--fm-corner-h),calc(100% - 2 * var(--fm-corner-w)) var(--fm-corner-h),
      var(--fm-side-w) 2.3px,var(--fm-side-w) 2.3px;
    background-repeat: no-repeat,no-repeat,no-repeat,no-repeat,no-repeat,no-repeat,repeat-y,repeat-y;
  }
}
@media screen and (max-width:650px) {
  body#phpbb.forum-circuit-stage:not(.forum-print-view) {
    --fm-corner-w: 48px;
    --fm-corner-h: 22.93px;
    --fm-side-w: 8px;
  }
  body#phpbb.forum-circuit-stage:not(.forum-print-view) #page-body::before {
    --fm-side-w: 4px;
    inset-inline: -4px;
  }
}
@media screen and (forced-colors:active) {
  body#phpbb.forum-circuit-stage:not(.forum-print-view) .headerbar { background-image:none;outline:1px solid CanvasText; }
  body#phpbb.forum-circuit-stage:not(.forum-print-view) #page-body::before { background:none;border:1px solid CanvasText; }
}
/* Reflow the native header/teaser at their text-dependent fit boundary. */
@media screen and (min-width:651px) {
  body#phpbb.forum-circuit-stage:not(.forum-print-view) .headerbar .inner {
    container: forum-header / inline-size;
  }
  body#phpbb.forum-circuit-stage:not(.forum-print-view) .mf-branding {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,18em),1fr));
  }
  body#phpbb.forum-circuit-stage:not(.forum-print-view) .mf-branding>.skiplink {
    display: contents;
  }
  body#phpbb.forum-circuit-stage:not(.forum-print-view) .mf-discussion {
    container: forum-teaser / inline-size;
  }
  @container forum-header (max-width:calc(36em + 24px)) {
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .mf-site-copy {
      text-align: left;
    }
  }
  @container forum-teaser (max-width:40em) {
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .mf-discussion>.mf-topic-preview {
      grid-template-columns: minmax(0,1fr);
      grid-template-areas: "title" "body" "meta" "action";
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .mf-topic-preview .mf-preview-open {
      justify-self: start;
    }
  }
}
/* Native list fields reflow together when their text no longer fits columns. */
@media screen {
  body#phpbb.forum-circuit-stage:not(.forum-print-view) :is(.forabg,.forumbg):has(>.inner>ul.topiclist) {
    container: forum-rows / inline-size;
    --fm-list-gutter: 22px;
  }
  @container forum-rows (max-width:50em) {
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.header dl.row-item {
      display: block;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.header dt {
      float: none;
      width: auto;
      margin: 0;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.header dt .list-inner {
      margin: 0;
      padding: 0;
    }
    /* Native localized dfn labels accompany the retained counts below. */
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.header dd:is(.topics,.posts,.views,.lastpost) {
      display: none;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.row dl.row-item {
      display: grid;
      grid-template-columns: repeat(auto-fit,minmax(min(100%,12em),1fr));
      gap: 10px 20px;
      min-height: 0;
      background-origin: content-box;
      background-position: 0 2px;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.row dl.row-item>dt {
      grid-column: 1 / -1;
      position: relative;
      float: none;
      width: 100%;
      margin: 0;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.row dl.row-item>dt .row-item-link {
      top: 2px;
      left: 0;
      margin: 0;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.row dl.row-item>dt .list-inner {
      margin-right: 0;
      padding-right: 0;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist.forums li.row dl.row-item>dt .list-inner {
      padding-left: 40px;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.row dl.row-item>dd {
      float: none;
      width: auto;
      min-width: 0;
      max-width: 100%;
      margin-left: 44px;
      text-align: left;
      overflow-wrap: anywhere;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.row dl.row-item>dd:is(.topics,.posts,.views) {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: .3em;
      padding-top: 0 !important;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.row dl.row-item>dd dfn {
      display: inline;
      position: static;
      clip: auto;
      clip-path: none;
      overflow: visible;
      width: auto;
      height: auto;
      margin: 0;
      font-style: normal;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.row dl.row-item>dd.lastpost dfn {
      display: block;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.row dl.row-item>dd:is(.lastpost,.redirect) {
      grid-column: 1 / -1;
      display: block !important;
      width: auto;
      margin-left: 44px;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist li.row dl.row-item>dd.lastpost>span {
      padding-left: 0;
    }
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist.forums li.row dl.row-item>dd {
      margin-left: 40px;
    }
    /* Only link-free native duplicate count summaries; canonical fields stay visible. */
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist.forums li.row dt .list-inner>div.responsive-show:not(:has(a)),
    body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist.topics li.row dt .list-inner>span.responsive-show.left-box:not(:has(a)) {
      display: none !important;
    }
  }
  body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist a:is(.forumtitle,.topictitle) {
    color: var(--mf-ink);
  }
  body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist a.lastsubject {
    color: var(--mf-cyan,#11d9ff);
  }
  body#phpbb.forum-circuit-stage:not(.forum-print-view) .topiclist a:is(.forumtitle,.topictitle,.lastsubject):is(:hover,:focus) {
    color: #d3f8ff;
  }
}
@media screen and (max-width:650px) {
  body#phpbb.forum-circuit-stage:not(.forum-print-view) :is(.forabg,.forumbg):has(>.inner>ul.topiclist) {
    --fm-list-gutter: 15px;
  }
}
