/* Current Figma Statistics 282:4368 / 878:23257; dynamic data, never sample bars. */
html[data-lunora-ui="2"] .tab-panel[data-tab="statistics"].active {display:flex;flex-direction:column;gap:16px;padding-top:12px;}
.v2-stats-section {display:flex;flex-direction:column;gap:8px;}
.v2-stats-divider {display:flex;align-items:center;gap:12px;height:20px;margin:0;font:500 11px/16px Inter,sans-serif;color:var(--lunora-muted);text-transform:uppercase;}
.v2-stats-divider::before,.v2-stats-divider::after {content:"";height:1px;flex:1;background:#e2dcf5;}
.v2-stats-divider>span {flex:1;min-width:0;}
:root[data-theme="dark"] .v2-stats-divider::before,:root[data-theme="dark"] .v2-stats-divider::after {background:#423b56;}
.v2-stats-filters {display:flex;flex-direction:column;gap:12px;min-height:134px;box-sizing:border-box;border-radius:16px;background:var(--lunora-surface);padding:16px;}
.v2-stats-selects {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;}
.v2-stats-selects .home-chart-field {min-width:0;display:flex;flex-direction:column;gap:8px;}
.v2-stats-selects .home-chart-control-label,.v2-stats-range {font:400 12px/16px Inter,sans-serif;color:var(--lunora-muted);}
.v2-stats-selects .custom-select {position:relative;width:100%;}
.v2-stats-selects .custom-select-btn {display:flex;align-items:center;gap:8px;height:48px;min-height:48px;width:100%;padding:0 12px;border:0;border-radius:12px;background:var(--lunora-field);font:500 14px/20px Inter,sans-serif;color:var(--lunora-text);}
.v2-stats-selects .custom-select-btn>span:first-child {flex:1;text-align:left;min-width:0;}
.v2-stats-selects .custom-select-chevron {display:none;}
.v2-stats-selects .custom-select-menu {position:absolute;z-index:42;top:calc(100% + 6px);left:0;right:0;display:flex;flex-direction:column;gap:2px;padding:8px;background:var(--lunora-surface);border:0;border-radius:12px;box-shadow:0 1px 2px #1a14290a,0 6px 10px #1a142917;overflow-y:auto;}
.v2-stats-selects .custom-select-menu[hidden] {display:none;}
.v2-stats-selects .drop-up .custom-select-menu {top:auto;bottom:calc(100% + 6px);}
.v2-stats-selects .custom-select-item {display:flex;align-items:center;text-align:left;min-height:44px;height:44px;flex:none;width:100%;padding:0 12px;border:0;border-radius:8px;color:var(--lunora-text);background:transparent;font:400 13px/20px Inter,sans-serif;}
.v2-stats-selects .custom-select-item.active {background:var(--lunora-nav-active);color:#5d4ba6;font-weight:700;}
:root[data-theme="dark"] .v2-stats-selects .custom-select-item.active {color:var(--lunora-nav-ink);}
.v2-stats-selects .custom-select-item.active::after {content:none;}
.v2-stats-check {position:relative;flex:0 0 18px;width:18px;height:18px;margin-left:auto;visibility:hidden;}
.v2-stats-check>.lunora-asset {position:absolute;left:3px;top:3.75px;}
.v2-stats-selects .custom-select-item.active .v2-stats-check {visibility:visible;}
.v2-stats-selects .custom-select-item:disabled {color:var(--lunora-muted);opacity:.45;}
.v2-stats-selects button:focus-visible {outline:2px solid var(--lunora-primary);outline-offset:2px;}
.v2-stat-card {display:flex;flex-direction:column;gap:8px;min-width:0;padding:16px;border-radius:16px;background:var(--lunora-surface);box-sizing:border-box;}
.v2-stat-heading {display:flex;align-items:center;gap:8px;height:32px;min-height:32px;max-height:32px;}
.v2-stat-icon {width:32px;height:32px;flex:0 0 32px;border-radius:8px;position:relative;background:#ebe6f7;}
.v2-stat-icon[data-metric="wake"] {background:#f9f0da;}.v2-stat-icon[data-metric="height"] {background:#ddf1ea;}.v2-stat-icon[data-metric="head"] {background:#dff1e7;}.v2-stat-icon[data-metric="chest"] {background:#f9efdd;}
:root[data-theme="dark"] .v2-stat-icon {background:#3c3456;}
:root[data-theme="dark"] .v2-stat-icon[data-metric="wake"],:root[data-theme="dark"] .v2-stat-icon[data-metric="chest"] {background:#363037;}
:root[data-theme="dark"] .v2-stat-icon[data-metric="height"],:root[data-theme="dark"] .v2-stat-icon[data-metric="head"] {background:#333038;}
.v2-stat-icon-slot {position:absolute;left:6px;top:6px;width:20px;height:20px;}
.v2-stat-icon-slot>.lunora-asset {position:absolute;}
.v2-stat-title {min-width:0;flex:1;font:500 16px/22px Inter,sans-serif;color:var(--lunora-text);margin:0;}
.v2-stat-summary {display:flex;flex-direction:column;align-items:flex-end;flex:none;}
.v2-stat-value {font:700 16px/21px Inter,sans-serif;color:var(--lunora-text);}
.v2-stat-card[data-metric="sleep"] .v2-stat-value,.v2-stat-card[data-metric="wake"] .v2-stat-value {font:600 15px/20px Inter,sans-serif;}
.v2-stat-caption {font:400 11px/14px Inter,sans-serif;color:var(--lunora-muted);}
.v2-stat-plot {display:flex;gap:8px;height:102px;min-width:0;}
.v2-stat-axis {display:flex;flex-direction:column;justify-content:space-between;flex:0 0 24px;font:400 11px/14px Inter,sans-serif;color:var(--lunora-muted);}
.v2-stat-bars {display:flex;gap:8px;min-width:0;flex:1;overflow-x:auto;scrollbar-width:none;overscroll-behavior-x:contain;}
.v2-stat-bars::-webkit-scrollbar {display:none;}
.v2-stat-column {height:102px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:5px;flex:0 0 38px;font:400 11px/14px Inter,sans-serif;color:var(--lunora-muted);}
.v2-stat-bar {width:22px;min-height:1px;max-height:78px;border-radius:8px;background:var(--lunora-primary);}
.v2-stat-card[data-metric="wake"] .v2-stat-bar {background:#fed47a;}
.v2-stat-card[data-metric="height"] .v2-stat-bar {background:#52af98;}
.v2-stat-card[data-metric="head"] .v2-stat-bar {background:#69a8d0;}
:root[data-theme="dark"] .v2-stat-card[data-metric="height"] .v2-stat-bar {background:#78c7a8;}
:root[data-theme="dark"] .v2-stat-card[data-metric="head"] .v2-stat-bar {background:#87b7e2;}
.v2-stat-card[data-metric="chest"] .v2-stat-bar {background:#e7a73f;}
.v2-stat-card[data-measure] .v2-stat-plot,.v2-stat-card[data-measure] .v2-stat-bars {gap:12px;}
.v2-stat-card[data-measure] .v2-stat-column {flex-basis:48px;}
.v2-stat-empty {display:flex;min-height:56px;align-items:center;justify-content:center;font:400 13px/17px Inter,sans-serif;color:var(--lunora-muted);}
.v2-stats-state {display:flex;flex-direction:column;gap:12px;padding:24px 20px;border-radius:16px;background:var(--lunora-surface);}
.v2-stats-state h2 {margin:0;font:500 18px/24px Inter,sans-serif;color:var(--lunora-text);}
.v2-stats-state p {margin:0;font:400 14px/20px Inter,sans-serif;color:var(--lunora-muted);}
.v2-stats-state button {height:48px;border:0;border-radius:12px;background:var(--lunora-primary);color:#fff;font:500 14px/20px Inter,sans-serif;}
.v2-stat-plot[hidden],.v2-stat-empty[hidden],.v2-stats-state[hidden] {display:none;}
.v2-stats-loading {background:#ede9f5!important;}
:root[data-theme="dark"] .v2-stats-loading {background:#3c3456!important;}
html[data-lunora-ui="2"] .nav-item[data-tab="statistics"].active .v2-nav-circle {background:#e3effa;}
:root[data-theme="dark"][data-lunora-ui="2"] .nav-item[data-tab="statistics"].active .v2-nav-circle {background:#2c4052;}

.v2-stats-range {line-height:18px;}
.v2-stats-selects .home-chart-field:last-child .custom-select-btn {border-radius:10px;}
html:not([lang="ru"]):not([lang="en"]) .v2-stat-heading {height:auto;max-height:none;}
.v2-stats-selects .custom-select-btn>span:first-child {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

.v2-stat-axis[hidden] {display:none;}
.v2-stat-plot.is-loading {gap:0;}
.v2-stat-bars.is-loading {height:102px;align-items:flex-end;gap:10px;overflow:hidden;}
.v2-stat-bars.is-loading>.v2-stat-bar {width:26px;flex:0 0 26px;}
.v2-stat-empty.is-period {min-height:26px;padding:4px 0;box-sizing:border-box;justify-content:flex-start;line-height:18px;color:#756c93;}
:root[data-theme="dark"] .v2-stat-empty.is-period {color:var(--lunora-muted);}

/* Owner correction: a shared baseline, bounded labels and readable long periods. */
.v2-stat-plot{height:111px;min-height:111px;max-width:100%}
.v2-stat-axis{height:92px;margin-top:-7px;flex-shrink:0}
html[data-lunora-ui="2"] .v2-stat-card .v2-stat-bars:not(.is-loading){display:grid;grid-template-columns:repeat(var(--stat-count,7),minmax(0,1fr));gap:8px;overflow:hidden;min-width:0}
html[data-lunora-ui="2"] .v2-stat-card .v2-stat-bars.is-compact{gap:4px}
.v2-stat-column{position:relative;display:grid;grid-template-rows:78px 28px;row-gap:5px;height:111px;min-width:0;width:auto;justify-content:stretch;align-items:stretch;flex:none}
.v2-stat-column>.v2-stat-bar{grid-row:1;align-self:end;justify-self:center;width:min(22px,70%);min-width:1px;flex-shrink:0}
.v2-stat-label{position:absolute;top:83px;left:0;right:0;display:block;height:28px;width:100%;font:400 11px/14px Inter,sans-serif;text-align:center;white-space:normal;overflow:hidden;overflow-wrap:anywhere}
.v2-stat-label.is-spacer{visibility:hidden}
.is-compact .v2-stat-label{left:50%;right:auto;width:calc(200% + 8px);transform:translateX(-50%)}
.is-compact .v2-stat-column:first-child .v2-stat-label{left:0;transform:none;text-align:left}
.is-compact .v2-stat-column:last-child .v2-stat-label{left:auto;right:0;transform:none;text-align:right}
.v2-stat-pager{display:grid;grid-template-columns:1fr auto 1fr;gap:8px;align-items:center;margin-left:32px;min-width:0}
.v2-stat-page-button{min-width:0;min-height:28px;padding:4px 8px;border:0;border-radius:8px;background:var(--lunora-field);color:var(--lunora-primary);font:500 11px/16px Inter,sans-serif}
.v2-stat-page-button:disabled{opacity:.4;cursor:default}
.v2-stat-page-range{font:400 11px/14px Inter,sans-serif;color:var(--lunora-muted);white-space:nowrap}
.v2-stat-page-button:focus-visible{outline:2px solid var(--lunora-primary);outline-offset:2px}

.v2-stat-label-line{display:block;white-space:nowrap;overflow:hidden;text-overflow:clip;height:14px}
@media(max-width:360px){.v2-stat-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}

/* Owner review: separate tick labels from header and center every axis label. */
.v2-stat-plot{margin-top:8px;}
.v2-stat-axis{text-align:center;}
.v2-stat-label,.v2-stat-label-line{text-align:center;}
html[data-lunora-ui="2"] .v2-stat-card .v2-stat-bars.is-compact{padding-inline:16px;box-sizing:border-box;}
.is-compact .v2-stat-column:first-child .v2-stat-label,.is-compact .v2-stat-column:last-child .v2-stat-label{left:50%;right:auto;transform:translateX(-50%);text-align:center;}
.v2-stat-column[role=button]{cursor:pointer;border-radius:8px;-webkit-tap-highlight-color:transparent;}
.v2-stat-column[role=button]:focus-visible{outline:2px solid var(--lunora-primary);outline-offset:-2px;}
.v2-stat-tooltip{position:fixed;z-index:150;box-sizing:border-box;max-width:min(280px,calc(100vw - 16px));padding:9px 12px;border:1px solid rgba(110,100,140,.15);border-radius:12px;background:var(--lunora-surface,#fff);color:var(--lunora-text);box-shadow:0 4px 20px rgba(30,24,46,.18);font:500 12px/18px Inter,sans-serif;text-align:center;white-space:normal;overflow-wrap:anywhere;pointer-events:none;animation:v2-stat-tooltip-in 140ms ease-out;}
.v2-stat-tooltip[hidden]{display:none;}
:root[data-theme=dark] .v2-stat-tooltip{background:#383244;border-color:#514760;box-shadow:0 5px 18px rgba(0,0,0,.32);}
@keyframes v2-stat-tooltip-in{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
.v2-stat-tooltip.is-leaving{animation:v2-stat-tooltip-out 110ms ease-in forwards;}
@keyframes v2-stat-tooltip-out{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(3px)}}
@media(prefers-reduced-motion:reduce){.v2-stat-tooltip{animation:none;}}

/* Owner long-period charts: one continuous series and an anchored vertical axis. */
html[data-lunora-ui="2"] .v2-stat-card .v2-stat-bars.is-scrollable:not(.is-loading){
  grid-template-columns:repeat(var(--stat-count),minmax(12px,1fr));gap:3px;
  overflow-x:auto;overflow-y:hidden;padding:0 16px 12px;
  scrollbar-width:none;
  overscroll-behavior-x:contain;min-width:0;touch-action:pan-x pan-y;
}
html[data-lunora-ui="2"] .v2-stat-card .v2-stat-bars.is-scrollable::-webkit-scrollbar{display:none;width:0;height:0}
.v2-stat-bars.is-scrollable::-webkit-scrollbar-thumb{background:#81788e;border-radius:4px}
.v2-stat-bars.is-scrollable::-webkit-scrollbar-track{background:#e6def5;border-radius:4px}
html[data-lunora-ui="2"] .v2-stat-card:has(.v2-stat-bars.is-scrollable) .v2-stat-plot{height:129px;min-height:129px}
.v2-stat-bars.is-scrollable .v2-stat-bar{width:min(8px,80%);border-radius:3px}
.v2-stat-bar{transform-origin:center bottom}
.v2-stat-bars.is-scrollable .v2-stat-label{width:44px;max-width:none;justify-self:center;font-size:10px;line-height:13px}
.v2-stat-bars:focus-visible{outline:2px solid var(--lunora-primary);outline-offset:3px;border-radius:4px}

html[data-lunora-ui="2"] .v2-stat-card .v2-stat-bars.is-scrollable{scrollbar-width:none}
html[data-lunora-ui="2"] .v2-stat-card .v2-stat-bars.is-scrollable::-webkit-scrollbar{display:none}
html[data-lunora-ui="2"] .v2-stat-card .v2-stat-scroll{
  display:block;appearance:none;-webkit-appearance:none;box-sizing:border-box;
  width:calc(100% - 32px);height:18px;margin:-9px 0 0 32px;padding:0;border:0;border-radius:0;
  background:transparent;cursor:pointer;box-shadow:none;accent-color:var(--lunora-primary);
}
html[data-lunora-ui="2"] .v2-stat-card .v2-stat-scroll[hidden]{display:none}
.v2-stat-scroll::-webkit-slider-runnable-track{height:3px;background:#e3daf4;border-radius:4px}
.v2-stat-scroll::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;height:3px;width:var(--thumb-width,24px);background:#7e748c;border-radius:4px}
.v2-stat-scroll::-moz-range-track{height:3px;background:#e3daf4;border-radius:4px}
.v2-stat-scroll::-moz-range-thumb{height:3px;width:var(--thumb-width,24px);background:#7e748c;border:0;border-radius:4px}
:root[data-theme="dark"] .v2-stat-scroll::-webkit-slider-runnable-track{background:#51465f}
:root[data-theme="dark"] .v2-stat-scroll::-webkit-slider-thumb{background:#b4a3d9}
:root[data-theme="dark"] .v2-stat-scroll::-moz-range-track{background:#51465f}
:root[data-theme="dark"] .v2-stat-scroll::-moz-range-thumb{background:#b4a3d9}
.v2-stat-scroll:focus-visible{outline:2px solid var(--lunora-primary);outline-offset:3px;border-radius:8px}

/* Mouse/pen dragging complements native touch scrolling. Only custom range below. */
.v2-stat-bars.can-drag{cursor:grab;user-select:none;-webkit-user-select:none}
.v2-stat-bars.can-drag .v2-stat-column{cursor:grab}
.v2-stat-bars.is-dragging,.v2-stat-bars.is-dragging *{cursor:grabbing;user-select:none;-webkit-user-select:none}

/* Fitting charts do not pan due to sparse labels extending a few pixels. */
html[data-lunora-ui="2"] .v2-stat-card .v2-stat-bars:not(.is-scrollable){overflow-x:hidden}
.v2-stat-plot{margin-top:16px}
html[data-lunora-ui="2"] .v2-stat-card:has(.v2-stat-bars.is-scrollable) .v2-stat-plot{height:var(--stat-plot-height,111px);min-height:var(--stat-plot-height,111px)}
html[data-lunora-ui="2"] .v2-stat-card .v2-stat-bars.is-scrollable:not(.is-loading){padding-bottom:0}
.v2-stat-bars.is-scrollable .v2-stat-column{height:calc(83px + var(--stat-label-height,28px))}
.v2-stat-bars.is-scrollable .v2-stat-label{height:var(--stat-label-height,28px)}
