/* Navigation, library and import use the same surface and spacing system. */
:root{--library-width:260px}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:16px;background:#122b49;box-shadow:none;padding:0 20px;border-bottom:1px solid #ffffff1f}
.topbar-start,.topbar-end{display:flex;align-items:center}.topbar-start{flex:1;gap:28px;height:100%;min-width:0}.topbar-end{flex:none;gap:10px}.topbar .brand{display:flex;flex:none;font-size:16px;white-space:nowrap;color:#f0f6ff;text-decoration:none;margin:0}.topbar .brand img{width:30px;height:30px}.main-menu{display:flex;align-items:stretch;gap:4px;height:100%;min-width:0}
.menu-item,.main-menu .record-menu>summary{display:flex;align-items:center;justify-content:center;height:100%;padding:0 15px;background:transparent;border:0;border-bottom:2px solid transparent;border-radius:0;color:#c5d5e9;font:inherit;font-size:12px;font-weight:500;text-decoration:none;cursor:pointer;white-space:nowrap;box-sizing:border-box}
.menu-item:hover,.main-menu .record-menu>summary:hover,.main-menu .record-menu[open]>summary{background:#ffffff09;color:#fff}.menu-item.active{color:#fff;border-bottom-color:#81b9f5;background:#ffffff06}.menu-item:focus-visible,.brand:focus-visible,.main-menu summary:focus-visible{outline:2px solid #81b9f5;outline-offset:-4px}.main-menu .record-menu{align-self:stretch}.main-menu .record-menu>summary span{padding-left:7px}.record-menu-items{padding:6px;border-radius:8px;min-width:200px;top:calc(100% + 1px)}.record-menu-items button,.record-menu-items a{gap:10px;font-weight:500}
.topbar .settings{border:0;background:transparent;width:34px;height:34px;display:grid;place-items:center;border-radius:6px}.topbar .settings:hover{background:#ffffff14}.topbar .viewer-actions .tool.icon{background:transparent;border-color:transparent}.topbar .viewer-actions .tool.icon:hover{background:#ffffff14}
/* Recording identity and analysis belong to the ECG workspace. */
.viewer-head{align-items:flex-start;gap:12px}.record-heading{min-width:0}.record-heading .record-context{max-width:none;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:nowrap;text-align:left;gap:8px;line-height:1.5}.record-heading .record-context>strong{font-size:14px;color:var(--ink);line-height:20px;min-width:0;max-width:40%;flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.record-heading .record-chip{display:block;flex:0 1 auto;min-width:0;color:var(--muted);font-size:11px;line-height:18px;max-width:100%;border:0;background:none;padding:0}.record-heading .lead-map-note{margin-top:3px}.record-heading .date-button{font-size:10px}
.analysis-action{display:inline-flex;align-items:center;justify-content:center;flex:none;width:27px;height:27px;padding:0;border:1px solid var(--line);border-radius:5px;background:var(--surface);color:var(--accent);font-size:19px;cursor:pointer;line-height:1}.analysis-action:hover:enabled{background:var(--accent-soft);border-color:var(--accent)}.analysis-action:disabled{cursor:default;opacity:.5}.analysis-status{flex:none;white-space:nowrap;font-size:10px;line-height:1.5;color:var(--muted)}.analysis-action.running>span{animation:analysis-spin 1.4s linear infinite}.analysis-action.running{opacity:1}.analysis-cancel{background:transparent;border:1px solid var(--line);border-radius:5px;color:var(--muted);width:26px;height:26px;cursor:pointer}.context-time{flex:none;padding-top:2px}
.analysis-action>span{display:block;width:18px;height:18px;flex:none;transform-origin:50% 50%}.analysis-action svg{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.review-counter{gap:4px}.review-counter svg{display:block;width:12px;height:12px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
@keyframes analysis-spin{to{transform:rotate(360deg)}}
.desktop-shell{grid-template-columns:var(--library-width) minmax(0,1fr)}
.recording-library{padding:18px 14px 0;gap:14px;height:calc(100dvh - 56px)}
.library-heading-actions{display:flex;align-items:center;gap:4px}.library-heading-actions #libraryClose{font-size:20px;line-height:1}.library-heading h2{font-size:13px;line-height:1.4}.recording-library input{font-size:12px;padding:10px 11px;border-radius:6px}
.library-import{height:37px;background:#1764b5;border-color:#1764b5;color:#fff;font-size:12px;font-weight:600;cursor:pointer}.library-import:hover{background:#125497}

.library-record .record-patient{font-size:12px;font-weight:500;line-height:1.4;color:var(--ink);overflow-wrap:anywhere}.library-record+.library-record{margin-top:6px}.library-record>button:first-child{padding:11px 8px;gap:5px}.library-record strong{font-size:11px}.library-record small{font-size:10px;line-height:1.5}
.library-record.active{border-color:transparent;box-shadow:inset 3px 0 var(--accent)}.library-record:focus-within .assign-patient,.library-record:focus-within .delete-recording{opacity:1}
.library-record .delete-recording{display:grid;place-items:center;padding:6px;flex:none;border-radius:4px}.delete-recording svg,.patients-trash-button svg{width:16px;height:16px;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}.library-record .delete-recording:hover{background:#bd465012}
.library-bottom{display:grid;grid-template-columns:1fr;gap:10px;padding:12px 0 14px;font-size:10px}.library-bottom #libraryCount{grid-row:2}.library-bottom #layoutReset{justify-self:start;margin:0;font-size:10px;color:var(--muted);padding:2px 0}
.library-bottom .patients-trash-button{margin:0;display:flex;align-items:center;gap:9px;text-align:left;min-height:36px;width:100%;padding:8px 10px;color:var(--ink);font-size:12px;border:1px solid var(--line);border-radius:6px;background:var(--surface-soft);cursor:pointer}.patients-trash-button:hover{border-color:var(--accent)}
.library-resize{position:absolute;right:-5px;top:0;bottom:0;width:10px;z-index:2;cursor:col-resize;touch-action:none;display:flex;align-items:center;justify-content:center}.library-resize:before{content:'';width:3px;height:38px;border-radius:3px;background:var(--line);transition:background .15s}.library-resize:hover:before,.library-resize:focus-visible:before{background:var(--accent)}
/* Supplementary information is a quiet footer row. */
.supplementary{border-radius:3px;box-shadow:none}.supplementary>summary{display:flex;align-items:center;gap:8px;min-height:34px;padding:8px 12px;list-style:none;font-weight:500}.supplementary>summary::-webkit-details-marker{display:none}.supplementary>summary:before{content:'›';font-size:17px;line-height:1}.supplementary[open]>summary:before{transform:rotate(90deg)}.list-footer{border-radius:0;box-shadow:none}
/* Native dialog keeps focus inside the import and leaves the workspace in place. */
dialog.recording-picker{position:fixed;inset:0;margin:auto;width:min(600px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:0;display:none;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);box-shadow:0 24px 90px #06182e40;overflow:auto}
dialog.recording-picker[open]{display:block}.recording-picker::backdrop{background:#07182f80;backdrop-filter:blur(3px)}
.import-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;padding:24px;border-bottom:1px solid var(--line)}.eyebrow{font-size:9px;font-weight:700;letter-spacing:.12em;color:var(--muted)}.import-header h2{font-size:22px;letter-spacing:-.03em;margin:7px 0 8px}.import-header p{margin:0;color:var(--muted);font-size:12px;line-height:1.6}
.recording-picker .picker-close{position:static;flex:none;width:30px;height:30px;border:0;background:var(--surface-soft);font-size:22px;line-height:1;border-radius:6px;color:var(--muted);cursor:pointer}
.import-body{padding:24px;display:flex;flex-direction:column;gap:16px}.recording-picker .file-drop{padding:26px 16px;gap:10px;border:1.5px dashed var(--line);border-radius:8px;background:var(--surface-soft)}.file-drop .import-symbol{display:grid;place-items:center;width:40px;height:40px;border:1px solid var(--line);border-radius:10px;color:var(--accent);font-size:24px;background:var(--surface)}.recording-picker .file-drop strong{font-size:14px;font-weight:600}.recording-picker .file-drop span{color:var(--muted);font-size:11px;line-height:1.5}.recording-picker .file-drop .tool{margin-top:4px;background:var(--surface);color:var(--accent);border-color:var(--line);height:35px;font-size:12px;padding:0 16px}.recording-picker .file-drop.drag-over{background:var(--accent-soft);border-color:var(--accent)}
.import-selection{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:6px;padding:12px}.import-selection>div{min-width:0}.import-selection strong{display:block;font-size:12px;overflow-wrap:anywhere}.import-selection span{display:block;font-size:11px;color:var(--muted);margin-top:4px}
.recording-picker .folder-picker{border-top:1px solid var(--line);padding-top:16px}.folder-picker>summary{cursor:pointer;font-size:12px;color:var(--muted);padding:3px 0}.folder-picker-body{padding-top:8px}.recording-picker .folder-picker p{font-size:11px;line-height:1.6;color:var(--muted)}.recording-picker .folder-picker label{margin:14px 0 6px;font-size:11px;font-weight:500}.recording-picker .folder-controls{gap:6px}.recording-picker .folder-controls input,.recording-picker .folder-controls select{width:100%;background:var(--surface-soft);color:var(--ink);border-color:var(--line);font-size:12px;padding:9px}.recording-picker .folder-controls .tool{height:auto;font-size:11px;padding:7px 10px;white-space:nowrap}
.recording-picker #fileStatus{font-size:12px;color:var(--muted);line-height:1.6;margin:0;overflow-wrap:anywhere}.recording-picker #fileStatus:empty{display:none}
.recording-picker progress{width:100%;height:10px;accent-color:var(--accent)}
.import-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 24px;background:var(--surface-soft);border-top:1px solid var(--line)}.import-footer>span{font-size:10px;color:var(--muted)}.import-footer>div{display:flex;gap:8px}.import-footer .tool{height:36px;padding:0 14px;font-size:12px}.recording-picker .primary{background:#1764b5;border-color:#1764b5;color:#fff}.recording-picker button:disabled{opacity:.5;cursor:default}
.patients-trash{width:min(680px,calc(100vw - 32px))}.patients-trash>header{padding:22px 24px}.patients-trash header p{font-size:12px;color:var(--muted);margin:7px 0 0;line-height:1.6}.trash-content{padding:6px 24px 24px}.trash-content h3{display:flex;align-items:center;gap:8px;margin-top:22px;font-size:12px}.trash-content h3 span{padding:2px 7px;border-radius:10px;background:var(--surface-soft);font-size:10px}.trash-row{padding:14px 0}.trash-row button{color:var(--accent);font-weight:600;white-space:nowrap}.trash-empty{text-align:center;padding:38px 16px}.trash-empty>span{display:block;font-size:32px;color:var(--muted);margin-bottom:12px}.trash-empty h3{display:block;margin:0 0 8px;font-size:15px}.trash-empty p{font-size:12px;color:var(--muted);line-height:1.7;margin:0}.trash-notice:empty{display:none}.trash-notice{font-size:11px;color:var(--accent);padding:10px 0;line-height:1.5}
@media(max-width:700px){.topbar{padding:0 10px;gap:4px}.topbar-start{gap:8px}.topbar-end{gap:2px}.topbar .brand{font-size:0;gap:0}.topbar .brand span{display:none}.topbar .brand img{width:27px;height:27px}.menu-item,.main-menu .record-menu>summary{font-size:11px;padding:0 9px;height:100%}.main-menu{gap:0}.topbar .settings{width:28px}.record-heading .record-context>strong{font-size:13px}.record-heading .record-chip{font-size:10px}.record-heading .record-context{gap:6px}.record-heading .analysis-status{display:none}.viewer-head{flex-wrap:wrap}.viewer-head>.context-time{margin-left:auto;text-align:right;font-size:9px}.recording-library{width:min(320px,calc(100vw - 40px));padding:16px 14px 0}.library-resize{display:none}.import-header{padding:20px}.import-body{padding:18px}.import-footer{padding:14px 18px;gap:10px}.import-footer>span{display:none}.import-footer>div{width:100%;justify-content:flex-end}.import-header h2{font-size:20px}.recording-picker .file-drop{padding:22px 10px}.recording-picker .folder-controls{flex-wrap:wrap}.recording-picker .folder-controls input,.recording-picker .folder-controls select{flex-basis:100%}}
@media(prefers-reduced-motion:reduce){.library-resize:before{transition:none}.analysis-action.running>span{animation:none}}
/* Daily summaries and source metadata are part of the expanded statistics. */

.supplementary>.daily-summary{position:static;margin:0 10px 10px;box-shadow:none;background:var(--surface);border:1px solid var(--line);border-radius:6px;min-width:0;max-height:none;overflow:hidden}.daily-summary .daily-head{padding:16px;border-bottom:1px solid var(--line);background:var(--surface);color:var(--ink)}.daily-summary .daily-head h2{font-size:14px;margin:0 0 5px}.daily-summary .daily-head p{color:var(--muted);font-size:11px;line-height:1.6;margin:0}.daily-summary .daily-content{overflow-x:auto;padding:12px;max-width:100%}.daily-summary .daily-empty{border:0;padding:12px;line-height:1.7}.daily-summary .daily-method{font-size:11px;line-height:1.6}.supplementary-tools{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 10px 10px;border:1px solid var(--line);border-radius:6px;padding:16px;background:var(--surface)}.supplementary-tools h3{font-size:13px;margin:0 0 5px}.supplementary-tools p,.ios-context-explanation{font-size:12px;line-height:1.6;color:var(--muted);margin:0}.supplementary-tools .ios-context-toggle{flex:none}.ios-context-explanation{margin:0 0 20px}
@media(max-width:700px){.supplementary-tools{align-items:flex-start;flex-direction:column}.daily-summary .daily-head{padding:12px}.daily-summary .daily-content{padding:8px}}

/* Shared navigation icons keep all primary actions together on the left. */
.main-menu{overflow-x:auto;scrollbar-width:none}.main-menu::-webkit-scrollbar{display:none}.main-menu .menu-item{flex:none;justify-content:flex-start;gap:8px}.menu-icon{display:block;width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:700px){.main-menu .menu-item{padding:0 7px;gap:5px;font-size:11px}.menu-icon{width:15px;height:15px}}

/* Legend reflects only the series and event markers in the visible overview. */
.overview-head{height:auto;min-height:21px;gap:6px;flex-wrap:wrap;padding-top:3px;padding-bottom:3px}.overview-head h3{flex:none}.overview-head .legend{display:flex;flex-wrap:wrap;align-items:center;gap:5px 10px;margin-left:auto;line-height:1.5}.overview-head .legend span{display:flex;align-items:center;gap:4px}.overview-head .legend i{flex:none;width:7px;height:7px;border-radius:50%;display:block}.overview-head .legend i.trend{width:14px;height:2px;border-radius:1px;background:var(--heart-rate-line)}.overview-head .legend i.normal{background:#087a61}.overview-head .legend i.other{background:#7d918b}.viewer>.overview{display:flex;flex-direction:column;height:auto;min-height:93px}.overview .timeline-wrap{flex:none;height:70px}
