/* =====================================================================
   FORMALITY IPS5 — index component layer (ips5.css)
   Loads AFTER global.css. Tokens namespaced --ipsx-* to avoid collisions.
   Styles only the new ips-* classes emitted by the IPS5 index templates.
   ===================================================================== */
:root{
  --ipsx-electric-blue:#3b82f6;
  --ipsx-electric-glow:rgba(59,130,246,.45);
  --ipsx-electric-subtle:rgba(59,130,246,.15);
  --ipsx-steel-blue:#4d9fff;
  --ipsx-deep-blue:#2563eb;
  --ipsx-surface-dark:#081120;
  --ipsx-text-primary:#e2eaf3;
  --ipsx-text-muted:#8b9eb3;
  --ipsx-card-bg:rgba(13,27,42,.98);
  --ipsx-card-header:rgba(4,12,22,.55);
  --ipsx-border:rgba(94,150,255,.13);
  --ipsx-border-soft:rgba(94,150,255,.07);
  --ipsx-row-hover:rgba(59,130,246,.05);
  --ipsx-shadow:0 1px 3px rgba(0,0,0,.5);
  --ipsx-shadow-raise:0 10px 30px rgba(0,0,0,.45);
  --ipsx-radius:10px;
  --ipsx-radius-sm:7px;
  --ipsx-green:#3fb96a;
}
[class^="ips-"], [class*=" ips-"], .ips-box *{box-sizing:border-box}
.ips-box{background:var(--ipsx-card-bg);border:1px solid var(--ipsx-border);border-radius:var(--ipsx-radius);box-shadow:var(--ipsx-shadow);margin-bottom:20px;overflow:hidden}
.ips-box-head{display:flex;align-items:center;gap:12px;padding:14px 20px;background:var(--ipsx-card-header);border-bottom:1px solid var(--ipsx-border);position:relative}
.ips-box-head::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:linear-gradient(90deg,rgba(59,130,246,.85),rgba(59,130,246,.25) 45%,rgba(59,130,246,0) 85%)}
.ips-box-head .ips-caret{color:var(--ipsx-text-muted);font-size:12px;transition:transform .15s ease;cursor:pointer;text-decoration:none;line-height:1}
.ips-box-head .expcolimage{display:flex;align-items:center}
.ips-box-head .expcolimage img.expander{width:14px;height:14px;opacity:.55;cursor:pointer;transition:opacity .15s ease}
.ips-box-head .expcolimage img.expander:hover{opacity:1}
.ips-box-head h2{margin:0;font-size:14px;font-weight:700;text-transform:uppercase;letter-spacing:1px;color:#fff}
.ips-box-head h2 a{color:#fff}
.ips-box-head .ips-head-right{margin-left:auto;font-size:11px;color:var(--ipsx-text-muted);text-transform:uppercase;letter-spacing:.5px}
.ips-rowlabels{display:flex;align-items:center;padding:9px 20px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.6px;color:var(--ipsx-text-muted);background:rgba(0,0,0,.18);border-bottom:1px solid var(--ipsx-border-soft)}
.ips-rowlabels .l-forum{flex:1}
.ips-rowlabels .l-stats{width:150px;text-align:center}
.ips-rowlabels .l-last{width:250px}
.ips-frow{display:flex;align-items:center;gap:16px;padding:16px 20px;border-bottom:1px solid var(--ipsx-border-soft);border-left:3px solid transparent;transition:background .15s ease,border-color .15s ease}
.ips-frow:last-child{border-bottom:none}
.ips-frow:hover{background:var(--ipsx-row-hover);border-left-color:var(--ipsx-electric-blue)}
.ips-ficon{flex-shrink:0;width:46px;height:46px;border-radius:12px;display:grid;place-items:center;color:#fff;position:relative;background:linear-gradient(135deg,rgba(59,130,246,.22),rgba(37,99,235,.12));border:1px solid rgba(94,150,255,.22)}
.ips-ficon svg{width:24px;height:24px;display:block}
.ips-ficon svg path{fill:var(--ipsx-steel-blue)}
.ips-frow.forum_off .ips-ficon{background:rgba(255,255,255,.03);border-color:var(--ipsx-border-soft)}
.ips-frow.forum_off .ips-ficon svg path{fill:var(--ipsx-text-muted)}
.ips-ficon .ips-unread{position:absolute;top:-4px;right:-4px;width:14px;height:14px;border-radius:50%;background:var(--ipsx-electric-blue);border:2px solid #0c1a2c;box-shadow:0 0 8px var(--ipsx-electric-glow)}
.ips-frow.forum_off .ips-ficon .ips-unread{display:none}
.ips-ficon .forum_status{position:absolute;inset:0;cursor:pointer;background:none;text-indent:-9999px;overflow:hidden}
.ips-fmain{flex:1;min-width:0}
.ips-fmain .ips-ftitle{font-size:16px;font-weight:600;display:block;margin-bottom:3px}
.ips-fmain .ips-ftitle a{color:#fff}
.ips-fmain .ips-ftitle a:hover{color:var(--ipsx-electric-blue)}
.ips-frow.forum_off .ips-fmain .ips-ftitle a{color:var(--ipsx-text-primary)}
.ips-fmain .ips-fdesc{font-size:13px;color:var(--ipsx-text-muted);line-height:1.45}
.ips-fmain .ips-fviewers{font-size:11px;color:var(--ipsx-steel-blue);margin-left:6px}
.ips-fmain .ips-modlist{font-size:11.5px;color:var(--ipsx-text-muted);margin-top:4px}
.ips-fmain .ips-modlist a{color:var(--ipsx-steel-blue)}
.ips-subs{margin-top:8px;display:flex;flex-wrap:wrap;gap:6px}
.ips-subs a{font-size:11.5px;font-weight:600;padding:3px 9px;border-radius:999px;color:var(--ipsx-steel-blue);background:var(--ipsx-electric-subtle);border:1px solid rgba(59,130,246,.25)}
.ips-subs a:hover{color:#fff;border-color:var(--ipsx-electric-blue)}
.ips-fstats{width:150px;flex-shrink:0;text-align:center;color:var(--ipsx-text-muted);font-size:13px;line-height:1.4}
.ips-fstats b{display:block;color:var(--ipsx-text-primary);font-size:17px;font-weight:700}
.ips-fstats .ips-fstats-lab{font-size:11px;text-transform:uppercase;letter-spacing:.5px}
.ips-fstats .ips-fstats-posts{margin-top:3px;font-size:12px;color:var(--ipsx-text-muted)}
.ips-flast{width:250px;flex-shrink:0;display:flex;align-items:center;gap:11px}
.ips-flast img.ips-lastav{width:38px;height:38px;border-radius:50%;object-fit:cover;flex-shrink:0;border:1px solid var(--ipsx-border)}
.ips-flast .ips-lastmeta{min-width:0;font-size:12.5px;color:var(--ipsx-text-muted);line-height:1.5}
.ips-flast .ips-lastmeta .ips-tpc{display:block;color:var(--ipsx-text-primary);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:200px}
.ips-flast .ips-lastmeta .ips-tpc:hover{color:var(--ipsx-electric-blue)}
.ips-flast .ips-lastmeta .ips-by{display:block}
.ips-flast .ips-lastmeta .ips-by a{color:var(--ipsx-steel-blue);font-weight:600}
.ips-flast .ips-lastmeta .ips-by a:hover{color:#fff}
.ips-flast .ips-lastnever{color:var(--ipsx-text-muted);font-style:italic;font-size:12.5px}
.ips-statgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:var(--ipsx-border-soft)}
.ips-stattile{background:var(--ipsx-card-bg);padding:20px 18px;text-align:center}
.ips-stattile .ips-num{font-size:26px;font-weight:800;color:#fff;letter-spacing:-.5px;line-height:1}
.ips-stattile .ips-lab{margin-top:7px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.7px;color:var(--ipsx-text-muted)}
.ips-stattile.ips-newest{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
.ips-newchip{display:inline-flex;align-items:center;gap:8px;padding:5px 12px 5px 5px;border-radius:999px;background:var(--ipsx-electric-subtle);border:1px solid rgba(59,130,246,.3)}
.ips-newchip img{width:26px;height:26px;border-radius:50%}
.ips-newchip b{color:var(--ipsx-steel-blue);font-size:13px}
.ips-sttitle{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1px;color:var(--ipsx-text-muted);margin-bottom:12px}
.ips-muted{color:var(--ipsx-text-muted);font-size:12.5px;line-height:1.7}
.ips-bignum{color:#fff;font-size:20px;font-weight:800}
a.ips-newchip{text-decoration:none}
a.ips-newchip:hover b{color:#fff}
.ips-moststrip{padding:14px 20px;border-top:1px solid var(--ipsx-border-soft);font-size:12.5px;color:var(--ipsx-text-muted)}
.ips-moststrip .ips-bignum{margin-right:6px}
.ips-online-wrap{padding:18px 20px;border-top:1px solid var(--ipsx-border-soft)}
.ips-onlinenote{color:var(--ipsx-text-muted);font-size:12.5px;margin-bottom:10px}
.ips-onlinelist{font-size:13px;line-height:1.9;color:var(--ipsx-text-muted)}
.ips-onlinelist a{color:var(--ipsx-steel-blue);font-weight:600}
.ips-onlinelist a:hover{color:#fff}
.ips-statfoot{padding:12px 20px;border-top:1px solid var(--ipsx-border-soft);text-align:right;font-size:12px;color:var(--ipsx-text-muted)}
.ips-statfoot a{color:var(--ipsx-text-muted)}
.ips-statfoot a:hover{color:var(--ipsx-electric-blue)}
@media (max-width:900px){
  .ips-rowlabels{display:none}
  .ips-frow{flex-wrap:wrap}
  .ips-fstats{width:auto;text-align:left;order:3}
  .ips-flast{width:100%;order:4;padding-top:6px;border-top:1px solid var(--ipsx-border-soft)}
  .ips-statgrid{grid-template-columns:repeat(2,1fr)}
}
/* last-post avatar (injected by footer script) -> IPS round */
.ips-flast img{width:38px !important;height:38px !important;border-radius:50%;object-fit:cover;flex-shrink:0;border:1px solid var(--ipsx-border);margin:0}

/* ===== Thread listing (forumdisplay) -> IPS5 ===== */
table.tborder:has(.thread_row){background:var(--ipsx-card-bg);border:1px solid var(--ipsx-border);border-radius:var(--ipsx-radius);box-shadow:var(--ipsx-shadow);overflow:hidden;border-collapse:separate;border-spacing:0}
table.tborder:has(.thread_row) .thead{background:var(--ipsx-card-header) !important;color:#fff;padding:14px 20px !important;border-bottom:1px solid var(--ipsx-border);font-size:12px;letter-spacing:.5px}
table.tborder:has(.thread_row) .thead a{color:var(--ipsx-steel-blue)}
table.tborder:has(.thread_row) .tcat{background:rgba(0,0,0,.18) !important;color:var(--ipsx-text-muted) !important;font-size:11px !important;text-transform:uppercase;letter-spacing:.6px;padding:9px 14px !important;border-bottom:1px solid var(--ipsx-border-soft)}
table.tborder:has(.thread_row) .tcat a{color:var(--ipsx-text-muted) !important}
.thread_row > td{border-bottom:1px solid var(--ipsx-border-soft) !important;padding:13px 14px !important;vertical-align:middle;background:transparent !important;transition:background .15s ease}
.thread_row:hover > td{background:var(--ipsx-row-hover) !important}
.thread_title a{color:#fff !important;font-weight:600;font-size:15px}
.thread_title a:hover{color:var(--ipsx-electric-blue) !important}
.thread_meta{color:var(--ipsx-text-muted) !important;font-size:12.5px;margin-top:4px}
.thread_meta a{color:var(--ipsx-steel-blue) !important}
.thread_stats{text-align:center;color:var(--ipsx-text-muted);font-size:12px}
.thread_stats .stat_number{display:block;color:var(--ipsx-text-primary);font-size:16px;font-weight:700}
.thread_stats .stat_number a{color:var(--ipsx-text-primary) !important}
.thread_lastpost{font-size:12.5px;color:var(--ipsx-text-muted)}
.thread_lastpost .lastpost_date{color:var(--ipsx-text-primary)}
.thread_lastpost a{color:var(--ipsx-steel-blue) !important}
.thread_lastpost img{width:34px !important;height:34px !important;border-radius:50% !important;object-fit:cover}
table.tborder:has(.thread_row) .tfoot{background:rgba(0,0,0,.2) !important;border-top:1px solid var(--ipsx-border);padding:12px 16px !important}

/* ===== Post view (showthread) -> IPS5 ===== */
.category_header{background:var(--ipsx-card-header) !important;border:1px solid var(--ipsx-border) !important;border-radius:var(--ipsx-radius) !important;padding:14px 20px !important;position:relative;overflow:hidden;box-shadow:var(--ipsx-shadow);margin-bottom:16px}
.category_header::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:linear-gradient(90deg,rgba(59,130,246,.85),rgba(59,130,246,.25) 45%,rgba(59,130,246,0) 85%)}
.category_header,.category_header a,.category_header strong,.category_header span{color:#fff !important}
.post{border:1px solid var(--ipsx-border) !important;border-radius:var(--ipsx-radius) !important;box-shadow:var(--ipsx-shadow) !important;overflow:hidden}
.post_author .author_avatar img,.post_author>img:first-of-type{border-radius:8px !important}

/* ===== Palette unification: remap the OLD cyan tokens to royal blue =====
   Shifts every var(--electric-blue) etc. across custom pages + old theme
   to IPS blue in one pass. My IPS5 components use --ipsx-* so are unaffected. */
:root{
  --electric-blue:#3b82f6;
  --electric-glow:rgba(59,130,246,.45);
  --electric-subtle:rgba(59,130,246,.15);
  --steel-blue:#4d9fff;
  --deep-blue:#2563eb;
}

/* ===== Panel/border palette unification (old tokens -> navy-blue) ===== */
:root{
  --glass-bg:rgba(11,25,41,.97);
  --glass-border:rgba(59,130,246,.14);
  --surface-dark:#081120;
  --card-bg:rgba(13,27,42,.98);
  --card-header:rgba(4,12,22,.45);
  --border:rgba(94,150,255,.13);
  --border-soft:rgba(94,150,255,.07);
  --row-hover:rgba(59,130,246,.05);
}
/* ===== Navy gradient background (replace marble) ===== */
body{background-color:#081120 !important}
body::before{background:linear-gradient(180deg,#0b1a2e 0%,#081327 38%,#050d1c 100%) !important;background-image:linear-gradient(180deg,#0b1a2e 0%,#081327 38%,#050d1c 100%) !important}

/* ===== Wave silhouettes at the page foot ===== */
body::after{content:"" !important;position:fixed !important;left:0 !important;right:0 !important;bottom:0 !important;height:190px !important;z-index:-1 !important;pointer-events:none !important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 190' preserveAspectRatio='none'%3E%3Cpath d='M0,120 C240,60 420,160 720,110 C1020,60 1200,150 1440,95 L1440,190 L0,190 Z' fill='%23060f1e'/%3E%3Cpath d='M0,150 C300,100 560,185 860,140 C1160,95 1300,170 1440,135 L1440,190 L0,190 Z' fill='%23040a15'/%3E%3C/svg%3E") !important;background-size:100% 100% !important;background-repeat:no-repeat !important}

/* ===== Last-post overflow safety (never break the box) ===== */
.ips-flast{overflow:hidden}
.ips-flast .ips-lastmeta{min-width:0;flex:1 1 auto}
.ips-flast .ips-lastmeta .ips-tpc{max-width:100%}

/* ===== De-MyBB: hide the Threaded Mode toggle (Invision has no threaded view) ===== */
.category_header .smalltext{display:none !important}

/* ===== Who's Online — IPS5 avatar row (no online dot) ===== */
.ips-online-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.ips-online-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1px;color:var(--ipsx-text-muted)}
.ips-online-seeall{font-size:12px;color:var(--ipsx-steel-blue)}
.ips-online-seeall:hover{color:#fff}
.ips-online-avatars{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.ips-online-avatars a.ips-ou{position:relative;display:inline-block;width:34px;height:34px;line-height:0}
.ips-ou-av{width:34px;height:34px;border-radius:50%;object-fit:cover;border:1px solid var(--ipsx-border);display:block;transition:transform .12s ease,border-color .12s ease}
.ips-online-avatars a.ips-ou:hover .ips-ou-av{transform:translateY(-2px);border-color:var(--ipsx-electric-blue)}
.ips-ou-dot{display:none}
.ips-onlinenote{color:var(--ipsx-text-muted);font-size:12.5px;margin-top:12px}


/* ===== IPS5 floating scroll-to-top button ===== */
#ips-scrolltop{position:fixed;right:22px;bottom:22px;z-index:9999;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--ipsx-electric-blue);color:#fff;box-shadow:var(--ipsx-shadow-raise,0 6px 18px rgba(0,0,0,.35));border:1px solid var(--ipsx-border-soft);opacity:0;visibility:hidden;transform:translateY(10px);transition:opacity .2s ease,transform .2s ease,visibility .2s ease,filter .15s ease;cursor:pointer;text-decoration:none;}
#ips-scrolltop.show{opacity:1;visibility:visible;transform:translateY(0);}
#ips-scrolltop:hover{filter:brightness(1.12);box-shadow:0 8px 22px rgba(0,0,0,.45);}
#ips-scrolltop svg{display:block;}
/* hide MyBB-style 'Return to Top' footer link, replaced by floating button */
.footer-links li:has(a[href="#top"]){display:none;}

/* ===== IPS5 avatar-led topic rows ===== */
table.tborder:has(.thread_row) .tcat{display:none !important;}
.ips-topic > td{border-bottom:1px solid var(--ipsx-border-soft) !important;padding:12px 12px !important;vertical-align:middle;background:transparent !important;}
.ips-topic:hover > td{background:var(--ipsx-row-hover) !important;}
td.ips-tp-av{width:62px;text-align:center;position:relative;}
.ips-tp-avatar{width:42px;height:42px;border-radius:50%;object-fit:cover;border:1px solid var(--ipsx-border);background:var(--ipsx-surface-dark);vertical-align:middle;}
td.ips-tp-av .thread_status{position:absolute;left:38px;top:30px;width:13px;height:13px;min-width:13px;border-radius:50%;border:2px solid var(--ipsx-card-bg);background-size:cover;}
td.ips-tp-main{width:auto;}
.ips-topic .thread_title{font-size:15px;font-weight:600;line-height:1.3;}
.ips-topic .thread_title a{color:#fff !important;}
.ips-topic .thread_meta{margin-top:3px;}
td.ips-tp-stat{width:80px;text-align:center;}
.ips-topic .thread_stats{display:flex;flex-direction:column;align-items:center;gap:1px;}
.ips-topic .thread_stats .stat_number{font-size:16px;font-weight:700;color:var(--ipsx-text-primary);}
.ips-tp-lab{font-size:10.5px;text-transform:uppercase;letter-spacing:.5px;color:var(--ipsx-text-muted);}
td.ips-tp-last{width:215px;text-align:right;white-space:nowrap;}
.ips-topic .thread_lastpost{display:flex;align-items:center;justify-content:flex-end;gap:10px;text-align:right;}
.ips-topic .ips-lastpost-wrap{display:flex;align-items:center;gap:10px;flex-direction:row-reverse;}
.ips-topic .ips-lastpost-avatar,.ips-topic .thread_lastpost img{width:34px !important;height:34px !important;border-radius:50% !important;object-fit:cover;}
@media(max-width:720px){td.ips-tp-stat,td.ips-tp-last{display:none;}}

/* ===== IPS5 post view refinements ===== */
.post_author .author_avatar img,.post_author>img:first-of-type{border-radius:50% !important;width:86px !important;height:86px !important;object-fit:cover;border:2px solid var(--ipsx-border);}
.post_author{text-align:center;padding:18px 14px !important;}
.post_author .author_name{margin-bottom:10px !important;font-size:15px;}
.post_author .author_group_title{display:block;color:var(--ipsx-text-muted);font-size:12px;margin-top:8px;}
.post_author .author_badge{margin:10px auto 0;}
.post_author .author_badge img{max-width:118px;height:auto;}
.author_statistics{margin-top:14px !important;border-top:1px solid var(--ipsx-border-soft);padding-top:12px !important;color:var(--ipsx-text-muted);font-size:12px;line-height:1.9;text-align:center;}
.author_statistics strong{color:var(--ipsx-text-primary);text-transform:uppercase;font-size:10.5px;letter-spacing:.4px;}
.post_content{padding:0 !important;}
.post_meta{padding:11px 18px !important;border-bottom:1px solid var(--ipsx-border-soft);display:flex;justify-content:space-between;align-items:center;}
.post_meta .post_date{color:var(--ipsx-text-muted);font-size:12.5px;}
.post_head{padding:10px 18px 0;}
.post_body{padding:18px !important;color:var(--ipsx-text-primary);line-height:1.6;}
.post_controls{border-top:1px solid var(--ipsx-border-soft);padding:10px 18px !important;background:rgba(0,0,0,.14);}
.postbit_buttons{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap;}
.postbit_buttons a{border-radius:6px;}

/* ===== IPS5 control panel polish ===== */
.usercp_container > img{border-radius:50% !important;width:96px !important;height:96px !important;object-fit:cover;border:2px solid var(--ipsx-border);}
