/**
 * Mobile Oberfläche und Rückmeldungen.
 *
 * @package Weih
 */
:root {
	color-scheme: light;
	--bg: #f6f4ef;
	--paper: #fffefb;
	--text: #263c32;
	--muted: #69756c;
	--accent: #35694b;
	--line: #dedfd5;
	--danger: #a33931;
	font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
	color: var(--text);
	background: var(--bg);
	font-synthesis: none;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
}

button,input,textarea,a {
	-webkit-tap-highlight-color: transparent;
}

button,input,textarea {
	font: inherit;
}

button,a,input,textarea,summary {
	touch-action: manipulation;
}

button,.button {
	min-height: 48px;
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 12px 16px;
	background: var(--paper);
	color: var(--text);
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	text-align: center;
}

button:disabled {
	opacity: .55;
	cursor: wait;
}

button:active,.button:active {
	transform: translateY(1px);
}

.food-toggle:active {
	transform: none;
}

:focus-visible {
	outline: 3px solid #c87937;
	outline-offset: 3px;
}

.app {
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
	padding: 32px 18px max(24px,env(safe-area-inset-bottom));
	overflow-wrap: anywhere;
}

header {
	margin-bottom: 30px;
}

h1 {
	font-size: clamp(38px,12vw,54px);
	letter-spacing: -2px;
	line-height: 1.06;
	margin: 0 0 14px;
	font-weight: 750;
}

h1 span {
	color: #c87937;
}

h2 {
	font-size: 22px;
	margin: 0 0 22px;
}

h3 {
	font-size: 14px;
	margin: 0 0 12px;
}

.muted {
	color: var(--muted);
	font-size: 14px;
	line-height: 1.5;
}

p {
	line-height: 1.5;
}

.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: white;
}

input,textarea {
	display: block;
	width: 100%;
	min-width: 0;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--paper);
	padding: 14px;
	color: var(--text);
	font-size: 16px;
	line-height: 1.4;
}

textarea {
	resize: vertical;
}

label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin: 18px 0 8px;
}

.toolbar>.primary {
	width: 100%;
	margin-bottom: 16px;
}

.list-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 54px;
}

.list-heading p {
	margin: 0;
}

.text-button {
	border: 0;
	background: transparent;
	color: var(--accent);
	padding: 10px 4px;
	font-size: 14px;
}

.food-card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 18px;
	margin-bottom: 10px;
	overflow: hidden;
}

.food-toggle {
	border: 0;
	border-radius: 0;
	width: 100%;
	justify-content: space-between;
	text-align: left;
	gap: 14px;
	padding: 17px 18px;
	min-height: 72px;
	background: transparent;
}

.food-name {
	font-size: 17px;
	line-height: 1.4;
	font-weight: 650;
	min-width: 0;
}

.toggle-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 34px;
	height: 34px;
	border-radius: 50%;
	background: #edf0e6;
	color: var(--accent);
	font-size: 25px;
	font-weight: 400;
}

.food-details {
	padding: 0 18px 18px;
}

.ingredients {
	padding: 0;
	list-style: none;
	margin: 0 0 20px;
}

.ingredients li {
	padding: 9px 0;
	border-bottom: 1px solid #ecece4;
	line-height: 1.5;
	font-size: 15px;
	white-space: pre-wrap;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.actions>* {
	flex: 1;
	min-width: 100px;
}

.panel {
	background: #eceee4;
	border-radius: 18px;
	padding: 20px;
	margin-top: 24px;
}

.panel>summary {
	list-style: none;
	cursor: pointer;
	min-height: 48px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-size: 16px;
	font-weight: 650;
}

.panel>summary::-webkit-details-marker {
	display: none;
}

.panel[open]>summary span {
	transform: rotate(45deg);
}

form>.primary {
	width: 100%;
	margin-top: 16px;
}

.edit-form {
	padding: 0 18px 18px;
}

.danger {
	border: 0;
	color: var(--danger);
	background: transparent;
	margin-top: 12px;
	width: 100%;
}

.form-message,#login-message {
	color: var(--danger);
	font-size: 14px;
}

.form-message:empty,#login-message:empty,#status:empty,#similar:empty {
	display: none;
}

#status {
	font-size: 14px;
}

footer {
	display: flex;
	justify-content: center;
	margin-top: 24px;
}

.empty {
	text-align: center;
	padding: 28px 12px;
	color: var(--muted);
}

[hidden] {
	display: none!important;
}

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

.ingredient-fields {
	border: 0;
	padding: 0;
	margin: 24px 0 0;
	min-width: 0;
}

.ingredient-fields label {
	margin-top: 12px;
}

/* Feste Spalten und gezeichnetes Symbol: identische Position offen/geschlossen. */
html {
	scrollbar-gutter: stable;
}

.food-toggle {
	display: grid;
	grid-template-columns: minmax(0,1fr) 34px;
	align-items: center;
	width: 100%;
	text-align: left;
	overflow-anchor: none;
}

.food-name {
	display: block;
	width: 100%;
	text-align: left;
}

.toggle-icon {
	position: relative;
	width: 34px;
	height: 34px;
	line-height: 1;
	padding: 0;
}

.toggle-icon::before,.toggle-icon::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 14px;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
	transform: translate(-50%,-50%);
}

.toggle-icon::after {
	transform: translate(-50%,-50%) rotate(90deg);
}

.food-toggle[aria-expanded="true"] .toggle-icon::after {
	visibility: hidden;
}

.food-details {
	overflow-anchor: none;
}

.ingredients li {
	padding: 0;
}

.ingredient-row {
	display: grid;
	grid-template-columns: minmax(0,1fr) 44px;
	align-items: center;
	gap: 12px;
}

.ingredient-name {
	color: var(--accent);
	font-weight: 500;
}

.ingredient-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	min-height: 48px;
	color: var(--accent);
	text-decoration: none;
	font-weight: 500;
}

.ingredient-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	font-size: 20px;
}

.edit-form > .actions {
	margin-top: 16px;
}

.footer-links {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	flex-wrap: wrap;
}

a.text-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	text-decoration: none;
	font-weight: 600;
}

.transfer-page h1 {
	font-size: 32px;
	letter-spacing: -1px;
	margin-top: 24px;
}

.transfer-page .panel>.primary {
	width: 100%;
	margin-top: 16px;
}

.transfer-page .actions {
	margin-top: 16px;
}

#import-file {
	font-size: 16px;
	padding: 12px 8px;
}

#import-preview {
	margin-top: 20px;
}

.import-entry {
	border-top: 1px solid var(--line);
	padding: 10px 0;
}

.import-entry summary {
	min-height: 48px;
	cursor: pointer;
	line-height: 1.5;
	padding: 8px 0;
	font-size: 14px;
}

.import-entry h3 {
	margin-top: 16px;
}

.import-entry .ingredients li {
	padding: 8px 0;
}

.food-heading {
	display: grid;
	grid-template-columns: minmax(0,1fr) 48px;
	align-items: center;
	padding-right: 8px;
}

.food-heading .food-toggle {
	min-width: 0;
	padding-right: 0;
}

.food-shortcut {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	min-height: 48px;
	color: var(--accent);
	text-decoration: none;
	font-size: 20px;
	font-weight: 500;
}

.food-shortcut {
	position: relative;
	isolation: isolate;
}

.food-shortcut::before {
	content: "";
	position: absolute;
	z-index: -1;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #edf0e6;
}

.search-field {
	position: relative;
}

.search-field input {
	padding-right: 52px;
}

.search-field input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

#search-clear {
	position: absolute;
	right: 2px;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 26px;
	color: var(--muted);
}

#edit-name {
	min-height: calc(4.2em + 30px);
	resize: vertical;
}

.shortcut-steps {
	padding-left: 22px;
	line-height: 1.6;
}

.shortcut-steps li {
	margin-bottom: 16px;
}

.food-detail-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 4px;
	overflow-x: auto;
}

.food-detail-actions .text-button {
	flex: 0 0 auto;
	white-space: nowrap;
	min-height: 44px;
	padding: 8px 0;
	font-size: 12px;
	font-weight: 500;
	margin: 0;
}

.food-detail-actions .copy-button {
	color: var(--muted);
}

.shortcut-download {
	margin-bottom: 28px;
}

.shortcut-download>.button {
	width: 100%;
	margin: 8px 0 12px;
}

/* Deutliche Farbrückmeldung ohne Bewegung oder Layoutverschiebung. */
.ingredient-link.shortcut-launching .ingredient-arrow {
	animation: shortcut-highlight 1.4s ease-out;
}

.food-shortcut.shortcut-launching {
	animation: shortcut-arrow-highlight 1.4s ease-out;
}

.food-shortcut.shortcut-launching::before {
	animation: shortcut-highlight 1.4s ease-out;
}

@keyframes shortcut-highlight {
	0%,65% {
		background-color: #35694b;
		color: #fff;
	}

	100% {
		background-color: transparent;
		color: var(--accent);
	}

}

@keyframes shortcut-arrow-highlight {
	0%,65% {
		color: #fff;
	}

	100% {
		color: var(--accent);
	}

}

.login-trap {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

