x* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Courier New', monospace;
	min-height: 100vh;
	position: relative;
	overflow-x: hidden;
}

/* Pixelated Background Canvas */
#pixel-background {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	position: relative;
	z-index: 1;
}

/* Pixel-themed Typography */
.pixel-title {
	font-family: 'Courier New', monospace;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 2px;
	text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.pixel-subtitle {
	font-family: 'Courier New', monospace;
	font-weight: bold;
	text-transform: uppercase;
}

/* Landing Page */
.landing-page {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.landing-content {
	background: rgba(255, 255, 255, 0.95);
	border-radius: 0;
	padding: 40px;
	text-align: center;
	max-width: 800px;
	margin: 20px;
	box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.3);
	border: 4px solid #000;
}

.landing-content h1 {
	font-size: 3em;
	margin-bottom: 10px;
	color: #000;
}

.landing-subtitle {
	font-size: 1.2em;
	color: #333;
	margin-bottom: 30px;
}

.landing-emulator {
	background: #1a1a1a;
	padding: 30px;
	margin: 30px auto;
	display: flex;
	justify-content: center;
	border: 4px solid #000;
	box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.token-form {
	margin: 30px auto;
	max-width: 500px;
}

.token-form h3 {
	font-size: 1.5em;
	margin-bottom: 20px;
	color: #000;
}

.token-form form {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.token-form input[type="password"] {
	padding: 15px;
	font-size: 1em;
	border: 3px solid #000;
	background: #fff;
	font-family: 'Courier New', monospace;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
}

.token-form input[type="password"]:focus {
	outline: none;
	box-shadow: 4px 4px 0px rgba(0, 255, 170, 0.5);
	border-color: #00FFAA;
}

.token-help {
	font-size: 0.9em;
	color: #666;
	margin-top: 10px;
}

.token-help a {
	color: #00FFAA;
	text-decoration: none;
	font-weight: bold;
}

.token-help a:hover {
	text-decoration: underline;
}

.landing-buttons {
	display: flex;
	gap: 20px;
	justify-content: center;
	margin-top: 30px;
	flex-wrap: wrap;
}

/* About Section */
.about-section {
	background: rgba(255, 255, 255, 0.95);
	border: 4px solid #000;
	box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.3);
	padding: 40px;
	margin: 40px 20px;
	max-width: 800px;
}

.about-section h2 {
	font-size: 2em;
	margin-bottom: 20px;
	text-align: center;
	color: #000;
}

.about-section > p {
	font-size: 1.1em;
	line-height: 1.6;
	margin-bottom: 30px;
	text-align: center;
}

.features {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin: 30px 0;
}

.feature-card {
	background: #f0f0f0;
	border: 3px solid #000;
	padding: 20px;
	text-align: center;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.feature-icon {
	font-size: 3em;
	margin-bottom: 10px;
}

.feature-icon-canvas {
	margin: 0 auto 10px;
	display: block;
	image-rendering: pixelated;
	image-rendering: -moz-crisp-edges;
	image-rendering: crisp-edges;
	border: 2px solid #000;
	background: white;
}

.feature-card h3 {
	font-size: 1.3em;
	margin-bottom: 10px;
	text-transform: uppercase;
}

.feature-card p {
	font-size: 0.9em;
	line-height: 1.4;
}

/* Main App */
.main-app {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - 40px);
	background: white;
	box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.3);
	border: 4px solid #000;
	margin: 20px;
	overflow: hidden;
}

.main-app.hidden {
	display: none;
}

header {
	background: #000;
	color: white;
	padding: 30px;
	text-align: center;
	border-bottom: 4px solid #333;
}

header h1 {
	font-size: 2em;
	margin-bottom: 5px;
}

header p {
	opacity: 0.9;
	font-size: 0.9em;
}

.tabs {
	display: flex;
	background: #f0f0f0;
	border-bottom: 4px solid #000;
}

.tab {
	flex: 1;
	padding: 15px;
	background: #e0e0e0;
	border: none;
	border-right: 2px solid #000;
	cursor: pointer;
	font-size: 1em;
	font-weight: bold;
	font-family: 'Courier New', monospace;
	text-transform: uppercase;
	color: #666;
	transition: all 0.1s;
}

.tab:last-child {
	border-right: none;
}

.tab.active {
	color: #000;
	background: white;
	border-bottom: 4px solid #000;
	margin-bottom: -4px;
}

.tab:hover {
	background: white;
}

.tab-content {
	display: none;
	padding: 30px;
}

.tab-content.active {
	display: block;
}

/* App Footer */
.app-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 15px 30px;
	background: #2a2a2a;
	border-top: 4px solid #000;
	margin-top: auto;
}

.footer-left {
	display: flex;
	align-items: center;
	gap: 20px;
}

.footer-version {
	color: #888;
	font-family: 'Courier New', monospace;
	font-size: 0.85em;
}

.footer-link {
	color: #00FFAA;
	text-decoration: none;
	font-family: 'Courier New', monospace;
	font-size: 0.85em;
	font-weight: bold;
	transition: all 0.2s;
}

.footer-link:hover {
	color: #00cc88;
	text-decoration: underline;
}

.footer-separator {
	color: #666;
	font-family: 'Courier New', monospace;
	font-size: 0.85em;
}

.footer-right {
	display: flex;
}

.btn-logout-footer {
	padding: 8px 16px;
	background: #FF0088;
	color: white;
	border: 3px solid #000;
	font-family: 'Courier New', monospace;
	font-weight: bold;
	font-size: 0.85em;
	cursor: pointer;
	box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
	transition: all 0.1s;
}

.btn-logout-footer:hover {
	background: #dd0077;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
	transform: translate(1px, 1px);
}

.btn-logout-footer:active {
	background: #bb0066;
	box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
	transform: translate(2px, 2px);
}

.emulator-wrapper {
	background: #1a1a1a;
	padding: 20px;
	display: flex;
	justify-content: center;
	margin-bottom: 30px;
	border: 4px solid #000;
	box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.matrix-container {
	display: inline-block;
}

.preview-form {
	background: #f0f0f0;
	padding: 25px;
	border: 3px solid #000;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.preview-form h3 {
	margin-bottom: 20px;
	color: #000;
	text-transform: uppercase;
	font-family: 'Courier New', monospace;
}

.form-group {
	margin-bottom: 20px;
	position: relative;
}

.form-group label {
	display: block;
	margin-bottom: 8px;
	font-weight: bold;
	color: #000;
	text-transform: uppercase;
	font-size: 0.9em;
}

.form-group input,
.form-group select {
	width: 100%;
	padding: 12px;
	border: 3px solid #000;
	background: white;
	font-size: 1em;
	font-family: 'Courier New', monospace;
	transition: box-shadow 0.1s;
}

/* Override width for checkbox inputs inside checkbox-option labels */
.form-group label.checkbox-option input[type="checkbox"] {
	width: auto;
}

.form-group input:focus,
.form-group select:focus {
	outline: none;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.form-group small {
	display: block;
	margin-top: 5px;
	color: #666;
	font-size: 0.85em;
}

.char-count {
	position: absolute;
	right: 12px;
	top: 42px;
	font-size: 0.85em;
	color: #666;
	font-weight: bold;
}

.color-preview {
	width: 40px;
	height: 40px;
	margin-top: 10px;
	border: 3px solid #000;
	background: #00FFAA;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

/* Checkbox option styling (matches day-checkbox design) */
.form-group label.checkbox-option {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #e0e0e0;
	border: 2px solid #000;
	padding: 8px 12px;
	cursor: pointer;
	font-size: 0.9em;
	font-weight: bold;
	font-family: 'Courier New', monospace;
	transition: all 0.1s;
	user-select: none;
	text-transform: none;
	margin-bottom: 0;
}

.form-group label.checkbox-option:hover {
	background: #d0d0d0;
}

.form-group label.checkbox-option:has(input[type="checkbox"]:checked) {
	background: #00FF88;
	color: #000;
}

.form-group label.checkbox-option input[type="checkbox"] {
	margin: 0;
	cursor: pointer;
	flex-shrink: 0;
}

.form-group label.checkbox-option span {
	white-space: nowrap;
	flex: 0 1 auto;
}

/* Pixel-style Buttons */
.btn-pixel {
	padding: 12px 24px;
	border: 3px solid #000;
	font-size: 1em;
	font-weight: bold;
	font-family: 'Courier New', monospace;
	text-transform: uppercase;
	cursor: pointer;
	transition: all 0.1s;
	margin-right: 10px;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
	position: relative;
}

.btn-pixel:hover {
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
	transform: translate(2px, 2px);
}

.btn-pixel:active {
	box-shadow: none;
	transform: translate(4px, 4px);
}

.btn-pixel:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.btn-primary {
	background: #00FF88;
	color: #000;
}

.btn-secondary {
	background: #FF0088;
	color: white;
}

.btn-sm {
	padding: 6px 12px;
	font-size: 0.85em;
}

.status {
	position: fixed;
	bottom: 20px;
	right: 20px;
	padding: 15px 25px;
	border: 3px solid #000;
	font-weight: bold;
	font-family: 'Courier New', monospace;
	text-transform: uppercase;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
	animation: slideIn 0.2s;
	z-index: 1000;
}

.status.success {
	background: #00FF88;
	color: #000;
}

.status.error {
	background: #FF0088;
	color: white;
}

.hidden {
	display: none;
}

@keyframes slideIn {
	from {
		transform: translateX(400px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

/* Timeline Week View */
.timeline-view-controls {
	display: flex;
	gap: 10px;
	align-items: center;
}

.timeline-week-view {
	border: 2px solid #000;
	background: white;
	padding: 10px;
	min-height: 400px;
	overflow-x: auto;
	overflow-y: hidden;
}

.week-grid {
	display: grid;
	grid-template-columns: repeat(7, 132px);
	gap: 10px;
	height: 100%;
}

.week-day-column {
	border: 2px solid #000;
	background: #f9f9f9;
	padding: 5px;
	min-height: 350px;
	display: flex;
	flex-direction: column;
}

.week-day-header {
	background: #000;
	color: white;
	padding: 8px 4px;
	text-align: center;
	font-weight: bold;
	font-size: 0.9em;
	margin-bottom: 5px;
	border: 2px solid #000;
}

.week-day-header.today {
	background: #00FFAA;
	color: #000;
}

.week-day-items {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.week-item {
	background: white;
	border: 2px solid #000;
	padding: 6px;
	font-size: 0.75em;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	transition: all 0.1s;
}

.week-item:hover {
	background: #e0f0ff;
	box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3);
}

.week-item-name {
	font-weight: bold;
	margin-bottom: 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.week-item-time {
	color: #666;
	font-size: 0.9em;
}

.week-item.disabled {
	opacity: 0.5;
	background: #e0e0e0;
}

/* Hide mobile edit panel on desktop */
.mobile-edit-panel {
	display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
	.landing-content {
		padding: 30px 20px;
		margin: 10px;
	}

	.landing-content h1 {
		font-size: 2em;
	}

	.landing-subtitle {
		font-size: 1em;
	}

	.about-section {
		padding: 30px 20px;
		margin: 20px 10px;
	}

	.main-app {
		margin: 5px;
		border-width: 2px;
	}

	header {
		padding: 20px;
	}

	.tab-content {
		padding: 20px;
	}

	.emulator-wrapper {
		padding: 15px;
	}

	.landing-buttons {
		flex-direction: column;
	}

	.btn-pixel {
		width: 100%;
		margin-right: 0;
		margin-bottom: 10px;
	}
}

/* Scale matrix emulator for mobile */
@media (max-width: 600px) {
	.matrix-container canvas {
		max-width: 100%;
		height: auto;
		width: auto !important;
	}
}

/* ============================================
   EVENTS MANAGEMENT STYLES
   ============================================ */

.event-editor {
	background: #f0f0f0;
	border: 3px solid #000;
	padding: 25px;
	margin-bottom: 30px;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.event-editor h3 {
	margin-bottom: 20px;
	text-transform: uppercase;
	font-family: 'Courier New', monospace;
}

.event-form-container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
}

.event-form {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.event-preview-container {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.event-preview-container h4 {
	margin-bottom: 15px;
	text-transform: uppercase;
	font-family: 'Courier New', monospace;
}

.event-emulator {
	margin: 0;
	padding: 20px;
}

.preview-hint {
	margin-top: 10px;
	font-size: 0.9em;
	color: #666;
	text-align: center;
}

.time-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	padding: 15px;
	background: #e0e0e0;
	border: 2px solid #000;
	margin-top: 10px;
}

.time-fields .form-group {
	margin-bottom: 0;
}

.time-fields input[type="number"] {
	max-width: 120px;
}

.form-actions {
	display: flex;
	gap: 10px;
	margin-top: 10px;
}

.form-actions .btn-pixel {
	flex: 1;
	margin: 0;
}

/* Event List Section */
.event-list-section {
	background: #f0f0f0;
	border: 3px solid #000;
	padding: 25px;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.event-list-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 15px;
}

.event-list-header h3 {
	text-transform: uppercase;
	font-family: 'Courier New', monospace;
}

.list-actions {
	display: flex;
	gap: 10px;
	margin-bottom: 15px;
}

/* Event Filters */
.event-filters {
	background: white;
	border: 3px solid #000;
	padding: 20px;
	margin-bottom: 20px;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.filter-row {
	display: flex;
	gap: 10px;
	margin-bottom: 15px;
	flex-wrap: wrap;
	align-items: stretch;
}

.filter-search {
	flex: 0 1 300px;
	min-width: 200px;
	max-width: 400px;
}

.filter-search input {
	width: 100%;
	padding: 12px;
	background: white;
	border: 3px solid #000;
	font-family: 'Courier New', monospace;
	font-size: 1em;
	transition: box-shadow 0.1s;
	height: 46px;
	box-sizing: border-box;
}

.filter-search input:focus {
	outline: none;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.filter-search input::placeholder {
	color: #999;
}

.filter-controls {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.filter-controls select {
	padding: 12px;
	background: white;
	border: 3px solid #000;
	font-family: 'Courier New', monospace;
	font-size: 1em;
	cursor: pointer;
	min-width: 180px;
	transition: box-shadow 0.1s;
	height: 46px;
	box-sizing: border-box;
}

.filter-controls select:focus {
	outline: none;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.filter-controls select option {
	background: white;
	color: #000;
}

.filter-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 14px;
	color: #666;
	margin-top: 5px;
}

.btn-text {
	background: none;
	border: none;
	color: #00FFAA;
	cursor: pointer;
	font-family: 'Courier New', monospace;
	font-size: 14px;
	text-decoration: underline;
	padding: 0;
	transition: color 0.1s;
}

.btn-text:hover {
	color: #00CC88;
}

/* Mobile optimizations for filters */
@media (max-width: 768px) {
	.event-filters {
		padding: 15px;
	}

	.filter-row {
		flex-direction: column;
		gap: 10px;
	}

	.filter-search {
		min-width: 100%;
		max-width: none;
		flex: 1;
	}

	.filter-search input {
		font-size: 16px;
		padding: 12px;
		height: 48px;
	}

	.filter-controls {
		width: 100%;
		flex-direction: column;
	}

	.filter-controls select {
		width: 100%;
		min-width: 0;
		font-size: 16px;
		padding: 12px;
		height: 48px;
	}

	.filter-info {
		flex-direction: column;
		align-items: flex-start;
		gap: 5px;
	}
}

.info-message {
	background: #e0e0e0;
	border: 3px solid #000;
	padding: 20px;
	margin-top: 20px;
	text-align: center;
	font-weight: bold;
}

.events-list {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.event-card {
	background: white;
	border: 3px solid #000;
	padding: 20px;
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 20px;
	align-items: center;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
	margin-bottom: 15px;
	contain: layout style;
}

.event-card:hover {
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.event-card.past-event {
	opacity: 0.6;
	background: #f5f5f5;
}

.event-date-badge {
	background: #000;
	color: white;
	padding: 15px;
	text-align: center;
	min-width: 80px;
	font-family: 'Courier New', monospace;
	font-weight: bold;
}

.event-date-badge .month {
	font-size: 0.8em;
	display: block;
}

.event-date-badge .day {
	font-size: 2em;
	display: block;
}

.event-date-badge .year {
	font-size: 0.8em;
	display: block;
}

.event-info {
	flex: 1;
}

.event-info h4 {
	font-size: 1.2em;
	margin-bottom: 5px;
	font-family: 'Courier New', monospace;
	text-transform: uppercase;
}

.event-info p {
	color: #666;
	margin: 3px 0;
	font-size: 0.95em;
}

.event-info .event-time {
	font-weight: bold;
	color: #000;
}

.event-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.event-actions .btn-pixel {
	margin: 0;
	padding: 8px 16px;
	font-size: 0.9em;
	white-space: nowrap;
}

/* Modal Styles */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2000;
	padding: 20px;
}

.modal.hidden {
	display: none;
}

.modal-content {
	background: white;
	border: 4px solid #000;
	box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.5);
	max-width: 900px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
}

.modal-header {
	background: #000;
	color: white;
	padding: 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 4px solid #000;
}

.modal-header h3 {
	margin: 0;
	text-transform: uppercase;
	font-family: 'Courier New', monospace;
}

.modal-close {
	background: none;
	border: none;
	color: white;
	font-size: 2em;
	cursor: pointer;
	padding: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-close:hover {
	background: rgba(255, 255, 255, 0.1);
}

.modal-body {
	padding: 30px;
}

/* Responsive Design for Events */
@media (max-width: 768px) {
	/* Reduce padding on mobile to prevent overflow */
	#add-event-tab.tab-content {
		padding: 10px;
		box-sizing: border-box;
	}

	.event-editor {
		padding: 10px;
		border-width: 2px;
		box-sizing: border-box;
	}

	.event-form-container {
		display: block;
		box-sizing: border-box;
	}

	.event-form {
		box-sizing: border-box;
		width: 100%;
	}

	.time-fields {
		display: block;
		padding: 8px;
		border-width: 2px;
		box-sizing: border-box;
	}

	.time-fields .form-group {
		margin-bottom: 10px;
	}

	.time-fields .form-group:last-child {
		margin-bottom: 0;
	}

	/* Fix event editor input overflows - use token input approach */
	.event-form .form-group {
		margin-bottom: 15px;
		box-sizing: border-box;
		width: 100%;
	}

	.event-form input:not([type="checkbox"]),
	.event-form select {
		width: 100% !important;
		display: block !important;
		box-sizing: border-box !important;
		min-width: 0 !important;
		max-width: 100% !important;
		padding: 10px !important;
		border: 2px solid #000 !important;
		margin: 0 !important;
		font-size: 1em !important;
	}

	/* Date input wrapper for custom placeholder */
	.date-input-wrapper {
		position: relative;
		width: 100%;
	}

	/* Specific fix for date inputs on mobile */
	.event-form input[type="date"],
	#schedule-info-form input[type="date"] {
		-webkit-appearance: none;
		appearance: none;
		overflow: hidden;
		min-height: 48px;
		padding: 12px !important;
		font-size: 16px !important;
		line-height: 1.5;
		width: 100%;
		text-align: left !important;
		color: #000 !important;
	}

	/* Hide custom placeholder on mobile - use native picker instead */
	.date-placeholder {
		display: none !important;
	}

	.form-group input:not([type="checkbox"]),
	.form-group select {
		width: 100% !important;
		display: block !important;
		box-sizing: border-box !important;
		min-width: 0 !important;
		max-width: 100% !important;
		padding: 10px !important;
		border: 2px solid #000 !important;
	}

	/* Ensure checkboxes don't get full width */
	.event-form input[type="checkbox"],
	.form-group input[type="checkbox"] {
		width: auto !important;
		display: inline-block !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.time-fields input[type="number"] {
		width: 100% !important;
		display: block !important;
		box-sizing: border-box !important;
		min-width: 0 !important;
		max-width: 100% !important;
		padding: 8px !important;
		border: 2px solid #000 !important;
	}

	/* Split color and icon to two lines on mobile */
	.event-meta {
		display: flex;
		flex-direction: column;
		gap: 4px;
	}

	.event-separator {
		display: none;
	}

	.event-color,
	.event-icon {
		display: block;
	}

	.event-card {
		grid-template-columns: 1fr;
		padding: 15px;
	}

	.event-date-badge {
		justify-self: start;
		min-width: 60px;
		padding: 10px;
	}

	.event-date-badge .month {
		font-size: 0.7em;
	}

	.event-date-badge .day {
		font-size: 1.5em;
	}

	.event-date-badge .year {
		font-size: 0.7em;
	}

	.event-actions {
		flex-direction: row;
		gap: 10px;
		width: 100%;
	}

	.event-actions .btn-pixel {
		flex: 1;
		margin: 0;
		padding: 10px;
		font-size: 0.9em;
	}

	.list-actions {
		width: 100%;
		flex-direction: column;
	}

	.list-actions .btn-pixel {
		width: 100%;
	}
}

/* ============================================
   MOBILE PREVIEW STYLES
   ============================================ */

.mobile-text-preview {
	background: #1a1a1a;
	border: 4px solid #000;
	padding: 20px;
	text-align: center;
	min-height: 200px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.mobile-text-preview .preview-hint {
	font-size: 0.8em;
	color: #888;
	margin-bottom: 15px;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.mobile-text-preview .preview-image-container {
	background: #000;
	border: 2px solid #333;
	padding: 10px;
	margin-bottom: 15px;
	min-height: 100px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mobile-text-preview .preview-image-display {
	max-width: 100%;
	max-height: 100px;
	image-rendering: pixelated;
	image-rendering: -moz-crisp-edges;
	image-rendering: crisp-edges;
}

.mobile-text-preview .preview-image-placeholder {
	color: #555;
	font-size: 0.9em;
	font-style: italic;
}

.mobile-text-preview .preview-content {
	background: #000;
	padding: 15px;
	border: 2px solid #333;
}

.mobile-text-preview .preview-top-line {
	color: #FFFFFF;
	font-size: 1.1em;
	font-weight: bold;
	font-family: 'Courier New', monospace;
	margin-bottom: 8px;
}

.mobile-text-preview .preview-bottom-line {
	color: #00FFAA;
	font-size: 1.3em;
	font-weight: bold;
	font-family: 'Courier New', monospace;
	margin-bottom: 12px;
}

.mobile-text-preview .preview-meta {
	display: flex;
	justify-content: space-around;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #333;
	font-size: 0.8em;
	color: #888;
}

/* Hide mobile text preview on desktop */
@media (min-width: 769px) {
	.mobile-text-preview {
		display: none !important;
	}
}

.mobile-preview-btn {
	display: none !important;
}

/* Mobile optimizations for event list scrolling */
@media (max-width: 768px) {
	.events-list {
		transform: translateZ(0);
		-webkit-transform: translateZ(0);
		will-change: scroll-position;
	}

	.event-card {
		contain: layout style paint;
		content-visibility: auto;
	}

	.event-info p {
		font-size: 0.85em;
	}

	.event-actions .btn-pixel {
		font-size: 0.85em;
		padding: 8px 12px;
	}

	.btn-pixel:hover {
		transform: none;
		box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
	}

	.btn-pixel:active {
		transform: translate(2px, 2px);
		box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
	}

	.emulator-wrapper canvas {
		display: none;
	}
}

/* ============================================
   SCHEDULE MANAGER STYLES
   ============================================ */

/* Schedule List */
.schedule-list-section {
	background: #f0f0f0;
	border: 3px solid #000;
	padding: 25px;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.schedules-list {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.schedule-card {
	background: white;
	border: 3px solid #000;
	padding: 15px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.schedule-card.past-schedule {
	opacity: 0.6;
	background: #f5f5f5;
}

.schedule-actions {
	display: flex;
	gap: 8px;
}

/* Schedule Editor Actions */
.schedule-editor .schedule-actions {
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 20px;
	padding: 20px;
	background: #f0f0f0;
	border-top: 3px solid #000;
}

.schedule-editor .schedule-actions .btn-pixel {
	flex: 1;
	margin: 0;
	min-width: 150px;
}
.schedule-editor {
	background: #f0f0f0;
	border: 3px solid #000;
	padding: 25px;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.editor-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 3px solid #000;
}

.schedule-editor-content {
	display: grid;
	gap: 20px;
}

.schedule-info-form {
	display: grid;
	gap: 15px;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Schedule Items Section */
.schedule-items-section {
	background: white;
	border: 3px solid #000;
	padding: 15px;
}

.section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
}

.schedule-items-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Schedule Item - Enhanced Layout */
.schedule-item {
	background: white;
	border: 3px solid #000;
	padding: 15px;
	margin-bottom: 15px;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.schedule-item-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	padding-bottom: 10px;
	border-bottom: 2px solid #e0e0e0;
}

.item-name-input {
	flex: 1;
	border: 2px solid #000;
	padding: 8px 12px;
	font-family: 'Courier New', monospace;
	font-size: 1em;
	font-weight: bold;
}

.item-enabled {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 0.9em;
	white-space: nowrap;
}

.schedule-item-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.schedule-item-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.item-label {
	font-weight: bold;
	min-width: 60px;
	font-size: 0.9em;
	text-transform: uppercase;
}

.schedule-item input[type="text"],
.schedule-item input[type="number"],
.schedule-item select {
	border: 2px solid #000;
	padding: 4px 8px;
	font-family: 'Courier New', monospace;
}

/* Day Checkboxes */
.day-checkboxes {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
}

.day-checkbox {
	background: #e0e0e0;
	border: 2px solid #000;
	padding: 6px 10px;
	cursor: pointer;
	font-size: 0.85em;
	font-weight: bold;
	font-family: 'Courier New', monospace;
	transition: all 0.1s;
	display: flex;
	align-items: center;
	gap: 5px;
}

.day-checkbox-sm {
	background: #e0e0e0;
	border: 2px solid #000;
	padding: 4px 6px;
	transition: all 0.1s;
}

.day-checkbox:hover, .day-checkbox-sm:hover {
	background: #d0d0d0;
}

.day-checkbox.checked, .day-checkbox-sm.checked {
	background: #00FF88;
	color: #000;
}

.day-checkbox input[type="checkbox"] {
	margin: 0;
	width: auto;
	flex-shrink: 0;
}

.day-badge {
	background: #000;
	color: white;
	padding: 6px 12px;
	font-weight: bold;
	font-family: 'Courier New', monospace;
	font-size: 0.9em;
	text-transform: uppercase;
}

.day-badge-placeholder {
	background: #ccc;
	color: #666;
	padding: 6px 12px;
	font-style: italic;
	font-family: 'Courier New', monospace;
	font-size: 0.9em;
}

/* Time Inputs */
.time-inputs {
	display: flex;
	align-items: center;
	gap: 5px;
	font-family: 'Courier New', monospace;
}

.time-input {
	width: 45px;
	border: 2px solid #000;
	padding: 4px 6px;
	font-family: 'Courier New', monospace;
	text-align: center;
}

.time-input-large {
	width: 60px !important;
	border: 2px solid #000;
	padding: 6px 8px;
	font-family: 'Courier New', monospace;
	text-align: center;
	font-size: 1em;
}

.time-input-long {
	width: 60px !important;
	border: 2px solid #000 !important;
	padding: 4px 6px !important;
	text-align: center;
}

.time-separator {
	font-weight: bold;
	padding: 0 5px;
}

.image-select {
	flex: 1;
	border: 2px solid #000;
	padding: 6px 10px;
	font-family: 'Courier New', monospace;
	min-width: 150px;
}

.image-select[value=""],
.image-select option[value=""]:checked {
	color: #999;
	font-style: italic;
}

.item-label {
	color: inherit;
}

.item-label::after {
	content: '';
}

/* Required field indicator (asterisk) */
.schedule-item-row .item-label:contains('*') {
	font-weight: normal;
}

.progress-label {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 0.9em;
	white-space: nowrap;
}

/* Timeline View */
.timeline-view-section {
	background: white;
	border: 3px solid #000;
	padding: 15px;
	overflow-x: auto;
}

.day-filter {
	margin-bottom: 15px;
	display: flex;
	gap: 10px;
	align-items: center;
}

.timeline-view {
	border: 2px solid #000;
	padding: 10px;
	background: #f9f9f9;
	max-height: 600px;
	overflow-y: auto;
}

.timeline-container {
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #f9f9f9;
}

.timeline-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
}

.timeline-date-display {
	background: #000;
	color: white;
	padding: 8px 16px;
	font-family: 'Courier New', monospace;
	font-weight: bold;
	border: 3px solid #000;
}

.timeline-date-display.hidden {
	display: none;
}

.timeline-item {
	background: white;
	border: 2px solid #000;
	padding: 5px 10px;
	cursor: pointer;
	transition: all 0.1s;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	flex-shrink: 0;
	overflow: hidden;
}

.timeline-item:hover {
	background: #e0f0ff;
	box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3);
}

.timeline-item.overlap {
	background: #ffe0e0;
	border-color: #ff0000;
}

.timeline-item.selected {
	background: #d4f4dd;
	border-color: #00FFAA;
	border-width: 3px;
	box-shadow: 3px 3px 0px rgba(0, 255, 170, 0.3);
}

.timeline-item-content {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: 'Courier New', monospace;
	overflow: hidden;
}

.timeline-item-time {
	color: #666;
	font-size: 0.85em;
	white-space: nowrap;
	flex-shrink: 0;
}

.timeline-item-name {
	font-weight: bold;
	font-size: 0.9em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1;
	min-width: 0;
}

.timeline-item-duration {
	color: #666;
	font-size: 0.85em;
	white-space: nowrap;
	flex-shrink: 0;
}

.overlap-warning {
	color: #ff0000;
	font-weight: bold;
	font-size: 0.8em;
	margin-top: 4px;
}

.timeline-gap {
	background: rgba(200, 200, 200, 0.2);
	border: 1px dashed #999;
	padding: 8px;
	text-align: center;
	font-size: 0.75em;
	color: #666;
	min-height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.timeline-gap-content {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
}

.gap-time {
	font-family: 'Courier New', monospace;
	font-weight: normal;
}

.gap-duration {
	font-family: 'Courier New', monospace;
	font-weight: bold;
	text-transform: uppercase;
}

#timeline-day-filter {
	margin-bottom: 15px;
	padding: 8px 12px;
	border: 3px solid #000;
	font-family: 'Courier New', monospace;
	font-weight: bold;
	font-size: 1em;
}

/* Timeline Edit Panel */
.timeline-edit-panel {
	background: white;
	border: 3px solid #000;
	padding: 8px;
	margin-top: 8px;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.timeline-edit-panel.hidden {
	display: none;
}

.edit-panel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 7px;
}

.edit-panel-header h5 {
	margin: 0;
	font-family: 'Press Start 2P', monospace;
	font-size: 0.75em;
}

.edit-panel-header label {
	margin: 0;
	font-family: 'Courier New', monospace;
	font-size: 0.8em;
}

.edit-panel-content {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.edit-panel-content .form-group {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.edit-panel-content {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-bottom: 0;
}

.form-group-small {
	display: flex;
	gap: 2px;
	margin-top: 10px;
	margin-bottom: 10px;
}

.edit-panel-content label {
	font-family: 'Courier New', monospace;
	font-weight: bold;
	font-size: 0.8em;
}

/* Checkbox labels should have normal weight */
.edit-panel-content label:has(input[type="checkbox"]) {
	font-weight: normal;
}

.edit-panel-content .form-input {
	padding: 4px;
	border: 2px solid #000;
	font-family: 'Courier New', monospace;
	font-size: 0.8em;
}

.days-checkboxes {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
}

.days-checkboxes label {
	display: flex;
	align-items: center;
	gap: 4px;
	font-weight: normal;
	cursor: pointer;
	font-size: 0.75em;
	background: #e0e0e0;
	border: 2px solid #000;
	padding: 4px 8px;
	transition: background 0.2s;
}

.days-checkboxes label:hover {
	background: #d0d0d0;
}

.days-checkboxes label.checked {
	background: #00FF88;
	color: #000;
}

.days-checkboxes input[type="checkbox"] {
	cursor: pointer;
	margin: 0;
}

.edit-time-inputs {
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: 'Courier New', monospace;
	font-size: 0.75em;
	width: 100%;
}

.edit-time-inputs .time-input {
	flex: 1;
	min-width: 0;
	padding: 4px;
	border: 2px solid #000;
	font-family: 'Courier New', monospace;
	font-size: 0.85em;
	text-align: center;
}

.edit-time-inputs span {
	color: #666;
	white-space: nowrap;
	flex-shrink: 0;
}


.btn-danger {
	background-color: #FF0088;
	color: white;
}

.btn-danger:hover {
	background-color: #CC0066;
}

/* Schedule Editor Layout - Side by Side */
.schedule-editor-layout {
	display: flex;
	gap: 20px;
	margin-top: 20px;
}

.schedule-editor-layout .timeline-view-section {
	flex: 0 0 45%;
	max-width: 45%;
	margin-top: 0;
	max-height: 760px;
	overflow-y: auto;
}

.schedule-editor-layout .schedule-preview-section {
	flex: 1;
	margin-top: 0;
	max-height: 760px;
	overflow-y: auto;
}

/* Hide preview section in week view */
.schedule-editor-layout.week-view-active .schedule-preview-section {
	display: none;
}

.schedule-editor-layout.week-view-active .timeline-view-section {
	flex: 1;
	max-width: 100%;
}

/* Schedule Preview */
.schedule-preview-section {
	background: white;
	border: 3px solid #000;
	padding: 20px;
	margin-top: 20px;
}

.schedule-preview-section h4 {
	margin-bottom: 15px;
	text-transform: uppercase;
	font-family: 'Courier New', monospace;
}

.schedule-preview-controls {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 15px;
	flex-wrap: wrap;
}

.schedule-preview-controls select {
	flex: 1;
	padding: 10px;
	border: 3px solid #000;
	font-family: 'Courier New', monospace;
	font-size: 1em;
	min-width: 150px;
}

.schedule-preview-controls input[type="range"] {
	flex: 2;
	min-width: 200px;
}

#preview-progress-value {
	font-weight: bold;
	font-family: 'Courier New', monospace;
	min-width: 40px;
}

.preview-note {
	font-size: 0.85em;
	color: #666;
	text-align: center;
	margin-bottom: 10px;
	font-style: italic;
}

.schedule-emulator {
	background: #1a1a1a;
	padding: 20px;
	margin-top: 15px;
}

/* Schedule Info Form */
#schedule-info-form {
	background: #f0f0f0;
	padding: 20px;
	border: 3px solid #000;
	margin-bottom: 20px;
}

#schedule-info-form .form-group {
	margin-bottom: 15px;
}

#schedule-info-form .form-group:last-child {
	margin-bottom: 0;
}

#schedule-info-form label {
	display: block;
	margin-bottom: 8px;
	font-weight: bold;
	text-transform: uppercase;
	font-size: 0.9em;
}

#schedule-info-form input[type="date"] {
	width: 100%;
	max-width: 200px;
	padding: 10px;
	border: 3px solid #000;
	font-family: 'Courier New', monospace;
	font-size: 1em;
}

#schedule-info-form select {
	width: 100%;
	padding: 10px;
	border: 3px solid #000;
	font-family: 'Courier New', monospace;
	font-size: 1em;
}

#schedule-info-form small {
	display: block;
	margin-top: 5px;
	color: #666;
	font-size: 0.85em;
}

#schedule-info-form .btn-pixel {
	width: 100%;
	margin: 0;
}

.schedule-mode-info {
	background: #e0e0e0;
	padding: 12px;
	border: 2px solid #000;
	font-weight: bold;
	text-align: center;
	margin: 0;
}

/* Mobile Schedule Preview - hidden on desktop */
.mobile-schedule-preview {
	display: none;
}

/* Schedule Editor */

/* Empty, Loading, Error States */
.loading-message {
	text-align: center;
	padding: 40px 20px;
	font-weight: bold;
	font-size: 1.1em;
}

.error-message {
	background: #ffe0e0;
	border: 3px solid #ff0000;
	padding: 20px;
	margin: 20px 0;
	color: #cc0000;
	font-weight: bold;
	text-align: center;
}

.empty-message {
	text-align: center;
	padding: 40px 20px;
	color: #666;
	font-style: italic;
}

.success-message {
	background: #e0ffe0;
	border: 3px solid #00cc00;
	padding: 20px;
	margin: 20px 0;
	color: #006600;
	font-weight: bold;
	text-align: center;
}

/* Mobile day indicator - hidden by default, shown only on mobile */
.mobile-day-indicator {
	display: none;
}

.mobile-day-item {
	padding: 6px 2px;
	background: #e0e0e0;
	border: 2px solid #000;
	text-align: center;
	font-weight: bold;
	font-family: 'Courier New', monospace;
	font-size: 0.7em;
	cursor: pointer;
	transition: all 0.1s;
	box-sizing: border-box;
	min-width: 0;
	overflow: hidden;
}

.mobile-day-item.has-items {
	background: #00FF88;
	color: #000;
}

.mobile-day-item.selected {
	border-color: #FF0088;
	border-width: 3px;
}

.mobile-day-short {
	display: none;
}

.mobile-day-full {
	display: inline;
}

/* Mobile Responsive for Schedules */
@media (max-width: 768px) {
	/* Reduce padding on schedule tab */
	#schedules-tab.tab-content {
		padding: 10px;
	}

	.schedule-editor {
		padding: 10px;
		border-width: 2px;
	}

	.schedule-editor-content {
		display: block;
	}

	.schedule-info-form {
		display: block;
	}

	/* Show mobile day indicator only on mobile AND only for default schedules */
	.mobile-day-indicator {
		display: none; /* Hidden by default */
		grid-template-columns: repeat(7, 1fr);
		gap: 2px;
		margin-bottom: 15px;
		padding: 5px;
		background: #f9f9f9;
		border: 2px solid #000;
		box-sizing: border-box;
		width: 100%;
	}

	/* Show only when editing default schedule */
	.schedule-editor[data-schedule-type="default"] .mobile-day-indicator {
		display: grid;
	}

	/* Show short day names on mobile */
	.mobile-day-short {
		display: inline;
	}

	.mobile-day-full {
		display: none;
	}

	/* Fix schedule editor input overflows */
	#schedule-info-form {
		padding: 10px;
		border: 2px solid #000;
		box-sizing: border-box;
	}

	#schedule-info-form .form-group {
		box-sizing: border-box;
		width: 100%;
	}

	#schedule-info-form input:not([type="checkbox"]):not([type="date"]),
	#schedule-info-form select {
		max-width: 100%;
		box-sizing: border-box !important;
		width: 100% !important;
		padding: 8px !important;
		border: 2px solid #000 !important;
		display: block !important;
		min-width: 0 !important;
		margin: 0 !important;
	}

	#schedule-info-form input[type="date"] {
		max-width: 100%;
		box-sizing: border-box !important;
		width: 100% !important;
		padding: 8px !important;
		border: 2px solid #000 !important;
		display: block !important;
		min-width: 0 !important;
		margin: 0 !important;
	}

	.schedule-item-header {
		flex-direction: column;
		align-items: stretch;
	}

	.item-name-input {
		width: 100% !important;
		max-width: 100%;
		box-sizing: border-box;
	}

	.item-enabled {
		justify-content: space-between;
	}

	.schedule-item {
		flex-direction: column;
		align-items: stretch;
	}

	.schedule-item {
		padding: 10px;
		border: 2px solid #000;
		box-sizing: border-box;
	}

	.schedule-item .form-group {
		box-sizing: border-box;
		width: 100%;
	}

	.schedule-item input:not([type="checkbox"]),
	.schedule-item select {
		width: 100% !important;
		max-width: 100%;
		box-sizing: border-box !important;
		padding: 6px !important;
		border: 2px solid #000 !important;
		display: block !important;
		min-width: 0 !important;
		margin: 0 !important;
	}

	/* Ensure checkboxes don't get full width in schedule editor */
	.schedule-item input[type="checkbox"] {
		width: auto !important;
		display: inline-block !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.schedule-item-row {
		flex-direction: column;
		align-items: stretch;
	}

	.item-label {
		min-width: auto;
	}

	.day-checkboxes {
		width: 100%;
	}

	.day-checkbox {
		flex: 1;
		justify-content: center;
		min-width: 40px;
	}

	/* Group time inputs side by side on mobile - 2 rows */
	.time-inputs {
		display: grid;
		grid-template-columns: auto auto auto;
		gap: 5px;
		align-items: center;
		justify-content: start;
	}

	/* From time on row 1: hour : minute */
	.time-inputs input:nth-of-type(1) {
		grid-column: 1;
		grid-row: 1;
	}

	.time-inputs span:nth-of-type(1) {
		grid-column: 2;
		grid-row: 1;
	}

	.time-inputs input:nth-of-type(2) {
		grid-column: 3;
		grid-row: 1;
	}

	/* "to" separator on row 2, spans all columns */
	.time-inputs span:nth-of-type(2) {
		grid-column: 1 / 2;
		grid-row: 2;
		justify-self: start;
	}

	/* To time on row 2: hour : minute */
	.time-inputs input:nth-of-type(3) {
		grid-column: 1;
		grid-row: 3;
	}

	.time-inputs span:nth-of-type(3) {
		grid-column: 2;
		grid-row: 3;
	}

	.time-inputs input:nth-of-type(4) {
		grid-column: 3;
		grid-row: 3;
	}

	.time-input-large {
		width: 60px !important;
		max-width: 60px;
	}

	.image-select {
		width: 100%;
	}

	/* Fix schedule card button overflows */
	.schedule-card {
		flex-direction: column;
		align-items: stretch;
	}

	.schedule-actions {
		width: 100%;
		flex-direction: row;
		gap: 5px;
	}

	.schedule-actions .btn-pixel {
		flex: 1;
		padding: 8px;
		font-size: 0.85em;
	}

	/* Fix timeline controls overflow on mobile - hide day/week buttons */
	.timeline-view-controls {
		flex-wrap: wrap;
		gap: 5px;
	}

	/* Hide Day/Week view toggle buttons on mobile */
	#timeline-view-day,
	#timeline-view-week {
		display: none !important;
	}

	#timeline-day-filter {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
		padding: 8px;
		font-size: 0.9em;
	}

	/* Fix timeline overflow - remove vertical scrolling on mobile */
	.timeline-view {
		max-width: 100%;
		overflow-x: auto;
		max-height: none;
		overflow-y: visible;
	}

	.timeline-item {
		font-size: 0.85em;
		min-width: 0;
	}

	.timeline-item-content {
		padding: 4px;
	}

	.timeline-gap {
		min-height: 20px;
	}

	.gap-time,
	.gap-duration {
		font-size: 0.6em;
	}

	/* Stack schedule editor layout vertically on mobile */
	.schedule-editor-layout {
		flex-direction: column;
	}

	.schedule-editor-layout .timeline-view-section,
	.schedule-editor-layout .schedule-preview-section {
		flex: 1;
		max-width: 100%;
		margin-top: 20px;
		max-height: none;
		overflow-y: visible;
	}

	/* Hide week view on mobile - too wide */
	.timeline-week-view {
		display: none !important;
	}

	#timeline-view-week {
		display: none !important;
	}

	/* Keep preview section visible on mobile */
	.schedule-preview-section {
		display: block !important;
	}

	/* Replace emulator content with 256x128 square on mobile */
	.schedule-emulator,
	.event-emulator {
		padding: 15px;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	/* Hide the actual matrix canvas on mobile */
	.schedule-emulator #matrix-container-schedule,
	.event-emulator #matrix-container-editor {
		display: none !important;
	}

	/* Hide mobile preview square on desktop */
	.mobile-preview-square,
	.mobile-event-preview-square {
		display: none;
	}

	/* Show mobile preview square on mobile */
	.schedule-emulator .mobile-preview-square,
	.event-emulator .mobile-event-preview-square {
		display: block;
		width: 256px;
		height: 128px;
		background: #000;
		border: 2px solid #000;
		position: relative;
	}

	.schedule-emulator .mobile-preview-square canvas,
	.event-emulator .mobile-event-preview-square canvas {
		display: block;
		image-rendering: pixelated;
		image-rendering: -moz-crisp-edges;
		image-rendering: crisp-edges;
	}

	/* Hide the separate mobile preview square container */
	.mobile-schedule-preview {
		display: none;
	}

	/* Show mobile edit panel, hide desktop timeline edit panel */
	.mobile-edit-panel {
		display: block;
		margin-top: 15px;
		padding: 15px;
		background: #f9f9f9;
		border: 2px solid #000;
		box-sizing: border-box;
	}

	.mobile-edit-panel .edit-panel-header {
		margin-bottom: 15px;
		padding-bottom: 10px;
		border-bottom: 2px solid #000;
	}

	.mobile-edit-panel .edit-panel-header h5 {
		margin: 0;
		font-size: 1.2em;
	}

	.mobile-edit-panel .form-group {
		margin-bottom: 15px;
	}

	.mobile-edit-panel .form-group:last-child {
		margin-bottom: 0;
	}

	.mobile-edit-panel .checkbox-option {
		display: flex;
		align-items: center;
		padding: 8px 0;
		cursor: pointer;
	}

	.mobile-edit-panel .checkbox-option input[type="checkbox"] {
		width: auto;
		margin-right: 8px;
		cursor: pointer;
	}

	.mobile-edit-panel .checkbox-option span {
		font-weight: normal;
	}

	.mobile-edit-panel .time-row {
		display: flex;
		gap: 10px;
		margin-top: 8px;
	}

	.mobile-edit-panel .time-field {
		flex: 1;
	}

	.mobile-edit-panel .time-field label {
		display: block;
		font-size: 0.85em;
		margin-bottom: 5px;
		color: #666;
	}

	.mobile-edit-panel .time-field input {
		width: 100%;
	}

	.mobile-edit-panel .btn-pixel {
		width: 100%;
		padding: 12px;
	}

	#timeline-edit-panel {
		display: none !important;
	}

	#schedule-info-form {
		padding: 15px;
	}

	/* Adjust schedule editor actions for mobile */
	.schedule-editor .schedule-actions {
		flex-direction: column;
		padding: 5px;
		gap: 5px;
		align-items: stretch;
		box-sizing: border-box;
		width: 100%;
		max-width: 100%;
	}

	.schedule-editor .schedule-actions .btn-pixel {
		min-width: 0;
		box-sizing: border-box;
		margin: 0 !important;
		padding: 8px 10px !important;
		max-width: 100%;
	}
}

/* ============================================
   TEMPLATE MANAGER STYLES
   ============================================ */

.template-manager-content {
	max-width: 700px;
}

.template-list {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.template-card {
	background: white;
	border: 3px solid #000;
	padding: 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
	transition: all 0.1s;
}

.template-card:hover {
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
	transform: translate(-1px, -1px);
}

.template-info {
	flex: 1;
	min-width: 0;
}

.template-name {
	font-size: 1.2em;
	margin-bottom: 5px;
	font-family: 'Courier New', monospace;
	text-transform: uppercase;
	font-weight: bold;
}

.template-path {
	color: #666;
	font-size: 0.85em;
	font-family: 'Courier New', monospace;
	margin: 0;
}

.template-actions {
	display: flex;
	gap: 10px;
	flex-shrink: 0;
}

.template-actions .btn-pixel {
	margin: 0;
	white-space: nowrap;
}

/* Responsive Design for Template Manager */
@media (max-width: 768px) {
	.template-manager-content {
		max-width: 100%;
		margin: 10px;
	}

	.template-card {
		flex-direction: column;
		align-items: stretch;
		gap: 15px;
	}

	.template-actions {
		width: 100%;
	}

	.template-actions .btn-pixel {
		flex: 1;
	}

	/* Mobile Footer */
	.app-footer {
		flex-direction: column;
		gap: 15px;
		padding: 20px 15px;
		text-align: center;
	}

	.footer-left {
		flex-direction: column;
		gap: 12px;
		width: 100%;
		order: 2;
	}

	.footer-right {
		width: 100%;
		order: 1;
	}

	.footer-separator {
		display: none;
	}

	.footer-version {
		font-size: 0.75em;
		color: #666;
	}

	.footer-link {
		font-size: 0.9em;
		padding: 8px 0;
		display: block;
		min-height: 44px;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.btn-logout-footer {
		width: 100%;
		padding: 14px 20px;
		font-size: 1em;
		min-height: 50px;
		box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
	}

	.btn-logout-footer:active {
		transform: translate(2px, 2px);
		box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
	}
}

/* ============================================
   VALIDATION MODAL STYLES
   ============================================ */

.validation-modal-content {
	max-width: 800px;
}

.validation-status {
	padding: 20px;
	text-align: center;
	font-size: 1.1em;
	color: #666;
	font-weight: bold;
}

.validation-results {
	margin-top: 20px;
}

.validation-success {
	background: #d4edda;
	border: 3px solid #28a745;
	padding: 30px;
	text-align: center;
	margin-bottom: 20px;
}

.validation-success h3 {
	color: #155724;
	font-size: 1.8em;
	margin-bottom: 15px;
	text-transform: uppercase;
}

.validation-success p {
	color: #155724;
	font-size: 1.1em;
}

.validation-summary {
	background: #fff3cd;
	border: 3px solid #ffc107;
	padding: 20px;
	margin-bottom: 20px;
}

.validation-summary h3 {
	color: #856404;
	margin-bottom: 10px;
	font-size: 1.5em;
	text-transform: uppercase;
}

.validation-summary p {
	color: #856404;
	font-size: 1.1em;
}

.validation-section {
	border: 3px solid #000;
	padding: 20px;
	margin-bottom: 20px;
	background: white;
}

.validation-section h4 {
	margin-bottom: 15px;
	font-size: 1.3em;
	text-transform: uppercase;
	font-family: 'Courier New', monospace;
}

.validation-section ul {
	list-style: none;
	padding: 0;
}

.validation-section li {
	padding: 8px 10px;
	margin-bottom: 5px;
	border-left: 4px solid transparent;
	font-family: 'Courier New', monospace;
	font-size: 0.95em;
	line-height: 1.5;
}

.validation-errors {
	background: #f8d7da;
	border-color: #dc3545;
}

.validation-errors h4 {
	color: #721c24;
}

.validation-errors li {
	border-left-color: #dc3545;
	background: rgba(220, 53, 69, 0.1);
	color: #721c24;
}

.validation-warnings {
	background: #fff3cd;
	border-color: #ffc107;
}

.validation-warnings h4 {
	color: #856404;
}

.validation-warnings li {
	border-left-color: #ffc107;
	background: rgba(255, 193, 7, 0.1);
	color: #856404;
}

.validation-info {
	background: #d1ecf1;
	border-color: #17a2b8;
}

.validation-info h4 {
	color: #0c5460;
}

.validation-info li {
	border-left-color: #17a2b8;
	background: rgba(23, 162, 184, 0.1);
	color: #0c5460;
}

.modal-footer {
	padding: 20px;
	border-top: 3px solid #ddd;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

/* Mobile responsiveness for validation modal */
@media (max-width: 768px) {
	.validation-modal-content {
		max-width: 100%;
		margin: 10px;
	}

	.validation-section h4 {
		font-size: 1.1em;
	}

	.validation-section li {
		font-size: 0.85em;
		padding: 6px 8px;
	}

	.validation-success h3,
	.validation-summary h3 {
		font-size: 1.3em;
	}

	.modal-body {
		padding: 15px;
	}

	.modal-footer {
		padding: 15px;
	}
}

/* ============================================
   VALIDATION BADGE (Footer notification)
   ============================================ */

.validation-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.validation-badge {
	display: inline-block;
	min-width: 18px;
	height: 18px;
	padding: 2px 6px;
	background: #dc3545;
	color: white;
	border-radius: 10px;
	font-size: 0.75em;
	font-weight: bold;
	text-align: center;
	line-height: 14px;
	margin-left: 5px;
}

.validation-badge.warning {
	background: #ffc107;
	color: #000;
}

.validation-badge.hidden {
	display: none;
}

/* Pulse animation for the badge */
@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.7;
	}
}

.validation-badge.pulse {
	animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   CONFIGURATION TAB
   ============================================ */

.config-container {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
	gap: 30px;
	margin-top: 20px;
}

.config-panel {
	background: white;
	border: 3px solid #000;
	padding: 25px;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.config-panel h3 {
	font-size: 1.5em;
	margin-bottom: 15px;
	color: #000;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.config-status {
	margin-bottom: 15px;
	min-height: 24px;
}

.config-settings {
	margin: 20px 0;
}

.config-section {
	margin-bottom: 25px;
}

.config-section:last-child {
	margin-bottom: 0;
}

.config-section-title {
	font-size: 1.1em;
	font-weight: bold;
	color: #333;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid #e0e0e0;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.config-setting {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 15px;
	margin-bottom: 8px;
	background: #f9f9f9;
	border: 2px solid #ddd;
	transition: all 0.2s;
}

.config-setting:hover {
	background: #f0f0f0;
	border-color: #000;
}

.config-setting-info {
	flex: 1;
	margin-right: 20px;
}

.config-label {
	display: block;
	font-weight: bold;
	font-size: 0.95em;
	color: #000;
	margin-bottom: 3px;
	cursor: pointer;
}

.config-description {
	display: block;
	font-size: 0.85em;
	color: #666;
	font-style: italic;
}

/* Toggle Switch Styles */
.config-toggle {
	flex-shrink: 0;
}

.toggle-checkbox {
	display: none;
}

.toggle-label {
	display: block;
	width: 60px;
	height: 30px;
	background: #ccc;
	border: 3px solid #000;
	position: relative;
	cursor: pointer;
	transition: all 0.3s;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.toggle-label:hover {
	box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.4);
}

.toggle-switch {
	display: block;
	width: 22px;
	height: 22px;
	background: white;
	border: 2px solid #000;
	position: absolute;
	top: 1px;
	left: 1px;
	transition: all 0.3s;
}

.toggle-checkbox:checked + .toggle-label {
	background: #00FF88;
}

.toggle-checkbox:checked + .toggle-label .toggle-switch {
	left: 31px;
	background: white;
}

/* ON/OFF text inside toggle */
.toggle-inner:before,
.toggle-inner:after {
	display: block;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.7em;
	font-weight: bold;
	font-family: 'Courier New', monospace;
}

.toggle-inner:before {
	content: 'ON';
	left: 6px;
	color: #000;
	opacity: 0;
	transition: opacity 0.3s;
}

.toggle-inner:after {
	content: 'OFF';
	right: 4px;
	color: #000;
	opacity: 1;
	transition: opacity 0.3s;
}

.toggle-checkbox:checked + .toggle-label .toggle-inner:before {
	opacity: 1;
}

.toggle-checkbox:checked + .toggle-label .toggle-inner:after {
	opacity: 0;
}

/* Number Input Styles for Configuration */
.config-number-input {
	flex-shrink: 0;
}

.config-number-input .number-input {
	width: 60px;
	height: 30px;
	padding: 3px 8px;
	background: white;
	border: 3px solid #000;
	font-size: 14px;
	font-family: 'Courier New', monospace;
	font-weight: bold;
	text-align: center;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
	transition: all 0.2s;
}

.config-number-input .number-input:hover {
	box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.4);
}

.config-number-input .number-input:focus {
	outline: none;
	border-color: #00FFAA;
	box-shadow: 0 0 0 3px rgba(0, 255, 170, 0.3);
}

/* Remove spinner arrows for cleaner look (optional) */
.config-number-input .number-input::-webkit-outer-spin-button,
.config-number-input .number-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.config-number-input .number-input[type=number] {
	-moz-appearance: textfield;
}

/* Time Helper Text */
.time-helper-text {
	display: inline-block;
	margin-left: 8px;
	font-size: 11px;
	color: #666;
	font-weight: 500;
	white-space: nowrap;
}

.config-actions {
	display: flex;
	gap: 10px;
	margin-top: 20px;
	flex-wrap: wrap;
}

.config-actions button {
	flex: 1;
	min-width: 150px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
	.config-container {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.config-panel {
		padding: 20px;
	}

	.config-setting {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.config-setting-info {
		margin-right: 0;
		margin-bottom: 10px;
	}

	.config-toggle {
		align-self: flex-end;
	}

	.config-actions {
		flex-direction: column;
	}

	.config-actions button {
		width: 100%;
	}
}


/* ============================================
   Stocks Section Styles
   ============================================ */

.stocks-section {
	padding: 20px;
	background: white;
	border: 4px solid #000;
	border-radius: 8px;
	box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.2);
	position: relative;
}

/* Success/Status Message - Fixed Position Toast */
#stocks-status {
	position: fixed;
	top: 20px;
	right: 20px;
	background: #00FFAA;
	color: #000;
	padding: 12px 20px;
	border: 3px solid #000;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
	font-weight: bold;
	z-index: 1000;
	pointer-events: none;
	animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
	from {
		transform: translateX(100%);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

.stocks-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 15px;
}

.stocks-header h3 {
	margin: 0;
	font-size: 1.4em;
}

/* 3-Column Grid Layout */
.stocks-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 15px;
	margin-top: 15px;
}

/* Stock Card - Pixel Art Style */
.stock-card {
	background: #f8f9fa;
	border: 3px solid #000;
	border-radius: 0;
	padding: 15px;
	position: relative;
	cursor: grab;
	transition: all 0.2s;
	box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
	display: flex;
	flex-direction: column;
	gap: 10px;
	/* Prevent text selection on drag */
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	/* Prevent touch actions that interfere with drag */
	touch-action: none;
}

.stock-card:hover {
	transform: translateY(-2px);
	box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.15);
}

.stock-card:active {
	cursor: grabbing;
}

/* Drag and Drop States */
.stock-card.dragging {
	opacity: 0.6;
	transform: rotate(2deg) scale(0.98);
	cursor: grabbing;
	box-shadow: 6px 6px 10px rgba(0, 0, 0, 0.3);
}

.stock-card.drag-over {
	border-color: #00FFAA;
	border-width: 4px;
	background: #e8ffe8;
	transform: scale(1.02);
}

/* Drag Handle */
.stock-drag-handle {
	position: absolute;
	top: 8px;
	left: 8px;
	font-size: 1.2em;
	color: #999;
	cursor: grab;
	user-select: none;
	line-height: 1;
}

.stock-card:active .stock-drag-handle {
	cursor: grabbing;
}

/* Cycle Badge - Top Right Corner */
.stock-cycle-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	background: #000;
	color: #00FFAA;
	padding: 3px 8px;
	font-size: 0.7em;
	font-weight: bold;
	border: 2px solid #000;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
}

/* Highlighted Stock Card */
.stock-card-highlighted {
	grid-column: 1 / -1; /* Span full width */
	border: 4px solid #FFD700;
	background: #FFFEF0;
	box-shadow: 0 0 0 2px #000, 4px 4px 0px rgba(0, 0, 0, 0.1);
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 15px;
	padding: 20px;
}

.stock-card-highlighted:hover {
	box-shadow: 0 0 0 2px #000, 6px 6px 0px rgba(0, 0, 0, 0.15);
}

/* Highlighted stock layout adjustments */
.stock-card-highlighted .stock-info {
	margin-top: 0;
	display: flex;
	align-items: center;
	gap: 20px;
}

.stock-card-highlighted .stock-ticker {
	font-size: 1.5em;
	margin-bottom: 0;
}

.stock-card-highlighted .stock-company {
	font-size: 0.9em;
}

/* Highlighted Badge */
.stock-highlighted-badge {
	background: #FFD700;
	color: #000;
	border-color: #000;
	position: static;
	margin-left: auto;
}

/* Stock Info */
.stock-info {
	margin-top: 10px;
}

.stock-ticker {
	font-size: 1.3em;
	font-weight: bold;
	color: #000;
	margin-bottom: 5px;
	font-family: monospace;
}

.stock-company {
	font-size: 0.85em;
	color: #666;
	line-height: 1.3;
}

.stock-meta {
	font-size: 0.75em;
	color: #888;
	margin-top: 4px;
	font-style: italic;
}

.stock-type-badge {
	display: inline-block;
	padding: 2px 6px;
	font-size: 0.65em;
	font-weight: bold;
	border-radius: 0;
	border: 2px solid #000;
	margin-left: 6px;
	vertical-align: middle;
}

.stock-type-badge-stock {
	background: #0088FF;
	color: #fff;
}

.stock-type-badge-other {
	background: #00FFAA;
	color: #000;
}

/* Stock Actions */
.stock-actions {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.btn-small {
	padding: 6px 12px;
	font-size: 0.85em;
	min-height: 32px;
}

.btn-danger {
	background: #ff4444;
	color: white;
}

.btn-danger:hover {
	background: #cc0000;
}

/* Cycle Row Separator - Inspired by Timeline Free Time Indicator */
.cycle-row-separator {
	grid-column: 1 / -1;
	height: 30px;
	background: repeating-linear-gradient(
		90deg,
		#f0f0f0,
		#f0f0f0 10px,
		#e0e0e0 10px,
		#e0e0e0 20px
	);
	border: 2px solid #ddd;
	border-left: none;
	border-right: none;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75em;
	color: #999;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin: 10px 0;
}

.cycle-row-separator::before {
	content: '⬇ Next Display Cycle ⬇';
	background: white;
	padding: 0 12px;
	border: 2px solid #ddd;
	box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.05);
}

/* Modal Styles for Stock Editor */
.ticker-input-group {
	display: flex;
	gap: 10px;
	align-items: center;
}

.ticker-input-group input {
	flex: 1;
}

.ticker-input-group button {
	white-space: nowrap;
}

#fetch-status {
	display: block;
	margin-top: 5px;
	font-size: 0.9em;
}

#fetch-status.error {
	color: #ff4444;
}

.info-message {
	color: #0066cc;
	font-size: 0.9em;
}

/* =================================================================
   Transit Card Styles - Pixel Art Style
   ================================================================= */

.transits-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 20px;
	margin-top: 20px;
}

.transit-card {
	background: var(--color-card-bg);
	border: 3px solid var(--color-border);
	border-radius: 8px;
	padding: 16px;
	box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
	transition: all 0.2s ease;
	cursor: grab;
	position: relative;
}

.transit-card:hover {
	transform: translateY(-2px);
	box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.15);
}

.transit-card.dragging {
	opacity: 0.5;
	cursor: grabbing;
}

.transit-card.drag-over {
	border-color: var(--color-primary);
	background: var(--color-hover-bg);
}

.transit-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--color-border);
}

.transit-type {
	font-weight: bold;
	font-size: 0.85em;
	color: var(--color-text-secondary);
	letter-spacing: 0.5px;
}

.transit-actions {
	display: flex;
	gap: 8px;
}

.transit-info {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.transit-route {
	font-size: 1.5em;
	font-weight: bold;
	display: flex;
	align-items: center;
	gap: 8px;
}

.alt-color-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.6em;
	font-weight: bold;
	color: white;
	border: 2px solid rgba(0, 0, 0, 0.2);
}

.transit-destination {
	font-size: 1.1em;
	color: var(--color-text);
	margin-bottom: 4px;
}

.transit-details {
	display: flex;
	gap: 15px;
	font-size: 0.9em;
	color: var(--color-text-secondary);
	margin-top: 4px;
}

.transit-filters {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	flex-wrap: wrap;
}

.filter-badge {
	background: var(--color-secondary);
	color: white;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 0.85em;
	border: 2px solid var(--color-border);
}

/* Transit Form Styles */
.transit-form-container {
	background: var(--color-card-bg);
	border: 3px solid var(--color-border);
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
	box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

.transit-form-container.hidden {
	display: none;
}

#transit-form .form-group {
	margin-bottom: 16px;
}

#transit-form label {
	display: block;
	margin-bottom: 6px;
	font-weight: bold;
	color: var(--color-text);
}

#transit-form input[type="text"],
#transit-form input[type="number"],
#transit-form select {
	width: 100%;
	padding: 8px 12px;
	border: 2px solid var(--color-border);
	border-radius: 4px;
	background: white;
	font-family: 'Press Start 2P', monospace;
	font-size: 0.75em;
}

#transit-form input[type="text"]:focus,
#transit-form input[type="number"]:focus,
#transit-form select:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.days-checkboxes {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.day-checkbox-label {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	padding: 6px 10px;
	border: 2px solid var(--color-border);
	border-radius: 4px;
	background: white;
	transition: all 0.2s ease;
}

.day-checkbox-label:hover {
	background: var(--color-hover-bg);
	border-color: var(--color-primary);
}

.day-checkbox-label input[type="checkbox"] {
	cursor: pointer;
}

.transit-form-actions {
	display: flex;
	gap: 12px;
	margin-top: 20px;
}

.transit-form-actions button {
	flex: 1;
}

/* Mobile Responsive Styles for Stocks */
@media (max-width: 1024px) {
	.stocks-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Highlighted stocks still span full width on tablet */
	.stock-card-highlighted {
		grid-column: 1 / -1;
	}
}

@media (max-width: 768px) {
	/* Mobile toast notification */
	#stocks-status {
		top: 10px;
		right: 10px;
		left: 10px;
		padding: 10px 15px;
		font-size: 0.9em;
		text-align: center;
	}

	.stocks-header {
		flex-direction: column;
		align-items: stretch;
	}

	.stocks-grid {
		grid-template-columns: 1fr;
	}

	.stock-card {
		flex-direction: column;
		align-items: stretch;
		/* Allow touch scrolling on mobile */
		touch-action: pan-y;
	}

	/* Highlighted stocks use vertical layout on mobile */
	.stock-card-highlighted {
		grid-template-columns: 1fr;
		grid-template-rows: auto auto auto;
		padding: 15px;
	}

	.stock-card-highlighted .stock-info {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.stock-card-highlighted .stock-ticker {
		font-size: 1.3em;
	}

	.stock-highlighted-badge {
		position: absolute;
		top: 8px;
		right: 8px;
		margin-left: 0;
	}

	.stock-actions {
		flex-direction: column;
	}

	.stock-actions button {
		width: 100%;
	}

	.ticker-input-group {
		flex-direction: column;
		align-items: stretch;
	}

	.ticker-input-group button {
		width: 100%;
	}

	.cycle-row-separator::before {
		font-size: 0.85em;
	}
}
