:root {
  --toefl-flash-ink: #17352b;
  --toefl-flash-muted: #637069;
  --toefl-flash-green: #2d5f4d;
  --toefl-flash-green-dark: #1f493a;
  --toefl-flash-lime: #c8ef65;
  --toefl-flash-cream: #f7f5ef;
  --toefl-flash-line: #dfe5df;
  --toefl-flash-white: #fff;
}

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

.toefl-flash-library {
  width: min(1180px, calc(100% - 40px));
  min-width: 0;
  margin: 0 auto;
  padding: 42px 0 88px;
  color: var(--toefl-flash-ink);
}

.toefl-flash-library .hidden,
.toefl-flash-library [hidden] {
  display: none !important;
}

.toefl-flash-library-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 34px;
}

.toefl-flash-library-header > div {
  min-width: 0;
  max-width: 720px;
}

.toefl-flash-library-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  color: var(--toefl-flash-green);
  font-size: .9rem;
  font-weight: 750;
  text-decoration: none;
}

.toefl-flash-library-back svg,
.toefl-flash-library-card-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.toefl-flash-library-eyebrow,
.toefl-flash-library-quality {
  margin: 0 0 8px;
  color: var(--toefl-flash-green);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.toefl-flash-library-header h1 {
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 4.4rem);
  font-weight: 780;
  letter-spacing: -.055em;
  line-height: .98;
}

.toefl-flash-library-header p:not(.toefl-flash-library-eyebrow) {
  max-width: 650px;
  margin: 15px 0 0;
  color: var(--toefl-flash-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.toefl-flash-library-header nav {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 14px;
  background: var(--toefl-flash-white);
}

.toefl-flash-library-header nav a {
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--toefl-flash-muted);
  font-size: .88rem;
  font-weight: 750;
  text-decoration: none;
}

.toefl-flash-library-header nav a[aria-current="page"] {
  color: var(--toefl-flash-white);
  background: var(--toefl-flash-green);
}

.toefl-flash-library-search {
  max-width: 720px;
  margin-bottom: 22px;
}

.toefl-flash-library-create-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px 22px;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 16px;
  background: var(--toefl-flash-cream);
}

.toefl-flash-library-create-row h2 {
  margin: 0;
  font-size: 1.25rem;
}

.toefl-flash-library-create-row > div:last-child {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.toefl-flash-library-create-row > div:last-child a {
  flex: 0 0 auto;
  padding: 10px 15px;
  border-radius: 10px;
  color: var(--toefl-flash-white);
  font-weight: 800;
  text-decoration: none;
  background: var(--toefl-flash-green);
}

.toefl-flash-deck-list-card a {
  color: var(--toefl-flash-green);
  font-weight: 750;
}

.toefl-flash-library-search label {
  display: block;
  margin-bottom: 9px;
  font-size: .82rem;
  font-weight: 800;
}

.toefl-flash-library-search > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px 7px 7px 16px;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 16px;
  background: var(--toefl-flash-white);
  box-shadow: 0 8px 30px rgba(23, 53, 43, .05);
}

.toefl-flash-library-search svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #7d8b83;
  stroke-width: 2;
}

.toefl-flash-library-search input,
.toefl-flash-deck-cards-heading input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--toefl-flash-ink);
  background: transparent;
  font: inherit;
}

.toefl-flash-library-search button,
.toefl-flash-deck-cards-heading button,
.toefl-flash-library-empty button,
.toefl-flash-library-empty a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 11px;
  color: var(--toefl-flash-white);
  background: var(--toefl-flash-green);
  font: inherit;
  font-size: .86rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.toefl-flash-library-categories,
.toefl-flash-deck-controls > div {
  display: flex;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 2px 2px 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.toefl-flash-library-categories button,
.toefl-flash-deck-controls button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 999px;
  color: var(--toefl-flash-muted);
  background: var(--toefl-flash-white);
  font: inherit;
  font-size: .82rem;
  font-weight: 750;
  cursor: pointer;
}

.toefl-flash-library-categories button.is-active,
.toefl-flash-deck-controls button.is-active {
  border-color: var(--toefl-flash-green);
  color: var(--toefl-flash-white);
  background: var(--toefl-flash-green);
}

.toefl-flash-library-state {
  min-height: 24px;
  margin: 8px 0 18px;
  color: var(--toefl-flash-muted);
  font-size: .88rem;
}

.toefl-flash-library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.toefl-flash-library-card {
  display: flex;
  min-width: 0;
  min-height: 330px;
  padding: 22px;
  flex-direction: column;
  gap: 20px;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 0, rgba(200, 239, 101, .18), transparent 36%),
    var(--toefl-flash-white);
  box-shadow: 0 10px 35px rgba(23, 53, 43, .045);
}

.toefl-flash-library-card-topline,
.toefl-flash-library-card-facts,
.toefl-flash-library-card-link,
.toefl-flash-deck-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toefl-flash-library-card-topline {
  justify-content: space-between;
  color: var(--toefl-flash-muted);
  font-size: .7rem;
  font-weight: 800;
}

.toefl-flash-library-card-topline > span:last-child,
.toefl-flash-deck-badges span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eff5f0;
}

.toefl-flash-library-card-topline .is-locked,
.toefl-flash-deck-badges .is-pro {
  color: #684c0d;
  background: #fff2bf;
}

.toefl-flash-library-card-topline svg,
.toefl-flash-deck-badges svg,
.toefl-flash-deck-preview-locked > svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.toefl-flash-library-card h2 {
  margin: 3px 0 10px;
  font-size: 1.38rem;
  letter-spacing: -.025em;
  line-height: 1.15;
}

.toefl-flash-library-card h2 a {
  color: inherit;
  text-decoration: none;
}

.toefl-flash-library-card > div > p:not(.toefl-flash-library-quality) {
  margin: 0;
  color: var(--toefl-flash-muted);
  font-size: .9rem;
  line-height: 1.55;
}

.toefl-flash-library-card-facts {
  align-items: stretch;
  margin-top: auto;
}

.toefl-flash-library-card-facts span {
  min-width: 0;
  color: var(--toefl-flash-muted);
  font-size: .67rem;
  line-height: 1.25;
}

.toefl-flash-library-card-facts strong {
  display: block;
  color: var(--toefl-flash-ink);
  font-size: .78rem;
}

.toefl-flash-library-card-progress > span,
.toefl-flash-deck-progress-track {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece8;
}

.toefl-flash-library-card-progress i,
.toefl-flash-deck-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--toefl-flash-green);
}

.toefl-flash-library-card-progress small {
  display: block;
  margin-top: 5px;
  color: var(--toefl-flash-muted);
}

.toefl-flash-library-card-link {
  justify-content: space-between;
  padding-top: 15px;
  border-top: 1px solid var(--toefl-flash-line);
  color: var(--toefl-flash-green);
  font-size: .85rem;
  font-weight: 850;
  text-decoration: none;
}

.toefl-flash-library-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.toefl-flash-library-pagination button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 10px;
  color: var(--toefl-flash-green);
  background: var(--toefl-flash-white);
  font: inherit;
  font-size: .84rem;
  font-weight: 800;
  cursor: pointer;
}

.toefl-flash-library-pagination button:disabled {
  opacity: .45;
  cursor: default;
}

.toefl-flash-library-pagination span {
  color: var(--toefl-flash-muted);
  font-size: .82rem;
}

.toefl-flash-library-empty,
.toefl-flash-deck-preview-locked {
  width: 100%;
  padding: 36px 24px;
  border: 1px dashed #cbd5cc;
  border-radius: 18px;
  text-align: center;
  background: var(--toefl-flash-cream);
}

.toefl-flash-library-empty h2,
.toefl-flash-library-empty h3,
.toefl-flash-deck-preview-locked h3 {
  margin: 0 0 8px;
}

.toefl-flash-library-empty p,
.toefl-flash-deck-preview-locked p {
  margin: 0 0 18px;
  color: var(--toefl-flash-muted);
}

.toefl-flash-library-empty a + a,
.toefl-flash-library-empty button + a {
  margin-left: 8px;
}

.toefl-flash-deck-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 26px 34px;
  min-width: 0;
  padding: 30px;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 96% 0, rgba(200, 239, 101, .25), transparent 42%),
    var(--toefl-flash-white);
  box-shadow: 0 15px 45px rgba(23, 53, 43, .05);
}

.toefl-flash-deck-hero-main,
.toefl-flash-deck-facts,
.toefl-flash-deck-actions {
  min-width: 0;
}

.toefl-flash-deck-badges {
  flex-wrap: wrap;
  margin-bottom: 18px;
  color: var(--toefl-flash-green);
  font-size: .7rem;
  font-weight: 850;
}

.toefl-flash-deck-hero h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -.045em;
  line-height: 1.03;
}

.toefl-flash-deck-hero-main > p {
  max-width: 680px;
  margin: 14px 0;
  color: var(--toefl-flash-muted);
  line-height: 1.62;
}

.toefl-flash-deck-hero-main ul {
  margin: 18px 0 0;
  padding-left: 20px;
  color: #42554c;
  font-size: .9rem;
  line-height: 1.7;
}

.toefl-flash-deck-facts {
  display: grid;
  align-self: start;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
}

.toefl-flash-deck-facts span {
  padding: 14px 16px;
  color: var(--toefl-flash-muted);
  font-size: .72rem;
}

.toefl-flash-deck-facts span + span {
  border-top: 1px solid var(--toefl-flash-line);
}

.toefl-flash-deck-facts strong {
  display: block;
  color: var(--toefl-flash-ink);
  font-size: 1.05rem;
}

.toefl-flash-deck-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid var(--toefl-flash-line);
}

.toefl-flash-deck-primary,
.toefl-flash-deck-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 13px;
  font: inherit;
  font-size: .9rem;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.toefl-flash-deck-primary {
  border: 1px solid var(--toefl-flash-green);
  color: var(--toefl-flash-white);
  background: var(--toefl-flash-green);
}

.toefl-flash-deck-secondary {
  border: 1px solid var(--toefl-flash-line);
  color: var(--toefl-flash-green);
  background: var(--toefl-flash-white);
}

.toefl-flash-deck-actions p {
  margin: 0;
  color: var(--toefl-flash-muted);
  font-size: .8rem;
}

.toefl-flash-deck-preview,
.toefl-flash-deck-progress,
.toefl-flash-deck-cards {
  min-width: 0;
  margin-top: 26px;
  padding: 28px;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 22px;
  background: var(--toefl-flash-white);
}

.toefl-flash-deck-preview h2,
.toefl-flash-deck-progress h2,
.toefl-flash-deck-cards h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -.025em;
}

.toefl-flash-deck-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
  margin-top: 20px;
}

.toefl-flash-deck-preview-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 16px;
  background: var(--toefl-flash-cream);
}

.toefl-flash-deck-preview-card h3,
.toefl-flash-deck-list-card h3 {
  margin: 0;
  font-size: 1.12rem;
}

.toefl-flash-deck-preview-card > div p,
.toefl-flash-deck-list-card > div:first-child p {
  margin: 4px 0 0;
  color: var(--toefl-flash-green);
  font-size: .75rem;
  font-weight: 750;
}

.toefl-flash-deck-preview-card > p {
  margin: 16px 0 0;
  line-height: 1.55;
}

.toefl-flash-deck-preview-card blockquote {
  margin: 15px 0 0;
  padding-left: 12px;
  border-left: 3px solid var(--toefl-flash-lime);
  color: var(--toefl-flash-muted);
  font-size: .84rem;
  line-height: 1.5;
}

.toefl-flash-deck-preview-locked {
  grid-column: 1 / -1;
}

.toefl-flash-deck-preview-locked > svg {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
}

.toefl-flash-deck-progress-heading,
.toefl-flash-deck-cards-heading,
.toefl-flash-deck-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.toefl-flash-deck-progress-heading > strong {
  font-size: 1.35rem;
}

.toefl-flash-deck-progress-track {
  height: 10px;
  margin-top: 20px;
}

.toefl-flash-deck-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.toefl-flash-deck-progress-grid span {
  padding: 14px;
  border-radius: 13px;
  color: var(--toefl-flash-muted);
  background: var(--toefl-flash-cream);
  font-size: .75rem;
}

.toefl-flash-deck-progress-grid strong {
  display: block;
  color: var(--toefl-flash-ink);
  font-size: 1.2rem;
}

.toefl-flash-deck-cards-heading form {
  display: flex;
  min-width: min(100%, 330px);
  padding: 6px;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 12px;
}

.toefl-flash-deck-cards-heading input {
  width: 100%;
  padding: 0 8px;
}

.toefl-flash-deck-cards-heading button {
  min-height: 36px;
}

.toefl-flash-deck-controls {
  align-items: center;
  margin-top: 18px;
}

.toefl-flash-deck-controls > div {
  padding-bottom: 4px;
}

.toefl-flash-deck-controls > label {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: var(--toefl-flash-muted);
  font-size: .78rem;
  font-weight: 750;
}

.toefl-flash-deck-controls select {
  min-height: 38px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 9px;
  color: var(--toefl-flash-ink);
  background: var(--toefl-flash-white);
}

.toefl-flash-deck-card-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.toefl-flash-deck-list-card {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--toefl-flash-line);
  border-radius: 14px;
}

.toefl-flash-deck-list-card > p {
  min-width: 0;
  margin: 0;
  color: var(--toefl-flash-muted);
  font-size: .86rem;
  line-height: 1.5;
}

.toefl-flash-deck-list-card > div:last-child {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.toefl-flash-deck-list-card > div:last-child span {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--toefl-flash-green);
  background: #edf4ef;
  font-size: .7rem;
  font-weight: 800;
}

.toefl-flash-deck-list-card small {
  color: var(--toefl-flash-muted);
  font-size: .68rem;
}

.toefl-flash-library :is(a, button, input, select):focus,
.toefl-flash-library :is(a, button, input, select):focus-visible {
  outline: 2px solid var(--toefl-flash-lime);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .toefl-flash-library-card {
    transition: transform 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
  }

  .toefl-flash-library-card:hover {
    transform: translateY(-3px);
    border-color: #b8cabd;
    box-shadow: 0 16px 42px rgba(23, 53, 43, .09);
  }
}

@media (max-width: 920px) {
  .toefl-flash-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toefl-flash-deck-hero {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  .toefl-flash-deck-list-card {
    grid-template-columns: minmax(130px, .7fr) minmax(0, 1.4fr);
  }

  .toefl-flash-deck-list-card > div:last-child {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
  }
}

@media (max-width: 680px) {
  .toefl-flash-library {
    width: min(100% - 28px, 1180px);
    padding-top: 28px;
  }

  .toefl-flash-library-header {
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
  }

  .toefl-flash-library-header nav {
    align-self: flex-start;
    flex-wrap: wrap;
  }

  .toefl-flash-library-create-row {
    align-items: stretch;
    flex-direction: column;
  }

  .toefl-flash-library-create-row > div:last-child,
  .toefl-flash-library-create-row > div:last-child a {
    width: 100%;
    text-align: center;
  }

  .toefl-flash-library-grid,
  .toefl-flash-deck-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .toefl-flash-library-card {
    min-height: 0;
  }

  .toefl-flash-deck-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 22px;
  }

  .toefl-flash-deck-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .toefl-flash-deck-primary,
  .toefl-flash-deck-secondary {
    width: 100%;
  }

  .toefl-flash-deck-preview,
  .toefl-flash-deck-progress,
  .toefl-flash-deck-cards {
    padding: 20px;
  }

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

  .toefl-flash-deck-cards-heading,
  .toefl-flash-deck-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .toefl-flash-deck-cards-heading form {
    min-width: 0;
    width: 100%;
  }

  .toefl-flash-deck-controls > label {
    justify-content: space-between;
  }

  .toefl-flash-deck-list-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .toefl-flash-deck-list-card > div:last-child {
    grid-column: auto;
  }
}

@media (max-width: 420px) {
  .toefl-flash-library {
    width: calc(100% - 24px);
    overflow-x: clip;
  }

  .toefl-flash-library-header h1 {
    font-size: 2.15rem;
  }

  .toefl-flash-library-header nav {
    width: 100%;
  }

  .toefl-flash-library-header nav a {
    flex: 1 1 0;
    text-align: center;
  }

  .toefl-flash-library-search > div {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .toefl-flash-library-search button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .toefl-flash-library-card,
  .toefl-flash-deck-hero,
  .toefl-flash-deck-preview,
  .toefl-flash-deck-progress,
  .toefl-flash-deck-cards {
    border-radius: 18px;
  }

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

  .toefl-flash-library-empty a,
  .toefl-flash-library-empty button {
    width: 100%;
  }

  .toefl-flash-library-empty a + a,
  .toefl-flash-library-empty button + a {
    margin: 8px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toefl-flash-library *,
  .toefl-flash-library *::before,
  .toefl-flash-library *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
