:root{color-scheme:light;--ink:#24465c;--muted:#587386;--blue:#1673aa;--yellow:#af830a;--line:#d7e7f0;--paper:#fff}
*{box-sizing:border-box}
body{margin:0;background:#f2f9fd;color:var(--ink);font:16px/1.8 -apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif}
header{background:var(--paper);border-bottom:1px solid var(--line)}
.header-inner{max-width:1060px;margin:auto;padding:22px 28px;display:flex;align-items:center;justify-content:space-between;gap:20px}
a{color:var(--blue)}
#home-link{text-decoration:none;font-weight:650;letter-spacing:.05em;border-left:5px solid #f5d66c;padding-left:14px}
#home-link span{font-size:12px;margin-left:14px;font-weight:400}
.private{color:var(--muted);font-size:12px;background:#eef8fd;border-radius:20px;padding:5px 12px}
main{max-width:1000px;min-height:60vh;margin:42px auto;padding:0 24px}
h1{font-size:28px;font-weight:600;line-height:1.5;margin:8px 0 14px;letter-spacing:.035em}
h2{font-size:21px;font-weight:600;margin:0 0 12px}
h3{font-size:17px;margin:0 0 8px}
p{margin:8px 0 20px}
.eyebrow{font-size:12px;letter-spacing:.16em;color:var(--blue);font-weight:600}
.muted,.description{color:var(--muted)}.description{font-size:14px}
.card{background:var(--paper);border:1px solid var(--line);border-radius:20px;padding:28px;margin:28px 0;box-shadow:0 4px 20px #29678e05}
.actions{display:flex;flex-wrap:wrap;gap:12px;margin:22px 0}
.button,button{font:inherit;line-height:1.5;border:1px solid var(--blue);border-radius:10px;padding:13px 22px;background:var(--blue);color:white;cursor:pointer;text-decoration:none;display:inline-block}
button.secondary{background:var(--paper);color:var(--blue);border-color:#a8cee3}
button:disabled{opacity:.5;cursor:wait}
button:hover{filter:brightness(.96)}
:focus-visible{outline:3px solid #1673aa;outline-offset:4px}
.chart{max-width:660px;margin:0 auto}
.chart svg{width:100%;height:auto;display:block;overflow:visible}
.legend{display:flex;gap:25px;justify-content:center;flex-wrap:wrap;font-size:14px}
.legend span:before{content:"";display:inline-block;vertical-align:middle;width:24px;border-top:3px solid #177ab1;margin-right:8px}
.legend span:last-child:before{border-color:var(--yellow);border-top-style:dashed}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:24px}
.grid>div{min-width:0}
#entry-form .grid>div{background:#f0f8fd;border-radius:12px;padding:20px}
#entry-form .grid>div:nth-child(2){background:#fffbee}
.ideal{border-bottom:1px solid var(--line);padding-bottom:24px;margin-bottom:24px}
label{display:block;font-size:14px;font-weight:550;margin:14px 0 7px}
input,textarea{font:inherit;color:var(--ink);border:1px solid #a7c6d8;border-radius:9px;background:white;padding:10px 12px;max-width:100%}
textarea{display:block;width:100%;height:55px;min-height:55px;resize:vertical;line-height:1.8}
textarea:focus,input[type=date]:focus{border-color:var(--blue)}
input[type=date]{min-height:46px}
.score-picker{border:0;margin:16px 0 22px;padding:0;min-width:0}
.score-picker legend{font-size:14px;font-weight:550;padding:0;margin-bottom:10px}
.score-options{display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));gap:8px}
.score-option{position:relative;margin:0;cursor:pointer;min-width:0}
.score-option input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.score-option span{display:flex;align-items:center;justify-content:center;min-height:46px;border:1px solid #a7c6d8;border-radius:9px;background:white;color:#24516d;font-size:17px;font-weight:600;transition:background .12s,border-color .12s}
.score-option:hover span{background:#e0f1fc;border-color:var(--blue)}
.score-option input:checked+span{background:var(--blue);color:white;border:2px solid #105b88;box-shadow:0 2px 4px #1673aa20}
.score-option input:focus-visible+span{outline:3px solid #1673aa;outline-offset:3px}
.score-option input:focus-visible{outline:none}
.domain-num{font-size:12px;color:#576e80;display:inline-block;margin-bottom:12px;background:#fff3c3;padding:3px 11px;border-radius:20px;letter-spacing:.08em}
.reading{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.9}
.score{font-size:25px;line-height:1.5;display:block;margin-bottom:12px;color:var(--blue)}
.score small{font-size:13px;color:var(--muted)}
.history-list{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:1fr 1fr;gap:12px}
.history-list button{width:100%;text-align:left;display:flex;justify-content:space-between;gap:12px;background:var(--paper);color:var(--ink);border-color:var(--line)}
.history-list small{color:var(--muted)}summary{cursor:pointer;color:var(--blue);padding:15px 0}details{margin:20px 0}
.notice{padding:12px 16px;background:#e4f4fd;border-radius:8px}
.error{color:#8d3030;background:#fff1ed;padding:12px;border-radius:8px}
footer{max-width:1000px;margin:50px auto 30px;padding:0 24px;color:var(--muted);font-size:12px}
.empty{text-align:center;padding:45px 20px;border-top:4px solid #f5d66c}
.form-bottom{margin:28px 0}.help{font-size:13px;color:var(--muted)}
@media(max-width:900px){.grid{grid-template-columns:1fr}.grid{gap:20px}}
@media(max-width:600px){.header-inner{padding:16px 20px}.private{display:none}#home-link span{display:block;margin:0;font-size:11px}main{margin-top:28px;padding:0 16px}h1{font-size:24px}.card{padding:20px 16px;border-radius:16px}.history-list{grid-template-columns:1fr}#entry-form .grid>div{padding:16px 12px}.score-options{gap:6px}.chart{margin:0 -8px}.actions button{flex-grow:1}footer{padding:0 16px}.legend{font-size:13px;gap:18px}.chart-label{font-size:22px}.chart svg text:not(.chart-label){font-size:18px}}
@media(max-width:389px){.score-options{grid-template-columns:repeat(4,minmax(44px,1fr))}}
@media(prefers-reduced-motion:reduce){.score-option span{transition:none}}

/* 入力中のチャートと短い理由欄 */
.entry-layout{display:flex;flex-direction:column;gap:0}
.live-chart-panel{margin:24px 0 0}
.live-chart-panel .help{margin-bottom:0}
.live-chart-panel .chart-label{font-size:22px}
.live-chart-panel .chart svg text:not(.chart-label){font-size:18px}
@media(min-width:1100px){
 main:has(.entry-layout){max-width:1320px}
 .entry-layout{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:28px;align-items:start}
 #entry-form{grid-column:1;grid-row:1;min-width:0}
 .live-chart-panel{grid-column:2;grid-row:1;position:sticky;top:20px;padding:20px;margin:0}
 #entry-form>.card:first-of-type{margin-top:24px}
 .entry-layout #entry-form .grid{grid-template-columns:1fr}
 .entry-layout .score-options{grid-template-columns:repeat(6,minmax(44px,1fr));gap:6px}
 .live-chart-panel .legend{font-size:13px;gap:16px}
}

@media(min-width:1200px){.entry-layout .score-options{grid-template-columns:repeat(11,minmax(44px,1fr))}}

.record-comments .comment-row{padding:16px 0;border-top:1px solid var(--line)}
.record-comments .comment-row:last-child{padding-bottom:0}
.record-comments .comment-row h3{color:var(--blue);font-size:14px;margin-bottom:6px}
.export-preview{display:block;width:100%;height:auto;border:1px solid var(--line)}
