body { font-family: system-ui, -apple-system, sans-serif; background: #f4f4f5; margin: 0; padding: 20px; color: #333; }
.container { max-width: 1400px; margin: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; margin-bottom: 20px; }
.card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
h2 { margin-top: 0; font-size: 1.15rem; border-bottom: 1px solid #eee; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
label { display: block; margin-bottom: 4px; font-weight: bold; font-size: 0.85rem; }


input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
	width: 100%;
	padding: 8px;
	margin-bottom: 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-sizing: border-box;
	font-family: inherit;
}

.login-wrapper {
	max-width: 400px;
	margin: 80px auto;
}

.alert-error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 12px;
}


.row { display: flex; gap: 10px; }
.row > div { flex: 1; }
button { background: #2563eb; color: white; border: none; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }
button:hover { background: #1d4ed8; }
.btn-sm { padding: 4px 8px; font-size: 0.75rem; border-radius: 4px; cursor: pointer; border: none; color: white; text-decoration: none; display: inline-block; }
.btn-secondary { background: #64748b; }
.btn-secondary:hover { background: #475569; }
.btn-rerun { background: #059669; }
.btn-rerun:hover { background: #047857; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #eee; vertical-align: top; }
th { background: #f8fafc; }
.status-pending { color: #d97706; font-weight: bold; }
.status-running { color: #2563eb; font-weight: bold; }
.status-completed { color: #16a34a; font-weight: bold; }
.status-failed { color: #dc2626; font-weight: bold; }
.badge-active { background: #dcfce7; color: #166534; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; }
.badge-inactive { background: #fee2e2; color: #991b1b; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; }
.prompt-full { white-space: pre-wrap; line-height: 1.4; max-height: 120px; overflow-y: auto; background: #f8fafc; padding: 6px; border-radius: 4px; border: 1px solid #e2e8f0; }

#logs {
    scroll-margin-top: 20px;
}

.log-box {
	background: #1e293b;
	color: #f8fafc;
	padding: 10px;
	border-radius: 4px;
	font-family: monospace;
	white-space: pre-wrap;
	font-size: 0.8rem;
	max-height: 250px;
	overflow-y: auto;
}
details summary { cursor: pointer; color: #2563eb; font-size: 0.8rem; margin-top: 4px; }
details pre { white-space: pre-wrap; background: #f1f5f9; padding: 8px; border-radius: 4px; font-size: 0.78rem; margin-top: 6px; border: 1px solid #cbd5e1; }

.action-group {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}
.status-cell {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}
.started-meta {
	display: block;
	font-size: 11px;
	color: #64748b;
	font-weight: normal;
	margin-top: 2px;
}

.copy-bar {
	display: flex;
	justify-content: flex-end;
	margin-top: 4px;
}
.copy-btn {
	background: #f1f5f9;
	color: #475569;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}
.copy-btn:hover {
	background: #e2e8f0;
	color: #1e293b;
}
.copy-btn.copied {
	background: #dcfce7;
	border-color: #86efac;
	color: #15803d;
}

.btn-logs {
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 600;
}

.pagination {
	text-align:center;
}

.md-toggle-btn {
	white-space: nowrap;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	margin-right: 6px;
	border-radius: 4px;
	border: 1px solid #cbd5e1;
	background: #f1f5f9;
	color: #475569;
	cursor: pointer;
}

.md-toggle-btn:hover {
	background: #e2e8f0;
	color: #1e293b;
}
.md-toggle-btn.is-rendered {
	background: #0284c7;
	border-color: #0284c7;
	color: #ffffff;
}

/* Rendered markdown container matching your dark output box */
.md-rendered {
	background: #0f172a;
	color: #e2e8f0;
	padding: 14px 16px;
	border-radius: 6px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 13.5px;
	line-height: 1.6;
	overflow-x: auto;
}
.md-rendered h1, .md-rendered h2, .md-rendered h3, .md-rendered h4 {
	color: #f8fafc;
	margin: 14px 0 6px;
	line-height: 1.3;
}
.md-rendered h1:first-child, .md-rendered h2:first-child, .md-rendered h3:first-child {
	margin-top: 0;
}
.md-rendered hr {
	border: 0;
	border-top: 1px solid #334155;
	margin: 12px 0;
}
.md-rendered pre {
	background: #020617;
	border: 1px solid #1e293b;
	border-radius: 5px;
	padding: 10px 12px;
	overflow-x: auto;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12.5px;
}
.md-rendered code {
	background: #1e293b;
	padding: 2px 5px;
	border-radius: 3px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12.5px;
}
.md-rendered pre code {
	background: transparent;
	padding: 0;
}
.md-rendered ul, .md-rendered ol {
	padding-left: 20px;
	margin: 6px 0;
}
.md-rendered blockquote {
	border-left: 3px solid #0284c7;
	margin: 8px 0;
	padding-left: 12px;
	color: #94a3b8;
}
.md-rendered table {
	border-collapse: collapse;
	width: 100%;
	margin: 8px 0;
}
.md-rendered th, .md-rendered td {
	border: 1px solid #334155;
	padding: 6px 10px;
	text-align: left;
}
.md-rendered th {
	background: #1e293b;
}

.md-rendered {
	max-width: 720px;
}