/* Graft Calculator v3 (3D) — styles */

.gc3-root {
	--gc3-bg: #eeeff2;
	--gc3-surface: #ffffff;
	--gc3-text: #223558;
	--gc3-muted: #5c5c5c;
	--gc3-accent: #d82b2b;
	--gc3-accent-soft: rgba(216, 43, 43, 0.25);
	--gc3-border: #dee2e6;
	--gc3-radius: 16px;

	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	font-family: 'Europa Default', 'EuropaDefault', system-ui, -apple-system, 'Segoe UI', sans-serif;
	color: var(--gc3-text);
}

.gc3-root *, .gc3-root *::before, .gc3-root *::after {
	box-sizing: border-box;
}

.gc3-layout {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 24px;
	align-items: stretch;
	background: var(--gc3-bg);
	padding: 24px;
	border-radius: calc(var(--gc3-radius) + 4px);
}

@media (max-width: 900px) {
	.gc3-layout {
		grid-template-columns: 1fr;
		gap: 20px;
		padding: 16px;
	}
}

/* 3D viewport */
.gc3-viewport {
	position: relative;
	background: linear-gradient(180deg, #f6f7fb 0%, #e4e6ee 100%);
	border-radius: var(--gc3-radius);
	overflow: hidden;
	min-height: 420px;
	aspect-ratio: 4 / 5;
	touch-action: none;
}

@media (max-width: 900px) {
	.gc3-viewport {
		aspect-ratio: 3 / 4;
		min-height: 360px;
	}
}

.gc3-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	cursor: grab;
}

.gc3-canvas.gc3-canvas--hover-zone {
	cursor: pointer;
}

.gc3-canvas:active {
	cursor: grabbing;
}

/* Loader */
.gc3-loader {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: rgba(246, 247, 251, 0.85);
	backdrop-filter: blur(2px);
	color: var(--gc3-text);
	font-size: 0.9rem;
	transition: opacity 0.3s ease;
	z-index: 3;
}

.gc3-loader.gc3-loader--hidden {
	opacity: 0;
	pointer-events: none;
}

.gc3-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--gc3-border);
	border-top-color: var(--gc3-accent);
	border-radius: 50%;
	animation: gc3-spin 0.9s linear infinite;
}

@keyframes gc3-spin {
	to { transform: rotate(360deg); }
}

/* View preset buttons */
.gc3-view-presets {
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 6px;
	padding: 6px;
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(4px);
	border-radius: 999px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	z-index: 2;
}

.gc3-view-btn {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--gc3-text);
	font-size: 0.8rem;
	font-weight: 500;
	padding: 6px 12px;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	font-family: inherit;
}

.gc3-view-btn:hover,
.gc3-view-btn:focus-visible {
	background: var(--gc3-accent);
	color: #fff;
	outline: none;
}

.gc3-view-btn.is-active {
	background: var(--gc3-text);
	color: #fff;
}

/* Fallback panel */
.gc3-fallback {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
	background: var(--gc3-surface);
	z-index: 4;
}

.gc3-fallback img {
	max-width: 100%;
	height: auto;
}

/* Sidebar: table + slider */
.gc3-sidebar {
	display: flex;
	flex-direction: column;
	gap: 18px;
	justify-content: center;
}

.gc3-form {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.gc3-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border-radius: var(--gc3-radius);
	overflow: hidden;
	background: var(--gc3-surface);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	font-size: 0.95rem;
}

.gc3-table th,
.gc3-table td {
	padding: 10px 12px;
	text-align: center;
	vertical-align: middle;
}

.gc3-th {
	background: var(--gc3-bg);
	color: var(--gc3-text);
	font-weight: 600;
	font-size: 0.85rem;
	text-transform: none;
}

.gc3-row:nth-child(odd) {
	background: #fafbfd;
}

.gc3-row.gc3-row-total {
	background: var(--gc3-bg);
	font-weight: 600;
}

.gc3-row.is-selected {
	background: rgba(216, 43, 43, 0.06);
}

.gc3-cell-label {
	text-align: left !important;
	font-weight: 500;
}

.gc3-cell-label label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	user-select: none;
}

.gc3-checkbox {
	accent-color: var(--gc3-accent);
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.gc3-zone-swatch {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--gc3-border);
	transition: background 0.15s ease;
}

.gc3-row.is-selected .gc3-zone-swatch {
	background: var(--gc3-accent);
}

.gc3-graft-input {
	width: 80px;
	max-width: 100%;
	text-align: center;
	border: 1px solid var(--gc3-border);
	border-radius: 8px;
	padding: 6px 4px;
	background: #fff;
	color: var(--gc3-text);
	font-family: inherit;
	font-size: 0.9rem;
}

.gc3-graft-input:read-only {
	background: #f7f8fa;
	color: var(--gc3-muted);
}

.gc3-cell-bold {
	font-weight: 600;
}

.gc3-cell-total {
	font-size: 1.35rem;
	color: var(--gc3-text);
}

.gc3-cell-total-hairs {
	color: var(--gc3-muted);
}

/* Slider */
.gc3-slider-block {
	background: var(--gc3-surface);
	padding: 14px 16px;
	border-radius: var(--gc3-radius);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.gc3-slider-label {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 0.9rem;
	font-weight: 600;
	margin-bottom: 8px;
}

.gc3-slider-hint {
	font-size: 0.75rem;
	color: var(--gc3-muted);
	font-weight: 400;
}

.gc3-slider-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.gc3-slider {
	flex: 1;
	appearance: none;
	-webkit-appearance: none;
	height: 6px;
	border-radius: 999px;
	background: var(--gc3-border);
	outline: none;
}

.gc3-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--gc3-accent);
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	cursor: pointer;
}

.gc3-slider::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--gc3-accent);
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	cursor: pointer;
}

.gc3-slider-value {
	font-weight: 700;
	font-size: 1.1rem;
	color: var(--gc3-text);
	min-width: 36px;
	text-align: right;
}

/* Zone-picker dev panel */
.gc3-pickzones {
	position: fixed;
	bottom: 12px;
	right: 12px;
	width: 320px;
	background: rgba(20, 22, 30, 0.92);
	color: #fff;
	padding: 14px;
	border-radius: 10px;
	font-size: 12px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	z-index: 10000;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.gc3-pickzones pre {
	max-height: 180px;
	overflow: auto;
	background: #0a0c12;
	padding: 8px;
	border-radius: 6px;
	font-size: 11px;
	margin: 8px 0 0;
	white-space: pre;
}

.gc3-pickzones button,
.gc3-pickzones select,
.gc3-pickzones input {
	font-family: inherit;
	font-size: 12px;
}

.gc3-pickzones button {
	background: var(--gc3-accent);
	color: #fff;
	border: 0;
	padding: 6px 10px;
	border-radius: 6px;
	cursor: pointer;
}
