:root {
  color-scheme: light;
  --iv-page-bg: #fffaf3;
  --iv-ink: #312820;
  --iv-muted: #6f645b;
  --iv-line: #eadfce;
  --iv-panel: #fffdf8;
  --iv-coral: #bc6b5a;
  --iv-coral-dark: #8f473d;
  --iv-sage: #6e8b72;
  --iv-blue: #6f849d;
  --iv-brown: #5a4637;
  --iv-green-bg: #edf6ee;
  --iv-green-text: #315f3c;
  --iv-red-bg: #fff0ed;
  --iv-red-text: #914238;
  --iv-shadow: 0 14px 38px rgba(89, 69, 48, 0.1);
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #fffaf3 0%, #f8f1e7 100%);
  color: var(--iv-ink);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.iv-page-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

irregular-verb-trainer {
  display: block;
}

:host {
  --iv-bg: #fffaf3;
  --iv-ink: #312820;
  --iv-muted: #6f645b;
  --iv-soft: #f8efe2;
  --iv-line: #eadfce;
  --iv-panel: #fffdf8;
  --iv-panel-strong: #fff8ee;
  --iv-yellow: #f6d98d;
  --iv-coral: #bc6b5a;
  --iv-coral-dark: #8f473d;
  --iv-sage: #6e8b72;
  --iv-blue: #6f849d;
  --iv-brown: #5a4637;
  --iv-green-bg: #edf6ee;
  --iv-green-text: #315f3c;
  --iv-red-bg: #fff0ed;
  --iv-red-text: #914238;
  --iv-focus: rgba(188, 107, 90, 0.28);
  --iv-shadow: 0 14px 38px rgba(89, 69, 48, 0.1);
  display: block;
  color: var(--iv-ink);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

.iv-shell {
  background: #fffdf8;
  border: 1px solid var(--iv-line);
  border-radius: 24px;
  box-shadow: 0 18px 44px rgba(89, 69, 48, 0.12);
  overflow: hidden;
}

.iv-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(420px, 1.08fr);
  gap: 16px 22px;
  padding: 22px 26px 16px;
  background:
    linear-gradient(135deg, rgba(255, 250, 243, 0.98), rgba(242, 249, 239, 0.72)),
    var(--iv-panel);
  border-bottom: 1px solid var(--iv-line);
}

.iv-eyebrow {
  margin: 0 0 8px;
  color: var(--iv-coral-dark);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.iv-title {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--iv-brown);
  font-size: clamp(1.75rem, 2.7vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.iv-title small {
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf6ee;
  color: var(--iv-green-text);
  font-size: 0.82rem;
  font-weight: 780;
}

.iv-lead {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--iv-muted);
  font-size: 0.9rem;
  line-height: 1.58;
}

.iv-flow {
  display: grid;
  grid-template-columns:
    minmax(82px, 1fr) 20px minmax(82px, 1fr) 20px
    minmax(82px, 1fr) 20px minmax(82px, 1fr);
  gap: 6px;
  align-items: center;
  align-self: center;
  min-width: 0;
  overflow: visible;
  padding: 3px 0 6px;
}

.iv-flow-node {
  min-width: 0;
  min-height: 54px;
  padding: 8px 7px;
  border: 1px solid #eadcc8;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.92);
  text-align: center;
  box-shadow: 0 8px 18px rgba(89, 69, 48, 0.06);
}

.iv-flow-node strong {
  display: block;
  color: var(--iv-coral-dark);
  font-size: 0.84rem;
  line-height: 1.2;
}

.iv-flow-node span {
  display: block;
  margin-top: 3px;
  color: var(--iv-muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.iv-flow-arrow {
  position: relative;
  width: 100%;
  height: 2px;
  background: #d8b992;
}

.iv-flow-arrow::after {
  position: absolute;
  top: 50%;
  right: -1px;
  width: 8px;
  height: 8px;
  border-top: 2px solid #d8b992;
  border-right: 2px solid #d8b992;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.iv-tips {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 13px;
  background: rgba(255, 247, 230, 0.72);
  border: 1px solid var(--iv-line);
  border-radius: 14px;
}

.iv-tips summary {
  cursor: pointer;
  color: var(--iv-brown);
  font-size: 0.9rem;
  font-weight: 800;
}

.iv-tips ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.iv-tips li {
  color: var(--iv-muted);
  line-height: 1.45;
}

.iv-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px 26px 16px;
  background: #fffaf3;
  border-bottom: 1px solid var(--iv-line);
}

.iv-control-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 0;
}

.iv-control-heading h2 {
  margin: 0;
  color: var(--iv-brown);
  font-size: 1rem;
  line-height: 1.2;
}

.iv-control-heading p {
  margin: 0;
  color: var(--iv-muted);
  font-size: 0.82rem;
}

.iv-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.iv-field label,
.iv-label {
  color: var(--iv-brown);
  font-size: 0.76rem;
  font-weight: 760;
}

.iv-field select,
.iv-field input[type="text"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--iv-line);
  border-radius: 10px;
  background: #fffaf3;
  color: var(--iv-ink);
  font: inherit;
  font-size: 0.9rem;
  padding: 7px 9px;
}

.iv-field input[type="text"]::placeholder {
  color: #a69b8f;
}

.iv-field select:focus,
.iv-field input[type="text"]:focus,
.iv-btn:focus-visible,
.iv-choice:focus-visible,
.iv-checkbox input:focus-visible {
  outline: 3px solid var(--iv-focus);
  outline-offset: 2px;
}

.iv-toggle {
  align-content: stretch;
  min-height: auto;
}

.iv-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #e5d7c6;
  border-radius: 12px;
  background: #fffaf3;
  color: var(--iv-muted);
  font-size: 0.88rem;
  line-height: 1.3;
}

.iv-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--iv-coral);
  flex: 0 0 auto;
}

.iv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 14px 26px 0;
  background: #fffdf8;
}

.iv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fffdf8;
  color: var(--iv-brown);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  padding: 8px 14px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.iv-btn small {
  color: currentColor;
  font-size: 0.7rem;
  font-weight: 650;
  opacity: 0.84;
}

.iv-btn:hover {
  transform: translateY(-1px);
}

.iv-btn-primary {
  background: var(--iv-coral);
  color: white;
}

.iv-btn-primary:hover {
  background: var(--iv-coral-dark);
}

.iv-btn-quiet {
  border-color: var(--iv-line);
}

.iv-btn-next {
  min-width: 126px;
  min-height: 48px;
  border-color: #dfc6ad;
  background: #fff8ed;
  color: var(--iv-brown);
  font-size: 0.98rem;
  box-shadow: 0 8px 18px rgba(89, 69, 48, 0.08);
}

.iv-btn-next:not(:disabled):focus-visible,
.iv-btn-next:not(:disabled):hover {
  border-color: var(--iv-coral);
  background: #fff0e5;
}

.iv-btn-quiet:hover {
  border-color: #decbb8;
  background: var(--iv-soft);
}

.iv-btn-danger {
  border-color: #ebc7c0;
  color: var(--iv-red-text);
}

.iv-btn-danger:hover {
  background: var(--iv-red-bg);
}

.iv-btn-stop {
  border-color: #e0b99c;
  background: #fff2e8;
  color: var(--iv-coral-dark);
}

.iv-btn-stop:not(:disabled):hover {
  border-color: var(--iv-coral);
  background: #ffe7d9;
}

.iv-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.iv-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  padding: 18px 26px 26px;
  background: #fffdf8;
}

.iv-practice-card,
.iv-side-card {
  background: #fffaf3;
  border: 1px solid var(--iv-line);
  border-radius: 20px;
}

.iv-practice-card {
  min-height: 380px;
  padding: 22px;
  border-left: 6px solid #f0c978;
}

.iv-side-card {
  align-self: start;
  padding: 18px;
  background: #f7fbf4;
}

.iv-statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.iv-progress-text {
  color: var(--iv-muted);
  font-size: 0.88rem;
}

.iv-progress-track {
  width: min(310px, 100%);
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--iv-soft);
}

.iv-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--iv-sage), var(--iv-blue));
  transition: width 180ms ease;
}

.iv-set-note {
  margin: -6px 0 14px;
  padding: 10px 12px;
  border: 1px solid #d6dfc9;
  border-radius: 12px;
  background: #f3f7ee;
  color: #516641;
  font-size: 0.88rem;
  line-height: 1.5;
}

.iv-question-kicker {
  margin: 0 0 10px;
  color: var(--iv-coral-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

.iv-word-card {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid #eadcc8;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.94), rgba(255, 247, 230, 0.94));
}

.iv-word-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--iv-muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.iv-prompt {
  margin: 0;
  color: var(--iv-brown);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.iv-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.iv-forms.single {
  grid-template-columns: minmax(0, 1fr);
}

.iv-practice-card .iv-field {
  padding: 10px;
  border: 1px solid #efe3d2;
  border-radius: 16px;
  background: #fffdf8;
}

.iv-practice-card .iv-field input[type="text"] {
  min-height: 48px;
  background: white;
  font-size: 1rem;
}

.iv-answer-note {
  margin: 12px 0 0;
  color: var(--iv-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.iv-feedback {
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--iv-line);
  color: var(--iv-muted);
  line-height: 1.55;
}

.iv-feedback.correct {
  border-color: #cfe4d1;
  background: var(--iv-green-bg);
  color: var(--iv-green-text);
}

.iv-feedback.wrong {
  border-color: #efcbc4;
  background: var(--iv-red-bg);
  color: var(--iv-red-text);
}

.iv-feedback.hint {
  border-color: #d6dfc9;
  background: #f3f7ee;
  color: #516641;
}

.iv-meta {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.iv-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.iv-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--iv-soft);
  color: var(--iv-brown);
  font-size: 0.86rem;
  font-weight: 720;
}

.iv-example {
  margin: 0;
  color: var(--iv-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.iv-sentence-box {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid #e7d8c5;
  border-radius: 16px;
  background: #fffdf8;
}

.iv-sentence-box h3 {
  margin: 0;
  color: var(--iv-brown);
  font-size: 1rem;
}

.iv-sentence-box p {
  margin: 0;
  color: var(--iv-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.iv-sentence-list {
  display: grid;
  gap: 8px;
}

.iv-sentence-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7e8;
}

.iv-sentence-item strong {
  color: var(--iv-coral-dark);
  font-size: 0.86rem;
}

.iv-sentence-item span {
  color: var(--iv-ink);
  font-size: 0.95rem;
  line-height: 1.45;
}

.iv-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.iv-choice {
  display: grid;
  gap: 2px;
  place-items: center;
  min-height: 64px;
  border: 1px solid var(--iv-line);
  border-radius: 16px;
  background: #fffdf8;
  color: var(--iv-brown);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.iv-choice small {
  color: var(--iv-muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.iv-choice:hover,
.iv-choice[aria-pressed="true"] {
  border-color: var(--iv-coral);
  background: #fff0e5;
}

.iv-side-title {
  margin: 0 0 12px;
  color: var(--iv-brown);
  font-size: 1rem;
}

.iv-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.iv-stat {
  padding: 12px;
  border: 1px solid var(--iv-line);
  border-radius: 14px;
  background: #fffdf8;
}

.iv-stat strong {
  display: block;
  color: var(--iv-brown);
  font-size: 1.12rem;
}

.iv-stat span {
  color: var(--iv-muted);
  font-size: 0.82rem;
}

.iv-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.iv-list-item {
  padding: 12px;
  border: 1px solid var(--iv-line);
  border-radius: 12px;
  background: #fffdf8;
}

.iv-list-item strong {
  display: block;
  color: var(--iv-brown);
  margin-bottom: 4px;
}

.iv-list-item span {
  color: var(--iv-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.iv-empty,
.iv-loading,
.iv-error {
  display: grid;
  gap: 8px;
  padding: 28px;
  color: var(--iv-muted);
  line-height: 1.6;
}

.iv-empty strong {
  color: var(--iv-brown);
  font-size: 1.08rem;
}

.iv-error {
  color: var(--iv-red-text);
  background: var(--iv-red-bg);
  border: 1px solid #efcbc4;
  border-radius: 14px;
}

.iv-results {
  display: grid;
  gap: 16px;
}

.iv-results h3 {
  margin: 0;
  color: var(--iv-brown);
  font-size: 1.22rem;
}

.iv-session-summary {
  align-content: start;
}

.iv-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.iv-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.iv-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.iv-table th,
.iv-table td {
  border-bottom: 1px solid var(--iv-line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.iv-table th {
  color: var(--iv-brown);
  background: #fff5e6;
  font-size: 0.9rem;
}

.iv-table td {
  color: var(--iv-muted);
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 960px) {
  .iv-hero,
  .iv-workspace {
    grid-template-columns: 1fr;
  }

  .iv-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .iv-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .iv-flow-arrow {
    display: none;
  }

  .iv-control-heading {
    display: grid;
  }
}

@media (max-width: 640px) {
  .iv-page-shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .iv-shell {
    border-radius: 16px;
  }

  .iv-hero,
  .iv-controls,
  .iv-actions,
  .iv-workspace {
    padding-left: 16px;
    padding-right: 16px;
  }

  .iv-hero {
    padding-top: 22px;
  }

  .iv-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .iv-controls,
  .iv-forms,
  .iv-choice-grid {
    grid-template-columns: 1fr;
  }

  .iv-tips ul {
    grid-template-columns: 1fr;
  }

  .iv-control-heading {
    grid-column: auto;
  }

  .iv-practice-card {
    padding: 18px;
    min-height: 300px;
  }

  .iv-btn {
    width: 100%;
  }
}

@media print {
  body {
    background: white;
  }

  .iv-page-shell {
    width: 100%;
    padding: 0;
  }

  .iv-shell,
  .iv-practice-card,
  .iv-side-card,
  .iv-tips {
    box-shadow: none;
    border-color: #ccc;
  }

  .iv-actions,
  .iv-controls {
    display: none;
  }
}
