:root {
  color-scheme: light dark;
  --bg: #0b0b0f;
  --bg-card: #15151c;
  --accent: #ffb300;
  --accent-soft: rgba(255, 179, 0, 0.15);
  --text-main: #f5f5f7;
  --text-muted: #a0a0b3;
  --border-soft: #262637;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top, #20203a 0, #050509 55%);
  color: var(--text-main);
}

.app-header {
  padding: 16px 20px 8px;
}

.app-title {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.app-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.app-main {
  padding: 0 12px 20px;
}

.toolbar {
  position: sticky;
  top: 0;
  padding: 8px 0 10px;
  background: linear-gradient(to bottom, #050509 0, rgba(5, 5, 9, 0.85) 60%, transparent 100%);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.toolbar-row + .toolbar-row {
  margin-top: 8px;
}

.search-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: #050509;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 179, 0, 0.4);
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  border: 1px solid var(--border-soft);
  background: rgba(21, 21, 28, 0.9);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
}

.tag-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag-chip-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.tag-chip-small {
  font-size: 0.7rem;
  padding: 3px 8px;
}

.recipe-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(21, 21, 28, 0.98), #050509);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.recipe-main {
  display: flex;
  gap: 10px;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.recipe-image-wrapper {
  width: 88px;
  min-width: 88px;
  height: 88px;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at top, #2b2030, #050509);
}

.recipe-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recipe-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.recipe-description {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.recipe-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.btn {
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(255, 179, 0, 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  padding: 5px 12px;
  cursor: pointer;
}

.btn-secondary {
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Modali generiche */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal-shell {
  position: relative;
  z-index: 1;
  width: min(640px, 100vw - 24px);
  border-radius: 18px;
  background: #050509;
  border: 1px solid var(--border-soft);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 2;
}

.modal-body {
  padding: 32px 14px 14px;
}

/* Modale video */

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
}

.video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Modale ricetta */

.recipe-modal-body {
  max-height: 80vh;
  overflow-y: auto;
}

.recipe-modal-title {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

.recipe-modal-description {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.recipe-modal-section {
  margin-top: 8px;
}

.recipe-modal-subtitle {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.recipe-modal-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.88rem;
}

.recipe-modal-list li + li {
  margin-top: 2px;
}

body.modal-open {
  overflow: hidden;
}

@media (min-width: 720px) {
  .app-main {
    max-width: 960px;
    margin: 0 auto 24px;
  }

  .recipe-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.app-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.app-title-block {
  display: flex;
  flex-direction: column;
}
.btn-install {
  margin-left: auto;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #00c67a;
  color: #050618;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 198, 122, 0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}

.btn-install:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(0, 198, 122, 0.6);
}

.btn-install:active {
  transform: translateY(0);
  box-shadow: 0 0 8px rgba(0, 198, 122, 0.4);
}

@media (max-width: 640px) {
  .btn-install {
    margin-left: 0;
    margin-top: 8px;
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .app-header-inner {
    flex-wrap: wrap;
  }
}/* Layout card ricette: immagine rettangolare tipo screenshot "buono" */
.recipe-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Contenitore immagine: rettangolo orizzontale, non quadrato */
.recipe-image-wrapper {
  width: 140px;
  aspect-ratio: 16 / 9;    /* rettangolare, non quadrato */
  border-radius: 16px;
  overflow: hidden;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* Testo a destra che occupa tutto lo spazio */
.recipe-text {
  flex: 1;
  min-width: 0;
}

.recipe-title {
  margin: 0 0 4px;
}

.recipe-description {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.3;
}

