/* ltc.tools: the original site's layout, moved a step toward ablefrog.com. The band is AbleFrog's
   dark pond instead of neutral #111; the title, tabs and labels use the site's fonts, while monospace
   stays where it carries meaning (timecode, values, filenames); corners soften and the Generate
   button becomes the site's pill. */

.ltc-app {
	--mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
	--line: rgb(255 255 255 / 0.12);
	--line-soft: rgb(255 255 255 / 0.07);
	--field: rgb(0 0 0 / 0.24);
	background: var(--pond);
	color: var(--on-dark);
	font-family: var(--body);
	font-size: 16px;
	line-height: 1.5;
	padding: clamp(48px, 7vw, 80px) 0 clamp(72px, 9vw, 112px);
}

.ltc-app-wrap {
	max-width: 660px;
	margin: 0 auto;
	padding: 0 20px;
}

.ltc-app h1 {
	margin: 0 0 24px;
	font-size: clamp(2.2rem, 5vw, 2.9rem);
	letter-spacing: -0.035em;
	line-height: 1;
}

.ltc-app :focus-visible {
	outline: 2px solid var(--frog-bright);
	outline-offset: 2px;
	border-radius: 6px;
}

/* --- Tabs: the original's underline, in the site's type --- */
.ltc-app .tabs {
	display: flex;
	margin-bottom: 26px;
	border-bottom: 1px solid var(--line);
}

.ltc-app .tab-btn {
	margin-bottom: -1px;
	padding: 10px 20px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: none;
	color: var(--on-dark-muted);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: color 0.15s;
}

.ltc-app .tab-btn:first-child {
	padding-left: 2px;
}

.ltc-app .tab-btn.active {
	color: var(--on-dark);
	border-bottom-color: var(--frog-bright);
}

.ltc-app .tab-btn:hover:not(.active) {
	color: var(--on-dark);
}

.ltc-app .tab-panel {
	display: none;
}

.ltc-app .tab-panel.active {
	display: block;
}

/* --- Form elements --- */
.ltc-app label {
	display: block;
	margin-top: 14px;
	color: var(--on-dark-muted);
	font-size: 0.88rem;
	font-weight: 550;
}

.ltc-app input[type="text"],
.ltc-app input[type="number"],
.ltc-app select {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 9px 12px;
	border: 1px solid var(--line);
	border-radius: var(--r-s);
	background: var(--field);
	color: var(--on-dark);
	font-family: var(--mono);
	font-size: 0.95rem;
	color-scheme: dark;
	transition: border-color 0.15s;
}

.ltc-app select {
	appearance: none;
	padding-right: 36px;
	background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23b5cf78' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 12px;
	cursor: pointer;
}

.ltc-app select option {
	background: var(--pond-2);
}

.ltc-app input[type="text"]:hover,
.ltc-app input[type="number"]:hover,
.ltc-app select:hover {
	border-color: rgb(255 255 255 / 0.22);
}

.ltc-app input[type="text"]:focus-visible,
.ltc-app input[type="number"]:focus-visible,
.ltc-app select:focus-visible {
	outline: none;
	border-color: var(--frog-bright);
	box-shadow: 0 0 0 3px rgb(181 207 120 / 0.18);
	border-radius: var(--r-s);
}

/* start & duration: stacked as in the original, set a size up since they're what you came for */
.ltc-app .tc-stage .tc-field:first-child label {
	margin-top: 0;
}

.ltc-app .tc-input {
	padding: 11px 14px !important;
	font-size: 1.2rem !important;
	font-weight: 500;
	letter-spacing: 0.02em;
}

.ltc-app .row {
	display: flex;
	gap: 14px;
	margin-top: 14px;
}

.ltc-app .row > div {
	flex: 1;
	min-width: 0;
}

.ltc-app #bulk-panel .row {
	align-items: flex-end;
	margin-top: 0;
}

.ltc-app #bulk-panel .row label {
	margin-top: 0;
}

.ltc-app .note {
	margin-top: 8px;
	color: var(--on-dark-muted);
	font-size: 0.85rem;
}

/* --- Validation warning & error boxes: the original's amber and red, tinted for the pond --- */
.ltc-app .gen-warning,
.ltc-app .gen-error {
	display: none;
	margin-top: 16px;
	padding: 12px 15px;
	border: 1px solid;
	border-radius: var(--r-s);
	font-size: 0.9rem;
	line-height: 1.55;
}

.ltc-app .gen-warning {
	border-color: rgb(240 200 105 / 0.35);
	background: rgb(240 200 105 / 0.08);
	color: #f2d68e;
}

.ltc-app .gen-error {
	border-color: rgb(240 144 144 / 0.38);
	background: rgb(240 144 144 / 0.08);
	color: #f4aaa2;
}

.ltc-app .gen-warning.visible,
.ltc-app .gen-error.visible {
	display: block;
}

.ltc-app .err-list {
	margin: 5px 0 0;
	padding-left: 1.3em;
	list-style: disc;
}

.ltc-app .err-list li {
	margin: 2px 0;
}

.ltc-app input.field-error {
	border-color: #e88a80 !important;
	box-shadow: 0 0 0 1px #e88a80;
}

/* --- Generate button: the site's pill, still its own progress bar --- */
.ltc-app #generate-btn {
	display: block;
	width: 100%;
	margin-top: 24px;
	padding: 13px 24px;
	border: 0;
	border-radius: 999px;
	background: var(--frog-deep);
	color: #fff;
	font-family: var(--body);
	font-size: 1.02rem;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
	transition: background-color 0.15s;
}

.ltc-app #generate-btn:hover {
	background: var(--frog);
}

.ltc-app #generate-btn.is-generating {
	background: linear-gradient(to right, var(--frog) var(--prog, 0%), var(--pond-2) var(--prog, 0%));
	cursor: progress;
}

.ltc-app #generate-btn.is-done {
	background: var(--frog-bright);
	color: var(--pond);
}

.ltc-app #generate-btn.is-done:hover {
	background: #c9dd94;
}

.ltc-app .status {
	min-height: 1.2em;
	margin-top: 10px;
	color: var(--on-dark-muted);
	font-family: var(--mono);
	font-size: 0.8rem;
	text-align: center;
}

/* --- Analyze drop zone --- */
.ltc-app #drop-zone {
	display: grid;
	justify-items: center;
	gap: 4px;
	margin-top: 8px;
	padding: 36px 20px;
	border: 1.5px dashed rgb(255 255 255 / 0.22);
	border-radius: var(--r-l);
	background: rgb(255 255 255 / 0.03);
	color: var(--on-dark);
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

.ltc-app #drop-zone:hover,
.ltc-app #drop-zone.drag-over {
	border-color: var(--frog-bright);
	background: rgb(181 207 120 / 0.06);
}

.ltc-app #drop-zone:focus-visible {
	border-radius: var(--r-l);
}

.ltc-app #drop-zone input[type="file"] {
	display: none;
}

/* a strip of LTC's biphase square wave */
.ltc-app .dz-wave {
	width: 96px;
	height: 26px;
	margin-bottom: 10px;
	fill: none;
	stroke: var(--frog-bright);
	stroke-width: 2;
	stroke-linejoin: round;
}

.ltc-app .dz-main {
	font-weight: 600;
}

.ltc-app .dz-hint {
	color: var(--on-dark-muted);
	font-size: 0.88rem;
}

/* --- Results table --- */
.ltc-app #results {
	display: none;
	margin-top: 22px;
}

.ltc-app #results table {
	width: 100%;
	border-collapse: collapse;
}

.ltc-app #results td {
	padding: 9px 4px;
	border-bottom: 1px solid var(--line-soft);
	white-space: pre-wrap;
}

.ltc-app #results td:first-child {
	width: 42%;
	color: var(--on-dark-muted);
	font-size: 0.92rem;
}

.ltc-app #results td:last-child {
	color: var(--on-dark);
	font-family: var(--mono);
	font-size: 0.92rem;
	font-weight: 600;
}

/* start and end timecode lead the list */
.ltc-app #results .tc-row td:last-child {
	color: var(--frog-bright);
	font-size: 1.15rem;
}

.ltc-app #analyze-status {
	min-height: 1.2em;
	margin-top: 12px;
	color: var(--on-dark-muted);
	font-size: 0.85rem;
	text-align: center;
}

/* --- Options: collapsed under the generator --- */
.ltc-app .options {
	margin-top: 28px;
	border-top: 1px solid var(--line-soft);
}

.ltc-app .options summary {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 5px 10px 5px 4px;
	border-radius: 999px;
	color: var(--on-dark-muted);
	font-size: 0.95rem;
	font-weight: 600;
	list-style: none;
	cursor: pointer;
	transition: color 0.15s;
}

.ltc-app .options summary::-webkit-details-marker {
	display: none;
}

.ltc-app .options summary::before {
	content: "";
	width: 6px;
	height: 6px;
	margin: 0 4px;
	border-right: 1.8px solid var(--frog-bright);
	border-bottom: 1.8px solid var(--frog-bright);
	transform: rotate(-45deg);
	transition: transform 0.15s;
}

.ltc-app .options[open] summary::before {
	transform: translateY(-2px) rotate(45deg);
}

.ltc-app .options summary:hover {
	color: var(--on-dark);
}

.ltc-app .opt-section {
	margin-top: 18px;
}

.ltc-app .opt-section + .opt-section {
	margin-top: 28px;
}

.ltc-app .opt-section h2 {
	margin: 0 0 4px;
	font-size: 1.1rem;
	font-weight: 650;
	letter-spacing: -0.015em;
	line-height: 1.3;
}

.ltc-app .opt-check {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
	cursor: pointer;
}

.ltc-app .opt-check input[type="checkbox"] {
	flex-shrink: 0;
	width: 17px;
	height: 17px;
	margin: 0;
	accent-color: var(--frog);
	cursor: pointer;
}

.ltc-app .opt-check span {
	color: var(--on-dark);
	font-size: 0.95rem;
	font-weight: 500;
}

.ltc-app .input-with-suffix {
	display: flex;
	margin-top: 6px;
}

.ltc-app .input-with-suffix input[type="text"] {
	flex: 1;
	margin-top: 0;
	border-right: 0;
	border-radius: var(--r-s) 0 0 var(--r-s);
}

.ltc-app .input-suffix {
	display: flex;
	align-items: center;
	padding: 0 12px;
	border: 1px solid var(--line);
	border-left: 0;
	border-radius: 0 var(--r-s) var(--r-s) 0;
	background: rgb(255 255 255 / 0.04);
	color: var(--on-dark-muted);
	font-family: var(--mono);
	font-size: 0.95rem;
	white-space: nowrap;
	user-select: none;
}

.ltc-app #filename-preview {
	min-height: 1.1em;
	margin-top: 8px;
	color: var(--frog-bright);
	font-family: var(--mono);
	font-size: 0.88rem;
	overflow-wrap: anywhere;
}

.ltc-app .token-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}

.ltc-app .token {
	padding: 3px 9px;
	border-radius: 8px;
	background: rgb(255 255 255 / 0.06);
	color: var(--on-dark-muted);
	font-size: 0.82rem;
	cursor: default;
}

.ltc-app .token span {
	color: var(--frog-bright);
	font-family: var(--mono);
	font-size: 0.95em;
}

/* --- Bulk generation panel --- */
.ltc-app #bulk-panel {
	display: none;
	margin-top: 10px;
	padding: 14px 16px 16px;
	border: 1px solid var(--line-soft);
	border-radius: var(--r-m);
	background: rgb(0 0 0 / 0.16);
}

.ltc-app #bulk-panel.visible {
	display: block;
}

/* --- Bulk download buttons --- */
.ltc-app #bulk-downloads {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 12px;
}

.ltc-app .bulk-dl-btn {
	display: block;
	width: 100%;
	padding: 9px 14px;
	border: 0;
	border-radius: var(--r-s);
	background: var(--frog-bright);
	color: var(--pond);
	font-family: var(--mono);
	font-size: 0.85rem;
	font-weight: 600;
	text-align: left;
	overflow-wrap: anywhere;
	cursor: pointer;
}

.ltc-app .bulk-dl-btn:hover {
	background: #c9dd94;
}

.ltc-app .bulk-dl-btn.pending {
	border: 1px solid var(--line-soft);
	background: rgb(255 255 255 / 0.03);
	color: var(--on-dark-muted);
	font-weight: 400;
	cursor: default;
}

@media (max-width: 560px) {
	.ltc-app .row {
		flex-direction: column;
		gap: 0;
	}

	.ltc-app .row label {
		margin-top: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ltc-app #drop-zone,
	.ltc-app .tab-btn,
	.ltc-app #generate-btn,
	.ltc-app input,
	.ltc-app select,
	.ltc-app .options summary,
	.ltc-app .options summary::before {
		transition: none;
	}
}
