/* BuyThisCode Arabic calculators kit: styles. Colours are the variables below. */
.tj-tool {
	--bg: #F3F6F4;
	--surface: #FFFFFF;
	--ink: #12201A;
	--muted: #56675F;
	--line: #D6E0DA;
	--green: #31643A;   /* the logo's green */
	--green-ink: #FFFFFF;
	--slip: #1F4428;
	--slip-ink: #EDF5EE;
	--slip-muted: #A9C9AF;
	--gold: #D9A21B;
	--gold-soft: #FFF3D3;
	--warn: #B3261E;
	--focus: #1D7FD8;
	--r-s: 6px;
	--r-m: 12px;
	--font-ui: "Readex Pro", system-ui, "Segoe UI", Tahoma, sans-serif;
	--font-text: "Noto Naskh Arabic", "Readex Pro", Tahoma, serif;
	--wrap: 1160px;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	.tj-tool {
		--bg: #0E1613;
		--surface: #15201B;
		--ink: #E5EEE9;
		--muted: #9AAFA5;
		--line: #26362F;
		--green: #7CC48A;
		--green-ink: #0F2814;
		--slip: #17311D;
		--slip-ink: #E6F2E8;
		--slip-muted: #96BE9D;
		--gold: #E8B83A;
		--gold-soft: #2E2711;
		--warn: #FF8A80;
		color-scheme: dark;
	}
}
.tj-tool, .tj-tool *, .tj-tool *::before, .tj-tool *::after { box-sizing: border-box; }
.tj-tool { font: 400 1rem/1.7 var(--font-ui); color: var(--ink); margin: 0 0 24px; }
.tj-tool [hidden] { display: none !important; }
/* ---------- tool form ---------- */
.tj-tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; margin-bottom: 20px; }
.tj-form { padding: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.tj-form:empty { display: none; }
.tj-form > .tj-seg, .tj-form > [data-show], .tj-form > .tj-courses, .tj-form > .tj-row2, .tj-form > .tj-row3, .tj-form > button { grid-column: 1 / -1; }
@media (max-width: 560px) { .tj-form { grid-template-columns: 1fr; padding: 16px; } }
.tj-f { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.tj-f__l { font-size: .9rem; font-weight: 500; color: var(--muted); padding: 0; }
.tj-f__in { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); }
.tj-f__in:focus-within, .tj-f select:focus, .tj-f input[type=date]:focus, .tj-hd input:focus { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); outline: none; }
.tj-f__in input { flex: 1; min-width: 0; border: 0; background: none; outline: none; }
.tj-f input, .tj-f select, .tj-course select, .tj-course input {
	font: 500 1.05rem/1.4 var(--font-ui); color: var(--ink); padding: 10px 12px; font-variant-numeric: tabular-nums;
}
.tj-f select, .tj-f > input[type=date], .tj-hd input, .tj-course select, .tj-course input {
	background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); width: 100%;
}
.tj-f__u { padding-inline: 10px 12px; color: var(--muted); font-size: .9rem; white-space: nowrap; }

/* Numbers are typed with Latin digits, so every number and date field runs left-to-right
   ("10000 ريال") inside the right-to-left page; RTL fields made the caret jump while typing. */
.tj-f__in, .tj-f > input[type=date], .tj-hd input, .tj-course input { direction: ltr; }
.tj-f__in input, .tj-f > input[type=date], .tj-hd input, .tj-course input { text-align: left; }
.tj-hd { display: grid; grid-template-columns: 70px 1fr 90px; gap: 8px; }
.tj-hd legend { margin-bottom: 6px; }
.tj-seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); padding: 3px; gap: 3px; justify-self: start; flex-wrap: wrap; }
.tj-seg label { position: relative; }
.tj-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tj-seg span { display: block; padding: 7px 14px; border-radius: 4px; font-weight: 500; font-size: .95rem; color: var(--muted); }
.tj-seg input:checked + span { background: var(--surface); color: var(--green); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.tj-seg input:focus-visible + span { outline: 3px solid var(--focus); }
.tj-row2, .tj-row3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.tj-row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .tj-row3 { grid-template-columns: 1fr; } }
.tj-btn { font: 600 .95rem var(--font-ui); background: var(--green); color: var(--green-ink); border: 0; border-radius: var(--r-s); padding: 10px 16px; cursor: pointer; justify-self: start; }
.tj-btn--ghost { background: none; color: var(--green); border: 1px dashed var(--green); }
.tj-courses { display: grid; gap: 8px; }
.tj-course { display: grid; grid-template-columns: 24px 1fr 76px auto 36px; gap: 8px; align-items: center; }
.tj-course__n { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.tj-course__u { color: var(--muted); font-size: .85rem; }
.tj-course__x { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: var(--r-s); height: 40px; font-size: 1.2rem; cursor: pointer; }
.tj-course__x:hover { color: var(--warn); border-color: var(--warn); }

/* ---------- the result slip: the one bold element ---------- */
.tj-slip {
	background: var(--slip); color: var(--slip-ink); padding: 22px 20px 18px; position: relative;
	/* perforated tear line between the form and the slip */
	background-image: radial-gradient(circle at 8px 0, var(--surface) 5px, transparent 5.5px);
	background-size: 16px 10px; background-repeat: repeat-x;
}
.tj-tool > .tj-form:empty + .tj-slip { background-image: none; }
.tj-slip__label { color: var(--slip-muted); font-size: .92rem; }
.tj-slip__big { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 3.6rem); font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 2px 0 12px; overflow-wrap: anywhere; }
.tj-slip__big small { font-size: 1.05rem; font-weight: 400; color: var(--slip-muted); letter-spacing: 0; }
.tj-slip__rows { margin: 0; display: grid; gap: 0; }
.tj-slip__rows div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px dashed rgba(255, 255, 255, .18); }
.tj-slip__rows dt { color: var(--slip-muted); }
.tj-slip__rows dd { margin: 0; font-weight: 500; text-align: end; font-variant-numeric: tabular-nums; }
.tj-slip__note { margin: 10px 0 0; font-size: .88rem; color: var(--slip-muted); }
.tj-slip.is-warn .tj-slip__note { color: var(--gold); font-weight: 500; }
.tj-slip__share { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28); background: transparent; color: var(--slip-ink); font: 500 .9rem var(--font-ui); cursor: pointer; }
.tj-slip__share:hover { background: rgba(255, 255, 255, .08); }

.tj-page--date .tj-slip__big, .tj-page--date .tj-slip__big small { color: var(--slip-ink); }
.tj-page--date .tj-slip__big { font-size: clamp(3rem, 2rem + 5vw, 5rem); }
.tj-upcoming { overflow-x: auto; }
.tj-upcoming table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tj-upcoming th, .tj-upcoming td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tj-upcoming td:first-child { white-space: normal; }
.tj-upcoming th { color: var(--muted); font-weight: 500; background: var(--bg); }
.tj-upcoming tr.is-now td { background: var(--gold-soft); font-weight: 600; }
.tj-upcoming small { color: var(--muted); font-weight: 400; }
@media (max-width: 560px) {
	.tj-upcoming:not(.tj-imsak-table) th:nth-child(3), .tj-upcoming:not(.tj-imsak-table) td:nth-child(3) { display: none; }
	.tj-upcoming th, .tj-upcoming td { white-space: normal; padding: 10px; }
	.tj-upcoming small { display: block; }
	.tj-upcoming td:last-child { white-space: nowrap; }
}

