/**
 * OMG SAMSA NOTE Wiki
 * Microsoft Design Language 2 (MDL2) Design System & Dark Theme
 * Inspired by Windows 10 UWP, SplitView, Pivot, and Segoe UI Guidelines
 */

/* ==========================================================================
   CSS CUSTOM PROPERTIES / MDL2 DESIGN TOKENS
   ========================================================================== */

:root {
  /* Typography - Segoe UI Type Ramp */
  --font-segoe: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "Consolas", "Courier New", Courier, monospace;

  /* Layout Dimensions */
  --splitview-width: 260px;
  --commandbar-height: 48px;
  --content-max-width: 1040px;

  /* Strict MDL2 Geometry: Flat, Rectangular, 0px border-radius */
  --radius-none: 0px;

  /* Windows 10 Light Theme Tokens */
  --bg-window: #f2f2f2;
  --bg-surface: #ffffff;
  --bg-splitview: #e6e6e6;
  --bg-subtle: #f7f7f7;
  --bg-hover: #dadada;
  --bg-active: #c8c8c8;

  --text-primary: #000000;
  --text-secondary: #333333;
  --text-muted: #666666;
  --text-subtle: #8c8c8c;

  --border: #dcdcdc;
  --border-subtle: #eaeaea;
  --border-strong: #767676;

  /* Iconic Windows 10 Accent Blue */
  --accent: #0078d7;
  --accent-hover: #0063b1;
  --accent-pressed: #004e8c;
  --accent-soft: rgba(0, 120, 215, 0.08);
  --accent-contrast: #ffffff;

  --link: #0078d7;
  --link-hover: #0063b1;
  --link-visited: #68217a;
  --link-red: #e81123;
  --link-red-visited: #a80000;

  --star-color: #ffb900;
  --star-muted: #767676;

  --code-bg: #f5f5f5;
  --code-border: #e0e0e0;

  --infobox-bg: #ffffff;
  --infobox-header-bg: #f2f2f2;
  --infobox-label-bg: #f7f7f7;

  /* MDL2 Elevation (Very subtle flat drop shadow) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.16);

  /* Legacy/Compatibility aliases */
  --bg-page: var(--bg-window);
  --primary: var(--accent);
  --primary-hover: var(--accent-hover);
  --primary-soft: var(--accent-soft);
  --mw-bg: var(--bg-window);
  --mw-content-bg: var(--bg-surface);
  --mw-text: var(--text-primary);
  --mw-muted: var(--text-muted);
  --mw-link: var(--link);
  --mw-link-visited: var(--link-visited);
  --mw-link-red: var(--link-red);
  --mw-border: var(--border);
  --mw-border-light: var(--border-subtle);
  --mw-border-subtle: var(--border-subtle);
  --mw-accent: var(--accent);
  --mw-highlight: var(--accent-soft);
  --mw-infobox-bg: var(--infobox-bg);
  --mw-infobox-header: var(--infobox-header-bg);
  --mw-infobox-label: var(--infobox-label-bg);
  --mw-toc-bg: var(--bg-subtle);
  --mw-catlinks-bg: var(--bg-subtle);
  --mw-code-bg: var(--code-bg);
  --mw-font-sans: var(--font-segoe);
  --mw-font-serif: var(--font-segoe);
  --mw-font-mono: var(--font-mono);
}

/* Windows 10 Dark Theme Tokens (Deep Pure Black UWP Style) */
[data-theme="dark"] {
  --bg-window: #000000;
  --bg-surface: #171717;
  --bg-splitview: #1f1f1f;
  --bg-subtle: #2b2b2b;
  --bg-hover: #333333;
  --bg-active: #404040;

  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #9e9e9e;
  --text-subtle: #757575;

  --border: #2b2b2b;
  --border-subtle: #202020;
  --border-strong: #8a8a8a;

  --accent: #0078d7;
  --accent-hover: #298cd9;
  --accent-pressed: #52a5e2;
  --accent-soft: rgba(0, 120, 215, 0.16);
  --accent-contrast: #ffffff;

  --link: #4cc2ff;
  --link-hover: #7cd6ff;
  --link-visited: #b180ff;
  --link-red: #ff6868;
  --link-red-visited: #e81123;

  --star-color: #ffc83b;
  --star-muted: #858585;

  --code-bg: #121212;
  --code-border: #2b2b2b;

  --infobox-bg: #171717;
  --infobox-header-bg: #222222;
  --infobox-label-bg: #202020;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 3px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.7);

  /* Legacy/Compatibility aliases */
  --bg-page: var(--bg-window);
  --primary: var(--accent);
  --primary-hover: var(--accent-hover);
  --primary-soft: var(--accent-soft);
  --mw-bg: var(--bg-window);
  --mw-content-bg: var(--bg-surface);
  --mw-text: var(--text-primary);
  --mw-muted: var(--text-muted);
  --mw-link: var(--link);
  --mw-link-visited: var(--link-visited);
  --mw-link-red: var(--link-red);
  --mw-border: var(--border);
  --mw-border-light: var(--border-subtle);
  --mw-border-subtle: var(--border-subtle);
  --mw-accent: var(--accent);
  --mw-highlight: var(--accent-soft);
  --mw-infobox-bg: var(--infobox-bg);
  --mw-infobox-header: var(--infobox-header-bg);
  --mw-infobox-label: var(--infobox-label-bg);
  --mw-toc-bg: var(--bg-subtle);
  --mw-catlinks-bg: var(--bg-subtle);
  --mw-code-bg: var(--code-bg);
  --mw-font-sans: var(--font-segoe);
  --mw-font-serif: var(--font-segoe);
  --mw-font-mono: var(--font-mono);
}

/* ==========================================================================
   GLOBAL RESETS & MDL2 BASE
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   SEGOE MDL2 ASSETS ICONS
   ========================================================================== */

/* Cross-Platform MDL2 SVG Icons */
.mdl2-icon,
svg.mdl2-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  vertical-align: middle;
  flex-shrink: 0;
  color: inherit;
  fill: currentColor;
  overflow: visible;
  user-select: none;
}
.mdl2-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.item-main {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal .body li a .mdl2-icon {
  font-size: 15px;
  color: var(--text-muted);
  width: 16px;
  text-align: center;
  transition: color 0.1s ease;
}
.portal .body li a:hover .mdl2-icon,
.portal .body li a.current .mdl2-icon {
  color: var(--accent);
}

.vectorTabs li a {
  display: flex;
  align-items: center;
  gap: 6px;
}
.vectorTabs li a .mdl2-icon {
  font-size: 14px;
}

.search-input-icon.mdl2-icon {
  font-size: 13px;
  margin-right: 6px;
  color: var(--text-muted);
}
#searchButton .mdl2-icon {
  font-size: 14px;
}
.theme-toggle-btn .mdl2-icon {
  font-size: 16px;
}
#menu-btn .mdl2-icon {
  font-size: 18px;
}
#mobile-search-btn .mdl2-icon {
  font-size: 16px;
}
#ca-watch button .mdl2-icon {
  font-size: 15px;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-window);
  color: var(--text-primary);
  font-family: var(--font-segoe);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Windows 10 Flat Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-window);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 2px solid var(--bg-window);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.1s ease;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
a.new, a.missing {
  color: var(--link-red);
}

/* Accessibility jump link */
.mw-jump-link {
  position: absolute;
  top: -9999px;
  left: -9999px;
  background: var(--bg-surface);
  color: var(--accent);
  padding: 8px 16px;
  border: 2px solid var(--accent);
  z-index: 9999;
  font-weight: 600;
}
.mw-jump-link:focus {
  top: 10px;
  left: 10px;
}

#mw-page-base,
#mw-head-base {
  display: none !important;
}

/* ==========================================================================
   COMMANDBAR / TITLEBAR (#mw-head)
   ========================================================================== */

#mw-head {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--commandbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 16px 0 calc(var(--splitview-width) + 16px);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

#right-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}

/* Windows 10 Pivot Tabs Navigation */
.vectorTabs {
  display: flex;
  align-items: center;
  height: 100%;
}
.vectorTabs ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 4px;
}
.vectorTabs li {
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  align-items: center;
}
.vectorTabs li a,
.vectorTabs li button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 14px;
  font-family: var(--font-segoe);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.1s ease, border-color 0.1s ease, background-color 0.1s ease;
}
.vectorTabs li a:hover,
.vectorTabs li button:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  text-decoration: none;
}
.vectorTabs li.selected a {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 3px solid var(--accent);
  cursor: default;
  background: transparent;
}

/* Star / Favorite Button */
#ca-watch button {
  font-size: 16px;
  color: var(--star-muted);
  padding: 0 10px;
}
#ca-watch.watched button {
  color: var(--star-color);
}

/* AutoSuggestBox (Windows 10 Search Bar) */
#p-search {
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
}
#simpleSearch {
  display: flex;
  align-items: center;
  height: 32px;
  width: 230px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  padding: 0 0 0 10px;
  transition: border-color 0.1s ease, width 0.15s ease;
}
#simpleSearch:focus-within {
  width: 280px;
  border: 2px solid var(--accent);
  padding-left: 9px; /* Compensate for 2px border */
}
.search-input-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 6px;
}
#searchInput {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-segoe);
  font-size: 13.5px;
  color: var(--text-primary);
}
#searchInput::placeholder {
  color: var(--text-muted);
}
.search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 20px;
  padding: 0 4px;
  margin-right: 4px;
  font-family: var(--font-segoe);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  user-select: none;
}
#simpleSearch:focus-within .search-kbd {
  display: none;
}
#searchButton {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  height: 100%;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.1s ease, color 0.1s ease;
}
#searchButton:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Theme Toggle Button (Windows 10 AppBarButton Style) */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.1s ease, border-color 0.1s ease;
}
.theme-toggle-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}
html[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}
html[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: block;
}
html:not([data-theme="dark"]) .theme-toggle-btn .sun-icon {
  display: none;
}
html:not([data-theme="dark"]) .theme-toggle-btn .moon-icon {
  display: block;
}

/* Search Dropdown (Flyout) */
.mw-search-suggest {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  z-index: 250;
  max-height: 400px;
  overflow-y: auto;
}
.mw-search-item {
  display: block;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.1s ease;
}
.mw-search-item:hover,
.mw-search-item.active {
  background-color: var(--bg-hover);
  text-decoration: none;
}
.mw-search-title {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}
.mw-search-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.mw-search-footer {
  padding: 8px 12px;
  font-size: 12px;
  background: var(--bg-subtle);
  color: var(--accent);
  cursor: pointer;
  border-top: 1px solid var(--border);
  font-weight: 600;
}
.mw-search-footer:hover {
  background: var(--bg-hover);
}
.mw-search-none {
  padding: 14px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ==========================================================================
   SPLITVIEW NAVIGATION PANE (SIDEBAR)
   ========================================================================== */

#mw-navigation h2 {
  display: none;
}

/* Top App Brand / Header in SplitView */
#p-logo {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--splitview-width);
  height: var(--commandbar-height);
  z-index: 110;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--bg-splitview);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.mw-wiki-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.mw-wiki-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.logo-meta {
  display: flex;
  flex-direction: column;
}
.logo-name {
  font-family: var(--font-segoe);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.logo-desc {
  font-family: var(--font-segoe);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* SplitView Menu Pane */
#mw-panel {
  position: fixed;
  top: var(--commandbar-height);
  left: 0;
  bottom: 0;
  width: var(--splitview-width);
  background: var(--bg-splitview);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0 32px;
  z-index: 90;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.portal {
  margin-bottom: 18px;
}
.portal h3 {
  margin: 0 0 4px 0;
  padding: 0 16px;
  font-family: var(--font-segoe);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  user-select: none;
}
.portal .body ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.portal .body li {
  margin: 0;
}

/* Iconic Windows 10 MDL2 List Item with 4px Left Accent Indicator */
.portal .body li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.35;
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: background-color 0.1s ease, border-color 0.1s ease;
}
.portal .body li a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}
.portal .body li a.current {
  border-left: 4px solid var(--accent);
  background: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 600;
}

/* Category Badge in SplitView */
.portal .body li .cat-count,
.portal .body li small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  font-family: var(--font-segoe);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  line-height: 1;
  flex-shrink: 0;
}
.portal .body li a:hover .cat-count {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.portal .body li a.current .cat-count {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

#cats li {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-actions-portal,
#mw-header-mobile,
#mobile-search-bar,
.drawer-backdrop {
  display: none;
}

/* ==========================================================================
   MAIN CONTENT AREA (#content)
   ========================================================================== */

#content {
  margin-left: var(--splitview-width);
  min-height: calc(100vh - var(--commandbar-height));
  padding: 32px 48px 64px;
  background-color: var(--bg-window);
  transition: background-color 0.15s ease;
}

.mw-body-content {
  max-width: var(--content-max-width);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 36px 44px;
  box-shadow: var(--shadow-sm);
}

/* Windows 10 Header (Segoe UI Light 38px/34px) */
h1.firstHeading {
  font-family: var(--font-segoe);
  font-size: 38px;
  font-weight: 200; /* Iconic Segoe UI Light */
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Subtitles */
#siteSub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
#contentSub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Site Notice / InfoBar */
#siteNotice,
.siteNotice {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-left: 4px solid var(--accent);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-primary);
}

/* Article Headings (Segoe UI SemiLight) */
#article h2 {
  font-family: var(--font-segoe);
  font-size: 24px;
  font-weight: 350; /* Segoe UI SemiLight */
  color: var(--text-primary);
  margin: 36px 0 12px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
#article h3 {
  font-family: var(--font-segoe);
  font-size: 18px;
  font-weight: 600; /* Segoe UI SemiBold */
  color: var(--text-primary);
  margin: 24px 0 8px 0;
}
#article h4 {
  font-family: var(--font-segoe);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 18px 0 6px 0;
}

/* Edit Section Links */
.mw-editsection {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.5;
  transition: opacity 0.1s ease;
}
#article h2:hover .mw-editsection,
#article h3:hover .mw-editsection {
  opacity: 1;
}
.mw-editsection a {
  color: var(--accent);
}

/* Text & Media elements */
#article p {
  margin: 0.85em 0;
  line-height: 1.65;
}
#article hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
#article img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: inline-block;
  margin: 8px 0;
}

/* Lists */
#article ul,
#article ol {
  margin: 0.8em 0 0.8em 1.6em;
  padding: 0;
}
#article li {
  margin: 0.3em 0;
  line-height: 1.6;
}

/* Windows 10 Blockquotes */
#article blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--accent);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  font-style: normal;
}
#article blockquote p {
  margin: 0.3em 0;
}

/* Code & Pre (Consolas) */
#article code {
  background-color: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 2px 5px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--accent);
}
#article pre {
  background-color: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 14px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88em;
  line-height: 1.5;
  color: var(--text-primary);
}
#article pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

/* References / Footnotes */
sup.reference {
  font-size: 80%;
  font-weight: 600;
  vertical-align: super;
  padding: 0 2px;
}
sup.reference a {
  color: var(--accent);
}
ol.references {
  font-size: 13px;
  color: var(--text-muted);
  margin: 1.2em 0 1.5em 2em;
}
.mw-cite-backlink {
  user-select: none;
  margin-right: 4px;
}

/* ==========================================================================
   MDL2 INFOBOX (WINDOWS 10 DETAIL FLYOUT CARD)
   ========================================================================== */

table.infobox {
  float: right;
  clear: right;
  width: 320px;
  margin: 0 0 20px 24px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent); /* Iconic Windows 10 Accent Top Edge */
  background-color: var(--infobox-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.45;
}
table.infobox th.infobox-header {
  background-color: var(--infobox-header-bg);
  color: var(--text-primary);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-segoe);
}
table.infobox .infobox-label,
table.infobox th.infobox-label,
table.infobox td.infobox-label {
  text-align: left;
  vertical-align: top;
  background-color: var(--infobox-label-bg);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12.5px;
  width: 38%;
  white-space: nowrap !important;
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
}
table.infobox .infobox-data,
table.infobox td.infobox-data,
table.infobox th.infobox-data {
  vertical-align: top;
  text-align: left;
  padding: 8px 12px;
  color: var(--text-primary);
  border-top: 1px solid var(--border-subtle);
}
table.infobox img {
  border: 1px solid var(--border);
  margin: 4px 0;
  max-width: 100%;
}

/* ==========================================================================
   TABLE OF CONTENTS (TOC) - WINDOWS 10 EXPANDER
   ========================================================================== */

#toc-wrapper {
  display: contents;
}
.toc {
  border: 1px solid var(--border);
  background-color: var(--bg-subtle);
  padding: 12px 16px;
  font-size: 13.5px;
  margin: 1.2em 0 1.5em 0;
  max-width: 440px;
}
.toctitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  user-select: none;
}
.toctitle strong,
.toctitle h2,
#article .toctitle h2 {
  font-family: var(--font-segoe) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline !important;
  color: var(--text-primary) !important;
}
.toctogglespan {
  font-size: 12px;
}
.toctogglelink {
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: background-color 0.1s ease;
}
.toctogglelink:hover {
  background: var(--bg-hover);
  text-decoration: none;
}
.toc ul {
  list-style: none;
  margin: 6px 0 0 0;
  padding-left: 0;
}
.toc ul ul {
  margin-left: 16px;
}
.toc li {
  margin: 4px 0;
  line-height: 1.4;
}
.tocnumber {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 12px;
  padding-right: 6px;
}
.toctext {
  color: var(--text-primary);
  transition: color 0.1s ease;
}
.toctext:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ==========================================================================
   WINDOWS 10 DATAGRID (Wikitables & History)
   ========================================================================== */

table.wikitable {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  margin: 18px 0;
  font-size: 13.5px;
  background-color: var(--bg-surface);
}
table.wikitable th,
table.wikitable td {
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
}
table.wikitable th {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
table.wikitable tr:hover td {
  background-color: var(--bg-hover);
}

.history-table code {
  background: var(--bg-subtle);
  padding: 2px 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   CATEGORIES BOX (#catlinks)
   ========================================================================== */

.catlinks {
  border: 1px solid var(--border);
  background-color: var(--bg-subtle);
  padding: 10px 14px;
  margin-top: 32px;
  clear: both;
  font-size: 13px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.catlinks[hidden],
.catlinks:empty,
.catlinks:not(:has(li)) {
  display: none !important;
}
.catlinks strong {
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 4px;
}
.catlinks ul {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.catlinks li {
  display: inline;
}
.catlinks li::after {
  content: none;
}
.catlinks a {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.1s ease;
}
.catlinks a:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  text-decoration: none;
}

/* ==========================================================================
   HOVERCARD (MDL2 Tooltip / Flyout Preview)
   ========================================================================== */

.mwe-popups {
  position: absolute;
  width: 310px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  padding: 14px 16px;
  pointer-events: none;
  font-size: 13px;
  line-height: 1.45;
  transition: opacity 0.1s ease;
}
.mwe-popups[hidden] {
  display: none;
}
.mwe-popups-title {
  display: block;
  font-family: var(--font-segoe);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.mwe-popups-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.mwe-popups-category:empty {
  display: none;
}
.mwe-popups-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12.5px;
}

/* ==========================================================================
   MODALS (Windows 10 ContentDialog)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-backdrop[hidden] {
  display: none;
}
.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  width: 640px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.modal-header h3 {
  margin: 0;
  font-family: var(--font-segoe);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-primary);
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
}
.modal-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.modal-body {
  padding: 18px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.55;
}
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border: 2px solid transparent;
  background: var(--bg-subtle);
  font-family: var(--font-segoe);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.1s ease;
}
.modal-btn:hover {
  background: var(--bg-hover);
  text-decoration: none;
}
.modal-btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.modal-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-contrast);
}

#raw-source-area {
  width: 100%;
  min-height: 380px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  padding: 12px;
  border: 1px solid var(--border-strong);
  background: var(--code-bg);
  color: var(--text-primary);
  resize: vertical;
  display: block;
}

/* ==========================================================================
   TOAST NOTIFICATION (Action Center Notification Banner)
   ========================================================================== */

.wiki-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border-left: 4px solid var(--accent);
  border-top: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
}
.wiki-toast[hidden] {
  display: none;
}

/* Alphabetical Page List */
.mw-page-list {
  columns: 2 240px;
  column-gap: 20px;
  list-style: none;
  margin: 1em 0;
  padding: 0;
}
.mw-page-list li {
  margin: 0.35em 0;
  padding-left: 12px;
  position: relative;
}
.mw-page-list li::before {
  content: "■";
  font-size: 8px;
  position: absolute;
  left: 0;
  top: 4px;
  color: var(--accent);
}

/* ==========================================================================
   FOOTER (#footer)
   ========================================================================== */

#footer {
  margin-left: var(--splitview-width);
  padding: 28px 48px;
  background-color: var(--bg-window);
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
#footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#footer-info li {
  margin-bottom: 0.4em;
  line-height: 1.5;
}
#footer-places {
  margin: 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
#footer-places a {
  color: var(--text-muted);
}
#footer-places a:hover {
  color: var(--accent);
}
#footer-icons {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.wiki-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 2px 8px;
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.2;
}
.wiki-badge .badge-top {
  font-size: 8px;
  text-transform: uppercase;
}
.wiki-badge .badge-bottom {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 10px;
}
.cc-badge .badge-bottom {
  color: var(--accent);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================================================== */

@media (max-width: 900px) {
  #mw-head {
    display: none !important;
  }
  #p-logo {
    display: none !important;
  }

  /* Mobile Header Bar */
  #mw-header-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  #menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
  }
  .mobile-logo:hover {
    text-decoration: none;
  }
  .mobile-logo img {
    width: 24px;
    height: 24px;
  }
  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  #mobile-search-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile Search Bar Dropdown */
  #mobile-search-bar {
    display: block;
    position: sticky;
    top: 48px;
    z-index: 99;
    background: var(--bg-surface);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
  }
  #mobile-search-bar[hidden] {
    display: none !important;
  }
  #mobileSearchInput {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
  }
  #mobileSearchInput:focus {
    border: 2px solid var(--accent);
  }
  #mobileResults {
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    width: auto;
  }

  /* Mobile Drawer Backdrop */
  .drawer-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 140;
  }
  .drawer-backdrop[hidden] {
    display: none;
  }

  /* Mobile Navigation Drawer (#mw-panel) */
  #mw-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-splitview);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.2s cubic-bezier(0.1, 0.9, 0.2, 1);
    z-index: 150;
    padding: 16px 0;
    box-shadow: var(--shadow-lg);
  }
  body.menu-open #mw-panel {
    transform: translateX(0);
  }
  .mobile-actions-portal {
    display: block;
  }

  /* Content & Footer adjustments */
  #content {
    margin-left: 0;
    padding: 12px 10px 32px;
  }
  .mw-body-content {
    padding: 20px 14px;
    border: none;
    box-shadow: none;
  }
  h1.firstHeading {
    font-size: 28px;
  }
  #footer {
    margin-left: 0;
    padding: 20px 14px;
  }

  /* Infobox full width on mobile */
  table.infobox {
    float: none;
    width: 100%;
    margin: 16px 0;
  }

  .mw-page-list {
    columns: 1;
  }
}

/* ==========================================================================
   PRINT STYLESHEET
   ========================================================================== */

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }
  .noprint,
  #mw-head,
  #mw-navigation,
  #mw-header-mobile,
  .toctogglelink,
  .mw-editsection,
  #p-search,
  #footer-places,
  #footer-icons,
  .modal-backdrop,
  .wiki-toast,
  .mwe-popups {
    display: none !important;
  }
  #content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    background: none !important;
  }
  .mw-body-content {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  #footer {
    margin: 2em 0 0 0 !important;
    padding: 1em 0 !important;
    border-top: 1px solid #ccc !important;
    background: none !important;
  }
  h1.firstHeading {
    font-size: 24pt;
    color: #000000 !important;
  }
  a {
    color: #000000 !important;
    text-decoration: underline;
  }
}
