/* 치조음 설근력 훈련 */

.ws-ts {
  --ws-green: var(--color-primary, #0f766e);
  --ws-green-soft: rgba(var(--color-primary-rgb, 15, 118, 110), 0.08);
  --ws-green-border: rgba(var(--color-primary-rgb, 15, 118, 110), 0.2);
  display: grid;
  gap: 28px;
  min-width: 0;
  max-width: 100%;
}

.ws-ts__purpose {
  padding: 18px 18px 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--ws-green-border);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1) 0%, rgba(255, 255, 255, 0.95) 42%),
    #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.ws-ts__purpose-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ws-green);
}

.ws-ts__purpose-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--color-text-primary, #0f172a);
  letter-spacing: -0.01em;
}

.ws-ts__banner {
  border: 1px solid var(--color-border, rgba(15, 118, 110, 0.12));
  border-radius: 16px;
  background: #fff;
  padding: 18px;
  display: grid;
  gap: 16px;
}

.ws-ts__banner-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text-primary, #0f172a);
}

.ws-ts__banner-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-secondary, #64748b);
}

.ws-ts__mech-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.ws-ts__mech-tab {
  appearance: none;
  border: 1px solid var(--color-border, rgba(15, 118, 110, 0.15));
  background: #fff;
  color: var(--color-text-secondary, #475569);
  border-radius: 999px;
  min-height: 36px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ws-ts__mech-tab:hover {
  color: var(--ws-green);
  border-color: rgba(15, 118, 110, 0.35);
}

.ws-ts__mech-tab.is-active {
  background: var(--ws-green);
  border-color: var(--ws-green);
  color: #fff;
}

.ws-ts__mech-stage {
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 20%, rgba(15, 118, 110, 0.1), transparent 55%),
    linear-gradient(180deg, #f8fffe 0%, #f1f5f9 100%);
  border: 1px solid rgba(15, 118, 110, 0.1);
  padding: 18px 16px 16px;
  display: grid;
  gap: 14px;
}

.ws-ts__oral {
  position: relative;
  height: 140px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ecfeff 0%, #e2e8f0 100%);
  overflow: hidden;
}

.ws-ts__gum {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 150px;
  text-align: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 118, 110, 0.18);
  color: var(--ws-green);
  font-size: 0.75rem;
  font-weight: 700;
}

.ws-ts__tongue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 88px;
  height: 54px;
  margin-left: -44px;
  border-radius: 44px 44px 28px 28px;
  background: linear-gradient(180deg, #fda4af 0%, #fb7185 100%);
  box-shadow: 0 8px 18px rgba(244, 63, 94, 0.25);
  transition: transform 0.45s ease;
}

.ws-ts__tongue-tip {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 28px;
  height: 18px;
  margin-left: -14px;
  border-radius: 50%;
  background: #fecdd3;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
  transition: transform 0.45s ease, box-shadow 0.45s ease;
}

.ws-ts__air {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ws-ts__air span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(14, 116, 144, 0.45);
  opacity: 0;
}

.ws-ts__mech[data-active="n"] .ws-ts__tongue {
  transform: translateY(-18px);
  animation: wsTsHold 1.8s ease-in-out infinite;
}

.ws-ts__mech[data-active="n"] .ws-ts__tongue-tip {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.35);
}

.ws-ts__mech[data-active="n"] .ws-ts__air span:nth-child(1) {
  left: 46%;
  top: 18%;
  animation: wsTsNasal 1.8s ease-in-out infinite;
}

.ws-ts__mech[data-active="n"] .ws-ts__air span:nth-child(2) {
  left: 54%;
  top: 12%;
  animation: wsTsNasal 1.8s ease-in-out 0.2s infinite;
}

.ws-ts__mech[data-active="n"] .ws-ts__air span:nth-child(3) {
  left: 62%;
  bottom: 34%;
  animation: wsTsForwardSoft 1.8s ease-in-out 0.9s infinite;
}

.ws-ts__mech[data-active="d"] .ws-ts__tongue {
  animation: wsTsBurst 1.7s ease-in-out infinite;
}

.ws-ts__mech[data-active="d"] .ws-ts__tongue-tip {
  animation: wsTsTipRelease 1.7s ease-in-out infinite;
}

.ws-ts__mech[data-active="d"] .ws-ts__air span {
  left: 50%;
  top: 46%;
  width: 10px;
  height: 10px;
  background: rgba(15, 118, 110, 0.55);
}

.ws-ts__mech[data-active="d"] .ws-ts__air span:nth-child(1) {
  animation: wsTsJet 1.7s ease-in-out 0.55s infinite;
}

.ws-ts__mech[data-active="d"] .ws-ts__air span:nth-child(2) {
  animation: wsTsJet 1.7s ease-in-out 0.7s infinite;
  margin-left: 8px;
}

.ws-ts__mech[data-active="d"] .ws-ts__air span:nth-child(3) {
  animation: wsTsJet 1.7s ease-in-out 0.85s infinite;
  margin-left: -8px;
}

.ws-ts__mech[data-active="r"] .ws-ts__tongue {
  transform: translateY(-10px);
  animation: wsTsLateral 1.9s ease-in-out infinite;
}

.ws-ts__mech[data-active="r"] .ws-ts__air span:nth-child(1) {
  left: 28%;
  top: 48%;
  animation: wsTsSideThenFront 1.9s ease-in-out infinite;
}

.ws-ts__mech[data-active="r"] .ws-ts__air span:nth-child(2) {
  left: 70%;
  top: 48%;
  animation: wsTsSideThenFrontRight 1.9s ease-in-out infinite;
}

.ws-ts__mech[data-active="r"] .ws-ts__air span:nth-child(3) {
  left: 50%;
  top: 42%;
  animation: wsTsJet 1.9s ease-in-out 0.95s infinite;
}

@keyframes wsTsHold {
  0%, 45% { transform: translateY(-18px); }
  70%, 100% { transform: translateY(-10px); }
}

@keyframes wsTsNasal {
  0%, 40% { opacity: 0; transform: translateY(8px); }
  55% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-18px); }
}

@keyframes wsTsForwardSoft {
  0%, 55% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  75% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(28px, -8px) scale(1); }
}

@keyframes wsTsBurst {
  0%, 40% { transform: translateY(-20px); }
  55%, 100% { transform: translateY(-6px); }
}

@keyframes wsTsTipRelease {
  0%, 40% { transform: translateY(0); box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.4); }
  55%, 100% { transform: translateY(8px); box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15); }
}

@keyframes wsTsJet {
  0%, 50% { opacity: 0; transform: translateX(0) scale(0.5); }
  65% { opacity: 1; }
  100% { opacity: 0; transform: translateX(42px) scale(1.1); }
}

@keyframes wsTsLateral {
  0%, 45% { transform: translateY(-10px) scaleX(1.05); }
  70%, 100% { transform: translateY(-6px) scaleX(1); }
}

@keyframes wsTsSideThenFront {
  0%, 40% { opacity: 0.15; transform: translate(-6px, 0); }
  55% { opacity: 0.8; transform: translate(-16px, -4px); }
  75%, 100% { opacity: 0; transform: translate(30px, -10px); }
}

@keyframes wsTsSideThenFrontRight {
  0%, 40% { opacity: 0.15; transform: translate(6px, 0); }
  55% { opacity: 0.8; transform: translate(16px, -4px); }
  75%, 100% { opacity: 0; transform: translate(-8px, -12px); }
}

.ws-ts__mech-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  font-size: 0.875rem;
  color: var(--color-text-secondary, #475569);
}

.ws-ts__mech-caption strong {
  color: var(--ws-green);
  font-weight: 800;
}

.ws-ts__steps {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.ws-ts__step {
  border: 1px solid var(--color-border, rgba(15, 118, 110, 0.12));
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  min-width: 0;
}

.ws-ts__step[open] {
  border-color: var(--ws-green-border);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.ws-ts__step summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  user-select: none;
}

.ws-ts__step summary::-webkit-details-marker {
  display: none;
}

.ws-ts__step summary::after {
  content: "+";
  margin-left: auto;
  color: var(--ws-green);
  font-size: 1.2rem;
}

.ws-ts__step[open] summary::after {
  content: "−";
}

.ws-ts__step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ws-green);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
}

.ws-ts__step-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ws-ts__step-title {
  font-size: 0.975rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--color-text-primary, #0f172a);
}

.ws-ts__step-tip {
  font-size: 0.75rem;
  color: var(--color-text-muted, #64748b);
  line-height: 1.4;
}

.ws-ts__step-progress {
  flex-shrink: 0;
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--ws-green-soft);
  color: var(--ws-green);
  font-size: 0.75rem;
  font-weight: 750;
  text-align: center;
}

.ws-ts__step-body {
  padding: 0 16px 18px;
  display: grid;
  gap: 16px;
}

.ws-ts__callout {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f0fdfa;
  border: 1px solid rgba(15, 118, 110, 0.22);
}

.ws-ts__callout-label {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--ws-green);
}

.ws-ts__callout ul {
  margin: 0;
  padding-left: 1.05em;
  display: grid;
  gap: 7px;
}

.ws-ts__callout li {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-primary, #0f172a);
}

.ws-ts__block-title {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 750;
  color: var(--color-text-primary, #0f172a);
}

.ws-ts__block-title span {
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
}

.ws-ts__checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
}

.ws-ts__step-body .ws-ts__block:nth-child(n + 3) .ws-ts__checklist,
.ws-ts__step[data-section="n"] .ws-ts__block:last-child .ws-ts__checklist {
  grid-template-columns: 1fr;
}

.ws-ts__check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ws-ts__check-item:hover {
  border-color: rgba(15, 118, 110, 0.28);
}

.ws-ts__check-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ws-ts__check-ui {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 999px;
  border: 2px solid rgba(15, 118, 110, 0.35);
  background: #fff;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ws-ts__check-ui::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s ease;
}

.ws-ts__check-input:checked + .ws-ts__check-ui {
  border-color: var(--ws-green);
  background: var(--ws-green-soft);
}

.ws-ts__check-input:checked + .ws-ts__check-ui::after {
  background: var(--ws-green);
}

.ws-ts__check-input:checked ~ .ws-ts__check-text {
  color: var(--ws-green);
}

.ws-ts__check-item:has(.ws-ts__check-input:checked) {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.04);
}

.ws-ts__check-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text-primary, #0f172a);
  letter-spacing: -0.01em;
}

.ws-ts__log {
  border: 1px solid var(--color-border, rgba(15, 118, 110, 0.12));
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fffe 0%, #ffffff 42%);
  padding: 20px 16px;
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.ws-ts__log-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.ws-ts__log-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ws-ts__log-desc {
  margin: 0;
  max-width: 46ch;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-secondary, #64748b);
}

.ws-ts__add-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 18px;
  background: var(--ws-green);
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.2);
}

.ws-ts__add-btn:hover {
  background: var(--color-primary-hover, #0d655e);
}

.ws-ts__table-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

.ws-ts__table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.ws-ts__table th,
.ws-ts__table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  text-align: center;
  vertical-align: middle;
}

.ws-ts__table th {
  background: var(--ws-green-soft);
  color: var(--ws-green);
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.8125rem;
}

.ws-ts__table th:first-child,
.ws-ts__table td:first-child {
  text-align: left;
  padding-left: 14px;
}

.ws-ts__table th:nth-child(5),
.ws-ts__table td:nth-child(5) {
  text-align: left;
  min-width: 180px;
}

.ws-ts__empty-row td {
  padding: 28px 16px;
  color: #94a3b8;
  text-align: center !important;
}

.ws-ts__date-input,
.ws-ts__note-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text-primary, #0f172a);
}

.ws-ts__date-input:focus,
.ws-ts__note-input:focus {
  outline: none;
  border-color: var(--ws-green);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.ws-ts__step-check {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.ws-ts__delete-btn {
  appearance: none;
  border: 1px solid rgba(220, 38, 38, 0.2);
  background: #fff;
  color: #b91c1c;
  border-radius: 8px;
  min-height: 34px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.ws-ts__delete-btn:hover {
  background: #fef2f2;
}

@media (max-width: 720px) {
  .ws-ts__checklist {
    grid-template-columns: 1fr 1fr;
  }

  .ws-ts__step summary {
    align-items: flex-start;
  }

  .ws-ts__step-progress {
    order: 3;
  }

  .ws-ts__step summary::after {
    order: 4;
  }

  .ws-ts__add-btn {
    width: 100%;
  }
}
