/*
 * EllGab Modern 1.0.1 — Midnight Charcoal
 * Progressive responsive layer over the owner's customized SMF 2.0 Curve.
 * Keeps original template/mod hooks, image assets and business logic intact.
 */
:root {
  --eg-bg: #10151d;
  --eg-shell: #171e28;
  --eg-panel: #1c2530;
  --eg-panel-alt: #222d39;
  --eg-panel-hover: #2b3644;
  --eg-border: #344151;
  --eg-ink: #edf0f4;
  --eg-secondary: #bdc7d3;
  --eg-muted: #9ba9ba;
  --eg-gold: #d2ad70;
  --eg-gold-bright: #edd3a1;
  --eg-amber-deep: #6a4e2a;
  --eg-radius: 13px;
  --eg-shadow: 0 12px 30px rgba(0,0,0,.16);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, body#help_popup {
  color: var(--eg-ink);
  background: var(--eg-bg);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 15px 0 28px;
  overflow-wrap: break-word;
}
body, td, th, tr, p, li, dl, dt, dd, label { color: inherit; }
a:link, a:visited, a.new_win:link, a.new_win:visited { color: var(--eg-gold-bright); text-decoration: none; }
a:hover, a.new_win:hover { color: #fff2d4; text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--eg-gold-bright);
  outline-offset: 3px;
}
::selection { background: #6b5435; color: #fff; }
h1, h2, h3, h4, h5, h6 { color: var(--eg-ink); font-family: inherit; }
h1, h2, h3 { letter-spacing: -.012em; }
.smalltext, tr.smalltext th { font-size: .82rem; font-family: inherit; line-height: 1.45; }
.middletext { font-size: .9rem; line-height: 1.5; font-family: inherit; }
.normaltext { font-size: 1rem; line-height: 1.5; }
.largetext { font-size: 1.25rem; }
#header, #content_section, #footer_section, #header div.frame, #content_section div.frame, #footer_section div.frame {
  background-image: none;
}
div#wrapper {
  min-width: 0 !important;
  width: calc(100% - 32px) !important;
  max-width: 1490px;
  margin: 0 auto;
}
#header, #content_section, #footer_section {
  max-width: 1490px;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
}
#header {
  color: var(--eg-ink);
  background: radial-gradient(ellipse at 12% -55%,rgba(166,124,63,.15),transparent 55%), #17202b;
  border: 1px solid var(--eg-border);
  border-bottom: 0;
  border-radius: 17px 17px 0 0;
  box-shadow: var(--eg-shadow);
}
#header div.frame { padding: 14px 24px 0; }
#content_section {
  background: var(--eg-shell);
  padding: 0 22px 20px;
  border-left: 1px solid var(--eg-border);
  border-right: 1px solid var(--eg-border);
}
#content_section div.frame { padding: 0; }
#main_content_section { min-width: 0; min-height: 300px; }
#footer_section {
  background: #151c25;
  border: 1px solid var(--eg-border);
  border-top: 1px solid #2a3543;
  border-radius: 0 0 17px 17px;
  color: var(--eg-muted);
  text-align: center;
  padding: 0;
}
#footer_section div.frame { padding: 19px 18px 22px; }
#footer_section ul li, #footer_section p { font-size: .83rem; line-height: 1.7; }
#footer_section .ellgab-theme-picker { margin: 5px 0 10px; font-weight: 650; }
#footer_section .ellgab-theme-picker a { color: var(--eg-gold-bright); }

/* Brand, useful controls, and the retained Wormhole shortcut. */
#top_section { min-height: 0; overflow: visible; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 17px; margin: 0 0 14px; }
#top_section h1.forumtitle { float: none; margin: 0; padding: 0; font-size: clamp(1.6rem, 3vw, 2.15rem); font-weight: 750; line-height: 1.15; font-family: inherit; letter-spacing: -.055em; }
#top_section h1.forumtitle a { color: #f7f6f2; }
#top_section h1.forumtitle a:hover { color: var(--eg-gold-bright); text-decoration: none; }
#top_section h1.forumtitle img { max-width: min(330px, 100%); max-height: 65px; object-fit: contain; vertical-align: middle; }
.ellgab-brand-kicker { font-size: .67rem; font-weight: 750; color: var(--eg-gold); letter-spacing: .17em; white-space: nowrap; margin-right: auto; }
#top_section #wormhole_header_link {
  order: 2;
  position: static;
  transform: none;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 13px;
  border: 1px solid #705b3c;
  border-radius: 999px;
  background: rgba(198,157,94,.08);
  color: var(--eg-gold-bright);
  font-size: .77rem; font-weight: 700; line-height: 1.3; font-family: inherit;
  letter-spacing: .08em;
  white-space: nowrap;
  text-decoration: none;
}
#top_section #wormhole_header_link:hover { background: rgba(198,157,94,.19); border-color: var(--eg-gold); }
#top_section #siteslogan, #top_section img#smflogo { order: 3; float: none; margin: 0; color: var(--eg-muted); line-height: 1.3; }
#top_section img#smflogo { max-height: 37px; max-width: 125px; width: auto; object-fit: contain; }
#top_section img#upshrink { order: 4; float: none; cursor: pointer; margin: 0 0 0 5px; }
#upper_section { display: flex; flex-wrap: wrap; align-items: start; gap: 18px; padding: 13px 0; margin: 0; border-top: 1px solid #303b48; }
#upper_section div.user, #upper_section div.news { float: none; width: calc(50% - 9px); min-width: 0; overflow: visible; text-align: left; }
#upper_section div.user ul { padding: 0; }
#upper_section div.user ul li { margin: 2px 0; }
#upper_section ul li.greeting { font-size: 1rem; }
#upper_section div.user p.avatar { margin: 0 12px 0 0; }
#upper_section div.user .avatar img { width: 43px; height: 43px; object-fit: cover; border-radius: 10px; }
#upper_section div.news { text-align: right; }
#upper_section div.news form { display: flex; justify-content: flex-end; gap: 8px; padding-bottom: 5px; }
#upper_section div.news h2 { display: inline; color: var(--eg-gold); }
#upper_section div.news p { color: var(--eg-secondary); }
#upper_section #guest_form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#upper_section #guest_form .info { width: 100%; }
#upper_section #guest_form input { min-width: 90px; }
#upper_section #guest_form select { max-width: 125px; }
#header > .frame > br.clear { display: none; }

/* Navigation: desktop dropdowns, keyboard access, and progressive mobile menu. */
#main_menu { float: none; width: 100%; margin: 8px 0 0; padding: 0; clear: both; }
#main_menu #menu_nav { display: flex; flex-wrap: wrap; gap: 5px; padding: 9px 0; border-top: 1px solid #303b48; }
#main_menu #menu_nav > li { float: none; }
#main_menu #menu_nav > li > a.firstlevel, #main_menu #menu_nav > li > a.active {
  background: none;
  color: var(--eg-secondary);
  border: 1px solid transparent;
  border-radius: 9px;
  margin: 0;
  padding: 0;
  font-weight: 600;
}
#main_menu #menu_nav > li > a.firstlevel span.firstlevel {
  background: none;
  color: inherit;
  display: block;
  font-size: .87rem;
  padding: 8px 13px;
  line-height: 1.35;
  height: auto;
  left: auto;
  white-space: normal;
}
#main_menu #menu_nav > li > a.firstlevel:hover, #main_menu #menu_nav > li:hover > a.firstlevel, #main_menu #menu_nav > li > a.firstlevel:focus-visible {
  background: #2b3644;
  border-color: #405063;
  color: #fff;
  text-decoration: none;
}
#main_menu #menu_nav > li > a.active { border-color: #785e3d; background: #4c3b28; color: var(--eg-gold-bright); }
#main_menu #menu_nav > li > a.active span.firstlevel, #main_menu #menu_nav > li > a.firstlevel:hover span.firstlevel { background: none; }
#main_menu #menu_nav > li > ul, #main_menu #menu_nav li li > ul {
  z-index: 120;
  width: 225px;
  padding: 6px;
  background: #252f3a;
  border: 1px solid #4b5765;
  border-radius: 10px;
  box-shadow: 0 14px 26px rgba(0,0,0,.32);
}
#main_menu #menu_nav li li { border: 0; width: auto; min-width: 0; float: none; }
#main_menu #menu_nav li li a { color: var(--eg-ink); border-radius: 6px; }
#main_menu #menu_nav li li a span { padding: 8px 10px; font-size: .85rem; }
#main_menu #menu_nav li li a:hover, #main_menu #menu_nav li li a:focus-visible { color: #fff; background: #394555; }
#main_menu #menu_nav > li:focus-within > ul, #main_menu #menu_nav li li:focus-within > ul { display: block; top: auto; }
#main_menu #menu_nav li li > ul { left: 100%; margin: -32px 0 0 0; }
#ellgab_mobile_menu_toggle { display: none; }

/* Forms and controls. */
input, button, select, textarea, .input_text, .input_password, .input_file {
  max-width: 100%;
  border: 1px solid #506072;
  border-radius: 7px;
  background: #121923;
  color: var(--eg-ink);
  padding: 7px 10px;
  font-size: .92rem; font-weight: 500; line-height: 1.4; font-family: inherit;
}
select { padding: 6px 7px; }
textarea { width: auto; max-width: 100%; line-height: 1.5; }
input[type="checkbox"], input[type="radio"], .input_check, .input_radio { accent-color: var(--eg-gold); min-width: 15px; min-height: 15px; background: transparent; }
input:hover, textarea:hover, button:hover, select:hover, input:focus, select:focus, textarea:focus { border-color: #b7996a; }
.button_submit, .button_reset, input[type="submit"], button[type="submit"] {
  color: #1b1a18;
  background: var(--eg-gold);
  border: 1px solid #dfc08a;
  border-radius: 8px;
  padding: 8px 13px;
  font-size: .87rem; font-weight: 700; line-height: 1.3; font-family: inherit;
  text-shadow: none;
  cursor: pointer;
}
.button_reset { background: #344252; color: var(--eg-ink); border-color: #526174; }
.button_submit:hover, .button_reset:hover, input[type="submit"]:hover, button[type="submit"]:hover { background: var(--eg-gold-bright); border-color: #efd4a3; color: #151719; }
input:disabled, button:disabled, select:disabled { opacity: .65; cursor: not-allowed; }
fieldset, dl.settings, .description { border-color: var(--eg-border); color: var(--eg-secondary); }
fieldset legend { color: var(--eg-gold-bright); }
hr, .hrcolor { background: var(--eg-border); color: var(--eg-border); }

/* Category banners and content surfaces. */
.catbg, .catbg2, .titlebg, .titlebg2,
tr.catbg td, tr.catbg th, tr.catbg2 td, tr.catbg2 th,
tr.titlebg th, tr.titlebg td, tr.titlebg2 td, tr.titlebg2 th,
td.catbg, td.titlebg { background-image: none; }
.catbg, .catbg2, tr.catbg td, tr.catbg th, tr.catbg2 td, tr.catbg2 th {
  color: var(--eg-gold-bright);
  background-color: #293644;
}
.titlebg, .titlebg2, tr.titlebg td, tr.titlebg th, tr.titlebg2 td, tr.titlebg2 th {
  color: #e2e8ef;
  background-color: #293543;
}
tr.titlebg th a:link, tr.titlebg th a:visited, tr.titlebg2 td a:link, tr.titlebg2 td a:visited,
tr.catbg th a:link, tr.catbg th a:visited, tr.catbg2 td a:link, tr.catbg2 td a:visited { color: var(--eg-gold-bright); }
.windowbg, #preview_body, .windowbg2, .windowbg3, .approvebg, .approvebg2,
.stickybg, .stickybg2, .lockedbg, .lockedbg2, .approvetbg, .approvetbg2 {
  color: var(--eg-ink);
  background: var(--eg-panel);
}
.windowbg2, .windowbg3, .stickybg2, .lockedbg2 { background: var(--eg-panel-alt); }
.approvebg, .approvebg2, .approvetbg, .approvetbg2 { background: #3d2b2a; }
div.cat_bar, div.title_bar, div.title_barIC, div.roundframe div.cat_bar {
  background: #293644;
  border: 1px solid var(--eg-border);
  border-radius: 10px;
  padding: 0 14px;
  height: auto;
  min-height: 43px;
  margin: 14px 0 7px;
  overflow: visible;
}
div.title_bar, div.title_barIC { background: #27313e; }
h3.catbg, h3.catbg2, h3.titlebg, h4.titlebg, h4.catbg, h4.catbg2,
div.roundframe div.cat_bar h3.catbg, div.title_barIC h4.titlebg {
  background: none;
  color: var(--eg-ink);
  font-size: .99rem; font-weight: 700; line-height: 1.45; font-family: inherit;
  height: auto;
  min-height: 42px;
  line-height: 1.45;
  padding: 10px 0;
  margin: 0;
  overflow: visible;
}
h3.catbg a, h4.catbg a, h3.catbg2 a, h4.catbg2 a, .table_list tbody.header td a { color: var(--eg-gold-bright); }
h3.catbg a:hover, h4.catbg a:hover { color: #fff; }
h3.titlebg a, h4.titlebg a { color: #e2e8ef; }
.table_grid tr.catbg th, .table_grid tr.titlebg th { height: auto; line-height: 1.5; padding: 10px; }
tr.catbg th.first_th, tr.catbg th.last_th, tr.titlebg th.first_th, tr.titlebg th.last_th { background-image: none; }
.roundframe, .information, .plainbox, .tborder, .table_frame { background: var(--eg-panel); border-color: var(--eg-border); border-radius: var(--eg-radius); }
.windowbg span.topslice, .windowbg span.topslice span, .windowbg span.botslice, .windowbg span.botslice span,
.windowbg2 span.topslice, .windowbg2 span.topslice span, .windowbg2 span.botslice, .windowbg2 span.botslice span { background-image: none; height: 0; }
.table_grid td { background-clip: padding-box; }
table.table_grid { border-collapse: separate; border-spacing: 0 1px; max-width: 100%; }
table.table_grid td { padding: 10px; border: 0; border-bottom: 1px solid var(--eg-border); }

/* Forum index. */
#boardindex_table { margin: 8px 0 16px; }
table.table_list { border-collapse: separate; border-spacing: 0 4px; }
table.table_list tbody.content td { border: none; padding: 12px; }
table.table_list tbody.content tr td:first-child { border-radius: 10px 0 0 10px; }
table.table_list tbody.content tr td:last-child { border-radius: 0 10px 10px 0; }
#boardindex_table .table_list tbody.content tr:hover td { background-color: #263340; }
#boardindex_table table.table_list tbody.content td.info a.subject { font-size: 1rem; font-weight: 760; color: var(--eg-gold-bright); line-height: 1.45; }
#boardindex_table .table_list tbody.content td.info p { color: var(--eg-secondary); margin-top: 3px; line-height: 1.5; }
#boardindex_table .table_list tbody.content td.stats { font-size: .78rem; color: var(--eg-secondary); }
#boardindex_table .table_list tbody.content td.lastpost { font-size: .8rem; color: var(--eg-secondary); line-height: 1.55; }
#boardindex_table .table_list tbody.content td.icon img { max-width: 34px; }
#boardindex_table .table_list tbody.content td.children { color: var(--eg-muted); }
#index_common_stats { position: static; line-height: 1.5; color: var(--eg-muted); }
#upshrinkHeaderIC .windowbg, #upshrinkHeaderIC .windowbg2 { border-radius: var(--eg-radius); }
#upshrinkHeaderIC { margin: 12px 0; }
#upshrinkHeaderIC p, #upshrinkHeaderIC dl { color: var(--eg-secondary); }
#upshrinkHeaderIC p.last { border-color: var(--eg-border); }

/* Topic list: preserve sorting links, unread markers and moderation. */
#messageindex { overflow: hidden; border: 1px solid var(--eg-border); }
#messageindex table.table_grid { width: 100%; }
#messageindex thead tr.catbg th { color: var(--eg-secondary); background: #283441; font-size: .83rem; }
#messageindex thead a { color: #f3dfb8; }
#messageindex tbody tr:not(.titlebg):hover td { background-color: #283543; }
#messageindex td.subject { min-width: 0; width: auto; }
#messageindex td.subject > div > span > a { font-size: .96rem; font-weight: 730; }
#messageindex td.subject p { color: var(--eg-muted); font-size: .8rem; margin: 3px 0 0; }
#messageindex td.stats, #messageindex td.lastpost { color: var(--eg-secondary); font-size: .8rem; }
#messageindex td.icon1, #messageindex td.icon2 { width: 36px; text-align: center; }
#messageindex td.icon1 img, #messageindex td.icon2 img { max-width: 25px; }
#messageindex tr.titlebg td { padding: 7px 12px; color: var(--eg-gold-bright); border: 0; }
#messageindex td.moderation { text-align: center; }
.pagesection { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 0; margin-bottom: 4px; min-height: 42px; overflow: visible; }
.pagesection .pagelinks { float: none; padding: 5px 0; color: var(--eg-secondary); }
.pagelinks a, .pagesection a.navPages { padding: 4px 7px; border-radius: 6px; }
.pagelinks .current_page { color: var(--eg-gold-bright); }
.buttonlist { float: none; }
.buttonlist ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.buttonlist ul li { float: none; }
.buttonlist ul li a, .buttonlist ul li a.active, .buttonlist ul li a:hover {
  margin: 0;
  padding: 0;
  background: #344252;
  color: var(--eg-ink);
  border: 1px solid #4b5c70;
  border-radius: 8px;
  font-size: .78rem;
  line-height: 1.35;
  text-transform: none;
}
.buttonlist ul li a span, .buttonlist ul li a:hover span, .buttonlist ul li a.active span {
  background: none;
  color: inherit;
  height: auto;
  line-height: 1.35;
  padding: 8px 12px;
}
.buttonlist ul li a:hover { background: #46596a; }
.buttonlist ul li a.active { color: #1e1a14; background: var(--eg-gold); border-color: #e3c187; }

/* Discussion pages. */
#forumposts .cat_bar { margin: 10px 0; }
#forumposts .cat_bar h3 { font-size: .98rem; }
#forumposts h3 span#author { margin-right: 2em; color: var(--eg-muted); }
#forumposts > form > .windowbg, #forumposts > form > .windowbg2, #forumposts > form > .approvebg {
  margin: 0 0 12px;
  padding: 8px 0;
  border: 1px solid var(--eg-border);
  border-radius: var(--eg-radius);
  overflow: hidden;
}
.post_wrapper { width: 100%; min-width: 0; }
.poster { box-sizing: border-box; padding: 13px 4px 12px 10px; }
.poster h4 { font-size: 1rem; line-height: 1.35; margin: 0 9px 9px; }
.poster h4 a { color: var(--eg-gold-bright); }
.poster ul { margin: 0 9px; }
.poster li, .poster li.postcount { color: var(--eg-secondary); line-height: 1.45; }
.poster li.avatar img { max-width: 100%; height: auto; border-radius: 9px; }
.postarea, .moderatorbar { padding: 10px 15px 12px; min-width: 0; }
.postarea { border-left: 1px solid var(--eg-border); }
.postarea div.flow_hidden { width: 100%; }
.keyinfo { width: auto; max-width: 62%; }
.keyinfo h5 { color: var(--eg-ink); font-size: .96rem; line-height: 1.5; }
.keyinfo .smalltext { color: var(--eg-muted); }
.post { font-size: 1rem; line-height: 1.68; }
.inner { padding: 13px 0 6px; margin: 0; border-color: var(--eg-border); }
#forumposts .modified, #forumposts .reportlinks, #forumposts .signature { color: var(--eg-secondary); }
ul.quickbuttons { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; float: right; gap: 6px; margin: 3px 0 0; padding: 0; }
ul.quickbuttons li { float: none; margin: 0; padding: 0; background-image: none !important; }
ul.quickbuttons li a { display: inline-block; float: none; padding: 5px 10px; border-radius: 7px; border: 1px solid #506072; height: auto; line-height: 1.25; color: var(--eg-gold-bright); background: #283441; }
ul.quickbuttons li a:hover { background: #405064; color: #fff; text-decoration: none; }
.attachments { max-width: 100%; overflow-x: auto; }
.signature { border-top-color: var(--eg-border); }
.post img, .inner img, .signature img, .attachments img, img.bbc_img, .bbc_img { max-width: 100%; height: auto; }
.post iframe, .post video, .post embed, .post object, .inner iframe, .inner video, .inner embed, .inner object { max-width: 100%; }
.inner, .post, .attachments, blockquote { overflow-wrap: anywhere; }
.post pre, .inner pre, .bbc_code, code.bbc_code, .code { max-width: 100%; overflow-x: auto; }
blockquote.bbc_standard_quote, blockquote.bbc_alternate_quote, .bbc_quote { color: var(--eg-ink); background: #283441; border-top: 2px solid #8d7651; border-bottom: 2px solid #8d7651; border-left: 0; border-right: 0; padding: 12px 15px; font-size: .94rem; line-height: 1.62; }
.codeheader, .quoteheader { color: var(--eg-gold-bright); }
code.bbc_code, .bbc_code { background-color: #111923; color: #e3e8f1; border-color: #425164; }
#quickreplybox, #quickReplyOptions, .editor, #postmodify { max-width: 100%; }
#quickReplyOptions .roundframe { padding: 14px; }
#quickReplyOptions textarea, #message, #message input { max-width: 100%; }

/* Breadcrumbs, notices, account features and plugin surfaces. */
.navigate_section { padding: 3px 0 12px; }
.navigate_section ul { border-top: 0; border-bottom: 1px solid var(--eg-border); margin: 0; padding: 9px 0 13px; overflow: visible; display: flex; flex-wrap: wrap; gap: 3px 6px; width: 100%; }
.navigate_section ul li { float: none; font-size: .81rem; color: var(--eg-muted); white-space: normal; }
.navigate_section ul li a { color: var(--eg-secondary); white-space: normal; }
.navigate_section ul li.last { color: var(--eg-gold-bright); font-weight: 650; }
.notice, .noticebox, .errorbox, .infobox, .successbox { border-radius: 8px; }
.errorbox { background: #432827; color: #ffdfdc; border-color: #94534e; }
.infobox, .noticebox { background: #263542; color: #e0e9f4; border-color: #50657a; }
.alert, .new_posts { color: var(--eg-gold-bright); }
#profileview, #profile_menu, #main_admsection, #admin_content, #manage_boards, #permissions, #searchform { max-width: 100%; }
#profileview .windowbg, #main_admsection .windowbg { border-radius: 9px; }
#profile_menu a, #adm_submenus a { color: var(--eg-gold-bright); }
#admin_content, #manage_boards, #permissions { overflow-x: auto; }
#searchform .roundframe, #searchform .windowbg { border-radius: var(--eg-radius); }
#newsfader { margin: 0 0 14px; }
#smfFadeScroller { color: var(--eg-secondary); }
#upshrinkHeaderIC, #posting_icons, #topic_icons { color: var(--eg-secondary); }
#topic_icons .description { background: var(--eg-panel); }
#sp_main, #sp_center, #sp_left, #sp_right, .sp_block, .sp_content_padding, .sp_table { max-width: 100%; }
.sp_block { border-color: var(--eg-border); }
.sp_list li { border-color: var(--eg-border); }
.sp_content_padding, .sp_regular_padding { color: var(--eg-secondary); }
.adsensemodzstudios_header, .adsensemodzstudios_footer, .ad, .advertisement, .adsbygoogle { max-width: 100%; }
iframe { max-width: 100%; }
img { max-width: 100%; }

/* Breakpoint: tablets / smaller laptops */
@media (max-width: 1060px) {
  #header div.frame { padding: 13px 17px 0; }
  #content_section { padding: 0 15px 18px; }
  #upper_section div.user, #upper_section div.news { width: calc(50% - 9px); }
  #top_section #siteslogan, #top_section img#smflogo { display: none; }
  .poster { width: 12em; }
  .postarea, .moderatorbar { margin-left: 13em; }
  #forumposts h3 span#author { margin-right: 1em; }
}

/* Breakpoint: portrait tablets and phones — no horizontal site scrolling. */
@media (max-width: 860px) {
  body { padding: 0; font-size: 15px; }
  div#wrapper { min-width: 0 !important; width: 100% !important; max-width: 100%; }
  #header, #content_section, #footer_section { border-radius: 0; border-left: 0; border-right: 0; width: 100%; }
  #header div.frame { padding: 13px 14px 0; }
  #content_section { padding: 0 12px 14px; }
  #footer_section div.frame { padding: 15px 10px 20px; }
  #top_section { gap: 8px 11px; margin-bottom: 10px; }
  #top_section h1.forumtitle { font-size: 1.68rem; }
  .ellgab-brand-kicker { font-size: .61rem; margin-right: auto; }
  #top_section #wormhole_header_link { padding: 5px 10px; min-height: 32px; font-size: .71rem; }
  #upper_section { gap: 9px; padding: 10px 0; }
  #upper_section div.user, #upper_section div.news { width: 100%; min-width: 0; }
  #upper_section div.news form { justify-content: flex-start; }
  #upper_section .input_text { width: min(310px, 100%); }
  #main_menu { margin: 4px 0 0; padding: 0 0 8px; }
  #ellgab_mobile_menu_toggle { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; font-weight: 700; background: #2b3847; color: var(--eg-ink); border: 1px solid #536579; border-radius: 9px; cursor: pointer; }
  #ellgab_mobile_menu_toggle span { font-size: 1.2rem; line-height: 1; }
  #main_menu #menu_nav { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 7px; margin: 9px 0 0; background: #1c2530; border: 1px solid #3d4a59; border-radius: 10px; }
  .ellgab-nav-ready #main_menu #menu_nav:not(.ellgab-open) { display: none; }
  #main_menu #menu_nav > li { width: 100%; display: block; border-bottom: 1px solid #34404e; }
  #main_menu #menu_nav > li:last-child { border-bottom: 0; }
  #main_menu #menu_nav > li > a.firstlevel span.firstlevel { font-size: .95rem; padding: 11px 13px; }
  #main_menu #menu_nav > li > ul, #main_menu #menu_nav li li > ul, #main_menu #menu_nav li:hover ul, #main_menu #menu_nav li:hover ul ul {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 0 4px 0 !important;
    padding: 0 0 0 13px !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    top: auto !important;
    left: auto !important;
  }
  #main_menu #menu_nav li li { width: 100%; }
  #main_menu #menu_nav li li a span { font-size: .84rem; padding: 9px 11px; }
  #boardindex_table table.table_list, #boardindex_table tbody, #boardindex_table tbody.header tr, #boardindex_table tbody.header td { display: block; width: 100%; }
  #boardindex_table tbody.divider tr, #boardindex_table tbody.divider td, #boardindex_table tbody:not(.content):not(.header) tr, #boardindex_table tbody:not(.content):not(.header) td { display: block; max-width: 100%; }
  #boardindex_table tbody:not(.content):not(.header) td { overflow-x: auto; }
  #boardindex_table .table_list tbody.content tr { display: grid; grid-template-columns: 43px minmax(0, 1fr); gap: 0 4px; border: 1px solid var(--eg-border); border-radius: 11px; margin-bottom: 8px; overflow: hidden; background: var(--eg-panel); }
  #boardindex_table table.table_list tbody.content td, #boardindex_table table.table_list tbody.content td:first-child, #boardindex_table table.table_list tbody.content td:last-child { display: block; border-radius: 0; background: transparent; width: auto; padding: 8px 10px; }
  #boardindex_table .table_list tbody.content td.icon { grid-column: 1; grid-row: 1; align-self: start; padding: 12px 4px 0 11px; text-align: center; }
  #boardindex_table .table_list tbody.content td.info { grid-column: 2; grid-row: 1; min-width: 0; padding-top: 13px; }
  #boardindex_table .table_list tbody.content td.stats { grid-column: 2; grid-row: 2; text-align: left; padding-top: 0; padding-bottom: 6px; }
  #boardindex_table .table_list tbody.content td.lastpost { grid-column: 1 / -1; grid-row: 3; padding: 9px 13px; border-top: 1px solid var(--eg-border); background: #1b2631; }
  #boardindex_table .table_list tbody.content td.children { grid-column: 1 / -1; padding: 9px 13px; }
  #boardindex_table .table_list tbody.content tr[id^="board_"] td.icon[rowspan] { grid-row: 1 / 3; }
  #boardindex_table .cat_bar { margin-top: 13px; }
  .table_frame { overflow-x: auto; }
  #messageindex table.table_grid, #messageindex thead, #messageindex tbody { display: block; width: 100%; }
  #messageindex thead tr { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; }
  #messageindex thead th { display: inline-flex; align-items: center; width: auto !important; border: 0; padding: 6px 9px; font-size: .78rem; }
  #messageindex thead th:first-child { display: none; }
  #messageindex tbody tr { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 0 2px; border-bottom: 1px solid var(--eg-border); }
  #messageindex tbody tr:not(.titlebg) td { display: block; width: auto; min-width: 0; padding: 7px 8px; background: transparent; border: 0; }
  #messageindex tbody tr td.icon1 { grid-column: 1; grid-row: 1; padding-top: 13px; text-align: center; }
  #messageindex tbody tr td.icon2 { display: none; }
  #messageindex tbody tr td.subject { grid-column: 2 / 4; grid-row: 1; padding-top: 11px; }
  #messageindex tbody tr td.stats { grid-column: 2; grid-row: 2; color: var(--eg-muted); }
  #messageindex tbody tr td.lastpost { grid-column: 2 / 4; grid-row: 3; background: #1a2530; color: var(--eg-muted); padding-bottom: 11px; }
  #messageindex tbody tr td.moderation { grid-column: 3; grid-row: 2; }
  #messageindex tbody tr.titlebg td, #messageindex tbody tr td[colspan] { grid-column: 1 / -1; padding: 8px 12px; }
  #messageindex tbody tr.titlebg { display: block; background: #2d3845; }
  .post_wrapper { float: none; }
  .poster { float: none; display: flex; align-items: flex-start; gap: 9px; flex-wrap: wrap; padding: 13px 13px 9px; width: 100%; border-bottom: 1px solid var(--eg-border); }
  .poster h4 { flex: 0 0 auto; margin: 0; padding: 4px 0; }
  .poster > ul { margin: 0; display: flex; flex: 1 1 200px; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
  .poster > ul > li { display: inline-block; padding: 2px 0; }
  .poster > ul > li.avatar { order: -1; margin: 0 5px 0 0; }
  .poster > ul > li.avatar img { max-height: 46px; max-width: 46px; object-fit: cover; }
  .postarea, .moderatorbar { margin-left: 0; padding: 12px; border: 0; width: 100%; }
  .keyinfo { max-width: 100%; width: 100%; }
  ul.quickbuttons { float: none; justify-content: flex-start; clear: both; margin-top: 10px; }
  #forumposts h3 span#author { display: none; }
  .pagesection { gap: 6px; }
  #quickReplyOptions .roundframe { padding: 10px; }
  .navigate_section ul { padding: 8px 0 11px; }
  #admin_content, #profileview, .tborder, .roundframe { min-width: 0; }
  .sp_table, .sp_table tbody, .sp_table tr, .sp_table td { max-width: 100%; }
}

@media (max-width: 520px) {
  #top_section { gap: 7px 9px; }
  #top_section h1.forumtitle { font-size: 1.47rem; }
  .ellgab-brand-kicker { flex-basis: 100%; order: 1; margin: -3px 0 1px; }
  #top_section #wormhole_header_link { order: 2; }
  #top_section img#upshrink { margin-left: auto; }
  #content_section { padding: 0 10px 12px; }
  #upper_section #guest_form input { width: 100%; }
  #upper_section div.news form { flex-wrap: wrap; }
  #upper_section div.news form input[name="search"] { width: calc(100% - 90px); }
  #upper_section div.news form input[type="submit"] { width: auto; }
  .pagesection { display: block; }
  .pagesection .buttonlist ul { margin-top: 7px; }
  .buttonlist ul li a span { padding: 7px 9px; }
  #messageindex tbody tr td.lastpost { font-size: .76rem; }
  .postarea, .moderatorbar { padding: 11px 10px; }
  .inner { font-size: .95rem; }
  blockquote.bbc_standard_quote, blockquote.bbc_alternate_quote { margin: 7px 0; padding: 10px; }
  .poster > ul { flex-basis: 100%; }
  #footer_section ul li { display: inline-block; }
  table.table_grid td { padding: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  html, body, #content_section, #main_content_section, #forumposts .windowbg, #forumposts .windowbg2, .postarea, .windowbg, .windowbg2 {
    color: #111 !important; background: #fff !important; box-shadow: none !important;
  }
  a:link, a:visited { color: #222 !important; }
  #main_menu, #upper_section, #footer_section, #ellgab_mobile_menu_toggle { display: none !important; }
  #wrapper { width: 100% !important; }
}


/* ==== v1.0.3: EllGab live-header alignment, scoped to this theme ==== */
/* Preserve original features and their markup; only compact their presentation. */
.ellgab-brand-kicker { display: none; } /* duplicates the "Spite Board" in the site title */
#top_section { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; min-height: 46px; padding: 0 0 11px; }
#top_section h1.forumtitle { flex: 0 1 auto; margin: 0 auto 0 0; font-size: clamp(1.55rem, 2.45vw, 2rem); line-height: 1.2; }
#top_section #wormhole_header_link { order: 1; margin-left: auto; }
#top_section #siteslogan, #top_section img#smflogo { order: 2; margin: 0; white-space: nowrap; font-size: .9rem; }
#top_section img#upshrink { order: 3; margin: 0 0 0 6px; }

/* Account, news and search form occupy one aligned utility bar on wide screens. */
#upper_section { display: grid; grid-template-columns: minmax(225px, .9fr) minmax(0, 2.75fr); align-items: center; gap: 12px 20px; padding: 10px 0; margin: 0; border-top: 1px solid #303b48; min-height: 0; }
#upper_section div.user { display: flex; align-items: center; min-width: 0; width: 100%; gap: 11px; float: none; overflow: visible; }
#upper_section div.user p.avatar { margin: 0; padding: 0; flex: 0 0 auto; float: none; }
#upper_section div.user .avatar img { display: block; width: 40px; height: 40px; border-radius: 9px; object-fit: cover; }
#upper_section div.user ul.reset { min-width: 0; margin: 0; padding: 0; line-height: 1.35; }
#upper_section div.user ul li { margin: 0; line-height: 1.4; font-size: .79rem; }
#upper_section div.user ul li.greeting { margin: 0 0 2px; font-size: .89rem; line-height: 1.4; }
#upper_section div.news { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; min-width: 0; float: none; text-align: left; }
#upper_section div.news h2 { display: block; grid-column: 1; grid-row: 1; margin: 0; padding: 0; font-size: .75rem; line-height: 1.3; font-weight: 750; white-space: nowrap; color: var(--eg-gold); }
#upper_section div.news p { display: block; grid-column: 2; grid-row: 1; min-width: 0; margin: 0; padding: 0; font-size: .84rem; line-height: 1.35; color: var(--eg-secondary); overflow-wrap: anywhere; }
#upper_section div.news p a { color: var(--eg-gold-bright) !important; font-size: inherit !important; font-weight: 650; }
#upper_section div.news p a:hover { color: #fff4d8 !important; }
#upper_section div.news form { display: flex; grid-column: 3; grid-row: 1; align-items: center; justify-content: flex-end; gap: 8px; width: auto; margin: 0; padding: 0; }
#upper_section div.news form input[name="search"] { flex: 0 1 200px; min-width: 110px; width: 190px; height: 36px; padding: 6px 10px; }
#upper_section div.news form input[type="submit"] { flex: none; min-height: 36px; padding: 7px 12px; }

/* Compact desktop navigation: one deliberate row, not an orphaned final item. */
#main_menu { margin: 0; padding: 0; border-top: 1px solid #303b48; }
#main_menu #menu_nav { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 0; margin: 0; padding: 7px 0 9px; border: 0; }
#main_menu #menu_nav > li { float: none; flex: 0 1 auto; min-width: 0; }
#main_menu #menu_nav > li > a.firstlevel span.firstlevel { padding: 7px 7px; font-size: .78rem; white-space: nowrap; line-height: 1.4; }
#main_menu #menu_nav li li > a span { white-space: normal; }

/* Convert navigation to the existing mobile menu before the 16+ links can wrap. */
@media (max-width: 1350px) {
  #main_menu { padding: 8px 0 10px; }
  #ellgab_mobile_menu_toggle { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; font-weight: 700; background: #2b3847; color: var(--eg-ink); border: 1px solid #536579; border-radius: 9px; cursor: pointer; }
  #main_menu #menu_nav { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; width: 100%; margin: 8px 0 0; padding: 7px; background: #1c2530; border: 1px solid #3d4a59; border-radius: 10px; }
  .ellgab-nav-ready #main_menu #menu_nav:not(.ellgab-open) { display: none; }
  #main_menu #menu_nav > li { width: 100%; display: block; border-bottom: 1px solid #34404e; }
  #main_menu #menu_nav > li:last-child { border-bottom: 0; }
  #main_menu #menu_nav > li > a.firstlevel span.firstlevel { font-size: .95rem; padding: 10px 12px; white-space: normal; }
  #main_menu #menu_nav > li > ul, #main_menu #menu_nav li li > ul, #main_menu #menu_nav li:hover ul, #main_menu #menu_nav li:hover ul ul {
    display: block !important; position: static !important; width: 100% !important; margin: 0 0 4px !important;
    padding: 0 0 0 13px !important; border: 0 !important; border-radius: 0; box-shadow: none;
    background: transparent; top: auto !important; left: auto !important;
  }
  #main_menu #menu_nav li li { width: 100%; }
}
@media (max-width: 1170px) {
  #upper_section { grid-template-columns: 1fr; gap: 8px; }
  #upper_section div.news { grid-template-columns: auto minmax(0, 1fr) auto; }
}
@media (max-width: 700px) {
  #top_section { gap: 7px 9px; }
  #top_section h1.forumtitle { flex: 1 1 100%; font-size: 1.55rem; }
  #top_section #wormhole_header_link { order: 1; margin-left: 0; font-size: .68rem; }
  #top_section #siteslogan { order: 2; }
  #top_section img#upshrink { order: 3; margin-left: auto; }
  #upper_section { gap: 10px; }
  #upper_section div.news { grid-template-columns: auto minmax(0,1fr); gap: 7px; }
  #upper_section div.news h2 { grid-column: 1; grid-row: 2; }
  #upper_section div.news p { grid-column: 2; grid-row: 2; }
  #upper_section div.news form { grid-column: 1 / -1; grid-row: 1; width: 100%; justify-content: flex-start; }
  #upper_section div.news form input[name="search"] { flex: 1 1 auto; width: 100%; min-width: 0; }
}
@media (max-width: 420px) {
  #top_section h1.forumtitle { font-size: 1.4rem; }
  #top_section #wormhole_header_link { padding: 6px 10px; }
  #upper_section div.news h2, #upper_section div.news p { font-size: .76rem; }
}


/* ==== v1.0.4: live-header polish ==== */
/* Curve's original div#upper_section selectors outrank the earlier Modern
   overrides. They left both grid children at width:50% and the news paragraph
   at display:inline, which produced the narrow account text and stray ticker. */
div#upper_section div.user,
div#upper_section div.news {
  width: 100%;
  float: none;
  min-width: 0;
  overflow: visible;
  text-align: left;
}
div#upper_section div.news p {
  display: block;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
}
div#upper_section div.news form {
  padding: 0;
  margin: 0;
  grid-column: 3;
  grid-row: 1;
  width: auto;
}
@media (max-width: 700px) {
  div#upper_section div.news p { grid-column: 2; grid-row: 2; }
  div#upper_section div.news form { grid-column: 1 / -1; grid-row: 1; width: 100%; }
}
/* The account/time line should use its available width on desktop. */
@media (min-width: 1171px) {
  #upper_section {
    grid-template-columns: minmax(295px, 335px) minmax(0, 1fr);
  }
  #upper_section div.user ul.reset,
  div#upper_section div.user ul.reset {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
  }
  #upper_section div.user ul.reset > li { white-space: nowrap; }
}

/* Administrator-configured SMF news can contain legacy <font> or inline
   colours/sizes. Normalize those presentational styles in Modern only. */
#upper_section div.news p,
#upper_section div.news p *,
#upper_section div.news p a,
#upper_section div.news p a * {
  color: var(--eg-gold-bright) !important;
  font: 650 .87rem/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0 !important;
  text-decoration: none;
}
#upper_section div.news p a:hover,
#upper_section div.news p a:hover * {
  color: #fff3db !important;
  text-decoration: underline;
}
#upper_section div.news h2 {
  font-size: .74rem;
  color: var(--eg-muted);
  letter-spacing: .01em;
}
/* Keep short news items visually balanced; longer items can wrap normally. */
#upper_section div.news p { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  #upper_section div.user ul.reset > li { white-space: normal; }
  #upper_section div.news p,
  #upper_section div.news p * { font-size: .81rem !important; }
}


/* ==== v1.0.5: centered Wormhole and centered news/search layout ==== */
#top_section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 18px;
}
#top_section .ellgab-brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
#top_section .ellgab-header-center {
  display: flex;
  justify-content: center;
  align-items: center;
}
#top_section .ellgab-header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
#top_section h1.forumtitle { min-width: 0; }
#top_section .ellgab-brand-kicker { margin-right: 0; }
#top_section #siteslogan,
#top_section img#smflogo,
#top_section img#upshrink {
  float: none;
  margin: 0;
}

#upper_section {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(250px, 320px);
  align-items: center;
  gap: 16px 18px;
}
div#upper_section div.user,
div#upper_section .ellgab-news-center,
div#upper_section .ellgab-search-side {
  width: auto;
  float: none;
  min-width: 0;
  overflow: visible;
}
div#upper_section .ellgab-news-center {
  text-align: center;
  justify-self: center;
}
div#upper_section .ellgab-news-center h2,
div#upper_section .ellgab-news-center p {
  display: inline;
  margin: 0;
  padding: 0;
}
div#upper_section .ellgab-news-center p { margin-left: 6px; }
div#upper_section .ellgab-search-side {
  justify-self: end;
}
div#upper_section .ellgab-search-side form {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}
div#upper_section .ellgab-search-side input[name="search"] {
  width: 185px;
  max-width: 100%;
}

/* Normalize news content in its new center slot. */
#upper_section .ellgab-news-center,
#upper_section .ellgab-news-center *,
#upper_section .ellgab-news-center a,
#upper_section .ellgab-news-center a * {
  color: var(--eg-gold-bright) !important;
  font: 650 .87rem/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0 !important;
  text-decoration: none;
}
#upper_section .ellgab-news-center a:hover,
#upper_section .ellgab-news-center a:hover * {
  color: #fff3db !important;
  text-decoration: underline;
}
#upper_section .ellgab-news-center h2 {
  color: var(--eg-muted) !important;
  font-size: .74rem !important;
}

@media (max-width: 1170px) {
  #top_section {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  #top_section .ellgab-header-center {
    grid-column: 1 / -1;
    justify-content: center;
  }
  #upper_section {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  div#upper_section .ellgab-news-center,
  div#upper_section .ellgab-search-side {
    justify-self: stretch;
    text-align: center;
  }
  div#upper_section .ellgab-search-side form {
    justify-content: center;
  }
}
@media (max-width: 700px) {
  #top_section {
    grid-template-columns: 1fr auto auto;
    gap: 8px 10px;
  }
  #top_section .ellgab-brand-group {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 6px 10px;
  }
  #top_section .ellgab-header-center {
    grid-column: 1 / 2;
    justify-content: flex-start;
  }
  #top_section .ellgab-header-actions {
    grid-column: 2 / 4;
  }
  div#upper_section .ellgab-news-center h2,
  div#upper_section .ellgab-news-center p {
    display: block;
  }
  div#upper_section .ellgab-news-center p { margin-left: 0; }
  div#upper_section .ellgab-search-side form {
    justify-content: stretch;
  }
  div#upper_section .ellgab-search-side input[name="search"] {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }
}


/* ELLGAB RECENT POSTS COLORS START */
/* SMF BoardIndex: title link is inside strong; author and board links are direct dt children.
   The board link is always the last direct-child anchor, even for guest authors. */
#ic_recentposts dt > strong > a,
#ic_recentposts dt > strong > a:visited {
    color: var(--eg-gold-bright) !important; /* thread titles */
}
#ic_recentposts dt > a:not(:last-of-type),
#ic_recentposts dt > a:not(:last-of-type):visited {
    color: #B8CADC !important; /* usernames */
}
#ic_recentposts dt > a:last-of-type,
#ic_recentposts dt > a:last-of-type:visited {
    color: #8799AA !important; /* board names */
}
/* ELLGAB RECENT POSTS COLORS END */

/* ELLGAB EXPANDED MOBILE NAV V1 START */
/* On iPad/touch devices, show every original SMF navigation item by default.
   Small desktop windows can also use the responsive layout. */
@media only screen and (max-width: 820px), only screen and (pointer: coarse) and (max-width: 1500px) {
    #ellgab_mobile_menu_toggle {
        display: inline-flex !important;
        align-items: center;
        gap: 8px;
        margin-bottom: 4px;
        min-height: 42px;
        cursor: pointer;
    }
    .ellgab-nav-ready #main_menu #menu_nav:not(.ellgab-open) {
        display: none !important;
    }
    #main_menu #menu_nav.ellgab-open {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
        padding: 9px;
        margin-top: 8px;
    }
    #main_menu #menu_nav.ellgab-open > li {
        width: auto !important;
        min-width: 0 !important;
        max-width: 100%;
        margin: 0;
        padding: 0;
        float: none !important;
        border-bottom: 0 !important;
        position: relative;
    }
    #main_menu #menu_nav.ellgab-open > li > a.firstlevel,
    #main_menu #menu_nav.ellgab-open > li > a.active {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        min-height: 44px;
        box-sizing: border-box;
        text-align: center;
    }
    #main_menu #menu_nav.ellgab-open > li > a.firstlevel span.firstlevel,
    #main_menu #menu_nav.ellgab-open > li > a.active span.firstlevel {
        display: block;
        padding: 10px 8px !important;
        font-size: .9rem;
        line-height: 1.3;
        white-space: normal !important;
        overflow-wrap: anywhere;
        text-align: center;
    }
    /* Preserve the existing SMF submenu links, styles and permissions. */
    #main_menu #menu_nav.ellgab-open > li > ul,
    #main_menu #menu_nav.ellgab-open li li > ul {
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}
@media only screen and (max-width: 600px) {
    #main_menu #menu_nav.ellgab-open {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }
}
@media only screen and (min-width: 1100px) and (max-width: 1500px) and (pointer: coarse) {
    #main_menu #menu_nav.ellgab-open {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
/* ELLGAB EXPANDED MOBILE NAV V1 END */

/* ELLGAB COMPACT MOBILE NAV V2 START */
#main_menu #menu_nav .eg-nav-sub-toggle { display: none !important; }
/* Only the same widths/touch devices handled by V1; desktop is unchanged. */
@media only screen and (max-width: 820px), only screen and (pointer: coarse) and (max-width: 1500px) {
  #main_menu #menu_nav.ellgab-open {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0,1fr));
    grid-auto-rows: min-content !important;
    align-items: start !important;
    align-content: start !important;
    gap: 7px !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 7px !important;
  }
  #main_menu #menu_nav.ellgab-open > li {
    display: block !important;
    align-self: start !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    overflow: visible !important;
  }
  #main_menu #menu_nav.ellgab-open > li > a.firstlevel,
  #main_menu #menu_nav.ellgab-open > li > a.active {
    height: auto !important;
    min-height: 43px !important;
    padding: 0 !important;
    align-self: start !important;
  }
  #main_menu #menu_nav.ellgab-open > li > a.firstlevel span.firstlevel,
  #main_menu #menu_nav.ellgab-open > li > a.active span.firstlevel {
    padding: 9px 9px !important;
    line-height: 1.25 !important;
    font-size: .88rem !important;
  }
  #main_menu #menu_nav.ellgab-open > li.eg-nav-has-sub > a.firstlevel,
  #main_menu #menu_nav.ellgab-open > li.eg-nav-has-sub > a.active {
    padding-right: 30px !important;
  }
  /* All nested panels remain inside the parent grid cell, never overlaying other buttons. */
  #main_menu #menu_nav.ellgab-open li > ul,
  #main_menu #menu_nav.ellgab-open li:hover > ul,
  #main_menu #menu_nav.ellgab-open li:focus-within > ul {
    display: none !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    float: none !important;
    transform: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 4px 0 0 !important;
    padding: 4px !important;
    border: 1px solid #3d4a59 !important;
    border-radius: 7px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    background: #14283a !important;
  }
  #main_menu #menu_nav.ellgab-open li.eg-sub-open > ul,
  #main_menu #menu_nav.ellgab-open li.eg-sub-open:hover > ul,
  #main_menu #menu_nav.ellgab-open li.eg-sub-open:focus-within > ul {
    display: block !important;
  }
  #main_menu #menu_nav.ellgab-open li li {
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    border: 0 !important;
  }
  #main_menu #menu_nav.ellgab-open li li > a {
    display: block !important;
    height: auto !important;
    min-height: 38px !important;
    width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    text-align: left !important;
    color: #edf2f6 !important;
  }
  #main_menu #menu_nav.ellgab-open li li > a span {
    display: block !important;
    padding: 9px 6px !important;
    font-size: .82rem !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  #main_menu #menu_nav.ellgab-open li li.eg-nav-has-sub > a { padding-right: 28px !important; }
  #main_menu #menu_nav.ellgab-open .eg-nav-sub-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: absolute !important;
    right: 2px !important;
    top: 2px !important;
    width: 30px !important;
    height: 38px !important;
    z-index: 2;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #536579 !important;
    border-radius: 5px !important;
    background: #263d50 !important;
    color: #efc17c !important;
    font-size: 16px !important;
    cursor: pointer;
    touch-action: manipulation;
  }
  #main_menu #menu_nav.ellgab-open .eg-nav-sub-toggle:focus-visible { outline: 2px solid #efc17c; outline-offset: 2px; }
}
@media only screen and (max-width: 600px) {
  #main_menu #menu_nav.ellgab-open { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 6px !important; }
}
@media only screen and (min-width: 1100px) and (max-width: 1500px) and (pointer: coarse) {
  #main_menu #menu_nav.ellgab-open { grid-template-columns: repeat(4,minmax(0,1fr)) !important; }
}
/* ELLGAB COMPACT MOBILE NAV V2 END */

/* ELLGAB MOBILE REGISTRATION V2 START */
/* Scope to public registration only. Keep desktop and admin registration unchanged. */
@media only screen and (max-width: 700px) {
  form#registration { width: 100%; max-width: 100%; box-sizing: border-box; }
  form#registration .cat_bar, form#registration .title_bar { margin-bottom: 3px; }
  form#registration .catbg, form#registration .titlebg { padding-top: 7px; padding-bottom: 7px; }
  form#registration .windowbg2, form#registration fieldset.content {
    min-width: 0; max-width: 100%; box-sizing: border-box;
  }
  form#registration fieldset.content { padding: 10px 11px !important; margin: 0 0 9px !important; }
  form#registration dl.register_form {
    display: grid !important; grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important; width: 100% !important; margin: 0 !important; padding: 0 !important;
    clear: both !important;
  }
  form#registration dl.register_form > dt,
  form#registration dl.register_form > dd {
    float: none !important; clear: both !important;
    display: block !important; grid-column: 1 !important;
    width: auto !important; max-width: 100% !important; min-width: 0 !important;
    margin-left: 0 !important; margin-right: 0 !important;
    padding-left: 0 !important; padding-right: 0 !important;
    box-sizing: border-box !important;
  }
  form#registration dl.register_form > dt { margin-top: 10px !important; margin-bottom: 3px !important; }
  form#registration dl.register_form > dt:first-child { margin-top: 0 !important; }
  form#registration dl.register_form > dd { margin-top: 0 !important; margin-bottom: 8px !important; }
  form#registration dl.register_form > dt label { display: inline; }
  form#registration dl.register_form > dd input.input_text,
  form#registration dl.register_form > dd input.input_password,
  form#registration dl.register_form > dd input[type="email"],
  form#registration dl.register_form > dd input[type="text"],
  form#registration dl.register_form > dd input[type="password"],
  form#registration dl.register_form > dd select,
  form#registration dl.register_form > dd textarea {
    width: 100% !important; max-width: 100% !important;
    min-width: 0 !important; box-sizing: border-box !important;
    font-size: 16px !important;
  }
  form#registration dl.register_form > dd input[type="checkbox"],
  form#registration dl.register_form > dd input[type="radio"] { width: auto !important; }
  form#registration #confirm_buttons { padding: 10px 0; }
}
/* On registration pages only, remove the sitewide masthead and navigation.
   The required registration headings, agreement and form remain visible. */
@media only screen and (max-width: 700px) {
  html.eg-simple-registration #header,
  html.eg-simple-registration #main_menu,
  html.eg-simple-registration #navigate_section,
  html.eg-simple-registration #linktree { display: none !important; }
  html.eg-simple-registration #content_section { margin-top: 0 !important; padding-top: 8px !important; }
  html.eg-simple-registration #content_section > div { margin-top: 0; }
}
/* ELLGAB MOBILE REGISTRATION V2 END */

/* ELLGAB MOBILE SEARCH ABOVE MENU V2.1 START */
/* Phone, tablet, and touch-sized iPad: search is a full-width row before navigation.
   Preserve all existing compact V2 menu and registration behaviors. */
@media only screen and (max-width: 1170px), only screen and (pointer: coarse) and (max-width: 1500px) {
  #upper_section,
  div#upper_section {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 9px !important;
    box-sizing: border-box !important;
  }
  #upper_section > div,
  div#upper_section > div {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    grid-column: 1 !important;
  }
  div#upper_section .ellgab-search-side {
    grid-row: 1 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    justify-self: stretch !important;
    margin: 0 !important;
    text-align: left !important;
  }
  div#upper_section .ellgab-search-side form#search_form {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  div#upper_section .ellgab-search-side form#search_form input[name="search"] {
    display: block !important;
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
  }
  div#upper_section .ellgab-search-side form#search_form input[type="submit"] {
    display: block !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 42% !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    margin: 0 !important;
  }
  div#upper_section > div.user { grid-row: 2 !important; }
  div#upper_section > div.ellgab-news-center { grid-row: 3 !important; }
  #main_menu { clear: both !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
}
/* ELLGAB MOBILE SEARCH ABOVE MENU V2.1 END */

/* ELLGAB SEARCH ROW V2.2 START */
/* The original search form is moved into its own sibling row above main_menu by JS.
   Do not alter V2 navigation buttons, submenus, or desktop appearance. */
#header .eg-mobile-search-row { display: none; }
@media only screen and (max-width: 1170px), only screen and (pointer: coarse) and (max-width: 1500px) {
  #header .eg-mobile-search-row {
    display: block !important;
    width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    clear: both !important; grid-column: 1 / -1 !important;
    flex: 0 0 100% !important; align-self: stretch !important;
    float: none !important; position: relative !important;
    margin: 7px 0 8px !important; padding: 0 !important;
    box-sizing: border-box !important;
  }
  #header .eg-mobile-search-row .ellgab-search-side {
    width: 100% !important; min-width: 0 !important; max-width: 100% !important;
    display: block !important; float: none !important; margin: 0 !important;
    padding: 0 !important; text-align: left !important; box-sizing: border-box !important;
  }
  #header .eg-mobile-search-row form#search_form {
    display: flex !important; flex-flow: row nowrap !important;
    align-items: stretch !important; justify-content: flex-start !important;
    width: 100% !important; min-width: 0 !important; max-width: 100% !important;
    margin: 0 !important; padding: 0 !important; gap: 8px !important;
    box-sizing: border-box !important;
  }
  #header .eg-mobile-search-row form#search_form input[name="search"] {
    display: block !important; flex: 1 1 0 !important;
    width: 0 !important; min-width: 0 !important; max-width: none !important;
    box-sizing: border-box !important; font-size: 16px !important;
  }
  #header .eg-mobile-search-row form#search_form input[type="submit"] {
    display: block !important; flex: 0 0 auto !important;
    width: auto !important; min-width: 0 !important; max-width: 42% !important;
    white-space: nowrap !important; box-sizing: border-box !important; margin: 0 !important;
  }
  /* V2.1 formerly reserved grid row 1 for a search block inside upper_section. */
  div#upper_section > div.user { grid-row: 1 !important; }
  div#upper_section > div.ellgab-news-center { grid-row: 2 !important; }
  #header #main_menu { clear: both !important; grid-column: 1 / -1 !important; }
}
/* ELLGAB SEARCH ROW V2.2 END */

/* ELLGAB MOBILE HEADER V2.3 START */
/* The existing menu button and existing search form share one row in mobile mode.
   Does not change desktop, SMF search scope, or Compact Nav V2 submenus. */
@media only screen and (max-width: 1170px), only screen and (pointer: coarse) and (max-width: 1500px) {
  #header .eg-mobile-search-row.eg-menu-search-inline {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 5px 0 9px !important;
  }
  #header .eg-mobile-search-row.eg-menu-search-inline > #ellgab_mobile_menu_toggle {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 38% !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
  #header .eg-mobile-search-row.eg-menu-search-inline > #ellgab_mobile_menu_toggle span {
    font-size: 16px !important;
  }
  #header .eg-mobile-search-row.eg-menu-search-inline > .ellgab-search-side {
    display: block !important;
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  #header .eg-mobile-search-row.eg-menu-search-inline form#search_form {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    gap: 5px !important;
    font-size: 0 !important; /* Prevent the legacy &nbsp; separator taking width. */
  }
  #header .eg-mobile-search-row.eg-menu-search-inline form#search_form input[name="search"] {
    display: block !important;
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    font-size: 16px !important;
  }
  #header .eg-mobile-search-row.eg-menu-search-inline form#search_form input[type="submit"] {
    display: block !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 46% !important;
    padding: 8px 10px !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.15 !important;
    box-sizing: border-box !important;
  }
  /* Existing compact navigation continues beneath the shared controls. */
  #header #main_menu { display: block !important; clear: both !important; }
}
@media only screen and (max-width: 375px) {
  #header .eg-mobile-search-row.eg-menu-search-inline { gap: 5px !important; }
  #header .eg-mobile-search-row.eg-menu-search-inline > #ellgab_mobile_menu_toggle { padding: 7px 7px !important; font-size: 13px !important; }
  #header .eg-mobile-search-row.eg-menu-search-inline form#search_form input[type="submit"] { padding: 7px 7px !important; font-size: 13px !important; }
}
/* ELLGAB MOBILE HEADER V2.3 END */
