/* Knowledge Check — self-contained and loaded only for Workbooks using it.
   Reference: centered Dynamips-orange quiz emblem, compact nested answer rows and feedback. */
.dyn-knowledge-check {
    --dyn-kc-ink: #202631;
    --dyn-kc-muted: #606873;
    --dyn-kc-border: #e1e4e8;
    --dyn-kc-accent: #f14700;
    --dyn-kc-correct: #20703b;
    --dyn-kc-wrong: #a85b08;
    margin: 36px 0;
    color: var(--dyn-kc-ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
.dyn-knowledge-check,
.dyn-knowledge-check * { box-sizing: border-box; }
.dyn-knowledge-check [hidden] { display: none !important; }

/* Above the card, the brand-orange icon and headline are centered like the reference. */
.dyn-knowledge-check .dyn-kc-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 13px;
    margin: 0 0 24px;
    text-align: center;
}
.dyn-knowledge-check .dyn-kc-head > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.dyn-knowledge-check .dyn-kc-emblem {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 50%;
    background: var(--dyn-kc-accent);
    color: white;
    font-size: 23px;
    font-weight: 450;
    line-height: 1;
}
.dyn-knowledge-check .dyn-kc-emblem::before {
    content: "";
    position: absolute;
    inset: 11px;
    border: 1.5px solid #fff;
    border-radius: 50%;
}
.dyn-knowledge-check .dyn-kc-head strong {
    display: block;
    margin: 0;
    color: var(--dyn-kc-ink);
    font-size: 20px;
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: -.02em;
}
.dyn-knowledge-check .dyn-kc-head p {
    margin: 0 !important;
    color: var(--dyn-kc-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
}

/* Outer question card: simple and restrained, with a separate option panel. */
.dyn-knowledge-check .dyn-kc-card {
    width: 100%;
    padding: 26px 28px 24px;
    border: 1px solid var(--dyn-kc-border);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(17, 24, 39, .035);
}
.dyn-knowledge-check .dyn-kc-question {
    margin: 0 0 22px !important;
    color: #202631;
    font-size: 16px;
    font-weight: 550;
    line-height: 1.5;
    letter-spacing: -.01em;
    text-align: center;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.dyn-knowledge-check .dyn-kc-options {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--dyn-kc-border);
    border-radius: 9px;
    background: #fafafa;
}
.dyn-knowledge-check button.dyn-kc-option {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 54px;
    margin: 0;
    padding: 12px 15px;
    border: 0;
    border-bottom: 1px solid var(--dyn-kc-border);
    border-radius: 0;
    background: transparent;
    color: #363d46;
    box-shadow: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
    cursor: pointer;
    transition: background .15s ease;
}
.dyn-knowledge-check button.dyn-kc-option:last-child { border-bottom: 0; }
.dyn-knowledge-check button.dyn-kc-option:hover {
    background: #fff6f0;
    color: var(--dyn-kc-ink);
    box-shadow: none;
}
.dyn-knowledge-check button.dyn-kc-option.is-selected {
    background: #fff0e6;
    color: var(--dyn-kc-ink);
    box-shadow: inset 3px 0 0 var(--dyn-kc-accent);
}
.dyn-knowledge-check .dyn-kc-letter,
.dyn-knowledge-check .dyn-kc-answer-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    border-radius: 50%;
    background: #fff0e6;
    color: #c84300;
    font-size: 14px;
    font-weight: 550;
    line-height: 1;
}
.dyn-knowledge-check .dyn-kc-option.is-selected .dyn-kc-letter {
    background: var(--dyn-kc-accent);
    color: #fff;
}
.dyn-knowledge-check .dyn-kc-choice {
    min-width: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.dyn-knowledge-check .dyn-kc-check-row {
    display: flex;
    justify-content: flex-end;
    margin: 21px 0 0;
}
.dyn-knowledge-check button.dyn-kc-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    min-height: 37px;
    margin: 0;
    padding: 8px 16px;
    border: 1px solid #242424;
    border-radius: 7px;
    background: #242424;
    color: #fff;
    box-shadow: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 550;
    line-height: 1.35;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
}
.dyn-knowledge-check button.dyn-kc-button:hover {
    background: #383838;
    color: #fff;
}
.dyn-knowledge-check button.dyn-kc-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.dyn-knowledge-check button:focus-visible {
    outline: 2px solid var(--dyn-kc-accent);
    outline-offset: 3px;
}

/* Correct / Not Quite uses a separate inset panel, as in the reference. */
.dyn-knowledge-check .dyn-kc-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
}
.dyn-knowledge-check .dyn-kc-result-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
    padding: 26px 20px;
    border: 1px solid var(--dyn-kc-border);
    border-radius: 9px;
    background: #fff;
}
.dyn-knowledge-check .dyn-kc-answer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.dyn-knowledge-check .dyn-kc-answer-letter {
    background: #ededed;
    color: #555;
}
.dyn-knowledge-check .dyn-kc-answer strong {
    color: #202631;
    font-size: 15px;
    font-weight: 620;
    line-height: 1.45;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.dyn-knowledge-check .dyn-kc-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    padding: 6px 12px;
    border-radius: 99px;
    background: #ffedc4;
    color: var(--dyn-kc-wrong);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}
.dyn-knowledge-check.is-correct .dyn-kc-status,
.dyn-knowledge-check .dyn-kc-group-slide.is-correct .dyn-kc-status {
    background: #dbf5df;
    color: var(--dyn-kc-correct);
}
.dyn-knowledge-check.is-correct .dyn-kc-answer-letter,
.dyn-knowledge-check .dyn-kc-group-slide.is-correct .dyn-kc-answer-letter {
    background: #def5e4;
    color: var(--dyn-kc-correct);
}
.dyn-knowledge-check .dyn-kc-feedback {
    max-width: 620px;
    margin: 20px 0 0 !important;
    color: #515963;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.65;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.dyn-knowledge-check button.dyn-kc-retry {
    margin-top: 21px;
    border-color: var(--dyn-kc-border);
    background: #fff;
    color: var(--dyn-kc-ink);
}
.dyn-knowledge-check button.dyn-kc-retry:hover {
    background: #f6f7f8;
    color: var(--dyn-kc-ink);
}

/* Gutenberg editing UI: keep separate, retaining existing editor controls. */
.dyn-kc-editor {padding:18px;border:1px solid #dfe3e8;border-radius:8px;background:#fff}
.dyn-kc-editor-title {font-weight:750;margin-bottom:18px;color:#202631}
.dyn-kc-editor-options {display:grid;gap:8px}
.dyn-kc-editor-option {display:flex;align-items:center;gap:12px}
.dyn-kc-editor-option>strong {width:22px;flex-shrink:0}
.dyn-kc-editor-option>.components-base-control {flex:1;margin-bottom:0}
.dyn-kc-editor-actions {display:flex;justify-content:flex-end;margin:10px 0 18px}

@media (max-width: 580px) {
    .dyn-knowledge-check { margin: 28px 0; }
    .dyn-knowledge-check .dyn-kc-head { gap: 10px; margin-bottom: 19px; }
    .dyn-knowledge-check .dyn-kc-emblem { width: 48px; height: 48px; flex-basis: 48px; font-size: 21px; }
    .dyn-knowledge-check .dyn-kc-head strong { font-size: 18px; }
    .dyn-knowledge-check .dyn-kc-head p { font-size: 12px; }
    .dyn-knowledge-check .dyn-kc-card { padding: 20px 15px; }
    .dyn-knowledge-check .dyn-kc-question { font-size: 15px; margin-bottom: 18px !important; }
    .dyn-knowledge-check button.dyn-kc-option { min-height: 48px; padding: 10px 11px; font-size: 13px; }
    .dyn-knowledge-check .dyn-kc-result-panel { padding: 23px 13px; }
    .dyn-knowledge-check .dyn-kc-feedback { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .dyn-knowledge-check button { transition: none !important; }
}


/* Grouped Knowledge Check: one card, one visible question. */
.dyn-knowledge-check.dyn-kc-group .dyn-kc-card { padding:24px 28px; }
.dyn-kc-group .dyn-kc-group-progress {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 8px;color:var(--dyn-kc-muted);font-size:11px;font-weight:650;line-height:1.4;text-transform:uppercase;letter-spacing:.025em}
.dyn-kc-group .dyn-kc-group-track {display:block;width:100%;height:4px;margin-bottom:24px;overflow:hidden;background:#eceff2;border-radius:4px}
.dyn-kc-group .dyn-kc-group-track>span {display:block;height:100%;background:var(--dyn-kc-accent);border-radius:4px;transition:width .2s ease}
.dyn-kc-group .dyn-kc-group-slide {min-width:0}
.dyn-kc-group .dyn-kc-group-slide[hidden],.dyn-kc-group .dyn-kc-group-done[hidden] {display:none!important}
.dyn-kc-group .dyn-kc-question:focus {outline:none}
.dyn-kc-group .dyn-kc-multi-note {margin:-9px 0 14px!important;color:var(--dyn-kc-muted);font-size:12px!important;line-height:1.4;text-align:center}
.dyn-kc-group .dyn-kc-group-nav {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:24px 0 0;padding-top:18px;border-top:1px solid var(--dyn-kc-border)}
.dyn-kc-group .dyn-kc-group-nav[hidden] {display:none!important}
.dyn-knowledge-check.dyn-kc-group button.dyn-kc-nav-secondary {border-color:var(--dyn-kc-border);background:#fff;color:var(--dyn-kc-ink)}
.dyn-knowledge-check.dyn-kc-group button.dyn-kc-nav-secondary:hover {background:#f7f8f9;color:var(--dyn-kc-ink)}
.dyn-knowledge-check.dyn-kc-group button.dyn-kc-nav-next {border-color:var(--dyn-kc-accent);background:var(--dyn-kc-accent);color:#fff}
.dyn-knowledge-check.dyn-kc-group button.dyn-kc-nav-next:hover {background:#d43f00;color:#fff}
.dyn-kc-group .dyn-kc-group-done {padding:34px 12px 15px;text-align:center}
.dyn-kc-group .dyn-kc-group-done strong {display:block;font-size:18px;font-weight:650}
.dyn-kc-group .dyn-kc-group-done p {margin:8px 0 18px!important;font-size:13px;color:var(--dyn-kc-muted)}
.dyn-kc-group-editor .dyn-kc-editor-helper {margin:0 0 14px;color:#66717d;font-size:13px}
.dyn-kc-group-editor .dyn-kc-editor-question-nav {display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:0 0 18px}
.dyn-kc-group-editor .dyn-kc-editor-question-nav label,.dyn-kc-group-editor .dyn-kc-editor-question-nav span {font-size:12px}
.dyn-kc-group-editor .dyn-kc-editor-question-nav select {flex:1;min-width:180px;max-width:100%}
.dyn-kc-group-editor .dyn-kc-editor-option .components-checkbox-control {flex:0 0 auto}
.dyn-kc-group-editor .dyn-kc-editor-question-actions {display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}
@media(max-width:580px) {
    .dyn-knowledge-check.dyn-kc-group .dyn-kc-card {padding:19px 15px}
    .dyn-kc-group .dyn-kc-group-track {margin-bottom:20px}
    .dyn-kc-group .dyn-kc-group-nav {margin-top:20px}
    .dyn-kc-group-editor .dyn-kc-editor-option {flex-wrap:wrap}
}
