/* Desk "Insights" section. Same tokens as the progress card: charcoal cards,
   #2a2a30 hairlines, shared workspace type roles, mint gains and coral needs-work
   (always with a symbol and a word). */
#statsPage .desk-insights {
    --di-card: #18181b; --di-rule: #2a2a30; --di-ink: #f5f5f7; --di-ink-2: #b5b5bf; --di-ink-3: #8e8e99;
    --di-link: #b6a6ff; --di-earned: #9ddbb5; --di-missed: #f3aba3;
    margin: 0 0 18px; scroll-margin-top: 80px; color: var(--di-ink);
    font: 400 1rem/1.5 var(--qp-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
}
#statsPage .desk-insights[hidden] { display: none; }
.desk-insights:focus { outline: none; }
.desk-insights:focus-visible { outline: 2px solid var(--di-link); outline-offset: 4px; border-radius: 6px; }
.desk-insights .di-title { margin: 0; font: 600 1.5rem/1.2 var(--font-display); color: var(--di-ink); }
.desk-insights .di-sub { margin: 4px 0 16px; font-size: .8125rem; color: var(--di-ink-2); }
.desk-insights .di-block { margin: 0 0 14px; padding: 24px; border: 1px solid var(--di-rule); border-radius: 12px; background: var(--di-card); }
.desk-insights .di-h3 { margin: 0 0 14px; font: 600 .6875rem/1.4 var(--qp-mono, 'JetBrains Mono', ui-monospace, Menlo, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--di-ink-3); }
.desk-insights .di-h4 { margin: 22px 0 10px; font: 600 .6875rem/1.4 var(--qp-mono, 'JetBrains Mono', ui-monospace, Menlo, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--di-ink-3); }
.desk-insights .di-fig { font: 400 1.25rem/1.2 var(--qp-serif, 'Source Serif 4', Georgia, serif); color: var(--di-ink); white-space: nowrap; }
.desk-insights .di-up { color: var(--di-earned); } .desk-insights .di-down { color: var(--di-missed); }
.desk-insights .di-fine { margin: 10px 0 0; font-size: .75rem; color: var(--di-ink-3); }
.desk-insights a { color: var(--di-link); font-weight: 600; text-underline-offset: 4px; }
.desk-insights :is(a, button, summary):focus-visible { outline: 2px solid var(--di-link); outline-offset: 3px; border-radius: 4px; }

/* topics */
.desk-insights .di-topics { display: grid; gap: 28px; }
@media (min-width: 900px) { .desk-insights .di-topics[data-cols="2"] { grid-template-columns: 1fr 1fr; column-gap: 40px; } }
.desk-insights .di-list { list-style: none; margin: 0; padding: 0; }
.desk-insights .di-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--di-rule); }
.desk-insights .di-row-main { display: flex; flex-direction: column; min-width: 0; }
.desk-insights .di-topic { font-size: .875rem; color: var(--di-ink); overflow-wrap: anywhere; }
.desk-insights .di-subject { font: 400 .6875rem/1.4 var(--qp-mono, 'JetBrains Mono', ui-monospace, Menlo, monospace); color: var(--di-ink-3); }
.desk-insights .di-practise { grid-column: 1 / -1; font-size: .8125rem; min-height: 24px; }

/* trend */
.desk-insights .di-chart-wrap { max-width: 724px; padding-left: 44px; }
.desk-insights .di-chart-plot { position: relative; }
.desk-insights .di-chart { display: block; width: 100%; height: auto; }
.desk-insights .di-grid { stroke: var(--di-rule); stroke-width: 1; fill: none; }
.desk-insights .di-line { fill: none; stroke: #b6a6ff; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.desk-insights .di-dot { fill: #b6a6ff; }
.desk-insights .di-ylab, .desk-insights .di-xlabs span { position: absolute; font: 400 11px/1 var(--qp-mono, 'JetBrains Mono', ui-monospace, Menlo, monospace); color: var(--di-ink-3); white-space: nowrap; }
.desk-insights .di-ylab { left: -44px; transform: translateY(-50%); }
.desk-insights .di-xlabs { position: relative; height: 22px; margin-top: 6px; }
.desk-insights .di-xlabs span { display: none; top: 0; transform: translateX(-50%); }
.desk-insights .di-xlabs span.is-alt { display: block; }
.desk-insights .di-xlabs span:last-child { transform: translateX(-100%); }
@media (max-width: 640px) {
    .desk-insights .di-xlabs span.is-alt { display: none; }
    .desk-insights .di-xlabs span.is-edge { display: block; }
    .desk-insights .di-xlabs span:first-child { transform: none; }
}

/* essays */
.desk-insights .di-weakest { margin: 0 0 16px; font-size: .9375rem; color: var(--di-ink-2); }
.desk-insights .di-weakest strong { color: var(--di-ink); font-weight: 600; }
.desk-insights .di-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.desk-insights .di-bars li { display: grid; grid-template-columns: minmax(0, 11rem) 1fr 2.5rem; align-items: center; gap: 12px; }
.desk-insights .di-bar-name { font-size: .8125rem; color: var(--di-ink-2); }
.desk-insights .di-bar { height: 6px; border-radius: 3px; background: var(--di-rule); overflow: hidden; }
.desk-insights .di-bar i { display: block; height: 100%; background: #b6a6ff; }
.desk-insights .di-bars .di-fig { text-align: right; font-size: 1rem; }
@media (max-width: 480px) { .desk-insights .di-bars li { grid-template-columns: 1fr 2.5rem; } .desk-insights .di-bar { grid-column: 1 / -1; grid-row: 2; } }
.desk-insights .di-essay { border-top: 1px solid var(--di-rule); }
.desk-insights .di-essay[hidden] { display: none; }
.desk-insights .di-essay-sum { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; cursor: pointer; list-style: none; }
.desk-insights .di-essay-sum::-webkit-details-marker { display: none; }
.desk-insights .di-essay-main { display: flex; flex-direction: column; min-width: 0; }
.desk-insights .di-essay-date { font-size: .875rem; color: var(--di-ink); }
.desk-insights .di-essay-meta, .desk-insights .di-essay-draft { font-size: .75rem; color: var(--di-ink-3); }
.desk-insights .di-essay-body { padding: 0 0 16px; }
.desk-insights .di-essay-summary { margin: 0 0 12px; font-size: .875rem; color: var(--di-ink-2); }
.desk-insights .di-crits { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.desk-insights .di-crit-name { display: block; font-size: .8125rem; font-weight: 600; color: var(--di-ink); }
.desk-insights .di-crit-comment { display: block; font-size: .8125rem; color: var(--di-ink-2); }
.desk-insights .di-more { margin-top: 12px; min-height: 44px; padding: 10px 18px; border: 1px solid #38383f; border-radius: 8px; background: transparent; color: var(--di-ink); font: 600 .875rem var(--qp-sans, system-ui, sans-serif); cursor: pointer; }
.desk-insights .di-more:hover { background: #222226; }
@media (max-width: 480px) { .desk-insights .di-block { padding: 20px; } .desk-insights .di-more { width: 100%; } }

/* Paid students with topic data here: drop the legacy duplicates on the desk. */
#statsPage.di-topics-on .student-progress-columns { display: none !important; }
