.drill-heart,
.drill-conj {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.35rem;
  line-height: 1.45;
  max-width: 60rem;
  margin: 1.5rem 0 2rem;
  padding: 1.75rem 2rem;
  border: 1px solid #d8dee4;
  border-radius: 10px;
  background: #fafbfc;
}

.drill-heart h4,
.drill-conj h4 {
  margin: 0 0 1rem;
  font-size: 1.65rem;
  font-weight: 600;
}

.drill-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.drill-ranges button {
  padding: 0.65rem 1.1rem;
  border: 1px solid #c8d0d9;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 1.25rem;
}

.drill-ranges button:hover {
  background: #eef2f6;
}

.drill-ranges button.active {
  border-color: #2563eb;
  background: #eff6ff;
  font-weight: 600;
}

.drill-prompt {
  margin: 0.65rem 0 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-left: 5px solid #2563eb;
  border-radius: 6px;
}

.drill-prompt-suomi-block .drill-prompt-text,
.drill-prompt-suomi {
  font-size: 2.1rem;
  font-weight: 500;
  display: block;
}

.drill-prompt-task-block {
  border-left-color: #7c3aed;
}

.drill-prompt-task {
  font-size: 1.75rem;
  font-weight: 600;
  display: block;
}

.drill-conj-cloze {
  border-left-color: #2563eb;
}

.drill-conj-meta {
  margin-bottom: 0.65rem;
  line-height: 1.35;
}

.drill-conj-lemma,
.drill-cloze-person {
  font-size: 1.85rem;
  font-weight: 600;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
}

.drill-cloze-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.55rem;
  font-size: 1.85rem;
  line-height: 1.35;
}

.drill-conj .drill-cloze-input {
  flex: 1 1 10rem;
  min-width: 9rem;
  max-width: 22rem;
  margin: 0;
  padding: 0.45rem 0.65rem;
  font-size: 1.85rem;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  border: none;
  border-bottom: 3px solid #2563eb;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.drill-conj .drill-cloze-input:focus {
  outline: none;
  border-bottom-color: #1d4ed8;
  background: #f0f7ff;
}

.drill-heart .drill-label,
.drill-conj .drill-label {
  font-size: 1.1rem;
  color: #57606a;
  display: block;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.drill-heart .drill-panel,
.drill-conj .drill-panel {
  display: none;
}

.drill-heart .drill-panel.active,
.drill-conj .drill-panel.active {
  display: block;
}

.drill-heart .drill-prompt:not(.drill-prompt-suomi-block):not(.drill-prompt-task-block) .drill-prompt-text {
  font-size: 2.1rem;
  font-weight: 500;
}

.drill-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1rem;
}

.drill-input-row input[type="text"] {
  flex: 1 1 100%;
  min-width: 14rem;
  padding: 1rem 1.15rem;
  font-size: 1.55rem;
  border: 1px solid #c8d0d9;
  border-radius: 8px;
}

.drill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.drill-actions button {
  padding: 0.85rem 1.4rem;
  border-radius: 8px;
  border: 1px solid #c8d0d9;
  background: #fff;
  cursor: pointer;
  font-size: 1.25rem;
}

.drill-actions button.primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.drill-actions button.danger {
  border-color: #dc2626;
  color: #dc2626;
}

.drill-feedback {
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  font-size: 1.35rem;
}

.drill-feedback.ok {
  background: #eff6ff;
  border: 1px solid #60a5fa;
  color: #1e3a8a;
}

.drill-feedback.err {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.drill-feedback.err .drill-feedback-msg {
  margin: 0;
}

.drill-paradigm-sticky {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  overflow-x: visible;
}

.drill-paradigm-table {
  border-collapse: collapse;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 1.1rem;
}

.drill-paradigm-table--horizontal {
  width: 100%;
  min-width: 34rem;
  table-layout: fixed;
}

.drill-paradigm-table--horizontal th,
.drill-paradigm-table--horizontal td {
  padding: 0.3rem 0.75rem;
  text-align: center;
  white-space: nowrap;
  width: 16.666%;
}

.drill-paradigm-table--horizontal th {
  color: #991b1b;
  font-weight: 600;
  border-bottom: 1px solid #fca5a5;
}

.drill-paradigm-table--horizontal td {
  color: #7f1d1d;
}

.drill-paradigm-table--horizontal th:not(:last-child),
.drill-paradigm-table--horizontal td:not(:last-child) {
  border-right: 1px solid #fca5a5;
}

.drill-progress {
  font-size: 1.25rem;
  color: #57606a;
  margin-bottom: 0.75rem;
}

.drill-summary {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #d8dee4;
  font-size: 1.3rem;
}

.drill-summary h4 {
  margin-top: 0;
  font-size: 1.55rem;
}

.drill-log-note {
  font-size: 1.2rem;
  color: #57606a;
  margin-top: 1rem;
}

.drill-log-saved {
  margin-top: 0.5rem;
}

.drill-hidden {
  display: none !important;
}

.drill-sentence { margin: 1.5rem 0; padding: 1.25rem; border: 1px solid #d8dee4; border-radius: 8px; }
.drill-sentence [hidden] { display: none !important; }
.sentence-fi { font-weight: 600; }
.sentence-cloze { font-size: 1.8rem; line-height: 2.5; }
.sentence-input { width: 12em; max-width: 100%; padding: .3em .5em; border: 1px solid #8b949e; border-radius: 4px; font: inherit; }
.sentence-input:focus { outline: 2px solid #0969da; outline-offset: 2px; }


/* Reserve feedback space before checking an answer; actions stay in place.
   Minimum sizes allow large text and long answers to grow without clipping. */
.drill-feedback-space {
  display: grid;
  grid-template-rows: minmax(7rem, auto);
  align-content: start;
  min-block-size: 8rem;
  margin-block: 1rem;
  min-inline-size: 0;
}
.drill-feedback-space--conj {
  grid-template-rows: minmax(5rem, auto) minmax(8rem, auto) minmax(4rem, auto);
  min-block-size: 18rem;
  row-gap: .5rem;
}
.drill-feedback-space > .drill-feedback {
  grid-row: 1;
  align-self: start;
  margin: 0;
  overflow-wrap: anywhere;
}
.drill-feedback-space > .drill-paradigm-sticky {
  grid-row: 2;
  align-self: start;
  margin: 0;
  min-inline-size: 0;
  overflow-x: auto;
}
.drill-feedback-space > .drill-continue-panel {
  grid-row: 3;
  align-self: start;
}
.drill-feedback-space .drill-continue-panel p { margin: 0; }
.drill-actions .drill-submit,
.drill-actions .drill-continue,
.drill-actions .sentence-submit,
.drill-actions .sentence-next { min-inline-size: 12rem; }
@media (max-width: 600px) {
  .drill-feedback-space { min-block-size: 10rem; }
  .drill-feedback-space--conj {
    grid-template-rows: minmax(7rem, auto) minmax(8rem, auto) minmax(6rem, auto);
    min-block-size: 22rem;
  }
}


.modal-table-scroll { max-width: 100%; overflow-x: auto; margin-bottom: 2rem; }
.modal-table-scroll table { width: 100%; }
.modal-table-scroll th, .modal-table-scroll td { white-space: nowrap; }
.modal-table-scroll td:first-child { font-weight: 600; }


/* Bookdown parts separate reference tables from the two kinds of practice. */
.book .book-summary ul.summary li.part > span {
  display: block;
  padding: 1.4rem 1.5rem .5rem;
  color: #434b55;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.book .book-summary ul.summary li.part,
.book .book-summary ul.summary li.part > span,
.book .book-summary ul.summary li.part > span > b {
  color: #434b55 !important;
  opacity: 1 !important;
  font-weight: 700;
}


.site-footer {
  max-width: 800px;
  margin: 5rem auto 0;
  padding: 1.5rem;
  border-top: 1px solid #d8dee4;
  color: #57606a;
  font-size: 1.2rem;
  line-height: 1.6;
}
.site-footer p { margin: 0; }

.book .book-summary ul.summary li.sidebar-copyright {
  white-space: nowrap;
  margin-top: 2rem;
  padding: 1.5rem;
  border-top: 1px solid #d8dee4;
  color: #57606a;
  font-size: 1.2rem;
}

/* Keep table captions clear of the surrounding border. */
.book .book-body .page-wrapper .page-inner section.normal table caption {
  padding-inline-start: .5em;
}

/* A complete sentence occupies the same answer area as the cloze exercise. */
.sentence-full-input { width: 100%; box-sizing: border-box; }

.book .book-summary ul.summary li.sidebar-copyright a {
  display: inline;
  padding: 0;
  color: inherit;
  text-decoration: underline;
}

.sentence-article-hint { margin-inline-start: .5em; font-size: .9em; font-weight: 400; color: #57606a; }

