.night-train-scene {
 position:fixed;
 inset:0;
 width:100%;
 height:100%;
 z-index:0;
 pointer-events:none;
 image-rendering:pixelated;
}
.night-train-scene[hidden],.charts-page[hidden],.ambient-mixer[hidden]{display:none!important}
.cabin-cat-trigger{
 position:fixed;z-index:2;pointer-events:none;background:none!important;
 border:0!important;padding:0;box-shadow:none!important
}
.cabin-cat-trigger[hidden]{display:none!important}
.cabin-cat-trigger:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
html:is([data-theme=night-train],[data-theme=rain-cabin]) body .app-layout-wrapper {
 position:relative;
 z-index:1;
 background:transparent!important;
}
html:is([data-theme=night-train],[data-theme=rain-cabin]) body :is(.layout-tile,.snap-card,.sidebar,.kpi-card) {
 background-color:color-mix(in srgb,var(--card) 84%,transparent)!important;
}
html:is([data-theme=night-train],[data-theme=rain-cabin]).theme-effects body :is(.layout-tile,.snap-card) {
 background-image:radial-gradient(ellipse at center,#c8ecff66 0 1px,transparent 2px),radial-gradient(ellipse at center,#9cd3ff44 0 1px,transparent 2px);
 background-size:89px 137px,127px 161px;
 animation:night-train-glass 16s linear infinite;
}
@keyframes night-train-glass {to{background-position:0 137px,0 161px}}

@media(prefers-reduced-motion:reduce){
 html:is([data-theme=night-train],[data-theme=rain-cabin]).theme-effects body :is(.layout-tile,.snap-card){animation:none}
}
.scene-panel>.scene-edge {
 position:absolute!important;z-index:4;display:block!important;
 min-width:0!important;min-height:0!important;padding:0!important;
 border:0!important;border-radius:0!important;background:transparent!important;
 box-shadow:none!important;touch-action:none;cursor:grab;
}
.scene-panel>.scene-edge[data-side=top] {inset:0 7px auto;height:7px}
.scene-panel>.scene-edge[data-side=bottom] {inset:auto 7px 0;height:7px}
.scene-panel>.scene-edge[data-side=left] {inset:0 auto 0 0;width:7px}
.scene-panel>.scene-edge[data-side=right] {inset:0 0 0 auto;width:7px}
.scene-panel>.scene-edge:focus-visible {outline:2px solid var(--accent)!important}
.charts-page {min-width:0;overflow:auto}
html body .charts-page #allChartsMasterModal {position:static!important;inset:auto!important;background:none!important;backdrop-filter:none!important}
html body .charts-page #allChartsMasterModal>.full-graph-modal-dialog {
 width:100%!important;max-width:none!important;max-height:none!important;height:auto!important;margin:0!important;
 overflow:visible!important;
}
html[data-theme] body .charts-page #allChartsMasterModal .all-charts-bento {
 grid-template-columns:repeat(2,minmax(0,1fr))!important;
 grid-template-rows:none!important;grid-auto-rows:clamp(340px,48vh,500px)!important;
 height:auto!important;max-height:none!important;overflow:visible!important;
}
html[data-theme] body .charts-page #allChartsMasterModal .all-charts-bento>.master-chart-card[data-chart-area] {
 grid-area:auto!important;height:auto!important;min-width:0!important;min-height:0!important;overflow:hidden;
}
@media(max-width:700px){
 html[data-theme] body .charts-page #allChartsMasterModal .all-charts-bento {
  grid-template-columns:minmax(0,1fr)!important;grid-auto-rows:360px!important;
 }
}
.ambient-mixer label {display:grid;grid-template-columns:5ch minmax(0,1fr);gap:10px;align-items:center;margin-block:6px}
.ambient-mixer input[type=range] {min-width:0;width:100%;accent-color:var(--accent)}
html[data-theme] body .premium-dashboard-grid:not([hidden]) {
 display:grid!important;grid-template-columns:repeat(24,minmax(0,1fr))!important;
 grid-template-rows:none!important;grid-auto-rows:minmax(20px,calc((100dvh - 240px)/24))!important;
 gap:0!important;align-content:start;overflow:auto!important;
}
html[data-theme] body .premium-dashboard-grid>.premium-layout-panel:not(.dashboard-window-hidden) {
 position:relative!important;inset:auto!important;width:auto!important;height:auto!important;
 max-height:none!important;min-width:0!important;min-height:0!important;margin:4px!important;
}
.premium-added-panel {background:var(--card);border:1px solid var(--border);border-radius:12px;padding:12px;overflow:auto}
.premium-added-panel>.catalog-chart {height:calc(100% - 32px);min-height:80px}
.premium-layout-editor{width:min(1100px,96vw)!important;max-width:96vw!important}
.premium-editor-scroll{overflow:hidden;margin-block:12px;border:1px solid var(--border);border-radius:var(--ui-panel-radius)}
.premium-editor-map{
 --cell-height:calc(100% / var(--preview-rows,24));
 display:grid;grid-template-columns:repeat(24,minmax(0,1fr));grid-template-rows:repeat(var(--preview-rows,24),minmax(0,1fr));
 height:min(56dvh,max(100px,calc(100dvh - 260px)));
 background-color:var(--bg-panel);
 background-image:linear-gradient(to right,var(--border) 1px,transparent 1px),linear-gradient(to bottom,var(--border) 1px,transparent 1px);
 background-size:calc(100% / 24) var(--cell-height)
}
.premium-editor-window{
 position:relative;display:grid;place-items:center;text-align:center;min-width:0;padding:8px;
 margin:2px;border:1px solid var(--border);border-radius:var(--ui-panel-radius);background:var(--card);
 color:var(--text);font-size:clamp(8px,1.1vw,.8rem);overflow:hidden;min-height:0;padding:0;
 overflow-wrap:anywhere;cursor:grab;touch-action:none;user-select:none
}
.premium-editor-window[data-moving]{border-color:var(--accent);cursor:grabbing}
.premium-editor-window>button{position:absolute;inset:8px 8px auto auto}
.premium-editor-edge{position:absolute;touch-action:none;pointer-events:none}
.premium-editor-edge[data-edge=n],.premium-editor-edge[data-edge=s]{inset-inline:14px;height:14px;cursor:ns-resize}
.premium-editor-edge[data-edge=n]{top:0}.premium-editor-edge[data-edge=s]{bottom:0}
.premium-editor-edge[data-edge=e],.premium-editor-edge[data-edge=w]{inset-block:14px;width:14px;cursor:ew-resize}
.premium-editor-edge[data-edge=e]{right:0}.premium-editor-edge[data-edge=w]{left:0}
@media(max-width:850px){
 html[data-theme] body .premium-dashboard-grid:not([hidden]) {grid-template-columns:minmax(0,1fr)!important}
 html[data-theme] body .premium-dashboard-grid>.premium-layout-panel {--editor-column:1;--editor-row:auto;min-height:280px!important}
}
html body :is(.friend-chat,.friends-chat-pane,.swaga-right-panel) {background-color:var(--bg-panel)!important}
html[data-theme] body .cockpit-4col-grid[hidden] {display:none!important}
.charts-page {position:relative;isolation:isolate}
html[data-theme] body .charts-page>.training-dialog {
 position:static!important;width:100%!important;max-width:none!important;
 height:auto!important;max-height:none!important;margin:0!important;
}
html[data-theme] body header .appearance-menu>summary.btn-mini {
 min-height:var(--ui-control-height,36px)!important;
 border-radius:var(--ui-control-radius,8px)!important;
 padding:8px 12px!important;
 list-style:none;cursor:pointer;
}
.appearance-menu>summary::-webkit-details-marker{display:none}
.nickname-brush[hidden],.nickname-style-picker[hidden]{display:none!important}
.profile-styled-name{display:inline-block}
.nickname-brush{margin-inline-start:8px}
.nickname-style-picker{display:grid;gap:10px;border:1px solid var(--border);border-radius:8px;padding:10px;min-width:0;margin:8px 0 0}
.nickname-style-picker legend{font-size:.8rem;padding-inline:4px}
.nickname-palette,.nickname-patterns{display:flex;gap:6px;flex-wrap:wrap}
html[data-theme] body .nickname-palette>button{background:var(--swatch)!important;width:26px;height:26px;min-height:0!important;padding:0!important;border-radius:50%!important;border:1px solid var(--border)}
.nickname-patterns>button{font-size:.75rem;padding:3px 7px;border:1px solid var(--border);border-radius:6px;color:var(--text);background:var(--card)}
.nickname-style-picker button[aria-pressed=true]{outline:2px solid var(--accent);outline-offset:1px}
.profile-edit-actions{
 display:flex;justify-content:flex-end;align-items:center;
 flex-wrap:wrap;gap:8px;padding:10px;background:var(--card);border:1px solid var(--border);border-radius:8px
}
.profile-edit-actions.has-changes{position:sticky;top:0;z-index:2}
.profile-edit-actions [data-profile-status]{margin:0;margin-inline-end:auto;overflow-wrap:anywhere}
html[data-theme] body .profile-styled-name{
 --nick-ink:var(--nick-selected,var(--text));
 --nick-shade:color-mix(in srgb,var(--nick-ink) 55%,#392d43);
 --nick-effect:var(--nick-selected,#b896ec);
 --nick-effect-end:var(--nick-highlight,#eda8c8);
 color:var(--nick-ink)!important
}
.profile-styled-name:is([data-nick-style=zebra],[data-nick-style=fade],[data-nick-style=gummy],[data-nick-style=prism],[data-nick-style=foil]){
 background-clip:text;-webkit-text-fill-color:transparent;background-color:var(--nick-ink)
}
.profile-styled-name[data-nick-style=zebra]{background-image:repeating-linear-gradient(133deg,transparent 0 4px,var(--nick-shade) 4px 7px)}
.profile-styled-name[data-nick-style=fade]{
 background-image:linear-gradient(90deg,var(--nick-ink),var(--nick-effect-end))
}
@font-face{font-family:"SWAGA Pixel";src:url("../js/assets/fonts/PixelifySans.ttf") format("truetype");font-weight:400 700;font-display:swap}
html[data-theme] body [data-nick-font=rounded]{font-family:"Nunito Sans","Segoe UI",sans-serif!important;font-weight:800!important}
html[data-theme] body [data-nick-font=serif]{font-family:Georgia,serif!important}
html[data-theme] body [data-nick-font=mono]{font-family:Consolas,monospace!important}
html[data-theme] body [data-nick-font=script]{font-family:Caveat,cursive!important}
html[data-theme] body [data-nick-font=pixel]{font-family:"SWAGA Pixel",Consolas,monospace!important}
.profile-styled-name[data-nick-style=neon]{
 --nick-glow:var(--nick-effect);
 text-shadow:0 0 4px color-mix(in srgb,var(--nick-glow) 75%,transparent),0 0 12px color-mix(in srgb,var(--nick-glow) 52%,transparent)
}
.profile-styled-name[data-nick-style=cartoon]{
 paint-order:stroke fill;-webkit-text-stroke:.11em color-mix(in srgb,var(--nick-effect) 32%,#20132a);
 text-shadow:.075em .085em 0 color-mix(in srgb,var(--nick-effect) 55%,#20132a)
}
.profile-styled-name[data-nick-style=highlight]{
 text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--nick-effect) 55%,transparent);
 text-decoration-thickness:.23em;text-underline-offset:-.05em;text-decoration-skip-ink:none
}
.profile-styled-name[data-nick-style=gummy]{
 background-image:linear-gradient(#fff9 0%,transparent 36%,#170b2840 58%,transparent 100%);
 filter:drop-shadow(0 1px 0 color-mix(in srgb,var(--nick-ink) 55%,#20132a))
}
.profile-styled-name[data-nick-style=prism]{
 background-image:linear-gradient(95deg,var(--nick-ink),#f29aab,#bfb2f6,#62d5ce)
}
.profile-styled-name[data-nick-style=foil]{
 background-image:linear-gradient(120deg,transparent 20%,#fff8 42%,#fff 46%,#3e225777 49%,transparent 76%)
}
.profile-styled-name[data-nick-style=echo]{
 text-shadow:.085em .07em 0 color-mix(in srgb,var(--nick-effect) 70%,transparent),.17em .14em 0 color-mix(in srgb,var(--nick-effect-end) 42%,transparent)
}
.nickname-section-label{font-size:.75rem;color:var(--muted);margin-block-end:-4px}
.nickname-patterns>button{min-height:30px}
.nickname-patterns>button[data-nick-font]:not([data-nick-font=""]){font-size:.95rem}
[data-profile-frame=silver]{--profile-frame-edge:#e2e8f5;--profile-frame-glow:#a2b9d9;--profile-frame-inner:#748198}
[data-profile-frame=violet]{--profile-frame-edge:#edcbff;--profile-frame-glow:#bd78ff;--profile-frame-inner:#8b60ae}
[data-profile-frame=gold]{--profile-frame-edge:#ffe5a5;--profile-frame-glow:#efa65c;--profile-frame-inner:#ad783c}
html[data-theme] body :is(.profile-dialog,.friend-profile-dialog,.friend-card,.friend-avatar,.profile-picture,.soft-avatar,.profile-frame-sample):is([data-profile-frame=silver],[data-profile-frame=violet],[data-profile-frame=gold]){
 outline:1px solid var(--profile-frame-edge);
 outline-offset:-1px;
 box-shadow:inset 0 0 0 3px var(--profile-frame-inner),inset 0 0 14px color-mix(in srgb,var(--profile-frame-glow) 35%,transparent),0 0 0 1px var(--profile-frame-inner),0 0 16px color-mix(in srgb,var(--profile-frame-glow) 48%,transparent)!important
}
html[data-theme] body :is(.friend-avatar,.profile-picture,.soft-avatar):is([data-profile-frame=silver],[data-profile-frame=violet],[data-profile-frame=gold]){
 outline:2px solid var(--profile-frame-edge);outline-offset:1px
}
[data-profile-frame=deco]{--frame-art:url("../js/assets/frames/deco.svg");--frame-glow:#d6a65b}
[data-profile-frame=filigree]{--frame-art:url("../js/assets/frames/filigree.svg");--frame-glow:#d7dbef}
[data-profile-frame=frost]{--frame-art:url("../js/assets/frames/frost.svg");--frame-glow:#76cce8}
[data-profile-frame=sakura]{--frame-art:url("../js/assets/frames/sakura.svg");--frame-glow:#e88daa}
[data-profile-frame=circuit]{--frame-art:url("../js/assets/frames/circuit.svg");--frame-glow:#2aab92}
[data-profile-frame=obsidian]{--frame-art:url("../js/assets/frames/obsidian.svg");--frame-glow:#d76d60}
[data-profile-frame=arcade]{--frame-art:url("../js/assets/frames/arcade.svg");--frame-glow:#b67cff}
html[data-theme] body :is(.profile-dialog,.friend-profile-dialog,.profile-frame-sample):is([data-profile-frame=deco],[data-profile-frame=filigree],[data-profile-frame=frost],[data-profile-frame=sakura],[data-profile-frame=circuit],[data-profile-frame=obsidian],[data-profile-frame=arcade]){
 border-image:var(--frame-art) 28 / 24px / 4px stretch!important;
 box-shadow:0 0 18px color-mix(in srgb,var(--frame-glow) 34%,transparent)!important
}
.friend-avatar{overflow:hidden}
.friend-avatar img{display:block;width:100%;height:100%;object-fit:cover}
html[data-theme] body :is(.profile-dialog .profile-picture,.friend-avatar,.soft-sidebar .soft-avatar){
 position:relative;border-radius:10px!important;overflow:hidden
}
html[data-theme] body .soft-sidebar .soft-avatar{
 border:1px solid var(--border)!important;
}
html[data-theme] body .soft-sidebar .soft-avatar::after{border-image-width:11px}
:is(.profile-picture,.friend-avatar,.soft-avatar):is([data-profile-frame=deco],[data-profile-frame=filigree],[data-profile-frame=frost],[data-profile-frame=sakura],[data-profile-frame=circuit],[data-profile-frame=obsidian],[data-profile-frame=arcade])::after{
 content:"";position:absolute;inset:0;border:1px solid transparent;
 border-image:var(--frame-art) 28 / 18px stretch;pointer-events:none
}
.friend-preview .friend-avatar::after{border-image-width:13px}
.profile-frame-options,.nickname-effect-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,86px),1fr));gap:8px}
.profile-frame-options>button,.nickname-effect-options>button{
 display:grid;place-items:center;align-content:center;gap:5px;min-width:0;padding:7px!important;
 border-radius:8px!important;line-height:1.2;text-align:center;overflow-wrap:anywhere
}
.profile-frame-sample{display:block;width:56px;height:32px;border:1px solid var(--border);border-radius:5px;background:#1c2436}
html[data-theme] body .profile-frame-options .profile-frame-sample{border-image-width:13px!important}
.profile-frame-picker{border-block-start:1px solid var(--border);padding-block-start:6px}
.profile-frame-picker>summary{cursor:pointer;padding:5px 2px;margin:0}
.profile-frame-picker[open]>.profile-frame-options{margin-block-start:8px}
.nickname-effect-sample{font-size:1.15rem;font-weight:800}
.profile-badge-cube::before{
 content:"";display:inline-block;vertical-align:middle;width:1.05em;height:1.05em;background:currentColor;
 mask:center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 2 3 7v10l9 5 9-5V7zM3 7l9 5 9-5M12 12v10'/%3E%3C/svg%3E")
}

html.wallpaper-view body .app-layout-wrapper > :not(.soft-sidebar),
html.wallpaper-view body .soft-sidebar > :not(.soft-mark),
html.wallpaper-view body :is(.music-widget,.glass-edge-glint) {
 opacity:0!important;visibility:hidden!important;transition:none!important;
}
html.wallpaper-view[data-theme] body .app-layout-wrapper > .soft-sidebar{
 background:none!important;border-color:transparent!important;box-shadow:none!important;
}
html[data-theme] body .day-card.active { outline:2px solid var(--accent); outline-offset:-2px; }
html[data-theme] body .soft-sidebar > .legacy-dashboard-home { display:grid!important; }

html[data-theme] body :is(.profile-picture,.friend-avatar,.soft-avatar):is([data-profile-frame=deco],[data-profile-frame=filigree],[data-profile-frame=frost],[data-profile-frame=sakura],[data-profile-frame=circuit],[data-profile-frame=obsidian],[data-profile-frame=arcade]) {
 box-sizing:border-box;
 padding:3px;
}

/* Keep the scrollport inside the decorative frame. */
html[data-theme] body :is(.profile-dialog,.friend-profile-dialog)[data-ornate-frame] {
 border-width:8px!important;
 border-style:solid!important;
 border-color:transparent!important;
 border-image:var(--frame-art) 28 / 19px / 4px stretch!important;
 background-clip:padding-box!important;
}
html[data-theme] body .friend-card[data-ornate-frame] {
 border-image:var(--frame-art) 28 / 16px / 3px stretch!important;
}
html[data-theme] body :is(.profile-picture,.friend-avatar,.soft-avatar)[data-ornate-frame] {
 padding:0!important;
 overflow:visible!important;
}
:is(.profile-picture,.friend-avatar,.soft-avatar)[data-ornate-frame] img {
 border-radius:inherit;
}
:is(.profile-picture,.friend-avatar,.soft-avatar)[data-ornate-frame]::after {
 inset:-3px;
 border-image-width:7px!important;
}
.team-dialog { width:min(960px,94vw); max-height:88dvh; overflow:auto; }
.team-dialog > header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; }
.team-dialog > header h2 { margin:0; }
.team-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.team-member { display:flex; flex-direction:column; align-items:flex-start; gap:6px; min-width:0; padding:16px; border:1px solid var(--border); border-radius:12px; background:var(--card); overflow-wrap:anywhere; }
.team-member img,.team-avatar-fallback { width:64px; height:64px; object-fit:cover; border-radius:10px; }
.team-avatar-fallback { display:grid; place-items:center; background:var(--accent-soft); color:var(--accent); font-weight:800; }
.team-empty { border-style:dashed; justify-content:center; align-items:center; }
.team-dialog form { display:grid; gap:10px; margin-block:12px; }
.team-dialog label { display:grid; gap:6px; }
.team-dialog textarea { min-height:4rem; resize:vertical; }
.team-dialog img { max-width:100%; }
.team-dialog p { white-space:pre-wrap; overflow-wrap:anywhere; }
.team-region { position:fixed; inset:0; z-index:2147483647; cursor:crosshair; touch-action:none; background:#0002; }
.team-region > div { position:absolute; border:2px solid white; pointer-events:none; box-shadow:0 0 0 1px #000; }
@media(max-width:660px) { .team-cards { grid-template-columns:1fr; } }
html body dialog.panel-fullscreen-dialog[open] { position:fixed!important; inset:0!important; margin:auto!important; display:flex; flex-direction:column; width:min(1040px,94vw); }
.panel-fullscreen-dialog .panel-fullscreen-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.panel-fullscreen-dialog .panel-fullscreen-body { display:flex; flex:1; min-height:0; overflow:auto; }
html body :is(.panel-openable,.panel-openable .drag-handle,.panel-expanded) { cursor:default!important; }
.panel-expanded :is(.drag-handle,.free-resize,.window-resize) { display:none!important; }
.profile-edit-actions.has-changes { top:auto; bottom:0; }
.team-section form[hidden] { display:none; }
.team-section .team-cards { margin-block:10px; }
.team-roster { display:flex; flex-wrap:wrap; gap:10px; margin-block:10px; }
.team-author { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.team-author .friend-avatar { width:36px; height:36px; display:grid; place-items:center; }
.team-log { max-height:48dvh; overflow:auto; }
.team-log article { padding:12px; margin-block:8px; border-radius:10px; background:var(--bg-elev); overflow-wrap:anywhere; }
.team-section form { display:grid; gap:8px; }
html[data-theme] body :is(.profile-picture,.friend-avatar,.soft-avatar)[data-ornate-frame]::after { inset:-6px; border-image-width:12px!important; }

.chat-image-trigger { display: block; max-width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.chat-image-viewer[open] { display: grid; justify-items: end; gap: 12px; width: max-content; max-width: 94vw; }
.chat-image-viewer .chat-image-preview { width: auto; height: auto; max-width: min(86vw, 1100px); max-height: 76dvh; object-fit: contain; }

/* Bug reports keep navigation, screenshot and actions in separate rows. */
.team-report-filters,.team-report-actions{display:flex;gap:8px;flex-wrap:wrap}
.team-report-filters{margin-block:12px}
.team-report-filters button[aria-pressed=true]{background:var(--accent-soft)!important;color:var(--accent)!important;border-color:var(--accent)!important}
.team-report-list .team-report-row{display:flex;align-items:center;justify-content:space-between;gap:16px}
.team-report-meta{display:grid;gap:4px;min-width:0}
.team-report-meta time{color:var(--text-muted);font-size:.8rem}
.team-report-detail .team-report-content{display:grid;gap:16px;min-width:0}
.team-report-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.team-report-heading h2{margin:0;min-width:0}
.team-report-detail .team-report-content p{margin:0;user-select:text}
.team-report-detail figure{margin:0;display:flex;justify-content:center;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--bg-input,var(--bg-elev));overflow:hidden}
.team-report-detail figure img{display:block;width:auto;max-width:100%;height:auto;max-height:52dvh;object-fit:contain;border-radius:6px}
.team-report-footer{display:flex;justify-content:flex-end;gap:8px;padding-top:16px;margin-top:16px;border-top:1px solid var(--border)}
@media(max-width:620px){.team-report-list .team-report-row{align-items:stretch;flex-direction:column}.team-report-actions>button{flex:1}.team-report-footer>button{width:100%}}
