.lkai-tool { box-sizing: border-box; width: 100%; max-width: 850px; margin: 1.5rem auto; padding: clamp(1rem, 4vw, 2rem); background: #edf4f8; border-radius: 14px; color: #233644; line-height: 1.6; font-family: 'Segoe UI', Arial, sans-serif; }
.lkai-tool *, .lkai-tool *::before, .lkai-tool *::after { box-sizing: border-box; }
.lkai-tool h2 { margin: 0 0 1rem; color: #145982; font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.3; }
.lkai-tool label { display: block; font-weight: 600; }
.lkai-tool .lkai-help { margin: .35rem 0 .75rem; white-space: pre-line; }
.lkai-tool textarea { display: block; width: 100%; min-height: 150px; padding: .9rem; border: 1px solid #718798; border-radius: 7px; background: #fff; color: #233644; font: inherit; resize: vertical; }
.lkai-tool .lkai-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.lkai-tool button { min-height: 44px; padding: .7rem 1.25rem; border: 1px solid transparent; border-radius: 7px; font: inherit; font-weight: 600; cursor: pointer; text-transform: none; letter-spacing: normal; }
.lkai-tool .lkai-send { background: #23743e; color: #fff; }
.lkai-tool .lkai-send:hover { background: #195c30; }
.lkai-tool .lkai-reset { background: #fff; border-color: #718798; color: #233644; }
.lkai-tool button:disabled { opacity: .65; cursor: wait; }
.lkai-tool button:focus-visible, .lkai-tool textarea:focus-visible { outline: 3px solid #145982; outline-offset: 3px; }
.lkai-tool .lkai-status { margin: .8rem 0 0; overflow-wrap: anywhere; }
.lkai-tool .lkai-status:empty { display: none; }
.lkai-tool .lkai-response { margin-top: 1.25rem; padding: 1rem; background: #fff; border: 1px solid #b8cbd8; border-radius: 8px; overflow-wrap: anywhere; }
.lkai-tool .lkai-response[hidden] { display: none; }
.lkai-tool .lkai-response h3 { margin: 0 0 .75rem; color: #145982; font-size: 1.25rem; }
.lkai-tool .lkai-answer { white-space: pre-wrap; overflow-x: auto; }
.lkai-tool .lkai-answer table { width: 100%; border-collapse: collapse; }
.lkai-tool .lkai-answer td, .lkai-tool .lkai-answer th { padding: .4rem; border: 1px solid #b8cbd8; }
.lkai-tool .lkai-answer pre { white-space: pre-wrap; }
@media (max-width: 480px) { .lkai-tool .lkai-actions button { flex: 1 1 100%; } }


/* Lesson containers may center their content. Keep exercise text readable locally. */
.lkai-tool { text-align: left; }
section.lkai-tool h2,
section.lkai-tool label,
.lkai-tool textarea,
.lkai-tool .lkai-help,
.lkai-tool .lkai-status,
.lkai-tool .lkai-response,
.lkai-tool .lkai-response h3,
.lkai-tool .lkai-answer,
.lkai-tool .lkai-answer * { text-align: left !important; }
.lkai-tool button { text-align: center; }


/* Extended forms are scoped to the same exercise component. */
.lkai-tool .lko-input { margin: 0 0 1rem; }
.lkai-tool .lko-input input[type=text] { width:100%; min-height:44px; padding:.8rem; border:1px solid #718798; border-radius:7px; background:#fff; color:#233644; font:inherit; text-align:left; }
.lkai-tool .lko-input input:focus-visible { outline:3px solid #145982; outline-offset:3px; }
.lkai-tool .lko-input label { text-align:left!important; }
.lkai-tool .lko-stage[hidden] { display:none!important; }
.lkai-tool .lko-stage > h3 { text-align:left!important; color:#145982; }
.lkai-tool .lko-stage + .lko-stage { border-top:1px solid #b8cbd8; margin-top:1.5rem; padding-top:1.5rem; }

.lko-special .lks-scroll { overflow-x:auto; margin:16px 0; }
.lko-special table { width:100%; border-collapse:collapse; text-align:left; }
.lko-special th,.lko-special td { padding:8px; border:1px solid #b9ccdc; vertical-align:top; white-space:pre-wrap; overflow-wrap:anywhere; }
.lko-special .lks-score { min-width:64px; max-width:84px; }
.lko-special input { box-sizing:border-box; width:100%; }
.lko-special .lks-question { white-space:pre-wrap; }
.lko-special [hidden] { display:none !important; }

.lko-special input { min-height:44px; padding:6px; font:inherit; border:1px solid #718798; border-radius:5px; color:#233644; background:#fff; }
.lko-special input:focus-visible { outline:3px solid #145982; outline-offset:2px; }
