.app-shell {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 90px;
}
 .app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
body.dark .app-header { background: rgba(25,22,28,0.92); }
.header-title-wrap { flex: 1; min-width: 0; }
.header-title-wrap h1 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  text-align: start;
}
.icon-btn, .lang-btn, .small-select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  min-height: 40px;
  padding: 0 12px;
  box-shadow: var(--shadow);
}
.icon-btn { width: 40px; padding: 0; }
.small-select { max-width: 78px; }
.main-nav {
  position: sticky;
  top: 57px;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 10px 12px;
  background: transparent;
}
.nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text);
  box-shadow: var(--shadow);
}
.nav-btn small { font-size: 0.72rem; }
.nav-btn.active {
  background: linear-gradient(135deg, var(--primary), #ff8dbb);
  color: white;
  border-color: transparent;
}
.tab-host { padding: 0 12px 20px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.hero-card { padding: 18px 16px; }
.hero-card h2 { margin: 0 0 10px; font-size: 1.15rem; }
.hero-card p { margin: 0; line-height: 1.7; color: var(--muted); }

.home-controls-card {
  display: grid;
  gap: 12px;
}
.home-section-title {
  margin: 0;
  font-size: 1rem;
}
.home-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}
.mode-grid .mode-btn,
.quick-setting-btn,
.quick-setting-select {
  min-height: 52px;
  border-radius: 16px;
}
.quick-setting-btn,
.quick-setting-select {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 8px 12px;
}
.quick-setting-btn {
  font-weight: 800;
}
.quick-setting-select {
  position: relative;
}
.quick-setting-select .small-select {
  border: none;
  background: transparent;
  box-shadow: none;
  min-height: auto;
  padding: 0;
  max-width: none;
  width: auto;
  font-weight: 800;
}
.setting-icon {
  font-size: 1rem;
  line-height: 1;
}
.mode-summary-inline {
  display: grid;
  gap: 8px;
}
.mode-summary-inline .muted {
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: linear-gradient(135deg, var(--primary), #ff97bf);
  color: white;
  border-radius: 18px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-value { font-size: 1.4rem; font-weight: 800; }
.stat-label { font-size: 0.8rem; margin-top: 4px; }
.stack-form label { display: block; margin-bottom: 10px; }
.stack-form span { display: inline-block; margin-bottom: 6px; font-size: 0.9rem; font-weight: 700; }
.input-field {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 12px 14px;
}
.text-area { min-height: 110px; resize: vertical; }
.two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.button-row, .stack-buttons {
  display: grid;
  gap: 10px;
}
.button-row { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.primary-btn, .secondary-btn, .ghost-btn, .danger-btn {
  min-height: 48px;
  border-radius: 16px;
  border: none;
  padding: 10px 14px;
  font-weight: 800;
}
.primary-btn { background: linear-gradient(135deg, var(--primary), #ff8dbb); color: white; }
.secondary-btn { background: linear-gradient(135deg, var(--secondary), #a89cff); color: white; }
.ghost-btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.danger-btn { background: linear-gradient(135deg, var(--danger), #ff8f8f); color: white; }
.secondary-btn.small { min-height: 42px; padding: 8px 12px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.section-head h3, .panel-card h2, .panel-card h3 { margin: 0; }
.search-field { max-width: 150px; }
.cards-list { display: grid; gap: 10px; }
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 20px;
  border-radius: 18px;
  background: var(--surface-2);
}
.notification-container {
  position: fixed;
  top: 78px;
  left: 10px;
  right: 10px;
  z-index: 100;
  display: grid;
  gap: 8px;
}
.notification {
  padding: 12px 14px;
  border-radius: 14px;
  color: white;
  box-shadow: var(--shadow);
}
.notification.success { background: linear-gradient(135deg, var(--success), #58d68d); }
.notification.warning { background: linear-gradient(135deg, var(--warning), #f5b041); }
.notification.error { background: linear-gradient(135deg, var(--danger), #ff8f8f); }
.compact-list p { margin: 8px 0 0; }


.nav-btn[hidden],
.tab-panel[hidden] {
  display: none !important;
}

.mode-summary-card,
.mode-settings-card {
  margin-bottom: 14px;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,77,148,0.12);
  color: #d63384;
  font-weight: 700;
  font-size: 0.9rem;
}

.mode-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.mode-btn {
  border: 2px solid #ffd0e2;
  background: #fff;
  color: #444;
  border-radius: 14px;
  min-height: 48px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.mode-btn.active {
  border-color: #ff4d94;
  background: linear-gradient(135deg, #ff4d94, #ff7aae);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255,77,148,0.22);
}

.dark .mode-btn {
  background: #2a2a2a;
  color: #eee;
  border-color: #444;
}

.dark .mode-btn.active {
  border-color: #ff73aa;
  background: linear-gradient(135deg, #ff4d94, #ff73aa);
  color: #fff;
}


.icon-btn, .lang-btn, .small-select, .input-field, .primary-btn, .secondary-btn, .ghost-btn, .danger-btn, .nav-btn {
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}
.primary-btn:active, .secondary-btn:active, .ghost-btn:active, .danger-btn:active, .icon-btn:active, .lang-btn:active, .nav-btn:active {
  transform: scale(.985);
}
.input-field::placeholder { color: var(--muted); }
.panel-card, .ingredient-card, .recipe-card, .priced-card { overflow: hidden; }
.notification { line-height: 1.5; }
.app-header, .main-nav {
  padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
}
.main-nav {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.main-nav::-webkit-scrollbar { display: none; }
.nav-btn {
  min-width: 84px;
  padding: 8px 6px;
  flex-shrink: 0;
}
.search-field {
  min-height: 44px;
}
.button-row > *, .stack-buttons > *, .mode-toggle-grid > * {
  width: 100%;
}
.mode-summary-card p, .mode-settings-card p { margin: 0; }

body.dark .notification {
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
}
.notification.info { background: linear-gradient(135deg, #5b4cc4, #8a7cff); }
body.dark .notification.success { background: linear-gradient(135deg, #1f8f55, #2ecc71); }
body.dark .notification.warning { background: linear-gradient(135deg, #b56a0f, #f39c12); }
body.dark .notification.error { background: linear-gradient(135deg, #b33939, #ff6b6b); }
body.dark .notification.info { background: linear-gradient(135deg, #4d3fb0, #7b6cff); }

.quick-setting-btn span:last-child { font-weight: 800; }

.panel-card h2 {
  font-size: 1.1rem;
  line-height: 1.35;
  font-weight: 600;
}

.main-nav .nav-btn small {
  font-size: 0.78rem;
  font-weight: 500;
}

.section-title {
  letter-spacing: 0.2px;
}

button:active {
  transform: scale(0.97);
}

button:hover {
  filter: brightness(0.95);
}