/* EllGab Modern v1.0.7: isolated mobile-only refinements.
   Built on the approved v1.0.5 desktop baseline.
   No rules outside mobile media queries. */
@media screen and (max-width: 860px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  html, body { width: 100%; max-width: 100%; }
  body { margin: 0; padding: 0; }
  body, #wrapper, #header, #content_section, #main_content_section, #footer_section { box-sizing: border-box; min-width: 0 !important; max-width: 100%; }
  body div#wrapper { width: 100% !important; max-width: 100% !important; margin: 0 auto; }
  #header .frame, #top_section, #upper_section, #main_menu, #content_section, #main_content_section { min-width: 0; }
  #top_section .ellgab-brand-group, #top_section .ellgab-header-center, #top_section .ellgab-header-actions { min-width: 0; }
  #top_section h1.forumtitle, #top_section h1.forumtitle a { max-width: 100%; overflow-wrap: anywhere; }
  #top_section .ellgab-header-actions { flex-wrap: wrap; }
  #upper_section { min-width: 0; }
  #upper_section .user, #upper_section .ellgab-news-center, #upper_section .ellgab-search-side { min-width: 0; max-width: 100%; }
  #upper_section .user ul.reset, #upper_section .user li { min-width: 0; overflow-wrap: anywhere; }
  #upper_section .ellgab-news-center { overflow-wrap: anywhere; }
  #upper_section .ellgab-search-side form { display: flex; flex-wrap: wrap; width: 100%; max-width: 100%; align-items: center; gap: 8px; }
  #upper_section .ellgab-search-side input[name="search"] { box-sizing: border-box; flex: 1 1 170px; min-width: 0; max-width: 100%; }
  #main_menu #menu_nav, #main_menu #menu_nav > li, #main_menu #menu_nav ul { box-sizing: border-box; max-width: 100%; }
  #main_menu #menu_nav a, #main_menu #menu_nav a span { overflow-wrap: anywhere; }
  #ellgab_mobile_menu_toggle { min-height: 44px; touch-action: manipulation; }
  #main_menu #menu_nav > li > a.firstlevel, #main_menu #menu_nav li li > a { min-height: 42px; box-sizing: border-box; }
  #content_section img, #main_content_section img, .postarea img, .inner img { max-width: 100%; height: auto; }
  #content_section iframe, #content_section video, .postarea iframe, .postarea video, .inner iframe, .inner video, #content_section embed, #content_section object { max-width: 100%; }
  .postarea, .postarea .inner, .post_wrapper, .poster, .keyinfo, #forumposts, #messageindex, #boardindex_table { min-width: 0; max-width: 100%; box-sizing: border-box; }
  .postarea .inner, .postarea .inner pre, .postarea .inner code, .postarea blockquote { overflow-wrap: anywhere; }
  .postarea .inner pre, .postarea .inner .code { max-width: 100%; overflow-x: auto; }
  .postarea blockquote { max-width: 100%; box-sizing: border-box; }
  .pagesection, .buttonlist, .quickbuttons { max-width: 100%; }
  .buttonlist ul, ul.quickbuttons { display: flex; flex-wrap: wrap; gap: 5px; }
  .buttonlist a, ul.quickbuttons a { touch-action: manipulation; }
  #postmodify, #postmodify textarea, #quickReplyOptions textarea, .editor, .editor textarea { max-width: 100%; box-sizing: border-box; }
  .table_frame, .scrolling_table { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .navigate_section { max-width: 100%; overflow-wrap: anywhere; }
  #content_section .bbc_img, #content_section .bbc_link, #content_section a { overflow-wrap: anywhere; }
}
@media screen and (max-width: 520px) {
  #header div.frame { padding: 12px 12px 0; }
  #top_section { gap: 8px; }
  #top_section .ellgab-brand-group { gap: 3px 8px; }
  #top_section h1.forumtitle { line-height: 1.2; font-size: clamp(1.22rem, 6vw, 1.55rem); }
  #top_section .ellgab-header-center { min-width: 0; }
  #top_section #wormhole_header_link { max-width: 100%; white-space: normal; text-align: center; }
  #top_section .ellgab-header-actions { gap: 8px; }
  #upper_section { gap: 8px; padding: 9px 0; }
  #upper_section div.user { gap: 9px; }
  #upper_section div.user .avatar img { width: 38px; height: 38px; }
  #upper_section .ellgab-search-side form input[name="search"],
  #upper_section .ellgab-search-side form input[type="search"],
  #upper_section #guest_form input[type="text"],
  #upper_section #guest_form input[type="password"],
  #postmodify input[type="text"], #postmodify textarea,
  #quickReplyOptions textarea, #searchform input[type="text"] { font-size: 16px !important; }
  #upper_section .ellgab-search-side input[type="submit"] { min-height: 44px; }
  #upper_section .ellgab-news-center { padding: 0 4px; line-height: 1.35; }
  .postarea, .moderatorbar { min-width: 0; }
  .poster ul, .poster li { min-width: 0; overflow-wrap: anywhere; }
  .postarea .inner iframe { width: 100%; }
  #messageindex tbody tr { grid-template-columns: 35px minmax(0, 1fr) auto; }
  #boardindex_table .table_list tbody.content tr { grid-template-columns: 38px minmax(0, 1fr); }
  #boardindex_table .table_list tbody.content td.info,
  #messageindex tbody tr td.subject { overflow-wrap: anywhere; }
  .pagesection .pagelinks { max-width: 100%; overflow-wrap: anywhere; }
}
@media screen and (max-width: 860px) and (orientation: landscape) {
  #header div.frame { padding-top: 8px; }
  #upper_section { padding: 7px 0; }
}

/* v1.0.8 — mobile-only KONR visibility and board-index action correction.
   The original v1.0.5 desktop CSS is not modified. */
@media screen and (max-width: 1060px) {
  /* v1.0.5 hides the SMF site slogan at this breakpoint; EllGab uses
     that field for the KONR Live link. Restore it instead. */
  #top_section #siteslogan {
    display: block !important;
    order: initial;
    max-width: 100%;
    min-width: 0;
    float: none !important;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: break-word;
  }
  #top_section #siteslogan a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    text-decoration: none;
    white-space: nowrap;
  }
}
@media screen and (max-width: 860px) {
  /* Preserve board-index legend and action without creating a narrow
     float column. Avoid changes to the actual Mark as Read URL/action. */
  #posting_icons {
    float: none !important;
    clear: both;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 10px 0 6px;
    padding: 8px 4px;
  }
  #posting_icons > ul.reset {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 16px;
    row-gap: 8px;
    margin: 0;
    padding: 0;
    line-height: 1.4;
  }
  #posting_icons > ul.reset > li {
    float: none !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    white-space: normal;
  }
  #posting_icons img { margin: 0 3px 0 0; }
  .mark_read {
    float: none !important;
    clear: both;
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 8px 0 12px;
    padding: 0 4px;
  }
  .mark_read .buttonlist,
  .mark_read .buttonlist ul,
  .mark_read .buttonlist li {
    float: none !important;
    width: auto;
    max-width: 100%;
    min-width: 0;
  }
  .mark_read .buttonlist ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    margin: 0;
    padding: 0;
  }
  .mark_read .buttonlist li a {
    display: inline-block;
    width: auto;
    max-width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.3;
  }
  .mark_read .buttonlist li a span {
    display: inline-block;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    letter-spacing: normal;
  }
}
@media screen and (max-width: 700px) {
  #top_section .ellgab-header-actions {
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: flex-end;
  }
  #top_section #siteslogan { font-size: .85rem; }
}


/* EllGab Modern v1.0.9 — Board status layout (all viewport widths).
   The board index legend + Mark Read action share one flex row.
   Other pages and the approved header remain unchanged. */
.ellgab-board-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  clear: both;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 12px 0 14px;
  padding: 8px 12px;
  border: 1px solid #34485b;
  border-radius: 9px;
  background: #1b2632;
}
.ellgab-board-status #posting_icons,
.ellgab-board-status .mark_read {
  float: none !important;
  clear: none !important;
  display: block;
  box-sizing: border-box;
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  line-height: 1.4;
}
.ellgab-board-status #posting_icons ul.reset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ellgab-board-status #posting_icons ul.reset > li {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  float: none !important;
  margin: 0;
  white-space: nowrap;
}
.ellgab-board-status #posting_icons img { margin: 0 3px 0 0; max-width: 24px; vertical-align: middle; }
.ellgab-board-status .mark_read .buttonlist,
.ellgab-board-status .mark_read .buttonlist ul,
.ellgab-board-status .mark_read .buttonlist li {
  float: none !important;
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}
.ellgab-board-status .mark_read .buttonlist ul {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.ellgab-board-status .mark_read .buttonlist a {
  display: inline-flex;
  align-items: center;
  width: auto;
  max-width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}
.ellgab-board-status .mark_read .buttonlist a span {
  display: inline-block;
  height: auto;
  padding: 10px 12px;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}
/* Legacy Curve rounded-frame cap appears as a white bar above Info Center. */
.ellgab-board-status + span.upperframe { display: none !important; }
.ellgab-board-status + span.upperframe + .roundframe { border-top: 1px solid #34485b; }
@media screen and (max-width: 860px) {
  .ellgab-board-status { flex-direction: column; align-items: stretch; margin: 10px 0 12px; padding: 10px; }
  .ellgab-board-status .mark_read { width: 100%; }
  .ellgab-board-status .mark_read .buttonlist a { min-height: 44px; }
}
@media screen and (max-width: 520px) {
  .ellgab-board-status #posting_icons ul.reset { column-gap: 11px; row-gap: 9px; }
  .ellgab-board-status #posting_icons ul.reset > li { white-space: normal; }
}
