.rebar-page {
	--rebar-ink: #14231e;
	--rebar-muted: #5c6d65;
	--rebar-line: #d9e5df;
	--rebar-soft: #f4f8f6;
	--rebar-green: #0b7d58;
	--rebar-green-dark: #075d42;
	color: var(--rebar-ink);
}

.rebar-calculator {
	padding-bottom: 72px;
}

.rebar-calculator *,
.rebar-calculator *::before,
.rebar-calculator *::after {
	box-sizing: border-box;
}

.rebar-intro-grid,
.rebar-workspace,
.rebar-actions {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}

.rebar-intro-grid {
	margin-bottom: 28px;
}

.rebar-workspace {
	grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr);
	align-items: start;
}

.rebar-scheme-card,
.rebar-form,
.rebar-result,
.rebar-actions,
.rebar-method {
	background: #fff;
	border: 1px solid var(--rebar-line);
	border-radius: 20px;
	box-shadow: 0 14px 38px rgb(17 55 42 / 7%);
}

.rebar-scheme-card {
	padding: 18px;
	margin: 0;
}

.rebar-scheme-card img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 14px;
}

.rebar-scheme-card figcaption {
	padding: 12px 8px 2px;
	color: var(--rebar-muted);
	font-size: .9rem;
	line-height: 1.55;
}

.rebar-eyebrow {
	margin: 0 0 8px;
	color: var(--rebar-green);
	font-size: .78rem;
	font-weight: 850;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.rebar-form,
.rebar-result {
	padding: 28px;
}

.rebar-form h2,
.rebar-result h2,
.rebar-actions h2,
.rebar-method h2 {
	margin: 0 0 14px;
	font-size: clamp(1.45rem, 3vw, 2rem);
	line-height: 1.15;
}

.rebar-form__heading {
	margin-bottom: 28px;
}

.rebar-form__heading p,
.rebar-result__heading p {
	margin-bottom: 0;
}

.rebar-form__heading > p:last-child,
.rebar-result__heading > p:last-child,
.rebar-form__details > p,
.rebar-method__note {
	color: var(--rebar-muted);
}

.rebar-form__group {
	padding: 0;
	margin: 0;
	border: 0;
}

.rebar-form__group + .rebar-form__group {
	padding-top: 28px;
	margin-top: 28px;
	border-top: 1px solid var(--rebar-line);
}

.rebar-form__group legend {
	padding: 0;
	margin: 0 0 18px;
	font-size: 1.12rem;
	font-weight: 850;
}

.rebar-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.rebar-mode-group {
	padding-top: 16px;
}

.rebar-mode-group[hidden] {
	display: none;
}

.rebar-field--wide {
	grid-column: 1 / -1;
}

.rebar-field > span {
	display: block;
	margin-bottom: 7px;
	color: #31423a;
	font-size: .9rem;
	font-weight: 750;
}

.rebar-field small {
	display: block;
	margin-top: 6px;
	color: #718078;
	font-size: .78rem;
	line-height: 1.4;
}

.rebar-field input,
.rebar-field select {
	width: 100%;
	min-height: 48px;
	padding: 10px 12px;
	color: var(--rebar-ink);
	font: inherit;
	font-variant-numeric: tabular-nums;
	background: #fff;
	border: 1px solid #b8c9c0;
	border-radius: 10px;
	box-shadow: 0 1px 2px rgb(16 40 32 / 4%);
}

.rebar-field input:focus,
.rebar-field select:focus {
	border-color: var(--rebar-green);
	outline: 0;
	box-shadow: 0 0 0 4px rgb(11 125 88 / 14%);
}

.rebar-form__details {
	padding: 18px;
	margin-top: 28px;
	background: var(--rebar-soft);
	border: 1px solid var(--rebar-line);
	border-radius: 14px;
}

.rebar-form__details summary {
	font-weight: 800;
	cursor: pointer;
}

.rebar-form__details[open] summary {
	margin-bottom: 10px;
}

.rebar-form__details > p {
	margin: 0 0 18px;
	font-size: .86rem;
	line-height: 1.5;
}

.rebar-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 54px;
	padding: 0 24px;
	margin-top: 28px;
	color: #fff;
	font: inherit;
	font-weight: 850;
	cursor: pointer;
	background: linear-gradient(135deg, #18a978, var(--rebar-green));
	border: 1px solid transparent;
	border-radius: 12px;
	box-shadow: 0 9px 20px rgb(11 125 88 / 24%);
	transition: transform .18s ease, box-shadow .18s ease;
}

.rebar-submit:hover,
.rebar-submit:focus-visible {
	color: #fff;
	box-shadow: 0 12px 26px rgb(11 125 88 / 30%);
	transform: translateY(-2px);
}

.rebar-result {
	position: sticky;
	top: 16px;
	overflow: hidden;
}

.rebar-result__summary {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 24px 0;
}

.rebar-result__summary > div {
	padding: 15px;
	background: var(--rebar-soft);
	border: 1px solid var(--rebar-line);
	border-radius: 12px;
}

.rebar-result__summary span,
.rebar-result__summary strong {
	display: block;
}

.rebar-result__summary span {
	margin-bottom: 7px;
	color: var(--rebar-muted);
	font-size: .78rem;
	font-weight: 700;
}

.rebar-result__summary strong {
	font-size: 1.25rem;
	font-variant-numeric: tabular-nums;
}

.rebar-result__summary .rebar-result__primary {
	color: #fff;
	background: var(--rebar-green);
	border-color: var(--rebar-green);
}

.rebar-result__primary span {
	color: #cdeee2;
}

.rebar-result__section {
	padding-top: 22px;
	margin-top: 22px;
	border-top: 1px solid var(--rebar-line);
}

.rebar-result__section h3 {
	margin: 0 0 12px;
	font-size: 1rem;
}

.rebar-result__section dl {
	margin: 0;
}

.rebar-result__section dl div {
	display: flex;
	justify-content: space-between;
	gap: 18px;
	padding: 9px 0;
	border-bottom: 1px dashed #dce6e1;
}

.rebar-result__section dt {
	color: var(--rebar-muted);
}

.rebar-result__section dd {
	margin: 0;
	font-weight: 800;
	text-align: right;
}

.rebar-result__note {
	padding: 15px;
	margin-top: 22px;
	color: #6a542c;
	font-size: .82rem;
	line-height: 1.5;
	background: #fff8e8;
	border: 1px solid #ead7a6;
	border-radius: 11px;
}

.rebar-actions {
	grid-template-columns: .9fr 1.1fr;
	padding: clamp(28px, 4vw, 44px);
	margin-top: 28px;
	color: #fff;
	background: #102820;
	border-color: #234b3e;
	border-radius: 24px;
	box-shadow: 0 20px 50px rgb(13 45 36 / 16%);
}

.rebar-actions h2 {
	color: #fff;
}

.rebar-actions .rebar-eyebrow {
	color: #69d5ab;
}

.rebar-actions__intro > p:last-child {
	margin-bottom: 0;
	color: #c9ddd4;
	line-height: 1.55;
}

.rebar-actions__buttons {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	align-content: start;
}

.rebar-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	padding: 12px 18px;
	color: #fff;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
	background: rgb(255 255 255 / 8%);
	border: 1px solid rgb(255 255 255 / 28%);
	border-radius: 12px;
}

.rebar-action:hover,
.rebar-action:focus-visible {
	color: #fff;
	background: rgb(255 255 255 / 16%);
}

.rebar-action--primary {
	background: #0d9566;
	border-color: #1eb77d;
}

.rebar-export {
	display: grid;
	grid-column: 1 / -1;
	gap: 7px;
}

.rebar-export label {
	color: #dceee6;
	font-size: .9rem;
	font-weight: 800;
}

.rebar-export > div {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 10px;
}

.rebar-export select {
	width: 100%;
	min-height: 52px;
	padding: 10px 14px;
	color: var(--rebar-ink);
	font: inherit;
	font-weight: 650;
	background: #fff;
	border: 1px solid transparent;
	border-radius: 12px;
}

#rebarCopyLink {
	grid-column: 1 / 2;
}

#rebarActionStatus {
	grid-column: 1 / -1;
	min-height: 1.3em;
	margin: 0;
	color: #9ee6c8;
	font-size: .85rem;
	font-weight: 700;
}

.rebar-method {
	padding: clamp(26px, 4vw, 40px);
	margin-top: 28px;
}

.rebar-method__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin: 24px 0 20px;
}

.rebar-method__grid > div {
	padding: 17px;
	background: var(--rebar-soft);
	border: 1px solid var(--rebar-line);
	border-radius: 13px;
}

.rebar-method__grid strong,
.rebar-method__grid span {
	display: block;
}

.rebar-method__grid strong {
	margin-bottom: 6px;
	color: var(--rebar-green-dark);
}

.rebar-method__grid span {
	color: var(--rebar-muted);
	font-size: .84rem;
	line-height: 1.45;
}

.rebar-method h3 {
	margin: 38px 0 16px;
}

.rebar-method__note {
	margin: 20px 0 0;
	line-height: 1.55;
}

.rebar-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--rebar-line);
	border-radius: 14px;
}

.rebar-table-wrap table {
	width: 100%;
	border-collapse: collapse;
}

.rebar-table-wrap th,
.rebar-table-wrap td {
	padding: 12px 15px;
	text-align: left;
	white-space: nowrap;
	border-bottom: 1px solid var(--rebar-line);
}

.rebar-table-wrap th {
	background: var(--rebar-soft);
}

.rebar-table-wrap tr:last-child td {
	border-bottom: 0;
}

@media (max-width: 900px) {
	.rebar-intro-grid,
	.rebar-workspace,
	.rebar-actions {
		grid-template-columns: 1fr;
	}

	.rebar-result {
		position: static;
	}

	.rebar-method__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.rebar-calculator {
		padding-bottom: 48px;
	}

	.rebar-form,
	.rebar-result,
	.rebar-actions,
	.rebar-method {
		padding: 20px;
		border-radius: 15px;
	}

	.rebar-scheme-card {
		padding: 12px;
		border-radius: 15px;
	}

	.rebar-fields,
	.rebar-result__summary,
	.rebar-actions__buttons,
	.rebar-method__grid {
		grid-template-columns: 1fr;
	}

	.rebar-export,
	#rebarCopyLink,
	.rebar-field--wide,
	#rebarActionStatus {
		grid-column: auto;
	}

	.rebar-export > div {
		grid-template-columns: 1fr;
	}

	.rebar-result__section dl div {
		align-items: flex-start;
		flex-direction: column;
		gap: 4px;
	}

	.rebar-result__section dd {
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rebar-calculator *,
	.rebar-calculator *::before,
	.rebar-calculator *::after {
		transition: none !important;
	}
}
