/* driveway clearance calculator. Colours come from the theme's Flexoki variables. */

.dc {
	--dc-gap: 0.75rem;
	font-variant-numeric: tabular-nums;
}

.dc fieldset {
	border: 1px solid var(--bg2);
	border-radius: 4px;
	padding: var(--dc-gap) 1rem 1rem;
	margin: 0 0 1rem;
}

.dc legend {
	padding: 0 0.4rem;
	font-weight: bold;
}

.dc-car {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
	gap: var(--dc-gap) 1.25rem;
	margin-top: var(--dc-gap);
}

.dc label {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	font-size: 0.92em;
}

.dc input[type='number'],
.dc select {
	font: inherit;
	color: var(--fg);
	background: var(--bg);
	border: 1px solid var(--bg3);
	border-radius: 3px;
	padding: 0.25rem 0.4rem;
	max-width: 100%;
	box-sizing: border-box;
}

.dc-car input {
	width: 100%;
}

.dc-car label {
	min-width: 0;
}

.dc input:focus-visible,
.dc select:focus-visible,
.dc button:focus-visible,
.dc canvas:focus-visible {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

.dc button {
	font: inherit;
	color: var(--fg);
	background: var(--bg1);
	border: 1px solid var(--bg3);
	border-radius: 3px;
	padding: 0.2rem 0.7rem;
	cursor: pointer;
}

.dc button:hover {
	border-color: var(--blue);
}

.dc-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
}

.dc-note {
	color: var(--fg3);
	font-size: 0.88em;
	margin: 0.5rem 0 0;
}

.dc-error {
	color: var(--red);
	min-height: 1.2em;
	margin: 0;
}

.dc-headline {
	font-size: 1.15em;
	font-weight: bold;
	margin: 0 0 0.5rem;
}

.dc-results {
	width: 100%;
	border-collapse: collapse;
}

.dc-results th,
.dc-results td {
	text-align: left;
	vertical-align: top;
	padding: 0.4rem 0.6rem 0.4rem 0;
	border-top: 1px solid var(--bg2);
}

.dc-sub {
	display: block;
	font-weight: normal;
	color: var(--fg3);
	font-size: 0.85em;
}

.dc-badge {
	display: inline-grid;
	place-items: center;
	width: 1.3em;
	height: 1.3em;
	border-radius: 50%;
	font-size: 0.85em;
	font-weight: bold;
	color: var(--bg);
}

.dc-clear .dc-badge {
	background: var(--green);
}

.dc-tight .dc-badge {
	background: var(--yellow);
}

.dc-scrape .dc-badge {
	background: var(--red);
}

.dc-scene,
.dc-chart {
	display: block;
	width: 100%;
	border: 1px solid var(--bg2);
	border-radius: 4px;
	touch-action: pan-y;
}

.dc-scene {
	height: clamp(220px, 42vw, 340px);
	margin: 0.75rem 0 0.5rem;
}

.dc-chart-wrap {
	position: relative;
	margin-top: 0.5rem;
}

.dc-chart {
	height: 200px;
	cursor: crosshair;
}

.dc-tip {
	position: absolute;
	pointer-events: none;
	background: var(--bg);
	border: 1px solid var(--bg3);
	border-radius: 4px;
	padding: 0.35rem 0.5rem;
	font-size: 0.82em;
	line-height: 1.4;
	white-space: nowrap;
}

.dc-tip span {
	display: block;
}

.dc-key {
	display: inline-block;
	width: 1.2em;
	height: 0;
	margin-right: 0.35em;
	vertical-align: middle;
	border-top: 2px solid #205ea6;
}

.dc-key-tail-in {
	border-top: 2px dashed #bc5215;
}

.darkmode .dc-key {
	border-top-color: #4385be;
}

.darkmode .dc-key-tail-in {
	border-top-color: #da702c;
}

.dc-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	font-size: 0.88em;
	color: var(--fg2);
}

.dc input[type='range'] {
	flex: 1 1 14rem;
	accent-color: var(--blue);
}

.dc-profile {
	border-collapse: collapse;
	margin: 0.5rem 0;
}

.dc-profile th,
.dc-profile td {
	padding: 0.15rem 0.4rem;
	text-align: left;
	font-size: 0.9em;
}

.dc-profile input[type='number'] {
	width: 7rem;
}

.dc-profile-scroll {
	max-height: 22rem;
	overflow: auto;
}

.dc details > summary {
	cursor: pointer;
	font-weight: bold;
}

.dc fieldset.dc-orient {
	border: 0;
	padding: 0;
	margin: 0;
}

.dc-orient legend {
	padding: 0;
	float: left;
	margin-right: 0.25rem;
}

.dc-orient label {
	flex-direction: row;
	align-items: center;
}

.dc-share {
	margin-top: 1rem;
}

.dc-results button {
	white-space: nowrap;
}

.dc fieldset {
	min-width: 0;
}
