/* Shared theme overrides. Original light styling remains in the existing files. */
.site-theme-toggle {
  display: block; width: 100%; border: 0; border-radius: 0; background: transparent;
  color: #dbe7f8; font: inherit; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; padding: 20px 14px; line-height: 20px; text-align: left;
}
.navbar-inverse .navbar-nav > li > .site-theme-toggle:hover,
.navbar-inverse .navbar-nav > li > .site-theme-toggle:focus { color: #fff; background: rgba(255,255,255,.08); }
.site-theme-toggle:focus-visible { outline: 2px solid #8fc6ff; outline-offset: -4px; }
@media (min-width: 768px) and (max-width: 1399px) {
  #slide-nav .navbar-nav > li > a, #slide-nav .site-theme-toggle { padding-left: 8px; padding-right: 8px; font-size: 12px; }
}
@media (max-width: 767px) { .site-theme-toggle { padding: 10px 15px; } }
@media screen {
html[data-theme="dark"] { color-scheme: dark; --theme-text: #e0e7f2; --theme-muted: #adbbcf; --theme-border: #37465e; --theme-panel: #1b2536; --theme-raised: #243249; }
html[data-theme="dark"] body { background: #111827; color: var(--theme-text); }
html[data-theme="dark"] a { color: #8fc6ff; }
html[data-theme="dark"] a:hover,
html[data-theme="dark"] a:focus { color: #bddfff; }
html[data-theme="dark"] .panel,
html[data-theme="dark"] .well,
html[data-theme="dark"] .panel-body,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .thumbnail,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .PhorumStdBlock,
html[data-theme="dark"] .PhorumStdBlockAlt,
html[data-theme="dark"] .PhorumReadMessageBlock,
html[data-theme="dark"] .PhorumReadBodyText,
html[data-theme="dark"] .PhorumFormTable,
html[data-theme="dark"] .content-table,
html[data-theme="dark"] .bg-container { background: var(--theme-panel); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .panel-footer,
html[data-theme="dark"] .PhorumStdBlockHeader,
html[data-theme="dark"] .PhorumNavBlock,
html[data-theme="dark"] .PhorumReadNavBlock,
html[data-theme="dark"] .PhorumReadBodyHead,
html[data-theme="dark"] .PhorumTableHeader,
html[data-theme="dark"] .content-table-header { background: var(--theme-raised); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .panel-heading,
html[data-theme="dark"] .panel-primary > .panel-heading,
html[data-theme="dark"] .panel-info > .panel-heading,
html[data-theme="dark"] .panel-heading.block-heading { background-color: #275f99 !important; background-image: linear-gradient(180deg,#326fae,#214b79) !important; color: #fff; border-color: var(--theme-border); }
html[data-theme="dark"] .panel-heading a,
html[data-theme="dark"] .panel-heading a:hover { color: #fff; }
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .help-block,
html[data-theme="dark"] .PhorumListSubText,
html[data-theme="dark"] .PhorumSmallFont,
html[data-theme="dark"] .forum-last-post { color: var(--theme-muted); }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .input-group-addon { background: #141e2d; color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--theme-muted); opacity: 1; }
html[data-theme="dark"] .btn-default,
html[data-theme="dark"] .pager li a,
html[data-theme="dark"] .tag-list .btn,
html[data-theme="dark"] .pagination > li > a,
html[data-theme="dark"] .pagination > li > span,
html[data-theme="dark"] .PhorumTableRow,
html[data-theme="dark"] .PhorumRowBlock { background: var(--theme-raised); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .btn-default:hover,
html[data-theme="dark"] .tag-list .btn:hover,
html[data-theme="dark"] .pager li a:hover,
html[data-theme="dark"] .table-hover > tbody > tr:hover,
html[data-theme="dark"] .PhorumTableRowAlt,
html[data-theme="dark"] .PhorumRowBlockAlt,
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) { background: #2b3c54; color: var(--theme-text); }
html[data-theme="dark"] .table > thead > tr > th,
html[data-theme="dark"] .table > tbody > tr > td,
html[data-theme="dark"] .table > tbody > tr > th,
html[data-theme="dark"] hr,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer { border-color: var(--theme-border); }
html[data-theme="dark"] .dropdown-menu { background: #172235; border-color: var(--theme-border); }
html[data-theme="dark"] .dropdown-menu > li > a,
html[data-theme="dark"] #image-share .image-share-action { color: var(--theme-text); }
html[data-theme="dark"] .dropdown-menu > li > a:hover,
html[data-theme="dark"] .dropdown-menu > li > a:focus,
html[data-theme="dark"] #image-share .image-share-action:hover,
html[data-theme="dark"] #image-share .image-share-action:focus { background: #2b3c54; color: #fff; }
html[data-theme="dark"] .dropdown-menu .divider { background-color: var(--theme-border); }
html[data-theme="dark"] .image-nav-cell .pager a,
html[data-theme="dark"] .image-nav-cell .pager a .nav-label,
html[data-theme="dark"] .image-nav-cell .pager a .fa { color: var(--theme-text) !important; }
html[data-theme="dark"] .gallery-card { background: var(--theme-panel); border-color: var(--theme-border); }
html[data-theme="dark"] .close { color: #fff; opacity: .8; text-shadow: none; }
html[data-theme="dark"] pre,
html[data-theme="dark"] code,
html[data-theme="dark"] blockquote { background: #141e2d; color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .alert-info,
html[data-theme="dark"] .PhorumNotificationArea { background: #18364e; color: #c5e7ff; border-color: #39617c; }
html[data-theme="dark"] .alert-success,
html[data-theme="dark"] .PhorumOkMsg { background: #193e34; color: #c4f1da; border-color: #39705e; }
html[data-theme="dark"] .alert-danger,
html[data-theme="dark"] .PhorumUserError { background: #4a2630; color: #ffd4dc; border-color: #825063; }
html[data-theme="dark"] .btn-link,
html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .PhorumNavLink,
html[data-theme="dark"] .PhorumListPageLink { color: #8fc6ff; }
}
/* Keep all navigation on one row on smaller desktops. */
@media (min-width: 992px) and (max-width: 1199px) {
  #slide-nav #slidemenu > .navbar-brand { display: none !important; }
}
@media screen {
  html[data-theme="dark"] #phorum-index th.forum-name a { color: #8fc6ff; }
  html[data-theme="dark"] .PhorumReadBodySubject,
  html[data-theme="dark"] .PhorumHeaderText,
  html[data-theme="dark"] .content-text { color: var(--theme-text); }
  html[data-theme="dark"] #slide-nav.navbar-inverse #slidemenu,
  html[data-theme="dark"] #navbar-height-col.inverse { background: #111d32; }
}

/* Upload guidelines, featured-image caption and Phorum text contrast. */
@media screen {
  html[data-theme="dark"] .upload-rules-box {
    background: #141e2d;
    color: var(--theme-text);
    border-color: var(--theme-border);
  }
  html[data-theme="dark"] .upload-rule-card {
    background: var(--theme-raised);
    color: var(--theme-text);
    border-color: var(--theme-border);
  }
  html[data-theme="dark"] .upload-rule-note,
  html[data-theme="dark"] .upload-preview-meta {
    color: var(--theme-muted);
  }
  html[data-theme="dark"] .upload-rule-card li:before {
    color: #8fc6ff;
  }
  html[data-theme="dark"] .upload-preview-container {
    border-color: var(--theme-border);
  }
  html[data-theme="dark"] .thumbnail .caption {
    color: var(--theme-text);
  }
  /* Phorum declares a colour on cells, so changing body alone is insufficient. */
  html[data-theme="dark"] #page-content td,
  html[data-theme="dark"] #page-content th {
    color: var(--theme-text);
  }
  html[data-theme="dark"] .PhorumTitleText,
  html[data-theme="dark"] .PhorumFloatingText,
  html[data-theme="dark"] .PhorumReadBodyHead,
  html[data-theme="dark"] .PhorumReadBodySubject,
  html[data-theme="dark"] .PhorumReadBodyText,
  html[data-theme="dark"] .PhorumListSubjPrefix,
  html[data-theme="dark"] .PhorumNavHeading {
    color: var(--theme-text);
  }
  html[data-theme="dark"] .content-table a,
  html[data-theme="dark"] #minitabs a:link,
  html[data-theme="dark"] #minitabs a:visited,
  html[data-theme="dark"] #minitabs2 a:link,
  html[data-theme="dark"] #minitabs2 a:visited {
    color: #8fc6ff;
  }
  html[data-theme="dark"] .content-table a:hover,
  html[data-theme="dark"] #minitabs a:hover,
  html[data-theme="dark"] #minitabs2 a:hover {
    color: #bddfff;
  }
}

/* Match child backgrounds to the panel's outside corners in both themes.
   Keep overflow visible so gallery/share dropdowns can extend past panels. */
.panel > .panel-body:first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
.panel > .panel-body:last-child,
.panel > .panel-footer:last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
