/* ============================================================
   Flashcards — flashcards/index.html

   Loaded after assets/css/style.css and built entirely on its tokens:
   no colour literal appears here (BUILD.md §2).

     sage  (--accent)  the interface: tabs, folders, buttons, pictures
     honey (--gold*)   progress only: learned meters, the session bar,
                       box pips, and the one "start" button
     --ok / --no       grading a card is answering, so "Got it" and
                       "Again" take the answer-feedback family

   Motion stays gentle: the card "flips" by cross-fading its faces —
   no 3D rotation, no hover lifts (§2).
   ============================================================ */

.fc-main { max-width: 880px; }
.fc-app { min-height: 50vh; }
.fc-note { color: var(--muted); }

.fc-h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}
.fc-h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
}
.fc-lead, .fc-hint, .fc-summary, .fc-calm, .fc-quiet, .fc-found {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: var(--measure);
}
.fc-hint, .fc-quiet, .fc-found { color: var(--muted); font-size: 0.86rem; }
.fc-calm { color: var(--ink); }

/* ---- storage notice ---- */
.fc-notice {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--no);
  background: var(--bg-sunken);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.fc-notice p { margin: 0 0 10px; color: var(--ink-soft); font-size: 0.92rem; }

/* ---- global stats ---- */
.fc-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.fc-stat {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}
.fc-stat.is-progress { background: var(--gold-soft); color: var(--gold-text); border-color: transparent; }

/* ---- tabs ---- */
.fc-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.fc-tab {
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  padding: 10px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.fc-tab:hover { color: var(--ink); }
.fc-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.fc-panel {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 24px 24px 22px;
  box-shadow: var(--shadow-sm);
}

/* ---- buttons ---- */
.fc-btn, .fc-cta, .fc-link, .fc-seg-btn, .fc-crumb, .fc-soon-toggle, .fc-toast-btn {
  font: inherit;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.fc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}
.fc-btn:hover { border-color: var(--accent); color: var(--accent-soft-ink); background: var(--accent-soft); }
.fc-btn.is-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fc-btn.is-accent:hover { background: var(--accent-hover); }
.fc-btn.is-danger { color: var(--no-text); }
.fc-btn:disabled, .fc-cta:disabled, .fc-link:disabled { opacity: 0.45; cursor: not-allowed; }

/* The one step forward on the page — honey, like .start-cta. */
.fc-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--gold-strong);
  color: var(--gold-ink);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--glow-gold);
}
.fc-cta:hover:not(:disabled) { filter: brightness(1.08); }
.fc-cta:disabled { box-shadow: none; }

.fc-link {
  border: none;
  background: none;
  padding: 6px 4px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}
.fc-link:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.fc-link.is-danger { color: var(--muted); }
.fc-link.is-danger:hover, .fc-link.is-armed, .fc-btn.is-armed { color: var(--no-text); }

.fc-btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 6px 0 14px;
}
.fc-btn-row.is-center { justify-content: center; }
.fc-actions-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  max-width: 420px;
  margin-top: 6px;
}
.fc-actions-col .fc-hint { margin: 0; }

/* ---- segmented choice (front side, session size) ---- */
.fc-seg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 12px;
}
.fc-seg-label { font-size: 0.86rem; color: var(--muted); font-weight: 600; min-width: 9em; }
.fc-seg-group {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-sunken);
  padding: 3px;
  gap: 2px;
}
.fc-seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 14px;
  min-height: 32px;
  border-radius: var(--radius-pill);
}
.fc-seg-btn:hover { color: var(--ink); }
.fc-seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---- study tree: many folders, readable at 360px ---- */
.fc-tree { list-style: none; margin: 0; padding: 0; }
.fc-setup > .fc-tree {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 8px 0 6px;
  overflow: hidden;
}
.fc-tree-item + .fc-tree-item { border-top: 1px solid var(--border); }
.fc-tree .fc-tree { border-top: 1px solid var(--border); background: var(--bg); }
.fc-tree-row {
  --depth: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 8px 12px 8px calc(8px + var(--depth) * 22px);
}
.fc-caret, .fc-caret-space { width: 30px; height: 30px; flex: none; }
.fc-caret {
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
}
.fc-caret::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease);
}
.fc-caret[aria-expanded="true"]::before { transform: rotate(45deg); top: 8px; }
.fc-caret:hover { background: var(--accent-soft); }
.fc-check {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 180px;
  min-width: 0;
  cursor: pointer;
  padding: 2px 0;
}
.fc-check input {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
}
.fc-check.is-disabled { cursor: default; color: var(--muted); }
.fc-check-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.fc-check-title { font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.fc-check.is-disabled .fc-check-title { color: var(--muted); }
.fc-check-sub { font-size: 0.8rem; color: var(--muted); }
.fc-tree-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.fc-pill {
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-soft-ink);
  font-weight: 600;
}

.fc-tree-item.is-soon { background: var(--bg); }
.fc-soon-toggle {
  --depth: 0;
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 10px 12px 10px calc(46px + var(--depth) * 22px);
}
.fc-soon-toggle:hover { color: var(--ink); }
.fc-soon-list {
  --depth: 0;
  list-style: none;
  margin: 0;
  padding: 0 12px 10px calc(46px + var(--depth) * 22px);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fc-soon-list li {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
}

.fc-summary { margin-top: 12px; font-weight: 600; color: var(--ink); }

/* ---- study session ---- */
.fc-session-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.fc-count { font-size: 0.84rem; font-weight: 600; color: var(--muted); }

.fc-progress, .fc-meter-track, .fc-mini {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  overflow: hidden;
}
.fc-progress { margin-bottom: 16px; }
.fc-progress-fill, .fc-meter-fill, .fc-mini-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--gold-strong), var(--gold));
  transition: width 0.5s var(--ease);
}

.fc-card {
  display: grid;
  min-height: 330px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.fc-card:hover { border-color: var(--accent); }
.fc-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fc-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 22px 20px;
  min-width: 0;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}
.fc-face-meta {
  align-self: stretch;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: auto;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: left;
}
.fc-face > :last-child { margin-bottom: auto; }
.fc-back { opacity: 0; visibility: hidden; }
.fc-card.is-flipped .fc-front { opacity: 0; visibility: hidden; }
.fc-card.is-flipped .fc-back { opacity: 1; visibility: visible; }

.fc-word {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.4rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.fc-word .tr { font-weight: 600; }
.fc-word-small {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.05rem;
}
.fc-gloss {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.1rem + 1.4vw, 1.8rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.fc-gloss-small { margin: 0; color: var(--ink-soft); font-size: 1rem; }
.fc-tap { margin: 6px 0 0; font-size: 0.8rem; color: var(--muted); }
.fc-card-art { width: 76px; height: 76px; color: var(--accent); flex: none; }
.fc-card-letter, .fc-row-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-soft-ink);
  font-family: var(--font-display);
  font-weight: 600;
}
.fc-card-letter { width: 76px; height: 76px; font-size: 2.2rem; }

.fc-example {
  width: 100%;
  max-width: 460px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.fc-example-tr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fc-example-tr .tr { font-weight: 500; font-style: italic; }
.fc-example-gloss { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }

button.speak-btn.fc-speak.is-small { min-height: 32px; padding: 5px 10px; font-size: 0.82rem; }

.fc-boxes { display: inline-flex; gap: 3px; flex: none; }
.fc-boxes i {
  width: 12px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-sunken);
  border: 1px solid var(--border-strong);
}
.fc-boxes i.is-on { background: var(--gold); border-color: var(--gold); }

.fc-grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.fc-grade .fc-btn { min-height: 48px; font-size: 0.95rem; }
.fc-grade .fc-show { grid-column: 1 / -1; }
.fc-again { color: var(--no-text); }
.fc-again:hover { background: var(--no-soft); border-color: var(--no); color: var(--no-text); }
.fc-good { color: var(--ok-text); }
.fc-good:hover { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-text); }
.fc-next { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fc-next:hover { background: var(--accent-hover); color: var(--accent-ink); }
.fc-nav { display: flex; justify-content: space-between; margin-top: 6px; }
.fc-keys { margin: 12px 0 0; font-size: 0.76rem; color: var(--muted); text-align: center; }
@media (hover: none) { .fc-keys { display: none; } }

.fc-empty { text-align: center; padding: 30px 10px; }
.fc-empty h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin: 6px 0 8px; }
.fc-empty p { color: var(--ink-soft); max-width: 46ch; margin: 0 auto 14px; }
.fc-empty-art { width: 64px; height: 64px; color: var(--accent); }
.fc-empty-art.is-progress { color: var(--gold); }

/* ---- browse ---- */
.fc-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  margin-bottom: 14px;
  font-size: 0.86rem;
}
.fc-crumb {
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}
.fc-crumb:hover { background: var(--accent-soft); }
.fc-crumb[aria-current="page"] { color: var(--ink); cursor: default; background: none; }
.fc-crumb-sep { color: var(--muted); }

.fc-folder-head { margin-bottom: 16px; }
.fc-folder-sub { margin: 0 0 8px; color: var(--muted); font-size: 0.9rem; }
.fc-meter { display: flex; flex-direction: column; gap: 6px; max-width: 460px; }
.fc-meter-label { font-size: 0.8rem; color: var(--gold-text); font-weight: 600; }

.fc-searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.fc-search, .fc-field input, .fc-select, .fc-inline-input {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  min-height: 42px;
  min-width: 0;
}
.fc-search { flex: 1; }
.fc-search:focus, .fc-field input:focus, .fc-select:focus, .fc-inline-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.fc-search::placeholder, .fc-inline-input::placeholder { color: var(--muted); }

.fc-folders { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.fc-folder-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.fc-folder-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
/* a folder, drawn in CSS so it themes with the page */
.fc-folder-icon {
  position: relative;
  width: 26px;
  height: 20px;
  flex: none;
  border: 2px solid var(--accent);
  border-radius: 3px 3px 4px 4px;
  margin-top: 4px;
}
.fc-folder-icon::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -7px;
  width: 11px;
  height: 5px;
  border: 2px solid var(--accent);
  border-bottom: none;
  border-radius: 3px 3px 0 0;
}
.fc-folder-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.fc-folder-name { font-weight: 600; }
.fc-folder-sub, .fc-folder-meta { font-size: 0.8rem; color: var(--muted); }
.fc-mini { width: 56px; height: 6px; flex: none; }
.fc-chevron { color: var(--muted); font-size: 1.3rem; line-height: 1; }
.fc-folders .fc-tree-item.is-soon { border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }
.fc-folders .fc-soon-toggle, .fc-folders .fc-soon-list { padding-left: 14px; }
.fc-folder-new { padding: 2px 2px; }

.fc-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fc-inline-input { flex: 1 1 180px; }

.fc-cards { list-style: none; margin: 0; padding: 0; }
.fc-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.fc-row-art { width: 40px; height: 40px; color: var(--accent); flex: none; margin-top: 2px; }
.fc-row-letter { width: 40px; height: 40px; font-size: 1.2rem; border-radius: var(--radius-sm); }
.fc-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fc-row-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
  font: inherit;
  border: none;
  background: none;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: inherit;
}
.fc-row-open:hover { background: var(--accent-soft); }
.fc-row-tr { font-size: 1.02rem; overflow-wrap: anywhere; }
.fc-row-gloss { color: var(--ink-soft); font-size: 0.9rem; overflow-wrap: anywhere; }
.fc-row-ex { font-weight: 400; font-style: italic; color: var(--muted); font-size: 0.84rem; overflow-wrap: anywhere; }
.fc-row-where { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.fc-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: none;
  max-width: 45%;
}
.fc-row-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 6px; }
.fc-row-tools .fc-link { font-size: 0.78rem; padding: 2px; }
.fc-select { max-width: 100%; }

.fc-form {
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 0 0 16px;
}
.fc-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 14px;
  margin-bottom: 10px;
}
.fc-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.fc-form-grid .fc-field { margin-bottom: 0; }
.fc-field label { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.fc-error { margin: 0 0 6px; min-height: 1.2em; color: var(--no-text); font-size: 0.86rem; font-weight: 600; }

.fc-data {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ---- toast ---- */
.fc-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 50;
}
.fc-toast-btn {
  border: 1px solid currentColor;
  background: none;
  color: inherit;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---- phone width is the design target (§2) ---- */
@media (max-width: 560px) {
  .fc-panel { padding: 18px 14px; border-radius: var(--radius-md); }
  .fc-card { min-height: 300px; }
  .fc-tree-row { padding-right: 8px; }
  .fc-tree-meta { margin-left: 38px; }
  .fc-seg-label { min-width: 0; flex-basis: 100%; }
  .fc-row-side { max-width: 40%; }
  .fc-mini { display: none; }
}
