.hero {
	text-align: center;
	padding: 1.5em 0 0.8em;
}

.hero h1 {
	margin-bottom: 0.4em;
}

.panel {
	max-width: 940px;
	margin: 0 auto;
	padding: 0.4em 0 0.8em;
}

.upload-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.8em;
	align-items: stretch;
}

.source-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
	gap: 0.8em;
	align-items: stretch;
	min-width: 0;
}

.drop-zone {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 86px;
	padding: 0.9em 1em;
	border: 1px dashed #6b956b;
	border-radius: 4px;
	background: #f7fbf5;
	box-sizing: border-box;
	cursor: pointer;
}

.drop-zone.is-dragover {
	background: #edf6ea;
	outline: 2px solid rgba(0, 51, 0, 0.25);
	outline-offset: 1px;
}

.drop-zone-title {
	font-weight: bold;
	color: #003300;
}

.drop-zone-sub {
	margin-top: 0.25em;
	color: #555555;
	word-break: break-word;
}

.url-source {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.35em;
	min-height: 86px;
}

.url-label {
	font-weight: bold;
	color: #003300;
}

.url-input,
.result-input {
	width: 100%;
	min-width: 0;
	padding: 0.75em 0.9em;
	border: 1px solid #a7a7a7;
	border-radius: 4px;
	font-size: 1rem;
	box-sizing: border-box;
}

.url-input:focus,
.result-input:focus {
	outline: 2px solid rgba(0, 51, 0, 0.25);
	outline-offset: 1px;
}

.primary-button,
.secondary-button {
	border: 1px solid #003300;
	background: #003300;
	color: #ffffff;
	padding: 0.75em 1.2em;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.95rem;
	white-space: nowrap;
	text-align: center;
	text-decoration: none;
	box-sizing: border-box;
}

.secondary-button {
	background: #ffffff;
	color: #003300;
}

.primary-button:hover,
.secondary-button:hover,
.action-link:hover {
	background: #006400;
	color: #ffffff;
}

.primary-button:disabled,
.secondary-button:disabled {
	opacity: 0.55;
	cursor: wait;
}

.status-line {
	min-height: 1.6em;
	margin-top: 0.8em;
}

.note-list {
	padding-left: 1.2em;
}

.result-panel {
	background: #f6fbf4;
	border: 1px solid #d7e6d2;
	padding: 1em;
}

.result-layout {
	display: grid;
	grid-template-columns: 180px minmax(0, 1fr);
	gap: 1em;
	align-items: start;
}

.preview-link {
	display: block;
	background: #ffffff;
	border: 1px solid #d7e6d2;
	border-radius: 4px;
	padding: 0.4em;
}

.preview-link:hover {
	background: #ffffff;
}

.result-preview {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: contain;
}

.result-meta {
	margin: 0.65em 0;
	color: #555555;
}

.button-row {
	display: flex;
	gap: 0.8em;
	align-items: center;
	flex-wrap: wrap;
}

.history-block {
	margin-top: 1.2em;
}

.history-empty {
	color: #666666;
}

.history-table-wrap {
	overflow-x: auto;
}

.history-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.history-table th,
.history-table td {
	padding: 0.6em 0.7em;
	border: 1px solid #d7e6d2;
	vertical-align: middle;
	text-align: left;
	word-break: break-word;
}

.history-table th {
	background: #edf6ea;
	font-weight: normal;
}

.history-thumb-cell {
	width: 120px;
}

.history-thumb {
	display: block;
	width: 84px;
	height: 84px;
	object-fit: contain;
	background: #ffffff;
	border: 1px solid #d7e6d2;
	border-radius: 4px;
}

.history-date {
	width: 11em;
	font-variant-numeric: tabular-nums;
}

.history-actions {
	display: flex;
	gap: 0.6em;
	flex-wrap: wrap;
}

.history-actions .primary-button,
.history-actions .secondary-button {
	padding: 0.5em 0.75em;
	font-size: 0.86rem;
}

.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;
}

@media (max-width: 700px) {
	.upload-form,
	.source-grid,
	.result-layout {
		grid-template-columns: 1fr;
	}

	.primary-button,
	.secondary-button,
	.action-link {
		width: 100%;
	}

	.history-table {
		table-layout: auto;
	}

	.history-thumb-cell {
		width: auto;
	}
}
