.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 {
  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(820px, calc(100% - 32px));
  height: min(880px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 28px;
  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 *,
.toefl-flash-history-reset-dialog * {
  box-sizing: border-box;
}

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

.toefl-flash-history-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.toefl-flash-history-dialog header {
  position: relative;
  z-index: 2;
  padding: 18px 26px 14px;
  border-bottom: 1px solid var(--toefl-flash-line, #dfe5df);
  background: var(--toefl-flash-white, #fff);
}

.toefl-flash-history-title-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
}

.toefl-flash-history-title-row h2 {
  font-size: 1.2rem;
  text-align: center;
}

.toefl-flash-history-title-row button,
.toefl-flash-history-card-nav button,
.toefl-flash-history-reset-dialog header button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: #f1f3f1;
  cursor: pointer;
}

.toefl-flash-history-title-row svg,
.toefl-flash-history-card-nav svg,
.toefl-flash-history-reset-dialog header svg,
.toefl-flash-history-dialog footer svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.toefl-flash-history-card-nav {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  max-width: 280px;
  margin: 10px auto 0;
  text-align: center;
}

.toefl-flash-history-card-nav button {
  background: transparent;
}

.toefl-flash-history-card-nav button:disabled {
  opacity: .3;
  cursor: default;
}

.toefl-flash-history-card-nav strong {
  color: var(--toefl-flash-muted, #637069);
  font-size: .82rem;
}

.toefl-flash-history-body {
  min-height: 0;
  padding: 26px 30px 34px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.toefl-flash-history-state {
  padding: 42px 12px;
  font-size: .9rem;
  text-align: center;
}

.toefl-flash-history-section-heading > p {
  color: #8a928e;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.toefl-flash-history-section-heading small {
  color: var(--toefl-flash-muted, #637069);
}

.toefl-flash-history-facts {
  margin: 0;
}

.toefl-flash-history-facts > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 68px;
  border-bottom: 1px solid #e4e7e4;
}

.toefl-flash-history-facts dt {
  color: #929995;
  font-size: .98rem;
}

.toefl-flash-history-facts dd {
  margin: 0;
  color: #28322e;
  font-size: 1rem;
  font-weight: 750;
  text-align: right;
}

.toefl-flash-history-review-section {
  margin-top: 30px;
}

.toefl-flash-history-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.toefl-flash-history-events {
  position: relative;
  display: grid;
  gap: 14px;
}

.toefl-flash-history-events::before {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 9px;
  width: 2px;
  background: #d7dcd9;
  content: '';
}

.toefl-flash-history-events article {
  position: relative;
  display: grid;
  grid-template-columns: 20px 132px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.toefl-flash-history-marker {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-left: 3px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #76827c;
  box-shadow: 0 0 0 1px currentColor;
}

.toefl-flash-history-rating {
  display: grid;
  gap: 3px;
  min-height: 68px;
  padding: 11px 14px;
  border-radius: 12px;
  color: #51605a;
  background: #f0f3f1;
  text-align: center;
}

.toefl-flash-history-rating strong {
  font-size: 1rem;
}

.toefl-flash-history-rating small {
  font-size: .8rem;
  font-weight: 750;
}

.toefl-flash-history-event-detail {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.toefl-flash-history-event-detail strong {
  color: #2d3632;
  font-size: .9rem;
}

.toefl-flash-history-event-detail time,
.toefl-flash-history-event-detail small {
  overflow-wrap: anywhere;
  color: #929995;
  font-size: .8rem;
}

.toefl-flash-history-events article.is-again {
  color: #ff4261;
}

.toefl-flash-history-events article.is-again .toefl-flash-history-rating {
  color: #e92f50;
  background: #fff0f3;
}

.toefl-flash-history-events article.is-hard {
  color: #f28a00;
}

.toefl-flash-history-events article.is-hard .toefl-flash-history-rating {
  color: #d97706;
  background: #fff8e6;
}

.toefl-flash-history-events article.is-good {
  color: #55bd21;
}

.toefl-flash-history-events article.is-good .toefl-flash-history-rating {
  color: #3fae16;
  background: #f2fbe9;
}

.toefl-flash-history-events article.is-easy {
  color: #178dde;
}

.toefl-flash-history-events article.is-easy .toefl-flash-history-rating {
  color: #087fcf;
  background: #edf7ff;
}

.toefl-flash-history-empty {
  position: relative;
  z-index: 1;
  padding: 20px;
  border-radius: 12px;
  color: var(--toefl-flash-muted, #637069);
  background: #f5f7f5;
  text-align: center;
}

.toefl-flash-history-dialog footer {
  position: relative;
  z-index: 2;
  padding: 12px 24px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--toefl-flash-line, #dfe5df);
  background: #fff;
}

.toefl-flash-history-dialog footer button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 13px;
  color: #2c332f;
  background: #eef0ee;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.toefl-flash-history-dialog footer button:disabled {
  opacity: .45;
  cursor: default;
}

.toefl-flash-history-note {
  margin-top: 18px !important;
  padding: 12px;
  border-radius: 10px;
  background: #fff7d9;
}

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

.toefl-flash-history-reset-dialog form > header,
.toefl-flash-history-reset-dialog form > div,
.toefl-flash-history-reset-dialog form > footer {
  padding: 20px 22px;
}

.toefl-flash-history-reset-dialog header,
.toefl-flash-history-reset-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.toefl-flash-history-reset-dialog header {
  border-bottom: 1px solid #e4e7e4;
}

.toefl-flash-history-reset-dialog h2 {
  margin: 0;
  font-size: 1.12rem;
}

.toefl-flash-history-reset-dialog form > div p {
  color: var(--toefl-flash-muted, #637069);
  line-height: 1.55;
}

.toefl-flash-history-reset-dialog form > div p + p {
  margin-top: 12px;
}

.toefl-flash-history-reset-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid #e4e7e4;
}

.toefl-flash-history-reset-dialog footer button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid #dbe1dd;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.toefl-flash-history-reset-dialog footer .is-danger {
  border-color: #b83245;
  color: #fff;
  background: #b83245;
}

.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;
  }

  .toefl-flash-history-dialog {
    width: calc(100% - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .toefl-flash-history-dialog header {
    padding: 12px 14px 10px;
  }

  .toefl-flash-history-title-row {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .toefl-flash-history-title-row button,
  .toefl-flash-history-card-nav button {
    width: 40px;
    height: 40px;
  }

  .toefl-flash-history-body {
    padding: 18px 16px 28px;
  }

  .toefl-flash-history-facts > div {
    min-height: 61px;
    gap: 14px;
  }

  .toefl-flash-history-facts dt,
  .toefl-flash-history-facts dd {
    font-size: .9rem;
  }

  .toefl-flash-history-events article {
    grid-template-columns: 18px 100px minmax(0, 1fr);
    gap: 9px;
  }

  .toefl-flash-history-events::before {
    left: 8px;
  }

  .toefl-flash-history-marker {
    margin-left: 2px;
  }

  .toefl-flash-history-rating {
    min-height: 62px;
    padding: 9px 8px;
  }

  .toefl-flash-history-event-detail strong,
  .toefl-flash-history-event-detail time,
  .toefl-flash-history-event-detail small {
    font-size: .75rem;
  }

  .toefl-flash-history-dialog footer {
    padding-inline: 16px;
  }

  .toefl-flash-history-reset-dialog footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.toefl-flash-progress-pro-lock {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

.toefl-flash-progress-pro-lock > span {
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  background: #7c3aed;
  font-size: .72rem;
  font-weight: 800;
}

.toefl-flash-progress-pro-lock h2,
.toefl-flash-progress-pro-lock p {
  margin: 0;
}

.toefl-flash-progress-pro-lock p {
  margin-top: .25rem;
  color: #64748b;
}

.toefl-flash-progress-pro-lock a {
  padding: .7rem .9rem;
  border-radius: 10px;
  color: #fff;
  background: #6d28d9;
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 640px) {
  .toefl-flash-progress-pro-lock {
    grid-template-columns: auto 1fr;
  }

  .toefl-flash-progress-pro-lock a {
    grid-column: 1 / -1;
    text-align: center;
  }
}
