/* Global calm, high visibility control contract. */
button,
.nav button,
.tile[role="button"] {
  min-height: 44px !important;
  cursor: pointer;
  color: #203b38 !important;
  border: 1px solid #718e87 !important;
  background: #eef5f2 !important;
  opacity: 1 !important;
}
button.primary,
.edu-auth-primary {
  background: #c8e1d9 !important;
  color: #183e35 !important;
  border-color: #54796f !important;
}
button.on,
button.selected,
button[aria-pressed="true"],
.nav button[aria-current="page"] {
  background: #d5e7e1 !important;
  border: 2px solid #426e60 !important;
  font-weight: 800 !important;
}
button.on::before,
button.selected::before,
button[aria-pressed="true"]::before {
  content: "✓ ";
  font-weight: 900;
}
button:disabled {
  color: #526862 !important;
  background: #e3ebe7 !important;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #386e61 !important;
  outline-offset: 3px;
}
input,
textarea {
  color: #223b35 !important;
  background: #fffdf9 !important;
  border: 1px solid #7f948b !important;
  font: inherit;
  min-height: 44px;
  max-width: 100%;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  box-sizing: border-box;
}
textarea {
  min-height: 100px;
}
input::placeholder,
textarea::placeholder {
  color: #596f66 !important;
  opacity: 1;
}
input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-height: 24px;
  vertical-align: middle;
  margin-right: 8px;
}
select {
  min-height: 44px;
  max-width: 100%;
  font: inherit;
  background: #fffdf9;
  color: #223b35;
  border: 1px solid #7f948b;
  border-radius: 12px;
  padding: 10px;
}
.sub,
.subtle,
.helper,
small {
  color: #485f57 !important;
}
.nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.nav button {
  font-size: 12px;
  padding: 8px 4px;
}
.nav i {
  display: block;
}
.edu-error {
  background: #fff4eb;
  color: #6d3024;
  border: 1px solid #af7661;
  padding: 12px;
  border-radius: 12px;
  margin: 12px 0;
  white-space: pre-wrap;
}
.edu-status {
  font-size: 12px;
  color: #426257;
  padding: 8px;
}
.edu-list {
  display: grid;
  gap: 12px;
}
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.edu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.edu-card-image {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 14px;
}
.edu-answer {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.edu-field {
  display: block;
  margin: 12px 0 6px;
  font-weight: 700;
}
.edu-dialog {
  position: fixed;
  inset: 0;
  background: #203b3870;
  z-index: 200;
  padding: 24px;
  overflow: auto;
}
.edu-dialog > div {
  max-width: 460px;
  margin: 8vh auto;
  background: #fffdf9;
  border-radius: 22px;
  padding: 20px;
}
.edu-photo {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
}
.screen[hidden] {
  display: none !important;
}
#eduCheckinEditor {
  display: block;
}
.screen h1,
.screen h2,
.screen h3 {
  overflow-wrap: anywhere;
}
.edu-live-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.edu-checkin-note {
  white-space: pre-wrap;
  font-size: 13px;
  margin: 8px 0;
}
@media (max-width: 390px) {
  .edu-grid,
  .edu-live-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-contrast: more) {
  button,
  input,
  textarea {
    border-color: #203b38 !important;
    border-width: 2px !important;
  }
  body {
    color: #18382b;
  }
}
.edu-dialog .edu-field:has(input[type="checkbox"]) {
  min-height: 44px;
  display: flex;
  align-items: center;
}
canvas {
  touch-action: none;
}
#usAvatar .edu-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.edu-support-note {
  font-size: 13px;
}
.edu-auth-mark img {
  width: 76px;
  height: 66px;
  object-fit: contain;
}
.edu-pair-code {
  overflow-wrap: anywhere;
  line-height: 1.5;
}

/* Compact presentation for Today, Translate and Understand only. */
:is(#todayHome, #translationHome, #understandProfile, #plans, #memories) .edu-fold > summary {
  min-height: 44px;
  cursor: pointer;
  padding: 10px 4px;
  color: #203b38;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
:is(#todayHome, #translationHome, #understandProfile, #plans, #memories) .edu-fold > summary small {
  display: block;
  margin-top: 4px;
  font-weight: 400;
}
:is(#todayHome, #translationHome, #understandProfile, #plans, #memories) .edu-fold[open] > summary {
  margin-bottom: 8px;
  border-bottom: 1px solid #7f948b;
}
#eduTodayRequests[hidden] { display: none; }
@media (max-width: 600px) {
  :is(#todayHome, #translationHome, #understandProfile, #plans, #memories) .homeGreeting { margin-bottom: 12px; }
  :is(#todayHome, #translationHome, #understandProfile, #plans, #memories) :is(.card, .understandCard) {
    padding: 14px;
    margin-bottom: 12px;
  }
  :is(#todayHome, #translationHome, #understandProfile, #plans, #memories) h2 { margin: 8px 0; }
  :is(#todayHome, #translationHome, #understandProfile, #plans, #memories) h3 { margin: 6px 0; }
}

.edu-file-picker {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
}

/* Warm, compact discovery and keepsakes. */
#todayHome .homeGreeting {
  border-left: 3px solid #718e87;
  padding-left: 14px;
}
#eduTodayWelcome { color: #42665d; }
#playHome .edu-game-discovery {
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #a4bbb2;
  border-radius: 18px;
  background: linear-gradient(125deg, #f2f7f2, #fff9f0);
  gap: 12px;
}
#playHome .edu-game-art {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid #8bab9e;
  border-radius: 18px 18px 18px 8px;
  background: #deece4;
  font-size: 24px;
  box-shadow: 3px 3px 0 #f0e3d1;
}
#playHome [data-mood="playful"] .edu-game-art { background: #f4e6dc; }
#playHome [data-mood="story"] .edu-game-art { background: #eae6f2; }
#playHome [data-mood="choice"] .edu-game-art { background: #e1eef2; }
#playHome .edu-game-discovery span { line-height: 1.45; }
#memories .edu-memory-summary { align-items: center; }
#memories .edu-memory-summary > span { display: inline-block; vertical-align: middle; max-width: calc(100% - 92px); }
.edu-memory-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #7f948b;
  margin-right: 12px;
  vertical-align: middle;
}
#memories .edu-memory-summary:not(:has(img)) > span { max-width: calc(100% - 24px); }
.edu-reveal { animation: edu-reveal-in 240ms ease-out; }
@keyframes edu-reveal-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .edu-reveal { animation: none; } }

/* Today's illustrated discovery, using initials only. */
#todayHome #eduDaily.edu-moment-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid #91aa9e;
  background: #fffaf2;
  border-radius: 22px;
}
.edu-moment-art { display: block; width: 100%; height: 150px; object-fit: cover; object-position: center; }
.edu-moment-body { padding: 16px; }
.edu-moment-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.edu-moment-tag { background: #efe4ef; color: #57405b; border: 1px solid #c3adc3; border-radius: 20px; padding: 4px 9px; font-size: 12px; }
#eduDaily h2 { font-size: clamp(22px, 5.8vw, 28px); line-height: 1.22; margin: 12px 0; }
.edu-moment-answer { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid #8bab9e; border-radius: 16px; margin: 10px 0; }
.edu-moment-answer > div { min-width: 0; flex: 1; }
.edu-moment-answer p { margin: 5px 0 0; overflow-wrap: anywhere; }
.edu-moment-mine { background: #e5f0e9; }
.edu-moment-theirs { background: #f0e8f2; border-color: #b29fba; }
.edu-person-initial { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; background: #fffaf2; color: #203b38; border: 1px solid #7f948b; font-weight: 800; }
.edu-moment-waiting { display: flex; gap: 12px; align-items: center; }
.edu-moment-waiting p { flex: 1; }
.edu-moment-anticipation { border-left: 3px solid #718e87; padding-left: 10px; }
.edu-moment-payoff { text-align: center; color: #42665d; }
.edu-moment-footer { font-size: 13px; line-height: 1.45; color: #42665d; margin: 12px 0 0; }
#eduDaily .primary { width: 100%; }
@media (min-width: 601px) { .edu-moment-art { height: 180px; } }

.edu-moment-choices { display: grid; gap: 8px; margin: 12px 0; }

/* Keep profile headings readable at phone widths. */
#understandProfile .profileIntro { display: block; }
#understandProfile .profileIntro h2 { width: 100%; word-break: normal; overflow-wrap: normal; margin-bottom: 10px; }
#understandProfile .profileIntro .sub { margin: 0; }
.edu-entry-guidance { margin-top: 16px; padding-top: 12px; border-top: 1px solid #91aa9e; }
.edu-entry-guidance h3 { font-size: 17px; margin: 0 0 8px; }
.edu-entry-guidance li { margin-bottom: 8px; line-height: 1.5; }
.edu-entry-guidance[hidden], .edu-entry-context[hidden] { display: none !important; }

/* Readable category labels and supporting copy in the four Play cards. */
#playHome .playTabs .stageBtn { font-size: 16px !important; line-height: 1.4 !important; padding: 12px !important; min-width: 0; }
#playHome .playTabs .stageBtn b { font-size: 16px !important; line-height: 1.35 !important; }
#playHome .playTabs .stageBtn b + span { font-size: 15px !important; line-height: 1.4 !important; }

.edu-push-option { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 8px 0; }
.edu-push-option input { width: 22px; height: 22px; flex: 0 0 22px; }
