/* Native SVG plot and its HTML labels share a fixed vertical scale. Horizontal
   positions are percentages, so text and touch targets do not shrink on mobile. */
.goal-data-chart {
    --goal-chart-blue: #2563eb;
    color: var(--text-primary, #0f172a);
    min-width: 0;
}

.goal-data-chart-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    border: 1px solid var(--border-light, #f1f5f9);
    border-radius: 10px;
    background: #fcfdff;
}

.goal-data-chart-metrics[hidden] { display: none; }

.goal-data-chart-metric {
    min-width: 0;
    padding: 12px 16px;
}

.goal-data-chart-metric + .goal-data-chart-metric {
    border-left: 1px solid var(--border-light, #f1f5f9);
}

.goal-data-chart-metric dt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 16px;
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.goal-data-chart-metric dd {
    margin: 3px 0 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.goal-data-chart-body {
    position: relative;
    display: grid;
    grid-template-columns: minmax(26px, max-content) minmax(0, 1fr);
    column-gap: 9px;
    padding-top: 28px;
    padding-bottom: 26px;
    margin: 0 0 2px;
}

.goal-data-chart-plot,
.goal-data-chart-x-axis {
    position: relative;
    grid-column: 2;
    min-width: 0;
    margin-right: 14px;
}

.goal-data-chart-plot {
    grid-row: 1;
    height: 168px;
    isolation: isolate;
}

.goal-data-chart-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.goal-data-chart-svg line,
.goal-data-chart-svg path {
    vector-effect: non-scaling-stroke;
}

.goal-data-chart-grid {
    stroke: #edf0f5;
    stroke-width: 1;
}

/* Fallback only: the chart script paints this area with its own fading tint. */
.goal-data-chart-area {
    fill: rgb(37 99 235 / 6%);
}

.goal-data-chart-line {
    fill: none;
    stroke: var(--goal-chart-blue);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.goal-data-chart-baseline {
    stroke: #b8c2d1;
    stroke-width: 1;
}

.goal-data-chart-target {
    stroke: #7b8799;
    stroke-width: 1;
    stroke-dasharray: 3 5;
}

.goal-data-chart-reference-label {
    position: absolute;
    right: 2px;
    max-width: 100%;
    padding: 0 3px;
    background: rgb(255 255 255 / 88%);
    color: #64748b;
    font-size: 10px;
    line-height: 16px;
    white-space: nowrap;
    pointer-events: none;
}

.goal-data-chart-reference-label[hidden] { display: none; }

.goal-data-chart-y-axis {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    height: 168px;
}

.goal-data-chart-y-axis span {
    grid-area: 1 / 1;
    position: relative;
    align-self: start;
    justify-self: end;
    transform: translateY(-50%);
    font-size: 10px;
    color: #64748b;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.goal-data-chart-x-axis span {
    position: absolute;
    top: 12px;
    transform: translateX(-50%);
    font-size: 10px;
    color: #64748b;
    line-height: 1.2;
    white-space: nowrap;
}

.goal-data-chart-x-axis span[data-edge="start"] { transform: none; }
.goal-data-chart-x-axis span[data-edge="end"] { transform: translateX(-100%); }

.goal-data-chart-point {
    position: absolute;
    z-index: 1;
    width: 28px;
    height: 28px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    transform: translate(-50%, -50%);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.goal-data-chart-point::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border: 1.5px solid #fff;
    border-radius: 50%;
    background: var(--goal-chart-blue);
}

.goal-data-chart-point:hover::after,
.goal-data-chart-point:focus-visible::after,
.goal-data-chart-point[data-selected="true"]::after {
    width: 9px;
    height: 9px;
    box-shadow: 0 0 0 4px rgb(37 99 235 / 13%);
}

.goal-data-chart-point:focus-visible {
    outline: 2px solid var(--goal-chart-blue);
    outline-offset: 1px;
    z-index: 3;
}

.goal-data-chart-tooltip {
    position: absolute;
    z-index: 4;
    width: max-content;
    max-width: min(240px, 100%);
    padding: 7px 10px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 7px;
    background: #fff;
    color: #334155;
    box-shadow: 0 3px 10px rgb(15 23 42 / 8%);
    font-size: 11px;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    overflow-wrap: anywhere;
}

.goal-data-chart-tooltip[data-align="center"] { transform: translateX(-50%); }
.goal-data-chart-tooltip[hidden] { display: none; }

.goal-data-metric-help { display: inline-flex; }
.goal-data-metric-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8792a2;
    cursor: help;
}
.goal-data-metric-info svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; }
.goal-data-metric-info:hover { color: #64748b; }
.goal-data-metric-info:focus-visible { outline: 2px solid var(--goal-chart-blue); outline-offset: 2px; }
.goal-data-metric-tooltip {
    bottom: calc(100% + 6px);
    left: 0;
    max-width: 220px;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 120ms ease, visibility 120ms ease;
}
/* The last statistic sits at the right edge, so its explanation opens leftward */
.goal-data-chart-metric:last-child .goal-data-metric-tooltip { left: auto; right: 0; }
.goal-data-metric-tooltip[data-open="true"] { opacity: 1; visibility: visible; pointer-events: auto; }
.goal-data-metric-tooltip::before { content: ''; position: absolute; bottom: -7px; height: 7px; left: 0; right: 0; }
@media (prefers-reduced-motion: reduce) { .goal-data-metric-tooltip { transition: none; } }

.goal-data-chart-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    .goal-data-chart-metric { padding: 10px; }
    .goal-data-chart-metric dd { font-size: 15px; }
    .goal-data-chart-reference-label { font-size: 9px; }
}

@media (pointer: coarse) {
    .goal-data-chart-point { width: 44px; height: 44px; }
}

@media (forced-colors: active) {
    .goal-data-chart-line,
    .goal-data-chart-target,
    .goal-data-chart-baseline { stroke: CanvasText; }
    .goal-data-chart-point::after { background: ButtonText; border-color: Canvas; }
    .goal-data-chart-point:focus-visible { outline-color: Highlight; }
    .goal-data-chart-point[data-selected="true"] { outline: 1px solid Highlight; }
}

/* Goal cards use the note's existing editing controls and quiet row actions. */
/* Data uses the shared note toolbar and compact, directly editable point rows. */
#workspace-data-tools {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    max-width: 100%;
    gap: 6px;
}
#workspace-data-tools[hidden] { display: none; }
#session-note-tools:not([data-workspace-view="goals"]) #workspace-data-tools { display: none; }
#timeline-view #workspace-data-tools .goal-data-edit-goals { font-size: 13px; }
#workspace-data-tools :is(#goal-data-export-pdf, #goal-data-refresh):disabled { opacity: 0.55; cursor: default; }
#goal-data-refresh-label .goal-data-refresh-date { font-weight: 600; }
/* While the app reads notes, Find more data says "Filling in data…" in its
   own footprint, like Superbill's Drafting. The label stays underneath and
   holds the size, so nothing moves. Its sheen is .workspace-inline-shimmer. */
#goal-data-refresh.goal-data-filling { color: var(--primary); border-color: #bfd3ff; }
#workspace-data-tools #goal-data-refresh.goal-data-filling:disabled { opacity: 1; }
#goal-data-refresh.goal-data-filling > :not(.goal-data-filling-status, .goal-data-found-message) { visibility: hidden; }
.goal-data-filling-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: inherit;
    white-space: nowrap;
    pointer-events: none;
}
/* A redrawn button resumes its sheen; goal-results.js sets the delay. */
#goal-data-refresh.goal-data-filling::after { animation-delay: inherit; }
/* Then it names the outcome for a moment ("✓ Found 2", "✓ Data filled in"),
   like Copy's "✓ Copied". It replaces "Filling in data…" at once and fades
   back to the label. 2200ms matches FOUND_MESSAGE_MS in goal-results.js. */
#goal-data-refresh.goal-data-found { position: relative; }
#goal-data-refresh.goal-data-found > :not(.goal-data-found-message) { opacity: 0; animation: goal-data-found-hide 2200ms ease both; }
.goal-data-found-message {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
    pointer-events: none;
    animation: goal-data-found-show 2200ms ease both;
}
@keyframes goal-data-found-show { 0%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes goal-data-found-hide { 0%, 92% { opacity: 0; } 100% { opacity: 1; } }
.goal-data-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }

/* This visit's cue count, top right of the Data toolbar. It reads like the
   header's cue summary (quiet, dotted underline) and opens the cue editor. */
#workspace-cue-link { display: none; }
#session-note-tools[data-workspace-view="goals"] #workspace-cue-link {
    display: inline-block;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: underline dotted;
    text-underline-offset: 2px;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease;
}
#workspace-cue-link:hover { color: var(--primary); }
#workspace-cue-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

/* Cue editor: one row per cue type. The total sits under the counts. */
#cue-count-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.cue-type-row,
.cue-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-primary);
}
.cue-type-row { padding: 5px 0; }
.cue-stepper { display: flex; align-items: center; gap: 6px; }
.cue-step {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-solid);
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.cue-step:hover:not(:disabled) { background: var(--surface-hover); color: var(--text-primary); }
.cue-stepper input {
    width: 56px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-solid);
    color: var(--text-primary);
    font: inherit;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}
.cue-stepper input::-webkit-outer-spin-button,
.cue-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cue-stepper input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
#cue-count-fields:disabled { opacity: 0.6; }
.cue-total-row {
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-weight: 600;
}
/* As wide as a stepper (30 + 6 + 56 + 6 + 30) so the total centers under the counts */
#cue-total-value { width: 128px; text-align: center; font-variant-numeric: tabular-nums; }
#cue-edit-modal .modal-button { justify-content: center; }
.goal-data-activity:empty { display: none; }
.goal-data-activity:not(.sr-only) { margin-bottom: 12px; font-size: 12px; }
.goal-data-card {
    container: goal-card / inline-size;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e8ecf2;
    border-radius: 14px;
    background: #fff;
}
.goal-data-heading {
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f2f5;
}
.goal-data-heading-top { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.goal-data-title-group { min-width: 0; }
.goal-data-heading .goal-data-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
    color: #1d2939;
    overflow-wrap: anywhere;
}
.goal-data-due { display: block; margin-top: 5px; font-size: 11px; line-height: 1.5; color: #98a2b3; }
.goal-data-heading .goal-result-source {
    min-height: 0;
    margin: 14px 0 0;
    padding: 0;
    border: 0;
    font-size: 13px;
    line-height: 1.65;
    font-weight: 400;
    color: #667085;
    overflow-wrap: anywhere;
}
.goal-data-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: auto; }
.goal-data-actions .goal-data-edit { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 92px; padding: 5px 8px; min-height: 30px; border-radius: 999px; font-size: 12px; transition: background-color 220ms cubic-bezier(0.22, 1, 0.36, 1), color 220ms cubic-bezier(0.22, 1, 0.36, 1); }
/* While a goal is open, Done is a filled pill so closing the editor is hard to miss.
   Same box as Edit Goal (no border), so nothing around it moves. */
.goal-data-actions .goal-data-edit[aria-expanded="true"] { background: var(--primary); color: #fff; font-weight: 600; }
.goal-data-actions .goal-data-edit[aria-expanded="true"]:hover:not(:disabled) { background: var(--primary-dark); color: #fff; }
.goal-data-actions .goal-data-edit[aria-expanded="true"]:active:not(:disabled) { background: var(--primary-pressed); }
.goal-data-edit-chevron { flex: none; width: 5px; height: 5px; border-right: 1.25px solid currentColor; border-bottom: 1.25px solid currentColor; transform: translateY(-1px) rotate(45deg); transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1); }
.goal-data-edit[aria-expanded="true"] .goal-data-edit-chevron { transform: translateY(1px) rotate(225deg); }
.goal-data-actions .goal-results-action { width: 30px; padding: 5px; }
.goal-data-details { position: relative; }
.goal-data-heading[data-transitioning] { overflow: hidden; overflow-anchor: none; }
.goal-data-goal-editor[hidden] { display: none; }
.goal-data-description, .goal-data-goal-editor { width: 100%; overflow-anchor: none; }
.goal-data-description { position: relative; opacity: 1; transition: opacity 140ms ease 70ms; }
.goal-data-goal-editor { position: absolute; inset: 0 0 auto; opacity: 0; pointer-events: none; transition: opacity 70ms ease; }
.goal-data-description-content, .goal-data-editor-content { display: flow-root; }
.goal-data-editor-fields { padding-top: 14px; }
.goal-data-heading[data-editing="true"] .goal-data-description { position: absolute; inset: 0 0 auto; opacity: 0; pointer-events: none; transition: opacity 70ms ease; }
.goal-data-heading[data-editing="true"] .goal-data-goal-editor { position: relative; opacity: 1; pointer-events: auto; transition: opacity 140ms ease 70ms; }
.goal-data-goal-editor .context-goal-row { padding: 0; border: 0; }
@media (prefers-reduced-motion: reduce) {
    .goal-data-description, .goal-data-goal-editor, .goal-data-edit-chevron, .goal-data-actions .goal-data-edit,
    .goal-data-heading[data-editing] :is(.goal-data-description, .goal-data-goal-editor) { transition: none; }
}
.goal-data-points-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 16px 0 4px;
    min-height: 32px;
}
.goal-data-points-heading button i { font-size: 10px; margin-right: 6px; }
.goal-data-points-heading > span {
    flex: 1;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
    color: #98a2b3;
}
.goal-data-points-heading .patient-context-text-button { font-size: 12px; }
.goal-data-copy-selected { white-space: nowrap; }
.goal-data-delete-selected { color: #b42318; white-space: nowrap; }
.goal-data-copy-selected[hidden], .goal-data-delete-selected[hidden] { display: none; }
.goal-data-checkbox {
    position: relative;
    flex: 0 0 24px;
    width: 24px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}
.goal-data-checkbox::before {
    content: '';
    position: absolute;
    inset: 9px 5px;
    border: 1px solid #c3cbd7;
    border-radius: 4px;
    background: #fff;
    transition: background 100ms ease, border-color 100ms ease;
}
.goal-data-checkbox[aria-checked="true"]::before,
.goal-data-checkbox[aria-checked="mixed"]::before { background: #3478f6; border-color: #3478f6; }
.goal-data-checkbox[aria-checked="true"]::after {
    content: '';
    position: absolute;
    box-sizing: border-box;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translate(-50%, -70%) rotate(45deg);
}
.goal-data-checkbox[aria-checked="mixed"]::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    border-top: 1.5px solid currentColor;
    transform: translate(-50%, -50%);
}
.goal-data-checkbox:focus-visible { outline: 2px solid #3478f6; outline-offset: 1px; }
.goal-data-checkbox:hover:not(:disabled)::before { border-color: #3478f6; }
.goal-data-checkbox:disabled { opacity: .4; cursor: default; }
.goal-data-point-selected { background: #f3f7ff; border-radius: 7px; }
.goal-data-points {
    min-width: 0;
    padding-inline: 2px;
    margin-inline: -2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}
.goal-data-points[data-transitioning] { overflow-y: hidden; overflow-anchor: none; }
.goal-data-point {
    display: grid;
    grid-template-columns: 24px 126px minmax(0, 1fr) 28px;
    align-items: start;
    gap: 0 10px;
    padding: 10px 0;
    min-width: 554px;
    min-height: 56px;
    border-bottom: 1px solid #f0f2f5;
    position: relative;
}
.goal-data-date { min-width: 0; }
.goal-data-entry { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; align-content: start; gap: 10px; }
.goal-data-point-numeric .goal-data-entry { grid-template-columns: 118px minmax(0, 1fr); }
.goal-data-measurement { display: flex; gap: 4px; align-items: center; min-height: 36px; flex-wrap: nowrap; }
.goal-data-number, .goal-data-date-input {
    min-width: 0;
    height: 36px;
    margin: 0;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #344054;
    font: inherit;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    box-shadow: none;
}
.goal-data-number { width: 60px; text-align: right; font-size: 13px; font-weight: 500; }
.goal-data-number::placeholder { color: #98a2b3; font-size: 12px; font-weight: 400; }
.goal-data-date-input { width: 100%; }
.goal-data-number:hover:not([readonly]):not(:disabled), .goal-data-date-input:hover:not([readonly]):not(:disabled) { background: #f8fafc; }
.goal-data-number:focus, .goal-data-date-input:focus { border-color: #3478f6; outline: 1px solid #3478f6; }
.goal-data-number[aria-invalid="true"], .goal-data-date-input[aria-invalid="true"] { border-color: #b42318; }
.goal-data-unit { font-size: 11px; color: #667085; }
.goal-data-ratio { white-space: nowrap; font-size: 11px; line-height: 14px; color: #98a2b3; margin-left: 4px; }
.goal-data-no-measurement { color: #98a2b3; }
.goal-data-note { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 28px; gap: 4px; align-items: start; }
.goal-data-entry .goal-result-field { height: 36px; min-height: 36px; transition: height .18s ease; }
/* Preserve the complete observation in one native editor. Expanding it changes
   only the reading space, never the stored text or the current draft. */
.goal-data-entry .goal-result-field::after { content: none; display: none; }
.goal-data-entry .goal-result-inline-input { padding: 0 8px; margin: 0; font-size: 13px; line-height: 34px; }
.goal-data-entry .goal-result-inline-input {
    width: 100%;
    height: 36px;
    min-height: 36px;
    max-height: none;
    border-color: transparent;
    border-radius: 7px;
    white-space: pre;
    overflow-wrap: normal;
    overflow: auto;
    scrollbar-width: none;
    transition: height .18s ease;
}
.goal-data-point-expanded .goal-result-field,
.goal-data-point-expanded .goal-result-inline-input { height: 92px; }
.goal-data-point-expanded .goal-result-inline-input { padding: 7px 8px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-width: thin; }
.goal-data-entry .goal-result-inline-input::-webkit-scrollbar { display: none; }
.goal-data-point-expanded .goal-result-inline-input::-webkit-scrollbar { display: block; width: 4px; }
.goal-data-point-expanded .goal-result-inline-input::-webkit-scrollbar-thumb { background: #d0d5dd; border-radius: 4px; }
.goal-data-entry .goal-result-inline-input:hover:not(:focus):not([aria-disabled="true"]):not(:disabled) { border-color: transparent; background: #f8fafc; }
.goal-data-entry .goal-result-inline-input:focus { border-color: #3478f6; }
.goal-data-entry .goal-result-inline-input::placeholder { font-size: 12px; }
.goal-data-point .goal-result-actions { margin: 0; min-height: 36px; align-self: start; flex-wrap: wrap; }
.goal-data-note-toggle,
.goal-data-point [data-goal-action="point-menu"] { width: 28px; height: 36px; padding: 5px; color: #98a2b3; }
.goal-data-note-toggle { transform: translateX(6px); }
.goal-data-note-toggle i { font-size: 10px; transition: transform .18s ease; }
.goal-data-note-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
/* An observation read from a note names that note under the open box, in line with its text. */
.goal-data-source {
    display: none;
    grid-column: 1;
    justify-self: start;
    align-items: center;
    gap: 5px;
    margin: 0 0 0 9px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: none;
    color: #98a2b3;
    font: inherit;
    font-size: 11px;
    line-height: 16px;
    white-space: nowrap;
    cursor: pointer;
}
.goal-data-point-expanded .goal-data-source { display: inline-flex; }
.goal-data-source i { font-size: 10px; }
.goal-data-source:hover:not(:disabled) { color: #3478f6; }
.goal-data-source:focus-visible { outline: 2px solid #3478f6; outline-offset: 2px; }
.goal-data-source:disabled { cursor: default; }
.goal-data-point-menu {
    position: fixed;
    inset: auto;
    z-index: 10000;
    margin: 0;
    min-width: 132px;
    padding: 4px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 20px #1018281a;
}
.goal-data-point-menu[hidden] { display: none; }
.goal-data-menu-item { display: block; width: 100%; border: 0; border-radius: 6px; padding: 8px 10px; background: transparent; color: #344054; text-align: left; font: inherit; font-size: 12px; cursor: pointer; }
.goal-data-menu-item:hover:not(:disabled), .goal-data-menu-item:focus-visible { background: #f3f6fb; }
.goal-data-menu-delete { color: #b42318; }
.goal-data-menu-item:disabled { opacity: .4; cursor: default; }
/* A thin, in-place saving line leaves the entry itself readable and stable. */
.goal-data-point-saving::after {
    content: '';
    position: absolute;
    height: 2px;
    bottom: -1px;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, #93b7ff, transparent);
    background-size: 200% 100%;
    animation: goal-point-save 1.4s linear infinite;
    pointer-events: none;
}
@keyframes goal-point-save { from { background-position: 200% 0; } to { background-position: -200% 0; } }
/* A point Find more data added or changed takes a soft tint once it is on
   screen, then fades back to the row's own background. 2000ms matches
   FOUND_POINT_MS in goal-results.js. */
.goal-data-point-found { border-radius: 7px; animation: goal-data-point-found 2000ms ease-in-out; }
@keyframes goal-data-point-found { 8%, 30% { background-color: rgb(51 116 230 / 12%); } }
.goal-data-point-error .goal-result-actions { grid-column: 1 / -1; width: 100%; }
.goal-data-point-error .goal-result-inline-status { white-space: normal; flex-basis: 100%; }
.patient-context-text-button.goal-data-show-more {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    margin-top: 8px;
    color: var(--text-secondary);
}
.patient-context-text-button.goal-data-show-more:hover:not(:disabled) { color: #475467; }
.goal-data-show-more::after {
    content: '';
    flex: none;
    width: 5px;
    height: 5px;
    border-right: 1.25px solid currentColor;
    border-bottom: 1.25px solid currentColor;
    transform: translateY(-1px) rotate(45deg);
}
.goal-data-show-more[data-goal-action="show-less"]::after { transform: translateY(1px) rotate(225deg); }
.goal-data-point-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.goal-data-history-error { margin-top: 8px; color: #b42318; font-size: 12px; }
.goal-data-empty { color: #98a2b3; font-size: 12px; margin: 8px 0 0; }
/* Past goals: archived goals in one closed section below the active goals,
   quieter than an active card, read-only apart from Restore. */
.goal-data-past { margin: 4px 0 20px; }
.goal-data-past-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    color: #475467;
    cursor: pointer;
    list-style: none;
}
.goal-data-past-summary::-webkit-details-marker { display: none; }
.goal-data-past-summary::after {
    content: '';
    flex: none;
    width: 5px;
    height: 5px;
    border-right: 1.25px solid currentColor;
    border-bottom: 1.25px solid currentColor;
    transform: translateY(-1px) rotate(45deg);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.goal-data-past[open] > .goal-data-past-summary { margin-bottom: 12px; }
.goal-data-past[open] > .goal-data-past-summary::after { transform: translateY(1px) rotate(225deg); }
.goal-data-past-summary:hover { color: #1d2939; }
.goal-data-past-summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.goal-data-past-card { background: #fcfcfd; }
.goal-data-past-card .goal-data-title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; color: #475467; overflow-wrap: anywhere; }
.goal-data-past-card .goal-result-source { min-height: 0; margin: 10px 0 0; padding: 0; border: 0; font-size: 13px; line-height: 1.65; color: #667085; overflow-wrap: anywhere; }
.goal-data-past-card > .goal-data-chart { margin-top: 16px; }
.goal-data-restore { flex-shrink: 0; margin-left: auto; font-weight: 600; }
.goal-data-past-points { max-height: 240px; margin: 16px 0 0; padding: 0; overflow-y: auto; list-style: none; border-top: 1px solid #f0f2f5; }
.goal-data-past-point { display: flex; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f0f2f5; font-size: 13px; line-height: 1.5; }
.goal-data-past-date { flex: none; width: 92px; color: #98a2b3; font-variant-numeric: tabular-nums; }
.goal-data-past-value { flex: none; font-weight: 600; color: #1d2939; font-variant-numeric: tabular-nums; white-space: nowrap; }
.goal-data-past-note { flex: 1; min-width: 0; color: #475467; overflow-wrap: anywhere; }
.goal-data-past-note:empty { display: none; }
.goal-data-past-note-empty { color: #98a2b3; }
@media (prefers-reduced-motion: reduce) { .goal-data-past-summary::after { transition: none; } }
@media (max-width: 600px) { .goal-data-card { padding: 14px; } }
/* Adapt to the actual note width, including an open agent and session list. */
@container goal-card (max-width: 640px) {
    .goal-data-heading-top { gap: 8px; }
    .goal-data-heading .goal-data-title { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
    .goal-data-checkbox::before { transition: none; }
    .goal-data-point .goal-result-actions button { transition: none; }
    .goal-data-entry .goal-result-field, .goal-data-entry .goal-result-inline-input, .goal-data-note-toggle i { transition: none; }
    .goal-data-point-saving::after { animation: none; background: #bdd2fa; }
    /* The result shows, and the tint holds, without fading; the timers end them. */
    #goal-data-refresh.goal-data-found > :not(.goal-data-found-message), .goal-data-found-message, .goal-data-point-found { animation: none; }
    .goal-data-point-found { background-color: rgb(51 116 230 / 12%); }
}
/* History can fill in around existing points without inserting a loading row. */
.goal-data-points-heading > .goal-data-points-label { display: inline-block; }
.goal-data-points-heading > .goal-data-points-loading { color: #3478f6; }
/* While the tab fills in data, every card shows it wherever the page is
   scrolled: a soft band of light passes behind its Baseline / Current /
   Target box and its data points, then rests. The box and the rows share one
   width, so the band lines up down the card, and the text stays crisp above
   it. The shared white sheen is nearly invisible on these white surfaces, so
   it steps aside here. The sweep is timed on the panel, which stays in place
   when the tab redraws every few seconds while it waits, so it never restarts. */
@property --goal-data-sheen {
    syntax: '<percentage>';
    inherits: true;
    initial-value: -100%;
}
.workspace-goals-panel:has(.goal-data-points-loading) { animation: goal-data-loading-sheen 2s linear infinite; }
@keyframes goal-data-loading-sheen { from { --goal-data-sheen: -100%; } 70%, to { --goal-data-sheen: 200%; } }
.goal-data-card:has(.goal-data-points-loading) :is(.goal-data-chart-metrics, .goal-data-point) {
    background-image: linear-gradient(90deg, transparent, rgb(52 120 246 / 7%) 30%, rgb(52 120 246 / 16%) 50%, rgb(52 120 246 / 7%) 70%, transparent);
    background-position: var(--goal-data-sheen) 0;
    background-size: 50% 100%;
    background-repeat: no-repeat;
}
.goal-data-card:has(.goal-data-points-loading) :is(.goal-data-chart, .goal-result-value).workspace-inline-shimmer::after { content: none; }
@media (prefers-reduced-motion: reduce) {
    .workspace-goals-panel:has(.goal-data-points-loading) { animation: none; }
    .goal-data-card:has(.goal-data-points-loading) :is(.goal-data-chart-metrics, .goal-data-point) {
        background-image: linear-gradient(rgb(52 120 246 / 5%) 0 0);
        background-size: auto;
    }
}
