/* Reports page (report.html). Builds on style.css. */
.report { gap: 14px; }
.card { padding: 12px 14px; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin-bottom: 6px; }
.hint { margin: 0 0 6px; }
.chart { position: relative; width: 100%; min-height: 60px; }
.chart svg { display: block; overflow: visible; touch-action: pan-y; }
.loading { padding: 50px 0; text-align: center; }

/* Filter row */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 14px; position: relative; z-index: 5; }
.lbl { color: var(--muted); font-size: 13px; margin-right: 2px; }
.chips { border: 0; margin: 0; padding: 0; display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label > span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 14px; }
.chips input:checked + span { color: var(--text); border-color: #33476d; background: #1d2b4b; }
.chips input:not(:checked) + span .sw, .chips input:not(:checked) + span .ico { opacity: .35; }
.chips input:focus-visible + span { outline: 2px solid var(--blue); }
.chips .ico { width: 18px; height: 18px; }
.seg .lbl { padding: 0 6px 0 6px; align-self: center; }

.types-wrap { position: relative; }
.types-pop { position: absolute; left: 0; top: calc(100% + 6px); width: min(360px, calc(100vw - 32px)); max-height: 70vh; display: flex; flex-direction: column;
	background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.55); }
.types-pop[hidden] { display: none !important; }
.types-pop .type-list { overflow-y: auto; }
.type-group.dim { opacity: .45; }

/* Overview */
.presets { display: flex; flex-wrap: wrap; gap: 4px; }
.presets .btn.on { background: #1d3a6e; border-color: #2c5299; }
.presets .btn.sep { margin-right: 8px; }
.nav-area { fill: rgba(57,135,229,.28); }
.nav-line { fill: none; stroke: #3987e5; stroke-width: 1.5; }
.brush .selection { fill: rgba(140,192,255,.16); stroke: #8cc0ff; stroke-width: 1; shape-rendering: crispEdges; }
.brush .handle { fill: #8cc0ff; rx: 2; }
.nav .brush .handle { fill: transparent; }
.nav .brush .handle--w, .nav .brush .handle--e { fill: #8cc0ff; opacity: .8; }

/* Axes (recessive) */
.yaxis text, .taxis text, .xl { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.taxis text.strong { fill: var(--text); font-weight: 600; font-size: 12px; }
.yaxis .grid { stroke: #1b2540; stroke-width: 1; }
.yaxis .base { stroke: #3a4868; stroke-width: 1; }
.taxis .tk { stroke: #3a4868; }
.taxis .tk.major { stroke: #56658a; }
.taxis .vgrid { stroke: #2a3756; stroke-dasharray: 2 3; }

/* Detail */
.det-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.det-tools input[type=date] { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; color: var(--text); }
#det-h { font-size: 20px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 6px 0 8px; }
.lg { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 8px 2px 4px; cursor: pointer; font-size: 13px; color: var(--text); }
.lg:hover:not(:disabled) { border-color: var(--line); background: var(--panel-2); }
.lg:disabled { cursor: default; }
.lg b { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.lg.off { opacity: .4; }
.lg.off span { text-decoration: line-through; }
.sq { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.det .col.partial rect { opacity: .55; }
.det .hl { fill: rgba(230,235,245,.07); pointer-events: none; }
.det .brush .selection { fill: rgba(140,192,255,.14); }

.table-view { margin-top: 6px; }
.table-view summary { cursor: pointer; color: #8cc0ff; font-size: 13px; }
.tbl-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; margin-top: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 4px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--panel); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }

/* Line view */
.det .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.det .ln.dashed { stroke-dasharray: 3 4; opacity: .7; }
.det .cross { pointer-events: none; }
.det .cross line { stroke: #8a96ad; stroke-width: 1; stroke-dasharray: 2 3; }
.det .cross circle { stroke: var(--panel); stroke-width: 2; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; background: none; border: 0; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 0; }
.tile-h { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.tile-v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ranking + weekday */
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.rank td.tname { display: flex; align-items: center; gap: 6px; white-space: normal; min-width: 180px; }
.rank .x { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; padding: 0 4px; opacity: 0; }
.rank tr:hover .x, .rank .x:focus-visible { opacity: 1; }
.rank .barcell { width: 30%; min-width: 80px; }
.rank .bar { display: block; height: 8px; border-radius: 0 4px 4px 0; min-width: 1px; }
#rank-more { margin-top: 8px; }
.dow-bar { fill: #3987e5; }
.dow-bar:hover { fill: #5598e7; }
.dl { fill: var(--text); font-size: 12px; font-weight: 600; }

/* Tooltip */
.tip { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; background: #18223a; border: 1px solid #2e3d61; border-radius: 8px; padding: 8px 10px; font-size: 13px; box-shadow: 0 8px 28px rgba(0,0,0,.5); max-width: 320px; }
.tip-h { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.tip-total { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.tip-row { display: grid; grid-template-columns: 12px auto 1fr; gap: 6px; align-items: center; line-height: 1.5; }
.tip-row .key { width: 12px; height: 3px; border-radius: 2px; }
.tip-row b { font-variant-numeric: tabular-nums; text-align: right; }
.tip-row span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip-note { color: var(--muted); font-size: 12px; margin-top: 4px; font-style: italic; }

@media (max-width: 900px) {
	.two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
	.filters { gap: 8px 10px; }
	.tile-v { font-size: 20px; }
	#det-h { font-size: 17px; }
}

/* Line under the pointer: thicker, others fade, name shown beside it */
.det.has-hot .ln { opacity: .25; }
.det.has-hot .ln.dashed { opacity: .15; }
.det.has-hot .ln.hot { opacity: 1; stroke-width: 3.5; }
.det.has-hot .ln.hot.dashed { opacity: .8; stroke-width: 2.5; }
.det .ln-name { fill: var(--text); font-size: 13px; font-weight: 700; paint-order: stroke; stroke: var(--panel); stroke-width: 4px; stroke-linejoin: round; }
.tip-row.hot b, .tip-row.hot span { color: var(--text); }
.tip-row.hot { background: rgba(230,235,245,.08); border-radius: 4px; margin: 0 -4px; padding: 0 4px; }
.tip-row.hot .key { height: 5px; }

/* Trend view */
.trend .hit { fill: transparent; }
.trend .trow-g:hover .hit { fill: rgba(230,235,245,.05); }
.trend .tname { fill: var(--text); font-size: 13px; }
.trend .all .tname { font-weight: 700; }
.trend .tval { fill: var(--text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trend .col-h { fill: var(--muted); font-size: 11px; }
.trend .spark { fill: none; stroke: #8a96ad; stroke-width: 1.5; }
.trend .spark-fit { stroke-width: 2; stroke-dasharray: 4 3; }
.lg.static { cursor: default; }
.lg.static:hover { border-color: transparent; background: none; }
.detail.is-trend .brush { display: none; }
.sort-seg { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-size: 13px; }
.sort-seg .btn.on { background: #1d3a6e; border-color: #2c5299; }
