:root {
	color-scheme: light;
	--color-paper: #f5f4ef;
	--color-surface: #fffefa;
	--color-ink: #202b28;
	--color-muted: #68736d;
	--color-line: #dce2d9;
	--color-green: #246b53;
	--color-green-dark: #194e3e;
	--color-coral: #e7785d;
	--font-body: "Trebuchet MS", "Segoe UI", sans-serif;
	--font-display: Georgia, "Times New Roman", serif;
}

* {
	box-sizing: border-box;
}

body {
	min-width: 320px;
	min-height: 100vh;
	margin: 0;
	color: var(--color-ink);
	background-color: var(--color-paper);
	background-image: radial-gradient(#d9ded4 0.7px, transparent 0.7px);
	background-size: 18px 18px;
	font-family: var(--font-body);
}

button,
input {
	font: inherit;
}

button {
	color: inherit;
}

.app-shell {
	width: min(100% - 32px, 760px);
	min-height: 100vh;
	margin: 0 auto;
	padding: 42px 0 110px;
}

.page-header {
	margin-bottom: 30px;
}

.eyebrow {
	margin: 0 0 12px;
	color: var(--color-green);
	font-size: 0.72rem;
	font-weight: 700;
}

h1,
h2,
p {
	margin-top: 0;
}

h1 {
	margin-bottom: 8px;
	font-family: var(--font-display);
	font-size: clamp(2.5rem, 10vw, 3.6rem);
	font-weight: 400;
	line-height: 1.05;
}

.page-intro {
	max-width: 34ch;
	margin-bottom: 0;
	color: var(--color-muted);
	font-size: 0.98rem;
	line-height: 1.55;
}

.places-toolbar {
	display: grid;
	gap: 17px;
}

.search-form {
	position: relative;
}

.search-form input {
	width: 100%;
	min-height: 52px;
	padding: 0 18px 0 48px;
	border: 1px solid var(--color-line);
	border-radius: 8px;
	outline: none;
	background: var(--color-surface);
	color: var(--color-ink);
}

.search-form input::placeholder {
	color: #858e88;
}

.search-form input:focus-visible {
	border-color: var(--color-green);
	box-shadow: 0 0 0 3px rgb(36 107 83 / 14%);
}

.search-icon {
	position: absolute;
	top: 17px;
	left: 18px;
	width: 15px;
	height: 15px;
	border: 1.7px solid var(--color-muted);
	border-radius: 50%;
}

.search-icon::after {
	position: absolute;
	right: -5px;
	bottom: -3px;
	width: 7px;
	height: 1.7px;
	background: var(--color-muted);
	content: "";
	transform: rotate(48deg);
}

.filters {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 1px 0 5px;
	scrollbar-width: none;
}

.filters::-webkit-scrollbar {
	display: none;
}

.filter-button {
	flex: 0 0 auto;
	min-height: 38px;
	padding: 0 14px;
	border: 1px solid var(--color-line);
	border-radius: 999px;
	background: var(--color-surface);
	color: var(--color-muted);
	cursor: pointer;
	font-size: 0.86rem;
}

.filter-button.is-active {
	border-color: var(--color-green);
	background: var(--color-green);
	color: white;
}

.filter-button:focus-visible,
.save-button:focus-visible {
	outline: 3px solid rgb(231 120 93 / 55%);
	outline-offset: 3px;
}

.places-section {
	min-height: 330px;
	margin-top: 23px;
	border-top: 1px solid var(--color-line);
}

.places-list {
	display: grid;
	gap: 14px;
}

.place-cards {
	display: grid;
	gap: 14px;
}

.no-results {
	margin: 0;
	padding: 44px 18px;
	color: var(--color-muted);
	font-size: 0.95rem;
	line-height: 1.5;
	text-align: center;
}

.no-results[hidden] {
	display: none;
}

.empty-state {
	display: grid;
	justify-items: center;
	padding: 45px 18px 36px;
	text-align: center;
}

.empty-state[hidden] {
	display: none;
}

.empty-illustration {
	position: relative;
	width: 150px;
	height: 116px;
	margin-bottom: 22px;
	overflow: hidden;
}

.illustration-sun {
	position: absolute;
	top: 13px;
	right: 25px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #f1bd68;
}

.illustration-hill {
	position: absolute;
	bottom: -38px;
	width: 150px;
	height: 100px;
	border-radius: 50% 50% 0 0;
	transform: rotate(-11deg);
}

.illustration-hill-back {
	left: -40px;
	background: #b5c9a6;
}

.illustration-hill-front {
	right: -49px;
	bottom: -49px;
	background: #6e9a79;
	transform: rotate(12deg);
}

.illustration-pin {
	position: absolute;
	top: 27px;
	left: 53px;
	display: grid;
	width: 37px;
	height: 37px;
	place-items: center;
	border: 4px solid var(--color-surface);
	border-radius: 50% 50% 50% 4px;
	background: var(--color-coral);
	color: white;
	font-size: 1.25rem;
	line-height: 1;
	transform: rotate(-45deg);
}

.illustration-pin span {
	transform: rotate(45deg);
}

.empty-state h2 {
	margin-bottom: 8px;
	font-family: var(--font-display);
	font-size: 1.35rem;
	font-weight: 400;
}

.empty-state p {
	max-width: 30ch;
	margin-bottom: 0;
	color: var(--color-muted);
	font-size: 0.92rem;
	line-height: 1.5;
}

.save-button {
	position: fixed;
	right: max(16px, calc((100vw - 760px) / 2));
	bottom: max(18px, env(safe-area-inset-bottom));
	left: max(16px, calc((100vw - 760px) / 2));
	display: flex;
	min-height: 54px;
	align-items: center;
	justify-content: center;
	gap: 9px;
	border: 0;
	border-radius: 8px;
	background: var(--color-green);
	box-shadow: 0 8px 22px rgb(25 78 62 / 18%);
	color: white;
	cursor: pointer;
	font-weight: 700;
}

.save-button:hover {
	background: var(--color-green-dark);
}

.save-button span {
	font-size: 1.3rem;
	font-weight: 400;
	line-height: 1;
}

.place-dialog {
	width: min(100% - 28px, 500px);
	max-width: 500px;
	max-height: min(88vh, 760px);
	padding: 0;
	border: 1px solid var(--color-line);
	border-radius: 12px;
	background: var(--color-surface);
	color: var(--color-ink);
	box-shadow: 0 24px 80px rgb(32 43 40 / 24%);
}

.place-dialog::backdrop {
	background: rgb(26 38 33 / 54%);
	backdrop-filter: blur(3px);
}

.place-form {
	display: grid;
	gap: 16px;
	padding: 24px;
}

.form-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 2px;
}

.form-heading .eyebrow {
	margin-bottom: 7px;
}

.form-heading h2 {
	margin-bottom: 0;
	font-family: var(--font-display);
	font-size: 1.65rem;
	font-weight: 400;
}

.dialog-close {
	width: 36px;
	height: 36px;
	border: 1px solid var(--color-line);
	border-radius: 50%;
	background: transparent;
	color: var(--color-muted);
	cursor: pointer;
	font-size: 1.45rem;
	line-height: 1;
}

.form-field {
	display: grid;
	gap: 7px;
	font-size: 0.88rem;
	font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--color-line);
	border-radius: 7px;
	background: white;
	color: var(--color-ink);
	font-size: 0.94rem;
}

.form-field textarea {
	min-height: 82px;
	resize: vertical;
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
	border-color: var(--color-green);
	outline: 3px solid rgb(36 107 83 / 14%);
}

.required-mark {
	color: #b44e39;
}

.field-hint {
	color: var(--color-muted);
	font-size: 0.78rem;
	font-weight: 400;
}

.favorite-field {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 0.9rem;
}

.favorite-field input {
	width: 18px;
	height: 18px;
	accent-color: var(--color-green);
}

.form-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 4px;
}

.cancel-button,
.submit-button {
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--color-line);
	border-radius: 7px;
	cursor: pointer;
	font-weight: 700;
}

.cancel-button {
	background: transparent;
	color: var(--color-muted);
}

.submit-button {
	border-color: var(--color-green);
	background: var(--color-green);
	color: white;
}

.place-card {
	padding: 18px;
	border: 1px solid var(--color-line);
	border-radius: 8px;
	background: var(--color-surface);
}

.place-card-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.place-card h3 {
	margin: 0;
	font-family: var(--font-display);
	font-size: 1.35rem;
	font-weight: 400;
	overflow-wrap: anywhere;
}

.favorite-indicator {
	flex: 0 0 auto;
	color: #c6533f;
	font-size: 1.1rem;
}

.place-card-details {
	display: grid;
	gap: 10px;
	margin-top: 12px;
}

.place-detail {
	margin: 0;
	color: var(--color-muted);
	font-size: 0.9rem;
	line-height: 1.5;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.place-status {
	width: fit-content;
	padding: 5px 10px;
	border-radius: 999px;
	background: #e7efe5;
	color: var(--color-green-dark);
	font-size: 0.8rem;
	font-weight: 700;
}

.place-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.place-tags li {
	padding: 5px 9px;
	border-radius: 999px;
	background: #f1eee4;
	color: #5c6259;
	font-size: 0.8rem;
}

.maps-link {
	display: inline-flex;
	width: fit-content;
	min-height: 40px;
	align-items: center;
	margin-top: 15px;
	padding: 0 13px;
	border: 1px solid var(--color-green);
	border-radius: 7px;
	color: var(--color-green-dark);
	font-size: 0.88rem;
	font-weight: 700;
	text-decoration: none;
}

.maps-link:hover {
	background: #edf3ed;
}

.place-card-actions {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}

.place-action-button {
	min-height: 36px;
	padding: 0 11px;
	border: 1px solid var(--color-line);
	border-radius: 7px;
	background: transparent;
	color: var(--color-muted);
	cursor: pointer;
	font-size: 0.84rem;
	font-weight: 700;
}

.place-action-button:hover {
	border-color: var(--color-green);
	color: var(--color-green-dark);
}

.place-action-button.delete-place:hover {
	border-color: #b44e39;
	color: #963d2c;
}

.dialog-close:focus-visible,
.cancel-button:focus-visible,
.submit-button:focus-visible,
.maps-link:focus-visible,
.place-action-button:focus-visible {
	outline: 3px solid rgb(231 120 93 / 55%);
	outline-offset: 3px;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (min-width: 700px) {
	.app-shell {
		padding-top: 64px;
	}

	.page-header {
		margin-bottom: 38px;
	}

	.places-toolbar {
		grid-template-columns: minmax(240px, 1fr) auto;
		align-items: center;
	}

	.filters {
		justify-content: flex-end;
	}

	.places-section {
		margin-top: 28px;
	}

	.empty-state {
		padding-top: 62px;
	}
}

@media (max-width: 420px) {
	.place-form {
		gap: 13px;
		padding: 19px;
	}

	.form-actions button {
		flex: 1;
		padding: 0 10px;
	}
}
