/* Hallmark v2.0.0 | scope: app | theme: Learnova | signature: editable study card */
/* Critique: Keep the source, selected settings and remaining quota visible in one form. */
:root {
  --fc-disabled-surface: #ede9f4;
  --fc-disabled-ink: #514861;
  --fc-error: #a11a3b;
}

.fc-back { animation: fc-turn 260ms ease-out; }
.fc-message { color: var(--fc-error); }
.fc-message:empty { display: none; }
@keyframes fc-turn { from { transform: perspective(800px) rotateY(-60deg); opacity: .5; } to { transform: perspective(800px) rotateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fc-back { animation: none; } }

.fc-create-quota {
  display: grid; gap: 8px; padding: 12px; border: 1px solid var(--ai-dark-line);
  border-radius: 12px; background: var(--ai-dark-soft); color: var(--ai-on-dark);
  font-size: .875rem; font-variant-numeric: tabular-nums;
}
.fc-create-quota meter { width: 100%; accent-color: var(--ai-light-ring); }
.fc-create [data-document] [data-more] { justify-self: start; }
.fc-create .ai-studio-buttons .ai-button--primary { font-family: var(--font-heading); letter-spacing: -.02em; }
.fc-create .fc-message:not(:empty) { margin-bottom: 12px; }

/* Hallmark · redesign: full · Learnova Premium · studio, generation and card preview */
.fc-create .ai-studio-grid { gap: var(--ai-gap); }
.fc-create .ai-studio-form { display: grid; }
.fc-create .ai-form-actions { border-top: 1px solid var(--ai-progress-line); padding-block-start: 20px; }
.fc-create .ai-summary-list dd, .fc-deck-info dd { font-variant-numeric: tabular-nums; }
.fc-generation-panel .ai-quiz-stack-face svg { width: 48%; color: var(--ai-on-dark); }
.fc-generation-panel .ai-progress-actions { justify-content: flex-start; }
.ai-timeline.fc-generation-steps, .ai-timeline.fc-review-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fc-review-grid {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--ai-gap); align-items: start;
}
.fc-review-main, .fc-review-rail { display: grid; gap: 16px; min-width: 0; }
.fc-card-stage, .fc-review-editor, .fc-deck-info, .fc-deck-save {
  border-color: var(--ai-progress-line); border-radius: var(--ai-radius);
  background: var(--ai-progress-surface); box-shadow: 0 12px 32px var(--ai-progress-shadow);
}
.fc-card-stage {
  display: grid; gap: 20px; justify-items: center; padding: 24px;
  background: radial-gradient(ellipse at 80% 100%, var(--ai-progress-fog), var(--ai-transparent) 68%), var(--ai-progress-glass);
}
.fc-review-grid .fc-position {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px;
  border: 1px solid var(--ai-progress-line); border-radius: 20px; background: var(--ai-progress-surface);
  color: var(--ai-progress-deep); font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.fc-position svg, .fc-review-grid h2 svg { width: 20px; height: 20px; flex: none; color: var(--ai-brand); }
.fc-carousel { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; }
.fc-carousel-arrow { inline-size: 44px; padding: 8px; border-radius: 50%; color: var(--ai-brand); }
.fc-carousel-arrow svg { width: 20px; height: 20px; }
.fc-carousel-arrow[data-prev] svg { transform: rotate(180deg); }
.fc-card-stack { position: relative; isolation: isolate; max-width: 700px; width: 100%; margin-inline: auto; }
.fc-card-stack::before, .fc-card-stack::after {
  content: ''; position: absolute; z-index: -1; inset: 12px 0; border: 1px solid var(--ai-progress-line);
  border-radius: var(--ai-radius); background: var(--ai-progress-glass); transform: rotate(-4deg);
}
.fc-card-stack::after { transform: rotate(4deg); }
.fc-preview-face {
  display: grid; align-content: start; gap: 16px; padding: 20px; min-height: 216px;
  border: 1px solid var(--ai-progress-line); border-radius: var(--ai-radius);
  background: radial-gradient(ellipse at 100% 100%, var(--ai-progress-fog), var(--ai-transparent) 58%), var(--ai-progress-surface);
  box-shadow: 0 8px 20px var(--ai-progress-shadow);
}
.fc-review-grid .fc-face-side {
  justify-self: start; padding: 4px 12px; border-radius: 16px; background: var(--ai-soft);
  color: var(--ai-progress-deep); font-size: .8125rem; font-weight: 600;
}
.fc-review-grid .fc-card-copy {
  align-self: center; color: var(--heading); white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 17px; line-height: 1.7; text-align: center;
}
.fc-review-grid .ai-button--primary { font-family: var(--font-heading); letter-spacing: -.02em; }
.fc-review-grid .fc-flip { min-width: 148px; border-radius: 24px; }
.fc-review-editor, .fc-deck-info, .fc-deck-save { display: grid; gap: 16px; padding: 20px; }
.fc-review-grid h2 {
  display: flex; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--ai-progress-line);
  color: var(--heading); font-size: 1.125rem; letter-spacing: -.02em;
}
.fc-face-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fc-review-editor summary { min-height: 44px; align-content: center; cursor: pointer; color: var(--ai-brand); }
.fc-review-editor blockquote { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fc-review-grid .fc-remove { color: var(--ai-red); border-color: var(--ai-red); }
.fc-review-grid .ai-button:disabled {
  opacity: 1; background: var(--fc-disabled-surface); color: var(--fc-disabled-ink);
  border-color: var(--ai-progress-line); cursor: not-allowed;
}
.fc-deck-info dl > div {
  display: flex; justify-content: space-between; gap: 12px; padding-block: 8px;
  border-bottom: 1px solid var(--ai-progress-line); font-size: .875rem;
}
.fc-deck-info dt { color: var(--ai-muted); flex: none; }
.fc-deck-info dd { min-width: 0; overflow-wrap: anywhere; text-align: end; color: var(--ai-progress-deep); font-weight: 600; }
.fc-deck-save input {
  width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--ai-edge);
  border-radius: var(--ai-control-radius); background: var(--ai-paper); color: var(--ai-ink);
}
.fc-deck-save [data-save-feedback]:has(.fc-message:empty) { display: none; }
.fc-deck-save button { width: 100%; }
.fc-review-grid :is(summary, a, button, textarea, input):focus-visible { outline: 2px solid var(--ai-focus); outline-offset: 3px; }
@media (max-width: 900px) {
  .fc-review-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 540px) {
  .fc-card-stage, .fc-review-editor, .fc-deck-info, .fc-deck-save { padding: 12px; }
  .fc-carousel { gap: 8px; }
  .fc-preview-face { min-height: 180px; padding: 12px; }
  .fc-review-grid .fc-card-copy { font-size: 16px; }
  .fc-face-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .ai-timeline.fc-generation-steps, .ai-timeline.fc-review-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

.fc-generation #fc-studio-title:focus { outline: none; }
.fc-preview-face { grid-template-rows: auto 1fr; }
.fc-preview-face .fc-card-copy { padding-block-end: 16px; }
.fc-create .ai-summary {
  color: var(--heading); border-color: var(--ai-progress-line);
  background: radial-gradient(ellipse at 100% 0, var(--ai-progress-fog), var(--ai-transparent) 64%), var(--ai-progress-surface);
}
.fc-create .ai-summary h2 { color: var(--heading); }
.fc-create .ai-summary :is(dt, .ai-summary-caption) { color: var(--muted); }
.fc-create .ai-summary-list,
.fc-create .ai-summary-list > div + div,
.fc-create .fc-create-quota,
.fc-create .ai-studio-history { border-color: var(--ai-progress-line); }
.fc-create .ai-summary-list dd { color: var(--ai-progress-deep); }
.fc-create :is(.fc-create-quota, .ai-studio-history) {
  color: var(--ai-progress-deep); background: var(--ai-progress-glass);
}
.fc-create-quota meter { accent-color: var(--ai-brand); }
.fc-create .ai-studio-illustration-spark { color: var(--ai-brand); }

/* Hallmark · redesign: full · Flashcards library · shape: app screen · theme: Learnova Premium */
.fc-library-hero {
  isolation: isolate; position: relative; display: flex; align-items: center; gap: 20px;
  min-height: 156px; margin-top: 12px; padding: 20px 168px 20px 4px;
  background: radial-gradient(ellipse at 90% 18%, var(--ai-progress-fog), var(--ai-transparent) 60%);
}
.fc-library-hero h1 { color: var(--heading); font-size: 2.25rem; line-height: 1.24; letter-spacing: -.02em; }
.fc-library-hero p { margin-top: 8px; color: var(--muted); }
.fc-library-hero .ai-progress-emblem { width: 60px; }
.fc-library-art {
  position: relative; isolation: isolate; width: 136px; height: 96px; flex: none;
  filter: drop-shadow(0 12px 18px var(--ai-progress-shadow));
}
.fc-library-hero > .fc-library-art { position: absolute; inset-inline-end: 28px; }
.fc-library-art > span {
  position: absolute; display: grid; inset: 4px 16px; place-content: center;
  border: 1px solid var(--ai-progress-line); border-radius: 16px;
  background: var(--ai-orb-mid); transform: translate(20px, 8px) rotate(17deg);
}
.fc-library-art > span:nth-child(2) {
  background: var(--ai-orb-light); transform: translate(10px, 6px) rotate(6deg);
}
.fc-library-art > .fc-library-art-front {
  gap: 8px; justify-items: center; background: linear-gradient(145deg, var(--ai-progress-surface), var(--ai-orb-light));
  color: var(--ai-brand); transform: rotate(-10deg);
}
.fc-library-art svg { width: 28px; height: 28px; }
.fc-library-art i { height: 4px; width: 36px; border-radius: 4px; background: var(--ai-orb-mid); }
.fc-library-art i:last-child { width: 24px; }
.fc-library-nav {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  padding-block-end: 12px; border-bottom: 1px solid var(--ai-progress-line); margin-bottom: 24px;
}
.fc-library-nav a {
  color: var(--heading); background: var(--ai-progress-surface); border: 1px solid var(--ai-progress-line);
  border-radius: 12px; min-height: 48px; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 8px; font-weight: 600; text-decoration: none; text-align: center;
}
.fc-library-nav a:hover { border-color: var(--ai-brand); }
.fc-library-nav a[aria-current] {
  color: var(--ai-on-dark); background: linear-gradient(135deg, var(--ai-progress-violet), var(--ai-progress-deep));
  border-color: var(--ai-progress-deep);
}
.fc-library-nav a svg { width: 20px; flex: none; }
.fc-library-empty {
  display: grid; justify-items: center; align-content: center; gap: 16px; min-height: 388px;
  border-color: var(--ai-progress-line); border-radius: var(--ai-radius); padding: 32px 20px;
  text-align: center; box-shadow: 0 12px 32px var(--ai-progress-shadow);
  background: radial-gradient(ellipse at 50% 34%, var(--ai-progress-fog), var(--ai-transparent) 40%), var(--ai-progress-surface);
}
.fc-library-empty .fc-library-art { width: 176px; height: 140px; margin-block-end: 16px; }
.fc-library-empty h2 { color: var(--heading); font-size: 1.375rem; letter-spacing: -.02em; }
.fc-library-empty p { max-width: 440px; color: var(--muted); }
.fc-library-empty .ai-actions { justify-content: center; gap: 12px; }
.fc-library-empty .ai-button--primary, .fc-library-form .ai-button--primary {
  font-family: var(--font-heading); letter-spacing: -.02em;
}
.fc-library :is(a, button):active { transform: translateY(1px); }
.fc-library-loading, .fc-library-list-heading { margin-bottom: 16px; }
.fc-library-list-heading { justify-content: space-between; }
.fc-library .fc-deck-list { display: grid; padding: 0; gap: 12px; margin-bottom: 16px; list-style: none; }
.fc-deck-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px; }
.fc-deck-row h3 {
  font-size: 18px; font-weight: 600; letter-spacing: -.02em; display: -webkit-box;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: clip;
}
.fc-deck-row p { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.fc-deck-row .ai-actions { flex: none; }
.fc-library .fc-back-link { margin-bottom: 16px; }
.fc-library-form { display: grid; justify-items: stretch; align-content: start; gap: 16px; max-width: 700px; }
.fc-library-form .ai-button { justify-self: start; }
.fc-library-form input {
  width: 100%; min-height: 44px; padding: 8px 12px; color: var(--ai-ink); background: var(--ai-paper);
  border: 1px solid var(--ai-edge); border-radius: var(--ai-control-radius);
}
.fc-library .ai-button:disabled {
  opacity: 1; background: var(--fc-disabled-surface); color: var(--fc-disabled-ink);
  border-color: var(--ai-progress-line); cursor: not-allowed;
}
@media (max-width: 640px) {
  .fc-library-hero { gap: 12px; min-height: 124px; padding: 12px 4px; align-items: flex-start; }
  .fc-library-hero h1 { font-size: 1.625rem; }
  .fc-library-hero > .fc-library-art { display: none; }
  .fc-library-hero .ai-progress-emblem { width: 44px; }
  .fc-library-nav a { flex-wrap: wrap; font-size: .8125rem; }
  .fc-deck-row { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .fc-library :is(a, button) { transition: none; }
}

/* Hallmark · redesign: full · Flashcards study · shape: app screen · theme: Learnova Premium */
.fc-study-grid {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start; gap: var(--ai-gap);
}
.fc-study-stage, .fc-study-progress {
  min-width: 0; border-color: var(--ai-progress-line);
  background: var(--ai-progress-surface); box-shadow: 0 12px 32px var(--ai-progress-shadow);
  padding: 24px;
}
.fc-study-stage {
  display: grid; gap: 20px; justify-items: center;
  background: radial-gradient(ellipse at 82% 100%, var(--ai-progress-fog), var(--ai-transparent) 65%), var(--ai-progress-glass);
}
.fc-study .fc-position {
  justify-self: start; border: 1px solid var(--ai-progress-line); border-radius: 20px;
  padding: 4px 12px; background: var(--ai-progress-surface); color: var(--ai-progress-deep);
  font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.fc-study .fc-card-stack { width: calc(100% - 24px); }
.fc-study .fc-preview-face { min-height: 256px; }
.fc-study .fc-face-side {
  justify-self: start; padding: 4px 12px; border-radius: 16px;
  background: var(--ai-soft); color: var(--ai-progress-deep); font-size: .8125rem;
}
.fc-study-copy {
  align-self: center; white-space: pre-wrap; overflow-wrap: anywhere; text-align: center;
  color: var(--heading); font-size: 17px; line-height: 1.7;
}
.fc-study-stage .ai-button--primary {
  font-family: var(--font-heading); letter-spacing: -.02em; min-width: 132px;
}
.fc-study-ratings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: min(100%, 340px); }
.fc-study-known.ai-button { color: var(--ai-green); background: var(--ai-green-soft); border-color: var(--ai-green); }
.fc-study-unknown.ai-button { color: var(--ai-amber); background: var(--ai-amber-soft); border-color: var(--ai-amber); }
.fc-study-stage .ai-button:hover:not(:disabled) { box-shadow: 0 4px 12px var(--ai-progress-shadow); }
.fc-study .ai-button:disabled {
  opacity: 1; color: var(--fc-disabled-ink); background: var(--fc-disabled-surface);
  border-color: var(--ai-progress-line); cursor: not-allowed;
}
.fc-study-keys { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.fc-study-keys kbd {
  font-family: var(--font-code); border: 1px solid var(--ai-progress-line); border-radius: 4px;
  padding: 0 4px; background: var(--ai-progress-surface);
}
.fc-study-progress { display: grid; gap: 16px; }
.fc-study-progress h2, .fc-study-finish h2 { color: var(--heading); font-size: 1.125rem; letter-spacing: -.02em; }
.fc-study-progress h2 { display: flex; align-items: center; gap: 8px; }
.fc-study-progress h2 svg { width: 20px; height: 20px; flex: none; color: var(--ai-brand); }
.fc-study-progress [data-study-count], .fc-study-finish p { color: var(--muted); }
.fc-study-progress progress {
  appearance: none; width: 100%; height: 8px; border: 0; border-radius: 8px;
  background: var(--ai-soft); color: var(--ai-brand); accent-color: var(--ai-brand);
}
.fc-study-progress progress::-webkit-progress-bar { border-radius: 8px; background: var(--ai-soft); }
.fc-study-progress progress::-webkit-progress-value { border-radius: 8px; background: var(--ai-brand); }
.fc-study-progress progress::-moz-progress-bar { border-radius: 8px; background: var(--ai-brand); }
.fc-study-tally {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.fc-study-tally > span:not(.ai-step-sr) { border-radius: 8px; padding: 8px; text-align: center; }
.fc-study-tally [data-study-known] { color: var(--ai-green); background: var(--ai-green-soft); }
.fc-study-tally [data-study-unknown] { color: var(--ai-amber); background: var(--ai-amber-soft); }
.fc-study-finish { align-content: center; min-height: 296px; text-align: center; }
.fc-study-finish h2 { font-size: 1.375rem; }
.fc-study .fc-study-finish h2:focus { outline: none; }
.fc-study-finish .ai-actions { justify-content: center; }
@media (max-width: 900px) {
  .fc-study-grid { grid-template-columns: minmax(0, 1fr); }
  .fc-study-progress { grid-row: 1; }
}
@media (max-width: 540px) {
  .fc-study-stage, .fc-study-progress { padding: 16px; gap: 12px; }
  .fc-study .fc-preview-face { min-height: 192px; }
  .fc-study-copy { font-size: 16px; }
}
@media (hover: none) { .fc-study-keys { display: none; } }
@media (prefers-reduced-motion: reduce) { .fc-study :is(a, button) { transition: none; } }
.fc-study h1, .fc-study h2 { min-width: 0; overflow-wrap: break-word; text-wrap: balance; }

/* Hallmark · redesign: full · study session reference · Learnova violet */
.fc-study .ai-studio-heading {
  padding-block: 12px; margin-block: 12px 24px;
  background: radial-gradient(ellipse at 94% 0, var(--ai-progress-fog), var(--ai-transparent) 68%);
}
.fc-study .ai-studio-heading .ai-progress-emblem { width: 56px; }
.fc-study .fc-study-grid { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.fc-study-rail { display: grid; gap: 16px; min-width: 0; }
.fc-study-stage, .fc-study-progress, .fc-study-timing {
  border: 2px solid var(--ai-paper); border-radius: 24px;
  box-shadow: 0 12px 32px var(--ai-progress-shadow);
}
.fc-study .fc-study-stage {
  padding: 24px; background: radial-gradient(ellipse at 50% 62%, var(--ai-progress-fog), var(--ai-transparent) 76%), var(--ai-progress-glass);
}
.fc-study .fc-position {
  display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 4px 12px var(--ai-progress-shadow);
}
.fc-study .fc-position svg, .fc-study-stage .ai-button svg { flex: none; width: 20px; height: 20px; }
.fc-study .fc-card-stack { width: calc(100% - 20px); margin-block: 8px 12px; }
.fc-study .fc-preview-face {
  border: 2px solid var(--ai-paper); border-radius: 24px; min-height: 240px;
  background: radial-gradient(ellipse at 102% 120%, var(--ai-progress-halo), var(--ai-transparent) 62%), var(--ai-progress-surface);
}
.fc-study .fc-face-side { font-weight: 600; font-family: var(--font-heading); }
.fc-study .fc-study-copy { font-weight: 600; }
.fc-study .fc-study-flip {
  min-width: min(100%, 236px); min-height: 48px; border-radius: 20px; gap: 8px;
  background: linear-gradient(135deg, var(--ai-progress-violet), var(--ai-progress-deep));
  box-shadow: 0 8px 16px var(--ai-progress-shadow); border-color: var(--ai-progress-deep);
}
.fc-study .fc-study-ratings { width: min(100%, 464px); }
.fc-study-ratings .ai-button { min-height: 48px; border-radius: 12px; gap: 8px; }
.fc-study-keys > span { display: inline-flex; align-items: center; gap: 4px; }
.fc-study-progress, .fc-study-timing {
  padding: 20px; background: radial-gradient(ellipse at 100% 0, var(--ai-progress-fog), var(--ai-transparent) 75%), var(--ai-progress-surface);
}
.fc-study-progress h2, .fc-study-timing h2 {
  display: flex; align-items: center; gap: 8px; color: var(--heading); font-size: 1.125rem; letter-spacing: -.02em;
}
.fc-study-timing h2 svg, .fc-study-timing dl svg { width: 20px; height: 20px; color: var(--ai-brand); flex: none; }
.fc-study-progress-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.fc-study-progress-line span { color: var(--ai-progress-deep); font-weight: 600; font-size: .875rem; font-variant-numeric: tabular-nums; }
.fc-study-progress .fc-study-tally > span:not(.ai-step-sr) { border-radius: 12px; padding: 12px 8px; }
.fc-study-timing { display: grid; gap: 16px; }
.fc-study-timing dl {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 0;
  border-radius: 12px; background: var(--ai-progress-glass);
}
.fc-study-timing dl > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; padding-inline: 12px; }
.fc-study-timing dl > div + div { border-inline-start: 1px solid var(--ai-progress-line); }
.fc-study-timing dt { grid-column: 2; grid-row: 2; color: var(--muted); font-size: .8125rem; }
.fc-study-timing dd { grid-column: 2; grid-row: 1; color: var(--heading); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .fc-study .fc-study-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 540px) {
  .fc-study .ai-studio-heading .ai-progress-emblem { width: 44px; }
  .fc-study .fc-study-stage, .fc-study-progress, .fc-study-timing { padding: 12px; }
  .fc-study .fc-card-stack { width: calc(100% - 12px); }
  .fc-study .fc-preview-face { min-height: 188px; }
  .fc-study-ratings .ai-button { padding-inline: 8px; gap: 4px; }
  .fc-study-ratings .ai-button svg { width: 16px; height: 16px; }
}

.fc-library-tools { margin-bottom: 16px; }
.fc-library-tools input, .fc-edit-dialog input {
  min-height: 44px; min-width: 0; padding: 8px 12px; color: var(--ai-ink); background: var(--ai-paper);
  border: 1px solid var(--ai-edge); border-radius: var(--ai-control-radius);
}
.fc-library-tools input { flex: 1 1 136px; }
.fc-edit-dialog {
  max-width: min(560px, calc(100% - 24px)); width: 100%; max-height: calc(100% - 24px);
  padding: 20px; color: var(--ai-ink); background: var(--ai-progress-surface);
}
.fc-edit-dialog::backdrop { background: var(--ai-orb-shadow); }
.fc-edit-dialog .fc-library-form { padding: 12px 0 0; border: 0; box-shadow: none; }
.fc-management-stack { display: grid; gap: 16px; min-width: 0; }
.fc-management-panel { display: grid; min-width: 0; gap: 16px; padding: 16px; }
.fc-management-panel h2, .fc-edit-dialog h2 { font-size: 1.125rem; letter-spacing: -.02em; }
.fc-management-panel h3 { font-size: 1rem; }
.fc-management-panel p { color: var(--muted); overflow-wrap: anywhere; }
.fc-library .fc-stat-grid, .fc-library .fc-saved-cards dl {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.fc-stat-grid dt, .fc-saved-cards dt { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.fc-stat-grid dd { color: var(--heading); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Study uses two physical faces. Rating and progress are separate from the flip. */
.fc-study .fc-card-stack { perspective: 1000px; }
.fc-study-turn {
  display: grid; transform-style: preserve-3d;
  transition: transform 280ms cubic-bezier(.25, .75, .25, 1);
}
.fc-study-turn .fc-preview-face { grid-area: 1 / 1; min-width: 0; backface-visibility: hidden; }
.fc-study-turn [data-side="back"], .fc-study-turn.is-flipped { transform: rotateY(180deg); }
.fc-study.lv-v2 .fc-study-known:enabled {
  color: var(--lv-success); background: var(--lv-success-surface); border-color: var(--lv-success);
}
.fc-study.lv-v2 .fc-study-unknown:enabled {
  color: var(--lv-warning); background: var(--lv-warning-surface); border-color: var(--lv-warning);
}
.fc-rating-status:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  .fc-study-turn { transition: none; }
}
.fc-library .fc-saved-cards, .fc-library .fc-activity { padding: 0; list-style: none; }
.fc-saved-cards li, .fc-activity li { padding-block: 12px; border-bottom: 1px solid var(--ai-line); }
.fc-saved-cards li > .ai-actions { margin-top: 8px; }
.fc-saved-cards dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.fc-activity li { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.fc-activity time { font-size: .875rem; color: var(--muted); }
.fc-library .fc-remove-action { color: var(--ai-red); }
@media (max-width: 540px) {
  .fc-library .fc-saved-cards dl { grid-template-columns: minmax(0, 1fr); }
}
