/* Détail view: metric list on the left, the selected metric large on the right
   (value, range, reference, level, chart, one cell per night or week). */

#player .focus {
  height: 100%;
  display: grid;
  grid-template-columns: clamp(220px, 24vw, 330px) minmax(0, 1fr);
  gap: clamp(10px, 1.2vw, 14px);
  min-height: 0;
}

/* metric list */
/* the list shares the height evenly; it scrolls inside itself only if a window is too short for every row */
#player .rail {
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 8px 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}
#player .rail .dh {
  margin: 10px 16px 6px;
  flex: none;
}
#player .ri {
  display: grid;
  grid-template-columns: 1fr auto 10px;
  align-items: center;
  gap: 10px;
  padding: 0 16px 0 14px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  flex: 1;
  min-height: 30px;
  max-height: 58px;
}
#player .ri:hover {
  background: var(--panel-hi);
}
#player .ri[aria-selected="true"] {
  border-left-color: var(--accent);
  background: var(--panel-hi);
}
#player .ri .n {
  font-size: 13.5px;
  color: var(--ink2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
#player .ri[aria-selected="true"] .n {
  color: var(--ink);
}
#player .ri .v {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  white-space: nowrap;
}
#player .ri .v .u {
  font-size: 10.5px;
}
#player .ri i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* selected metric */
#player .detail {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: clamp(12px, 2vh, 18px) 22px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
#player .detail .top2 {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}
#player .detail .ttl {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-right: auto;
  min-width: 0;
}
#player .detail .ttl .dh {
  flex: none;
}
#player .detail h2 {
  font-family: var(--cond);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1;
  margin: 0;
  font-size: clamp(22px, 3.2vh, 30px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#player .pager {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink2);
  white-space: nowrap;
  flex: none;
}
#player .arrow {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line2);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
}
#player .arrow:hover {
  background: var(--panel-hi);
  border-color: var(--hl);
}
#player .arrow:disabled {
  opacity: 0.3;
  cursor: default;
}
#player .detail .big {
  flex: none;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  margin-top: clamp(4px, 1vh, 10px);
  gap: clamp(16px, 2vw, 26px);
}
#player .detail .big .v {
  font-family: var(--cond);
  font-weight: 600;
  line-height: 1;
  font-size: clamp(38px, 6.2vh, 64px);
}
#player .detail .big .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 13.5px;
  color: var(--ink2);
}
#player .detail .big .meta em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink3t);
  display: block;
}
#player .detail .chart {
  flex: 1;
  min-height: 80px;
  margin-top: clamp(8px, 1.4vh, 14px);
}

/* legend and chart-style switch under the chart */
#player .stlg {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  margin-top: clamp(4px, 0.8vh, 8px);
  font-size: 12.5px;
  color: var(--ink2);
}
#player .stlg i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}
#player .stlg .nt {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink3t);
}
#player .tsel .seg button {
  padding: 3px 9px;
  font-size: 10.5px;
}

/* night cells (columns set inline: one row up to 15, two rows beyond) */
#player .nights {
  display: grid;
  gap: 4px;
  flex: none;
  margin-top: clamp(8px, 1.4vh, 14px);
}
#player .nc {
  border: 1px solid var(--line);
  padding: 6px 0 7px;
  text-align: center;
}
#player .nc .d {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink3t);
}
#player .nc .x {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.1;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
#player .nc .x i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
#player .nc .x .two {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  font-size: 15px;
}
#player .nc .x .two small {
  font-size: 12px;
  color: var(--ink2);
  font-weight: 500;
}
#player .nc.off {
  border-style: dashed;
  border-color: var(--none);
}
#player .nc.off .x {
  color: var(--ink3t);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
}
#player .nc.hl {
  background: var(--panel-hi);
  border-color: var(--hl);
}
