/* ==========================================================================
   The post-exam analysis panel.

   Sits under the per-subject breakdown and answers the only question that matters
   after a mock exam: what do I fix next. Weakest topics first, every claim carried
   by a count, and the official thresholds spelled out — most candidates do not know
   English is 50% and would otherwise read a correct result as a bug.
   ========================================================================== */

.analysis {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.an-block {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

/* The block that says what went wrong. Amber rather than red: this is a practice
   run, and a wall of red on a first attempt reads as punishment. */
.an-block.is-alert {
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(120, 53, 15, 0.16);
}

/* The criteria reference: present for orientation, not competing for attention. */
.an-block.is-quiet {
  background: transparent;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.1);
}

.an-title {
  font-size: 13px;
  font-weight: 590;
  color: var(--ink);
  margin-bottom: 9px;
  letter-spacing: -0.01em;
}

.an-note {
  font-size: 13px;
  line-height: 1.62;
  color: var(--ink-2);
}
.an-note + .an-note { margin-top: 6px; }
.an-note b { color: var(--ink); font-weight: 590; }

/* ---------- per-topic rows ---------- */

.an-row {
  display: grid;
  /* Fixed centre column so every bar starts and ends at the same x, which is what
     makes the rows comparable at a glance. */
  grid-template-columns: minmax(0, 1fr) 88px auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}
.an-row + .an-row { border-top: 1px solid rgba(255, 255, 255, 0.05); }

.an-topic {
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.an-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.an-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .55s cubic-bezier(.32, .72, 0, 1);
}
.an-fill.is-weak { background: #F87171; }
.an-fill.is-strong { background: #4ADE80; }

.an-num {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  white-space: nowrap;
}

/* The single next action. Given its own emphasis because a list of six weak topics
   without a starting point is paralysing. */
.an-focus {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px;
  color: var(--accent-hi);
  font-weight: 520;
}

.an-caveat {
  font-size: 12.5px;
  color: var(--ink-4);
  line-height: 1.6;
  padding: 0 2px;
}

.an-cta { margin-top: 12px; }

/* The locked verdict, shown instead of a score when a free attempt is spent. Grey
   rather than red: nothing has gone wrong, the feature simply is not open. */
.score-verdict.is-locked {
  color: var(--ink-3);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

/* A failing subject's number, marked so the row reads correctly without relying on
   the bar colour alone. */
.bd-val.is-fail { color: #FCA5A5; }

@media (max-width: 560px) {
  .an-row {
    /* The bar is the first thing to go on a narrow screen: the fraction and the
       percentage carry the same information in less space. */
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .an-bar { display: none; }
  .an-block { padding: 13px 14px; }
}
