/*
 * AskTraders Trading Calculators — neutral, theme-inheriting styles.
 * Override via your theme by targeting .askt-calc and its children.
 */

.askt-calc {
	--askt-radius: 6px;
	--askt-border: rgba(0, 0, 0, 0.12);
	--askt-bg-soft: rgba(0, 0, 0, 0.03);
	--askt-bg-result: rgba(0, 0, 0, 0.04);
	--askt-accent: currentColor;
	--askt-error: #b00020;

	box-sizing: border-box;
	width: 100%;
	max-width: 760px;
	margin: 0 auto;
	font: inherit;
	color: inherit;
}

.askt-calc *,
.askt-calc *::before,
.askt-calc *::after {
	box-sizing: border-box;
}

.askt-form {
	background: var(--askt-bg-soft);
	border: 1px solid var(--askt-border);
	border-radius: var(--askt-radius);
	padding: 1.25rem;
}

.askt-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.85rem 1rem;
}

@media (max-width: 540px) {
	.askt-grid {
		grid-template-columns: 1fr;
	}
}

.askt-field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	font-size: 0.95em;
	min-width: 0;
}

.askt-field[hidden] {
	display: none;
}

.askt-field > span {
	font-weight: 600;
	font-size: 0.9em;
	opacity: 0.85;
}

.askt-field input,
.askt-field select {
	font: inherit;
	color: inherit;
	background: #fff;
	border: 1px solid var(--askt-border);
	border-radius: var(--askt-radius);
	padding: 0.55rem 0.7rem;
	width: 100%;
	min-width: 0;
	line-height: 1.3;
}

.askt-field input:focus,
.askt-field select:focus {
	outline: 2px solid var(--askt-accent);
	outline-offset: 1px;
}

.askt-help {
	font-size: 0.8em;
	opacity: 0.75;
}

.askt-actions {
	margin-top: 1.1rem;
	display: flex;
	justify-content: flex-start;
}

.askt-submit {
	font: inherit;
	font-weight: 600;
	color: #fff;
	background: #111;
	border: 0;
	border-radius: var(--askt-radius);
	padding: 0.7rem 1.4rem;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.askt-submit:hover { opacity: 0.9; }
.askt-submit:active { opacity: 0.8; }
.askt-submit:focus-visible { outline: 2px solid var(--askt-accent); outline-offset: 2px; }

.askt-error {
	color: var(--askt-error);
	font-size: 0.9em;
	margin: 0.8rem 0 0;
}

.askt-result {
	margin-top: 1.25rem;
	background: var(--askt-bg-result);
	border: 1px solid var(--askt-border);
	border-radius: var(--askt-radius);
	padding: 1.1rem 1.25rem;
}

.askt-result[hidden] {
	display: none;
}

.askt-result-body {
	display: grid;
	gap: 0.45rem;
}

.askt-result-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	border-bottom: 1px dashed var(--askt-border);
	padding-bottom: 0.45rem;
}

.askt-result-row:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.askt-result-label {
	font-size: 0.9em;
	opacity: 0.85;
}

.askt-result-value {
	font-weight: 700;
	text-align: right;
	word-break: break-word;
}

.askt-disclaimer {
	margin: 1rem 0 0;
	font-size: 0.82em;
	opacity: 0.75;
	line-height: 1.45;
}

.askt-cta {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--askt-border);
}

.askt-cta-headline {
	margin: 0 0 0.6rem;
	font-weight: 600;
}

.askt-cta-button {
	display: inline-block;
	text-decoration: none;
	font-weight: 600;
	color: #fff;
	background: #111;
	padding: 0.6rem 1.1rem;
	border-radius: var(--askt-radius);
}

.askt-cta-button:hover { opacity: 0.9; }

/* ----- Searchable combobox ----- */

.askt-visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}

.askt-combobox {
	position: relative;
	width: 100%;
}

.askt-combobox-input {
	font: inherit;
	color: inherit;
	background: #fff;
	border: 1px solid var(--askt-border);
	border-radius: var(--askt-radius);
	padding: 0.55rem 0.7rem;
	width: 100%;
	line-height: 1.3;
}

.askt-combobox-input:focus {
	outline: 2px solid var(--askt-accent);
	outline-offset: 1px;
}

.askt-calc ul.askt-combobox-list {
	position: absolute;
	top: calc(100% + 2px);
	left: 0;
	right: 0;
	z-index: 50;
	max-height: 14em;
	overflow-y: auto;
	margin: 0;
	padding: 0.25rem 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--askt-border);
	border-radius: var(--askt-radius);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.askt-calc ul.askt-combobox-list[hidden] {
	display: none;
}

.askt-calc ul.askt-combobox-list li {
	list-style: none;
	margin: 0;
	padding: 0.45rem 0.7rem;
	cursor: pointer;
	font-size: 0.95em;
	line-height: 1.3;
	background: transparent;
}

.askt-calc ul.askt-combobox-list li::before,
.askt-calc ul.askt-combobox-list li::marker {
	content: none !important;
	display: none !important;
}

.askt-calc ul.askt-combobox-list li:hover,
.askt-calc ul.askt-combobox-list li.is-active {
	background: rgba(0, 0, 0, 0.07);
}

.askt-calc .askt-combobox-empty {
	cursor: default;
	color: rgba(0, 0, 0, 0.55);
	font-style: italic;
}
