.my-atoms-wrapper,
.my-atoms-wrapper *,
.my-atoms-wrapper *::before,
.my-atoms-wrapper *::after {
	box-sizing: border-box;
}

.my-atoms-wrapper {
	--my-atoms-available: #0068D7;
	--my-atoms-contact: #4BB175;
	--my-atoms-not-available: #AAAAAA;
	--my-atoms-text: #1a1a1a;
	font-family: inherit;
	max-width: 100%;
	display: block;
}

/* Tablet and desktop: table on the left, form on the right */
@media (min-width: 782px) {
	.my-atoms-wrapper {
		display: grid;
		grid-template-columns: 1fr 320px;
		gap: 28px;
		align-items: start;
	}
}

@media (min-width: 1000px) {
	.my-atoms-wrapper {
		grid-template-columns: 1fr 360px;
	}
}

.my-atoms-table-col {
	min-width: 0; /* allow the column to shrink below the grid's intrinsic width */
	overflow-x: auto;
}

.my-atoms-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 16px;
	font-size: 14px;
}

.my-atoms-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.my-atoms-legend-dot {
	width: 12px;
	height: 12px;
	border-radius: 3px;
	display: inline-block;
}

.my-atoms-legend-item.my-atoms-cat-available .my-atoms-legend-dot { background: var(--my-atoms-available); }
.my-atoms-legend-item.my-atoms-cat-contact .my-atoms-legend-dot { background: var(--my-atoms-contact); }
.my-atoms-legend-item.my-atoms-cat-not_available .my-atoms-legend-dot { background: var(--my-atoms-not-available); }

.my-atoms-grid {
	display: grid;
	grid-template-columns: repeat(18, minmax(46px, 1fr));
	grid-auto-rows: minmax(46px, 1fr);
	gap: 4px;
	min-width: 900px;
}

.my-atoms-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border-radius: 0;
	clip-path: polygon( 0 0, 100% 0, 100% calc(100% - 25px), calc(100% - 25px) 100%, 0 100% );
	padding: 4px 2px;
	color: #fff;
	cursor: pointer;
	overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
	outline: none;
}

.my-atoms-tile.my-atoms-cat-available { background: var(--my-atoms-available); }
.my-atoms-tile.my-atoms-cat-contact { background: var(--my-atoms-contact); }
.my-atoms-tile.my-atoms-cat-not_available { background: var(--my-atoms-not-available); }

.my-atoms-tile:hover,
.my-atoms-tile:focus-visible {
	transform: translateY(-3px) scale(1.05);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
	z-index: 2;
}

.my-atoms-number {
	position: absolute;
	top: 3px;
	left: 5px;
	font-size: 9px;
	opacity: 0.85;
	line-height: 1;
}

.my-atoms-symbol {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.1;
}

.my-atoms-name {
	font-size: 8px;
	line-height: 1.1;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.my-atoms-request-icon {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.55);
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
	cursor: pointer;
	padding: 4px;
}

.my-atoms-tile:hover .my-atoms-request-icon,
.my-atoms-tile:focus-visible .my-atoms-request-icon {
	opacity: 1;
	pointer-events: auto;
}

.my-atoms-request-tooltip {
	position: absolute;
	bottom: 2px;
	left: 2px;
	right: 2px;
	font-size: 7px;
	line-height: 1.1;
	text-align: center;
}

.my-atoms-tile.my-atoms-group-header {
	background: #fff;
	border: 2px solid #7a2e5c;
	color: #7a2e5c;
	cursor: default;
	justify-content: center;
}

.my-atoms-tile.my-atoms-group-header:hover {
	transform: none;
	box-shadow: none;
}

.my-atoms-group-header-label {
	font-size: 7px;
	font-weight: 700;
	text-align: center;
	line-height: 1.2;
	padding: 0 2px;
}

.my-atoms-special-row {
	margin-top: 20px;
	display: flex;
	align-items: flex-start;
	gap: 14px;
	flex-wrap: wrap;
}

.my-atoms-special-row-label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	border: 2px solid #7a2e5c;
	color: #7a2e5c;
	padding: 8px 10px;
	border-radius: 6px;
	flex-shrink: 0;
	align-self: center;
}

.my-atoms-special-items {
	display: grid;
	grid-template-columns: repeat(auto-fill, 64px);
	grid-auto-rows: 64px;
	gap: 6px;
	flex: 1 1 auto;
}

.my-atoms-tile-special {
	width: 100%;
	height: 100%;
}

.my-atoms-formula sub {
	font-size: 0.65em;
}

/* Form section */
.my-atoms-form-section {
	margin-top: 32px;
	padding: 24px;
	border-radius: 8px;
	background: #f7f7f7;
	max-width: 560px;
	transition: box-shadow 0.3s ease;
}

.my-atoms-form-section.my-atoms-flash {
	box-shadow: 0 0 0 3px var(--my-atoms-available);
}

@media (min-width: 782px) {
	.my-atoms-form-section {
		margin-top: 0;
		max-width: none;
		position: sticky;
		top: 20px;
	}
}

.my-atoms-selected-element {
	font-weight: 600;
	min-height: 1.4em;
}

.my-atoms-selected-element:empty::before {
	content: attr(data-placeholder);
	font-weight: 400;
	color: #777;
}

.my-atoms-form-row {
	margin-bottom: 14px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.my-atoms-form-row label {
	font-size: 13px;
	font-weight: 600;
}

.my-atoms-form-row input {
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
}

.my-atoms-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.my-atoms-submit {
	background: #1a1a1a;
	color: #fff;
	border: none;
	padding: 10px 22px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
}

.my-atoms-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.my-atoms-form-feedback {
	margin-top: 10px;
	font-size: 13px;
}

.my-atoms-form-feedback.is-success { color: #2e7d32; }
.my-atoms-form-feedback.is-error { color: #c62828; }

/* Responsive: below 700px, switch to a horizontally scrollable table with larger touch targets */
@media (max-width: 700px) {
	.my-atoms-grid {
		grid-template-columns: repeat(18, minmax(40px, 1fr));
	}
	.my-atoms-symbol { font-size: 16px; }
	.my-atoms-name { font-size: 6.5px; }
}
