body { margin: 0; font: 400 1rem/1.55 Inter, sans-serif; }
.fc-header { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem var(--st-page-gutter); border-bottom: 1px solid var(--sc-border); }
.fc-header a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.fc-header a:first-child { font: 600 1.25rem 'Playfair Display', serif; }
.fc-main { max-width: 65rem; margin: 0 auto; padding: clamp(1.5rem, 5vw, 4rem) var(--st-page-gutter); }
.fc-main h1, .fc-main h2 { font-family: 'Playfair Display', serif; font-weight: 600; line-height: 1.15; }
.fc-main h1 { font-size: var(--st-editorial-size); margin: 0 0 1.35rem; }
.fc-main h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.fc-main button, .fc-main input, .fc-main textarea, .fc-main select, .fc-button {
  font: inherit; min-height: var(--st-control-height); padding: .55rem .85rem; border: 1px solid var(--sc-control-border);
  border-radius: var(--st-control-radius); max-width: 100%; min-width: 0;
}
.fc-main button, .fc-button { cursor: pointer; font-weight: 600; }
.fc-main button:disabled { opacity: .55; cursor: wait; }
.fc-main button.primary, .fc-main .fc-button { background: var(--st-primary); border-color: var(--st-primary); color: var(--st-primary-text); }
.fc-main button.primary:hover, .fc-main .fc-button:hover { background: var(--st-primary-hover); }
.fc-button { display: inline-flex; align-items: center; text-decoration: none; }
.fc-main :focus-visible, .fc-header a:focus-visible { outline: 2px solid var(--sc-accent-strong); outline-offset: 3px; }
#fc-nav:not([hidden]) { display: flex; gap: .35rem; flex-wrap: wrap; border-bottom: 1px solid var(--sc-border); }
#fc-nav button { border: 0; border-radius: 0; background: transparent; border-bottom: 2px solid transparent; padding-inline: .65rem; }
#fc-nav [aria-current="page"] { border-bottom-color: var(--sc-accent-strong); color: var(--sc-accent-strong); }
#fc-status { color: var(--sc-muted); margin: .75rem 0; }
#fc-status:empty { display: none; }
#fc-status[data-error] { color: var(--sc-danger); }
#fc-view { margin-top: 1.25rem; overflow-wrap: anywhere; }
.fc-toolbar, .fc-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.fc-toolbar { justify-content: space-between; margin-bottom: 1rem; }
.fc-list { list-style: none; padding: 0; }
.fc-list li { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; border-top: 1px solid var(--sc-border); padding: .8rem 0; }
.fc-list li > :first-child { flex: 1 1 14rem; min-width: 0; }
.fc-meta { display: block; color: var(--sc-muted); font-size: .9rem; }
.fc-main label, .fc-form { display: grid; gap: .4rem; }
.fc-form { gap: 1rem; max-width: 45rem; margin-block: 1rem; }
.fc-form textarea { width: 100%; resize: vertical; }
.fc-form input[type=file] { width: 100%; }
.fc-main summary { cursor: pointer; min-height: 44px; align-content: center; }
.fc-main details { margin-block: .5rem; }
.fc-list details { margin: 0; }
.fc-paper { background: var(--sc-surface); border: 1px solid var(--sc-border); border-radius: var(--st-panel-radius); padding: clamp(1rem, 5vw, 3rem); margin-block: 1rem; box-shadow: var(--sc-shadow); }
.fc-question { font: 500 clamp(1.25rem, 3vw, 1.85rem)/1.45 'Playfair Display', serif; }
.fc-answer { border-top: 1px solid var(--sc-border); margin-top: 1.25rem; padding-top: 1.25rem; }
.fc-paper p { white-space: pre-wrap; margin: 0 0 .6rem; }
.fc-paper img { display: block; max-width: 100%; max-height: 26rem; object-fit: contain; margin-block: .75rem; }
.fc-ratings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-bottom: .75rem; }
@media (max-width: 420px) { .fc-ratings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .fc-main *, .fc-header * { transition: none !important; } }

.fc-main .fc-check { display: flex; gap: .75rem; align-items: center; }
.fc-main .fc-check input { width: 1.25rem; margin: 0; cursor: pointer; }
.fc-header { align-items: center; flex-wrap: wrap; }
.fc-header .header-theme-control { margin: 0; max-width: 100%; }
.fc-header .header-theme-control select { max-width: 100%; min-height: var(--st-control-height); }

/* A focused destructive-action confirmation that remains usable on small screens. */
.fc-confirm-dialog {
  box-sizing: border-box;
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: clamp(1rem, 4vw, 1.75rem);
  border: 1px solid var(--sc-border);
  border-radius: var(--st-panel-radius);
  background: var(--sc-surface);
  color: inherit;
  box-shadow: var(--sc-shadow);
}
.fc-confirm-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.fc-confirm-dialog .fc-form { margin: 0; }
.fc-confirm-dialog h2 { font: 600 clamp(1.35rem, 4vw, 1.8rem)/1.2 'Playfair Display', serif; margin: 0; }
.fc-confirm-dialog label { display: grid; gap: .4rem; }
.fc-confirm-dialog input, .fc-confirm-dialog button {
  box-sizing: border-box;
  font: inherit;
  min-height: 44px;
  max-width: 100%;
  padding: .6rem .8rem;
  border: 1px solid var(--sc-control-border);
  border-radius: var(--st-control-radius);
}
.fc-confirm-dialog input { width: 100%; background: var(--sc-surface); color: inherit; }
.fc-confirm-dialog button { cursor: pointer; }
.fc-confirm-dialog button:disabled { opacity: .5; cursor: not-allowed; }
.fc-confirm-dialog .fc-danger-button:not(:disabled) {
  border-color: var(--sc-danger);
  color: var(--sc-danger);
}
.fc-confirm-dialog .fc-delete-error { min-height: 1em; color: var(--sc-danger); margin: 0; }
.fc-confirm-dialog :focus-visible { outline: 2px solid var(--sc-accent-strong); outline-offset: 2px; }

/* One compact deck management control, not a row of competing actions. */
.fc-main .fc-deck-menu { position: relative; margin: 0; }
.fc-main .fc-deck-menu > summary {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  list-style: none;
  min-width: 44px;
  min-height: 44px;
  padding: .2rem;
  font-size: 1.45rem;
  line-height: 1;
  border: 1px solid var(--sc-control-border);
  border-radius: var(--st-control-radius);
}
.fc-main .fc-deck-menu > summary::-webkit-details-marker { display: none; }
.fc-main .fc-deck-menu[open] > .fc-actions {
  position: absolute;
  z-index: 20;
  top: calc(100% + .25rem);
  right: 0;
  box-sizing: border-box;
  display: grid;
  width: min(18rem, calc(100vw - 2rem));
  max-height: min(26rem, 65dvh);
  overflow: auto;
  padding: .5rem;
  border: 1px solid var(--sc-border);
  border-radius: var(--st-control-radius);
  background: var(--sc-surface);
  box-shadow: var(--sc-shadow);
}
.fc-main .fc-deck-menu > .fc-actions button { width: 100%; text-align: left; }

.fc-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: .75rem;
  margin: 0;
}
.fc-progress > div { padding: .625rem 0; }
.fc-progress dt { font-size: .875rem; }
.fc-progress dd { margin: .25rem 0 0; font-size: 1.25rem; font-weight: 600; }
.fc-import-text { margin: 0; }
.fc-form[hidden] { display: none; }

/* Deck-scoped Search & Study blends with the existing workspace and scales to mobile. */
.fc-search-study {
  margin-block: 1.25rem; padding: clamp(.9rem, 3vw, 1.35rem);
  border: 1px solid var(--sc-border); border-radius: var(--st-panel-radius);
  background: var(--sc-surface);
}
.fc-search-study h3 { margin: 0 0 .35rem; font: 600 1.18rem/1.3 'Playfair Display', serif; }
.fc-search-form { margin-top: .9rem; }
.fc-search-form .fc-actions { align-items: end; }
.fc-search-form label:first-child { flex: 2 1 14rem; }
.fc-search-form label:nth-child(2) { flex: 1 1 9rem; }
.fc-search-results { margin-top: 1rem; }
.fc-search-results:empty { display: none; }
.fc-search-results .fc-list { margin-block: .5rem .85rem; }
.fc-search-results .fc-list li { padding-block: .6rem; }
