.tq-dd-calc {
	--tq-brand: #4a6b5a;
	--tq-brand-dark: #3a5548;
	--tq-brand-light: #eef4f1;
	--tq-brand-border: rgba(74, 107, 90, 0.16);
	--tq-text: #22302b;
	--tq-muted: #57685f;
	--tq-border: #d7e3de;
	--tq-radius: 16px;

	font-family: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
	color: var(--tq-text);
	width: 100%;
	max-width: 100%;
	margin: 24px 0;
	box-sizing: border-box;
	border: 3px solid var(--tq-brand);
	border-radius: var(--tq-radius);
	overflow: hidden;
	background: #ffffff;
}

.tq-dd-calc *,
.tq-dd-calc *::before,
.tq-dd-calc *::after {
	box-sizing: inherit;
}

/* ----- الرأس ----- */

.tq-dd-header {
	background: linear-gradient(135deg, #5c7d6c 0%, var(--tq-brand) 100%);
	color: #ffffff;
	text-align: center;
	padding: 16px 20px;
}

.tq-dd-header-title-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 8px;
}

.tq-dd-header-icon {
	display: inline-flex;
	width: 26px;
	height: 26px;
}

.tq-dd-header-icon svg {
	width: 100%;
	height: 100%;
}

.tq-dd-title {
	margin: 0;
	font-size: 25px;
	font-weight: 700;
}

.tq-dd-subtitle {
	margin: 0;
	font-size: 15.5px;
	font-weight: 400;
	opacity: 0.9;
}

.tq-dd-body {
	background: #ffffff;
	padding: 24px 20px;
}

/* ----- كتلة تاريخ واحدة (يتكرر مرتين) ----- */

.tq-dd-block {
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1.5px solid var(--tq-border);
}

.tq-dd-block-label {
	margin: 0 0 12px;
	font-size: 17px;
	font-weight: 700;
	color: var(--tq-brand-dark);
}

/* ----- التبويبات ----- */

.tq-dd-tabs {
	display: flex;
	gap: 8px;
	background: var(--tq-brand-light);
	padding: 6px;
	border-radius: 12px;
	margin-bottom: 16px;
	border: 1px solid var(--tq-brand-border);
}

.tq-dd-tab {
	flex: 1;
	border: none;
	background: transparent;
	padding: 10px 14px;
	border-radius: 9px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	color: var(--tq-brand-dark);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tq-dd-tab.is-active {
	background: var(--tq-brand);
	color: #ffffff;
	box-shadow: 0 3px 8px rgba(74, 107, 90, 0.4);
}

/* ----- الحقول ----- */

.tq-dd-selects {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 12px;
	margin-bottom: 16px;
}

@media (max-width: 420px) {
	.tq-dd-selects {
		grid-template-columns: 1fr;
	}
}

.tq-dd-field label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--tq-muted);
	margin-bottom: 7px;
}

.tq-dd-select {
	width: 100%;
	padding: 12px 40px;
	border: 1.5px solid var(--tq-border);
	border-radius: 10px;
	background-color: #fafcfb;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2357685f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 14px center;
	background-size: 16px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	color: var(--tq-text);
	text-align: center;
	text-align-last: center;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.tq-dd-select:focus {
	outline: none;
	border-color: var(--tq-brand);
	background-color: #ffffff;
}

/* ----- التاريخ المعادل ----- */

.tq-dd-equivalent {
	background: var(--tq-brand-light);
	border: 1.5px solid var(--tq-brand-border);
	border-radius: 12px;
	padding: 14px;
	text-align: center;
}

.tq-dd-equivalent-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--tq-muted);
	margin-bottom: 7px;
}

.tq-dd-equivalent-value {
	display: block;
	font-size: 19px;
	font-weight: 700;
	color: var(--tq-text);
}

/* ----- خانة الاختيار ----- */

.tq-dd-checkbox-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 18px;
	font-size: 15px;
	font-weight: 600;
	color: var(--tq-text);
	cursor: pointer;
}

.tq-dd-checkbox {
	width: 20px;
	height: 20px;
	accent-color: var(--tq-brand);
	cursor: pointer;
	flex-shrink: 0;
}

/* ----- الزر والخطأ ----- */

.tq-dd-error {
	color: #b3382c;
	font-size: 14.5px;
	font-weight: 600;
	margin: 0 2px 14px;
}

.tq-dd-btn {
	width: 100%;
	background: var(--tq-brand);
	color: #ffffff;
	border: none;
	border-radius: 10px;
	padding: 15px 22px;
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.tq-dd-btn:hover,
.tq-dd-btn:focus-visible {
	background: var(--tq-brand-dark);
}

/* ----- النتيجة ----- */

.tq-dd-result {
	background: #f6faf8;
	border-top: 1.5px solid var(--tq-border);
	padding: 22px 20px;
}

.tq-dd-swap-note {
	margin: 0 0 16px;
	padding: 10px 14px;
	background: #fdf3e6;
	border: 1.5px solid #f0d9b5;
	border-radius: 10px;
	color: #8a6416;
	font-size: 13.5px;
	font-weight: 600;
	text-align: center;
}

.tq-dd-cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 560px) {
	.tq-dd-cards {
		grid-template-columns: 1fr;
	}
}

.tq-dd-card {
	background: var(--tq-brand-light);
	border: 1.5px solid var(--tq-brand-border);
	border-radius: 14px;
	padding: 20px;
	text-align: center;
}

.tq-dd-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--tq-brand);
	margin-bottom: 8px;
}

.tq-dd-icon svg {
	width: 28px;
	height: 28px;
}

.tq-dd-card-title {
	display: block;
	font-size: 15px;
	font-weight: 700;
	color: var(--tq-brand-dark);
	margin-bottom: 10px;
}

.tq-dd-card-value {
	display: block;
	font-size: 22px;
	font-weight: 700;
	color: var(--tq-brand-dark);
	line-height: 1.6;
	overflow-wrap: break-word;
	word-break: break-word;
}

/* ----- تفاصيل إضافية ----- */

.tq-dd-stats-wrap {
	margin-top: 16px;
	background: #ffffff;
	border: 1.5px solid var(--tq-border);
	border-radius: 14px;
	padding: 18px;
	text-align: center;
}

.tq-dd-stats-title {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 700;
	color: var(--tq-muted);
}

.tq-dd-stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}

.tq-dd-stats .tq-dd-stat:last-child {
	grid-column: 1 / -1;
}

.tq-dd-stat {
	background: var(--tq-brand-light);
	border: 1.5px solid var(--tq-brand-border);
	border-radius: 12px;
	padding: 16px 10px;
	text-align: center;
	overflow: hidden;
}

.tq-dd-stat-value {
	display: block;
	font-size: clamp(15px, 4.5vw, 19px);
	font-weight: 700;
	color: var(--tq-text);
	margin-bottom: 4px;
	overflow-wrap: break-word;
	word-break: break-word;
}

.tq-dd-stat-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--tq-muted);
}
