/*
 * MyBodyMath Calculators — standalone styles.
 *
 * The MyBodyMath theme already styles all of this; these rules exist so the
 * calculators stay usable under a different theme. Everything is expressed
 * against CSS custom properties with fallbacks, so a theme that defines
 * --accent, --bg-card and friends is picked up automatically.
 */

.mbm-table-wrap,
.calc-box {
	--mbm-accent:  var(--accent,      #e8563a);
	--mbm-bg:      var(--bg,          #f7f5f0);
	--mbm-card:    var(--bg-card,     #ffffff);
	--mbm-text:    var(--text,        #1a1a2e);
	--mbm-muted:   var(--text-muted,  #5a5a6e);
	--mbm-light:   var(--text-light,  #8a8a9e);
	--mbm-border:  var(--border,      #e4e0d8);
	--mbm-radius:  var(--radius,      14px);
	--mbm-radius-sm: var(--radius-sm, 8px);
}

/* ── Shell ── */
.calc-box {
	background: var(--mbm-card);
	border: 1px solid var(--mbm-border);
	border-radius: var(--mbm-radius);
	padding: 28px;
	margin-bottom: 20px;
	color: var(--mbm-text);
}

.calc-box .subtitle {
	color: var(--mbm-muted);
	font-size: 15px;
	line-height: 1.6;
	margin-bottom: 24px;
	overflow: hidden;
}

/* ── Unit toggle ── */
.calc-box .unit-toggle {
	display: inline-flex;
	border: 1px solid var(--mbm-border);
	border-radius: var(--mbm-radius-sm);
	overflow: hidden;
	margin-bottom: 20px;
}
.calc-box .unit-toggle button {
	background: none;
	border: none;
	padding: 9px 16px;
	font-size: 13px;
	font-family: inherit;
	color: var(--mbm-muted);
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}
.calc-box .unit-toggle button:hover { background: var(--mbm-bg); }
.calc-box .unit-toggle button.active {
	background: var(--mbm-accent);
	color: #fff;
	font-weight: 500;
}

/* ── Form ── */
.calc-box .form-row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 16px;
}
.calc-box .form-group { flex: 1 1 160px; min-width: 0; }
.calc-box .form-group.full { flex-basis: 100%; }

.calc-box label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	margin-bottom: 6px;
	color: var(--mbm-text);
}

.calc-box input[type="number"],
.calc-box input[type="text"],
.calc-box input[type="search"],
.calc-box select {
	width: 100%;
	padding: 12px 14px;
	font-size: 15px;
	font-family: inherit;
	color: var(--mbm-text);
	background: var(--mbm-bg);
	border: 1px solid var(--mbm-border);
	border-radius: var(--mbm-radius-sm);
	box-sizing: border-box;
}
.calc-box input:focus-visible,
.calc-box select:focus-visible {
	outline: 2px solid var(--mbm-accent);
	outline-offset: 1px;
}

/* ── Radio cards ── */
.calc-box .radio-group { display: flex; flex-direction: column; gap: 8px; }
.calc-box .radio-option {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid var(--mbm-border);
	border-radius: var(--mbm-radius-sm);
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}
.calc-box .radio-option:hover { background: var(--mbm-bg); }
.calc-box .radio-option.selected { border-color: var(--mbm-accent); }
.calc-box .radio-option input { margin-top: 3px; accent-color: var(--mbm-accent); }
.calc-box .radio-label { font-size: 14px; font-weight: 500; }
.calc-box .radio-sub   { font-size: 13px; color: var(--mbm-muted); margin-top: 2px; line-height: 1.5; }

/* ── Submit ── */
.calc-box .btn-calc {
	display: block;
	width: 100%;
	margin-top: 24px;
	padding: 15px 20px;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	color: #fff;
	background: var(--mbm-accent);
	border: none;
	border-radius: var(--mbm-radius-sm);
	cursor: pointer;
	transition: filter 0.15s;
}
.calc-box .btn-calc:hover  { filter: brightness(0.93); }
.calc-box .btn-calc:active { filter: brightness(0.86); }
.calc-box .btn-calc:focus-visible { outline: 2px solid var(--mbm-text); outline-offset: 2px; }

/* ── Results ── */
.calc-box .results-box {
	display: none;
	margin-top: 24px;
	padding: 24px;
	background: #1a1a2e;
	color: #fff;
	border-radius: var(--mbm-radius);
}
.calc-box .results-box.visible { display: block; }

.calc-box .results-title {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.55;
	margin-bottom: 14px;
}
.calc-box .result-main { display: flex; align-items: baseline; gap: 10px; }
.calc-box .result-number { font-size: 46px; font-weight: 600; line-height: 1; }
.calc-box .result-unit   { font-size: 16px; opacity: 0.6; }
.calc-box .result-label  { font-size: 14px; opacity: 0.6; margin-top: 6px; }

.calc-box .result-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 12px;
	margin-top: 22px;
}
.calc-box .result-card {
	background: rgba(255, 255, 255, 0.07);
	border-radius: var(--mbm-radius-sm);
	padding: 14px;
}
.calc-box .result-card-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.55; }
.calc-box .result-card-val   { font-size: 20px; font-weight: 600; margin-top: 5px; font-variant-numeric: tabular-nums; }
.calc-box .result-card-sub   { font-size: 12px; opacity: 0.55; margin-top: 2px; }

/* ── Reference tables ── */
.mbm-ref-table th { text-align: left; }
.mbm-ref-table tbody tr:hover { background: var(--bg-card, rgba(0, 0, 0, 0.02)); }

/* ── FAQ accordions (markup lives in page content) ── */
.faq-q {
	display: block;
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	border-bottom: 1px solid var(--border, #e4e0d8);
	padding: 16px 32px 16px 0;
	font-size: 15px;
	font-weight: 500;
	font-family: inherit;
	color: var(--text, #1a1a2e);
	cursor: pointer;
	position: relative;
}
.faq-q::after {
	content: '+';
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 20px;
	font-weight: 400;
	color: var(--accent, #e8563a);
}
.faq-q.open::after { content: '\2013'; }
.faq-a { display: none; padding: 4px 0 20px; }
.faq-a.open { display: block; }
.faq-a p { font-size: 15px; line-height: 1.7; color: var(--text-muted, #5a5a6e); margin: 0; }

@media (max-width: 600px) {
	.calc-box { padding: 20px 18px; }
	.calc-box .result-number { font-size: 38px; }
}
