.tt-shell {
  max-width: min(1080px, calc(100% - 32px));
  margin: 24px auto 56px;
  padding: 0;
  color: #0f172a;
}

.tt-head {
  margin-bottom: 16px;
}

.tt-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6b737c;
  margin-bottom: 8px;
}

.tt-breadcrumbs a {
  color: #6b737c;
  text-decoration: none;
}

.tt-breadcrumbs a:hover,
.tt-breadcrumbs a:focus-visible {
  color: #2f6fdf;
  text-decoration: underline;
}

.tt-head h1 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #101828;
}

.tt-intro {
  margin: 0;
  max-width: 860px;
  font-size: 1rem;
  line-height: 1.6;
  color: #334155;
}

.tt-card {
  background: #ffffff;
  border: 1px solid rgba(20, 24, 30, 0.1);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
}

.tt-card > h1 {
  margin: 0;
  padding-bottom: 20px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #101828;
}

.tt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tt-chip-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tt-chip-group-right {
  margin-left: auto;
}

.tt-chip-label {
  font-size: 13px;
  color: #4c5669;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.tt-chip {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #ccd7ec;
  background: #ffffff;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
}

.tt-chip.is-active,
.tt-chip:hover,
.tt-chip:focus-visible {
  border-color: #2f6fdf;
  color: #1f4eb7;
  background: #eef4ff;
}

.tt-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

.tt-btn {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 14px;
  background: linear-gradient(135deg, #2f6fdf 0%, #2aa8da 100%);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.tt-btn-ghost {
  background: #ffffff;
  color: #334155;
  border-color: #ccd7ec;
}

.tt-stats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.tt-stat {
  border: 1px solid #dbe3f3;
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
}

.tt-stat h2 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5b6879;
}

.tt-stat-label {
  font-size: 14px !important;
}

.tt-stat p {
  margin: 6px 0 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

 .tt-passage-wrap {
  margin-top: 14px;
  background: #ffffff;
  border: 1px solid #d7deeb;
  border-radius: 12px;
  padding: 16px;
  cursor: text;
  position: relative;
}

.tt-passage {
  margin: 0;
  font-family: "Space Grotesk", "Courier New", Courier, monospace;
  font-size: clamp(21px, 2.6vw, 30px);
  line-height: 1.75;
  letter-spacing: 0.025em;
  color: #5d6673;
  word-break: normal;
  overflow-wrap: normal;
  white-space: pre-wrap;
  hyphens: none;
}

.tt-char {
  display: inline;
  border-radius: 4px;
  transition: background 0.1s ease, color 0.1s ease;
}

.tt-char.is-current {
  background: #e2ecff;
  color: #1849b6;
}

.tt-char.is-correct {
  background: #e9f8ee;
  color: #1d8b4c;
}

.tt-char.is-wrong {
  background: #ffe9ea;
  color: #be1f2f;
}

.tt-capture-label {
  margin-top: 12px;
  display: inline-block;
  font-weight: 600;
  color: #374151;
}

.tt-input {
  margin-top: 8px;
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid #cfd9ec;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 18px;
  line-height: 1.5;
  color: #0f172a;
  background: #ffffff;
}

.tt-input:focus-visible {
  outline: 2px solid #2f6fdf;
  outline-offset: 0;
  border-color: #2f6fdf;
}

@media (min-width: 900px) {
  .tt-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    border: none;
    padding: 0;
    margin: 0;
    pointer-events: none;
  }
}

.tt-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: #5b6879;
}

.tt-result {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 16px;
  border-radius: 12px;
  background: rgba(231, 242, 255, 0.96);
  border: 1px solid #c5d9ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  color: #1d4eb7;
  z-index: 3;
}

.tt-result[hidden] {
  display: none !important;
}

.tt-result.is-fail {
  background: rgba(255, 244, 244, 0.96);
  border-color: #f1c4c4;
  color: #b12a2a;
}
.tt-card.is-result-active .tt-actions {
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
}

.tt-result button {
  border-color: transparent;
}

.tt-reference {
  margin-top: 16px;
  background: #ffffff;
  border: 1px solid rgba(20, 24, 30, 0.08);
  border-radius: 12px;
  padding: 20px;
}

.tt-reference h2 {
  margin: 16px 0 8px;
  font-size: 22px;
  line-height: 1.3;
  color: #101828;
}

.tt-reference h2:first-child {
  margin-top: 0;
}

.tt-reference p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: #374151;
}

.tt-reference ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.tt-reference li {
  margin: 4px 0;
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
}

.tt-reference a {
  color: #2f6fdf;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tt-reference a:hover,
.tt-reference a:focus-visible {
  color: #1f5cc9;
}

@media (max-width: 920px) {
  .tt-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .tt-shell {
    width: calc(100% - 22px);
    margin: 20px auto 42px;
    padding: 0;
  }

  .tt-card,
  .tt-reference {
    padding: 14px;
  }

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

  .tt-toolbar {
    align-items: stretch;
  }

  .tt-duration,
  .tt-actions {
    width: 100%;
    justify-content: space-between;
  }

  .tt-passage {
    line-height: 1.6;
  }
}
