/* Knowledge-driven lesson pieces and the staff knowledge map. Pearl: soft white, one deep blue. */
.kd-shell { max-width: 960px; margin: 0 auto; display: grid; gap: 20px; color: var(--ink, #1d1d1f); font-family: var(--app-font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif); padding-bottom: 48px; min-width: 0; }
.kd-shell h1 { font-size: clamp(32px, 4vw, 44px); letter-spacing: -.04em; line-height: 1.12; margin: 6px 0 10px; }
.kd-shell h2 { font-size: 22px; letter-spacing: -.03em; margin: 0 0 12px; }
.kd-shell h3 { font-size: 17px; letter-spacing: -.015em; margin: 0; }
.kd-heading p { color: var(--muted, #686b73); font-size: 16px; margin: 0; }
.kd-eyebrow { color: var(--accent, #1046ab); font-size: 11px; font-weight: 650; letter-spacing: .085em; }
.kd-panel { padding: 24px; border: 1px solid var(--line, #e5e6ea); border-radius: 20px; background: var(--pearl-surface, #fff); box-shadow: var(--pearl-shadow, none); min-width: 0; overflow-wrap: anywhere; }
.kd-panel > * + * { margin-top: 12px; }
.kd-muted, .kd-fine { color: var(--muted, #686b73); }
.kd-fine { font-size: 13px; line-height: 1.5; }
.kd-hash { word-break: break-all; }
.kd-back, .kd-link { color: var(--accent, #1046ab); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; text-align: left; }
.kd-back:hover, .kd-link:hover { text-decoration: underline; }
.kd-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px; border: 1px solid var(--accent, #1046ab); border-radius: 14px; background: var(--pearl-action, #1046ab); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.kd-button.kd-secondary { background: #fff; color: var(--accent, #1046ab); border-color: #e0e3e9; }
.kd-button:disabled { opacity: .55; cursor: default; }
.kd-shell :focus-visible, .kd-ask :focus-visible, .kd-trace :focus-visible { outline: 3px solid var(--accent, #1046ab); outline-offset: 3px; }
.kd-message { padding: 12px 16px; border-radius: 12px; background: var(--accent-soft, #eef3fc); color: var(--accent-deep, #0d3889); margin: 0; }
.kd-error { color: #9b2929; background: #fff2f1; padding: 12px 16px; border-radius: 12px; margin: 0; }
.kd-warn-text { color: #855d26; }

/* Badges: provenance and football category stay visibly separate. */
.kd-badges, .kd-axes { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kd-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; background: #f0f2f6; color: #4a5568; }
.kd-badge.kd-prov { background: #eef3fc; color: #1a4d9c; }
.kd-badge.kd-cat { background: #fff; color: #253247; box-shadow: inset 0 0 0 1px #cfd6e2; }
.kd-badge.kd-missing { background: transparent; color: #7a8190; box-shadow: inset 0 0 0 1px #dfe3ea; font-weight: 500; }
.kd-badge.kd-ok { background: #e9f5ee; color: #1f6b43; }
.kd-badge.kd-warn { background: #fcf2e1; color: #855d26; }
.kd-badge.kd-quiet { background: #f3f4f7; color: #5b6475; }
.kd-badge.kd-draft { background: #fcf2e1; color: #7a5420; white-space: normal; }

/* Draft label and approved legacy lesson. */
.kd-draft-label { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 0 0 18px; color: var(--muted, #686b73); font-size: 14px; line-height: 1.5; }
.kd-approved { padding: 24px; border: 1px solid var(--line, #e5e6ea); border-radius: 20px; background: var(--pearl-surface, #fff); box-shadow: var(--pearl-shadow, none); display: grid; gap: 10px; margin-bottom: 18px; }
.kd-approved h2 { margin: 0; }
.kd-approved .kd-badge { justify-self: start; }
.kd-connected { margin-bottom: 16px; }
.kd-approved p { margin: 0; }

/* Whole-play trace. */
.kd-trace { margin-top: 18px; padding: 20px; border-radius: 16px; background: #f7f8fb; border: 1px solid #eceef2; }
.kd-trace-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.kd-trace h3 { font-size: 17px; margin: 0; }
.kd-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.kd-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid #eceef2; }
.kd-steps li:first-child { border-top: 0; }
.kd-step-number { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent, #1046ab); color: #fff; font-size: 13px; font-weight: 650; }
.kd-steps li.is-awaiting .kd-step-number { background: #dfe3ea; color: #5b6475; }
.kd-step-label { display: block; font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--accent, #1046ab); }
.kd-steps li.is-awaiting .kd-step-label { color: #5b6475; }
.kd-steps p { margin: 2px 0 0; line-height: 1.5; }
.kd-steps li.is-awaiting p { color: #7a8190; font-style: italic; }
.kd-step-note { font-size: 14px; color: var(--muted, #686b73); }
.kd-concepts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 0; font-size: 13px; color: var(--muted, #686b73); }
.kd-concepts > span:first-child { font-weight: 650; margin-right: 4px; }
.kd-tag { display: inline-flex; padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid #d8deea; color: #253247; font-size: 13px; }
.kd-tag-awaiting { color: #7a8190; border-style: dashed; }

/* Ask about this. */
.kd-ask { margin-top: 18px; border-top: 1px solid var(--line, #e5e6ea); padding-top: 4px; }
.kd-ask > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent, #1046ab); font-size: 15px; font-weight: 600; }
/* The screen keeps one primary action: Ask about this uses secondary buttons. */
.kd-ask .kd-button { background: #fff; color: var(--accent, #1046ab); border-color: #d5dce9; box-shadow: none; }
.kd-ask-form { display: grid; gap: 12px; margin: 8px 0 0; }
.kd-ask-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 550; }
.kd-ask-form textarea { width: 100%; box-sizing: border-box; min-height: 88px; padding: 12px 14px; border: 1px solid #d3dce8; border-radius: 12px; font: inherit; font-size: 16px; resize: vertical; background: #f5f7faa8; }
.kd-ask-form .kd-button { justify-self: start; }
.kd-answer { margin-top: 14px; display: grid; gap: 10px; }
.kd-answer h3, .kd-answer h4 { margin: 0; }
.kd-answer p { margin: 0; line-height: 1.55; }
.kd-answer .kd-button { justify-self: start; }
.kd-statement { padding: 14px 0; border-top: 1px solid #eceef2; display: grid; gap: 8px; min-width: 0; }
.kd-statement-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.kd-statement blockquote, .kd-panel blockquote, .kd-occurrences blockquote { margin: 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--accent, #1046ab); color: #2a3240; white-space: pre-wrap; }
.kd-cite { font-size: 13px; color: var(--muted, #686b73); }
.kd-binding { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: #f7f8fb; }
.kd-binding p { margin: 2px 0; }
.kd-excerpts { margin-top: 16px; }
.kd-excerpts > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }

/* Staff map. */
.kd-row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.kd-row-head h2, .kd-row-head h3 { margin: 0; }
.kd-count { font-size: 14px; color: var(--muted, #686b73); }
.kd-coverage-line { font-size: 17px; font-weight: 550; letter-spacing: -.01em; }
.kd-facts, .kd-gaps, .kd-list, .kd-occurrences, .kd-totals { list-style: none; margin: 0; padding: 0; }
.kd-facts li, .kd-gaps li { display: flex; justify-content: space-between; gap: 6px 16px; padding: 10px 0; border-top: 1px solid #eceef2; flex-wrap: wrap; }
.kd-facts li span { color: var(--muted, #686b73); }
.kd-gaps li div { display: grid; gap: 2px; min-width: 0; flex: 1 1 240px; }
.kd-gaps li div span { font-size: 13px; color: var(--muted, #686b73); }
.kd-list li { border-top: 1px solid #eceef2; }
.kd-list li > a { display: flex; justify-content: space-between; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 12px 0; min-height: 44px; color: inherit; text-decoration: none; }
.kd-list li > a:hover strong { color: var(--accent, #1046ab); }
.kd-list li > a > span:first-child { display: grid; gap: 2px; min-width: 0; flex: 1 1 220px; }
.kd-list small { color: var(--muted, #686b73); font-size: 13px; }
.kd-list-end { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kd-empty { padding: 14px 0; color: var(--muted, #686b73); border-top: 1px solid #eceef2; }
.kd-rel { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 12px 0 4px; }
.kd-rel-kind { font-size: 13px; font-weight: 650; color: #4a5568; }
.kd-rel a { color: var(--accent, #1046ab); font-weight: 600; text-decoration: none; }
.kd-list details, .kd-occurrences details { padding-bottom: 8px; }
.kd-list summary, .kd-occurrences summary, .kd-delivery summary { cursor: pointer; min-height: 44px; display: list-item; padding: 11px 0; line-height: 1.5; color: #3c4658; }
.kd-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.kd-filters label, .kd-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 550; min-width: 0; }
.kd-filters select, .kd-filters input, .kd-form select, .kd-form textarea, .kd-form input { width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 12px; border: 1px solid #d3dce8; border-radius: 12px; font: inherit; font-size: 16px; background: #f5f7faa8; color: inherit; }
.kd-form { display: grid; gap: 12px; margin-top: 12px; }
.kd-form textarea { min-height: 80px; resize: vertical; }
.kd-form .kd-button { justify-self: start; }
.kd-lesson { padding: 16px 0; border-top: 1px solid #eceef2; display: grid; gap: 8px; }
.kd-lesson p { margin: 0; }
.kd-occurrences li { padding: 14px 0; border-top: 1px solid #eceef2; display: grid; gap: 8px; min-width: 0; }
.kd-occurrences .kd-row-head > div { display: grid; gap: 2px; }
.kd-dl { display: grid; gap: 8px; margin: 0; }
.kd-dl div { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr); gap: 12px; }
.kd-dl dt { color: var(--muted, #686b73); font-size: 13px; }
.kd-dl dt::first-letter { text-transform: uppercase; }
.kd-dl dd { margin: 0; white-space: pre-wrap; }
.kd-original dt::first-letter { text-transform: none; }
.kd-original dt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.kd-definition { font-size: 17px; line-height: 1.55; }
.kd-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: #eceef180; border: 1px solid #e8e9ed; width: max-content; max-width: 100%; }
.kd-tabs button { min-height: 44px; padding: 8px 16px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: #4a5568; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.kd-tabs button[aria-pressed="true"] { background: #fff; color: var(--accent, #1046ab); border-color: #fff; box-shadow: 0 2px 5px #2636520c; }
.kd-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.kd-totals li { padding: 12px; border-radius: 14px; background: #f7f8fb; display: grid; gap: 2px; }
.kd-totals strong { font-size: 24px; letter-spacing: -.03em; }
.kd-totals span { font-size: 13px; color: var(--muted, #686b73); }
.kd-timeline { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; }
.kd-timeline p { margin: 2px 0 0; }
.kd-bullets { margin: 0; padding-left: 20px; line-height: 1.6; }
.kd-inline { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
@media (max-width: 640px) {
  .kd-panel, .kd-approved { padding: 20px 16px; border-radius: 18px; }
  .kd-shell h1 { font-size: 32px; }
  .kd-dl div { grid-template-columns: 1fr; gap: 2px; }
  .kd-inline { grid-template-columns: 1fr; }
  .kd-trace { padding: 16px 14px; }
  .kd-tabs { width: 100%; }
  .kd-tabs button { flex: 1 1 0; padding: 8px 10px; }
  .kd-ask-form .kd-button, .kd-answer .kd-button, .kd-form .kd-button { width: 100%; justify-self: stretch; }
}
