/* =========================================================
   ざつみのカラダの中身。（「ざつみのサイフの中身。」と同じ見た目の系統）
   ========================================================= */
:root{
  color-scheme:dark;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans JP",sans-serif;
  background:#171a20;color:#eeeae4;
  --muted:#a6a8b0;--line:#ffffff12;--surface:#22262e;--accent:#ff8a6b;
  --steps:#e0583a;--exercise:#2f8ae6;--sleep:#9b6be0;--pop:cubic-bezier(.2,1.5,.4,1);
}
*{box-sizing:border-box}
body{margin:0}
[hidden]{display:none!important}
a:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
h1{font-size:30px;line-height:1.5;font-weight:500;margin:0 0 10px}
h2{font-size:18px;font-weight:600;margin:0}
.eyebrow{font-size:12px;color:var(--accent);letter-spacing:.04em;font-weight:500;margin:0 0 10px}

@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes popin{0%{opacity:0;transform:scale(.6)}100%{opacity:1;transform:scale(1)}}
@keyframes barup{from{transform:scaleY(0)}}
@keyframes grow{from{transform:scaleX(0)}}

/* ヘッダー */
header{height:76px;padding:0 max(28px,calc((100vw - 1080px)/2));display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:#171a20eb;position:sticky;top:0;z-index:3;backdrop-filter:blur(18px)}
.header-left{display:flex;align-items:center;gap:14px;min-width:0}
.home-link{display:inline-flex;align-items:center;gap:2px;color:var(--muted);text-decoration:none;font-size:12px;padding:6px 10px;border-radius:99px;border:1px solid #ffffff1a;white-space:nowrap}
.home-link:hover{color:#eeeae4;border-color:#ffffff40}
.brand{display:flex;align-items:center;gap:8px;color:inherit;text-decoration:none;font-size:17px;font-weight:600}
.brand-mark{color:var(--steps);font-size:20px}
.demo{color:var(--muted);font-size:12px}
.sample-bar{padding:10px 16px;text-align:center;font-size:13px;color:#fde047;background:linear-gradient(90deg,#3a3214,#2a2145)}

main{max-width:1080px;margin:auto;padding:44px 28px 0}
.intro{margin-bottom:30px}
.lede{font-size:14px;line-height:1.8;color:var(--muted);margin:0}

/* カード共通 */
.card{background:var(--surface);border:1px solid #ffffff0d;border-radius:20px;padding:24px 28px;margin:0 0 24px;animation:rise .5s var(--pop) both}
.section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.section-heading>span{font-size:12px;color:var(--muted)}

/* 今日のリング */
.today{background:radial-gradient(120% 140% at 0% 0%,#3a2218 0%,transparent 55%),radial-gradient(120% 140% at 100% 100%,#241a3a 0%,transparent 55%),var(--surface)}
.today-layout{display:grid;grid-template-columns:240px 1fr;gap:32px;align-items:center}
.rings-wrap{position:relative;width:240px;aspect-ratio:1}
.rings{width:100%;height:100%;transform:rotate(-90deg)}
.ring-track{fill:none;stroke:#ffffff0f}
.ring{fill:none;stroke-linecap:round;stroke-dasharray:0 var(--c);transition:stroke-dasharray 1.2s var(--pop) var(--d)}
.ring.on{stroke-dasharray:var(--len) var(--c)}
.rings-center{position:absolute;inset:0;display:grid;place-content:center;text-align:center}
.rings-center b{font-size:40px;font-weight:800;line-height:1}
.rings-center small{font-size:16px;margin-left:2px}
.rings-center span{font-size:11px;color:var(--muted);margin-top:6px}
.ring-legend{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.ring-legend li{display:grid;grid-template-columns:12px auto 1fr;grid-template-rows:auto auto;column-gap:10px;align-items:center;background:#ffffff06;border-radius:14px;padding:12px 14px;animation:rise .4s var(--d) both}
.ring-legend i{width:12px;height:12px;border-radius:50%;grid-row:1/3}
.rl-name{font-size:13px;color:var(--muted)}
.ring-legend b{font-size:22px;font-weight:700;text-align:right;font-variant-numeric:tabular-nums}
.ring-legend small{grid-column:2/4;font-size:11px;color:var(--muted)}

/* ハイライト */
.highlights{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:0 0 24px}
.hl{background:var(--surface);border:1px solid #ffffff0d;border-radius:18px;padding:18px;display:flex;flex-direction:column;gap:6px;animation:popin .5s var(--d) var(--pop) both;transition:transform .2s var(--pop),border-color .2s;min-width:0}
.hl:hover{transform:translateY(-4px) rotate(-.6deg);border-color:#ff8a6b66}
.hl-icon{font-size:24px}
.hl-title{font-size:12px;color:var(--muted)}
.hl-value{font-size:24px;font-weight:700;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.hl:nth-child(1) .hl-value{color:#ff9a7a}
.hl:nth-child(2) .hl-value{color:#fde047}
.hl:nth-child(3) .hl-value{color:#c4b5fd}
.hl:nth-child(4) .hl-value{color:#7dd3fc}
.hl small{font-size:11px;color:var(--muted);line-height:1.6}

/* グラフ共通 */
.chart{width:100%;height:auto;display:block;overflow:visible}
.axis{fill:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}
.grid{stroke:#ffffff10}
.base{stroke:#ffffff24}
.goal{stroke:#ffffff66;stroke-dasharray:4 4}
.bar{transform-origin:bottom;transform-box:fill-box;animation:barup .7s var(--d) var(--pop) both;cursor:pointer}
.band{transform-origin:left;transform-box:fill-box;animation:grow .7s var(--d) var(--pop) both;cursor:pointer}
.wline{fill:none;stroke:#7dd3fc;stroke-width:2;stroke-linejoin:round}
.wdot{fill:#7dd3fc;stroke:var(--surface);stroke-width:2}
.wdot.last{fill:#eeeae4}
.wlabel{fill:#eeeae4;font-size:12px;font-weight:700}
.hit{fill:transparent}
.empty{color:var(--muted);font-size:13px}
.tip{position:absolute;z-index:20;pointer-events:none;background:#0d0f13f0;border:1px solid #ffffff1a;border-radius:10px;padding:8px 10px;font-size:12px;line-height:1.6;box-shadow:0 8px 24px #0006;white-space:nowrap}

footer{border-top:1px solid var(--line);padding:22px 0 28px;display:flex;gap:24px;align-items:center;color:var(--muted)}
.brand-footer{font-size:12px;white-space:nowrap;font-weight:500}
footer p{font-size:11px;line-height:1.8;margin:0;flex:1}
.home-footer{color:var(--muted);font-size:11px;white-space:nowrap}

@media(max-width:950px){.highlights{grid-template-columns:repeat(2,1fr)}}
@media(max-width:650px){
  header{height:64px;padding:0 20px}
  .header-left{gap:8px}
  .home-link span{display:none}
  .brand{font-size:15px}
  .demo{font-size:10px}
  main{padding:30px 20px 0}
  h1{font-size:25px}
  .card{padding:20px}
  .today-layout{grid-template-columns:1fr;gap:20px;justify-items:center}
  .rings-wrap{width:220px}
  .ring-legend{width:100%}
  .highlights{gap:10px}
  .hl{padding:14px}
  .hl-value{font-size:19px}
  footer{flex-direction:column;align-items:flex-start;gap:10px}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}

.health-period{margin:0 0 24px}.health-period select{font:inherit;padding:8px;border-radius:8px;background:var(--surface,#22262e);color:inherit}.health-period p,.health-method{font-size:12px;line-height:1.8;opacity:.75}.sleep-records>div{display:flex;justify-content:space-between;padding:10px;border-bottom:1px solid #8883}
/* 全期間の実データを閲覧する画面 */
.record-period{color:var(--accent);font-size:13px;margin-top:18px}
.health-summary{display:flex;gap:32px;align-items:center;border-block:1px solid var(--line);padding:22px 0;margin-bottom:28px}
.health-summary>div{display:flex;flex-direction:column;gap:4px;flex-shrink:0}.health-summary strong{font-size:30px;font-variant-numeric:tabular-nums}.health-summary span,.health-summary p{font-size:12px;color:var(--muted);line-height:1.8}.health-summary p{margin-left:auto;max-width:310px}
.health-controls{display:flex;align-items:end;gap:12px}.health-controls label{display:grid;gap:7px;font-size:12px;color:var(--muted)}.health-controls select,.health-controls input{min-height:44px;border:1px solid #ffffff25;background:var(--surface);color:inherit;border-radius:10px;padding:10px 12px;font:inherit;font-size:14px;color:#eeeae4;min-width:0}.search-control{flex:1}.health-controls select:disabled{opacity:.5}
.health-categories{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0 28px}.health-categories button{border:1px solid #ffffff20;background:transparent;color:var(--muted);padding:9px 13px;border-radius:99px;font:inherit;font-size:12px;cursor:pointer}.health-categories button[aria-pressed=true]{background:var(--accent);color:#171a20;border-color:var(--accent)}
.view-heading{display:flex;justify-content:space-between;gap:16px;align-items:baseline;margin-bottom:28px}.view-heading p,.view-heading>span{color:var(--muted);font-size:12px;line-height:1.7}.view-heading>span{white-space:nowrap}
.metric-section{margin:0 0 32px}.metric-section>h2{font-size:15px;color:var(--muted);margin-bottom:12px}.metric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.metric-card{padding:20px;border-radius:16px;border:1px solid #ffffff12;background:var(--surface);min-width:0;display:flex;flex-direction:column}.metric-card h3{font-size:13px;font-weight:500;line-height:1.6;margin:0 0 14px;min-height:2.6em}.metric-value{font-size:28px;font-weight:600;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.metric-value small{font-size:12px;font-weight:400;color:var(--muted)}.metric-date{font-size:11px;color:var(--muted);margin:8px 0 14px}.metric-card svg{width:100%;height:56px;overflow:visible;margin-top:auto}.metric-card svg path{fill:none;stroke:var(--accent);stroke-width:1.5}.metric-card svg circle{fill:var(--accent)}.metric-bottom{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-top:14px}.metric-bottom>span{font-size:10px;line-height:1.6;color:var(--muted)}.metric-bottom button{white-space:nowrap;padding:8px 0;font-size:11px;background:none;color:var(--accent);border:0;cursor:pointer}.no-record{opacity:.7}.no-record .metric-bottom{margin-top:auto}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.health-methods{font-size:12px;color:var(--muted);line-height:1.9;padding:18px 0;margin-bottom:20px;border-top:1px solid var(--line)}.health-methods summary{cursor:pointer;color:#eeeae4}
#metric-dialog{background:var(--surface);color:#eeeae4;border:1px solid #ffffff30;border-radius:18px;width:min(600px,calc(100vw - 24px));max-height:85vh;padding:24px}#metric-dialog::backdrop{background:#0009}.detail-heading{display:flex;gap:14px;justify-content:space-between;align-items:center}.detail-heading h2{font-size:17px}.detail-heading button,#detail-more{background:#ffffff0a;border:1px solid #ffffff25;border-radius:8px;padding:9px 12px;color:inherit;cursor:pointer;font:inherit;white-space:nowrap}#detail-summary{font-size:12px;color:var(--muted);line-height:1.6}.detail-table{max-height:55vh;overflow:auto;margin-bottom:16px}.detail-table table{width:100%;border-collapse:collapse;font-size:13px}.detail-table th,.detail-table td{padding:12px 4px;border-bottom:1px solid #ffffff12;text-align:left;font-weight:400}.detail-table td{text-align:right}button:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(max-width:800px){.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.health-summary{gap:24px;flex-wrap:wrap}.health-summary p{max-width:none;margin:0}}
@media(max-width:500px){header{height:auto;min-height:76px;flex-wrap:wrap;padding:12px 16px;gap:10px}.demo{display:block!important;width:100%;text-align:left;font-size:11px}main{padding-top:28px}h1{font-size:25px}.metric-grid{gap:10px}.metric-card{padding:14px}.metric-value{font-size:23px}.metric-card h3{font-size:12px;min-height:3.2em}.metric-bottom{flex-direction:column;align-items:start;gap:0}.metric-date{line-height:1.7}.health-controls{flex-wrap:wrap}.search-control{flex-basis:100%}.health-summary strong{font-size:26px}.detail-heading h2{font-size:15px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* 使用デバイスの明記。借金は支出開示（/wallet/）へ。リンクだけサイフの色（黄緑） */
.device-note{margin:10px 0 0;font-size:13px;line-height:1.8;color:var(--muted)}
.device-note a{color:#c6f36b;text-underline-offset:3px}

/* 取得日と更新頻度（「ざつみのサイフの中身。」と同じ形）。スマホでも省略しない。 */
.update-status{display:flex;flex-direction:column;gap:5px;text-align:right}
.update-status .demo{display:block;color:var(--accent);font-size:13px;font-weight:600;line-height:1.5}
.update-frequency{color:var(--muted);font-size:11px;line-height:1.6}
@media(max-width:500px){
  .update-status{width:100%;text-align:left}
  .update-status .demo{font-size:12px}
  .update-frequency{font-size:10px;overflow-wrap:anywhere}
}
