/* MindGuard's established sage, paper and clay palette in a mobile shell. */
:root {
  --mini-paper: #faf5eb;
  --mini-ink: #344334;
  --mini-green: #4e6a50;
  --mini-clay: #a35e3f;
  color-scheme: light;
  font-family: 'Nunito', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 16px;
  background: #eee8dc;
}
html { min-height: 100%; }
body { min-width: 280px; background: #eee8dc; }
button, a.button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a.button { min-height: 44px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #986a31;
  outline-offset: 4px;
}
button, a { touch-action: manipulation; }

/* The image is displayed whole at its original 4:3 ratio on every screen. */
.welcome {
  width: min(100%, 560px);
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--mini-paper);
  box-shadow: 0 0 70px #4337180b;
}
.welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(13px, env(safe-area-inset-top)) 22px 13px;
}
.welcome-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.9px;
  text-decoration: none;
  color: #354a37;
}
.welcome-brand > span {
  display: grid;
  place-items: center;
  width: 33px;
  height: 36px;
  border-radius: 12px 12px 17px 17px;
  color: #fff6e5;
  background: var(--mini-green);
  font: italic 28px Georgia, serif;
}
.welcome-help {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 650;
  background: #f7ebdf;
  border-color: #decbb8;
  color: #80503a;
  border-radius: 100px;
  white-space: nowrap;
}
.welcome-landscape { width: 100%; background: #e8a46c; }
.welcome-landscape img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; }
.welcome-copy { padding: 25px 28px 16px; text-align: center; }
.welcome-eyebrow {
  color: #6a715d;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .12em;
  margin: 0 0 13px;
}
.welcome-copy h1 {
  font: 400 clamp(32px, 8.6vw, 44px)/1.17 Georgia, 'Times New Roman', serif;
  letter-spacing: -1px;
  color: var(--mini-ink);
  margin: 0 0 15px;
}
.welcome-copy h1 em { color: var(--mini-green); font-weight: 400; }
.welcome-note { font-size: 16px; color: #616655; line-height: 1.7; margin: 0 0 23px; }
.welcome-enter {
  width: 100%;
  min-height: 54px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 5px 12px #4e6a5015;
}
.welcome-choice { font-size: 14px; color: #69705f; margin: 11px 0 0; }
.welcome-foot {
  text-align: center;
  padding: 10px 20px max(15px, env(safe-area-inset-bottom));
  margin-top: auto;
}
.welcome-foot p { font-size: 14px; line-height: 1.65; color: #6d7063; margin: 0; }
.welcome-foot button { min-height: 44px; font-size: 14px; justify-content: center; text-align: center; }

/* Core page keeps the original application's controls and functional IDs. */
#mini-core {
  max-width: 700px;
  min-height: 100svh;
  margin: 0 auto;
  background: var(--mini-paper);
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  box-shadow: 0 0 70px #4337180b;
}
.top {
  position: sticky;
  top: 0;
  z-index: 9;
  max-width: 700px;
  padding: max(12px, env(safe-area-inset-top)) 20px 12px;
  margin: 0;
  border-bottom: 1px solid #e8e2d5;
  background: #faf5ebf5;
}
.top .brand { font-size: 23px; }
.top .brand > span { width: 32px; height: 35px; font-size: 27px; border-radius: 11px 11px 16px 16px; }
.top .help-link { border-radius: 100px; font-size: 14px; padding: 9px 12px; min-height: 44px; }
main { padding: 18px 20px 30px; }
.hero { min-height: 168px; margin: 0; grid-template-columns: 1.35fr 1fr; border-radius: 21px; background: #f1ead9; }
.hero-copy { padding: 23px 0 22px 22px; margin-right: -50px; position: relative; z-index: 1; }
.hero-copy .eyebrow { font-size: 14px; letter-spacing: 0; max-width: 230px; margin-bottom: 11px; }
.hero h1 { font-size: 27px; line-height: 1.25; letter-spacing: -.8px; white-space: nowrap; margin-bottom: 10px; }
.hero img { min-height: 168px; max-height: 220px; object-position: 59% 50%; opacity: .58; }
.hero-note { font-size: 14px; line-height: 1.6; }
.mini-demo-note { font-size: 14px; line-height: 1.6; color: #666b5b; padding: 12px 2px 0; margin: 0 0 24px; }
.section-head { margin-bottom: 18px; }
.section-head .eyebrow { font-size: 14px; letter-spacing: .035em; margin-bottom: 8px; }
.section-head h2 { font-size: 27px; line-height: 1.3; letter-spacing: -.6px; margin-bottom: 10px; }
.section-head > p:last-child { font-size: 16px; line-height: 1.7; }
.mini-music { margin-bottom: 18px; padding: 14px 16px 8px; border: 1px solid #d8dfcd; border-radius: 17px; background: #edf0e4; }
.mini-music-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mini-music-row > div { min-width: 0; }
.mini-music-heading { font-weight: 750; font-size: 16px; color: #3c583e; margin: 0 0 3px; }
#mini-music-status { font-size: 14px; line-height: 1.5; margin: 0; color: #59624f; }
#mini-music-toggle { min-height: 44px; min-width: 108px; flex: 0 0 auto; padding: 9px 12px; font-size: 14px; background: #fffdf8; }
.mini-music summary { font-size: 14px; cursor: pointer; min-height: 44px; display: flex; align-items: center; color: #4e6a50; text-decoration: underline; text-underline-offset: 3px; }
.mini-music details label { display: block; font-size: 14px; font-weight: 650; margin: 6px 0; }
.mini-music details input { width: 100%; min-height: 44px; accent-color: #4e6a50; }
.mini-music-credit { font-size: 14px; line-height: 1.6; margin: 4px 0 10px; }
.express-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.card { border-radius: 19px; padding: 20px; box-shadow: none; background: #fffdf8; }
.write-card > label { font-size: 16px; line-height: 1.5; margin-bottom: 9px; }
select, textarea { font-size: 16px; border-radius: 13px; padding: 12px; min-width: 0; }
textarea { min-height: 148px; }
textarea::placeholder { color: #767b6b; }
.mini-send-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.mini-send-row p { margin: 0; font-size: 14px; line-height: 1.5; color: #616655; }
.mini-send-row button { flex: 0 0 auto; min-width: 96px; min-height: 48px; border-radius: 13px; font-size: 16px; }
#result { scroll-margin-top: 90px; scroll-margin-bottom: 100px; }
label small { font-size: 14px; }
.small, .status, .check, .support-boundary, .voice-options, .voice-options summary span,
.quick-feelings legend, .quick-feelings button, .text-button, footer small,
.mg-breath .eyebrow, .mg-breath-music label, .mg-breath-music-status,
.mg-breath-comfort { font-size: 14px; }
.quick-feelings { margin-top: 23px; }
.quick-feelings legend { margin-bottom: 12px; }
.emotion-choices { gap: 8px; }
.emotion-choices button { min-height: 44px; font-size: 14px; padding: 9px 12px; border-radius: 100px; font-weight: 550; }
.emotion-choices button[aria-pressed=true] { background: #e8eddf; border-color: #6f8964; color: #344f35; }
.write-card > .actions { gap: 8px; margin-top: 20px; }
.write-card > .actions > .primary { flex-basis: 100%; width: 100%; min-height: 52px; }
.actions button { font-size: 15px; }
.mg-breath-shortcut { margin-top: 13px; padding: 12px; gap: 9px; border-radius: 13px; align-items: center; flex-wrap: wrap; }
.mg-breath-shortcut p { font-size: 14px; }
.mg-breath-shortcut button { font-size: 14px; min-width: 130px; }
.mg-breath { padding: 22px 20px; border-radius: 19px; }
.mg-breath-heading h3 { font-size: 27px; }
.mg-breath-visual { height: 205px; }
.mg-breath-music input[type=range] { min-height: 44px; }
.gentle-card { padding: 22px 20px; background: #edf0e4; border-color: #d9dfcd; }
.gentle-card .leaf-mark { display: none; }
.gentle-card h3 { font-size: 20px; }
.gentle-card p { font-size: 15px; line-height: 1.7; }
.text-button { min-height: 44px; }
.voice-options { margin-top: 20px; padding-top: 16px; }
.voice-options p { font-size: 14px; }
.voice-options summary { min-height: 44px; font-size: 15px; }
.voice-options select { max-width: none; }
.check input { width: 20px; height: 20px; margin-top: 3px; }
.one-question { padding: 16px; }
.one-question > p { font-size: 18px; }
.one-question .actions button { flex: 1 1 auto; }
.one-question .actions button:last-child { flex-basis: 100%; }
.support-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.support-grid .card { padding: 21px; }
.support-grid .eyebrow { font-size: 14px; letter-spacing: .015em; }
.support-grid p { font-size: 16px; }
.support-grid .small { font-size: 14px; }
.support-grid h3 { font-size: 23px; }
.support-grid .card button { align-self: flex-start; margin-top: 8px; font-size: 15px; }
.reflection h3 { font-size: 23px; }
.reflection textarea { min-height: 144px; }
.reflection > .actions .primary { flex: 1 1 auto; }
.prose p, .emergency p { font-size: 16px; }
.emergency .small { font-size: 14px; }
footer { margin: 0 20px; padding: 23px 0 18px; gap: 6px 18px; }
footer .brand { font-size: 21px; }
footer p, footer .text-button { font-size: 14px; }
footer small { line-height: 1.6; }
.panel, .section-head { scroll-margin-top: 22px; }

/* The existing buttons remain the application's only three primary routes. */
.tabs {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 700px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
  margin: 0;
  border: 0;
  border-top: 1px solid #dce1d0;
  border-radius: 20px 20px 0 0;
  background: #fffdf8f7;
  backdrop-filter: blur(16px);
  box-shadow: 0 -6px 25px #41513a08;
}
.tabs button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 8px 5px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #6c735f;
  background: transparent;
  box-shadow: none;
}
.tabs svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabs span { font-size: 14px; letter-spacing: 0; font-weight: 550; color: inherit; margin: 0; line-height: 1.35; }
.tabs button[aria-current=page] { color: #345135; background: #e8eddf; border-color: transparent; box-shadow: none; }
.tabs button[aria-current=page] span { font-weight: 750; }
.tabs button:hover { background: #eef1e5; }

@media (max-width: 359px) {
  .welcome-header, .top { padding-inline: 16px; gap: 8px; }
  .welcome-brand, .top .brand { font-size: 21px; gap: 7px; }
  .welcome-help, .top .help-link { padding-inline: 10px; }
  .welcome-copy { padding: 22px 20px 12px; }
  .welcome-copy h1 { font-size: 32px; }
  .welcome-eyebrow { letter-spacing: .08em; }
  .welcome-note { font-size: 15px; }
  main { padding: 16px 15px 25px; }
  .hero-copy { padding: 19px 0 18px 17px; margin-right: -55px; }
  .hero-copy .eyebrow { max-width: 175px; font-size: 14px; }
  .hero h1 { font-size: 24px; }
  .section-head h2 { font-size: 25px; }
  .card, .mg-breath { padding: 18px 16px; }
  .actions button { font-size: 14px; }
  .tabs { padding-inline: 8px; }
}
@media (min-width: 560px) {
  .welcome-copy { padding-inline: 55px; }
  .welcome-copy h1 { font-size: 43px; }
  .welcome-note br { display: none; }
  .welcome-header { padding-inline: 27px; }
  .hero { min-height: 195px; grid-template-columns: 1.15fr 1fr; }
  .hero-copy { padding: 27px 0 27px 28px; }
  .hero h1 { font-size: 34px; }
  .hero img { min-height: 195px; opacity: .8; }
  main { padding-inline: 28px; }
  .top { padding-inline: 28px; }
  footer { margin-inline: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
