/* Diary uses the existing pine green palette, with quiet borders and large touch targets. */
.health-fields{--health-green:#234c3c;--health-mint:#eaf4ec;--health-ink:#183d32;border-top:1px solid #dce6dd;padding-top:22px;margin-top:22px;min-width:0;color:var(--health-ink)}
.health-fields h3{font-size:24px;margin:0 0 14px}.health-fields [hidden],.diary-history [hidden]{display:none!important}
.health-step-labels{display:flex;gap:6px;margin:0 0 18px;flex-wrap:wrap}.health-step-labels span{font-size:var(--ui-caption);padding:7px 12px;color:var(--ui-muted);background:#f4f6f3;border-radius:6px}.health-step-labels .current{color:#fff;background:var(--health-green)}
.health-fields button{min-height:44px;white-space:normal;text-align:left;line-height:1.35}.health-good{width:100%;justify-content:flex-start;font-weight:600;margin-bottom:16px;border-color:#aacbb4;background:#f7fbf6}.health-fields button.selected,.health-pick.selected{background:var(--health-mint);border-color:#3d805f;color:#164e3b;box-shadow:inset 0 0 0 1px #3d805f}
.health-search{margin-bottom:16px}.health-groups{border:1px solid #dce6dd;border-radius:10px;overflow:hidden}.health-groups details{margin:0;border-bottom:1px solid #dce6dd}.health-groups details:last-child{border:0}.health-groups summary{cursor:pointer;padding:14px;background:#f8faf7;font-weight:600;min-height:48px}.health-picks{display:grid;grid-template-columns:1fr;gap:7px;padding:10px}.health-pick{display:flex;align-items:center;gap:10px;min-height:48px;margin:0;padding:10px 12px;border:1px solid #e0e7df;border-radius:7px;cursor:pointer;background:white;font-size:var(--ui-caption)}.health-pick input{width:18px;height:18px;flex:none;margin:0;accent-color:#276647}.health-pick span{line-height:1.4}.health-fields button:focus-visible,.health-groups summary:focus-visible{outline:3px solid #8ab39a;outline-offset:2px}.health-pick:focus-within{outline:2px solid #8ab39a;outline-offset:1px}
.health-step-actions{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;margin-top:20px;padding-top:15px;border-top:1px solid #e0e7df}.health-step-actions>span{font-size:var(--ui-caption)}.health-step-actions .primary{margin-left:auto}.health-question-head{padding:14px 16px;background:#edf5ee;border-radius:9px;margin-bottom:20px}.health-question-head span{font-size:var(--ui-caption);color:#627a6c}.health-question-head h4{font-size:23px;margin:5px 0 0}.health-question{border:0;padding:0;margin:0 0 20px}.health-question legend{font-weight:600;margin-bottom:9px;padding:0;font-size:var(--ui-caption)}.health-answer-options{display:flex;flex-wrap:wrap;gap:7px}.health-answer-options button{padding:9px 13px;font-size:var(--ui-caption)}.health-question>input{max-width:260px}.health-comment{margin-top:20px}.health-comment textarea{min-height:84px}.health-error{color:#9b3434;background:#fff3f1;border-radius:7px;padding:12px;margin-top:15px}.health-confirmed,.health-good-result{color:#286341}.health-good-result{padding:15px;background:#eaf4ec;border-radius:9px}
.health-summary-cards{display:grid;gap:10px}.health-summary-card{border:1px solid #dce6dd;border-left:3px solid #6c9c7d;border-radius:7px;padding:14px;background:#fff}.health-summary-card header{display:flex;align-items:start;justify-content:space-between;gap:10px}.health-summary-card h4{font-size:var(--ui-body);margin:0 0 12px}.health-summary-card .small{font-size:var(--ui-caption);padding:7px 10px;min-height:36px}.health-summary-card dl,.history-facts{margin:0}.health-summary-card dl>div,.history-facts>div{display:grid;grid-template-columns:minmax(110px,1fr) 1.4fr;gap:12px;margin:7px 0;line-height:1.45;font-size:var(--ui-caption)}.health-summary-card dt,.history-facts dt{color:var(--ui-muted)}.health-summary-card dd,.history-facts dd{margin:0;overflow-wrap:anywhere}.health-legacy{color:var(--ui-muted);font-size:var(--ui-caption);line-height:1.6}.health-extra{margin-top:10px}.health-extra summary{padding:10px 0}.health-extra .formgrid{margin-top:15px}
.diary-history{min-width:0}.diary-history .pagehead{gap:16px}.diary-history .pagehead h2{font-size:28px}.diary-history .pagehead p{margin:5px 0 0;font-size:var(--ui-caption)}.history-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:18px;background:#fff;border:1px solid #dce6dd;border-radius:12px;margin:18px 0}.history-filters label{font-size:var(--ui-caption);margin:0;min-width:0}.history-search{grid-column:1/-1}.history-table-scroll{border:1px solid #dce6dd;border-radius:12px;overflow:auto;background:white}.diary-history-table{width:100%;min-width:1600px;border-collapse:collapse;font-size:var(--ui-caption);table-layout:fixed}.diary-history-table thead{background:#edf3ed}.diary-history-table th{font-size:var(--ui-caption);font-weight:500;color:#506a5a;padding:13px 10px;border-bottom:1px solid #dce6dd;text-align:left;white-space:normal}.diary-history-table td{padding:14px 10px;border:0;vertical-align:top;overflow-wrap:anywhere}.diary-history-table tbody+tbody{border-top:1px solid #e0e7df}.history-overview>td:first-child>*{display:block;margin-bottom:6px}.history-overview strong{font-size:var(--ui-caption)}.history-overview small{font-size:var(--ui-caption);color:var(--ui-muted)}.history-overview .history-rise{color:#9b6d22}.history-overview .history-warning{color:#a65c3d}.history-basics{display:grid;gap:7px;font-size:var(--ui-caption)}.history-symptoms{display:flex;flex-wrap:wrap;gap:5px}.history-symptoms>span{padding:5px 8px;background:#f2f6f2;border-radius:6px;font-size:var(--ui-caption);line-height:1.4}.history-symptoms small{display:block}.history-good{color:#286b46;font-size:var(--ui-caption)}.history-overview .pill{font-size:var(--ui-caption);white-space:normal}.history-overview button{white-space:nowrap;min-height:40px;padding:7px 10px}
.history-detail-row>td{padding:20px;background:#f7faf6;border-top:1px dashed #d4e2d6}.history-detail-grid{display:grid;grid-template-columns:1fr;gap:24px}.history-detail-grid>section{min-width:0}.history-detail-grid h3{font-size:21px;margin:0 0 15px}.history-detail-grid h4{margin:18px 0 9px}.history-detail-grid .health-summary-card h4{margin:0 0 10px;font-size:var(--ui-body)}.history-detail-grid .textbody{font-size:var(--ui-caption)}.history-facts{margin:18px 0}.history-plan{margin:12px 0}.history-plan summary{cursor:pointer;font-weight:600;padding:5px 0}.history-plan p{font-size:var(--ui-caption);margin:8px 0}.history-reply{border-bottom:1px solid #dce6dd;padding-bottom:15px;margin-bottom:15px}.history-photos{display:flex;gap:8px;flex-wrap:wrap}.history-photos img{width:70px;height:80px;object-fit:cover;border-radius:7px}.history-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0;font-size:var(--ui-caption);color:#637c6e}.history-bottom button{min-height:44px}
@media(min-width:700px){.health-picks{grid-template-columns:repeat(2,minmax(0,1fr))}.history-filters{grid-template-columns:150px 150px minmax(180px,1fr) minmax(160px,.7fr)}.history-search{grid-column:auto}.history-detail-grid{grid-template-columns:1.2fr 1fr 1fr}}
@media(max-width:1050px){.history-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.diary-history-table{font-size:var(--ui-caption)}.diary-history-table th,.diary-history-table td{padding:12px 9px}.history-detail-grid{grid-template-columns:1fr 1fr}.history-detail-grid>section:last-child{grid-column:1/-1}}
@media(max-width:700px){.history-table-scroll{border:0;border-radius:0;background:transparent}.diary-history-table,.diary-history-table tbody,.diary-history-table tr,.diary-history-table td{display:block;width:100%;min-width:0}.diary-history-table colgroup{display:none}.diary-history-table .history-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.history-cell-date,.history-cell-health,.history-cell-reply,.history-cell-details{grid-column:1/-1}.diary-history-table thead{display:none}.diary-history-table tbody{background:white;border:1px solid #dce6dd!important;border-radius:10px;margin:0 0 13px;overflow:hidden}.diary-history-table td{padding:9px 14px}.history-overview>td[data-label]::before{content:attr(data-label);display:block;font-size:var(--ui-caption);color:var(--ui-muted);margin-bottom:5px}.history-overview>td:first-child{background:#f2f7f0;padding:13px 14px}.history-overview>td:first-child::before{display:none}.history-overview>td:last-child button{width:100%;min-height:44px}.history-detail-row>td{padding:16px}.history-detail-grid{grid-template-columns:1fr}.history-detail-grid>section:last-child{grid-column:auto}.history-filters{padding:13px}.history-filters .history-search,.history-filters label:last-child{grid-column:1/-1}.history-bottom{align-items:start;flex-direction:column}.history-bottom button{width:100%}.health-step-labels span{padding:7px 9px}.health-summary-card dl>div{grid-template-columns:1fr;gap:2px}.health-step-actions>button{flex:1;justify-content:center}.health-extra .formgrid{grid-template-columns:1fr}.health-fields .health-pick{font-size:var(--ui-caption)}}
/* Keep the date in view while comparing individual measurements across the table. */
@media(min-width:701px){.history-overview>td+td{border-left:1px solid #edf1eb}.diary-history-table th:first-child{position:sticky;left:0;z-index:3;background:#edf3ed}.history-overview>.history-cell-date{position:sticky;left:0;z-index:1;background:#fff;border-right:1px solid #dce6dd}}

/* Daily entry: quiet pastel cards, with related questions kept together. */
.diary-entry-form{font-family:var(--ui-font);font-size:var(--ui-caption);color:#263a45;min-width:0}
.diary-date-note{margin:0 0 16px;color:#687b78;font-size:var(--ui-caption);line-height:1.6}
.diary-entry-form .diary-card{padding:0;overflow:hidden;border:1px solid #e4e9e6;border-radius:15px;box-shadow:0 3px 14px #293b3210;margin-bottom:18px}
.diary-card-heading{display:flex;align-items:center;gap:13px;padding:18px 20px;background:var(--diary-tint);border-bottom:1px solid var(--diary-border)}
.diary-card-heading>svg{width:30px;height:30px;flex:none;color:var(--diary-accent)}
.diary-entry-form .diary-card-heading h2{font:700 19px/1.3 var(--ui-font);color:#253944;margin:0}
.diary-card-heading h2 small{font-size:var(--ui-caption);font-weight:400;color:var(--ui-muted);margin-left:7px}
.diary-card-heading p{font-size:var(--ui-caption);color:#6b787a;margin:4px 0 0;line-height:1.5}
.diary-card-body{padding:20px}.diary-card-body>fieldset{margin:0;min-width:0}
.diary-morning{--diary-tint:#fff6e8;--diary-accent:#d29a32;--diary-border:#f4e9d4}
.diary-evening{--diary-tint:#f1f4fc;--diary-accent:#7d87b4;--diary-border:#e5e9f4}
.diary-health{--diary-tint:#f5effc;--diary-accent:#9572af;--diary-border:#eadef4}
.diary-photos{--diary-tint:#edf7fd;--diary-accent:#5699ba;--diary-border:#deedf5}
.diary-measures{--diary-tint:#edf7f1;--diary-accent:#4d9478;--diary-border:#dceee3}
.diary-entry-form label,.diary-entry-form legend{font-size:var(--ui-caption);color:#37474f}
.diary-entry-form input,.diary-entry-form textarea{font-size:var(--ui-caption);min-width:0}
.diary-entry-form .formgrid{gap:5px 24px}.diary-entry-form .diary-answer{min-width:0;margin-bottom:16px}
.diary-entry-form .checks{gap:12px 24px}.diary-entry-form .check{min-height:30px;margin:0}
.diary-entry-form button{font-size:var(--ui-caption);min-height:42px}.diary-entry-form fieldset:disabled input{background:#f8f9f8;color:#687474}
.diary-save-line{display:flex;align-items:center;flex-wrap:wrap;gap:12px}.diary-save-line span{font-size:var(--ui-caption);color:#557b69}
.diary-entry-form .diary-submit{padding:12px 22px;margin-bottom:20px;font-weight:600}
.diary-photo-input{margin-top:12px}.diary-photo-input input{padding:10px;background:#f9fcfe;font-size:var(--ui-caption)}
.diary-entry-form .health-fields{border:0;margin:0;padding:0;color:#37404d;--health-green:#73568d;--health-mint:#f1eaf8;--health-ink:#554467}
.diary-entry-form .health-good{border-color:#d7e8de;background:#f5faf6;color:#397358;font-size:var(--ui-caption)}
.diary-entry-form .health-good.selected{background:#edf6ef;border-color:#6eaa85;box-shadow:inset 0 0 0 1px #6eaa85}
.diary-entry-form .health-search{margin-bottom:14px}.diary-entry-form .health-groups{border-color:#e6ddee}
.diary-entry-form .health-groups summary{background:#faf7fd;font-size:var(--ui-caption);min-height:44px;padding:12px 14px;color:#675378}
.diary-entry-form .health-picks{grid-template-columns:1fr;gap:7px;padding:10px}
.diary-entry-form .health-pick{min-height:44px;border-color:#e8e1ed;font-size:var(--ui-caption)}
.diary-entry-form .health-pick.selected,.diary-entry-form .health-answer-options button.selected{background:#f2eafa;border-color:#ae90c4;box-shadow:inset 0 0 0 1px #ae90c4;color:#664c80}
.diary-entry-form .health-pick input{accent-color:#8a69a7;min-height:0}
.health-inline-detail{padding:18px 12px 4px;border-left:2px solid #c5add8;margin:8px 4px 10px 10px}
.diary-entry-form .health-question{margin-bottom:18px;min-width:0}.diary-entry-form .health-question legend{font-size:var(--ui-caption);font-weight:600}
.diary-entry-form .health-answer-options{gap:6px}.diary-entry-form .health-answer-options button{padding:8px 10px;min-height:38px;font-size:var(--ui-caption);border-color:#e5ddeb;color:#63596c}
.health-selection{font-size:var(--ui-caption);color:var(--ui-muted);margin:12px 0 0}.diary-entry-form .health-comment{margin-top:18px}
@media(min-width:1100px){.diary-layout{grid-template-columns:minmax(420px,1.15fr) minmax(300px,1fr);gap:24px}}
@media(max-width:760px){.diary-card-heading{padding:15px 16px}.diary-card-body{padding:16px}.diary-entry-form .formgrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}.diary-entry-form .checks{gap:12px}.diary-entry-form .diary-card-heading h2{font-size:var(--ui-body)}.diary-entry-form .diary-submit{width:100%}.health-inline-detail{padding-left:10px;margin-left:6px}}
@media(max-width:360px){.diary-entry-form .formgrid{grid-template-columns:1fr}}

