.hmtt {
  --hmtt-border: #d8dde3;
  --hmtt-text: #17212b;
  --hmtt-muted: #5a6875;
  --hmtt-accent: #0b4f6c;
  --hmtt-bg-soft: #f7f9fb;
  margin: 2rem 0;
}

.hmtt * { box-sizing: border-box; }

.hmtt__shell {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid var(--hmtt-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(15, 30, 45, 0.08);
  color: var(--hmtt-text);
}

.hmtt__eyebrow {
  margin-bottom: .55rem;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--hmtt-accent);
}

.hmtt__title {
  margin: 0 0 .8rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.08;
}

.hmtt__lead,
.hmtt__microcopy,
.hmtt__result-text,
.hmtt__fineprint {
  line-height: 1.65;
}

.hmtt__lead { margin: 0 0 1.5rem; font-size: 1.06rem; }
.hmtt__fineprint { margin: 1.2rem 0 0; color: var(--hmtt-muted); font-size: .88rem; }
.hmtt__stage { min-height: 210px; }

.hmtt__start,
.hmtt__cta,
.hmtt__restart,
.hmtt__answer {
  appearance: none;
  border: 0;
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
}

.hmtt__start,
.hmtt__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .8rem 1.1rem;
  background: var(--hmtt-accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.hmtt__progress { margin: .25rem 0 1.5rem; }
.hmtt__progress-row { display: flex; justify-content: flex-end; margin-bottom: .45rem; color: var(--hmtt-muted); font-size: .86rem; }
.hmtt__bar { height: 8px; overflow: hidden; border-radius: 999px; background: #e9edf1; }
.hmtt__bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--hmtt-accent); transition: width .25s ease; }

.hmtt__question { margin: 0 0 .6rem; font-size: clamp(1.3rem, 4vw, 1.8rem); }
.hmtt__microcopy { margin: 0 0 1.2rem; color: var(--hmtt-muted); }
.hmtt__answers { display: grid; gap: .75rem; }

.hmtt__answer {
  width: 100%;
  padding: 1rem 1.05rem;
  border: 1px solid var(--hmtt-border);
  background: var(--hmtt-bg-soft);
  color: var(--hmtt-text);
  text-align: left;
  transition: transform .12s ease, border-color .12s ease, background-color .12s ease;
}
.hmtt__answer:hover,
.hmtt__answer:focus-visible { transform: translateY(-1px); border-color: var(--hmtt-accent); background: #fff; outline: none; }
.hmtt__answer.is-selected { border-color: var(--hmtt-accent); }
.hmtt__answer-label { display: block; font-weight: 750; }
.hmtt__answer-hint { display: block; margin-top: .3rem; color: var(--hmtt-muted); }

.hmtt__result { padding: 1.2rem; border-radius: 16px; border: 1px solid var(--hmtt-border); background: var(--hmtt-bg-soft); }
.hmtt__result--green { border-left: 6px solid #2c8a5b; }
.hmtt__result--yellow { border-left: 6px solid #d29a00; }
.hmtt__result--red { border-left: 6px solid #c84a48; }
.hmtt__badge { margin-bottom: .45rem; font-weight: 850; }
.hmtt__result-title { margin: 0 0 .6rem; font-size: 1.45rem; }
.hmtt__result-text { margin: 0 0 1rem; }
.hmtt__bullets { margin: 0 0 1.2rem; padding-left: 1.25rem; }
.hmtt__bullets li + li { margin-top: .45rem; }
.hmtt__actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.hmtt__restart { min-height: 46px; padding: .75rem 1rem; background: transparent; border: 1px solid var(--hmtt-border); color: var(--hmtt-text); font-weight: 700; }
.hmtt__restart:hover,
.hmtt__restart:focus-visible { border-color: var(--hmtt-accent); outline: none; }
.hmtt__loading { padding: 2rem 0; color: var(--hmtt-muted); }
.hmtt__error { padding: 1rem; border: 1px solid #c84a48; border-radius: 12px; }
.hmtt.is-busy { opacity: .92; }
.hmtt button:disabled { cursor: wait; }

@media (max-width: 560px) {
  .hmtt__shell { border-radius: 14px; }
  .hmtt__actions { align-items: stretch; }
  .hmtt__cta, .hmtt__restart { width: 100%; justify-content: center; }
}

/* 0.2: pelillinen eteneminen, vihjeet ja tutkittavat haarat */
.hmtt__panel {
  animation: hmtt-in .22s ease both;
}

@keyframes hmtt-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.hmtt__feedback {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  margin: 0 0 1rem;
  padding: .8rem .9rem;
  border-left: 3px solid var(--hmtt-accent);
  border-radius: 8px;
  background: #f2f7f9;
  line-height: 1.5;
}

.hmtt__feedback-mark {
  flex: 0 0 auto;
  font-weight: 900;
  color: var(--hmtt-accent);
}

.hmtt__clues {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 0 1rem;
}

.hmtt__clue {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: .35rem .65rem;
  border: 1px solid var(--hmtt-border);
  border-radius: 999px;
  background: #fff;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.2;
}

.hmtt__result .hmtt__clues {
  margin-top: .9rem;
}

.hmtt__explorer {
  margin-top: 1rem;
  padding: 1.05rem;
  border: 1px solid var(--hmtt-border);
  border-radius: 16px;
  background: #fff;
}

.hmtt__explorer-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: .85rem;
}

.hmtt__explorer-count {
  color: var(--hmtt-muted);
  font-size: .86rem;
  white-space: nowrap;
}

.hmtt__branch-icons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .55rem;
  margin-bottom: .9rem;
}

.hmtt__branch-icon {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--hmtt-border);
  border-radius: 12px;
  background: var(--hmtt-bg-soft);
  opacity: .48;
}

.hmtt__branch-icon.is-explored {
  border-style: solid;
  border-color: var(--hmtt-accent);
  background: #fff;
  opacity: 1;
}

.hmtt__branch-emoji {
  font-size: 1.45rem;
  line-height: 1;
}

.hmtt__branch-state {
  position: absolute;
  right: 6px;
  top: 4px;
  font-size: .7rem;
  font-weight: 900;
  color: var(--hmtt-muted);
}

.hmtt__branch-icon.is-explored .hmtt__branch-state {
  color: var(--hmtt-accent);
}

.hmtt__next-label {
  margin: .3rem 0 .55rem;
  font-size: .9rem;
  font-weight: 800;
}

.hmtt__next-branches {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.hmtt__next-branch {
  appearance: none;
  min-height: 40px;
  padding: .55rem .75rem;
  border: 1px solid var(--hmtt-border);
  border-radius: 10px;
  background: var(--hmtt-bg-soft);
  color: var(--hmtt-text);
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background-color .12s ease;
}

.hmtt__next-branch:hover,
.hmtt__next-branch:focus-visible {
  transform: translateY(-1px);
  border-color: var(--hmtt-accent);
  background: #fff;
  outline: none;
}

.hmtt__all-found {
  margin: .65rem 0 0;
  color: var(--hmtt-muted);
  font-size: .9rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .hmtt__panel,
  .hmtt__bar-fill,
  .hmtt__answer,
  .hmtt__next-branch {
    animation: none;
    transition: none;
  }
}

@media (max-width: 560px) {
  .hmtt__explorer-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: .2rem;
  }

  .hmtt__branch-icons {
    gap: .35rem;
  }

  .hmtt__branch-icon {
    min-height: 52px;
  }

  .hmtt__next-branch {
    width: 100%;
    text-align: left;
  }
}

/* 0.3: selkeämpi liikennevalo + täsmäartikkeli osaksi lopputulosta */
.hmtt__shell {
  box-shadow: 0 12px 34px rgba(15, 30, 45, 0.07);
}

.hmtt__lead {
  max-width: 66ch;
}

.hmtt__answer {
  padding: 1.05rem 1.1rem;
  border-radius: 14px;
}

.hmtt__answer-label {
  font-size: 1.01rem;
}

.hmtt__result {
  padding: clamp(1.15rem, 4vw, 1.5rem);
  background: #fff;
}

.hmtt__result--green { background: #f6fbf8; }
.hmtt__result--yellow { background: #fffbf0; }
.hmtt__result--red { background: #fff7f6; }

.hmtt__badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: .75rem;
  padding: .38rem .7rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--hmtt-border);
  font-size: .9rem;
  line-height: 1;
}

.hmtt__result--green .hmtt__badge { border-color: #9bc9ae; }
.hmtt__result--yellow .hmtt__badge { border-color: #e8cc77; }
.hmtt__result--red .hmtt__badge { border-color: #e2a3a0; }

.hmtt__result-title {
  font-size: clamp(1.4rem, 4vw, 1.65rem);
  line-height: 1.2;
}

.hmtt__article-card {
  display: block;
  margin: 1.25rem 0 .9rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--hmtt-border);
  border-radius: 14px;
  background: #fff;
  color: var(--hmtt-text);
  text-decoration: none;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.hmtt__article-card:hover,
.hmtt__article-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--hmtt-accent);
  box-shadow: 0 8px 22px rgba(15, 30, 45, 0.08);
  outline: none;
  color: var(--hmtt-text);
}

.hmtt__article-kicker {
  display: block;
  margin-bottom: .35rem;
  color: var(--hmtt-accent);
  font-size: .82rem;
  font-weight: 850;
  letter-spacing: .01em;
}

.hmtt__article-title {
  display: block;
  font-size: 1.02rem;
  line-height: 1.4;
}

.hmtt__article-arrow {
  display: block;
  margin-top: .55rem;
  font-size: .88rem;
  font-weight: 800;
  color: var(--hmtt-accent);
}

.hmtt__actions {
  margin-top: .25rem;
}

.hmtt__restart {
  background: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .hmtt__article-card { transition: none; }
}

/* 0.4: rauhallisempi hover. Testin pitää reagoida, ei hypätä silmille. */
.hmtt__answer,
.hmtt__next-branch,
.hmtt__restart,
.hmtt__start,
.hmtt__article-card {
  transition: border-color .12s ease, background-color .12s ease, opacity .12s ease, box-shadow .12s ease !important;
}

.hmtt__answer:hover,
.hmtt__next-branch:hover,
.hmtt__restart:hover {
  transform: none !important;
  border-color: #aebbc4 !important;
  background: #fbfcfd !important;
  color: var(--hmtt-text) !important;
  box-shadow: none !important;
}

.hmtt__article-card:hover {
  transform: none !important;
  border-color: #b8c3ca !important;
  box-shadow: 0 3px 10px rgba(15, 30, 45, 0.05) !important;
  color: var(--hmtt-text) !important;
}

.hmtt__start:hover {
  transform: none !important;
  background: var(--hmtt-accent) !important;
  color: #fff !important;
  opacity: .94;
  box-shadow: none !important;
}

.hmtt__answer:focus-visible,
.hmtt__next-branch:focus-visible,
.hmtt__restart:focus-visible,
.hmtt__start:focus-visible,
.hmtt__article-card:focus-visible {
  transform: none !important;
  outline: 3px solid rgba(11, 79, 108, .18) !important;
  outline-offset: 2px;
}


/* 0.5: laajempi tilanneopas */
.hmtt__answer-hint {
  max-width: 58ch;
}
.hmtt__branch-icon {
  cursor: default;
}
.hmtt__article-kicker {
  letter-spacing: .01em;
}
