/* FM Online: opaque settings, premium palettes and AOL classics. September 2026.
 * Loaded after fm-glass.css to isolate the legacy cascade without rewriting it.
 * Palette references: nordtheme.com, catppuccin.com/palette, draculatheme.com/spec.
 */
body {
  --fm-menu-bg: var(--bg, #181c22);
  --fm-menu-sidebar: color-mix(in srgb, var(--bg, #181c22) 92%, #000);
  --fm-menu-card: color-mix(in srgb, var(--bg, #181c22) 89%, #fff);
  --fm-menu-field: color-mix(in srgb, var(--bg, #181c22) 94%, #000);
  --fm-menu-selected: color-mix(in srgb, var(--bg, #181c22) 80%, #fff);
  --fm-menu-border: color-mix(in srgb, var(--bg, #181c22) 67%, #fff);
  --fm-menu-text: #f0f4fb;
  --fm-menu-muted: #bdc8d8;
  --fm-menu-action: #b7d7ff;
  --fm-menu-on-action: #14243a;
  --fm-menu-scheme: dark;
}
body:is(.theme-porcelain,.theme-linen-cream,.theme-arctic-frost,.theme-pearl-glass,.theme-sandstone,.theme-bubblegum,.theme-sakura-veil,.theme-tahoe-light) {
  --fm-menu-sidebar: color-mix(in srgb, var(--bg) 94%, #000);
  --fm-menu-card: #fff;
  --fm-menu-field: #fff;
  --fm-menu-selected: color-mix(in srgb, var(--bg) 93%, #000);
  --fm-menu-border: #a9b2c2;
  --fm-menu-text: #243148;
  --fm-menu-muted: #536179;
  --fm-menu-action: #245ba8;
  --fm-menu-on-action: #fff;
  --fm-menu-scheme: light;
}
body.theme-nordic-slate {
  color-scheme: dark;
  --bg:#2e3440; --glass:#2e3440; --panel:#3b4252; --panel-strong:#434c5e; --title:#272d38;
  --text:#eceff4; --muted:#d8dee9; --stroke:#596478; --accent:#88c0d0; --theme-accent:#88c0d0;
  --theme-accent-soft:#434c5e; --theme-accent-border:#596478;
  --chat-shell:#2e3440; --list-surface:#3b4252; --list-text:#eceff4; --list-muted:#d8dee9;
  --theme-gradient:linear-gradient(135deg,#171e2c,#2e3440,#4c6978);
  --fm-menu-bg:#2e3440; --fm-menu-sidebar:#272d38; --fm-menu-card:#3b4252; --fm-menu-field:#242a35;
  --fm-menu-selected:#434c5e; --fm-menu-text:#eceff4; --fm-menu-muted:#d8dee9; --fm-menu-border:#596478;
  --fm-menu-action:#88c0d0; --fm-menu-on-action:#202732; --fm-menu-scheme:dark;
  --fm-title-bg:#272d38; --fm-title-text:#eceff4;
}
body.theme-mocha-lounge {
  color-scheme: dark;
  --bg:#1e1e2e; --glass:#1e1e2e; --panel:#313244; --panel-strong:#45475a; --title:#181825;
  --text:#cdd6f4; --muted:#bac2de; --stroke:#585b70; --accent:#cba6f7; --theme-accent:#cba6f7;
  --theme-accent-soft:#45475a; --theme-accent-border:#585b70;
  --chat-shell:#1e1e2e; --list-surface:#313244; --list-text:#cdd6f4; --list-muted:#bac2de;
  --theme-gradient:linear-gradient(135deg,#11111b,#28243c,#59405d);
  --fm-menu-bg:#1e1e2e; --fm-menu-sidebar:#181825; --fm-menu-card:#313244; --fm-menu-field:#181825;
  --fm-menu-selected:#45475a; --fm-menu-text:#cdd6f4; --fm-menu-muted:#bac2de; --fm-menu-border:#585b70;
  --fm-menu-action:#cba6f7; --fm-menu-on-action:#1e1e2e; --fm-menu-scheme:dark;
  --fm-title-bg:#181825; --fm-title-text:#cdd6f4;
}
body.theme-royal-violet {
  color-scheme: dark;
  --bg:#282a36; --glass:#282a36; --panel:#343746; --panel-strong:#44475a; --title:#21222c;
  --text:#f8f8f2; --muted:#d2d4e1; --stroke:#656982; --accent:#bd93f9; --theme-accent:#bd93f9;
  --theme-accent-soft:#44475a; --theme-accent-border:#656982;
  --chat-shell:#282a36; --list-surface:#343746; --list-text:#f8f8f2; --list-muted:#d2d4e1;
  --theme-gradient:linear-gradient(135deg,#171720,#342b4b,#654168);
  --fm-menu-bg:#282a36; --fm-menu-sidebar:#21222c; --fm-menu-card:#343746; --fm-menu-field:#21222c;
  --fm-menu-selected:#44475a; --fm-menu-text:#f8f8f2; --fm-menu-muted:#d2d4e1; --fm-menu-border:#656982;
  --fm-menu-action:#bd93f9; --fm-menu-on-action:#21222c; --fm-menu-scheme:dark;
  --fm-title-bg:#21222c; --fm-title-text:#f8f8f2;
}
body.theme-pearl-latte {
  color-scheme: light;
  --bg:#eff1f5; --glass:#eff1f5; --panel:#ffffff; --panel-strong:#dce0e8; --title:#e6e9ef;
  --text:#4c4f69; --muted:#5c5f77; --stroke:#aeb5c5; --accent:#8839ef; --theme-accent:#8839ef;
  --theme-accent-soft:#dce0e8; --theme-accent-border:#aeb5c5;
  --chat-shell:#eff1f5; --list-surface:#ffffff; --list-text:#4c4f69; --list-muted:#5c5f77;
  --theme-gradient:linear-gradient(135deg,#d6dbea,#edf0f5,#ddd0eb);
  --fm-menu-bg:#eff1f5; --fm-menu-sidebar:#e6e9ef; --fm-menu-card:#ffffff; --fm-menu-field:#f8f9fc;
  --fm-menu-selected:#dce0e8; --fm-menu-text:#4c4f69; --fm-menu-muted:#5c5f77; --fm-menu-border:#aeb5c5;
  --fm-menu-action:#8839ef; --fm-menu-on-action:#ffffff; --fm-menu-scheme:light;
  --fm-title-bg:#e6e9ef; --fm-title-text:#4c4f69;
}
body.theme-aol-classic {
  color-scheme: light;
  --bg:#f1f4fa; --glass:#f1f4fa; --panel:#ffffff; --panel-strong:#d6e5fb; --title:#0047ab;
  --text:#142c50; --muted:#405773; --stroke:#9cacc3; --accent:#0047ab; --theme-accent:#0047ab;
  --theme-accent-soft:#d6e5fb; --theme-accent-border:#9cacc3;
  --chat-shell:#f1f4fa; --list-surface:#ffffff; --list-text:#142c50; --list-muted:#405773;
  --theme-gradient:linear-gradient(135deg,#00337a,#0053b7,#1687d4);
  --fm-menu-bg:#f1f4fa; --fm-menu-sidebar:#e0e7f2; --fm-menu-card:#ffffff; --fm-menu-field:#f8faff;
  --fm-menu-selected:#d6e5fb; --fm-menu-text:#142c50; --fm-menu-muted:#405773; --fm-menu-border:#9cacc3;
  --fm-menu-action:#0047ab; --fm-menu-on-action:#ffffff; --fm-menu-scheme:light;
  --fm-title-bg:#0047ab; --fm-title-text:#ffffff;
}
body.theme-aol-midnight {
  color-scheme: dark;
  --bg:#0b1730; --glass:#0b1730; --panel:#132744; --panel-strong:#1b365b; --title:#123d76;
  --text:#eef5ff; --muted:#b9cde7; --stroke:#426187; --accent:#80c4ff; --theme-accent:#80c4ff;
  --theme-accent-soft:#1b365b; --theme-accent-border:#426187;
  --chat-shell:#0b1730; --list-surface:#132744; --list-text:#eef5ff; --list-muted:#b9cde7;
  --theme-gradient:linear-gradient(135deg,#040b18,#0a2147,#174d83);
  --fm-menu-bg:#0b1730; --fm-menu-sidebar:#081225; --fm-menu-card:#132744; --fm-menu-field:#081225;
  --fm-menu-selected:#1b365b; --fm-menu-text:#eef5ff; --fm-menu-muted:#b9cde7; --fm-menu-border:#426187;
  --fm-menu-action:#80c4ff; --fm-menu-on-action:#081225; --fm-menu-scheme:dark;
  --fm-title-bg:#123d76; --fm-title-text:#ffffff;
}
body.theme-aim-gold {
  color-scheme: light;
  --bg:#fff9e9; --glass:#fff9e9; --panel:#fffefa; --panel-strong:#f9e6a3; --title:#ffcb05;
  --text:#2f2b21; --muted:#635841; --stroke:#b8a77f; --accent:#765500; --theme-accent:#765500;
  --theme-accent-soft:#f9e6a3; --theme-accent-border:#b8a77f;
  --chat-shell:#fff9e9; --list-surface:#fffefa; --list-text:#2f2b21; --list-muted:#635841;
  --theme-gradient:linear-gradient(135deg,#1a2338,#34415b,#776335);
  --fm-menu-bg:#fff9e9; --fm-menu-sidebar:#f0e6cc; --fm-menu-card:#fffefa; --fm-menu-field:#fffcf2;
  --fm-menu-selected:#f9e6a3; --fm-menu-text:#2f2b21; --fm-menu-muted:#635841; --fm-menu-border:#b8a77f;
  --fm-menu-action:#ffcb05; --fm-menu-on-action:#292417; --fm-menu-scheme:light;
  --fm-title-bg:#ffcb05; --fm-title-text:#292417;
}

/* An opaque outer surface is intentional: backdrop blur alone does not make
   settings legible over detailed wallpapers or other windows. */
body #win-control.fm-tahoe-settings,
body :is(#win-appearance,#win-sounds,#win-wallpapers,#win-admin,#win-debug),
body :is(.fm-context-menu,.fm-dropdown,.fm-popover,.buddy-context-menu,.format-popover,
  .profile-dropdown,.attachment-menu,.fm-dashboard-prefs-card,.fm-room-icon-modal,
  .pc2-whos-popover,.pb-vs-dialog) {
  background:var(--fm-menu-bg) !important;
  color:var(--fm-menu-text) !important;
  border:1px solid var(--fm-menu-border) !important;
  box-shadow:0 24px 72px #0005,0 4px 16px #0003 !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
  opacity:1 !important;
  color-scheme:var(--fm-menu-scheme);
  --text:var(--fm-menu-text);
  --muted:var(--fm-menu-muted);
}
body #win-control.fm-tahoe-settings::before,
body #win-control.fm-tahoe-settings::after { display:none !important; }
body #win-control.fm-tahoe-settings > .titlebar {
  background:var(--fm-title-bg,var(--fm-menu-sidebar)) !important;
  color:var(--fm-title-text,var(--fm-menu-text)) !important;
  border-bottom:1px solid var(--fm-menu-border) !important;
  box-shadow:none !important;
  opacity:1 !important;
}
body #win-control.fm-tahoe-settings > .titlebar > div:first-child {
  color:inherit !important; opacity:1 !important; font-weight:650 !important;
}
body #win-control.fm-tahoe-settings > .window-body {
  background:var(--fm-menu-bg) !important;
  color:var(--fm-menu-text) !important;
  min-height:0;
}
body #win-control.fm-tahoe-settings .ts-sidebar {
  background:var(--fm-menu-sidebar) !important;
  border-right:1px solid var(--fm-menu-border) !important;
  color:var(--fm-menu-text) !important;
}
body #win-control.fm-tahoe-settings .ts-main {
  background:var(--fm-menu-bg) !important;
  min-width:0; min-height:0; scrollbar-gutter:stable;
}
body #win-control.fm-tahoe-settings :is(.ts-card,.ts-hero) {
  background:var(--fm-menu-card) !important;
  color:var(--fm-menu-text) !important;
  border:1px solid var(--fm-menu-border) !important;
  box-shadow:none !important;
}
body #win-control.fm-tahoe-settings .ts-hero {
  align-items:flex-start; text-align:left; padding:24px; gap:10px;
}
body #win-control.fm-tahoe-settings .ts-hero-icon { width:44px; height:44px; border-radius:12px; }
body #win-control.fm-tahoe-settings .ts-hero-icon svg { width:24px; height:24px; }
body #win-control.fm-tahoe-settings .ts-hero-title { color:var(--fm-menu-text) !important; }
body #win-control.fm-tahoe-settings :is(.ts-hero-desc,.ts-section-label,.ts-row-value,.ts-row-chevron,.cc-wp-meta,.cc-help) {
  color:var(--fm-menu-muted) !important; opacity:1 !important;
}
body #win-control.fm-tahoe-settings :is(.ts-section-title,.ts-row-label,.ts-nav-item) {
  color:var(--fm-menu-text) !important; opacity:1 !important;
}
body #win-control.fm-tahoe-settings .ts-nav-item { border:1px solid transparent; }
body #win-control.fm-tahoe-settings .ts-nav-item.active {
  background:var(--fm-menu-selected) !important;
  color:var(--fm-menu-text) !important;
  border-color:var(--fm-menu-border);
  box-shadow:inset 3px 0 var(--accent) !important;
}
body #win-control.fm-tahoe-settings :is(.ts-nav-item:hover,.ts-row:hover,.cc-wp-row:hover) {
  background:var(--fm-menu-selected) !important;
}
body #win-control.fm-tahoe-settings .ts-row { border-top-color:var(--fm-menu-border) !important; }
body #win-control.fm-tahoe-settings .ts-search {
  background:var(--fm-menu-field) !important; border:1px solid var(--fm-menu-border) !important;
}
body #win-control.fm-tahoe-settings :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea) {
  color:var(--fm-menu-text) !important;
  background:var(--fm-menu-field) !important;
  border-color:var(--fm-menu-border) !important;
  color-scheme:var(--fm-menu-scheme);
}
body #win-control.fm-tahoe-settings option {
  color:var(--fm-menu-text); background:var(--fm-menu-field);
}
body #win-control.fm-tahoe-settings ::placeholder { color:var(--fm-menu-muted) !important; opacity:1; }
body #win-control.fm-tahoe-settings :is(button,input,select,textarea):focus-visible {
  outline:2px solid var(--accent) !important; outline-offset:3px;
}
body #win-control.fm-tahoe-settings .theme-grid button {
  background:var(--fm-menu-card) !important;
  color:var(--fm-menu-text) !important;
  border:1px solid var(--fm-menu-border) !important;
}
body #win-control.fm-tahoe-settings .theme-grid button.active-theme {
  background:var(--fm-menu-selected) !important;
  color:var(--fm-menu-text) !important;
  border-color:var(--accent) !important;
  box-shadow:0 0 0 1px var(--accent) !important;
}
body #win-control.fm-tahoe-settings button.primary {
  background:var(--fm-menu-action) !important; color:var(--fm-menu-on-action) !important;
}

/* Small window previews make palettes understandable before applying them. */
body #win-control .fm-theme-collection { margin-bottom:8px; }
body #win-control .fm-theme-collection-head {
  display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin:3px 0 14px;
}
body #win-control .fm-theme-collection-head .ts-section-title { margin:0 0 5px; font-size:16px; font-weight:700; }
body #win-control .fm-theme-collection-head p { margin:0; font-size:12px; line-height:1.5; color:var(--fm-menu-muted); }
body #win-control .fm-theme-edition { color:var(--fm-menu-muted); font-size:10px; letter-spacing:.12em; white-space:nowrap; padding-top:4px; }
body #win-control.fm-tahoe-settings .theme-grid.fm-theme-showcase {
  grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:12px !important;
}
body #win-control.fm-tahoe-settings .theme-grid .fm-theme-card {
  position:relative; align-items:stretch !important; justify-content:flex-start !important;
  padding:12px !important; gap:8px !important; border-radius:12px !important;
  min-width:0; text-align:left !important; transition:border-color .15s,box-shadow .15s;
}
body #win-control.fm-tahoe-settings .theme-grid .fm-theme-card:hover {
  border-color:var(--accent) !important; transform:none !important;
}
body #win-control.fm-tahoe-settings .theme-grid .fm-theme-card > .fm-theme-preview {
  height:78px; width:100%; border-radius:7px; background:var(--preview-bg) !important;
  border:1px solid color-mix(in srgb,var(--preview-line) 45%,transparent);
  display:flex !important; flex-direction:column; overflow:hidden;
}
body #win-control .fm-theme-preview-top {
  display:flex; align-items:center; gap:4px; height:17px; flex:0 0 17px; padding:0 7px;
  background:var(--preview-accent);
}
body #win-control .fm-theme-preview-top b { width:4px; height:4px; border-radius:50%; background:#fff9; }
body #win-control .fm-theme-preview-body { display:grid; grid-template-columns:28% 1fr; flex:1; min-height:0; }
body #win-control .fm-theme-preview-nav { background:var(--preview-sidebar); border-right:1px solid color-mix(in srgb,var(--preview-line) 25%,transparent); }
body #win-control .fm-theme-preview-content { display:flex; flex-direction:column; gap:5px; padding:10px; background:var(--preview-bg); }
body #win-control .fm-theme-preview-content b { display:block; width:76%; height:4px; border-radius:2px; background:var(--preview-line); opacity:.8; }
body #win-control .fm-theme-preview-content b:nth-child(2) { width:52%; background:var(--preview-secondary); }
body #win-control .fm-theme-preview-content b:nth-child(3) { width:92%; height:12px; background:var(--preview-card); border:1px solid color-mix(in srgb,var(--preview-line) 22%,transparent); }
body #win-control.fm-tahoe-settings .theme-grid .fm-theme-card > .fm-theme-card-name {
  font-size:13px !important; font-weight:700 !important; text-align:left !important; padding-right:20px;
}
body #win-control.fm-tahoe-settings .theme-grid .fm-theme-card > .fm-theme-card-desc {
  font-size:11px !important; line-height:1.45 !important; white-space:normal; text-align:left !important;
  color:var(--fm-menu-muted) !important;
}
body #win-control.fm-tahoe-settings .theme-grid .fm-theme-card > .fm-theme-card-check {
  display:none !important; position:absolute; right:12px; bottom:39px; color:var(--accent); font-size:16px !important;
}
body #win-control.fm-tahoe-settings .theme-grid .fm-theme-card.active-theme > .fm-theme-card-check { display:block !important; }

/* New themes apply their palette throughout the client as well as settings. */
body.fm-premium-theme {
  font-family:"Segoe UI",system-ui,-apple-system,sans-serif;
  color:var(--text); background-color:var(--bg);
}
body.fm-premium-theme:not(.has-wallpaper) { background-image:var(--theme-gradient) !important; }
body.fm-premium-theme .fm-window {
  background:var(--glass) !important; color:var(--text) !important;
  border:1px solid var(--stroke) !important; border-radius:14px;
  box-shadow:0 18px 60px #0005,0 2px 8px #0002 !important;
  backdrop-filter:none !important; -webkit-backdrop-filter:none !important;
}
body.fm-premium-theme .fm-window > .titlebar {
  background:var(--fm-title-bg) !important; color:var(--fm-title-text) !important;
  border-bottom:1px solid var(--stroke) !important; box-shadow:none !important;
}
body.fm-premium-theme .fm-window > .titlebar > div:first-child { color:inherit !important; opacity:1 !important; }
/* Window controls inherit the shared traffic-light treatment. */
body.fm-premium-theme .fm-window .window-body { color:var(--text); }
body.fm-premium-theme :is(.fm-room-chat-log,.im-log,.fm-im-log,.fm-chat-log,.chat-log,.fmp-main,.fmp-sidebar,.buddy-body,.fm-rooms-sidebar,.fm-rooms-people-panel) {
  background:var(--fm-menu-card) !important; color:var(--text) !important;
}
body.fm-premium-theme :is(input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=color]),select,textarea) {
  background:var(--fm-menu-field); color:var(--text); border-color:var(--stroke);
}
body.fm-premium-theme :is(.primary,.btn-primary) { background:var(--fm-menu-action) !important; color:var(--fm-menu-on-action) !important; }
body.fm-premium-theme :is(.titlebar,.toolbar,.fm-toolbar) button { color:inherit; }
body:is(.theme-aol-classic,.theme-aol-midnight,.theme-aim-gold) .fm-window { border-radius:10px; }
body:is(.theme-aol-classic,.theme-aol-midnight,.theme-aim-gold) .fm-window > .titlebar { font-weight:700; }

@media (max-width:800px) {
  body #win-control.fm-tahoe-settings { min-width:0 !important; max-width:calc(100vw - 24px) !important; }
  body #win-control.fm-tahoe-settings > .window-body { grid-template-columns:170px minmax(0,1fr); }
  body #win-control.fm-tahoe-settings .ts-main { padding:16px; }
  body #win-control.fm-tahoe-settings .ts-hero { padding:18px; }
  body #win-control .fm-theme-edition { display:none; }
}
@media (max-width:560px) {
  body #win-control.fm-tahoe-settings > .window-body { grid-template-columns:125px minmax(0,1fr); }
  body #win-control.fm-tahoe-settings .ts-sidebar { padding:10px 5px; }
  body #win-control.fm-tahoe-settings .ts-nav-item { font-size:11px; gap:5px; }
  body #win-control.fm-tahoe-settings .ts-main { padding:12px; }
  body #win-control.fm-tahoe-settings .theme-grid.fm-theme-showcase { grid-template-columns:minmax(0,1fr) !important; }
}
@media (prefers-reduced-motion:reduce) {
  body #win-control.fm-tahoe-settings .theme-grid button { transition:none !important; }
}
