/* Shared visual shell for every primary Say ABC page. */
:root {
  --ui-paper: #fcfaf4;
  --ui-paper-deep: #f3f0e6;
  --ui-ink: #405047;
  --ui-muted: #849087;
  --ui-line: #e3e5da;
  --ui-green: #5f8f70;
  --ui-green-soft: #e7f2e8;
  --ui-shadow: 0 5px 16px rgba(78, 101, 86, 0.1);
}

* {
  box-sizing: border-box;
}

body.site-page {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  color: var(--ui-ink);
  background: #e8efeb;
  font-family: "Nunito", "PingFang SC", "Hiragino Sans GB", "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body.site-page a {
  color: inherit;
}

body.site-page button,
body.site-page input,
body.site-page textarea {
  font-family: inherit;
}

body.site-page button:focus-visible,
body.site-page a:focus-visible,
body.site-page input:focus-visible,
body.site-page textarea:focus-visible {
  outline: 3px solid rgba(95, 143, 112, 0.56);
  outline-offset: 3px;
}

body.site-page .app-stage,
body.site-page .word-library-app {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 0;
}

body.site-page .app-shell,
body.site-page .library-shell {
  position: relative;
  display: flex;
  width: 100%;
  height: 100svh;
  min-height: 0;
  max-width: 440px;
  max-height: 100svh;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--ui-paper);
  box-shadow: none;
}

body.site-page .app-shell::before,
body.site-page .app-shell::after {
  position: absolute;
  z-index: 0;
  display: block;
  height: 4px;
  border-radius: 999px;
  content: "";
  opacity: 0.48;
}

body.site-page .app-shell::before {
  top: 15px;
  left: 15%;
  width: 70px;
  background: #d8b6a7;
  transform: rotate(-4deg);
}

body.site-page .app-shell::after {
  top: 28px;
  right: 15%;
  width: 39px;
  background: #9fc7bd;
  transform: rotate(5deg);
}

body.site-page .app-content,
body.site-page .library-content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 18px 110px;
  scrollbar-color: #c7d9ce transparent;
  scrollbar-width: thin;
}

body.site-page.page-home .app-content {
  padding-top: 22px;
}

body.site-page.page-settings > .app-stage > .app-shell > .page-header {
  min-height: 76px;
  padding: 16px 18px 8px;
}

body.site-page.page-library .page-header {
  padding: 4px 0 0;
}

body.site-page .topbar {
  min-height: 60px;
}

body.site-page .page-title,
body.site-page .brand-title,
body.site-page .page-heading h1,
body.site-page .intro-title,
body.site-page .section-heading h2,
body.site-page .practice-heading h2,
body.site-page .review-heading h2 {
  color: var(--ui-ink);
  font-weight: 900;
}

body.site-page.page-library .page-title {
  font-size: 26px;
  line-height: 1.08;
}

body.site-page.page-wow .page-heading h1 {
  font-size: 21px;
}

body.site-page.page-settings .page-title {
  font-size: 23px;
}

body.site-page .soft-card,
body.site-page .workbench-panel,
body.site-page .matching-card,
body.site-page .settings-panel,
body.site-page .group-item,
body.site-page .custom-trigger,
body.site-page .reset-section,
body.site-page .word-card,
body.site-page .empty-state,
body.site-page .wow-entry {
  border-radius: 22px;
  box-shadow: var(--ui-shadow);
}

body.site-page .word-card,
body.site-page .wow-entry,
body.site-page .empty-state {
  border-width: 1.5px;
}

body.site-page .primary-button,
body.site-page .library-button,
body.site-page .record-button,
body.site-page .page-action,
body.site-page .back-button,
body.site-page .icon-button {
  border-radius: 16px;
}

body.site-page .bottom-nav {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  min-height: 78px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1.5px solid var(--ui-line);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 -6px 18px rgba(78, 101, 86, 0.08);
  backdrop-filter: blur(8px);
}

body.site-page .bottom-nav-item {
  display: flex;
  min-width: 0;
  min-height: 58px;
  flex: initial;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 2px;
  border-radius: 16px;
  color: #94a098;
  background: transparent;
  cursor: pointer;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}

body.site-page .bottom-nav-item:hover,
body.site-page .bottom-nav-item.is-active {
  color: var(--ui-green);
  background: var(--ui-green-soft);
}

body.site-page .bottom-nav-item.is-active {
  box-shadow: inset 0 -2px 0 rgba(95, 143, 112, 0.12);
}

body.site-page .bottom-nav-icon {
  display: grid;
  min-height: 23px;
  place-items: center;
  color: currentColor;
  font-size: 21px;
  line-height: 1;
}

@media (min-width: 600px), (orientation: landscape) {
  body.site-page .app-stage,
  body.site-page .word-library-app {
    padding: 16px;
  }

  body.site-page .app-shell,
  body.site-page .library-shell {
    width: min(92vw, 440px, calc((100svh - 32px) * 9 / 16));
    height: auto;
    min-height: 0;
    max-height: calc(100svh - 32px);
    aspect-ratio: 9 / 16;
    border: 1.5px solid #d9e4dc;
    border-radius: 30px;
    box-shadow: 0 18px 44px rgba(71, 108, 91, 0.16);
  }
}

@media (max-width: 360px) {
  body.site-page .app-content,
  body.site-page .library-content {
    padding-right: 14px;
    padding-left: 14px;
  }

  body.site-page .bottom-nav {
    padding-right: 5px;
    padding-left: 5px;
  }

  body.site-page .bottom-nav-item {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.site-page *,
  body.site-page *::before,
  body.site-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
