@media (max-width: 900px) {
	body {
		padding: 12px;
	}

	.container {
		border-radius: 14px;
		max-width: 100%;
	}

	.top-nav {
		display: flex;
		flex-wrap: nowrap;
		gap: 8px;
		overflow-x: auto;
		overflow-y: hidden;
		padding: 12px 14px;
		justify-content: flex-start;
		-webkit-overflow-scrolling: touch;
	}

	.top-nav a {
		flex: 0 0 auto;
		padding: 9px 12px;
		font-size: 0.92rem;
	}

	.header {
		padding: 24px 18px;
		text-align: left;
	}

	.header h1 {
		font-size: 1.75rem;
		line-height: 1.2;
		letter-spacing: 0;
	}

	.header p {
		font-size: 1rem;
		line-height: 1.5;
	}

	.content,
	.tools-section,
	.controls-section,
	.result-section {
		padding: 22px 16px;
	}

	.panel,
	.result-section,
	.tool-card,
	.action-card {
		border-radius: 12px;
		padding: 18px;
	}

	.form-grid,
	.controls-grid,
	.table-controls-grid,
	.tools-grid,
	.actions,
	#content > section {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.button-group,
	.download-controls,
	.result-header,
	.inline-info,
	.map-view-toggle,
	.export-buttons {
		align-items: stretch;
		flex-direction: column;
	}

	.btn,
	.actions button,
	.action-card button,
	.tool-card a,
	.map-view-button,
	.tab,
	.btn-copy {
		width: 100%;
		max-width: none;
	}

	.tabs {
		overflow-x: auto;
		padding: 12px 16px;
		gap: 8px;
		-webkit-overflow-scrolling: touch;
	}

	.tabs .tab {
		flex: 0 0 auto;
		width: auto;
	}

	.download-controls .form-group {
		width: 100%;
	}

	.svg-display-area {
		height: min(360px, 70vh);
		margin: 12px 0;
	}

	.map-display-area {
		height: min(420px, 65vh);
	}

	.table-display-area {
		max-height: 60vh;
		overflow: auto;
	}

	table.preview-table,
	table.diff-table {
		font-size: 13px;
	}

	table.preview-table thead th,
	table.preview-table tbody td,
	table.diff-table thead th,
	table.diff-table tbody td {
		padding: 8px 10px;
	}

	.tool-container {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	textarea {
		width: 100%;
		min-height: 220px;
	}

	.layout-area-wrapper {
		min-height: 430px;
		overflow: auto;
	}

	.layout-area {
		min-width: 680px;
		min-height: 420px;
	}

	.export-buttons {
		grid-template-columns: 1fr;
	}

	.list-popover-panel {
		border-radius: 16px;
		max-height: calc(100vh - 24px);
	}

	.list-popover-header,
	.list-popover-entry-header {
		flex-direction: column;
	}

	.person-list-container {
		max-height: 260px;
	}
}

@media (max-width: 480px) {
	body {
		padding: 8px;
	}

	.container {
		border-radius: 10px;
	}

	.header,
	.content,
	.tools-section,
	.controls-section,
	.result-section {
		padding-left: 14px;
		padding-right: 14px;
	}

	.header h1 {
		font-size: 1.45rem;
	}

	.header p,
	.panel p.lead,
	.action-card p,
	.tool-card p {
		font-size: 0.95rem;
	}

	.panel,
	.result-section,
	.tool-card,
	.action-card {
		padding: 16px;
	}

	.panel-footer {
		align-items: stretch;
		flex-direction: column;
		gap: 10px;
	}

	.empty-state {
		padding: 36px 14px;
		width: min(100%, 300px);
	}

	.svg-display-area {
		height: 320px;
	}

	.map-display-area {
		height: 360px;
	}
}
