.thd-widget {
  border: 1px solid #d7dce3;
  border-radius: 12px;
  background: #fff;
  padding: 20px;
  margin: 24px 0;
  box-shadow: 0 2px 10px rgba(10, 25, 40, 0.04);
  color: #1b2a3a;
}

.thd-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.4;
}

.thd-description {
  margin: 0 0 16px;
  color: #46566a;
  font-size: 0.95rem;
}

.thd-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.thd-label {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: #304457;
  font-weight: 600;
}

.thd-url-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c4ceda;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px;
}

.thd-url-input:focus {
  outline: none;
  border-color: #2d6fb6;
  box-shadow: 0 0 0 3px rgba(45, 111, 182, 0.15);
}

.thd-submit,
.thd-rediagnose {
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: #2d6fb6;
  color: #fff;
  font-weight: 700;
  padding: 0 16px;
  cursor: pointer;
}

.thd-submit:hover,
.thd-rediagnose:hover {
  background: #245f9b;
}

.thd-loading {
  margin-top: 12px;
  color: #2d6fb6;
  font-size: 0.92rem;
}

.thd-error {
  margin-top: 12px;
  color: #b00020;
  background: #ffe8ec;
  border: 1px solid #f5bcc8;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.thd-result {
  margin-top: 20px;
  border-top: 1px solid #e6ebf1;
  padding-top: 18px;
}

.thd-total-score-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid #d1d9e4;
  background: #f7f9fc;
}

.thd-total-label {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #2f4357;
}

.thd-total-score {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 800;
}

.thd-total-max {
  margin: 0;
  color: #56687c;
  font-size: 0.95rem;
}

.thd-total-score-wrap.thd-good {
  background: #ecf9f1;
  border-color: #b8e8cb;
  color: #1f7a4d;
}

.thd-total-score-wrap.thd-warning {
  background: #fff7e8;
  border-color: #f3ddb0;
  color: #8a5a00;
}

.thd-total-score-wrap.thd-bad {
  background: #fff0f0;
  border-color: #f0c0c0;
  color: #9a2f2f;
}

.thd-category-scores {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.thd-score-card {
  border: 1px solid #d7dfe8;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.thd-score-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.thd-score-label {
  font-weight: 700;
  color: #2a3d52;
}

.thd-score-value {
  color: #3e556d;
  font-size: 0.92rem;
}

.thd-score-bar {
  height: 8px;
  border-radius: 999px;
  background: #e9eef5;
  overflow: hidden;
}

.thd-score-bar > span {
  display: block;
  height: 100%;
  background: #7aa7d6;
}

.thd-score-card.thd-good .thd-score-bar > span {
  background: #35a66a;
}

.thd-score-card.thd-warning .thd-score-bar > span {
  background: #d29a27;
}

.thd-score-card.thd-bad .thd-score-bar > span {
  background: #cc5a5a;
}

.thd-section {
  margin-top: 16px;
}

.thd-section h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #1f3247;
}

.thd-strengths,
.thd-issues {
  margin: 0;
  padding-left: 1.2rem;
}

.thd-strengths li,
.thd-issues li {
  margin: 0.35rem 0;
  line-height: 1.6;
}

.thd-summary {
  margin: 0;
  color: #2f4458;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .thd-widget {
    padding: 16px;
  }

  .thd-form {
    grid-template-columns: 1fr;
  }

  .thd-submit,
  .thd-rediagnose {
    width: 100%;
  }

  .thd-total-score {
    font-size: 1.5rem;
  }
}
