/* 一日韓語・手機版導覽（底部分頁、今日任務、學習／我的頁面） */
.app-tabs { display: none; }
.app-view .app-intro h1 { margin-bottom: .2rem; }
.app-card { background: var(--study-card, #fffdf7); border: 1px solid var(--study-line, #dfd6c4); border-radius: 18px; padding: 12px 14px 14px; }
.app-week-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font-weight: 800; font-size: .92rem; color: var(--study-ink, #2c3a30); }
.app-week-head b { color: #b8433a; font-size: 1.2rem; }
.app-week-count { color: var(--study-muted, #5c685e); font-size: .82rem; }
.app-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 8px; }
.app-day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.app-day small { font-size: .72rem; font-weight: 700; color: var(--study-muted, #5c685e); }
.app-day i { width: 32px; height: 32px; border-radius: 50%; background: #efe7d6; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 900; font-size: .9rem; color: #f2c55c; }
.app-day i.is-done { background: var(--study-green, #254d3b); }
.app-day i.is-today { background: transparent; border: 2px dashed var(--study-green, #254d3b); }
.app-view { padding-bottom: 1rem; }
.app-step { margin-top: 1.1rem; }
.app-step h2 { display: flex; align-items: center; gap: .5rem; font-size: 1rem; color: var(--study-ochre, #79531f); margin: 0 0 .6rem; }
.app-step h2 span { background: #efe5d2; color: #6a5638; border-radius: 6px; padding: 1px 8px 2px; font-size: .78rem; }
.app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.app-tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 118px; padding: 12px 12px 13px; background: var(--study-card, #fffdf7); border: 1px solid var(--study-line, #dfd6c4); border-radius: 18px; color: var(--study-ink, #2c3a30); text-decoration: none; overflow: hidden; }
.app-tile img { position: absolute; right: 4px; top: 4px; width: 64px; height: 64px; object-fit: contain; }
.app-tile strong { font-size: 1.02rem; color: var(--study-green, #254d3b); }
.app-tile span { font-size: .8rem; color: var(--study-muted, #5c685e); line-height: 1.45; margin-top: 2px; }
.app-tile-wide { min-height: 96px; padding-right: 96px; }
.app-tile-wide img { width: 84px; height: 84px; top: 50%; transform: translateY(-50%); right: 8px; }
.app-tile-soft { background: #fdeef0; border-color: #f1c9cf; justify-content: center; }
.app-more { display: inline-block; margin-top: 1rem; }
.app-next { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; margin-top: 12px; padding: 12px 16px 14px; border-radius: 18px; background: #fdeef0; border: 1px solid #f1c9cf; color: var(--study-ink, #2c3a30); text-decoration: none; }
.app-next-label { grid-column: 1; font-size: .78rem; font-weight: 800; color: #b8433a; }
.app-next strong { grid-column: 1; font-size: 1rem; }
.app-next-go { grid-column: 2; grid-row: 1 / span 2; font-weight: 800; font-size: .85rem; color: var(--study-green, #254d3b); }
.app-me-tasks { margin-top: 12px; }
.app-me-tasks:empty { display: none; }
.app-view .app-week { margin-top: 12px; }
.app-rows { margin-top: 14px; background: var(--study-card, #fffdf7); border: 1px solid var(--study-line, #dfd6c4); border-radius: 18px; padding: 2px 14px; }
.app-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #ece4d3; color: var(--study-ink, #2c3a30); text-decoration: none; }
.app-row:first-child { border-top: 0; }
.app-row-mark { flex: none; width: 36px; height: 36px; border-radius: 11px; background: #efe5d2; color: #6a5638; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: .9rem; }
.app-row-mark.is-line { background: #06c755; color: #fff; font-size: .62rem; letter-spacing: .02em; }
.app-row-copy { display: flex; flex-direction: column; min-width: 0; }
.app-row-copy strong { font-size: .95rem; }
.app-row-copy span { font-size: .78rem; color: var(--study-muted, #5c685e); }
.app-row-arrow { margin-left: auto; color: #a99d88; font-size: 1.3rem; }
.app-today, .app-tasks, .app-me-notice { display: none; }

@media (width < 720px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .app-tabs { display: flex; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; justify-content: space-around; padding: 7px 4px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 253, 247, .97); border-top: 1px solid var(--study-line, #dfd6c4); box-shadow: 0 -6px 18px rgba(60, 50, 30, .06); }
  .app-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; padding: 2px 0; color: #9b8f7c; font-size: .7rem; font-weight: 800; text-decoration: none; }
  .app-tab svg { width: 25px; height: 25px; }
  .app-tab[aria-current="page"] { color: var(--study-green, #254d3b); }
  .app-tab-dot { position: absolute; top: 0; right: 16px; width: 10px; height: 10px; border-radius: 50%; background: #d9372e; border: 2px solid #fffdf7; }
  .app-tab-dot[hidden] { display: none; }
  body.is-chaipo-game .app-tabs { display: none; }
  #mobile-menu-trigger, #study-line-contact { display: none !important; }
  .site-header .student-entry { display: none; }

  #view-home:not([hidden]) { display: flex; flex-direction: column; }
  #view-home > #daily-healing { order: 1; }
  #view-home > .app-today { display: block; order: 2; }
  #view-home > .app-tasks { display: block; order: 3; }
  #view-home > .app-me-notice:not([hidden]) { display: flex; order: 4; }
  #view-home > .home-welcome { order: 5; }
  #view-home > .home-learning { order: 6; }
  #view-home > #course-notice-trigger { order: 7; }
  #view-home > .home-path-link { order: 8; }

  .app-date { margin: 0; font-size: .82rem; font-weight: 700; color: var(--study-muted, #5c685e); }
  .app-greet { display: flex; align-items: flex-end; justify-content: space-between; }
  .app-greet h2 { margin: 2px 0 0; font-size: 1.4rem; line-height: 1.35; color: var(--study-green, #254d3b); }
  .app-greet img { width: 76px; height: auto; margin-bottom: -6px; }
  .app-today .app-week { margin-top: 8px; }

  .app-tasks { margin-top: 12px; padding: 14px 14px 12px; border-radius: 22px; background: var(--study-green, #254d3b); color: #fff; }
  .app-tasks-head { display: flex; justify-content: space-between; align-items: center; }
  .app-tasks-head h2 { margin: 0; color: #fff; font-size: 1.15rem; }
  .app-tasks-head span { color: #f2c55c; font-weight: 900; font-size: .85rem; }
  .app-progress { height: 8px; margin-top: 8px; border-radius: 99px; background: rgba(255, 255, 255, .18); overflow: hidden; }
  .app-progress i { display: block; height: 100%; border-radius: 99px; background: #f2c55c; transition: width .3s; }
  .app-task-list { list-style: none; margin: 4px 0 0; padding: 0; }
  .app-task { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 9px 10px; border-radius: 16px; background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
  .app-task img { flex: none; width: 46px; height: 46px; border-radius: 12px; background: #fffdf7; object-fit: contain; }
  .app-task img.is-photo { object-fit: cover; }
  .app-task-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .app-task-copy strong { font-size: .95rem; }
  .app-task-copy span { font-size: .76rem; color: #cfe0d3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-task-check { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #9bbfa6; display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--study-green, #254d3b); }
  .app-task.is-done .app-task-check { background: #f2c55c; border-color: #f2c55c; }
  .app-task.is-done strong { opacity: .75; }
  .app-tasks-foot { display: flex; justify-content: space-between; gap: 8px; margin: 10px 2px 0; font-size: .74rem; color: #cfe0d3; }
  .app-tasks-foot a { color: #f2c55c; font-weight: 800; white-space: nowrap; }

  .app-me-notice { align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 11px 14px; border-radius: 16px; background: #fdeef0; border: 1px solid #f1c9cf; color: var(--study-ink, #2c3a30); font-weight: 800; font-size: .86rem; text-decoration: none; }

  #view-home > .home-welcome { display: grid; grid-template-columns: 1fr; margin-top: 12px; padding: 12px 14px 14px; background: var(--study-card, #fffdf7); border: 1px solid var(--study-line, #dfd6c4); border-radius: 18px; }
  #view-home > .home-welcome .hero-image, #view-home > .home-welcome .home-room-preview, #view-home > .home-welcome .eyebrow { display: none !important; }
  #view-home > .home-welcome h1 { font-size: 1.05rem; margin: 0; color: var(--study-ochre, #79531f); }
  #view-home > .home-welcome .home-welcome-intro { font-size: .98rem; font-weight: 800; color: var(--study-ink, #2c3a30); margin: 2px 0 8px; }
  #view-home > .home-welcome .home-primary { justify-self: start; padding: .45rem 1rem .55rem; font-size: .9rem; }
  #view-home > .home-learning > .section-heading, #view-home > .home-learning > .home-daily-plan { display: none; }
  #view-home > #course-notice-trigger:not([hidden]) { margin-top: 14px; padding: 10px 14px; min-height: 0; border-radius: 16px; }
  #view-home > #course-notice-trigger .course-banner-art { width: 34px; height: 34px; }
  #view-home > #course-notice-trigger strong { font-size: .92rem; }
  #view-home > #course-notice-trigger [data-banner-subtitle] { font-size: .76rem; }
  #view-home > #daily-healing { margin: 0 0 14px; }
  #view-home > .app-today .app-greet h2 { font-size: 1.25rem; }
}
