/* Speakzy — analysis page. Extends styles.css + app.css. */

.analysis {
  flex: 1;
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 32px var(--gutter) 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.analysis[hidden] { display: none; }

.acard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: clamp(24px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.acard[hidden] { display: none; }
.acard--muted {
  background: var(--surface-muted);
  border-color: var(--border-soft);
}

.acard__head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}
.acard__title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.acard__title--lg {
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.acard__title--eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--periwinkle);
}
.acard__text {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 52ch;
}
.acard__aside { font-size: 14px; color: var(--ink-muted); }
.acard__sub {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 6px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}
.acard__tools { display: flex; align-items: center; gap: 16px; }
.acard__tools .btn--link { min-height: 0; padding: 0; }
.acard__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

/* ---------- score header ---------- */

.score {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
}
.score__copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 320px;
  min-width: 0;
}
.score__prompt {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.18;
  text-wrap: pretty;
}
.stats { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat__value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.stat__label { font-size: 15px; color: var(--ink-subtle); }

.score__dial-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: none;
}
.dial--score { width: 136px; height: 136px; }
.dial__face--score {
  width: 112px;
  height: 112px;
  flex-direction: column;
  gap: 4px;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}
.dial__face--score::after {
  content: "Score";
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.score__note {
  font-size: 13px;
  color: var(--ink-subtle);
  max-width: 20ch;
  text-align: center;
  line-height: 1.5;
}

/* ---------- metric cards ---------- */

.grid--metrics { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ---------- pace chart ---------- */

.pace {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.pace__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.pace__slot {
  height: 150px;
  display: flex;
  align-items: flex-end;
}
.pace__bar {
  width: 100%;
  background: var(--track-strong);
  border-radius: 8px 8px 0 0;
  min-height: 2px;
}
.pace__bar--in { background: var(--lime); }
.pace__tick {
  height: 14px;
  font-size: 11px;
  color: var(--ink-subtle);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- filler rows ---------- */

.fillers { display: flex; flex-direction: column; gap: 14px; }
.filler {
  display: grid;
  grid-template-columns: minmax(80px, 120px) 1fr auto;
  gap: 14px;
  align-items: center;
}
.filler__word { font-size: 15px; font-weight: 500; }
.filler__track {
  height: 10px;
  background: var(--track);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.filler__fill {
  height: 100%;
  background: var(--lime);
  border-radius: var(--r-pill);
}
.filler__count {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- history ---------- */

.history {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.history__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.history__score {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.history__slot {
  height: 132px;
  width: 100%;
  display: flex;
  align-items: flex-end;
}
.history__bar {
  width: 100%;
  background: var(--track-soft);
  border-radius: 8px 8px 0 0;
  min-height: 2px;
}
.history__bar--latest { background: var(--lime); }
.history__day { font-size: 12px; color: var(--ink-subtle); }

/* ---------- transcript ---------- */

.legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-muted);
}
.legend__swatch {
  width: 13px;
  height: 13px;
  border-radius: 4px;
}
.legend__swatch--filler { background: var(--lime-soft); }
.legend__swatch--pause { background: var(--track); }

.transcript {
  margin: 0;
  font-size: 17px;
  line-height: 1.85;
}
.transcript mark {
  background: var(--lime-soft);
  color: var(--ink);
  border-radius: 5px;
  padding: 1px 5px;
}
.transcript .gap {
  display: inline-block;
  background: var(--track);
  color: var(--ink-subtle);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 5px;
  padding: 1px 7px;
  margin: 0 4px;
  font-variant-numeric: tabular-nums;
  vertical-align: 2px;
}

/* ---------- tips ---------- */

.tips {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px 36px;
}
.tip { display: flex; flex-direction: column; gap: 8px; }
.tip__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.tip__text {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-muted);
}
