/* 색은 마이리움 로고와 캐릭터에서 가져왔습니다 */
:root {
  --bg: #fffaf0;          /* 크림 */
  --surface: #ffffff;
  --ink: #3d2f1f;         /* 캐릭터 머리카락 갈색 */
  --muted: #7d6a52;
  --line: #f0e3c4;        /* 밀짚모자 밝은 톤 */
  --brand: #51b871;       /* 로고 초록 */
  --brand-deep: #2b7d46;  /* 버튼용 진한 초록 (흰 글자가 잘 읽히게) */
  --brand-soft: #e4f5e9;
  --sun: #f8ec9e;         /* 모자 띠 노랑 */
  --radius: 22px;
  --font-round: "Jua", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans KR", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  word-break: keep-all;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 16px 48px;
}

/* 맨 위: 로고와 제목 */
.hero { text-align: center; margin-bottom: 40px; }
.hero-art { display: block; width: 200px; height: auto; margin: 0 auto 8px; }
.hero h1 {
  font-family: var(--font-round);
  font-size: clamp(30px, 8.5vw, 40px);
  font-weight: 400;
  color: var(--brand-deep);
  margin: 0 0 4px;
  line-height: 1.25;
}
.home-link { color: inherit; text-decoration: none; border-radius: 12px; }
.hero-home { display: block; width: fit-content; margin: 0 auto; }
.home-link:focus-visible { outline: 3px solid var(--sun); outline-offset: 4px; }
.intro { margin: 0; color: var(--muted); text-wrap: balance; }

/* 씨앗 찾기 */
.search { position: relative; margin: -16px 0 16px; }
.search::before {   /* 돋보기 */
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -9px;
  border: 2.5px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}
.search::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 50%;
  width: 7px;
  height: 2.5px;
  margin-top: 4px;
  background: var(--muted);
  border-radius: 2px;
  transform: rotate(45deg);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 12px 46px 12px 46px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;   /* 16px 보다 작으면 아이폰이 화면을 확대해요 */
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s;
}
.search-input::placeholder { color: #a8977d; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-input:focus { outline: none; border-color: var(--brand); }
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  border: 0;
  border-radius: 50%;
  background: var(--brand-soft);
  cursor: pointer;
}
.search-clear::before, .search-clear::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2.5px;
  margin: -1.25px 0 0 -6px;
  background: var(--brand-deep);
  border-radius: 2px;
  transform: rotate(45deg);
}
.search-clear::after { transform: rotate(-45deg); }
.search-clear:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.seed-months { color: var(--brand-deep); font-size: 13px; font-weight: 700; margin-top: 2px; }

/* 월 고르기 */
.month-box {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 28px;
}
.section-label {
  font-family: var(--font-round);
  font-size: 18px;
  font-weight: 400;
  margin: 0 0 10px;
}
.months {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
@media (min-width: 560px) {
  .months { grid-template-columns: repeat(12, 1fr); gap: 6px; }
}
.month {
  font-family: var(--font-round);
  font-size: 16px;
  padding: 9px 0;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.month:hover { border-color: var(--brand); }
.month:active { transform: scale(.95); }
.month:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.month[aria-pressed="true"] {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}

/* 씨앗 목록 */
.list h2 {
  font-family: var(--font-round);
  font-size: 24px;
  font-weight: 400;
  margin: 0 0 8px;
}
.season-note {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--sun);
  font-size: 14px;
}
.seeds { display: grid; gap: 12px; }

.seed {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s;
}
.seed:hover { border-color: #e6d3a6; }
.seed[open] { border-color: var(--brand); }

.seed-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}
.seed-head::-webkit-details-marker { display: none; }
.seed-head:focus-visible { outline: 3px solid var(--sun); outline-offset: -3px; }

.seed-emoji {
  flex: none;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: var(--brand-soft);
  border-radius: 50%;
}
.seed-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.seed-name { font-family: var(--font-round); font-weight: 400; font-size: 22px; line-height: 1.3; }
.seed-summary { color: var(--muted); font-size: 14px; }

/* 펼치기 버튼: 연두 동그라미 안 화살표 (펼치면 위로 뒤집혀요) */
.seed-chevron {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  transition: transform .2s, background .15s;
}
.seed-chevron::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: -4px;
  border-right: 2.5px solid var(--brand-deep);
  border-bottom: 2.5px solid var(--brand-deep);
  border-radius: 1px;
  transform: rotate(45deg);
}
.seed-head:hover .seed-chevron { background: #d3eedb; }
/* 상세 페이지로 바로 가는 카드: 화살표가 오른쪽을 봐요 */
.seed-link { display: block; color: inherit; text-decoration: none; }
.seed-link:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.seed-link:hover { border-color: var(--brand); }
.seed-chevron-go { transform: rotate(-90deg); }
.seed-chevron-go::before { margin: 0 0 0 -4px; }
.seed[open] .seed-chevron { transform: rotate(180deg); }

.seed-body { padding: 2px 16px 18px; border-top: 2px dashed var(--line); }

.facts { margin: 14px 0 0; }
.fact { margin-bottom: 12px; }
.fact dt { font-weight: 700; font-size: 14px; }
.fact dd { margin: 2px 0 0; }

.together-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
  margin: 4px 0 6px;
}
.together-icon { width: auto; height: 20px; }
.together { margin: 0 0 18px; padding-left: 20px; }
.together li { margin-bottom: 4px; }
.together li::marker { color: var(--brand); }

.kit-btn {
  display: block;
  text-align: center;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--brand-deep);
  color: #fff;
  font-family: var(--font-round);
  font-size: 17px;
  text-decoration: none;
  transition: filter .15s, transform .1s;
}
.kit-btn:hover { filter: brightness(1.08); }
.kit-btn:active { transform: scale(.98); }
.kit-btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* 맨 아래 */
.foot { margin-top: 40px; text-align: center; }
.foot-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
}
.foot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border-radius: var(--radius);
}
.foot-card img {
  height: 150px;
  width: auto;
  transition: transform .2s;
}
.foot-card:hover img { transform: translateY(-4px) rotate(-2deg); }
.foot-card:focus-visible { outline: 3px solid var(--sun); outline-offset: 4px; }
.foot-btn {
  width: 100%;
  padding: 11px 8px;
  border-radius: 999px;
  border: 2px solid var(--brand-deep);
  color: var(--brand-deep);
  background: var(--surface);
  font-family: var(--font-round);
  font-size: 16px;
  transition: background .15s;
}
.foot-card:hover .foot-btn { background: var(--brand-soft); }
.foot-text { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* 이달의 추천 */
.seed-pick { border-color: #ecd77a; background: #fffdf0; }
.pick-badge {
  align-self: flex-start;
  margin-bottom: 2px;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--sun);
  color: #6b5414;
  font-size: 12px;
  font-weight: 700;
}

/* 씨앗 종류 고르기 */
/* 한 줄로: 넓은 화면은 다 보이고, 휴대폰은 옆으로 밀어서 봐요 */
.cats {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin: 0 -16px 14px;
  padding: 2px 16px;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-round);
  font-size: 14px;
  padding: 6px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.cat:hover { border-color: var(--brand); }
.cat:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.cat[aria-pressed="true"] { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.cat-count {
  font-family: "Noto Sans KR", sans-serif;
  font-size: 12px;
  font-weight: 700;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.cat[aria-pressed="true"] .cat-count { background: rgba(255, 255, 255, .22); color: #fff; }

/* 키우기 난이도 */
.seed-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.level {
  display: inline-flex;
  align-items: center;
  padding: 0 9px 2px;   /* 한글이 아래로 살짝 내려앉아 보여서 위·아래 여백을 맞춤 */
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}
.level-1 { background: var(--brand-soft); color: var(--brand-deep); }
.level-2 { background: #fdf1c7; color: #7a5a00; }
.level-3 { background: #fde3d9; color: #9a3b1b; }

/* 관찰일지 보기 */
.diary-btn {
  display: block;
  margin-top: 8px;
  text-align: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid var(--brand-deep);
  background: var(--surface);
  color: var(--brand-deep);
  font-family: var(--font-round);
  font-size: 16px;
  text-decoration: none;
  transition: background .15s;
}
.diary-btn:hover { background: var(--brand-soft); }
.diary-btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* 씨앗 그림 (흰 배경 그림이라 흰 동그라미에 넣어요) */
.seed-emoji.has-img { width: 58px; height: 58px; background: #fff; overflow: hidden; }
.seed-emoji.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

[hidden] { display: none !important; }

/* ───────── 씨앗 상세 페이지 (seed.html) ───────── */
.detail-wrap { padding-top: 20px; }
.back-link {
  display: inline-block;
  margin-bottom: 16px;
  padding: 6px 2px;
  font-family: var(--font-round);
  font-size: 16px;
  color: var(--brand-deep);
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }
.back-link:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 8px; }

.detail-top { text-align: center; margin-bottom: 20px; }
.detail-top .seed-emoji { width: 116px; height: 116px; margin: 0 auto 10px; font-size: 56px; border: 2px solid var(--line); }
.detail-title { justify-content: center; }
.detail-name {
  font-family: var(--font-round);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.25;
  margin: 0;
}
.detail-summary { margin: 4px 0 14px; color: var(--muted); }
.detail-facts {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 16px;
  text-align: left;
  background: var(--brand-soft);
  border-radius: 16px;
}
.detail-fact { display: flex; gap: 10px; }
.detail-fact dt { flex: none; width: 112px; font-weight: 700; font-size: 14px; padding-top: 1px; }
.detail-fact dd { margin: 0; }

.detail-box {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.detail-h {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-round);
  font-weight: 400;
  font-size: 20px;
  margin: 0 0 10px;
}
.detail-h .together-icon { height: 22px; }
.detail-text { margin: 0; }
.detail-box .together { margin: 0; }

.detail-list { margin: 0; padding-left: 20px; }
.detail-list li { margin-bottom: 4px; }
.detail-list li::marker { color: var(--brand); }
.detail-mistakes li::marker { color: #d9822b; }

/* 심는 순서: 초록 동그라미 번호 */
.detail-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.detail-steps li {
  position: relative;
  padding-left: 40px;
  margin-bottom: 12px;
  min-height: 28px;
  counter-increment: step;
}
.detail-steps li:last-child { margin-bottom: 0; }
.detail-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-deep);
  color: #fff;
  font-family: var(--font-round);
  font-size: 15px;
}

/* 자라는 모습: 세로 줄 위에 점 */
.detail-growth { list-style: none; margin: 0; padding: 0; }
.detail-growth li {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0 0 14px 26px;
}
.detail-growth li:last-child { padding-bottom: 0; }
.detail-growth li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.detail-growth li::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.detail-growth li:last-child::after { display: none; }
.growth-when { font-family: var(--font-round); font-weight: 400; font-size: 16px; color: var(--brand-deep); }

.detail-buttons { display: grid; gap: 8px; margin-bottom: 20px; }
.detail-buttons .diary-btn { margin-top: 0; }
.detail-missing { text-align: center; color: var(--muted); padding: 40px 0; }

/* 맨 위로 버튼 (긴 페이지에서 내려왔을 때만) */
.top-btn {
  position: fixed;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 10;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--brand-deep);
  color: #fff;
  font-family: var(--font-round);
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(61, 47, 31, .2);
  cursor: pointer;
  transition: transform .1s, filter .15s;
}
.top-btn:hover { filter: brightness(1.08); }
.top-btn:active { transform: scale(.95); }
.top-btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* 상세 페이지: 연두색 일지 버튼 */
.diary-soft { background: #e3f3cf; border-color: #e3f3cf; }
.diary-soft:hover { background: #d5ecba; }

/* 상세 페이지: 심은 날 고르기 + 단계별 날짜 */
.planted {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--sun);
  cursor: pointer;
}
.planted-label { font-weight: 700; font-size: 14px; flex: none; }
.planted-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 2px solid #ecd77a;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;   /* 16px 보다 작으면 아이폰이 화면을 확대해요 */
}
.planted-input:focus { outline: none; border-color: var(--brand); }
.planted-hint { margin: 6px 2px 14px; font-size: 13px; color: var(--muted); }
.growth-date {
  display: inline-block;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  font-family: "Noto Sans KR", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-deep);
  vertical-align: 1px;
}
.sprouted { margin-top: 8px; background: var(--brand-soft); }
.sprouted .planted-input { border-color: #bfe3c9; }
.planted-notice { display: grid; gap: 4px; margin: -6px 0 14px; padding: 8px 12px; border-radius: 12px; background: #fff7e0; font-size: 14px; }
.growth-date-done { background: var(--brand-deep); color: #fff; }

/* 공유하기 버튼 */
.share-btn {
  flex: none;
  padding: 6px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-deep);
  font-family: var(--font-round);
  font-size: 15px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.share-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.share-btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.hero { position: relative; }
.share-btn-hero { position: absolute; top: -38px; right: 0; padding: 4px 12px; font-size: 14px; }   /* 맨 위 여백 자리, 그림과 안 겹치게 */
.detail-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.detail-bar .back-link { margin-bottom: 0; }

/* 잠깐 떴다 사라지는 안내 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .2s, transform .2s;
}
.toast-show { opacity: 1; transform: translate(-50%, 0); }
