.timeline-card{--timeline-muted:var(--muted, #526b70);background:#fff}
.timeline-heading{padding:20px 28px;border-bottom:0;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:14px}
.timeline-heading-left{min-width:0}
.timeline-heading-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-left:auto}
.timeline-heading .eyebrow{font-size:9px;letter-spacing:1.6px;margin-bottom:8px}
.timeline-heading h2{font-size:21px;letter-spacing:-.5px}
.timeline-heading p{font-size:13px;color:var(--timeline-muted);margin:7px 0 0}
.timeline-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 14px;padding:9px 28px;border-block:1px solid var(--line);background:var(--bg);font-size:11.5px;color:var(--timeline-muted)}
.timeline-toolbar-left{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;flex:1}
.timeline-toolbar-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-left:auto}
.timeline-search-wrap{position:relative;display:flex;align-items:center;width:220px;min-width:140px;flex-shrink:0}
.timeline-search-icon{position:absolute;left:9px;top:50%;transform:translateY(-50%);color:var(--timeline-muted);pointer-events:none;display:flex;align-items:center}
.timeline-search-icon .icon{width:13px;height:13px}
.timeline-search-input{width:100%;height:32px;padding:4px 26px 4px 28px;font-size:var(--font-sm, 12px);border:1px solid var(--line);border-radius:var(--radius-sm, 6px);background:#fff;color:var(--ink);transition:border-color .15s,box-shadow .15s}
.timeline-search-input:focus{border-color:var(--primary);outline:none;box-shadow:0 0 0 3px var(--primary-glow, rgba(8,126,133,0.16))}
.timeline-search-clear{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:17px;height:17px;padding:0;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;border:none;background:var(--line);color:var(--timeline-muted);font-size:11px;font-weight:700;cursor:pointer;line-height:1;transition:background-color .15s,color .15s}
.timeline-search-clear:hover{background:var(--line-strong);color:var(--ink)}
.timeline-search-clear[hidden]{display:none!important}
.timeline-filter-pills{display:inline-flex;align-items:center;gap:3px;background:color-mix(in srgb,var(--tint) 55%,var(--bg));padding:3px;border-radius:var(--radius-sm, 6px);border:1px solid var(--line)}
.timeline-filter-pill{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;font-size:11px;font-weight:500;color:var(--timeline-muted);background:transparent;border:none;border-radius:var(--radius-xs, 4px);cursor:pointer;transition:all .15s ease;line-height:1.3;white-space:nowrap}
.timeline-filter-pill:hover{color:var(--ink);background:rgba(255,255,255,0.6)}
.timeline-filter-pill.active{background:#fff;color:var(--primary-dark);font-weight:700;box-shadow:var(--shadow-sm)}
.timeline-filter-pill .pill-count{font-size:9.5px;font-weight:600;padding:1px 5px;border-radius:var(--radius-pill, 999px);background:rgba(0,0,0,0.05);color:inherit}
.timeline-filter-pill.active .pill-count{background:var(--tint);color:var(--primary)}
.timeline-filter-pill.is-unification-pill.active{color:#6d28d9}
.timeline-filter-pill.is-unification-pill.active .pill-count{background:#ede9fe;color:#6d28d9}
.timeline-sort-btn{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;height:32px;border-radius:var(--radius-sm, 6px);border:1px solid var(--line);background:#fff;color:var(--timeline-muted);font-size:11px;font-weight:500;cursor:pointer;transition:all .15s ease;white-space:nowrap}
.timeline-sort-btn:hover{border-color:var(--primary);color:var(--ink)}
.timeline-sort-btn .icon{width:13px;height:13px}
.timeline-toolbar-count{display:inline-flex;align-items:center;gap:5px;font-size:11px;color:var(--timeline-muted);white-space:nowrap}
.timeline-toolbar-count .icon{width:13px;height:13px}
.timeline-empty-search{padding:36px 20px;text-align:center;background:#fff;border-radius:var(--radius-lg, 12px);margin:16px 24px}
.timeline-empty-icon{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:50%;background:var(--bg);color:var(--timeline-muted);margin-bottom:12px}
.timeline-empty-icon .icon{width:20px;height:20px}
.timeline-empty-search h4{font-size:14px;color:var(--ink);margin:0 0 6px;font-weight:600}
.timeline-empty-search p{font-size:12px;color:var(--timeline-muted);margin:0 0 14px;line-height:1.4}
.timeline-empty-search strong{color:var(--ink)}
.timeline-empty-search .button{font-size:11.5px;padding:5px 12px}
.notes-timeline{padding:14px 20px 20px;background:linear-gradient(135deg,var(--bg),#fff 65%)}
.notes-timeline:before{display:none}
.timeline-day{display:grid;grid-template-columns:125px minmax(0,1fr);gap:16px;margin-bottom:6px}
.timeline-date{display:flex;gap:8px;align-items:flex-start;padding-top:6px}
.timeline-date-icon{color:var(--primary);padding-top:1px}
.timeline-date h3{font-size:11.5px;line-height:1.4;margin:0 0 2px;font-weight:700}
.timeline-date small{font-size:10px;color:var(--timeline-muted)}
.timeline-day-notes{position:relative;padding:0 0 8px 18px;border-left:2px solid var(--line);min-width:0}
.timeline-day:last-child .timeline-day-notes{padding-bottom:0}
.timeline-entry{position:relative;margin:0 0 6px;padding:8px 12px;border:1px solid var(--line);border-radius:var(--radius-md, 8px);background:#fff;box-shadow:0 1px 4px #19383d04;min-width:0;transition:border-color .15s,box-shadow .15s}
.timeline-entry:last-child{margin-bottom:0}
.timeline-entry:hover{transform:none;border-color:color-mix(in srgb,var(--primary) 35%,var(--line));box-shadow:0 3px 10px #19383d08}
.timeline-entry.latest{border-top:2.5px solid var(--primary);padding-top:6px}
.timeline-marker{position:absolute;left:-29px;top:7px;width:22px;height:22px;border:3px solid var(--bg);display:grid;place-items:center;background:var(--line);color:var(--timeline-muted);border-radius:50%;box-shadow:none}
.timeline-marker .icon{width:10px;height:10px;stroke-width:2}
.timeline-entry.latest .timeline-marker{background:var(--primary);color:#fff;box-shadow:0 0 0 1px var(--tint)}
.note-top{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px;margin-bottom:4px}
.note-classification{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0}
.note-kind{font-size:10px;padding:2px 6px;border-radius:var(--radius-xs, 4px);font-weight:600}
.is-addendum .note-kind{background:#f2edfa;color:#705393}
.note-specialty{color:var(--timeline-muted);font-size:11px;white-space:normal;overflow-wrap:anywhere}
.note-timing{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.note-top time{font-size:10.5px;font-variant-numeric:tabular-nums;color:var(--timeline-muted)}
.note-latest{display:inline-flex;align-items:center;gap:4px;color:var(--primary-dark);font-size:9.5px;font-weight:600}
.note-latest:before{content:"";width:4px;height:4px;border-radius:50%;background:var(--primary)}
.note-nom-pill{font-size:9px;padding:1px 5px;border-radius:var(--radius-xs, 4px);background:var(--tint);color:var(--primary-dark);border:1px solid color-mix(in srgb,var(--primary) 24%,var(--line));display:inline-flex;align-items:center;gap:3px;font-weight:600}
.note-nom-pill .icon{width:10px;height:10px}
.note-reference{display:flex;align-items:center;gap:5px;color:#705393;font-size:10px;line-height:1.4;margin:0 0 4px;overflow-wrap:anywhere}
.note-reference .icon{width:11px;height:11px}
.note-summary{overflow-wrap:anywhere}
.note-diagnosis-text{font-size:12.5px;line-height:1.35;margin:3px 0 1px;font-weight:600;color:var(--ink);white-space:pre-wrap;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.note-card-actions{display:inline-flex;align-items:center;gap:5px;margin-left:auto}
.note-card-actions .btn{display:inline-flex!important;align-items:center!important;gap:4px!important;padding:3px 9px!important;height:26px!important;min-height:26px!important;font-size:11px!important;font-weight:600!important;border-radius:var(--radius-sm, 6px)!important;line-height:1!important;box-shadow:0 1px 2px rgba(0,0,0,0.03)!important;cursor:pointer!important;transition:all .15s ease!important;white-space:nowrap!important}
.note-card-actions .btn .icon{width:12px!important;height:12px!important;flex-shrink:0!important}
.note-card-actions .note-addendum-btn{background:#ffffff!important;border:1px solid var(--line)!important;color:var(--ink)!important}
.note-card-actions .note-addendum-btn:hover{background:#f5edf9!important;border-color:#bda5d7!important;color:#6b3b93!important}
.note-card-actions .note-addendum-btn .icon{color:#795299!important}
.note-card-actions .note-view-modal-btn{background:var(--primary)!important;border:1px solid var(--primary)!important;color:#ffffff!important}
.note-card-actions .note-view-modal-btn:hover{background:var(--primary-dark)!important;border-color:var(--primary-dark)!important;box-shadow:0 2px 7px color-mix(in srgb,var(--primary) 28%,transparent)!important}
.note-card-actions .note-view-modal-btn .icon{color:#ffffff!important}
.note-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px;margin-top:5px;padding-top:5px;border-top:1px dashed var(--line)}
.note-author{min-width:0;gap:6px;overflow-wrap:anywhere;display:flex;align-items:center}
.note-author-icon{width:20px;height:20px;flex-basis:20px;border-radius:50%;font-size:9px;display:grid;place-items:center;background:var(--tint);color:var(--primary-dark);font-weight:700}
.note-author strong{font-size:11px}
.note-author small{font-size:9.5px;color:var(--timeline-muted);margin-left:4px}
.note-footer .actions{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.note-footer .link-button{font-size:10.5px;padding:3px 7px;min-height:26px;border-radius:var(--radius-sm, 6px)}
.note-footer .actions .icon{width:12px;height:12px}
.note-read{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;min-height:26px;background:var(--tint);border:1px solid transparent;color:var(--primary-dark);font-size:10.5px;font-weight:600;border-radius:var(--radius-sm, 6px);transition:all .15s}
.note-read:hover{border-color:var(--primary);background:color-mix(in srgb,var(--primary) 12%,#fff)}
.note-view-modal-btn{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;min-height:26px;background:var(--tint);border:1px solid color-mix(in srgb,var(--primary) 30%,transparent);color:var(--primary-dark);font-size:10.5px;font-weight:600;border-radius:var(--radius-sm, 6px);cursor:pointer}
.note-view-modal-btn:hover{background:var(--primary);color:#fff;border-color:var(--primary)}
.note-view-modal-btn .icon{width:12px;height:12px}
.note-addendum-btn{font-size:10.5px;font-weight:600}
.note-read:hover{border-color:var(--primary)}
.patient-appointment-badge{display:inline-flex;align-items:center;gap:4px;margin-top:3px;padding:2px 7px;border-radius:var(--radius-sm, 6px);background:var(--tint);color:var(--primary-dark);border:1px solid color-mix(in srgb,var(--primary) 24%,var(--line));font-size:10.5px;font-weight:600;line-height:1.25;max-width:100%;flex-wrap:wrap;transition:border-color .15s}
.patient-appointment-badge:hover{border-color:var(--primary)}
.patient-appointment-badge .icon{width:11px;height:11px;flex-shrink:0;color:var(--primary)}
.patient-appointment-badge strong{color:var(--primary-dark);font-weight:700}
.patient-appointment-badge .badge-service{opacity:.85;font-weight:500;color:var(--ink)}

.timeline-entry.is-appointment{padding:6px 12px;margin:0 0 6px;border-radius:var(--radius-md, 8px);border:1px solid var(--line);border-left:3.5px solid var(--primary);background:#fff;box-shadow:0 1px 2px rgba(25,56,61,0.03)}
.timeline-entry.is-appointment:hover{border-color:color-mix(in srgb,var(--primary) 35%,var(--line));box-shadow:0 2px 5px rgba(25,56,61,0.06)}
.timeline-entry.is-upcoming-appointment{border-left:3.5px solid var(--success, #10b981);background:linear-gradient(180deg,#f7fcf9 0%,#fff 28px)}
.timeline-entry.is-upcoming-appointment .timeline-marker{background:var(--success, #10b981);color:#fff;box-shadow:0 0 0 2px #d1fae5}
.timeline-entry.is-cancelled-appointment{opacity:.75;border-left:3.5px solid #f87171}
.timeline-entry.is-appointment .timeline-marker{top:7px;width:20px;height:20px}
.timeline-entry.is-appointment .timeline-marker .icon{width:10px;height:10px}

.apt-compact-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;min-height:24px}
.apt-compact-left{display:flex;align-items:center;gap:6px;min-width:0;flex-wrap:wrap}
.apt-compact-title{font-size:12.5px;font-weight:700;color:var(--ink)}
.apt-compact-reason{font-size:11.5px;color:var(--muted);max-width:320px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.apt-compact-clinic{font-size:11px;color:var(--muted);opacity:.85}
.apt-compact-right{display:flex;align-items:center;gap:10px;margin-left:auto;flex-wrap:wrap}
.apt-compact-timing{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:600;color:var(--ink);white-space:nowrap}
.apt-compact-dot{color:var(--success-dark, #059669);font-weight:700;font-size:10.5px}
.apt-compact-sched{font-size:11px;color:var(--muted);background:var(--bg);padding:2px 7px;border-radius:var(--radius-sm, 6px);border:1px solid var(--line);white-space:nowrap;display:inline-flex;align-items:center;gap:4px}
.apt-compact-sched .apt-sched-label{opacity:.75;font-weight:500}
.apt-compact-sched strong{color:var(--ink);font-weight:700}
.timeline-reg-hour{font-size:11px;color:var(--timeline-muted);font-variant-numeric:tabular-nums;font-weight:500;display:block}
@media(max-width:1100px){.timeline-day{grid-template-columns:115px minmax(0,1fr);gap:18px}.notes-timeline{padding:22px}.timeline-entry{padding-inline:16px}}
@media(max-width:760px){.timeline-heading{padding:18px 18px 14px;gap:12px}.timeline-heading-left,.timeline-heading-actions{width:100%;margin-left:0}.timeline-heading h2{font-size:19px}.timeline-toolbar{padding:9px 18px;gap:10px}.timeline-toolbar-left,.timeline-toolbar-right{width:100%;justify-content:space-between;margin-left:0}.timeline-search-wrap{width:100%}.timeline-filter-pills{width:100%;overflow-x:auto;padding:3px}.notes-timeline{padding:18px 16px 22px}.timeline-day{display:block}.timeline-date{padding:0 0 15px;align-items:center}.timeline-date>div{display:flex;align-items:baseline;gap:10px}.timeline-date h3{margin:0}.timeline-day-notes{margin-left:9px;padding-left:21px;padding-bottom:16px}.timeline-marker{left:-37px}.note-top{flex-direction:row;align-items:center}.note-timing{gap:8px}.note-summary h3{font-size:15px}.note-footer{align-items:flex-start;flex-direction:column}.note-footer .actions{width:100%;justify-content:flex-end}.note-footer .actions button{min-height:42px}.note-author strong{font-size:12px}}
@media print{.timeline-heading,.timeline-toolbar{background:white}.notes-timeline{background:white;padding:16px 0}.timeline-day{display:block}.timeline-date{padding-bottom:12px}.timeline-date h3{color:#000}.timeline-entry{box-shadow:none;break-inside:avoid}.note-summary h3,.note-summary p{display:block;overflow:visible;-webkit-line-clamp:unset}.timeline-card{break-inside:auto}.note-timing{color:#000}}


.timeline-entry.is-unification{padding:6px 12px;margin:0 0 6px;border-radius:var(--radius-md, 8px);border:1px solid #e0e7ff;border-left:3.5px solid #7c3aed;background:#faf5ff;box-shadow:0 1px 2px rgba(124,58,237,0.04)}
.timeline-entry.is-unification:hover{border-color:#c4b5fd;box-shadow:0 2px 6px rgba(124,58,237,0.08)}
.timeline-entry.is-unification .timeline-marker{top:7px;width:20px;height:20px;background:#7c3aed;color:#fff;border-color:#ddd6fe}
.timeline-entry.is-unification .timeline-marker .icon{width:10px;height:10px}
