/* Focused navigation and shared workflow layouts. */
.nav-secondary{border-top:1px solid #ffffff30;margin-top:1.5rem;padding-top:1rem}.mobile-primary{display:none}
.nav-main a.calculator-shortcut{background:transparent;color:#dce8fb;border:0}.mobile-nav .nav-main a.calculator-shortcut{background:transparent;color:#233c55}
.nav-main a.calculator-shortcut:hover{background:#ffffff1a;color:#fff}.mobile-nav .nav-main a.calculator-shortcut:hover{background:#e1ecf7;color:#153e73}
.nav-main a.calculator-shortcut[aria-current]{background:#ffffff21;color:#fff;box-shadow:inset 3px 0 0 var(--diabetes-blue)}.mobile-nav .nav-main a.calculator-shortcut[aria-current]{background:#dceafa;color:#153e73;box-shadow:none}
.calculator-shortcut .nav-symbol{color:#7fafee}
.mobile-nav .calculator-shortcut .nav-symbol{color:#2d63ad}
.record-chooser{margin:1rem 0;border:1px solid #d5e1f0;border-radius:14px;background:#f7faff;padding:.8rem 1rem}.record-chooser summary{font-weight:700;color:#174a8b;cursor:pointer}.record-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr));gap:.55rem;padding-top:.8rem}.record-options a{border-radius:10px;background:white;padding:.75rem;color:#174a8b;text-decoration:none;border:1px solid #d5e1f0}
.setup-focus{border-top:5px solid #1c5a9e;padding:1.5rem}.setup-list{padding:0;list-style:none;margin:1rem 0}.setup-list li{display:flex;align-items:center;justify-content:space-between;gap:1rem;border-top:1px solid #d5e1f0;padding:1rem 0}.setup-list h3{font-size:1rem;margin:0}.setup-state{font-weight:700;color:#38614e}.setup-list form{display:inline}.quiet-button{background:none;border:0;text-decoration:underline;color:#365b7f;padding:.6rem;cursor:pointer}
.workflow-actions{display:flex;align-items:center;flex-wrap:wrap;gap:.65rem;margin:1rem 0}.checkin-card{border-left:5px solid #967246;margin:1rem 0}.checkin-card time{font-weight:700}.checkin-card.is-due{border-left-color:#a5472d}.checkin-meta{color:#40556d;line-height:1.65}.checkin-entry{padding:1rem 0;border-bottom:1px solid #d5e1f0}.checkin-entry:last-child{border:0}.checkin-status{font-weight:750;color:#174a8b}.checkin-form textarea{min-height:90px}.checkin-audit{padding-left:1.2rem}.checkin-audit li{padding:.5rem 0}.checkin-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.checkin-grid>*{min-width:0}.handoff-today{margin-top:1rem}.setup-focus a,.checkin-card a{overflow-wrap:anywhere}
.heard-question{border:1px solid #d5e1f0;border-radius:12px;padding:1rem;margin-top:1rem}.heard-question button{white-space:normal}.workflow-actions .primary-btn,.workflow-actions .secondary-btn{white-space:normal;text-align:center}
@media(max-width:980px){.mobile-primary{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:800;background:#fff;border-top:1px solid #c8d8ec;padding:.45rem .4rem calc(.45rem + env(safe-area-inset-bottom));justify-content:space-around;box-shadow:0 -5px 18px #142c4820}.mobile-primary a{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;min-width:0;color:#345370;text-decoration:none;min-height:44px;padding:.25rem;border-radius:10px;font-size:1.2rem}.mobile-primary span{font-size:.76rem;font-weight:750}.mobile-primary a[aria-current]{color:#174a8b;background:#e8f1fd}.main-area{padding-bottom:100px!important}.checkin-grid{grid-template-columns:1fr}.setup-list li{align-items:flex-start;flex-wrap:wrap}.settings-sections{flex-wrap:wrap}.settings-sections a{min-width:0}}

.report-return{margin-bottom:1rem}.report-export .workflow-actions>*{min-height:44px}.food-other-actions{margin-top:.75rem}

/* Controls get their own row: long task text never competes with buttons. */
.routine-layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(280px,1fr);align-items:start;gap:20px}
.routine-layout>*{min-width:0}.routine-readonly{grid-template-columns:minmax(0,1fr)}
.routine-editor>summary{min-height:44px;cursor:pointer;font-size:1.1rem;font-weight:750;color:var(--primary-strong)}
.routine-editor[open]>summary{margin-bottom:18px}.routine-editor form{margin-bottom:0}
.routine-date{display:grid;gap:6px;margin:0}.routine-date label{font-size:.85rem;font-weight:700;color:var(--muted)}
.routine-date input{min-height:44px;width:180px}
.task-row.routine-task{grid-template-columns:5rem minmax(0,1fr);align-items:start;column-gap:16px;row-gap:10px;padding-top:20px;padding-bottom:20px}
.routine-task>.routine-time{grid-column:1;grid-row:1;white-space:nowrap;line-height:1.5;font-size:.94rem;font-variant-numeric:tabular-nums}
.routine-task>.task-content{grid-column:2;grid-row:1;gap:6px;min-width:0;overflow-wrap:anywhere}
.routine-task .task-content>.tag{align-self:flex-start}.routine-task .task-content>strong{font-size:1rem;line-height:1.5}
.routine-task .task-content>small{font-size:.92rem;line-height:1.6;color:#40556d}
.task-row.routine-task>.task-controls{grid-column:2;grid-row:2;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:10px 16px;min-width:0}
.routine-task .completion-status{flex:1 1 11rem;font-size:.85rem;line-height:1.5;overflow-wrap:anywhere}
.routine-task .task-toggle{min-height:44px;min-width:64px;font-size:.9rem;line-height:1.2}
.routine-task .task-more{flex:none;max-width:100%}.task-more>summary{display:flex;align-items:center;min-height:44px;padding:6px 10px;cursor:pointer;color:var(--primary-strong);font-size:.9rem;font-weight:700}
.task-more[open]{flex:1 1 100%}.task-more .record-actions{gap:10px;padding-top:6px}.task-more .record-actions>a{min-height:44px;display:inline-flex;align-items:center}
.routine-plan-link{margin-top:20px;font-size:.9rem}.today-routine{margin-top:20px}
.more-groups.tools-groups{grid-template-columns:repeat(2,minmax(0,1fr))}.more-groups.tools-groups>:last-child{grid-column:auto}.tools-setup-link{margin-top:20px}
.report-actions{min-width:0;max-width:100%;flex:0 1 340px}.report-actions .action-row{justify-content:flex-end;flex-wrap:wrap;gap:10px;margin:0}
.report-save-status{font-size:.85rem;margin:.6rem 0 0;line-height:1.5;color:var(--muted)}
.report-save-status:empty{display:none}.report-actions #reportShareHelp{font-size:.82rem;margin:.5rem 0 0}
@media(max-width:1200px){.routine-layout{grid-template-columns:minmax(0,1fr)}.routine-editor{width:100%}}
@media(max-width:500px){.task-row.routine-task{grid-template-columns:4.5rem minmax(0,1fr);column-gap:10px}.routine-task .completion-status{flex-basis:100%}.report-actions{flex-basis:100%;width:100%}.report-actions .action-row{justify-content:flex-start}}
@media(max-width:650px){.more-groups.tools-groups{grid-template-columns:minmax(0,1fr)}}

.mobile-primary a.calculator-shortcut{background:transparent;color:#174a8b}.mobile-primary a.calculator-shortcut[aria-current]{background:#e8f1fd;color:#174a8b}.mobile-primary a.calculator-shortcut .quick-nav-symbol{color:#2d63ad}.mobile-primary a.calculator-shortcut[aria-current] .quick-nav-symbol{color:#174a8b}
.mobile-primary .quick-nav-symbol{font-size:1.2rem;line-height:1.25}
@media(max-width:400px){.mobile-primary span:not(.quick-nav-symbol){font-size:.7rem}.mobile-primary{gap:2px}}

/* Historical line chart: readable labels and a fixed, unclipped inspection row. */
.history-chart{width:100%;min-width:0;min-height:280px;touch-action:pan-y pinch-zoom;cursor:crosshair;border-radius:10px}
.history-chart svg{display:block;max-width:100%;overflow:visible}
.history-chart:focus-visible{outline:3px solid #79a7df;outline-offset:5px}
.history-chart .chart-axis-label{font-size:12px;fill:#52677e}
.chart-line{fill:none;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}.chart-line.dexcom{stroke:#087f8c}.chart-line.manual{stroke:#3d68b6;stroke-dasharray:6 4}
.chart-sample.dexcom,.chart-selected.dexcom{fill:#087f8c}.chart-sample.manual,.chart-selected.manual{fill:#3d68b6}
.chart-selected{stroke:#fff;stroke-width:2}.chart-cursor{stroke:#617792;stroke-width:1;stroke-dasharray:3 4}
.chart-reading{display:flex;align-items:center;gap:8px 14px;flex-wrap:wrap;min-height:70px;border:1px solid #dce6f3;border-radius:12px;background:#f7faff;padding:12px 14px;margin:12px 0;color:#24405d;font-size:.85rem}
.chart-reading-label{font-weight:700;color:#62758a;font-size:.75rem}.chart-reading time{font-weight:650}.chart-value{display:inline-flex;flex-wrap:wrap;align-items:baseline;gap:5px}.chart-value strong{font-size:1rem}.chart-value.dexcom{color:#087f8c}.chart-value.manual{color:#3d68b6}
.chart-help{font-size:.83rem;line-height:1.6;color:#536b83;margin:14px 0 6px}
.line-key{display:inline-block;vertical-align:middle;width:24px;border-top:3px solid currentColor;margin-right:4px}.line-key.manual{border-top-style:dashed}
.pattern-findings{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:14px;margin:18px 0}.pattern-findings article{padding:16px;border-radius:14px;background:#f4f8fd;border:1px solid #d8e5f3;min-width:0}.pattern-findings h3{font-size:1.05rem;margin:12px 0 8px}.pattern-findings p{font-size:.9rem;line-height:1.6;margin:0}.time-pattern-details{margin:16px 0}.time-pattern-details>summary{padding:10px 0;min-height:44px;cursor:pointer;font-weight:650;color:#174a8b}
@media(max-width:500px){.chart-reading-label{flex-basis:100%}.chart-reading{gap:6px 12px}.chart-value{font-size:.78rem}.chart-value strong{font-size:.92rem}}
