:root {
  color-scheme: light;
  --bg: #fbf3f0;
  --surface: #ffffff;
  --surface-soft: #fff8f6;
  --ink: #2a2426;
  --muted: #7b6d71;
  --faint: #a7979c;
  --line: #eadeda;
  --coral: #fb6f79;
  --coral-deep: #df4e5d;
  --mint: #d7efe7;
  --mint-deep: #4f927e;
  --lavender: #e8e1f7;
  --yellow: #ffe7a8;
  --shadow: 0 18px 48px rgba(95, 56, 64, 0.14);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 28% 0%, rgba(255, 231, 168, 0.58), transparent 28rem),
    linear-gradient(180deg, #fbf3f0 0%, #f6f7f4 62%, #f8efec 100%);
  color: var(--ink);
}

#app {
  width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 430px);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom));
}

.login-frame {
  display: grid;
  align-items: center;
  overflow-y: auto;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.login-shell {
  display: grid;
  gap: 16px;
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.login-mark {
  width: 46px;
  height: 46px;
}

.login-brand h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.login-panel,
.login-note {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-panel {
  padding: 18px;
}

.login-panel h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.login-panel > p {
  margin: 9px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.login-options {
  display: grid;
  gap: 10px;
}

.login-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  min-height: 88px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.login-card:hover {
  border-color: rgba(251, 111, 121, 0.34);
  background: #fff8f6;
}

.login-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff0ef, #edf8f4);
  color: var(--coral-deep);
}

.login-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}

.login-card strong {
  display: block;
  grid-column: 2;
  font-size: 17px;
  line-height: 1.2;
}

.login-card small {
  display: block;
  grid-column: 2;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.auth-heading span {
  color: var(--mint-deep);
  font-size: 13px;
  font-weight: 820;
}

.auth-form {
  display: grid;
  gap: 11px;
  margin-top: 14px;
}

.auth-form label {
  display: grid;
  gap: 6px;
}

.auth-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.auth-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 680;
  outline: none;
}

.auth-form input:focus {
  border-color: rgba(79, 146, 126, 0.46);
  box-shadow: 0 0 0 3px rgba(79, 146, 126, 0.12);
}

.auth-message {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(79, 146, 126, 0.22);
  border-radius: 8px;
  background: rgba(215, 239, 231, 0.42);
  color: var(--mint-deep);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.45;
}

.recovery-code-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(251, 111, 121, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8f6, #edf8f4);
}

.recovery-code-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.recovery-code-card strong {
  grid-column: 1;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

.recovery-code-card button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 820;
}

.auth-submit {
  min-height: 48px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 860;
}

.auth-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.auth-secondary button {
  padding: 6px 4px;
  background: transparent;
  color: var(--mint-deep);
  font-size: 13px;
  font-weight: 860;
}

.login-code-row {
  display: grid;
  grid-column: 2;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 4px;
}

.login-code-row.saved {
  grid-template-columns: 1fr;
}

.login-code-row input {
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  outline: none;
  text-transform: uppercase;
}

.login-code-row input:focus {
  border-color: rgba(251, 111, 121, 0.48);
  box-shadow: 0 0 0 3px rgba(251, 111, 121, 0.12);
}

.login-code-row button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 780;
}

.login-note {
  display: grid;
  gap: 4px;
  padding: 13px;
}

.login-note strong {
  font-size: 14px;
}

.login-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--coral);
  color: #fff;
  box-shadow: 0 8px 18px rgba(251, 111, 121, 0.28);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  font-weight: 760;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.session-pill,
.logout-button,
.back-button {
  min-height: 32px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 760;
}

.session-pill {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: #fff;
  color: var(--coral-deep);
  box-shadow: 0 8px 22px rgba(95, 56, 64, 0.08);
}

.logout-button {
  padding: 0 10px;
  background: var(--ink);
  color: #fff;
}

.back-button {
  padding: 0 10px;
  border: 1px solid rgba(79, 146, 126, 0.18);
  background: #fff;
  color: var(--mint-deep);
  font-weight: 820;
}

.back-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.auth-back-button {
  min-height: 32px;
  padding: 0 12px;
}

.screen {
  display: none;
}

.app-content {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.screen.active {
  display: block;
}

.prediction-card,
.module,
.partner-hero {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.prediction-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.prediction-card::after {
  position: absolute;
  right: -54px;
  top: -60px;
  width: 172px;
  height: 172px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(251, 111, 121, 0.2), rgba(215, 239, 231, 0.7));
  content: "";
}

.prediction-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 104px;
  gap: 12px;
  align-items: center;
}

.metric-label,
.section-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.prediction-title {
  margin: 0;
  font-size: 30px;
  font-weight: 820;
  line-height: 1.05;
  white-space: nowrap;
}

.prediction-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.prediction-meta {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  flex: 0 0 auto;
}

.dot.mint {
  background: var(--mint-deep);
}

.cycle-ring {
  position: relative;
  width: 104px;
  height: 104px;
  flex: 0 0 auto;
}

.cycle-ring svg {
  width: 104px;
  height: 104px;
  transform: rotate(-90deg);
}

.cycle-ring .track {
  fill: none;
  stroke: #f0e5e2;
  stroke-width: 10;
}

.cycle-ring .progress {
  fill: none;
  stroke: var(--coral);
  stroke-linecap: round;
  stroke-width: 10;
  transition: stroke-dashoffset 240ms ease;
}

.ring-copy {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

.ring-copy strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.ring-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.period-date-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(234, 222, 218, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.period-date-header {
  display: grid;
  gap: 10px;
}

.period-date-header strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.period-date-header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.period-date-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.period-date-row input {
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
  outline: none;
}

.period-date-row input:focus {
  border-color: rgba(251, 111, 121, 0.46);
  box-shadow: 0 0 0 3px rgba(251, 111, 121, 0.12);
}

.period-date-actions {
  display: grid;
  gap: 10px;
}

.action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 760;
}

.action.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.stack {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.module {
  overflow: hidden;
  padding: 16px;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.module-title {
  margin: 0;
  font-size: 17px;
  font-weight: 780;
  line-height: 1.2;
}

.module-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.mood-orb {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(251, 111, 121, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.36) 42%, transparent 58%),
    linear-gradient(135deg, #fff5f2, #edf8f4);
}

.mood-face {
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 14px 30px rgba(95, 56, 64, 0.12);
  font-size: 58px;
  line-height: 1;
}

.mood-orb strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.mood-orb span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.mood-ring {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mood-button {
  display: grid;
  min-width: 0;
  min-height: 64px;
  place-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.mood-button span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  font-size: 20px;
  line-height: 1;
}

.mood-button small {
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.1;
  text-align: center;
}

.mood-button.active {
  border-color: rgba(251, 111, 121, 0.28);
  background: #fff0ef;
  color: var(--coral-deep);
  box-shadow: inset 0 0 0 1px rgba(251, 111, 121, 0.16);
}

.mood-button.active span {
  background: #fff;
  box-shadow: 0 8px 18px rgba(251, 111, 121, 0.18);
}

.need-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.need-row::-webkit-scrollbar {
  display: none;
}

.need-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.need-chip.active {
  border-color: rgba(79, 146, 126, 0.24);
  background: #eef8f4;
  color: var(--mint-deep);
}

.status-chip {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.status-chip.active {
  border-color: rgba(251, 111, 121, 0.2);
  background: #fff0ef;
  color: var(--coral-deep);
  box-shadow: inset 0 0 0 1px rgba(251, 111, 121, 0.16);
}

.care-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff5f2 0%, #edf8f4 100%);
}

.care-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--coral-deep);
  box-shadow: 0 8px 18px rgba(95, 56, 64, 0.08);
}

.care-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.care-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.account-security {
  border-color: rgba(223, 78, 93, 0.2);
}

.profile-inline-security {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.account-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.account-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.account-summary strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.account-security-toggle {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(79, 146, 126, 0.2);
  border-radius: 8px;
  background: #f7fbf9;
  color: var(--mint-deep);
  font-size: 13px;
  font-weight: 820;
}

.delete-account-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.delete-account-form label {
  display: grid;
  gap: 6px;
}

.delete-account-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.delete-account-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
  outline: none;
}

.delete-account-form input:focus {
  border-color: rgba(223, 78, 93, 0.4);
  box-shadow: 0 0 0 3px rgba(223, 78, 93, 0.1);
}

.delete-account-button {
  min-height: 42px;
}

.danger-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pwa-module .response-button {
  margin-top: 12px;
}

.pwa-steps {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.pwa-steps div {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.pwa-steps strong,
.pwa-steps p {
  display: block;
  margin: 0;
}

.pwa-steps strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 860;
}

.pwa-steps p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.folded-hint {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.45;
}

.care-picker {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.care-picker::-webkit-scrollbar {
  display: none;
}

.care-compose {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.care-compose label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.care-compose textarea {
  width: 100%;
  min-height: 62px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  font-size: 14px;
  line-height: 1.45;
  outline: none;
}

.care-compose textarea:focus {
  border-color: rgba(79, 146, 126, 0.4);
  box-shadow: 0 0 0 3px rgba(79, 146, 126, 0.12);
}

.care-readonly {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
}

.care-readonly span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.care-readonly strong {
  font-size: 14px;
  line-height: 1.35;
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
  align-items: end;
  min-height: 92px;
  padding-top: 6px;
}

.bar-wrap {
  display: grid;
  gap: 7px;
  justify-items: center;
}

.bar {
  width: 100%;
  max-width: 30px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--coral), #ffc0a5);
}

.bar-wrap span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.partner-hero {
  padding: 18px;
}

.partner-hero h2 {
  margin: 0;
  font-size: 29px;
  line-height: 1.1;
}

.partner-hero p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.partner-mood {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.partner-mood > span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 12px 28px rgba(95, 56, 64, 0.12);
  font-size: 28px;
  line-height: 1;
}

.partner-mood p {
  margin-top: 6px;
  font-size: 13px;
}

.signal-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #fff;
}

.reminder-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 13px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff5f2, #f0faf6);
}

.reminder-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.reminder-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.1;
}

.reminder-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.reminder-days {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.reminder-days::-webkit-scrollbar {
  display: none;
}

.signal-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.interaction-summary {
  display: grid;
  gap: 10px;
}

.signal-pair div,
.interaction-summary div,
.calendar-summary {
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff5f2, #f0faf6);
}

.signal-pair span,
.interaction-summary span,
.calendar-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.signal-pair strong,
.interaction-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--coral-deep);
  font-size: 16px;
  line-height: 1.2;
}

.interaction-summary p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.response-hero {
  padding: 13px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff5f2, #f0faf6);
}

.response-hero span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.response-hero strong {
  display: block;
  margin-top: 6px;
  color: var(--coral-deep);
  font-size: 18px;
  line-height: 1.25;
}

.response-hero p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sync-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sync-line span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 730;
  line-height: 1.3;
}

.sync-line strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
  text-align: right;
}

.text-action {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  margin-top: 9px;
  padding: 0;
  background: transparent;
  color: var(--mint-deep);
  font-size: 13px;
  font-weight: 780;
}

.calendar-summary {
  margin-bottom: 12px;
}

.calendar-summary strong {
  display: block;
  margin-bottom: 5px;
  font-size: 24px;
  line-height: 1.1;
}

.explain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.explain-grid div,
.share-preview,
.record-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.explain-grid div {
  padding: 11px;
}

.explain-grid span,
.share-preview > span,
.record-row-header span,
.record-inputs label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 730;
  line-height: 1.35;
}

.explain-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.health-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid rgba(151, 210, 190, 0.42);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 244, 241, 0.94), rgba(239, 250, 246, 0.96));
}

.record-add-row label,
.record-count-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 730;
  line-height: 1.35;
}

.record-add-row input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin-top: 5px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
  outline: none;
}

.record-add-row input:focus {
  border-color: rgba(251, 111, 121, 0.46);
  box-shadow: 0 0 0 3px rgba(251, 111, 121, 0.12);
}

.record-count-note {
  margin: 0 0 10px;
}

.history-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 12px;
  border: 1px solid rgba(151, 210, 190, 0.4);
  border-radius: 8px;
  background: #f7fbf9;
  color: var(--ink);
  font-size: 14px;
  font-weight: 820;
}

.history-toggle svg {
  width: 17px;
  height: 17px;
  color: var(--mint-deep);
  stroke-width: 2.3;
}

.history-record-list {
  margin-top: 10px;
}

.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(151, 210, 190, 0.46);
  border-radius: 8px;
  background: #f5fbf8;
  color: var(--mint-deep);
  font-size: 12px;
  font-weight: 820;
}

.mini-action svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.3;
}

.record-row {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.record-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-row-header strong {
  font-size: 15px;
  line-height: 1.25;
}

.record-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.record-inputs input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin-top: 5px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
  outline: none;
}

.record-inputs input:focus {
  border-color: rgba(251, 111, 121, 0.46);
  box-shadow: 0 0 0 3px rgba(251, 111, 121, 0.12);
}

.record-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ghost-button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.ghost-button.danger {
  border-color: rgba(223, 78, 93, 0.28);
  background: #fff0ef;
  color: var(--coral-deep);
}

.signal-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.signal-strip strong {
  color: var(--coral-deep);
  font-size: 15px;
}

.bind-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 13px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff5f2, #f0faf6);
}

.bind-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.bind-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.bind-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.bind-input-row input {
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
  outline: none;
  text-transform: uppercase;
}

.bind-input-row input:focus {
  border-color: rgba(251, 111, 121, 0.48);
  box-shadow: 0 0 0 3px rgba(251, 111, 121, 0.12);
}

.bind-form p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.bind-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bind-box strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  line-height: 1;
}

.copy-button {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 760;
}

.response-list {
  display: grid;
  gap: 9px;
}

.feedback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.response-button,
.feedback-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 730;
  text-align: left;
}

.response-button.active,
.feedback-button.active {
  border-color: rgba(79, 146, 126, 0.28);
  background: #f0faf6;
  color: #2d725d;
}

.today-response-link {
  width: 100%;
  margin-top: 10px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 12px;
}

.calendar-legend span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.legend-dot.period {
  background: var(--coral);
}

.legend-dot.window {
  background: var(--mint-deep);
}

.calendar-day {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}

.calendar-day.period {
  background: #fff0ef;
  color: var(--coral-deep);
}

.calendar-day.window {
  background: #eef8f4;
  color: var(--mint-deep);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.settings-row:first-of-type {
  border-top: 0;
}

.settings-row strong {
  font-size: 14px;
}

.settings-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.share-preview {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
}

.share-preview div {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
  align-items: start;
}

.share-preview strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.share-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.visibility-list {
  display: grid;
  gap: 8px;
}

.visibility-row {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.visibility-row span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 730;
}

.visibility-row strong {
  font-size: 13px;
  font-weight: 760;
}

.visibility-row strong.allowed {
  color: var(--mint-deep);
}

.visibility-row strong.blocked {
  color: var(--faint);
}

.toggle {
  width: 46px;
  height: 26px;
  padding: 3px;
  border-radius: 20px;
  background: var(--line);
}

.toggle::after {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 180ms ease;
}

.toggle.active {
  background: var(--mint-deep);
}

.toggle.active::after {
  transform: translateX(20px);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  pointer-events: none;
}

.bottom-nav-inner {
  display: grid;
  width: min(100%, 398px);
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 40px rgba(95, 56, 64, 0.18);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.nav-item {
  position: relative;
  display: grid;
  min-height: 48px;
  place-items: center;
  gap: 2px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 730;
}

.nav-item.active {
  background: var(--ink);
  color: #fff;
}

.nav-badge {
  position: absolute;
  top: 7px;
  right: 20px;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  background: #ef4d61;
  box-shadow: 0 6px 14px rgba(239, 77, 97, 0.34);
}

.nav-item svg,
.brand-mark svg,
.care-icon svg,
.action svg,
.response-button svg,
.feedback-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 90px;
  left: 18px;
  z-index: 30;
  max-width: 392px;
  margin: 0 auto;
  padding: 13px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 18px 40px rgba(42, 36, 38, 0.24);
  font-size: 14px;
  line-height: 1.4;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.in-app-alert {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  left: 14px;
  z-index: 42;
  max-width: 448px;
  margin: 0 auto;
  transform: translateY(-16px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.in-app-alert.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.in-app-alert-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 42px 12px 12px;
  border: 1px solid rgba(251, 111, 121, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 60px rgba(75, 52, 58, 0.22);
  backdrop-filter: blur(18px);
}

.in-app-alert-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff4f1, #edf8f4);
  color: var(--rose);
}

.in-app-alert-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.in-app-alert-card strong,
.in-app-alert-card span {
  display: block;
}

.in-app-alert-card strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 860;
}

.in-app-alert-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.in-app-alert-action {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 840;
  white-space: nowrap;
}

.in-app-alert-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: rgba(246, 239, 237, 0.9);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

@media (min-width: 760px) {
  body {
    display: grid;
    min-height: 100vh;
    place-items: center;
  }

  .app-frame {
    height: min(844px, calc(100vh - 64px));
    margin: 32px auto;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 28px;
    box-shadow: 0 28px 80px rgba(95, 56, 64, 0.2);
  }

  .app-content {
    scrollbar-gutter: stable;
  }

  .app-content::-webkit-scrollbar {
    width: 0;
  }

  .bottom-nav {
    position: absolute;
    right: 16px;
    bottom: 12px;
    left: 16px;
    padding: 0;
  }

  .bottom-nav-inner {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .prediction-grid {
    grid-template-columns: 1fr;
  }

  .cycle-ring {
    justify-self: center;
  }

  .prediction-title {
    font-size: 28px;
  }
}
