/* Android-only presentation. The native-app class is applied by app.js in Capacitor. */
html.native-app {
  --native-bg: #f7f5fc;
  --native-surface: #ffffff;
  --native-surface-soft: #f0ecf7;
  --native-primary: #7452a8;
  --native-primary-dark: #51347f;
  --native-pink: #d9639c;
  --native-text: #211b28;
  --native-muted: #6a6072;
  --native-line: #e9e3ef;
  --native-nav-height: 76px;
  --native-shadow-color: 44, 29, 61;
  --native-shadow-sm: 0 2px 8px rgba(var(--native-shadow-color), .08);
  --native-shadow-md: 0 6px 18px rgba(var(--native-shadow-color), .10);
  --native-shadow-lg: 0 14px 34px rgba(var(--native-shadow-color), .16);
  --native-press: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
  background: var(--native-bg);
  color-scheme: light;
}

html.native-app body {
  min-height: 100dvh;
  background: var(--native-bg);
  color: var(--native-text);
  font-family: "Z06 Walone", "Quicksand", system-ui, sans-serif;
  font-weight: 500;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

html.native-app body::before,
html.native-app .ambient-layer {
  display: none !important;
}

html.native-app .app-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: 0 0 calc(var(--native-nav-height) + var(--safe-bottom));
}

/* Login/loading do not need the signed-in bottom-navigation reserve. */
html.native-app body:has(#authLoading:not(.hidden)) .app-shell,
html.native-app body:has(#loginView:not(.hidden)) .app-shell {
  min-height: 100dvh;
  padding-bottom: 0;
  overflow: hidden;
}

html.native-app body:has(#authLoading:not(.hidden)),
html.native-app body:has(#loginView:not(.hidden)) {
  height: 100dvh;
  overflow: hidden;
}

html.native-app .app-shell > main {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

/* Native app bar */
html.native-app .topbar {
  position: sticky;
  z-index: 35;
  top: 0;
  min-height: calc(64px + var(--safe-top));
  margin: 0;
  padding: var(--safe-top) 12px 0;
  border-bottom: 1px solid var(--native-line);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--native-shadow-sm);
  animation: none;
  backdrop-filter: none;
}

html.native-app .brand-block { justify-content: flex-start; gap: 9px; }
html.native-app .brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  box-shadow: none;
}
html.native-app .brand-text { text-align: left; }
html.native-app .topbar h1.brand-wordmark {
  color: var(--native-primary-dark);
  background: none;
  font-family: "Baloo 2", "Z06 Walone", sans-serif;
  font-size: 20px;
  font-weight: 800;
}
html.native-app .brand-eyebrow { display: none; }
html.native-app .icon-button,
html.native-app .ghost-small {
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--native-primary-dark);
  box-shadow: none;
  transition: var(--native-press);
}
html.native-app .icon-button:active,
html.native-app .ghost-small:active { background: var(--native-surface-soft); transform: scale(.94); }
html.native-app .icon-button:focus-visible,
html.native-app .ghost-small:focus-visible {
  outline: 2px solid var(--native-primary);
  outline-offset: 2px;
}

html.native-app .app-menu {
  position: fixed;
  top: calc(58px + var(--safe-top));
  left: 10px;
  width: min(340px, calc(100% - 20px));
  padding: 8px;
  border: 1px solid var(--native-line);
  border-radius: 20px;
  background: var(--native-surface);
  box-shadow: var(--native-shadow-lg);
  backdrop-filter: none;
}
html.native-app .app-menu-item {
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 14px;
  transition: background-color 120ms ease;
}
html.native-app .app-menu-item:active { background: var(--native-surface-soft); }
html.native-app .app-menu-item > span { background: var(--native-surface-soft); color: var(--native-primary); }
html.native-app .app-menu-item strong { color: var(--native-text); font-size: 14px; }
html.native-app .app-menu-item small { color: var(--native-muted); font-size: 11px; }

/* Login becomes a clean native welcome screen. */
html.native-app .auth-loading {
  min-height: calc(100dvh - 64px - var(--safe-top));
  padding: 12px 0;
}
html.native-app .auth-loading-card {
  border: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
}
html.native-app .auth-wrap {
  min-height: calc(100dvh - 64px - var(--safe-top));
  padding: 0;
}
html.native-app .auth-card {
  max-width: 480px;
  max-height: calc(100dvh - 64px - var(--safe-top));
  padding: 14px 18px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  animation: none;
}
html.native-app .auth-card::before,
html.native-app .auth-card::after,
html.native-app .fairytale-castle,
html.native-app .fairytale-cloud,
html.native-app .login-butterfly,
html.native-app .login-sparkle,
html.native-app .float-heart,
html.native-app .paw-trail { display: none; }
html.native-app .cat-stage { min-height: 170px; }
html.native-app .cat-speech { border: 0; border-radius: 18px; box-shadow: var(--native-shadow-sm); }
html.native-app .auth-panel {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--native-line);
  border-radius: 24px;
  background: var(--native-surface);
}

html.native-app input,
html.native-app textarea,
html.native-app select {
  min-height: 52px;
  border: 1px solid #ddd5e5;
  border-radius: 14px;
  background: var(--native-surface);
  color: var(--native-text);
  font-size: 16px;
  box-shadow: none;
}
html.native-app input:focus,
html.native-app textarea:focus,
html.native-app select:focus {
  border-color: var(--native-primary);
  box-shadow: 0 0 0 3px rgba(116, 82, 168, .12);
  transform: none;
}
html.native-app .primary-btn,
html.native-app .secondary-btn,
html.native-app .ghost-btn {
  min-height: 50px;
  border-radius: 16px;
  font-size: 15px;
  box-shadow: none;
  transition: var(--native-press);
}
html.native-app .primary-btn:active,
html.native-app .secondary-btn:active,
html.native-app .ghost-btn:active { transform: scale(.97); }
html.native-app .primary-btn:focus-visible,
html.native-app .secondary-btn:focus-visible,
html.native-app .ghost-btn:focus-visible {
  outline: 2px solid var(--native-primary-dark);
  outline-offset: 2px;
}
html.native-app .primary-btn { background: var(--native-primary); box-shadow: var(--native-shadow-sm); }
html.native-app .primary-btn::after { display: none; }
html.native-app .secondary-btn { background: #ece5f5; color: var(--native-primary-dark); }

/* Home as a single-column mobile feed. */
html.native-app .time-pair-card {
  padding: 14px 16px;
  border: 1px solid var(--native-line);
  border-radius: 20px;
  background: var(--native-surface);
  box-shadow: none;
  animation: none;
}
html.native-app .time-couple { width: 54px; max-height: 54px; }
html.native-app .time-person strong { color: var(--native-text); font-size: 18px; }
html.native-app .time-person span { color: var(--native-muted); }
html.native-app .pair-heading { margin: 24px 2px 10px; }
html.native-app .section-heading h2,
html.native-app .section-heading h3 { color: var(--native-text); }
html.native-app .pair-chip { border: 0; background: var(--native-surface-soft); box-shadow: none; animation: none; }
html.native-app .pair-status-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
}
html.native-app .person-status-card,
html.native-app #ownerStatusCard,
html.native-app #partnerStatusCard {
  min-height: 238px;
  padding: 20px;
  border: 0;
  border-radius: 24px;
  box-shadow: var(--native-shadow-md);
  backdrop-filter: none;
  transform: none;
  animation: none;
}
html.native-app .person-status-card:hover,
html.native-app .partner-card:hover { transform: none; }
html.native-app .person-card-top { padding-right: 44px; }
html.native-app .person-activity { margin-top: 18px; }
html.native-app .person-emoji { width: 52px; height: 52px; border-radius: 17px; }
html.native-app .person-activity h3 { font-size: 24px; }
html.native-app .card-peek { max-width: 78px; max-height: 92px; }
html.native-app .fairy-portal,
html.native-app .flying-butterfly,
html.native-app .tiny-sparkle { display: none !important; }
html.native-app .partner-floral-frame { opacity: .42; }
html.native-app .status-reaction-toggle,
html.native-app .card-edit-status { min-height: 44px; }
html.native-app .quick-checkin-card,
html.native-app .section-block,
html.native-app .schedule-person-card,
html.native-app .edit-card {
  border-color: var(--native-line);
  border-radius: 22px;
  background: var(--native-surface);
  box-shadow: none;
}

/* Schedule and editor use Android list/sheet patterns. */
html.native-app .schedule-list { gap: 10px; }
html.native-app .schedule-item,
html.native-app .schedule-row {
  border: 1px solid var(--native-line);
  border-radius: 17px;
  background: var(--native-surface);
  box-shadow: none;
}
html.native-app .schedule-sheet {
  width: 100%;
  max-width: 720px;
  padding-bottom: calc(20px + var(--safe-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--native-surface);
  box-shadow: var(--native-shadow-lg);
}
html.native-app .schedule-activity-picker button { min-height: 64px; border-radius: 16px; }
html.native-app .schedule-week-picker button { min-width: 44px; min-height: 44px; }

/* Edge-to-edge native chat. */
html.native-app body.chat-active .topbar { display: none; }
html.native-app body.chat-active .app-shell { padding-bottom: 0; }
html.native-app body.chat-active .app-shell > main {
  max-width: none;
  height: 100dvh;
  padding: 0;
}
html.native-app .chat-view {
  width: 100%;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #f4f1f8;
  box-shadow: none;
}
html.native-app .chat-topbar {
  min-height: calc(64px + var(--safe-top));
  padding: var(--safe-top) 10px 0;
  border-bottom: 1px solid var(--native-line);
  border-radius: 0;
  background: var(--native-surface);
  box-shadow: none;
  backdrop-filter: none;
}
html.native-app .chat-partner-copy strong { color: var(--native-text); font-size: 16px; }
html.native-app .chat-partner-copy small { color: var(--native-muted); }
html.native-app .chat-messages { padding: 14px 12px 18px; }
html.native-app .chat-bubble { max-width: 84%; border-radius: 19px; box-shadow: none; }
html.native-app .chat-message.mine .chat-bubble { background: #7b59ad; color: #fff; }
html.native-app .chat-composer {
  padding: 8px 10px calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--native-line);
  background: var(--native-surface);
  box-shadow: none;
  backdrop-filter: none;
}
html.native-app .chat-compose-row {
  min-height: 52px;
  border: 1px solid #ded7e6;
  border-radius: 26px;
  background: #f7f4fa;
  box-shadow: none;
}
html.native-app #chatInput { min-height: 42px; border: 0; background: transparent; box-shadow: none; }
html.native-app .chat-send-btn,
html.native-app .chat-mic-btn { background: var(--native-primary); }

/* Bottom navigation is native, not the web liquid-glass pill. */
html.native-app #bottomNav {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: none;
  min-height: calc(var(--native-nav-height) + var(--safe-bottom));
  padding: 7px 8px var(--safe-bottom);
  gap: 0;
  border: 0;
  border-top: 1px solid var(--native-line);
  border-radius: 0;
  background: #f4eff9;
  box-shadow: 0 -4px 18px rgba(40, 27, 53, .07);
  backdrop-filter: none;
  transform: none !important;
  margin: 0;
}
html.native-app #bottomNav::before { display: none; }
html.native-app #bottomNav .nav-item {
  min-height: 62px;
  padding: 5px 2px;
  border-radius: 14px;
  color: #635b69;
  gap: 2px;
  transition: opacity 120ms ease, transform 120ms ease;
}
html.native-app #bottomNav .nav-item:active { opacity: .62; }
html.native-app #bottomNav .nav-item:focus-visible {
  outline: 2px solid var(--native-primary);
  outline-offset: -2px;
}
html.native-app #bottomNav .nav-item span {
  width: 62px;
  height: 32px;
  margin: 0 auto;
  border-radius: 18px;
}
html.native-app #bottomNav .nav-item svg { width: 22px; height: 22px; }
html.native-app #bottomNav .nav-item small { font-size: 11px; font-weight: 700; }
html.native-app #bottomNav .nav-item.active {
  background: transparent;
  color: var(--native-primary-dark);
  box-shadow: none;
}
html.native-app #bottomNav .nav-item.active span { background: #dfd2ef; }
html.native-app body.chat-active #bottomNav { display: none !important; }

/* Ensure the signed-out view cannot inherit visibility from the web nav. */
html.native-app body:has(#authLoading:not(.hidden)) #bottomNav,
html.native-app body:has(#loginView:not(.hidden)) #bottomNav {
  display: none !important;
}

html.native-app .toast {
  bottom: calc(var(--native-nav-height) + var(--safe-bottom) + 12px);
  border-radius: 16px;
  background: #312b36;
  color: #fff;
  box-shadow: var(--native-shadow-lg);
}

@media (min-width: 700px) {
  html.native-app .app-shell > main { padding: 22px 24px; }
  html.native-app .pair-status-grid { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-height: 720px) {
  html.native-app .app-shell > main { padding-top: 8px; padding-bottom: 8px; }
  html.native-app .auth-card { padding-top: 8px; padding-bottom: 10px; }
  html.native-app .cat-stage { min-height: 126px; }
  html.native-app .login-character { width: 104px; height: 94px; }
  html.native-app .login-wordmark-art { width: min(210px, 72%); }
  html.native-app .login-subtitle { display: none; }
  html.native-app .auth-panel { margin-top: 8px; padding: 10px 14px; gap: 9px; }
  html.native-app input { min-height: 46px; }
  html.native-app .primary-btn { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  html.native-app *, html.native-app *::before, html.native-app *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
