html, body { margin: 0; min-height: 100%; background: #0f1115; color: #e8ecf1; font-family: system-ui, sans-serif; }
#app { max-width: 960px; margin: 0 auto; padding: 24px; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; margin-bottom: 8px; }
.muted { color: #8b95a5; }
.small { font-size: 0.8rem; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.row.wrap { flex-wrap: wrap; }
.row.center, .chips.center { justify-content: center; }
.row .fx-input { flex: 1; min-width: 160px; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid #232833; margin-bottom: 18px; }
.top h1 { font-size: 1.4rem; color: #7cc4ff; }
nav { display: flex; gap: 4px; }
.tab { background: none; border: 0; color: #8b95a5; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 0.95rem; }
.tab:hover { color: #e8ecf1; }
.tab.active { background: #1c2230; color: #fff; }
.fx-card { background: #171b24; border: 1px solid #232833; border-radius: 12px; padding: 16px; margin: 12px 0; }
.fx-card.empty { text-align: center; padding: 32px 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.grid .fx-card { margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chips:empty { margin: 0; }
.tag { font-size: 0.72rem; background: #1c2230; color: #9bb4d4; border-radius: 10px; padding: 2px 8px; }
.fx-badge.due, .fx-badge.st-due { background: #4a2a1c; color: #ffb27a; }
.fx-badge.st-new { background: #1c3550; color: #7cc4ff; }
.fx-badge.st-learning { background: #4a411c; color: #ffe27a; }
.fx-badge.st-mature { background: #1c4a2c; color: #7aff9f; }
.fx-badge.st-suspended { background: #3a3a44; color: #b5b5c4; }
.form textarea, .form .fx-input { width: 100%; box-sizing: border-box; margin-bottom: 8px; resize: vertical; font-family: inherit; }
.err { color: #ff7a7a; min-height: 1.1em; font-size: 0.85rem; margin-bottom: 6px; }
.item { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.item.dim { opacity: .55; }
.item .txt { flex: 1; min-width: 200px; }
.item .q { font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.item .a { overflow-wrap: anywhere; white-space: pre-wrap; }
.progress { height: 6px; background: #232833; border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.progress div { height: 100%; background: #4da3ff; transition: width .3s; }
.flash { background: #171b24; border: 1px solid #2c3445; border-radius: 16px; min-height: 260px; padding: 28px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; cursor: pointer; gap: 10px; outline: none; }
.flash:focus-visible { border-color: #4da3ff; }
.flash.flipped { border-color: #3a5f8f; }
.flash hr { width: 60%; border: 0; border-top: 1px solid #2c3445; }
.big { font-size: 1.7rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.big.ans { color: #7cc4ff; }
.rates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.rate { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; }
.rate span { font-size: 0.8rem; opacity: .8; }
.rate kbd { font-size: 0.7rem; opacity: .6; }
kbd { background: #232833; border: 1px solid #343c4d; border-radius: 4px; padding: 1px 6px; font-size: 0.8rem; }
.help td { padding: 4px 10px; }
.r-again { border-color: #ff6b6b !important; }
.r-hard { border-color: #ffb454 !important; }
.r-good { border-color: #5fd68a !important; }
.r-easy { border-color: #4da3ff !important; }
.fx-badge.r-again, .fx-badge.r-hard, .fx-badge.r-good, .fx-badge.r-easy { border: 1px solid; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.tile { text-align: center; margin: 0; }
.tile .num { font-size: 1.8rem; font-weight: 700; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 18px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar .fill { width: 100%; background: linear-gradient(#4da3ff, #2a6fb8); border-radius: 4px 4px 0 0; }
.bar .v { font-size: 0.7rem; color: #8b95a5; }
.bar .l { font-size: 0.65rem; color: #8b95a5; margin-top: 4px; }
.stack { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: #232833; }
.seg.new { background: #4da3ff; }
.seg.learning { background: #e5c84a; }
.seg.due { background: #ff9a5a; }
.seg.mature { background: #5fd68a; }
.seg.suspended { background: #6b6b7a; }
@media (max-width: 560px) {
  #app { padding: 14px; }
  .rates { grid-template-columns: repeat(2, 1fr); }
  .big { font-size: 1.3rem; }
  .item { flex-wrap: wrap; }
}
