body {
	font-family: sans-serif;
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px 16px 40px;
	color: #222;
	box-sizing: border-box;
}

h1 {
	margin-bottom: 4px;
}

.subtitle {
	color: #555;
	margin-top: 0;
}

nav.main-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 16px 0 24px;
	border-bottom: 1px solid #ddd;
}

nav.main-nav a {
	display: inline-block;
	padding: 10px 16px;
	text-decoration: none;
	color: #333;
	border-bottom: 2px solid transparent;
}

nav.main-nav a:hover {
	background: #f5f5f5;
}

nav.main-nav a.active {
	border-bottom-color: #06c;
	color: #06c;
	font-weight: bold;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 16px;
}

th, td {
	border: 1px solid #ddd;
	padding: 6px 10px;
	text-align: left;
	vertical-align: middle;
}

th {
	background: #f5f5f5;
}

input, select {
	padding: 6px;
	font-size: 0.95rem;
	box-sizing: border-box;
	width: 100%;
}

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

button, input[type=submit] {
	padding: 6px 14px;
	font-size: 0.9rem;
	cursor: pointer;
}

button.secondary {
	background: #eee;
}

button.danger {
	background: #fdecea;
	border-color: #f5c2c0;
	color: #b00020;
}

.actions {
	white-space: nowrap;
	width: 1%;
}

.actions form, .actions button {
	display: inline-block;
	margin-right: 4px;
}

.error {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	color: #b00020;
	background: #fdecea;
	border: 1px solid #f5c2c0;
	padding: 8px 12px;
	border-radius: 4px;
	margin-bottom: 16px;
}

.error-close {
	flex-shrink: 0;
	background: none;
	border: none;
	padding: 0 2px;
	font-size: 1.1rem;
	line-height: 1;
	color: #b00020;
	cursor: pointer;
}

.error-close:hover {
	color: #7a0016;
}

.new-row td {
	background: #fafafa;
}

.field-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	background: #fafafa;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 16px;
	margin-bottom: 16px;
}

.field {
	margin-top: 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.field label {
	font-size: 0.85rem;
	font-weight: bold;
	color: #444;
}

.field-checkbox {
	flex-direction: row;
	align-items: center;
}

.field-checkbox label {
	display: flex;
	align-items: center;
	gap: 6px;
}

.field-actions {
	grid-column: 1 / -1;
	flex-direction: row;
	justify-content: flex-end;
	gap: 8px;
}

.field-span-2 {
	grid-column: span 2;
}

.checkbox-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 2px 12px;
	max-height: 160px;
	overflow-y: auto;
	border: 1px solid #ccc;
	border-radius: 4px;
	padding: 8px;
	background: #fff;
}

.checkbox-list-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: normal;
	padding: 4px;
	border-radius: 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.checkbox-list-item:hover {
	background: #f0f4f8;
}

section {
	margin-bottom: 32px;
}

/* Sessions page */
.filter-field {
	margin: 0 0 16px;
	max-width: 480px;
}

.notice {
	color: #7a5b00;
	background: #fff8e1;
	border: 1px solid #f0d98a;
	border-radius: 4px;
	padding: 8px 12px;
}

.muted {
	color: #777;
	font-size: 0.85rem;
}

.toggle-cell {
	width: 1%;
	text-align: center;
}

.icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	line-height: 0;
	background: #eee;
	border: 1px solid #ccc;
	border-radius: 4px;
	color: #333;
}

.icon-button:hover {
	background: #e2e2e2;
}

.icon-button.danger {
	background: #fdecea;
}

.chevron {
	transition: transform 0.15s;
}

.icon-button[aria-expanded="true"] .chevron {
	transform: rotate(90deg);
}

tbody.editing td, .detail-cell {
	background: #fafafa;
}

.detail-cell h4 {
	margin: 0 0 8px;
}

.chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 3px 4px 3px 10px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 14px;
}

.chip .icon-button {
	border-radius: 50%;
	padding: 3px;
}

.inline-form {
	display: flex;
	gap: 8px;
	max-width: 480px;
}

.solver-status {
	margin-bottom: 16px;
}

.solver-controls {
	display: flex;
	gap: 8px;
}

.solver-status-message {
	margin: 8px 0 0;
	padding: 8px 12px;
	background: #f5f5f5;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 0.85rem;
	white-space: pre-wrap;
}

.publish-draft {
	margin-bottom: 16px;
}

.conflicts-toggle {
	display: inline-flex;
	gap: 0;
	margin-bottom: 16px;
	border: 1px solid #06c;
	border-radius: 6px;
	overflow: hidden;
}

.conflicts-toggle button {
	background: #fff;
	color: #06c;
	border: none;
	border-radius: 0;
	padding: 8px 18px;
}

.conflicts-toggle button:not(.active):hover {
	background: #eaf2fb;
}

.conflicts-toggle button + button {
	border-left: 1px solid #06c;
}

.conflicts-toggle button.active {
	background: #06c;
	color: #fff;
	font-weight: bold;
	cursor: default;
}

.conflict-category {
	margin-bottom: 24px;
	padding: 12px 16px;
	border: 1px solid #f5c2c0;
	background: #fdecea;
	border-radius: 6px;
}

.conflict-category-clean {
	border-color: #ddd;
	background: #fafafa;
}

.conflict-category h3 {
	margin: 0 0 2px;
}

.conflict-list {
	margin: 8px 0 0;
	padding-left: 20px;
}

.conflict-list li {
	margin-bottom: 4px;
}

/* Reserves room at the top of the page for the fixed banner below, so it doesn't cover
   the heading. Only applied on pages that actually render the banner. */
body.has-live-banner {
	padding-top: 68px;
}

.live-warning-banner {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	background: #fff;
	color: #b00020;
	padding: 12px 16px;
	border-bottom: 2px solid #b00020;
	text-align: center;
	font-weight: bold;
	font-size: 1.05rem;
}

.solver-precheck-error {
	color: #b00020;
	background: #fdecea;
	border: 1px solid #f5c2c0;
	padding: 8px 12px;
	border-radius: 4px;
	margin-bottom: 12px;
}

.solver-precheck-warning {
	color: #7a5b00;
	background: #fff8e1;
	border: 1px solid #f0d98a;
	padding: 8px 12px;
	border-radius: 4px;
	margin-bottom: 12px;
}

/* Login and users */
.nav-account {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 12px;
}

.logout-form {
	align-self: center;
}

.field-checkbox label {
	flex-direction: row;
	align-items: center;
	gap: 8px;
	font-weight: normal;
}

.login-actions {
	flex-direction: row;
	align-items: center;
	gap: 12px;
}

.button-link {
	color: #06c;
	text-decoration: none;
}

.logout-form-block {
	margin-top: 16px;
}

.login-box {
	max-width: 360px;
	margin-top: 32px;
}

.login-box .field {
	margin-bottom: 12px;
}

.login-box input {
	width: 100%;
	box-sizing: border-box;
}

.inline-notice {
	color: #1b5e20;
	font-size: 0.85rem;
	margin-left: 6px;
}
