/* ===== HOME VIEW ===== */
.home-view {
  padding-bottom: calc(var(--tabbar-height, 64px) + var(--sp-4));
  animation: fade-in var(--dur-med) var(--ease-out);
}

.home-hero {
  padding: var(--sp-6) 0 var(--sp-5);
  text-align: center;
}
.home-hero-title {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--sp-3);
}
.home-hero-title em {
  font-style: normal;
  color: var(--color-saffron);
}
.home-hero-sub {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  max-width: 380px;
  margin: 0 auto;
}

.home-search-row {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.home-search-row .search-wrap { flex: 1; }

.home-sections { display: flex; flex-direction: column; gap: var(--sp-7); }

/* ===== DETAIL VIEW ===== */
.detail-view {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar-height, 64px) + var(--sp-4));
  animation: fade-in var(--dur-med) var(--ease-out);
}

.detail-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--sp-5);
  transition: color var(--dur-fast);
}
.detail-back-btn:hover { color: var(--color-text); }

.detail-hero {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  margin-bottom: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.detail-emoji { font-size: 3.5rem; line-height: 1; }
.detail-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h1);
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}

.detail-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.detail-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}
.detail-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h3);
  color: var(--color-text);
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.detail-notes-area {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  color: var(--color-text);
  font-size: var(--fs-sm);
  min-height: 80px;
  resize: vertical;
  transition: border-color var(--dur-fast);
}
.detail-notes-area:focus { border-color: var(--color-saffron); outline: none; }
.detail-notes-area::placeholder { color: var(--color-text-dim); }

/* ===== FORM VIEW ===== */
.form-view {
  max-width: 620px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar-height, 64px) + var(--sp-4));
  animation: fade-in var(--dur-med) var(--ease-out);
}

.form-view-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h2);
  color: var(--color-text);
  margin-bottom: var(--sp-5);
}

.form-section {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}
.form-section-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-dim);
  margin-bottom: var(--sp-4);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.ingredient-form-row {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr auto;
  gap: var(--sp-2);
  align-items: end;
}
@media (max-width: 480px) { .ingredient-form-row { grid-template-columns: 1fr 1fr; } }

.remove-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-coral-soft);
  color: var(--color-coral);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast);
}
.remove-btn:hover { background: rgba(231,111,81,0.2); }

.split-form-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.split-form-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-surface-2);
  cursor: pointer;
}
.split-form-toggle {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--color-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast);
  flex-shrink: 0;
}
.split-form-toggle.checked { background: var(--color-saffron); border-color: var(--color-saffron); }
.split-form-toggle.checked::after { content: '✓'; font-size: 11px; color: #0A0F14; font-weight: 700; }
.split-form-body { padding: var(--sp-4); display: none; }
.split-form-body.open { display: flex; flex-direction: column; gap: var(--sp-3); }

/* ===== IMPORT VIEW ===== */
.import-view {
  max-width: 580px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar-height, 64px) + var(--sp-4));
  animation: fade-in var(--dur-med) var(--ease-out);
}

.import-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  margin-bottom: var(--sp-4);
}

.import-result {
  background: var(--color-surface-1);
  border: 1px solid var(--color-sage);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-top: var(--sp-5);
  animation: fade-in var(--dur-med) var(--ease-out);
}

.import-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-saffron-soft);
  color: var(--color-saffron);
  font-weight: 700;
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.import-step-dot.done { background: var(--color-sage-soft); color: var(--color-sage); }

/* Import mode toggle */
.import-mode-toggle {
  display: flex;
  background: var(--color-surface-2);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
  margin-bottom: var(--sp-4);
}
.import-mode-btn {
  flex: 1;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
  transition: all var(--dur-fast);
  cursor: pointer;
  background: none;
  border: none;
}
.import-mode-btn:hover { color: var(--color-text); }
.import-mode-btn.active {
  background: var(--color-saffron);
  color: #0A0F14;
  box-shadow: var(--shadow-sm);
}

/* Photo input area */
.photo-add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--sp-4);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast), color var(--dur-fast);
  text-align: center;
  cursor: pointer;
}
.photo-add-btn:hover {
  border-color: var(--color-saffron);
  color: var(--color-text);
}
.photo-add-icon {
  font-size: 2rem;
  margin-bottom: var(--sp-2);
}

/* Photo thumbnail strip */
.photo-strip {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  -webkit-overflow-scrolling: touch;
}
.photo-thumb-wrap {
  position: relative;
  flex-shrink: 0;
}
.photo-thumb {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.photo-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-coral);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  border: none;
  cursor: pointer;
  padding: 0;
}

@media (max-width: 480px) {
  .photo-thumb { width: 100px; height: 133px; }
}

/* ===== SEARCH VIEW ===== */
.search-view {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar-height, 64px) + var(--sp-4));
  animation: fade-in var(--dur-med) var(--ease-out);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
}

.search-result-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  animation: slide-up var(--dur-med) var(--ease-out);
}
.search-result-card:nth-child(2) { animation-delay: 60ms; }
.search-result-card:nth-child(3) { animation-delay: 120ms; }

.search-result-header { display: flex; align-items: center; gap: var(--sp-3); }
.search-result-emoji { font-size: 2rem; line-height: 1; }
.search-result-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h3);
  color: var(--color-text);
}

/* ===== WEEK VIEW ===== */
.week-view {
  padding-bottom: calc(var(--tabbar-height, 64px) + var(--sp-4));
  animation: fade-in var(--dur-med) var(--ease-out);
}

.week-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.week-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h2);
  color: var(--color-text);
}
.week-title-select {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h2);
  color: var(--color-text);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--color-border);
  cursor: pointer;
  padding: 0 var(--sp-1) 0 0;
  max-width: 260px;
  appearance: auto;
}
.week-title-select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.week-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.week-empty {
  background: var(--color-surface-1);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-9) var(--sp-5);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

/* ===== SETTINGS VIEW ===== */
.settings-view {
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar-height, 64px) + var(--sp-4));
  animation: fade-in var(--dur-med) var(--ease-out);
}

.settings-section {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}
.settings-section-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-dim);
  margin-bottom: var(--sp-4);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--color-border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: var(--fs-sm); font-weight: 500; color: var(--color-text); }
.settings-row-hint { font-size: var(--fs-xs); color: var(--color-text-dim); margin-top: 2px; }
