.home-page {
  width: 100%;
  min-height: 100vh;
  background: #F4F5F0;
  position: relative;
  overflow-x: hidden;
  margin: 0 auto;
}

.home-try-pro-wrap {
  position: absolute;
  top: 21px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
}

.home-top-row {
  position: absolute;
  top: 21px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.home-top-row .home-try-pro-wrap,
.home-top-row .home-avatar-wrap {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  transform: none;
}

.home-top-row .home-try-pro-wrap {
  order: 1;
}

.home-top-row .home-avatar-wrap {
  order: 2;
  margin-left: auto;
}

.home-try-pro-btn {
  width: 68px;
  height: 28px;
  background: #FFF066;
  border: none;
  border-radius: 13px;
  color: black;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  line-height: 15.6px;
  cursor: pointer;
}

.home-avatar-wrap {
  position: absolute;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
}

.home-avatar {
  width: 41px;
  height: 41px;
  border-radius: 9999px;
  background: #E5E6DF;
  display: block;
}

.home-greeting {
  position: absolute;
  top: 112px;
  left: 0; right: 0;
  text-align: center;
  color: black;
  font-size: 26px;
  font-family: 'Druk Wide', sans-serif;
  font-weight: 700;
  line-height: 32px;
}

.home-name {
  display: none;
}

.home-hero-banner {
  display: contents;
}

.home-hero-right {
  display: none;
}

.home-hero-desc-short {
  display: none;
}

.home-hero-desc-full {
  display: none;
}

.home-card {
  margin: 244px 16px 0;
  display: none;
}

.home-card-title {
  text-align: center;
  color: black;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  line-height: 19px;
}

.home-card-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.home-card-meta {
  color: #7E7E7E;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  line-height: 18px;
}

.home-btn-wrap {
  margin: 192px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-btn {
  width: 100%;
  height: 48px;
  background: black;
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  line-height: 15.6px;
  cursor: pointer;
  text-align: center;
}

.home-history {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 100px;
}

.home-history-header {
  text-align: center;
  color: black;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  line-height: 18px;
  padding: 14px 16px 0;
}

.home-history-tabs {
  display: flex;
  padding: 10px 16px;
  gap: 8px;
  align-items: center;
}

.home-tabs-scroll {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.home-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.home-filter-square {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  background: #ECECE5;
  border-radius: 10px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
  justify-content: center;
  cursor: pointer;
}

.home-sticky-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 24px 16px;
  gap: 8px;
  align-items: center;
  padding-bottom: 30px;
}

.home-sticky-header-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #F4F5F0 70%, rgba(244, 245, 240, 0) 100%);
  pointer-events: none;
  z-index: 1;
}

.home-sticky-header.visible {
  display: flex;
}

.home-tab-item {
  flex: none;
  height: 34px;
  padding: 0 10px;
  white-space: nowrap;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: black;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  line-height: 16px;
  background: none;
}

.home-tab-item--active {
  background: #ECECE5;
}

.home-tab-content {
  display: none;
}

.home-tab-content.active {
  display: flex;
}

.home-all-categories {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 0 16px;
}

.home-cat-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.home-cat-title {
  color: black;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  line-height: 16px;
}

.home-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.home-history-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
}

.home-history-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 80px;
  gap: 8px;
}

.home-history-card-time {
  color: #A1A09F;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  line-height: 18px;
}

.home-history-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.home-recipe-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 130px;
}

.home-recipe-card-top {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-right: 8px;
}

.home-recipe-card-meta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.home-recipe-card-time-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}

.home-recipe-remove {
  cursor: pointer; flex-shrink: 0;
}

.home-recipe-duration,
  .home-recipe-date {
  color: #A1A09F;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  line-height: 18px;
}

.home-recipe-card-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.home-recipe-img {
  width: 65px;
  height: 65px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

.home-recipe-title {
  flex: 1;
  color: black;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  line-height: 14px;
}

.home-page.hidden {
  display: none;
}

.home-recipes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-recipes-list--list {
  gap: 12px;
}

.home-ai-generate-btn {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 16px;
  background: #000;
  color: #fff;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  line-height: 16px;
  cursor: pointer;
}

.home-ai-generate-btn:disabled {
  background: #A1A09F;
  cursor: default;
}

.rcard-ai-icon,
.rcard-list-ai-icon {
  background: #F4F5F0;
  color: #000;
  font-family: 'Druk Wide', sans-serif;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

.rcard-ai-icon img,
.rcard-list-ai-icon img {
  width: 50%;
  height: 50%;
  color: #000;
}

.rcard-ai-icon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  font-size: 54px;
}

.home-page .rcard--ai-generated {
  padding-bottom: 18px;
}

.home-page .rcard--ai-generated .rcard-img-wrap {
  width: 96px;
  height: 96px;
  margin-top: 8px;
}

.home-page .rcard--ai-generated .rcard-ai-icon {
  width: 96px;
  height: 96px;
}

.home-page .rcard--ai-generated .rcard-info {
  margin-top: 10px;
}

.rcard-list-ai-icon {
  width: 65px;
  height: 65px;
  border-radius: 14px;
  flex-shrink: 0;
  font-size: 20px;
}

/* View toggle icon switching */
.view-icon-grid {
  display: none;
}

.home-filter-square--active .view-icon-list {
  display: none;
}

.home-filter-square--active .view-icon-grid {
  display: block;
}

/* List view card */
.rcard-list {
  background: white;
  border-radius: 16px;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rcard-list-img {
  width: 65px;
  height: 65px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.rcard-list-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rcard-list-ings {
  display: flex;
  align-items: center;
  gap: 3px;
}
.rcard-list-ings .rcard-ingredient-thumb {
  width: 18px; height: 18px;
}
.rcard-list-ings .rcard-ingredient-thumb img {
  width: 14px; height: 14px;
}
.rcard-list-ings .rcard-ingredient-more {
  width: 18px; height: 18px;
  font-size: 9px;
  line-height: 11px;
}
.rcard-list-ings .rcard-ingredient-more {
  min-width: 18px !important;
  max-width: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  flex: 0 0 18px !important;
  font-size: 9px !important;
  line-height: 11px !important;
}

.rcard-list-name {
  color: black;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rcard-list-meta {
  color: #7E7E7E;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 16px;
}

@media (min-width: 375px) {
  .home-try-pro-btn,
  .home-card-title,
  .home-card-meta,
  .home-btn,
  .home-history-header,
  .home-tab-item,
  .home-cat-title,
  .home-history-card-time,

  .home-recipe-duration,
  .home-recipe-date,
  .home-recipe-title,
  .rcard-list-name {
    font-size: 16px;
  }
}

@media (min-width: 393px) {
}

@media (min-width: 440px) {
  .home-avatar {
    width: 48px; height: 48px;
  }

  .home-try-pro-btn {
    width: 78px; height: 32px; font-size: 13px;
  }

  .home-try-pro-btn,
  .home-card-title,
  .home-card-meta,
  .home-btn,
  .home-history-header,
  .home-tab-item,
  .home-cat-title,
  .home-history-card-time,

  .home-recipe-duration,
  .home-recipe-date,
  .home-recipe-title {
    font-size: 16px;
  }

  .home-greeting {
    font-size: 32px;
  }

  .home-greeting {
    line-height: 40px;
  }

  .home-card {
    margin-top: 276px;
  }

  .home-btn-wrap {
    margin-top: 276px;
  }

  .home-history-header {
    padding: 14px 20px 0;
  }

  .home-history-tabs {
    padding: 0 20px;
  }

  .home-sticky-header {
    padding: 24px 20px; padding-bottom: 30px;
  }

  .home-all-categories {
    padding: 0 20px;
  }

  .home-history-cards {
    padding: 0 20px;
  }

  .home-history-card {
    padding: 20px;
  }

  .home-recipe-card {
    padding: 20px;
  }
}

@media (min-width: 640px) {
  .home-top-row {
    display: none;
  }

  .home-try-pro-wrap {
    display: none;
  }

  .home-avatar-wrap {
    display: none;
  }

  .home-greeting {
    display: none;
  }

  .greeting-br-small {
    display: none;
  }

  .home-greeting br {
    display: none;
  }

  .home-recipes-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .home-recipes-list--list {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
  }

  .home-greeting {
    display: none;
  }

  .home-hero-banner {
    display: flex;
    align-items: center;
    gap: 30px;
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 24px;
    margin: 16px 16px 0;
  }

  .home-card {
    display: flex;
    position: static;
    flex: 0 0 45%;
  }

  .home-card .rcard-top {
    display: none;
  }

  .home-hero-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
  }

  .home-hero-title {
    color: black;
    font-size: 22px;
    font-family: 'Druk Wide', sans-serif;
    font-weight: 700;
    line-height: 26px;
  }

  .home-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .home-hero-tag {
    padding: 4px 12px;
    background: #F4F5F0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: black;
  }

  .home-hero-desc {
    color: black;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 18px;
    margin: 0;
  }

  .home-hero-desc-short {
    display: block;
  }

  .home-hero-desc-full {
    display: none;
  }

  .home-btn-wrap {
    margin: 16px 16px 0;
  }

  .home-avatar-wrap {
    position: static;
    margin: 20px 16px 0;
  }

  .home-history {
    margin-top: 20px;
  }
}

@media (min-width: 768px) {
  .home-hero-desc-short {
    display: none;
  }

  .home-hero-desc-full {
    display: block;
  }
}

/* =================================================================
   Dynamic Type (iOS) — home view only, scope: html.mild-dt
   Added by /js/home.js at runtime so other pages are not affected.
   Base size follows system Text Size; layout drops absolute
   positioning so text growth pushes siblings instead of overlapping.
   ================================================================= */

html.mild-dt:has(.home-page) {
  font: -apple-system-body;
  font-family: 'Inter', sans-serif;
}
html.mild-dt:has(.home-page) body { font-family: 'Inter', sans-serif; }

html.mild-dt:has(.home-page) .home-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-top: 21px;
  gap: 16px;
}

html.mild-dt:has(.home-page) .home-top-row {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: 0 16px;
}

html.mild-dt:has(.home-page) .home-try-pro-wrap,
html.mild-dt:has(.home-page) .home-avatar-wrap,
html.mild-dt:has(.home-page) .home-greeting {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  transform: none;
}

html.mild-dt:has(.home-page) .home-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

html.mild-dt:has(.home-page) .home-greeting {
  padding: 0 16px;
  margin: 0;
  font-size: 1.55em;
  line-height: 1.25;
}

html.mild-dt:has(.home-page) .home-btn-wrap,
html.mild-dt:has(.home-page) .home-card {
  margin: 0 16px;
}

@media (min-width: 640px) {
  html.mild-dt:has(.home-page) .home-top-row {
    display: none;
  }
}

html.mild-dt:has(.home-page) .home-try-pro-btn {
  width: auto;
  min-width: 68px;
  height: auto;
  min-height: 28px;
  padding: 6px 14px;
  font-size: 0.75em;
  line-height: 1.3;
}

html.mild-dt:has(.home-page) .home-btn {
  height: auto;
  min-height: 48px;
  padding: 14px 16px;
  font-size: 0.85em;
  line-height: 1.3;
  white-space: normal;
}

html.mild-dt:has(.home-page) .home-recipe-card {
  height: auto;
  min-height: 130px;
}

html.mild-dt:has(.home-page) .home-recipe-title,
html.mild-dt:has(.home-page) .home-recipe-duration,
html.mild-dt:has(.home-page) .home-recipe-date {
  font-size: 0.85em;
  line-height: 1.3;
}

html.mild-dt:has(.home-page) .home-history-header,
html.mild-dt:has(.home-page) .home-cat-title,
html.mild-dt:has(.home-page) .home-history-card-time,
html.mild-dt:has(.home-page) .home-card-title,
html.mild-dt:has(.home-page) .home-card-meta {
  font-size: 0.85em;
  line-height: 1.3;
}

.home-page .home-tab-item {
  height: auto;
  min-height: 34px;
  padding: 4px 12px;
  font-size: 0.85em;
  line-height: 1.3;
}

.home-page .rcard-list {
  align-items: flex-start;
}

.home-page .rcard-list-name {
  font-size: 0.85em;
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.home-page .rcard-list-meta {
  font-size: 0.8em;
  line-height: 1.3;
}

.home-page .rcard-name {
  font-size: 0.85em;
  line-height: 1.3;
  min-height: 0;
  white-space: normal;
}

.home-page .rcard-meta,
.home-page .rcard-time-text {
  font-size: 0.85em;
  line-height: 1.3;
}
