/* Scoped additions only; the existing forum theme stays intact. */
#header .news p {font-size:14px;font-weight:700;line-height:1.6;}
.ksn-archive-banner {clear:both;display:flex;align-items:center;justify-content:space-between;gap:20px;margin:12px 0 18px;padding:17px 20px;border:1px solid #b7d3dd;border-left:5px solid #df3c77;background:#eaf3f6;color:#234f66;border-radius:5px;text-align:left;box-sizing:border-box;}
.ksn-archive-banner .ksn-archive-label {display:inline-block;margin:0 10px 5px 0;color:#a81d52;font-size:12px;font-weight:700;letter-spacing:2px;}
.ksn-archive-banner strong {display:block;font-size:19px;line-height:1.4;}
.ksn-archive-banner p {margin:6px 0 0;font-size:13px;line-height:1.5;}
.ksn-archive-banner a {display:inline-block;flex-shrink:0;padding:12px 16px;border-radius:4px;background:#b8235c;color:#fff!important;font-size:13px;font-weight:700;text-decoration:none!important;line-height:1.5;}
.ksn-archive-banner a:hover,.ksn-archive-banner a:focus {background:#961b49;outline:2px solid #234f66;outline-offset:3px;}
@media(max-width:650px){.ksn-archive-banner{align-items:flex-start;flex-direction:column;gap:12px;padding:14px;}.ksn-archive-banner strong{font-size:17px;}.ksn-archive-banner a{box-sizing:border-box;max-width:100%;white-space:normal;}}

/* KSN mobile v1 — overrides apply only to narrow viewports. */
@media screen and (max-width: 800px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { font-size: 16px; line-height: 1.55; padding: 6px 0; }
  div#wrapper { width: 100% !important; min-width: 0; max-width: 100%; }
  #header, #content_section { padding-left: 8px; }
  #header > .frame, #content_section > .frame { padding-right: 8px; }
  #main_content_section, .post_wrapper, .postarea, .post, .personalmessage,
  .inner, .content, .table_frame { min-width: 0; box-sizing: border-box; }
  #wrapper { overflow-wrap: anywhere; }
  #top_section { min-height: 0; }
  h1.forumtitle { float: none; font-size: 22px; line-height: 1.35; padding: 10px 36px 10px 2px; }
  h1.forumtitle img { max-width: 100%; height: auto; }
  img#smflogo { float: none; display: block; margin: 0 0 8px auto; max-width: 160px; height: auto; }
  img#upshrink { position: absolute; right: 5px; top: 5px; margin: 0; padding: 14px; }
  #top_section { position: relative; }
  #upper_section { padding: 4px; margin-bottom: 10px; }
  div#upper_section div.user, #upper_section div.news { float: none; width: auto; text-align: left; }
  div#upper_section div.user { margin-bottom: 14px; }
  div#upper_section div.user img.avatar { max-width: 64px; max-height: 64px; width: auto; height: auto; }
  #guest_form { line-height: 1.55; }
  #guest_form input, #guest_form select { box-sizing: border-box; max-width: 100%; margin: 4px 0; }
  #search_form { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
  #search_form input[type="text"] { flex: 1 1 140px; min-width: 0; width: auto; }
  #header .news p { display: block; font-size: 16px; line-height: 1.6; }
  .ksn-archive-banner { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; margin: 12px 0; }
  .ksn-archive-banner strong { font-size: 19px; }
  .ksn-archive-banner p, .ksn-archive-banner a { font-size: 15px; }
  .ksn-archive-banner a { text-align: center; white-space: normal; }
  #main_menu { clear: both; }
  #menu_nav { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 0; }
  #menu_nav > li { float: none; margin: 0; min-width: 0; }
  #menu_nav > li > a.firstlevel { display: flex; align-items: center; min-height: 44px; height: auto; padding: 0 10px; font-size: 15px; line-height: 1.4; background-image: none; border-radius: 4px; box-sizing: border-box; }
  #menu_nav > li > a.firstlevel > span.firstlevel { padding: 0; height: auto; line-height: 1.4; background-image: none; }
  #menu_nav > li > a.active, #menu_nav > li > a.firstlevel:hover { background: #df3c77; color: #fff; }
  #menu_nav li ul { max-width: calc(100vw - 24px); box-sizing: border-box; }
  #menu_nav li li { width: 100%; box-sizing: border-box; }
  #menu_nav li:focus-within > ul { display: block; top: auto; }
  #menu_nav li ul ul { position: static; margin: 0; width: 100%; }
  input, select, textarea, button { font-size: 16px; max-width: 100%; box-sizing: border-box; }
  input[type="text"], input[type="password"], input[type="email"], select,
  input[type="submit"], input[type="button"], button { min-height: 44px; }
  textarea { width: 100%; }
  .smalltext, .middletext, .normaltext { line-height: 1.55; }
  .smalltext { font-size: 14px; }
  .middletext, .normaltext { font-size: 16px; }
  .navigate_section { padding: 8px 2px; }
  .navigate_section ul li { float: none; display: inline; white-space: normal; }
  .navigate_section a { display: inline-block; padding: 5px 0; }
  .cat_bar, .title_bar, .title_barIC { height: auto; min-height: 31px; }
  h3.catbg, h3.catbg2, h3.titlebg, h4.titlebg, h4.catbg { height: auto; min-height: 31px; font-size: 17px; line-height: 1.45; padding-top: 7px; padding-bottom: 7px; background-color: #4b9db5; }
  h3.titlebg, h4.titlebg { background-color: #e7eaef; }
  .pagesection, .pagelinks { font-size: 15px; line-height: 1.8; }
  .pagesection .floatleft, .pagesection .floatright { float: none; }
  .pagelinks a, .pagelinks > strong { display: inline-block; min-width: 28px; padding: 6px 4px; text-align: center; }
  .buttonlist ul, ul.quickbuttons { display: flex; flex-wrap: wrap; gap: 6px; float: none; margin: 4px 0; padding: 0; }
  .buttonlist ul li, ul.quickbuttons li { float: none; margin: 0; }
  .buttonlist ul li a { margin: 0; font-size: 14px; }
  .buttonlist ul li a span { height: auto; min-height: 40px; line-height: 1.4; display: flex; align-items: center; }
  ul.quickbuttons li a { height: auto; min-height: 40px; display: flex; align-items: center; line-height: 1.4; }
  #postbuttons .buttonlist { float: none; }
  /* Board and topic lists: preserve every title, count and last-post link. */
  #boardindex_table .table_list, #childboards .table_list, #messageindex .table_grid,
  #messageindex .table_list { display: block; width: 100%; }
  #boardindex_table .table_list > tbody, #childboards .table_list > tbody,
  #messageindex table > tbody, #messageindex table > thead { display: block; width: 100%; }
  #boardindex_table .table_list > tbody > tr, #childboards .table_list > tbody > tr,
  #messageindex table > tbody > tr, #messageindex table > thead > tr { display: grid; grid-template-columns: 40px minmax(0,1fr); width: 100%; box-sizing: border-box; }
  #boardindex_table .table_list > tbody > tr > td, #childboards .table_list > tbody > tr > td,
  #messageindex table > tbody > tr > td, #messageindex table > thead > tr > th { display: block; width: auto; min-width: 0; box-sizing: border-box; border-right: 0; text-align: left; }
  #boardindex_table .table_list td.icon, #childboards .table_list td.icon { grid-column: 1; grid-row: 1; padding: 10px 3px; }
  .table_list td.icon img { max-width: 30px; height: auto; }
  #boardindex_table .table_list td.info, #childboards .table_list td.info { grid-column: 2; padding: 10px 6px 6px; }
  #boardindex_table .table_list td.stats, #boardindex_table .table_list td.lastpost,
  #childboards .table_list td.stats, #childboards .table_list td.lastpost { grid-column: 2; padding: 4px 6px; font-size: 14px; line-height: 1.55; }
  #boardindex_table .table_list td.stats br, #childboards .table_list td.stats br { display: none; }
  #boardindex_table .table_list td.lastpost, #childboards .table_list td.lastpost { padding-bottom: 12px; }
  #boardindex_table .table_list tbody.header td, #boardindex_table .table_list tbody.divider td,
  #boardindex_table .table_list td.children, #childboards .table_list td.children { grid-column: 1 / -1; }
  .table_list td.children { font-size: 14px; line-height: 1.6; }
  .table_list td.children a { display: inline-block; padding: 6px 0; }
  .table_list td.info a.subject { display: inline-block; font-size: 17px; line-height: 1.4; padding: 3px 0; }
  .table_list td.info p { font-size: 15px; line-height: 1.6; }
  .table_list td.info p.moderators { font-size: 14px; }
  #messageindex table > tbody > tr { grid-template-columns: 28px 28px minmax(0,1fr); border-bottom: 3px solid white; padding: 8px 0; }
  #messageindex td.icon1, #messageindex td.icon2 { padding: 5px 2px; }
  #messageindex td.icon1 { grid-column: 1; grid-row: 1; }
  #messageindex td.icon2 { grid-column: 2; grid-row: 1; }
  #messageindex td.subject { grid-column: 3; padding: 3px 6px; font-size: 17px; line-height: 1.5; }
  #messageindex td.stats, #messageindex td.lastpost { grid-column: 3; padding: 4px 6px; font-size: 14px; line-height: 1.55; }
  #messageindex td[colspan] { grid-column: 1 / -1; font-size: 14px; }
  #messageindex table > thead > tr { display: flex; flex-wrap: wrap; gap: 6px; }
  #messageindex table > thead > tr > th { flex: 1 1 130px; font-size: 14px; padding: 6px; white-space: normal; }
  #messageindex th.first_th[colspan="2"] { display: none; }
  #messageindex table > thead > tr > th:empty { display: none; }
  /* Post body uses the full available width. Author information stays visible. */
  #forumposts h3 span#author { display: none; }
  .post_wrapper { float: none; width: 100%; }
  .poster { float: none; width: auto; padding: 10px 8px; border-bottom: 1px solid #c9d2dc; }
  .poster h4 { margin: 0 0 7px; font-size: 17px; }
  .poster > ul { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; margin: 0; padding: 0; }
  .poster > ul > li { margin: 0; font-size: 13px; line-height: 1.5; }
  .poster > ul > li.avatar { order: -1; margin: 0; }
  .poster img.avatar { max-width: 56px; max-height: 56px; width: auto; height: auto; }
  .poster ul ul { margin: 0; }
  .poster .profile a, .poster .im_icons a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; }
  .postarea, .moderatorbar { margin: 0; padding: 10px 8px; }
  .keyinfo { float: none; width: auto; }
  .keyinfo h5 { font-size: 17px; line-height: 1.5; }
  .post, .personalmessage, .post .inner { font-size: 16px; line-height: 1.65; }
  .post .inner { padding: 12px 0 4px; margin: 0; }
  .post .inner, .signature, .attachments { max-width: 100%; overflow-wrap: anywhere; }
  .post img, .personalmessage img, .signature img, .attachments img { max-width: 100% !important; height: auto !important; object-fit: contain; }
  .quoteheader, blockquote.bbc_standard_quote, blockquote.bbc_alternate_quote { font-size: 14px; line-height: 1.6; margin-left: 0; margin-right: 0; }
  pre, .bbc_code, .inner table { max-width: 100%; overflow-x: auto; }
  .inner table { display: block; }
  .bbc_code { white-space: pre; overflow-wrap: normal; }
  .inner iframe, .inner video, .inner object, .inner embed { max-width: 100%; }
  .inner video { height: auto; }
  .inner iframe[src*="youtube.com/"]:not(.ksn-legacy-frame),
  .inner iframe[src*="youtube-nocookie.com/"]:not(.ksn-legacy-frame),
  .inner iframe[src*="player.vimeo.com/"]:not(.ksn-legacy-frame) { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .inner .ksn-legacy-card { max-width: 100% !important; box-sizing: border-box; padding: 12px; }
  .ksn-legacy-title, .ksn-legacy-description, .ksn-legacy-play { font-size: 15px; line-height: 1.5; }
  .ksn-legacy-source, .ksn-legacy-watch { font-size: 13px; }
  .ksn-legacy-ruffle, .ksn-legacy-frame { max-width: 100%; }
  .ksn-instagram-card { max-width: 100% !important; min-width: 0 !important; overflow-x: auto; }
  /* Small ancillary screens and footer. Never clip page overflow to hide bugs. */
  #smfFadeScroller { padding: 0 4px; height: auto !important; min-height: 0 !important; }
  #smfFadeScroller li { position: static !important; }
  dl#ic_recentposts dt { float: none; }
  dl#ic_recentposts dd { text-align: left; margin: 0 0 14px; font-size: 14px; }
  #index_common_stats { position: static; line-height: 1.6; text-align: left; }
  #footer_section { padding: 8px; }
  #footer_section .frame { padding: 0; }
  #footer_section ul li { float: none; display: inline-block; margin: 4px; line-height: 1.5; }
  .login, #registration, #searchform, #advanced_search { max-width: 100%; width: auto; box-sizing: border-box; }
  .login dt, .login dd { float: none; width: auto; margin-left: 0; text-align: left; }
  #quickReplyOptions .input_text, #quickReplyOptions textarea, #postmodify textarea { width: 100%; min-width: 0; box-sizing: border-box; }
  dl.settings dt, dl.settings dd { float: none; width: auto; margin-left: 0; }
  .roundframe { padding-left: 8px; padding-right: 8px; }
}

/* KSN Archive v2: one historical notice, with justified copy. */
#newsfader { display: none; }
.ksn-archive-banner > div { min-width: 0; }
.ksn-archive-banner p,
#boardindex_table .table_list td.info p:not(.moderators),
#childboards .table_list td.info p:not(.moderators) {
  text-align: justify;
  text-align-last: left;
  text-justify: inter-word;
  hyphens: auto;
}
.ksn-archive-banner p { font-weight: 400; }
