* {
	box-sizing: border-box;
}
body {
	font-family: "Segoe UI", Tahoma, sans-serif;
	background: #1a1a2e;
	color: #e8e8e8;
	margin: 0;
}
a {
	color: #ffffff;
	text-decoration: underline;
}
/* Login */
.login-body {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100vh;
}
.login-box {
	background: #16213e;
	padding: 2rem 2.5rem;
	border-radius: 8px;
	width: 300px;
	display: flex;
	flex-direction: column;
}
.login-box h1 {
	margin: 0 0 1rem;
	text-align: center;
	color: #e94560;
}
.login-box label {
	margin-top: 0.75rem;
	font-size: 0.85rem;
	color: #aaaaaa;
}
.login-box input {
	margin-top: 0.25rem;
	padding: 0.5rem;
	border-radius: 4px;
	border: 1px solid #0f3460;
	background: #0f3460;
	color: white;
}
.login-box button {
	margin-top: 1.25rem;
	padding: 0.6rem;
	border: none;
	border-radius: 4px;
	background: #e94560;
	color: white;
	font-weight: bold;
	cursor: pointer;
}
.error {
	color: #ff6b81;
}
/* App shell */
nav {
	background: #0f3460;
	padding: 0.75rem 1.5rem;
	display: flex;
	align-items: center;
	gap: 1.5rem;
}
nav a {
	color: #e8e8e8;
	text-decoration: none;
}
nav a:hover {
	color: #e94560;
}
nav .spacer {
	flex: 1;
}
nav .account {
	color: #aaaaaa;
	font-size: 0.9rem;
}
.container {
	padding: 1.5rem;
	max-width: 90vw;
	margin: 0 auto;
}
.flash {
	padding: 0.8rem 1rem;
	border-radius: 6px;
	margin-bottom: 1.5rem;
	font-size: 0.9rem;
	line-height: 1.4;
}
.flash-success {
	background: rgba(46, 204, 113, 0.15);
	border-left: 4px solid #2ecc71;
}
.flash-warning {
	background: rgba(241, 196, 15, 0.12);
	border-left: 4px solid #f1c40f;
}
.flash-error {
	background: rgba(231, 76, 60, 0.15);
	border-left: 4px solid #e74c3c;
}
.flash-info {
	background: rgba(52, 152, 219, 0.12);
	border-left: 4px solid #3498db;
}
button[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}
.run-now-status {
	display: block;
	/* Fixed px cap, not a relative max-width:100% - the Actions cell itself
	   shrinks to content (see .actions-cell), so a relative cap would just
	   grow right along with it instead of actually capping anything. */
	max-width: 220px;
	margin-bottom: 0.3rem;
	font-size: 0.78rem;
	color: #8a8fa3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.reasoning-toggle {
	padding: 0.2rem 0.5rem;
}
.reasoning-row td {
	text-align: left;
	white-space: normal;
	background: rgba(255, 255, 255, 0.03);
	font-size: 0.85rem;
	line-height: 1.5;
	padding: 0.75rem 1rem;
}
.reasoning-row td a {
	color: #3498db;
	font-size: 0.8rem;
	text-decoration: none;
}
.reasoning-row td a:hover {
	text-decoration: underline;
}
/*
 * table-layout:auto (the default) sizes each column to fit its own content -
 * short columns like Name or the icon-button Actions column stay narrow
 * instead of being forced to an arbitrary fixed percentage. The Last Run
 * column is the one exception: its content (translated status sentences)
 * can be arbitrarily long, so its text is wrapped in a block child
 * (.last-run-text) with its own max-width + ellipsis - that caps how wide
 * the column can grow without needing table-layout:fixed for the whole
 * table (which would have undone the shrink-to-content behavior everywhere
 * else).
 */
.last-run-cell {
	font-size: 0.85rem;
	color: #8a8fa3;
	cursor: help;
}
.last-run-text {
	display: block;
	max-width: 320px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.actions-cell {
	white-space: nowrap;
	width: 1%;
}
.reliability-warning {
	display: inline-block;
	margin-left: 0.4rem;
	color: #f1c40f;
	cursor: help;
}
.credit-balance {
	display: inline-block;
	margin-left: 0.4rem;
	font-size: 0.75rem;
	font-weight: bold;
	color: #2ecc71;
	border: 1px solid #3a3f52;
	border-radius: 4px;
	padding: 0.05rem 0.4rem;
}
.run-now-status-done {
	color: #2ecc71;
}
.run-now-status-error {
	color: #e74c3c;
}
.panel {
	background: #16213e;
	border-radius: 8px;
	padding: 1.25rem;
	margin-bottom: 1.5rem;
}
.panel h2 {
	margin-top: 0;
	font-size: 1.05rem;
	color: #e94560;
}
.grid-2 {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 1.5rem;
}
table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}
th, td {
	padding: 0.5rem 0.6rem;
	text-align: center;
	border-bottom: 1px solid #0f3460;
}
th {
	background: #0f3460;
}
td.left, th.left {
	text-align: left;
}
tr.correct {
	background: rgba(46, 204, 113, 0.08);
}
tr.incorrect {
	background: rgba(231, 76, 60, 0.08);
}
tr.skipped {
	opacity: 0.5;
}
.filters {
	margin-bottom: 1rem;
}
.filters a {
	display: inline-block;
	padding: 0.4rem 0.9rem;
	margin-right: 0.5rem;
	border-radius: 4px;
	background: #0f3460;
	color: #e8e8e8;
	text-decoration: none;
	font-size: 0.85rem;
}
.filters a.active {
	background: #e94560;
}
button, .btn {
	display: inline-block;
	padding: 0.4rem 0.9rem;
	border: none;
	border-radius: 4px;
	background: #e94560;
	color: white;
	cursor: pointer;
	font-size: 0.85rem;
	text-decoration: none;
	vertical-align: middle;
	box-sizing: border-box;
}
.icon-btn {
	width: 2rem;
	height: 2rem;
	padding: 0;
	font-size: 1rem;
	line-height: 2rem;
	text-align: center;
}
.icon-btn.run-icon {
	background: #2ecc71;
}
.icon-btn.edit-icon {
	background: #3498db;
}
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.secondary {
	background: #0f3460;
}
.danger {
	background: #c0392b;
}
.stats-grid {
	font-family: "Consolas", monospace;
	font-size: 0.85rem;
	line-height: 1.6;
}
.stat-row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}
.stat-row .stat-label {
	color: #8a8fa3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.stat-row .stat-value {
	text-align: right;
	white-space: nowrap;
	flex-shrink: 0;
}
.stat-section {
	margin-top: 0.85rem;
	color: #e94560;
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: 0.03em;
}
.stat-section:first-child {
	margin-top: 0;
}
.sparkline-svg {
	width: 100%;
	height: auto;
	display: block;
}
.log-panel {
	max-height: 220px;
	overflow-y: auto;
	font-family: Consolas, monospace;
	font-size: 0.8rem;
}
.log-INFO {
	color: #bbbbbb;
}
.log-WARN {
	color: #f1c40f;
}
.log-ERROR {
	color: #ff6b81;
}
form.inline {
	display: inline;
}
form.run-now-form, form.bot-run-now-form {
	display: inline-block;
	margin-top: 10px;
}
input[type=text], input[type=number], input[type=password], select, textarea {
	padding: 0.4rem;
	border-radius: 4px;
	border: 1px solid #0f3460;
	background: #0f3460;
	color: white;
	width: 100%;
}
textarea {
	font-family: Consolas, monospace;
	min-height: 220px;
}
.var-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 0.5rem;
}
.var-buttons button {
	font-family: Consolas, monospace;
	font-size: 0.78rem;
	padding: 0.25rem 0.5rem;
	width: auto;
}
.form-row {
	margin-bottom: 0.9rem;
}
.form-row label {
	display: block;
	margin-bottom: 0.3rem;
	font-size: 0.85rem;
	color: #aaaaaa;
}
.toggle-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}
.help-text {
	margin: 0.35rem 0 0;
	font-size: 0.78rem;
	color: #8a8fa3;
	line-height: 1.4;
}
.help-text-spaced {
	margin-bottom: 0.9rem;
}
.api-help-inline {
	margin-top: 0.5rem;
	padding: 0.6rem 0.75rem;
	background: #0f3460;
	border-left: 3px solid #e94560;
	border-radius: 4px;
	font-size: 0.82rem;
	line-height: 1.4;
}
.api-help-inline a {
	color: #e94560;
	text-decoration: none;
	margin-left: 0.4rem;
	white-space: nowrap;
}
.api-help-inline a:hover {
	text-decoration: underline;
}
form[action="clear_log"] {
	margin-top: 15px;
}