/*
 * [kd_bbt_chart] styles. Builds on the shared .kdtc-calc design system.
 * Colors match the sample chart on the Basal Body Temperature page:
 * blue before the shift, amber after.
 */

.kdtc-bbt {
	--kdtc-bbt-pre: #3f6fb3;
	--kdtc-bbt-post: #c9811a;
	--kdtc-bbt-post-soft: #fffaf0;
	--kdtc-bbt-post-edge: #f0d9ab;
	max-width: 720px;
}

.kdtc-bbt__top {
	display: flex;
	flex-wrap: wrap;
	gap: 1em 1.5em;
	margin-bottom: 1.1em;
}

.kdtc-bbt__top .kdtc-field {
	margin-bottom: 0;
}

.kdtc-bbt__top .kdtc-field:last-child {
	flex: 1 1 200px;
}

.kdtc-bbt__opt {
	font-weight: 400;
	color: var(--kdtc-muted);
	font-size: 0.9em;
}

/* Entry form */
.kdtc-bbt__form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	align-items: flex-end;
	padding: 1em;
	background: var(--kdtc-panel-bg);
	border: 1px solid var(--kdtc-border);
	border-radius: var(--kdtc-radius-sm);
}

.kdtc-bbt__form .kdtc-field {
	margin-bottom: 0;
}

.kdtc-bbt__day {
	flex: 0 0 96px;
}

.kdtc-bbt__temp {
	flex: 1 1 140px;
}

.kdtc-bbt__add {
	flex: 0 0 auto;
}

/* Pin every button state so the theme's hover color can't take over. */
.kdtc-calc .kdtc-bbt__btn,
.kdtc-calc .kdtc-bbt__btn:hover,
.kdtc-calc .kdtc-bbt__btn:focus,
.kdtc-calc .kdtc-bbt__btn:active {
	font: inherit;
	font-weight: 700;
	font-size: 0.95em;
	line-height: 1.2;
	padding: 0.7em 1.2em;
	border: 1px solid var(--kdtc-accent);
	border-radius: var(--kdtc-radius-sm);
	background: var(--kdtc-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: none;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
}

.kdtc-calc .kdtc-bbt__btn:hover,
.kdtc-calc .kdtc-bbt__btn:focus {
	background: var(--kdtc-accent-dark);
	border-color: var(--kdtc-accent-dark);
}

.kdtc-calc .kdtc-bbt__btn:focus-visible {
	outline: 3px solid var(--kdtc-accent-soft);
	outline-offset: 1px;
}

.kdtc-calc .kdtc-bbt__btn--ghost,
.kdtc-calc .kdtc-bbt__btn--ghost:active {
	background: #fff;
	color: var(--kdtc-accent-dark);
}

.kdtc-calc .kdtc-bbt__btn--ghost:hover,
.kdtc-calc .kdtc-bbt__btn--ghost:focus {
	background: var(--kdtc-accent-soft);
	border-color: var(--kdtc-accent);
	color: var(--kdtc-accent-dark);
}

.kdtc-bbt__error {
	margin: 0.6em 0 0;
	font-size: 0.88em;
	color: var(--kdtc-danger-ink);
	background: var(--kdtc-danger-bg);
	border: 1px solid var(--kdtc-danger-border);
	border-radius: var(--kdtc-radius-sm);
	padding: 0.5em 0.8em;
}

.kdtc-bbt__error[hidden] {
	display: none !important;
}

/* Chart */
.kdtc-bbt__chartwrap {
	margin-top: 1.2em;
	border: 1px solid var(--kdtc-border);
	border-radius: var(--kdtc-radius-sm);
	background: #fff;
	min-height: 120px;
	position: relative;
}

.kdtc-bbt__chart {
	width: 100%;
	line-height: 0;
}

.kdtc-bbt__svg {
	display: block;
	max-width: 100%;
	height: auto;
}

.kdtc-bbt__empty {
	margin: 0;
	padding: 2.4em 1em;
	text-align: center;
	color: var(--kdtc-muted);
	font-size: 0.92em;
}

.kdtc-bbt__empty[hidden] {
	display: none !important;
}

.kdtc-bbt__exnote {
	margin: 0.5em 0 0;
	font-size: 0.85em;
	color: var(--kdtc-warn-ink);
	background: var(--kdtc-warn-bg);
	border: 1px solid var(--kdtc-warn-border);
	border-radius: var(--kdtc-radius-sm);
	padding: 0.45em 0.8em;
}

.kdtc-bbt__exnote[hidden] {
	display: none !important;
}

.kdtc-bbt__grid {
	stroke: #e6ebf1;
	stroke-width: 1;
}

.kdtc-bbt__axis {
	stroke: #9aa6b5;
	stroke-width: 1;
}

.kdtc-bbt__tick {
	fill: #5b6472;
	font-size: 11px;
	font-family: var(--kdtc-font);
}

.kdtc-bbt__axislabel {
	fill: #5b6472;
	font-size: 11px;
	font-weight: 600;
	font-family: var(--kdtc-font);
}

.kdtc-bbt__cover {
	stroke: #6b7787;
	stroke-width: 1.5;
	stroke-dasharray: 6 4;
}

.kdtc-bbt__covertext {
	fill: #4b5563;
	font-size: 11px;
	font-weight: 600;
	font-family: var(--kdtc-font);
}

.kdtc-bbt__ov {
	stroke: var(--kdtc-bbt-post);
	stroke-width: 1.5;
	stroke-dasharray: 4 4;
}

.kdtc-bbt__ovtext {
	fill: #8a5a10;
	font-size: 11px;
	font-weight: 700;
	font-family: var(--kdtc-font);
}

.kdtc-bbt__seg {
	stroke-width: 2.25;
	stroke-linecap: round;
	fill: none;
}

.kdtc-bbt__seg--pre {
	stroke: var(--kdtc-bbt-pre);
}

.kdtc-bbt__seg--post {
	stroke: var(--kdtc-bbt-post);
}

.kdtc-bbt__seg--gap {
	stroke-dasharray: 2 5;
	opacity: 0.7;
}

.kdtc-bbt__pt {
	stroke: #fff;
	stroke-width: 1.5;
}

.kdtc-bbt__pt--pre {
	fill: var(--kdtc-bbt-pre);
}

.kdtc-bbt__pt--post {
	fill: var(--kdtc-bbt-post);
}

.kdtc-bbt__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em 1.2em;
	margin-top: 0.6em;
	font-size: 0.82em;
	color: var(--kdtc-muted);
}

.kdtc-bbt__legend span {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
}

.kdtc-bbt__key {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
}

.kdtc-bbt__key--pre {
	background: var(--kdtc-bbt-pre);
}

.kdtc-bbt__key--post {
	background: var(--kdtc-bbt-post);
}

.kdtc-bbt__key--cover {
	width: 18px;
	height: 0;
	border-radius: 0;
	border-top: 2px dashed #6b7787;
}

/* Reading chips */
.kdtc-bbt__readings {
	margin-top: 1.2em;
}

.kdtc-bbt__readings[hidden] {
	display: none !important;
}

.kdtc-bbt__chips {
	list-style: none;
	margin: 0.2em 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
}

.kdtc-bbt__chip {
	display: inline-flex;
	align-items: stretch;
	margin: 0;
	padding: 0;
	border: 1px solid var(--kdtc-border);
	border-left: 3px solid var(--kdtc-bbt-pre);
	border-radius: 6px;
	background: #fff;
	overflow: hidden;
}

.kdtc-bbt__chip--post {
	border-left-color: var(--kdtc-bbt-post);
	background: var(--kdtc-bbt-post-soft);
	border-color: var(--kdtc-bbt-post-edge);
	border-left-color: var(--kdtc-bbt-post);
}

.kdtc-calc .kdtc-bbt__chipbtn,
.kdtc-calc .kdtc-bbt__chipbtn:hover,
.kdtc-calc .kdtc-bbt__chipbtn:focus,
.kdtc-calc .kdtc-bbt__chipx,
.kdtc-calc .kdtc-bbt__chipx:hover,
.kdtc-calc .kdtc-bbt__chipx:focus {
	font: inherit;
	font-size: 0.82em;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--kdtc-ink);
	cursor: pointer;
	text-transform: none;
	letter-spacing: normal;
}

.kdtc-calc .kdtc-bbt__chipbtn {
	padding: 0.4em 0.6em;
}

.kdtc-calc .kdtc-bbt__chipx {
	padding: 0.4em 0.55em;
	color: var(--kdtc-muted);
	font-size: 1em;
	line-height: 1;
	border-left: 1px solid var(--kdtc-border);
}

.kdtc-calc .kdtc-bbt__chipbtn:hover,
.kdtc-calc .kdtc-bbt__chipbtn:focus {
	background: var(--kdtc-accent-soft);
}

.kdtc-calc .kdtc-bbt__chipx:hover,
.kdtc-calc .kdtc-bbt__chipx:focus {
	background: var(--kdtc-danger-bg);
	color: var(--kdtc-danger-ink);
}

/* Results */
.kdtc-bbt__headline .kdtc-bbt__big {
	font-size: 1.3em;
	display: block;
}

.kdtc-bbt__stats {
	margin-top: 0.8em;
}

.kdtc-bbt__detail {
	margin-top: 0.8em;
}

.kdtc-bbt__actions {
	justify-content: space-between;
	flex-wrap: wrap;
}

.kdtc-bbt__privacy {
	margin: 0.8em 0 0;
	font-size: 0.8em;
	color: var(--kdtc-muted);
}

@media (max-width: 480px) {
	.kdtc-bbt__day {
		flex: 1 1 80px;
	}

	.kdtc-bbt__add {
		flex: 1 1 100%;
	}

	.kdtc-calc .kdtc-bbt__add .kdtc-bbt__btn {
		width: 100%;
	}
}
