/* Shared note viewer styles (web port of the iOS SummaryFileView).
   Used by /visits/ (via desktop.css) and by /sample-notes/. Self-contained:
   every variable has a fallback so the file can be linked on any page. */
@keyframes sfv-rise { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

.sfv {
    --sfv-navy: #011c94;
    --sfv-green: #02ff42;
    --sfv-purple: #9C27B0;
    margin-top: 28px;
    scroll-margin-top: 96px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", var(--font, "Geist", sans-serif);
    color: #000;
    animation: sfv-rise .45s var(--ease, cubic-bezier(.2, .7, .2, 1));
}
.sfv-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 44px;
}
.sfv-nav { font-size: 17px; font-weight: 600; }
.sfv-save {
    position: absolute;
    right: 4px;
    font-size: 13px;
    color: rgba(60, 60, 67, .6);
}
.sfv-save.error { color: #b42318; }
.sfv-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 8px 16px;
}
.sfv-patient {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--sfv-navy);
    letter-spacing: .01em;
}
.sfv-refresh {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-right: 2px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--sfv-navy);
    cursor: pointer;
}
.sfv-refresh:hover { background: rgba(1, 28, 148, .08); }
.sfv-refresh:disabled { cursor: default; }
.sfv-refresh.spin svg { animation: sfv-spin .8s linear infinite; }
@keyframes sfv-spin { to { transform: rotate(-360deg); } }
.sfv-divider {
    height: 2px;
    margin: 4px 0;
    background: linear-gradient(90deg, var(--sfv-navy), var(--sfv-green));
}
.sfv-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 20px 4px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(128, 128, 128, .08);
    font-size: 12px;
    color: rgba(60, 60, 67, .6);
    cursor: pointer;
}
.sfv-toggle-label { display: inline-flex; align-items: center; gap: 6px; flex: 1; }
.sfv-toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.sfv-switch {
    width: 41px;
    height: 25px;
    border-radius: 999px;
    background: rgba(120, 120, 128, .16);
    position: relative;
    transition: background .2s;
}
.sfv-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    transition: transform .2s var(--ease, cubic-bezier(.2, .7, .2, 1));
}
.sfv-toggle-row input:checked + .sfv-switch { background: #34c759; }
.sfv-toggle-row input:checked + .sfv-switch::after { transform: translateX(16px); }
.sfv-card {
    position: relative;
    margin: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: 15px;
    background: rgba(128, 128, 128, .1);
}
.sfv-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 15px;
    padding: 2px;
    background: linear-gradient(90deg, var(--sfv-navy), var(--sfv-green));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.sfv-row {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    margin: 0 -8px;
    border-radius: 10px;
    transition: background .2s;
}
.sfv-row:hover { background: rgba(1, 28, 148, .04); }
.sfv-row.editing { background: #fff; box-shadow: 0 0 0 2px rgba(1, 28, 148, .25); }
.sfv-label {
    font-size: 17px;
    font-weight: 600;
    color: var(--sfv-navy);
}
.sfv-value { display: flex; align-items: flex-start; gap: 8px; }
.sfv-bullet { color: var(--sfv-navy); font-size: 17px; line-height: 22px; }
.sfv-text {
    flex: 1;
    font-size: 17px;
    line-height: 22px;
    white-space: pre-wrap;
    outline: none;
    cursor: text;
    min-height: 22px;
}
.sfv-pill {
    display: inline-flex;
    align-items: center;
    margin: 0 2px;
    padding: 1px 9px;
    border: 1px solid var(--sfv-navy);
    border-radius: 999px;
    background: #fff;
    color: var(--sfv-navy);
    font: inherit;
    font-size: 15px;
    line-height: 20px;
    cursor: pointer;
    vertical-align: baseline;
}
.sfv-pill.empty {
    border-style: dashed;
    color: #6b7280;
}
.sfv-pill.starred { background: rgba(1, 28, 148, .08); }
.sfv-prose { outline: none; border-radius: 4px; }
.sfv-prose:focus { background: rgba(1, 28, 148, .08); }
.sfv-picker {
    position: absolute;
    z-index: 4;
    left: 28px;
    top: calc(100% - 8px);
    width: min(320px, calc(100% - 36px));
    max-height: 280px;
    overflow: auto;
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}
.sfv-picker-title { font-weight: 700; color: var(--sfv-navy); }
.sfv-picker-hint { margin: 4px 0 8px; color: #6b7280; font-size: 13px; }
.sfv-options { display: flex; flex-wrap: wrap; gap: 6px; }
.sfv-options.teeth { display: grid; grid-template-columns: repeat(8, 1fr); }
.sfv-option {
    border: 1px solid rgba(1, 28, 148, .35);
    border-radius: 999px;
    background: #fff;
    color: var(--sfv-navy);
    padding: 4px 10px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.sfv-options.teeth .sfv-option { padding: 6px 0; border-radius: 8px; }
.sfv-option-row { display: flex; align-items: center; gap: 4px; max-width: 100%; }
.sfv-option-row .sfv-option { flex: 1; text-align: left; }
.sfv-star {
    flex: none;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #c4c4c4;
    font-size: 16px;
    cursor: pointer;
}
.sfv-star.on { color: #e0a100; }
.sfv-picker-star {
    display: block;
    width: 100%;
    margin-top: 8px;
    border: 0;
    background: transparent;
    color: var(--sfv-navy);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.sfv-option.on { background: var(--sfv-navy); color: #fff; }
.sfv-option.star:not(.on) { background: rgba(1, 28, 148, .08); }
.sfv-custom {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    color: #6b7280;
    font-size: 13px;
}
.sfv-custom input {
    border: 1px solid rgba(1, 28, 148, .35);
    border-radius: 8px;
    padding: 6px 8px;
    font: inherit;
    font-size: 15px;
    color: var(--sfv-ink, #1d1d1f);
}
.sfv-picker-done {
    margin-top: 10px;
    border: 0;
    border-radius: 999px;
    padding: 6px 14px;
    background: var(--sfv-navy);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.sfv-undo {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 6px;
}
.sfv-undo button {
    border: 0;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--sfv-navy);
    box-shadow: 0 4px 10px -4px rgba(1, 28, 148, .5);
}
.sfv-undo button:disabled { background: rgba(120, 120, 128, .35); box-shadow: none; cursor: default; }
.sfv-signature-row { display: flex; justify-content: flex-end; padding-top: 20px; }
.sfv-signature {
    border: 0;
    background: transparent;
    font-family: "Pacifico", cursive;
    font-size: 26px;
    font-weight: 400;
    color: #8e8e93;
    padding: 0 4px;
    transition: color .25s;
}
.sfv-signature.signed { color: var(--sfv-navy); }
.sfv-info {
    margin: 4px 32px 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--line, rgba(0, 0, 0, .08));
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    color: rgba(60, 60, 67, .7);
}
.sfv-info strong { color: #000; font-size: 15px; }
.sfv-actions { display: flex; flex-direction: column; gap: 0; padding: 0 0 8px; }
.sfv-button {
    margin: 16px 16px 0;
    border: 0;
    border-radius: 12px;
    padding: 16px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: filter .2s, transform .1s;
}
.sfv-button:active { transform: scale(.99); }
.sfv-button:hover { filter: brightness(1.08); }
.sfv-button:disabled { background: #8e8e93; cursor: default; filter: none; }
.sfv-button.purple { background: linear-gradient(135deg, var(--sfv-navy), var(--sfv-purple)); }
.sfv-button.blue { background: linear-gradient(135deg, var(--sfv-navy), var(--sfv-green)); }
.sfv-sent {
    margin: 16px 16px 0;
    padding: 14px;
    border-radius: 12px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--sfv-navy);
    background: rgba(1, 28, 148, .06);
}
