/* Ricettario Pro V15 — product redesign */
:root {
  --bg: #f4f0e7;
  --bg-card: #fffdf8;
  --bg-soft: #ebe6dc;
  --border: #d9d2c5;
  --accent: #1f4b3f;
  --accent-strong: #163a31;
  --accent-soft: rgba(31, 75, 63, 0.11);
  --text: #252a27;
  --text-muted: #6f746f;
  --terracotta: #b85f43;
  --terracotta-soft: #f2dfd6;
  --success: #38785d;
  --warning: #b47729;
  --danger: #b5443d;
  --info: #466b78;
  --radius: 18px;
  --shadow-soft: 0 8px 30px rgba(47, 43, 35, 0.07);
  --shadow-strong: 0 18px 50px rgba(47, 43, 35, 0.13);
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Newsreader", Georgia, serif;
  --header-height: 76px;
}

[data-theme="dark"] {
  --bg: #161b18;
  --bg-card: #202722;
  --bg-soft: #29312c;
  --border: #39443d;
  --accent: #a8c9b8;
  --accent-strong: #d4e7dc;
  --accent-soft: rgba(168, 201, 184, 0.13);
  --text: #f2efe7;
  --text-muted: #aab1ab;
  --terracotta: #dd8a6d;
  --terracotta-soft: rgba(221, 138, 109, 0.13);
  --success: #83b99a;
  --warning: #e4b76d;
  --danger: #ed8b83;
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.22);
  --shadow-strong: 0 18px 55px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { max-width: 100%; overflow-x: clip; scroll-padding-top: var(--app-scroll-offset, calc(var(--header-height) + 26px)); }

body {
  max-width: 100%;
  overflow-x: clip;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 3% 2%, rgba(184, 95, 67, 0.10), transparent 28rem),
    radial-gradient(circle at 95% 20%, rgba(31, 75, 63, 0.09), transparent 32rem),
    var(--bg);
  font-family: var(--font);
  line-height: 1.5;
}

button, input, textarea, select { font-family: inherit; }
button { touch-action: manipulation; }

:where(button, a, input, textarea, select):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--terracotta) 70%, white);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 5000;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  color: white;
  background: var(--accent-strong);
}
.skip-link:focus { transform: translateY(0); }

.container { max-width: 1480px; margin: 0 auto; padding: 18px 30px 60px; }

.app-header {
  position: sticky;
  z-index: 100;
  top: 14px;
  min-height: var(--header-height);
  margin-bottom: 24px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.brand-mark {
  display: inline-grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px 14px 14px 4px;
  color: #fffaf1;
  background: var(--accent-strong);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
}
.brand-lockup h1 { display: flex; margin: 0; flex-direction: column; font-family: var(--font-display); font-size: 23px; line-height: .9; letter-spacing: -.02em; }
.brand-lockup h1 strong { display: inline; color: var(--terracotta); font: inherit; }
.brand-lockup h1 small { margin-top: 8px; color: var(--text-muted); font-family: var(--font); font-size: 9px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }

.primary-nav { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--bg-soft); }
.nav-item {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  color: var(--text-muted);
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}
.nav-item:hover, .nav-item.active { color: var(--text); background: var(--bg-card); box-shadow: 0 2px 10px rgba(44, 38, 28, .06); }

.user-area { gap: 8px; }
.header-tools-btn, .theme-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--bg-card);
  cursor: pointer;
}
.header-tools-btn:hover, .theme-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
.theme-toggle { width: 42px; padding: 0; }
.theme-toggle-label { display: none; }
.sync-status { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 15%, transparent); }
.sync-status.offline .status-dot { background: var(--warning); }
.user-email { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

#collections-btn, #ai-btn, #analytics-btn, #language-btn, #converter-btn,
#calculator-btn, #timer-btn, #stats-btn, #export-btn, #shopping-list-btn { display: none; }

main { display: block; }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); box-shadow: var(--shadow-soft); }

.auth-section { max-width: 1180px; min-height: min(760px, calc(100vh - 136px)); margin: 22px auto; }
.auth-layout { display: grid; min-height: inherit; grid-template-columns: minmax(0, 1.24fr) minmax(360px, .76fr); overflow: hidden; border: 1px solid var(--border); border-radius: 28px; background: var(--bg-card); box-shadow: var(--shadow-strong); }
.auth-story {
  position: relative;
  min-height: 700px;
  overflow: hidden;
  background: url("../images/og.png") center / cover no-repeat;
}
.auth-story::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20, 35, 29, .88), transparent 52%); }
.auth-story-content { position: absolute; z-index: 1; right: 28px; bottom: 26px; left: 28px; color: #fffdf8; }
.auth-story-content > .eyebrow, .auth-story-content > h1, .auth-story-content > p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.auth-benefits { display: grid; margin: 0; padding: 0; grid-template-columns: repeat(3, 1fr); gap: 10px; list-style: none; }
.auth-benefits li { padding: 15px; border: 1px solid rgba(255,255,255,.22); border-radius: 15px; background: rgba(20, 30, 25, .40); backdrop-filter: blur(12px); }
.auth-benefits li span { display: block; margin-bottom: 9px; color: #e6b4a3; font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.auth-benefits strong { display: block; font-size: 13px; }
.auth-benefits small { display: block; margin-top: 4px; color: rgba(255,255,255,.72); font-size: 10px; line-height: 1.35; }

.auth-card { display: flex; padding: clamp(34px, 5vw, 66px); justify-content: center; flex-direction: column; border: 0; border-radius: 0; box-shadow: none; }
.mobile-brand { display: none; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--terracotta); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.auth-card > h2 { margin: 0; font-family: var(--font-display); font-size: clamp(32px, 4vw, 46px); line-height: 1; letter-spacing: -.03em; }
.auth-intro { margin: 12px 0 26px; color: var(--text-muted); font-size: 14px; }
.auth-card .btn, .auth-card input { min-height: 48px; border-radius: 13px; }
.auth-card .btn-google { color: var(--text); background: var(--bg-card); }
.auth-card .auth-form { gap: 13px; }
.auth-card .auth-form h3 { display: none; }
.auth-card label { font-weight: 600; }
.auth-card input { margin-top: 4px; background: var(--bg-soft); }
.auth-links { line-height: 1.9; }
.guest-entry { display: flex; margin-bottom: 6px; align-items: stretch; flex-direction: column; }
.guest-entry > span { font-size: 13px; font-weight: 600; }
.guest-entry small { margin-top: 6px; color: var(--text-muted); font-size: 10px; text-align: center; }
.guest-entry-primary .btn { color: #fffaf1; background: var(--terracotta); }
.guest-entry-primary .btn:hover { background: color-mix(in srgb, var(--terracotta) 88%, black); }
.btn-quiet { margin: 4px 0 0; padding: 0; color: var(--accent); background: transparent; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
.btn-quiet:hover { color: var(--terracotta); background: transparent; transform: none; box-shadow: none; }

.dashboard-strip {
  display: grid;
  margin-bottom: 20px;
  padding: clamp(22px, 4vw, 38px);
  grid-template-columns: minmax(230px, .68fr) minmax(540px, 1.32fr);
  align-items: center;
  gap: 28px;
  border-radius: 24px;
  color: #fffaf1;
  background: linear-gradient(135deg, #183d34, #2f6251);
  box-shadow: var(--shadow-strong);
}
.dashboard-strip h2 { margin: 0; font-family: var(--font-display); font-size: clamp(34px, 4vw, 54px); font-weight: 600; line-height: .95; letter-spacing: -.035em; }
.dashboard-strip p { margin: 12px 0 0; color: rgba(255,255,255,.68); font-size: 13px; }
.dashboard-strip .eyebrow { color: #e6b4a3; }
.dashboard-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-action { display: flex; min-height: 132px; padding: 15px; align-items: flex-start; flex-direction: column; border: 1px solid rgba(255,255,255,.13); border-radius: 16px; color: #fffaf1; background: rgba(255,255,255,.08); cursor: pointer; text-align: left; transition: transform .18s ease, background .18s ease; }
.quick-action:hover { transform: translateY(-3px); background: rgba(255,255,255,.14); }
.quick-action > span { display: grid; width: 32px; height: 32px; margin-bottom: auto; place-items: center; border-radius: 10px; color: #233c33; background: #f2d5c9; font-size: 18px; }
.quick-action strong { margin-top: 15px; font-size: 13px; }
.quick-action small { color: rgba(255,255,255,.62); font-size: 10px; }

#app-section > .controls.card, #app-section > .card:not(#recipes-list-section):not(#recipe-form-section):not(#recipe-detail-section) { box-shadow: none; }
#app-section > .controls.card { border: 0; background: transparent; }
.controls { gap: 14px; }
.controls-left, .controls-right { gap: 10px; }
.inline-label { min-width: 210px; }
input, select, textarea { min-height: 44px; border-radius: 12px; background: var(--bg-card); }
.btn { min-height: 42px; border-radius: 12px; background: var(--accent-strong); }
.btn:hover { box-shadow: 0 8px 22px var(--accent-soft); }
.btn-outline { color: var(--text); background: var(--bg-card); }
.btn.small { min-height: 38px; padding: 7px 11px; }
.filters-toggle { min-height: 42px; border-radius: 12px; }
.search-input-wrapper input { min-height: 52px; padding-left: 16px !important; border: 1px solid var(--border); border-radius: 15px; background: var(--bg-card); font-size: 15px; box-shadow: var(--shadow-soft); }
.voice-search-btn { width: 44px; height: 44px; }

#recipes-list-section { padding: clamp(18px, 3vw, 28px); }
.section-heading { display: flex; margin-bottom: 8px; align-items: end; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 0; font-family: var(--font-display); font-size: clamp(28px, 3vw, 38px); letter-spacing: -.025em; }
.count-label { padding: 6px 10px; border-radius: 999px; color: var(--text-muted); background: var(--bg-soft); font-size: 11px; }
.recipes-list { max-width: none; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 14px; }
.recipes-list > * { max-width: none; }
.recipe-card { position: relative; min-height: 280px; padding: 10px; gap: 7px; overflow: hidden; border-radius: 17px; box-shadow: none; cursor: pointer; }
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-strong); }
.recipe-card-image { height: 180px; margin: 0 0 7px; border-radius: 12px; object-fit: contain; background: var(--bg-soft); }
.recipe-card:not(:has(.recipe-card-image))::before { content: ""; height: 145px; border-radius: 12px; background: linear-gradient(145deg, var(--terracotta-soft), var(--accent-soft)); }
.recipe-title { font-family: var(--font-display); font-size: 20px; line-height: 1.05; }
.recipe-meta, .recipe-sv { font-size: 11px; }
.recipe-actions { margin-top: auto; }
.recipe-actions .btn { min-width: 40px; min-height: 40px; padding: 7px; }
.badge { padding: 3px 8px; font-size: 9px; }

.detail-image { max-height: 520px; border-radius: 18px; object-fit: contain; background: var(--bg-soft); }
.detail-grid { grid-template-columns: minmax(160px, .65fr) minmax(260px, 1.35fr); gap: 14px; }
.detail-box { padding: 18px; border-radius: 15px; }
.detail-label { margin-bottom: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.detail-value { padding: 4px 0; line-height: 1.55; }
.servings-btn { min-width: 44px; min-height: 44px; }

.modal { background: rgba(20, 27, 23, .68); }
.modal-content { border-radius: 22px; box-shadow: var(--shadow-strong); }

.save-confirm-content, .tools-panel { color: var(--text); background: var(--bg-card); }
.tools-overlay { position: fixed; z-index: 1400; inset: 0; display: flex; padding: 18px; align-items: center; justify-content: center; background: rgba(20,27,23,.65); backdrop-filter: blur(8px); }
.tools-panel { width: min(560px, 100%); padding: 22px; border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-strong); }
.tools-panel-header { display: flex; margin-bottom: 16px; align-items: center; justify-content: space-between; }
.tools-panel-header h2 { margin: 0; font-family: var(--font-display); font-size: 30px; }
.tools-close { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--bg-soft); cursor: pointer; }
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tool-tile { display: flex; min-height: 94px; padding: 13px; align-items: flex-start; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; color: var(--text); background: var(--bg-soft); cursor: pointer; text-align: left; }
.tool-tile:hover { border-color: var(--accent); background: var(--accent-soft); }
.tool-tile span { font-size: 22px; }
.tool-tile strong { margin-top: auto; font-size: 12px; }

.guest-badge { padding: 4px 8px; border-radius: 999px; color: var(--terracotta); background: var(--terracotta-soft); font-size: 11px; font-weight: 700; }
.offline-banner { position: fixed; z-index: 1200; right: 14px; bottom: 14px; padding: 9px 13px; border-radius: 12px; color: var(--text); background: var(--warning); box-shadow: var(--shadow-soft); font-size: 12px; }

.mobile-nav { display: none; }
.app-footer { color: var(--text-muted); }
.app-footer nav { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.app-footer a, .footer-install { color: var(--accent-strong); font: inherit; font-weight: 700; text-decoration: none; }
.footer-install { padding: 0; border: 0; background: transparent; cursor: pointer; }
.install-app-btn { width: 100%; margin-top: 12px; }
.device-install-offer {
  position: relative;
  display: grid;
  margin: 0 0 16px;
  padding: 18px 56px 18px 18px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent-strong) 30%, var(--border));
  border-radius: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 72%, var(--bg-card)), var(--bg-card));
  box-shadow: var(--shadow-soft);
}
.device-install-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 17px 17px 17px 5px;
  color: #fff;
  background: var(--accent-strong);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}
.device-install-copy { min-width: 0; }
.device-install-copy .eyebrow { margin: 0 0 3px; }
.device-install-copy h2 { margin: 0; font-family: var(--font-display); font-size: 25px; line-height: 1.05; }
.device-install-copy p { margin: 6px 0 12px; color: var(--text-muted); font-size: 13px; line-height: 1.45; }
.device-install-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.device-install-actions .btn { min-height: 40px; padding: 8px 13px; }
.device-install-primary { color: #fff; background: var(--accent-strong); }
.device-install-later, .device-install-details {
  padding: 8px 2px;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.device-install-details { display: inline-block; margin-top: 7px; padding: 0; color: var(--accent-strong); }
.device-install-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 11px;
  color: var(--text-muted);
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}
.device-install-close:hover { color: var(--text); background: var(--bg-soft); }
.install-help-overlay { position: fixed; z-index: 1800; inset: 0; display: flex; padding: 18px; align-items: center; justify-content: center; background: rgba(20,27,23,.7); backdrop-filter: blur(9px); }
.install-help-card { position: relative; width: min(430px, 100%); padding: 30px; border: 1px solid var(--border); border-radius: 24px; color: var(--text); background: var(--bg-card); box-shadow: var(--shadow-strong); }
.install-help-card h2 { margin: 8px 0; font-family: var(--font-display); font-size: 34px; line-height: 1; }
.install-help-card ol { padding-left: 22px; color: var(--text-muted); line-height: 1.8; }
.install-help-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--bg-soft); cursor: pointer; }
.install-app-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 17px 17px 17px 5px; color: #fff; background: var(--accent-strong); font-family: var(--font-display); font-size: 30px; }
.install-help-done { width: 100%; }
.account-data-card { max-width: 520px; max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.account-data-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.account-data-header h2 { margin: 0; font-family: var(--font-display); font-size: 34px; }
.danger-zone { margin-top: 22px; padding: 20px; border: 1px solid color-mix(in srgb, #a13b32 45%, var(--border)); border-radius: 16px; background: color-mix(in srgb, #a13b32 8%, var(--bg-card)); }
.danger-zone h3 { margin-top: 0; color: #a13b32; }
.danger-zone label { display: grid; margin: 16px 0 12px; gap: 5px; font-weight: 700; }
.danger-zone input { min-height: 48px; }
.danger-button { width: 100%; background: #a13b32; }
.danger-button:hover { background: #842d27; }
.danger-button:disabled { cursor: not-allowed; opacity: .45; }
.form-status { min-height: 22px; margin-bottom: 0; color: var(--text-muted); font-size: 13px; }

@media (max-width: 1050px) {
  .container { padding: 14px 18px 80px; }
  .primary-nav { display: none; }
  .dashboard-strip { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: 1fr 430px; }
  .auth-benefits { grid-template-columns: 1fr; }
  .auth-benefits li:nth-child(n+2) { display: none; }
}

@media (max-width: 760px) {
  :root { --header-height: 62px; }
  html { scroll-padding-bottom: 88px; }
  body { padding-bottom: 78px; }
  .container { width: 100%; padding: 8px 10px 100px; }
  .app-header { top: 6px; min-height: 58px; margin-bottom: 12px; padding: 8px 10px; border-radius: 16px; }
  .brand-lockup { min-width: 0; }
  .brand-mark { flex-basis: 38px; width: 38px; height: 38px; border-radius: 12px 12px 12px 4px; }
  .brand-lockup h1 { font-size: 19px; }
  .brand-lockup h1 small, .header-tools-btn span:last-child, .sync-status, .user-email, #logout-btn { display: none !important; }
  .header-tools-btn, .theme-toggle { width: 42px; padding: 0; }

  .auth-section { min-height: calc(100vh - 26px); margin: 0; }
  .auth-layout { display: block; min-height: inherit; border-radius: 20px; }
  .auth-story { display: none; }
  .auth-card { min-height: inherit; padding: 28px 22px 34px; }
  .mobile-brand { display: flex; margin-bottom: auto; padding-bottom: 46px; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 22px; }
  .auth-card > h2 { font-size: 39px; }
  .auth-card .btn, .auth-card input { min-height: 50px; }
  .guest-entry { margin-top: 18px; }
  .btn.small, .filters-toggle, .tag-btn, .step-photo-btn { min-height: 44px; }

  .dashboard-strip { padding: 24px 18px; gap: 22px; border-radius: 20px; }
  .dashboard-strip h2 { max-width: 270px; font-size: 42px; }
  .dashboard-actions { grid-template-columns: repeat(2, 1fr); }
  .quick-action { min-height: 112px; }

  #app-section > .controls.card { padding: 0; }
  #app-section > .card { margin-bottom: 10px; }
  .controls { align-items: stretch; }
  .controls-left, .controls-right { justify-content: stretch; }
  .controls-right > .btn { flex: 1; }
  .inline-label { width: 100%; }
  .search-input-wrapper input { min-height: 54px; }
  .filters-advanced { gap: 10px; }
  .filter-group { width: 100%; }
  #recipes-list-section { padding: 18px 12px; }
  .section-heading { align-items: start; }
  .recipes-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .recipe-card { min-height: 250px; padding: 8px; }
  .recipe-card-image { height: 124px; }
  .recipe-card:not(:has(.recipe-card-image))::before { height: 105px; }
  .recipe-title { font-size: 17px; }
  .recipe-actions { display: grid; grid-template-columns: repeat(2, 1fr); }
  .recipe-actions .btn { min-width: 44px; min-height: 44px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-controls { align-items: stretch; }
  .servings-adjuster { align-items: flex-start; }

  .mobile-nav {
    position: fixed;
    z-index: 900;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    display: grid !important;
    height: 68px;
    padding: 6px 8px;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: color-mix(in srgb, var(--bg-card) 92%, transparent);
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(18px);
  }
  .mobile-nav.hidden { display: none !important; }
  .mobile-nav button { display: flex; min-width: 0; min-height: 52px; padding: 5px; align-items: center; justify-content: center; flex-direction: column; gap: 1px; border: 0; border-radius: 13px; color: var(--text-muted); background: transparent; font-size: 9px; cursor: pointer; }
  .mobile-nav button span { font-size: 20px; line-height: 1; }
  .mobile-nav button.active { color: var(--accent-strong); background: var(--accent-soft); }
  .mobile-nav .mobile-add { transform: translateY(-12px); color: #fff; background: var(--terracotta); box-shadow: 0 9px 24px rgba(184,95,67,.30); }
  .mobile-nav .mobile-add span { font-size: 27px; }
  .mobile-nav .mobile-add b { font-size: 9px; }

  .modal { padding: 8px; }
  .device-install-offer { margin-bottom: 10px; padding: 15px 44px 15px 13px; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 11px; border-radius: 16px; }
  .device-install-icon { width: 42px; height: 42px; border-radius: 13px 13px 13px 4px; font-size: 21px; }
  .device-install-copy h2 { font-size: 21px; }
  .device-install-copy p { margin-bottom: 10px; font-size: 12px; }
  .device-install-actions { align-items: stretch; flex-direction: column; }
  .device-install-actions .btn { width: 100%; min-height: 44px; }
  .device-install-later { min-height: 38px; }
  .device-install-close { top: 5px; right: 5px; }
  .install-help-overlay { padding: 8px; align-items: flex-end; }
  .install-help-card { padding: 26px 22px; border-radius: 24px 24px 14px 14px; }
  .modal-content { border-radius: 20px 20px 12px 12px; }
  .tools-overlay { align-items: flex-end; padding: 8px; }
  .tools-panel { border-radius: 24px 24px 14px 14px; }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
  .tool-tile { min-height: 88px; }
  .app-footer { margin-bottom: 70px; }
  .toast-container { top: 76px; right: 10px; left: 10px; gap: 6px; }
  .toast { width: 100%; max-width: 100%; min-height: 0; padding: 10px 12px; gap: 8px; border-radius: 14px; transform: none !important; animation: mobileToastIn .18s ease-out; }
  .toast-content strong { font-size: 13px; }
  .toast-content p { margin: 2px 0 0; font-size: 11px; line-height: 1.3; }
  .toast-close { min-width: 36px; min-height: 36px; }
  #recipe-detail-section > .form-header > h2 { display: none; }
  #recipe-detail-section > .form-header > div { width: 100%; padding-bottom: 5px; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; }
  #recipe-detail-section > .form-header > div::-webkit-scrollbar { display: none; }
  #recipe-detail-section > .form-header .btn { flex: 0 0 auto; min-height: 44px; }
}

@keyframes mobileToastIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 380px) {
  .recipes-list { grid-template-columns: 1fr; }
  .recipe-card-image, .recipe-card:not(:has(.recipe-card-image))::before { height: 170px; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.kitchen-member-list { display: grid; gap: 10px; margin: 14px 0 24px; }
.kitchen-member { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border, #dcd7cc); border-radius: 12px; background: var(--surface-soft, #f6f3eb); }
.kitchen-switch { width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.kitchen-switch:disabled { cursor: default; border-color: var(--primary, #1f4b3f); opacity: 1; }
.kitchen-member div, .kitchen-member strong, .kitchen-member small { display: block; min-width: 0; }
.kitchen-member small, .form-help { color: var(--text-muted, #66716b); font-size: 12px; }
.kitchen-invite { margin: 12px 0; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--primary, #1f4b3f) 8%, transparent); }
.kitchen-invite .modal-footer { justify-content: flex-end; padding: 8px 0 0; }
#kitchen-invite-form, #kitchen-create-form { margin-top: 20px; }
#kitchen-invite-form label, #kitchen-create-form label { display: grid; gap: 7px; font-weight: 700; }
#kitchen-invite-form input, #kitchen-create-form input:not([type="checkbox"]) { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid var(--border, #dcd7cc); border-radius: 12px; font: inherit; }
#kitchen-create-form .checkbox-row { display: flex; grid-template-columns: none; align-items: center; gap: 9px; font-weight: 500; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
