/* ============================================================
   쉬운 모드(큰 글씨) — html.easy-mode 가 켜졌을 때만 적용됩니다.
   어르신 기준: 본문 18px 이상, 터치 목표 56px 이상, 또렷한 대비.
   ============================================================ */

/* ---------- 떠 있는 토글 버튼 ---------- */
.easy-mode-toggle {
  position: fixed;
  z-index: 2147483000;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 10px 20px 10px 12px;
  border: 2px solid rgba(255, 250, 240, .85);
  border-radius: 999px;
  background: linear-gradient(150deg, #3c5a48, #2c4437);
  color: #fdf7ea;
  box-shadow: 0 16px 40px rgba(24, 38, 29, .38), 0 2px 0 rgba(255,255,255,.18) inset;
  cursor: pointer;
  animation: easy-mode-rise .5s cubic-bezier(.2,.72,.2,1) both;
  transition: transform .22s cubic-bezier(.2,.72,.2,1), box-shadow .22s ease, background .22s ease;
}
.easy-mode-toggle:hover,
.easy-mode-toggle:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 22px 52px rgba(24, 38, 29, .46), 0 2px 0 rgba(255,255,255,.22) inset;
  outline: 3px solid rgba(229, 194, 123, .9);
  outline-offset: 3px;
}
.easy-mode-toggle-glyph {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 250, 240, .16);
  border: 1px solid rgba(255, 250, 240, .4);
  font: 700 22px/1 "Noto Sans KR", sans-serif;
}
.easy-mode-toggle-copy { display: grid; gap: 2px; text-align: left; }
.easy-mode-toggle-label { font: 700 17px/1.1 "Noto Sans KR", sans-serif; letter-spacing: -.02em; }
.easy-mode-toggle-copy small { font: 500 12px/1 "Noto Sans KR", sans-serif; opacity: .82; }
html.easy-mode .easy-mode-toggle {
  background: linear-gradient(150deg, #b06a75, #8f4f5d);
}
@keyframes easy-mode-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .easy-mode-toggle { animation: none; transition: none; }
}

/* ---------- 기본 글자 키우기 ---------- */
html.easy-mode body { font-size: 18px; }
html.easy-mode p,
html.easy-mode li,
html.easy-mode dd,
html.easy-mode blockquote { font-size: 18px; line-height: 1.85; }
html.easy-mode small { font-size: 15px; }
html.easy-mode h1 { letter-spacing: -.04em; }
html.easy-mode h2 { letter-spacing: -.03em; }

/* ---------- 버튼: 더 크고, 더 또렷하게 ---------- */
html.easy-mode button,
html.easy-mode .outline-button,
html.easy-mode .primary-button,
html.easy-mode .flower-upload-button,
html.easy-mode .book-quiet-button {
  min-height: 56px;
  font-size: 17px;
}
html.easy-mode .primary-button { font-size: 20px; min-height: 62px; }
html.easy-mode .flower-upload-button { min-height: 60px; padding: 0 26px; font-size: 18px; }

/* ---------- 입력 칸: 크게, iOS 자동 확대 방지(16px 이상) ---------- */
html.easy-mode input,
html.easy-mode select,
html.easy-mode textarea {
  font-size: 18px !important;
  min-height: 54px;
  padding: 12px 14px;
}
html.easy-mode textarea { min-height: 130px; line-height: 1.7; }
html.easy-mode label,
html.easy-mode .field > span,
html.easy-mode .compose-field > span {
  font-size: 17px !important;
  font-weight: 700;
}
html.easy-mode input[type="checkbox"],
html.easy-mode input[type="radio"] {
  width: 26px !important;
  height: 26px !important;
  min-height: 0;
}

/* ---------- 가족의정원 앨범 ---------- */
html.easy-mode .album-card-copy h3 { font-size: 20px; }
html.easy-mode .album-card-copy p { font-size: 16px; }
html.easy-mode .album-toolbar > span,
html.easy-mode .key-status { font-size: 16px; }
html.easy-mode .season-filters button { min-height: 52px; font-size: 17px; padding: 0 20px; }
html.easy-mode .family-session > span { font-size: 21px; }
html.easy-mode .family-session a,
html.easy-mode .family-session button { min-height: 54px; line-height: 50px; font-size: 17px; }

/* ---------- 다이얼로그(추억 보기·고치기) ---------- */
html.easy-mode .family-dialog h2,
html.easy-mode .memory-dialog h2,
html.easy-mode .compose-dialog h2 { font-size: clamp(30px, 4vw, 44px); }
html.easy-mode .memory-dialog article > p,
html.easy-mode .story-dialog article > p { font-size: 19px; line-height: 1.9; }
html.easy-mode .memory-dialog article > p:first-child,
html.easy-mode .story-dialog article > p:first-child { font-size: 15px; }
html.easy-mode .dialog-close { width: 56px; height: 56px; font-size: 30px; }
html.easy-mode .memory-detail-actions button,
html.easy-mode .family-album-detail-actions button { min-height: 58px; font-size: 18px; padding: 0 24px; }

/* ---------- 엄마의정원 꽃동화책 ---------- */
html.easy-mode #dialogLabel { font-size: 16px; }
html.easy-mode #dialogTitle { font-size: clamp(28px, 3.4vw, 42px); }
html.easy-mode #dialogDescription { font-size: 19px; line-height: 1.9; }
html.easy-mode .book-turn { width: 64px; height: 64px; }
html.easy-mode .book-turn svg { width: 30px; height: 30px; }
html.easy-mode #bookPageStatus { font-size: 17px; }
html.easy-mode .memory-book-public-badge { font-size: 14px; padding: 10px 16px; }

/* ---------- 모두의정원 ---------- */
html.easy-mode .bloom-card blockquote { font-size: 19px; }
html.easy-mode .bloom-card footer { font-size: 14px; }
html.easy-mode .plant-form textarea { min-height: 150px; }
html.easy-mode .plant-submit-row button { min-height: 58px; font-size: 18px; }
html.easy-mode #messageCount { font-size: 15px; }

/* ---------- 모두의정원 꿈결 놀이판: 터치 목표 키우기 ---------- */
html.easy-mode .garden-tool-dock button { min-height: 88px; }
html.easy-mode .garden-tool-dock button b { font-size: 16px; }
html.easy-mode .garden-tool-dock button small { font-size: 12px; }
html.easy-mode .garden-tool-dock button > img { width: 48px; height: 60px; }
html.easy-mode .mobile-task-toggle { min-height: 56px; font-size: 15px; padding: 0 20px; }
html.easy-mode .garden-resource { min-height: 44px; font-size: 13px; padding: 0 13px; }
html.easy-mode .garden-resource b { font-size: 16px; }
html.easy-mode .garden-resource > span:first-child { font-size: 19px; }
html.easy-mode .living-bloom { width: 70px; height: 70px; }
html.easy-mode .living-bloom > span { font-size: 32px; }
html.easy-mode .rose-hotspot { width: 72px; height: 72px; font-size: 30px; }
html.easy-mode .garden-tasks > button:not(.task-reset) { min-height: 68px; }
html.easy-mode .garden-tasks > button b { font-size: 15px; }
html.easy-mode .garden-tasks > button small { font-size: 12px; }
html.easy-mode .story-panel-actions button { min-height: 56px; font-size: 16px; }
html.easy-mode .dream-chapter-nav button { min-height: 52px; }
html.easy-mode .dream-chapter-nav button b { font-size: 14px; }
html.easy-mode .garden-complete-card button { min-height: 56px; font-size: 15px; padding: 0 24px; }
html.easy-mode .garden-complete-card h2 { font-size: clamp(32px, 5vw, 48px); }

/* ---------- 동화책방 ---------- */
html.easy-mode #pageLabel { font-size: 16px; }
html.easy-mode #pageTitle { font-size: clamp(30px, 3.6vw, 46px); }
html.easy-mode #pageDescription { font-size: 19px; line-height: 1.9; }
html.easy-mode #pagePosition { font-size: 17px; }
html.easy-mode .page-controls button { min-height: 56px; font-size: 17px; padding: 0 22px; }
html.easy-mode .cover-spring-one strong,
html.easy-mode .cover-spring-two strong,
html.easy-mode .cover-summer strong,
html.easy-mode .cover-autumn strong,
html.easy-mode .cover-winter strong { font-size: 20px; }

/* ---------- 상태 알림: 크게, 오래 보이게 ---------- */
html.easy-mode [role="status"],
html.easy-mode .plant-status,
html.easy-mode .flower-upload-status,
html.easy-mode .memory-form-status {
  font-size: 17px !important;
  line-height: 1.6;
}

/* ---------- 내비게이션 ---------- */
html.easy-mode .family-header nav a { font-size: 19px; }
html.easy-mode .together-nav a { font-size: 17px; }
html.easy-mode .books-header nav a { font-size: 17px; }

/* ---------- 토글 버튼이 콘텐츠를 가리지 않도록 아래 여백 ---------- */
html.easy-mode body { padding-bottom: 96px; }

/* ---------- 저장 완료 알림이 글씨크기 버튼에 가리지 않도록 위로 ----------
   글씨크기 버튼은 오른쪽 아래에 항상 떠 있으므로, 화면 아래에 뜨는 알림은
   버튼 높이(62px)와 아래 여백(18px)만큼 위로 올려 서로 겹치지 않게 합니다. */
.bloom-toast { bottom: 100px; }
.garden-toast { bottom: 100px; }

/* 알림 글자도 어르신이 한눈에 읽을 수 있는 크기로 맞춥니다. */
html.easy-mode .bloom-toast strong { font-size: 19px; }
html.easy-mode .bloom-toast small { font-size: 16px; }

/* ---------- 창(동화책·가족앨범)이 열렸을 때의 글씨크기 버튼 ----------
   창이 열리면 버튼이 창 안으로 옮겨집니다. 창은 안쪽 내용만 따로 넘어가므로,
   창을 기준으로 오른쪽 아래에 고정하면 글을 내려도 늘 같은 자리에 남습니다. */
dialog[open] > .easy-mode-toggle {
  position: absolute;
  z-index: 20;
  right: 12px;
  bottom: 12px;
  float: none;
  margin: 0;
}

/* 동화책 창은 아래에 넘김 단추 줄이 있어, 그 위로 올려 서로 가리지 않게 합니다. */
@media (max-width: 820px) {
  #memoryDialog[open] > .easy-mode-toggle { bottom: 84px; }
}

/* 넘김 단추 줄 안에 들어간 글씨크기 버튼은 줄의 한 칸으로 자리잡습니다.
   떠 있는 버튼이 아니므로 글자를 덮을 수 없습니다. */
[data-easy-mode-dock] > .easy-mode-toggle {
  position: static;
  right: auto;
  bottom: auto;
  float: none;
  margin: 0;
  width: 54px;
  min-height: 54px;
  justify-content: center;
  padding: 6px;
  animation: none;
}
[data-easy-mode-dock] > .easy-mode-toggle .easy-mode-toggle-copy { display: none; }
[data-easy-mode-dock] > .easy-mode-toggle .easy-mode-toggle-glyph { width: 40px; height: 40px; font-size: 18px; }

/* 창 안에서는 글자를 덜 가리도록 동그란 아이콘만 남깁니다.
   (지름 60px이라 어르신도 충분히 누를 수 있는 크기입니다.) */
dialog[open] > .easy-mode-toggle .easy-mode-toggle-copy { display: none; }
dialog[open] > .easy-mode-toggle {
  width: 60px;
  min-height: 60px;
  justify-content: center;
  padding: 7px;
}
dialog[open] > .easy-mode-toggle .easy-mode-toggle-glyph { width: 44px; height: 44px; font-size: 19px; }

@media (max-width: 360px) {
  .easy-mode-toggle {
    right: 10px;
    bottom: 10px;
    width: 60px;
    min-height: 60px;
    justify-content: center;
    padding: 7px;
  }
  .easy-mode-toggle-copy { display: none; }
  .easy-mode-toggle-glyph { width: 44px; height: 44px; font-size: 19px; }
  html.easy-mode body { padding-bottom: 78px; }
  .bloom-toast { bottom: 84px; }
  .garden-toast { bottom: 84px; }
  dialog[open] > .easy-mode-toggle { right: 8px; bottom: 10px; }
  #memoryDialog[open] > .easy-mode-toggle { bottom: 78px; }
}

@media (max-width: 560px) {
  .bloom-toast { right: 16px; bottom: 100px; }
}

@media (max-width: 360px) {
  .bloom-toast { right: 10px; bottom: 84px; }
}

/* ---------- 현관 모바일 큰 글씨 ----------
   현관 카드는 작은 글씨 기준의 고정 높이를 사용하므로, 큰 글씨에서는
   카드 높이와 글 영역을 함께 늘려 문구와 입장 버튼이 겹치지 않게 합니다. */
@media (max-width: 700px) {
  .easy-mode-toggle {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 76px;
    min-height: 76px;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    padding: 7px;
  }
  .easy-mode-toggle-glyph { width: 38px; height: 38px; font-size: 17px; }
  .easy-mode-toggle-copy { display: block; text-align: center; }
  .easy-mode-toggle-label { display: block; font-size: 11px; line-height: 1.15; }
  .easy-mode-toggle-copy small { display: none; }

  html.easy-mode .garden-doors { grid-template-rows: repeat(3, minmax(218px, auto)); }
  html.easy-mode .garden-door { min-height: 218px; }
  html.easy-mode .door-copy {
    inset: 0 0 0 30%;
    align-content: center;
    justify-items: start;
    gap: 0;
    padding: 16px 14px;
    text-align: left;
  }
  html.easy-mode .door-order {
    margin-bottom: 7px;
    font-size: 12px;
    line-height: 1.35;
    letter-spacing: .1em;
  }
  html.easy-mode .door-copy > strong { font-size: clamp(27px, 8vw, 34px); line-height: 1.25; }
  html.easy-mode .door-copy > small { margin-top: 5px; font-size: 15px; line-height: 1.55; }
  html.easy-mode .door-action {
    min-height: 52px;
    margin-top: 10px;
    padding: 7px 14px;
    font-size: 14px;
    line-height: 1.35;
  }
  html.easy-mode .foyer-note {
    min-height: 78px;
    display: flex;
    align-items: center;
    padding-right: 68px;
    padding-left: 0;
    font-size: 15px;
    line-height: 1.65;
    text-align: left;
  }
  html.easy-mode body[data-story-chapter="foyer"] > .easy-mode-toggle {
    right: 4px;
    left: auto;
    bottom: max(4px, env(safe-area-inset-bottom));
    width: 60px;
    min-height: 68px;
    padding: 5px;
  }
  html.easy-mode body[data-story-chapter="foyer"] > .easy-mode-toggle .easy-mode-toggle-glyph {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
  html.easy-mode body[data-story-chapter="foyer"] > .easy-mode-toggle .easy-mode-toggle-label {
    font-size: 10px;
  }
}

@media (min-width: 701px) {
  html.easy-mode body[data-story-chapter="foyer"] > .easy-mode-toggle {
    width: 60px;
    min-height: 68px;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    padding: 5px;
  }
  html.easy-mode body[data-story-chapter="foyer"] > .easy-mode-toggle .easy-mode-toggle-glyph {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
  html.easy-mode body[data-story-chapter="foyer"] > .easy-mode-toggle .easy-mode-toggle-copy {
    display: block;
    text-align: center;
  }
  html.easy-mode body[data-story-chapter="foyer"] > .easy-mode-toggle .easy-mode-toggle-label {
    display: block;
    font-size: 10px;
    line-height: 1.15;
  }
  html.easy-mode body[data-story-chapter="foyer"] > .easy-mode-toggle .easy-mode-toggle-copy small {
    display: none;
  }
}

@media (max-width: 360px) {
  .easy-mode-toggle-copy { display: block; }
}

/* ---------- 화면 안의 글자 크기 자리 ----------
   각 화면 헤더와 로그인 카드 안에 토글을 두어 320px·200% 확대에서도
   입력칸과 주요 버튼을 가리지 않습니다. 전용 자리가 없는 예외 화면만
   기존 우하단 고정 배치를 사용합니다. */
[data-easy-mode-dock] {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-easy-mode-dock] > .easy-mode-toggle {
  position: static;
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 4px;
  border-width: 1px;
  box-shadow: 0 5px 16px rgba(24, 38, 29, .2);
  transform: none;
}
[data-easy-mode-dock] > .easy-mode-toggle:hover,
[data-easy-mode-dock] > .easy-mode-toggle:focus-visible { transform: none; }
[data-easy-mode-dock] > .easy-mode-toggle .easy-mode-toggle-copy { display: none; }
[data-easy-mode-dock] > .easy-mode-toggle .easy-mode-toggle-glyph {
  width: 38px;
  height: 38px;
  font-size: 17px;
}
html.easy-mode-docked body { padding-bottom: 0; }

/* 기본 모드도 읽기와 조작에 필요한 최소 크기를 지킵니다. */
.family-key-card label:not(.remember-key),
.compose-dialog label,
.plant-form legend,
.plant-field { font-size: max(14px, 0.875rem); }
.remember-key,
.archive-consent,
.family-route-help { font-size: max(14px, 0.875rem); }
.archive-consent input { width: 22px; height: 22px; }
.plant-field select,
.plant-field textarea { min-height: 48px; font-size: 16px; }
.family-sound-button,
.family-control-button,
.header-icon-button,
.bloom-actions button,
.garden-tasks > button,
.mobile-task-toggle { min-height: 44px; }
.family-session a,
.family-session button { min-height: 44px; }

@media (max-width: 700px) {
  [data-easy-mode-dock] > .easy-mode-toggle {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    padding: 4px;
  }
  [data-easy-mode-dock] > .easy-mode-toggle .easy-mode-toggle-glyph {
    width: 38px;
    height: 38px;
  }
  [data-easy-mode-dock] > .easy-mode-toggle .easy-mode-toggle-copy { display: none; }
  html.easy-mode-docked body { padding-bottom: 0; }
  .family-header-actions { grid-template-columns: repeat(4, auto); }
  .family-header-actions nav { grid-column: 1 / -1; }
  .family-header nav a { font-size: 12px; }
}
