.toefl-flash-progress-card,
.toefl-flash-progress-card * {
  box-sizing: border-box;
}

.toefl-flash-progress-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--toefl-flash-line, #dfe5df);
  border-radius: 20px;
  color: var(--toefl-flash-ink, #17352b);
  background:
    radial-gradient(circle at 94% 0, rgba(200, 239, 101, .2), transparent 38%),
    var(--toefl-flash-white, #fff);
}

.toefl-flash-progress-card[hidden] {
  display: none !important;
}

.toefl-flash-v3-home > .toefl-flash-progress-card {
  grid-column: 1 / -1;
}

.toefl-flash-library > .toefl-flash-progress-card {
  margin-top: 22px;
}

.toefl-flash-progress-heading,
.toefl-flash-progress-facts,
.toefl-flash-history-dialog header,
.toefl-flash-history-events article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toefl-flash-progress-heading h2,
.toefl-flash-progress-heading p,
.toefl-flash-history-dialog h2,
.toefl-flash-history-dialog p {
  margin: 0;
}

.toefl-flash-progress-heading p,
.toefl-flash-history-state,
.toefl-flash-history-events article p {
  color: var(--toefl-flash-muted, #637069);
}

.toefl-flash-progress-heading h2 {
  margin-top: 4px;
  font-size: 1.3rem;
}

.toefl-flash-progress-facts {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 20px 0;
}

.toefl-flash-progress-facts span {
  min-width: 120px;
  color: var(--toefl-flash-muted, #637069);
  font-size: .76rem;
}

.toefl-flash-progress-facts strong {
  display: block;
  color: var(--toefl-flash-ink, #17352b);
  font-size: 1.15rem;
}

.toefl-flash-progress-activity {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
  height: 150px;
  overflow: hidden;
}

.toefl-flash-progress-day {
  display: grid;
  grid-template-rows: 20px minmax(0, 1fr) 20px;
  gap: 5px;
  min-width: 0;
  text-align: center;
}

.toefl-flash-progress-day strong,
.toefl-flash-progress-day small {
  overflow: hidden;
  color: var(--toefl-flash-muted, #637069);
  font-size: .72rem;
  text-overflow: ellipsis;
}

.toefl-flash-progress-day > span {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #eef2ee;
}

.toefl-flash-progress-day i {
  display: block;
  width: min(24px, 62%);
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  background: var(--toefl-flash-green, #2d5f4d);
}

.toefl-flash-history-trigger {
  padding: 0;
  border: 0;
  color: var(--toefl-flash-green, #2d5f4d);
  background: transparent;
  font: inherit;
  font-size: .8rem;
  font-weight: 750;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.toefl-flash-history-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  color: var(--toefl-flash-ink, #17352b);
  background: var(--toefl-flash-white, #fff);
  box-shadow: 0 28px 80px rgba(13, 37, 29, .25);
}

.toefl-flash-history-dialog::backdrop {
  background: rgba(13, 37, 29, .55);
}

.toefl-flash-history-dialog header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--toefl-flash-line, #dfe5df);
}

.toefl-flash-history-dialog header button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--toefl-flash-line, #dfe5df);
  border-radius: 10px;
  color: inherit;
  background: transparent;
  font-size: 1.35rem;
  cursor: pointer;
}

.toefl-flash-history-body {
  max-height: calc(100vh - 150px);
  padding: 18px 24px 24px;
  overflow-y: auto;
}

.toefl-flash-history-state {
  margin-bottom: 16px !important;
  font-size: .86rem;
}

.toefl-flash-history-events {
  display: grid;
  gap: 10px;
}

.toefl-flash-history-events article {
  padding: 14px;
  border: 1px solid var(--toefl-flash-line, #dfe5df);
  border-radius: 12px;
  background: var(--toefl-flash-cream, #f7f5ef);
}

.toefl-flash-history-events article time,
.toefl-flash-history-events article p {
  font-size: .78rem;
}

.toefl-flash-history-events article p {
  margin-top: 7px;
}

.toefl-flash-history-note {
  padding: 12px;
  border-radius: 10px;
  background: #fff7d9;
}

.toefl-flash-dashboard-widget {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.toefl-flash-dashboard-widget[hidden] {
  display: none !important;
}

.toefl-flash-dashboard-count {
  min-width: 72px;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -.06em;
  text-align: center;
}

.toefl-flash-dashboard-copy h3,
.toefl-flash-dashboard-copy p {
  margin: 0;
}

.toefl-flash-dashboard-copy p {
  margin-top: 5px;
  color: var(--text-secondary, #637069);
}

.toefl-flash-dashboard-facts {
  display: flex;
  gap: 16px;
}

.toefl-flash-dashboard-facts span {
  min-width: 78px;
  color: var(--text-muted, #78716c);
  font-size: .7rem;
}

.toefl-flash-dashboard-facts strong {
  display: block;
  color: var(--text-primary, #1a1816);
  font-size: .95rem;
}

@media (max-width: 640px) {
  .toefl-flash-progress-card {
    padding: 19px;
  }

  .toefl-flash-progress-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toefl-flash-progress-facts span {
    min-width: 0;
  }

  .toefl-flash-progress-activity {
    gap: 4px;
    height: 132px;
  }

  .toefl-flash-progress-day strong,
  .toefl-flash-progress-day small {
    font-size: .64rem;
  }

  .toefl-flash-dashboard-widget {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .toefl-flash-dashboard-facts {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toefl-flash-dashboard-facts span {
    min-width: 0;
  }
}
