/* ==========================================================================
   Trend on Squad Assessment (tn-)

   The last 14 days behind the Today band: the Wellness and Data views of the
   player popover and the wellness click card. Drawn as inline SVG by
   components/trend.js; every mark takes its ink here, from the tokens.
   ========================================================================== */

.tn-svg {
    display: block;
    max-width: 100%;
    height: auto;
    overflow: visible;
    font-family: var(--font-system);
}

.tn-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tn-panel .tn-svg { margin-top: 6px; }

/* ── The panel: one row per metric around the group's line ── */
.tn-label {
    fill: var(--text-secondary);
    font-size: var(--type-label);
}

.tn-row-light { fill: var(--text-tertiary); }
.tn-row-light.is-on { fill: var(--text-primary); }
.tn-row-light.is-conv { fill: var(--status-injured); }

/* ── The day axis, shared by the views and the hover ── */
.tn-date {
    fill: var(--text-secondary);
    font-size: var(--type-label);
}

.tn-code,
.tn-off {
    fill: var(--text-tertiary);
    font-size: var(--type-label);
}

.tn-date.is-match,
.tn-code.is-match {
    fill: var(--text-primary);
    font-weight: 600;
}

/* ── The key beside the panel title ── */
.tn-key {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--text-tertiary);
    font-size: var(--type-label);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.tn-key > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── The wellness click card: answers against the usual ── */
.player-table td[data-tn-item] {
    cursor: pointer;
}

.player-table td[data-tn-item]:focus-visible {
    outline: 1px solid var(--focus-ring);
    outline-offset: -3px;
    border-radius: var(--radius-sm);
}

.tn-hover {
    position: fixed;
    z-index: 125;
    width: 700px;
    max-width: calc(100vw - 16px);
    box-sizing: border-box;
    padding: 12px 16px;
    background: var(--surface-chrome);
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-pop);
    color: var(--text-primary);
    font-family: var(--font-system);
    text-align: left;
    white-space: normal;
    pointer-events: none;
}

.tn-hover[hidden] { display: none; }

.tn-hover-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.tn-hover-head b {
    font-size: var(--type-label);
    font-weight: 700;
}

.tn-hover-head span {
    color: var(--text-tertiary);
    font-size: var(--type-label);
}

.tn-hover-head .tn-hover-usual { margin-left: auto; }

.tn-usual {
    stroke: var(--text-tertiary);
    stroke-opacity: 0.5;
    stroke-dasharray: 3 3;
}

.tn-join {
    stroke: var(--text-tertiary);
    stroke-opacity: 0.7;
    stroke-width: 1.6;
    stroke-linecap: round;
}

.tn-scale {
    fill: var(--text-tertiary);
    font-size: var(--type-label);
}

/* The answers take the cell's own colour rule. */
.tn-dot {
    stroke: var(--surface-chrome);
    stroke-width: 1.5;
}

.tn-dot.is-good { fill: var(--wellness-good); }
.tn-dot.is-caution { fill: var(--wellness-caution); }
.tn-dot.is-concern { fill: var(--wellness-concern); }

.player-table td.tn-hovered {
    outline: 1px solid var(--ink-line-strong);
    outline-offset: -3px;
    border-radius: var(--radius-sm);
}

/* ── The Wellness view: five rows against the player's usual ── */
.tn-usual-k {
    fill: var(--text-tertiary);
    font-size: var(--type-label);
}

.tn-row-base { stroke: var(--ink-line); }

.tn-key-usual {
    display: inline-block;
    width: 14px;
    height: 0;
    border-top: 1px dashed var(--text-tertiary);
}

/* ── The Data view: which streams arrived ── */
.tn-have { fill: var(--text-secondary); }

.tn-missing {
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 1.4;
}

.tn-poor {
    fill: none;
    stroke: var(--text-tertiary);
    stroke-width: 1.4;
    stroke-dasharray: 2 2;
}

.tn-row-light.is-data { fill: var(--text-tertiary); }

.tn-key-have,
.tn-key-missing,
.tn-key-poor {
    display: inline-block;
    box-sizing: border-box;
    border-radius: var(--radius-circle);
}

.tn-key-have { width: 7px; height: 7px; background: var(--text-secondary); }
.tn-key-missing { width: 9px; height: 9px; border: 1px solid var(--text-primary); }
.tn-key-poor { width: 9px; height: 9px; border: 1px dashed var(--text-tertiary); }
