:root{font-family:"Yu Gothic","Meiryo",sans-serif;color:#233e43;background:#f4f6f3;font-size:16px}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer;background:#fff;border:1px solid #bfcfca;border-radius:7px;padding:10px 14px;color:inherit}button:hover{background:#edf5ef}button:disabled{opacity:.5;cursor:default}.primary{background:#287765;color:white;border-color:#287765}.primary:hover{background:#1d6252}header{height:86px;display:flex;align-items:center;gap:24px;background:white;border-bottom:1px solid #d9e2dc;padding:20px 32px}header img{width:210px}header span{font-size:22px;font-weight:bold}header small{background:#f1eee0;padding:5px 10px;border-radius:20px}header button{margin-left:auto}.workspace{display:flex;min-height:calc(100vh - 86px)}aside{width:270px;flex-shrink:0;background:#fff;padding:25px 20px;border-right:1px solid #dae2dc}aside>button,aside input{width:100%;margin:7px 0}label{display:block;font-size:14px;font-weight:600;margin:15px 0 7px}input,textarea,select{display:block;width:100%;border:1px solid #b9cbc5;border-radius:5px;padding:10px;background:white;color:#233e43;margin-top:6px}textarea{resize:vertical;line-height:1.7}#counts{font-size:13px;margin:20px 0;color:#658078}.person{display:flex;flex-direction:column;align-items:flex-start;width:100%;border:0;border-radius:6px;margin:7px 0;padding:16px}.person span{font-size:12px;margin-top:8px;color:#5e796f}.person.active{background:#e5f1e9;border-left:4px solid #287765}.aside-bottom{font-size:12px;color:#7a8a80;line-height:1.8;margin-top:45px}main{min-width:0;flex:1;padding:24px 28px}#notice{font-size:13px;background:#e9eeea;padding:10px 14px;border-radius:6px;margin-bottom:20px}#empty{padding:90px 30px;text-align:center}h1{font-size:26px}.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:22px}.toolbar h1{margin:6px 20px 0 0}.toolbar small{color:#6c8176}.columns{display:grid;grid-template-columns:minmax(290px,360px) minmax(560px,1fr);gap:26px}.form-panel{background:white;border:1px solid #dce4dd;border-radius:10px;padding:22px;height:fit-content}.form-panel h2{font-size:19px;margin-top:0}.form-panel small{font-size:12px;line-height:1.7;display:block;color:#6a766c}.inline{display:flex;gap:8px;margin:12px 0}.inline button{font-size:13px}details{margin-top:25px}summary{cursor:pointer;font-weight:bold;font-size:14px}.scroll{overflow:auto;max-height:420px;margin:15px 0}table{border-collapse:collapse}th,td{border:1px solid #c8d8d9;padding:6px;font-size:13px;white-space:pre-line}#dailyEditor input{width:75px;padding:6px}#dailyEditor input[data-key=day]{width:45px}.preview{overflow:auto;padding:0 0 30px}.preview-label{display:flex;justify-content:space-between;font-size:13px;color:#64796c;margin-bottom:12px}#fit{color:#95642b}#paper{width:794px;height:1123px;padding:42px 42px 35px;background:white;box-shadow:0 4px 18px #1a3b2415;display:flex;flex-direction:column;color:#263c43;overflow:visible;font-family:"Yu Gothic","Meiryo",sans-serif}.paper-head{display:flex;justify-content:space-between;border-bottom:1px solid #bfd0d1;padding-bottom:14px;font-size:14px}.paper-head p{margin:10px 0}.brand{font-size:12px;line-height:1.6;width:215px}.brand img{width:205px;display:block;margin-bottom:7px}.brand>div{font-size:11px}.paper-title{display:flex;align-items:center;justify-content:space-between;gap:30px;margin-top:15px}.paper-title h2{font-size:22px;white-space:nowrap;margin:5px 0}.paper-title>b{font-size:21px;white-space:nowrap;color:#287e84}#paper h1{font-size:29px;margin:18px 0}#paper h3{font-size:17px;background:#edf5f4;border-left:5px solid #31888a;padding:7px 10px;border-radius:4px;margin:0 0 13px}.vitals{width:100%;table-layout:fixed;margin:0 0 13px;font-size:12px}.vitals th,.vitals td{padding:4px 1px;text-align:center;line-height:1.28;font-size:12px;overflow-wrap:anywhere}.vitals th:first-child{width:76px;text-align:left;padding-left:7px;font-size:14px;font-weight:400}.vitals tr:first-child{background:#edf4f4}.vitals tr:nth-child(2n+3){background:#f9fbfb}.vitals tr:first-child th{font-weight:bold}#paper small{font-size:11px;color:#657c85}.weight{font-size:14px;margin:10px 0 20px}.narrative{display:flex;gap:20px;align-items:flex-start;font-size:16px;line-height:1.85;min-height:185px}.prose{overflow-wrap:anywhere;flex:1}.prose p{margin:16px 0}.photos{width:190px;flex-shrink:0;display:flex;flex-direction:column;gap:10px}.photos img{width:190px;max-height:160px;object-fit:contain;border-radius:4px}#paper footer{border-top:1px solid #bfd0d1;padding-top:7px;margin-top:auto;font-size:13px}#paper footer p{margin:7px 0}.missing{color:#7e8584;font-size:14px}dialog{border:0;border-radius:10px;box-shadow:0 20px 70px #1235;padding:28px;width:800px;max-width:95vw;max-height:90vh}dialog::backdrop{background:#183a3c66}dialog button{margin:8px 8px 0 0}dialog label{margin-top:12px}dialog table{min-width:600px}.scroll table{width:100%}#dialogContent>p{line-height:1.8}a{color:#216e63} [hidden]{display:none!important}@media(max-width:1250px){.columns{grid-template-columns:320px 1fr}aside{width:230px}main{padding:20px 16px}}@media(max-width:900px){header{padding:12px;height:auto;gap:10px;flex-wrap:wrap}header img{width:150px}header span{font-size:18px}aside{width:185px;padding:15px 10px}.columns{display:flex;flex-direction:column}.preview{max-width:100%}.toolbar button{font-size:13px;padding:8px}.form-panel{width:100%}}@media print{@page{size:A4;margin:0}body{background:white}header,aside,#notice,.toolbar,.form-panel,.preview-label,dialog{display:none!important}.workspace,main,.columns,.preview{display:block!important;padding:0!important;margin:0!important;overflow:visible!important}#paper{width:210mm;height:297mm;box-shadow:none;padding:11mm;break-after:avoid}#editor{display:block!important}#empty{display:none!important}*{-webkit-print-color-adjust:exact;print-color-adjust:exact}}

#paper > * {flex-shrink:0}
#paper .narrative{min-height:120px}#paper .brand>div{margin-bottom:2px}#paper .paper-head{padding-bottom:10px}

/* A4 uses the same physical dimensions on screen and paper. Keep type sizes; budget spacing and image frames. */
#paper{width:210mm;height:297mm;padding:10mm 11mm;line-height:1.4}
#paper .paper-head{font-size:14px;line-height:1.4;padding-bottom:6px}
#paper .paper-head p{margin:6px 0}
#paper .brand{width:48mm;font-size:12px;line-height:17px}
#paper .brand img{width:48mm;height:12.8mm;object-fit:contain;margin-bottom:4px}
#paper .brand>div{line-height:14px;margin-bottom:2px}
#paper .paper-title{margin-top:6px;gap:20px}
#paper .paper-title h2{line-height:28px;margin:4px 0}
#paper h1{font-size:29px;line-height:35px;margin:8px 0}
#paper h3{font-size:17px;line-height:22px;padding:4px 10px;margin:0 0 8px}
#paper .vitals{margin:0 0 8px}
#paper .vitals th,#paper .vitals td{font-size:13px;line-height:18px;padding:1.5px 1px}
#paper .vitals th:first-child{font-size:14px;width:76px;padding-left:7px}
#paper small{line-height:14px}
#paper .weight{font-size:14px;line-height:20px;margin:6px 0 10px}
#paper .narrative{display:flex;flex-direction:column;align-items:stretch;min-height:0;gap:3mm;font-size:16px;line-height:1.65}
#paper .prose{flex:none;width:100%;min-width:0}
#paper .prose p{margin:10px 0 0}
#paper .photos{display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;gap:4mm}
#paper .photos img{display:block;object-fit:contain;max-height:none;min-width:0;flex-shrink:0}
#paper .photos.two img{width:calc((100% - 4mm)/2);height:44mm}
#paper .photos.one img{width:100%;height:44mm}
#paper footer{font-size:13px;line-height:17px;padding-top:6px}
#paper footer p{margin:4px 0}
@media print{#paper{width:210mm;height:297mm;padding:10mm 11mm}}

#paper .monthly-stats{width:100%;table-layout:fixed;border-collapse:collapse;margin:0 0 8px;font-size:15px}
#paper .monthly-stats th,#paper .monthly-stats td{padding:3px 8px;line-height:20px;font-size:15px;text-align:center}
#paper .monthly-stats th:first-child{width:35%;text-align:left}
#paper .monthly-stats thead{background:#edf4f4}
#paper .monthly-stats tbody tr:nth-child(even){background:#f9fbfb}
#paper .monthly-stats small{font-size:11px}
#statsReview{font-size:13px;line-height:1.7}#statsReview li{margin:6px 0}

#paper .goal-block{font-size:16px;line-height:1.65;margin:0 0 10px;overflow-wrap:anywhere}#paper .goal-block p{margin:0 0 6px}

#dailyEditor textarea{width:82px;min-height:60px;padding:6px;font-size:13px;line-height:1.4}

/* New monthly format: health and goals share the upper row. Legacy finals keep their existing flow. */
#paper .report-upper{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:5mm;align-items:start;margin:0 0 10px}
#paper .report-upper>section{min-width:0}
#paper .report-upper h3{font-size:16px;padding-left:7px;padding-right:5px}
#paper .report-upper .monthly-stats th,#paper .report-upper .monthly-stats td{font-size:14px;padding:3px 4px}
#paper .report-upper .monthly-stats th:first-child{width:40%}
#paper .report-upper .monthly-stats small{font-size:10px;white-space:nowrap}
#paper .report-upper .health-column>small{display:block;font-size:10px;line-height:15px}
#paper .report-upper .weight{margin-bottom:0}
#paper .report-upper .goal-block{font-size:16px;line-height:1.65;margin-bottom:0}
#paper .goals-column{min-height:65mm}
#paper .report-upper .goals-column .goal-block{box-sizing:border-box;width:100%;border:1px solid #c8d8d9;padding:8px 10px}
#paper .narrative{box-sizing:border-box;width:100%;border:1px solid #c8d8d9;padding:8px 10px}

/* Fixed form areas only for the monthly-summary format; content remains visible when too long. */
#paper.fixed-report{display:grid;grid-template-rows:26mm 12mm 15mm 90mm 10mm minmax(0,1fr) 16mm;gap:0;align-content:stretch}
#paper.fixed-report>.paper-head{height:100%;margin:0;min-height:0;overflow:visible}
#paper.fixed-report>.paper-title{height:100%;margin:0;min-height:0;overflow:visible}
#paper.fixed-report>.paper-title h2{margin:0}
#paper.fixed-report>h1{height:100%;margin:0;display:flex;align-items:center;min-height:0;overflow:visible}
#paper.fixed-report>.report-upper{height:100%;min-height:0;margin:0;padding-bottom:3mm;align-items:stretch;overflow:visible}
#paper.fixed-report .report-upper>section{display:flex;flex-direction:column;min-height:0;height:100%;overflow:visible}
#paper.fixed-report .report-upper>section>h3{flex:0 0 8mm;margin:0 0 2mm;box-sizing:border-box}
#paper.fixed-report .report-upper .health-column>*{flex-shrink:0}
#paper.fixed-report .report-upper .goals-column{min-height:0}
#paper.fixed-report .report-upper .goals-column .goal-block{flex:1 1 0%;min-height:0;height:auto;margin:0;overflow:visible}
#paper.fixed-report>h3{height:100%;margin:0;min-height:0;overflow:visible}
#paper.fixed-report>.narrative{height:100%;min-height:0;margin:0;flex:none;justify-content:flex-start;overflow:visible}
#paper.fixed-report>.narrative>.photos{height:44mm;flex:0 0 44mm}
#paper.fixed-report>.narrative>.prose{flex:0 0 auto}
#paper.fixed-report>footer{height:100%;min-height:0;margin:0;overflow:visible}
#paper.fixed-report .content-overflow{outline:2px solid #be4936;outline-offset:-2px}
@media print{#paper.fixed-report{display:grid}}


#paper.fixed-report .report-upper .goals-column .goal-block,#paper.fixed-report .narrative .prose{font-size:12pt;line-height:1.65}

.authentication-required>header,.authentication-required>.workspace{display:none}.auth-gate{max-width:440px;margin:8vh auto;background:white;border:1px solid #c8d8d9;border-radius:12px;padding:30px}.auth-gate small{font-size:12px}.auth-gate #authError{color:#ac3d26}#recovery{margin-bottom:14px;border-color:#ac3d26}
.inline{flex-wrap:wrap}
