[hidden] {
  display: none !important;
}

* { box-sizing: border-box; }

:root {
  --accent: #FF385C;
  --accent-dark: #E31C5F;
  --text: #222222;
  --text-muted: #717171;
  --border: #DDDDDD;
  --card-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  --card-shadow-hover: 0 10px 24px rgba(0, 0, 0, 0.18);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  margin: 0;
  padding: 1.5rem 1rem;
  max-width: 480px;
  margin-inline: auto;
  line-height: 1.5;
  background: #fff;
}

header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

header h1 {
  font-size: 1.25rem;
}

.home-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  text-decoration: none;
  flex-shrink: 0;
}

.menu {
  position: relative;
}

.menu summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  list-style: none;
}

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

.menu summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

.avatar-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #FFB400);
  flex-shrink: 0;
}

.menu nav {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 0.5rem;
  min-width: 200px;
}

.menu nav a,
.menu nav button {
  width: auto;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font-weight: 500;
  margin: 0;
}

.menu nav a:hover,
.menu nav button:hover {
  background: #f7f7f7;
}

.menu nav form {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

h2, h3 {
  color: var(--text);
}

button, input[type=submit] {
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  width: 100%;
  margin-top: 0.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

button:hover, input[type=submit]:hover {
  background: var(--accent-dark);
}

input, select, textarea {
  width: 100%;
  padding: 0.65rem;
  font-size: 1rem;
  margin-top: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}

.card-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.recipe-card {
  border: none;
  border-radius: 16px;
  padding: 0;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.recipe-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.recipe-card .card-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #FFB400);
}

.recipe-card .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-photo {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 10px;
}

.recipe-card .card-body {
  padding: 1rem;
}

.recipe-card .card-body strong {
  font-size: 1.05rem;
}

.recipe-card .card-meta {
  color: var(--text-muted);
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.error {
  color: #b00020;
}

.message {
  color: #0a7d3c;
}

.recipe-actions {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.recipe-actions form {
  flex: 1;
  margin: 0;
}

.recipe-actions > button {
  flex: 1;
}

button.danger {
  background: #fff;
  color: #b00020;
  border: 1px solid #b00020;
}

button.danger:hover {
  background: #fdeceb;
}

.profile-section {
  margin-bottom: 2rem;
}

.profile-section img.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.75rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-align: center;
  padding: 2rem;
  z-index: 100;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

button:disabled {
  background: var(--border);
  cursor: not-allowed;
}

.shopping-list li {
  cursor: pointer;
  padding: 0.2rem 0;
}

.shopping-list li.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.title-with-flags .flags { margin-left: .5rem; font-size: 1.2rem; }
.title-with-flags .flags a { text-decoration: none; margin-left: .25rem; }

details.section { margin: 1rem 0; }
details.section > summary { cursor: pointer; }
details.section > summary h3 { display: inline; margin: 0; }
