/* Ontleed: sentence parsing on top of the shared styles.
   Red means a mistake, so no zinsdeel colour is red; mistakes also get a ✗, correct words a ✓. */
.lab-ow { --lab: #22201d; --lab-soft: #e6dfd2; }
.lab-wg, .lab-wd { --lab: #1d4ed8; --lab-soft: #e0e9ff; }
.lab-nd { --lab: #6d28d9; --lab-soft: #ede4ff; }
.lab-lv { --lab: #15803d; --lab-soft: #dcf5e4; }
.lab-mv { --lab: #be185d; --lab-soft: #fce4f0; }
.lab-vv { --lab: #0f766e; --lab-soft: #d7f3ef; }
.lab-bwb { --lab: #a15c07; --lab-soft: #fdefd3; }
.lab-bvg { --lab: #5f6b0c; --lab-soft: #eef2cf; }

.parse-stats { grid-template-columns: repeat(4, minmax(58px, 1fr)); }

.step-trail { display: flex; gap: 6px; margin: 20px 0 4px; }
.step-trail i { flex: 1; height: 6px; border-radius: 99px; background: var(--paper-deep); }
.step-trail i.is-done { background: var(--green); }
.step-trail i.is-current { background: var(--accent); }

.sentence {
  margin: 24px 0 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 6px;
  font: 500 clamp(21px, 5vw, 27px)/1.3 Georgia, "Times New Roman", serif;
}
.tok {
  padding: 5px 8px; border: 2px solid transparent; border-radius: 10px; color: var(--ink); background: none; font: inherit;
}
button.tok { border-color: var(--line); background: var(--white); cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
button.tok:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.tok.has-lab { color: var(--lab); background: var(--lab-soft); }
.tok.is-selected { border-color: var(--lab, var(--ink)); color: var(--lab, var(--ink)); background: var(--lab-soft, var(--paper-deep)); }
.tok.is-pv { text-decoration: underline 3px; text-underline-offset: 6px; font-weight: 700; }

/* Colouring: a painted word shows its zinsdeel underneath. */
.tok[data-action="paint"] { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.tok[data-action="paint"] small { min-height: 11px; font: 800 11px/1 system-ui, sans-serif; letter-spacing: .07em; text-transform: uppercase; }
button.tok.is-painted { border-color: transparent; }
button.tok.is-wrong { border: 2px dashed var(--red); animation: shake .35s ease; }
button.tok.is-wrong small::after { content: " ✗"; color: var(--red); }
button.tok[data-action="paint"]:disabled small::after { content: " ✓"; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
button.tok:disabled { cursor: default; transform: none; }
.label-button.is-active { border-color: var(--lab); box-shadow: 0 0 0 3px var(--lab-soft), inset 0 0 0 1px var(--lab); }

.seg {
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 10px;
  border: 2px solid transparent; border-radius: 12px; color: var(--ink); font: inherit;
}
.seg small { font: 800 11px/1 system-ui, sans-serif; letter-spacing: .07em; text-transform: uppercase; }
.seg.has-lab { color: var(--lab); background: var(--lab-soft); }

.choice-button small { display: block; margin-top: 3px; color: var(--muted); font-weight: 600; }
.label-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px; margin-bottom: 14px; }
.label-button {
  min-height: 50px; padding: 8px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid transparent;
  border-radius: 13px; color: var(--lab); background: var(--lab-soft); text-align: left; font-size: 14px; font-weight: 650; cursor: pointer;
}
.label-button b { min-width: 2.4em; font-size: 15px; text-transform: uppercase; }
.label-button:hover:not(:disabled) { border-color: var(--lab); }
.label-button:disabled { opacity: .45; cursor: default; }

.parse-actions { margin-top: 14px; }
.parse-actions .primary-button:disabled { opacity: .45; cursor: default; }
.parse-view .hint ul { margin: 0; padding-left: 18px; }
.parse-view .hint li + li { margin-top: 5px; }

.list-view h2, .guide-view h2 { margin: 28px 0 8px; font: 600 20px/1.2 Georgia, serif; }
.sentence-list { margin: 0; padding-left: 26px; }
.sentence-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sentence-list small { color: var(--muted); font-size: 13px; }
.analysis { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px; font: 500 18px/1.3 Georgia, serif; }
.parse-view .sentence .seg u { text-decoration-thickness: 3px; text-underline-offset: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 4px; font-size: 13px; }
.legend .seg { flex-direction: row; gap: 7px; padding: 5px 9px; }

.guide-view details { margin-top: 10px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.guide-view summary { cursor: pointer; font-weight: 750; }
.guide-view details div { line-height: 1.55; }
.guide-view ol, .guide-view ul { padding-left: 20px; }
.guide-view .example { padding: 9px 12px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--paper-deep); }

@media (max-width: 600px) {
  .label-palette { grid-template-columns: 1fr 1fr; }
  .label-button span { font-size: 12px; }
  .parse-actions { flex-direction: row; flex-wrap: wrap; }
  .parse-actions .primary-button { flex-basis: 100%; }
}
.written-feedback > .parse-message { margin-top: 0; }

