body {
	font-family: monospace;
	max-width: 620px;
	margin: 40px auto;
	padding: 20px;
	background: #111;
	color: #eee;
}
h1 {
	font-size: 1.4em;
	margin: 0 0 20px;
}

/* --- Tabs --- */
.tabs {
	display: flex;
	gap: 0;
	margin-bottom: 24px;
	border-bottom: 1px solid #333;
}
.tab-btn {
	padding: 8px 22px;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	color: #888;
	font-family: monospace;
	font-size: 1em;
	cursor: pointer;
	margin-bottom: -1px;
}
.tab-btn.active {
	color: #eee;
	border-bottom-color: #2a6;
}
.tab-btn:hover:not(.active) {
	color: #ccc;
}
.tab-panel {
	display: none;
}
.tab-panel.active {
	display: block;
}

/* --- Form elements --- */
label {
	display: block;
	margin-top: 12px;
	font-size: 0.9em;
	color: #aaa;
}
input[type="text"],
input[type="number"],
select {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin-top: 4px;
	padding: 6px 8px;
	background: #222;
	border: 1px solid #444;
	color: #eee;
	font-family: monospace;
	font-size: 1em;
	border-radius: 3px;
}
.row {
	display: flex;
	gap: 16px;
}
.row > div {
	flex: 1;
}
.note {
	font-size: 0.8em;
	color: #888;
	margin-top: 4px;
}

/* --- Validation error box --- */
.gen-error {
	display: none;
	margin-top: 14px;
	padding: 10px 14px;
	background: #1c0909;
	border: 1px solid #6b2323;
	border-radius: 3px;
	color: #f09090;
	font-size: 0.88em;
	line-height: 1.6;
}
.gen-error.visible {
	display: block;
}
.gen-error .err-list {
	margin: 5px 0 0;
	padding-left: 1.3em;
}
.gen-error .err-list li {
	margin: 2px 0;
}
input[type="text"].field-error,
input[type="number"].field-error {
	border-color: #7a2525 !important;
	box-shadow: 0 0 0 1px #7a2525;
}

/* --- Generate button (triple-state: idle / generating / done) --- */
#generate-btn {
	display: block;
	width: 100%;
	margin-top: 20px;
	padding: 11px 24px;
	border: none;
	border-radius: 3px;
	box-sizing: border-box;
	font-family: monospace;
	font-size: 1em;
	cursor: pointer;
	background: #2a6;
	color: #fff;
	/* Isolate the gradient from any inherited background rules */
	background-clip: padding-box;
}
#generate-btn.is-generating {
	background: linear-gradient(to right, #2a6 var(--prog, 0%), #143 var(--prog, 0%));
	cursor: default;
}
#generate-btn.is-done {
	background: #1a9;
	color: #fff;
	cursor: pointer;
}
#generate-btn.is-done:hover {
	background: #1bc;
}

.status {
	margin-top: 8px;
	font-size: 0.85em;
	color: #aaa;
	min-height: 1.2em;
}

/* --- Analyze drop zone --- */
#drop-zone {
	margin-top: 8px;
	border: 2px dashed #444;
	border-radius: 6px;
	padding: 32px 20px;
	text-align: center;
	color: #777;
	cursor: pointer;
	transition:
		border-color 0.15s,
		color 0.15s;
}
#drop-zone.drag-over {
	border-color: #2a6;
	color: #aaa;
}
#drop-zone input[type="file"] {
	display: none;
}
#drop-zone .dz-hint {
	font-size: 0.85em;
	margin-top: 6px;
}

/* --- Results table --- */
#results {
	display: none;
	margin-top: 20px;
}
#results table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95em;
}
#results td {
	padding: 6px 8px;
	border-bottom: 1px solid #2a2a2a;
}
#results td:first-child {
	color: #aaa;
	width: 44%;
}
#results td:last-child {
	color: #eee;
	font-weight: bold;
}
#analyze-status {
	margin-top: 10px;
	font-size: 0.85em;
	color: #aaa;
	min-height: 1.2em;
}

/* --- Options tab --- */
.opt-section {
	margin-top: 8px;
}
.opt-section + .opt-section {
	margin-top: 28px;
}
.opt-section h3 {
	font-size: 0.78em;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	margin: 0 0 10px;
	border-bottom: 1px solid #222;
	padding-bottom: 6px;
}
.opt-check {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
	cursor: pointer;
}
.opt-check input[type="checkbox"] {
	width: 15px;
	height: 15px;
	cursor: pointer;
	accent-color: #2a6;
	flex-shrink: 0;
}
.opt-check span {
	font-size: 0.95em;
	color: #ccc;
}
.input-with-suffix {
	display: flex;
	margin-top: 4px;
}
.input-with-suffix input[type="text"] {
	flex: 1;
	margin-top: 0;
	border-right: none;
	border-radius: 3px 0 0 3px;
}
.input-suffix {
	display: flex;
	align-items: center;
	padding: 6px 9px;
	background: #1a1a1a;
	border: 1px solid #444;
	border-left: none;
	border-radius: 0 3px 3px 0;
	color: #555;
	font-family: monospace;
	font-size: 1em;
	white-space: nowrap;
	user-select: none;
}

#filename-preview {
	margin-top: 8px;
	color: #4cf;
	min-height: 1.1em;
}
.token-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}
.token {
	background: #1e1e1e;
	border: 1px solid #383838;
	border-radius: 3px;
	padding: 2px 7px;
	font-size: 0.82em;
	color: #aaa;
	cursor: default;
}
.token span {
	color: #4cf;
}

/* --- Bulk generation panel --- */
#bulk-panel {
	display: none;
	margin-top: 6px;
	padding: 12px 14px;
	background: #181818;
	border: 1px solid #2a2a2a;
	border-radius: 4px;
}
#bulk-panel.visible {
	display: block;
}

/* --- Bulk download buttons --- */
#bulk-downloads {
	margin-top: 10px;
	display: flex;
	flex-direction: column;
	gap: 5px;
}
.bulk-dl-btn {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 8px 12px;
	background: #1a9;
	border: none;
	border-radius: 3px;
	color: #fff;
	font-family: monospace;
	font-size: 0.9em;
	cursor: pointer;
	text-align: left;
}
.bulk-dl-btn:hover {
	background: #1bc;
}
.bulk-dl-btn.pending {
	background: #1a1a1a;
	border: 1px solid #2a2a2a;
	color: #555;
	cursor: default;
}
