.hts-wrapper {
    max-width: 900px;
    margin: 20px auto;
    padding: 18px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    font-family: Tahoma, Arial, sans-serif;
    direction: rtl;
}

.hts-wrapper h2 { margin-top: 0; }

.hts-wrapper h1 {
	font-size: 2rem;
	color: #7D2B40;
	text-align: center;
	font-weight: 600;
}

@media (max-width : 640px) {
	.hts-wrapper h1 {
		font-size: 1.5rem;
	}
	
} 


.hts-progress { margin-bottom: 12px; font-weight: 600; font-family: 'peydaa'; }

.hts-ear { margin-bottom: 18px; }

.hts-step { padding: 12px; border: 1px solid #f0f0f0; border-radius: 6px; margin-bottom: 10px; background:#fbfbfb; }

.hts-sound {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}
.hts-sound:last-child { border-bottom: none; }

.hts-options { text-align: left; }

.hts-options label { margin-left: 10px; cursor: pointer; }

.hts-step-controls { margin-top: 10px; text-align: left; }

.hts-btn {
    border: none;	
    background: #7D2B40 !important;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
	width: 100%;
}
.hts-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.hts-result { margin-top: 20px; padding: 12px; border-top: 1px solid #eee; }

@media (max-width:640px) {
    .hts-sound { grid-template-columns: 1fr; }
}



#hts-pretest {
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
	font-family: 'peydaa';
}

#hts-pretest h2 {
	text-align: center;
	margin-bottom: 3%;
}


#hts-pretest h3 {
	text-align: right;
	margin-bottom: 3%;
	font-size: 1.3rem;
}

.hts-form-group {
    margin-bottom: 20px;
}
.hts-form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
	line-height: 1.5;
	text-align: justify;

}
#hts-start-btn {
    background-color: #0073aa;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
#hts-start-btn:hover {
    background-color: #005f8d;
}


/* استایل نتایج */
.hts-result {
  direction: rtl;
  text-align: center;
  margin-top: 30px;
}

.hts-bar-chart {
  width: 100%;
  max-width: 600px;
  margin: 25px auto;
}

.hts-bar {
  height: 28px;
  margin: 8px 0;
  border-radius: 6px;
  text-align: right;
  color: #fff;
  padding-right: 10px;
  font-size: 14px;
  line-height: 28px;
  transition: width 0.5s ease;
}

.hts-bar.good { background-color: #4caf50; }
.hts-bar.mild { background-color: #ffeb3b; color: #000; }
.hts-bar.medium { background-color: #ff9800; }
.hts-bar.severe { background-color: #f44336; }

@keyframes grow {
  from { width: 0; opacity: 0.5; }
  to { opacity: 1; }
}

/* استایل نتایج */
.hts-result {
  direction: rtl;
  text-align: center;
  margin-top: 30px;
}

.hts-bar-chart {
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
}

.hts-bar {
  height: 25px;
  margin: 6px 0;
  border-radius: 5px;
  transition: width 0.5s ease;
  text-align: right;
  color: #fff;
  padding-right: 10px;
  font-size: 14px;
  line-height: 25px;
}

/* رنگ‌بندی مرحله‌ای از خوب تا ضعیف */
.hts-bar.good { background-color: #4caf50; }   /* سبز */
.hts-bar.mild { background-color: #ffeb3b; color: #000; } /* زرد */
.hts-bar.medium { background-color: #ff9800; } /* نارنجی */
.hts-bar.severe { background-color: #f44336; } /* قرمز */


.hts-bar.good { background-color: #f44336; }   /* سبز */
.hts-bar.mild { background-color: #ff9800; color: #000; } /* زرد */
.hts-bar.medium { background-color: #ffeb3b; } /* نارنجی */
.hts-bar.severe { background-color: #4caf50; } /* قرمز */

.hts-break-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.hts-break-table th,
.hts-break-table td {
  border: 1px solid #ccc;
  padding: 6px 10px;
  text-align: center;
}

.hts-break-table th {
  background: #f0f0f0;
}



/* کانتینر کلی هر چارت */
.hts-chart-wrapper {
  margin: 20px 0;
  width: 100%;
  box-sizing: border-box;
  font-family: 'peydaa';
}

/* inner که تعیین کننده padding افقی مشترک است - 
   می‌توانی max-width را با توجه به طراحی سایت خود کم/زیاد کنی */
.hts-chart-inner {
  max-width: 920px;       /* تنظیم اختیاری: حداکثر عرض چارت */
  margin: 0 auto;
  padding: 14px 24px;     /* <-- مهم: همین padding برای چارت و محور مشترک است */
  box-sizing: border-box;
  direction: rtl;         /* حفظ جهت فارسی/RTL */
}

/* ظاهر عنوان */
.hts-chart-title {
  text-align: center;
  margin-bottom: 8px;
  font-weight: 600;
}

/* خودِ ناحیه‌ی میله‌ها — فقط padding عمودی نگه داشته شود (افقی صفر) */
.hts-bar-chart {
  background: #f6f7f8;
  border-radius: 10px;
  padding: 10px 0;   /* فقط عمودی — padding افقی داخل .hts-chart-inner است */
  box-sizing: border-box;
}

/* هر میله */
.hts-bar {
  display: block;
  height: 36px;
  line-height: 36px;
  margin: 8px 0;
  padding: 0 12px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
  transition: width 0.5s ease;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* برچسب داخل میله (اگر نیاز به راست چین یا فونت کوچکتر داشت) */
.hts-bar-label {
  display: inline-block;
  padding-left: 6px;
  font-weight: 600;
  font-family: 'peydaa';
}

/* کلاس‌های رنگی */



.hts-bar.good { background: #f44336; }
.hts-bar.mild { background: #ff9800; color: #222; }
.hts-bar.medium { background: #ffc107; }
.hts-bar.severe { background: #4caf50; }

/* محور/اسکیل زیر چارت 
.hts-bar-scale {
  display: flex;
  width: 100%;
  margin-top: 12px;
  box-sizing: border-box;
  align-items: flex-start;
  text-align: center;
  font-size: 13px;
  color: #333;
  border-top: 3px solid #e0e0e0;
  padding-top: 10px;
  direction: rtl;   /* سازگار با جهت فارسی 
}

/* هر سگمنت سهمی از کل پهنا می‌گیرد — نسبت واقعی بر اساس 0..90 
.hts-bar-scale .scale-segment {
  box-sizing: border-box;
  padding: 0 6px;
}

/* نسبت‌ها (بر اساس محدوده‌های 0–30، 31–50، 51–70، 71–90) 
/* 0–30   => 30/90  = 33.3333% 
/* 31–50  => 20/90  = 22.2222% 
/* 51–70  => 20/90  = 22.2222% 
/* 71–90  => 20/90  = 22.2222% 
.hts-bar-scale .normal  { flex: 0 0 33.3333%; }
.hts-bar-scale .mild    { flex: 0 0 22.2222%; }
.hts-bar-scale .medium  { flex: 0 0 22.2222%; }
.hts-bar-scale .severe  { flex: 0 0 22.2222%; }

.hts-bar-scale .scale-segment span {
  display: block;
  font-size: 12px;
  color: #666;
}

/* responsive tweaks 
@media (max-width: 600px) {
  .hts-chart-inner { padding: 10px 12px; }
  .hts-bar { height: 34px; font-size: 13px; padding: 0 8px; }
  .hts-bar-scale { font-size: 12px; padding-top: 8px; }
  .hts-bar-scale .scale-segment { padding: 0 4px; }
} */


.hts-bar-scale {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  margin-top: 12px;
  border-top: 3px solid #ddd;
  padding-top: 10px;
  text-align: center;
  font-size: 13px;
  direction: rtl;
  color: #333;
  box-sizing: border-box;
}

.hts-bar-scale .scale-segment {
  flex-grow: 0;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 0 6px;
  font-weight: 500;
}

/* نسبت پهناها بر اساس بازه واقعی (به درصد از کل 100) */
.hts-bar-scale .normal    { flex-basis: 15%; }  /* 10− تا 15 */
.hts-bar-scale .slight    { flex-basis: 10%; }  /* 16–25 */
.hts-bar-scale .mild      { flex-basis: 15%; }  /* 26–40 */
.hts-bar-scale .moderate  { flex-basis: 15%; }  /* 41–55 */
.hts-bar-scale .modsevere { flex-basis: 15%; }  /* 56–70 */
.hts-bar-scale .severe    { flex-basis: 15%; }  /* 71–90 */
.hts-bar-scale .profound  { flex-basis: 15%; }  /* 90+ */

/* رنگ پس‌زمینه ملایم برای تشخیص دیداری */
.hts-bar-scale .normal    { background: #c8e6c9; }
.hts-bar-scale .slight    { background: #fff9c4; }
.hts-bar-scale .mild      { background: #ffe082; }
.hts-bar-scale .moderate  { background: #ffcc80; }
.hts-bar-scale .modsevere { background: #ffb74d; }
.hts-bar-scale .severe    { background: #ef5350; color: #fff; }
.hts-bar-scale .profound  { background: #b71c1c; color: #fff; }

.hts-bar-scale .scale-segment span {
  display: block;
  font-size: 12px;
  color: inherit;
  margin-top: 3px;
}

/* موبایل */
@media (max-width: 768px) {
  .hts-bar-scale {
    font-size: 11px;
    padding-top: 6px;
  }
  .hts-bar-scale .scale-segment {
    padding: 0 3px;
  }
  .hts-bar-scale .scale-segment span {
    font-size: 10px;
  }
}