/* =========================================================
   ゲピミニライフ : スタイル
   生成りの紙 × くすみ水彩。ピンクは使わず、紺・黄土・セージ・空色でまとめる
   ========================================================= */
:root {
  --paper: #FAF6EE;
  --card: #FFFDF8;
  --ink: #3A3530;
  --ink2: #7A6F64;
  --ink3: #A99D90;
  --line: #EAE1D3;
  --navy: #34466F;
  --navy2: #27365A;
  --meal: #E0A93B;
  --ex: #4FA982;
  --supp: #5B8FD6;
  --danger: #C8604E;
  --c: #E0A93B;          /* 選んだキャラの色（JSで上書き） */
  --cs: #FBF1D3;
  --r: 18px;
  --tabh: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .3 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-text-size-adjust: 100%;
  line-height: 1.55;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; }
img { display: block; max-width: 100%; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tabh) + var(--safe-b) + 16px); }
.screen { padding: 0 16px; }
/* backwards にしておかないと終了後も transform が残り、中の position:fixed（保存ボタン）がずれる */
.screen.is-in { animation: fadeIn .28s ease backwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.apphd { padding: 18px 16px 6px; }
.apphd h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .04em; }

/* ---------- 読み込み ---------- */
.loading { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; background: var(--paper); color: var(--ink2); font-size: 13px; }
.loading[hidden] { display: none; }
.loading__egg { width: 44px; height: 56px; border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%; background: #F7EABC; box-shadow: inset 0 0 0 2.5px rgba(107,84,68,.45); animation: wobble 1s ease-in-out infinite; }
@keyframes wobble { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

/* ---------- 共通部品 ---------- */
.card { background: var(--card); border-radius: var(--r); padding: 16px; margin: 0 0 14px; box-shadow: 0 1px 0 var(--line), 0 6px 18px -12px rgba(80,60,40,.25); }
.card__h { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin-bottom: 12px; }
.card__h small { font-weight: 500; font-size: 11px; color: var(--ink3); }
.card__h .btn-link { margin-left: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 24px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .04em; box-shadow: 0 3px 0 var(--navy2); transition: transform .08s; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--navy2); }
.btn[disabled] { background: #C9C1B6; box-shadow: 0 3px 0 #B3AA9E; cursor: default; }
.btn--lg { width: 100%; min-height: 56px; font-size: 17px; }
.btn--sub { background: #EFE8DC; color: var(--ink); box-shadow: 0 2px 0 #DDD3C3; min-height: 44px; padding: 0 16px; }
.btn--danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--block { width: 100%; margin-bottom: 10px; }
.btn-link { color: var(--navy); font-weight: 700; font-size: 13px; padding: 8px 4px; }
.muted { color: var(--ink3); font-size: 12px; margin: 6px 0 0; }
.note { color: var(--ink3); font-size: 11px; line-height: 1.7; margin: 8px 4px 20px; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #E3F1E9; color: #2F7A5A; font-size: 11px; font-weight: 700; vertical-align: 2px; }

.input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-size: 16px; outline: none; }
.input:focus { border-color: var(--navy); }
.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 12px; color: var(--ink2); margin-bottom: 6px; font-weight: 700; }
.fld--c { text-align: left; margin: 4px 0 14px; }
.fld[hidden] { display: none; }
.addrow { display: flex; gap: 8px; margin: 10px 0; }
.addrow .input { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); font-size: 14px; font-weight: 700; color: var(--ink2); transition: background .15s, color .15s; }
.chip.is-on { background: var(--navy); color: #fff; box-shadow: none; }
.chips--sm .chip { min-height: 34px; font-size: 12px; padding: 0 12px; }

/* ---------- タブバー ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-width: 480px; margin: 0 auto; height: calc(var(--tabh) + var(--safe-b)); padding: 6px 6px var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255,253,248,.96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.is-ob .tabbar { display: none; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; font-weight: 700; color: var(--ink3); }
.tab svg { width: 24px; height: 24px; fill: currentColor; }
.tab.is-on { color: var(--navy); }
.tab { position: relative; }
.tab__dot { position: absolute; top: 6px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--meal); box-shadow: 0 0 0 2px var(--card); }
.tab__dot[hidden] { display: none; }
.tab__fab { display: grid; place-items: center; width: 52px; height: 52px; margin-top: -24px; border-radius: 50%; background: var(--navy); box-shadow: 0 4px 0 var(--navy2), 0 8px 18px -6px rgba(39,54,90,.5); }
.tab__fab svg { fill: #fff; width: 26px; height: 26px; }
.tab--rec.is-on { color: var(--navy); }

/* ---------- オンボーディング ---------- */
.ob { padding: 28px 4px 24px; min-height: 100vh; display: flex; flex-direction: column; gap: 14px; }
.ob--welcome { text-align: center; justify-content: center; align-items: center; }
.ob__logo { margin: 8px 0 4px; }
.logo-text { font-size: 32px; font-weight: 800; letter-spacing: .04em; color: var(--navy); }
.logo-text b { color: var(--meal); font-weight: 800; }
.logo-img { width: 260px; }
.ob__trio { display: flex; gap: 6px; justify-content: center; }
.ob__trioc { width: 88px; animation: bob 2.4s ease-in-out infinite; }
.ob__lead { font-size: 18px; font-weight: 800; margin: 4px 0; line-height: 1.7; }
.ob__lead b { color: var(--meal); font-size: 22px; }
.ob__points { list-style: none; padding: 14px 18px; margin: 0 0 6px; background: var(--card); border-radius: var(--r); text-align: left; width: 100%; font-size: 14px; }
.ob__points li { display: flex; gap: 10px; align-items: center; padding: 5px 0; }
.ob__points span { font-size: 20px; }
.ob__co { font-size: 11px; color: var(--ink3); margin: 6px 0 0; }
.ob__dots { display: flex; gap: 6px; }
.ob__dots i { width: 22px; height: 5px; border-radius: 3px; background: var(--line); }
.ob__dots i.is-on { background: var(--navy); }
.ob__h { margin: 8px 0 0; font-size: 22px; font-weight: 800; }
.ob__p { margin: 0 0 6px; color: var(--ink2); font-size: 14px; }
.ob__note { font-size: 11px; color: var(--ink3); text-align: center; margin: 0; }
.ob .btn--lg { margin-top: auto; }
.ob .btn-link { align-self: center; }

.eggs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.egg { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px 12px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 2px transparent; transition: transform .2s, box-shadow .2s; }
.egg__art { width: 84px; animation: wobble 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.egg:nth-child(2) .egg__art { animation-delay: -.8s; }
.egg:nth-child(3) .egg__art { animation-delay: -1.6s; }
.egg__n { font-size: 11px; font-weight: 700; color: var(--ink2); text-align: center; line-height: 1.4; }
.egg.is-on { box-shadow: inset 0 0 0 2.5px var(--c); transform: translateY(-4px); }
.egg.is-on .egg__n { color: var(--ink); }
.egg-hint { min-height: 64px; padding: 12px 14px; border-radius: 14px; background: #F3EDE3; font-size: 13px; color: var(--ink2); }

.ch-art, .face-art, .bg-art { display: block; width: 100%; }
.ch-svg, .egg-svg, .face-svg { display: block; width: 100%; height: auto; overflow: visible; }

/* ---------- ホーム ---------- */
/* ホームはスクロールさせず、画面の高さに合わせてステージを伸び縮みさせる */
body[data-view="home"] .app { padding-bottom: calc(var(--tabh) + var(--safe-b)); }
.home { display: flex; flex-direction: column; gap: 10px; padding: 10px 0; height: calc(100vh - var(--tabh) - var(--safe-b)); height: calc(100dvh - var(--tabh) - var(--safe-b)); }
.hud { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border-radius: var(--r); box-shadow: 0 1px 0 var(--line); }
.hud__lv { flex: 0 0 52px; height: 52px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: var(--cs); color: var(--ink); font-weight: 800; font-size: 20px; line-height: 1; box-shadow: inset 0 0 0 2px var(--c); }
.hud__lv small { font-size: 10px; color: var(--ink2); }
.hud__m { flex: 1; min-width: 0; }
.hud__n { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp { height: 8px; margin: 4px 0 3px; border-radius: 4px; background: #EFE8DC; overflow: hidden; }
.exp i { display: block; height: 100%; border-radius: 4px; background: var(--c); transition: width .8s cubic-bezier(.2,.9,.3,1); }
.hud__st { flex: 0 0 auto; text-align: center; padding: 4px 8px; border-radius: 12px; background: #FCEBD0; color: #A0661B; line-height: 1.1; }
.hud__st b { display: block; font-size: 18px; font-weight: 800; }
.hud__st small { font-size: 9px; }

.stage { position: relative; flex: 1; min-height: 240px; border-radius: 24px; overflow: hidden; background: #EEF3EE; }
.stage__bg, .stage__bg .bg-art, .stage__bg .bg-svg, .stage__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
/* 画面が低い端末でも頭がふきだしにかからないよう、高さでも上限をかける */
.pet { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); width: min(56%, 46vh); max-width: 250px; }
.pet--s0 { width: min(34%, 26vh); max-width: 150px; }
.pet--s1 { width: min(46%, 36vh); max-width: 200px; }
.pet--s2 { width: min(50%, 40vh); max-width: 220px; }
.pet__body { display: block; position: relative; animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.pet--s0 .pet__body { animation: wobble 2.4s ease-in-out infinite; }
.pet__shadow { position: absolute; left: 18%; right: 18%; bottom: -2%; height: 9%; border-radius: 50%; background: rgba(70,90,60,.18); filter: blur(2px); }
.pet.is-hop .pet__body { animation: hop .5s ease; }
@keyframes bob { 0%,100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-4px) scaleY(1.015); } }
@keyframes hop { 0% { transform: none; } 35% { transform: translateY(-18px) scale(1.03, .97); } 70% { transform: translateY(0) scale(1.04, .95); } 100% { transform: none; } }
.talk { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: calc(100% - 32px); max-width: 360px; padding: 10px 14px; border-radius: 16px; background: rgba(255,255,255,.94); font-size: 14px; font-weight: 700; text-align: center; box-shadow: 0 4px 14px -8px rgba(60,50,40,.4); z-index: 2; }
.talk::after { content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: rgba(255,255,255,.94); }
.talk.is-pop { animation: pop .3s ease; }
@keyframes pop { 0% { transform: translateX(-50%) scale(.92); } 100% { transform: translateX(-50%) scale(1); } }

.today { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: var(--r); text-align: left; }
.today--todo { background: var(--navy); color: #fff; box-shadow: 0 4px 0 var(--navy2); animation: breathe 2.4s ease-in-out infinite; }
.today--todo:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--navy2); }
@keyframes breathe { 0%,100% { box-shadow: 0 4px 0 var(--navy2), 0 0 0 0 rgba(52,70,111,.3); } 50% { box-shadow: 0 4px 0 var(--navy2), 0 0 0 8px rgba(52,70,111,0); } }
.today__ic { flex: 0 0 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); font-size: 22px; }
.today__t { flex: 1; }
.today__t b { display: block; font-size: 17px; font-weight: 800; }
.today__t small { font-size: 12px; opacity: .8; }
.today__arr { font-size: 28px; opacity: .7; }
.today--done { background: var(--card); box-shadow: 0 1px 0 var(--line); }
.today--done .today__arr { color: var(--ink3); }
.today__ok { flex: 0 0 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ex); color: #fff; font-size: 22px; font-weight: 800; }
.today--done small { color: var(--ink2); opacity: 1; }

/* ---------- ドーナツ ---------- */
.ring { position: relative; }
.ring svg { display: block; }
.ring__v { transition: stroke-dashoffset 1s cubic-bezier(.2,.9,.3,1); }
.ring__in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-weight: 800; font-size: 20px; line-height: 1; }
.ring__in small { font-size: 10px; }

/* ---------- 記録 ---------- */
.rec { padding-top: 4px; padding-bottom: 80px; }
.rec__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rec__nav { width: 44px; height: 44px; border-radius: 50%; background: var(--card); font-size: 26px; line-height: 1; color: var(--ink2); box-shadow: 0 1px 0 var(--line); }
.rec__nav[disabled] { opacity: .3; cursor: default; }
.rec__day { font-size: 16px; font-weight: 800; text-align: center; }
.rec__day b { margin-right: 6px; color: var(--navy); }
.rec__copy { display: block; width: 100%; padding: 10px; margin-bottom: 12px; border-radius: 14px; background: #EFE8DC; font-weight: 700; font-size: 14px; color: var(--ink); }
.rec__copy:active { background: #E6DCCB; }
.rsec { background: var(--card); border-radius: var(--r); padding: 14px 12px; margin-bottom: 12px; box-shadow: 0 1px 0 var(--line); }
.rsec__h { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin: 0 2px 10px; }
.rsec__h i { width: 6px; height: 18px; border-radius: 3px; }
.rsec__h small { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--ink3); }

.tiles { display: grid; gap: 6px; }
.tiles--5 { grid-template-columns: repeat(5, 1fr); }
.tiles--4 { grid-template-columns: repeat(4, 1fr); }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px 8px; border-radius: 14px; background: #F7F2EA; box-shadow: inset 0 0 0 1.5px transparent; transition: background .15s, box-shadow .15s, transform .1s; }
.tile:active { transform: scale(.95); }
.tile__ic { display: grid; place-items: center; width: 38px; height: 38px; }
.tile__ic .emo { font-size: 26px; line-height: 1; filter: saturate(.8); }
.tile__ic .ic-img { width: 38px; height: 38px; object-fit: contain; }
.tile__l { font-size: 12px; font-weight: 800; line-height: 1.2; text-align: center; white-space: nowrap; letter-spacing: -.02em; }
.tiles--5 .tile__l { font-size: 11px; }
.tile__s { font-size: 9px; color: var(--ink3); line-height: 1.2; text-align: center; white-space: nowrap; letter-spacing: -.03em; }
.tile--meal.is-on { background: #FBEFD4; box-shadow: inset 0 0 0 2px var(--meal); }
.tile--ex.is-on { background: #E2F2EA; box-shadow: inset 0 0 0 2px var(--ex); }
.tile.is-on::after { content: '✓'; position: absolute; top: 4px; right: 6px; font-size: 11px; font-weight: 800; color: var(--ink2); }
.chips--supp .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.chip--supp.is-on, .chip--all.is-on { background: var(--supp); }
.chip__ck { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink3); display: grid; place-items: center; font-size: 10px; }
.chip--supp.is-on .chip__ck { background: #fff; box-shadow: none; }
.chip--supp.is-on .chip__ck::after { content: '✓'; color: var(--supp); font-weight: 800; }
.chip--all { color: var(--supp); box-shadow: inset 0 0 0 1.5px var(--supp); }

.moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mood { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 14px; font-size: 10px; color: var(--ink3); }
.mood__e { font-size: 28px; line-height: 1.1; filter: grayscale(.7) opacity(.7); transition: filter .15s, transform .15s; }
.mood__e .ic-img { width: 36px; height: 36px; object-fit: contain; }
.mood.is-on { background: #F3EDE3; color: var(--ink); font-weight: 700; }
.mood.is-on .mood__e { filter: none; transform: scale(1.12); }
.memo { min-height: 64px; resize: none; }
.rec__memo { display: block; margin: -2px auto 8px; }
.rec__bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabh) + var(--safe-b)); z-index: 15; max-width: 480px; margin: 0 auto; padding: 10px 16px 18px; background: linear-gradient(rgba(250,246,238,0), var(--paper) 30%); }
.rec { padding-bottom: 96px; }

/* ---------- レポート ---------- */
.rep { padding-top: 4px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: #EFE8DC; margin-bottom: 14px; }
.seg__b { min-height: 38px; border-radius: 999px; font-weight: 800; font-size: 14px; color: var(--ink2); }
.seg__b.is-on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(60,50,40,.12); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.kpi { background: var(--card); border-radius: 16px; padding: 10px 8px; text-align: center; box-shadow: 0 1px 0 var(--line); position: relative; }
.kpi small { display: block; font-size: 10px; color: var(--ink3); }
.kpi b { font-size: 24px; font-weight: 800; line-height: 1.3; }
.kpi b span { font-size: 11px; color: var(--ink2); margin-left: 1px; }
.kpi__d { display: inline-block; margin-left: 3px; vertical-align: 3px; font-size: 10px; font-weight: 800; padding: 0 5px; border-radius: 6px; }
.kpi__d.is-up { color: #2F7A5A; background: #E3F1E9; }
.kpi__d.is-down { color: #A9573F; background: #F8E6DE; }

.fb { background: linear-gradient(var(--cs), var(--card) 120px); }
.fb__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fb__head b { display: block; font-size: 15px; }
.fb__head small { font-size: 11px; color: var(--ink3); }
.fb__face { flex: 0 0 56px; width: 56px; }
.fb__i { display: flex; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.fb__i p { margin: 0; font-weight: 700; font-size: 14px; }
.fb__i small { display: block; margin-top: 3px; font-size: 12px; color: var(--ink2); }
.fb__ic { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: var(--ink3); }
.fb__i--good .fb__ic, .fb__i--up .fb__ic { background: var(--ex); }
.fb__i--weak .fb__ic, .fb__i--down .fb__ic { background: var(--meal); }
.fb__i--base .fb__ic { background: var(--supp); }

.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #EFE8DC; stroke-width: 1; }
.chart .ax { font-size: 10px; fill: var(--ink3); font-family: var(--font); }
.chart .ax--now { fill: var(--navy); font-weight: 800; }
.chart .ax--emo { font-size: 15px; }
.chart .val { font-size: 10px; fill: var(--ink2); font-weight: 800; font-family: var(--font); }
.chart .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: grow .6s cubic-bezier(.2,.9,.3,1) both; }
.chart .empty { fill: none; stroke: #DDD3C3; stroke-dasharray: 2 2; }
.chart .line { fill: none; stroke: var(--c); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: #fff; stroke: var(--c); stroke-width: 2; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.legend { display: flex; justify-content: center; gap: 14px; font-size: 11px; color: var(--ink2); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.legend--heat { gap: 4px; align-items: center; }
.legend--heat i { width: 14px; height: 14px; }

.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ringbox { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ringbox b { font-size: 13px; margin-top: 4px; }
.ringbox small { font-size: 10px; color: var(--ink3); }

.hbar { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.hbar__l { display: flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; }
.hbar__e { font-size: 16px; }
.hbar__b { height: 10px; border-radius: 5px; background: #F1EBE1; overflow: hidden; }
.hbar__b i { display: block; height: 100%; width: 0; border-radius: 5px; transition: width .9s cubic-bezier(.2,.9,.3,1); }
.hbar__v { text-align: right; font-weight: 800; }
.hbar__v small { font-size: 10px; color: var(--ink3); }

.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.heat__wd { text-align: center; font-size: 10px; color: var(--ink3); }
.heat__c { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink2); background: #F1EBE1; cursor: pointer; }
.heat__c--1 { background: #E4EEDB; }
.heat__c--2 { background: #C3DEB1; }
.heat__c--3 { background: #93C89A; color: #fff; }
.heat__c--4 { background: #4FA982; color: #fff; }
.heat__c.is-today { box-shadow: 0 0 0 2px var(--navy); }
.legend--heat i.heat__c--1 { background: #E4EEDB; }
.legend--heat i.heat__c--2 { background: #C3DEB1; }
.legend--heat i.heat__c--3 { background: #93C89A; }
.legend--heat i.heat__c--4 { background: #4FA982; }

/* ---------- 成長（レポート画面の上と下） ---------- */
.grow__hero { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, var(--cs), var(--card)); }
.grow__art { flex: 0 0 104px; }
.grow__info { flex: 1; min-width: 0; }
.grow__info .exp { margin: 2px 0 4px; }
.grow__name { font-size: 20px; font-weight: 800; }
.grow__kind { font-size: 12px; color: var(--ink2); }
.grow__lv { margin-top: 6px; font-size: 14px; }
.grow__lv b { font-size: 28px; font-weight: 800; }
.grow__next { font-size: 12px; color: var(--ink2); }
.gsteps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.gstep { text-align: center; font-size: 11px; opacity: .55; }
.gstep.is-open { opacity: 1; }
.gstep__art { height: 74px; display: grid; place-items: end center; margin-bottom: 4px; border-radius: 12px; background: #F7F2EA; padding: 6px 4px 4px; }
.gstep__art .ch-art { width: 100%; max-width: 56px; }
.gstep.is-now .gstep__art { box-shadow: inset 0 0 0 2px var(--c); background: var(--cs); }
.gstep__lock { align-self: center; font-size: 22px; font-weight: 800; color: var(--ink3); }
.gstep b { display: block; font-size: 11px; }
.gstep small { font-size: 9px; color: var(--ink3); }
.prof p { margin: 0 0 8px; font-size: 13px; color: var(--ink2); }
.prof__adult b { color: var(--ink); }

/* ---------- はじめのアンケート ---------- */
.sv { gap: 12px; }
body:not(.is-ob) .sv { min-height: 0; padding-top: 4px; }
.sv__top { display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
.sv__top .btn-link { padding-left: 0; }
.sv__n { font-size: 12px; font-weight: 700; color: var(--ink3); }
.sv__bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.sv__bar i { display: block; height: 100%; border-radius: 3px; background: var(--navy); transition: width .3s; }
.sv__intro { padding: 12px 14px; border-radius: 14px; background: #FBEFD4; font-size: 13px; line-height: 1.7; }
.sq { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 16px; background: var(--card); box-shadow: 0 1px 0 var(--line); }
.sq__l { display: flex; align-items: baseline; gap: 6px; font-weight: 800; font-size: 14px; }
.sq__l span { font-size: 18px; }
.sq__l small { font-weight: 500; font-size: 11px; color: var(--ink3); }
.freq { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.freq--wk { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.freq--3 .freq__b:last-child { grid-column: span 2; }
.freq__b { min-height: 42px; padding: 0 4px; border-radius: 10px; background: #F7F2EA; font-size: 13px; font-weight: 700; color: var(--ink2); white-space: nowrap; }
.freq--wk .freq__b { font-size: 12px; }
.freq__b.is-on { background: var(--navy); color: #fff; }
.tiles--3 { grid-template-columns: repeat(3, 1fr); }
.moods--lg .mood { padding: 12px 0; background: var(--card); box-shadow: 0 1px 0 var(--line); }
.moods--lg .mood__e { font-size: 34px; }
.moods--lg .mood.is-on { box-shadow: inset 0 0 0 2px var(--navy); }

/* はじめた時からの変化（レポート） */
.base__p { margin: 0 0 10px; font-size: 13px; color: var(--ink2); }
.base__sum { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 8px 14px; margin-bottom: 8px; border-bottom: 1px dashed var(--line); text-align: center; line-height: 1.1; }
.base__sum small { display: block; font-size: 10px; color: var(--ink3); margin-bottom: 4px; }
.base__sum b { font-size: 30px; font-weight: 800; }
.base__sum span { font-size: 11px; color: var(--ink2); }
.base__sum > div:first-child b { color: var(--ink3); }
.base__arr { font-size: 20px; color: var(--ink3); }
.base__d { padding: 4px 10px; border-radius: 999px; font-size: 14px; font-weight: 800; }
.base__d.is-up { color: #2F7A5A; background: #E3F1E9; }
.base__d.is-down { color: #A9573F; background: #F8E6DE; }
.cmp__legend { display: flex; justify-content: flex-end; gap: 12px; font-size: 10px; color: var(--ink3); margin-bottom: 2px; }
.cmp__legend span { display: inline-flex; align-items: center; gap: 4px; }
.cmp__legend i { display: inline-block; width: 12px; height: 5px; border-radius: 3px; }
.cmp { display: grid; grid-template-columns: 88px 1fr 108px; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.cmp__l { display: flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; }
.cmp__l span { font-size: 15px; }
.cmp__bars { display: flex; flex-direction: column; gap: 3px; }
.cmp__bars i { display: block; height: 6px; width: 0; border-radius: 3px; transition: width .9s cubic-bezier(.2,.9,.3,1); }
i.cmp__b0 { background: #D9CFC0; }
.cmp__v { text-align: right; font-weight: 800; white-space: nowrap; }
.cmp__v small { display: block; font-size: 10px; font-weight: 500; color: var(--ink3); }
.cmp__v em { font-style: normal; margin-left: 4px; font-size: 10px; padding: 0 5px; border-radius: 6px; color: var(--ink3); background: #F1EBE1; }
.cmp__v em.is-up { color: #2F7A5A; background: #E3F1E9; }
.cmp__v em.is-down { color: #A9573F; background: #F8E6DE; }
.cmp__moods { font-size: 20px; display: flex; align-items: center; gap: 6px; }
.cmp__moods small { font-size: 12px; color: var(--ink3); }

/* ---------- コラム ---------- */
.cols { padding-top: 4px; }
.colexp { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border-radius: 16px; background: #EFE8DC; font-size: 13px; color: var(--ink2); }
.colexp b { flex: 0 0 auto; padding: 2px 10px; border-radius: 999px; background: var(--card); color: var(--ink2); font-weight: 800; }
.colexp.is-on { background: #FBEFD4; color: var(--ink); }
.colexp.is-on b { background: var(--meal); color: #fff; }
.colcard { display: block; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 10px; border-radius: var(--r); background: var(--card); box-shadow: 0 1px 0 var(--line), 0 6px 18px -12px rgba(80,60,40,.25); }
.colcard:active { transform: scale(.99); }
.colcard__h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.colcard__read { font-size: 11px; font-weight: 700; color: var(--ex); }
.colcard__t { display: block; font-size: 16px; font-weight: 800; line-height: 1.45; }
.colcard__l { display: block; margin-top: 4px; font-size: 12px; color: var(--ink2); }
.colcard__src { display: block; margin-top: 8px; font-size: 10px; color: var(--ink3); }
.ctag { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; color: var(--tc); box-shadow: inset 0 0 0 1.5px var(--tc); }

.art { padding: 0 2px 24px; }
.art__back { margin: 0 0 6px -4px; }
.art__t { margin: 10px 0 6px; font-size: 21px; font-weight: 800; line-height: 1.45; }
.art__lead { margin: 0 0 14px; font-size: 14px; color: var(--ink2); }
.art__body { padding: 16px; border-radius: var(--r); background: var(--card); box-shadow: 0 1px 0 var(--line); font-size: 15px; line-height: 1.85; }
.art__body p { margin: 0 0 12px; }
.art__body h3 { margin: 18px 0 6px; font-size: 15px; font-weight: 800; }
.art__body h3:first-child { margin-top: 0; }
.art__body ul { margin: 0 0 12px; padding-left: 1.2em; }
.art__body li { margin-bottom: 4px; }
.art__body > :last-child { margin-bottom: 0; }
.art__src { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: #EFE8DC; font-size: 12px; }
.art__src b { display: block; margin-bottom: 4px; }
.art__src ul { list-style: none; margin: 0; padding: 0; }
.art__src li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px; padding: 6px 0; border-top: 1px dashed #DDD3C3; }
.art__src li:first-child { border-top: 0; }
.art__src .btn-link { padding: 2px 0; font-size: 12px; }
.art__note { margin: 12px 2px 16px; font-size: 11px; line-height: 1.7; color: var(--ink3); }

/* ---------- せってい ---------- */
.sw { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 15px; cursor: pointer; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw__k { position: relative; flex: 0 0 52px; height: 30px; border-radius: 15px; background: #D9CFC0; transition: background .2s; }
.sw__k::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.sw input:checked + .sw__k { background: var(--ex); }
.sw input:checked + .sw__k::after { transform: translateX(22px); }
.set { padding-top: 4px; }
.slist { list-style: none; margin: 0 0 4px; padding: 0; }
.slist li { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; border-bottom: 1px dashed var(--line); font-weight: 700; }
.slist__x { width: 36px; height: 36px; border-radius: 50%; font-size: 18px; color: var(--ink3); }
.card.is-flash { animation: flash 1.2s ease; }
@keyframes flash { 0%,60% { box-shadow: 0 0 0 3px var(--supp); } 100% { box-shadow: 0 1px 0 var(--line); } }

/* ---------- シート・トースト・報酬 ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; }
.sheet-wrap[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(40,34,28,.4); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; max-height: 85vh; overflow: auto; padding: 8px 20px calc(20px + var(--safe-b)); background: var(--card); border-radius: 22px 22px 0 0; animation: up .25s ease; }
.sheet .btn { width: 100%; margin-top: 8px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
.sheet__h { margin: 0 0 10px; font-size: 18px; }
.sheet__p { color: var(--ink2); font-size: 14px; }
.dd__score { font-size: 40px; font-weight: 800; line-height: 1; margin-bottom: 8px; }
.dd__score small { font-size: 14px; color: var(--ink2); }
.dd { display: grid; grid-template-columns: 56px 1fr; gap: 8px 10px; margin: 0 0 8px; font-size: 14px; }
.dd dt { color: var(--ink3); font-size: 12px; font-weight: 700; padding-top: 2px; }
.dd dd { margin: 0; }

.toast-wrap { position: fixed; left: 0; right: 0; top: 16px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 999px; background: rgba(52,70,111,.95); color: #fff; font-size: 14px; font-weight: 700; animation: up .25s ease; }
.toast.out { opacity: 0; transition: opacity .25s; }

.reward { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(40,34,28,.5); }
.reward[hidden] { display: none; }
.reward__box { width: 100%; max-width: 340px; padding: 22px 20px 20px; border-radius: 24px; background: var(--card); text-align: center; animation: popin .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes popin { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.reward__art { width: 150px; margin: 0 auto 8px; }
.reward__t { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.reward__d { font-size: 14px; color: var(--ink2); margin-bottom: 14px; }
.reward .btn { width: 100%; }
.reward .btn[hidden] { display: none; }
.hatch { animation: shake .5s ease-in-out 3; transform-origin: 50% 90%; }
.hatch.is-born { animation: popin .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }

.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; opacity: .9; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
