/* Shared geometry: themes change paint, not panel dimensions. */
html body{--ui-panel-radius:14px;--ui-control-radius:8px;background-color:#08090b!important}
html[data-theme] body .app-layout-wrapper.app-layout-wrapper{border:10px solid #08090b!important;box-sizing:border-box!important;background-clip:padding-box!important;border-radius:24px!important;overflow:hidden!important}
/* Fixed scene canvases can paint outside the layout; keep the viewport edge opaque. */
html body::after{content:"";position:fixed;inset:.65rem;box-sizing:border-box;border:10px solid #08090b;border-radius:24px;box-shadow:0 0 0 100vmax #08090b;pointer-events:none;z-index:2147483647}
html body .day-title-group{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto;align-items:center!important;gap:12px;width:100%;min-width:0}
html body #activeDayTitle{font-size:clamp(18px,1.35vw,28px);margin:0;white-space:nowrap}
html body .day-task-count{text-align:center;font-weight:600;font-size:14px;line-height:1.3;min-width:0}
html body #activeDayDateLabel{margin-left:auto;white-space:nowrap;cursor:pointer}
html body #activeDayPanel .col2-bottom-widgets{display:none!important}
html body .day-note-button{flex:none;width:32px;height:32px;padding:0;border:1px solid #73777e!important;border-radius:8px!important;background:transparent;color:inherit}
html body .day-note-button.has-notes{border-color:var(--accent)!important;box-shadow:inset 0 0 0 1px var(--accent)}
html body .day-notes-dialog{width:min(520px,calc(100vw - 32px))}
html body .day-notes-dialog textarea{width:100%;height:190px;resize:none;box-sizing:border-box}
html body .project-calendar{width:min(440px,calc(100vw - 32px));box-sizing:border-box;padding:24px}
html body .calendar-month{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:14px}
html body .calendar-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;text-align:center;margin-bottom:14px}
html body .calendar-hours{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;margin-bottom:14px}
html body .calendar-days button,html body .calendar-hours button{min-width:0;min-height:34px;padding:5px;font-size:12px;border-radius:8px!important}
html body .project-calendar .selected{background:var(--accent)!important;color:#14181b!important;border-color:var(--accent)!important}
html body .project-calendar .today{box-shadow:inset 0 0 0 1px var(--accent)}
html body .project-calendar label{display:flex;align-items:center;gap:12px;margin-bottom:14px}
html body .project-calendar .action-buttons{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
html body .deadline-label{display:inline-flex;align-items:center;width:max-content;max-width:100%;white-space:nowrap;color:var(--accent);border:1px solid currentColor;border-radius:8px;padding:3px 7px;font-variant-numeric:tabular-nums}
html body .deadline-label.overdue{background:color-mix(in srgb,var(--accent) 17%,transparent);font-weight:700}
html body .charts-page{height:var(--analytics-page-height,65dvh);min-height:0;overflow:hidden!important;box-sizing:border-box}
html[data-theme] body .charts-page #allChartsMasterModal{height:100%!important;overflow:hidden!important}
html[data-theme] body .charts-page #allChartsMasterModal>.full-graph-modal-dialog{display:flex!important;flex-direction:column;width:100%!important;height:100%!important;max-height:100%!important;min-height:0!important;overflow:hidden!important;padding:12px!important;box-sizing:border-box;border-radius:var(--ui-panel-radius)!important}
html[data-theme] body .charts-page #allChartsMasterModal .all-charts-bento{display:grid!important;grid-template-columns:repeat(24,minmax(0,1fr))!important;grid-template-rows:repeat(24,minmax(0,1fr))!important;grid-auto-rows:0!important;columns:auto!important;gap:10px!important;flex:1!important;height:0!important;min-height:0!important;max-height:100%!important;padding:6px!important;overflow:hidden!important}
html[data-theme] body .charts-page #allChartsMasterModal .master-chart-card[data-chart-area],html[data-theme] body .charts-page #allChartsMasterModal .analytics-inline-grid>.master-chart-card{grid-area:auto;min-height:0!important;min-width:0!important;height:auto!important;max-height:100%!important;padding:12px!important;margin:0!important;box-sizing:border-box;border-radius:var(--ui-panel-radius)!important;overflow:hidden!important;display:flex;flex-direction:column}
html[data-theme] body .charts-page #allChartsMasterModal .master-chart-card h3{font-size:14px!important;line-height:18px!important;margin:0 0 8px!important}
html[data-theme] body .charts-page #allChartsMasterModal .master-chart-card canvas{max-width:100%;min-height:0}
html[data-theme] body .charts-page #allChartsMasterModal #analytics-weight{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(120px,24%);grid-template-rows:auto auto minmax(0,1fr);gap:6px 12px}
html body #analytics-weight>:first-child{grid-column:1/-1}
html body #analytics-weight .weight-entry{grid-column:1;grid-row:2;margin:0!important;gap:6px!important}
html body #analytics-weight .weight-inline-plot{grid-column:1;grid-row:3;height:auto!important;min-height:0!important;position:relative}
html body #analytics-weight .weight-inline-plot canvas{width:100%!important;height:100%!important}
html body .weight-measurements{grid-column:2;grid-row:2/4;display:flex;flex-direction:column;gap:8px;min-height:0;overflow:hidden;font-size:12px}
html body .weight-measurement-rows{overflow:auto;min-height:0;flex:1;overscroll-behavior:contain;border:1px solid color-mix(in srgb,var(--accent) 25%,transparent);border-radius:8px}
html body .weight-measurement-rows>div{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:7px;border-bottom:1px solid #7774}
html body .weight-measurement-rows button{padding:2px 5px;min-width:22px}
html body #analytics-monthly>div:last-child,html body #analytics-hours>div:last-child{flex:1;min-height:0;height:auto!important}
html body #analytics-monthly canvas{height:100%!important;max-height:100%}
html body #analytics-muscles>div:last-child{overflow:hidden!important;flex:1;min-height:0}
html body #analytics-muscles .muscle-plate-row{flex:1 1 0!important;min-height:0!important;height:auto!important;padding:0!important}
html body .muscle-plate-row.is-focus,html body .muscle-plate-row.focused{outline:none!important;box-shadow:inset 0 0 0 1px var(--accent)!important}
html body .gym-calendar-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
html body .gym-calendar-heading select{padding:3px 8px;height:28px;font-size:12px}
html body .gym-heatmap{display:grid;grid-auto-flow:column;grid-template-rows:repeat(7,12px);grid-template-columns:repeat(53,12px);gap:3px;flex:0 0 auto;align-content:start;justify-content:start;min-height:102px;max-height:100%;overflow:auto;position:relative}
html body .gym-day{width:12px!important;height:12px!important;max-width:12px!important;max-height:12px!important;box-sizing:border-box!important;padding:0!important;min-width:0!important;min-height:0!important;border:0!important;border-radius:2px!important;box-shadow:none!important;background:color-mix(in srgb,var(--accent) calc(var(--activity)*100%),#6c74812b)!important}
html[data-theme] body #analytics-gym button.gym-day:is(:hover,:focus-visible){outline:0!important;box-shadow:inset 0 0 0 1px var(--accent)!important}
html body .gym-tooltip{font-size:11px;line-height:16px;position:absolute;bottom:4px;left:12px;right:12px;background:var(--card-bg,#17232b);padding:4px;border:1px solid var(--accent);border-radius:5px;pointer-events:none;z-index:2}
html body .gym-calendar-card{position:relative}
html body .premium-dashboard-grid:not([hidden]){height:var(--dashboard-page-height,65dvh)!important;min-height:0!important;grid-template-rows:repeat(24,minmax(0,1fr))!important;grid-auto-rows:0!important;overflow:hidden!important}
html body .premium-layout-panel{min-height:0!important;min-width:0!important;box-sizing:border-box}
html body .premium-editor-scroll{overflow:hidden!important;min-height:0}
html body .premium-editor-map{max-height:56dvh!important;overflow:hidden!important}
html body .editor-mode{margin-bottom:12px;width:100%}
html body .profile-picture[role=button]{cursor:pointer}
@media(max-width:700px){
 html body .day-task-count{font-size:11px}
 html[data-theme] body .charts-page #allChartsMasterModal .all-charts-bento{display:flex!important;flex-direction:column;overflow:auto!important;height:auto!important}
 html body .charts-page{overflow:auto!important}
 html[data-theme] body .charts-page #allChartsMasterModal .master-chart-card{flex:none!important;min-height:260px!important}
 html body .premium-dashboard-grid:not([hidden]){height:auto!important;overflow:visible!important}
}

html body .analytics-inline-grid>[hidden]{display:none!important}
html body .charts-page .full-graph-footer{display:none!important}

html[data-theme] body .charts-page #allChartsMasterModal .analytics-inline-grid>.master-chart-card{align-self:stretch!important;height:100%!important;max-height:none!important}


html body .dashboard-window-hidden.dashboard-window-hidden{display:none!important}
.dashboard-window-tabs{width:100%;margin-bottom:16px}

/* The list owns its scroll height; category rows keep their natural size. */
html body #analytics-hours .hours-ranking{height:100%!important;min-height:0!important;overflow:hidden!important;grid-template-rows:minmax(0,1fr);align-items:stretch}
html body #analytics-hours .hours-rows{height:100%;min-height:0;overflow-y:auto!important;display:block!important}
html body #analytics-hours .hours-row{min-height:38px;flex:none!important}
html body .muscle-plate-row.focused{outline:0!important;border:0!important;box-shadow:none!important}
html body .muscle-plate-row.focused::after{content:"";position:absolute;inset:0;border:1px solid var(--accent);border-radius:inherit;pointer-events:none;z-index:2}
html body .muscle-ribbon{box-sizing:border-box}
html body #categoryEmojiGrid button{font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif!important;font-size:30px!important;line-height:1.2!important;width:48px!important;height:48px!important;min-width:48px;padding:6px!important}
html body .text-window-title{font-family:inherit;font-size:14px;font-weight:600;width:100%;box-sizing:border-box;margin-bottom:8px}
html body .text-window textarea{flex:1;min-height:0;width:100%;resize:none;box-sizing:border-box}
html body .profile-actions label[hidden],html body .profile-actions button[hidden]{display:none!important}
html body .gym-heatmap{grid-template-columns:none;grid-auto-columns:12px;max-width:100%;}
html[data-theme] body button.gym-day{rotate:0deg!important;transform:none!important}

html[data-theme] body #analytics-gym button.gym-day{border-radius:2px!important}
html[data-theme] body .muscle-plate-row.focused{border-radius:8px!important;rotate:0deg!important;transform:none!important}

html body .gym-heatmap{flex:1 1 auto;min-height:0;max-height:100%;overflow:auto}

html body .gym-calendar-heading{flex-wrap:wrap;flex-shrink:0;margin-bottom:6px}
html body .gym-calendar-heading h3{margin-inline-end:auto!important}
html body .gym-calendar-heading select[aria-label="Категория тренировок"]{max-width:min(220px,100%);min-width:0;text-overflow:ellipsis}
html body .gym-summary{width:min(420px,calc(100vw - 32px));box-sizing:border-box}
html body .gym-time-card{display:flex;flex-direction:column;gap:4px;padding:16px;margin-bottom:16px;border:1px solid var(--border);border-radius:10px;background:var(--accent-soft)}
html body .gym-time-value{font-size:28px;line-height:1.3;font-variant-numeric:tabular-nums}
html body .gym-muscle-badges{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px}
html body .gym-muscle-badge{display:inline-flex;padding:8px 12px;border:1px solid var(--accent);border-radius:8px;background:var(--accent-soft);color:var(--text);font-weight:600}

/* The weight card's grid display must also respect the shared window switch. */
html[data-theme] body .charts-page #allChartsMasterModal #analytics-weight.dashboard-window-hidden{display:none!important}

html body .deadline-label.deadline-compact{flex:none;font-size:11px!important;line-height:16px;padding:2px 6px;border-radius:6px}
/* Compact progress windows share the dashboard geometry and visibility controls. */
html[data-theme] body .progress-window{display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr);gap:4px 10px;padding:10px 12px!important;min-height:0!important;min-width:0!important;overflow:hidden!important;cursor:pointer}
html[data-theme] body .progress-window .kpi-header{grid-column:1;grid-row:1;margin:0;min-height:0}
html[data-theme] body .progress-window .kpi-title{font-size:12px!important;line-height:16px}
html[data-theme] body .progress-window .kpi-badge,html[data-theme] body .progress-window .kpi-progress,html[data-theme] body .progress-window .kpi-sub{display:none!important}
html[data-theme] body .progress-window .kpi-body{grid-column:1;grid-row:2;min-height:0;margin:0;line-height:1.1}
html[data-theme] body .progress-window .kpi-value{font-size:24px!important;line-height:1.1}
html[data-theme] body .progress-window-preview{grid-column:1;grid-row:3;display:flex;gap:4px;align-items:center;justify-content:flex-start;align-self:end;width:100%;min-height:0;min-width:0;overflow:hidden}
html body .progress-sparkline{display:block;width:100%;height:36px;max-height:100%}
html body .progress-week-day{display:block;width:9px;height:18px;border-radius:3px;background:var(--text-muted);opacity:.25}
html body .progress-week-day.qualified{background:var(--accent);opacity:1}
html body .progress-window.dashboard-window-hidden{display:none!important}
html body .progress-history-dialog{width:min(850px,calc(100vw - 32px));max-height:90dvh;box-sizing:border-box;overflow:auto}
html body .progress-history-dialog select{margin-bottom:12px}
html body .progress-history-body{margin-bottom:20px;min-width:0}
html body .progress-history-summary{font-variant-numeric:tabular-nums}
html body .discipline-history-chart{display:block;width:100%;height:auto;max-height:45dvh;color:var(--text);overflow:visible}
html body .discipline-history-chart rect[role=button]{cursor:pointer}
html body .streak-history-grid{display:grid;grid-auto-flow:column;grid-template-rows:repeat(7,16px);grid-auto-columns:16px;gap:4px;justify-content:start;overflow:auto;padding:3px;margin-bottom:14px}
html[data-theme] body .progress-history-dialog button.streak-history-day{width:16px!important;height:16px!important;min-width:16px!important;min-height:16px!important;padding:0!important;border:0!important;border-radius:3px!important;box-shadow:none!important;background:color-mix(in srgb,var(--text-muted) 22%,transparent)!important;rotate:0deg!important;transform:none!important}
html[data-theme] body .progress-history-dialog button.streak-history-day.qualified{background:var(--accent)!important}
html body .progress-day-dialog{width:min(520px,calc(100vw - 32px));max-height:85dvh;overflow:auto;box-sizing:border-box}
html body .progress-day-tasks{margin-bottom:16px;max-height:55dvh;overflow:auto}
html body .premium-editor-map{max-height:72dvh!important}
/* Seal the area outside the shell even when a theme paints the viewport. */
html[data-theme] body .app-layout-wrapper.app-layout-wrapper{border-image:none!important;outline:0!important;box-shadow:0 0 0 100vmax #08090b!important}
html body::after{border-color:#08090b!important;background:none!important;outline:0!important}
@media(max-width:1099px){html[data-theme] body .progress-window{flex:none!important;height:86px!important;min-height:86px!important}}

html body .monthly-column-chart{min-height:0!important;color:var(--text-muted)}
html body .monthly-column{cursor:pointer;outline:none}
html body .monthly-column-fill{fill:color-mix(in srgb,var(--accent) 40%,var(--bg-elev));transition:filter .15s}
html body .current-column .monthly-column-fill{fill:var(--accent)}
html body .monthly-column:is(:hover,:focus-visible) .monthly-column-fill{filter:brightness(1.25);stroke:var(--text);stroke-width:1.5}
html body .monthly-column-value{font-weight:600}
html body .premium-layout-editor{width:min(1500px,96vw)!important;max-height:94dvh!important;overflow:auto}

html[data-theme] body .monthly-column-chart .month-label{font-size:11px!important}

html[data-theme] body #categoryManagerModal #categoryEmojiGrid button{display:grid!important;place-items:center!important;box-sizing:border-box!important;inline-size:48px!important;block-size:48px!important;min-inline-size:48px!important;max-inline-size:48px!important;min-block-size:48px!important;max-block-size:48px!important;padding:4px!important;line-height:1!important;rotate:0deg!important;transform:none!important;overflow:hidden}
html body .subtask-deadline-row{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:6px;width:100%;min-width:0}
html body .task-category-dialog{width:min(440px,calc(100vw - 24px));box-sizing:border-box}
html body .task-category-dialog select{width:100%;min-width:0;box-sizing:border-box;margin-bottom:16px}
html body .task-category-dialog p{overflow-wrap:anywhere}
html body .task-category-dialog .action-buttons{flex-wrap:wrap}
/* Only the default arrangement is square; a Premium resize can choose any shape. */
html[data-theme] body :is(.snap-grid,.cockpit-4col-grid):not(.premium-dashboard-grid)>.progress-window{width:min(160px,100%)!important;height:160px!important;min-height:0!important;aspect-ratio:1;align-self:start}
html body .progress-square-default{align-self:start;justify-self:start}
/* Keep friend frames inside their cards and use one solid card surface. */
html[data-theme] body .friends-space .friends-grid{padding:6px;box-sizing:border-box}
html[data-theme] body .friends-space .friend-card{background:var(--card)!important}
html[data-theme] body .friends-space .friend-card .friend-preview{background:transparent!important;box-shadow:none!important;overflow:visible!important}
html[data-theme] body .friends-space .friend-card[data-ornate-frame]{border:8px solid transparent!important;border-image:var(--frame-art) 28 / 12px / 0 stretch!important;background-clip:padding-box!important}
/* Portraits use the same box regardless of their image's intrinsic dimensions. */
html[data-theme] body .creator-dialog .creator-avatar-menu{width:100%;min-width:0}
html[data-theme] body .creator-dialog .creator-portrait{width:100%;aspect-ratio:4/5;box-sizing:border-box}
html[data-theme] body .creator-dialog .creator-portrait img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
html body .team-cards{align-items:stretch}
html body .team-member>img,html body .team-avatar-fallback{width:64px;height:64px;min-width:64px;max-width:64px;min-height:64px;max-height:64px;flex:none;object-fit:cover;aspect-ratio:1}
html body .team-member>button:first-of-type{margin-top:auto}
@media(max-width:620px){html[data-theme] body .creator-dialog .creator-portrait{aspect-ratio:16/10}}

html[data-theme] body .friend-avatar>img{position:absolute;inset:0;inline-size:100%!important;block-size:100%!important;object-fit:cover!important;border-radius:inherit}


@media(max-width:620px){html body .team-cards{grid-template-columns:1fr}}

/* Progress windows */
.streak-week-chart{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;width:100%;margin-block:5px}
.streak-week-column{display:grid!important;justify-items:center;gap:4px;min-width:0!important;min-height:0!important;padding:2px 0!important;background:transparent!important;border:0!important;box-shadow:none!important;color:var(--text)!important}
.streak-week-column small{font-size:clamp(8px,1.1vw,11px)}
.streak-mark{display:grid;place-items:center;width:min(100%,22px);aspect-ratio:1;border-radius:50%;font-size:12px;font-weight:700;background:color-mix(in srgb,var(--text) 10%,transparent)}
.streak-week-column.qualified .streak-mark{background:var(--accent);color:var(--on-accent,#111)}
.streak-week-column.burned .streak-mark{color:#ff88a5;background:#44202a}
.streak-week-column.restored .streak-mark{outline:1px dashed currentColor;outline-offset:1px}
html[data-theme] body #card-streak .progress-window-preview{display:flex;flex-direction:column;align-items:stretch;align-self:stretch;gap:7px;overflow:auto}
html[data-theme] body #card-streak .kpi-body{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.streak-flame{font-size:1.4rem;line-height:1;filter:drop-shadow(0 0 7px #ff3768aa)}
.streak-meter{display:grid;gap:4px;font-size:11px;font-variant-numeric:tabular-nums}
.streak-meter progress{width:100%;height:8px;accent-color:var(--accent)}
.streak-coupons{align-self:start;font-size:11px!important;padding:3px 6px!important}
html[data-theme] body #card-discipline .progress-window-preview{align-self:stretch;display:flex;flex-direction:column;align-items:stretch;gap:8px;padding-top:4px}
html[data-theme] body #card-discipline .kpi-sub{display:inline!important}
#card-discipline .progress-window-preview>.btn-mini{align-self:start;flex:none;font-size:11px}
#card-discipline .progress-window-preview button:focus-visible{outline:2px solid var(--accent)!important;outline-offset:-3px!important}
html[data-theme] body #card-discipline #disciplineProgressBar{background:var(--accent)!important}
.discipline-period{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-block:10px}
.discipline-period strong{font-size:clamp(11px,2.8vw,15px)}
.discipline-heatmap,.discipline-calendar{--discipline-cell:14px;display:grid;grid-template-columns:repeat(auto-fill,var(--discipline-cell));grid-auto-rows:var(--discipline-cell);align-content:start;gap:4px}
.discipline-heatmap{--discipline-cell:20px}
.discipline-calendar{flex:1;min-height:0;overflow:hidden}
.discipline-calendar .discipline-day[hidden]{display:none!important}
html[data-theme] body :is(.progress-history-dialog,.discipline-calendar) button.discipline-day{align-self:start;aspect-ratio:1;width:var(--discipline-cell)!important;height:var(--discipline-cell)!important;min-width:0!important;min-height:0!important;padding:0!important;border:0!important;border-radius:3px!important;box-shadow:none!important;background:color-mix(in srgb,var(--accent) calc(var(--points) * 19%),color-mix(in srgb,var(--text) 28%,var(--card)))!important}
.discipline-day:disabled{visibility:hidden}
.discipline-detail{min-height:2em;font-size:.85rem;color:var(--text-muted)}
@media(max-width:1099px){
 html[data-theme] body :is(.snap-grid,.cockpit-4col-grid):not(.premium-dashboard-grid)>.progress-window{width:100%!important;aspect-ratio:auto}
 html[data-theme] body #card-streak.progress-window{height:175px!important;min-height:175px!important}
 html[data-theme] body #card-discipline.progress-window{height:220px!important;min-height:220px!important}
}
.network-badge{display:inline-block;border-radius:5px;padding:3px 6px;font-size:11px}.vpn-badge{background:#775117;color:#ffda82}.same-device-badge{background:#7c2424;color:#ffd5d5}.device-badge{font-family:monospace}


.streak-week-column:focus-visible{outline:2px solid var(--accent)!important;outline-offset:2px}
html body .gym-heatmap{grid-auto-flow:row;grid-template-columns:repeat(auto-fill,minmax(min(100%,20px),20px));grid-template-rows:none;grid-auto-rows:20px;gap:4px;overflow:auto}
html body #analytics-gym button.gym-day{width:100%!important;height:20px!important;max-width:20px!important;max-height:20px!important}
html body .gym-tooltip{position:fixed;inset:auto;max-width:calc(100vw - 16px);padding:7px 10px;background:var(--card,#17232b);color:var(--text);z-index:2147483646}
html body .gym-tooltip[hidden]{display:none!important}
html[data-theme] body .friends-space .friend-card[data-ornate-frame]{border-image:none!important;border:1px solid color-mix(in srgb,var(--frame-glow),var(--border) 45%)!important;border-radius:14px!important;background-clip:border-box!important;position:relative;isolation:isolate}
html[data-theme] body .friends-space .friend-card[data-ornate-frame]::before{content:"";position:absolute;inset:0;border:1px solid transparent;border-image:var(--frame-art) 28 / 12px / 0 stretch;border-radius:inherit;clip-path:inset(0 round 13px);pointer-events:none}
.friend-staff-badge{--staff-color:#dfac54;display:flex;align-items:center;gap:8px;width:fit-content;max-width:100%;padding:5px 10px;margin:3px 0;border:1px solid color-mix(in srgb,var(--staff-color),var(--border) 20%);border-radius:8px;background:color-mix(in srgb,var(--staff-color) 17%,var(--card));color:var(--text);text-align:left}
.friend-staff-badge[data-staff=moderator]{--staff-color:#ae83ec}.friend-staff-badge[data-staff=tester]{--staff-color:#51c7bd}.friend-staff-badge>span:first-child{font-size:1.25em}.friend-staff-badge :is(strong,small){display:block}.friend-staff-badge small{font-size:.68rem}
html body .team-cards>.team-member{display:grid;grid-template-rows:64px auto auto auto 1fr;align-items:start;align-content:start;gap:8px}
html body .team-cards>.team-empty{display:flex;justify-content:flex-end}
html body .team-member .team-card-actions{display:flex;gap:6px;flex-wrap:wrap;align-self:end}
html body .feature-levels:has(>[data-skill=code]){grid-auto-flow:row dense}
html body .feature-levels>.achievement-add{grid-column:1/-1;justify-self:start;min-height:0!important;height:auto!important;width:auto!important;resize:none}
html body .skill-card .skill-layout-tools{flex-wrap:wrap;justify-content:flex-end}
html body .admin-user-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;align-items:center;padding:6px 8px!important;min-height:0!important}
html body .admin-user-row>button{justify-self:start;min-height:0!important;padding:4px 8px!important;overflow-wrap:anywhere}
.admin-user-network{grid-column:1/-1;display:flex;align-items:center;flex-wrap:wrap;gap:6px}.admin-user-network small{overflow-wrap:anywhere}
.ip-match-card{display:grid;gap:6px;border:1px solid var(--border);border-radius:12px;background:var(--card);padding:8px 10px;margin:6px 0}.ip-match-head,.ip-match-accounts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.ip-match-head strong{font-family:monospace;overflow-wrap:anywhere}.ip-match-accounts button{max-width:100%;overflow-wrap:anywhere}

.developer-message-gif{display:block;max-width:100%;width:auto;height:auto;max-height:42dvh;object-fit:contain;margin:8px auto;border-radius:8px}.developer-message-gif[hidden]{display:none!important}

.friend-identity .friend-staff-line{display:grid;grid-template-columns:minmax(0,1fr) fit-content(55%);align-items:start;gap:6px}
.friend-staff-line>.friend-staff-badge{box-sizing:border-box;min-width:0;margin:0;gap:4px;padding:3px 5px;font-size:.79rem}
.friend-staff-line>.friend-staff-badge>span:last-child{min-width:0;overflow-wrap:anywhere}

html[data-theme] body .friend-preview .friend-identity .profile-name-line>strong{font-size:.96rem!important;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-theme] body .friend-identity>div>small{font-size:.86rem!important;line-height:1.3;overflow-wrap:anywhere}
html[data-theme=paper] body .friend-identity .profile-name-line>:is(strong,h2){--friend-nick-ink:var(--text);color:var(--text)!important;-webkit-text-fill-color:var(--text)!important;text-shadow:none!important;background:none!important;font-weight:800}

.friend-staff-line>.friend-staff-badge small{font-size:.62rem;line-height:1.15}
.friend-staff-line>.friend-staff-badge>span:first-child{font-size:1em}

/* Chart columns are marks, so theme button relief must not bleed into the chart edges. */
html[data-theme] body :is(#card-streak,.progress-history-dialog) button.streak-week-column{
 background:transparent!important;border:0!important;box-shadow:none!important;border-radius:6px!important
}
html[data-theme] body :is(#card-streak,.progress-history-dialog) button.streak-week-column:focus-visible{outline-offset:-2px!important}


#card-goals{display:flex;flex-direction:column;min-width:0;min-height:0;padding:12px;gap:10px;overflow:hidden}
#card-goals{container-type:inline-size}
#card-goals .goals-top{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:8px}
#card-goals .goals-deadline{justify-self:end;text-align:end;color:var(--text-muted);font-size:.72rem;font-variant-numeric:tabular-nums}
@container(max-width:280px){#card-goals .goals-top{grid-template-columns:1fr 1fr}#card-goals .goals-tabs{grid-row:2;grid-column:1 / -1;justify-self:center}}
#card-goals .goals-top h2,#card-goals .goal-card h3{font-size:1rem;margin:0;overflow-wrap:anywhere}
#card-goals .goals-tabs{display:flex;gap:2px;padding:2px;border-radius:999px;background:var(--bg-input)}
html[data-theme] body #card-goals .goals-tabs button{min-height:30px;border-radius:999px!important;background:transparent!important;border-color:transparent!important;box-shadow:none!important;padding:4px 8px}
html[data-theme] body #card-goals .goals-tabs [aria-pressed=true]{background:var(--accent-soft)!important;color:var(--accent)!important}
#card-goals .goals-content{flex:1;display:grid;align-content:start;gap:9px;min-height:0;overflow:auto}
#card-goals .goals-content p{margin:0;overflow-wrap:anywhere}
#card-goals .goals-footer{display:grid;gap:8px;max-height:55%;overflow:auto;padding-top:8px;border-top:1px solid var(--border-soft)}
#card-goals .goals-footer:empty{display:none}
#card-goals form,#card-goals .goals-grid,#card-goals .goal-card,#card-goals .goals-overall{display:grid;gap:6px}
#card-goals form{margin-top:6px}
#card-goals .goal-card{position:relative;padding:9px 34px 9px 9px}
#card-goals .goal-remove{position:absolute;right:6px;top:6px;min-width:24px;min-height:24px}
#card-goals .goal-status{justify-self:start;min-height:34px;border-radius:6px}
#card-goals .goal-status::before{content:'';display:inline-grid;place-items:center;width:1em;height:1em;margin-inline-end:.45em;border:1px solid currentColor;border-radius:2px;vertical-align:middle}
#card-goals .goal-status[aria-pressed=true]::before{content:'✓'}
#card-goals :is(input,select,progress){display:block;width:100%;min-width:0;box-sizing:border-box}
#card-goals progress{height:8px;accent-color:var(--accent)}
#card-goals :is(summary,button,input,select):focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
#card-goals label[hidden]{display:none!important}

/* Black glass uses the lifted surfaces and recessed controls of Soft volume. */
html[data-theme=black-glass]{
 --swaga-window-surface:linear-gradient(145deg,#2a1c22,#1b1317 55%,#170f13) padding-box,
 linear-gradient(145deg,#845a67,#b78494 18%,#48303a 55%,#60424d) border-box;
 --swaga-window-glow:inset 1px 1px 2px #ffd2dd25,inset -1px -1px 2px #0008,7px 9px 15px #0009,-3px -3px 9px #d1859d14;
 --black-glass-raised:inset 0 1px 1px #ffe6ed80,0 3px 0 #130a0f,0 6px 8px #0009;
 --black-glass-inset:inset 3px 4px 7px #0009,inset -2px -2px 5px #d1859d20;
}
html[data-theme=black-glass] body :is(.app-layout-wrapper,.theme-scenery){
 background:radial-gradient(ellipse at 20% 0%,#36121e,transparent 58%),#100a0d!important;
}
html[data-theme=black-glass] body :is(.panel,.snap-card,.draggable-card,.swaga-right-panel,.soft-sidebar,.friend-card,.master-chart-card,dialog):not([data-profile-frame]:not([data-profile-frame=""])){
 border:1px solid transparent!important;
 border-radius:18px!important;
 background:var(--swaga-window-surface)!important;
 box-shadow:var(--swaga-window-glow)!important;
}
/* Registered windows and panels mounted in the shared grids use the same paint.
   The layer gives theme paint precedence over older unlayered !important chrome. */
:root{--dashboard-panel-coverage:80%;--dashboard-panel-paint:var(--card)}
html[data-theme=paper]{--dashboard-panel-paint:var(--paper-stock)}
@layer swaga-window-theme{
 html[data-theme][data-scheme] body :is([data-swaga-window],.premium-added-panel,
  :is(.cockpit-4col-grid,.snap-grid,.custom-space,.premium-dashboard-grid,.all-charts-bento) > :is(section,article,.snap-card,.master-chart-card)){
  background-color:color-mix(in srgb,var(--scene-tint,var(--dashboard-panel-paint)) var(--dashboard-panel-coverage),transparent)!important;
  backdrop-filter:none!important;
  html:is([data-theme=rain-cabin],[data-theme=night-train]) &{
   background-image:none!important;
  }
  html[data-theme=black-glass] &{
   border:1px solid transparent!important;
   border-radius:18px!important;
   background:var(--swaga-window-surface)!important;
   box-shadow:var(--swaga-window-glow)!important;
  }
 }
}
html[data-theme=black-glass] body :is(button:not(.streak-week-column),summary,input,select,textarea){
 background:linear-gradient(170deg,#654553,#503440 43%,#36232d 100%)!important;
 color:var(--text)!important;border-color:#684752!important;box-shadow:var(--black-glass-raised)!important;
}
html[data-theme=black-glass] body :is(button,summary,input,select):not(.gym-day,.discipline-day,.streak-week-column){
 border-radius:999px!important;
}
html[data-theme=black-glass] body :is(button.btn-cyan,button.btn-cyan-pill,.swaga-send-btn){
 background:linear-gradient(160deg,#ff89a0,var(--accent) 55%,#ee355b)!important;color:#19070d!important;border-color:#ff7794!important;
}
html[data-theme=black-glass] body :is(input,select,textarea,.plan-editor,.day-card,.task-card-row,.subtask-item-card,.swaga-msg-bubble,.goal-card){
 background:linear-gradient(145deg,#1c1217,#261920)!important;border-color:#5c3e49!important;box-shadow:var(--black-glass-inset)!important;
}
html[data-theme=black-glass] body :is(button:not(.streak-week-column),summary):active{box-shadow:var(--black-glass-inset)!important}
html[data-theme=black-glass] body :is(#card-streak,#card-discipline) .kpi-value{color:var(--accent)!important}
html[data-theme=black-glass] body dialog::backdrop{background:#050505a8}

/* Scale the painted window around its center without changing its layout. */
@keyframes swaga-window-in{
 0%{opacity:.25;scale:.3;animation-timing-function:cubic-bezier(.23,.68,.28,1)}
 78%{opacity:1;scale:1.018;animation-timing-function:cubic-bezier(.22,.65,.32,1)}
 100%{opacity:1;scale:1}
}
@keyframes swaga-shade-in{from{opacity:0}to{opacity:1}}
@keyframes swaga-view-in{from{opacity:.42;translate:0 12px}to{opacity:1;translate:0 0}}
@media(prefers-reduced-motion:no-preference){
 /* The centering offset must precede scale; a transform-list offset would scale with it. */
 html[data-theme] body dialog:is(.action-dialog,.creator-dialog)[open]{translate:-50% -50%!important;transform:none!important}
 html[data-theme] body dialog[open],
 html[data-theme] body #allChartsMasterModal.lumina-modal-backdrop:not([style*="display: none"])>.full-graph-modal-dialog{
  transform-origin:center;animation:swaga-window-in 360ms backwards!important
 }
 html[data-theme] body dialog[open]::backdrop{animation:swaga-shade-in 240ms ease-out}
 html[data-theme] body :is(.cockpit-4col-grid,.custom-space,.friends-space):not([hidden]),
 html[data-theme] body .charts-page:not([hidden])>.charts-page-content:not([style*="display: none"]){
  animation:swaga-view-in 260ms cubic-bezier(.22,.75,.24,1)
 }
 html[data-theme] body :is(.soft-nav,.btn-mini,.action-icon-btn,.theme-swatch){transition:background-color 150ms ease,color 150ms ease,border-color 150ms ease}
}

.developer-gift-content[hidden]{display:none!important}
html[data-theme] body .security-dialog .developer-gift-option{display:flex;align-items:center;gap:8px}
html[data-theme] body .security-dialog .developer-gift-option input{width:1.05em!important;height:1.05em!important;min-height:0!important;accent-color:var(--accent)}
@layer swaga-gift-chrome{
html[data-theme] body dialog.developer-notice.developer-gift-sealed[open]{
 background:none!important;border:0!important;box-shadow:none!important;overflow:visible!important;backdrop-filter:none!important;
}
html[data-theme] body dialog.developer-gift-sealed[open]::before,html[data-theme] body dialog.developer-gift-sealed[open]::after{content:none!important}
}
.developer-gift{display:grid;place-items:center;padding:10px}
html[data-theme] body .developer-gift button.developer-gift-trigger{
 display:grid;justify-items:center;gap:18px;cursor:pointer;padding:20px!important;
 background:transparent!important;border:0!important;box-shadow:none!important;color:#fff!important;opacity:1!important;
}
.developer-gift-box{display:block;position:relative;width:min(70vw,60dvh,350px);aspect-ratio:1.3;margin-top:58px;border-radius:0 0 18px 18px;background:linear-gradient(90deg,#ac194c 41%,#ffe090 41% 59%,#b81e4f 59%);box-shadow:inset 0 -8px #0003,0 15px 30px #0006}
.developer-gift-lid{position:absolute;left:-8px;right:-8px;top:-25px;height:34px;border-radius:9px 9px 3px 3px;background:linear-gradient(90deg,#e3416a 42%,#fff1a3 42% 58%,#e3416a 58%);text-align:center;font-size:46px;line-height:0;transform-origin:left center}
canvas.developer-confetti:popover-open{position:fixed;inset:0;width:100vw;height:100vh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent!important;pointer-events:none}
@keyframes swaga-gift-open{0%{transform:scale(1)}45%{transform:rotate(-9deg) scale(1.15);opacity:1}100%{transform:rotate(7deg) scale(.5);opacity:0}}
@keyframes swaga-gift-lid{from{transform:none}to{transform:translate(-24px,-65px) rotate(-28deg)}}
@media(prefers-reduced-motion:no-preference){
 .gift-opening .developer-gift-lid{animation:swaga-gift-lid 350ms ease-out both}
 .gift-opening .developer-gift-box{animation:swaga-gift-open 350ms ease both}
 .gift-revealed{animation:swaga-view-in 230ms ease-out}
}


/* Compact navigation keeps existing views and shares the current theme colors. */
@layer swaga-sidebar{
 html[data-theme] body #mainSidebar.compact-sidebar{isolation:isolate}
 html[data-theme] body #mainSidebar.compact-sidebar>.soft-nav:not([hidden]){
  z-index:1;border:0!important;border-radius:50%!important;background:transparent!important;box-shadow:none!important;
  color:var(--text-muted)!important
 }
 html[data-theme] body #mainSidebar.compact-sidebar>.soft-nav[data-sidebar-current]{color:var(--accent)!important}
 html[data-theme=black-glass] body #mainSidebar.compact-sidebar>.soft-nav:not([hidden]){
  background:linear-gradient(155deg,#422d3788,#1d131966)!important;box-shadow:var(--black-glass-raised)!important
 }
 html[data-theme] body #mainSidebar.compact-sidebar>.soft-nav>span{color:inherit!important;text-shadow:none!important}
 #mainSidebar.compact-sidebar>.soft-nav.active::before,#mainSidebar.compact-sidebar>.soft-nav small{display:none!important}
 @media(min-width:1100px){
  html[data-theme] body #mainSidebar.compact-sidebar{width:var(--sidebar-width)!important;bottom:var(--sidebar-bottom,1.15rem)!important;padding-inline:12px!important;gap:8px!important;border-radius:18px!important}
  html[data-theme] body #mainSidebar.compact-sidebar>.soft-nav:not([hidden]){
   display:grid!important;grid-template-columns:20px minmax(0,1fr);align-items:center;direction:ltr;
   width:100%!important;height:42px!important;min-height:42px!important;flex:0 0 42px!important;margin:0!important;padding:0 9px!important;gap:8px!important;border-radius:12px!important
  }
  html[data-theme] body #mainSidebar.compact-sidebar>.section-shortcut:not(.legacy-dashboard-home,[data-view=custom]){display:none!important}
  html[data-theme] body #mainSidebar.compact-sidebar>.soft-nav>span{text-align:center;font-size:18px!important}
  html[data-theme] body #mainSidebar.compact-sidebar>.soft-nav small{display:block!important;min-width:0;font-size:.82rem!important;text-align:left;white-space:normal;overflow-wrap:anywhere}
  #mainSidebar.compact-sidebar .soft-sidebar-foot{display:none!important}
  html[data-theme] body .app-layout-wrapper:has(>#mainSidebar.compact-sidebar){--sidebar-width:clamp(148px,12vw,196px);padding-inline-start:calc(var(--sidebar-width) + 24px)!important}
 }
}
.sidebar-premium-card{flex:none}
.sidebar-premium-card>:is(strong,p),.sidebar-premium-label{display:none}
.sidebar-premium-label{font-size:.78rem}
.sidebar-selection{position:absolute;top:0;left:0;z-index:0;pointer-events:none;border-radius:999px;background:color-mix(in srgb,var(--accent) 22%,var(--card));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 35%,transparent)}
@media(prefers-reduced-motion:no-preference){.sidebar-selection{transition:transform 240ms cubic-bezier(.22,.75,.24,1),width 180ms ease,height 180ms ease}}
html[data-theme] body #mainSidebar button.sidebar-premium{
 position:relative;z-index:1;display:grid;place-items:center;flex:0 0 40px;min-width:40px;min-height:40px;padding:0!important;border-radius:50%!important;
 color:var(--accent)!important;background:color-mix(in srgb,var(--accent) 14%,var(--card))!important;font-size:19px;line-height:1
}
html[data-theme=black-glass] body #mainSidebar button.sidebar-premium{
 background:linear-gradient(170deg,#654553,#36232d)!important;box-shadow:var(--black-glass-raised)!important
}
@media(min-width:1100px){html[data-theme] body .premium-dashboard-grid>.premium-layout-panel:not(.dashboard-window-hidden){margin:8px!important}}
html[data-theme=black-glass] body #card-goals .goals-tabs button{
 background:linear-gradient(155deg,#422d37,#291d24)!important;box-shadow:var(--black-glass-raised)!important
}
html[data-theme=black-glass] body #card-goals .goals-tabs [aria-pressed=true]{
 background:linear-gradient(155deg,#57303f,#36232c)!important
}
@media(min-width:1100px){
 .sidebar-premium-card{
  width:100%;box-sizing:border-box;margin-top:auto;padding:12px 10px;display:grid;gap:8px;
  border:1px solid var(--border-soft);border-radius:16px;text-align:center;color:var(--text);
  background:linear-gradient(155deg,var(--accent-soft),var(--bg-input));
 }
 .sidebar-premium-card>:is(strong,p),.sidebar-premium-label{display:block}
 .sidebar-premium-card strong{font-size:.84rem}
 .sidebar-premium-card p{margin:0;color:var(--text-muted);font-size:.72rem;line-height:1.35}
 html[data-theme] body #mainSidebar button.sidebar-premium{display:flex;justify-content:center;gap:6px;width:100%;border-radius:10px!important}
}
#mainSidebar :is(.soft-nav,.sidebar-premium):focus-visible{outline:2px solid var(--accent)!important;outline-offset:-2px}
html[data-theme] body .sidebar-premium-dialog{width:min(620px,calc(100vw - 28px));max-height:85dvh;box-sizing:border-box;overflow:auto}
.sidebar-premium-heading{display:grid;grid-template-columns:auto 1fr auto;align-items:start;gap:12px;margin-bottom:18px}
.sidebar-premium-heading h2,.sidebar-premium-heading p,.sidebar-premium-features :is(h3,p){margin:0}
.sidebar-premium-heading p,.sidebar-premium-features p{color:var(--text-muted);line-height:1.45}
.sidebar-premium-symbol{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:var(--accent-soft);color:var(--accent);font-size:23px}
.sidebar-premium-features{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:0;padding:0;list-style:none}
.sidebar-premium-features li{padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--card)}
.sidebar-premium-features h3{font-size:.95rem;margin-bottom:4px}
.sidebar-premium-features p{font-size:.875rem}
.sidebar-purchase-actions{display:flex;justify-content:flex-end;margin-top:16px}
html[data-theme] body .sidebar-maintenance-dialog{text-align:center;width:min(340px,calc(100vw - 28px));box-sizing:border-box}
.sidebar-maintenance-dialog h2{font-size:1.125rem;margin:12px 0 16px}
.sidebar-maintenance-spinner{display:block;margin:auto;width:26px;height:26px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%}
@keyframes swaga-maintenance-spin{to{transform:rotate(1turn)}}
@media(prefers-reduced-motion:no-preference){.sidebar-maintenance-spinner{animation:swaga-maintenance-spin .85s linear infinite}}
@media(max-width:490px){.sidebar-premium-features{grid-template-columns:1fr}}

.glass-edge-glint{position:fixed;top:0;left:0;z-index:12;pointer-events:none;color:#fff3f6;text-shadow:0 0 5px #fff,0 0 11px #ff496e,0 0 16px #ff496e;font:17px/1 system-ui;opacity:0;will-change:transform,opacity}

.header-account-actions{display:grid;justify-items:end;gap:3px;min-width:0}
.header-download-app{font-size:.72rem;line-height:1.2;color:var(--text-muted);text-underline-offset:2px}
.header-download-app:hover,.header-download-app:focus-visible{color:var(--accent)}

html[data-theme] body .friends-layout:not(.friends-chat-active){grid-template-columns:minmax(0,1fr)}
html[data-theme] body .friends-page-head{flex-wrap:wrap}
html[data-theme] body .friends-chat-pane[hidden],html[data-theme] body .friends-requests-button[hidden]{display:none!important}
html[data-theme] body .friends-requests-dialog{width:min(680px,calc(100vw - 28px));max-height:85dvh;overflow:auto}
.friend-request-sections{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-block:12px}
.friend-request-sections section{min-width:0}
@media(max-width:560px){.friend-request-sections{grid-template-columns:1fr}}
.discipline-day:not(:disabled){outline:1px solid color-mix(in srgb,var(--text) 44%,transparent);outline-offset:-1px}

html body .soft-intro h1 .overview-heading-first { color:inherit; }

.ip-match-accounts [aria-pressed=true]{color:var(--accent);border-color:var(--accent)}

html[data-theme] body #card-discipline.progress-window{container:discipline / size}
@container discipline (max-height:110px){
 #card-discipline .progress-window-preview{gap:3px;padding-top:0}
 #card-discipline .progress-window-preview>.btn-mini{min-height:24px!important;padding:2px 5px!important;max-width:100%;white-space:normal}
 #card-discipline .kpi-value{font-size:1rem!important}
}
html[data-theme] body #card-discipline.progress-window{grid-template-columns:minmax(0,1fr) auto}
html[data-theme] body #card-discipline :is(.kpi-header,.kpi-body,.progress-window-preview){grid-column:1 / -1}
@container discipline (max-height:75px){
 html[data-theme] body #card-discipline .kpi-header{grid-column:1;min-width:0}
 html[data-theme] body #card-discipline .kpi-title{font-size:10px!important;line-height:13px}
 html[data-theme] body #card-discipline .kpi-body{grid-column:2;grid-row:1}
 html[data-theme] body #card-discipline .kpi-sub{display:none!important}
 html[data-theme] body #card-discipline .progress-window-preview{grid-row:2 / 4;gap:2px;padding-top:0}
 html[data-theme] body #card-discipline .progress-window-preview>.btn-mini{min-height:19px!important;font-size:10px!important;line-height:13px}
}
