.ks-subtitle {
  color: var(--text-dark-muted);
  font-size: var(--text-s);
  margin-block-start: 0.35em;
}
.ks-tagline {
  color: var(--text-color);
  font-size: var(--text-m);
  margin-block-start: 0.5em;
}
.ks-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em 1em;
  margin-block-start: 0.85em;
}
.ks-nav__link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-s);
}
.ks-nav__link:hover { text-decoration: underline; }
.ks-nav a.btn--primary { margin-inline-start: auto; }
.speech-cue {
  margin: 0;
  padding: 0.65em 0.85em;
  border-radius: 6px;
  font-size: var(--text-s);
}
.speech-cue a { color: var(--primary); font-weight: 600; text-decoration: none; }
.speech-cue a:hover { text-decoration: underline; }
.speech-cue rt { font-size: 0.55em; }
footer.credit .learner-note {
  margin: 0 0 0.35em;
  padding: 0.65em 0.85em;
  background: var(--bg-ultra-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  font-size: var(--text-s);
}
footer.credit p { margin-block-start: 0.35em; font-size: var(--text-s); }
footer.credit a { color: var(--primary); font-weight: 600; text-decoration: none; }
footer.credit a:hover { text-decoration: underline; }
.ks-meta { color: var(--text-dark-muted); }
/* tst-sentence-card — match live kanjistuff.com apple cards */
.tst-apple {
  gap: 1.25rem;
}
.tst-sentence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  counter-reset: ks-sentence;
}
.tst-sentence-list > li {
  margin: 0;
  padding: 0;
  counter-increment: ks-sentence;
}
.tst-sentence-card {
  position: relative;
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem 1.1rem 1rem 3.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.tst-sentence-card::before {
  content: counter(ks-sentence);
  position: absolute;
  left: 0.85rem;
  top: 1rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tst-sentence-card .english {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.tst-sentence-card .romaji {
  font-size: 18px;
  color: var(--text-dark-muted);
  font-style: italic;
  margin-bottom: 0.25rem;
}
.tst-sentence-card .japanese {
  font-size: 24px;
  font-family: var(--font-2, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif);
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
  line-height: 2.25;
}
.tst-sentence-card .japanese.jp-chunks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  line-height: 2.4;
}
.tst-sentence-card .japanese .chunk {
  display: inline-block;
  white-space: nowrap;
}
.tst-sentence-card .japanese.jp-chunks.has-roles {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 0.35em 0;
  line-height: 2.4;
}
.tst-sentence-card .japanese .chunk-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  max-width: 100%;
  min-height: 4.35em;
}
.tst-sentence-card .japanese .chunk-block .chunk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2.4em;
  line-height: 2.4;
}
.tst-sentence-card .japanese .chunk-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  color: #8a8a8a;
  font-weight: 700;
  font-size: 1em;
  line-height: 1;
  height: 1.2em;
  padding: 0 0.08em;
  margin: 0;
  user-select: none;
  transform: translateY(-0.08em);
}
.tst-sentence-card .japanese.jp-chunks.has-roles > .chunk-sep {
  align-self: flex-start;
  height: 2.4em;
  transform: none;
  align-items: center;
}
.tst-sentence-card .japanese .chunk-role {
  display: block;
  margin-top: auto;
  margin-bottom: 0;
  padding: 0 0.15em;
  border: none;
  font-family: var(--text-font-family);
  font-size: 12px;
  font-weight: 500;
  font-style: normal;
  line-height: 1.25;
  color: var(--text-dark-muted);
  letter-spacing: 0.01em;
  max-width: 7.5em;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tst-sentence-card .japanese .chunk-role.particle-role {
  color: #9b3a32;
  font-weight: 600;
}
.tst-sentence-card .japanese .chunk.particle {
  color: #9b3a32;
  font-weight: 700;
  background: #f7e9e7;
  border: 1px solid #d9a39c;
  border-radius: 0.45em;
  padding: 0.06em 0.28em 0.1em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.tst-sentence-card .japanese ruby {
  ruby-position: over;
  ruby-align: center;
}
.tst-sentence-card .japanese rt {
  font-size: 55%;
  font-weight: 500;
  color: var(--text-dark-muted);
  font-style: normal;
  letter-spacing: 0;
  user-select: none;
}
.tst-sentence-card .spoken {
  margin: 0.1rem 0 0.75rem;
  padding: 0.55rem 0.8rem;
  background: #f3f6f4;
  border-radius: 6px;
}
.tst-sentence-card .spoken-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #5a6b5e;
  margin-bottom: 0.3rem;
  letter-spacing: 0.01em;
}
.tst-sentence-card .spoken-romaji {
  font-size: 15px;
  color: var(--text-dark-muted);
  font-style: italic;
  margin-bottom: 0.15rem;
}
.tst-sentence-card .spoken .japanese {
  font-size: 20px;
  margin-bottom: 0;
  line-height: 2.2;
}
.tst-sentence-card .spoken-note {
  font-size: 15px;
  color: var(--text-dark-muted);
  line-height: 1.45;
}
.tst-sentence-card .spoken .japanese + .spoken-note {
  margin-top: 0.35rem;
}
.tst-sentence-card .explain {
  font-size: 17px;
  color: #333;
  line-height: 1.6;
  background: #f5f0eb;
  border-left: 3px solid var(--primary);
  padding: 0.75rem 0.95rem;
  border-radius: 0 4px 4px 0;
}
.tst-sentence-card .explain strong {
  font-weight: 600;
  color: var(--text-dark);
}
@media screen and (max-width: 768px) {
  .tst-sentence-list { gap: 0.85rem; }
  .tst-sentence-card { padding: 0.9rem 1rem 0.9rem 2.9rem; }
  .tst-sentence-card::before {
    left: 0.7rem;
    top: 0.9rem;
    width: 1.55rem;
    height: 1.55rem;
    font-size: 14px;
  }
  .tst-sentence-card .english { font-size: 17px; }
  .tst-sentence-card .romaji { font-size: 16px; }
  .tst-sentence-card .japanese { font-size: 20px; line-height: 2.2; }
  .tst-sentence-card .spoken { padding: 0.5rem 0.7rem; }
  .tst-sentence-card .spoken-label { font-size: 12px; }
  .tst-sentence-card .spoken-romaji { font-size: 14px; }
  .tst-sentence-card .spoken .japanese { font-size: 18px; }
  .tst-sentence-card .spoken-note { font-size: 14px; }
  .tst-sentence-card .explain { font-size: 15px; }
}
@media screen and (max-width: 480px) {
  .tst-sentence-list { gap: 0.75rem; }
  .tst-sentence-card { padding: 0.8rem 0.85rem 0.8rem 2.55rem; }
  .tst-sentence-card::before {
    left: 0.55rem;
    top: 0.8rem;
    width: 1.4rem;
    height: 1.4rem;
    font-size: 13px;
  }
  .tst-sentence-card .english { font-size: 16px; }
  .tst-sentence-card .romaji { font-size: 15px; }
  .tst-sentence-card .japanese { font-size: 18px; line-height: 2.1; margin-bottom: 0.6rem; }
  .tst-sentence-card .spoken { margin-bottom: 0.6rem; padding: 0.45rem 0.6rem; }
  .tst-sentence-card .spoken-romaji { font-size: 13px; }
  .tst-sentence-card .spoken .japanese { font-size: 16px; }
  .tst-sentence-card .spoken-note { font-size: 13px; }
  .tst-sentence-card .explain { font-size: 14px; padding: 0.6rem 0.75rem; }
}
/* ks-nav mobile */
@media screen and (max-width: 768px) {
  .ks-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    margin-block-start: 1rem;
    padding-block-start: 0.85rem;
    border-block-start: 1px solid var(--neutral-light);
  }
  .ks-nav__link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--neutral-light);
    border-radius: 8px;
    background: var(--white);
    text-align: center;
    text-decoration: none;
  }
  .ks-nav__link:hover {
    text-decoration: none;
    border-color: var(--primary);
  }
  .ks-nav__link--current {
    color: var(--text-dark);
    background: var(--primary-ultra-light);
    border-color: var(--primary);
  }
  .ks-nav a.btn--primary {
    margin-inline-start: 0;
    margin-block-start: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: 100%;
    min-inline-size: 0;
    text-align: center;
  }
}
/* tst-core — Core words page, matched to the live list */
.tst-core .intro {
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin: 0 0 1.5rem;
  font-size: 17px;
  line-height: 1.6;
  color: #333;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.tst-core .intro p + p { margin-top: 0.65rem; }
.tst-core .intro strong { color: var(--text-dark); }
.tst-core .intro a,
.tst-core .next-steps a,
.tst-core .speech-cue a { color: var(--primary); }
.tst-core .how-to {
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  counter-reset: how;
}
.tst-core .how-to li {
  font-size: 16px;
  color: #333;
  padding-left: 1.35rem;
  position: relative;
  line-height: 1.55;
}
.tst-core .how-to li::before {
  content: counter(how, decimal);
  counter-increment: how;
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}
.tst-core .how-to strong { color: var(--text-dark); }
.tst-core .section-title {
  font-size: 22px;
  font-weight: 700;
  margin: 1.75rem 0 0.35rem;
  letter-spacing: -0.01em;
}
.tst-core .section-note {
  color: var(--text-dark-muted);
  font-size: 16px;
  margin: 0 0 0.85rem;
  line-height: 1.45;
}
.tst-core .study-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}
.tst-core .study-filter button {
  appearance: none;
  border: 1px solid #ddd;
  background: var(--white);
  color: var(--text-dark);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
}
.tst-core .study-filter button:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.tst-core .study-filter button[aria-pressed="true"] {
  border-color: var(--primary);
  background: #f7e9e7;
  color: var(--primary);
}
.tst-core .core-section.is-hidden { display: none; }
.tst-core .card-section {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.45rem;
}
.tst-core .example {
  background: #f5f0eb;
  border-left: 3px solid var(--primary);
  padding: 0.75rem 0.95rem;
  border-radius: 0 4px 4px 0;
  margin-bottom: 0.65rem;
}
.tst-core .example .label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 0.35rem;
}
.tst-core .example .english { font-size: 17px; font-weight: 600; margin-bottom: 0.25rem; }
.tst-core .example .romaji { font-size: 16px; margin-bottom: 0.15rem; }
.tst-core .example .japanese,
.tst-core .example .japanese.jp-chunks.has-roles {
  font-size: 20px;
  line-height: 2.2;
  margin-bottom: 0;
}
.tst-core .example .japanese .chunk-role { font-size: 11px; }
.tst-core .tst-sentence-card .explain {
  background: transparent;
  border-left: none;
  padding: 0;
  border-radius: 0;
  font-size: 16px;
  line-height: 1.55;
}
.tst-core .next-steps {
  margin-top: 2rem;
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
}
.tst-core .next-steps h2 { font-size: 18px; margin: 0 0 0.45rem; }
.tst-core .next-steps ul { margin: 0.4rem 0 0 1.2rem; }
.tst-core .next-steps li { margin-bottom: 0.3rem; }
.tst-core .next-steps p + p,
.tst-core .next-steps ul + p { margin-top: 0.65rem; }
@media screen and (max-width: 768px) {
  .tst-core .intro { font-size: 15px; padding: 0.9rem 1rem; }
  .tst-core .how-to li { font-size: 15px; }
  .tst-core .section-title { font-size: 20px; }
  .tst-core .section-note { font-size: 15px; }
  .tst-core .example .english,
  .tst-core .example .romaji { font-size: 15px; }
  .tst-core .example .japanese { font-size: 18px; }
  .tst-core .next-steps { font-size: 15px; }
}
@media screen and (max-width: 480px) {
  .tst-core .intro { font-size: 14px; padding: 0.8rem 0.85rem; margin-bottom: 1.15rem; }
  .tst-core .how-to li { font-size: 14px; }
  .tst-core .section-title { font-size: 18px; margin-top: 1.4rem; }
  .tst-core .section-note { font-size: 14px; }
  .tst-core .example { padding: 0.6rem 0.7rem; }
  .tst-core .example .english,
  .tst-core .example .romaji { font-size: 14px; }
  .tst-core .example .japanese { font-size: 16px; line-height: 2; }
  .tst-core .next-steps { font-size: 14px; padding: 0.85rem; }
  .tst-core .study-filter button { font-size: 13px; }
}
/* tst-study — Apple study mode, one card at a time */
.tst-study .speech-cue { margin: 0 0 1.25rem; }
.tst-study .study-deck { margin-bottom: 1.5rem; }
.tst-study .study-viewport { touch-action: pan-y; }
.tst-study .study-cards { gap: 0; }
.tst-study .study-cards > li { display: none; margin: 0; counter-increment: none; }
.tst-study .study-cards > li.is-active { display: block; }
.tst-study .study-cards .tst-sentence-card::before { content: attr(data-n); }
.tst-study .study-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.tst-study .study-progress {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.tst-study .study-btn {
  appearance: none;
  border: 1px solid var(--primary);
  background: var(--white);
  color: var(--primary);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  min-width: 6.5rem;
}
.tst-study .study-btn:hover:not(:disabled) { background: #f7e9e7; }
.tst-study .study-btn:disabled { opacity: 0.4; cursor: default; }
@media print {
  .tst-study .study-toolbar { display: none; }
  .tst-study .study-cards > li { display: block !important; }
}
/* tst-core-study — one core card at a time, Everyday by default */
.tst-core-study .speech-cue { margin: 0 0 1rem; }
.tst-core-study .study-filter { margin-bottom: 1rem; }
.tst-core-study .study-empty {
  display: none;
  padding: 1.25rem 1rem;
  background: var(--white);
  border: 1px dashed #ddd;
  border-radius: 8px;
  color: var(--text-dark-muted);
  font-size: 16px;
  text-align: center;
}
.tst-core-study .study-empty.is-visible { display: block; }