.rts-dialog.howto-dialog {
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: max(32px, calc(var(--ui-slice-top, 0px) + 8px)) max(28px, calc(var(--ui-slice-right, 0px) + 8px));
  text-align: center;
}
.howto-dialog .rts-dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.howto-dialog .rts-dialog-title, .howto-dialog .rts-dialog-actions { flex-shrink: 0; }
.howto-dialog .rts-dialog-actions { display: flex; flex-wrap: nowrap; justify-content: center; }
.howto-dialog .rts-dialog-actions .rts-component-button { flex: 1; min-width: 0; padding-inline: 12px; font-size: 16px; }
.howto-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.howto-tabs .rts-component-button {
  position: relative;
  flex: 1;
  min-width: 0;
  padding-inline: 12px;
  font-size: 16px;
}
.howto-tabs [data-compact-label="true"] { white-space: nowrap; }
.howto-tabs [data-completed="true"] {
  color: #ffe39a;
  box-shadow: 0 0 0 2px #b88a2d;
  border-radius: 4px;
}
.howto-tabs [data-completed="true"]::after {
  content: '\2605';
  position: absolute;
  top: -5px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #9c6e1e;
  border-radius: 50%;
  background: #f4cf67;
  color: #805415;
  font-size: 14px;
  text-shadow: none;
}
.howto-panel[hidden] { display: none; }
.howto-lesson {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 130px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--rts-ui-ink-muted);
  border-radius: 8px;
  background: rgba(255, 252, 232, .4);
  text-align: left;
}
.howto-lesson h3 { margin: 0 0 4px; font-size: 20px; }
.howto-lesson p { margin: 0 0 12px; font-size: 16px; }
.howto-lesson-progress { margin: 0 0 12px; font-weight: 700; }
.howto-lesson-status { display: block; margin-bottom: 4px; font-size: 15px; color: var(--rts-ui-ink-muted); }
.howto-lesson[data-completed="true"] .howto-lesson-status { color: #35632e; font-weight: 700; }

.howto-introduction { margin: 0; color: var(--rts-ui-ink-muted); font-size: 17px; }
.howto-lesson-duration { color: var(--rts-ui-ink-muted); }
.howto-category-progress { margin: 0; text-align: left; color: var(--rts-ui-ink-muted); font-size: 16px; }
.howto-timeline { list-style: none; margin: 0; padding: 0 0 4px; }
.howto-timeline-step { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; position: relative; margin-bottom: 12px; }
.howto-timeline-step:last-child { margin-bottom: 0; }
.howto-timeline-step::before { content: ''; position: absolute; width: 3px; background: #b4a17b; top: 0; bottom: -12px; left: 17px; }
.howto-timeline-step:first-child::before { top: 50%; }
.howto-timeline-step:last-child::before { bottom: 50%; }
.howto-timeline-step[data-completed="true"]::before { background: #b88a2d; }
.howto-milestone { position: relative; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; border: 2px solid #998360; border-radius: 50%; background: #eee1bd; color: #765936; font-size: 20px; font-weight: 700; }
.howto-timeline-step[aria-current="step"] .howto-milestone { border-color: #447dac; color: #294d69; background: #e0e8e2; }
.howto-timeline-step[data-completed="true"] .howto-milestone { border-color: #9c6e1e; color: #805415; background: #f4cf67; font-size: 26px; }
.howto-timeline-step[aria-current="step"] .howto-lesson { border-color: #447dac; }
.howto-illustration { display: block; width: 100%; height: auto; align-self: center; border-radius: 8px; }
.howto-lesson-copy { min-width: 0; }
.howto-lesson-actions { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.howto-lesson-actions .howto-lesson-duration { margin: 0; font-size: 14px; }
.howto-lesson-actions .rts-component-button { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; padding-inline: 10px; }
.howto-lesson-copy p { margin-bottom: 0; }
.howto-lesson[data-completed="true"] .rts-component-button {
  filter: grayscale(.7) saturate(.6);
  opacity: .8;
  transition: filter 160ms ease, opacity 160ms ease;
}
.howto-lesson[data-completed="true"] .rts-component-button:is(:hover, :focus-visible) {
  filter: grayscale(.35);
  opacity: 1;
}
.howto-timeline-step[aria-current="step"] .howto-milestone,
.howto-timeline-step[aria-current="step"] .howto-lesson-actions .rts-component-button {
  animation: howto-next-pulse 2s ease-in-out infinite;
}
@keyframes howto-next-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 0 rgba(226, 172, 48, 0)); }
  50% { transform: scale(1.08); filter: brightness(1.15) drop-shadow(0 0 6px rgba(226, 172, 48, .7)); }
}
@media (prefers-reduced-motion: reduce) {
  .howto-timeline-step[aria-current="step"] .howto-milestone,
  .howto-timeline-step[aria-current="step"] .howto-lesson-actions .rts-component-button { animation: none; }
}
@media (min-width: 641px) {
  .howto-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .howto-tabs .rts-component-button { padding-inline: 8px; font-size: 15px; }
  .howto-timeline-step { margin-bottom: 10px; }
  .howto-timeline-step::before { bottom: -10px; }
  .howto-timeline-step:last-child::before { bottom: 50%; }
}
@media (max-width: 640px) {
  .howto-timeline-step { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; }
  .howto-milestone { width: 28px; height: 28px; font-size: 17px; }
  .howto-timeline-step::before { left: 13px; }
  .howto-timeline-step[data-completed="true"] .howto-milestone { font-size: 21px; }
  .howto-lesson { grid-template-columns: 52px minmax(0, 1fr); gap: 8px; padding: 8px; }
  .howto-lesson h3 { font-size: 19px; margin-bottom: 4px; }
  .howto-lesson-status { font-size: 14px; margin-bottom: 4px; }
  .howto-lesson p { font-size: 15px; }
  .howto-lesson-actions { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; gap: 8px; }
  .howto-lesson-actions .howto-lesson-duration { max-width: 74px; font-size: 13px; line-height: 1.15; }
  .howto-lesson-actions .rts-component-button { width: auto; flex: 0 1 124px; font-size: 14px; padding-inline: 8px; }
}
